@getmicdrop/svelte-components 5.6.0 → 5.6.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.
Files changed (77) hide show
  1. package/dist/components/Layout/__tests__/AppShell.test.d.ts +2 -0
  2. package/dist/components/Layout/__tests__/AppShell.test.d.ts.map +1 -0
  3. package/dist/components/Layout/__tests__/AppShell.test.js +95 -0
  4. package/dist/components/Layout/__tests__/ContentSection.test.d.ts +2 -0
  5. package/dist/components/Layout/__tests__/ContentSection.test.d.ts.map +1 -0
  6. package/dist/components/Layout/__tests__/ContentSection.test.js +112 -0
  7. package/dist/components/Layout/__tests__/PageContainer.test.d.ts +2 -0
  8. package/dist/components/Layout/__tests__/PageContainer.test.d.ts.map +1 -0
  9. package/dist/components/Layout/__tests__/PageContainer.test.js +133 -0
  10. package/dist/components/Layout/__tests__/Responsive.test.d.ts +2 -0
  11. package/dist/components/Layout/__tests__/Responsive.test.d.ts.map +1 -0
  12. package/dist/components/Layout/__tests__/Responsive.test.js +123 -0
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.js +41 -40
  15. package/dist/patterns/navigation/BottomNav.svelte +18 -8
  16. package/dist/patterns/navigation/BottomNav.svelte.d.ts.map +1 -1
  17. package/dist/primitives/Accordion/AccordionItemWrapper.test.svelte +107 -107
  18. package/dist/primitives/Accordion/AccordionItemWrapper.test.svelte.d.ts +2 -2
  19. package/dist/primitives/Accordion/AccordionItemWrapper.test.svelte.d.ts.map +1 -1
  20. package/dist/primitives/Checkbox/Checkbox.svelte +3 -3
  21. package/dist/primitives/Dropdown/DropdownDivider.svelte +9 -0
  22. package/dist/primitives/Dropdown/DropdownDivider.svelte.d.ts +7 -0
  23. package/dist/primitives/Dropdown/DropdownDivider.svelte.d.ts.map +1 -0
  24. package/dist/primitives/Helper/Helper.svelte +33 -0
  25. package/dist/primitives/Helper/Helper.svelte.d.ts +18 -0
  26. package/dist/primitives/Helper/Helper.svelte.d.ts.map +1 -0
  27. package/dist/primitives/Input/Input.svelte +416 -417
  28. package/dist/primitives/Input/Input.svelte.d.ts +2 -4
  29. package/dist/primitives/Input/Input.svelte.d.ts.map +1 -1
  30. package/dist/primitives/Modal/Modal.svelte +157 -158
  31. package/dist/primitives/Modal/Modal.svelte.d.ts +6 -8
  32. package/dist/primitives/Modal/Modal.svelte.d.ts.map +1 -1
  33. package/dist/primitives/NumberInput/NumberInput.svelte +105 -106
  34. package/dist/primitives/NumberInput/NumberInput.svelte.d.ts +0 -2
  35. package/dist/primitives/NumberInput/NumberInput.svelte.d.ts.map +1 -1
  36. package/dist/primitives/Toggle.svelte +70 -71
  37. package/dist/primitives/Toggle.svelte.d.ts +2 -4
  38. package/dist/primitives/Toggle.svelte.d.ts.map +1 -1
  39. package/dist/primitives/Tooltip/Tooltip.svelte +83 -0
  40. package/dist/primitives/Tooltip/Tooltip.svelte.d.ts +15 -0
  41. package/dist/primitives/Tooltip/Tooltip.svelte.d.ts.map +1 -0
  42. package/dist/primitives/index.d.ts +3 -0
  43. package/dist/primitives/index.js +7 -0
  44. package/dist/recipes/ImageUploader/ImageUploader.spec.js +6 -5
  45. package/dist/recipes/inputs/MultiSelect.svelte +277 -256
  46. package/dist/recipes/inputs/MultiSelect.svelte.d.ts +54 -21
  47. package/dist/recipes/inputs/MultiSelect.svelte.d.ts.map +1 -1
  48. package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.spec.js +9 -4
  49. package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte +332 -327
  50. package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte.d.ts +12 -1
  51. package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte.d.ts.map +1 -1
  52. package/dist/stores/auth.js +8 -0
  53. package/dist/stores/auth.svelte.d.ts +39 -0
  54. package/dist/stores/auth.svelte.d.ts.map +1 -0
  55. package/dist/stores/auth.svelte.js +60 -0
  56. package/dist/stores/formDataStore.d.ts.map +1 -1
  57. package/dist/stores/formDataStore.js +8 -0
  58. package/dist/stores/formDataStore.svelte.d.ts +47 -0
  59. package/dist/stores/formDataStore.svelte.d.ts.map +1 -0
  60. package/dist/stores/formDataStore.svelte.js +84 -0
  61. package/dist/stores/formSave.d.ts.map +1 -1
  62. package/dist/stores/formSave.js +8 -0
  63. package/dist/stores/formSave.svelte.d.ts +33 -0
  64. package/dist/stores/formSave.svelte.d.ts.map +1 -0
  65. package/dist/stores/formSave.svelte.js +113 -0
  66. package/dist/stores/navigation.d.ts.map +1 -1
  67. package/dist/stores/navigation.js +8 -0
  68. package/dist/stores/navigation.svelte.d.ts +35 -0
  69. package/dist/stores/navigation.svelte.d.ts.map +1 -0
  70. package/dist/stores/navigation.svelte.js +69 -0
  71. package/dist/telemetry.server.spec.js +11 -8
  72. package/dist/telemetry.spec.js +75 -50
  73. package/dist/utils/imageValidation.spec.js +62 -59
  74. package/dist/utils/logger.d.ts +19 -0
  75. package/dist/utils/logger.d.ts.map +1 -0
  76. package/dist/utils/logger.js +47 -0
  77. package/package.json +296 -292
