diff --git a/.changeset/khaki-owls-camp.md b/.changeset/khaki-owls-camp.md
new file mode 100644
index 0000000..c96b4f1
--- /dev/null
+++ b/.changeset/khaki-owls-camp.md
@@ -0,0 +1,5 @@
+---
+'@jeanne-mas/svelte-ui': minor
+---
+
+Added tooltip and separator components
diff --git a/package.json b/package.json
index 890f84a..14a5163 100644
--- a/package.json
+++ b/package.json
@@ -82,6 +82,10 @@
"types": "./dist/components/select/index.d.ts",
"svelte": "./dist/components/select/index.js"
},
+ "./components/separator": {
+ "types": "./dist/components/separator/index.d.ts",
+ "svelte": "./dist/components/separator/index.js"
+ },
"./components/switch": {
"types": "./dist/components/switch/index.d.ts",
"svelte": "./dist/components/switch/index.js"
@@ -90,6 +94,10 @@
"types": "./dist/components/textarea/index.d.ts",
"svelte": "./dist/components/textarea/index.js"
},
+ "./components/tooltip": {
+ "types": "./dist/components/tooltip/index.d.ts",
+ "svelte": "./dist/components/tooltip/index.js"
+ },
"./package.json": "./package.json",
"./transition/flyAndScale": {
"types": "./dist/transition/flyAndScale.d.ts",
@@ -113,11 +121,17 @@
"!dist/**/*.test.*",
"!dist/**/*.spec.*"
],
+ "homepage": "https://github.com/jeannemas/svelte-ui",
"license": "MIT",
"name": "@jeanne-mas/svelte-ui",
"peerDependencies": {
"svelte": "^4.0.0"
},
+ "repository": {
+ "directory": "https://github.com/jeannemas/svelte-ui",
+ "type": "git",
+ "url": "https://github.com/jeannemas/svelte-ui.git"
+ },
"scripts": {
"dev": "vite dev",
"build": "vite build && npm run package",
diff --git a/src/lib/components/input/Input.svelte b/src/lib/components/input/Input.svelte
index 7b7b72e..50192f3 100644
--- a/src/lib/components/input/Input.svelte
+++ b/src/lib/components/input/Input.svelte
@@ -13,7 +13,7 @@
*/
value?: number;
/**
- * The type of the input.
+ * The variant of the input.
*/
variant: 'number';
}
@@ -23,7 +23,7 @@
*/
value?: string;
/**
- * The type of the input.
+ * The variant of the input.
*/
variant: 'text';
};
diff --git a/src/lib/components/separator/Separator.svelte b/src/lib/components/separator/Separator.svelte
new file mode 100644
index 0000000..df1e832
--- /dev/null
+++ b/src/lib/components/separator/Separator.svelte
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/lib/components/separator/index.ts b/src/lib/components/separator/index.ts
new file mode 100644
index 0000000..11fadf0
--- /dev/null
+++ b/src/lib/components/separator/index.ts
@@ -0,0 +1,9 @@
+export {
+ default,
+ defaultOrientation,
+ orientations,
+ type Attributes,
+ type Events,
+ type Props,
+ type Slots,
+} from './Separator.svelte';
diff --git a/src/lib/components/tooltip/Content.svelte b/src/lib/components/tooltip/Content.svelte
new file mode 100644
index 0000000..f91a71a
--- /dev/null
+++ b/src/lib/components/tooltip/Content.svelte
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/lib/components/tooltip/Root.svelte b/src/lib/components/tooltip/Root.svelte
new file mode 100644
index 0000000..ff2e6fc
--- /dev/null
+++ b/src/lib/components/tooltip/Root.svelte
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/lib/components/tooltip/Trigger.svelte b/src/lib/components/tooltip/Trigger.svelte
new file mode 100644
index 0000000..08a616e
--- /dev/null
+++ b/src/lib/components/tooltip/Trigger.svelte
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/lib/components/tooltip/index.ts b/src/lib/components/tooltip/index.ts
new file mode 100644
index 0000000..16cde2b
--- /dev/null
+++ b/src/lib/components/tooltip/index.ts
@@ -0,0 +1,21 @@
+export {
+ default as Content,
+ type Attributes as ContentAttributes,
+ type Events as ContentEvents,
+ type Props as ContentProps,
+ type Slots as ContentSlots,
+} from './Content.svelte';
+export {
+ default as Root,
+ type Attributes as RootAttributes,
+ type Events as RootEvents,
+ type Props as RootProps,
+ type Slots as RootSlots,
+} from './Root.svelte';
+export {
+ default as Trigger,
+ type Attributes as TriggerAttributes,
+ type Events as TriggerEvents,
+ type Props as TriggerProps,
+ type Slots as TriggerSlots,
+} from './Trigger.svelte';
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index acc9fd7..5c58813 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -11,13 +11,7 @@
@@ -40,19 +47,113 @@
-->
-
+ Disabled
-
+
+
+
+
+ Whether the calendar is disabled. When true, the user will not be able to focus or select
+ dates.
+
+
+
+
+
+
+
+ Fixed weeks
+
+
+
+
+
+ Display 6 weeks per month, regardless the month's number of weeks. This is useful for
+ displaying a consistent calendar, where the size of the calendar doesn't change month to
+ month.
+
+
+
+
+
+
+
+ Number of months
+
+
- Whether the calendar is disabled.
+
+ Determines the number of months to display on the calendar simultaneously.
+
-
+
+
+ Paged navigation
+
+
+
+
+
+
Applicable only when numberOfMonths is greater than 1.
+
+
+ Controls whether to use paged navigation for the next and previous buttons in the date
+ picker. With paged navigation set to true, clicking the next/prev buttons changes all months
+ in view. When set to false, it shifts the view by a single month.
+
+
+
+ For example, with pagedNavigation set to true and 2 months displayed (January and February),
+ clicking the next button changes the view to March and April. If pagedNavigation is false,
+ the view shifts to February and March.
+
+
+
+
+
+
+
+
+ Prevent deselect
+
+
+
+
+
+ Prevent deselecting the selected date(s), which would set the value to undefined. You can use
+ this to ensure a date is always selected in certain situations.
+
+
+
+
+
+
+
+ Readonly
+
+
+
+
+
+ Whether the calendar is readonly. When true, the user will be able to focus and navigate the
+ calendar, but will not be able to select dates.
+
+
+
+
+
+ Week starts on
@@ -72,7 +173,7 @@
}
: undefined}"
>
-
+
@@ -88,12 +189,15 @@
- The index of the first day of the week.
+
+ The day of the week to start the calendar on, which must be a number between 0 and 6, where 0
+ is Sunday and 6 is Saturday.
+
-
+ Weekday format
@@ -113,7 +217,7 @@
}
: undefined}"
>
-
+
@@ -129,12 +233,33 @@
- The format of the weekdays.
+
+ How the string representation of the weekdays provided via the weekdays state store should be
+ formatted.
+
+
+
"long": "Sunday", "Monday", "Tuesday", etc.
+
+
"short": "Sun", "Mon", "Tue", etc.
+
+
"narrow": "S", "M", "T", etc.
+
+
-
+
-
+
diff --git a/src/routes/collapsible/+page.svelte b/src/routes/collapsible/+page.svelte
index 4f2a896..b9f9c45 100644
--- a/src/routes/collapsible/+page.svelte
+++ b/src/routes/collapsible/+page.svelte
@@ -1,19 +1,67 @@
-
+
+
+
+ Disabled
+
+
+
+
+
+ Whether the collapsible is disabled which prevents it from being opened.
+
+
+
+
+
+
+
+ Open
+
+
+
+
+ The open state of the collapsible.
+
+
+
+
+
+
+
+
diff --git a/src/routes/container/+page.svelte b/src/routes/container/+page.svelte
index c6f8f46..fd9f707 100644
--- a/src/routes/container/+page.svelte
+++ b/src/routes/container/+page.svelte
@@ -5,6 +5,7 @@
import Container from '$lib/components/container/index.js';
import * as Form from '$lib/components/form/index.js';
+ import Separator from '$lib/components/separator/index.js';
import Switch from '$lib/components/switch/index.js';
const adapter = zod(
@@ -27,32 +28,32 @@
-->
-
+ X axis
-
+
- Whether the x-axis is enabled.
+ Whether to add horizontal padding.
-
+ Y axis
-
+
- Whether the y-axis is enabled.
+ Whether to add vertical padding.
-
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Non beatae, cupiditate unde cumque facere
@@ -60,7 +61,11 @@
Aliquid autem dolorem magni.
-
+
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Aperiam sapiente nisi omnis temporibus
veritatis nihil eligendi impedit similique quo, neque sequi voluptate, ipsum optio odit repellat
ipsam quidem delectus libero.
diff --git a/src/routes/form/+page.svelte b/src/routes/form/+page.svelte
index f799f10..e87a317 100644
--- a/src/routes/form/+page.svelte
+++ b/src/routes/form/+page.svelte
@@ -5,8 +5,15 @@
import * as Form from '$lib/components/form/index.js';
import Input from '$lib/components/input/index.js';
+ import Separator from '$lib/components/separator/index.js';
+ import Switch from '$lib/components/switch/index.js';
- const adapter = zod(
+ const adapter1 = zod(
+ z.object({
+ debug: z.boolean().default(false).optional(),
+ }),
+ );
+ const adapter2 = zod(
z.object({
username: z.string().min(2).max(50),
}),
@@ -14,22 +21,45 @@
-
-
+
+
+
+ Debug
+
+
+
+
+
+ Whether to display the form state in a debug panel underneath the form.
+
+
+
+
+
+
+
+
+
+ Placeholder
-
+
This is your public display name.
diff --git a/src/routes/input/+page.svelte b/src/routes/input/+page.svelte
index 75672eb..74f0751 100644
--- a/src/routes/input/+page.svelte
+++ b/src/routes/input/+page.svelte
@@ -6,6 +6,7 @@
import * as Form from '$lib/components/form/index.js';
import Input, { variants } from '$lib/components/input/index.js';
import * as Select from '$lib/components/select/index.js';
+ import Separator from '$lib/components/separator/index.js';
import Switch from '$lib/components/switch/index.js';
const adapter = zod(
@@ -29,11 +30,11 @@
-->
-
+ Disabled
-
+ Whether the input is disabled.
@@ -41,11 +42,11 @@
-
+ Placeholder
-
+
The input placeholder.
@@ -53,7 +54,7 @@
-
+ Variant
@@ -73,7 +74,7 @@
}
: undefined}"
>
-
+
@@ -95,6 +96,10 @@
-
+
-
+
diff --git a/src/routes/label/+page.svelte b/src/routes/label/+page.svelte
index 58db907..5216647 100644
--- a/src/routes/label/+page.svelte
+++ b/src/routes/label/+page.svelte
@@ -1,5 +1,6 @@
-
+
+
+
+ Close on escape
+
+
+
+
+
+ Whether or not to close the popover when the escape key is pressed.
+
+
+
+
+
+
+
+ Close on outside click
+
+
+
+
+
+ Whether or not to close the popover when the escape key is pressed.
+
+
+
+
+
+
+
+ Disable focus trap
+
+
+
+
+
+ Whether or not to disable the focus trap when the popover is open.
+
+
+
+
+
+
+
+ Open
+
+
+
+
+ The open state of the popover.
+
+
+
+
+
+
+ Prevent scroll
+
+
+
+
+
+ Whether or not to prevent scrolling when the popover is open.
+
+
+
+
+
+
+
+
+
diff --git a/src/routes/select/+page.svelte b/src/routes/select/+page.svelte
index f0a8ab8..6e27270 100644
--- a/src/routes/select/+page.svelte
+++ b/src/routes/select/+page.svelte
@@ -1,61 +1,151 @@
-
+
+
+
+ Close on escape
+
+
+
+
+
+ Whether or not to close the listbox menu when the user presses the escape key.
+
+
+
+
+
+
+
+ Close on outside click
+
+
+
+
+
+ Whether or not to close the listbox menu when the user clicks outside of the listbox.
+
+
+
+
+
+
+
+ Disabled
+
+
+
+
+ Whether the select is disabled.
+
+
+
+
+
+
+ Loop
+
+
+
+
+
+ Whether or not the listbox should loop through the list when the end or beginning is reached.
+
+
+
+
+
+
+
+ Open
+
+
+
+
+ The open state of the select menu.
+
+
+
+
+
+
+ Prevent scroll
+
+
+
+
+
+ Whether or not to prevent scrolling the page when the listbox menu is open.
+
+
+
+
+
+
+
-
+
- {#each fruitKeys as fruitKey, index (index)}
-
- {fruitKey}
+ {#each fruits as fruit, index (index)}
+
+ {fruit}
{/each}
diff --git a/src/routes/separator/+page.svelte b/src/routes/separator/+page.svelte
new file mode 100644
index 0000000..185fd1d
--- /dev/null
+++ b/src/routes/separator/+page.svelte
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+ Orientation
+
+
+
+
+
+
+
+
+
+ {#each orientations as orientation, index (index)}
+
+ {orientation}
+
+ {/each}
+
+
+
+
+ The orientation of the separator.
+
+
+
+
+
+
+
+