@skeletonlabs/skeleton 0.99.5 → 0.132.4

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 (121) hide show
  1. package/README.md +1 -2
  2. package/actions/Filters/filter.js +6 -9
  3. package/components/Accordion/Accordion.svelte +34 -0
  4. package/components/Accordion/Accordion.svelte.d.ts +41 -0
  5. package/components/Accordion/AccordionItem.svelte +84 -39
  6. package/components/Accordion/AccordionItem.svelte.d.ts +24 -7
  7. package/components/AppBar/AppBar.svelte +36 -21
  8. package/components/AppBar/AppBar.svelte.d.ts +20 -1
  9. package/components/AppRail/AppRail.svelte +3 -2
  10. package/components/AppRail/AppRail.svelte.d.ts +13 -1
  11. package/components/AppRail/AppRailTile.svelte +10 -7
  12. package/components/AppRail/AppRailTile.svelte.d.ts +10 -4
  13. package/components/AppShell/AppShell.svelte +3 -2
  14. package/components/AppShell/AppShell.svelte.d.ts +11 -0
  15. package/components/Avatar/Avatar.svelte +9 -9
  16. package/components/Avatar/Avatar.svelte.d.ts +16 -5
  17. package/components/ConicGradient/ConicGradient.svelte +18 -8
  18. package/components/ConicGradient/ConicGradient.svelte.d.ts +11 -0
  19. package/components/ConicGradient/settings.d.ts +1 -5
  20. package/components/ConicGradient/settings.js +1 -2
  21. package/components/FileButton/FileButton.svelte +8 -6
  22. package/components/FileButton/FileButton.svelte.d.ts +3 -1
  23. package/components/FileDropzone/FileDropzone.svelte +43 -63
  24. package/components/FileDropzone/FileDropzone.svelte.d.ts +24 -8
  25. package/components/InputChip/InputChip.svelte +97 -52
  26. package/components/InputChip/InputChip.svelte.d.ts +28 -4
  27. package/components/ListBox/ListBox.svelte +13 -29
  28. package/components/ListBox/ListBox.svelte.d.ts +11 -10
  29. package/components/ListBox/ListBoxItem.svelte +60 -50
  30. package/components/ListBox/ListBoxItem.svelte.d.ts +12 -7
  31. package/components/Paginator/Paginator.svelte +4 -4
  32. package/components/Paginator/Paginator.svelte.d.ts +13 -2
  33. package/components/ProgressBar/ProgressBar.svelte +17 -24
  34. package/components/ProgressBar/ProgressBar.svelte.d.ts +9 -1
  35. package/components/ProgressRadial/ProgressRadial.svelte +6 -8
  36. package/components/ProgressRadial/ProgressRadial.svelte.d.ts +9 -2
  37. package/components/Radio/RadioGroup.svelte +13 -16
  38. package/components/Radio/RadioGroup.svelte.d.ts +15 -7
  39. package/components/Radio/RadioItem.svelte +25 -21
  40. package/components/Radio/RadioItem.svelte.d.ts +12 -7
  41. package/components/RangeSlider/RangeSlider.svelte +9 -17
  42. package/components/RangeSlider/RangeSlider.svelte.d.ts +11 -2
  43. package/components/SlideToggle/SlideToggle.svelte +10 -9
  44. package/components/SlideToggle/SlideToggle.svelte.d.ts +11 -3
  45. package/components/Stepper/Step.svelte +64 -107
  46. package/components/Stepper/Step.svelte.d.ts +17 -18
  47. package/components/Stepper/Stepper.svelte +58 -37
  48. package/components/Stepper/Stepper.svelte.d.ts +28 -14
  49. package/components/Tab/Tab.svelte +40 -38
  50. package/components/Tab/Tab.svelte.d.ts +20 -14
  51. package/components/Tab/TabGroup.svelte +28 -41
  52. package/components/Tab/TabGroup.svelte.d.ts +25 -9
  53. package/components/Table/Table.svelte.d.ts +9 -0
  54. package/components/TableOfContents/TableOfContents.svelte +3 -2
  55. package/components/TableOfContents/TableOfContents.svelte.d.ts +12 -0
  56. package/index.d.ts +5 -4
  57. package/index.js +10 -4
  58. package/package.json +24 -16
  59. package/styles/all.css +0 -3
  60. package/styles/elements/breadcrumbs.css +3 -4
  61. package/styles/elements/buttons.css +2 -4
  62. package/styles/elements/forms.css +265 -0
  63. package/styles/elements/lists.css +1 -1
  64. package/styles/elements/modals.css +15 -0
  65. package/styles/elements/popups.css +16 -0
  66. package/styles/elements.css +3 -2
  67. package/styles/typography.css +5 -5
  68. package/styles/variants.css +7 -7
  69. package/tailwind/core.cjs +1 -1
  70. package/tailwind/generated/intellisense-classes.cjs +1 -1
  71. package/tailwind/generated/intellisense-classes.d.cts +318 -404
  72. package/tailwind/intellisense.cjs +2 -2
  73. package/tailwind/skeleton.cjs +1 -1
  74. package/types/index.d.ts +1 -0
  75. package/types/index.js +1 -0
  76. package/types/tailwind.d.ts +4 -0
  77. package/types/tailwind.js +2 -0
  78. package/utilities/CodeBlock/CodeBlock.svelte +14 -8
  79. package/utilities/CodeBlock/CodeBlock.svelte.d.ts +17 -1
  80. package/utilities/Drawer/Drawer.svelte +50 -37
  81. package/utilities/Drawer/Drawer.svelte.d.ts +20 -1
  82. package/utilities/Drawer/types.d.ts +8 -2
  83. package/utilities/LightSwitch/LightSwitch.svelte +43 -53
  84. package/utilities/LightSwitch/LightSwitch.svelte.d.ts +18 -2
  85. package/utilities/LightSwitch/lightswitch.d.ts +20 -0
  86. package/utilities/LightSwitch/lightswitch.js +71 -0
  87. package/utilities/LocalStorageStore/LocalStorageStore.js +1 -1
  88. package/utilities/Modal/Modal.svelte +96 -64
  89. package/utilities/Modal/Modal.svelte.d.ts +29 -0
  90. package/utilities/Modal/types.d.ts +9 -5
  91. package/utilities/Popup/popup.d.ts +7 -0
  92. package/utilities/Popup/popup.js +218 -0
  93. package/utilities/Popup/types.d.ts +32 -0
  94. package/utilities/Popup/types.js +3 -0
  95. package/utilities/Toast/Toast.svelte +17 -13
  96. package/utilities/Toast/Toast.svelte.d.ts +14 -0
  97. package/utilities/Toast/stores.js +9 -26
  98. package/utilities/Toast/types.d.ts +6 -1
  99. package/components/Accordion/AccordionGroup.svelte +0 -33
  100. package/components/Accordion/AccordionGroup.svelte.d.ts +0 -24
  101. package/components/SvgIcon/SvgIcon.svelte +0 -33
  102. package/components/SvgIcon/SvgIcon.svelte.d.ts +0 -26
  103. package/components/SvgIcon/icons.d.ts +0 -1
  104. package/components/SvgIcon/icons.js +0 -25
  105. package/styles/elements/menus.css +0 -29
  106. package/styles/elements/tooltips.css +0 -83
  107. package/styles/forms.css +0 -195
  108. package/utilities/LightSwitch/stores.d.ts +0 -2
  109. package/utilities/LightSwitch/stores.js +0 -5
  110. package/utilities/Menu/menu.d.ts +0 -18
  111. package/utilities/Menu/menu.js +0 -151
  112. package/utilities/Modal/examples/ModalExampleEmbed.svelte +0 -17
  113. package/utilities/Modal/examples/ModalExampleEmbed.svelte.d.ts +0 -17
  114. package/utilities/Modal/examples/ModalExampleForm.svelte +0 -41
  115. package/utilities/Modal/examples/ModalExampleForm.svelte.d.ts +0 -17
  116. package/utilities/Modal/examples/ModalExampleImage.svelte +0 -19
  117. package/utilities/Modal/examples/ModalExampleImage.svelte.d.ts +0 -16
  118. package/utilities/Modal/examples/ModalExampleList.svelte +0 -27
  119. package/utilities/Modal/examples/ModalExampleList.svelte.d.ts +0 -17
  120. package/utilities/Tooltip/tooltip.d.ts +0 -35
  121. package/utilities/Tooltip/tooltip.js +0 -94