@@ -2,7 +2,6 @@ export default Input;
2
2
  type Input = {
3
3
  $on?(type: string, callback: (e: any) => void): () => void;
4
4
  $set?(props: Partial<{
5
- [key: string]: any;
6
5
  required?: boolean | undefined;
7
6
  disabled?: boolean | undefined;
8
7
  optional?: boolean | undefined;
@@ -48,11 +47,10 @@ type Input = {
48
47
  onfocus?: (() => void) | undefined;
49
48
  onblur?: (() => void) | undefined;
50
49
  oninputchange?: ((value: string) => void) | undefined;
51
- leftIcon?: any;
50
+ leftIcon?: Snippet<[]> | undefined;
52
51
  }>): void;
53
52
  };
54
53
  declare const Input: import("svelte").Component<{
55
- [key: string]: any;
56
54
  required?: boolean;
57
55
  disabled?: boolean;
58
56
  optional?: boolean;
@@ -98,6 +96,6 @@ declare const Input: import("svelte").Component<{
98
96
  onfocus?: () => void;
99
97
  onblur?: () => void;
100
98
  oninputchange?: (value: string) => void;
101
- leftIcon?: any;
99
+ leftIcon?: import("svelte").Snippet;
102
100
  }, {}, "value">;
103
101
  //# sourceMappingURL=Input.svelte.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Input/Input.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmZA;;eA9Ce,OAAO;eACP,OAAO;eACP,OAAO;WACX,MAAM,GAAG,IAAI;iBACP,MAAM,GAAG,IAAI;iBACb,MAAM,GAAG,IAAI;gBACd,MAAM,GAAG,IAAI;gBACb,MAAM,GAAG,IAAI;WAClB,MAAM;kBACC,MAAM;YACZ,MAAM;SACT,MAAM;WACJ,MAAM;gBACD,MAAM;WACX,IAAI,GAAG,IAAI,GAAG,IAAI;mBACV,MAAM;gBACT,MAAM;YACV,MAAM,GAAG,KAAK;iBACT,MAAM;iBACN,MAAM;eACR,MAAM;eACN,MAAM;mBACF,MAAM;eACV,OAAO;iBACL,OAAO;oBACJ,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI;YACxC,MAAM,GAAG,MAAM,GAAG,IAAI;mBACf,MAAM,GAAG,IAAI;gBAChB,OAAO;yBACE,OAAO;mBACb,OAAO;iBACT,MAAM;iBACN,MAAM;qBACF,OAAO;gBACZ,MAAM,GAAG,IAAI;oBACT,OAAO;iBACV,MAAM;qBACF,MAAM;sBACL,OAAO;eACd,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;cACpC,MAAM,IAAI;aACX,MAAM,IAAI;oBACH,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;eAC5B,GAAG;gBAGkC"}
1
+ {"version":3,"file":"Input.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Input/Input.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiZA;eA7Ce,OAAO;eACP,OAAO;eACP,OAAO;WACX,MAAM,GAAG,IAAI;iBACP,MAAM,GAAG,IAAI;iBACb,MAAM,GAAG,IAAI;gBACd,MAAM,GAAG,IAAI;gBACb,MAAM,GAAG,IAAI;WAClB,MAAM;kBACC,MAAM;YACZ,MAAM;SACT,MAAM;WACJ,MAAM;gBACD,MAAM;WACX,IAAI,GAAG,IAAI,GAAG,IAAI;mBACV,MAAM;gBACT,MAAM;YACV,MAAM,GAAG,KAAK;iBACT,MAAM;iBACN,MAAM;eACR,MAAM;eACN,MAAM;mBACF,MAAM;eACV,OAAO;iBACL,OAAO;oBACJ,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI;YACxC,MAAM,GAAG,MAAM,GAAG,IAAI;mBACf,MAAM,GAAG,IAAI;gBAChB,OAAO;yBACE,OAAO;mBACb,OAAO;iBACT,MAAM;iBACN,MAAM;qBACF,OAAO;gBACZ,MAAM,GAAG,IAAI;oBACT,OAAO;iBACV,MAAM;qBACF,MAAM;sBACL,OAAO;eACd,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;cACpC,MAAM,IAAI;aACX,MAAM,IAAI;oBACH,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;eAC5B,OAAO,QAAQ,EAAE,OAAO;gBAEa"}
@@ -1,158 +1,157 @@
1
- <script>
2
- /**
3
- * Modal Component - Flowbite Native
4
- * Migrated to Svelte 5 runes
5
- */
6
- import { onDestroy } from "svelte";
7
- import { fade, fly } from "svelte/transition";
8
- import { cubicOut } from "svelte/easing";
9
- import { portal } from "../../utils/portal.js";
10
-
11
- /** @type {{
12
- show?: boolean,
13
- isProcessing?: boolean,
14
- isSuccess?: boolean,
15
- size?: 'default' | 'small' | 'large' | 'xlarge',
16
- persistent?: boolean,
17
- oncancel?: () => void,
18
- header?: any,
19
- body?: any,
20
- footer?: any,
21
- class?: string,
22
- [key: string]: any
23
- }} */
24
- let {
25
- show = $bindable(false),
26
- isProcessing = false,
27
- isSuccess = false,
28
- size = "default",
29
- persistent = false,
30
- oncancel,
31
- header,
32
- body,
33
- footer,
34
- class: _className,
35
- ...restProps
36
- } = $props();
37
-
38
- // Store scroll position for iOS scroll lock
39
- let scrollY = $state(0);
40
-
41
- // Handle escape key
42
- function handleKeydown(event) {
43
- if (event.key === "Escape" && show && !persistent) {
44
- resetModal();
45
- }
46
- }
47
-
48
- const resetModal = () => {
49
- oncancel?.();
50
- show = false;
51
- };
52
-
53
- // Size classes for desktop modal (Tailwind scale)
54
- const sizeClasses = {
55
- default: "max-w-md",
56
- small: "max-w-sm",
57
- large: "max-w-xl",
58
- xlarge: "max-w-2xl"
59
- };
60
-
61
- let modalSizeClass = $derived(sizeClasses[size] || sizeClasses.default);
62
-
63
- // iOS-compatible scroll lock using position:fixed approach
64
- $effect(() => {
65
- if (typeof document !== "undefined") {
66
- if (show) {
67
- scrollY = window.scrollY;
68
- document.body.style.position = "fixed";
69
- document.body.style.top = `-${scrollY}px`;
70
- document.body.style.left = "0";
71
- document.body.style.right = "0";
72
- document.body.style.overflow = "hidden";
73
- } else {
74
- document.body.style.position = "";
75
- document.body.style.top = "";
76
- document.body.style.left = "";
77
- document.body.style.right = "";
78
- document.body.style.overflow = "";
79
- window.scrollTo(0, scrollY);
80
- }
81
- }
82
- });
83
-
84
- onDestroy(() => {
85
- if (typeof document !== "undefined") {
86
- document.body.style.position = "";
87
- document.body.style.top = "";
88
- document.body.style.left = "";
89
- document.body.style.right = "";
90
- document.body.style.overflow = "";
91
- }
92
- });
93
- </script>
94
-
95
- <svelte:window onkeydown={handleKeydown} />
96
-
97
- {#if show}
98
- <!-- svelte-ignore a11y_click_events_have_key_events -->
99
- <!-- svelte-ignore a11y_no_static_element_interactions -->
100
- <div
101
- class="fixed inset-0 flex bg-black/50 z-50 items-end justify-center md:items-center md:p-4 touch-none overscroll-none"
102
- onmousedown={(e) => {
103
- // Only track direct clicks on backdrop, not drags that end on backdrop
104
- if (e.target === e.currentTarget && !persistent) {
105
- e.currentTarget.dataset.clickStartedOnBackdrop = 'true';
106
- }
107
- }}
108
- onmouseup={(e) => {
109
- // Only close if both mousedown and mouseup were on the backdrop
110
- if (e.target === e.currentTarget && e.currentTarget.dataset.clickStartedOnBackdrop === 'true' && !persistent) {
111
- resetModal();
112
- }
113
- delete e.currentTarget.dataset.clickStartedOnBackdrop;
114
- }}
115
- transition:fade={{ duration: 300 }}
116
- role="dialog"
117
- aria-modal="true"
118
- use:portal
119
- {...restProps}
120
- >
121
- <!-- Mobile: Bottom sheet -->
122
- <!-- svelte-ignore a11y_click_events_have_key_events -->
123
- <!-- svelte-ignore a11y_no_static_element_interactions -->
124
- <div
125
- class="md:hidden bg-white dark:bg-gray-800 rounded-t-3xl w-full max-h-[90vh] max-h-[90dvh] overflow-hidden flex flex-col shadow-[0_-10px_40px_rgba(0,0,0,0.15)] touch-pan-y overscroll-contain"
126
- onclick={(e) => e.stopPropagation()}
127
- transition:fly={{ y: 300, duration: 300, easing: cubicOut }}
128
- >
129
- <!-- Handle bar -->
130
- <div class="flex justify-center pt-3 pb-1 shrink-0">
131
- <div class="w-10 h-1 bg-gray-300 dark:bg-gray-600 rounded-sm"></div>
132
- </div>
133
-
134
- <div class="p-6 pb-[calc(5rem+env(safe-area-inset-bottom,0px))] overflow-y-auto flex-1">
135
- {#if header}{@render header()}{/if}
136
- {#if body}{@render body()}{/if}
137
- <div class="w-full flex flex-col gap-3 mt-6 empty:hidden empty:mt-0">
138
- {#if footer}{@render footer()}{/if}
139
- </div>
140
- </div>
141
- </div>
142
-
143
- <!-- Desktop: Centered modal -->
144
- <!-- svelte-ignore a11y_click_events_have_key_events -->
145
- <!-- svelte-ignore a11y_no_static_element_interactions -->
146
- <div
147
- class="hidden md:block bg-white dark:bg-gray-800 p-6 rounded-lg {modalSizeClass} w-full max-h-[calc(100vh-4rem)] overflow-y-auto shadow-2xl"
148
- onclick={(e) => e.stopPropagation()}
149
- transition:fly={{ y: 20, duration: 200 }}
150
- >
151
- {#if header}{@render header()}{/if}
152
- {#if body}{@render body()}{/if}
153
- <div class="w-full flex flex-col md:flex-row md:justify-end gap-3 mt-6 empty:hidden empty:mt-0">
154
- {#if footer}{@render footer()}{/if}
155
- </div>
156
- </div>
157
- </div>
158
- {/if}
1
+ <script>
2
+ /**
3
+ * Modal Component - Flowbite Native
4
+ * Migrated to Svelte 5 runes
5
+ */
6
+ import { onDestroy } from "svelte";
7
+ import { fade, fly } from "svelte/transition";
8
+ import { cubicOut } from "svelte/easing";
9
+ import { portal } from "../../utils/portal.js";
10
+
11
+ /** @type {{
12
+ show?: boolean,
13
+ isProcessing?: boolean,
14
+ isSuccess?: boolean,
15
+ size?: 'default' | 'small' | 'large' | 'xlarge',
16
+ persistent?: boolean,
17
+ oncancel?: () => void,
18
+ header?: import('svelte').Snippet,
19
+ body?: import('svelte').Snippet,
20
+ footer?: import('svelte').Snippet,
21
+ class?: string,
22
+ }} */
23
+ let {
24
+ show = $bindable(false),
25
+ isProcessing = false,
26
+ isSuccess = false,
27
+ size = "default",
28
+ persistent = false,
29
+ oncancel,
30
+ header,
31
+ body,
32
+ footer,
33
+ class: _className,
34
+ ...restProps
35
+ } = $props();
36
+
37
+ // Store scroll position for iOS scroll lock
38
+ let scrollY = $state(0);
39
+
40
+ // Handle escape key
41
+ function handleKeydown(event) {
42
+ if (event.key === "Escape" && show && !persistent) {
43
+ resetModal();
44
+ }
45
+ }
46
+
47
+ const resetModal = () => {
48
+ oncancel?.();
49
+ show = false;
50
+ };
51
+
52
+ // Size classes for desktop modal (Tailwind scale)
53
+ const sizeClasses = {
54
+ default: "max-w-md",
55
+ small: "max-w-sm",
56
+ large: "max-w-xl",
57
+ xlarge: "max-w-2xl"
58
+ };
59
+
60
+ let modalSizeClass = $derived(sizeClasses[size] || sizeClasses.default);
61
+
62
+ // iOS-compatible scroll lock using position:fixed approach
63
+ $effect(() => {
64
+ if (typeof document !== "undefined") {
65
+ if (show) {
66
+ scrollY = window.scrollY;
67
+ document.body.style.position = "fixed";
68
+ document.body.style.top = `-${scrollY}px`;
69
+ document.body.style.left = "0";
70
+ document.body.style.right = "0";
71
+ document.body.style.overflow = "hidden";
72
+ } else {
73
+ document.body.style.position = "";
74
+ document.body.style.top = "";
75
+ document.body.style.left = "";
76
+ document.body.style.right = "";
77
+ document.body.style.overflow = "";
78
+ window.scrollTo(0, scrollY);
79
+ }
80
+ }
81
+ });
82
+
83
+ onDestroy(() => {
84
+ if (typeof document !== "undefined") {
85
+ document.body.style.position = "";
86
+ document.body.style.top = "";
87
+ document.body.style.left = "";
88
+ document.body.style.right = "";
89
+ document.body.style.overflow = "";
90
+ }
91
+ });
92
+ </script>
93
+
94
+ <svelte:window onkeydown={handleKeydown} />
95
+
96
+ {#if show}
97
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
98
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
99
+ <div
100
+ class="fixed inset-0 flex bg-black/50 z-50 items-end justify-center md:items-center md:p-4 touch-none overscroll-none"
101
+ onmousedown={(e) => {
102
+ // Only track direct clicks on backdrop, not drags that end on backdrop
103
+ if (e.target === e.currentTarget && !persistent) {
104
+ e.currentTarget.dataset.clickStartedOnBackdrop = 'true';
105
+ }
106
+ }}
107
+ onmouseup={(e) => {
108
+ // Only close if both mousedown and mouseup were on the backdrop
109
+ if (e.target === e.currentTarget && e.currentTarget.dataset.clickStartedOnBackdrop === 'true' && !persistent) {
110
+ resetModal();
111
+ }
112
+ delete e.currentTarget.dataset.clickStartedOnBackdrop;
113
+ }}
114
+ transition:fade={{ duration: 300 }}
115
+ role="dialog"
116
+ aria-modal="true"
117
+ use:portal
118
+ {...restProps}
119
+ >
120
+ <!-- Mobile: Bottom sheet -->
121
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
122
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
123
+ <div
124
+ class="md:hidden bg-white dark:bg-gray-800 rounded-t-3xl w-full max-h-[90vh] max-h-[90dvh] overflow-hidden flex flex-col shadow-[0_-10px_40px_rgba(0,0,0,0.15)] touch-pan-y overscroll-contain"
125
+ onclick={(e) => e.stopPropagation()}
126
+ transition:fly={{ y: 300, duration: 300, easing: cubicOut }}
127
+ >
128
+ <!-- Handle bar -->
129
+ <div class="flex justify-center pt-3 pb-1 shrink-0">
130
+ <div class="w-10 h-1 bg-gray-300 dark:bg-gray-600 rounded-sm"></div>
131
+ </div>
132
+
133
+ <div class="p-6 pb-[calc(5rem+env(safe-area-inset-bottom,0px))] overflow-y-auto flex-1">
134
+ {#if header}{@render header()}{/if}
135
+ {#if body}{@render body()}{/if}
136
+ <div class="w-full flex flex-col gap-3 mt-6 empty:hidden empty:mt-0">
137
+ {#if footer}{@render footer()}{/if}
138
+ </div>
139
+ </div>
140
+ </div>
141
+
142
+ <!-- Desktop: Centered modal -->
143
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
144
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
145
+ <div
146
+ class="hidden md:block bg-white dark:bg-gray-800 p-6 rounded-lg {modalSizeClass} w-full max-h-[calc(100vh-4rem)] overflow-y-auto shadow-2xl"
147
+ onclick={(e) => e.stopPropagation()}
148
+ transition:fly={{ y: 20, duration: 200 }}
149
+ >
150
+ {#if header}{@render header()}{/if}
151
+ {#if body}{@render body()}{/if}
152
+ <div class="w-full flex flex-col md:flex-row md:justify-end gap-3 mt-6 empty:hidden empty:mt-0">
153
+ {#if footer}{@render footer()}{/if}
154
+ </div>
155
+ </div>
156
+ </div>
157
+ {/if}
@@ -2,30 +2,28 @@ export default Modal;
2
2
  type Modal = {
3
3
  $on?(type: string, callback: (e: any) => void): () => void;
4
4
  $set?(props: Partial<{
5
- [key: string]: any;
6
5
  show?: boolean | undefined;
7
6
  isProcessing?: boolean | undefined;
8
7
  isSuccess?: boolean | undefined;
9
8
  size?: "small" | "large" | "default" | "xlarge" | undefined;
10
9
  persistent?: boolean | undefined;
11
10
  oncancel?: (() => void) | undefined;
12
- header?: any;
13
- body?: any;
14
- footer?: any;
11
+ header?: Snippet<[]> | undefined;
12
+ body?: Snippet<[]> | undefined;
13
+ footer?: Snippet<[]> | undefined;
15
14
  class?: string | undefined;
16
15
  }>): void;
17
16
  };
18
17
  declare const Modal: import("svelte").Component<{
19
- [key: string]: any;
20
18
  show?: boolean;
21
19
  isProcessing?: boolean;
22
20
  isSuccess?: boolean;
23
21
  size?: "default" | "small" | "large" | "xlarge";
24
22
  persistent?: boolean;
25
23
  oncancel?: () => void;
26
- header?: any;
27
- body?: any;
28
- footer?: any;
24
+ header?: import("svelte").Snippet;
25
+ body?: import("svelte").Snippet;
26
+ footer?: import("svelte").Snippet;
29
27
  class?: string;
30
28
  }, {}, "show">;
31
29
  //# sourceMappingURL=Modal.svelte.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Modal/Modal.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAqKA;;WAZW,OAAO;mBACC,OAAO;gBACV,OAAO;WACZ,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ;iBAClC,OAAO;eACT,MAAM,IAAI;aACZ,GAAG;WACL,GAAG;aACD,GAAG;YACJ,MAAM;eAGkC"}
1
+ {"version":3,"file":"Modal.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Modal/Modal.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAmKA;WAXW,OAAO;mBACC,OAAO;gBACV,OAAO;WACZ,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ;iBAClC,OAAO;eACT,MAAM,IAAI;aACZ,OAAO,QAAQ,EAAE,OAAO;WAC1B,OAAO,QAAQ,EAAE,OAAO;aACtB,OAAO,QAAQ,EAAE,OAAO;YACzB,MAAM;eAEkC"}
@@ -1,106 +1,105 @@
1
- <script>
2
- /**
3
- * NumberInput Component - Flowbite Native (Pure Tailwind)
4
- * Quantity stepper with increment/decrement buttons
5
- *
6
- * Matches Figma design:
7
- * - Buttons: bg-gray-100, border-gray-300, outer corners rounded
8
- * - Display: bg-gray-50, border-gray-300
9
- * - Height: 37px
10
- * - Icons: 10x10px
11
- */
12
- import { twMerge } from 'tailwind-merge';
13
-
14
- /** @type {{
15
- value?: number,
16
- min?: number,
17
- max?: number,
18
- disabled?: boolean,
19
- onchange?: (value: number) => void,
20
- class?: string,
21
- [key: string]: any
22
- }} */
23
- let {
24
- value = 0,
25
- min = 0,
26
- max = Infinity,
27
- disabled = false,
28
- onchange,
29
- class: className = "",
30
- ...restProps
31
- } = $props();
32
-
33
- function increment() {
34
- if (value < max && !disabled) {
35
- const newValue = value + 1;
36
- onchange?.(newValue);
37
- }
38
- }
39
-
40
- function decrement() {
41
- if (value > min && !disabled) {
42
- const newValue = value - 1;
43
- onchange?.(newValue);
44
- }
45
- }
46
-
47
- let isMinDisabled = $derived(disabled || value <= min);
48
- let isMaxDisabled = $derived(disabled || value >= max);
49
-
50
- // Button base classes matching Figma spec
51
- const buttonBase = "h-[37px] px-3 flex items-center justify-center bg-gray-100 border border-gray-300 transition-colors dark:bg-gray-700 dark:border-gray-600";
52
- const buttonHover = "hover:bg-gray-200 dark:hover:bg-gray-600";
53
- const buttonDisabled = "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-gray-100 dark:disabled:hover:bg-gray-700";
54
-
55
- let decrementClasses = $derived(twMerge(
56
- buttonBase,
57
- buttonHover,
58
- buttonDisabled,
59
- "rounded-l-lg"
60
- ));
61
-
62
- let incrementClasses = $derived(twMerge(
63
- buttonBase,
64
- buttonHover,
65
- buttonDisabled,
66
- "rounded-r-lg"
67
- ));
68
-
69
- // Display classes matching Figma spec
70
- const displayClasses = "h-[37px] px-4 flex items-center justify-center text-gray-500 text-sm bg-gray-50 border-y border-gray-300 -mx-px dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600";
71
-
72
- let containerClasses = $derived(twMerge(
73
- "inline-flex items-center",
74
- className
75
- ));
76
- </script>
77
-
78
- <div class={containerClasses} {...restProps}>
79
- <button
80
- type="button"
81
- class={decrementClasses}
82
- onclick={decrement}
83
- disabled={isMinDisabled}
84
- aria-label="Decrease quantity"
85
- >
86
- <svg class="w-3 h-3 text-gray-800 dark:text-white" fill="none" viewBox="0 0 18 2">
87
- <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 1h16"/>
88
- </svg>
89
- </button>
90
-
91
- <span class={displayClasses}>
92
- {value}
93
- </span>
94
-
95
- <button
96
- type="button"
97
- class={incrementClasses}
98
- onclick={increment}
99
- disabled={isMaxDisabled}
100
- aria-label="Increase quantity"
101
- >
102
- <svg class="w-3 h-3 text-gray-800 dark:text-white" fill="none" viewBox="0 0 18 18">
103
- <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/>
104
- </svg>
105
- </button>
106
- </div>
1
+ <script>
2
+ /**
3
+ * NumberInput Component - Flowbite Native (Pure Tailwind)
4
+ * Quantity stepper with increment/decrement buttons
5
+ *
6
+ * Matches Figma design:
7
+ * - Buttons: bg-gray-100, border-gray-300, outer corners rounded
8
+ * - Display: bg-gray-50, border-gray-300
9
+ * - Height: 37px
10
+ * - Icons: 10x10px
11
+ */
12
+ import { twMerge } from 'tailwind-merge';
13
+
14
+ /** @type {{
15
+ value?: number,
16
+ min?: number,
17
+ max?: number,
18
+ disabled?: boolean,
19
+ onchange?: (value: number) => void,
20
+ class?: string,
21
+ }} */
22
+ let {
23
+ value = 0,
24
+ min = 0,
25
+ max = Infinity,
26
+ disabled = false,
27
+ onchange,
28
+ class: className = "",
29
+ ...restProps
30
+ } = $props();
31
+
32
+ function increment() {
33
+ if (value < max && !disabled) {
34
+ const newValue = value + 1;
35
+ onchange?.(newValue);
36
+ }
37
+ }
38
+
39
+ function decrement() {
40
+ if (value > min && !disabled) {
41
+ const newValue = value - 1;
42
+ onchange?.(newValue);
43
+ }
44
+ }
45
+
46
+ let isMinDisabled = $derived(disabled || value <= min);
47
+ let isMaxDisabled = $derived(disabled || value >= max);
48
+
49
+ // Button base classes matching Figma spec
50
+ const buttonBase = "h-[37px] px-3 flex items-center justify-center bg-gray-100 border border-gray-300 transition-colors dark:bg-gray-700 dark:border-gray-600";
51
+ const buttonHover = "hover:bg-gray-200 dark:hover:bg-gray-600";
52
+ const buttonDisabled = "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-gray-100 dark:disabled:hover:bg-gray-700";
53
+
54
+ let decrementClasses = $derived(twMerge(
55
+ buttonBase,
56
+ buttonHover,
57
+ buttonDisabled,
58
+ "rounded-l-lg"
59
+ ));
60
+
61
+ let incrementClasses = $derived(twMerge(
62
+ buttonBase,
63
+ buttonHover,
64
+ buttonDisabled,
65
+ "rounded-r-lg"
66
+ ));
67
+
68
+ // Display classes matching Figma spec
69
+ const displayClasses = "h-[37px] px-4 flex items-center justify-center text-gray-500 text-sm bg-gray-50 border-y border-gray-300 -mx-px dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600";
70
+
71
+ let containerClasses = $derived(twMerge(
72
+ "inline-flex items-center",
73
+ className
74
+ ));
75
+ </script>
76
+
77
+ <div class={containerClasses} {...restProps}>
78
+ <button
79
+ type="button"
80
+ class={decrementClasses}
81
+ onclick={decrement}
82
+ disabled={isMinDisabled}
83
+ aria-label="Decrease quantity"
84
+ >
85
+ <svg class="w-3 h-3 text-gray-800 dark:text-white" fill="none" viewBox="0 0 18 2">
86
+ <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 1h16"/>
87
+ </svg>
88
+ </button>
89
+
90
+ <span class={displayClasses}>
91
+ {value}
92
+ </span>
93
+
94
+ <button
95
+ type="button"
96
+ class={incrementClasses}
97
+ onclick={increment}
98
+ disabled={isMaxDisabled}
99
+ aria-label="Increase quantity"
100
+ >
101
+ <svg class="w-3 h-3 text-gray-800 dark:text-white" fill="none" viewBox="0 0 18 18">
102
+ <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/>
103
+ </svg>
104
+ </button>
105
+ </div>
@@ -2,7 +2,6 @@ export default NumberInput;
2
2
  type NumberInput = {
3
3
  $on?(type: string, callback: (e: any) => void): () => void;
4
4
  $set?(props: Partial<{
5
- [key: string]: any;
6
5
  value?: number | undefined;
7
6
  min?: number | undefined;
8
7
  max?: number | undefined;
@@ -12,7 +11,6 @@ type NumberInput = {
12
11
  }>): void;
13
12
  };
14
13
  declare const NumberInput: import("svelte").Component<{
15
- [key: string]: any;
16
14
  value?: number;
17
15
  min?: number;
18
16
  max?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/NumberInput/NumberInput.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;AA+GA;;YARY,MAAM;UACR,MAAM;UACN,MAAM;eACD,OAAO;eACP,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;YAC1B,MAAM;WAGwC"}
1
+ {"version":3,"file":"NumberInput.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/NumberInput/NumberInput.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;AA6GA;YAPY,MAAM;UACR,MAAM;UACN,MAAM;eACD,OAAO;eACP,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;YAC1B,MAAM;WAEwC"}