@getmicdrop/svelte-components 5.10.3 → 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/calendar/AboutShow/AboutShow.svelte +172 -172
- package/dist/calendar/Calendar/MiniMonthCalendar.svelte +782 -782
- package/dist/calendar/FAQs/FAQs.svelte +75 -75
- package/dist/calendar/MonthSwitcher/MonthSwitcher.svelte +126 -126
- package/dist/calendar/OrderSummary/OrderSummary.svelte +367 -367
- package/dist/calendar/PublicCard/PublicCard.svelte +146 -146
- package/dist/calendar/ShowCard/ShowCard.svelte +157 -157
- package/dist/calendar/ShowTimeCard/ShowTimeCard.svelte +61 -61
- package/dist/components/Heading.svelte +60 -60
- package/dist/components/Layout/AppShell.svelte +104 -104
- package/dist/components/Layout/ContentSection.svelte +80 -80
- package/dist/components/Layout/Grid.svelte +4 -4
- package/dist/components/Layout/Heading.svelte +81 -81
- package/dist/components/Layout/PageContainer.svelte +69 -69
- package/dist/components/Layout/Responsive.svelte +75 -75
- package/dist/components/Layout/Section.svelte +80 -80
- package/dist/components/Layout/ShowOnDesktop.svelte +37 -37
- package/dist/components/Layout/ShowOnMobile.svelte +37 -37
- package/dist/components/Layout/Sidebar.svelte +108 -108
- package/dist/components/Layout/Stack.spec.js +1 -1
- package/dist/components/Layout/Stack.svelte +6 -6
- package/dist/components/Layout/Text.svelte +87 -87
- package/dist/components/Layout/TwoColumn.svelte +108 -108
- package/dist/components/Text.svelte +53 -53
- package/dist/constants/validation.js +91 -91
- package/dist/constants/validation.spec.js +64 -64
- package/dist/datetime/__tests__/format.test.js +1 -1
- package/dist/datetime/__tests__/parse.test.js +1 -1
- package/dist/datetime/__tests__/timezone.test.js +1 -1
- package/dist/datetime/parse.js +1 -1
- package/dist/forms/createFormStore.svelte.js +0 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +57 -51
- package/dist/index.spec.js +0 -1
- package/dist/patterns/data/DataGrid.svelte +45 -45
- package/dist/patterns/data/DataList.svelte +24 -24
- package/dist/patterns/data/DataTable.svelte +36 -36
- package/dist/patterns/forms/FormActions.spec.js +95 -95
- package/dist/patterns/forms/FormActions.stories.svelte +97 -97
- package/dist/patterns/forms/FormActions.svelte +46 -46
- package/dist/patterns/forms/FormGrid.svelte +33 -33
- package/dist/patterns/forms/FormSection.svelte +32 -32
- package/dist/patterns/forms/FormValidationSummary.stories.svelte +83 -83
- package/dist/patterns/forms/FormValidationSummary.svelte +74 -74
- package/dist/patterns/layout/Sidebar.svelte +39 -39
- package/dist/patterns/layout/index.js +29 -29
- package/dist/patterns/navigation/BottomNav.stories.svelte +117 -117
- package/dist/patterns/navigation/BottomNav.svelte +74 -74
- package/dist/patterns/navigation/Header.stories.svelte +77 -77
- package/dist/patterns/navigation/Header.svelte +251 -255
- package/dist/patterns/navigation/Header.svelte.d.ts.map +1 -1
- package/dist/patterns/page/PageHeader.svelte +18 -18
- package/dist/patterns/page/PageLayout.svelte +40 -40
- package/dist/patterns/page/PageLoader.spec.js +57 -57
- package/dist/patterns/page/PageLoader.stories.svelte +137 -137
- package/dist/patterns/page/PageLoader.svelte +24 -24
- package/dist/patterns/page/SectionHeader.svelte +29 -29
- package/dist/presets/badges.js +112 -112
- package/dist/presets/buttons.js +76 -76
- package/dist/presets/index.js +9 -9
- package/dist/primitives/Accordion/Accordion.stories.svelte +75 -75
- package/dist/primitives/Accordion/Accordion.svelte +42 -42
- package/dist/primitives/Accordion/AccordionItem.svelte +95 -95
- package/dist/primitives/Alert/Alert.spec.js +173 -173
- package/dist/primitives/Alert/Alert.stories.svelte +88 -88
- package/dist/primitives/Alert/Alert.svelte +27 -27
- package/dist/primitives/Avatar/Avatar.stories.svelte +94 -94
- package/dist/primitives/Avatar/Avatar.svelte +66 -66
- 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/Badges/Badge.spec.js +144 -144
- package/dist/primitives/Badges/Badge.stories.svelte +86 -86
- package/dist/primitives/Badges/Badge.svelte +99 -99
- package/dist/primitives/BottomSheet/BottomSheet.spec.js +136 -136
- package/dist/primitives/BottomSheet/BottomSheet.stories.svelte +83 -83
- package/dist/primitives/BottomSheet/BottomSheet.svelte +100 -100
- 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/Breadcrumb/Breadcrumb.spec.js +123 -122
- package/dist/primitives/Breadcrumb/Breadcrumb.stories.svelte +23 -23
- package/dist/primitives/Breadcrumb/Breadcrumb.svelte +99 -98
- package/dist/primitives/Button/Button.spec.js +223 -223
- package/dist/primitives/Button/Button.stories.svelte +76 -76
- package/dist/primitives/Button/Button.svelte +278 -283
- package/dist/primitives/Button/Button.svelte.d.ts +2 -0
- package/dist/primitives/Button/Button.svelte.d.ts.map +1 -1
- package/dist/primitives/Button/ButtonGroup.svelte +50 -50
- package/dist/primitives/Button/ButtonSaveDemo.spec.js +146 -146
- package/dist/primitives/Button/ButtonSaveDemo.svelte +25 -25
- package/dist/primitives/Button/ButtonVariantShowcase.svelte +129 -129
- package/dist/primitives/Card.spec.js +49 -49
- package/dist/primitives/Card.stories.svelte +22 -22
- package/dist/primitives/Card.svelte +28 -28
- 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/Checkbox/Checkbox.stories.svelte +84 -84
- package/dist/primitives/Checkbox/Checkbox.svelte +88 -88
- package/dist/primitives/DarkModeToggle.spec.js +390 -390
- package/dist/primitives/DarkModeToggle.stories.svelte +57 -57
- package/dist/primitives/DarkModeToggle.svelte +136 -136
- package/dist/primitives/Drawer/Drawer.spec.js +33 -33
- package/dist/primitives/Drawer/Drawer.stories.svelte +80 -80
- package/dist/primitives/Drawer/Drawer.svelte +123 -127
- package/dist/primitives/Drawer/Drawer.svelte.d.ts +2 -3
- package/dist/primitives/Drawer/Drawer.svelte.d.ts.map +1 -1
- package/dist/primitives/Dropdown/Dropdown.stories.svelte +137 -137
- package/dist/primitives/Dropdown/Dropdown.svelte +170 -170
- package/dist/primitives/Dropdown/DropdownDivider.svelte +9 -9
- package/dist/primitives/Dropdown/DropdownItem.svelte +80 -80
- package/dist/primitives/Helper/Helper.svelte +33 -33
- package/dist/primitives/Icons/ArrowLeft.svelte +8 -8
- package/dist/primitives/Icons/ArrowRight.svelte +8 -8
- package/dist/primitives/Icons/Availability.svelte +14 -14
- package/dist/primitives/Icons/Back.svelte +14 -14
- package/dist/primitives/Icons/CheckCircle.svelte +6 -6
- package/dist/primitives/Icons/CheckCircleOutline.svelte +15 -15
- package/dist/primitives/Icons/ChevronLeft.svelte +4 -4
- package/dist/primitives/Icons/ChevronRight.svelte +4 -4
- package/dist/primitives/Icons/Copy.svelte +15 -15
- package/dist/primitives/Icons/Cross.svelte +5 -5
- package/dist/primitives/Icons/DownArrow.svelte +8 -8
- package/dist/primitives/Icons/ErrorCircle.svelte +6 -6
- package/dist/primitives/Icons/FacebookIcon.svelte +2 -2
- package/dist/primitives/Icons/Home.svelte +15 -15
- package/dist/primitives/Icons/Icon.spec.js +169 -169
- package/dist/primitives/Icons/Icon.stories.svelte +100 -100
- package/dist/primitives/Icons/Icon.svelte +52 -52
- package/dist/primitives/Icons/IconGallery.stories.svelte +235 -235
- package/dist/primitives/Icons/Info.svelte +7 -7
- package/dist/primitives/Icons/InstagramIcon.svelte +4 -4
- package/dist/primitives/Icons/LogoInstagram.svelte +2 -2
- package/dist/primitives/Icons/Message.svelte +15 -15
- package/dist/primitives/Icons/MoonIcon.svelte +5 -5
- package/dist/primitives/Icons/More.svelte +21 -21
- package/dist/primitives/Icons/MoreHori.spec.js +61 -61
- package/dist/primitives/Icons/MoreHori.svelte +22 -22
- package/dist/primitives/Icons/Notification.svelte +14 -14
- package/dist/primitives/Icons/Payment.svelte +14 -14
- package/dist/primitives/Icons/Profile.svelte +21 -21
- package/dist/primitives/Icons/Reload.svelte +29 -29
- package/dist/primitives/Icons/Shows.svelte +21 -21
- package/dist/primitives/Icons/Signout.svelte +21 -21
- package/dist/primitives/Icons/SunIcon.svelte +8 -8
- package/dist/primitives/Icons/TiktokIcon.svelte +2 -2
- package/dist/primitives/Icons/TwitterIcon.svelte +2 -2
- package/dist/primitives/Icons/WarningIcon.spec.js +18 -18
- package/dist/primitives/Icons/WarningIcon.svelte +5 -5
- package/dist/primitives/Input/Input.spec.js +573 -573
- package/dist/primitives/Input/Input.stories.svelte +139 -139
- package/dist/primitives/Input/Input.svelte +423 -423
- package/dist/primitives/Input/Select.spec.js +218 -218
- package/dist/primitives/Input/Select.stories.svelte +112 -112
- package/dist/primitives/Input/Select.svelte +252 -252
- package/dist/primitives/Input/Textarea.stories.svelte +137 -137
- package/dist/primitives/Input/Textarea.svelte +105 -105
- package/dist/primitives/Label/Label.svelte +37 -37
- 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 +99 -99
- package/dist/primitives/Modal/Modal.stories.svelte +86 -86
- package/dist/primitives/Modal/Modal.svelte +181 -157
- package/dist/primitives/Modal/Modal.svelte.d.ts +7 -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/Pagination/Pagination.stories.svelte +76 -76
- package/dist/primitives/Pagination/Pagination.svelte +261 -261
- package/dist/primitives/Radio/Radio.stories.svelte +80 -80
- package/dist/primitives/Radio/Radio.svelte +67 -67
- 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/Skeleton/CardPlaceholder.svelte +87 -87
- package/dist/primitives/Skeleton/ImagePlaceholder.svelte +59 -59
- package/dist/primitives/Skeleton/ListPlaceholder.svelte +76 -76
- package/dist/primitives/Skeleton/Skeleton.stories.svelte +151 -151
- package/dist/primitives/Skeleton/Skeleton.svelte +26 -26
- package/dist/primitives/Spinner/Spinner.spec.js +71 -71
- package/dist/primitives/Spinner/Spinner.stories.svelte +29 -29
- package/dist/primitives/Spinner/Spinner.svelte +20 -20
- package/dist/primitives/Tabs/TabItem.svelte +49 -49
- package/dist/primitives/Tabs/Tabs.stories.svelte +112 -112
- package/dist/primitives/Tabs/Tabs.svelte +137 -137
- package/dist/primitives/Toggle.spec.js +146 -146
- package/dist/primitives/Toggle.stories.svelte +92 -92
- package/dist/primitives/Toggle.svelte +141 -131
- package/dist/primitives/Toggle.svelte.d.ts +2 -0
- package/dist/primitives/Toggle.svelte.d.ts.map +1 -1
- package/dist/primitives/Tooltip/Tooltip.svelte +83 -83
- package/dist/primitives/Typography/Typography.svelte +53 -53
- package/dist/primitives/ValidationError.spec.js +103 -103
- package/dist/primitives/ValidationError.stories.svelte +69 -69
- package/dist/primitives/ValidationError.svelte +29 -29
- package/dist/primitives/index.d.ts +7 -0
- package/dist/primitives/index.js +113 -92
- package/dist/recipes/CropImage/CropImage.spec.js +208 -208
- package/dist/recipes/CropImage/CropImage.stories.svelte +104 -104
- package/dist/recipes/CropImage/CropImage.svelte +219 -219
- package/dist/recipes/ImageUploader/ImageUploader.stories.svelte +125 -125
- package/dist/recipes/ImageUploader/ImageUploader.svelte +970 -970
- package/dist/recipes/SuperLogin/SuperLogin.svelte +3 -3
- package/dist/recipes/SuperLogin/SuperLogin.svelte.d.ts.map +1 -1
- package/dist/recipes/Toaster/Toaster.stories.svelte +62 -62
- package/dist/recipes/feedback/EmptyState/EmptyState.svelte +1 -1
- package/dist/recipes/feedback/ErrorDisplay.spec.js +69 -69
- package/dist/recipes/feedback/ErrorDisplay.stories.svelte +101 -101
- package/dist/recipes/feedback/ErrorDisplay.svelte +1 -1
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.spec.js +133 -133
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.svelte +157 -157
- package/dist/recipes/fields/CheckboxField.svelte +85 -85
- package/dist/recipes/fields/FormField.svelte +58 -58
- package/dist/recipes/fields/RadioGroup.svelte +95 -95
- package/dist/recipes/fields/SelectField.svelte +80 -80
- package/dist/recipes/fields/TextareaField.svelte +97 -97
- package/dist/recipes/fields/ToggleField.svelte +60 -60
- package/dist/recipes/fields/index.js +7 -7
- package/dist/recipes/inputs/MultiSelect.spec.js +260 -260
- package/dist/recipes/inputs/MultiSelect.stories.svelte +133 -133
- package/dist/recipes/inputs/MultiSelect.svelte +283 -283
- package/dist/recipes/inputs/OTPInput.spec.js +251 -251
- package/dist/recipes/inputs/OTPInput.stories.svelte +162 -162
- package/dist/recipes/inputs/OTPInput.svelte +117 -117
- package/dist/recipes/inputs/PasswordInput.svelte +22 -22
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte +131 -131
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.stories.svelte +123 -123
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte +344 -344
- package/dist/recipes/inputs/Search.svelte +102 -102
- 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 +130 -130
- package/dist/recipes/modals/AlertModal.svelte.d.ts +3 -3
- package/dist/recipes/modals/ConfirmationModal.spec.js +206 -206
- package/dist/recipes/modals/ConfirmationModal.stories.svelte +119 -119
- package/dist/recipes/modals/ConfirmationModal.svelte +162 -152
- package/dist/recipes/modals/ConfirmationModal.svelte.d.ts +5 -3
- package/dist/recipes/modals/ConfirmationModal.svelte.d.ts.map +1 -1
- package/dist/recipes/modals/InputModal.spec.js +2 -2
- package/dist/recipes/modals/InputModal.svelte +182 -182
- package/dist/recipes/modals/InputModal.svelte.d.ts +3 -3
- package/dist/recipes/modals/ModalStateManager.spec.js +100 -100
- package/dist/recipes/modals/ModalStateManager.svelte +77 -77
- package/dist/recipes/modals/ModalTestWrapper.spec.js +49 -49
- package/dist/recipes/modals/ModalTestWrapper.svelte +65 -65
- 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 +206 -206
- package/dist/recipes/modals/StatusModal.svelte.d.ts +3 -3
- package/dist/services/EventService.js +75 -75
- package/dist/services/EventService.spec.js +217 -217
- package/dist/services/ShowService.spec.js +345 -345
- package/dist/stores/toaster.js +13 -13
- package/dist/stories/ButtonAuditReview.stories.svelte +14 -14
- package/dist/stories/ButtonAuditReview.svelte +427 -427
- package/dist/stories/ComponentConsolidation.stories.svelte +10 -10
- package/dist/stories/PatternsGallery.stories.svelte +19 -19
- package/dist/stories/PatternsGallery.svelte +206 -206
- package/dist/stories/PrimitivesGallery.stories.svelte +19 -19
- package/dist/stories/PrimitivesGallery.svelte +756 -752
- package/dist/stories/PrimitivesGallery.svelte.d.ts.map +1 -1
- package/dist/stories/RecipesGallery.spec.js +9 -18
- package/dist/stories/RecipesGallery.stories.svelte +19 -19
- package/dist/stories/RecipesGallery.svelte +454 -471
- package/dist/stories/RecipesGallery.svelte.d.ts.map +1 -1
- package/dist/stories/button-audit-manifest.json +11186 -11186
- package/dist/tailwind/preset.cjs +82 -82
- package/dist/telemetry.js +405 -405
- package/dist/telemetry.spec.js +1169 -1169
- package/dist/tokens/tokens.css +87 -87
- package/dist/tokens/typography-base.css +163 -163
- package/dist/tokens/utilities.css +353 -353
- package/dist/utils/apiConfig.spec.js +219 -219
- package/dist/utils/haptic.d.ts +41 -0
- package/dist/utils/haptic.d.ts.map +1 -0
- package/dist/utils/haptic.js +115 -0
- package/dist/utils/transitions.js +4 -4
- package/dist/utils/utils.js +693 -693
- package/package.json +297 -297
- 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
|
@@ -1,471 +1,454 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// ============================================================================
|
|
3
|
-
// RECIPES VISUAL GALLERY
|
|
4
|
-
// Displays ALL recipe components (Layer 2) - Domain-agnostic compositions
|
|
5
|
-
// ============================================================================
|
|
6
|
-
|
|
7
|
-
// Feedback
|
|
8
|
-
import EmptyState from '../recipes/feedback/EmptyState/EmptyState.svelte';
|
|
9
|
-
import ErrorDisplay from '../recipes/feedback/ErrorDisplay.svelte';
|
|
10
|
-
import StatusIndicator from '../recipes/feedback/StatusIndicator/StatusIndicator.svelte';
|
|
11
|
-
|
|
12
|
-
// Inputs
|
|
13
|
-
import MultiSelect from '../recipes/inputs/MultiSelect.svelte';
|
|
14
|
-
import OTPInput from '../recipes/inputs/OTPInput.svelte';
|
|
15
|
-
import PasswordInput from '../recipes/inputs/PasswordInput.svelte';
|
|
16
|
-
import PasswordStrengthIndicator from '../recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte';
|
|
17
|
-
import Search from '../recipes/inputs/Search.svelte';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
import
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
let
|
|
44
|
-
let
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
//
|
|
49
|
-
let
|
|
50
|
-
let
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
let
|
|
57
|
-
let
|
|
58
|
-
let
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
{ value: '
|
|
81
|
-
{ value: '
|
|
82
|
-
{ value: '
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
{ value: '
|
|
90
|
-
{ value: '
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
>
|
|
146
|
-
<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
<
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
{
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
>
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
</div>
|
|
216
|
-
|
|
217
|
-
<div>
|
|
218
|
-
<
|
|
219
|
-
label="
|
|
220
|
-
|
|
221
|
-
bind:value={
|
|
222
|
-
|
|
223
|
-
/>
|
|
224
|
-
</div>
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
<div>
|
|
266
|
-
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">
|
|
267
|
-
<
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
<
|
|
277
|
-
</div>
|
|
278
|
-
|
|
279
|
-
<div>
|
|
280
|
-
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">
|
|
281
|
-
<
|
|
282
|
-
|
|
283
|
-
bind:value={
|
|
284
|
-
/>
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
<
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
bind:value={
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
<
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
showStatusModal =
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
<
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
label="Language"
|
|
456
|
-
items={[
|
|
457
|
-
{ value: 'en', name: 'English' },
|
|
458
|
-
{ value: 'es', name: 'Spanish' },
|
|
459
|
-
{ value: 'fr', name: 'French' },
|
|
460
|
-
]}
|
|
461
|
-
placeholder="Select language"
|
|
462
|
-
/>
|
|
463
|
-
<div class="flex justify-end gap-2 pt-4">
|
|
464
|
-
<Button variant="ghost">Cancel</Button>
|
|
465
|
-
<Button>Save Changes</Button>
|
|
466
|
-
</div>
|
|
467
|
-
</div>
|
|
468
|
-
</Card>
|
|
469
|
-
</div>
|
|
470
|
-
</section>
|
|
471
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// ============================================================================
|
|
3
|
+
// RECIPES VISUAL GALLERY
|
|
4
|
+
// Displays ALL recipe components (Layer 2) - Domain-agnostic compositions
|
|
5
|
+
// ============================================================================
|
|
6
|
+
|
|
7
|
+
// Feedback
|
|
8
|
+
import EmptyState from '../recipes/feedback/EmptyState/EmptyState.svelte';
|
|
9
|
+
import ErrorDisplay from '../recipes/feedback/ErrorDisplay.svelte';
|
|
10
|
+
import StatusIndicator from '../recipes/feedback/StatusIndicator/StatusIndicator.svelte';
|
|
11
|
+
|
|
12
|
+
// Inputs
|
|
13
|
+
import MultiSelect from '../recipes/inputs/MultiSelect.svelte';
|
|
14
|
+
import OTPInput from '../recipes/inputs/OTPInput.svelte';
|
|
15
|
+
import PasswordInput from '../recipes/inputs/PasswordInput.svelte';
|
|
16
|
+
import PasswordStrengthIndicator from '../recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte';
|
|
17
|
+
import Search from '../recipes/inputs/Search.svelte';
|
|
18
|
+
|
|
19
|
+
// Modals
|
|
20
|
+
import AlertModal from '../recipes/modals/AlertModal.svelte';
|
|
21
|
+
import ConfirmationModal from '../recipes/modals/ConfirmationModal.svelte';
|
|
22
|
+
import InputModal from '../recipes/modals/InputModal.svelte';
|
|
23
|
+
import StatusModal from '../recipes/modals/StatusModal.svelte';
|
|
24
|
+
|
|
25
|
+
// Fields
|
|
26
|
+
import CheckboxField from '../recipes/fields/CheckboxField.svelte';
|
|
27
|
+
import FormField from '../recipes/fields/FormField.svelte';
|
|
28
|
+
import RadioGroup from '../recipes/fields/RadioGroup.svelte';
|
|
29
|
+
import SelectField from '../recipes/fields/SelectField.svelte';
|
|
30
|
+
import TextareaField from '../recipes/fields/TextareaField.svelte';
|
|
31
|
+
import ToggleField from '../recipes/fields/ToggleField.svelte';
|
|
32
|
+
|
|
33
|
+
// Primitives for demos
|
|
34
|
+
import Button from '../primitives/Button/Button.svelte';
|
|
35
|
+
import Card from '../primitives/Card.svelte';
|
|
36
|
+
|
|
37
|
+
// State
|
|
38
|
+
let isDark = $state(false);
|
|
39
|
+
|
|
40
|
+
// Modal states
|
|
41
|
+
let showAlertModal = $state(false);
|
|
42
|
+
let showConfirmModal = $state(false);
|
|
43
|
+
let showInputModal = $state(false);
|
|
44
|
+
let showStatusModal = $state(false);
|
|
45
|
+
let statusModalType = $state<'success' | 'error' | 'loading'>('success');
|
|
46
|
+
|
|
47
|
+
// Input states
|
|
48
|
+
let otpValue = $state<string[]>(['', '', '', '', '', '']); // OTPInput expects string[]
|
|
49
|
+
let passwordValue = $state('');
|
|
50
|
+
let searchValue = $state('');
|
|
51
|
+
let multiSelectValue = $state<string[]>([]);
|
|
52
|
+
|
|
53
|
+
// Field states
|
|
54
|
+
let checkboxChecked = $state(false);
|
|
55
|
+
let toggleChecked = $state(false);
|
|
56
|
+
let radioValue = $state('');
|
|
57
|
+
let textareaValue = $state('');
|
|
58
|
+
let selectFieldValue = $state('');
|
|
59
|
+
let formFieldValue = $state('');
|
|
60
|
+
|
|
61
|
+
function toggleDark() {
|
|
62
|
+
isDark = !isDark;
|
|
63
|
+
document.documentElement.classList.toggle('dark', isDark);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Section styling
|
|
67
|
+
const sectionClass = (dark: boolean) =>
|
|
68
|
+
`rounded-xl p-6 ${dark ? 'bg-gray-800 border-gray-700' : 'bg-white border-gray-200'} border`;
|
|
69
|
+
|
|
70
|
+
const headingClass = (dark: boolean) =>
|
|
71
|
+
`text-xl font-semibold mb-1 ${dark ? 'text-white' : 'text-gray-900'}`;
|
|
72
|
+
|
|
73
|
+
const subheadingClass = (dark: boolean) =>
|
|
74
|
+
`text-sm mb-4 ${dark ? 'text-gray-400' : 'text-gray-500'}`;
|
|
75
|
+
|
|
76
|
+
// Demo data - MultiSelect uses 'items' with {name, value} format
|
|
77
|
+
const multiSelectItems = [
|
|
78
|
+
{ value: 'react', name: 'React' },
|
|
79
|
+
{ value: 'vue', name: 'Vue' },
|
|
80
|
+
{ value: 'svelte', name: 'Svelte' },
|
|
81
|
+
{ value: 'angular', name: 'Angular' },
|
|
82
|
+
{ value: 'solid', name: 'Solid' },
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
// SelectField uses 'items' with {name, value} format
|
|
86
|
+
const selectFieldItems = [
|
|
87
|
+
{ value: 'sm', name: 'Small' },
|
|
88
|
+
{ value: 'md', name: 'Medium' },
|
|
89
|
+
{ value: 'lg', name: 'Large' },
|
|
90
|
+
{ value: 'xl', name: 'Extra Large' },
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
const radioOptions = [
|
|
94
|
+
{ value: 'daily', label: 'Daily', description: 'Get updates every day' },
|
|
95
|
+
{ value: 'weekly', label: 'Weekly', description: 'Get updates once a week' },
|
|
96
|
+
{ value: 'monthly', label: 'Monthly', description: 'Get updates once a month' },
|
|
97
|
+
];
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<div class="min-h-screen p-6 space-y-8 {isDark ? 'bg-gray-900' : 'bg-gray-50'}">
|
|
101
|
+
<!-- Header -->
|
|
102
|
+
<div class="flex items-center justify-between mb-8">
|
|
103
|
+
<div>
|
|
104
|
+
<h1 class="text-3xl font-bold {isDark ? 'text-white' : 'text-gray-900'}">Recipes Gallery</h1>
|
|
105
|
+
<p class="{isDark ? 'text-gray-400' : 'text-gray-600'}">Domain-agnostic compositions (Layer 2)</p>
|
|
106
|
+
</div>
|
|
107
|
+
<button
|
|
108
|
+
onclick={toggleDark}
|
|
109
|
+
class="px-4 py-2 rounded-lg font-medium {isDark ? 'bg-yellow-500 text-black' : 'bg-gray-800 text-white'}"
|
|
110
|
+
>
|
|
111
|
+
{isDark ? '☀️ Light' : '🌙 Dark'}
|
|
112
|
+
</button>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<!-- ========== FEEDBACK COMPONENTS ========== -->
|
|
116
|
+
<section class={sectionClass(isDark)}>
|
|
117
|
+
<h2 class={headingClass(isDark)}>Feedback Components</h2>
|
|
118
|
+
<p class={subheadingClass(isDark)}>EmptyState, ErrorDisplay, StatusIndicator</p>
|
|
119
|
+
|
|
120
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
121
|
+
<Card>
|
|
122
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">EmptyState</p>
|
|
123
|
+
<EmptyState
|
|
124
|
+
title="No items yet"
|
|
125
|
+
description="Get started by creating your first item"
|
|
126
|
+
>
|
|
127
|
+
<Button size="sm">Create Item</Button>
|
|
128
|
+
</EmptyState>
|
|
129
|
+
</Card>
|
|
130
|
+
|
|
131
|
+
<Card>
|
|
132
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">ErrorDisplay</p>
|
|
133
|
+
<ErrorDisplay
|
|
134
|
+
title="Something went wrong"
|
|
135
|
+
message="We couldn't load the data. Please try again."
|
|
136
|
+
>
|
|
137
|
+
<Button size="sm" variant="outline">Retry</Button>
|
|
138
|
+
</ErrorDisplay>
|
|
139
|
+
</Card>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<div class="mt-6">
|
|
143
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-3">StatusIndicator</p>
|
|
144
|
+
<div class="flex flex-wrap gap-6">
|
|
145
|
+
<div class="flex items-center gap-2">
|
|
146
|
+
<StatusIndicator status="active" />
|
|
147
|
+
<span class={isDark ? 'text-white' : 'text-gray-900'}>Active</span>
|
|
148
|
+
</div>
|
|
149
|
+
<div class="flex items-center gap-2">
|
|
150
|
+
<StatusIndicator status="pending" />
|
|
151
|
+
<span class={isDark ? 'text-white' : 'text-gray-900'}>Pending</span>
|
|
152
|
+
</div>
|
|
153
|
+
<div class="flex items-center gap-2">
|
|
154
|
+
<StatusIndicator status="inactive" />
|
|
155
|
+
<span class={isDark ? 'text-white' : 'text-gray-900'}>Inactive</span>
|
|
156
|
+
</div>
|
|
157
|
+
<div class="flex items-center gap-2">
|
|
158
|
+
<StatusIndicator status="error" />
|
|
159
|
+
<span class={isDark ? 'text-white' : 'text-gray-900'}>Error</span>
|
|
160
|
+
</div>
|
|
161
|
+
<div class="flex items-center gap-2">
|
|
162
|
+
<StatusIndicator status="success" />
|
|
163
|
+
<span class={isDark ? 'text-white' : 'text-gray-900'}>Success</span>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
</section>
|
|
168
|
+
|
|
169
|
+
<!-- ========== FORM FIELDS ========== -->
|
|
170
|
+
<section class={sectionClass(isDark)}>
|
|
171
|
+
<h2 class={headingClass(isDark)}>Form Fields</h2>
|
|
172
|
+
<p class={subheadingClass(isDark)}>Composed field components with labels, validation, and help text</p>
|
|
173
|
+
|
|
174
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
175
|
+
<div>
|
|
176
|
+
<FormField
|
|
177
|
+
label="Full Name"
|
|
178
|
+
hint="Enter your legal name"
|
|
179
|
+
>
|
|
180
|
+
{#snippet children({ id, error })}
|
|
181
|
+
<input
|
|
182
|
+
{id}
|
|
183
|
+
type="text"
|
|
184
|
+
placeholder="John Doe"
|
|
185
|
+
bind:value={formFieldValue}
|
|
186
|
+
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-700 focus:outline-hidden focus:ring-2 focus:ring-blue-500"
|
|
187
|
+
/>
|
|
188
|
+
{/snippet}
|
|
189
|
+
</FormField>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
<div>
|
|
193
|
+
<FormField
|
|
194
|
+
label="Email (with error)"
|
|
195
|
+
error="Please enter a valid email address"
|
|
196
|
+
>
|
|
197
|
+
{#snippet children({ id, error })}
|
|
198
|
+
<input
|
|
199
|
+
{id}
|
|
200
|
+
type="email"
|
|
201
|
+
placeholder="email@example.com"
|
|
202
|
+
class="w-full px-3 py-2 border {error ? 'border-red-500' : 'border-gray-300 dark:border-gray-600'} rounded-lg bg-gray-50 dark:bg-gray-700 focus:outline-hidden focus:ring-2 focus:ring-blue-500"
|
|
203
|
+
/>
|
|
204
|
+
{/snippet}
|
|
205
|
+
</FormField>
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
<div>
|
|
209
|
+
<SelectField
|
|
210
|
+
label="Size"
|
|
211
|
+
items={selectFieldItems}
|
|
212
|
+
bind:value={selectFieldValue}
|
|
213
|
+
placeholder="Choose a size"
|
|
214
|
+
/>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<div>
|
|
218
|
+
<TextareaField
|
|
219
|
+
label="Bio"
|
|
220
|
+
placeholder="Tell us about yourself..."
|
|
221
|
+
bind:value={textareaValue}
|
|
222
|
+
hint="Maximum 500 characters"
|
|
223
|
+
/>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<div class="mt-6 space-y-4">
|
|
228
|
+
<CheckboxField
|
|
229
|
+
label="I agree to the terms and conditions"
|
|
230
|
+
description="You must agree to continue"
|
|
231
|
+
bind:checked={checkboxChecked}
|
|
232
|
+
/>
|
|
233
|
+
|
|
234
|
+
<ToggleField
|
|
235
|
+
label="Enable notifications"
|
|
236
|
+
description="Receive email updates about your account"
|
|
237
|
+
bind:checked={toggleChecked}
|
|
238
|
+
/>
|
|
239
|
+
|
|
240
|
+
<div class="max-w-md">
|
|
241
|
+
<RadioGroup
|
|
242
|
+
label="Update frequency"
|
|
243
|
+
options={radioOptions}
|
|
244
|
+
bind:value={radioValue}
|
|
245
|
+
/>
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
</section>
|
|
249
|
+
|
|
250
|
+
<!-- ========== SPECIAL INPUTS ========== -->
|
|
251
|
+
<section class={sectionClass(isDark)}>
|
|
252
|
+
<h2 class={headingClass(isDark)}>Special Inputs</h2>
|
|
253
|
+
<p class={subheadingClass(isDark)}>Password, OTP, Search, MultiSelect</p>
|
|
254
|
+
|
|
255
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
|
256
|
+
<div>
|
|
257
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">PasswordInput</p>
|
|
258
|
+
<PasswordInput
|
|
259
|
+
label="Password"
|
|
260
|
+
placeholder="Enter password"
|
|
261
|
+
bind:value={passwordValue}
|
|
262
|
+
/>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
<div>
|
|
266
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">PasswordStrengthIndicator</p>
|
|
267
|
+
<PasswordStrengthIndicator password={passwordValue} />
|
|
268
|
+
</div>
|
|
269
|
+
|
|
270
|
+
<div>
|
|
271
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">OTPInput (6 digits)</p>
|
|
272
|
+
<OTPInput
|
|
273
|
+
length={6}
|
|
274
|
+
bind:value={otpValue}
|
|
275
|
+
/>
|
|
276
|
+
<p class="text-sm text-gray-500 mt-2">Value: {otpValue || '(empty)'}</p>
|
|
277
|
+
</div>
|
|
278
|
+
|
|
279
|
+
<div>
|
|
280
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">Search</p>
|
|
281
|
+
<Search
|
|
282
|
+
placeholder="Search..."
|
|
283
|
+
bind:value={searchValue}
|
|
284
|
+
/>
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
<div>
|
|
288
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">MultiSelect</p>
|
|
289
|
+
<MultiSelect
|
|
290
|
+
label="Frameworks"
|
|
291
|
+
items={multiSelectItems}
|
|
292
|
+
bind:value={multiSelectValue}
|
|
293
|
+
placeholder="Select frameworks"
|
|
294
|
+
/>
|
|
295
|
+
</div>
|
|
296
|
+
|
|
297
|
+
</div>
|
|
298
|
+
</section>
|
|
299
|
+
|
|
300
|
+
<!-- ========== MODALS ========== -->
|
|
301
|
+
<section class={sectionClass(isDark)}>
|
|
302
|
+
<h2 class={headingClass(isDark)}>Modals</h2>
|
|
303
|
+
<p class={subheadingClass(isDark)}>AlertModal, ConfirmationModal, InputModal, StatusModal</p>
|
|
304
|
+
|
|
305
|
+
<div class="flex flex-wrap gap-4">
|
|
306
|
+
<Button onclick={() => showAlertModal = true}>
|
|
307
|
+
Open AlertModal
|
|
308
|
+
</Button>
|
|
309
|
+
|
|
310
|
+
<Button variant="alternative" onclick={() => showConfirmModal = true}>
|
|
311
|
+
Open ConfirmationModal
|
|
312
|
+
</Button>
|
|
313
|
+
|
|
314
|
+
<Button variant="outline" onclick={() => showInputModal = true}>
|
|
315
|
+
Open InputModal
|
|
316
|
+
</Button>
|
|
317
|
+
|
|
318
|
+
<Button variant="ghost" onclick={() => {
|
|
319
|
+
statusModalType = 'success';
|
|
320
|
+
showStatusModal = true;
|
|
321
|
+
setTimeout(() => showStatusModal = false, 2000);
|
|
322
|
+
}}>
|
|
323
|
+
StatusModal (Success)
|
|
324
|
+
</Button>
|
|
325
|
+
|
|
326
|
+
<Button variant="ghost" onclick={() => {
|
|
327
|
+
statusModalType = 'error';
|
|
328
|
+
showStatusModal = true;
|
|
329
|
+
setTimeout(() => showStatusModal = false, 2000);
|
|
330
|
+
}}>
|
|
331
|
+
StatusModal (Error)
|
|
332
|
+
</Button>
|
|
333
|
+
|
|
334
|
+
<Button variant="ghost" onclick={() => {
|
|
335
|
+
statusModalType = 'loading';
|
|
336
|
+
showStatusModal = true;
|
|
337
|
+
setTimeout(() => showStatusModal = false, 2000);
|
|
338
|
+
}}>
|
|
339
|
+
StatusModal (Loading)
|
|
340
|
+
</Button>
|
|
341
|
+
</div>
|
|
342
|
+
</section>
|
|
343
|
+
|
|
344
|
+
<!-- AlertModal -->
|
|
345
|
+
<AlertModal
|
|
346
|
+
bind:open={showAlertModal}
|
|
347
|
+
title="Alert"
|
|
348
|
+
message="This is an alert message that requires your attention."
|
|
349
|
+
buttonText="OK"
|
|
350
|
+
onconfirm={() => showAlertModal = false}
|
|
351
|
+
onclose={() => showAlertModal = false}
|
|
352
|
+
/>
|
|
353
|
+
|
|
354
|
+
<!-- ConfirmationModal -->
|
|
355
|
+
<ConfirmationModal
|
|
356
|
+
bind:open={showConfirmModal}
|
|
357
|
+
title="Confirm Action"
|
|
358
|
+
description="Are you sure you want to proceed? This action cannot be undone."
|
|
359
|
+
primaryButtonText="Yes, proceed"
|
|
360
|
+
secondaryButtonText="Cancel"
|
|
361
|
+
onconfirm={() => {
|
|
362
|
+
showConfirmModal = false;
|
|
363
|
+
console.log('Confirmed!');
|
|
364
|
+
}}
|
|
365
|
+
oncancel={() => showConfirmModal = false}
|
|
366
|
+
onclose={() => showConfirmModal = false}
|
|
367
|
+
/>
|
|
368
|
+
|
|
369
|
+
<!-- InputModal -->
|
|
370
|
+
<InputModal
|
|
371
|
+
bind:open={showInputModal}
|
|
372
|
+
title="Enter Information"
|
|
373
|
+
inputLabel="Name"
|
|
374
|
+
inputPlaceholder="Enter your name"
|
|
375
|
+
primaryButtonText="Submit"
|
|
376
|
+
onconfirm={(detail: { value: string }) => {
|
|
377
|
+
console.log('Submitted:', detail.value);
|
|
378
|
+
showInputModal = false;
|
|
379
|
+
}}
|
|
380
|
+
oncancel={() => showInputModal = false}
|
|
381
|
+
onclose={() => showInputModal = false}
|
|
382
|
+
/>
|
|
383
|
+
|
|
384
|
+
<!-- StatusModal -->
|
|
385
|
+
<StatusModal
|
|
386
|
+
bind:open={showStatusModal}
|
|
387
|
+
iconType={statusModalType}
|
|
388
|
+
title={statusModalType === 'loading' ? 'Processing...' : statusModalType === 'success' ? 'Success!' : 'Error'}
|
|
389
|
+
description={statusModalType === 'loading' ? 'Please wait...' : statusModalType === 'success' ? 'Operation completed successfully.' : 'Something went wrong.'}
|
|
390
|
+
onconfirm={() => showStatusModal = false}
|
|
391
|
+
onclose={() => showStatusModal = false}
|
|
392
|
+
/>
|
|
393
|
+
|
|
394
|
+
<!-- ========== COMMON PATTERNS ========== -->
|
|
395
|
+
<section class={sectionClass(isDark)}>
|
|
396
|
+
<h2 class={headingClass(isDark)}>Common Recipe Patterns</h2>
|
|
397
|
+
<p class={subheadingClass(isDark)}>How recipes compose together</p>
|
|
398
|
+
|
|
399
|
+
<div class="space-y-6">
|
|
400
|
+
<Card>
|
|
401
|
+
<h4 class="font-medium mb-4">Registration Form Pattern</h4>
|
|
402
|
+
<div class="space-y-4 max-w-md">
|
|
403
|
+
<FormField label="Email">
|
|
404
|
+
{#snippet children({ id })}
|
|
405
|
+
<input
|
|
406
|
+
{id}
|
|
407
|
+
type="email"
|
|
408
|
+
placeholder="email@example.com"
|
|
409
|
+
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-700 focus:outline-hidden focus:ring-2 focus:ring-blue-500"
|
|
410
|
+
/>
|
|
411
|
+
{/snippet}
|
|
412
|
+
</FormField>
|
|
413
|
+
<PasswordInput
|
|
414
|
+
label="Password"
|
|
415
|
+
placeholder="Create a password"
|
|
416
|
+
bind:value={passwordValue}
|
|
417
|
+
/>
|
|
418
|
+
<PasswordStrengthIndicator password={passwordValue} />
|
|
419
|
+
<CheckboxField
|
|
420
|
+
label="I agree to the Terms of Service"
|
|
421
|
+
/>
|
|
422
|
+
<Button size="full">Create Account</Button>
|
|
423
|
+
</div>
|
|
424
|
+
</Card>
|
|
425
|
+
|
|
426
|
+
<Card>
|
|
427
|
+
<h4 class="font-medium mb-4">Settings Form Pattern</h4>
|
|
428
|
+
<div class="space-y-4 max-w-md">
|
|
429
|
+
<ToggleField
|
|
430
|
+
label="Email notifications"
|
|
431
|
+
description="Receive updates via email"
|
|
432
|
+
/>
|
|
433
|
+
<ToggleField
|
|
434
|
+
label="Push notifications"
|
|
435
|
+
description="Receive mobile push notifications"
|
|
436
|
+
/>
|
|
437
|
+
<SelectField
|
|
438
|
+
label="Language"
|
|
439
|
+
items={[
|
|
440
|
+
{ value: 'en', name: 'English' },
|
|
441
|
+
{ value: 'es', name: 'Spanish' },
|
|
442
|
+
{ value: 'fr', name: 'French' },
|
|
443
|
+
]}
|
|
444
|
+
placeholder="Select language"
|
|
445
|
+
/>
|
|
446
|
+
<div class="flex justify-end gap-2 pt-4">
|
|
447
|
+
<Button variant="ghost">Cancel</Button>
|
|
448
|
+
<Button>Save Changes</Button>
|
|
449
|
+
</div>
|
|
450
|
+
</div>
|
|
451
|
+
</Card>
|
|
452
|
+
</div>
|
|
453
|
+
</section>
|
|
454
|
+
</div>
|