@skeletonlabs/skeleton 0.92.0 → 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 -159
- 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} +31 -1
- package/{styles → src/lib/styles}/all.css +0 -0
- package/{styles → src/lib/styles}/core.css +0 -0
- package/{styles → src/lib/styles}/elements/alerts.css +0 -0
- package/{styles → src/lib/styles}/elements/badges.css +0 -0
- package/{styles → src/lib/styles}/elements/breadcrumbs.css +0 -0
- package/{styles → src/lib/styles}/elements/buttons.css +0 -0
- package/{styles → src/lib/styles}/elements/cards.css +0 -0
- package/{styles → src/lib/styles}/elements/chips.css +0 -0
- package/{styles → src/lib/styles}/elements/lists.css +0 -0
- package/{styles → src/lib/styles}/elements/logo-clouds.css +0 -0
- package/{styles → src/lib/styles}/elements/menus.css +0 -0
- package/{styles → src/lib/styles}/elements/placeholders.css +0 -0
- package/{styles → src/lib/styles}/elements/tables.css +0 -0
- package/{styles → src/lib/styles}/elements/tooltips.css +0 -0
- package/{styles → src/lib/styles}/elements.css +0 -0
- package/{styles → src/lib/styles}/forms.css +0 -1
- 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 +0 -0
- package/{tailwind → src/lib/tailwind}/settings.cjs +0 -0
- package/{tailwind → src/lib/tailwind}/skeleton.cjs +1 -5
- package/{tailwind → src/lib/tailwind}/theme/colors.cjs +0 -0
- package/{tailwind → src/lib/tailwind}/tokens/backgrounds.cjs +0 -0
- package/{tailwind → src/lib/tailwind}/tokens/border-radius.cjs +0 -0
- package/{tailwind → src/lib/tailwind}/tokens/borders.cjs +0 -0
- package/{tailwind → src/lib/tailwind}/tokens/fills.cjs +0 -0
- package/{tailwind → src/lib/tailwind}/tokens/rings.cjs +0 -0
- package/{tailwind → src/lib/tailwind}/tokens/text.cjs +0 -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 +0 -0
- package/{themes → src/lib/themes}/theme-skeleton.css +0 -0
- 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 -73
- 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/settings.d.ts +0 -13
- package/components/ConicGradient/settings.js +0 -335
- 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 -95
- 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/InputChip/InputChip.svelte +0 -107
- package/components/InputChip/InputChip.svelte.d.ts +0 -29
- package/components/ListBox/ListBox.svelte +0 -57
- package/components/ListBox/ListBox.svelte.d.ts +0 -30
- package/components/ListBox/ListBoxItem.svelte +0 -88
- 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 -133
- package/components/Stepper/Step.svelte.d.ts +0 -39
- package/components/Stepper/Stepper.svelte +0 -64
- package/components/Stepper/Stepper.svelte.d.ts +0 -32
- 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 -25
- 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/components/TableOfContents/TableOfContents.svelte +0 -132
- package/components/TableOfContents/TableOfContents.svelte.d.ts +0 -32
- package/index.js +0 -71
- package/tailwind/generated/allComponents.cjs +0 -1
- package/tailwind/generated/allComponents.d.cts +0 -5552
- package/tailwind/settings.d.cts +0 -6
- package/tailwind/skeleton.d.cts +0 -5
- package/tailwind/theme/colors.d.cts +0 -2
- package/tailwind/tokens/backgrounds.d.cts +0 -2
- package/tailwind/tokens/border-radius.d.cts +0 -33
- package/tailwind/tokens/borders.d.cts +0 -6
- package/tailwind/tokens/fills.d.cts +0 -15
- package/tailwind/tokens/rings.d.cts +0 -17
- package/tailwind/tokens/text.d.cts +0 -21
- 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 -98
- package/utilities/LightSwitch/LightSwitch.svelte.d.ts +0 -21
- package/utilities/LightSwitch/stores.d.ts +0 -2
- 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 -195
- 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 -36
- 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 -60
- 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,148 @@
|
|
|
1
|
+
// Navigation Links & Sitemap
|
|
2
|
+
|
|
3
|
+
export const menuNavLinks: any = [
|
|
4
|
+
// Docs ---
|
|
5
|
+
|
|
6
|
+
{
|
|
7
|
+
id: 'docs',
|
|
8
|
+
title: 'Docs',
|
|
9
|
+
list: [
|
|
10
|
+
{ href: '/docs/why', label: 'Why Skeleton', keywords: 'svelte, sirens, license, release' },
|
|
11
|
+
{ href: '/docs/features', label: 'Features', keywords: 'tailwind, svelte, utilities' },
|
|
12
|
+
{ href: '/docs/comparisons', label: 'Comparisons', keywords: 'mantine, flowbite, daisy, material' },
|
|
13
|
+
{ href: '/docs/faqs', label: 'FAQs', keywords: 'typescript, npm, pnpm, yarn, tutorial' },
|
|
14
|
+
{ href: '/docs/contributions', label: 'Contributions', keywords: 'branch, pr' }
|
|
15
|
+
// { href: '/docs/recommended', label: 'Recommended', keywords: '' } // DISABLED until more complete
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
// Guides ---
|
|
20
|
+
|
|
21
|
+
{
|
|
22
|
+
id: 'guides',
|
|
23
|
+
title: 'Guides',
|
|
24
|
+
list: [
|
|
25
|
+
{ href: '/guides/install', label: 'Installation', keywords: 'start, install, setup' },
|
|
26
|
+
{ href: '/guides/tailwind', label: 'Tailwind CSS', keywords: 'dark, content, plugin' },
|
|
27
|
+
{ href: '/guides/themes', label: 'Themes', keywords: 'create, generate, generator, colors, tokens' },
|
|
28
|
+
{ href: '/guides/styling', label: 'Styling', keywords: 'css, import, customization, props, class, styles' },
|
|
29
|
+
{ href: '/guides/quickstart', label: 'Quickstart', keywords: 'start, setup, tutorial, guide' }
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
// Tailwind ---
|
|
34
|
+
|
|
35
|
+
{
|
|
36
|
+
id: 'tokens',
|
|
37
|
+
title: 'Info',
|
|
38
|
+
list: [{ href: '/elements/tokens', label: 'Design Tokens', keywords: 'theme, color, pairing, css, utility' }]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'base',
|
|
42
|
+
title: 'Base',
|
|
43
|
+
list: [
|
|
44
|
+
{ href: '/elements/core', label: 'Core', keywords: 'body, scroll, scrollbar, hr, horizontal, rule' },
|
|
45
|
+
{
|
|
46
|
+
href: '/elements/typography',
|
|
47
|
+
label: 'Typography',
|
|
48
|
+
keywords: 'unstyled, headings, paragraph, anchor, blockquote, pre, code, keyboard, ins, del'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
href: '/elements/forms',
|
|
52
|
+
label: 'Forms',
|
|
53
|
+
keywords: 'plugin, label, input, select, checkbox, radio, date, color, picker, slider, range'
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'elements',
|
|
59
|
+
title: 'Elements',
|
|
60
|
+
list: [
|
|
61
|
+
{ href: '/elements/alerts', label: 'Alerts', keywords: 'message, notification' },
|
|
62
|
+
{ href: '/elements/badges', label: 'Badges', keywords: 'sup, sub, overlay, favorite, icon' },
|
|
63
|
+
{ href: '/elements/breadcrumbs', label: 'Breadcrumbs', keywords: 'nav, navigation, seperator, hierarchy' },
|
|
64
|
+
{ href: '/elements/buttons', label: 'Buttons', keywords: 'click, anchor, icon, preload' },
|
|
65
|
+
{ href: '/elements/cards', label: 'Cards', keywords: 'header, footer, background, cell, region' },
|
|
66
|
+
{ href: '/elements/chips', label: 'Chips', keywords: 'action, select, selection, filter, filtering, interactive' },
|
|
67
|
+
{ href: '/elements/lists', label: 'Lists', keywords: 'unordered, ordered, description, nav, navigation, ul, ol, li, dd, dt' },
|
|
68
|
+
{ href: '/elements/logo-clouds', label: 'Logo Clouds', keywords: 'logo, brand, branding, links' },
|
|
69
|
+
{ href: '/elements/placeholders', label: 'Placeholders', keywords: 'skeleton, spacer, text, image, avatar, animate, animate' },
|
|
70
|
+
{ href: '/elements/tables', label: 'Tables', keywords: 'data, entry' }
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
// Svelte ---
|
|
75
|
+
|
|
76
|
+
{
|
|
77
|
+
id: 'actions',
|
|
78
|
+
title: 'Actions',
|
|
79
|
+
list: [
|
|
80
|
+
{ href: '/actions/clipboard', label: 'Clipboard', keywords: 'copy, contenteditable, html, input' },
|
|
81
|
+
{ href: '/actions/filters', label: 'Filters', keywords: 'svg, filtering, image, images, effect' },
|
|
82
|
+
{ href: '/actions/focus-trap', label: 'Focus Trap', keywords: 'form, modal, a11y, accessibility, keyboard, interaction' }
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 'components',
|
|
87
|
+
title: 'Components',
|
|
88
|
+
list: [
|
|
89
|
+
{ href: '/components/accordions', label: 'Accordions', keywords: 'collapse' },
|
|
90
|
+
{ href: '/components/app-bar', label: 'App Bar', keywords: 'header, top, bar, title' },
|
|
91
|
+
{ href: '/components/app-rail', label: 'App Rail', keywords: 'nav, navigation, tile, sidebar' },
|
|
92
|
+
{ href: '/components/app-shell', label: 'App Shell', keywords: 'layout, header, footer, sidebar, page, content' },
|
|
93
|
+
{ href: '/components/avatars', label: 'Avatars', keywords: 'image, initial, filter' },
|
|
94
|
+
{ href: '/components/conic-gradients', label: 'Conic Gradients', keywords: 'chart, graph, circle, pie, spinner, legend' },
|
|
95
|
+
{ href: '/components/file-buttons', label: 'File Buttons', keywords: 'upload, form, input, file, media' },
|
|
96
|
+
{ href: '/components/file-dropzone', label: 'File Dropzone', keywords: 'upload, form, input, file, media, drag, drop' },
|
|
97
|
+
{ href: '/components/input-chips', label: 'Input Chips', keywords: 'multi, multiple, select, tags, form, validation' },
|
|
98
|
+
{ href: '/components/listboxes', label: 'Listboxes', keywords: 'list, select, multi, multiple' },
|
|
99
|
+
{ href: '/components/paginators', label: 'Paginators', keywords: 'nav, navigation, table, data, list' },
|
|
100
|
+
{ href: '/components/progress-bars', label: 'Progress Bars', keywords: 'meter, track, indeterminate, determinate, min, max' },
|
|
101
|
+
{ href: '/components/progress-radials', label: 'Progress Radials', keywords: 'meter, track, indeterminate, determinate, spin' },
|
|
102
|
+
{ href: '/components/radio-groups', label: 'Radio Groups', keywords: 'input, form, select, selection' },
|
|
103
|
+
{ href: '/components/range-sliders', label: 'Range Sliders', keywords: 'value, min, max, step,, tick, input, form' },
|
|
104
|
+
{ href: '/components/slide-toggles', label: 'Slide Toggles', keywords: 'check, checkbox, toggle, input, form' },
|
|
105
|
+
{ href: '/components/steppers', label: 'Steppers', keywords: 'intro, onboard, onboarding, form, progress' },
|
|
106
|
+
{ href: '/components/tabs', label: 'Tabs', keywords: 'select, selection, panel' },
|
|
107
|
+
{ href: '/components/tables', label: 'Tables', keywords: 'data, entry' },
|
|
108
|
+
{ href: '/components/table-of-contents', label: 'Table of Contents', keywords: 'page, results, links, navigation' },
|
|
109
|
+
// Slated for Deprecation:
|
|
110
|
+
{ href: '/components/alerts', label: 'Alerts', keywords: 'message, notification', badge: 'Deprecated' },
|
|
111
|
+
{ href: '/components/breadcrumbs', label: 'Breadcrumbs', keywords: 'nav, navigation, seperator, hierarchy', badge: 'Deprecated' },
|
|
112
|
+
{ href: '/components/dividers', label: 'Dividers', keywords: 'hr, horizontal, rule, separator', badge: 'Deprecated' },
|
|
113
|
+
{
|
|
114
|
+
href: '/components/gradient-headings',
|
|
115
|
+
label: '<small>Gradient Headings</small>',
|
|
116
|
+
keywords: 'header, h1, h2, h3',
|
|
117
|
+
badge: 'Deprecated'
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
// Utilities ---
|
|
123
|
+
|
|
124
|
+
{
|
|
125
|
+
id: 'utilities',
|
|
126
|
+
title: 'Utilities',
|
|
127
|
+
list: [
|
|
128
|
+
{ href: '/utilities/codeblocks', label: 'Code Blocks', keywords: 'highlight, syntax, code' },
|
|
129
|
+
{
|
|
130
|
+
href: '/utilities/data-tables',
|
|
131
|
+
label: 'Data Tables',
|
|
132
|
+
keywords: 'search, sort, page, pagination, async',
|
|
133
|
+
badge: 'Experimental'
|
|
134
|
+
},
|
|
135
|
+
{ href: '/utilities/drawers', label: 'Drawers', keywords: 'overlay, slide, panel, sidebar' },
|
|
136
|
+
{ href: '/utilities/lightswitches', label: 'Lightswitch', keywords: 'light, dark, toggle, prefer, color, scheme' },
|
|
137
|
+
{ href: '/utilities/local-storage-stores', label: 'Local Storage Stores', keywords: 'svelte, writable, get, cache, persist' },
|
|
138
|
+
{ href: '/utilities/menus', label: 'Menus', keywords: 'overlay, dropdown, drop, down, select' },
|
|
139
|
+
{
|
|
140
|
+
href: '/utilities/modals',
|
|
141
|
+
label: 'Modals',
|
|
142
|
+
keywords: 'overlay, dialog, notification, alert, confirm, prompt, multiple, form, list, embed, video'
|
|
143
|
+
},
|
|
144
|
+
{ href: '/utilities/toasts', label: 'Toasts', keywords: 'overlay, snack, snackbar, bar, action, alert, notification' },
|
|
145
|
+
{ href: '/utilities/tooltips', label: 'Tooltips', keywords: 'pop, up, popup, overlay, hover' }
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { menuNavLinks } from '$docs/DocsNavigation/links';
|
|
3
|
+
import { modalStore } from '$lib/utilities/Modal/stores';
|
|
4
|
+
|
|
5
|
+
// Classes
|
|
6
|
+
const cBase = '';
|
|
7
|
+
const cHeader = 'bg-surface-100-800-token flex items-center space-x-4 p-4';
|
|
8
|
+
const cList = 'p-4 space-y-4 rounded-container-token max-h-[60vh] md:max-h-[75vh] overflow-y-auto';
|
|
9
|
+
const cCardLink = 'card bg-surface-200-700-token p-2 grid grid-cols-[auto_1fr_auto_auto] gap-4 items-center';
|
|
10
|
+
const cCardLinkFocus = 'hover:bg-primary-500 hover:text-on-primary-token focus:bg-primary-500 focus:text-on-primary-token';
|
|
11
|
+
const cHashtag = 'border-2 border-surface-300-600-token rounded w-7 aspect-square flex justify-center items-center text-xs';
|
|
12
|
+
|
|
13
|
+
// Local
|
|
14
|
+
let searchTerm = '';
|
|
15
|
+
let navigationOriginal: any[] = Object.values(menuNavLinks);
|
|
16
|
+
let navigation: any[] = navigationOriginal;
|
|
17
|
+
|
|
18
|
+
// Elements
|
|
19
|
+
let elemDocSearch: HTMLElement;
|
|
20
|
+
|
|
21
|
+
function filterList(list: any[]): any[] {
|
|
22
|
+
return list.filter((rowObj: any) => {
|
|
23
|
+
const formattedSearchTerm = searchTerm.toLowerCase() || '';
|
|
24
|
+
return Object.values(rowObj).join(' ').toLowerCase().includes(formattedSearchTerm);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function onSearch(): void {
|
|
29
|
+
let navDeepCopy = JSON.parse(JSON.stringify(navigationOriginal));
|
|
30
|
+
navigation = navDeepCopy.filter((category: any) => {
|
|
31
|
+
category.list = filterList(category.list);
|
|
32
|
+
if (category.list.length) return category;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function onKeyDown(event: KeyboardEvent): void {
|
|
37
|
+
if (['Enter', 'ArrowDown'].includes(event.code)) {
|
|
38
|
+
const queryFirstAnchorElement = elemDocSearch.querySelector('a');
|
|
39
|
+
if (queryFirstAnchorElement) queryFirstAnchorElement.focus();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<div bind:this={elemDocSearch} class="docs-search {cBase}">
|
|
45
|
+
<!-- Header -->
|
|
46
|
+
<header class="docs-search-header {cHeader}">
|
|
47
|
+
<i class="fa-solid fa-magnifying-glass text-xl" />
|
|
48
|
+
<input bind:value={searchTerm} type="search" placeholder="Search..." on:input={onSearch} on:keydown={onKeyDown} />
|
|
49
|
+
<!-- prettier-ignore -->
|
|
50
|
+
<button class="btn-icon btn-filled btn-icon-sm" on:click={() => { modalStore.close(); }} tabindex="-1">
|
|
51
|
+
<i class="fa-solid fa-xmark" />
|
|
52
|
+
</button>
|
|
53
|
+
</header>
|
|
54
|
+
<hr />
|
|
55
|
+
<!-- Results -->
|
|
56
|
+
<div class="docs-search-categories {cList}">
|
|
57
|
+
{#each navigation as category}
|
|
58
|
+
<div class="space-y-4">
|
|
59
|
+
<span>{category.title}</span>
|
|
60
|
+
<nav class="grid grid-cols-1 gap-4">
|
|
61
|
+
<ul class="space-y-4">
|
|
62
|
+
{#each category.list as link}
|
|
63
|
+
<li>
|
|
64
|
+
<!-- prettier-ignore -->
|
|
65
|
+
<a class="{cCardLink} {cCardLinkFocus}" href={link.href} on:click={() => { modalStore.close(); }}>
|
|
66
|
+
<div class="{cHashtag}"><i class="fa-solid fa-hashtag"></i></div>
|
|
67
|
+
<strong class="block text-lg">{link.label}</strong>
|
|
68
|
+
<small class="text-xs opacity-50">{link.href}</small>
|
|
69
|
+
<i class="fa-solid fa-angle-right text-xs opacity-30" />
|
|
70
|
+
</a>
|
|
71
|
+
</li>
|
|
72
|
+
{/each}
|
|
73
|
+
</ul>
|
|
74
|
+
</nav>
|
|
75
|
+
</div>
|
|
76
|
+
{/each}
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { page } from '$app/stores';
|
|
3
|
+
import { writable, type Writable } from 'svelte/store';
|
|
4
|
+
|
|
5
|
+
// Types
|
|
6
|
+
import { DocsFeature, type DocsShellSettings } from '$docs/DocsShell/types';
|
|
7
|
+
|
|
8
|
+
// Components
|
|
9
|
+
import Table from '$lib/components/Table/Table.svelte';
|
|
10
|
+
import Tab from '$lib/components/Tab/Tab.svelte';
|
|
11
|
+
import TabGroup from '$lib/components/Tab/TabGroup.svelte';
|
|
12
|
+
import TableOfContents from '$lib/components/TableOfContents/TableOfContents.svelte';
|
|
13
|
+
|
|
14
|
+
// Utilities
|
|
15
|
+
import { toastStore } from '$lib/utilities/Toast/stores';
|
|
16
|
+
import type { ToastSettings } from '$lib/utilities/Toast/types';
|
|
17
|
+
import { sveldMapperProps, sveldMapperSlots, sveldeMapperEvents } from './sveldMapper';
|
|
18
|
+
|
|
19
|
+
// Props
|
|
20
|
+
export let settings: DocsShellSettings;
|
|
21
|
+
// Props (styles)
|
|
22
|
+
export let spacing = 'space-y-8 md:space-y-12';
|
|
23
|
+
// Props (regions)
|
|
24
|
+
export let regionHeader = 'card-glass-surface border-b border-black/5 dark:border-white/5';
|
|
25
|
+
export let regionDetails = 'overflow-x-auto whitespace-nowrap grid grid-cols-1 md:grid-cols-[128px_1fr] gap-3';
|
|
26
|
+
export let regionPanels = 'page-container';
|
|
27
|
+
|
|
28
|
+
// Classes
|
|
29
|
+
const cBase = '';
|
|
30
|
+
|
|
31
|
+
// Stores
|
|
32
|
+
let storeActiveTab: Writable<string> = writable('usage');
|
|
33
|
+
|
|
34
|
+
// Local
|
|
35
|
+
const githubSourcePath = 'https://github.com/skeletonlabs/skeleton/tree/master/src'; // FIXME: hardcoded path
|
|
36
|
+
const defaultSettings: DocsShellSettings = {
|
|
37
|
+
// Heading
|
|
38
|
+
feature: DocsFeature.Component,
|
|
39
|
+
name: '(name)',
|
|
40
|
+
description: '(description)',
|
|
41
|
+
// Meta
|
|
42
|
+
imports: [],
|
|
43
|
+
types: [],
|
|
44
|
+
stylesheetIncludes: [],
|
|
45
|
+
stylesheets: [],
|
|
46
|
+
package: { name: '@skeletonlabs/skeleton', url: 'https://www.npmjs.com/package/@skeletonlabs/skeleton' },
|
|
47
|
+
source: '',
|
|
48
|
+
docsPath: $page.url.pathname,
|
|
49
|
+
aria: undefined,
|
|
50
|
+
dependencies: [],
|
|
51
|
+
// Docs
|
|
52
|
+
components: [],
|
|
53
|
+
restProps: undefined,
|
|
54
|
+
parameters: [],
|
|
55
|
+
classes: [],
|
|
56
|
+
keyboard: []
|
|
57
|
+
};
|
|
58
|
+
const pageSettings: DocsShellSettings = { ...defaultSettings, ...settings };
|
|
59
|
+
|
|
60
|
+
function toastCopied(noun: string): void {
|
|
61
|
+
const t: ToastSettings = { message: `Copied ${noun} to clipboard.`, timeout: 2000 };
|
|
62
|
+
toastStore.trigger(t);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Sveld Counts ---
|
|
66
|
+
// Conditional tab display based on Sveld reference counts
|
|
67
|
+
|
|
68
|
+
const sveldCounts = { props: 0, slots: 0, events: 0 };
|
|
69
|
+
|
|
70
|
+
if (pageSettings.components && pageSettings.components?.length > 0) {
|
|
71
|
+
pageSettings.components.forEach((comp) => {
|
|
72
|
+
sveldCounts.props += comp.sveld.props.length;
|
|
73
|
+
sveldCounts.slots += comp.sveld.slots.length;
|
|
74
|
+
sveldCounts.events += comp.sveld.events.length;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Format ---
|
|
79
|
+
|
|
80
|
+
function formatImports(): string {
|
|
81
|
+
return `import { ${pageSettings.imports?.join(', ')} } from '${pageSettings.package?.name}';`;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function formatTypes(): string {
|
|
85
|
+
return `import type { ${pageSettings.types?.join(', ')} } from '${pageSettings.package?.name}';`;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function formatStylesheet(stylesheet: string): string {
|
|
89
|
+
return `import '${pageSettings.package?.name}/styles/${stylesheet}.css';`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Copy ---
|
|
93
|
+
|
|
94
|
+
function copyImports(): void {
|
|
95
|
+
navigator.clipboard.writeText(formatImports());
|
|
96
|
+
toastCopied('import');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function copyTypes(): void {
|
|
100
|
+
navigator.clipboard.writeText(formatTypes());
|
|
101
|
+
toastCopied('type import');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function copyStylesheet(stylesheet: string): void {
|
|
105
|
+
navigator.clipboard.writeText(formatStylesheet(stylesheet));
|
|
106
|
+
toastCopied('stylesheet');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Reactive
|
|
110
|
+
$: classesBase = `${cBase} ${$$props.class ?? ''}`;
|
|
111
|
+
$: classesRegionHeader = `${regionHeader}`;
|
|
112
|
+
$: classesRegionPanels = `${regionPanels}`;
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<div class="doc-shell {classesBase}">
|
|
116
|
+
<!-- Region: Header -->
|
|
117
|
+
<header class="doc-shell-header {classesRegionHeader}">
|
|
118
|
+
<!-- Information -->
|
|
119
|
+
<div class="doc-shell-info page-container !pb-0 lg:!space-y-10">
|
|
120
|
+
<!-- Intro -->
|
|
121
|
+
<section class="space-y-4">
|
|
122
|
+
<div class="flex items-center space-x-4">
|
|
123
|
+
<h1>{@html pageSettings.name}</h1>
|
|
124
|
+
<!-- Feature -->
|
|
125
|
+
<span class="badge badge-glass translate-y-1">{@html pageSettings.feature}</span>
|
|
126
|
+
</div>
|
|
127
|
+
<p>{@html pageSettings.description}</p>
|
|
128
|
+
</section>
|
|
129
|
+
|
|
130
|
+
<!-- Details -->
|
|
131
|
+
<section class="doc-shell-details {regionDetails}">
|
|
132
|
+
<!-- Imports -->
|
|
133
|
+
{#if pageSettings.imports?.length}
|
|
134
|
+
<p class="hidden md:inline-block w-32">Import</p>
|
|
135
|
+
<div>
|
|
136
|
+
<button class="chip chip-primary" on:click={copyImports}>{formatImports()}</button>
|
|
137
|
+
</div>
|
|
138
|
+
{/if}
|
|
139
|
+
<!-- Types -->
|
|
140
|
+
{#if pageSettings.types?.length}
|
|
141
|
+
<p class="hidden md:inline-block w-32">Types</p>
|
|
142
|
+
<div>
|
|
143
|
+
<button class="chip chip-primary" on:click={copyTypes}>{formatTypes()}</button>
|
|
144
|
+
</div>
|
|
145
|
+
{/if}
|
|
146
|
+
<!-- Stylesheets -->
|
|
147
|
+
{#if pageSettings.stylesheetIncludes?.length || pageSettings.stylesheets?.length}
|
|
148
|
+
<p class="hidden md:inline-block w-32">Stylesheets</p>
|
|
149
|
+
<!-- prettier-ignore -->
|
|
150
|
+
<div class="flex space-x-2">
|
|
151
|
+
<!-- Stylesheet Includes -->
|
|
152
|
+
{#if pageSettings.stylesheetIncludes?.length}
|
|
153
|
+
{#each pageSettings.stylesheetIncludes as si}
|
|
154
|
+
<button class="chip chip-primary" on:click={() => {copyStylesheet(si)}}>{si}.css</button>
|
|
155
|
+
{/each}
|
|
156
|
+
{/if}
|
|
157
|
+
<!-- Stylesheets -->
|
|
158
|
+
{#if pageSettings.stylesheets?.length}
|
|
159
|
+
{#each pageSettings.stylesheets as s}
|
|
160
|
+
<button class="chip chip-primary" on:click={() => {copyStylesheet(s)}}>{s}.css</button>
|
|
161
|
+
{/each}
|
|
162
|
+
{/if}
|
|
163
|
+
</div>
|
|
164
|
+
{/if}
|
|
165
|
+
<!-- Package -->
|
|
166
|
+
<p class="hidden md:inline-block w-32">Package</p>
|
|
167
|
+
<div class="flex items-center space-x-2">
|
|
168
|
+
<i class="fa-brands fa-npm" />
|
|
169
|
+
<a href={pageSettings.package?.url} target="_blank" rel="noreferrer">{pageSettings.package?.name}</a>
|
|
170
|
+
</div>
|
|
171
|
+
<!-- Source Code -->
|
|
172
|
+
<p class="hidden md:inline-block w-32">Source</p>
|
|
173
|
+
<div class="flex items-center space-x-2">
|
|
174
|
+
<i class="fa-brands fa-github" />
|
|
175
|
+
<a href={`${githubSourcePath}/lib/${pageSettings.source}`} target="_blank" rel="noreferrer">Source Code</a>
|
|
176
|
+
</div>
|
|
177
|
+
<!-- Doc Source -->
|
|
178
|
+
<p class="hidden md:inline-block w-32">Doc</p>
|
|
179
|
+
<div class="flex items-center space-x-2">
|
|
180
|
+
<i class="fa-solid fa-code" />
|
|
181
|
+
<a href={`${githubSourcePath}/routes/(inner)${pageSettings.docsPath}/+page.svelte`} target="_blank" rel="noreferrer">
|
|
182
|
+
View Page Source
|
|
183
|
+
</a>
|
|
184
|
+
</div>
|
|
185
|
+
<!-- Dependencies -->
|
|
186
|
+
{#if pageSettings.dependencies?.length}
|
|
187
|
+
<p class="hidden md:inline-block w-32">Dependencies</p>
|
|
188
|
+
<div class="flex items-center space-x-2">
|
|
189
|
+
<i class="fa-solid fa-down-left-and-up-right-to-center" />
|
|
190
|
+
<div class="grid grid-cols-1 gap-2">
|
|
191
|
+
{#each pageSettings.dependencies as d}
|
|
192
|
+
<a href={d.url} target="_blank" rel="noreferrer">{d.label}</a>
|
|
193
|
+
{/each}
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
{/if}
|
|
197
|
+
<!-- Accessibility -->
|
|
198
|
+
{#if pageSettings.aria}
|
|
199
|
+
<p class="hidden md:inline-block w-32">WAI-ARIA</p>
|
|
200
|
+
<div class="flex items-center space-x-2">
|
|
201
|
+
<i class="fa-solid fa-universal-access" />
|
|
202
|
+
<a href={pageSettings.aria} target="_blank" rel="noreferrer">Accessibility Reference</a>
|
|
203
|
+
</div>
|
|
204
|
+
{/if}
|
|
205
|
+
</section>
|
|
206
|
+
|
|
207
|
+
<!-- Tabs -->
|
|
208
|
+
<TabGroup selected={storeActiveTab} rail={false}>
|
|
209
|
+
<Tab value="usage">Usage</Tab>
|
|
210
|
+
<!-- Based on Sveld -->
|
|
211
|
+
{#if sveldCounts.props > 0}<Tab value="properties">Props</Tab>{/if}
|
|
212
|
+
{#if sveldCounts.slots > 0}<Tab value="slots">Slots</Tab>{/if}
|
|
213
|
+
{#if sveldCounts.events > 0}<Tab value="events">Events</Tab>{/if}
|
|
214
|
+
<!-- Based on Page Settings -->
|
|
215
|
+
{#if pageSettings.parameters?.length}<Tab value="parameters">Params</Tab>{/if}
|
|
216
|
+
{#if pageSettings.classes?.length}<Tab value="classes">Classes</Tab>{/if}
|
|
217
|
+
{#if pageSettings.keyboard?.length}<Tab value="keyboard">Keyboard</Tab>{/if}
|
|
218
|
+
</TabGroup>
|
|
219
|
+
</div>
|
|
220
|
+
</header>
|
|
221
|
+
|
|
222
|
+
<!-- Tab Panels -->
|
|
223
|
+
<div class="doc-shell-tab-panels relative">
|
|
224
|
+
<!-- Tab: Usage -->
|
|
225
|
+
{#if $storeActiveTab === 'usage'}
|
|
226
|
+
<div class="doc-shell-usage {classesRegionPanels}">
|
|
227
|
+
<div class="grid grid-cols-1 2xl:grid-cols-[1fr_240px]">
|
|
228
|
+
<!-- Content -->
|
|
229
|
+
<div class={spacing}>
|
|
230
|
+
<!-- Slot: Examples Sandbox -->
|
|
231
|
+
{#if $$slots.sandbox}
|
|
232
|
+
<div>
|
|
233
|
+
<h2 class="sr-only">Examples</h2>
|
|
234
|
+
<div class="doc-shell-sandbox {spacing}">
|
|
235
|
+
<slot name="sandbox">(sandbox)</slot>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
{/if}
|
|
239
|
+
<div id="toc-target" class={spacing}>
|
|
240
|
+
<!-- Slot: Usage -->
|
|
241
|
+
{#if $$slots.usage}
|
|
242
|
+
<div>
|
|
243
|
+
<h2 class="sr-only">Getting Started</h2>
|
|
244
|
+
<div class="doc-shell-usage {spacing}">
|
|
245
|
+
<slot name="usage">(usage)</slot>
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
{/if}
|
|
249
|
+
<!-- Slot: Overflow -->
|
|
250
|
+
{#if $$slots.default}
|
|
251
|
+
<footer class="doc-shell-footer"><slot /></footer>
|
|
252
|
+
{/if}
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
<!-- Table of Contents -->
|
|
256
|
+
<div>
|
|
257
|
+
<TableOfContents target="#toc-target" minimumHeadings={1} class="sticky top-10 hidden 2xl:inline-block ml-4" />
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
{/if}
|
|
262
|
+
|
|
263
|
+
<!-- Tab: Component Properties -->
|
|
264
|
+
{#if $storeActiveTab === 'properties'}
|
|
265
|
+
<div class="doc-shell-properties {classesRegionPanels}">
|
|
266
|
+
<!-- Supports restProps -->
|
|
267
|
+
{#if pageSettings.restProps}
|
|
268
|
+
<p>
|
|
269
|
+
This component makes use of <a
|
|
270
|
+
href="https://svelte.dev/docs#template-syntax-attributes-and-props"
|
|
271
|
+
target="_blank"
|
|
272
|
+
rel="noreferrer">restProps</a
|
|
273
|
+
>
|
|
274
|
+
for the
|
|
275
|
+
<code>{pageSettings.restProps}</code> element.
|
|
276
|
+
</p>
|
|
277
|
+
{/if}
|
|
278
|
+
<!-- Tables -->
|
|
279
|
+
{#if pageSettings.components}
|
|
280
|
+
{#each pageSettings.components as comp}
|
|
281
|
+
{#if comp.sveld.props.length > 0}
|
|
282
|
+
{@const tableSource = sveldMapperProps(comp)}
|
|
283
|
+
<section class="space-y-4">
|
|
284
|
+
{#if comp.label}<h2>{comp.label}</h2>{/if}
|
|
285
|
+
{#if comp.descProps}<div>{@html comp.descProps}</div>{/if}
|
|
286
|
+
{#if tableSource.body.length > 0}<Table source={tableSource} />{/if}
|
|
287
|
+
{#if comp.overrideProps}<div>
|
|
288
|
+
<em>{comp.label} can override: <span class="text-primary-500">{comp.overrideProps.join(', ')}</span>.</em>
|
|
289
|
+
</div>{/if}
|
|
290
|
+
</section>
|
|
291
|
+
{/if}
|
|
292
|
+
{/each}
|
|
293
|
+
{/if}
|
|
294
|
+
</div>
|
|
295
|
+
{/if}
|
|
296
|
+
|
|
297
|
+
<!-- Tab: Component Slots -->
|
|
298
|
+
{#if $storeActiveTab === 'slots'}
|
|
299
|
+
<div class="doc-shell-slots {classesRegionPanels}">
|
|
300
|
+
{#if pageSettings.components}
|
|
301
|
+
{#each pageSettings.components as comp}
|
|
302
|
+
{#if comp.sveld.slots.length > 0}
|
|
303
|
+
{@const tableSource = sveldMapperSlots(comp)}
|
|
304
|
+
<section class="space-y-4">
|
|
305
|
+
{#if comp.label}<h2>{comp.label}</h2>{/if}
|
|
306
|
+
{#if comp.descSlots}<div>{@html comp.descSlots}</div>{/if}
|
|
307
|
+
{#if tableSource.body.length > 0}<Table source={tableSource} />{/if}
|
|
308
|
+
</section>
|
|
309
|
+
{/if}
|
|
310
|
+
{/each}
|
|
311
|
+
{/if}
|
|
312
|
+
</div>
|
|
313
|
+
{/if}
|
|
314
|
+
|
|
315
|
+
<!-- Tab: Component Events -->
|
|
316
|
+
{#if $storeActiveTab === 'events'}
|
|
317
|
+
<div class="doc-shell-events {classesRegionPanels}">
|
|
318
|
+
{#if pageSettings.components}
|
|
319
|
+
{#each pageSettings.components as comp}
|
|
320
|
+
{#if comp.sveld.events.length > 0}
|
|
321
|
+
{@const tableSource = sveldeMapperEvents(comp)}
|
|
322
|
+
<section class="space-y-4">
|
|
323
|
+
{#if comp.label}<h2>{comp.label}</h2>{/if}
|
|
324
|
+
{#if comp.descEvents}<div>{@html comp.descEvents}</div>{/if}
|
|
325
|
+
{#if tableSource.body.length > 0}<Table source={tableSource} />{/if}
|
|
326
|
+
</section>
|
|
327
|
+
{/if}
|
|
328
|
+
{/each}
|
|
329
|
+
{/if}
|
|
330
|
+
</div>
|
|
331
|
+
{/if}
|
|
332
|
+
|
|
333
|
+
<!-- Tab: Action Parameters -->
|
|
334
|
+
{#if pageSettings.parameters?.length && $storeActiveTab === 'parameters'}
|
|
335
|
+
<div class="doc-shell-parameters {classesRegionPanels}">
|
|
336
|
+
<Table
|
|
337
|
+
source={{
|
|
338
|
+
head: ['Prop', 'Type', 'Default', 'Values', 'Description'],
|
|
339
|
+
body: pageSettings.parameters
|
|
340
|
+
}}
|
|
341
|
+
/>
|
|
342
|
+
</div>
|
|
343
|
+
{/if}
|
|
344
|
+
|
|
345
|
+
<!-- Tab: Tailwind Element Classes -->
|
|
346
|
+
{#if pageSettings.classes?.length && $storeActiveTab === 'classes'}
|
|
347
|
+
<div class="doc-shell-classes {classesRegionPanels}">
|
|
348
|
+
<Table
|
|
349
|
+
source={{
|
|
350
|
+
head: ['Keys', 'Values', 'Description'],
|
|
351
|
+
body: pageSettings.classes
|
|
352
|
+
}}
|
|
353
|
+
/>
|
|
354
|
+
</div>
|
|
355
|
+
{/if}
|
|
356
|
+
|
|
357
|
+
<!-- Tab: Keyboard Interactions -->
|
|
358
|
+
{#if $storeActiveTab === 'keyboard'}
|
|
359
|
+
{#if pageSettings.keyboard?.length}
|
|
360
|
+
<div class="doc-shell-keyboard {classesRegionPanels}">
|
|
361
|
+
<Table
|
|
362
|
+
source={{
|
|
363
|
+
head: ['Keys', 'Description'],
|
|
364
|
+
body: pageSettings.keyboard
|
|
365
|
+
}}
|
|
366
|
+
/>
|
|
367
|
+
</div>
|
|
368
|
+
{/if}
|
|
369
|
+
{/if}
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
|
|
373
|
+
<style lang="postcss">
|
|
374
|
+
.doc-shell-info code {
|
|
375
|
+
@apply hover:!bg-primary-500/30 transition-colors duration-100 cursor-pointer;
|
|
376
|
+
}
|
|
377
|
+
</style>
|