@@ -21,33 +21,11 @@ function toastService() {
21
21
  /** Add a new toast to the queue. */
22
22
  trigger: (toast) => update((tStore) => {
23
23
  const id = randomUUID();
24
- // Apply Preset Color Styles
25
- let classes = toast.classes ?? '';
26
- // prettier-ignore
27
- switch (toast.preset) {
28
- // Success/Error
29
- // IMPORTANT: use full class names here. Do not construct the classes.
30
- case ('primary'):
31
- classes += '!bg-primary-500 text-on-primary-token';
32
- break;
33
- case ('secondary'):
34
- classes += '!bg-secondary-500 text-on-secondary-token';
35
- break;
36
- case ('tertiary'):
37
- classes += '!bg-tertiary-500 text-on-tertiary-token';
38
- break;
39
- case ('success'):
40
- classes += '!bg-success-500 text-on-success-token';
41
- break;
42
- case ('warning'):
43
- classes += '!bg-warning-500 text-on-warning-token';
44
- break;
45
- case ('error'):
46
- classes += '!bg-error-500 text-on-error-token';
47
- break;
48
- }
24
+ // Trigger Callback
25
+ if (toast && toast.callback)
26
+ toast.callback({ id, status: 'queued' });
49
27
  // Merge into store
50
- const tMerged = { ...toastDefaults, ...toast, id, classes };
28
+ const tMerged = { ...toastDefaults, ...toast, id };
51
29
  tStore.push(tMerged);
52
30
  // Handle auto-hide, if needed
53
31
  handleAutoHide(tMerged);
@@ -58,6 +36,11 @@ function toastService() {
58
36
  close: (id) => update((tStore) => {
59
37
  if (tStore.length > 0) {
60
38
  const index = tStore.findIndex((t) => t.id === id);
39
+ // Trigger Callback
40
+ const selectedToast = tStore[index];
41
+ if (selectedToast && selectedToast.callback)
42
+ selectedToast.callback({ id, status: 'closed' });
43
+ // Remove
61
44
  tStore.splice(index, 1);
62
45
  }
63
46
  return tStore;
@@ -5,7 +5,7 @@ export interface ToastSettings {
5
5
  * Applies a canned set of styles.
6
6
  * @type {'primary' | 'secondary' | 'tertiary' | 'warning' | 'success' | 'error'}
7
7
  */
8
- preset?: 'primary' | 'secondary' | 'tertiary' | 'warning' | 'success' | 'error';
8
+ background?: string;
9
9
  /** Enables auto-hide after the timeout duration. */
10
10
  autohide?: boolean;
11
11
  /** Set the auto-hide timeout duration. */
@@ -19,6 +19,11 @@ export interface ToastSettings {
19
19
  };
20
20
  /** Provide arbitrary CSS classes to style the toast. */
21
21
  classes?: string;
22
+ /** Callback function that fires on trigger and close. */
23
+ callback?: (response: {
24
+ id: string;
25
+ status: 'queued' | 'closed';
26
+ }) => void;
22
27
  }
23
28
  export interface Toast extends ToastSettings {
24
29
  /** A UUID will be auto-assigned on `.trigger()`. */
@@ -1,33 +0,0 @@
1
- <script>import { onMount, setContext } from "svelte";
2
- export let collapse = true;
3
- export let hover = "bg-primary-hover-token";
4
- export let spacing = "space-y-4";
5
- export let padding = "px-4 py-2";
6
- export let rounded = "rounded-token";
7
- setContext("hover", hover);
8
- setContext("spacing", spacing);
9
- setContext("padding", padding);
10
- setContext("rounded", rounded);
11
- const cBase = "rounded-container-token";
12
- let elemAccordian;
13
- onMount(() => {
14
- if (collapse) {
15
- const details = Array.from(elemAccordian.querySelectorAll("details"));
16
- details.forEach((detail) => {
17
- detail.addEventListener("click", (e) => {
18
- const active = details.find((d) => d.open);
19
- if (!e.currentTarget.open && active)
20
- active.open = false;
21
- });
22
- });
23
- }
24
- });
25
- $:
26
- classesBase = `${cBase} ${spacing} ${$$props.class ?? ""}`;
27
- </script>
28
-
29
- <!-- @component The Accordion parent element. -->
30
-
31
- <div bind:this={elemAccordian} class="accordion-group {classesBase}" data-testid="accordion-group">
32
- <slot />
33
- </div>
@@ -1,24 +0,0 @@
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 {};
@@ -1,33 +0,0 @@
1
- <script context="module">
2
- import { icons } from './icons';
3
- </script>
4
-
5
- <script>export let name = "placeholder";
6
- export let x = "0px";
7
- export let y = "0px";
8
- export let viewBox = icons[name].viewBox || "0 0 512 512";
9
- export let fill = "fill-current";
10
- export let width = "w-5";
11
- export let height = "h-5";
12
- export let title = "";
13
- const cBase = "inline-block outline-none";
14
- $:
15
- classesBase = `${cBase} ${fill} ${width} ${height}`;
16
- </script>
17
-
18
- <!-- prettier-ignore -->
19
- <svg
20
- xmlns="http://www.w3.org/2000/svg"
21
- {x} {y}
22
- {viewBox}
23
- class="svg-icon {classesBase} {$$props.class ?? ''}"
24
- focusable="false"
25
- data-testid="svg-icon"
26
- >
27
- {#if title}<title>{title}</title>{/if}
28
- {#if $$slots.default}
29
- <slot />
30
- {:else}
31
- <path d={icons[name].path} />
32
- {/if}
33
- </svg>
@@ -1,26 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- [x: string]: any;
5
- name?: string | undefined;
6
- x?: string | undefined;
7
- y?: string | undefined;
8
- viewBox?: string | undefined;
9
- fill?: string | undefined;
10
- width?: string | undefined;
11
- height?: string | undefined;
12
- title?: string | undefined;
13
- };
14
- events: {
15
- [evt: string]: CustomEvent<any>;
16
- };
17
- slots: {
18
- default: {};
19
- };
20
- };
21
- export type SvgIconProps = typeof __propDef.props;
22
- export type SvgIconEvents = typeof __propDef.events;
23
- export type SvgIconSlots = typeof __propDef.slots;
24
- export default class SvgIcon extends SvelteComponentTyped<SvgIconProps, SvgIconEvents, SvgIconSlots> {
25
- }
26
- export {};
@@ -1 +0,0 @@
1
- export declare const icons: any;
@@ -1,25 +0,0 @@
1
- /*
2
- Font Awesome @fontawesome - https://fontawesome.com
3
- License - https://fontawesome.com/license (Commercial License)
4
- Copyright 2022 Fonticons, Inc
5
- */
6
- export const icons = {
7
- // Default Placeholder
8
- // Source: https://fontawesome.com/icons/image?s=solid
9
- placeholder: {
10
- path: 'M0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96z'
11
- },
12
- // ----------- Brand Logos -----------
13
- // Svelte
14
- // Source: https://iconape.com/svelte-logo-by-gengns-logo-icon-svg-png.html
15
- svelte: {
16
- viewBox: `0 0 513.978 597.129`,
17
- path: 'M179.547 545.729c-63.418-10.114-114.409-57.647-126.738-118.147-6.814-33.436-1.056-69.7 15.357-96.718l3.628-5.972-4.271-9.908c-24.281-56.32-9.106-121.877 36.892-159.376 10.666-8.695 132.771-86.226 145.148-92.162 21.395-10.261 41.161-14.203 66.834-13.328 18.527.631 27.235 2.147 43.648 7.597 51.619 17.139 90.63 60.248 101.124 111.747 6.814 33.436 1.056 69.7-15.357 96.719l-3.628 5.972 4.272 9.907c24.28 56.32 9.105 121.877-36.893 159.376-10.665 8.696-132.77 86.227-145.148 92.163-12.055 5.781-25.266 9.867-39.22 12.13-11.505 1.867-33.943 1.866-45.648 0zm40.107-56.452c8.462-1.864 18.23-5.676 24.437-9.538 35.719-22.223 123.574-78.887 127.592-82.293 12.127-10.28 21.731-25.243 26.045-40.577 3.4-12.09 3.396-31.504-.01-43.495-13.838-48.709-63.665-77.61-112.356-65.171-10.868 2.776-18.714 6.93-45.78 24.232-13.075 8.359-25.352 15.857-27.283 16.664-4.16 1.738-13.889 1.925-18.096.347-17.67-6.628-23.849-28.21-11.645-40.68 5.378-5.494 122.039-79.894 127.75-81.47 9.037-2.496 20.352 1.013 26.744 8.293 4.882 5.56 6.727 10.52 6.695 17.99l-.029 6.446 4.904 1.306c12.307 3.278 34.058 14.246 45.35 22.869 2.72 2.076 5.285 3.775 5.7 3.775 1.288 0 5.255-14.95 6.4-24.12 3.407-27.296-9.063-57.132-31.933-76.408-26.294-22.162-62.304-28-94.067-15.252-6.577 2.64-.2-1.29-74.004 45.59-55.791 35.438-59.99 38.319-68.987 47.332-10.858 10.879-16.752 20.816-20.829 35.118-3.414 11.98-3.41 31.399.01 43.435 13.837 48.71 63.663 77.611 112.355 65.171 10.824-2.765 18.631-6.896 45.876-24.271 13.128-8.373 25.406-15.869 27.283-16.657 4.071-1.71 13.823-1.88 18-.314 17.67 6.628 23.848 28.21 11.644 40.679-5.378 5.494-122.038 79.894-127.749 81.47-9.037 2.496-20.352-1.013-26.744-8.293-4.883-5.56-6.728-10.52-6.695-17.99l.028-6.446-4.904-1.306c-12.306-3.278-34.057-14.246-45.35-22.868-2.72-2.077-5.284-3.776-5.699-3.776-1.288 0-5.255 14.95-6.4 24.121-4.265 34.178 16.128 70.808 48.833 87.712 20.186 10.434 40.992 13.203 62.915 8.375z'
18
- },
19
- // Tailwind
20
- // Source: https://worldvectorlogo.com/logo/tailwind-css-2
21
- tailwind: {
22
- viewBox: `0.15 0.13 799.7 479.69`,
23
- path: 'M400 .13c-106.63 0-173.27 53.3-199.93 159.89 39.99-53.3 86.64-73.28 139.95-59.96 30.42 7.6 52.16 29.67 76.23 54.09 39.2 39.78 84.57 85.82 183.68 85.82 106.62 0 173.27-53.3 199.92-159.9-39.98 53.3-86.63 73.29-139.95 59.97-30.41-7.6-52.15-29.67-76.22-54.09C544.48 46.17 499.1.13 400 .13zM200.07 239.97c-106.62 0-173.27 53.3-199.92 159.9 39.98-53.3 86.63-73.29 139.95-59.96 30.41 7.61 52.15 29.67 76.22 54.08 39.2 39.78 84.58 85.83 183.68 85.83 106.63 0 173.27-53.3 199.93-159.9-39.99 53.3-86.64 73.29-139.95 59.96-30.42-7.59-52.16-29.67-76.23-54.08-39.2-39.78-84.57-85.83-183.68-85.83z'
24
- }
25
- };
@@ -1,29 +0,0 @@
1
- /* Tailwind Elements: menus.css */
2
-
3
- [data-menu] {
4
- @apply absolute z-20 hidden;
5
- }
6
- [data-menu] a {
7
- @apply focus-visible:bg-primary-500/10;
8
- }
9
-
10
- :root {
11
- --menu-offset: 8px;
12
- }
13
-
14
- @layer components {
15
- /* === Origins === */
16
-
17
- .menu-tl {
18
- @apply mt-[var(--menu-offset)] left-0 origin-top-left;
19
- }
20
- .menu-tr {
21
- @apply mt-[var(--menu-offset)] right-0 origin-top-right;
22
- }
23
- .menu-bl {
24
- @apply top-0 left-0 origin-bottom-left -translate-y-[calc(100%+var(--menu-offset))];
25
- }
26
- .menu-br {
27
- @apply top-0 right-0 origin-bottom-right -translate-y-[calc(100%+var(--menu-offset))];
28
- }
29
- }
@@ -1,83 +0,0 @@
1
- /* Tailwind Elements: tooltips.css */
2
-
3
- /* FIXME: adding @layer components causes visual strobing effect bug */
4
-
5
- :root {
6
- --tooltip-offset: 8px;
7
- }
8
-
9
- .tooltip {
10
- @apply text-center origin-center absolute z-[45] opacity-0 transition-opacity duration-150;
11
- /* Base Design */
12
- @apply bg-primary-500 w-48 p-2 shadow-xl;
13
- /* Theme: Rounded */
14
- @apply rounded-container-token;
15
- }
16
-
17
- /* === Positions === */
18
- /* Set based on the action param 'position' */
19
-
20
- .tooltip-top {
21
- @apply top-0;
22
- /* Center Horz */
23
- @apply left-[50%] -translate-x-[50%];
24
- /* Offset Y */
25
- @apply -translate-y-[calc(100%+var(--tooltip-offset))];
26
- }
27
-
28
- .tooltip-bottom {
29
- @apply bottom-0;
30
- /* Center Horz */
31
- @apply left-[50%] -translate-x-[50%];
32
- /* Offset Y */
33
- @apply translate-y-[calc(100%+var(--tooltip-offset))];
34
- }
35
-
36
- .tooltip-left {
37
- @apply left-0;
38
- /* Center Vert */
39
- @apply top-[50%] -translate-y-[50%];
40
- /* Offset X */
41
- @apply -translate-x-[calc(100%+var(--tooltip-offset))];
42
- }
43
-
44
- .tooltip-right {
45
- @apply right-0;
46
- /* Center Vert */
47
- @apply top-[50%] -translate-y-[50%];
48
- /* Offset X */
49
- @apply translate-x-[calc(100%+var(--tooltip-offset))];
50
- }
51
-
52
- /* === Arrow === */
53
- /* Set based on the action param 'position' */
54
-
55
- .tooltip-arrow {
56
- @apply absolute h-2 w-2 -rotate-45 origin-center;
57
- /* Base Design */
58
- @apply bg-primary-500;
59
- }
60
-
61
- .tooltip-arrow-top {
62
- @apply tooltip-arrow;
63
- /* Bottom side, center horz */
64
- @apply bottom-0 left-0 right-0 mx-auto translate-y-[50%];
65
- }
66
-
67
- .tooltip-arrow-bottom {
68
- @apply tooltip-arrow;
69
- /* Top side, centered horz */
70
- @apply top-0 left-0 right-0 mx-auto translate-y-[-50%];
71
- }
72
-
73
- .tooltip-arrow-left {
74
- @apply tooltip-arrow;
75
- /* Right size, centered vert */
76
- @apply top-0 bottom-0 right-0 my-auto translate-x-[50%];
77
- }
78
-
79
- .tooltip-arrow-right {
80
- @apply tooltip-arrow;
81
- /* Left size, centered vert */
82
- @apply top-0 bottom-0 left-0 my-auto translate-x-[-50%];
83
- }
package/styles/forms.css DELETED
@@ -1,195 +0,0 @@
1
- /* Stylesheet: forms.css */
2
-
3
- @layer base {
4
- fieldset {
5
- @apply block;
6
- }
7
-
8
- /* === Labels === */
9
-
10
- legend {
11
- @apply font-heading-token text-xl md:text-2xl;
12
- }
13
-
14
- label {
15
- @apply block overflow-visible;
16
- }
17
- .input-label {
18
- @apply space-y-2;
19
- }
20
-
21
- /* === Inputs === */
22
-
23
- .input-cell {
24
- @apply w-full rounded-token;
25
- /* Background */
26
- @apply bg-surface-200-700-token focus:brightness-105 hover:brightness-105;
27
- /* Border */
28
- @apply ring-0 border-token border-surface-400-500-token focus:border-primary-500;
29
- /* Transition */
30
- @apply transition;
31
- }
32
-
33
- /* Input Groups */
34
- .input-group {
35
- @apply input-cell;
36
- @apply overflow-hidden grid focus-within:border-primary-500;
37
- }
38
- .input-group input,
39
- .input-group select {
40
- @apply bg-transparent border-0 !ring-0;
41
- }
42
- .input-group div,
43
- .input-group button,
44
- .input-group a {
45
- @apply p-4 py-2 place-self-center;
46
- }
47
- .input-group-divider * + * {
48
- @apply !border-l border-surface-400-500-token focus:border-surface-400-500-token;
49
- }
50
- .input-group-shim {
51
- @apply bg-surface-400/10 text-surface-600-300-token;
52
- }
53
-
54
- /* Apply the input styles by default, but exclude if wrapped in `.input-group` */
55
- input:not([type='checkbox']):not([type='radio']):not([type='color']):not(.unstyled):is(:not(.input-group *)),
56
- select[multiple]:not(.unstyled):is(:not(.input-group *)),
57
- textarea:not(.unstyled):is(:not(.input-group *)),
58
- select:not(.unstyled):is(:not(.input-group *)) {
59
- @apply input-cell;
60
- }
61
-
62
- /* Container Inputs */
63
- select[multiple]:not(.unstyled):is(:not(.input-group *)),
64
- textarea:not(.unstyled):is(:not(.input-group *)) {
65
- @apply rounded-container-token;
66
- }
67
-
68
- /* Select (multipe) */
69
- /* https://stackoverflow.com/questions/50618602/change-color-of-selected-option-in-select-multiple */
70
- select[multiple]:not(.unstyled):is(:not(.input-group *)) {
71
- @apply p-2 space-y-1;
72
- }
73
- select[multiple]:not(.unstyled):is(:not(.input-group *)) option {
74
- @apply p-2 rounded-token;
75
- }
76
- select[multiple]:not(.unstyled):is(:not(.input-group *)) option:checked {
77
- background: rgb(var(--color-primary-500)) linear-gradient(0deg, rgb(var(--color-primary-500)) 0%, rgb(var(--color-primary-500)) 100%);
78
- @apply text-on-primary-token;
79
- }
80
-
81
- /* File Input */
82
- [type='file']:not(.unstyled):is(:not(.input-group *)) {
83
- @apply p-1;
84
- }
85
-
86
- /* Checkbox & Radio */
87
- [type='checkbox']:not(.unstyled):is(:not(.input-group *)),
88
- [type='radio']:not(.unstyled):is(:not(.input-group *)) {
89
- @apply rounded text-secondary-600 focus:ring-secondary-500 w-5 h-5 cursor-pointer;
90
- }
91
- [type='radio']:not(.unstyled):is(:not(.input-group *)) {
92
- @apply rounded-token;
93
- }
94
-
95
- /* Color Picker */
96
- /* https://stackoverflow.com/questions/11167281/webkit-css-to-control-the-box-around-the-color-in-an-inputtype-color */
97
- input[type='color']:not(.unstyled):is(:not(.input-group *)) {
98
- @apply border-none w-10 h-10 overflow-hidden rounded-token cursor-pointer;
99
- /* WebKit Only */
100
- -webkit-appearance: none;
101
- }
102
- input[type='color']:not(.unstyled):is(:not(.input-group *))::-webkit-color-swatch-wrapper {
103
- @apply p-0;
104
- }
105
- input[type='color']:not(.unstyled):is(:not(.input-group *))::-webkit-color-swatch {
106
- @apply border-none hover:brightness-110;
107
- }
108
- input[type='color']:not(.unstyled):is(:not(.input-group *))::-moz-color-swatch {
109
- @apply border-none;
110
- }
111
-
112
- /* === Placeholder === */
113
-
114
- ::-moz-placeholder {
115
- @apply text-surface-500-400-token;
116
- }
117
- :-ms-input-placeholder {
118
- @apply text-surface-500-400-token;
119
- }
120
- ::placeholder {
121
- @apply text-surface-500-400-token;
122
- }
123
-
124
- /* === Accent Color === */
125
- /* https://developer.mozilla.org/en-US/docs/Web/CSS/accent-color */
126
-
127
- [type='range']:not(.range-input) {
128
- @apply w-full accent-secondary-500;
129
- }
130
-
131
- /* === States === */
132
-
133
- input:disabled,
134
- textarea:disabled,
135
- select:disabled {
136
- @apply !opacity-50 !cursor-not-allowed hover:!brightness-100;
137
- }
138
-
139
- input[readonly],
140
- textarea[readonly],
141
- select[readonly] {
142
- @apply !border-0 !cursor-not-allowed hover:!brightness-100;
143
- }
144
-
145
- /* === Vendor-Specific === */
146
-
147
- /* Date Calendar Picker (Webkit) */
148
- ::-webkit-calendar-picker-indicator {
149
- @apply dark:invert;
150
- }
151
-
152
- /* === Utility Classes === */
153
-
154
- /* success */
155
- .input-success {
156
- @apply !bg-success-200 !border-success-500 !text-success-700;
157
- }
158
- .input-success::-moz-placeholder {
159
- @apply text-success-700;
160
- }
161
- .input-success:-ms-input-placeholder {
162
- @apply text-success-700;
163
- }
164
- .input-success::placeholder {
165
- @apply text-success-700;
166
- }
167
-
168
- /* warning */
169
- .input-warning {
170
- @apply !bg-warning-200 !border-warning-500 !text-warning-700;
171
- }
172
- .input-warning::-moz-placeholder {
173
- @apply text-warning-700;
174
- }
175
- .input-warning:-ms-input-placeholder {
176
- @apply text-warning-700;
177
- }
178
- .input-warning::placeholder {
179
- @apply text-warning-700;
180
- }
181
-
182
- /* error */
183
- .input-error {
184
- @apply !bg-error-200 !border-error-500 !text-error-500;
185
- }
186
- .input-error::-moz-placeholder {
187
- @apply text-error-500;
188
- }
189
- .input-error:-ms-input-placeholder {
190
- @apply text-error-500;
191
- }
192
- .input-error::placeholder {
193
- @apply text-error-500;
194
- }
195
- }
@@ -1,2 +0,0 @@
1
- export declare const storePrefersDarkScheme: import("svelte/store").Writable<boolean>;
2
- export declare const storeLightSwitch: import("svelte/store").Writable<boolean | undefined>;
@@ -1,5 +0,0 @@
1
- import { localStorageStore } from '../LocalStorageStore/LocalStorageStore';
2
- // OS Prefers Dark Scheme - TRUE: dark | FALSE: light
3
- export const storePrefersDarkScheme = localStorageStore('storePrefersDarkScheme', false);
4
- // User Selected Mode - TRUE: dark | FALSE: light | undefined: use system preference
5
- export const storeLightSwitch = localStorageStore('storeLightSwitch', undefined);
@@ -1,18 +0,0 @@
1
- interface ArgsMenu {
2
- /** The value of 'x' from data-menu-[x] */
3
- menu: string;
4
- /** Origin - TRUE: fixed | FALSE: auto */
5
- fixed?: boolean;
6
- /** Clicks inside body will not close window */
7
- interactive?: boolean;
8
- /** Provide an optional callback function to handle open/close state changes. */
9
- state?: (e: {
10
- menu: string;
11
- state: boolean;
12
- }) => void;
13
- }
14
- export declare function menu(node: HTMLElement, args: ArgsMenu): {
15
- update: (newArgs: ArgsMenu) => void;
16
- destroy: () => void;
17
- } | undefined;
18
- export {};