@thomasfosterau/components 0.0.0 → 0.2.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 +241 -56
- package/dist/canvas/VectorCanvas.svelte +320 -0
- package/dist/canvas/VectorCanvas.svelte.d.ts +105 -0
- package/dist/canvas/history.d.ts +105 -0
- package/dist/canvas/history.js +147 -0
- package/dist/canvas/index.d.ts +15 -0
- package/dist/canvas/index.js +14 -0
- package/dist/canvas/types.d.ts +91 -0
- package/dist/canvas/types.js +13 -0
- package/dist/canvas/utils.d.ts +66 -0
- package/dist/canvas/utils.js +114 -0
- package/dist/charts/Chart.svelte +300 -0
- package/dist/charts/Chart.svelte.d.ts +50 -0
- package/dist/charts/index.d.ts +11 -0
- package/dist/charts/index.js +10 -0
- package/dist/charts/types.d.ts +28 -0
- package/dist/charts/types.js +6 -0
- package/dist/citations/BookCitation.svelte +53 -0
- package/dist/citations/BookCitation.svelte.d.ts +41 -0
- package/dist/citations/ChapterCitation.svelte +38 -0
- package/dist/citations/ChapterCitation.svelte.d.ts +50 -0
- package/dist/citations/Citation.svelte +47 -0
- package/dist/citations/Citation.svelte.d.ts +24 -0
- package/dist/citations/CreditList.svelte +69 -0
- package/dist/citations/CreditList.svelte.d.ts +47 -0
- package/dist/citations/DOILink.svelte +28 -0
- package/dist/citations/DOILink.svelte.d.ts +19 -0
- package/dist/citations/Footnote.svelte +39 -0
- package/dist/citations/Footnote.svelte.d.ts +17 -0
- package/dist/citations/FootnoteList.svelte +36 -0
- package/dist/citations/FootnoteList.svelte.d.ts +21 -0
- package/dist/citations/ISBNLink.svelte +29 -0
- package/dist/citations/ISBNLink.svelte.d.ts +19 -0
- package/dist/citations/ISSNLink.svelte +29 -0
- package/dist/citations/ISSNLink.svelte.d.ts +19 -0
- package/dist/citations/Publisher.svelte +34 -0
- package/dist/citations/Publisher.svelte.d.ts +14 -0
- package/dist/citations/ReferenceList.svelte +53 -0
- package/dist/citations/ReferenceList.svelte.d.ts +21 -0
- package/dist/citations/ReportCitation.svelte +41 -0
- package/dist/citations/ReportCitation.svelte.d.ts +36 -0
- package/dist/citations/ScholarlyArticleCitation.svelte +64 -0
- package/dist/citations/ScholarlyArticleCitation.svelte.d.ts +41 -0
- package/dist/citations/ThesisCitation.svelte +35 -0
- package/dist/citations/ThesisCitation.svelte.d.ts +29 -0
- package/dist/citations/bibliography.svelte.d.ts +55 -0
- package/dist/citations/bibliography.svelte.js +78 -0
- package/dist/citations/citation.d.ts +71 -0
- package/dist/citations/citation.js +121 -0
- package/dist/citations/csl.d.ts +102 -0
- package/dist/citations/csl.js +20 -0
- package/dist/citations/index.d.ts +31 -0
- package/dist/citations/index.js +36 -0
- package/dist/citations/list-format.d.ts +34 -0
- package/dist/citations/list-format.js +40 -0
- package/dist/context.svelte.d.ts +46 -0
- package/dist/context.svelte.js +51 -0
- package/dist/data/ChatBubble.svelte +48 -0
- package/dist/data/ChatBubble.svelte.d.ts +33 -0
- package/dist/data/DataGrid.svelte +150 -0
- package/dist/data/DataGrid.svelte.d.ts +118 -0
- package/dist/data/DescriptionList.svelte +53 -0
- package/dist/data/DescriptionList.svelte.d.ts +26 -0
- package/dist/data/DescriptionRow.svelte +56 -0
- package/dist/data/DescriptionRow.svelte.d.ts +21 -0
- package/dist/data/DiffText.svelte +29 -0
- package/dist/data/DiffText.svelte.d.ts +19 -0
- package/dist/data/ItemList.svelte +80 -0
- package/dist/data/ItemList.svelte.d.ts +52 -0
- package/dist/data/LinkListItem.svelte +46 -0
- package/dist/data/LinkListItem.svelte.d.ts +21 -0
- package/dist/data/MessageThread.svelte +29 -0
- package/dist/data/MessageThread.svelte.d.ts +17 -0
- package/dist/data/Pagination.svelte +136 -0
- package/dist/data/Pagination.svelte.d.ts +79 -0
- package/dist/data/PaginationFooter.svelte +42 -0
- package/dist/data/PaginationFooter.svelte.d.ts +61 -0
- package/dist/data/ResultCount.svelte +27 -0
- package/dist/data/ResultCount.svelte.d.ts +18 -0
- package/dist/data/Table.svelte +151 -0
- package/dist/data/Table.svelte.d.ts +75 -0
- package/dist/data/TreeList.svelte +41 -0
- package/dist/data/TreeList.svelte.d.ts +17 -0
- package/dist/data/TreeListItem.svelte +29 -0
- package/dist/data/TreeListItem.svelte.d.ts +10 -0
- package/dist/data/description-context.d.ts +39 -0
- package/dist/data/description-context.js +36 -0
- package/dist/data/diff.d.ts +14 -0
- package/dist/data/diff.js +10 -0
- package/dist/data/index.d.ts +37 -0
- package/dist/data/index.js +37 -0
- package/dist/data/list-item.d.ts +30 -0
- package/dist/data/list-item.js +19 -0
- package/dist/data/pagination.d.ts +81 -0
- package/dist/data/pagination.js +79 -0
- package/dist/data/table-types.d.ts +71 -0
- package/dist/data/table-types.js +35 -0
- package/dist/feedback/ConfirmDialog.svelte +79 -0
- package/dist/feedback/ConfirmDialog.svelte.d.ts +82 -0
- package/dist/feedback/Dialog.svelte +47 -0
- package/dist/feedback/Dialog.svelte.d.ts +36 -0
- package/dist/feedback/DialogFrame.svelte +64 -0
- package/dist/feedback/DialogFrame.svelte.d.ts +23 -0
- package/dist/feedback/Drawer.svelte +43 -0
- package/dist/feedback/Drawer.svelte.d.ts +43 -0
- package/dist/feedback/LoadingBoundary.svelte +61 -0
- package/dist/feedback/LoadingBoundary.svelte.d.ts +34 -0
- package/dist/feedback/ProgressBar.svelte +46 -0
- package/dist/feedback/ProgressBar.svelte.d.ts +28 -0
- package/dist/feedback/SegmentBar.svelte +83 -0
- package/dist/feedback/SegmentBar.svelte.d.ts +37 -0
- package/dist/feedback/StatTile.svelte +77 -0
- package/dist/feedback/StatTile.svelte.d.ts +50 -0
- package/dist/feedback/Stats.svelte +18 -0
- package/dist/feedback/Stats.svelte.d.ts +16 -0
- package/dist/feedback/Steps.svelte +72 -0
- package/dist/feedback/Steps.svelte.d.ts +61 -0
- package/dist/feedback/Timeline.svelte +86 -0
- package/dist/feedback/Timeline.svelte.d.ts +55 -0
- package/dist/feedback/Toaster.svelte +78 -0
- package/dist/feedback/Toaster.svelte.d.ts +32 -0
- package/dist/feedback/index.d.ts +34 -0
- package/dist/feedback/index.js +29 -0
- package/dist/feedback/sizes.d.ts +41 -0
- package/dist/feedback/sizes.js +69 -0
- package/dist/feedback/toaster.d.ts +48 -0
- package/dist/feedback/toaster.js +29 -0
- package/dist/fields/Calendar.svelte +60 -0
- package/dist/fields/Calendar.svelte.d.ts +11 -0
- package/dist/fields/CalendarMonths.svelte +86 -0
- package/dist/fields/CalendarMonths.svelte.d.ts +30 -0
- package/dist/fields/Checkbox.svelte +33 -0
- package/dist/fields/Checkbox.svelte.d.ts +30 -0
- package/dist/fields/CheckboxGroup.svelte +41 -0
- package/dist/fields/CheckboxGroup.svelte.d.ts +40 -0
- package/dist/fields/Combobox.svelte +229 -0
- package/dist/fields/Combobox.svelte.d.ts +133 -0
- package/dist/fields/DateField.svelte +37 -0
- package/dist/fields/DateField.svelte.d.ts +20 -0
- package/dist/fields/DateInput.svelte +31 -0
- package/dist/fields/DateInput.svelte.d.ts +35 -0
- package/dist/fields/DatePicker.svelte +47 -0
- package/dist/fields/DatePicker.svelte.d.ts +25 -0
- package/dist/fields/DateRangePicker.svelte +70 -0
- package/dist/fields/DateRangePicker.svelte.d.ts +43 -0
- package/dist/fields/Dropzone.svelte +232 -0
- package/dist/fields/Dropzone.svelte.d.ts +103 -0
- package/dist/fields/FieldErrors.svelte +30 -0
- package/dist/fields/FieldErrors.svelte.d.ts +11 -0
- package/dist/fields/Fieldset.svelte +53 -0
- package/dist/fields/Fieldset.svelte.d.ts +27 -0
- package/dist/fields/FileInput.svelte +68 -0
- package/dist/fields/FileInput.svelte.d.ts +39 -0
- package/dist/fields/FormField.svelte +78 -0
- package/dist/fields/FormField.svelte.d.ts +29 -0
- package/dist/fields/ImageInput.svelte +87 -0
- package/dist/fields/ImageInput.svelte.d.ts +45 -0
- package/dist/fields/MultiSelect.svelte +112 -0
- package/dist/fields/MultiSelect.svelte.d.ts +75 -0
- package/dist/fields/NumberField.svelte +190 -0
- package/dist/fields/NumberField.svelte.d.ts +76 -0
- package/dist/fields/PasswordInput.svelte +95 -0
- package/dist/fields/PasswordInput.svelte.d.ts +58 -0
- package/dist/fields/PickerPopover.svelte +47 -0
- package/dist/fields/PickerPopover.svelte.d.ts +16 -0
- package/dist/fields/PinInput.svelte +83 -0
- package/dist/fields/PinInput.svelte.d.ts +66 -0
- package/dist/fields/PushToggle.svelte +93 -0
- package/dist/fields/PushToggle.svelte.d.ts +55 -0
- package/dist/fields/RadioGroup.svelte +88 -0
- package/dist/fields/RadioGroup.svelte.d.ts +41 -0
- package/dist/fields/RangeCalendar.svelte +51 -0
- package/dist/fields/RangeCalendar.svelte.d.ts +23 -0
- package/dist/fields/Rating.svelte +127 -0
- package/dist/fields/Rating.svelte.d.ts +86 -0
- package/dist/fields/SearchInput.svelte +58 -0
- package/dist/fields/SearchInput.svelte.d.ts +33 -0
- package/dist/fields/SegmentGroup.svelte +91 -0
- package/dist/fields/SegmentGroup.svelte.d.ts +20 -0
- package/dist/fields/Select.svelte +36 -0
- package/dist/fields/Select.svelte.d.ts +35 -0
- package/dist/fields/Slider.svelte +194 -0
- package/dist/fields/Slider.svelte.d.ts +100 -0
- package/dist/fields/TagsInput.svelte +256 -0
- package/dist/fields/TagsInput.svelte.d.ts +102 -0
- package/dist/fields/TextInput.svelte +26 -0
- package/dist/fields/TextInput.svelte.d.ts +36 -0
- package/dist/fields/Textarea.svelte +22 -0
- package/dist/fields/Textarea.svelte.d.ts +31 -0
- package/dist/fields/TimeField.svelte +30 -0
- package/dist/fields/TimeField.svelte.d.ts +19 -0
- package/dist/fields/Toggle.svelte +72 -0
- package/dist/fields/Toggle.svelte.d.ts +38 -0
- package/dist/fields/VideoInput.svelte +35 -0
- package/dist/fields/VideoInput.svelte.d.ts +46 -0
- package/dist/fields/calendar-props.d.ts +119 -0
- package/dist/fields/calendar-props.js +51 -0
- package/dist/fields/dates.d.ts +28 -0
- package/dist/fields/dates.js +26 -0
- package/dist/fields/field-types.d.ts +80 -0
- package/dist/fields/field-types.js +92 -0
- package/dist/fields/file-validation.d.ts +30 -0
- package/dist/fields/file-validation.js +51 -0
- package/dist/fields/index.d.ts +43 -0
- package/dist/fields/index.js +42 -0
- package/dist/fields/latest-search.svelte.d.ts +38 -0
- package/dist/fields/latest-search.svelte.js +85 -0
- package/dist/fields/number-format.d.ts +52 -0
- package/dist/fields/number-format.js +89 -0
- package/dist/fields/segmented-field.d.ts +128 -0
- package/dist/fields/segmented-field.js +52 -0
- package/dist/fields/slider-keys.d.ts +21 -0
- package/dist/fields/slider-keys.js +37 -0
- package/dist/formatting/Countdown.svelte +110 -0
- package/dist/formatting/Countdown.svelte.d.ts +35 -0
- package/dist/formatting/DateTime.svelte +35 -0
- package/dist/formatting/DateTime.svelte.d.ts +26 -0
- package/dist/formatting/Duration.svelte +18 -0
- package/dist/formatting/Duration.svelte.d.ts +20 -0
- package/dist/formatting/FormatList.svelte +31 -0
- package/dist/formatting/FormatList.svelte.d.ts +46 -0
- package/dist/formatting/Highlight.svelte +51 -0
- package/dist/formatting/Highlight.svelte.d.ts +19 -0
- package/dist/formatting/Number.svelte +35 -0
- package/dist/formatting/Number.svelte.d.ts +43 -0
- package/dist/formatting/RelativeTime.svelte +69 -0
- package/dist/formatting/RelativeTime.svelte.d.ts +26 -0
- package/dist/formatting/Year.svelte +39 -0
- package/dist/formatting/Year.svelte.d.ts +21 -0
- package/dist/formatting/duration.d.ts +44 -0
- package/dist/formatting/duration.js +125 -0
- package/dist/formatting/index.d.ts +15 -0
- package/dist/formatting/index.js +17 -0
- package/dist/forms/EntityForm.svelte +185 -0
- package/dist/forms/EntityForm.svelte.d.ts +66 -0
- package/dist/forms/FormActions.svelte +29 -0
- package/dist/forms/FormActions.svelte.d.ts +37 -0
- package/dist/forms/FormErrors.svelte +21 -0
- package/dist/forms/FormErrors.svelte.d.ts +16 -0
- package/dist/forms/HiddenField.svelte +22 -0
- package/dist/forms/HiddenField.svelte.d.ts +11 -0
- package/dist/forms/SearchForm.svelte +43 -0
- package/dist/forms/SearchForm.svelte.d.ts +36 -0
- package/dist/forms/entity-form.d.ts +12 -0
- package/dist/forms/entity-form.js +12 -0
- package/dist/forms/index.d.ts +14 -0
- package/dist/forms/index.js +14 -0
- package/dist/hotkeys/HotkeyBadge.svelte +39 -0
- package/dist/hotkeys/HotkeyBadge.svelte.d.ts +25 -0
- package/dist/hotkeys/HotkeyHelpDialog.svelte +68 -0
- package/dist/hotkeys/HotkeyHelpDialog.svelte.d.ts +35 -0
- package/dist/hotkeys/HotkeyProvider.svelte +92 -0
- package/dist/hotkeys/HotkeyProvider.svelte.d.ts +4 -0
- package/dist/hotkeys/context.svelte.d.ts +47 -0
- package/dist/hotkeys/context.svelte.js +72 -0
- package/dist/hotkeys/index.d.ts +28 -0
- package/dist/hotkeys/index.js +27 -0
- package/dist/hotkeys/match.d.ts +65 -0
- package/dist/hotkeys/match.js +135 -0
- package/dist/hotkeys/registry.svelte.d.ts +55 -0
- package/dist/hotkeys/registry.svelte.js +110 -0
- package/dist/hotkeys/types.d.ts +74 -0
- package/dist/hotkeys/types.js +18 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +37 -0
- package/dist/infobox/Infobox.svelte +79 -0
- package/dist/infobox/Infobox.svelte.d.ts +33 -0
- package/dist/infobox/InfoboxHeader.svelte +35 -0
- package/dist/infobox/InfoboxHeader.svelte.d.ts +18 -0
- package/dist/infobox/InfoboxImage.svelte +38 -0
- package/dist/infobox/InfoboxImage.svelte.d.ts +21 -0
- package/dist/infobox/InfoboxRow.svelte +50 -0
- package/dist/infobox/InfoboxRow.svelte.d.ts +25 -0
- package/dist/infobox/InfoboxSection.svelte +24 -0
- package/dist/infobox/InfoboxSection.svelte.d.ts +12 -0
- package/dist/infobox/index.d.ts +21 -0
- package/dist/infobox/index.js +20 -0
- package/dist/infobox/types.d.ts +86 -0
- package/dist/infobox/types.js +27 -0
- package/dist/layout/AppShell.svelte +50 -0
- package/dist/layout/AppShell.svelte.d.ts +28 -0
- package/dist/layout/Breadcrumbs.svelte +52 -0
- package/dist/layout/Breadcrumbs.svelte.d.ts +18 -0
- package/dist/layout/Cluster.svelte +28 -0
- package/dist/layout/Cluster.svelte.d.ts +27 -0
- package/dist/layout/DetailLayout.svelte +50 -0
- package/dist/layout/DetailLayout.svelte.d.ts +19 -0
- package/dist/layout/FilterBar.svelte +40 -0
- package/dist/layout/FilterBar.svelte.d.ts +12 -0
- package/dist/layout/Fits.svelte +27 -0
- package/dist/layout/Fits.svelte.d.ts +13 -0
- package/dist/layout/Flow.svelte +46 -0
- package/dist/layout/Flow.svelte.d.ts +16 -0
- package/dist/layout/Footer.svelte +32 -0
- package/dist/layout/Footer.svelte.d.ts +12 -0
- package/dist/layout/Grid.svelte +23 -0
- package/dist/layout/Grid.svelte.d.ts +26 -0
- package/dist/layout/HStack.svelte +12 -0
- package/dist/layout/HStack.svelte.d.ts +34 -0
- package/dist/layout/Hero.svelte +76 -0
- package/dist/layout/Hero.svelte.d.ts +36 -0
- package/dist/layout/Main.svelte +30 -0
- package/dist/layout/Main.svelte.d.ts +15 -0
- package/dist/layout/Navbar.svelte +68 -0
- package/dist/layout/Navbar.svelte.d.ts +31 -0
- package/dist/layout/PageHeader.svelte +77 -0
- package/dist/layout/PageHeader.svelte.d.ts +33 -0
- package/dist/layout/Section.svelte +72 -0
- package/dist/layout/Section.svelte.d.ts +40 -0
- package/dist/layout/Sidebar.svelte +54 -0
- package/dist/layout/Sidebar.svelte.d.ts +27 -0
- package/dist/layout/Spacer.svelte +12 -0
- package/dist/layout/Spacer.svelte.d.ts +6 -0
- package/dist/layout/Tabs.svelte +85 -0
- package/dist/layout/Tabs.svelte.d.ts +42 -0
- package/dist/layout/VStack.svelte +12 -0
- package/dist/layout/VStack.svelte.d.ts +29 -0
- package/dist/layout/index.d.ts +38 -0
- package/dist/layout/index.js +38 -0
- package/dist/layout/space.d.ts +44 -0
- package/dist/layout/space.js +76 -0
- package/dist/layout/types.d.ts +52 -0
- package/dist/layout/types.js +27 -0
- package/dist/links/ContextLinks.svelte +28 -0
- package/dist/links/ContextLinks.svelte.d.ts +20 -0
- package/dist/links/EmailLink.svelte +26 -0
- package/dist/links/EmailLink.svelte.d.ts +20 -0
- package/dist/links/index.d.ts +7 -0
- package/dist/links/index.js +7 -0
- package/dist/media/Figure.svelte +26 -0
- package/dist/media/Figure.svelte.d.ts +12 -0
- package/dist/media/Image.svelte +76 -0
- package/dist/media/Image.svelte.d.ts +41 -0
- package/dist/media/Video.svelte +65 -0
- package/dist/media/Video.svelte.d.ts +29 -0
- package/dist/media/image-dimensions.d.ts +28 -0
- package/dist/media/image-dimensions.js +34 -0
- package/dist/media/index.d.ts +10 -0
- package/dist/media/index.js +10 -0
- package/dist/search/CommandPalette.svelte +257 -0
- package/dist/search/CommandPalette.svelte.d.ts +59 -0
- package/dist/search/index.d.ts +13 -0
- package/dist/search/index.js +13 -0
- package/dist/search/types.d.ts +40 -0
- package/dist/search/types.js +20 -0
- package/dist/seo/Head.svelte +190 -0
- package/dist/seo/Head.svelte.d.ts +86 -0
- package/dist/seo/JsonLd.svelte +30 -0
- package/dist/seo/JsonLd.svelte.d.ts +20 -0
- package/dist/seo/index.d.ts +18 -0
- package/dist/seo/index.js +17 -0
- package/dist/seo/json-ld.d.ts +33 -0
- package/dist/seo/json-ld.js +29 -0
- package/dist/seo/og-image.d.ts +72 -0
- package/dist/seo/og-image.js +82 -0
- package/dist/seo/types.d.ts +43 -0
- package/dist/seo/types.js +6 -0
- package/dist/theme.css +161 -0
- package/dist/tips/PopoverTip.svelte +80 -0
- package/dist/tips/PopoverTip.svelte.d.ts +33 -0
- package/dist/tips/Tip.svelte +91 -0
- package/dist/tips/Tip.svelte.d.ts +25 -0
- package/dist/tips/index.d.ts +15 -0
- package/dist/tips/index.js +14 -0
- package/dist/tips/tip-stack.d.ts +26 -0
- package/dist/tips/tip-stack.js +37 -0
- package/dist/tips/tip-store.svelte.d.ts +75 -0
- package/dist/tips/tip-store.svelte.js +158 -0
- package/dist/tips/types.d.ts +46 -0
- package/dist/tips/types.js +6 -0
- package/dist/ui/Accordion.svelte +75 -0
- package/dist/ui/Accordion.svelte.d.ts +50 -0
- package/dist/ui/AccordionItem.svelte +73 -0
- package/dist/ui/AccordionItem.svelte.d.ts +18 -0
- package/dist/ui/Alert.svelte +61 -0
- package/dist/ui/Alert.svelte.d.ts +37 -0
- package/dist/ui/Badge.svelte +39 -0
- package/dist/ui/Badge.svelte.d.ts +32 -0
- package/dist/ui/Button.svelte +44 -0
- package/dist/ui/Button.svelte.d.ts +29 -0
- package/dist/ui/ButtonGroup.svelte +24 -0
- package/dist/ui/ButtonGroup.svelte.d.ts +17 -0
- package/dist/ui/Card.svelte +49 -0
- package/dist/ui/Card.svelte.d.ts +44 -0
- package/dist/ui/Chip.svelte +58 -0
- package/dist/ui/Chip.svelte.d.ts +21 -0
- package/dist/ui/ConfirmButton.svelte +75 -0
- package/dist/ui/ConfirmButton.svelte.d.ts +48 -0
- package/dist/ui/ContextMenu.svelte +75 -0
- package/dist/ui/ContextMenu.svelte.d.ts +25 -0
- package/dist/ui/Disclosure.svelte +46 -0
- package/dist/ui/Disclosure.svelte.d.ts +22 -0
- package/dist/ui/Divider.svelte +47 -0
- package/dist/ui/Divider.svelte.d.ts +28 -0
- package/dist/ui/DropdownMenu.svelte +44 -0
- package/dist/ui/DropdownMenu.svelte.d.ts +30 -0
- package/dist/ui/EmptyState.svelte +37 -0
- package/dist/ui/EmptyState.svelte.d.ts +22 -0
- package/dist/ui/ExternalLink.svelte +38 -0
- package/dist/ui/ExternalLink.svelte.d.ts +34 -0
- package/dist/ui/Heading.svelte +58 -0
- package/dist/ui/Heading.svelte.d.ts +22 -0
- package/dist/ui/Link.svelte +34 -0
- package/dist/ui/Link.svelte.d.ts +20 -0
- package/dist/ui/LinkButton.svelte +51 -0
- package/dist/ui/LinkButton.svelte.d.ts +33 -0
- package/dist/ui/Menu.svelte +24 -0
- package/dist/ui/Menu.svelte.d.ts +13 -0
- package/dist/ui/MenuCheckboxItem.svelte +33 -0
- package/dist/ui/MenuCheckboxItem.svelte.d.ts +20 -0
- package/dist/ui/MenuItem.svelte +73 -0
- package/dist/ui/MenuItem.svelte.d.ts +21 -0
- package/dist/ui/MenuRadioGroup.svelte +25 -0
- package/dist/ui/MenuRadioGroup.svelte.d.ts +20 -0
- package/dist/ui/MenuRadioItem.svelte +20 -0
- package/dist/ui/MenuRadioItem.svelte.d.ts +15 -0
- package/dist/ui/MenuSeparator.svelte +27 -0
- package/dist/ui/MenuSeparator.svelte.d.ts +8 -0
- package/dist/ui/MenuSub.svelte +24 -0
- package/dist/ui/MenuSub.svelte.d.ts +15 -0
- package/dist/ui/Popover.svelte +63 -0
- package/dist/ui/Popover.svelte.d.ts +40 -0
- package/dist/ui/ShareButton.svelte +64 -0
- package/dist/ui/ShareButton.svelte.d.ts +39 -0
- package/dist/ui/Skeleton.svelte +43 -0
- package/dist/ui/Skeleton.svelte.d.ts +22 -0
- package/dist/ui/Spinner.svelte +41 -0
- package/dist/ui/Spinner.svelte.d.ts +35 -0
- package/dist/ui/Stack.svelte +36 -0
- package/dist/ui/Stack.svelte.d.ts +48 -0
- package/dist/ui/ThemeToggle.svelte +65 -0
- package/dist/ui/ThemeToggle.svelte.d.ts +24 -0
- package/dist/ui/ToggleButton.svelte +58 -0
- package/dist/ui/ToggleButton.svelte.d.ts +45 -0
- package/dist/ui/ToggleGroup.svelte +142 -0
- package/dist/ui/ToggleGroup.svelte.d.ts +86 -0
- package/dist/ui/Toolbar.svelte +40 -0
- package/dist/ui/Toolbar.svelte.d.ts +20 -0
- package/dist/ui/ToolbarButton.svelte +29 -0
- package/dist/ui/ToolbarButton.svelte.d.ts +21 -0
- package/dist/ui/ToolbarLink.svelte +21 -0
- package/dist/ui/ToolbarLink.svelte.d.ts +12 -0
- package/dist/ui/ToolbarSeparator.svelte +22 -0
- package/dist/ui/ToolbarSeparator.svelte.d.ts +12 -0
- package/dist/ui/ToolbarToggleGroup.svelte +66 -0
- package/dist/ui/ToolbarToggleGroup.svelte.d.ts +52 -0
- package/dist/ui/Tooltip.svelte +54 -0
- package/dist/ui/Tooltip.svelte.d.ts +35 -0
- package/dist/ui/VisuallyHidden.svelte +23 -0
- package/dist/ui/VisuallyHidden.svelte.d.ts +10 -0
- package/dist/ui/accordion-context.d.ts +26 -0
- package/dist/ui/accordion-context.js +23 -0
- package/dist/ui/colour-token.d.ts +41 -0
- package/dist/ui/colour-token.js +49 -0
- package/dist/ui/context-menu.d.ts +13 -0
- package/dist/ui/context-menu.js +13 -0
- package/dist/ui/index.d.ts +63 -0
- package/dist/ui/index.js +62 -0
- package/dist/ui/menu-context.d.ts +20 -0
- package/dist/ui/menu-context.js +22 -0
- package/dist/ui/menu-parts/CheckboxItemPart.svelte +26 -0
- package/dist/ui/menu-parts/CheckboxItemPart.svelte.d.ts +5 -0
- package/dist/ui/menu-parts/ItemPart.svelte +29 -0
- package/dist/ui/menu-parts/ItemPart.svelte.d.ts +5 -0
- package/dist/ui/menu-parts/RadioGroupPart.svelte +24 -0
- package/dist/ui/menu-parts/RadioGroupPart.svelte.d.ts +5 -0
- package/dist/ui/menu-parts/RadioItemPart.svelte +22 -0
- package/dist/ui/menu-parts/RadioItemPart.svelte.d.ts +5 -0
- package/dist/ui/menu-parts/SeparatorPart.svelte +16 -0
- package/dist/ui/menu-parts/SeparatorPart.svelte.d.ts +5 -0
- package/dist/ui/menu-parts/SubPart.svelte +28 -0
- package/dist/ui/menu-parts/SubPart.svelte.d.ts +5 -0
- package/dist/ui/menu-parts/menu-parts.d.ts +104 -0
- package/dist/ui/menu-parts/menu-parts.js +31 -0
- package/dist/ui/menu-parts/parts.d.ts +12 -0
- package/dist/ui/menu-parts/parts.js +27 -0
- package/dist/ui/slug.d.ts +19 -0
- package/dist/ui/slug.js +25 -0
- package/dist/ui/toggle-classes.d.ts +39 -0
- package/dist/ui/toggle-classes.js +36 -0
- package/dist/ui/tones.d.ts +103 -0
- package/dist/ui/tones.js +240 -0
- package/package.json +41 -25
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<!-- @component
|
|
2
|
+
A stack of headed, collapsible sections on bits-ui `Accordion`, with single- or multi-open behaviour.
|
|
3
|
+
-->
|
|
4
|
+
<!--
|
|
5
|
+
Accordion — a vertical stack of `AccordionItem`s, each a real heading whose
|
|
6
|
+
button expands its panel. `type="single"` keeps at most one open (an FAQ, a
|
|
7
|
+
care guide by season); `type="multiple"` lets any number open.
|
|
8
|
+
|
|
9
|
+
Why not a stack of `Disclosure`s: `<summary>` has an implicit button role
|
|
10
|
+
whose children are presentational, so a heading inside it drops out of the
|
|
11
|
+
heading tree, and native `<details name>` groups have no "which one is
|
|
12
|
+
open" value and no "keep one open" rule. A single `Disclosure` stays
|
|
13
|
+
native; this is for the heading-structured, coordinated case.
|
|
14
|
+
|
|
15
|
+
ARIA and keyboard contract (APG Accordion): bits-ui gives each trigger
|
|
16
|
+
`aria-expanded`, Enter / Space to toggle, ↑ / ↓ and Home / End between
|
|
17
|
+
headers. We render each header as a native `<h{headingLevel}>`, wire
|
|
18
|
+
`aria-controls` from the button to its panel, and make each panel a
|
|
19
|
+
`region` labelled by its button. With `required`, the open item's button
|
|
20
|
+
reports `aria-disabled="true"`, so a reader isn't offered an action that
|
|
21
|
+
does nothing. With `searchable` (the default) a closed panel keeps
|
|
22
|
+
`hidden="until-found"`, so find-in-page still reaches it and opens it, the
|
|
23
|
+
one advantage `<details>` had.
|
|
24
|
+
|
|
25
|
+
`headingLevel`, `variant`, `joined` and `searchable` reach the items
|
|
26
|
+
through context (`accordion-context.ts`), so they cannot drift per item.
|
|
27
|
+
-->
|
|
28
|
+
<script lang="ts">import { Accordion } from "bits-ui";
|
|
29
|
+
import { setAccordionContext } from "./accordion-context.js";
|
|
30
|
+
let { type, value = $bindable(), required = false, headingLevel = 3, variant = "arrow", joined = true, searchable = true, disabled = false, children, class: className, ...rest } = $props();
|
|
31
|
+
function openValues() {
|
|
32
|
+
if (value === undefined || value === "") return [];
|
|
33
|
+
return typeof value === "string" ? [value] : value;
|
|
34
|
+
}
|
|
35
|
+
setAccordionContext({
|
|
36
|
+
headingLevel: () => headingLevel,
|
|
37
|
+
variant: () => variant,
|
|
38
|
+
joined: () => joined,
|
|
39
|
+
searchable: () => searchable,
|
|
40
|
+
isOpen: (item) => openValues().includes(item),
|
|
41
|
+
isLocked: (item) => type === "single" && required && value === item
|
|
42
|
+
});
|
|
43
|
+
const rootClass = $derived([
|
|
44
|
+
"w-full",
|
|
45
|
+
joined && "join join-vertical",
|
|
46
|
+
className
|
|
47
|
+
]);
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
{#snippet root({ props }: { props: Record<string, unknown> })}
|
|
51
|
+
<div {...rest} {...props} class={rootClass}>{@render children()}</div>
|
|
52
|
+
{/snippet}
|
|
53
|
+
|
|
54
|
+
{#if type === 'single'}
|
|
55
|
+
<Accordion.Root
|
|
56
|
+
type="single"
|
|
57
|
+
{disabled}
|
|
58
|
+
bind:value={
|
|
59
|
+
() => (typeof value === 'string' ? value : ''),
|
|
60
|
+
(next) => {
|
|
61
|
+
// `required`: a change to '' is the open item closing; refuse it.
|
|
62
|
+
if (required && next === '') return;
|
|
63
|
+
value = next;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
child={root}
|
|
67
|
+
/>
|
|
68
|
+
{:else}
|
|
69
|
+
<Accordion.Root
|
|
70
|
+
type="multiple"
|
|
71
|
+
{disabled}
|
|
72
|
+
bind:value={() => [...openValues()], (next) => (value = next)}
|
|
73
|
+
child={root}
|
|
74
|
+
/>
|
|
75
|
+
{/if}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Accordion } from 'bits-ui';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
import type { DisclosureVariant, HeadingLevel } from './tones.ts';
|
|
5
|
+
type Props = Omit<HTMLAttributes<HTMLDivElement>, 'onchange'> & {
|
|
6
|
+
/**
|
|
7
|
+
* The level of each item's heading.
|
|
8
|
+
* @defaultValue `3`
|
|
9
|
+
*/
|
|
10
|
+
headingLevel?: HeadingLevel | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The expand marker, shared with `Disclosure`.
|
|
13
|
+
* @defaultValue `'arrow'`
|
|
14
|
+
*/
|
|
15
|
+
variant?: DisclosureVariant | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Join the items into one bordered block (daisyUI `join join-vertical`).
|
|
18
|
+
* @defaultValue `true`
|
|
19
|
+
*/
|
|
20
|
+
joined?: boolean | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Keep closed panels reachable by find-in-page (`hidden="until-found"`).
|
|
23
|
+
* @defaultValue `true`
|
|
24
|
+
*/
|
|
25
|
+
searchable?: boolean | undefined;
|
|
26
|
+
/** Disable every item. */
|
|
27
|
+
disabled?: boolean | undefined;
|
|
28
|
+
/** The `AccordionItem`s. */
|
|
29
|
+
children: Snippet<[]>;
|
|
30
|
+
} & ({
|
|
31
|
+
/** At most one item open. */
|
|
32
|
+
type: 'single';
|
|
33
|
+
/** The open item's value, `''` for none. Bindable. */
|
|
34
|
+
value?: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Refuse to close the open item, so exactly one stays open once one is.
|
|
37
|
+
* @defaultValue `false`
|
|
38
|
+
*/
|
|
39
|
+
required?: boolean | undefined;
|
|
40
|
+
} | {
|
|
41
|
+
/** Any number of items open. */
|
|
42
|
+
type: 'multiple';
|
|
43
|
+
/** The open items' values. Bindable. */
|
|
44
|
+
value?: readonly string[] | undefined;
|
|
45
|
+
required?: undefined;
|
|
46
|
+
});
|
|
47
|
+
/** A stack of headed, collapsible sections on bits-ui `Accordion`, with single- or multi-open behaviour. */
|
|
48
|
+
declare const Accordion: import("svelte").Component<Props, {}, "value">;
|
|
49
|
+
type Accordion = ReturnType<typeof Accordion>;
|
|
50
|
+
export default Accordion;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<!-- @component
|
|
2
|
+
One headed, collapsible section of an `Accordion`.
|
|
3
|
+
-->
|
|
4
|
+
<!--
|
|
5
|
+
AccordionItem — a heading whose button expands a panel. Must sit inside an
|
|
6
|
+
`Accordion`, which supplies the heading level, the marker and the open
|
|
7
|
+
state (see `accordion-context.ts`).
|
|
8
|
+
|
|
9
|
+
The header is a native `<h{level}>` rendered through bits-ui's `child`
|
|
10
|
+
snippet, so the redundant `role="heading"` / `aria-level` bits-ui would put
|
|
11
|
+
on a `<div>` are dropped. The daisyUI marker is the heading's `::after`,
|
|
12
|
+
outside the button, so it never joins the button's accessible name.
|
|
13
|
+
-->
|
|
14
|
+
<script lang="ts">import { Accordion } from "bits-ui";
|
|
15
|
+
import { getAccordionContext } from "./accordion-context.js";
|
|
16
|
+
import { collapseVariant } from "./tones.js";
|
|
17
|
+
const uid = $props.id();
|
|
18
|
+
let { value = uid, title, disabled, contentClass, children, class: className, ...rest } = $props();
|
|
19
|
+
const accordion = getAccordionContext();
|
|
20
|
+
const triggerId = `${uid}-trigger`;
|
|
21
|
+
const contentId = `${uid}-content`;
|
|
22
|
+
const open = $derived(accordion.isOpen(value));
|
|
23
|
+
const locked = $derived(accordion.isLocked(value));
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<Accordion.Item {value} {...disabled === undefined ? {} : { disabled }}>
|
|
27
|
+
{#snippet child({ props: itemProps })}
|
|
28
|
+
<div
|
|
29
|
+
{...rest}
|
|
30
|
+
{...itemProps}
|
|
31
|
+
class={[
|
|
32
|
+
'collapse border-base-300 bg-base-100 border',
|
|
33
|
+
open ? 'collapse-open' : 'collapse-close',
|
|
34
|
+
collapseVariant[accordion.variant()],
|
|
35
|
+
accordion.joined() && 'join-item',
|
|
36
|
+
className,
|
|
37
|
+
]}
|
|
38
|
+
>
|
|
39
|
+
<Accordion.Header level={accordion.headingLevel()}>
|
|
40
|
+
{#snippet child({ props })}
|
|
41
|
+
{@const { role: _role, 'aria-level': _level, ...headerProps } = props}
|
|
42
|
+
<svelte:element
|
|
43
|
+
this={`h${accordion.headingLevel()}`}
|
|
44
|
+
{...headerProps}
|
|
45
|
+
class="collapse-title p-0 text-base font-medium"
|
|
46
|
+
>
|
|
47
|
+
<Accordion.Trigger id={triggerId}>
|
|
48
|
+
{#snippet child({ props: triggerProps })}
|
|
49
|
+
<button
|
|
50
|
+
{...triggerProps}
|
|
51
|
+
aria-controls={contentId}
|
|
52
|
+
{...locked ? { 'aria-disabled': 'true' } : {}}
|
|
53
|
+
class="w-full cursor-pointer px-4 py-4 pe-12 text-start disabled:cursor-not-allowed disabled:opacity-60"
|
|
54
|
+
>
|
|
55
|
+
{#if typeof title === 'string'}{title}{:else}{@render title()}{/if}
|
|
56
|
+
</button>
|
|
57
|
+
{/snippet}
|
|
58
|
+
</Accordion.Trigger>
|
|
59
|
+
</svelte:element>
|
|
60
|
+
{/snippet}
|
|
61
|
+
</Accordion.Header>
|
|
62
|
+
<Accordion.Content
|
|
63
|
+
id={contentId}
|
|
64
|
+
role="region"
|
|
65
|
+
aria-labelledby={triggerId}
|
|
66
|
+
hiddenUntilFound={accordion.searchable()}
|
|
67
|
+
class={['collapse-content', contentClass]}
|
|
68
|
+
>
|
|
69
|
+
{@render children()}
|
|
70
|
+
</Accordion.Content>
|
|
71
|
+
</div>
|
|
72
|
+
{/snippet}
|
|
73
|
+
</Accordion.Item>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
|
+
/** Identifies the item in the `Accordion`'s `value`; defaults to a generated id. */
|
|
5
|
+
value?: string | undefined;
|
|
6
|
+
/** The header text, or a snippet for richer markup. */
|
|
7
|
+
title: string | Snippet<[]>;
|
|
8
|
+
/** Disable this item's button. */
|
|
9
|
+
disabled?: boolean | undefined;
|
|
10
|
+
/** Extra classes on the panel. */
|
|
11
|
+
contentClass?: string | undefined;
|
|
12
|
+
/** The panel's content. */
|
|
13
|
+
children: Snippet<[]>;
|
|
14
|
+
}
|
|
15
|
+
/** One headed, collapsible section of an `Accordion`. */
|
|
16
|
+
declare const AccordionItem: import("svelte").Component<Props, {}, "">;
|
|
17
|
+
type AccordionItem = ReturnType<typeof AccordionItem>;
|
|
18
|
+
export default AccordionItem;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!-- @component
|
|
2
|
+
The daisyUI `alert`: a tone-coloured notice with an icon, an optional lead-in and an optional dismiss button.
|
|
3
|
+
-->
|
|
4
|
+
<!--
|
|
5
|
+
Alert — the daisyUI `alert`: a tone-coloured notice with an icon, an
|
|
6
|
+
optional bold lead-in and an optional dismiss button.
|
|
7
|
+
|
|
8
|
+
ARIA contract, and the reason `live` is a prop rather than a constant: an
|
|
9
|
+
alert that is on the page when it loads must NOT be announced, an alert
|
|
10
|
+
that appears in response to something the reader did must be, and the
|
|
11
|
+
urgency depends on what happened. `live` picks between `role="alert"`
|
|
12
|
+
(assertive — interrupt, the default for `error`), `role="status"` (polite —
|
|
13
|
+
wait for a pause, the default for everything else) and `off`, which renders
|
|
14
|
+
no role at all. Static page furniture wants `off`; a form failure wants
|
|
15
|
+
`assertive`.
|
|
16
|
+
|
|
17
|
+
A live region must be IN the document before its content changes, so an app
|
|
18
|
+
that swaps an alert's text keeps the component mounted; one that mounts the
|
|
19
|
+
alert on failure gets the announcement from the insertion.
|
|
20
|
+
|
|
21
|
+
The tone icon is `aria-hidden` — it restates the tone, which the text
|
|
22
|
+
already carries — and the dismiss button is a labelled `Button`, not a
|
|
23
|
+
bare glyph.
|
|
24
|
+
-->
|
|
25
|
+
<script lang="ts">import { CircleCheck, CircleX, Info, TriangleAlert, X } from "@lucide/svelte";
|
|
26
|
+
import Button from "./Button.svelte";
|
|
27
|
+
import { alertTone, alertVariant } from "./tones.js";
|
|
28
|
+
import VisuallyHidden from "./VisuallyHidden.svelte";
|
|
29
|
+
let { tone = "info", variant = "soft", title, live, icon, onDismiss, dismissLabel = "Dismiss", children, class: className, ...rest } = $props();
|
|
30
|
+
const liveness = $derived(live ?? (tone === "error" ? "assertive" : "polite"));
|
|
31
|
+
// `role="alert"` already implies `aria-live="assertive"` and `role="status"`
|
|
32
|
+
// implies `polite`; spelling the second one out as well is how a region ends
|
|
33
|
+
// up announced twice.
|
|
34
|
+
const role = $derived(liveness === "assertive" ? "alert" : liveness === "polite" ? "status" : undefined);
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<div {...rest} {role} class={['alert', alertTone[tone], alertVariant[variant], className]}>
|
|
38
|
+
{#if icon}
|
|
39
|
+
{@render icon()}
|
|
40
|
+
{:else if tone === 'success'}
|
|
41
|
+
<CircleCheck class="size-5 shrink-0" aria-hidden="true" />
|
|
42
|
+
{:else if tone === 'warning'}
|
|
43
|
+
<TriangleAlert class="size-5 shrink-0" aria-hidden="true" />
|
|
44
|
+
{:else if tone === 'error'}
|
|
45
|
+
<CircleX class="size-5 shrink-0" aria-hidden="true" />
|
|
46
|
+
{:else}
|
|
47
|
+
<Info class="size-5 shrink-0" aria-hidden="true" />
|
|
48
|
+
{/if}
|
|
49
|
+
<div>
|
|
50
|
+
{#if title !== undefined}
|
|
51
|
+
<p class="font-semibold">{title}</p>
|
|
52
|
+
{/if}
|
|
53
|
+
{@render children()}
|
|
54
|
+
</div>
|
|
55
|
+
{#if onDismiss}
|
|
56
|
+
<Button variant="ghost" size="sm" class="btn-square" onclick={onDismiss}>
|
|
57
|
+
<X class="size-4" aria-hidden="true" />
|
|
58
|
+
<VisuallyHidden>{dismissLabel}</VisuallyHidden>
|
|
59
|
+
</Button>
|
|
60
|
+
{/if}
|
|
61
|
+
</div>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { type AlertVariant, type StatusTone } from './tones.ts';
|
|
4
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Status colour and icon.
|
|
7
|
+
* @defaultValue `'info'`
|
|
8
|
+
*/
|
|
9
|
+
tone?: StatusTone | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* daisyUI alert style.
|
|
12
|
+
* @defaultValue `'soft'`
|
|
13
|
+
*/
|
|
14
|
+
variant?: AlertVariant | undefined;
|
|
15
|
+
/** Bold lead-in rendered above the body. */
|
|
16
|
+
title?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* How — and whether — assistive technology announces this alert.
|
|
19
|
+
* Defaults to `assertive` for `error` and `polite` for every other tone.
|
|
20
|
+
*/
|
|
21
|
+
live?: 'assertive' | 'polite' | 'off' | undefined;
|
|
22
|
+
/** Replace the tone's default icon. */
|
|
23
|
+
icon?: Snippet<[]> | undefined;
|
|
24
|
+
/** When set, renders a dismiss button that calls it. */
|
|
25
|
+
onDismiss?: (() => void) | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Accessible name of the dismiss button.
|
|
28
|
+
* @defaultValue `'Dismiss'`
|
|
29
|
+
*/
|
|
30
|
+
dismissLabel?: string | undefined;
|
|
31
|
+
/** The message, after the optional bold lead-in. */
|
|
32
|
+
children: Snippet<[]>;
|
|
33
|
+
}
|
|
34
|
+
/** The daisyUI `alert`: a tone-coloured notice with an icon, an optional lead-in and an optional dismiss button. */
|
|
35
|
+
declare const Alert: import("svelte").Component<Props, {}, "">;
|
|
36
|
+
type Alert = ReturnType<typeof Alert>;
|
|
37
|
+
export default Alert;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!-- @component
|
|
2
|
+
The daisyUI `badge`: a short inline label for a status, a count or a category.
|
|
3
|
+
-->
|
|
4
|
+
<!--
|
|
5
|
+
Badge — the daisyUI `badge`: a short, inline label for a status, a count or
|
|
6
|
+
a category.
|
|
7
|
+
|
|
8
|
+
Two colour paths. A semantic `tone` picks the badge's daisyUI colour, which
|
|
9
|
+
is what a status ("Draft", "Overdue") wants. A `colourToken` instead names a
|
|
10
|
+
custom property the consuming app's theme declares, which is what a
|
|
11
|
+
subject-coloured label (a party, a rank, a project) wants: the badge then
|
|
12
|
+
tints its border and a translucent fill from that one variable and keeps
|
|
13
|
+
`base-content` text, so it stays legible on either theme whatever the hue.
|
|
14
|
+
`colourToken` wins over `tone` — a subject's colour is not a tone.
|
|
15
|
+
|
|
16
|
+
ARIA contract: none, deliberately. A badge is a decorative frame around
|
|
17
|
+
text, so the text has to carry the meaning: a status badge showing only a
|
|
18
|
+
colour is a status nobody can read. If the badge's own text is not enough
|
|
19
|
+
in context, label the thing it sits on, not the badge.
|
|
20
|
+
-->
|
|
21
|
+
<script lang="ts">import { BADGE_COLOUR_PROPERTY, colourTokenStyle } from "./colour-token.js";
|
|
22
|
+
import { badgeSize, badgeTone, badgeVariant } from "./tones.js";
|
|
23
|
+
let { tone = "neutral", variant = "soft", size = "md", colourToken, children, class: className, ...rest } = $props();
|
|
24
|
+
const classes = $derived(colourToken === undefined ? [
|
|
25
|
+
"badge",
|
|
26
|
+
badgeTone[tone],
|
|
27
|
+
badgeVariant[variant],
|
|
28
|
+
badgeSize[size],
|
|
29
|
+
className
|
|
30
|
+
] : [
|
|
31
|
+
"badge border-(--badge-colour) bg-(--badge-colour)/15 text-base-content",
|
|
32
|
+
badgeSize[size],
|
|
33
|
+
className
|
|
34
|
+
]);
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<span {...rest} class={classes} style={colourTokenStyle(BADGE_COLOUR_PROPERTY, colourToken)}>
|
|
38
|
+
{@render children()}
|
|
39
|
+
</span>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { type BadgeVariant, type Size, type Tone } from './tones.ts';
|
|
4
|
+
interface Props extends HTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Semantic colour.
|
|
7
|
+
* @defaultValue `'neutral'`
|
|
8
|
+
*/
|
|
9
|
+
tone?: Tone | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* daisyUI badge style.
|
|
12
|
+
* @defaultValue `'soft'`
|
|
13
|
+
*/
|
|
14
|
+
variant?: BadgeVariant | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* daisyUI size step.
|
|
17
|
+
* @defaultValue `'md'`
|
|
18
|
+
*/
|
|
19
|
+
size?: Size | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* A CSS custom-property name the app's theme declares (`--party-alp`).
|
|
22
|
+
* Overrides `tone` and `variant`; falls back to the theme's neutral
|
|
23
|
+
* colour when the token is undeclared.
|
|
24
|
+
*/
|
|
25
|
+
colourToken?: string | undefined;
|
|
26
|
+
/** The badge text; keep it to a word or a count. */
|
|
27
|
+
children: Snippet<[]>;
|
|
28
|
+
}
|
|
29
|
+
/** The daisyUI `badge`: a short inline label for a status, a count or a category. */
|
|
30
|
+
declare const Badge: import("svelte").Component<Props, {}, "">;
|
|
31
|
+
type Badge = ReturnType<typeof Badge>;
|
|
32
|
+
export default Badge;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<!-- @component
|
|
2
|
+
The daisyUI `btn` with tone, variant and size; `loading` disables it and sets `aria-busy` without changing its name. `type` defaults to `button`, not the native `submit`.
|
|
3
|
+
-->
|
|
4
|
+
<!--
|
|
5
|
+
Button — the daisyUI `btn`, with tone / variant / size chosen from literal
|
|
6
|
+
lookup tables and a `loading` state that is a real busy state rather than a
|
|
7
|
+
spinner drawn over a live control.
|
|
8
|
+
|
|
9
|
+
ARIA contract: a native `<button>`, so role and keyboard (Enter and Space)
|
|
10
|
+
come from the platform and nothing is hand-rolled. While `loading` the
|
|
11
|
+
button is `disabled` AND `aria-busy="true"` — disabled alone says "you may
|
|
12
|
+
not", busy says "it is already happening" — and the spinner that replaces
|
|
13
|
+
the leading icon is `aria-hidden`, because the accessible name must not
|
|
14
|
+
change when the state does.
|
|
15
|
+
|
|
16
|
+
`type` defaults to `button`: a button inside a form that does not say what
|
|
17
|
+
it is submits it, which is almost never what a call site means.
|
|
18
|
+
-->
|
|
19
|
+
<script lang="ts">import Spinner from "./Spinner.svelte";
|
|
20
|
+
import { buttonSize, buttonTone, buttonVariant } from "./tones.js";
|
|
21
|
+
let { tone, variant = "solid", size = "md", loading = false, block = false, icon, children, type = "button", disabled = false, class: className, ...rest } = $props();
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<button
|
|
25
|
+
{...rest}
|
|
26
|
+
{type}
|
|
27
|
+
disabled={disabled || loading}
|
|
28
|
+
aria-busy={loading ? 'true' : undefined}
|
|
29
|
+
class={[
|
|
30
|
+
'btn',
|
|
31
|
+
tone !== undefined && buttonTone[tone],
|
|
32
|
+
buttonVariant[variant],
|
|
33
|
+
buttonSize[size],
|
|
34
|
+
block && 'btn-block',
|
|
35
|
+
className,
|
|
36
|
+
]}
|
|
37
|
+
>
|
|
38
|
+
{#if loading}
|
|
39
|
+
<Spinner decorative size="sm" />
|
|
40
|
+
{:else if icon}
|
|
41
|
+
{@render icon()}
|
|
42
|
+
{/if}
|
|
43
|
+
{@render children()}
|
|
44
|
+
</button>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
import { type ButtonVariant, type Size, type Tone } from './tones.ts';
|
|
4
|
+
interface Props extends HTMLButtonAttributes {
|
|
5
|
+
/** Semantic colour. Omitted, the button is daisyUI's neutral `btn`. */
|
|
6
|
+
tone?: Tone | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* daisyUI button style.
|
|
9
|
+
* @defaultValue `'solid'`
|
|
10
|
+
*/
|
|
11
|
+
variant?: ButtonVariant | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* daisyUI size step.
|
|
14
|
+
* @defaultValue `'md'`
|
|
15
|
+
*/
|
|
16
|
+
size?: Size | undefined;
|
|
17
|
+
/** Disables the button, marks it busy and shows a spinner. */
|
|
18
|
+
loading?: boolean | undefined;
|
|
19
|
+
/** Full-width. */
|
|
20
|
+
block?: boolean | undefined;
|
|
21
|
+
/** Leading icon, replaced by the spinner while `loading`. */
|
|
22
|
+
icon?: Snippet<[]> | undefined;
|
|
23
|
+
/** The button text; its accessible name. */
|
|
24
|
+
children: Snippet<[]>;
|
|
25
|
+
}
|
|
26
|
+
/** The daisyUI `btn` with tone, variant and size; `loading` disables it and sets `aria-busy` without changing its name. `type` defaults to `button`, not the native `submit`. */
|
|
27
|
+
declare const Button: import("svelte").Component<Props, {}, "">;
|
|
28
|
+
type Button = ReturnType<typeof Button>;
|
|
29
|
+
export default Button;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- @component
|
|
2
|
+
A named cluster of independent buttons in a daisyUI `join`; each stays its own Tab stop.
|
|
3
|
+
-->
|
|
4
|
+
<!--
|
|
5
|
+
ButtonGroup — "Save | Save as… | Discard" on a form: presentational, a
|
|
6
|
+
`role="group"` with a name, no keyboard behaviour by design. For a row of
|
|
7
|
+
controls that should be ONE Tab stop with arrow keys, use `Toolbar`.
|
|
8
|
+
|
|
9
|
+
Children join the bar by taking `class="join-item"` themselves. The
|
|
10
|
+
group does not reach into them through a context, so `Button` stays
|
|
11
|
+
free of any group coupling.
|
|
12
|
+
-->
|
|
13
|
+
<script lang="ts">let { label, orientation = "horizontal", children, class: className, ...rest } = $props();
|
|
14
|
+
const orientationClass = {
|
|
15
|
+
horizontal: "",
|
|
16
|
+
vertical: "join-vertical",
|
|
17
|
+
responsive: "join-vertical sm:join-horizontal"
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<div {...rest} role="group" aria-label={label} class={['join', orientationClass[orientation], className]}>
|
|
23
|
+
{@render children()}
|
|
24
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
4
|
+
/** Accessible name of the group ("Save options"). */
|
|
5
|
+
label: string;
|
|
6
|
+
/**
|
|
7
|
+
* `responsive` stacks below `sm`.
|
|
8
|
+
* @defaultValue `'horizontal'`
|
|
9
|
+
*/
|
|
10
|
+
orientation?: 'horizontal' | 'vertical' | 'responsive' | undefined;
|
|
11
|
+
/** The buttons, each with `class="join-item"`. */
|
|
12
|
+
children: Snippet<[]>;
|
|
13
|
+
}
|
|
14
|
+
/** A named cluster of independent buttons in a daisyUI `join`; each stays its own Tab stop. */
|
|
15
|
+
declare const ButtonGroup: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type ButtonGroup = ReturnType<typeof ButtonGroup>;
|
|
17
|
+
export default ButtonGroup;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!-- @component
|
|
2
|
+
The bordered `base-100` surface: a padded body with an optional heading, a figure above and an actions row below.
|
|
3
|
+
-->
|
|
4
|
+
<!--
|
|
5
|
+
Card — the surface. One bordered box on `base-100` with a padded body, an
|
|
6
|
+
optional heading, an optional figure above it and an optional actions row
|
|
7
|
+
under it.
|
|
8
|
+
|
|
9
|
+
This component exists to END the hand-written
|
|
10
|
+
`card card-border bg-base-100 p-6 shadow-sm`, of which the four apps carried
|
|
11
|
+
56 copies. A bare `<Card>` renders exactly that look, so adopting it is a
|
|
12
|
+
substitution and never a redesign; every knob below is an opt-in for a site
|
|
13
|
+
that wanted something slightly different and previously got it by editing
|
|
14
|
+
the class list in place.
|
|
15
|
+
|
|
16
|
+
ARIA contract: `title` is a REAL heading at `headingLevel`, not a styled
|
|
17
|
+
`<p>`, so a card in a list is reachable by heading navigation and the
|
|
18
|
+
document outline stays true. The default is `h2` — a card under the page's
|
|
19
|
+
`<h1>`. `as` picks the element that carries the semantics: `article` for a
|
|
20
|
+
self-contained item (the default), `section` for a labelled region of the
|
|
21
|
+
page, `div` for pure grouping.
|
|
22
|
+
-->
|
|
23
|
+
<script lang="ts">import { cardSize, cardVariant } from "./tones.js";
|
|
24
|
+
let { as = "article", title, headingLevel = 2, variant = "border", size = "md", padded = true, bodyClass, figure, actions, children, class: className, ...rest } = $props();
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<svelte:element
|
|
28
|
+
this={as}
|
|
29
|
+
{...rest}
|
|
30
|
+
class={[
|
|
31
|
+
'card bg-base-100 shadow-sm',
|
|
32
|
+
cardVariant[variant],
|
|
33
|
+
cardSize[size],
|
|
34
|
+
className,
|
|
35
|
+
]}
|
|
36
|
+
>
|
|
37
|
+
{#if figure}
|
|
38
|
+
<figure>{@render figure()}</figure>
|
|
39
|
+
{/if}
|
|
40
|
+
<div class={['card-body', !padded && 'p-0', bodyClass]}>
|
|
41
|
+
{#if title !== undefined}
|
|
42
|
+
<svelte:element this={`h${headingLevel}`} class="card-title">{title}</svelte:element>
|
|
43
|
+
{/if}
|
|
44
|
+
{@render children()}
|
|
45
|
+
{#if actions}
|
|
46
|
+
<div class="card-actions justify-end">{@render actions()}</div>
|
|
47
|
+
{/if}
|
|
48
|
+
</div>
|
|
49
|
+
</svelte:element>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { type CardVariant, type HeadingLevel, type Size } from './tones.ts';
|
|
4
|
+
interface Props extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/**
|
|
6
|
+
* The element that carries the semantics.
|
|
7
|
+
* @defaultValue `'article'`
|
|
8
|
+
*/
|
|
9
|
+
as?: 'article' | 'section' | 'div' | undefined;
|
|
10
|
+
/** Heading rendered as `card-title` at the top of the body. */
|
|
11
|
+
title?: string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Heading level for `title`.
|
|
14
|
+
* @defaultValue `2`
|
|
15
|
+
*/
|
|
16
|
+
headingLevel?: HeadingLevel | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* daisyUI card style.
|
|
19
|
+
* @defaultValue `'border'`
|
|
20
|
+
*/
|
|
21
|
+
variant?: CardVariant | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* daisyUI size step.
|
|
24
|
+
* @defaultValue `'md'`
|
|
25
|
+
*/
|
|
26
|
+
size?: Size | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Drop the body padding — for a card whose content is edge to edge.
|
|
29
|
+
* @defaultValue `true`
|
|
30
|
+
*/
|
|
31
|
+
padded?: boolean | undefined;
|
|
32
|
+
/** Extra classes on the `card-body`, for layout the caller owns. */
|
|
33
|
+
bodyClass?: string | undefined;
|
|
34
|
+
/** Media block rendered above the body. */
|
|
35
|
+
figure?: Snippet<[]> | undefined;
|
|
36
|
+
/** Buttons or links rendered in the `card-actions` row. */
|
|
37
|
+
actions?: Snippet<[]> | undefined;
|
|
38
|
+
/** The body, inside the padded `card-body`, under the heading. */
|
|
39
|
+
children: Snippet<[]>;
|
|
40
|
+
}
|
|
41
|
+
/** The bordered `base-100` surface: a padded body with an optional heading, a figure above and an actions row below. */
|
|
42
|
+
declare const Card: import("svelte").Component<Props, {}, "">;
|
|
43
|
+
type Card = ReturnType<typeof Card>;
|
|
44
|
+
export default Card;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<!-- @component
|
|
2
|
+
A colour swatch beside a short code, for legends, result rows and filter lists.
|
|
3
|
+
-->
|
|
4
|
+
<!--
|
|
5
|
+
Chip — a colour swatch beside a short code: the unit that appears in a
|
|
6
|
+
legend, a result row, a filter list. Denser than a `Badge` and always
|
|
7
|
+
paired with a colour, where a badge is usually paired with a tone.
|
|
8
|
+
|
|
9
|
+
ARIA contract: when `title` is given the code is wrapped in `<abbr title>`,
|
|
10
|
+
so the expansion is available to hover AND to assistive technology — which
|
|
11
|
+
is the whole reason a three-letter code is acceptable here at all. The
|
|
12
|
+
swatch is `aria-hidden`: it repeats the colour, which conveys nothing on
|
|
13
|
+
its own. With `href` the chip is a real link and the code is its accessible
|
|
14
|
+
name.
|
|
15
|
+
|
|
16
|
+
The colour arrives as a token name, never a value — see `colour-token.ts`.
|
|
17
|
+
-->
|
|
18
|
+
<script lang="ts">import { getComponentsContext } from "../context.svelte.js";
|
|
19
|
+
import { CHIP_COLOUR_PROPERTY, colourTokenStyle } from "./colour-token.js";
|
|
20
|
+
import { chipSize, chipSwatchSize } from "./tones.js";
|
|
21
|
+
let { label, title, href, colourToken, size = "md", class: className, ...rest } = $props();
|
|
22
|
+
const context = getComponentsContext();
|
|
23
|
+
const style = $derived(colourTokenStyle(CHIP_COLOUR_PROPERTY, colourToken));
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
{#snippet body()}
|
|
27
|
+
<span
|
|
28
|
+
aria-hidden="true"
|
|
29
|
+
class={[
|
|
30
|
+
'ring-base-content/20 inline-block shrink-0 rounded-full bg-(--chip-colour) ring-1',
|
|
31
|
+
chipSwatchSize[size],
|
|
32
|
+
]}
|
|
33
|
+
></span>
|
|
34
|
+
{#if title !== undefined}
|
|
35
|
+
<abbr {title} class="no-underline">{label}</abbr>
|
|
36
|
+
{:else}
|
|
37
|
+
<span>{label}</span>
|
|
38
|
+
{/if}
|
|
39
|
+
{/snippet}
|
|
40
|
+
|
|
41
|
+
{#if href !== undefined}
|
|
42
|
+
<a
|
|
43
|
+
{...rest}
|
|
44
|
+
href={context.href(href)}
|
|
45
|
+
{style}
|
|
46
|
+
class={['link link-hover inline-flex items-center font-medium', chipSize[size], className]}
|
|
47
|
+
>
|
|
48
|
+
{@render body()}
|
|
49
|
+
</a>
|
|
50
|
+
{:else}
|
|
51
|
+
<span
|
|
52
|
+
{...rest}
|
|
53
|
+
{style}
|
|
54
|
+
class={['inline-flex items-center font-medium', chipSize[size], className]}
|
|
55
|
+
>
|
|
56
|
+
{@render body()}
|
|
57
|
+
</span>
|
|
58
|
+
{/if}
|