@skeletonlabs/skeleton 0.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -0
  3. package/actions/Clipboard/clipboard.d.ts +4 -0
  4. package/actions/Clipboard/clipboard.js +37 -0
  5. package/actions/Filters/filter.d.ts +3 -0
  6. package/actions/Filters/filter.js +23 -0
  7. package/actions/Filters/svg-filters/Apollo.svelte +13 -0
  8. package/actions/Filters/svg-filters/Apollo.svelte.d.ts +19 -0
  9. package/actions/Filters/svg-filters/BlueNight.svelte +12 -0
  10. package/actions/Filters/svg-filters/BlueNight.svelte.d.ts +19 -0
  11. package/actions/Filters/svg-filters/Emerald.svelte +23 -0
  12. package/actions/Filters/svg-filters/Emerald.svelte.d.ts +19 -0
  13. package/actions/Filters/svg-filters/GreenFall.svelte +18 -0
  14. package/actions/Filters/svg-filters/GreenFall.svelte.d.ts +19 -0
  15. package/actions/Filters/svg-filters/Noir.svelte +11 -0
  16. package/actions/Filters/svg-filters/Noir.svelte.d.ts +19 -0
  17. package/actions/Filters/svg-filters/NoirLight.svelte +10 -0
  18. package/actions/Filters/svg-filters/NoirLight.svelte.d.ts +19 -0
  19. package/actions/Filters/svg-filters/Rustic.svelte +14 -0
  20. package/actions/Filters/svg-filters/Rustic.svelte.d.ts +19 -0
  21. package/actions/Filters/svg-filters/Summer84.svelte +12 -0
  22. package/actions/Filters/svg-filters/Summer84.svelte.d.ts +19 -0
  23. package/actions/Filters/svg-filters/XPro.svelte +12 -0
  24. package/actions/Filters/svg-filters/XPro.svelte.d.ts +19 -0
  25. package/actions/FocusTrap/focusTrap.d.ts +4 -0
  26. package/actions/FocusTrap/focusTrap.js +42 -0
  27. package/components/Accordion/AccordionGroup.svelte +47 -0
  28. package/components/Accordion/AccordionGroup.svelte.d.ts +24 -0
  29. package/components/Accordion/AccordionItem.svelte +70 -0
  30. package/components/Accordion/AccordionItem.svelte.d.ts +35 -0
  31. package/components/Alert/Alert.svelte +65 -0
  32. package/components/Alert/Alert.svelte.d.ts +30 -0
  33. package/components/AppBar/AppBar.svelte +54 -0
  34. package/components/AppBar/AppBar.svelte.d.ts +30 -0
  35. package/components/AppRail/AppRail.svelte +48 -0
  36. package/components/AppRail/AppRail.svelte.d.ts +31 -0
  37. package/components/AppRail/AppRailTile.svelte +51 -0
  38. package/components/AppRail/AppRailTile.svelte.d.ts +33 -0
  39. package/components/AppShell/AppShell.svelte +80 -0
  40. package/components/AppShell/AppShell.svelte.d.ts +31 -0
  41. package/components/Avatar/Avatar.svelte +46 -0
  42. package/components/Avatar/Avatar.svelte.d.ts +32 -0
  43. package/components/Breadcrumb/Breadcrumb.svelte +24 -0
  44. package/components/Breadcrumb/Breadcrumb.svelte.d.ts +21 -0
  45. package/components/Breadcrumb/Crumb.svelte +29 -0
  46. package/components/Breadcrumb/Crumb.svelte.d.ts +21 -0
  47. package/components/ConicGradient/ConicGradient.svelte +80 -0
  48. package/components/ConicGradient/ConicGradient.svelte.d.ts +24 -0
  49. package/components/ConicGradient/types.d.ts +10 -0
  50. package/components/ConicGradient/types.js +2 -0
  51. package/components/Divider/Divider.svelte +21 -0
  52. package/components/Divider/Divider.svelte.d.ts +22 -0
  53. package/components/FileButton/FileButton.svelte +25 -0
  54. package/components/FileButton/FileButton.svelte.d.ts +22 -0
  55. package/components/FileDropzone/FileDropzone.svelte +83 -0
  56. package/components/FileDropzone/FileDropzone.svelte.d.ts +27 -0
  57. package/components/GradientHeading/GradientHeading.svelte +21 -0
  58. package/components/GradientHeading/GradientHeading.svelte.d.ts +22 -0
  59. package/components/ListBox/ListBox.svelte +54 -0
  60. package/components/ListBox/ListBox.svelte.d.ts +30 -0
  61. package/components/ListBox/ListBoxItem.svelte +87 -0
  62. package/components/ListBox/ListBoxItem.svelte.d.ts +30 -0
  63. package/components/Paginator/Paginator.svelte +62 -0
  64. package/components/Paginator/Paginator.svelte.d.ts +25 -0
  65. package/components/Paginator/types.d.ts +10 -0
  66. package/components/Paginator/types.js +2 -0
  67. package/components/ProgressBar/ProgressBar.svelte +57 -0
  68. package/components/ProgressBar/ProgressBar.svelte.d.ts +23 -0
  69. package/components/ProgressRadial/ProgressRadial.svelte +81 -0
  70. package/components/ProgressRadial/ProgressRadial.svelte.d.ts +25 -0
  71. package/components/Radio/RadioGroup.svelte +45 -0
  72. package/components/Radio/RadioGroup.svelte.d.ts +30 -0
  73. package/components/Radio/RadioItem.svelte +40 -0
  74. package/components/Radio/RadioItem.svelte.d.ts +29 -0
  75. package/components/RangeSlider/RangeSlider.svelte +95 -0
  76. package/components/RangeSlider/RangeSlider.svelte.d.ts +32 -0
  77. package/components/SlideToggle/SlideToggle.svelte +77 -0
  78. package/components/SlideToggle/SlideToggle.svelte.d.ts +31 -0
  79. package/components/Stepper/Step.svelte +94 -0
  80. package/components/Stepper/Step.svelte.d.ts +31 -0
  81. package/components/Stepper/Stepper.svelte +42 -0
  82. package/components/Stepper/Stepper.svelte.d.ts +27 -0
  83. package/components/SvgIcon/SvgIcon.svelte +45 -0
  84. package/components/SvgIcon/SvgIcon.svelte.d.ts +26 -0
  85. package/components/SvgIcon/icons.d.ts +1 -0
  86. package/components/SvgIcon/icons.js +171 -0
  87. package/components/Tab/Tab.svelte +54 -0
  88. package/components/Tab/Tab.svelte.d.ts +32 -0
  89. package/components/Tab/TabGroup.svelte +69 -0
  90. package/components/Tab/TabGroup.svelte.d.ts +30 -0
  91. package/components/Table/Table.svelte +102 -0
  92. package/components/Table/Table.svelte.d.ts +27 -0
  93. package/components/Table/types.d.ts +10 -0
  94. package/components/Table/types.js +1 -0
  95. package/components/Table/utils.d.ts +7 -0
  96. package/components/Table/utils.js +33 -0
  97. package/index.d.ts +59 -0
  98. package/index.js +68 -0
  99. package/package.json +147 -0
  100. package/styles/all.css +20 -0
  101. package/styles/core.css +53 -0
  102. package/styles/elements/badges.css +29 -0
  103. package/styles/elements/buttons.css +162 -0
  104. package/styles/elements/cards.css +34 -0
  105. package/styles/elements/lists.css +47 -0
  106. package/styles/elements/logo-clouds.css +31 -0
  107. package/styles/elements/menus.css +26 -0
  108. package/styles/elements/placeholders.css +17 -0
  109. package/styles/elements/tables.css +97 -0
  110. package/styles/elements/tooltips.css +83 -0
  111. package/styles/elements.css +15 -0
  112. package/styles/forms.css +154 -0
  113. package/styles/highlight-js.css +116 -0
  114. package/styles/tailwind.css +12 -0
  115. package/styles/tokens.css +171 -0
  116. package/styles/typography.css +115 -0
  117. package/tailwind/colors.d.ts +13 -0
  118. package/tailwind/colors.js +335 -0
  119. package/tailwind/theme.cjs +45 -0
  120. package/tailwind/theme.d.cts +5 -0
  121. package/themes/legacy/theme-skeleton.css +93 -0
  122. package/themes/theme-crimson.css +70 -0
  123. package/themes/theme-gold-nouveau.css +142 -0
  124. package/themes/theme-hamlindigo.css +82 -0
  125. package/themes/theme-modern.css +78 -0
  126. package/themes/theme-rocket.css +80 -0
  127. package/themes/theme-sahara.css +83 -0
  128. package/themes/theme-seafoam.css +81 -0
  129. package/themes/theme-seasonal.css +69 -0
  130. package/themes/theme-skeleton.css +99 -0
  131. package/themes/theme-vintage.css +80 -0
  132. package/utilities/CodeBlock/CodeBlock.svelte +63 -0
  133. package/utilities/CodeBlock/CodeBlock.svelte.d.ts +23 -0
  134. package/utilities/CodeBlock/stores.d.ts +2 -0
  135. package/utilities/CodeBlock/stores.js +3 -0
  136. package/utilities/DataTable/DataTable.d.ts +14 -0
  137. package/utilities/DataTable/DataTable.js +98 -0
  138. package/utilities/DataTable/actions.d.ts +8 -0
  139. package/utilities/DataTable/actions.js +114 -0
  140. package/utilities/DataTable/types.d.ts +15 -0
  141. package/utilities/DataTable/types.js +2 -0
  142. package/utilities/Drawer/Drawer.svelte +135 -0
  143. package/utilities/Drawer/Drawer.svelte.d.ts +36 -0
  144. package/utilities/LightSwitch/LightSwitch.svelte +70 -0
  145. package/utilities/LightSwitch/LightSwitch.svelte.d.ts +16 -0
  146. package/utilities/LightSwitch/stores.d.ts +3 -0
  147. package/utilities/LightSwitch/stores.js +5 -0
  148. package/utilities/LocalStorageStore/LocalStorageStore.d.ts +10 -0
  149. package/utilities/LocalStorageStore/LocalStorageStore.js +44 -0
  150. package/utilities/Menu/menu.d.ts +18 -0
  151. package/utilities/Menu/menu.js +100 -0
  152. package/utilities/Modal/Modal.d.ts +1 -0
  153. package/utilities/Modal/Modal.js +44 -0
  154. package/utilities/Modal/Modal.svelte +182 -0
  155. package/utilities/Modal/Modal.svelte.d.ts +33 -0
  156. package/utilities/Modal/examples/ModalExampleEmbed.svelte +20 -0
  157. package/utilities/Modal/examples/ModalExampleEmbed.svelte.d.ts +17 -0
  158. package/utilities/Modal/examples/ModalExampleForm.svelte +46 -0
  159. package/utilities/Modal/examples/ModalExampleForm.svelte.d.ts +17 -0
  160. package/utilities/Modal/examples/ModalExampleList.svelte +32 -0
  161. package/utilities/Modal/examples/ModalExampleList.svelte.d.ts +17 -0
  162. package/utilities/Modal/stores.d.ts +1 -0
  163. package/utilities/Modal/stores.js +22 -0
  164. package/utilities/Modal/types.d.ts +26 -0
  165. package/utilities/Modal/types.js +2 -0
  166. package/utilities/Toast/Toast.svelte +117 -0
  167. package/utilities/Toast/Toast.svelte.d.ts +28 -0
  168. package/utilities/Toast/stores.d.ts +10 -0
  169. package/utilities/Toast/stores.js +44 -0
  170. package/utilities/Toast/types.d.ts +21 -0
  171. package/utilities/Toast/types.js +2 -0
  172. package/utilities/Tooltip/tooltip.d.ts +35 -0
  173. package/utilities/Tooltip/tooltip.js +94 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Skeleton Labs, LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ [![Skeleton](https://user-images.githubusercontent.com/1509726/199282306-7454adcb-b765-4618-8438-67655a7dee47.png)](https://www.skeleton.dev/)
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@skeletonlabs/skeleton?logo=npm&color=cb3837)](https://www.npmjs.com/package/@skeletonlabs/skeleton)
4
+ [![Chat](https://img.shields.io/discord/1003691521280856084?label=chat&logo=discord&color=7289da)](https://discord.gg/EXqV7W8MtY)
5
+ [![Twitter Follow](https://img.shields.io/twitter/follow/SkeletonUI?style=social)](https://twitter.com/SkeletonUI)
6
+ [![license](https://img.shields.io/badge/license-MIT-%23bada55)](https://github.com/skeletonlabs/skeleton/blob/master/LICENSE)
7
+
8
+ # 💀 Skeleton
9
+
10
+ A fully featured Svelte UI toolkit for Svelte + Tailwind. Skeleton allows you to build fast and reactive web interfaces using the power of [Svelte](https://svelte.dev/) + [Tailwind CSS](https://tailwindcss.com/). Including official support for [SvelteKit](https://kit.svelte.dev/), [Vite](https://vitejs.dev/), and [Astro](https://astro.build/).
11
+
12
+ ## 🔗 Useful Links
13
+
14
+ - [Documentation](https://skeleton.dev/)
15
+ - [Contribution Guide](https://skeleton.dev/docs/contributions)
16
+ - [Project Roadmap](https://github.com/skeletonlabs/skeleton/wiki/%F0%9F%9B%A3%EF%B8%8F-The-Skeleton-Roadmap)
17
+
18
+ ## 👋 Community
19
+
20
+ - [Join the Discord](https://discord.gg/EXqV7W8MtY)
21
+ - [Follow on Twitter](https://twitter.com/SkeletonUI)
22
+
23
+ ## 🐞 Report an Issue
24
+
25
+ - [Submit Issue](https://github.com/skeletonlabs/skeleton/issues/new/choose)
26
+
27
+ ## 🛠️ Contributions
28
+
29
+ We've provided a detailed [contribution guide](https://www.skeleton.dev/docs/contributions) to help you get started. Pull requests are highly encouraged. [Pick an open issue](https://github.com/skeletonlabs/skeleton/issues), review requirements with contributors, then send a PR!
30
+
31
+ ## Core Maintainer
32
+
33
+ - [Chris Simmons](https://github.com/endigo9740) (endigo9740)
@@ -0,0 +1,4 @@
1
+ export declare function clipboard(node: HTMLElement, args: any): {
2
+ update(newArgs: any): void;
3
+ destroy(): void;
4
+ };
@@ -0,0 +1,37 @@
1
+ // Action: Clipboard
2
+ export function clipboard(node, args) {
3
+ const onClick = () => {
4
+ // Handle `data-clipboard` target based on object key
5
+ if (typeof args === 'object') {
6
+ // Element Inner HTML
7
+ if (Object.prototype.hasOwnProperty.call(args, 'element')) {
8
+ const element = document.querySelector(`[data-clipboard="${args.element}"]`);
9
+ copyToClipboard(element?.innerHTML);
10
+ return;
11
+ }
12
+ // Form Input Value
13
+ if (Object.prototype.hasOwnProperty.call(args, 'input')) {
14
+ const input = document.querySelector(`[data-clipboard="${args.input}"]`);
15
+ copyToClipboard(input?.value);
16
+ return;
17
+ }
18
+ }
19
+ // Handle everything else.
20
+ copyToClipboard(args);
21
+ };
22
+ // Event Listner
23
+ node.addEventListener('click', onClick);
24
+ // Lifecycle
25
+ return {
26
+ update(newArgs) {
27
+ args = newArgs;
28
+ },
29
+ destroy() {
30
+ node.removeEventListener('click', onClick);
31
+ }
32
+ };
33
+ }
34
+ // Shared copy method
35
+ function copyToClipboard(data) {
36
+ navigator.clipboard.writeText(String(data));
37
+ }
@@ -0,0 +1,3 @@
1
+ export declare function filter(node: HTMLElement, filterName: string): {
2
+ update(newArgs: any): void;
3
+ } | undefined;
@@ -0,0 +1,23 @@
1
+ // Action: Filter
2
+ export function filter(node, filterName) {
3
+ if (filterName === undefined)
4
+ return;
5
+ const applyFilter = () => {
6
+ // Prevent this action on Firebox browsers
7
+ const isFirefox = navigator.userAgent.indexOf('Firefox') > -1;
8
+ if (isFirefox) {
9
+ return;
10
+ }
11
+ // If the filter name availalbe, apply the Filter
12
+ node.setAttribute('style', `filter: url("#${filterName}")`);
13
+ };
14
+ // On Init
15
+ applyFilter();
16
+ // Lifecycle
17
+ return {
18
+ update(newArgs) {
19
+ filterName = newArgs;
20
+ applyFilter();
21
+ }
22
+ };
23
+ }
@@ -0,0 +1,13 @@
1
+ <!-- Apollo: `filter: url(#Apollo)` -->
2
+ <svg id="svg-filter-apollo" class="hidden">
3
+ <filter id="Apollo" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
4
+ <feColorMatrix
5
+ values="0.8 0.6 -0.4 0.1 0,
6
+ 0 1.2 0.05 0 0,
7
+ 0 -1 3 0.02 0,
8
+ 0 0 0 50 0"
9
+ result="final"
10
+ in="SourceGraphic"
11
+ />
12
+ </filter>
13
+ </svg>
@@ -0,0 +1,19 @@
1
+ /** @typedef {typeof __propDef.props} ApolloProps */
2
+ /** @typedef {typeof __propDef.events} ApolloEvents */
3
+ /** @typedef {typeof __propDef.slots} ApolloSlots */
4
+ export default class Apollo extends SvelteComponentTyped<{}, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> {
7
+ }
8
+ export type ApolloProps = typeof __propDef.props;
9
+ export type ApolloEvents = typeof __propDef.events;
10
+ export type ApolloSlots = typeof __propDef.slots;
11
+ import { SvelteComponentTyped } from "svelte";
12
+ declare const __propDef: {
13
+ props: {};
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {};
18
+ };
19
+ export {};
@@ -0,0 +1,12 @@
1
+ <!-- BlueNight: `filter: url(#BlueNight)` -->
2
+ <svg id="svg-filter-bluenight" class="hidden">
3
+ <filter id="BlueNight" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
4
+ <feColorMatrix
5
+ type="matrix"
6
+ values="1.000 0.000 0.000 0.000 0.000
7
+ 0.000 1.000 0.000 0.000 0.05
8
+ 0.000 0.000 1.000 0.000 0.400
9
+ 0.000 0.000 0.000 1.000 0.000"
10
+ />
11
+ </filter>
12
+ </svg>
@@ -0,0 +1,19 @@
1
+ /** @typedef {typeof __propDef.props} BlueNightProps */
2
+ /** @typedef {typeof __propDef.events} BlueNightEvents */
3
+ /** @typedef {typeof __propDef.slots} BlueNightSlots */
4
+ export default class BlueNight extends SvelteComponentTyped<{}, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> {
7
+ }
8
+ export type BlueNightProps = typeof __propDef.props;
9
+ export type BlueNightEvents = typeof __propDef.events;
10
+ export type BlueNightSlots = typeof __propDef.slots;
11
+ import { SvelteComponentTyped } from "svelte";
12
+ declare const __propDef: {
13
+ props: {};
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {};
18
+ };
19
+ export {};
@@ -0,0 +1,23 @@
1
+ <!-- Emerald: `filter: url(#Emerald)` -->
2
+ <svg id="svg-filter-emerald" class="hidden">
3
+ <filter id="Emerald" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
4
+ <!-- RGB, RGB, RGB, 0pacity -->
5
+ <feColorMatrix
6
+ type="matrix"
7
+ in="SourceGraphic"
8
+ result="colormatrix"
9
+ values="
10
+ .16 .185 .129 0 0
11
+ .16 .185 .129 0 0
12
+ .16 .185 .129 0 0
13
+ 0 0 0 0.33 0"
14
+ />
15
+ <feComponentTransfer in="colormatrix" result="componentTransfer">
16
+ <feFuncR type="table" tableValues="0.03 0.9" />
17
+ <feFuncG type="table" tableValues="0.57 1" />
18
+ <feFuncB type="table" tableValues="0.49 0.53" />
19
+ <feFuncA type="table" tableValues="0 1" />
20
+ </feComponentTransfer>
21
+ <feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend" />
22
+ </filter>
23
+ </svg>
@@ -0,0 +1,19 @@
1
+ /** @typedef {typeof __propDef.props} EmeraldProps */
2
+ /** @typedef {typeof __propDef.events} EmeraldEvents */
3
+ /** @typedef {typeof __propDef.slots} EmeraldSlots */
4
+ export default class Emerald extends SvelteComponentTyped<{}, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> {
7
+ }
8
+ export type EmeraldProps = typeof __propDef.props;
9
+ export type EmeraldEvents = typeof __propDef.events;
10
+ export type EmeraldSlots = typeof __propDef.slots;
11
+ import { SvelteComponentTyped } from "svelte";
12
+ declare const __propDef: {
13
+ props: {};
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {};
18
+ };
19
+ export {};
@@ -0,0 +1,18 @@
1
+ <!-- GreenFall: `filter: url(#GreenFall)` -->
2
+ <svg id="svg-filter-greenfall" class="filter hidden">
3
+ <filter id="GreenFall" x="-20%" y="-20%" width="140%" height="140%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="linearRGB">
4
+ <feColorMatrix
5
+ type="matrix"
6
+ values="0.5 -0.4 0.3332 0 0
7
+ 0 0.4 0.3 0 0
8
+ 0 0 0.5 0 0
9
+ 0 0 0 500 -20"
10
+ x="0%"
11
+ y="0%"
12
+ width="100%"
13
+ height="100%"
14
+ in="SourceGraphic"
15
+ result="colormatrix"
16
+ />
17
+ </filter>
18
+ </svg>
@@ -0,0 +1,19 @@
1
+ /** @typedef {typeof __propDef.props} GreenFallProps */
2
+ /** @typedef {typeof __propDef.events} GreenFallEvents */
3
+ /** @typedef {typeof __propDef.slots} GreenFallSlots */
4
+ export default class GreenFall extends SvelteComponentTyped<{}, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> {
7
+ }
8
+ export type GreenFallProps = typeof __propDef.props;
9
+ export type GreenFallEvents = typeof __propDef.events;
10
+ export type GreenFallSlots = typeof __propDef.slots;
11
+ import { SvelteComponentTyped } from "svelte";
12
+ declare const __propDef: {
13
+ props: {};
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {};
18
+ };
19
+ export {};
@@ -0,0 +1,11 @@
1
+ <!-- Noir: `filter: url(#Noir)` -->
2
+ <svg id="svg-filter-noir" class="hidden">
3
+ <filter id="Noir" x="-20%" y="-20%" width="140%" height="140%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="linearRGB">
4
+ <feColorMatrix type="saturate" values="0" x="0%" y="0%" width="100%" height="100%" in="SourceGraphic" result="colormatrix1" />
5
+ <feBlend mode="lighten" x="0%" y="0%" width="100%" height="100%" in="colormatrix1" in2="colormatrix1" result="blend" />
6
+ <feDiffuseLighting surfaceScale="7.7" diffuseConstant="7.3" lighting-color="#707070" x="0%" y="0%" width="100%" height="100%" in="blend" result="diffuseLighting">
7
+ <fePointLight x="200" y="157" z="200" />
8
+ </feDiffuseLighting>
9
+ <feBlend mode="multiply" x="0%" y="0%" width="100%" height="100%" in="colormatrix1" in2="diffuseLighting" result="blend1" />
10
+ </filter>
11
+ </svg>
@@ -0,0 +1,19 @@
1
+ /** @typedef {typeof __propDef.props} NoirProps */
2
+ /** @typedef {typeof __propDef.events} NoirEvents */
3
+ /** @typedef {typeof __propDef.slots} NoirSlots */
4
+ export default class Noir extends SvelteComponentTyped<{}, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> {
7
+ }
8
+ export type NoirProps = typeof __propDef.props;
9
+ export type NoirEvents = typeof __propDef.events;
10
+ export type NoirSlots = typeof __propDef.slots;
11
+ import { SvelteComponentTyped } from "svelte";
12
+ declare const __propDef: {
13
+ props: {};
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {};
18
+ };
19
+ export {};
@@ -0,0 +1,10 @@
1
+ <!-- NoirLight: `filter: url(#NoirLight)` -->
2
+ <svg id="svg-filter-noirlight" class="hidden">
3
+ <filter id="NoirLight" x="-20%" y="-20%" width="140%" height="140%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="linearRGB">
4
+ <feColorMatrix type="saturate" values="0" x="0%" y="0%" width="100%" height="100%" in="SourceGraphic" result="colormatrix2" />
5
+ <feBlend mode="saturation" x="0%" y="0%" width="100%" height="100%" in="SourceGraphic" in2="colormatrix2" result="blend2" />
6
+ <feBlend mode="screen" x="0%" y="0%" width="100%" height="100%" in="colormatrix2" in2="blend2" result="blend3" />
7
+ <feColorMatrix type="luminanceToAlpha" x="0%" y="0%" width="100%" height="100%" in="blend3" result="colormatrix3" />
8
+ <feBlend mode="exclusion" x="0%" y="0%" width="100%" height="100%" in="blend3" in2="colormatrix3" result="blend5" />
9
+ </filter>
10
+ </svg>
@@ -0,0 +1,19 @@
1
+ /** @typedef {typeof __propDef.props} NoirLightProps */
2
+ /** @typedef {typeof __propDef.events} NoirLightEvents */
3
+ /** @typedef {typeof __propDef.slots} NoirLightSlots */
4
+ export default class NoirLight extends SvelteComponentTyped<{}, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> {
7
+ }
8
+ export type NoirLightProps = typeof __propDef.props;
9
+ export type NoirLightEvents = typeof __propDef.events;
10
+ export type NoirLightSlots = typeof __propDef.slots;
11
+ import { SvelteComponentTyped } from "svelte";
12
+ declare const __propDef: {
13
+ props: {};
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {};
18
+ };
19
+ export {};
@@ -0,0 +1,14 @@
1
+ <!-- Rustic: `filter: url(#Rustic)` -->
2
+ <svg id="svg-filter-rustic" class="hidden">
3
+ <filter id="Rustic" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
4
+ <feColorMatrix
5
+ type="matrix"
6
+ in="SourceGraphic"
7
+ result="colormatrix"
8
+ values="0.39215686274509803 0.39215686274509803 0.39215686274509803 0 0
9
+ 0.3333333333333333 0.3333333333333333 0.3333333333333333 0 0
10
+ 0.30980392156862746 0.30980392156862746 0.30980392156862746 0 0
11
+ 0 0 0 1 0"
12
+ />
13
+ </filter>
14
+ </svg>
@@ -0,0 +1,19 @@
1
+ /** @typedef {typeof __propDef.props} RusticProps */
2
+ /** @typedef {typeof __propDef.events} RusticEvents */
3
+ /** @typedef {typeof __propDef.slots} RusticSlots */
4
+ export default class Rustic extends SvelteComponentTyped<{}, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> {
7
+ }
8
+ export type RusticProps = typeof __propDef.props;
9
+ export type RusticEvents = typeof __propDef.events;
10
+ export type RusticSlots = typeof __propDef.slots;
11
+ import { SvelteComponentTyped } from "svelte";
12
+ declare const __propDef: {
13
+ props: {};
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {};
18
+ };
19
+ export {};
@@ -0,0 +1,12 @@
1
+ <!-- Summer84: `filter: url(#Summer84)` -->
2
+ <svg id="svg-filter-summer84" class="hidden">
3
+ <filter id="Summer84" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
4
+ <feColorMatrix
5
+ type="matrix"
6
+ values="1.300 0.200 0.000 0.000 0.000
7
+ 0.300 0.600 0.200 0.000 0.000
8
+ 0.200 1.000 0.200 0.000 0.000
9
+ 0.000 0.000 0.000 1.000 0.000"
10
+ />
11
+ </filter>
12
+ </svg>
@@ -0,0 +1,19 @@
1
+ /** @typedef {typeof __propDef.props} Summer84Props */
2
+ /** @typedef {typeof __propDef.events} Summer84Events */
3
+ /** @typedef {typeof __propDef.slots} Summer84Slots */
4
+ export default class Summer84 extends SvelteComponentTyped<{}, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> {
7
+ }
8
+ export type Summer84Props = typeof __propDef.props;
9
+ export type Summer84Events = typeof __propDef.events;
10
+ export type Summer84Slots = typeof __propDef.slots;
11
+ import { SvelteComponentTyped } from "svelte";
12
+ declare const __propDef: {
13
+ props: {};
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {};
18
+ };
19
+ export {};
@@ -0,0 +1,12 @@
1
+ <!-- XPro: `filter: url(#XPro)` -->
2
+ <svg id="svg-filter-xpro" class="hidden">
3
+ <filter id="XPro" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
4
+ <feColorMatrix
5
+ type="matrix"
6
+ values="1.70 -0.20 0.00 0.00 0.00
7
+ 0.10 0.800 0.30 0.00 0.00
8
+ 0.20 0.300 0.50 0.00 0.00
9
+ 0.00 0.00 0.00 1.00 0.00"
10
+ />
11
+ </filter>
12
+ </svg>
@@ -0,0 +1,19 @@
1
+ /** @typedef {typeof __propDef.props} XProProps */
2
+ /** @typedef {typeof __propDef.events} XProEvents */
3
+ /** @typedef {typeof __propDef.slots} XProSlots */
4
+ export default class XPro extends SvelteComponentTyped<{}, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> {
7
+ }
8
+ export type XProProps = typeof __propDef.props;
9
+ export type XProEvents = typeof __propDef.events;
10
+ export type XProSlots = typeof __propDef.slots;
11
+ import { SvelteComponentTyped } from "svelte";
12
+ declare const __propDef: {
13
+ props: {};
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {};
18
+ };
19
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare function focusTrap(node: HTMLElement, enabled: boolean): {
2
+ update(newArgs: boolean): void;
3
+ destroy(): void;
4
+ };
@@ -0,0 +1,42 @@
1
+ // Action: Focus Trap
2
+ export function focusTrap(node, enabled) {
3
+ const elemWhitelist = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])';
4
+ let elemFirst;
5
+ let elemLast;
6
+ function onElemLastKeydown(e) {
7
+ if (e.code === 'Tab') {
8
+ e.preventDefault();
9
+ elemFirst.focus();
10
+ }
11
+ }
12
+ const onInit = () => {
13
+ if (enabled === false)
14
+ return;
15
+ // Gather all focusable elements
16
+ const focusableElems = Array.from(node.querySelectorAll(elemWhitelist));
17
+ if (focusableElems.length) {
18
+ // Set first/last focusable elements
19
+ elemFirst = focusableElems[0];
20
+ elemLast = focusableElems[focusableElems.length - 1];
21
+ // Auto-focus first focusable element
22
+ elemFirst.focus();
23
+ // Listen for keydown on last element
24
+ elemLast.addEventListener('keydown', onElemLastKeydown);
25
+ }
26
+ };
27
+ onInit();
28
+ function onDestory() {
29
+ if (elemLast)
30
+ elemLast.removeEventListener('keydown', onElemLastKeydown);
31
+ }
32
+ // Lifecycle
33
+ return {
34
+ update(newArgs) {
35
+ enabled = newArgs;
36
+ newArgs ? onInit() : onDestory();
37
+ },
38
+ destroy() {
39
+ onDestory();
40
+ }
41
+ };
42
+ }
@@ -0,0 +1,47 @@
1
+ <script>// Slots:
2
+ // NOTE: we cannot describe the default slot.
3
+ import { onMount, setContext } from 'svelte';
4
+ /** Enable auto-collapse mode. */
5
+ export let collapse = true;
6
+ /** Provide classes to set the hover background color. */
7
+ export let hover = 'bg-hover-token';
8
+ /** Provide classes to set vertical spacing. */
9
+ export let spacing = 'space-y-4';
10
+ /** Provide classes to set padding for summary and content regions. */
11
+ export let padding = 'px-4 py-2';
12
+ /** Provide classes to set summary border radius. */
13
+ export let rounded = 'rounded-token';
14
+ // Context
15
+ setContext('hover', hover);
16
+ setContext('spacing', spacing);
17
+ setContext('padding', padding);
18
+ setContext('rounded', rounded);
19
+ // Classes
20
+ const cBase = 'rounded-container-token';
21
+ // Local
22
+ let elemAccordian;
23
+ // Lifecycle
24
+ onMount(() => {
25
+ if (collapse) {
26
+ // Ensure only one detail element is open at a time
27
+ // https://nikitahl.com/native-html-accordion
28
+ const details = Array.from(elemAccordian.querySelectorAll('details'));
29
+ details.forEach((detail) => {
30
+ detail.addEventListener('click', (e) => {
31
+ const active = details.find((d) => d.open);
32
+ if (!e.currentTarget.open && active) {
33
+ active.open = false;
34
+ }
35
+ });
36
+ });
37
+ }
38
+ });
39
+ // Reactive
40
+ $: classesBase = `${cBase} ${spacing} ${$$props.class ?? ''}`;
41
+ </script>
42
+
43
+ <!-- @component The Accordion parent element. -->
44
+
45
+ <div bind:this={elemAccordian} class="accordion-group {classesBase}" data-testid="accordion-group">
46
+ <slot />
47
+ </div>
@@ -0,0 +1,24 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ collapse?: boolean | undefined;
6
+ hover?: string | undefined;
7
+ spacing?: string | undefined;
8
+ padding?: string | undefined;
9
+ rounded?: string | undefined;
10
+ };
11
+ events: {
12
+ [evt: string]: CustomEvent<any>;
13
+ };
14
+ slots: {
15
+ default: {};
16
+ };
17
+ };
18
+ export type AccordionGroupProps = typeof __propDef.props;
19
+ export type AccordionGroupEvents = typeof __propDef.events;
20
+ export type AccordionGroupSlots = typeof __propDef.slots;
21
+ /** The Accordion parent element. */
22
+ export default class AccordionGroup extends SvelteComponentTyped<AccordionGroupProps, AccordionGroupEvents, AccordionGroupSlots> {
23
+ }
24
+ export {};
@@ -0,0 +1,70 @@
1
+ <script>// Slots:
2
+ /**
3
+ * @slot {{}} content - Allows for an optional leading element, such as an icon.
4
+ * @slot {{}} lead - Provide the summary details of each item.
5
+ * @slot {{}} summary - Provide the content details of each item.
6
+ */
7
+ // Events:
8
+ // FORWARDED: do not document these, breaks the type definition
9
+ // DISPATCHED: document directly above the definition, like props (ex: paginator)
10
+ import { getContext } from 'svelte';
11
+ import SvgIcon from '../SvgIcon/SvgIcon.svelte';
12
+ // Props
13
+ /** Defines the default open state on page load .*/
14
+ export let open = false;
15
+ /** Provide semantic ID for ARIA summary element. */
16
+ export let summaryId = '';
17
+ /** Provide semantic ID for ARIA content element. */
18
+ export let contentId = '';
19
+ /** Provide arbitrary styles for the summary element region. */
20
+ export let regionSummary = '';
21
+ /** Provide arbitrary styles for the summary element region. */
22
+ export let regionContent = '';
23
+ // Context
24
+ /** Provide classes to set the hover background color. */
25
+ export let hover = getContext('hover');
26
+ /** Provide classes to set vertical spacing. */
27
+ export let spacing = getContext('spacing');
28
+ /** Provide classes to set padding for summary and content regions. */
29
+ export let padding = getContext('padding');
30
+ /** Provide classes to set summary border radius. */
31
+ export let rounded = getContext('rounded');
32
+ // Base Classes
33
+ const cBaseDetails = '';
34
+ const cBaseSummary = 'list-none flex items-center space-x-4 cursor-pointer';
35
+ const cBaseIcon = 'flex justify-center items-center w-3 fill-black dark:fill-white transition-all duration-[100ms]';
36
+ // Reactive Classes
37
+ $: classesDetails = `${cBaseDetails} ${spacing} ${$$props.class ?? ''}`;
38
+ $: classesSummary = `${cBaseSummary} ${padding} ${rounded} ${hover} ${regionSummary}`;
39
+ $: classesIconState = open ? '-rotate-180' : '';
40
+ $: classesIcon = `${cBaseIcon} ${classesIconState}`;
41
+ $: classesContent = `${padding} ${regionContent}`;
42
+ </script>
43
+
44
+ <!-- @component The Accordion child element. -->
45
+
46
+ <details bind:open class="accordion-item {classesDetails}" data-testid="accordion-item" on:click on:keydown on:keyup on:keypress>
47
+ <!-- Summary -->
48
+ <summary id={summaryId} class="accordion-summary {classesSummary}" aria-expanded={open} aria-controls={contentId}>
49
+ <!-- Slot: Lead -->
50
+ {#if $$slots.lead}<div class="accordion-summary-lead"><slot name="lead" /></div>{/if}
51
+ <!-- Slot: Text -->
52
+ <div class="accordion-summary-text flex-auto" role="button"><slot name="summary">(summary)</slot></div>
53
+ <!-- Caret -->
54
+ <div class="accordion-summary-caret {classesIcon}">
55
+ <SvgIcon name="angle-down" class="opacity-50" />
56
+ </div>
57
+ </summary>
58
+
59
+ <!-- Content -->
60
+ <div id={contentId} class="accordion-content {classesContent}" role="region" aria-labelledby={summaryId}>
61
+ <slot name="content">(content)</slot>
62
+ </div>
63
+ </details>
64
+
65
+ <style>
66
+ /* Hide the left-hande arrows for details/summary */
67
+ /* Note: let's keep this localized in case users want the arrows elsewhere */
68
+ details summary::-webkit-details-marker {
69
+ display: none;
70
+ }</style>