svelora 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +145 -0
- package/dist/Accordion/Accordion.svelte +207 -0
- package/dist/Accordion/Accordion.svelte.d.ts +6 -0
- package/dist/Accordion/accordion.types.d.ts +225 -0
- package/dist/Accordion/accordion.types.js +1 -0
- package/dist/Accordion/accordion.variants.d.ts +88 -0
- package/dist/Accordion/accordion.variants.js +28 -0
- package/dist/Accordion/index.d.ts +2 -0
- package/dist/Accordion/index.js +1 -0
- package/dist/Alert/Alert.svelte +131 -0
- package/dist/Alert/Alert.svelte.d.ts +5 -0
- package/dist/Alert/alert.types.d.ts +103 -0
- package/dist/Alert/alert.types.js +1 -0
- package/dist/Alert/alert.variants.d.ts +213 -0
- package/dist/Alert/alert.variants.js +293 -0
- package/dist/Alert/index.d.ts +2 -0
- package/dist/Alert/index.js +1 -0
- package/dist/Avatar/Avatar.svelte +114 -0
- package/dist/Avatar/Avatar.svelte.d.ts +6 -0
- package/dist/Avatar/avatar.types.d.ts +73 -0
- package/dist/Avatar/avatar.types.js +1 -0
- package/dist/Avatar/avatar.variants.d.ts +316 -0
- package/dist/Avatar/avatar.variants.js +39 -0
- package/dist/Avatar/index.d.ts +2 -0
- package/dist/Avatar/index.js +1 -0
- package/dist/AvatarGroup/AvatarGroup.svelte +71 -0
- package/dist/AvatarGroup/AvatarGroup.svelte.d.ts +5 -0
- package/dist/AvatarGroup/avatar-group.types.d.ts +49 -0
- package/dist/AvatarGroup/avatar-group.types.js +1 -0
- package/dist/AvatarGroup/avatar-group.variants.d.ts +258 -0
- package/dist/AvatarGroup/avatar-group.variants.js +35 -0
- package/dist/AvatarGroup/index.d.ts +2 -0
- package/dist/AvatarGroup/index.js +1 -0
- package/dist/Badge/Badge.svelte +79 -0
- package/dist/Badge/Badge.svelte.d.ts +5 -0
- package/dist/Badge/badge.types.d.ts +83 -0
- package/dist/Badge/badge.types.js +1 -0
- package/dist/Badge/badge.variants.d.ts +303 -0
- package/dist/Badge/badge.variants.js +259 -0
- package/dist/Badge/index.d.ts +2 -0
- package/dist/Badge/index.js +1 -0
- package/dist/Banner/Banner.svelte +130 -0
- package/dist/Banner/Banner.svelte.d.ts +5 -0
- package/dist/Banner/banner.types.d.ts +148 -0
- package/dist/Banner/banner.types.js +1 -0
- package/dist/Banner/banner.variants.d.ts +293 -0
- package/dist/Banner/banner.variants.js +86 -0
- package/dist/Banner/index.d.ts +2 -0
- package/dist/Banner/index.js +1 -0
- package/dist/Breadcrumb/Breadcrumb.svelte +79 -0
- package/dist/Breadcrumb/Breadcrumb.svelte.d.ts +5 -0
- package/dist/Breadcrumb/breadcrumb.types.d.ts +66 -0
- package/dist/Breadcrumb/breadcrumb.types.js +1 -0
- package/dist/Breadcrumb/breadcrumb.variants.d.ts +138 -0
- package/dist/Breadcrumb/breadcrumb.variants.js +53 -0
- package/dist/Breadcrumb/index.d.ts +2 -0
- package/dist/Breadcrumb/index.js +1 -0
- package/dist/Button/Button.svelte +177 -0
- package/dist/Button/Button.svelte.d.ts +5 -0
- package/dist/Button/button.types.d.ts +151 -0
- package/dist/Button/button.types.js +1 -0
- package/dist/Button/button.variants.d.ts +388 -0
- package/dist/Button/button.variants.js +461 -0
- package/dist/Button/index.d.ts +2 -0
- package/dist/Button/index.js +1 -0
- package/dist/Calendar/Calendar.svelte +344 -0
- package/dist/Calendar/Calendar.svelte.d.ts +6 -0
- package/dist/Calendar/calendar.types.d.ts +122 -0
- package/dist/Calendar/calendar.types.js +1 -0
- package/dist/Calendar/calendar.variants.d.ts +553 -0
- package/dist/Calendar/calendar.variants.js +368 -0
- package/dist/Calendar/index.d.ts +2 -0
- package/dist/Calendar/index.js +1 -0
- package/dist/Card/Card.svelte +54 -0
- package/dist/Card/Card.svelte.d.ts +5 -0
- package/dist/Card/card.types.d.ts +36 -0
- package/dist/Card/card.types.js +1 -0
- package/dist/Card/card.variants.d.ts +108 -0
- package/dist/Card/card.variants.js +32 -0
- package/dist/Card/index.d.ts +2 -0
- package/dist/Card/index.js +1 -0
- package/dist/Carousel/Carousel.svelte +277 -0
- package/dist/Carousel/Carousel.svelte.d.ts +26 -0
- package/dist/Carousel/carousel.types.d.ts +251 -0
- package/dist/Carousel/carousel.types.js +1 -0
- package/dist/Carousel/carousel.variants.d.ts +408 -0
- package/dist/Carousel/carousel.variants.js +88 -0
- package/dist/Carousel/index.d.ts +2 -0
- package/dist/Carousel/index.js +1 -0
- package/dist/Checkbox/Checkbox.svelte +161 -0
- package/dist/Checkbox/Checkbox.svelte.d.ts +6 -0
- package/dist/Checkbox/checkbox.types.d.ts +101 -0
- package/dist/Checkbox/checkbox.types.js +1 -0
- package/dist/Checkbox/checkbox.variants.d.ts +448 -0
- package/dist/Checkbox/checkbox.variants.js +209 -0
- package/dist/Checkbox/index.d.ts +2 -0
- package/dist/Checkbox/index.js +1 -0
- package/dist/CheckboxGroup/CheckboxGroup.svelte +219 -0
- package/dist/CheckboxGroup/CheckboxGroup.svelte.d.ts +5 -0
- package/dist/CheckboxGroup/checkbox-group.types.d.ts +130 -0
- package/dist/CheckboxGroup/checkbox-group.types.js +1 -0
- package/dist/CheckboxGroup/checkbox-group.variants.d.ts +553 -0
- package/dist/CheckboxGroup/checkbox-group.variants.js +231 -0
- package/dist/CheckboxGroup/index.d.ts +2 -0
- package/dist/CheckboxGroup/index.js +1 -0
- package/dist/Chip/Chip.svelte +51 -0
- package/dist/Chip/Chip.svelte.d.ts +5 -0
- package/dist/Chip/chip.types.d.ts +66 -0
- package/dist/Chip/chip.types.js +1 -0
- package/dist/Chip/chip.variants.d.ts +418 -0
- package/dist/Chip/chip.variants.js +74 -0
- package/dist/Chip/index.d.ts +2 -0
- package/dist/Chip/index.js +1 -0
- package/dist/Collapsible/Collapsible.svelte +69 -0
- package/dist/Collapsible/Collapsible.svelte.d.ts +6 -0
- package/dist/Collapsible/CollapsibleTestWrapper.svelte +17 -0
- package/dist/Collapsible/CollapsibleTestWrapper.svelte.d.ts +4 -0
- package/dist/Collapsible/collapsible.types.d.ts +77 -0
- package/dist/Collapsible/collapsible.types.js +1 -0
- package/dist/Collapsible/collapsible.variants.d.ts +53 -0
- package/dist/Collapsible/collapsible.variants.js +21 -0
- package/dist/Collapsible/index.d.ts +2 -0
- package/dist/Collapsible/index.js +1 -0
- package/dist/Command/Command.svelte +183 -0
- package/dist/Command/Command.svelte.d.ts +6 -0
- package/dist/Command/CommandTestWrapper.svelte +13 -0
- package/dist/Command/CommandTestWrapper.svelte.d.ts +4 -0
- package/dist/Command/command.types.d.ts +100 -0
- package/dist/Command/command.types.js +1 -0
- package/dist/Command/command.variants.d.ts +226 -0
- package/dist/Command/command.variants.js +86 -0
- package/dist/Command/index.d.ts +2 -0
- package/dist/Command/index.js +1 -0
- package/dist/Container/Container.svelte +21 -0
- package/dist/Container/Container.svelte.d.ts +5 -0
- package/dist/Container/container.types.d.ts +19 -0
- package/dist/Container/container.types.js +1 -0
- package/dist/Container/container.variants.d.ts +29 -0
- package/dist/Container/container.variants.js +9 -0
- package/dist/Container/index.d.ts +2 -0
- package/dist/Container/index.js +1 -0
- package/dist/ContextMenu/ContextMenu.svelte +344 -0
- package/dist/ContextMenu/ContextMenu.svelte.d.ts +6 -0
- package/dist/ContextMenu/context-menu.types.d.ts +265 -0
- package/dist/ContextMenu/context-menu.types.js +1 -0
- package/dist/ContextMenu/context-menu.variants.d.ts +307 -0
- package/dist/ContextMenu/context-menu.variants.js +144 -0
- package/dist/ContextMenu/index.d.ts +2 -0
- package/dist/ContextMenu/index.js +1 -0
- package/dist/Drawer/Drawer.svelte +207 -0
- package/dist/Drawer/Drawer.svelte.d.ts +6 -0
- package/dist/Drawer/DrawerTriggerTestWrapper.svelte +10 -0
- package/dist/Drawer/DrawerTriggerTestWrapper.svelte.d.ts +18 -0
- package/dist/Drawer/drawer.types.d.ts +116 -0
- package/dist/Drawer/drawer.types.js +1 -0
- package/dist/Drawer/drawer.variants.d.ts +193 -0
- package/dist/Drawer/drawer.variants.js +139 -0
- package/dist/Drawer/index.d.ts +2 -0
- package/dist/Drawer/index.js +1 -0
- package/dist/DropdownMenu/DropdownMenu.svelte +363 -0
- package/dist/DropdownMenu/DropdownMenu.svelte.d.ts +6 -0
- package/dist/DropdownMenu/DropdownMenuTriggerTestWrapper.svelte +12 -0
- package/dist/DropdownMenu/DropdownMenuTriggerTestWrapper.svelte.d.ts +7 -0
- package/dist/DropdownMenu/dropdown-menu.types.d.ts +279 -0
- package/dist/DropdownMenu/dropdown-menu.types.js +1 -0
- package/dist/DropdownMenu/dropdown-menu.variants.d.ts +312 -0
- package/dist/DropdownMenu/dropdown-menu.variants.js +149 -0
- package/dist/DropdownMenu/index.d.ts +2 -0
- package/dist/DropdownMenu/index.js +1 -0
- package/dist/Editor/Editor.svelte +756 -0
- package/dist/Editor/Editor.svelte.d.ts +6 -0
- package/dist/Editor/EditorUrlPrompt.svelte +94 -0
- package/dist/Editor/EditorUrlPrompt.svelte.d.ts +15 -0
- package/dist/Editor/SlashPopup.svelte +74 -0
- package/dist/Editor/SlashPopup.svelte.d.ts +11 -0
- package/dist/Editor/editor.extensions.d.ts +23 -0
- package/dist/Editor/editor.extensions.js +132 -0
- package/dist/Editor/editor.schemas.d.ts +5 -0
- package/dist/Editor/editor.schemas.js +27 -0
- package/dist/Editor/editor.slash.svelte.d.ts +25 -0
- package/dist/Editor/editor.slash.svelte.js +299 -0
- package/dist/Editor/editor.suggestion.d.ts +7 -0
- package/dist/Editor/editor.suggestion.js +165 -0
- package/dist/Editor/editor.toolbar.d.ts +11 -0
- package/dist/Editor/editor.toolbar.js +204 -0
- package/dist/Editor/editor.types.d.ts +367 -0
- package/dist/Editor/editor.types.js +1 -0
- package/dist/Editor/editor.variants.d.ts +303 -0
- package/dist/Editor/editor.variants.js +135 -0
- package/dist/Editor/index.d.ts +55 -0
- package/dist/Editor/index.js +54 -0
- package/dist/Empty/Empty.svelte +118 -0
- package/dist/Empty/Empty.svelte.d.ts +5 -0
- package/dist/Empty/empty.types.d.ts +91 -0
- package/dist/Empty/empty.types.js +1 -0
- package/dist/Empty/empty.variants.d.ts +308 -0
- package/dist/Empty/empty.variants.js +73 -0
- package/dist/Empty/index.d.ts +2 -0
- package/dist/Empty/index.js +1 -0
- package/dist/FieldGroup/FieldGroup.svelte +53 -0
- package/dist/FieldGroup/FieldGroup.svelte.d.ts +5 -0
- package/dist/FieldGroup/field-group.types.d.ts +37 -0
- package/dist/FieldGroup/field-group.types.js +1 -0
- package/dist/FieldGroup/field-group.variants.d.ts +116 -0
- package/dist/FieldGroup/field-group.variants.js +49 -0
- package/dist/FieldGroup/index.d.ts +2 -0
- package/dist/FieldGroup/index.js +1 -0
- package/dist/FileUpload/FileUpload.svelte +639 -0
- package/dist/FileUpload/FileUpload.svelte.d.ts +8 -0
- package/dist/FileUpload/file-upload.types.d.ts +203 -0
- package/dist/FileUpload/file-upload.types.js +1 -0
- package/dist/FileUpload/file-upload.variants.d.ts +397 -0
- package/dist/FileUpload/file-upload.variants.js +224 -0
- package/dist/FileUpload/index.d.ts +2 -0
- package/dist/FileUpload/index.js +1 -0
- package/dist/Form/Form.svelte +197 -0
- package/dist/Form/Form.svelte.d.ts +26 -0
- package/dist/Form/form.context.svelte.d.ts +64 -0
- package/dist/Form/form.context.svelte.js +478 -0
- package/dist/Form/form.types.d.ts +164 -0
- package/dist/Form/form.types.js +12 -0
- package/dist/Form/form.variants.d.ts +39 -0
- package/dist/Form/form.variants.js +17 -0
- package/dist/Form/index.d.ts +4 -0
- package/dist/Form/index.js +6 -0
- package/dist/Form/validate-schema.d.ts +13 -0
- package/dist/Form/validate-schema.js +113 -0
- package/dist/FormField/FormField.svelte +186 -0
- package/dist/FormField/FormField.svelte.d.ts +5 -0
- package/dist/FormField/form-field.types.d.ts +109 -0
- package/dist/FormField/form-field.types.js +1 -0
- package/dist/FormField/form-field.variants.d.ts +313 -0
- package/dist/FormField/form-field.variants.js +74 -0
- package/dist/FormField/index.d.ts +2 -0
- package/dist/FormField/index.js +1 -0
- package/dist/Icon/Icon.svelte +46 -0
- package/dist/Icon/Icon.svelte.d.ts +6 -0
- package/dist/Icon/icon.types.d.ts +49 -0
- package/dist/Icon/icon.types.js +1 -0
- package/dist/Icon/index.d.ts +2 -0
- package/dist/Icon/index.js +1 -0
- package/dist/Input/Input.svelte +199 -0
- package/dist/Input/Input.svelte.d.ts +26 -0
- package/dist/Input/index.d.ts +2 -0
- package/dist/Input/index.js +1 -0
- package/dist/Input/input.types.d.ts +113 -0
- package/dist/Input/input.types.js +1 -0
- package/dist/Input/input.variants.d.ts +398 -0
- package/dist/Input/input.variants.js +387 -0
- package/dist/Kbd/Kbd.svelte +45 -0
- package/dist/Kbd/Kbd.svelte.d.ts +5 -0
- package/dist/Kbd/index.d.ts +3 -0
- package/dist/Kbd/index.js +2 -0
- package/dist/Kbd/kbd.types.d.ts +91 -0
- package/dist/Kbd/kbd.types.js +1 -0
- package/dist/Kbd/kbd.variants.d.ts +180 -0
- package/dist/Kbd/kbd.variants.js +168 -0
- package/dist/Kbd/useKbd.svelte.d.ts +29 -0
- package/dist/Kbd/useKbd.svelte.js +248 -0
- package/dist/Link/Link.svelte +168 -0
- package/dist/Link/Link.svelte.d.ts +5 -0
- package/dist/Link/index.d.ts +2 -0
- package/dist/Link/index.js +1 -0
- package/dist/Link/link.types.d.ts +86 -0
- package/dist/Link/link.types.js +1 -0
- package/dist/Link/link.variants.d.ts +113 -0
- package/dist/Link/link.variants.js +43 -0
- package/dist/Modal/Modal.svelte +218 -0
- package/dist/Modal/Modal.svelte.d.ts +5 -0
- package/dist/Modal/ModalTriggerTestWrapper.svelte +10 -0
- package/dist/Modal/ModalTriggerTestWrapper.svelte.d.ts +18 -0
- package/dist/Modal/index.d.ts +2 -0
- package/dist/Modal/index.js +1 -0
- package/dist/Modal/modal.types.d.ts +155 -0
- package/dist/Modal/modal.types.js +1 -0
- package/dist/Modal/modal.variants.d.ts +303 -0
- package/dist/Modal/modal.variants.js +90 -0
- package/dist/Pagination/Pagination.svelte +253 -0
- package/dist/Pagination/Pagination.svelte.d.ts +6 -0
- package/dist/Pagination/index.d.ts +2 -0
- package/dist/Pagination/index.js +1 -0
- package/dist/Pagination/pagination.types.d.ts +191 -0
- package/dist/Pagination/pagination.types.js +1 -0
- package/dist/Pagination/pagination.variants.d.ts +160 -0
- package/dist/Pagination/pagination.variants.js +125 -0
- package/dist/PinInput/PinInput.svelte +162 -0
- package/dist/PinInput/PinInput.svelte.d.ts +6 -0
- package/dist/PinInput/index.d.ts +2 -0
- package/dist/PinInput/index.js +1 -0
- package/dist/PinInput/pin-input.types.d.ts +110 -0
- package/dist/PinInput/pin-input.types.js +1 -0
- package/dist/PinInput/pin-input.variants.d.ts +303 -0
- package/dist/PinInput/pin-input.variants.js +196 -0
- package/dist/Popover/Popover.svelte +122 -0
- package/dist/Popover/Popover.svelte.d.ts +6 -0
- package/dist/Popover/index.d.ts +2 -0
- package/dist/Popover/index.js +1 -0
- package/dist/Popover/popover.types.d.ts +58 -0
- package/dist/Popover/popover.types.js +1 -0
- package/dist/Popover/popover.variants.d.ts +53 -0
- package/dist/Popover/popover.variants.js +31 -0
- package/dist/Progress/Progress.svelte +135 -0
- package/dist/Progress/Progress.svelte.d.ts +6 -0
- package/dist/Progress/index.d.ts +2 -0
- package/dist/Progress/index.js +1 -0
- package/dist/Progress/progress.types.d.ts +71 -0
- package/dist/Progress/progress.types.js +1 -0
- package/dist/Progress/progress.variants.d.ts +513 -0
- package/dist/Progress/progress.variants.js +204 -0
- package/dist/RadioGroup/RadioGroup.svelte +226 -0
- package/dist/RadioGroup/RadioGroup.svelte.d.ts +6 -0
- package/dist/RadioGroup/index.d.ts +2 -0
- package/dist/RadioGroup/index.js +1 -0
- package/dist/RadioGroup/radio-group.types.d.ts +111 -0
- package/dist/RadioGroup/radio-group.types.js +1 -0
- package/dist/RadioGroup/radio-group.variants.d.ts +543 -0
- package/dist/RadioGroup/radio-group.variants.js +232 -0
- package/dist/Select/Select.svelte +461 -0
- package/dist/Select/Select.svelte.d.ts +6 -0
- package/dist/Select/index.d.ts +2 -0
- package/dist/Select/index.js +1 -0
- package/dist/Select/select.types.d.ts +263 -0
- package/dist/Select/select.types.js +1 -0
- package/dist/Select/select.variants.d.ts +713 -0
- package/dist/Select/select.variants.js +482 -0
- package/dist/SelectMenu/SelectMenu.svelte +637 -0
- package/dist/SelectMenu/SelectMenu.svelte.d.ts +5 -0
- package/dist/SelectMenu/SelectMenuFormFieldTestWrapper.svelte +11 -0
- package/dist/SelectMenu/SelectMenuFormFieldTestWrapper.svelte.d.ts +7 -0
- package/dist/SelectMenu/index.d.ts +2 -0
- package/dist/SelectMenu/index.js +1 -0
- package/dist/SelectMenu/select-menu.types.d.ts +326 -0
- package/dist/SelectMenu/select-menu.types.js +1 -0
- package/dist/SelectMenu/select-menu.variants.d.ts +795 -0
- package/dist/SelectMenu/select-menu.variants.js +70 -0
- package/dist/Separator/Separator.svelte +77 -0
- package/dist/Separator/Separator.svelte.d.ts +6 -0
- package/dist/Separator/index.d.ts +2 -0
- package/dist/Separator/index.js +1 -0
- package/dist/Separator/separator.types.d.ts +53 -0
- package/dist/Separator/separator.types.js +1 -0
- package/dist/Separator/separator.variants.d.ts +509 -0
- package/dist/Separator/separator.variants.js +110 -0
- package/dist/Skeleton/Skeleton.svelte +39 -0
- package/dist/Skeleton/Skeleton.svelte.d.ts +5 -0
- package/dist/Skeleton/index.d.ts +2 -0
- package/dist/Skeleton/index.js +1 -0
- package/dist/Skeleton/skeleton.types.d.ts +27 -0
- package/dist/Skeleton/skeleton.types.js +1 -0
- package/dist/Skeleton/skeleton.variants.d.ts +18 -0
- package/dist/Skeleton/skeleton.variants.js +12 -0
- package/dist/Slideover/Slideover.svelte +212 -0
- package/dist/Slideover/Slideover.svelte.d.ts +5 -0
- package/dist/Slideover/SlideoverTriggerTestWrapper.svelte +10 -0
- package/dist/Slideover/SlideoverTriggerTestWrapper.svelte.d.ts +18 -0
- package/dist/Slideover/index.d.ts +2 -0
- package/dist/Slideover/index.js +1 -0
- package/dist/Slideover/slideover.types.d.ts +154 -0
- package/dist/Slideover/slideover.types.js +1 -0
- package/dist/Slideover/slideover.variants.d.ts +298 -0
- package/dist/Slideover/slideover.variants.js +145 -0
- package/dist/Slider/Slider.svelte +129 -0
- package/dist/Slider/Slider.svelte.d.ts +6 -0
- package/dist/Slider/index.d.ts +2 -0
- package/dist/Slider/index.js +1 -0
- package/dist/Slider/slider.types.d.ts +55 -0
- package/dist/Slider/slider.types.js +1 -0
- package/dist/Slider/slider.variants.d.ts +383 -0
- package/dist/Slider/slider.variants.js +102 -0
- package/dist/Stepper/Stepper.svelte +254 -0
- package/dist/Stepper/Stepper.svelte.d.ts +5 -0
- package/dist/Stepper/index.d.ts +2 -0
- package/dist/Stepper/index.js +1 -0
- package/dist/Stepper/stepper.types.d.ts +223 -0
- package/dist/Stepper/stepper.types.js +1 -0
- package/dist/Stepper/stepper.variants.d.ts +428 -0
- package/dist/Stepper/stepper.variants.js +204 -0
- package/dist/Switch/Switch.svelte +150 -0
- package/dist/Switch/Switch.svelte.d.ts +6 -0
- package/dist/Switch/index.d.ts +2 -0
- package/dist/Switch/index.js +1 -0
- package/dist/Switch/switch.types.d.ts +80 -0
- package/dist/Switch/switch.types.js +1 -0
- package/dist/Switch/switch.variants.d.ts +433 -0
- package/dist/Switch/switch.variants.js +171 -0
- package/dist/Table/Table.svelte +667 -0
- package/dist/Table/Table.svelte.d.ts +26 -0
- package/dist/Table/index.d.ts +2 -0
- package/dist/Table/index.js +1 -0
- package/dist/Table/table.types.d.ts +202 -0
- package/dist/Table/table.types.js +1 -0
- package/dist/Table/table.utils.d.ts +54 -0
- package/dist/Table/table.utils.js +167 -0
- package/dist/Table/table.variants.d.ts +205 -0
- package/dist/Table/table.variants.js +126 -0
- package/dist/Tabs/Tabs.svelte +188 -0
- package/dist/Tabs/Tabs.svelte.d.ts +6 -0
- package/dist/Tabs/index.d.ts +2 -0
- package/dist/Tabs/index.js +1 -0
- package/dist/Tabs/tabs.types.d.ts +207 -0
- package/dist/Tabs/tabs.types.js +1 -0
- package/dist/Tabs/tabs.variants.d.ts +298 -0
- package/dist/Tabs/tabs.variants.js +251 -0
- package/dist/Textarea/Textarea.svelte +215 -0
- package/dist/Textarea/Textarea.svelte.d.ts +5 -0
- package/dist/Textarea/index.d.ts +2 -0
- package/dist/Textarea/index.js +1 -0
- package/dist/Textarea/textarea.types.d.ts +103 -0
- package/dist/Textarea/textarea.types.js +1 -0
- package/dist/Textarea/textarea.variants.d.ts +403 -0
- package/dist/Textarea/textarea.variants.js +404 -0
- package/dist/ThemeModeButton/ThemeModeButton.svelte +74 -0
- package/dist/ThemeModeButton/ThemeModeButton.svelte.d.ts +5 -0
- package/dist/ThemeModeButton/index.d.ts +2 -0
- package/dist/ThemeModeButton/index.js +1 -0
- package/dist/ThemeModeButton/theme-mode-button.types.d.ts +69 -0
- package/dist/ThemeModeButton/theme-mode-button.types.js +1 -0
- package/dist/ThemeModeButton/theme-mode-button.variants.d.ts +21 -0
- package/dist/ThemeModeButton/theme-mode-button.variants.js +17 -0
- package/dist/Timeline/Timeline.svelte +116 -0
- package/dist/Timeline/Timeline.svelte.d.ts +5 -0
- package/dist/Timeline/index.d.ts +2 -0
- package/dist/Timeline/index.js +1 -0
- package/dist/Timeline/timeline.types.d.ts +138 -0
- package/dist/Timeline/timeline.types.js +1 -0
- package/dist/Timeline/timeline.variants.d.ts +413 -0
- package/dist/Timeline/timeline.variants.js +201 -0
- package/dist/Toast/Toaster.svelte +619 -0
- package/dist/Toast/Toaster.svelte.d.ts +5 -0
- package/dist/Toast/index.d.ts +4 -0
- package/dist/Toast/index.js +2 -0
- package/dist/Toast/toast.d.ts +38 -0
- package/dist/Toast/toast.js +73 -0
- package/dist/Toast/toast.types.d.ts +19 -0
- package/dist/Toast/toast.types.js +1 -0
- package/dist/Toast/toast.variants.d.ts +7 -0
- package/dist/Toast/toast.variants.js +5 -0
- package/dist/Tooltip/Tooltip.svelte +151 -0
- package/dist/Tooltip/Tooltip.svelte.d.ts +6 -0
- package/dist/Tooltip/TooltipTestWrapper.svelte +8 -0
- package/dist/Tooltip/TooltipTestWrapper.svelte.d.ts +4 -0
- package/dist/Tooltip/index.d.ts +2 -0
- package/dist/Tooltip/index.js +1 -0
- package/dist/Tooltip/tooltip.types.d.ts +62 -0
- package/dist/Tooltip/tooltip.types.js +1 -0
- package/dist/Tooltip/tooltip.variants.d.ts +68 -0
- package/dist/Tooltip/tooltip.variants.js +35 -0
- package/dist/User/User.svelte +98 -0
- package/dist/User/User.svelte.d.ts +5 -0
- package/dist/User/index.d.ts +2 -0
- package/dist/User/index.js +1 -0
- package/dist/User/user.types.d.ts +78 -0
- package/dist/User/user.types.js +1 -0
- package/dist/User/user.variants.d.ts +368 -0
- package/dist/User/user.variants.js +85 -0
- package/dist/config.d.ts +73 -0
- package/dist/config.js +108 -0
- package/dist/hooks/HookContextProbe.svelte +7 -0
- package/dist/hooks/HookContextProbe.svelte.d.ts +18 -0
- package/dist/hooks/HookContextProvider.svelte +9 -0
- package/dist/hooks/HookContextProvider.svelte.d.ts +18 -0
- package/dist/hooks/HookEmitProbe.svelte +14 -0
- package/dist/hooks/HookEmitProbe.svelte.d.ts +18 -0
- package/dist/hooks/index.d.ts +14 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/useClickOutside.svelte.d.ts +31 -0
- package/dist/hooks/useClickOutside.svelte.js +37 -0
- package/dist/hooks/useClipboard.svelte.d.ts +30 -0
- package/dist/hooks/useClipboard.svelte.js +45 -0
- package/dist/hooks/useDebounce.svelte.d.ts +36 -0
- package/dist/hooks/useDebounce.svelte.js +56 -0
- package/dist/hooks/useEscapeKeydown.svelte.d.ts +31 -0
- package/dist/hooks/useEscapeKeydown.svelte.js +37 -0
- package/dist/hooks/useFormField.svelte.d.ts +54 -0
- package/dist/hooks/useFormField.svelte.js +65 -0
- package/dist/hooks/useInfiniteScroll.svelte.d.ts +57 -0
- package/dist/hooks/useInfiniteScroll.svelte.js +69 -0
- package/dist/hooks/useMediaQuery.svelte.d.ts +31 -0
- package/dist/hooks/useMediaQuery.svelte.js +38 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +57 -0
- package/dist/theme.css +680 -0
- package/package.json +237 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAnchorAttributes, HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import type { ClassNameValue } from 'tailwind-merge';
|
|
4
|
+
import type { ButtonProps } from '../Button/button.types.js';
|
|
5
|
+
import type { BannerSlots, BannerVariantProps } from './banner.variants.js';
|
|
6
|
+
/**
|
|
7
|
+
* Props for the Banner component.
|
|
8
|
+
*
|
|
9
|
+
* A full-width announcement bar typically rendered at the top of a page or
|
|
10
|
+
* layout. Supports optional `localStorage` persistence — once dismissed by a
|
|
11
|
+
* given `id`, the banner stays hidden across reloads.
|
|
12
|
+
*
|
|
13
|
+
* **Hydration note:** When a banner has been previously dismissed via `id`,
|
|
14
|
+
* users will see a one-frame flicker on initial render (server renders the
|
|
15
|
+
* banner, then `$effect` reads `localStorage` and hides it). Eliminating the
|
|
16
|
+
* flicker requires a SvelteKit prehydration script the consumer injects
|
|
17
|
+
* themselves — see the demo page for a recipe.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```svelte
|
|
21
|
+
* <Banner
|
|
22
|
+
* id="announce-2026-q2"
|
|
23
|
+
* icon="lucide:megaphone"
|
|
24
|
+
* title="New features available — check the changelog!"
|
|
25
|
+
* color="primary"
|
|
26
|
+
* close
|
|
27
|
+
* to="/changelog"
|
|
28
|
+
* />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export interface BannerProps extends Omit<HTMLAttributes<HTMLElement>, 'class' | 'title' | 'id'> {
|
|
32
|
+
/**
|
|
33
|
+
* Bindable reference to the root DOM element.
|
|
34
|
+
*/
|
|
35
|
+
ref?: HTMLElement | null;
|
|
36
|
+
/**
|
|
37
|
+
* The HTML element to render as the root.
|
|
38
|
+
* @default 'div'
|
|
39
|
+
*/
|
|
40
|
+
as?: keyof HTMLElementTagNameMap;
|
|
41
|
+
/**
|
|
42
|
+
* Unique identifier used as the localStorage persistence key. When set,
|
|
43
|
+
* clicking the close button writes `ps-banner-{id}` to localStorage
|
|
44
|
+
* and the banner remains hidden on subsequent loads.
|
|
45
|
+
*
|
|
46
|
+
* Without an explicit `id`, a stable per-instance id is generated via
|
|
47
|
+
* `useId()` (used for the `data-banner-id` DOM attribute), but **dismissal
|
|
48
|
+
* is session-only** — no localStorage interaction happens. Pass an
|
|
49
|
+
* explicit `id` to opt into cross-reload persistence.
|
|
50
|
+
*
|
|
51
|
+
* Allowed characters in the storage key: alphanumeric, underscore, dash.
|
|
52
|
+
* Other characters are replaced with `-`.
|
|
53
|
+
*/
|
|
54
|
+
id?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Banner text content.
|
|
57
|
+
*/
|
|
58
|
+
title?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Iconify icon name rendered before the title.
|
|
61
|
+
*/
|
|
62
|
+
icon?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Color theme. Applies background + foreground tokens.
|
|
65
|
+
* @default 'primary'
|
|
66
|
+
*/
|
|
67
|
+
color?: NonNullable<BannerVariantProps['color']>;
|
|
68
|
+
/**
|
|
69
|
+
* When provided, the entire banner becomes a clickable link via an
|
|
70
|
+
* absolute-positioned overlay anchor. The `as` element stays unchanged
|
|
71
|
+
* (so close/action buttons inside aren't nested in an `<a>` — valid HTML).
|
|
72
|
+
* Pair with `target` for new-tab links.
|
|
73
|
+
*/
|
|
74
|
+
to?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Anchor `target` (e.g. `'_blank'`). Only honored when `to` is set.
|
|
77
|
+
*/
|
|
78
|
+
target?: HTMLAnchorAttributes['target'];
|
|
79
|
+
/**
|
|
80
|
+
* Show close button. Pass `true` for default styling or a `ButtonProps`
|
|
81
|
+
* object to customize. When `id` is also set, dismissal persists across
|
|
82
|
+
* reloads via localStorage.
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
close?: boolean | ButtonProps;
|
|
86
|
+
/**
|
|
87
|
+
* Override the close button icon.
|
|
88
|
+
* @default 'lucide:x' (from global icons config)
|
|
89
|
+
*/
|
|
90
|
+
closeIcon?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Action buttons rendered inline after the title. Each entry is spread
|
|
93
|
+
* onto a `<Button>` and accepts the full `ButtonProps` shape. Banner
|
|
94
|
+
* applies `size="xs" color="surface"` as the default — override any prop
|
|
95
|
+
* (variant, color, icon, to, etc.) per item.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```svelte
|
|
99
|
+
* <Banner
|
|
100
|
+
* title="Update available"
|
|
101
|
+
* actions={[
|
|
102
|
+
* { label: 'Learn more', variant: 'outline' },
|
|
103
|
+
* { label: 'Update now', trailingIcon: 'lucide:arrow-right' }
|
|
104
|
+
* ]}
|
|
105
|
+
* />
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
actions?: ButtonProps[];
|
|
109
|
+
/**
|
|
110
|
+
* Bindable visibility. Set to `false` to hide externally without
|
|
111
|
+
* persisting (e.g. for analytics-driven banners). When the user clicks
|
|
112
|
+
* the close button, this is set to `false` automatically.
|
|
113
|
+
* @default true
|
|
114
|
+
*/
|
|
115
|
+
open?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Fired when the close button is clicked, before any localStorage
|
|
118
|
+
* write. Cannot prevent dismissal — use `open` binding if you need
|
|
119
|
+
* conditional dismissal.
|
|
120
|
+
*/
|
|
121
|
+
onClose?: () => void;
|
|
122
|
+
/**
|
|
123
|
+
* Additional CSS classes for the root element.
|
|
124
|
+
*/
|
|
125
|
+
class?: ClassNameValue;
|
|
126
|
+
/**
|
|
127
|
+
* Override classes for component slots.
|
|
128
|
+
*/
|
|
129
|
+
ui?: Partial<Record<BannerSlots, ClassNameValue>>;
|
|
130
|
+
/**
|
|
131
|
+
* Custom leading content. Replaces the default `icon` rendering.
|
|
132
|
+
*/
|
|
133
|
+
leading?: Snippet;
|
|
134
|
+
/**
|
|
135
|
+
* Custom title content. Replaces the default `title` text.
|
|
136
|
+
*/
|
|
137
|
+
titleSlot?: Snippet;
|
|
138
|
+
/**
|
|
139
|
+
* Custom actions content. Replaces the default `actions` array rendering.
|
|
140
|
+
*/
|
|
141
|
+
actionsSlot?: Snippet;
|
|
142
|
+
/**
|
|
143
|
+
* Custom close button content. When provided, the consumer is
|
|
144
|
+
* responsible for wiring up the dismiss action (typically by binding
|
|
145
|
+
* `open` externally).
|
|
146
|
+
*/
|
|
147
|
+
closeSlot?: Snippet;
|
|
148
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
export declare const bannerVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
color: {
|
|
4
|
+
primary: {
|
|
5
|
+
root: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
title: string;
|
|
8
|
+
};
|
|
9
|
+
secondary: {
|
|
10
|
+
root: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
title: string;
|
|
13
|
+
};
|
|
14
|
+
tertiary: {
|
|
15
|
+
root: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
title: string;
|
|
18
|
+
};
|
|
19
|
+
success: {
|
|
20
|
+
root: string;
|
|
21
|
+
icon: string;
|
|
22
|
+
title: string;
|
|
23
|
+
};
|
|
24
|
+
warning: {
|
|
25
|
+
root: string;
|
|
26
|
+
icon: string;
|
|
27
|
+
title: string;
|
|
28
|
+
};
|
|
29
|
+
error: {
|
|
30
|
+
root: string;
|
|
31
|
+
icon: string;
|
|
32
|
+
title: string;
|
|
33
|
+
};
|
|
34
|
+
info: {
|
|
35
|
+
root: string;
|
|
36
|
+
icon: string;
|
|
37
|
+
title: string;
|
|
38
|
+
};
|
|
39
|
+
surface: {
|
|
40
|
+
root: string;
|
|
41
|
+
icon: string;
|
|
42
|
+
title: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
to: {
|
|
46
|
+
true: string;
|
|
47
|
+
false: string;
|
|
48
|
+
};
|
|
49
|
+
}, {
|
|
50
|
+
root: string;
|
|
51
|
+
container: string;
|
|
52
|
+
left: string;
|
|
53
|
+
center: string;
|
|
54
|
+
right: string;
|
|
55
|
+
icon: string;
|
|
56
|
+
title: string;
|
|
57
|
+
actions: string[];
|
|
58
|
+
close: string;
|
|
59
|
+
}, undefined, {
|
|
60
|
+
color: {
|
|
61
|
+
primary: {
|
|
62
|
+
root: string;
|
|
63
|
+
icon: string;
|
|
64
|
+
title: string;
|
|
65
|
+
};
|
|
66
|
+
secondary: {
|
|
67
|
+
root: string;
|
|
68
|
+
icon: string;
|
|
69
|
+
title: string;
|
|
70
|
+
};
|
|
71
|
+
tertiary: {
|
|
72
|
+
root: string;
|
|
73
|
+
icon: string;
|
|
74
|
+
title: string;
|
|
75
|
+
};
|
|
76
|
+
success: {
|
|
77
|
+
root: string;
|
|
78
|
+
icon: string;
|
|
79
|
+
title: string;
|
|
80
|
+
};
|
|
81
|
+
warning: {
|
|
82
|
+
root: string;
|
|
83
|
+
icon: string;
|
|
84
|
+
title: string;
|
|
85
|
+
};
|
|
86
|
+
error: {
|
|
87
|
+
root: string;
|
|
88
|
+
icon: string;
|
|
89
|
+
title: string;
|
|
90
|
+
};
|
|
91
|
+
info: {
|
|
92
|
+
root: string;
|
|
93
|
+
icon: string;
|
|
94
|
+
title: string;
|
|
95
|
+
};
|
|
96
|
+
surface: {
|
|
97
|
+
root: string;
|
|
98
|
+
icon: string;
|
|
99
|
+
title: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
to: {
|
|
103
|
+
true: string;
|
|
104
|
+
false: string;
|
|
105
|
+
};
|
|
106
|
+
}, {
|
|
107
|
+
root: string;
|
|
108
|
+
container: string;
|
|
109
|
+
left: string;
|
|
110
|
+
center: string;
|
|
111
|
+
right: string;
|
|
112
|
+
icon: string;
|
|
113
|
+
title: string;
|
|
114
|
+
actions: string[];
|
|
115
|
+
close: string;
|
|
116
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
117
|
+
color: {
|
|
118
|
+
primary: {
|
|
119
|
+
root: string;
|
|
120
|
+
icon: string;
|
|
121
|
+
title: string;
|
|
122
|
+
};
|
|
123
|
+
secondary: {
|
|
124
|
+
root: string;
|
|
125
|
+
icon: string;
|
|
126
|
+
title: string;
|
|
127
|
+
};
|
|
128
|
+
tertiary: {
|
|
129
|
+
root: string;
|
|
130
|
+
icon: string;
|
|
131
|
+
title: string;
|
|
132
|
+
};
|
|
133
|
+
success: {
|
|
134
|
+
root: string;
|
|
135
|
+
icon: string;
|
|
136
|
+
title: string;
|
|
137
|
+
};
|
|
138
|
+
warning: {
|
|
139
|
+
root: string;
|
|
140
|
+
icon: string;
|
|
141
|
+
title: string;
|
|
142
|
+
};
|
|
143
|
+
error: {
|
|
144
|
+
root: string;
|
|
145
|
+
icon: string;
|
|
146
|
+
title: string;
|
|
147
|
+
};
|
|
148
|
+
info: {
|
|
149
|
+
root: string;
|
|
150
|
+
icon: string;
|
|
151
|
+
title: string;
|
|
152
|
+
};
|
|
153
|
+
surface: {
|
|
154
|
+
root: string;
|
|
155
|
+
icon: string;
|
|
156
|
+
title: string;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
to: {
|
|
160
|
+
true: string;
|
|
161
|
+
false: string;
|
|
162
|
+
};
|
|
163
|
+
}, {
|
|
164
|
+
root: string;
|
|
165
|
+
container: string;
|
|
166
|
+
left: string;
|
|
167
|
+
center: string;
|
|
168
|
+
right: string;
|
|
169
|
+
icon: string;
|
|
170
|
+
title: string;
|
|
171
|
+
actions: string[];
|
|
172
|
+
close: string;
|
|
173
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
174
|
+
export type BannerVariantProps = VariantProps<typeof bannerVariants>;
|
|
175
|
+
export type BannerSlots = keyof ReturnType<typeof bannerVariants>;
|
|
176
|
+
export declare const bannerDefaults: {
|
|
177
|
+
defaultVariants: import("tailwind-variants").TVDefaultVariants<{
|
|
178
|
+
color: {
|
|
179
|
+
primary: {
|
|
180
|
+
root: string;
|
|
181
|
+
icon: string;
|
|
182
|
+
title: string;
|
|
183
|
+
};
|
|
184
|
+
secondary: {
|
|
185
|
+
root: string;
|
|
186
|
+
icon: string;
|
|
187
|
+
title: string;
|
|
188
|
+
};
|
|
189
|
+
tertiary: {
|
|
190
|
+
root: string;
|
|
191
|
+
icon: string;
|
|
192
|
+
title: string;
|
|
193
|
+
};
|
|
194
|
+
success: {
|
|
195
|
+
root: string;
|
|
196
|
+
icon: string;
|
|
197
|
+
title: string;
|
|
198
|
+
};
|
|
199
|
+
warning: {
|
|
200
|
+
root: string;
|
|
201
|
+
icon: string;
|
|
202
|
+
title: string;
|
|
203
|
+
};
|
|
204
|
+
error: {
|
|
205
|
+
root: string;
|
|
206
|
+
icon: string;
|
|
207
|
+
title: string;
|
|
208
|
+
};
|
|
209
|
+
info: {
|
|
210
|
+
root: string;
|
|
211
|
+
icon: string;
|
|
212
|
+
title: string;
|
|
213
|
+
};
|
|
214
|
+
surface: {
|
|
215
|
+
root: string;
|
|
216
|
+
icon: string;
|
|
217
|
+
title: string;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
to: {
|
|
221
|
+
true: string;
|
|
222
|
+
false: string;
|
|
223
|
+
};
|
|
224
|
+
}, {
|
|
225
|
+
root: string;
|
|
226
|
+
container: string;
|
|
227
|
+
left: string;
|
|
228
|
+
center: string;
|
|
229
|
+
right: string;
|
|
230
|
+
icon: string;
|
|
231
|
+
title: string;
|
|
232
|
+
actions: string[];
|
|
233
|
+
close: string;
|
|
234
|
+
}, {
|
|
235
|
+
color: {
|
|
236
|
+
primary: {
|
|
237
|
+
root: string;
|
|
238
|
+
icon: string;
|
|
239
|
+
title: string;
|
|
240
|
+
};
|
|
241
|
+
secondary: {
|
|
242
|
+
root: string;
|
|
243
|
+
icon: string;
|
|
244
|
+
title: string;
|
|
245
|
+
};
|
|
246
|
+
tertiary: {
|
|
247
|
+
root: string;
|
|
248
|
+
icon: string;
|
|
249
|
+
title: string;
|
|
250
|
+
};
|
|
251
|
+
success: {
|
|
252
|
+
root: string;
|
|
253
|
+
icon: string;
|
|
254
|
+
title: string;
|
|
255
|
+
};
|
|
256
|
+
warning: {
|
|
257
|
+
root: string;
|
|
258
|
+
icon: string;
|
|
259
|
+
title: string;
|
|
260
|
+
};
|
|
261
|
+
error: {
|
|
262
|
+
root: string;
|
|
263
|
+
icon: string;
|
|
264
|
+
title: string;
|
|
265
|
+
};
|
|
266
|
+
info: {
|
|
267
|
+
root: string;
|
|
268
|
+
icon: string;
|
|
269
|
+
title: string;
|
|
270
|
+
};
|
|
271
|
+
surface: {
|
|
272
|
+
root: string;
|
|
273
|
+
icon: string;
|
|
274
|
+
title: string;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
to: {
|
|
278
|
+
true: string;
|
|
279
|
+
false: string;
|
|
280
|
+
};
|
|
281
|
+
}, {
|
|
282
|
+
root: string;
|
|
283
|
+
container: string;
|
|
284
|
+
left: string;
|
|
285
|
+
center: string;
|
|
286
|
+
right: string;
|
|
287
|
+
icon: string;
|
|
288
|
+
title: string;
|
|
289
|
+
actions: string[];
|
|
290
|
+
close: string;
|
|
291
|
+
}>;
|
|
292
|
+
slots: Partial<Record<BannerSlots, string>>;
|
|
293
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
export const bannerVariants = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
root: 'relative z-30 w-full transition-colors',
|
|
5
|
+
container: 'flex items-center justify-between gap-3 min-h-12 px-4 py-2',
|
|
6
|
+
left: 'hidden lg:flex lg:flex-1 lg:items-center',
|
|
7
|
+
center: 'flex items-center gap-2 min-w-0',
|
|
8
|
+
right: 'flex items-center justify-end gap-2 lg:flex-1',
|
|
9
|
+
icon: 'size-5 shrink-0 pointer-events-none',
|
|
10
|
+
title: 'text-sm font-medium truncate',
|
|
11
|
+
actions: [
|
|
12
|
+
'flex items-center gap-2 ms-2',
|
|
13
|
+
'[&_button]:text-inherit [&_button]:border-current/30 [&_button]:hover:bg-current/10'
|
|
14
|
+
],
|
|
15
|
+
close: 'shrink-0 text-inherit hover:bg-current/10'
|
|
16
|
+
},
|
|
17
|
+
variants: {
|
|
18
|
+
color: {
|
|
19
|
+
primary: {
|
|
20
|
+
root: 'bg-primary text-on-primary',
|
|
21
|
+
icon: 'text-on-primary',
|
|
22
|
+
title: 'text-on-primary'
|
|
23
|
+
},
|
|
24
|
+
secondary: {
|
|
25
|
+
root: 'bg-secondary text-on-secondary',
|
|
26
|
+
icon: 'text-on-secondary',
|
|
27
|
+
title: 'text-on-secondary'
|
|
28
|
+
},
|
|
29
|
+
tertiary: {
|
|
30
|
+
root: 'bg-tertiary text-on-tertiary',
|
|
31
|
+
icon: 'text-on-tertiary',
|
|
32
|
+
title: 'text-on-tertiary'
|
|
33
|
+
},
|
|
34
|
+
success: {
|
|
35
|
+
root: 'bg-success text-on-success',
|
|
36
|
+
icon: 'text-on-success',
|
|
37
|
+
title: 'text-on-success'
|
|
38
|
+
},
|
|
39
|
+
warning: {
|
|
40
|
+
root: 'bg-warning text-on-warning',
|
|
41
|
+
icon: 'text-on-warning',
|
|
42
|
+
title: 'text-on-warning'
|
|
43
|
+
},
|
|
44
|
+
error: {
|
|
45
|
+
root: 'bg-error text-on-error',
|
|
46
|
+
icon: 'text-on-error',
|
|
47
|
+
title: 'text-on-error'
|
|
48
|
+
},
|
|
49
|
+
info: {
|
|
50
|
+
root: 'bg-info text-on-info',
|
|
51
|
+
icon: 'text-on-info',
|
|
52
|
+
title: 'text-on-info'
|
|
53
|
+
},
|
|
54
|
+
surface: {
|
|
55
|
+
root: 'bg-inverse-surface text-inverse-on-surface',
|
|
56
|
+
icon: 'text-inverse-on-surface',
|
|
57
|
+
title: 'text-inverse-on-surface'
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
to: {
|
|
61
|
+
true: '',
|
|
62
|
+
false: ''
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
compoundVariants: [
|
|
66
|
+
// -------------------------------------------------------------------
|
|
67
|
+
// Hover effects when banner is clickable (`to` is set)
|
|
68
|
+
// -------------------------------------------------------------------
|
|
69
|
+
{ color: 'primary', to: true, class: { root: 'hover:bg-primary/90' } },
|
|
70
|
+
{ color: 'secondary', to: true, class: { root: 'hover:bg-secondary/90' } },
|
|
71
|
+
{ color: 'tertiary', to: true, class: { root: 'hover:bg-tertiary/90' } },
|
|
72
|
+
{ color: 'success', to: true, class: { root: 'hover:bg-success/90' } },
|
|
73
|
+
{ color: 'warning', to: true, class: { root: 'hover:bg-warning/90' } },
|
|
74
|
+
{ color: 'error', to: true, class: { root: 'hover:bg-error/90' } },
|
|
75
|
+
{ color: 'info', to: true, class: { root: 'hover:bg-info/90' } },
|
|
76
|
+
{ color: 'surface', to: true, class: { root: 'hover:bg-inverse-surface/90' } }
|
|
77
|
+
],
|
|
78
|
+
defaultVariants: {
|
|
79
|
+
color: 'primary',
|
|
80
|
+
to: false
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
export const bannerDefaults = {
|
|
84
|
+
defaultVariants: bannerVariants.defaultVariants,
|
|
85
|
+
slots: {}
|
|
86
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Banner } from './Banner.svelte';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script lang="ts" module>import type { BreadcrumbProps } from './breadcrumb.types.js';
|
|
2
|
+
export type Props = BreadcrumbProps;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">import type { ClassNameValue } from 'tailwind-merge';
|
|
6
|
+
import { getComponentConfig } from '../config.js';
|
|
7
|
+
import Icon from '../Icon/Icon.svelte';
|
|
8
|
+
import Link from '../Link/Link.svelte';
|
|
9
|
+
import { breadcrumbDefaults, breadcrumbVariants } from './breadcrumb.variants.js';
|
|
10
|
+
|
|
11
|
+
const config = getComponentConfig('breadcrumb', breadcrumbDefaults);
|
|
12
|
+
let { ref = $bindable(null), as = 'nav', items, separatorIcon = 'lucide:chevron-right', class: className, ui, item: itemSnippet, separator: separatorSnippet, ...restProps }: Props = $props();
|
|
13
|
+
const variantSlots = $derived(breadcrumbVariants(config.defaultVariants));
|
|
14
|
+
const classes = $derived({
|
|
15
|
+
root: variantSlots.root({ class: [config.slots.root, className, ui?.root] }),
|
|
16
|
+
list: variantSlots.list({ class: [config.slots.list, ui?.list] }),
|
|
17
|
+
separator: variantSlots.separator({ class: [config.slots.separator, ui?.separator] }),
|
|
18
|
+
separatorIcon: variantSlots.separatorIcon({
|
|
19
|
+
class: [config.slots.separatorIcon, ui?.separatorIcon]
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
function getLinkClasses(active: boolean, disabled: boolean, to: boolean, itemClass: ClassNameValue | undefined) {
|
|
23
|
+
const slots = breadcrumbVariants({ ...config.defaultVariants, active, disabled, to });
|
|
24
|
+
return {
|
|
25
|
+
item: slots.item({ class: [config.slots.item, ui?.item] }),
|
|
26
|
+
link: slots.link({ class: [config.slots.link, itemClass, ui?.link] }),
|
|
27
|
+
linkLeadingIcon: slots.linkLeadingIcon({
|
|
28
|
+
class: [config.slots.linkLeadingIcon, ui?.linkLeadingIcon]
|
|
29
|
+
}),
|
|
30
|
+
linkLabel: slots.linkLabel({ class: [config.slots.linkLabel, ui?.linkLabel] })
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<svelte:element
|
|
36
|
+
this={as}
|
|
37
|
+
bind:this={ref}
|
|
38
|
+
aria-label={as === 'nav' ? 'Breadcrumb' : undefined}
|
|
39
|
+
class={classes.root}
|
|
40
|
+
{...restProps}
|
|
41
|
+
>
|
|
42
|
+
<ol class={classes.list}>
|
|
43
|
+
{#each items as item, index (item.label ?? index)}
|
|
44
|
+
{@const active = index === items.length - 1}
|
|
45
|
+
{@const disabled = item.disabled ?? false}
|
|
46
|
+
{@const itemClasses = getLinkClasses(active, disabled, !!item.href, item.class)}
|
|
47
|
+
|
|
48
|
+
<li class={itemClasses.item}>
|
|
49
|
+
{#if itemSnippet}
|
|
50
|
+
{@render itemSnippet({ item, index, active })}
|
|
51
|
+
{:else if active || !item.href}
|
|
52
|
+
<span class={itemClasses.link} aria-current={active ? 'page' : undefined}>
|
|
53
|
+
{#if item.icon}
|
|
54
|
+
<Icon name={item.icon} class={itemClasses.linkLeadingIcon} />
|
|
55
|
+
{/if}
|
|
56
|
+
<span class={itemClasses.linkLabel}>{item.label}</span>
|
|
57
|
+
</span>
|
|
58
|
+
{:else}
|
|
59
|
+
<Link href={item.href} raw {disabled} class={itemClasses.link}>
|
|
60
|
+
{#if item.icon}
|
|
61
|
+
<Icon name={item.icon} class={itemClasses.linkLeadingIcon} />
|
|
62
|
+
{/if}
|
|
63
|
+
<span class={itemClasses.linkLabel}>{item.label}</span>
|
|
64
|
+
</Link>
|
|
65
|
+
{/if}
|
|
66
|
+
</li>
|
|
67
|
+
|
|
68
|
+
{#if index < items.length - 1}
|
|
69
|
+
<li role="presentation" aria-hidden="true" class={classes.separator}>
|
|
70
|
+
{#if separatorSnippet}
|
|
71
|
+
{@render separatorSnippet()}
|
|
72
|
+
{:else}
|
|
73
|
+
<Icon name={separatorIcon} class={classes.separatorIcon} />
|
|
74
|
+
{/if}
|
|
75
|
+
</li>
|
|
76
|
+
{/if}
|
|
77
|
+
{/each}
|
|
78
|
+
</ol>
|
|
79
|
+
</svelte:element>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { ClassNameValue } from 'tailwind-merge';
|
|
3
|
+
import type { BreadcrumbSlots } from './breadcrumb.variants.js';
|
|
4
|
+
export interface BreadcrumbItem {
|
|
5
|
+
/**
|
|
6
|
+
* Display text for the breadcrumb item.
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* The destination URL. When omitted, the item renders as a non-clickable span.
|
|
11
|
+
*/
|
|
12
|
+
href?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Leading icon name (e.g. 'lucide:home').
|
|
15
|
+
*/
|
|
16
|
+
icon?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Disables the breadcrumb item.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Additional CSS classes for this specific item's link/span.
|
|
24
|
+
*/
|
|
25
|
+
class?: ClassNameValue;
|
|
26
|
+
}
|
|
27
|
+
export interface BreadcrumbProps {
|
|
28
|
+
/**
|
|
29
|
+
* Bindable reference to the root DOM element.
|
|
30
|
+
*/
|
|
31
|
+
ref?: HTMLElement | null;
|
|
32
|
+
/**
|
|
33
|
+
* The HTML element to render as the root wrapper.
|
|
34
|
+
* @default 'nav'
|
|
35
|
+
*/
|
|
36
|
+
as?: keyof HTMLElementTagNameMap;
|
|
37
|
+
/**
|
|
38
|
+
* Array of breadcrumb items to render.
|
|
39
|
+
*/
|
|
40
|
+
items: BreadcrumbItem[];
|
|
41
|
+
/**
|
|
42
|
+
* Icon name for the separator between items.
|
|
43
|
+
* @default 'lucide:chevron-right'
|
|
44
|
+
*/
|
|
45
|
+
separatorIcon?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Additional CSS classes for the root element.
|
|
48
|
+
*/
|
|
49
|
+
class?: ClassNameValue;
|
|
50
|
+
/**
|
|
51
|
+
* Override styles for specific breadcrumb slots.
|
|
52
|
+
*/
|
|
53
|
+
ui?: Partial<Record<BreadcrumbSlots, ClassNameValue>>;
|
|
54
|
+
/**
|
|
55
|
+
* Custom snippet for rendering each breadcrumb item.
|
|
56
|
+
*/
|
|
57
|
+
item?: Snippet<[{
|
|
58
|
+
item: BreadcrumbItem;
|
|
59
|
+
index: number;
|
|
60
|
+
active: boolean;
|
|
61
|
+
}]>;
|
|
62
|
+
/**
|
|
63
|
+
* Custom snippet for rendering the separator.
|
|
64
|
+
*/
|
|
65
|
+
separator?: Snippet;
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|