@getmicdrop/svelte-components 5.2.1 → 5.3.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.
- package/dist/index.d.ts +0 -2
- package/dist/index.js +2 -3
- package/dist/patterns/forms/FormValidationSummary.svelte +6 -4
- package/dist/patterns/forms/FormValidationSummary.svelte.d.ts.map +1 -1
- package/dist/patterns/navigation/Header.svelte +6 -11
- package/dist/patterns/navigation/Header.svelte.d.ts.map +1 -1
- package/dist/patterns/page/PageLoader.stories.svelte +4 -6
- package/dist/patterns/page/PageLoader.stories.svelte.d.ts +4 -24
- package/dist/patterns/page/PageLoader.stories.svelte.d.ts.map +1 -1
- package/dist/patterns/page/PageLoader.svelte +3 -5
- package/dist/patterns/page/PageLoader.svelte.d.ts.map +1 -1
- package/dist/primitives/BottomSheet/BottomSheet.stories.svelte +14 -15
- package/dist/primitives/BottomSheet/BottomSheet.stories.svelte.d.ts +4 -24
- package/dist/primitives/BottomSheet/BottomSheet.stories.svelte.d.ts.map +1 -1
- package/dist/primitives/Button/Button.svelte +25 -25
- package/dist/primitives/Button/Button.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/CheckOutline.svelte +1 -1
- package/dist/primitives/Modal/Modal.stories.svelte +23 -22
- package/dist/primitives/Modal/Modal.stories.svelte.d.ts +4 -24
- package/dist/primitives/Modal/Modal.stories.svelte.d.ts.map +1 -1
- package/dist/recipes/CropImage/CropImage.stories.svelte +6 -13
- package/dist/recipes/CropImage/CropImage.stories.svelte.d.ts +4 -24
- package/dist/recipes/CropImage/CropImage.stories.svelte.d.ts.map +1 -1
- package/dist/recipes/CropImage/CropImage.svelte +14 -13
- package/dist/recipes/CropImage/CropImage.svelte.d.ts.map +1 -1
- package/dist/recipes/SuperLogin/SuperLogin.svelte +29 -53
- package/dist/recipes/SuperLogin/SuperLogin.svelte.d.ts.map +1 -1
- package/dist/recipes/Toaster/Toaster.stories.svelte +3 -4
- package/dist/recipes/Toaster/Toaster.stories.svelte.d.ts.map +1 -1
- package/dist/recipes/feedback/ErrorDisplay.stories.svelte +2 -4
- package/dist/recipes/feedback/ErrorDisplay.stories.svelte.d.ts +4 -24
- package/dist/recipes/feedback/ErrorDisplay.stories.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/MultiSelect.stories.svelte +3 -5
- package/dist/recipes/inputs/MultiSelect.stories.svelte.d.ts +4 -24
- package/dist/recipes/inputs/MultiSelect.stories.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/OTPInput.stories.svelte +15 -17
- package/dist/recipes/inputs/OTPInput.stories.svelte.d.ts +4 -24
- package/dist/recipes/inputs/OTPInput.stories.svelte.d.ts.map +1 -1
- package/dist/recipes/modals/ConfirmationModal.svelte +2 -6
- package/dist/recipes/modals/InputModal.svelte +2 -6
- package/dist/recipes/modals/ModalTestWrapper.svelte +3 -2
- package/dist/recipes/modals/ModalTestWrapper.svelte.d.ts.map +1 -1
- package/dist/recipes/modals/StatusModal.svelte +2 -6
- package/dist/stories/ComponentConsolidation.stories.svelte +1227 -0
- package/dist/stories/ComponentConsolidation.stories.svelte.d.ts +27 -0
- package/dist/stories/ComponentConsolidation.stories.svelte.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
export default CropImage;
|
|
2
|
-
type CropImage =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
2
|
+
type CropImage = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Record<string, never>>): void;
|
|
8
5
|
};
|
|
9
|
-
declare const CropImage:
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
6
|
+
declare const CropImage: import("svelte").Component<Record<string, never>, {}, "">;
|
|
14
7
|
import CropImage from "./CropImage.svelte";
|
|
15
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
|
-
$$bindings?: Bindings;
|
|
18
|
-
} & Exports;
|
|
19
|
-
(internal: unknown, props: {
|
|
20
|
-
$$events?: Events;
|
|
21
|
-
$$slots?: Slots;
|
|
22
|
-
}): Exports & {
|
|
23
|
-
$set?: any;
|
|
24
|
-
$on?: any;
|
|
25
|
-
};
|
|
26
|
-
z_$$bindings?: Bindings;
|
|
27
|
-
}
|
|
28
8
|
//# sourceMappingURL=CropImage.stories.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CropImage.stories.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/CropImage/CropImage.stories.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CropImage.stories.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/CropImage/CropImage.stories.svelte.js"],"names":[],"mappings":";;;;;AAuFA,mFAAwD;sBAlFhC,oBAAoB"}
|
|
@@ -136,15 +136,14 @@
|
|
|
136
136
|
<h3 class="text-xl font-semibold text-gray-900 dark:text-white">
|
|
137
137
|
Crop image
|
|
138
138
|
</h3>
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
<Button
|
|
140
|
+
variant="icon"
|
|
141
|
+
size="sm"
|
|
142
142
|
onclick={closeModal}
|
|
143
143
|
aria-label="Close modal"
|
|
144
144
|
>
|
|
145
145
|
<CloseOutline class="w-3 h-3" />
|
|
146
|
-
|
|
147
|
-
</button>
|
|
146
|
+
</Button>
|
|
148
147
|
</div>
|
|
149
148
|
|
|
150
149
|
<div class="p-4 md:p-6 space-y-4">
|
|
@@ -171,14 +170,15 @@
|
|
|
171
170
|
</p>
|
|
172
171
|
|
|
173
172
|
<div class="flex items-center justify-center gap-3 max-w-xs mx-auto">
|
|
174
|
-
<
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
<Button
|
|
174
|
+
variant="outline"
|
|
175
|
+
size="sm"
|
|
176
|
+
class="!rounded-full !w-9 !h-9 !p-0 shrink-0"
|
|
177
177
|
onclick={() => (zoom = Math.max(1, zoom - 0.2))}
|
|
178
178
|
aria-label="Zoom out"
|
|
179
179
|
>
|
|
180
180
|
<MinusOutline class="w-4 h-4" />
|
|
181
|
-
</
|
|
181
|
+
</Button>
|
|
182
182
|
|
|
183
183
|
<input
|
|
184
184
|
type="range"
|
|
@@ -190,14 +190,15 @@
|
|
|
190
190
|
aria-label="Zoom level"
|
|
191
191
|
/>
|
|
192
192
|
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
<Button
|
|
194
|
+
variant="outline"
|
|
195
|
+
size="sm"
|
|
196
|
+
class="!rounded-full !w-9 !h-9 !p-0 shrink-0"
|
|
196
197
|
onclick={() => (zoom = Math.min(3, zoom + 0.2))}
|
|
197
198
|
aria-label="Zoom in"
|
|
198
199
|
>
|
|
199
200
|
<PlusOutline class="w-4 h-4" />
|
|
200
|
-
</
|
|
201
|
+
</Button>
|
|
201
202
|
</div>
|
|
202
203
|
</div>
|
|
203
204
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CropImage.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/CropImage/CropImage.svelte.ts"],"names":[],"mappings":"AAQE,UAAU,KAAK;IACb,gCAAgC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"CropImage.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/CropImage/CropImage.svelte.ts"],"names":[],"mappings":"AAQE,UAAU,KAAK;IACb,gCAAgC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AA2KH,QAAA,MAAM,SAAS,iEAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
|
@@ -90,6 +90,8 @@
|
|
|
90
90
|
|
|
91
91
|
// Remembered user state for "Welcome back" feature
|
|
92
92
|
let rememberedUser = $state(null);
|
|
93
|
+
// Track if user clicked "Not me?" to show email input even when userEmail prop is set
|
|
94
|
+
let showEmailInput = $state(false);
|
|
93
95
|
|
|
94
96
|
// First name from eligibility check (for setup welcome message)
|
|
95
97
|
let setupFirstName = $state("");
|
|
@@ -295,13 +297,14 @@
|
|
|
295
297
|
|
|
296
298
|
if (response.ok) {
|
|
297
299
|
const data = await response.json();
|
|
298
|
-
isLoading = false
|
|
300
|
+
// Keep loading state until navigation completes (don't set isLoading = false)
|
|
299
301
|
// Clear errors on success
|
|
300
302
|
errors = {};
|
|
301
303
|
showErrors = false;
|
|
302
304
|
|
|
303
305
|
if (data.accounts && data.accounts.length > 1) {
|
|
304
306
|
accounts = data.accounts;
|
|
307
|
+
isLoading = false; // Clear loading for selection view
|
|
305
308
|
view = "selection";
|
|
306
309
|
return;
|
|
307
310
|
}
|
|
@@ -373,6 +376,7 @@
|
|
|
373
376
|
|
|
374
377
|
if (response.ok) {
|
|
375
378
|
const data = await response.json();
|
|
379
|
+
// Keep loading state until navigation completes (don't set isLoading = false)
|
|
376
380
|
|
|
377
381
|
// Call the success callback
|
|
378
382
|
onLoginSuccess({
|
|
@@ -382,6 +386,7 @@
|
|
|
382
386
|
}, rememberMe);
|
|
383
387
|
|
|
384
388
|
onNavigate(setupRedirectPath);
|
|
389
|
+
return; // Exit early to skip finally block
|
|
385
390
|
} else {
|
|
386
391
|
const errorData = await response.json();
|
|
387
392
|
errors = {
|
|
@@ -513,7 +518,8 @@
|
|
|
513
518
|
}
|
|
514
519
|
|
|
515
520
|
function handleReturnToSignIn() {
|
|
516
|
-
email
|
|
521
|
+
// Restore email from remembered user if available, otherwise clear it
|
|
522
|
+
email = rememberedUser?.email || userEmail || "";
|
|
517
523
|
password = "";
|
|
518
524
|
errors = {};
|
|
519
525
|
showErrors = false;
|
|
@@ -523,6 +529,7 @@
|
|
|
523
529
|
function handleNotMe() {
|
|
524
530
|
localStorage.removeItem('rememberedUser');
|
|
525
531
|
rememberedUser = null;
|
|
532
|
+
showEmailInput = true; // Force showing email input even if userEmail prop is set
|
|
526
533
|
email = "";
|
|
527
534
|
password = "";
|
|
528
535
|
errors = {};
|
|
@@ -629,17 +636,13 @@
|
|
|
629
636
|
Sign in to access your {portalType}.
|
|
630
637
|
</p>
|
|
631
638
|
</div>
|
|
632
|
-
{:else if rememberedUser?.firstName}
|
|
639
|
+
{:else if !showEmailInput && rememberedUser?.firstName}
|
|
633
640
|
<h2 class="text-3xl font-semibold text-gray-900 dark:text-white">
|
|
634
641
|
Welcome back, {rememberedUser.firstName}
|
|
635
642
|
</h2>
|
|
636
|
-
<
|
|
637
|
-
type="button"
|
|
638
|
-
class="text-sm text-gray-500 hover:text-blue-600 transition-colors"
|
|
639
|
-
onclick={handleNotMe}
|
|
640
|
-
>
|
|
643
|
+
<Button variant="link" class="text-gray-500 hover:text-blue-600" onclick={handleNotMe}>
|
|
641
644
|
Not {rememberedUser.firstName}?
|
|
642
|
-
</
|
|
645
|
+
</Button>
|
|
643
646
|
{:else}
|
|
644
647
|
<h2 class="text-3xl font-semibold text-gray-900 dark:text-white">
|
|
645
648
|
Log in
|
|
@@ -651,19 +654,14 @@
|
|
|
651
654
|
<div class="form-fields-container">
|
|
652
655
|
<div>
|
|
653
656
|
<div class="mb-2">
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
>Email</label>
|
|
658
|
-
{#if userEmail || rememberedUser?.email}
|
|
659
|
-
<div
|
|
660
|
-
class="w-full h-10 flex items-center bg-gray-50 dark:bg-gray-700 rounded-lg border border-gray-200 dark:border-gray-600 px-3"
|
|
661
|
-
>
|
|
662
|
-
<span class="text-sm font-medium text-gray-900 dark:text-white"
|
|
663
|
-
>{userEmail || rememberedUser?.email}</span
|
|
664
|
-
>
|
|
665
|
-
</div>
|
|
657
|
+
{#if !showEmailInput && (userEmail || rememberedUser?.email)}
|
|
658
|
+
<p class="text-sm text-gray-500 dark:text-gray-400"
|
|
659
|
+
>{userEmail || rememberedUser?.email}</p>
|
|
666
660
|
{:else}
|
|
661
|
+
<label
|
|
662
|
+
for="email"
|
|
663
|
+
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
|
|
664
|
+
>Email</label>
|
|
667
665
|
<Input
|
|
668
666
|
id="email"
|
|
669
667
|
placeholder=""
|
|
@@ -698,15 +696,9 @@
|
|
|
698
696
|
for="password"
|
|
699
697
|
class="block text-sm font-medium text-gray-900 dark:text-white"
|
|
700
698
|
>Password</label>
|
|
701
|
-
<
|
|
702
|
-
type="button"
|
|
703
|
-
onclick={() => {
|
|
704
|
-
view = "reset";
|
|
705
|
-
}}
|
|
706
|
-
class="text-sm font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400"
|
|
707
|
-
>
|
|
699
|
+
<Button variant="link" onclick={() => { view = "reset"; }}>
|
|
708
700
|
Forgot your password?
|
|
709
|
-
</
|
|
701
|
+
</Button>
|
|
710
702
|
</div>
|
|
711
703
|
<Input
|
|
712
704
|
id="password"
|
|
@@ -850,13 +842,9 @@
|
|
|
850
842
|
</div>
|
|
851
843
|
|
|
852
844
|
<div class="pt-4 border-t border-gray-300 dark:border-gray-600">
|
|
853
|
-
<
|
|
854
|
-
type="button"
|
|
855
|
-
class="w-full text-center text-sm text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors"
|
|
856
|
-
onclick={handleReturnToSignIn}
|
|
857
|
-
>
|
|
845
|
+
<Button variant="ghost" size="full" class="text-gray-500 dark:text-gray-400" onclick={handleReturnToSignIn}>
|
|
858
846
|
Log in with a different email
|
|
859
|
-
</
|
|
847
|
+
</Button>
|
|
860
848
|
</div>
|
|
861
849
|
</div>
|
|
862
850
|
{:else if view === "setup"}
|
|
@@ -1000,13 +988,9 @@
|
|
|
1000
988
|
</Button>
|
|
1001
989
|
|
|
1002
990
|
<div class="text-center">
|
|
1003
|
-
<
|
|
1004
|
-
type="button"
|
|
1005
|
-
onclick={handleReturnToSignIn}
|
|
1006
|
-
class="text-sm font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400"
|
|
1007
|
-
>
|
|
991
|
+
<Button variant="link" onclick={handleReturnToSignIn}>
|
|
1008
992
|
Return to log in
|
|
1009
|
-
</
|
|
993
|
+
</Button>
|
|
1010
994
|
</div>
|
|
1011
995
|
</div>
|
|
1012
996
|
</form>
|
|
@@ -1081,13 +1065,9 @@
|
|
|
1081
1065
|
</Button>
|
|
1082
1066
|
|
|
1083
1067
|
<div class="text-center">
|
|
1084
|
-
<
|
|
1085
|
-
type="button"
|
|
1086
|
-
onclick={handleReturnToSignIn}
|
|
1087
|
-
class="text-sm font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400"
|
|
1088
|
-
>
|
|
1068
|
+
<Button variant="link" onclick={handleReturnToSignIn}>
|
|
1089
1069
|
Return to log in
|
|
1090
|
-
</
|
|
1070
|
+
</Button>
|
|
1091
1071
|
</div>
|
|
1092
1072
|
</div>
|
|
1093
1073
|
</form>
|
|
@@ -1144,13 +1124,9 @@
|
|
|
1144
1124
|
</div>
|
|
1145
1125
|
|
|
1146
1126
|
<div class="pt-2">
|
|
1147
|
-
<
|
|
1148
|
-
type="button"
|
|
1149
|
-
onclick={handleReturnToSignIn}
|
|
1150
|
-
class="text-sm font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400"
|
|
1151
|
-
>
|
|
1127
|
+
<Button variant="link" onclick={handleReturnToSignIn}>
|
|
1152
1128
|
Return to sign in
|
|
1153
|
-
</
|
|
1129
|
+
</Button>
|
|
1154
1130
|
</div>
|
|
1155
1131
|
</div>
|
|
1156
1132
|
{/if}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuperLogin.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/SuperLogin/SuperLogin.svelte.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"SuperLogin.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/SuperLogin/SuperLogin.svelte.js"],"names":[],"mappings":";;;;;AAy9BA;iBA76BkC,MAAM;cAAY,MAAM;cAAY,MAAM;kBAAgB,MAAM;kBAAgB,OAAO;gBAAc,MAAM;gBAAc,MAAM;iBAAe,MAAM;0BAAwB,MAAM;wBAAsB,MAAM;aAAW,MAAM;;;;;yBAAoI,OAAO;mBAAiB,MAAM;WA66B1W;wBA76BtC;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,WAAW;IAAC,eAAe,CAAC,WAAW;IAAC,UAAU,CAAC,WAAW;IAAC,kBAAkB,CAAC,WAAW;IAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import { Toaster } from "svelte-sonner";
|
|
5
5
|
import { showToast } from "../../stores/toaster";
|
|
6
6
|
|
|
7
7
|
const { Story } = defineMeta({
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
function showErrorToast() {
|
|
16
16
|
showToast("An error occurred. Please try again.", "error");
|
|
17
17
|
}
|
|
18
|
-
|
|
19
18
|
</script>
|
|
20
19
|
|
|
21
20
|
<Story name="Trigger Success Toast">
|
|
@@ -31,7 +30,7 @@
|
|
|
31
30
|
}}
|
|
32
31
|
/>
|
|
33
32
|
<button
|
|
34
|
-
|
|
33
|
+
onclick={showSuccessToast}
|
|
35
34
|
class="px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700"
|
|
36
35
|
>
|
|
37
36
|
Show Success Toast
|
|
@@ -53,7 +52,7 @@
|
|
|
53
52
|
}}
|
|
54
53
|
/>
|
|
55
54
|
<button
|
|
56
|
-
|
|
55
|
+
onclick={showErrorToast}
|
|
57
56
|
class="px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700"
|
|
58
57
|
>
|
|
59
58
|
Show Error Toast
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.stories.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/Toaster/Toaster.stories.svelte.js"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"Toaster.stories.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/Toaster/Toaster.stories.svelte.js"],"names":[],"mappings":";;;;;;;;AAgEA;;;;mBAAmH;wBA3DzF,eAAe;6CAkDI,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IACtG,eAAe,QAAQ,CAAC"}
|
|
@@ -30,12 +30,10 @@
|
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
|
-
|
|
34
33
|
</script>
|
|
35
34
|
|
|
36
35
|
<script>
|
|
37
|
-
|
|
38
|
-
let showShakeDemo = false;
|
|
36
|
+
let showShakeDemo = $state(false);
|
|
39
37
|
function triggerShake() {
|
|
40
38
|
showShakeDemo = false;
|
|
41
39
|
setTimeout(() => {
|
|
@@ -67,7 +65,7 @@
|
|
|
67
65
|
<div class="space-y-4">
|
|
68
66
|
<button
|
|
69
67
|
class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-primary"
|
|
70
|
-
|
|
68
|
+
onclick={triggerShake}
|
|
71
69
|
>
|
|
72
70
|
Trigger Error Shake
|
|
73
71
|
</button>
|
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
export default ErrorDisplay;
|
|
2
|
-
type ErrorDisplay =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
2
|
+
type ErrorDisplay = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Record<string, never>>): void;
|
|
8
5
|
};
|
|
9
|
-
declare const ErrorDisplay:
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
6
|
+
declare const ErrorDisplay: import("svelte").Component<Record<string, never>, {}, "">;
|
|
14
7
|
import ErrorDisplay from './ErrorDisplay.svelte';
|
|
15
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
|
-
$$bindings?: Bindings;
|
|
18
|
-
} & Exports;
|
|
19
|
-
(internal: unknown, props: {
|
|
20
|
-
$$events?: Events;
|
|
21
|
-
$$slots?: Slots;
|
|
22
|
-
}): Exports & {
|
|
23
|
-
$set?: any;
|
|
24
|
-
$on?: any;
|
|
25
|
-
};
|
|
26
|
-
z_$$bindings?: Bindings;
|
|
27
|
-
}
|
|
28
8
|
//# sourceMappingURL=ErrorDisplay.stories.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorDisplay.stories.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/feedback/ErrorDisplay.stories.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorDisplay.stories.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/feedback/ErrorDisplay.stories.svelte.js"],"names":[],"mappings":";;;;;AA8FA,sFAA2D;yBAzFhC,uBAAuB"}
|
|
@@ -8,11 +8,9 @@
|
|
|
8
8
|
component: MultiSelect,
|
|
9
9
|
tags: ['autodocs'],
|
|
10
10
|
});
|
|
11
|
-
|
|
12
11
|
</script>
|
|
13
12
|
|
|
14
13
|
<script>
|
|
15
|
-
|
|
16
14
|
const fruits = [
|
|
17
15
|
{ name: 'Apple', value: 'apple' },
|
|
18
16
|
{ name: 'Banana', value: 'banana' },
|
|
@@ -32,8 +30,8 @@
|
|
|
32
30
|
{ name: 'Rust', value: 'rust' },
|
|
33
31
|
];
|
|
34
32
|
|
|
35
|
-
let selectedFruits = [];
|
|
36
|
-
let selectedSkills = ['js', 'ts'];
|
|
33
|
+
let selectedFruits = $state([]);
|
|
34
|
+
let selectedSkills = $state(['js', 'ts']);
|
|
37
35
|
</script>
|
|
38
36
|
|
|
39
37
|
|
|
@@ -97,7 +95,7 @@
|
|
|
97
95
|
bind:value={selectedFruits}
|
|
98
96
|
placeholder="Select your favorite fruits"
|
|
99
97
|
label="Favorite Fruits"
|
|
100
|
-
|
|
98
|
+
onchange={(e) => console.log('Selected:', e.value)}
|
|
101
99
|
/>
|
|
102
100
|
|
|
103
101
|
<div class="p-4 bg-gray-100 dark:bg-gray-700 rounded">
|
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
export default MultiSelect;
|
|
2
|
-
type MultiSelect =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
2
|
+
type MultiSelect = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Record<string, never>>): void;
|
|
8
5
|
};
|
|
9
|
-
declare const MultiSelect:
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
6
|
+
declare const MultiSelect: import("svelte").Component<Record<string, never>, {}, "">;
|
|
14
7
|
import MultiSelect from './MultiSelect.svelte';
|
|
15
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
|
-
$$bindings?: Bindings;
|
|
18
|
-
} & Exports;
|
|
19
|
-
(internal: unknown, props: {
|
|
20
|
-
$$events?: Events;
|
|
21
|
-
$$slots?: Slots;
|
|
22
|
-
}): Exports & {
|
|
23
|
-
$set?: any;
|
|
24
|
-
$on?: any;
|
|
25
|
-
};
|
|
26
|
-
z_$$bindings?: Bindings;
|
|
27
|
-
}
|
|
28
8
|
//# sourceMappingURL=MultiSelect.stories.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.stories.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/inputs/MultiSelect.stories.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MultiSelect.stories.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/inputs/MultiSelect.stories.svelte.js"],"names":[],"mappings":";;;;;AAsGA,qFAA0D;wBAjGhC,sBAAsB"}
|
|
@@ -18,20 +18,18 @@
|
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
|
-
|
|
22
21
|
</script>
|
|
23
22
|
|
|
24
23
|
<script>
|
|
25
|
-
|
|
26
|
-
let
|
|
27
|
-
let
|
|
28
|
-
let
|
|
29
|
-
let
|
|
30
|
-
let otpRef;
|
|
24
|
+
let code = $state(['', '', '', '', '', '']);
|
|
25
|
+
let code4 = $state(['', '', '', '']);
|
|
26
|
+
let code8 = $state(['', '', '', '', '', '', '', '']);
|
|
27
|
+
let completedCode = $state('');
|
|
28
|
+
let otpRef = $state(null);
|
|
31
29
|
|
|
32
30
|
function handleComplete(event) {
|
|
33
|
-
completedCode = event.
|
|
34
|
-
console.log('OTP Complete:', event.
|
|
31
|
+
completedCode = event.code;
|
|
32
|
+
console.log('OTP Complete:', event.code);
|
|
35
33
|
}
|
|
36
34
|
</script>
|
|
37
35
|
|
|
@@ -91,8 +89,8 @@
|
|
|
91
89
|
<OTPInput
|
|
92
90
|
bind:value={code}
|
|
93
91
|
bind:this={otpRef}
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
oncomplete={handleComplete}
|
|
93
|
+
onchange={(e) => console.log('Changed:', e.code)}
|
|
96
94
|
/>
|
|
97
95
|
</div>
|
|
98
96
|
|
|
@@ -107,13 +105,13 @@
|
|
|
107
105
|
<div class="flex gap-2">
|
|
108
106
|
<button
|
|
109
107
|
class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-primary"
|
|
110
|
-
|
|
108
|
+
onclick={() => otpRef?.focus()}
|
|
111
109
|
>
|
|
112
110
|
Focus First Input
|
|
113
111
|
</button>
|
|
114
112
|
<button
|
|
115
|
-
class="px-4 py-2 bg-gray-
|
|
116
|
-
|
|
113
|
+
class="px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600"
|
|
114
|
+
onclick={() => {
|
|
117
115
|
otpRef?.clear();
|
|
118
116
|
completedCode = '';
|
|
119
117
|
}}
|
|
@@ -138,7 +136,7 @@
|
|
|
138
136
|
<OTPInput
|
|
139
137
|
bind:value={code4}
|
|
140
138
|
length={4}
|
|
141
|
-
|
|
139
|
+
oncomplete={(e) => alert(`Verifying code: ${e.code}`)}
|
|
142
140
|
/>
|
|
143
141
|
</div>
|
|
144
142
|
|
|
@@ -156,8 +154,8 @@
|
|
|
156
154
|
</p>
|
|
157
155
|
<OTPInput
|
|
158
156
|
value={['', '', '', '', '', '']}
|
|
159
|
-
|
|
160
|
-
alert(`Auto-submitting code: ${e.
|
|
157
|
+
oncomplete={(e) => {
|
|
158
|
+
alert(`Auto-submitting code: ${e.code}`);
|
|
161
159
|
}}
|
|
162
160
|
/>
|
|
163
161
|
</div>
|
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
export default OTPInput;
|
|
2
|
-
type OTPInput =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
2
|
+
type OTPInput = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Record<string, never>>): void;
|
|
8
5
|
};
|
|
9
|
-
declare const OTPInput:
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
6
|
+
declare const OTPInput: import("svelte").Component<Record<string, never>, {}, "">;
|
|
14
7
|
import OTPInput from './OTPInput.svelte';
|
|
15
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
|
-
$$bindings?: Bindings;
|
|
18
|
-
} & Exports;
|
|
19
|
-
(internal: unknown, props: {
|
|
20
|
-
$$events?: Events;
|
|
21
|
-
$$slots?: Slots;
|
|
22
|
-
}): Exports & {
|
|
23
|
-
$set?: any;
|
|
24
|
-
$on?: any;
|
|
25
|
-
};
|
|
26
|
-
z_$$bindings?: Bindings;
|
|
27
|
-
}
|
|
28
8
|
//# sourceMappingURL=OTPInput.stories.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTPInput.stories.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/inputs/OTPInput.stories.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OTPInput.stories.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/inputs/OTPInput.stories.svelte.js"],"names":[],"mappings":";;;;;AAuIA,kFAAuD;qBAlIhC,mBAAmB"}
|
|
@@ -100,13 +100,9 @@
|
|
|
100
100
|
<div class="text-center">
|
|
101
101
|
{#if closeBtn}
|
|
102
102
|
<div class="flex justify-end -mt-2 -mr-2 mb-2">
|
|
103
|
-
<
|
|
104
|
-
class="p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none transition-colors"
|
|
105
|
-
onclick={handleClose}
|
|
106
|
-
{disabled}
|
|
107
|
-
>
|
|
103
|
+
<Button variant="icon" size="xs" onclick={handleClose} {disabled}>
|
|
108
104
|
<img src={Cancel} alt="Close" class="w-5 h-5" />
|
|
109
|
-
</
|
|
105
|
+
</Button>
|
|
110
106
|
</div>
|
|
111
107
|
{/if}
|
|
112
108
|
{#if resolvedIcon}
|
|
@@ -82,13 +82,9 @@
|
|
|
82
82
|
<div class="text-left">
|
|
83
83
|
{#if closeBtn}
|
|
84
84
|
<div class="flex justify-end -mt-2 -mr-2 mb-2">
|
|
85
|
-
<
|
|
86
|
-
class="p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none transition-colors"
|
|
87
|
-
onclick={handleClose}
|
|
88
|
-
{disabled}
|
|
89
|
-
>
|
|
85
|
+
<Button variant="icon" size="xs" onclick={handleClose} {disabled}>
|
|
90
86
|
<img src={Cancel} alt="Close" class="w-5 h-5" />
|
|
91
|
-
</
|
|
87
|
+
</Button>
|
|
92
88
|
</div>
|
|
93
89
|
{/if}
|
|
94
90
|
{#if title}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import Modal from "../../primitives/Modal/Modal.svelte";
|
|
4
|
+
import Button from "../../primitives/Button/Button.svelte";
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
6
7
|
/** Whether the modal is visible */
|
|
@@ -57,8 +58,8 @@
|
|
|
57
58
|
{#if footer}
|
|
58
59
|
{@render footer()}
|
|
59
60
|
{:else}
|
|
60
|
-
<
|
|
61
|
-
<
|
|
61
|
+
<Button variant="alternative">Cancel</Button>
|
|
62
|
+
<Button variant="default">Confirm</Button>
|
|
62
63
|
{/if}
|
|
63
64
|
{/snippet}
|
|
64
65
|
</Modal>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalTestWrapper.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/modals/ModalTestWrapper.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"ModalTestWrapper.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/modals/ModalTestWrapper.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAKpC,UAAU,KAAK;IACb,mCAAmC;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,qBAAqB;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mBAAmB;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,qBAAqB;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAmDH,QAAA,MAAM,gBAAgB,+CAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|