@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,48 @@
|
|
|
1
|
+
import { render } from '@testing-library/svelte';
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
|
|
4
|
+
import Crumb from '$lib/components/Breadcrumb/Crumb.svelte';
|
|
5
|
+
|
|
6
|
+
describe('Crumb.svelte', () => {
|
|
7
|
+
it('Renders with minimal props', async () => {
|
|
8
|
+
const { getByTestId } = render(Crumb);
|
|
9
|
+
expect(getByTestId('crumb')).toBeTruthy();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('Renders with style props', () => {
|
|
13
|
+
const { getByTestId } = render(Crumb, {
|
|
14
|
+
props: {
|
|
15
|
+
text: 'text-base',
|
|
16
|
+
color: 'text-white'
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
expect(getByTestId('crumb')).toBeTruthy();
|
|
20
|
+
// expect(getByTestId('crumb')?.className).to.contain('text-base');
|
|
21
|
+
expect(getByTestId('crumb')?.className).to.contain('text-white');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('Renders an anchor with seperator', () => {
|
|
25
|
+
const { getByTestId } = render(Crumb, {
|
|
26
|
+
props: {
|
|
27
|
+
href: '/foobar',
|
|
28
|
+
separator: '|'
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
expect(getByTestId('crumb')).toBeTruthy();
|
|
32
|
+
expect(getByTestId('crumb').querySelector('a')).toBeTruthy();
|
|
33
|
+
expect(getByTestId('crumb').querySelector('a')?.href).to.contain('/foobar');
|
|
34
|
+
expect(getByTestId('crumb').querySelector('.crumb-seperator')).toBeTruthy();
|
|
35
|
+
expect(getByTestId('crumb').querySelector('.crumb-seperator')?.textContent).eq('|');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('Renders a current page as span', () => {
|
|
39
|
+
const { getByTestId } = render(Crumb, {
|
|
40
|
+
props: {
|
|
41
|
+
text: 'text-base',
|
|
42
|
+
color: 'text-white'
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
expect(getByTestId('crumb')).toBeTruthy();
|
|
46
|
+
expect(getByTestId('crumb').querySelector('span')).toBeTruthy();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tailwindDefaultColors } from './settings';
|
|
3
|
+
import type { ConicStop } from './types';
|
|
4
|
+
|
|
5
|
+
// Props
|
|
6
|
+
/**
|
|
7
|
+
* Provide a data set of color stops and labels.
|
|
8
|
+
* @type {ConicStop[]}
|
|
9
|
+
*/
|
|
10
|
+
export let stops: ConicStop[] = [{ color: ['neutral', 500], start: 0, end: 100 }];
|
|
11
|
+
/** Allows for automatic generation of a legend below the conic gradient. */
|
|
12
|
+
export let legend = false;
|
|
13
|
+
/** When enabled, the conic gradient will spin. */
|
|
14
|
+
export let spin = false;
|
|
15
|
+
/** Provided classes to style the conic gradient width. */
|
|
16
|
+
export let width = 'w-full';
|
|
17
|
+
/** Provided classes to style the legend hover effect. */
|
|
18
|
+
export let hover = 'bg-primary-hover-token';
|
|
19
|
+
|
|
20
|
+
// Local
|
|
21
|
+
let cone: string;
|
|
22
|
+
let generatedLegendList: any[];
|
|
23
|
+
|
|
24
|
+
// Styles
|
|
25
|
+
const cBase = 'flex flex-col items-center space-y-4';
|
|
26
|
+
const cCaption = 'text-center';
|
|
27
|
+
const cCone = 'block aspect-square rounded-full';
|
|
28
|
+
const cLabel = 'text-sm w-full';
|
|
29
|
+
const cSwatch = 'block aspect-square bg-black w-5 rounded-full mr-2';
|
|
30
|
+
|
|
31
|
+
// Set Color
|
|
32
|
+
function setColorValue(color: any): string {
|
|
33
|
+
// If string, keep as is
|
|
34
|
+
if (typeof color === 'string') return color;
|
|
35
|
+
// If object, provide default Tailwind color
|
|
36
|
+
const colorSet: any = tailwindDefaultColors.find((c) => c.label === color[0]);
|
|
37
|
+
return colorSet?.shades[color[1]].hex;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Generate Conic Gradient style
|
|
41
|
+
function genConicGradient(): void {
|
|
42
|
+
let d: any = stops.map((v) => `${setColorValue(v.color)} ${v.start}% ${v.end}%`);
|
|
43
|
+
cone = `conic-gradient(${d.join(', ')})`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Generate Legend
|
|
47
|
+
function genLegend(): any {
|
|
48
|
+
if (!legend) return;
|
|
49
|
+
generatedLegendList = stops.map((v) => {
|
|
50
|
+
return {
|
|
51
|
+
label: v.label,
|
|
52
|
+
color: setColorValue(v.color),
|
|
53
|
+
value: v.end - v.start
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Lifecycle (on init)
|
|
59
|
+
genConicGradient();
|
|
60
|
+
genLegend();
|
|
61
|
+
|
|
62
|
+
// Reactive
|
|
63
|
+
$: classesBase = `${cBase} ${$$props.class ?? ''}`;
|
|
64
|
+
$: classesCone = `${cCone} ${width}`;
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<figure class="conic-gradient {classesBase}" data-testid="conic-gradient">
|
|
68
|
+
<!-- Label -->
|
|
69
|
+
{#if $$slots.default}
|
|
70
|
+
<figcaption class="conic-caption {cCaption}"><slot /></figcaption>
|
|
71
|
+
{/if}
|
|
72
|
+
<!-- Conic Gradient -->
|
|
73
|
+
{#if cone}
|
|
74
|
+
<div class="concic-cone {classesCone}" class:animate-spin={spin} style:background={cone} />
|
|
75
|
+
{/if}
|
|
76
|
+
<!-- Legend -->
|
|
77
|
+
{#if legend && generatedLegendList}
|
|
78
|
+
<ul class="conic-list list {cLabel}">
|
|
79
|
+
{#each generatedLegendList as { color, label, value }}
|
|
80
|
+
<li class="conic-item {hover}" on:click on:keydown on:keyup on:keypress>
|
|
81
|
+
<span class="conic-swatch {cSwatch}" style:background={color} />
|
|
82
|
+
<span class="conic-label flex-auto">{label}</span>
|
|
83
|
+
<strong class="conic-value">{value}%</strong>
|
|
84
|
+
</li>
|
|
85
|
+
{/each}
|
|
86
|
+
</ul>
|
|
87
|
+
{/if}
|
|
88
|
+
</figure>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { render } from '@testing-library/svelte';
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
|
|
4
|
+
import ConicGradient from '$lib/components/ConicGradient/ConicGradient.svelte';
|
|
5
|
+
|
|
6
|
+
describe('ConicGradient.svelte', () => {
|
|
7
|
+
it('Renders with minimal props', async () => {
|
|
8
|
+
const { getByTestId } = render(ConicGradient);
|
|
9
|
+
expect(getByTestId('conic-gradient')).toBeTruthy();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('Renders with props', () => {
|
|
13
|
+
const { getByTestId } = render(ConicGradient, {
|
|
14
|
+
props: {
|
|
15
|
+
data: [
|
|
16
|
+
{ label: 'Emerald', color: ['emerald', 500], start: 0, end: 33 },
|
|
17
|
+
{ label: 'Indigo', color: ['indigo', 500], start: 33, end: 66 },
|
|
18
|
+
{ label: 'Rose', color: ['rose', 500], start: 66, end: 100 }
|
|
19
|
+
],
|
|
20
|
+
legend: true,
|
|
21
|
+
width: 'w-8'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
expect(getByTestId('conic-gradient')).toBeTruthy();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
export type TailwindNumbers = typeof tailwindNumbers[number];
|
|
2
|
+
export const tailwindNumbers = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'] as const;
|
|
3
|
+
|
|
4
|
+
export type SemanticNames = typeof semanticNames[number];
|
|
5
|
+
export const semanticNames = ['primary', 'secondary', 'tertiary', 'success', 'warning', 'error', 'surface'] as const;
|
|
6
|
+
|
|
7
|
+
export type HexRgb = { hex: string; rgb: string };
|
|
8
|
+
export type TailwindColorObject = {
|
|
9
|
+
label: string;
|
|
10
|
+
shades: Record<TailwindNumbers, HexRgb>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// https://tailwindcss.com/docs/customizing-colors#default-color-palette
|
|
14
|
+
export const tailwindDefaultColors: TailwindColorObject[] = [
|
|
15
|
+
{
|
|
16
|
+
label: 'slate',
|
|
17
|
+
shades: {
|
|
18
|
+
'50': { hex: '#f8fafc', rgb: '248 250 252' },
|
|
19
|
+
'100': { hex: '#f1f5f9', rgb: '241 245 249' },
|
|
20
|
+
'200': { hex: '#e2e8f0', rgb: '226 232 240' },
|
|
21
|
+
'300': { hex: '#cbd5e1', rgb: '203 213 225' },
|
|
22
|
+
'400': { hex: '#94a3b8', rgb: '148 163 184' },
|
|
23
|
+
'500': { hex: '#64748b', rgb: '100 116 139' },
|
|
24
|
+
'600': { hex: '#475569', rgb: '71 85 105' },
|
|
25
|
+
'700': { hex: '#334155', rgb: '51 65 85' },
|
|
26
|
+
'800': { hex: '#1e293b', rgb: '30 41 59' },
|
|
27
|
+
'900': { hex: '#0f172a', rgb: '15 23 42' }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'gray',
|
|
32
|
+
shades: {
|
|
33
|
+
'50': { hex: '#f9fafb', rgb: '249 250 251' },
|
|
34
|
+
'100': { hex: '#f3f4f6', rgb: '243 244 246' },
|
|
35
|
+
'200': { hex: '#e5e7eb', rgb: '229 231 235' },
|
|
36
|
+
'300': { hex: '#d1d5db', rgb: '209 213 219' },
|
|
37
|
+
'400': { hex: '#9ca3af', rgb: '156 163 175' },
|
|
38
|
+
'500': { hex: '#6b7280', rgb: '107 114 128' },
|
|
39
|
+
'600': { hex: '#4b5563', rgb: '75 85 99' },
|
|
40
|
+
'700': { hex: '#374151', rgb: '55 65 81' },
|
|
41
|
+
'800': { hex: '#1f2937', rgb: '31 41 55' },
|
|
42
|
+
'900': { hex: '#111827', rgb: '17 24 39' }
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'zinc',
|
|
47
|
+
shades: {
|
|
48
|
+
'50': { hex: '#fafafa', rgb: '250 250 250' },
|
|
49
|
+
'100': { hex: '#f4f4f5', rgb: '244 244 245' },
|
|
50
|
+
'200': { hex: '#e4e4e7', rgb: '228 228 231' },
|
|
51
|
+
'300': { hex: '#d4d4d8', rgb: '212 212 216' },
|
|
52
|
+
'400': { hex: '#a1a1aa', rgb: '161 161 170' },
|
|
53
|
+
'500': { hex: '#71717a', rgb: '113 113 122' },
|
|
54
|
+
'600': { hex: '#52525b', rgb: '82 82 91' },
|
|
55
|
+
'700': { hex: '#3f3f46', rgb: '63 63 70' },
|
|
56
|
+
'800': { hex: '#27272a', rgb: '39 39 42' },
|
|
57
|
+
'900': { hex: '#18181b', rgb: '24 24 27' }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: 'neutral',
|
|
62
|
+
shades: {
|
|
63
|
+
'50': { hex: '#fafafa', rgb: '250 250 250' },
|
|
64
|
+
'100': { hex: '#f5f5f5', rgb: '245 245 245' },
|
|
65
|
+
'200': { hex: '#e5e5e5', rgb: '229 229 229' },
|
|
66
|
+
'300': { hex: '#d4d4d4', rgb: '212 212 212' },
|
|
67
|
+
'400': { hex: '#a3a3a3', rgb: '163 163 163' },
|
|
68
|
+
'500': { hex: '#737373', rgb: '115 115 115' },
|
|
69
|
+
'600': { hex: '#525252', rgb: '82 82 82' },
|
|
70
|
+
'700': { hex: '#404040', rgb: '64 64 64' },
|
|
71
|
+
'800': { hex: '#262626', rgb: '38 38 38' },
|
|
72
|
+
'900': { hex: '#171717', rgb: '23 23 23' }
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: 'stone',
|
|
77
|
+
shades: {
|
|
78
|
+
'50': { hex: '#fafaf9', rgb: '250 250 249' },
|
|
79
|
+
'100': { hex: '#f5f5f4', rgb: '245 245 244' },
|
|
80
|
+
'200': { hex: '#e7e5e4', rgb: '231 229 228' },
|
|
81
|
+
'300': { hex: '#d6d3d1', rgb: '214 211 209' },
|
|
82
|
+
'400': { hex: '#a8a29e', rgb: '168 162 158' },
|
|
83
|
+
'500': { hex: '#78716c', rgb: '120 113 108' },
|
|
84
|
+
'600': { hex: '#57534e', rgb: '87 83 78' },
|
|
85
|
+
'700': { hex: '#44403c', rgb: '68 64 60' },
|
|
86
|
+
'800': { hex: '#292524', rgb: '41 37 36' },
|
|
87
|
+
'900': { hex: '#1c1917', rgb: '28 25 23' }
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: 'red',
|
|
92
|
+
shades: {
|
|
93
|
+
'50': { hex: '#fef2f2', rgb: '254 242 242' },
|
|
94
|
+
'100': { hex: '#fee2e2', rgb: '254 226 226' },
|
|
95
|
+
'200': { hex: '#fecaca', rgb: '254 202 202' },
|
|
96
|
+
'300': { hex: '#fca5a5', rgb: '252 165 165' },
|
|
97
|
+
'400': { hex: '#f87171', rgb: '248 113 113' },
|
|
98
|
+
'500': { hex: '#ef4444', rgb: '239 68 68' },
|
|
99
|
+
'600': { hex: '#dc2626', rgb: '220 38 38' },
|
|
100
|
+
'700': { hex: '#b91c1c', rgb: '185 28 28' },
|
|
101
|
+
'800': { hex: '#991b1b', rgb: '153 27 27' },
|
|
102
|
+
'900': { hex: '#7f1d1d', rgb: '127 29 29' }
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: 'orange',
|
|
107
|
+
shades: {
|
|
108
|
+
'50': { hex: '#fff7ed', rgb: '255 247 237' },
|
|
109
|
+
'100': { hex: '#ffedd5', rgb: '255 237 213' },
|
|
110
|
+
'200': { hex: '#fed7aa', rgb: '254 215 170' },
|
|
111
|
+
'300': { hex: '#fdba74', rgb: '253 186 116' },
|
|
112
|
+
'400': { hex: '#fb923c', rgb: '251 146 60' },
|
|
113
|
+
'500': { hex: '#f97316', rgb: '249 115 22' },
|
|
114
|
+
'600': { hex: '#ea580c', rgb: '234 88 12' },
|
|
115
|
+
'700': { hex: '#c2410c', rgb: '194 65 12' },
|
|
116
|
+
'800': { hex: '#9a3412', rgb: '154 52 18' },
|
|
117
|
+
'900': { hex: '#7c2d12', rgb: '124 45 18' }
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
label: 'amber',
|
|
122
|
+
shades: {
|
|
123
|
+
'50': { hex: '#fffbeb', rgb: '255 251 235' },
|
|
124
|
+
'100': { hex: '#fef3c7', rgb: '254 243 199' },
|
|
125
|
+
'200': { hex: '#fde68a', rgb: '253 230 138' },
|
|
126
|
+
'300': { hex: '#fcd34d', rgb: '252 211 77' },
|
|
127
|
+
'400': { hex: '#fbbf24', rgb: '251 191 36' },
|
|
128
|
+
'500': { hex: '#f59e0b', rgb: '245 158 11' },
|
|
129
|
+
'600': { hex: '#d97706', rgb: '217 119 6' },
|
|
130
|
+
'700': { hex: '#b45309', rgb: '180 83 9' },
|
|
131
|
+
'800': { hex: '#92400e', rgb: '146 64 14' },
|
|
132
|
+
'900': { hex: '#78350f', rgb: '120 53 15' }
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
label: 'yellow',
|
|
137
|
+
shades: {
|
|
138
|
+
'50': { hex: '#fefce8', rgb: '254 252 232' },
|
|
139
|
+
'100': { hex: '#fef9c3', rgb: '254 249 195' },
|
|
140
|
+
'200': { hex: '#fef08a', rgb: '254 240 138' },
|
|
141
|
+
'300': { hex: '#fde047', rgb: '253 224 71' },
|
|
142
|
+
'400': { hex: '#facc15', rgb: '250 204 21' },
|
|
143
|
+
'500': { hex: '#eab308', rgb: '234 179 8' },
|
|
144
|
+
'600': { hex: '#ca8a04', rgb: '202 138 4' },
|
|
145
|
+
'700': { hex: '#a16207', rgb: '161 98 7' },
|
|
146
|
+
'800': { hex: '#854d0e', rgb: '133 77 14' },
|
|
147
|
+
'900': { hex: '#713f12', rgb: '113 63 18' }
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
label: 'lime',
|
|
152
|
+
shades: {
|
|
153
|
+
'50': { hex: '#f7fee7', rgb: '247 254 231' },
|
|
154
|
+
'100': { hex: '#ecfccb', rgb: '236 252 203' },
|
|
155
|
+
'200': { hex: '#d9f99d', rgb: '217 249 157' },
|
|
156
|
+
'300': { hex: '#bef264', rgb: '190 242 100' },
|
|
157
|
+
'400': { hex: '#a3e635', rgb: '163 230 53' },
|
|
158
|
+
'500': { hex: '#84cc16', rgb: '132 204 22' },
|
|
159
|
+
'600': { hex: '#65a30d', rgb: '101 163 13' },
|
|
160
|
+
'700': { hex: '#4d7c0f', rgb: '77 124 15' },
|
|
161
|
+
'800': { hex: '#3f6212', rgb: '63 98 18' },
|
|
162
|
+
'900': { hex: '#365314', rgb: '54 83 20' }
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
label: 'green',
|
|
167
|
+
shades: {
|
|
168
|
+
'50': { hex: '#f0fdf4', rgb: '240 253 244' },
|
|
169
|
+
'100': { hex: '#dcfce7', rgb: '220 252 231' },
|
|
170
|
+
'200': { hex: '#bbf7d0', rgb: '187 247 208' },
|
|
171
|
+
'300': { hex: '#86efac', rgb: '134 239 172' },
|
|
172
|
+
'400': { hex: '#4ade80', rgb: '74 222 128' },
|
|
173
|
+
'500': { hex: '#22c55e', rgb: '34 197 94' },
|
|
174
|
+
'600': { hex: '#16a34a', rgb: '22 163 74' },
|
|
175
|
+
'700': { hex: '#15803d', rgb: '21 128 61' },
|
|
176
|
+
'800': { hex: '#166534', rgb: '22 101 52' },
|
|
177
|
+
'900': { hex: '#14532d', rgb: '20 83 45' }
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
label: 'emerald',
|
|
182
|
+
shades: {
|
|
183
|
+
'50': { hex: '#ecfdf5', rgb: '236 253 245' },
|
|
184
|
+
'100': { hex: '#d1fae5', rgb: '209 250 229' },
|
|
185
|
+
'200': { hex: '#a7f3d0', rgb: '167 243 208' },
|
|
186
|
+
'300': { hex: '#6ee7b7', rgb: '110 231 183' },
|
|
187
|
+
'400': { hex: '#34d399', rgb: '52 211 153' },
|
|
188
|
+
'500': { hex: '#10b981', rgb: '16 185 129' },
|
|
189
|
+
'600': { hex: '#059669', rgb: '5 150 105' },
|
|
190
|
+
'700': { hex: '#047857', rgb: '4 120 87' },
|
|
191
|
+
'800': { hex: '#065f46', rgb: '6 95 70' },
|
|
192
|
+
'900': { hex: '#064e3b', rgb: '6 78 59' }
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
label: 'teal',
|
|
197
|
+
shades: {
|
|
198
|
+
'50': { hex: '#f0fdfa', rgb: '240 253 250' },
|
|
199
|
+
'100': { hex: '#ccfbf1', rgb: '204 251 241' },
|
|
200
|
+
'200': { hex: '#99f6e4', rgb: '153 246 228' },
|
|
201
|
+
'300': { hex: '#5eead4', rgb: '94 234 212' },
|
|
202
|
+
'400': { hex: '#2dd4bf', rgb: '45 212 191' },
|
|
203
|
+
'500': { hex: '#14b8a6', rgb: '20 184 166' },
|
|
204
|
+
'600': { hex: '#0d9488', rgb: '13 148 136' },
|
|
205
|
+
'700': { hex: '#0f766e', rgb: '15 118 110' },
|
|
206
|
+
'800': { hex: '#115e59', rgb: '17 94 89' },
|
|
207
|
+
'900': { hex: '#134e4a', rgb: '19 78 74' }
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
label: 'cyan',
|
|
212
|
+
shades: {
|
|
213
|
+
'50': { hex: '#ecfeff', rgb: '236 254 255' },
|
|
214
|
+
'100': { hex: '#cffafe', rgb: '207 250 254' },
|
|
215
|
+
'200': { hex: '#a5f3fc', rgb: '165 243 252' },
|
|
216
|
+
'300': { hex: '#67e8f9', rgb: '103 232 249' },
|
|
217
|
+
'400': { hex: '#22d3ee', rgb: '34 211 238' },
|
|
218
|
+
'500': { hex: '#06b6d4', rgb: '6 182 212' },
|
|
219
|
+
'600': { hex: '#0891b2', rgb: '8 145 178' },
|
|
220
|
+
'700': { hex: '#0e7490', rgb: '14 116 144' },
|
|
221
|
+
'800': { hex: '#155e75', rgb: '21 94 117' },
|
|
222
|
+
'900': { hex: '#164e63', rgb: '22 78 99' }
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
label: 'sky',
|
|
227
|
+
shades: {
|
|
228
|
+
'50': { hex: '#f0f9ff', rgb: '240 249 255' },
|
|
229
|
+
'100': { hex: '#e0f2fe', rgb: '224 242 254' },
|
|
230
|
+
'200': { hex: '#bae6fd', rgb: '186 230 253' },
|
|
231
|
+
'300': { hex: '#7dd3fc', rgb: '125 211 252' },
|
|
232
|
+
'400': { hex: '#38bdf8', rgb: '56 189 248' },
|
|
233
|
+
'500': { hex: '#0ea5e9', rgb: '14 165 233' },
|
|
234
|
+
'600': { hex: '#0284c7', rgb: '2 132 199' },
|
|
235
|
+
'700': { hex: '#0369a1', rgb: '3 105 161' },
|
|
236
|
+
'800': { hex: '#075985', rgb: '7 89 133' },
|
|
237
|
+
'900': { hex: '#0c4a6e', rgb: '12 74 110' }
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
label: 'blue',
|
|
242
|
+
shades: {
|
|
243
|
+
'50': { hex: '#eff6ff', rgb: '239 246 255' },
|
|
244
|
+
'100': { hex: '#dbeafe', rgb: '219 234 254' },
|
|
245
|
+
'200': { hex: '#bfdbfe', rgb: '191 219 254' },
|
|
246
|
+
'300': { hex: '#93c5fd', rgb: '147 197 253' },
|
|
247
|
+
'400': { hex: '#60a5fa', rgb: '96 165 250' },
|
|
248
|
+
'500': { hex: '#3b82f6', rgb: '59 130 246' },
|
|
249
|
+
'600': { hex: '#2563eb', rgb: '37 99 235' },
|
|
250
|
+
'700': { hex: '#1d4ed8', rgb: '29 78 216' },
|
|
251
|
+
'800': { hex: '#1e40af', rgb: '30 64 175' },
|
|
252
|
+
'900': { hex: '#1e3a8a', rgb: '30 58 138' }
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
label: 'indigo',
|
|
257
|
+
shades: {
|
|
258
|
+
'50': { hex: '#eef2ff', rgb: '238 242 255' },
|
|
259
|
+
'100': { hex: '#e0e7ff', rgb: '224 231 255' },
|
|
260
|
+
'200': { hex: '#c7d2fe', rgb: '199 210 254' },
|
|
261
|
+
'300': { hex: '#a5b4fc', rgb: '165 180 252' },
|
|
262
|
+
'400': { hex: '#818cf8', rgb: '129 140 248' },
|
|
263
|
+
'500': { hex: '#6366f1', rgb: '99 102 241' },
|
|
264
|
+
'600': { hex: '#4f46e5', rgb: '79 70 229' },
|
|
265
|
+
'700': { hex: '#4338ca', rgb: '67 56 202' },
|
|
266
|
+
'800': { hex: '#3730a3', rgb: '55 48 163' },
|
|
267
|
+
'900': { hex: '#312e81', rgb: '49 46 129' }
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
label: 'violet',
|
|
272
|
+
shades: {
|
|
273
|
+
'50': { hex: '#f5f3ff', rgb: '245 243 255' },
|
|
274
|
+
'100': { hex: '#ede9fe', rgb: '237 233 254' },
|
|
275
|
+
'200': { hex: '#ddd6fe', rgb: '221 214 254' },
|
|
276
|
+
'300': { hex: '#c4b5fd', rgb: '196 181 253' },
|
|
277
|
+
'400': { hex: '#a78bfa', rgb: '167 139 250' },
|
|
278
|
+
'500': { hex: '#8b5cf6', rgb: '139 92 246' },
|
|
279
|
+
'600': { hex: '#7c3aed', rgb: '124 58 237' },
|
|
280
|
+
'700': { hex: '#6d28d9', rgb: '109 40 217' },
|
|
281
|
+
'800': { hex: '#5b21b6', rgb: '91 33 182' },
|
|
282
|
+
'900': { hex: '#4c1d95', rgb: '76 29 149' }
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
label: 'purple',
|
|
287
|
+
shades: {
|
|
288
|
+
'50': { hex: '#faf5ff', rgb: '250 245 255' },
|
|
289
|
+
'100': { hex: '#f3e8ff', rgb: '243 232 255' },
|
|
290
|
+
'200': { hex: '#e9d5ff', rgb: '233 213 255' },
|
|
291
|
+
'300': { hex: '#d8b4fe', rgb: '216 180 254' },
|
|
292
|
+
'400': { hex: '#c084fc', rgb: '192 132 252' },
|
|
293
|
+
'500': { hex: '#a855f7', rgb: '168 85 247' },
|
|
294
|
+
'600': { hex: '#9333ea', rgb: '147 51 234' },
|
|
295
|
+
'700': { hex: '#7e22ce', rgb: '126 34 206' },
|
|
296
|
+
'800': { hex: '#6b21a8', rgb: '107 33 168' },
|
|
297
|
+
'900': { hex: '#581c87', rgb: '88 28 135' }
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
label: 'fuchsia',
|
|
302
|
+
shades: {
|
|
303
|
+
'50': { hex: '#fdf4ff', rgb: '253 244 255' },
|
|
304
|
+
'100': { hex: '#fae8ff', rgb: '250 232 255' },
|
|
305
|
+
'200': { hex: '#f5d0fe', rgb: '245 208 254' },
|
|
306
|
+
'300': { hex: '#f0abfc', rgb: '240 171 252' },
|
|
307
|
+
'400': { hex: '#e879f9', rgb: '232 121 249' },
|
|
308
|
+
'500': { hex: '#d946ef', rgb: '217 70 239' },
|
|
309
|
+
'600': { hex: '#c026d3', rgb: '192 38 211' },
|
|
310
|
+
'700': { hex: '#a21caf', rgb: '162 28 175' },
|
|
311
|
+
'800': { hex: '#86198f', rgb: '134 25 143' },
|
|
312
|
+
'900': { hex: '#701a75', rgb: '112 26 117' }
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
label: 'pink',
|
|
317
|
+
shades: {
|
|
318
|
+
'50': { hex: '#fdf2f8', rgb: '253 242 248' },
|
|
319
|
+
'100': { hex: '#fce7f3', rgb: '252 231 243' },
|
|
320
|
+
'200': { hex: '#fbcfe8', rgb: '251 207 232' },
|
|
321
|
+
'300': { hex: '#f9a8d4', rgb: '249 168 212' },
|
|
322
|
+
'400': { hex: '#f472b6', rgb: '244 114 182' },
|
|
323
|
+
'500': { hex: '#ec4899', rgb: '236 72 153' },
|
|
324
|
+
'600': { hex: '#db2777', rgb: '219 39 119' },
|
|
325
|
+
'700': { hex: '#be185d', rgb: '190 24 93' },
|
|
326
|
+
'800': { hex: '#9d174d', rgb: '157 23 77' },
|
|
327
|
+
'900': { hex: '#831843', rgb: '131 24 67' }
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
label: 'rose',
|
|
332
|
+
shades: {
|
|
333
|
+
'50': { hex: '#fff1f2', rgb: '255 241 242' },
|
|
334
|
+
'100': { hex: '#ffe4e6', rgb: '255 228 230' },
|
|
335
|
+
'200': { hex: '#fecdd3', rgb: '254 205 211' },
|
|
336
|
+
'300': { hex: '#fda4af', rgb: '253 164 175' },
|
|
337
|
+
'400': { hex: '#fb7185', rgb: '251 113 133' },
|
|
338
|
+
'500': { hex: '#f43f5e', rgb: '244 63 94' },
|
|
339
|
+
'600': { hex: '#e11d48', rgb: '225 29 72' },
|
|
340
|
+
'700': { hex: '#be123c', rgb: '190 18 60' },
|
|
341
|
+
'800': { hex: '#9f1239', rgb: '159 18 57' },
|
|
342
|
+
'900': { hex: '#881337', rgb: '136 19 55' }
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Conic Gradient Types
|
|
2
|
+
|
|
3
|
+
export interface ConicStop {
|
|
4
|
+
/** The legend label value. */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** The desired color value. */
|
|
7
|
+
color: string | object;
|
|
8
|
+
/** Starting stop value (0-100) */
|
|
9
|
+
start: number;
|
|
10
|
+
/** Ending stop value (0-100) */
|
|
11
|
+
end: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// Props
|
|
3
|
+
/** When enabled, sets the width to zero and height to full. */
|
|
4
|
+
export let vertical = false;
|
|
5
|
+
/** Provide classes to set the border width. */
|
|
6
|
+
export let borderWidth = 'border-t';
|
|
7
|
+
/** Provide classes to set the border style. */
|
|
8
|
+
export let borderStyle = 'border-solid';
|
|
9
|
+
/** Provide classes to set the border color. */
|
|
10
|
+
export let borderColor = 'border-surface-300-600-token';
|
|
11
|
+
/** Provide classes to set the margin. */
|
|
12
|
+
export let margin = 'm-0';
|
|
13
|
+
/** Provide classes to set opacity. */
|
|
14
|
+
export let opacity = 'opacity-full';
|
|
15
|
+
|
|
16
|
+
// Base Classes
|
|
17
|
+
const cBaseDivider = `block`;
|
|
18
|
+
|
|
19
|
+
// Reactive Classes
|
|
20
|
+
$: classesOrientation = vertical === true ? 'w-0 h-full min-h-[24px]' : 'w-full h-0';
|
|
21
|
+
$: classesDivider = `${cBaseDivider} ${classesOrientation} ${borderWidth} ${borderStyle} ${borderColor} ${margin} ${opacity} ${
|
|
22
|
+
$$props.class ?? ''
|
|
23
|
+
}`;
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<hr class="divider {classesDivider}" data-testid="divider" />
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { render } from '@testing-library/svelte';
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
|
|
4
|
+
import Divider from '$lib/components/Divider/Divider.svelte';
|
|
5
|
+
|
|
6
|
+
describe('Divider.svelte', () => {
|
|
7
|
+
it('Renders with minimal props', async () => {
|
|
8
|
+
const { getByTestId } = render(Divider);
|
|
9
|
+
expect(getByTestId('divider')).toBeTruthy();
|
|
10
|
+
expect(getByTestId('divider').className).toContain('border-t');
|
|
11
|
+
expect(getByTestId('divider').className).toContain('border-solid');
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('Renders with all props', async () => {
|
|
15
|
+
const { getByTestId } = render(Divider, {
|
|
16
|
+
props: {
|
|
17
|
+
vertical: false,
|
|
18
|
+
borderWidth: 'border-t-2',
|
|
19
|
+
borderStyle: 'border-dotted',
|
|
20
|
+
borderColor: 'border-red',
|
|
21
|
+
margin: 'my-10',
|
|
22
|
+
opacity: 'opacity-50'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
expect(getByTestId('divider')).toBeTruthy();
|
|
26
|
+
expect(getByTestId('divider').className).toContain('border-t-2');
|
|
27
|
+
expect(getByTestId('divider').className).toContain('border-dotted');
|
|
28
|
+
expect(getByTestId('divider').className).toContain('border-red');
|
|
29
|
+
expect(getByTestId('divider').className).toContain('my-10');
|
|
30
|
+
expect(getByTestId('divider').className).toContain('opacity-50');
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Bind your file data for the file input.
|
|
4
|
+
* @type {FileList}
|
|
5
|
+
*/
|
|
6
|
+
export let files: FileList;
|
|
7
|
+
/** Provide a button variant or other class styles. */
|
|
8
|
+
export let button = 'btn-filled-secondary';
|
|
9
|
+
|
|
10
|
+
let elemFileInput: HTMLElement;
|
|
11
|
+
|
|
12
|
+
function onButtonClick(): void {
|
|
13
|
+
elemFileInput.click();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function prunedRestProps(): any {
|
|
17
|
+
delete $$restProps.class;
|
|
18
|
+
return $$restProps;
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<div class="file-button {$$props.class ?? ''}" data-testid="file-button">
|
|
23
|
+
<!-- Input: File -->
|
|
24
|
+
<input bind:this={elemFileInput} bind:files type="file" {...prunedRestProps()} class="file-button-input hidden" on:change />
|
|
25
|
+
<!-- Button -->
|
|
26
|
+
<button class="file-button-btn btn {button}" type="button" on:click={onButtonClick} on:keydown on:keyup on:keypress>
|
|
27
|
+
<slot />
|
|
28
|
+
</button>
|
|
29
|
+
</div>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { render } from '@testing-library/svelte';
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
|
|
4
|
+
import FileButton from '$lib/components/FileButton/FileButton.svelte';
|
|
5
|
+
|
|
6
|
+
describe('FileButton.svelte', () => {
|
|
7
|
+
it('Renders with minimal props', async () => {
|
|
8
|
+
const { getByTestId } = render(FileButton);
|
|
9
|
+
expect(getByTestId('file-button')).toBeTruthy();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('Renders with all props', async () => {
|
|
13
|
+
// Create Mock FileList
|
|
14
|
+
// Reference: https://dev.to/akirakashihara/how-to-mock-filelist-on-vitest-or-jest-4494
|
|
15
|
+
const file = new File([`foo`], `foo.txt`, { type: `text/plain` });
|
|
16
|
+
const input = document.createElement(`input`);
|
|
17
|
+
input.setAttribute(`type`, `file`);
|
|
18
|
+
input.setAttribute(`name`, `file-upload`);
|
|
19
|
+
const mockFileList = Object.create(input.files);
|
|
20
|
+
mockFileList[0] = file;
|
|
21
|
+
// ---
|
|
22
|
+
const { getByTestId } = render(FileButton, {
|
|
23
|
+
props: {
|
|
24
|
+
files: mockFileList,
|
|
25
|
+
name: 'testFileButtonInput',
|
|
26
|
+
accept: 'image/*',
|
|
27
|
+
multiple: false
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
expect(getByTestId('file-button')).toBeTruthy();
|
|
31
|
+
});
|
|
32
|
+
});
|