@skeletonlabs/skeleton 0.86.9 → 0.92.1
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/.eslintrc.cjs +20 -0
- package/.github/FUNDING.yml +13 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +30 -0
- package/.github/ISSUE_TEMPLATE/config.yml +8 -0
- package/.github/ISSUE_TEMPLATE/docs_issue.yml +23 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +22 -0
- package/.github/pull_request_template.md +14 -0
- package/.prettierignore +12 -0
- package/.prettierrc +6 -0
- package/package.json +61 -149
- package/postcss.config.cjs +14 -0
- package/scripts/compile-css-to-js.cjs +50 -0
- package/scripts/generate-jss.js +67 -0
- package/scripts/post-build.js +17 -0
- package/scripts/pre-build.js +14 -0
- package/src/app.d.ts +13 -0
- package/src/app.html +43 -0
- package/src/app.postcss +10 -0
- package/src/docs/DocsAppBar/DocsAppBar.svelte +213 -0
- package/src/docs/DocsFooter/DocsFooter.svelte +78 -0
- package/src/docs/DocsLogo/DocsLogoAnim.svelte +44 -0
- package/src/docs/DocsLogo/DocsLogoFull.svelte +11 -0
- package/src/docs/DocsLogo/DocsLogoIcon.svelte +6 -0
- package/src/docs/DocsNavigation/DocsDrawer.svelte +23 -0
- package/src/docs/DocsNavigation/DocsSidebar.svelte +103 -0
- package/src/docs/DocsNavigation/links.ts +148 -0
- package/src/docs/DocsSearch/DocsSearch.svelte +78 -0
- package/src/docs/DocsShell/DocsShell.svelte +377 -0
- package/src/docs/DocsShell/sveldMapper.ts +143 -0
- package/src/docs/DocsShell/types.ts +96 -0
- package/src/docs/DocsStyles/blog.css +192 -0
- package/src/docs/DocsThemer/DocsThemer.svelte +254 -0
- package/src/docs/DocsThemer/Swatch.svelte +28 -0
- package/src/docs/DocsThemer/colors.ts +122 -0
- package/src/docs/DocsThemer/settings.ts +129 -0
- package/src/docs/DocsThemer/stores.ts +5 -0
- package/src/docs/DocsThemer/types.ts +20 -0
- package/src/docs/README.md +3 -0
- package/src/docs/stores.ts +15 -0
- package/src/lib/actions/Clipboard/clipboard.ts +39 -0
- package/src/lib/actions/Filters/filter.test.ts +40 -0
- package/src/lib/actions/Filters/filter.ts +23 -0
- package/{actions → src/lib/actions}/Filters/svg-filters/Apollo.svelte +0 -0
- package/{actions → src/lib/actions}/Filters/svg-filters/BlueNight.svelte +0 -0
- package/{actions → src/lib/actions}/Filters/svg-filters/Emerald.svelte +0 -0
- package/{actions → src/lib/actions}/Filters/svg-filters/GreenFall.svelte +0 -0
- package/{actions → src/lib/actions}/Filters/svg-filters/Noir.svelte +0 -0
- package/{actions → src/lib/actions}/Filters/svg-filters/NoirLight.svelte +0 -0
- package/{actions → src/lib/actions}/Filters/svg-filters/Rustic.svelte +0 -0
- package/{actions → src/lib/actions}/Filters/svg-filters/Summer84.svelte +0 -0
- package/{actions → src/lib/actions}/Filters/svg-filters/XPro.svelte +0 -0
- package/src/lib/actions/FocusTrap/focusTrap.ts +56 -0
- package/src/lib/components/Accordion/AccordionGroup.svelte +53 -0
- package/src/lib/components/Accordion/AccordionGroup.test.ts +22 -0
- package/src/lib/components/Accordion/AccordionItem.svelte +80 -0
- package/src/lib/components/Accordion/AccordionItem.test.ts +28 -0
- package/src/lib/components/Alert/Alert.svelte +71 -0
- package/src/lib/components/Alert/Alert.test.ts +30 -0
- package/src/lib/components/AppBar/AppBar.svelte +60 -0
- package/src/lib/components/AppBar/AppBar.test.ts +31 -0
- package/src/lib/components/AppRail/AppRail.svelte +58 -0
- package/src/lib/components/AppRail/AppRailTile.svelte +66 -0
- package/src/lib/components/AppShell/AppShell.svelte +84 -0
- package/src/lib/components/AppShell/AppShell.test.ts +26 -0
- package/src/lib/components/Avatar/Avatar.svelte +51 -0
- package/src/lib/components/Avatar/Avatar.test.ts +41 -0
- package/src/lib/components/Breadcrumb/Breadcrumb.svelte +30 -0
- package/src/lib/components/Breadcrumb/Breadcrumb.test.ts +20 -0
- package/{components → src/lib/components}/Breadcrumb/Crumb.svelte +23 -16
- package/src/lib/components/Breadcrumb/Crumb.test.ts +48 -0
- package/src/lib/components/ConicGradient/ConicGradient.svelte +88 -0
- package/src/lib/components/ConicGradient/ConicGradient.test.ts +26 -0
- package/src/lib/components/ConicGradient/settings.ts +345 -0
- package/src/lib/components/ConicGradient/types.ts +12 -0
- package/src/lib/components/Divider/Divider.svelte +26 -0
- package/src/lib/components/Divider/Divider.test.ts +32 -0
- package/src/lib/components/FileButton/FileButton.svelte +29 -0
- package/src/lib/components/FileButton/FileButton.test.ts +32 -0
- package/src/lib/components/FileDropzone/FileDropzone.svelte +108 -0
- package/src/lib/components/FileDropzone/FileDropzone.test.ts +32 -0
- package/src/lib/components/GradientHeading/GradientHeading.svelte +24 -0
- package/src/lib/components/GradientHeading/GradientHeading.test.ts +30 -0
- package/src/lib/components/InputChip/InputChip.svelte +118 -0
- package/src/lib/components/ListBox/ListBox.svelte +65 -0
- package/src/lib/components/ListBox/ListBox.test.ts +48 -0
- package/src/lib/components/ListBox/ListBoxItem.svelte +99 -0
- package/src/lib/components/ListBox/ListBoxItem.test.ts +22 -0
- package/src/lib/components/Paginator/Paginator.svelte +84 -0
- package/src/lib/components/Paginator/Paginator.test.ts +29 -0
- package/src/lib/components/Paginator/types.ts +12 -0
- package/src/lib/components/ProgressBar/ProgressBar.svelte +73 -0
- package/src/lib/components/ProgressBar/ProgressBar.test.ts +27 -0
- package/src/lib/components/ProgressRadial/ProgressRadial.svelte +98 -0
- package/src/lib/components/ProgressRadial/ProgressRadial.test.ts +26 -0
- package/src/lib/components/Radio/RadioGroup.svelte +54 -0
- package/src/lib/components/Radio/RadioGroup.test.ts +35 -0
- package/src/lib/components/Radio/RadioItem.svelte +71 -0
- package/src/lib/components/Radio/RadioItem.test.ts +32 -0
- package/src/lib/components/RangeSlider/RangeSlider.svelte +110 -0
- package/src/lib/components/RangeSlider/RangeSlider.test.ts +44 -0
- package/src/lib/components/SlideToggle/SlideToggle.svelte +106 -0
- package/src/lib/components/SlideToggle/SlideToggle.test.ts +23 -0
- package/src/lib/components/Stepper/Step.svelte +140 -0
- package/src/lib/components/Stepper/Step.test.ts +21 -0
- package/src/lib/components/Stepper/Stepper.svelte +71 -0
- package/src/lib/components/Stepper/Stepper.test.ts +31 -0
- package/src/lib/components/SvgIcon/SvgIcon.svelte +50 -0
- package/src/lib/components/SvgIcon/SvgIcon.test.ts +28 -0
- package/src/lib/components/SvgIcon/icons.ts +29 -0
- package/src/lib/components/Tab/Tab.svelte +79 -0
- package/src/lib/components/Tab/Tab.test.ts +26 -0
- package/src/lib/components/Tab/TabGroup.svelte +78 -0
- package/src/lib/components/Tab/TabGroup.test.ts +30 -0
- package/src/lib/components/Table/Table.svelte +106 -0
- package/src/lib/components/Table/types.ts +10 -0
- package/{components/Table/utils.js → src/lib/components/Table/utils.ts} +16 -10
- package/src/lib/components/TableOfContents/TableOfContents.svelte +139 -0
- package/{index.d.ts → src/lib/index.ts} +33 -1
- package/{styles → src/lib/styles}/all.css +0 -3
- package/{styles → src/lib/styles}/core.css +3 -0
- package/src/lib/styles/elements/alerts.css +43 -0
- package/{styles → src/lib/styles}/elements/badges.css +1 -1
- package/src/lib/styles/elements/breadcrumbs.css +27 -0
- package/{styles → src/lib/styles}/elements/buttons.css +1 -1
- package/{styles → src/lib/styles}/elements/cards.css +1 -1
- package/src/lib/styles/elements/chips.css +71 -0
- package/{styles → src/lib/styles}/elements/lists.css +1 -1
- package/{styles → src/lib/styles}/elements/logo-clouds.css +1 -1
- package/{styles → src/lib/styles}/elements/menus.css +1 -1
- package/{styles → src/lib/styles}/elements/placeholders.css +1 -1
- package/{styles → src/lib/styles}/elements/tables.css +0 -0
- package/{styles → src/lib/styles}/elements/tooltips.css +1 -1
- package/{styles → src/lib/styles}/elements.css +2 -0
- package/{styles → src/lib/styles}/forms.css +57 -40
- package/{styles → src/lib/styles}/highlight-js.css +0 -0
- package/{styles → src/lib/styles}/tailwind.css +0 -0
- package/{styles → src/lib/styles}/typography.css +2 -2
- package/src/lib/tailwind/settings.cjs +20 -0
- package/src/lib/tailwind/skeleton.cjs +50 -0
- package/src/lib/tailwind/theme/colors.cjs +18 -0
- package/src/lib/tailwind/tokens/backgrounds.cjs +40 -0
- package/src/lib/tailwind/tokens/border-radius.cjs +21 -0
- package/src/lib/tailwind/tokens/borders.cjs +20 -0
- package/src/lib/tailwind/tokens/fills.cjs +20 -0
- package/src/lib/tailwind/tokens/rings.cjs +42 -0
- package/src/lib/tailwind/tokens/text.cjs +33 -0
- package/{themes → src/lib/themes}/theme-crimson.css +0 -0
- package/{themes → src/lib/themes}/theme-gold-nouveau.css +0 -0
- package/{themes → src/lib/themes}/theme-hamlindigo.css +0 -0
- package/{themes → src/lib/themes}/theme-modern.css +0 -0
- package/{themes → src/lib/themes}/theme-rocket.css +0 -0
- package/{themes → src/lib/themes}/theme-sahara.css +0 -0
- package/{themes → src/lib/themes}/theme-seafoam.css +0 -0
- package/{themes → src/lib/themes}/theme-seasonal.css +2 -2
- package/{themes → src/lib/themes}/theme-skeleton.css +6 -6
- package/src/lib/themes/theme-test.css +96 -0
- package/{themes → src/lib/themes}/theme-vintage.css +0 -0
- package/src/lib/utilities/CodeBlock/CodeBlock.svelte +78 -0
- package/src/lib/utilities/CodeBlock/CodeBlock.test.ts +27 -0
- package/src/lib/utilities/CodeBlock/stores.ts +5 -0
- package/src/lib/utilities/DataTable/DataTable.ts +151 -0
- package/src/lib/utilities/DataTable/actions.ts +100 -0
- package/src/lib/utilities/DataTable/types.ts +33 -0
- package/src/lib/utilities/Drawer/Drawer.svelte +173 -0
- package/src/lib/utilities/Drawer/Drawer.test.ts +15 -0
- package/src/lib/utilities/Drawer/stores.ts +27 -0
- package/src/lib/utilities/Drawer/types.ts +47 -0
- package/src/lib/utilities/LightSwitch/LightSwitch.svelte +116 -0
- package/src/lib/utilities/LightSwitch/LightSwitch.test.ts +19 -0
- package/src/lib/utilities/LightSwitch/stores.ts +7 -0
- package/src/lib/utilities/LocalStorageStore/LocalStorageStore.test.ts +220 -0
- package/src/lib/utilities/LocalStorageStore/LocalStorageStore.ts +77 -0
- package/src/lib/utilities/Menu/menu.test.ts +22 -0
- package/src/lib/utilities/Menu/menu.ts +172 -0
- package/src/lib/utilities/Modal/Modal.svelte +206 -0
- package/src/lib/utilities/Modal/Modal.test.ts +50 -0
- package/{utilities → src/lib/utilities}/Modal/examples/ModalExampleEmbed.svelte +7 -5
- package/{utilities → src/lib/utilities}/Modal/examples/ModalExampleForm.svelte +24 -20
- package/{utilities → src/lib/utilities}/Modal/examples/ModalExampleList.svelte +18 -13
- package/src/lib/utilities/Modal/stores.ts +29 -0
- package/src/lib/utilities/Modal/types.ts +39 -0
- package/src/lib/utilities/Toast/Toast.svelte +95 -0
- package/src/lib/utilities/Toast/Toats.test.ts +25 -0
- package/src/lib/utilities/Toast/stores.ts +63 -0
- package/src/lib/utilities/Toast/types.ts +29 -0
- package/src/lib/utilities/Tooltip/tooltip.ts +137 -0
- package/src/routes/(inner)/+layout.svelte +3 -0
- package/src/routes/(inner)/actions/clipboard/+page.svelte +87 -0
- package/src/routes/(inner)/actions/filters/+page.svelte +151 -0
- package/src/routes/(inner)/actions/focus-trap/+page.svelte +59 -0
- package/src/routes/(inner)/components/accordions/+page.svelte +127 -0
- package/src/routes/(inner)/components/alerts/+page.svelte +130 -0
- package/src/routes/(inner)/components/app-bar/+page.svelte +52 -0
- package/src/routes/(inner)/components/app-rail/+page.svelte +105 -0
- package/src/routes/(inner)/components/app-shell/+page.svelte +159 -0
- package/src/routes/(inner)/components/avatars/+page.svelte +193 -0
- package/src/routes/(inner)/components/breadcrumbs/+page.svelte +121 -0
- package/src/routes/(inner)/components/conic-gradients/+page.svelte +161 -0
- package/src/routes/(inner)/components/dividers/+page.svelte +146 -0
- package/src/routes/(inner)/components/file-buttons/+page.svelte +46 -0
- package/src/routes/(inner)/components/file-dropzone/+page.svelte +71 -0
- package/src/routes/(inner)/components/gradient-headings/+page.svelte +138 -0
- package/src/routes/(inner)/components/input-chips/+page.svelte +128 -0
- package/src/routes/(inner)/components/listboxes/+page.svelte +92 -0
- package/src/routes/(inner)/components/paginators/+page.svelte +118 -0
- package/src/routes/(inner)/components/progress-bars/+page.svelte +157 -0
- package/src/routes/(inner)/components/progress-radials/+page.svelte +64 -0
- package/src/routes/(inner)/components/radio-groups/+page.svelte +91 -0
- package/src/routes/(inner)/components/range-sliders/+page.svelte +134 -0
- package/src/routes/(inner)/components/slide-toggles/+page.svelte +63 -0
- package/src/routes/(inner)/components/steppers/+page.svelte +168 -0
- package/src/routes/(inner)/components/svg-icons/+page.svelte +60 -0
- package/src/routes/(inner)/components/table-of-contents/+page.svelte +110 -0
- package/src/routes/(inner)/components/tables/+page.svelte +216 -0
- package/src/routes/(inner)/components/tabs/+page.svelte +146 -0
- package/src/routes/(inner)/docs/comparisons/+page.svelte +130 -0
- package/src/routes/(inner)/docs/contributions/+page.svelte +78 -0
- package/src/routes/(inner)/docs/contributions/documentation/+page.svelte +217 -0
- package/src/routes/(inner)/docs/contributions/requirements/+page.svelte +173 -0
- package/src/routes/(inner)/docs/contributions/style-guide/+page.svelte +164 -0
- package/src/routes/(inner)/docs/faqs/+page.svelte +80 -0
- package/src/routes/(inner)/docs/features/+page.svelte +121 -0
- package/src/routes/(inner)/docs/recommended/+page.svelte +162 -0
- package/src/routes/(inner)/docs/why/+page.svelte +104 -0
- package/src/routes/(inner)/elements/alerts/+page.svelte +142 -0
- package/src/routes/(inner)/elements/badges/+page.svelte +155 -0
- package/src/routes/(inner)/elements/breadcrumbs/+page.svelte +132 -0
- package/src/routes/(inner)/elements/buttons/+page.svelte +304 -0
- package/src/routes/(inner)/elements/cards/+page.svelte +117 -0
- package/src/routes/(inner)/elements/chips/+page.svelte +130 -0
- package/src/routes/(inner)/elements/core/+page.svelte +98 -0
- package/src/routes/(inner)/elements/forms/+page.svelte +89 -0
- package/src/routes/(inner)/elements/forms/preview/+page.svelte +256 -0
- package/src/routes/(inner)/elements/lists/+page.svelte +197 -0
- package/src/routes/(inner)/elements/logo-clouds/+page.svelte +105 -0
- package/src/routes/(inner)/elements/placeholders/+page.svelte +70 -0
- package/src/routes/(inner)/elements/tables/+page.svelte +138 -0
- package/src/routes/(inner)/elements/tokens/+page.svelte +176 -0
- package/src/routes/(inner)/elements/typography/+page.svelte +100 -0
- package/src/routes/(inner)/guides/install/+page.svelte +84 -0
- package/src/routes/(inner)/guides/quickstart/+page.svelte +118 -0
- package/src/routes/(inner)/guides/styling/+page.svelte +361 -0
- package/src/routes/(inner)/guides/tailwind/+page.svelte +150 -0
- package/src/routes/(inner)/guides/themes/+page.svelte +144 -0
- package/src/routes/(inner)/guides/themes/colors/+page.svelte +87 -0
- package/src/routes/(inner)/guides/themes/generator/+page.svelte +58 -0
- package/src/routes/(inner)/guides/themes/presets.ts +69 -0
- package/src/routes/(inner)/template/+page.svelte +52 -0
- package/src/routes/(inner)/utilities/codeblocks/+page.svelte +77 -0
- package/src/routes/(inner)/utilities/data-tables/+page.svelte +399 -0
- package/src/routes/(inner)/utilities/data-tables/+page.ts +18 -0
- package/src/routes/(inner)/utilities/drawers/+page.svelte +193 -0
- package/src/routes/(inner)/utilities/lightswitches/+page.svelte +86 -0
- package/src/routes/(inner)/utilities/local-storage-stores/+page.svelte +67 -0
- package/src/routes/(inner)/utilities/menus/+page.svelte +186 -0
- package/src/routes/(inner)/utilities/modals/+page.svelte +391 -0
- package/src/routes/(inner)/utilities/toasts/+page.svelte +212 -0
- package/src/routes/(inner)/utilities/tooltips/+page.svelte +153 -0
- package/src/routes/+error.svelte +16 -0
- package/src/routes/+layout.server.ts +13 -0
- package/src/routes/+layout.svelte +100 -0
- package/src/routes/+page.server.ts +12 -0
- package/src/routes/+page.svelte +197 -0
- package/src/routes/blog/+page.svelte +78 -0
- package/src/routes/blog/+page.ts +6 -0
- package/src/routes/blog/[slug]/+page.svelte +112 -0
- package/src/routes/blog/[slug]/+page.ts +6 -0
- package/src/routes/blog/blog-service.ts +31 -0
- package/src/routes/blog/rss/+server.ts +16 -0
- package/static/favicon.png +0 -0
- package/svelte.config.js +30 -0
- package/tailwind.config.cjs +14 -0
- package/tsconfig.json +37 -0
- package/vite.config.js +25 -0
- package/actions/Clipboard/clipboard.d.ts +0 -4
- package/actions/Clipboard/clipboard.js +0 -37
- package/actions/Filters/filter.d.ts +0 -3
- package/actions/Filters/filter.js +0 -23
- package/actions/Filters/svg-filters/Apollo.svelte.d.ts +0 -23
- package/actions/Filters/svg-filters/BlueNight.svelte.d.ts +0 -23
- package/actions/Filters/svg-filters/Emerald.svelte.d.ts +0 -23
- package/actions/Filters/svg-filters/GreenFall.svelte.d.ts +0 -23
- package/actions/Filters/svg-filters/Noir.svelte.d.ts +0 -23
- package/actions/Filters/svg-filters/NoirLight.svelte.d.ts +0 -23
- package/actions/Filters/svg-filters/Rustic.svelte.d.ts +0 -23
- package/actions/Filters/svg-filters/Summer84.svelte.d.ts +0 -23
- package/actions/Filters/svg-filters/XPro.svelte.d.ts +0 -23
- package/actions/FocusTrap/focusTrap.d.ts +0 -4
- package/actions/FocusTrap/focusTrap.js +0 -53
- package/components/Accordion/AccordionGroup.svelte +0 -46
- package/components/Accordion/AccordionGroup.svelte.d.ts +0 -24
- package/components/Accordion/AccordionItem.svelte +0 -70
- package/components/Accordion/AccordionItem.svelte.d.ts +0 -36
- package/components/Alert/Alert.svelte +0 -65
- package/components/Alert/Alert.svelte.d.ts +0 -30
- package/components/AppBar/AppBar.svelte +0 -54
- package/components/AppBar/AppBar.svelte.d.ts +0 -30
- package/components/AppRail/AppRail.svelte +0 -51
- package/components/AppRail/AppRail.svelte.d.ts +0 -32
- package/components/AppRail/AppRailTile.svelte +0 -57
- package/components/AppRail/AppRailTile.svelte.d.ts +0 -33
- package/components/AppShell/AppShell.svelte +0 -80
- package/components/AppShell/AppShell.svelte.d.ts +0 -31
- package/components/Avatar/Avatar.svelte +0 -46
- package/components/Avatar/Avatar.svelte.d.ts +0 -32
- package/components/Breadcrumb/Breadcrumb.svelte +0 -24
- package/components/Breadcrumb/Breadcrumb.svelte.d.ts +0 -21
- package/components/Breadcrumb/Crumb.svelte.d.ts +0 -26
- package/components/ConicGradient/ConicGradient.svelte +0 -80
- package/components/ConicGradient/ConicGradient.svelte.d.ts +0 -29
- package/components/ConicGradient/types.d.ts +0 -10
- package/components/ConicGradient/types.js +0 -2
- package/components/Divider/Divider.svelte +0 -21
- package/components/Divider/Divider.svelte.d.ts +0 -22
- package/components/FileButton/FileButton.svelte +0 -25
- package/components/FileButton/FileButton.svelte.d.ts +0 -25
- package/components/FileDropzone/FileDropzone.svelte +0 -98
- package/components/FileDropzone/FileDropzone.svelte.d.ts +0 -32
- package/components/GradientHeading/GradientHeading.svelte +0 -21
- package/components/GradientHeading/GradientHeading.svelte.d.ts +0 -22
- package/components/ListBox/ListBox.svelte +0 -57
- package/components/ListBox/ListBox.svelte.d.ts +0 -30
- package/components/ListBox/ListBoxItem.svelte +0 -89
- package/components/ListBox/ListBoxItem.svelte.d.ts +0 -32
- package/components/Paginator/Paginator.svelte +0 -74
- package/components/Paginator/Paginator.svelte.d.ts +0 -29
- package/components/Paginator/types.d.ts +0 -10
- package/components/Paginator/types.js +0 -2
- package/components/ProgressBar/ProgressBar.svelte +0 -67
- package/components/ProgressBar/ProgressBar.svelte.d.ts +0 -24
- package/components/ProgressRadial/ProgressRadial.svelte +0 -89
- package/components/ProgressRadial/ProgressRadial.svelte.d.ts +0 -25
- package/components/Radio/RadioGroup.svelte +0 -48
- package/components/Radio/RadioGroup.svelte.d.ts +0 -31
- package/components/Radio/RadioItem.svelte +0 -61
- package/components/Radio/RadioItem.svelte.d.ts +0 -33
- package/components/RangeSlider/RangeSlider.svelte +0 -101
- package/components/RangeSlider/RangeSlider.svelte.d.ts +0 -32
- package/components/SlideToggle/SlideToggle.svelte +0 -100
- package/components/SlideToggle/SlideToggle.svelte.d.ts +0 -34
- package/components/Stepper/Step.svelte +0 -114
- package/components/Stepper/Step.svelte.d.ts +0 -34
- package/components/Stepper/Stepper.svelte +0 -51
- package/components/Stepper/Stepper.svelte.d.ts +0 -30
- package/components/SvgIcon/SvgIcon.svelte +0 -45
- package/components/SvgIcon/SvgIcon.svelte.d.ts +0 -26
- package/components/SvgIcon/icons.d.ts +0 -1
- package/components/SvgIcon/icons.js +0 -171
- package/components/Tab/Tab.svelte +0 -69
- package/components/Tab/Tab.svelte.d.ts +0 -37
- package/components/Tab/TabGroup.svelte +0 -69
- package/components/Tab/TabGroup.svelte.d.ts +0 -30
- package/components/Table/Table.svelte +0 -99
- package/components/Table/Table.svelte.d.ts +0 -27
- package/components/Table/types.d.ts +0 -10
- package/components/Table/types.js +0 -1
- package/components/Table/utils.d.ts +0 -7
- package/index.js +0 -69
- package/styles/elements/chips.css +0 -20
- package/styles/tokens/backgrounds.css +0 -329
- package/styles/tokens/border-radius.css +0 -41
- package/styles/tokens/borders.css +0 -253
- package/styles/tokens/fills.css +0 -38
- package/styles/tokens/rings.css +0 -253
- package/styles/tokens/text.css +0 -293
- package/styles/tokens.css +0 -8
- package/tailwind/colors.d.ts +0 -13
- package/tailwind/colors.js +0 -335
- package/tailwind/theme.cjs +0 -39
- package/tailwind/theme.d.cts +0 -5
- package/utilities/CodeBlock/CodeBlock.svelte +0 -68
- package/utilities/CodeBlock/CodeBlock.svelte.d.ts +0 -25
- package/utilities/CodeBlock/stores.d.ts +0 -2
- package/utilities/CodeBlock/stores.js +0 -3
- package/utilities/DataTable/DataTable.d.ts +0 -18
- package/utilities/DataTable/DataTable.js +0 -137
- package/utilities/DataTable/actions.d.ts +0 -8
- package/utilities/DataTable/actions.js +0 -114
- package/utilities/DataTable/types.d.ts +0 -33
- package/utilities/DataTable/types.js +0 -2
- package/utilities/Drawer/Drawer.svelte +0 -157
- package/utilities/Drawer/Drawer.svelte.d.ts +0 -33
- package/utilities/Drawer/stores.d.ts +0 -10
- package/utilities/Drawer/stores.js +0 -21
- package/utilities/Drawer/types.d.ts +0 -33
- package/utilities/Drawer/types.js +0 -2
- package/utilities/LightSwitch/LightSwitch.svelte +0 -75
- package/utilities/LightSwitch/LightSwitch.svelte.d.ts +0 -21
- package/utilities/LightSwitch/stores.d.ts +0 -3
- package/utilities/LightSwitch/stores.js +0 -5
- package/utilities/LocalStorageStore/LocalStorageStore.d.ts +0 -12
- package/utilities/LocalStorageStore/LocalStorageStore.js +0 -49
- package/utilities/Menu/menu.d.ts +0 -18
- package/utilities/Menu/menu.js +0 -151
- package/utilities/Modal/Modal.svelte +0 -194
- package/utilities/Modal/Modal.svelte.d.ts +0 -35
- package/utilities/Modal/examples/ModalExampleEmbed.svelte.d.ts +0 -17
- package/utilities/Modal/examples/ModalExampleForm.svelte.d.ts +0 -17
- package/utilities/Modal/examples/ModalExampleList.svelte.d.ts +0 -17
- package/utilities/Modal/stores.d.ts +0 -12
- package/utilities/Modal/stores.js +0 -24
- package/utilities/Modal/types.d.ts +0 -34
- package/utilities/Modal/types.js +0 -2
- package/utilities/Toast/Toast.svelte +0 -117
- package/utilities/Toast/Toast.svelte.d.ts +0 -28
- package/utilities/Toast/stores.d.ts +0 -10
- package/utilities/Toast/stores.js +0 -61
- package/utilities/Toast/types.d.ts +0 -26
- package/utilities/Toast/types.js +0 -2
- package/utilities/Tooltip/tooltip.d.ts +0 -35
- package/utilities/Tooltip/tooltip.js +0 -94
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { writable, type Writable } from 'svelte/store';
|
|
3
|
+
|
|
4
|
+
import DocsShell from '$docs/DocsShell/DocsShell.svelte';
|
|
5
|
+
import { DocsFeature, type DocsShellSettings } from '$docs/DocsShell/types';
|
|
6
|
+
|
|
7
|
+
import GradientHeading from '$lib/components/GradientHeading/GradientHeading.svelte';
|
|
8
|
+
import RadioGroup from '$lib/components/Radio/RadioGroup.svelte';
|
|
9
|
+
import RadioItem from '$lib/components/Radio/RadioItem.svelte';
|
|
10
|
+
import CodeBlock from '$lib/utilities/CodeBlock/CodeBlock.svelte';
|
|
11
|
+
|
|
12
|
+
// @ts-expect-error sveld import
|
|
13
|
+
import sveldGradientHeading from '$lib/components/GradientHeading/GradientHeading.svelte?raw&sveld';
|
|
14
|
+
|
|
15
|
+
// Docs Shell
|
|
16
|
+
const settings: DocsShellSettings = {
|
|
17
|
+
feature: DocsFeature.Component,
|
|
18
|
+
name: 'Gradient Headings',
|
|
19
|
+
description: 'Generate a gradient-colored heading with customizable tag and gradient direction.',
|
|
20
|
+
imports: ['GradientHeading'],
|
|
21
|
+
source: 'components/GradientHeading',
|
|
22
|
+
components: [{ sveld: sveldGradientHeading }]
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// Stores
|
|
26
|
+
const storeTag: Writable<string> = writable('h1');
|
|
27
|
+
|
|
28
|
+
// Reactive Props
|
|
29
|
+
$: props = {
|
|
30
|
+
text: 'Skeleton',
|
|
31
|
+
tag: $storeTag,
|
|
32
|
+
direction: 'bg-gradient-to-r',
|
|
33
|
+
from: 'from-primary-500',
|
|
34
|
+
to: 'to-secondary-500'
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<DocsShell {settings}>
|
|
39
|
+
<!-- Slot: Sandbox -->
|
|
40
|
+
<svelte:fragment slot="sandbox">
|
|
41
|
+
<!-- Alert -->
|
|
42
|
+
<aside class="alert alert-error">
|
|
43
|
+
<div class="alert-message">
|
|
44
|
+
<h3><i class="fa-solid fa-triangle-exclamation mr-2" /> Deprecated</h3>
|
|
45
|
+
<p>
|
|
46
|
+
This component is slated to be <u>removed</u>. We recommend using the following Tailwind styles if you wish to replicate this.
|
|
47
|
+
</p>
|
|
48
|
+
<CodeBlock language="html" code={`<h1><span class="gradient-heading">Skeleton</span></h1>`} />
|
|
49
|
+
<CodeBlock
|
|
50
|
+
language="css"
|
|
51
|
+
code={`
|
|
52
|
+
.gradient-heading {
|
|
53
|
+
@apply bg-gradient-to-r from-primary-500 to-bg-secondary-500 bg-clip text-transparent box-decoration-clone;
|
|
54
|
+
}
|
|
55
|
+
`}
|
|
56
|
+
/>
|
|
57
|
+
<!-- prettier-ignore -->
|
|
58
|
+
<p>See the <a class="!text-error-200" href="https://tailwindcss.com/docs/gradient-color-stops" target="_blank" rel="noreferrer">Tailwind documentation</a> for additional gradient options.</p>
|
|
59
|
+
</div>
|
|
60
|
+
</aside>
|
|
61
|
+
|
|
62
|
+
<section class="space-y-4 xl:space-y-0 xl:grid grid-cols-[1fr_300px] gap-2">
|
|
63
|
+
<!-- Example -->
|
|
64
|
+
<div class="card p-4 h-full flex justify-center items-center">
|
|
65
|
+
<svelte:component this={GradientHeading} tag={props.tag} direction={props.direction} from={props.from} to={props.to}
|
|
66
|
+
>{props.text}</svelte:component
|
|
67
|
+
>
|
|
68
|
+
</div>
|
|
69
|
+
<!-- Options -->
|
|
70
|
+
<div class="card p-4 space-y-4">
|
|
71
|
+
<label>
|
|
72
|
+
<span>Text</span>
|
|
73
|
+
<input type="text" bind:value={props.text} placeholder="Enter text..." />
|
|
74
|
+
</label>
|
|
75
|
+
<!-- Tag -->
|
|
76
|
+
<label for="">
|
|
77
|
+
<span>Tag</span>
|
|
78
|
+
<RadioGroup selected={storeTag} display="flex">
|
|
79
|
+
<RadioItem value="h1">h1</RadioItem>
|
|
80
|
+
<RadioItem value="h3">h3</RadioItem>
|
|
81
|
+
<RadioItem value="h6">h6</RadioItem>
|
|
82
|
+
<RadioItem value="p">p</RadioItem>
|
|
83
|
+
</RadioGroup>
|
|
84
|
+
</label>
|
|
85
|
+
<!-- Direction -->
|
|
86
|
+
<label>
|
|
87
|
+
<span>Direction</span>
|
|
88
|
+
<select name="direction" id="direction" bind:value={props.direction}>
|
|
89
|
+
<option value="bg-gradient-to-t">bg-gradient-to-t</option>
|
|
90
|
+
<option value="bg-gradient-to-b">bg-gradient-to-b</option>
|
|
91
|
+
<option value="bg-gradient-to-l">bg-gradient-to-l</option>
|
|
92
|
+
<option value="bg-gradient-to-r">bg-gradient-to-r</option>
|
|
93
|
+
<option value="bg-gradient-to-tl">bg-gradient-to-tl</option>
|
|
94
|
+
<option value="bg-gradient-to-tr">bg-gradient-to-tr</option>
|
|
95
|
+
<option value="bg-gradient-to-bl">bg-gradient-to-bl</option>
|
|
96
|
+
<option value="bg-gradient-to-br">bg-gradient-to-br</option>
|
|
97
|
+
<option value="bg-gradient-to-r">bg-gradient-to-r</option>
|
|
98
|
+
</select>
|
|
99
|
+
</label>
|
|
100
|
+
<!-- From -->
|
|
101
|
+
<label>
|
|
102
|
+
<span>From</span>
|
|
103
|
+
<select name="from" id="from" bind:value={props.from}>
|
|
104
|
+
<option value="from-primary-500">from-primary-500</option>
|
|
105
|
+
<option value="from-secondary-500">from-secondary-500</option>
|
|
106
|
+
<option value="from-tertiary-500">from-tertiary-500</option>
|
|
107
|
+
<option value="from-warning-500">from-warning-500</option>
|
|
108
|
+
<option value="from-surface-500">from-surface-500</option>
|
|
109
|
+
</select>
|
|
110
|
+
</label>
|
|
111
|
+
<!-- To -->
|
|
112
|
+
<label>
|
|
113
|
+
<span>To</span>
|
|
114
|
+
<select name="to" id="to" bind:value={props.to}>
|
|
115
|
+
<option value="to-primary-500">to-primary-500</option>
|
|
116
|
+
<option value="to-secondary-500">to-secondary-500</option>
|
|
117
|
+
<option value="to-tertiary-500">to-tertiary-500</option>
|
|
118
|
+
<option value="to-warning-500">to-warning-500</option>
|
|
119
|
+
<option value="to-surface-500">to-surface-500</option>
|
|
120
|
+
</select>
|
|
121
|
+
</label>
|
|
122
|
+
</div>
|
|
123
|
+
</section>
|
|
124
|
+
</svelte:fragment>
|
|
125
|
+
|
|
126
|
+
<!-- Slot: Usage -->
|
|
127
|
+
<svelte:fragment slot="usage">
|
|
128
|
+
<section class="space-y-4">
|
|
129
|
+
<p>
|
|
130
|
+
You are advised to use semantic heading tags (H1-H6). However, an explicit ARIA attribute of <code>role="heading"</code> has been applied.
|
|
131
|
+
</p>
|
|
132
|
+
<CodeBlock
|
|
133
|
+
language="html"
|
|
134
|
+
code={`<GradientHeading tag="h1" direction="bg-gradient-to-r" from="from-primary-500" to="to-secondary-500">Skeleton</GradientHeading>`}
|
|
135
|
+
/>
|
|
136
|
+
</section>
|
|
137
|
+
</svelte:fragment>
|
|
138
|
+
</DocsShell>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import DocsShell from '$docs/DocsShell/DocsShell.svelte';
|
|
3
|
+
import { DocsFeature, type DocsShellSettings } from '$docs/DocsShell/types';
|
|
4
|
+
|
|
5
|
+
// Utilities
|
|
6
|
+
import CodeBlock from '$lib/utilities/CodeBlock/CodeBlock.svelte';
|
|
7
|
+
|
|
8
|
+
// Components
|
|
9
|
+
import InputChip from '$lib/components/InputChip/InputChip.svelte';
|
|
10
|
+
|
|
11
|
+
// @ts-expect-error
|
|
12
|
+
import sveldInputChip from '$lib/components/InputChip/InputChip.svelte?raw&sveld';
|
|
13
|
+
|
|
14
|
+
// Docs Shell
|
|
15
|
+
const settings: DocsShellSettings = {
|
|
16
|
+
feature: DocsFeature.Component,
|
|
17
|
+
name: 'Input Chips',
|
|
18
|
+
description: 'Allows input of multiple values.',
|
|
19
|
+
imports: ['InputChip'],
|
|
20
|
+
stylesheetIncludes: ['all', 'elements'],
|
|
21
|
+
stylesheets: ['elements/forms', 'elements/chips'],
|
|
22
|
+
source: 'components/InputChip',
|
|
23
|
+
components: [{ sveld: sveldInputChip }],
|
|
24
|
+
// aria: 'https://www.w3.org/WAI/ARIA/apg/',
|
|
25
|
+
restProps: 'input'
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Local
|
|
29
|
+
let tags = ['tutorials', 'news', 'interviews'];
|
|
30
|
+
let flavors = ['vanilla', 'chocolate', 'strawberry'];
|
|
31
|
+
let flavorsWhitelist = ['vanilla', 'chocolate', 'strawberry', 'peach', 'rocky road'];
|
|
32
|
+
let emails = ['john@email.com', 'jane@email.com', 'sally@email.com'];
|
|
33
|
+
|
|
34
|
+
function isValidEmail(value: string): boolean {
|
|
35
|
+
return value.includes('@') && value.includes('.');
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<DocsShell {settings}>
|
|
40
|
+
<!-- Slot: Sandbox -->
|
|
41
|
+
<svelte:fragment slot="sandbox">
|
|
42
|
+
<section class="space-y-4">
|
|
43
|
+
<p>Type a value then hit ENTER to apply it.</p>
|
|
44
|
+
<!-- Tags -->
|
|
45
|
+
<div class="card p-4 space-y-4">
|
|
46
|
+
<p>This input allows for any value to be entered.</p>
|
|
47
|
+
<InputChip placeholder="Add tags..." bind:value={tags} />
|
|
48
|
+
<code class="inline-block">{tags.length ? tags : 'No tags set.'}</code>
|
|
49
|
+
</div>
|
|
50
|
+
<!-- Flavors -->
|
|
51
|
+
<div class="card p-4 space-y-4">
|
|
52
|
+
<p>Flavors are whitelisted to: <em>{flavorsWhitelist.join(', ')}</em>.</p>
|
|
53
|
+
<InputChip label="Flavors" placeholder="Add flavor..." bind:value={flavors} allowDuplicates={true} whitelist={flavorsWhitelist} />
|
|
54
|
+
<code class="inline-block">{flavors.length ? flavors : 'No flavors set.'}</code>
|
|
55
|
+
</div>
|
|
56
|
+
<!-- Emails -->
|
|
57
|
+
<div class="card p-4 space-y-4">
|
|
58
|
+
<p>Emails are validated to contain <code>@</code> and <code>.</code> symbols.</p>
|
|
59
|
+
<InputChip label="Emails" placeholder="Enter emails..." bind:value={emails} validation={isValidEmail} />
|
|
60
|
+
<code class="inline-block">{emails.length ? emails : 'No emails set.'}</code>
|
|
61
|
+
</div>
|
|
62
|
+
</section>
|
|
63
|
+
</svelte:fragment>
|
|
64
|
+
|
|
65
|
+
<!-- Slot: Usage -->
|
|
66
|
+
<svelte:fragment slot="usage">
|
|
67
|
+
<section class="space-y-4">
|
|
68
|
+
<p>
|
|
69
|
+
Create an array of values, then bind these to your the <code>InputChip</code> component. As values are added or removed the array will
|
|
70
|
+
update.
|
|
71
|
+
</p>
|
|
72
|
+
<CodeBlock language="ts" code={`let flavors = ['vanilla', 'chocolate', 'strawberry'];`} />
|
|
73
|
+
<CodeBlock language="html" code={`<InputChip label="Flavors" placeholder="Add flavor..." bind:value={flavors} />`} />
|
|
74
|
+
</section>
|
|
75
|
+
<section class="space-y-4">
|
|
76
|
+
<h2>Whitelist Values</h2>
|
|
77
|
+
<p>
|
|
78
|
+
You can provide an array of strings to use as a whitelist. Only whitelisted items can be entered. Invalid or duplicate values will
|
|
79
|
+
show an error state.
|
|
80
|
+
</p>
|
|
81
|
+
<CodeBlock language="ts" code={`let flavorsWhitelist = ['vanilla', 'chocolate', 'strawberry'];`} />
|
|
82
|
+
<CodeBlock language="html" code={`<InputChip ... whitelist={flavorsWhitelist} />`} />
|
|
83
|
+
</section>
|
|
84
|
+
<section class="space-y-4">
|
|
85
|
+
<h2>Custom Validation</h2>
|
|
86
|
+
<p>You can optionally provide a function to provide custom validation. Make sure to accept a string value and return a boolean.</p>
|
|
87
|
+
<CodeBlock
|
|
88
|
+
language="ts"
|
|
89
|
+
code={`
|
|
90
|
+
function isValidEmail(value: string): boolean {
|
|
91
|
+
return value.includes('@') && value.includes('.');
|
|
92
|
+
}
|
|
93
|
+
`}
|
|
94
|
+
/>
|
|
95
|
+
<CodeBlock language="html" code={`<InputChip ... validation={isValidEmail} />`} />
|
|
96
|
+
</section>
|
|
97
|
+
<section class="space-y-4">
|
|
98
|
+
<h2>Additional Settings</h2>
|
|
99
|
+
<p>
|
|
100
|
+
By default, only a single instance of each value is allowed. If you wish to allow duplicates, set <code>allowDuplicates={true}</code
|
|
101
|
+
>.
|
|
102
|
+
</p>
|
|
103
|
+
<CodeBlock language="html" code={`<InputChip ... allowDuplicates={true} />`} />
|
|
104
|
+
<p>
|
|
105
|
+
By default, all values are trimmed and formatted lowercase. If you wish to allow uppercase, set <code>allowUpperCase={true}</code>.
|
|
106
|
+
</p>
|
|
107
|
+
<CodeBlock language="html" code={`<InputChip ... allowUpperCase={true} />`} />
|
|
108
|
+
</section>
|
|
109
|
+
<section class="space-y-4">
|
|
110
|
+
<h2>Required Attribute</h2>
|
|
111
|
+
<p>
|
|
112
|
+
Note the <code>required</code> attribute has no bearing on the validation state of this input. Instead, we recommend disabling form
|
|
113
|
+
submission if your validation conditions are not for our your source value array - such as too few or too many values. Make sure to
|
|
114
|
+
inform users of the error state using a message or <a href="/components/alerts">Alert</a>.
|
|
115
|
+
</p>
|
|
116
|
+
<CodeBlock language="html" code={`<button type="submit" disabled={!flavors.length}>Submit</button>`} />
|
|
117
|
+
<CodeBlock language="html" code={`<button type="submit" disabled={flavors.length > 3}>Submit</button>`} />
|
|
118
|
+
</section>
|
|
119
|
+
<hr />
|
|
120
|
+
<section class="!flex flex-col md:flex-row justify-between items-center space-y-4 md:space-y-0 md:space-x-4">
|
|
121
|
+
<div class="space-y-2">
|
|
122
|
+
<h2>Chip Elements</h2>
|
|
123
|
+
<p>Interactive elements for actions, selection, or filtering.</p>
|
|
124
|
+
</div>
|
|
125
|
+
<a class="btn btn-ghost-surface" href="/elements/chips">Chip Elements →</a>
|
|
126
|
+
</section>
|
|
127
|
+
</svelte:fragment>
|
|
128
|
+
</DocsShell>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { writable, type Writable } from 'svelte/store';
|
|
3
|
+
|
|
4
|
+
import DocsShell from '$docs/DocsShell/DocsShell.svelte';
|
|
5
|
+
import { DocsFeature, type DocsShellSettings } from '$docs/DocsShell/types';
|
|
6
|
+
|
|
7
|
+
import CodeBlock from '$lib/utilities/CodeBlock/CodeBlock.svelte';
|
|
8
|
+
import ListBox from '$lib/components/ListBox/ListBox.svelte';
|
|
9
|
+
import ListBoxItem from '$lib/components/ListBox/ListBoxItem.svelte';
|
|
10
|
+
|
|
11
|
+
// @ts-expect-error sveld import
|
|
12
|
+
import sveldListBox from '$lib/components/ListBox/ListBox.svelte?raw&sveld';
|
|
13
|
+
// @ts-expect-error sveld import
|
|
14
|
+
import sveldListBoxItem from '$lib/components/ListBox/ListBoxItem.svelte?raw&sveld';
|
|
15
|
+
|
|
16
|
+
// Stores
|
|
17
|
+
let navSingle: Writable<number> = writable(1);
|
|
18
|
+
let navMultiple: Writable<string[]> = writable(['A', 'B']);
|
|
19
|
+
|
|
20
|
+
// Docs Shell
|
|
21
|
+
const settings: DocsShellSettings = {
|
|
22
|
+
feature: DocsFeature.Component,
|
|
23
|
+
name: 'Listboxes',
|
|
24
|
+
description: 'Interactive listboxes that maintain selection state.',
|
|
25
|
+
imports: ['ListBox', 'ListBoxItem'],
|
|
26
|
+
source: 'components/ListBox',
|
|
27
|
+
aria: 'https://www.w3.org/WAI/ARIA/apg/patterns/listbox/',
|
|
28
|
+
components: [
|
|
29
|
+
{ label: 'ListBox', sveld: sveldListBox },
|
|
30
|
+
{ label: 'ListBoxItem', sveld: sveldListBoxItem, overrideProps: ['accent', 'padding', 'rounded', 'hover'] }
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<DocsShell {settings}>
|
|
36
|
+
<!-- Slot: Sandbox -->
|
|
37
|
+
<svelte:fragment slot="sandbox">
|
|
38
|
+
<section class="grid grid-cols-1 lg:grid-cols-2 gap-4">
|
|
39
|
+
<!-- Single -->
|
|
40
|
+
<div class="card p-4 space-y-4">
|
|
41
|
+
<ListBox selected={navSingle} label="Single Selection">
|
|
42
|
+
<ListBoxItem value={1}>Item 1</ListBoxItem>
|
|
43
|
+
<ListBoxItem value={2}>Item 2</ListBoxItem>
|
|
44
|
+
<ListBoxItem value={3}>Item 3</ListBoxItem>
|
|
45
|
+
</ListBox>
|
|
46
|
+
<p class="text-center">Selected: <code>{$navSingle}</code></p>
|
|
47
|
+
</div>
|
|
48
|
+
<!-- Multiple -->
|
|
49
|
+
<div class="card p-4 space-y-4">
|
|
50
|
+
<ListBox selected={navMultiple} label="Multi-Selection" hover="bg-secondary-hover-token" accent="!bg-secondary-active-token">
|
|
51
|
+
<ListBoxItem value={'A'}>Item A</ListBoxItem>
|
|
52
|
+
<ListBoxItem value={'B'}>Item B</ListBoxItem>
|
|
53
|
+
<ListBoxItem value={'C'}>Item C</ListBoxItem>
|
|
54
|
+
</ListBox>
|
|
55
|
+
<p class="text-center">Selected: <code>{$navMultiple}</code></p>
|
|
56
|
+
</div>
|
|
57
|
+
</section>
|
|
58
|
+
</svelte:fragment>
|
|
59
|
+
|
|
60
|
+
<!-- Slot: Usage -->
|
|
61
|
+
<svelte:fragment slot="usage">
|
|
62
|
+
<section class="space-y-4">
|
|
63
|
+
<h2>Single Value</h2>
|
|
64
|
+
<p>Define a writable store with a <u>singular</u> value of any type, then add a <code>value</code> prop to each child.</p>
|
|
65
|
+
<CodeBlock language="typescript" code={`import { writable, type Writable } from 'svelte/store';`} />
|
|
66
|
+
<CodeBlock language="typescript" code={`const storeSingle: Writable<number> = writable(1);`} />
|
|
67
|
+
<CodeBlock
|
|
68
|
+
language="html"
|
|
69
|
+
code={`
|
|
70
|
+
<ListBox selected="{storeSingle}" label="Single Selection">
|
|
71
|
+
<ListBoxItem value={1}>Selection Example 1</ListBoxItem>
|
|
72
|
+
<ListBoxItem value={2}>Selection Example 2</ListBoxItem>
|
|
73
|
+
</ListBox>`}
|
|
74
|
+
/>
|
|
75
|
+
</section>
|
|
76
|
+
<section class="space-y-4">
|
|
77
|
+
<h2>Multiple Values</h2>
|
|
78
|
+
<p>Create a writable with an <u>array</u> of values.</p>
|
|
79
|
+
<CodeBlock language="typescript" code={`import { writable, type Writable } from 'svelte/store';`} />
|
|
80
|
+
<CodeBlock language="typescript" code={`let storeMultiple: Writable<any[]> = writable(['A', 'B']);`} />
|
|
81
|
+
<CodeBlock
|
|
82
|
+
language="html"
|
|
83
|
+
code={`
|
|
84
|
+
<ListBox selected={storeMultiple} label="Multi-Selection">
|
|
85
|
+
<ListBoxItem value={'A'}>Item A</ListBoxItem>
|
|
86
|
+
<ListBoxItem value={'B'}>Item B</ListBoxItem>
|
|
87
|
+
<ListBoxItem value={'C'}>Item C</ListBoxItem>
|
|
88
|
+
</ListBox>`}
|
|
89
|
+
/>
|
|
90
|
+
</section>
|
|
91
|
+
</svelte:fragment>
|
|
92
|
+
</DocsShell>
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import DocsShell from '$docs/DocsShell/DocsShell.svelte';
|
|
3
|
+
import { DocsFeature, type DocsShellSettings } from '$docs/DocsShell/types';
|
|
4
|
+
|
|
5
|
+
import Paginator from '$lib/components/Paginator/Paginator.svelte';
|
|
6
|
+
import Table from '$lib/components/Table/Table.svelte';
|
|
7
|
+
import CodeBlock from '$lib/utilities/CodeBlock/CodeBlock.svelte';
|
|
8
|
+
|
|
9
|
+
import type { PaginationSettings } from '$lib/components/Paginator/types';
|
|
10
|
+
|
|
11
|
+
// @ts-expect-error sveld import
|
|
12
|
+
import sveldPaginator from '$lib/components/Paginator/Paginator.svelte?raw&sveld';
|
|
13
|
+
|
|
14
|
+
// Docs Shell
|
|
15
|
+
const settings: DocsShellSettings = {
|
|
16
|
+
feature: DocsFeature.Component,
|
|
17
|
+
name: 'Paginators',
|
|
18
|
+
description: 'Navigate between multiple pages of content.',
|
|
19
|
+
imports: ['Paginator'],
|
|
20
|
+
source: 'components/Paginator',
|
|
21
|
+
components: [{ sveld: sveldPaginator }]
|
|
22
|
+
};
|
|
23
|
+
// Local
|
|
24
|
+
const sourceHeaders: string[] = ['Positions', 'Name', 'Weight', 'Symbol'];
|
|
25
|
+
const sourceBody: any = [
|
|
26
|
+
[1, 'Hydrogen', 1.0079, 'H'],
|
|
27
|
+
[2, 'Helium', 4.0026, 'He'],
|
|
28
|
+
[3, 'Lithium', 6.941, 'Li'],
|
|
29
|
+
[4, 'Beryllium', 9.0122, 'Be'],
|
|
30
|
+
[5, 'Boron', 10.811, 'B'],
|
|
31
|
+
[6, 'Carbon', 12.0107, 'C'],
|
|
32
|
+
[7, 'Nitrogen', 14.0067, 'N'],
|
|
33
|
+
[8, 'Oxygen', 15.9994, 'O'],
|
|
34
|
+
[9, 'Fluorine', 18.9984, 'F'],
|
|
35
|
+
[10, 'Neon', 20.1797, 'Ne']
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
// Reactive
|
|
39
|
+
$: page = {
|
|
40
|
+
offset: 0,
|
|
41
|
+
limit: 5,
|
|
42
|
+
size: sourceBody.length,
|
|
43
|
+
amounts: [1, 2, 5, sourceBody.length]
|
|
44
|
+
} as PaginationSettings;
|
|
45
|
+
|
|
46
|
+
// Event Handlers
|
|
47
|
+
function onPageChange(e: CustomEvent): void {
|
|
48
|
+
console.log('Paginator - event:page', e.detail);
|
|
49
|
+
}
|
|
50
|
+
function onAmountChange(e: CustomEvent): void {
|
|
51
|
+
console.log('Paginator - event:amount', e.detail);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Reactive
|
|
55
|
+
$: sourceBodySliced = sourceBody.slice(page.offset * page.limit, page.offset * page.limit + page.limit);
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<DocsShell {settings}>
|
|
59
|
+
<!-- Slot: Sandbox -->
|
|
60
|
+
<svelte:fragment slot="sandbox">
|
|
61
|
+
<section class="space-y-4">
|
|
62
|
+
<Table
|
|
63
|
+
source={{
|
|
64
|
+
head: sourceHeaders,
|
|
65
|
+
body: sourceBodySliced
|
|
66
|
+
}}
|
|
67
|
+
/>
|
|
68
|
+
<div class="col-span-2 card p-4 space-y-4">
|
|
69
|
+
<Paginator bind:settings={page} on:page={onPageChange} on:amount={onAmountChange} />
|
|
70
|
+
</div>
|
|
71
|
+
</section>
|
|
72
|
+
</svelte:fragment>
|
|
73
|
+
|
|
74
|
+
<!-- Slot: Usage -->
|
|
75
|
+
<svelte:fragment slot="usage">
|
|
76
|
+
<div class="space-y-4">
|
|
77
|
+
<CodeBlock
|
|
78
|
+
language="typescript"
|
|
79
|
+
code={`
|
|
80
|
+
$: page = {
|
|
81
|
+
offset: 0,
|
|
82
|
+
limit: 5,
|
|
83
|
+
size: sourceData.length,
|
|
84
|
+
amounts: [1,2,5,10],
|
|
85
|
+
};`}
|
|
86
|
+
/>
|
|
87
|
+
<CodeBlock language="html" code={`<Paginator bind:settings={page} on:page={onPageChange} on:amount={onAmountChange}></Paginator>`} />
|
|
88
|
+
</div>
|
|
89
|
+
<div class="space-y-4">
|
|
90
|
+
<h2>Reactive Slicing</h2>
|
|
91
|
+
<p>
|
|
92
|
+
Once your paginator component is setup you'll need to limit your content. This can be accomplished with the JavaScript <a
|
|
93
|
+
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice"
|
|
94
|
+
target="_blank"
|
|
95
|
+
rel="noreferrer">slice</a
|
|
96
|
+
> method. See a minimal example below.
|
|
97
|
+
</p>
|
|
98
|
+
<CodeBlock language="typescript" code={`const source = [ /* any array of objects */ ]`} />
|
|
99
|
+
<CodeBlock
|
|
100
|
+
language="typescript"
|
|
101
|
+
code={`
|
|
102
|
+
$: sourcePaginated = source.slice(
|
|
103
|
+
page.offset * page.limit, // start
|
|
104
|
+
page.offset * page.limit + page.limit // end
|
|
105
|
+
);`}
|
|
106
|
+
/>
|
|
107
|
+
<CodeBlock
|
|
108
|
+
language="html"
|
|
109
|
+
code={`
|
|
110
|
+
<ul>
|
|
111
|
+
{#each sourcePaginated as row}
|
|
112
|
+
<li>{row}</li>
|
|
113
|
+
{/each}
|
|
114
|
+
</ul>`}
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
117
|
+
</svelte:fragment>
|
|
118
|
+
</DocsShell>
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { writable, type Writable } from 'svelte/store';
|
|
3
|
+
|
|
4
|
+
import DocsShell from '$docs/DocsShell/DocsShell.svelte';
|
|
5
|
+
import { DocsFeature, type DocsShellSettings } from '$docs/DocsShell/types';
|
|
6
|
+
|
|
7
|
+
import ProgressBar from '$lib/components/ProgressBar/ProgressBar.svelte';
|
|
8
|
+
import RadioGroup from '$lib/components/Radio/RadioGroup.svelte';
|
|
9
|
+
import RadioItem from '$lib/components/Radio/RadioItem.svelte';
|
|
10
|
+
import CodeBlock from '$lib/utilities/CodeBlock/CodeBlock.svelte';
|
|
11
|
+
|
|
12
|
+
// @ts-expect-error sveld import
|
|
13
|
+
import sveldProgressBar from '$lib/components/ProgressBar/ProgressBar.svelte?raw&sveld';
|
|
14
|
+
|
|
15
|
+
// Stores
|
|
16
|
+
const storeDeterminate: Writable<boolean> = writable(true);
|
|
17
|
+
const storeHeight: Writable<string> = writable('h-2');
|
|
18
|
+
const defaultTrackBg = 'bg-surface-200-700-token';
|
|
19
|
+
|
|
20
|
+
// Docs Shell
|
|
21
|
+
const settings: DocsShellSettings = {
|
|
22
|
+
feature: DocsFeature.Component,
|
|
23
|
+
name: 'Progress Bars',
|
|
24
|
+
description: 'An indicator showing the progress or completion of a task.',
|
|
25
|
+
imports: ['ProgressBar'],
|
|
26
|
+
source: 'components/ProgressBar',
|
|
27
|
+
components: [{ sveld: sveldProgressBar }]
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Reactive Props
|
|
31
|
+
$: props = {
|
|
32
|
+
determinate: $storeDeterminate,
|
|
33
|
+
label: 'Progress Bar',
|
|
34
|
+
value: 50,
|
|
35
|
+
max: 100,
|
|
36
|
+
height: $storeHeight,
|
|
37
|
+
rounded: 'rounded-token',
|
|
38
|
+
meter: 'bg-secondary-500',
|
|
39
|
+
track: defaultTrackBg
|
|
40
|
+
};
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<DocsShell {settings}>
|
|
44
|
+
<!-- Slot: Sandbox -->
|
|
45
|
+
<svelte:fragment slot="sandbox">
|
|
46
|
+
<section class="grid grid-cols-1 lg:grid-cols-[1fr_auto] gap-2">
|
|
47
|
+
<!-- Example -->
|
|
48
|
+
<div class="card p-4 h-full flex justify-center items-center">
|
|
49
|
+
<div class="py-10 w-[90%]">
|
|
50
|
+
<svelte:component
|
|
51
|
+
this={ProgressBar}
|
|
52
|
+
label={props.label}
|
|
53
|
+
value={props.determinate ? props.value : undefined}
|
|
54
|
+
max={props.max}
|
|
55
|
+
height={props.height}
|
|
56
|
+
rounded={props.rounded}
|
|
57
|
+
meter={props.meter}
|
|
58
|
+
track={props.track}
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<!-- Options -->
|
|
63
|
+
<div class="card p-4 space-y-4 w-auto lg:w-[400px]">
|
|
64
|
+
<!-- Mode -->
|
|
65
|
+
<label for="">
|
|
66
|
+
<RadioGroup selected={storeDeterminate} display="flex">
|
|
67
|
+
<RadioItem value={true}>Determinate</RadioItem>
|
|
68
|
+
<RadioItem value={false}>Indeterminate</RadioItem>
|
|
69
|
+
</RadioGroup>
|
|
70
|
+
</label>
|
|
71
|
+
<!-- Amount -->
|
|
72
|
+
{#if props.determinate}
|
|
73
|
+
<input
|
|
74
|
+
type="range"
|
|
75
|
+
id="amount"
|
|
76
|
+
name="amount"
|
|
77
|
+
min="0"
|
|
78
|
+
max={props.max}
|
|
79
|
+
step="10"
|
|
80
|
+
bind:value={props.value}
|
|
81
|
+
aria-label="Value Amount"
|
|
82
|
+
/>
|
|
83
|
+
{/if}
|
|
84
|
+
<!-- Label -->
|
|
85
|
+
<label>
|
|
86
|
+
<span>Label</span>
|
|
87
|
+
<input type="text" bind:value={props.label} placeholder="Label" />
|
|
88
|
+
</label>
|
|
89
|
+
<!-- Height -->
|
|
90
|
+
<label for="">
|
|
91
|
+
<span>Height</span>
|
|
92
|
+
<RadioGroup selected={storeHeight} display="flex">
|
|
93
|
+
<RadioItem value="h-1">h-1</RadioItem>
|
|
94
|
+
<RadioItem value="h-2">h-2</RadioItem>
|
|
95
|
+
<RadioItem value="h-4">h-4</RadioItem>
|
|
96
|
+
<RadioItem value="h-8">h-8</RadioItem>
|
|
97
|
+
</RadioGroup>
|
|
98
|
+
</label>
|
|
99
|
+
<!-- Rounded -->
|
|
100
|
+
<label>
|
|
101
|
+
<span>Rounded</span>
|
|
102
|
+
<select name="rounded" id="rounded" bind:value={props.rounded}>
|
|
103
|
+
<option value="rounded-token">rounded-token</option>
|
|
104
|
+
<option value="rounded">rounded</option>
|
|
105
|
+
<option value="rounded-full">rounded-full</option>
|
|
106
|
+
</select>
|
|
107
|
+
</label>
|
|
108
|
+
<!-- Meter -->
|
|
109
|
+
<label>
|
|
110
|
+
<span>Meter</span>
|
|
111
|
+
<select name="meter" id="meter" bind:value={props.meter}>
|
|
112
|
+
<option value="bg-primary-500">bg-primary-500</option>
|
|
113
|
+
<option value="bg-secondary-500">bg-secondary-500</option>
|
|
114
|
+
<option value="bg-tertiary-500">bg-tertiary-500</option>
|
|
115
|
+
<option value="bg-success-500">bg-success-500</option>
|
|
116
|
+
<option value="bg-warning-500">bg-warning-500</option>
|
|
117
|
+
<option value="bg-error-500">bg-error-500</option>
|
|
118
|
+
<option value="bg-surface-500">bg-surface-500</option>
|
|
119
|
+
</select>
|
|
120
|
+
</label>
|
|
121
|
+
<!-- track -->
|
|
122
|
+
<label>
|
|
123
|
+
<span>Track</span>
|
|
124
|
+
<select name="track" id="track" bind:value={props.track}>
|
|
125
|
+
<option value={defaultTrackBg}>Default</option>
|
|
126
|
+
<option value="bg-primary-500/30">bg-primary-500/30</option>
|
|
127
|
+
<option value="bg-secondary-500/30">bg-secondary-500/30</option>
|
|
128
|
+
<option value="bg-tertiary-500/30">bg-tertiary-500/30</option>
|
|
129
|
+
<option value="bg-success-500/30">bg-success-500/30</option>
|
|
130
|
+
<option value="bg-warning-500/30">bg-warning-500/30</option>
|
|
131
|
+
<option value="bg-errror-500/30">bg-errror-500/30</option>
|
|
132
|
+
<option value="bg-surface-500/30">bg-surface-500/30</option>
|
|
133
|
+
</select>
|
|
134
|
+
</label>
|
|
135
|
+
</div>
|
|
136
|
+
</section>
|
|
137
|
+
</svelte:fragment>
|
|
138
|
+
|
|
139
|
+
<!-- Slot: Usage -->
|
|
140
|
+
<svelte:fragment slot="usage">
|
|
141
|
+
<div class="space-y-4">
|
|
142
|
+
<p>
|
|
143
|
+
This component is treated as an <a
|
|
144
|
+
href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/progressbar_role"
|
|
145
|
+
target="_blank"
|
|
146
|
+
rel="noreferrer">ARIA progressbar</a
|
|
147
|
+
>.
|
|
148
|
+
</p>
|
|
149
|
+
<CodeBlock language="html" code={`<ProgressBar label="Progress Bar" value={50} max={100} />`} />
|
|
150
|
+
</div>
|
|
151
|
+
<div class="space-y-4">
|
|
152
|
+
<h2>Indeterminate Mode</h2>
|
|
153
|
+
<p>The <code>value</code> property must be removed or set to <code>undefined</code>.</p>
|
|
154
|
+
<CodeBlock language="html" code={`<ProgressBar />`} />
|
|
155
|
+
</div>
|
|
156
|
+
</svelte:fragment>
|
|
157
|
+
</DocsShell>
|