diff --git a/.changeset/plenty-frogs-decide.md b/.changeset/plenty-frogs-decide.md new file mode 100644 index 0000000..4b8309f --- /dev/null +++ b/.changeset/plenty-frogs-decide.md @@ -0,0 +1,5 @@ +--- +'@jeanne-mas/svelte-ui': patch +--- + +Added combobox, accordion and checkbox components diff --git a/package.json b/package.json index 783adcb..e3610dd 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "dependencies": { "@internationalized/date": "^3.5.2", "@melt-ui/svelte": "^0.76.2", - "bits-ui": "^0.21.7", + "bits-ui": "^0.21.8", "clsx": "^2.1.0", "cmdk-sv": "^0.0.17", "formsnap": "^1.0.0", @@ -52,6 +52,10 @@ "vitest": "^1.2.0" }, "exports": { + "./components/accordion": { + "types": "./dist/components/accordion/index.d.ts", + "svelte": "./dist/components/accordion/index.js" + }, "./components/alert": { "types": "./dist/components/alert/index.d.ts", "svelte": "./dist/components/alert/index.js" @@ -76,10 +80,18 @@ "types": "./dist/components/card/index.d.ts", "svelte": "./dist/components/card/index.js" }, + "./components/checkbox": { + "types": "./dist/components/checkbox/index.d.ts", + "svelte": "./dist/components/checkbox/index.js" + }, "./components/collapsible": { "types": "./dist/components/collapsible/index.d.ts", "svelte": "./dist/components/collapsible/index.js" }, + "./components/combobox": { + "types": "./dist/components/combobox/index.d.ts", + "svelte": "./dist/components/combobox/index.js" + }, "./components/command": { "types": "./dist/components/command/index.d.ts", "svelte": "./dist/components/command/index.js" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d7ebe80..edf5d17 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^0.76.2 version: 0.76.2(svelte@4.2.12) bits-ui: - specifier: ^0.21.7 - version: 0.21.7(svelte@4.2.12) + specifier: ^0.21.8 + version: 0.21.8(svelte@4.2.12) clsx: specifier: ^2.1.0 version: 2.1.0 @@ -850,8 +850,8 @@ packages: peerDependencies: svelte: ^4.0.0 - bits-ui@0.21.7: - resolution: {integrity: sha512-1PKp90ly1R6jexIiAUj1Dk4u2pln7ok+L8Vc0rHMY7pi7YZvadFNZvkp1G5BtmL8qh2xsn4MVNgKjPAQMCxW0A==} + bits-ui@0.21.8: + resolution: {integrity: sha512-fr++Gf//41w9/Td5r1SfaeA/XXv5YEOw3LFY7JVH+eAbi7RzNqf7Xy8BS/W8HXfRqlsu1ReFgZ7ZZ4DbrP4HwQ==} peerDependencies: svelte: ^4.0.0 || ^5.0.0-next.118 @@ -3659,7 +3659,7 @@ snapshots: nanoid: 5.0.7 svelte: 4.2.12 - bits-ui@0.21.7(svelte@4.2.12): + bits-ui@0.21.8(svelte@4.2.12): dependencies: '@internationalized/date': 3.5.2 '@melt-ui/svelte': 0.76.2(svelte@4.2.12) diff --git a/src/lib/components/accordion/AccordionContent.svelte b/src/lib/components/accordion/AccordionContent.svelte new file mode 100644 index 0000000..8eac23d --- /dev/null +++ b/src/lib/components/accordion/AccordionContent.svelte @@ -0,0 +1,99 @@ + + + + + + + + + diff --git a/src/lib/components/accordion/AccordionItem.svelte b/src/lib/components/accordion/AccordionItem.svelte new file mode 100644 index 0000000..bc2a3ad --- /dev/null +++ b/src/lib/components/accordion/AccordionItem.svelte @@ -0,0 +1,59 @@ + + + + + + + + + diff --git a/src/lib/components/accordion/AccordionRoot.svelte b/src/lib/components/accordion/AccordionRoot.svelte new file mode 100644 index 0000000..5d16fa7 --- /dev/null +++ b/src/lib/components/accordion/AccordionRoot.svelte @@ -0,0 +1,69 @@ + + + + + + + + + diff --git a/src/lib/components/accordion/AccordionTrigger.svelte b/src/lib/components/accordion/AccordionTrigger.svelte new file mode 100644 index 0000000..ba0fa45 --- /dev/null +++ b/src/lib/components/accordion/AccordionTrigger.svelte @@ -0,0 +1,73 @@ + + + + + + + + + + + + + diff --git a/src/lib/components/accordion/index.ts b/src/lib/components/accordion/index.ts new file mode 100644 index 0000000..ca42fc4 --- /dev/null +++ b/src/lib/components/accordion/index.ts @@ -0,0 +1,28 @@ +export { + default as Content, + styles as contentStyles, + type Attributes as ContentAttributes, + type Props as ContentProps, + type Slots as ContentSlots, +} from './AccordionContent.svelte'; +export { + default as Item, + styles as itemStyles, + type Attributes as ItemAttributes, + type Props as ItemProps, + type Slots as ItemSlots, +} from './AccordionItem.svelte'; +export { + default as Root, + styles as rootStyles, + type Attributes as RootAttributes, + type Props as RootProps, + type Slots as RootSlots, +} from './AccordionRoot.svelte'; +export { + default as Trigger, + styles as triggerStyles, + type Attributes as TriggerAttributes, + type Props as TriggerProps, + type Slots as TriggerSlots, +} from './AccordionTrigger.svelte'; diff --git a/src/lib/components/alert-dialog/AlertDialogAction.svelte b/src/lib/components/alert-dialog/AlertDialogAction.svelte index a7d55d4..43d5f1d 100644 --- a/src/lib/components/alert-dialog/AlertDialogAction.svelte +++ b/src/lib/components/alert-dialog/AlertDialogAction.svelte @@ -46,7 +46,13 @@ * The styles of the action. */ export const styles = tv({ - ...buttonStyles, + base: [...buttonStyles.base], + defaultVariants: { + ...buttonStyles.defaultVariants, + }, + variants: { + ...buttonStyles.variants, + }, }); /** * The default size of the action. diff --git a/src/lib/components/alert-dialog/AlertDialogCancel.svelte b/src/lib/components/alert-dialog/AlertDialogCancel.svelte index e076cda..aad46c9 100644 --- a/src/lib/components/alert-dialog/AlertDialogCancel.svelte +++ b/src/lib/components/alert-dialog/AlertDialogCancel.svelte @@ -46,11 +46,14 @@ * The styles of the cancel. */ export const styles = tv({ - ...buttonStyles, + base: [...buttonStyles.base], defaultVariants: { ...buttonStyles.defaultVariants, variant: 'outline', }, + variants: { + ...buttonStyles.variants, + }, }); /** * The default size of the cancel. diff --git a/src/lib/components/breadcrumb/BreadcrumbEllipsis.svelte b/src/lib/components/breadcrumb/BreadcrumbEllipsis.svelte index b5980c9..7ea3206 100644 --- a/src/lib/components/breadcrumb/BreadcrumbEllipsis.svelte +++ b/src/lib/components/breadcrumb/BreadcrumbEllipsis.svelte @@ -1,5 +1,5 @@ + + + + + + + + + {#if isChecked} + + {:else if isIndeterminate} + + {/if} + + + diff --git a/src/lib/components/checkbox/index.ts b/src/lib/components/checkbox/index.ts new file mode 100644 index 0000000..f59b0cb --- /dev/null +++ b/src/lib/components/checkbox/index.ts @@ -0,0 +1 @@ +export { default, styles, type Attributes, type Props, type Slots } from './Checkbox.svelte'; diff --git a/src/lib/components/combobox/ComboboxContent.svelte b/src/lib/components/combobox/ComboboxContent.svelte new file mode 100644 index 0000000..37a4552 --- /dev/null +++ b/src/lib/components/combobox/ComboboxContent.svelte @@ -0,0 +1,122 @@ + + + + + + + + + diff --git a/src/lib/components/combobox/ComboboxGroup.svelte b/src/lib/components/combobox/ComboboxGroup.svelte new file mode 100644 index 0000000..bd4d110 --- /dev/null +++ b/src/lib/components/combobox/ComboboxGroup.svelte @@ -0,0 +1,56 @@ + + + + + + + + + diff --git a/src/lib/components/combobox/ComboboxGroupLabel.svelte b/src/lib/components/combobox/ComboboxGroupLabel.svelte new file mode 100644 index 0000000..80e81eb --- /dev/null +++ b/src/lib/components/combobox/ComboboxGroupLabel.svelte @@ -0,0 +1,57 @@ + + + + + + + + + diff --git a/src/lib/components/combobox/ComboboxHiddenInput.svelte b/src/lib/components/combobox/ComboboxHiddenInput.svelte new file mode 100644 index 0000000..a2f26b2 --- /dev/null +++ b/src/lib/components/combobox/ComboboxHiddenInput.svelte @@ -0,0 +1,57 @@ + + + + + + + + + diff --git a/src/lib/components/combobox/ComboboxInput.svelte b/src/lib/components/combobox/ComboboxInput.svelte new file mode 100644 index 0000000..751bb86 --- /dev/null +++ b/src/lib/components/combobox/ComboboxInput.svelte @@ -0,0 +1,62 @@ + + + + + + + + + diff --git a/src/lib/components/combobox/ComboboxItem.svelte b/src/lib/components/combobox/ComboboxItem.svelte new file mode 100644 index 0000000..529065f --- /dev/null +++ b/src/lib/components/combobox/ComboboxItem.svelte @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + {label || value} + + diff --git a/src/lib/components/combobox/ComboboxLabel.svelte b/src/lib/components/combobox/ComboboxLabel.svelte new file mode 100644 index 0000000..abd0816 --- /dev/null +++ b/src/lib/components/combobox/ComboboxLabel.svelte @@ -0,0 +1,55 @@ + + + + + + + + + diff --git a/src/lib/components/combobox/ComboboxRoot.svelte b/src/lib/components/combobox/ComboboxRoot.svelte new file mode 100644 index 0000000..c787545 --- /dev/null +++ b/src/lib/components/combobox/ComboboxRoot.svelte @@ -0,0 +1,81 @@ + + + + + + + + + diff --git a/src/lib/components/combobox/index.ts b/src/lib/components/combobox/index.ts new file mode 100644 index 0000000..340a111 --- /dev/null +++ b/src/lib/components/combobox/index.ts @@ -0,0 +1,55 @@ +export { + default as Content, + styles as contentStyles, + type Attributes as ContentAttributes, + type Props as ContentProps, + type Slots as ContentSlots, +} from './ComboboxContent.svelte'; +export { + default as Group, + styles as groupStyles, + type Attributes as GroupAttributes, + type Props as GroupProps, + type Slots as GroupSlots, +} from './ComboboxGroup.svelte'; +export { + default as GroupLabel, + styles as groupLabelStyles, + type Attributes as GroupLabelAttributes, + type Props as GroupLabelProps, + type Slots as GroupLabelSlots, +} from './ComboboxGroupLabel.svelte'; +export { + default as HiddenInput, + styles as hiddenInputStyles, + type Attributes as HiddenInputAttributes, + type Props as HiddenInputProps, + type Slots as HiddenInputSlots, +} from './ComboboxHiddenInput.svelte'; +export { + default as Input, + styles as inputStyles, + type Attributes as InputAttributes, + type Props as InputProps, + type Slots as InputSlots, +} from './ComboboxInput.svelte'; +export { + default as Item, + styles as itemStyles, + type Attributes as ItemAttributes, + type Props as ItemProps, + type Slots as ItemSlots, +} from './ComboboxItem.svelte'; +export { + default as Label, + styles as labelStyles, + type Attributes as LabelAttributes, + type Props as LabelProps, + type Slots as LabelSlots, +} from './ComboboxLabel.svelte'; +export { + default as Root, + type Attributes as RootAttributes, + type Props as RootProps, + type Slots as RootSlots, +} from './ComboboxRoot.svelte'; diff --git a/src/lib/components/command/CommandInput.svelte b/src/lib/components/command/CommandInput.svelte index bb01a61..3385d96 100644 --- a/src/lib/components/command/CommandInput.svelte +++ b/src/lib/components/command/CommandInput.svelte @@ -1,6 +1,6 @@ diff --git a/src/lib/components/pagination/PaginationNextButton.svelte b/src/lib/components/pagination/PaginationNextButton.svelte index 78b7ed4..5163c78 100644 --- a/src/lib/components/pagination/PaginationNextButton.svelte +++ b/src/lib/components/pagination/PaginationNextButton.svelte @@ -1,6 +1,6 @@ @@ -122,7 +122,5 @@ on:keydown on:pointerleave > -
- -
+ diff --git a/src/lib/components/select/SelectGroup.svelte b/src/lib/components/select/SelectGroup.svelte index 5573e37..d05928a 100644 --- a/src/lib/components/select/SelectGroup.svelte +++ b/src/lib/components/select/SelectGroup.svelte @@ -24,7 +24,7 @@ * The styles of the group. */ export const styles = tv({ - base: [] as string[], + base: [''], }); diff --git a/src/lib/components/select/SelectInput.svelte b/src/lib/components/select/SelectInput.svelte index a6797e1..d65d9bb 100644 --- a/src/lib/components/select/SelectInput.svelte +++ b/src/lib/components/select/SelectInput.svelte @@ -3,7 +3,6 @@ import type { SvelteHTMLElements } from 'svelte/elements'; import { tv } from 'tailwind-variants'; - import { castAsAny } from '$lib/utils/internal.js'; import type { ComponentInfo } from '$lib/utils/types.js'; type Primitive = ComponentInfo; @@ -52,5 +51,5 @@ el="{el}" let:builder > - + diff --git a/src/lib/components/select/SelectRoot.svelte b/src/lib/components/select/SelectRoot.svelte index 5365acd..e583f02 100644 --- a/src/lib/components/select/SelectRoot.svelte +++ b/src/lib/components/select/SelectRoot.svelte @@ -32,7 +32,13 @@ >['slots']; - + + + + Config + + + + + + Disabled + + + + + + When + + true + + , prevents the user from interacting with the accordion. + + + + + + + + + + Demo + + + + + Is it accessible? + + Yes. It adheres to the WAI-ARIA design pattern. + + + + Is it styled? + + + Yes. It comes with default styles that matches the other components' aesthetic. + + + + + Is it animated? + + + Yes. It's animated by default, but you can disable it if you prefer. + + + + + + diff --git a/src/routes/alert-dialog/+page.svelte b/src/routes/alert-dialog/+page.svelte index c70ef32..ed1db5a 100644 --- a/src/routes/alert-dialog/+page.svelte +++ b/src/routes/alert-dialog/+page.svelte @@ -3,10 +3,10 @@ import { zod } from 'sveltekit-superforms/adapters'; import z from 'zod'; + import * as Accordion from '$lib/components/accordion/index.js'; import * as AlertDialog from '$lib/components/alert-dialog/index.js'; import Button from '$lib/components/button/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( @@ -31,88 +31,100 @@ - - - - Close on escape - - - - - Whether or not to close the alert dialog when the escape key is pressed. - - - - - - - - Close on outside click - - - - - - Whether or not to close the alert dialog when the escape key is pressed. - - - - - - - - Open - - - - - The open state of the alert dialog. - - - - - - - Prevent scroll - - - - - - Whether or not to prevent scrolling when the alert dialog is open. - - - - - - - - - - - - - - - - Are you absolutely sure? - - - This action cannot be undone. This will permanently delete your account and remove your data - from our servers. - - - - - Cancel - - Continue - - - + + + Config + + + + + + Close on escape + + + + + + Whether or not to close the alert dialog when the escape key is pressed. + + + + + + + + Close on outside click + + + + + + Whether or not to close the alert dialog when the escape key is pressed. + + + + + + + + Open + + + + + The open state of the alert dialog. + + + + + + + Prevent scroll + + + + + + Whether or not to prevent scrolling when the alert dialog is open. + + + + + + + + + + Demo + + + + + + + + + + Are you absolutely sure? + + + This action cannot be undone. This will permanently delete your account and remove + your data from our servers. + + + + + Cancel + + Continue + + + + + + diff --git a/src/routes/alert/+page.svelte b/src/routes/alert/+page.svelte index c6fe013..cbd3e06 100644 --- a/src/routes/alert/+page.svelte +++ b/src/routes/alert/+page.svelte @@ -1,13 +1,13 @@ + + + + + + + + Config + + + + + + Checked + + + + + + The state of the checkbox. You can bind this to a boolean value to programmatically + control the checked state. + + + + + + + + Disabled + + + + + + When + + true + + , the checkbox will be disabled. + + + + + + + + + + Demo + + +
+ + + +
+
+
+
diff --git a/src/routes/collapsible/+page.svelte b/src/routes/collapsible/+page.svelte index 57b6cca..7370775 100644 --- a/src/routes/collapsible/+page.svelte +++ b/src/routes/collapsible/+page.svelte @@ -3,10 +3,10 @@ import { zod } from 'sveltekit-superforms/adapters'; import z from 'zod'; + import * as Accordion from '$lib/components/accordion/index.js'; import Button from '$lib/components/button/index.js'; import * as Collapsible from '$lib/components/collapsible/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( @@ -30,46 +30,58 @@ - - - - Disabled + + + Config - - + + + + + Disabled - - Whether the collapsible is disabled which prevents it from being opened. - + + - - + + Whether the collapsible is disabled which prevents it from being opened. + - - - Open + + - - + + + Open - The open state of the collapsible. + + - - - + The open state of the collapsible. - + + + + + - - - - + + Demo - - Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla quo velit facilis illum placeat - numquam consectetur culpa ab laboriosam aliquid! Facere, consequatur ex maiores dolorum aut - commodi quis nostrum impedit? - - + + + + + + + + Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla quo velit facilis illum + placeat numquam consectetur culpa ab laboriosam aliquid! Facere, consequatur ex maiores + dolorum aut commodi quis nostrum impedit? + + + + + diff --git a/src/routes/combobox/+page.svelte b/src/routes/combobox/+page.svelte new file mode 100644 index 0000000..b0232fd --- /dev/null +++ b/src/routes/combobox/+page.svelte @@ -0,0 +1,61 @@ + + + + + + + + + Config + + + + + + + + Demo + + + + + + + {#each filteredFruits as fruit (fruit.value)} + + {fruit.label} + + {:else} +
No results found
+ {/each} +
+ + +
+
+
+
diff --git a/src/routes/command/+page.svelte b/src/routes/command/+page.svelte index c6d1c8b..47304a7 100644 --- a/src/routes/command/+page.svelte +++ b/src/routes/command/+page.svelte @@ -1,18 +1,18 @@ @@ -26,82 +25,97 @@ validators: adapter, }); const { form: superFormData } = superForm; + + function handleSelectedChange(selected: Selected | undefined) { + $superFormData.variant = selected!.value; + } - - - - Disabled - - - - - Whether the input is disabled. - - - - - - - Placeholder - - - - - The input placeholder. - - - - - - - Variant - - - - - - - - - - {#each variants as variant, index (index)} - - {variant} - - {/each} - - - - - The variant of the input. - - - - - - - - + + + Config + + + + + + Disabled + + + + + Whether the input is disabled. + + + + + + + Placeholder + + + + + The input placeholder. + + + + + + + Variant + + + + + + + + + + {#each variants as variant, index (index)} + + {variant} + + {/each} + + + + + The variant of the input. + + + + + + + + + Demo + + + + + + diff --git a/src/routes/label/+page.svelte b/src/routes/label/+page.svelte index 5216647..232f643 100644 --- a/src/routes/label/+page.svelte +++ b/src/routes/label/+page.svelte @@ -1,6 +1,7 @@ @@ -33,126 +31,138 @@ - - - - Count - - - - - The total number of items to be paginated. - - - - - - - Per page - - - - - Number of items per page. - - - - - - - Page - - - - - - The selected page. This updates as the users selects new pages. You can bind this to a value - to programmatically control the value state. - - - - - - - - Sibling count - - - - - Number of visible items before and after the current page. - - - - - - - - - - - - - - - - - - {#each pages as page (page.key)} - {#if page.type === 'ellipsis'} - - - - {:else} - - - {page.value} - - - {/if} - {/each} - - - - - - - - - - + + + Config + + + + + + Count + + + + + The total number of items to be paginated. + + + + + + + Per page + + + + + Number of items per page. + + + + + + + Page + + + + + + The selected page. This updates as the users selects new pages. You can bind this to a + value to programmatically control the value state. + + + + + + + + Sibling count + + + + + Number of visible items before and after the current page. + + + + + + + + + Demo + + + + + + + + + + + + + {#each pages as page (page.key)} + {#if page.type === 'ellipsis'} + + + + {:else} + + + {page.value} + + + {/if} + {/each} + + + + + + + + + + + + + diff --git a/src/routes/popover/+page.svelte b/src/routes/popover/+page.svelte index bf98ea8..d91f846 100644 --- a/src/routes/popover/+page.svelte +++ b/src/routes/popover/+page.svelte @@ -3,12 +3,12 @@ import { zod } from 'sveltekit-superforms/adapters'; import z from 'zod'; + import * as Accordion from '$lib/components/accordion/index.js'; import Button from '$lib/components/button/index.js'; import * as Form from '$lib/components/form/index.js'; import Input from '$lib/components/input/index.js'; import Label from '$lib/components/label/index.js'; import * as Popover from '$lib/components/popover/index.js'; - import Separator from '$lib/components/separator/index.js'; import Switch from '$lib/components/switch/index.js'; const adapter = zod( @@ -35,123 +35,132 @@ - - - - Close on escape + + + Config - - + + + + + Close on escape - - Whether or not to close the popover when the escape key is pressed. - + + - - + + Whether or not to close the popover when the escape key is pressed. + - - - Close on outside click + + - - + + + Close on outside click - - Whether or not to close the popover when the escape key is pressed. - + + - - + + Whether or not to close the popover when the escape key is pressed. + - - - Disable focus trap + + - - + + + Disable focus trap - - Whether or not to disable the focus trap when the popover is open. - + + - - + + Whether or not to disable the focus trap when the popover is open. + - - - Open + + - - + + + Open - The open state of the popover. + + - - + The open state of the popover. - - - Prevent scroll + + - - + + + Prevent scroll - - Whether or not to prevent scrolling when the popover is open. - + + - - - + + Whether or not to prevent scrolling when the popover is open. + - + + + + + - - - - + + Demo - -
-
-

Dimensions

+ + + + + -

Set the dimensions for the layer.

-
+ +
+
+

Dimensions

-
-
- +

Set the dimensions for the layer.

+
- -
+
+
+ -
- + +
- -
+
+ -
- + +
- -
+
+ -
- + +
- -
-
-
- - +
+ + + +
+
+
+
+
+ + + diff --git a/src/routes/select/+page.svelte b/src/routes/select/+page.svelte index 16ec274..15edcbb 100644 --- a/src/routes/select/+page.svelte +++ b/src/routes/select/+page.svelte @@ -4,9 +4,9 @@ import { zod } from 'sveltekit-superforms/adapters'; import z from 'zod'; + import * as Accordion from '$lib/components/accordion/index.js'; import * as Form from '$lib/components/form/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( @@ -37,118 +37,131 @@ - - - - Close on escape + + + Config - - + + + + + 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 fruits as fruit, index (index)} - - {fruit} - - {/each} - - + + 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. + + + + + + + + + + Demo + + + + + + + + + + + {#each fruits as fruit, index (index)} + + {fruit} + + {/each} + + + + + diff --git a/src/routes/separator/+page.svelte b/src/routes/separator/+page.svelte index 580c6aa..2f2bb98 100644 --- a/src/routes/separator/+page.svelte +++ b/src/routes/separator/+page.svelte @@ -3,6 +3,7 @@ import { zod } from 'sveltekit-superforms/adapters'; import z from 'zod'; + import * as Accordion from '$lib/components/accordion/index.js'; import * as Form from '$lib/components/form/index.js'; import * as Select from '$lib/components/select/index.js'; import Separator, { defaultOrientation, orientations } from '$lib/components/separator/index.js'; @@ -27,63 +28,76 @@ - - - - Orientation - - + + Config + + + + + + Orientation + + + + + + + + + + {#each orientations as orientation, index (index)} + + {orientation} + + {/each} + + + + + The orientation of the separator. + + + + + + + + + Demo + + +
- +
Foo
- - - + - - {#each orientations as orientation, index (index)} - - {orientation} - - {/each} - - - +
Bar
- The orientation of the separator. + - - - - - - -
-
Foo
- - - -
Bar
- - - -
Baz
-
+
Baz
+
+
+
+ diff --git a/src/routes/sonner/+page.svelte b/src/routes/sonner/+page.svelte index 9d4f627..d6ff603 100644 --- a/src/routes/sonner/+page.svelte +++ b/src/routes/sonner/+page.svelte @@ -4,11 +4,11 @@ import { zod } from 'sveltekit-superforms/adapters'; import z from 'zod'; + import * as Accordion from '$lib/components/accordion/index.js'; import Button from '$lib/components/button/index.js'; import * as Form from '$lib/components/form/index.js'; import Input from '$lib/components/input/index.js'; import * as Select from '$lib/components/select/index.js'; - import Separator from '$lib/components/separator/index.js'; import Sonner, { defaultDir, defaultPosition, @@ -49,285 +49,285 @@ - - - - Close button - - - - - Adds a close button to all toasts, shows on hover. - - - - - - - Direction - - + + Config + + + + + + Close button + + + + + Adds a close button to all toasts, shows on hover. + + + + + + + Direction + + + + + + + + + + {#each dirs as dir, index (index)} + + {dir} + + {/each} + + + + + Directionality of toast's text. + + + + + + + Duration + + + + + The duration of the toast in milliseconds. + + + + + + + Expand + + + + + Toasts will be expanded by default. + + + + + + + Gap + + + + + Gap between toasts when expanded, in pixels. + + + + + + + Invert + + + + + Dark toasts in light mode and vice versa. + + + + + + + Offset + + + + + Offset from the edges of the screen. + + + + + + + Position + + + + + + + + + + {#each positions as position, index (index)} + + {position} + + {/each} + + + + + Directionality of toast's text. + + + + + + + Rich colors + + + + + Makes error and success state more colorful. + + + + + + + Theme + + + + + + + + + + {#each themes as theme, index (index)} + + {theme} + + {/each} + + + + + Toast's theme, either light, dark, or system. + + + + + + + Visible toasts + + + + + Amount of visible toasts. + + + + + + + + + Demo + + + - - - - + Show Toast + + + + + + diff --git a/src/routes/switch/+page.svelte b/src/routes/switch/+page.svelte index 0664062..60acea2 100644 --- a/src/routes/switch/+page.svelte +++ b/src/routes/switch/+page.svelte @@ -3,8 +3,8 @@ import { zod } from 'sveltekit-superforms/adapters'; import z from 'zod'; + import * as Accordion from '$lib/components/accordion/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( @@ -28,34 +28,46 @@ - - - - Checked + + + Config - - + + + + + Checked - The checked state of the switch. + + - - + The checked state of the switch. - - - Disabled + + - - + + + Disabled - - When true, prevents the user from interacting with the switch. - + + - - - + + When true, prevents the user from interacting with the switch. + - + +
+
+ + - + + Demo + + + + + + diff --git a/src/routes/table/+page.svelte b/src/routes/table/+page.svelte index b78ffe4..607ab47 100644 --- a/src/routes/table/+page.svelte +++ b/src/routes/table/+page.svelte @@ -1,5 +1,5 @@ - - - - Disabled + + + Config + + + + + + Disabled + + + + + Whether the textarea is disabled. + + + + + + + Placeholder + +