@getmicdrop/svelte-components 5.12.0 → 5.13.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.spec.js +0 -1
- package/dist/patterns/navigation/Header.svelte +23 -27
- package/dist/patterns/navigation/Header.svelte.d.ts.map +1 -1
- package/dist/primitives/AvatarButton/AvatarButton.svelte +57 -0
- package/dist/primitives/AvatarButton/AvatarButton.svelte.d.ts +18 -0
- package/dist/primitives/AvatarButton/AvatarButton.svelte.d.ts.map +1 -0
- package/dist/primitives/BottomSheet/BottomSheet.spec.js +19 -19
- package/dist/primitives/BottomSheet/BottomSheet.svelte +5 -5
- package/dist/primitives/BottomSheet/BottomSheet.svelte.d.ts +2 -2
- package/dist/primitives/BottomSheet/BottomSheet.svelte.d.ts.map +1 -1
- package/dist/primitives/BottomSheet/BottomSheetWrapper.test.svelte +3 -3
- package/dist/primitives/BottomSheet/BottomSheetWrapper.test.svelte.d.ts +1 -1
- package/dist/primitives/Button/Button.spec.js +8 -8
- package/dist/primitives/Button/Button.svelte +9 -45
- package/dist/primitives/Button/Button.svelte.d.ts.map +1 -1
- package/dist/primitives/CardAction/CardAction.svelte +68 -0
- package/dist/primitives/CardAction/CardAction.svelte.d.ts +20 -0
- package/dist/primitives/CardAction/CardAction.svelte.d.ts.map +1 -0
- package/dist/primitives/Drawer/Drawer.spec.js +33 -33
- package/dist/primitives/Drawer/Drawer.svelte +5 -9
- package/dist/primitives/Drawer/Drawer.svelte.d.ts +2 -3
- package/dist/primitives/Drawer/Drawer.svelte.d.ts.map +1 -1
- package/dist/primitives/LandingButton/LandingButton.svelte +92 -0
- package/dist/primitives/LandingButton/LandingButton.svelte.d.ts +22 -0
- package/dist/primitives/LandingButton/LandingButton.svelte.d.ts.map +1 -0
- package/dist/primitives/MenuItem/MenuItem.svelte +85 -0
- package/dist/primitives/MenuItem/MenuItem.svelte.d.ts +24 -0
- package/dist/primitives/MenuItem/MenuItem.svelte.d.ts.map +1 -0
- package/dist/primitives/Modal/Modal.spec.js +7 -7
- package/dist/primitives/Modal/Modal.stories.svelte +3 -3
- package/dist/primitives/Modal/Modal.svelte +25 -18
- package/dist/primitives/Modal/Modal.svelte.d.ts +5 -5
- package/dist/primitives/Modal/Modal.svelte.d.ts.map +1 -1
- package/dist/primitives/Modal/ModalTestWrapper.svelte +3 -3
- package/dist/primitives/Modal/ModalTestWrapper.svelte.d.ts +2 -2
- package/dist/primitives/NavItem/NavItem.svelte +75 -0
- package/dist/primitives/NavItem/NavItem.svelte.d.ts +20 -0
- package/dist/primitives/NavItem/NavItem.svelte.d.ts.map +1 -0
- package/dist/primitives/SearchResultItem/SearchResultItem.svelte +109 -0
- package/dist/primitives/SearchResultItem/SearchResultItem.svelte.d.ts +26 -0
- package/dist/primitives/SearchResultItem/SearchResultItem.svelte.d.ts.map +1 -0
- package/dist/primitives/SidebarToggle/SidebarToggle.svelte +55 -0
- package/dist/primitives/SidebarToggle/SidebarToggle.svelte.d.ts +18 -0
- package/dist/primitives/SidebarToggle/SidebarToggle.svelte.d.ts.map +1 -0
- package/dist/primitives/index.d.ts +7 -0
- package/dist/primitives/index.js +21 -0
- package/dist/recipes/SuperLogin/SuperLogin.svelte +3 -3
- package/dist/recipes/SuperLogin/SuperLogin.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/index.d.ts +0 -1
- package/dist/recipes/inputs/index.js +0 -1
- package/dist/recipes/modals/AlertModal.spec.js +2 -2
- package/dist/recipes/modals/AlertModal.svelte +6 -6
- package/dist/recipes/modals/AlertModal.svelte.d.ts +3 -3
- package/dist/recipes/modals/ConfirmationModal.spec.js +2 -2
- package/dist/recipes/modals/ConfirmationModal.svelte +5 -5
- package/dist/recipes/modals/ConfirmationModal.svelte.d.ts +3 -3
- package/dist/recipes/modals/InputModal.spec.js +2 -2
- package/dist/recipes/modals/InputModal.svelte +4 -4
- package/dist/recipes/modals/InputModal.svelte.d.ts +3 -3
- package/dist/recipes/modals/ModalTestWrapper.spec.js +49 -49
- package/dist/recipes/modals/ModalTestWrapper.svelte +3 -3
- package/dist/recipes/modals/ModalTestWrapper.svelte.d.ts +2 -2
- package/dist/recipes/modals/StatusModal.spec.js +2 -2
- package/dist/recipes/modals/StatusModal.svelte +4 -4
- package/dist/recipes/modals/StatusModal.svelte.d.ts +3 -3
- package/dist/stories/ComponentConsolidation.stories.svelte +10 -10
- package/dist/stories/PrimitivesGallery.svelte +25 -21
- package/dist/stories/PrimitivesGallery.svelte.d.ts.map +1 -1
- package/dist/stories/RecipesGallery.spec.js +9 -18
- package/dist/stories/RecipesGallery.svelte +5 -22
- package/dist/stories/RecipesGallery.svelte.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/recipes/inputs/SelectDropdown.spec.d.ts +0 -2
- package/dist/recipes/inputs/SelectDropdown.spec.d.ts.map +0 -1
- package/dist/recipes/inputs/SelectDropdown.spec.js +0 -518
- package/dist/recipes/inputs/SelectDropdown.svelte +0 -171
- package/dist/recipes/inputs/SelectDropdown.svelte.d.ts +0 -16
- package/dist/recipes/inputs/SelectDropdown.svelte.d.ts.map +0 -1
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
import { typography } from '../../tokens/typography';
|
|
7
7
|
|
|
8
8
|
let {
|
|
9
|
-
|
|
10
|
-
size = "
|
|
9
|
+
open = $bindable(false),
|
|
10
|
+
size = "sm",
|
|
11
11
|
title = "",
|
|
12
12
|
subtitle = "",
|
|
13
13
|
description = "",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
const closeModal = () => {
|
|
48
|
-
|
|
48
|
+
open = false;
|
|
49
49
|
onclose?.();
|
|
50
50
|
};
|
|
51
51
|
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
let buttonVariant = $derived(getButtonVariant(effectiveVariant));
|
|
112
112
|
</script>
|
|
113
113
|
|
|
114
|
-
<Modal bind:
|
|
114
|
+
<Modal bind:open {size} oncancel={handleClose} {...restProps}>
|
|
115
115
|
{#snippet header()}
|
|
116
116
|
<div class="text-center">
|
|
117
117
|
{#if closeBtn}
|
|
@@ -4,7 +4,7 @@ type StatusModal = {
|
|
|
4
4
|
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
5
|
};
|
|
6
6
|
declare const StatusModal: import("svelte").Component<{
|
|
7
|
-
|
|
7
|
+
open?: boolean;
|
|
8
8
|
size?: string;
|
|
9
9
|
title?: string;
|
|
10
10
|
subtitle?: string;
|
|
@@ -20,9 +20,9 @@ declare const StatusModal: import("svelte").Component<{
|
|
|
20
20
|
closeBtn?: boolean;
|
|
21
21
|
onconfirm: any;
|
|
22
22
|
onclose: any;
|
|
23
|
-
} & Record<string, any>, {}, "
|
|
23
|
+
} & Record<string, any>, {}, "open">;
|
|
24
24
|
type $$ComponentProps = {
|
|
25
|
-
|
|
25
|
+
open?: boolean;
|
|
26
26
|
size?: string;
|
|
27
27
|
title?: string;
|
|
28
28
|
subtitle?: string;
|
|
@@ -326,13 +326,13 @@ grep -r "<button" /Users/peet/repos/performers-portal/src --include="*.svelte
|
|
|
326
326
|
</div>
|
|
327
327
|
</div>
|
|
328
328
|
|
|
329
|
-
<div class="mt-4 p-3 bg-
|
|
330
|
-
<strong class="text-
|
|
331
|
-
<ul class="mt-2 list-disc list-inside text-
|
|
332
|
-
<li><code class="bg-gray-200 dark:bg-gray-700 px-1 rounded"
|
|
333
|
-
<li><code class="bg-gray-200 dark:bg-gray-700 px-1 rounded"
|
|
334
|
-
<li><code class="bg-gray-200 dark:bg-gray-700 px-1 rounded"
|
|
335
|
-
<li><code class="bg-gray-200 dark:bg-gray-700 px-1 rounded"
|
|
329
|
+
<div class="mt-4 p-3 bg-green-50 dark:bg-green-900/20 rounded text-sm">
|
|
330
|
+
<strong class="text-green-700 dark:text-green-400">Extracted to dedicated components:</strong>
|
|
331
|
+
<ul class="mt-2 list-disc list-inside text-green-600 dark:text-green-400 space-y-1">
|
|
332
|
+
<li><code class="bg-gray-200 dark:bg-gray-700 px-1 rounded"><AvatarButton></code> - Avatar/image trigger buttons (opacity hover)</li>
|
|
333
|
+
<li><code class="bg-gray-200 dark:bg-gray-700 px-1 rounded"><MenuItem></code> - Dropdown menu items (full width, left-aligned)</li>
|
|
334
|
+
<li><code class="bg-gray-200 dark:bg-gray-700 px-1 rounded"><MenuItem danger></code> - Destructive menu items (red text)</li>
|
|
335
|
+
<li><code class="bg-gray-200 dark:bg-gray-700 px-1 rounded"><CardAction></code> - Selectable card buttons (bordered)</li>
|
|
336
336
|
</ul>
|
|
337
337
|
</div>
|
|
338
338
|
</div>
|
|
@@ -505,7 +505,7 @@ grep -r "<button" /Users/peet/repos/performers-portal/src --include="*.svelte
|
|
|
505
505
|
</h2>
|
|
506
506
|
<p class="text-sm text-green-700 dark:text-green-400">
|
|
507
507
|
No raw <code class="bg-green-100 dark:bg-green-800 px-1 rounded"><select></code> elements found outside of primitives.
|
|
508
|
-
All select functionality uses custom dropdown
|
|
508
|
+
All select functionality uses the MultiSelect custom dropdown component.
|
|
509
509
|
</p>
|
|
510
510
|
</div>
|
|
511
511
|
|
|
@@ -1161,8 +1161,8 @@ grep -r "from '\$lib/components/Button" /Users/peet/repos/micdrop-frontend/src -
|
|
|
1161
1161
|
<br/><span class="text-blue-500 dark:text-blue-500 ml-4">→ Are these all necessary, or can some be variants of one component?</span>
|
|
1162
1162
|
</li>
|
|
1163
1163
|
<li>
|
|
1164
|
-
<strong>Select vs
|
|
1165
|
-
<br/><span class="text-blue-500 dark:text-blue-500 ml-4">→ Should these share more code
|
|
1164
|
+
<strong>Select vs MultiSelect</strong>
|
|
1165
|
+
<br/><span class="text-blue-500 dark:text-blue-500 ml-4">→ Should these share more code? (SelectDropdown removed)</span>
|
|
1166
1166
|
</li>
|
|
1167
1167
|
<li>
|
|
1168
1168
|
<strong>Input vs OTPInput vs PlaceAutocomplete</strong>
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
|
|
26
26
|
// Button
|
|
27
27
|
import Button from '../primitives/Button/Button.svelte';
|
|
28
|
+
import MenuItem from '../primitives/MenuItem/MenuItem.svelte';
|
|
29
|
+
import AvatarButton from '../primitives/AvatarButton/AvatarButton.svelte';
|
|
30
|
+
import CardAction from '../primitives/CardAction/CardAction.svelte';
|
|
31
|
+
import NavItem from '../primitives/NavItem/NavItem.svelte';
|
|
28
32
|
|
|
29
33
|
// Card
|
|
30
34
|
import Card from '../primitives/Card.svelte';
|
|
@@ -162,51 +166,51 @@
|
|
|
162
166
|
</div>
|
|
163
167
|
|
|
164
168
|
<div>
|
|
165
|
-
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">
|
|
169
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">NavItem (Mobile Navigation)</p>
|
|
166
170
|
<div class="flex gap-6 items-end bg-gray-100 dark:bg-gray-800 p-4 rounded-lg">
|
|
167
|
-
<
|
|
171
|
+
<NavItem>
|
|
168
172
|
<Home class="w-5 h-5" />
|
|
169
173
|
<span>Home</span>
|
|
170
|
-
</
|
|
171
|
-
<
|
|
174
|
+
</NavItem>
|
|
175
|
+
<NavItem active={true}>
|
|
172
176
|
<Notification class="w-5 h-5" />
|
|
173
177
|
<span>Events</span>
|
|
174
|
-
</
|
|
175
|
-
<
|
|
178
|
+
</NavItem>
|
|
179
|
+
<NavItem>
|
|
176
180
|
<Profile class="w-5 h-5" />
|
|
177
181
|
<span>Profile</span>
|
|
178
|
-
</
|
|
182
|
+
</NavItem>
|
|
179
183
|
</div>
|
|
180
184
|
</div>
|
|
181
185
|
|
|
182
186
|
<div>
|
|
183
|
-
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">Avatar, Menu & Card
|
|
187
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">Avatar, Menu & Card Components</p>
|
|
184
188
|
<div class="flex gap-6 items-start">
|
|
185
189
|
<div class="flex flex-col items-center gap-2">
|
|
186
|
-
<
|
|
190
|
+
<AvatarButton>
|
|
187
191
|
<Avatar src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Crect width='150' height='150' fill='%238b5cf6'/%3E%3Ccircle cx='75' cy='55' r='30' fill='%23fff'/%3E%3Cellipse cx='75' cy='130' rx='45' ry='35' fill='%23fff'/%3E%3C/svg%3E" rounded size="md" />
|
|
188
|
-
</
|
|
189
|
-
<span class="text-xs text-gray-500">
|
|
192
|
+
</AvatarButton>
|
|
193
|
+
<span class="text-xs text-gray-500">AvatarButton</span>
|
|
190
194
|
</div>
|
|
191
195
|
<div class="w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg overflow-hidden">
|
|
192
|
-
<
|
|
193
|
-
<
|
|
196
|
+
<MenuItem>Settings</MenuItem>
|
|
197
|
+
<MenuItem>Profile</MenuItem>
|
|
194
198
|
<div class="h-px bg-gray-200 dark:bg-gray-700"></div>
|
|
195
|
-
<
|
|
199
|
+
<MenuItem danger>Sign out</MenuItem>
|
|
196
200
|
</div>
|
|
197
201
|
<div class="w-64 space-y-2">
|
|
198
|
-
<
|
|
202
|
+
<CardAction>
|
|
199
203
|
<span class="flex flex-col">
|
|
200
204
|
<span class="font-medium">Select this option</span>
|
|
201
205
|
<span class="text-sm text-gray-500">Description text here</span>
|
|
202
206
|
</span>
|
|
203
|
-
</
|
|
204
|
-
<
|
|
207
|
+
</CardAction>
|
|
208
|
+
<CardAction>
|
|
205
209
|
<span class="flex flex-col">
|
|
206
210
|
<span class="font-medium">Another option</span>
|
|
207
211
|
<span class="text-sm text-gray-500">More description</span>
|
|
208
212
|
</span>
|
|
209
|
-
</
|
|
213
|
+
</CardAction>
|
|
210
214
|
</div>
|
|
211
215
|
</div>
|
|
212
216
|
</div>
|
|
@@ -703,7 +707,7 @@
|
|
|
703
707
|
</section>
|
|
704
708
|
|
|
705
709
|
<!-- Modal -->
|
|
706
|
-
<Modal bind:
|
|
710
|
+
<Modal bind:open={showModal}>
|
|
707
711
|
{#snippet header()}
|
|
708
712
|
<h3 class="text-lg font-semibold">Example Modal</h3>
|
|
709
713
|
{/snippet}
|
|
@@ -717,7 +721,7 @@
|
|
|
717
721
|
</Modal>
|
|
718
722
|
|
|
719
723
|
<!-- Drawer -->
|
|
720
|
-
<Drawer bind:
|
|
724
|
+
<Drawer bind:open={showDrawer} placement="right">
|
|
721
725
|
<div class="p-6">
|
|
722
726
|
<h3 class="text-lg font-semibold mb-4">Drawer Content</h3>
|
|
723
727
|
<p class="text-gray-600">This drawer slides in from the right.</p>
|
|
@@ -726,7 +730,7 @@
|
|
|
726
730
|
</Drawer>
|
|
727
731
|
|
|
728
732
|
<!-- BottomSheet -->
|
|
729
|
-
<BottomSheet
|
|
733
|
+
<BottomSheet open={showBottomSheet} onclose={() => showBottomSheet = false}>
|
|
730
734
|
<div class="p-6">
|
|
731
735
|
<h3 class="text-lg font-semibold mb-4">Bottom Sheet</h3>
|
|
732
736
|
<p class="text-gray-600">This sheet slides up from the bottom on mobile.</p>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivesGallery.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/stories/PrimitivesGallery.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrimitivesGallery.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/stories/PrimitivesGallery.svelte.ts"],"names":[],"mappings":"AA+xBA,QAAA,MAAM,iBAAiB,2DAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|
|
@@ -17,7 +17,7 @@ import { expect } from 'vitest';
|
|
|
17
17
|
* 1. Header with title, description, and dark mode toggle
|
|
18
18
|
* 2. Feedback Components section (EmptyState, ErrorDisplay, StatusIndicator)
|
|
19
19
|
* 3. Form Fields section (FormField, SelectField, TextareaField, CheckboxField, ToggleField, RadioGroup)
|
|
20
|
-
* 4. Special Inputs section (PasswordInput, PasswordStrengthIndicator, OTPInput, Search, MultiSelect
|
|
20
|
+
* 4. Special Inputs section (PasswordInput, PasswordStrengthIndicator, OTPInput, Search, MultiSelect)
|
|
21
21
|
* 5. Modals section (AlertModal, ConfirmationModal, InputModal, StatusModal)
|
|
22
22
|
* 6. Common Recipe Patterns section (Registration Form, Settings Form)
|
|
23
23
|
*
|
|
@@ -38,7 +38,7 @@ describe('RecipesGallery Component - Documentation', () => {
|
|
|
38
38
|
const componentStructure = {
|
|
39
39
|
imports: {
|
|
40
40
|
feedback: ['EmptyState', 'ErrorDisplay', 'StatusIndicator'],
|
|
41
|
-
inputs: ['MultiSelect', 'OTPInput', 'PasswordInput', 'PasswordStrengthIndicator', 'Search'
|
|
41
|
+
inputs: ['MultiSelect', 'OTPInput', 'PasswordInput', 'PasswordStrengthIndicator', 'Search'],
|
|
42
42
|
modals: ['AlertModal', 'ConfirmationModal', 'InputModal', 'StatusModal'],
|
|
43
43
|
fields: ['CheckboxField', 'FormField', 'RadioGroup', 'SelectField', 'TextareaField', 'ToggleField'],
|
|
44
44
|
primitives: ['Button', 'Card']
|
|
@@ -54,7 +54,6 @@ describe('RecipesGallery Component - Documentation', () => {
|
|
|
54
54
|
passwordValue: 'string',
|
|
55
55
|
searchValue: 'string',
|
|
56
56
|
multiSelectValue: 'string[]',
|
|
57
|
-
selectDropdownValue: '{label: string, value: string} | null',
|
|
58
57
|
checkboxChecked: 'boolean',
|
|
59
58
|
toggleChecked: 'boolean',
|
|
60
59
|
radioValue: 'string',
|
|
@@ -109,7 +108,6 @@ describe('RecipesGallery Component - Documentation', () => {
|
|
|
109
108
|
'PasswordInput',
|
|
110
109
|
'PasswordStrengthIndicator',
|
|
111
110
|
'Search',
|
|
112
|
-
'SelectDropdown',
|
|
113
111
|
'AlertModal',
|
|
114
112
|
'ConfirmationModal',
|
|
115
113
|
'InputModal',
|
|
@@ -123,7 +121,7 @@ describe('RecipesGallery Component - Documentation', () => {
|
|
|
123
121
|
];
|
|
124
122
|
|
|
125
123
|
// All components are imported in the file
|
|
126
|
-
expect(recipeComponents).toHaveLength(
|
|
124
|
+
expect(recipeComponents).toHaveLength(18);
|
|
127
125
|
expect(recipeComponents).toContain('EmptyState');
|
|
128
126
|
expect(recipeComponents).toContain('PasswordInput');
|
|
129
127
|
expect(recipeComponents).toContain('AlertModal');
|
|
@@ -132,13 +130,13 @@ describe('RecipesGallery Component - Documentation', () => {
|
|
|
132
130
|
|
|
133
131
|
test('Modal state management is properly implemented', () => {
|
|
134
132
|
const modalStates = {
|
|
135
|
-
alert: {
|
|
136
|
-
confirm: {
|
|
137
|
-
input: {
|
|
138
|
-
status: {
|
|
133
|
+
alert: { open: false, autoClose: 0 },
|
|
134
|
+
confirm: { open: false },
|
|
135
|
+
input: { open: false },
|
|
136
|
+
status: { open: false, type: 'success', autoCloseDelay: 2000 }
|
|
139
137
|
};
|
|
140
138
|
|
|
141
|
-
expect(modalStates.alert.
|
|
139
|
+
expect(modalStates.alert.open).toBe(false);
|
|
142
140
|
expect(modalStates.status.autoCloseDelay).toBe(2000);
|
|
143
141
|
});
|
|
144
142
|
|
|
@@ -148,7 +146,6 @@ describe('RecipesGallery Component - Documentation', () => {
|
|
|
148
146
|
passwordValue: 'string',
|
|
149
147
|
searchValue: 'string',
|
|
150
148
|
multiSelectValue: 'string[]',
|
|
151
|
-
selectDropdownValue: '{label: string, value: string} | null',
|
|
152
149
|
checkboxChecked: 'boolean',
|
|
153
150
|
toggleChecked: 'boolean',
|
|
154
151
|
radioValue: 'string',
|
|
@@ -158,7 +155,7 @@ describe('RecipesGallery Component - Documentation', () => {
|
|
|
158
155
|
};
|
|
159
156
|
|
|
160
157
|
expect(fieldBindings.otpValue).toBe('string[]');
|
|
161
|
-
|
|
158
|
+
// Note: selectDropdownValue removed - SelectDropdown has been deprecated, use Select
|
|
162
159
|
expect(fieldBindings.checkboxChecked).toBe('boolean');
|
|
163
160
|
});
|
|
164
161
|
|
|
@@ -177,11 +174,6 @@ describe('RecipesGallery Component - Documentation', () => {
|
|
|
177
174
|
{ value: 'lg', name: 'Large' },
|
|
178
175
|
{ value: 'xl', name: 'Extra Large' }
|
|
179
176
|
],
|
|
180
|
-
selectDropdownOptions: [
|
|
181
|
-
{ value: 'low', label: 'Low Priority' },
|
|
182
|
-
{ value: 'medium', label: 'Medium Priority' },
|
|
183
|
-
{ value: 'high', label: 'High Priority' }
|
|
184
|
-
],
|
|
185
177
|
radioOptions: [
|
|
186
178
|
{ value: 'daily', label: 'Daily', description: 'Get updates every day' },
|
|
187
179
|
{ value: 'weekly', label: 'Weekly', description: 'Get updates once a week' },
|
|
@@ -191,7 +183,6 @@ describe('RecipesGallery Component - Documentation', () => {
|
|
|
191
183
|
|
|
192
184
|
expect(demoData.multiSelectItems).toHaveLength(5);
|
|
193
185
|
expect(demoData.selectFieldItems).toHaveLength(4);
|
|
194
|
-
expect(demoData.selectDropdownOptions).toHaveLength(3);
|
|
195
186
|
expect(demoData.radioOptions).toHaveLength(3);
|
|
196
187
|
});
|
|
197
188
|
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
import PasswordInput from '../recipes/inputs/PasswordInput.svelte';
|
|
16
16
|
import PasswordStrengthIndicator from '../recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte';
|
|
17
17
|
import Search from '../recipes/inputs/Search.svelte';
|
|
18
|
-
import SelectDropdown from '../recipes/inputs/SelectDropdown.svelte';
|
|
19
18
|
|
|
20
19
|
// Modals
|
|
21
20
|
import AlertModal from '../recipes/modals/AlertModal.svelte';
|
|
@@ -50,7 +49,6 @@
|
|
|
50
49
|
let passwordValue = $state('');
|
|
51
50
|
let searchValue = $state('');
|
|
52
51
|
let multiSelectValue = $state<string[]>([]);
|
|
53
|
-
let selectDropdownValue = $state<{label: string, value: string} | null>(null); // SelectDropdown expects object
|
|
54
52
|
|
|
55
53
|
// Field states
|
|
56
54
|
let checkboxChecked = $state(false);
|
|
@@ -92,13 +90,6 @@
|
|
|
92
90
|
{ value: 'xl', name: 'Extra Large' },
|
|
93
91
|
];
|
|
94
92
|
|
|
95
|
-
// SelectDropdown uses 'options' with {label, value} format
|
|
96
|
-
const selectDropdownOptions = [
|
|
97
|
-
{ value: 'low', label: 'Low Priority' },
|
|
98
|
-
{ value: 'medium', label: 'Medium Priority' },
|
|
99
|
-
{ value: 'high', label: 'High Priority' },
|
|
100
|
-
];
|
|
101
|
-
|
|
102
93
|
const radioOptions = [
|
|
103
94
|
{ value: 'daily', label: 'Daily', description: 'Get updates every day' },
|
|
104
95
|
{ value: 'weekly', label: 'Weekly', description: 'Get updates once a week' },
|
|
@@ -259,7 +250,7 @@
|
|
|
259
250
|
<!-- ========== SPECIAL INPUTS ========== -->
|
|
260
251
|
<section class={sectionClass(isDark)}>
|
|
261
252
|
<h2 class={headingClass(isDark)}>Special Inputs</h2>
|
|
262
|
-
<p class={subheadingClass(isDark)}>Password, OTP, Search, MultiSelect
|
|
253
|
+
<p class={subheadingClass(isDark)}>Password, OTP, Search, MultiSelect</p>
|
|
263
254
|
|
|
264
255
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
|
265
256
|
<div>
|
|
@@ -303,14 +294,6 @@
|
|
|
303
294
|
/>
|
|
304
295
|
</div>
|
|
305
296
|
|
|
306
|
-
<div>
|
|
307
|
-
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">SelectDropdown</p>
|
|
308
|
-
<SelectDropdown
|
|
309
|
-
options={selectDropdownOptions}
|
|
310
|
-
bind:selected={selectDropdownValue}
|
|
311
|
-
placeholder="Priority"
|
|
312
|
-
/>
|
|
313
|
-
</div>
|
|
314
297
|
</div>
|
|
315
298
|
</section>
|
|
316
299
|
|
|
@@ -360,7 +343,7 @@
|
|
|
360
343
|
|
|
361
344
|
<!-- AlertModal -->
|
|
362
345
|
<AlertModal
|
|
363
|
-
bind:
|
|
346
|
+
bind:open={showAlertModal}
|
|
364
347
|
title="Alert"
|
|
365
348
|
message="This is an alert message that requires your attention."
|
|
366
349
|
buttonText="OK"
|
|
@@ -370,7 +353,7 @@
|
|
|
370
353
|
|
|
371
354
|
<!-- ConfirmationModal -->
|
|
372
355
|
<ConfirmationModal
|
|
373
|
-
bind:
|
|
356
|
+
bind:open={showConfirmModal}
|
|
374
357
|
title="Confirm Action"
|
|
375
358
|
description="Are you sure you want to proceed? This action cannot be undone."
|
|
376
359
|
primaryButtonText="Yes, proceed"
|
|
@@ -385,7 +368,7 @@
|
|
|
385
368
|
|
|
386
369
|
<!-- InputModal -->
|
|
387
370
|
<InputModal
|
|
388
|
-
bind:
|
|
371
|
+
bind:open={showInputModal}
|
|
389
372
|
title="Enter Information"
|
|
390
373
|
inputLabel="Name"
|
|
391
374
|
inputPlaceholder="Enter your name"
|
|
@@ -400,7 +383,7 @@
|
|
|
400
383
|
|
|
401
384
|
<!-- StatusModal -->
|
|
402
385
|
<StatusModal
|
|
403
|
-
bind:
|
|
386
|
+
bind:open={showStatusModal}
|
|
404
387
|
iconType={statusModalType}
|
|
405
388
|
title={statusModalType === 'loading' ? 'Processing...' : statusModalType === 'success' ? 'Success!' : 'Error'}
|
|
406
389
|
description={statusModalType === 'loading' ? 'Please wait...' : statusModalType === 'success' ? 'Operation completed successfully.' : 'Something went wrong.'}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecipesGallery.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/stories/RecipesGallery.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RecipesGallery.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/stories/RecipesGallery.svelte.ts"],"names":[],"mappings":"AAsXA,QAAA,MAAM,cAAc,2DAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDropdown.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/inputs/SelectDropdown.spec.js"],"names":[],"mappings":""}
|