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