@getmicdrop/svelte-components 5.4.1 → 5.5.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/PublicCard/PublicCard.svelte +12 -11
- package/dist/calendar/PublicCard/PublicCard.svelte.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +9 -0
- package/dist/calendar/index.d.ts.map +1 -0
- package/dist/calendar/index.js +15 -0
- package/dist/components/Layout/Grid.spec.d.ts +2 -0
- package/dist/components/Layout/Grid.spec.d.ts.map +1 -0
- package/dist/components/Layout/Grid.spec.js +230 -0
- package/dist/components/Layout/Grid.svelte +97 -105
- package/dist/components/Layout/Grid.svelte.d.ts +16 -6
- package/dist/components/Layout/Grid.svelte.d.ts.map +1 -1
- package/dist/components/Layout/Stack.spec.d.ts +2 -0
- package/dist/components/Layout/Stack.spec.d.ts.map +1 -0
- package/dist/components/Layout/Stack.spec.js +257 -0
- package/dist/components/Layout/Stack.svelte +47 -85
- package/dist/components/Layout/Stack.svelte.d.ts +4 -6
- package/dist/components/Layout/Stack.svelte.d.ts.map +1 -1
- package/dist/components/Layout/__tests__/Grid.test.d.ts +2 -0
- package/dist/components/Layout/__tests__/Grid.test.d.ts.map +1 -0
- package/dist/components/Layout/__tests__/Grid.test.js +246 -0
- package/dist/components/Layout/__tests__/Stack.test.d.ts +2 -0
- package/dist/components/Layout/__tests__/Stack.test.d.ts.map +1 -0
- package/dist/components/Layout/__tests__/Stack.test.js +267 -0
- package/dist/constants/formOptions.spec.d.ts.map +1 -1
- package/dist/constants/formOptions.spec.js +69 -82
- package/dist/datetime/__tests__/format.test.js +81 -1
- package/dist/datetime/format.d.ts +74 -0
- package/dist/datetime/format.d.ts.map +1 -1
- package/dist/datetime/format.js +104 -0
- package/dist/datetime/index.d.ts +1 -1
- package/dist/datetime/index.d.ts.map +1 -1
- package/dist/datetime/index.js +1 -1
- package/dist/datetime/timezone.d.ts.map +1 -1
- package/dist/datetime/timezone.js +2 -0
- package/dist/datetime/types.d.ts +4 -0
- package/dist/datetime/types.d.ts.map +1 -1
- package/dist/forms/createFormStore.svelte.d.ts.map +1 -1
- package/dist/forms/createFormStore.svelte.js +3 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/index.spec.d.ts +2 -0
- package/dist/index.spec.d.ts.map +1 -0
- package/dist/index.spec.js +370 -0
- package/dist/patterns/data/DataTable.svelte +5 -5
- package/dist/patterns/data/index.d.ts +4 -0
- package/dist/patterns/data/index.d.ts.map +1 -0
- package/dist/patterns/data/index.js +4 -0
- package/dist/patterns/forms/FormValidationSummary.spec.d.ts.map +1 -1
- package/dist/patterns/forms/FormValidationSummary.spec.js +181 -203
- package/dist/patterns/forms/FormValidationSummary.stories.svelte +14 -14
- package/dist/patterns/forms/FormValidationSummary.svelte +43 -36
- package/dist/patterns/forms/FormValidationSummary.svelte.d.ts +8 -16
- package/dist/patterns/forms/FormValidationSummary.svelte.d.ts.map +1 -1
- package/dist/patterns/forms/index.d.ts +5 -0
- package/dist/patterns/forms/index.d.ts.map +1 -0
- package/dist/patterns/forms/index.js +5 -0
- package/dist/patterns/index.d.ts +6 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +18 -0
- package/dist/patterns/layout/Stack.svelte +61 -45
- package/dist/patterns/layout/Stack.svelte.d.ts +35 -21
- package/dist/patterns/layout/Stack.svelte.d.ts.map +1 -1
- package/dist/patterns/layout/index.d.ts +5 -0
- package/dist/patterns/layout/index.d.ts.map +1 -0
- package/dist/patterns/layout/index.js +6 -0
- package/dist/patterns/navigation/BottomNav.spec.d.ts.map +1 -1
- package/dist/patterns/navigation/BottomNav.spec.js +104 -130
- package/dist/patterns/navigation/BottomNav.svelte +44 -34
- package/dist/patterns/navigation/BottomNav.svelte.d.ts +10 -10
- package/dist/patterns/navigation/BottomNav.svelte.d.ts.map +1 -1
- package/dist/patterns/navigation/Header.spec.d.ts.map +1 -1
- package/dist/patterns/navigation/Header.spec.js +161 -203
- package/dist/patterns/navigation/Header.svelte +62 -47
- package/dist/patterns/navigation/Header.svelte.d.ts +12 -19
- package/dist/patterns/navigation/Header.svelte.d.ts.map +1 -1
- package/dist/patterns/navigation/index.d.ts +3 -0
- package/dist/patterns/navigation/index.d.ts.map +1 -0
- package/dist/patterns/navigation/index.js +3 -0
- package/dist/patterns/page/PageHeader.svelte +31 -18
- package/dist/patterns/page/PageHeader.svelte.d.ts +12 -18
- package/dist/patterns/page/PageHeader.svelte.d.ts.map +1 -1
- package/dist/patterns/page/PageLoader.svelte +29 -17
- package/dist/patterns/page/PageLoader.svelte.d.ts +9 -20
- package/dist/patterns/page/PageLoader.svelte.d.ts.map +1 -1
- package/dist/patterns/page/SectionHeader.svelte +22 -12
- package/dist/patterns/page/SectionHeader.svelte.d.ts +8 -17
- package/dist/patterns/page/SectionHeader.svelte.d.ts.map +1 -1
- package/dist/patterns/page/index.d.ts +5 -0
- package/dist/patterns/page/index.d.ts.map +1 -0
- package/dist/patterns/page/index.js +5 -0
- package/dist/primitives/Accordion/Accordion.svelte +20 -19
- package/dist/primitives/Accordion/Accordion.svelte.d.ts.map +1 -1
- package/dist/primitives/Alert/Alert.svelte +37 -38
- package/dist/primitives/Alert/Alert.svelte.d.ts +2 -1
- package/dist/primitives/Alert/Alert.svelte.d.ts.map +1 -1
- package/dist/primitives/Badges/Badge.svelte +20 -63
- package/dist/primitives/Badges/Badge.svelte.d.ts +4 -2
- package/dist/primitives/Badges/Badge.svelte.d.ts.map +1 -1
- package/dist/primitives/Button/Button.svelte +39 -70
- package/dist/primitives/Button/Button.svelte.d.ts +10 -26
- package/dist/primitives/Button/Button.svelte.d.ts.map +1 -1
- package/dist/primitives/Drawer/Drawer.stories.svelte +20 -20
- package/dist/primitives/Drawer/Drawer.svelte +116 -94
- package/dist/primitives/Drawer/Drawer.svelte.d.ts +12 -31
- package/dist/primitives/Drawer/Drawer.svelte.d.ts.map +1 -1
- package/dist/primitives/Dropdown/Dropdown.svelte +146 -134
- package/dist/primitives/Dropdown/Dropdown.svelte.d.ts +9 -18
- package/dist/primitives/Dropdown/Dropdown.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/ArrowLeft.svelte +13 -12
- package/dist/primitives/Icons/ArrowLeft.svelte.d.ts +2 -0
- package/dist/primitives/Icons/ArrowLeft.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/ArrowRight.svelte +13 -12
- package/dist/primitives/Icons/ArrowRight.svelte.d.ts +2 -0
- package/dist/primitives/Icons/ArrowRight.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Availability.svelte +13 -12
- package/dist/primitives/Icons/Availability.svelte.d.ts +2 -0
- package/dist/primitives/Icons/Availability.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Back.svelte +13 -12
- package/dist/primitives/Icons/Back.svelte.d.ts +2 -0
- package/dist/primitives/Icons/Back.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/CheckCircle.svelte +13 -12
- package/dist/primitives/Icons/CheckCircle.svelte.d.ts +2 -0
- package/dist/primitives/Icons/CheckCircle.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/CheckCircleOutline.svelte +13 -12
- package/dist/primitives/Icons/CheckCircleOutline.svelte.d.ts +2 -0
- package/dist/primitives/Icons/CheckCircleOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/CheckCircleSolid.svelte +12 -10
- package/dist/primitives/Icons/CheckCircleSolid.svelte.d.ts +4 -0
- package/dist/primitives/Icons/CheckCircleSolid.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/CheckOutline.svelte +15 -13
- package/dist/primitives/Icons/CheckOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/CheckOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/ChevronDownOutline.svelte +14 -12
- package/dist/primitives/Icons/ChevronDownOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/ChevronDownOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/ChevronLeft.svelte +13 -12
- package/dist/primitives/Icons/ChevronLeft.svelte.d.ts +2 -0
- package/dist/primitives/Icons/ChevronLeft.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/ChevronLeftOutline.svelte +14 -12
- package/dist/primitives/Icons/ChevronLeftOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/ChevronLeftOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/ChevronRight.svelte +13 -12
- package/dist/primitives/Icons/ChevronRight.svelte.d.ts +2 -0
- package/dist/primitives/Icons/ChevronRight.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/ChevronRightOutline.svelte +14 -12
- package/dist/primitives/Icons/ChevronRightOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/ChevronRightOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/ChevronUpOutline.svelte +14 -12
- package/dist/primitives/Icons/ChevronUpOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/ChevronUpOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/CloseCircleOutline.svelte +14 -12
- package/dist/primitives/Icons/CloseCircleOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/CloseCircleOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/CloseOutline.svelte +14 -12
- package/dist/primitives/Icons/CloseOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/CloseOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Copy.svelte +13 -12
- package/dist/primitives/Icons/Copy.svelte.d.ts +2 -0
- package/dist/primitives/Icons/Copy.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Cross.svelte +13 -12
- package/dist/primitives/Icons/Cross.svelte.d.ts +2 -0
- package/dist/primitives/Icons/Cross.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/DotsHorizontalOutline.svelte +12 -10
- package/dist/primitives/Icons/DotsHorizontalOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/DotsHorizontalOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/DownArrow.svelte +13 -12
- package/dist/primitives/Icons/DownArrow.svelte.d.ts +2 -0
- package/dist/primitives/Icons/DownArrow.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/ErrorCircle.svelte +13 -12
- package/dist/primitives/Icons/ErrorCircle.svelte.d.ts +2 -0
- package/dist/primitives/Icons/ErrorCircle.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/ExclamationCircleOutline.svelte +14 -12
- package/dist/primitives/Icons/ExclamationCircleOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/ExclamationCircleOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/ExclamationTriangleOutline.svelte +14 -12
- package/dist/primitives/Icons/ExclamationTriangleOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/ExclamationTriangleOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/EyeOutline.svelte +14 -12
- package/dist/primitives/Icons/EyeOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/EyeOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/EyeSlashOutline.svelte +14 -12
- package/dist/primitives/Icons/EyeSlashOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/EyeSlashOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/FacebookIcon.svelte +13 -11
- package/dist/primitives/Icons/FacebookIcon.svelte.d.ts +2 -0
- package/dist/primitives/Icons/FacebookIcon.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/FileCopyOutline.svelte +14 -12
- package/dist/primitives/Icons/FileCopyOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/FileCopyOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Home.svelte +13 -12
- package/dist/primitives/Icons/Home.svelte.d.ts +2 -0
- package/dist/primitives/Icons/Home.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/HomeSolid.svelte +12 -10
- package/dist/primitives/Icons/HomeSolid.svelte.d.ts +4 -0
- package/dist/primitives/Icons/HomeSolid.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Icon.spec.js +6 -6
- package/dist/primitives/Icons/Icon.svelte +27 -11
- package/dist/primitives/Icons/Icon.svelte.d.ts +5 -3
- package/dist/primitives/Icons/Icon.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Icons.spec.d.ts +8 -0
- package/dist/primitives/Icons/Icons.spec.d.ts.map +1 -0
- package/dist/primitives/Icons/Icons.spec.js +291 -0
- package/dist/primitives/Icons/ImageOutline.svelte +21 -19
- package/dist/primitives/Icons/ImageOutline.svelte.d.ts +6 -2
- package/dist/primitives/Icons/ImageOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Info.svelte +13 -12
- package/dist/primitives/Icons/Info.svelte.d.ts +2 -0
- package/dist/primitives/Icons/Info.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/InfoCircleOutline.svelte +14 -12
- package/dist/primitives/Icons/InfoCircleOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/InfoCircleOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/InstagramIcon.svelte +17 -15
- package/dist/primitives/Icons/InstagramIcon.svelte.d.ts +2 -0
- package/dist/primitives/Icons/InstagramIcon.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/LogoInstagram.svelte +13 -13
- package/dist/primitives/Icons/LogoInstagram.svelte.d.ts +4 -2
- package/dist/primitives/Icons/LogoInstagram.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Message.svelte +13 -12
- package/dist/primitives/Icons/Message.svelte.d.ts +2 -0
- package/dist/primitives/Icons/Message.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/MinusOutline.svelte +14 -12
- package/dist/primitives/Icons/MinusOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/MinusOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/MoonIcon.svelte +13 -11
- package/dist/primitives/Icons/MoonIcon.svelte.d.ts +2 -0
- package/dist/primitives/Icons/MoonIcon.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/More.svelte +13 -12
- package/dist/primitives/Icons/More.svelte.d.ts +2 -0
- package/dist/primitives/Icons/More.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/MoreHori.spec.js +6 -6
- package/dist/primitives/Icons/MoreHori.svelte +13 -12
- package/dist/primitives/Icons/MoreHori.svelte.d.ts +2 -0
- package/dist/primitives/Icons/MoreHori.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Notification.svelte +13 -12
- package/dist/primitives/Icons/Notification.svelte.d.ts +2 -0
- package/dist/primitives/Icons/Notification.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Payment.svelte +13 -12
- package/dist/primitives/Icons/Payment.svelte.d.ts +2 -0
- package/dist/primitives/Icons/Payment.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/PlusOutline.svelte +14 -12
- package/dist/primitives/Icons/PlusOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/PlusOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Profile.svelte +13 -12
- package/dist/primitives/Icons/Profile.svelte.d.ts +2 -0
- package/dist/primitives/Icons/Profile.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Reload.svelte +13 -12
- package/dist/primitives/Icons/Reload.svelte.d.ts +2 -0
- package/dist/primitives/Icons/Reload.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/SearchOutline.svelte +14 -12
- package/dist/primitives/Icons/SearchOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/SearchOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/ShareOutline.svelte +14 -12
- package/dist/primitives/Icons/ShareOutline.svelte.d.ts +4 -0
- package/dist/primitives/Icons/ShareOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Shows.svelte +13 -12
- package/dist/primitives/Icons/Shows.svelte.d.ts +2 -0
- package/dist/primitives/Icons/Shows.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/Signout.svelte +13 -12
- package/dist/primitives/Icons/Signout.svelte.d.ts +2 -0
- package/dist/primitives/Icons/Signout.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/SunIcon.svelte +13 -11
- package/dist/primitives/Icons/SunIcon.svelte.d.ts +2 -0
- package/dist/primitives/Icons/SunIcon.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/TiktokIcon.svelte +13 -11
- package/dist/primitives/Icons/TiktokIcon.svelte.d.ts +2 -0
- package/dist/primitives/Icons/TiktokIcon.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/TrashBinOutline.svelte +21 -19
- package/dist/primitives/Icons/TrashBinOutline.svelte.d.ts +6 -2
- package/dist/primitives/Icons/TrashBinOutline.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/TwitterIcon.svelte +13 -11
- package/dist/primitives/Icons/TwitterIcon.svelte.d.ts +2 -0
- package/dist/primitives/Icons/TwitterIcon.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/WarningIcon.spec.js +12 -12
- package/dist/primitives/Icons/WarningIcon.svelte +19 -19
- package/dist/primitives/Icons/WarningIcon.svelte.d.ts +6 -2
- package/dist/primitives/Icons/WarningIcon.svelte.d.ts.map +1 -1
- package/dist/primitives/Icons/iconTestUtils.d.ts +162 -0
- package/dist/primitives/Icons/iconTestUtils.d.ts.map +1 -0
- package/dist/primitives/Icons/iconTestUtils.js +160 -0
- package/dist/primitives/Icons/index.d.ts +56 -54
- package/dist/primitives/Icons/index.d.ts.map +1 -1
- package/dist/primitives/Icons/index.js +59 -61
- package/dist/primitives/Icons/types.d.ts +31 -0
- package/dist/primitives/Icons/types.d.ts.map +1 -0
- package/dist/primitives/Icons/types.js +8 -0
- package/dist/primitives/Input/Input.svelte +40 -53
- package/dist/primitives/Input/Input.svelte.d.ts.map +1 -1
- package/dist/primitives/Input/Select.svelte +121 -104
- package/dist/primitives/Input/Select.svelte.d.ts +16 -24
- package/dist/primitives/Input/Select.svelte.d.ts.map +1 -1
- package/dist/primitives/Input/Textarea.svelte +70 -44
- package/dist/primitives/Input/Textarea.svelte.d.ts +20 -39
- package/dist/primitives/Input/Textarea.svelte.d.ts.map +1 -1
- package/dist/primitives/NumberInput/NumberInput.svelte +106 -0
- package/dist/primitives/NumberInput/NumberInput.svelte.d.ts +23 -0
- package/dist/primitives/NumberInput/NumberInput.svelte.d.ts.map +1 -0
- package/dist/primitives/NumberInput/index.d.ts +2 -0
- package/dist/primitives/NumberInput/index.d.ts.map +1 -0
- package/dist/primitives/NumberInput/index.js +1 -0
- package/dist/primitives/Skeleton/Skeleton.svelte +21 -27
- package/dist/primitives/Skeleton/Skeleton.svelte.d.ts +2 -1
- package/dist/primitives/Skeleton/Skeleton.svelte.d.ts.map +1 -1
- package/dist/primitives/Spinner/Spinner.svelte +24 -37
- package/dist/primitives/Spinner/Spinner.svelte.d.ts +4 -2
- package/dist/primitives/Spinner/Spinner.svelte.d.ts.map +1 -1
- package/dist/primitives/Tabs/TabItem.svelte +3 -2
- package/dist/primitives/Tabs/TabItem.svelte.d.ts.map +1 -1
- package/dist/primitives/Tabs/Tabs.svelte +6 -5
- package/dist/primitives/Tabs/Tabs.svelte.d.ts.map +1 -1
- package/dist/primitives/ValidationError.stories.svelte +43 -42
- package/dist/primitives/ValidationError.svelte +1 -1
- package/dist/primitives/index.d.ts +31 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +81 -0
- package/dist/recipes/ImageUploader/ImageUploader.svelte +155 -176
- package/dist/recipes/ImageUploader/ImageUploader.svelte.d.ts.map +1 -1
- package/dist/recipes/SuperLogin/SuperLogin.svelte +18 -17
- package/dist/recipes/SuperLogin/SuperLogin.svelte.d.ts.map +1 -1
- package/dist/recipes/feedback/EmptyState/EmptyState.svelte +65 -46
- package/dist/recipes/feedback/EmptyState/EmptyState.svelte.d.ts +7 -1
- package/dist/recipes/feedback/EmptyState/EmptyState.svelte.d.ts.map +1 -1
- package/dist/recipes/feedback/ErrorDisplay.stories.svelte +12 -11
- package/dist/recipes/feedback/ErrorDisplay.svelte +66 -37
- package/dist/recipes/feedback/ErrorDisplay.svelte.d.ts +7 -0
- package/dist/recipes/feedback/ErrorDisplay.svelte.d.ts.map +1 -1
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.svelte +22 -13
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.svelte.d.ts +2 -2
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.svelte.d.ts.map +1 -1
- package/dist/recipes/feedback/index.d.ts +4 -0
- package/dist/recipes/feedback/index.d.ts.map +1 -0
- package/dist/recipes/feedback/index.js +4 -0
- package/dist/recipes/fields/SelectField.svelte +2 -2
- package/dist/recipes/fields/SelectField.svelte.d.ts +4 -1
- package/dist/recipes/fields/SelectField.svelte.d.ts.map +1 -1
- package/dist/recipes/fields/TextareaField.svelte +4 -4
- package/dist/recipes/fields/TextareaField.svelte.d.ts +6 -2
- package/dist/recipes/fields/TextareaField.svelte.d.ts.map +1 -1
- package/dist/recipes/index.d.ts +8 -0
- package/dist/recipes/index.d.ts.map +1 -0
- package/dist/recipes/index.js +24 -0
- package/dist/recipes/inputs/MultiSelect.svelte +5 -0
- package/dist/recipes/inputs/MultiSelect.svelte.d.ts +2 -0
- package/dist/recipes/inputs/MultiSelect.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/OTPInput.svelte +89 -74
- package/dist/recipes/inputs/OTPInput.svelte.d.ts +15 -20
- package/dist/recipes/inputs/OTPInput.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/PasswordInput.svelte +99 -78
- package/dist/recipes/inputs/PasswordInput.svelte.d.ts +27 -34
- package/dist/recipes/inputs/PasswordInput.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte +75 -66
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte.d.ts +8 -16
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.stories.svelte +47 -42
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.stories.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte +12 -12
- package/dist/recipes/inputs/Search.svelte +65 -48
- package/dist/recipes/inputs/Search.svelte.d.ts +16 -32
- package/dist/recipes/inputs/Search.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/SelectDropdown.svelte +112 -104
- package/dist/recipes/inputs/SelectDropdown.svelte.d.ts +12 -18
- package/dist/recipes/inputs/SelectDropdown.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/index.d.ts +8 -0
- package/dist/recipes/inputs/index.d.ts.map +1 -0
- package/dist/recipes/inputs/index.js +8 -0
- package/dist/recipes/modals/index.d.ts +7 -0
- package/dist/recipes/modals/index.d.ts.map +1 -0
- package/dist/recipes/modals/index.js +7 -0
- package/dist/stories/ButtonAuditDashboard.svelte +23 -18
- package/dist/stories/ButtonAuditDashboard.svelte.d.ts.map +1 -1
- package/dist/stories/PatternsGallery.svelte +199 -188
- package/dist/stories/PatternsGallery.svelte.d.ts.map +1 -1
- package/dist/stories/PrimitivesGallery.svelte +27 -27
- package/dist/stories/RecipesGallery.svelte +200 -170
- package/dist/stories/RecipesGallery.svelte.d.ts.map +1 -1
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +1 -0
- package/dist/telemetry.server.d.ts.map +1 -1
- package/dist/telemetry.server.js +1 -0
- package/dist/telemetry.server.spec.js +1 -0
- package/dist/telemetry.spec.js +1 -0
- package/dist/tokens/__tests__/sizing.test.d.ts +2 -0
- package/dist/tokens/__tests__/sizing.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/sizing.test.js +307 -0
- package/dist/tokens/__tests__/spacing.test.d.ts +2 -0
- package/dist/tokens/__tests__/spacing.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/spacing.test.js +178 -0
- package/dist/tokens/__tests__/variants.test.d.ts +2 -0
- package/dist/tokens/__tests__/variants.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/variants.test.js +329 -0
- package/dist/tokens/index.d.ts +3 -0
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +16 -0
- package/dist/tokens/sizing.d.ts +118 -0
- package/dist/tokens/sizing.d.ts.map +1 -0
- package/dist/tokens/sizing.js +125 -0
- package/dist/tokens/spacing.d.ts +105 -0
- package/dist/tokens/spacing.d.ts.map +1 -1
- package/dist/tokens/spacing.js +76 -0
- package/dist/tokens/variants.d.ts +78 -0
- package/dist/tokens/variants.d.ts.map +1 -0
- package/dist/tokens/variants.js +89 -0
- package/dist/utils/__tests__/auth.test.d.ts +2 -0
- package/dist/utils/__tests__/auth.test.d.ts.map +1 -0
- package/dist/utils/__tests__/auth.test.js +431 -0
- package/dist/utils/__tests__/formatters.test.d.ts +2 -0
- package/dist/utils/__tests__/formatters.test.d.ts.map +1 -0
- package/dist/utils/__tests__/formatters.test.js +73 -0
- package/dist/utils/auth.d.ts +46 -0
- package/dist/utils/auth.d.ts.map +1 -0
- package/dist/utils/auth.js +195 -0
- package/dist/utils/formatters.d.ts +13 -0
- package/dist/utils/formatters.d.ts.map +1 -0
- package/dist/utils/formatters.js +24 -0
- package/package.json +9 -5
- package/dist/patterns/layout/Grid.svelte +0 -35
- package/dist/patterns/layout/Grid.svelte.d.ts +0 -18
- package/dist/patterns/layout/Grid.svelte.d.ts.map +0 -1
|
@@ -1,203 +1,181 @@
|
|
|
1
|
-
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
-
import { render, fireEvent } from '@testing-library/svelte';
|
|
3
|
-
import FormValidationSummary from './FormValidationSummary.svelte';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
const { container } = render(FormValidationSummary, {
|
|
183
|
-
props: {
|
|
184
|
-
show: true,
|
|
185
|
-
errors: { firstName: 'Required' },
|
|
186
|
-
},
|
|
187
|
-
});
|
|
188
|
-
const svg = container.querySelector('svg');
|
|
189
|
-
expect(svg).toBeTruthy();
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
it('filters out null and undefined error values', () => {
|
|
193
|
-
const { container } = render(FormValidationSummary, {
|
|
194
|
-
props: {
|
|
195
|
-
show: true,
|
|
196
|
-
errors: { firstName: 'Required', lastName: null, email: undefined },
|
|
197
|
-
fieldLabels: { firstName: 'First Name', lastName: 'Last Name', email: 'Email' },
|
|
198
|
-
},
|
|
199
|
-
});
|
|
200
|
-
const listItems = container.querySelectorAll('li');
|
|
201
|
-
expect(listItems.length).toBe(1);
|
|
202
|
-
});
|
|
203
|
-
});
|
|
1
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
+
import { render, fireEvent } from '@testing-library/svelte';
|
|
3
|
+
import FormValidationSummary from './FormValidationSummary.svelte';
|
|
4
|
+
describe('FormValidationSummary Component', () => {
|
|
5
|
+
it('does not render when show is false', () => {
|
|
6
|
+
const { container } = render(FormValidationSummary, {
|
|
7
|
+
props: {
|
|
8
|
+
show: false,
|
|
9
|
+
errors: { firstName: 'Required' },
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
const alert = container.querySelector('[role="alert"]');
|
|
13
|
+
expect(alert).toBeFalsy();
|
|
14
|
+
});
|
|
15
|
+
it('does not render when there are no errors', () => {
|
|
16
|
+
const { container } = render(FormValidationSummary, {
|
|
17
|
+
props: {
|
|
18
|
+
show: true,
|
|
19
|
+
errors: {},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
const alert = container.querySelector('[role="alert"]');
|
|
23
|
+
expect(alert).toBeFalsy();
|
|
24
|
+
});
|
|
25
|
+
it('does not render when errors have empty messages', () => {
|
|
26
|
+
const { container } = render(FormValidationSummary, {
|
|
27
|
+
props: {
|
|
28
|
+
show: true,
|
|
29
|
+
errors: { firstName: '', lastName: ' ' },
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
const alert = container.querySelector('[role="alert"]');
|
|
33
|
+
expect(alert).toBeFalsy();
|
|
34
|
+
});
|
|
35
|
+
it('renders when show is true and has errors', () => {
|
|
36
|
+
const { container, getByText } = render(FormValidationSummary, {
|
|
37
|
+
props: {
|
|
38
|
+
show: true,
|
|
39
|
+
errors: { firstName: 'First name is required' },
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
const alert = container.querySelector('[role="alert"]');
|
|
43
|
+
expect(alert).toBeTruthy();
|
|
44
|
+
expect(getByText('Please fix the following:')).toBeTruthy();
|
|
45
|
+
});
|
|
46
|
+
it('displays error field labels', () => {
|
|
47
|
+
const { getByText } = render(FormValidationSummary, {
|
|
48
|
+
props: {
|
|
49
|
+
show: true,
|
|
50
|
+
errors: { firstName: 'Required', email: 'Invalid' },
|
|
51
|
+
fieldLabels: { firstName: 'First Name', email: 'Email Address' },
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
expect(getByText('First Name')).toBeTruthy();
|
|
55
|
+
expect(getByText('Email Address')).toBeTruthy();
|
|
56
|
+
});
|
|
57
|
+
it('uses field key as label when no label provided', () => {
|
|
58
|
+
const { getByText } = render(FormValidationSummary, {
|
|
59
|
+
props: {
|
|
60
|
+
show: true,
|
|
61
|
+
errors: { firstName: 'Required' },
|
|
62
|
+
fieldLabels: {},
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
expect(getByText('firstName')).toBeTruthy();
|
|
66
|
+
});
|
|
67
|
+
it('renders multiple error fields', () => {
|
|
68
|
+
const { container } = render(FormValidationSummary, {
|
|
69
|
+
props: {
|
|
70
|
+
show: true,
|
|
71
|
+
errors: {
|
|
72
|
+
firstName: 'Required',
|
|
73
|
+
lastName: 'Required',
|
|
74
|
+
email: 'Invalid format',
|
|
75
|
+
},
|
|
76
|
+
fieldLabels: {
|
|
77
|
+
firstName: 'First Name',
|
|
78
|
+
lastName: 'Last Name',
|
|
79
|
+
email: 'Email',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
const listItems = container.querySelectorAll('li');
|
|
84
|
+
expect(listItems.length).toBe(3);
|
|
85
|
+
});
|
|
86
|
+
it('has role="alert" and aria-live="polite"', () => {
|
|
87
|
+
const { container } = render(FormValidationSummary, {
|
|
88
|
+
props: {
|
|
89
|
+
show: true,
|
|
90
|
+
errors: { firstName: 'Required' },
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
const alert = container.querySelector('[role="alert"]');
|
|
94
|
+
expect(alert.getAttribute('aria-live')).toBe('polite');
|
|
95
|
+
});
|
|
96
|
+
it('renders clickable buttons for each error', () => {
|
|
97
|
+
const { container } = render(FormValidationSummary, {
|
|
98
|
+
props: {
|
|
99
|
+
show: true,
|
|
100
|
+
errors: { firstName: 'Required', email: 'Invalid' },
|
|
101
|
+
fieldLabels: { firstName: 'First Name', email: 'Email' },
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
const buttons = container.querySelectorAll('button[type="button"]');
|
|
105
|
+
expect(buttons.length).toBe(2);
|
|
106
|
+
});
|
|
107
|
+
it('calls scrollIntoView on button click', async () => {
|
|
108
|
+
// Create a mock element
|
|
109
|
+
const mockElement = document.createElement('input');
|
|
110
|
+
mockElement.id = 'firstName';
|
|
111
|
+
mockElement.scrollIntoView = vi.fn();
|
|
112
|
+
mockElement.focus = vi.fn();
|
|
113
|
+
document.body.appendChild(mockElement);
|
|
114
|
+
const { container } = render(FormValidationSummary, {
|
|
115
|
+
props: {
|
|
116
|
+
show: true,
|
|
117
|
+
errors: { firstName: 'Required' },
|
|
118
|
+
fieldLabels: { firstName: 'First Name' },
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
const button = container.querySelector('button[type="button"]');
|
|
122
|
+
await fireEvent.click(button);
|
|
123
|
+
expect(mockElement.scrollIntoView).toHaveBeenCalledWith({
|
|
124
|
+
behavior: 'smooth',
|
|
125
|
+
block: 'center',
|
|
126
|
+
});
|
|
127
|
+
// Clean up
|
|
128
|
+
document.body.removeChild(mockElement);
|
|
129
|
+
});
|
|
130
|
+
it('uses custom fieldIds for scrolling', async () => {
|
|
131
|
+
const mockElement = document.createElement('input');
|
|
132
|
+
mockElement.id = 'custom-first-name-input';
|
|
133
|
+
mockElement.scrollIntoView = vi.fn();
|
|
134
|
+
mockElement.focus = vi.fn();
|
|
135
|
+
document.body.appendChild(mockElement);
|
|
136
|
+
const { container } = render(FormValidationSummary, {
|
|
137
|
+
props: {
|
|
138
|
+
show: true,
|
|
139
|
+
errors: { firstName: 'Required' },
|
|
140
|
+
fieldLabels: { firstName: 'First Name' },
|
|
141
|
+
fieldIds: { firstName: 'custom-first-name-input' },
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
const button = container.querySelector('button[type="button"]');
|
|
145
|
+
await fireEvent.click(button);
|
|
146
|
+
expect(mockElement.scrollIntoView).toHaveBeenCalled();
|
|
147
|
+
document.body.removeChild(mockElement);
|
|
148
|
+
});
|
|
149
|
+
it('has red background styling', () => {
|
|
150
|
+
const { container } = render(FormValidationSummary, {
|
|
151
|
+
props: {
|
|
152
|
+
show: true,
|
|
153
|
+
errors: { firstName: 'Required' },
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
const alert = container.querySelector('[role="alert"]');
|
|
157
|
+
expect(alert.classList.contains('bg-red-50')).toBe(true);
|
|
158
|
+
expect(alert.classList.contains('border-red-200')).toBe(true);
|
|
159
|
+
});
|
|
160
|
+
it('renders warning icon', () => {
|
|
161
|
+
const { container } = render(FormValidationSummary, {
|
|
162
|
+
props: {
|
|
163
|
+
show: true,
|
|
164
|
+
errors: { firstName: 'Required' },
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
const svg = container.querySelector('svg');
|
|
168
|
+
expect(svg).toBeTruthy();
|
|
169
|
+
});
|
|
170
|
+
it('filters out null and undefined error values', () => {
|
|
171
|
+
const { container } = render(FormValidationSummary, {
|
|
172
|
+
props: {
|
|
173
|
+
show: true,
|
|
174
|
+
errors: { firstName: 'Required', lastName: null, email: undefined },
|
|
175
|
+
fieldLabels: { firstName: 'First Name', lastName: 'Last Name', email: 'Email' },
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
const listItems = container.querySelectorAll('li');
|
|
179
|
+
expect(listItems.length).toBe(1);
|
|
180
|
+
});
|
|
181
|
+
});
|
|
@@ -70,20 +70,20 @@
|
|
|
70
70
|
show={true}
|
|
71
71
|
/>
|
|
72
72
|
|
|
73
|
-
<div class="space-y-4 mt-4">
|
|
74
|
-
<div>
|
|
75
|
-
<label
|
|
76
|
-
<input type="text" class="w-full px-3 py-2 border border-red-300 rounded" />
|
|
77
|
-
</div>
|
|
78
|
-
<div>
|
|
79
|
-
<label
|
|
80
|
-
<input type="email" class="w-full px-3 py-2 border border-red-300 rounded" />
|
|
81
|
-
</div>
|
|
82
|
-
<div>
|
|
83
|
-
<label
|
|
84
|
-
<input type="tel" class="w-full px-3 py-2 border border-red-300 rounded" />
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
73
|
+
<div class="space-y-4 mt-4">
|
|
74
|
+
<div>
|
|
75
|
+
<label for="firstName" class="block text-sm font-medium mb-1">First Name</label>
|
|
76
|
+
<input id="firstName" type="text" class="w-full px-3 py-2 border border-red-300 rounded" />
|
|
77
|
+
</div>
|
|
78
|
+
<div>
|
|
79
|
+
<label for="email" class="block text-sm font-medium mb-1">Email</label>
|
|
80
|
+
<input id="email" type="email" class="w-full px-3 py-2 border border-red-300 rounded" />
|
|
81
|
+
</div>
|
|
82
|
+
<div>
|
|
83
|
+
<label for="phone" class="block text-sm font-medium mb-1">Phone</label>
|
|
84
|
+
<input id="phone" type="tel" class="w-full px-3 py-2 border border-red-300 rounded" />
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
87
|
</div>
|
|
88
88
|
</Story>
|
|
89
89
|
|
|
@@ -1,38 +1,45 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { slide } from "svelte/transition";
|
|
3
|
-
import { cubicOut } from "svelte/easing";
|
|
4
|
-
import WarningIcon from "../../primitives/Icons/WarningIcon.svelte";
|
|
5
|
-
import Button from "../../primitives/Button/Button.svelte";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
errors
|
|
9
|
-
show
|
|
10
|
-
fieldLabels
|
|
11
|
-
fieldIds
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { slide } from "svelte/transition";
|
|
3
|
+
import { cubicOut } from "svelte/easing";
|
|
4
|
+
import WarningIcon from "../../primitives/Icons/WarningIcon.svelte";
|
|
5
|
+
import Button from "../../primitives/Button/Button.svelte";
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
errors?: Record<string, string | null | undefined>;
|
|
9
|
+
show?: boolean;
|
|
10
|
+
fieldLabels?: Record<string, string>;
|
|
11
|
+
fieldIds?: Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
errors = {},
|
|
16
|
+
show = false,
|
|
17
|
+
fieldLabels = {},
|
|
18
|
+
fieldIds = {},
|
|
19
|
+
}: Props = $props();
|
|
20
|
+
|
|
21
|
+
// Get list of fields with errors
|
|
22
|
+
let errorFields = $derived(Object.entries(errors)
|
|
23
|
+
.filter(([_, message]) => message && message.trim() !== "")
|
|
24
|
+
.map(([key, message]) => ({
|
|
25
|
+
key,
|
|
26
|
+
label: fieldLabels[key] || key,
|
|
27
|
+
message,
|
|
28
|
+
elementId: fieldIds[key] || key
|
|
29
|
+
})));
|
|
30
|
+
|
|
31
|
+
let hasErrors = $derived(errorFields.length > 0);
|
|
32
|
+
|
|
33
|
+
function scrollToField(elementId: string) {
|
|
34
|
+
const element = document.getElementById(elementId);
|
|
35
|
+
if (element) {
|
|
36
|
+
element.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
37
|
+
if (element.focus) {
|
|
38
|
+
setTimeout(() => element.focus(), 300);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
36
43
|
|
|
37
44
|
{#if show && hasErrors}
|
|
38
45
|
<div
|
|
@@ -42,7 +49,7 @@
|
|
|
42
49
|
aria-live="polite"
|
|
43
50
|
>
|
|
44
51
|
<div class="flex items-start gap-2">
|
|
45
|
-
<WarningIcon
|
|
52
|
+
<WarningIcon class="shrink-0 text-red-600 dark:text-red-500 mt-0.5" />
|
|
46
53
|
<div class="flex-1">
|
|
47
54
|
<p class="text-sm font-medium text-red-800 dark:text-red-400">
|
|
48
55
|
Please fix the following:
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
-
};
|
|
6
|
-
declare const FormValidationSummary: import("svelte").Component<{
|
|
7
|
-
errors?: Record<string, any>;
|
|
8
|
-
show?: boolean;
|
|
9
|
-
fieldLabels?: Record<string, any>;
|
|
10
|
-
fieldIds?: Record<string, any>;
|
|
11
|
-
}, {}, "">;
|
|
12
|
-
type $$ComponentProps = {
|
|
13
|
-
errors?: Record<string, any>;
|
|
1
|
+
interface Props {
|
|
2
|
+
errors?: Record<string, string | null | undefined>;
|
|
14
3
|
show?: boolean;
|
|
15
|
-
fieldLabels?: Record<string,
|
|
16
|
-
fieldIds?: Record<string,
|
|
17
|
-
}
|
|
4
|
+
fieldLabels?: Record<string, string>;
|
|
5
|
+
fieldIds?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
declare const FormValidationSummary: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type FormValidationSummary = ReturnType<typeof FormValidationSummary>;
|
|
9
|
+
export default FormValidationSummary;
|
|
18
10
|
//# sourceMappingURL=FormValidationSummary.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormValidationSummary.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/patterns/forms/FormValidationSummary.svelte.
|
|
1
|
+
{"version":3,"file":"FormValidationSummary.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/patterns/forms/FormValidationSummary.svelte.ts"],"names":[],"mappings":"AASE,UAAU,KAAK;IACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IACnD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AA8DH,QAAA,MAAM,qBAAqB,2CAAwC,CAAC;AACpE,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACtE,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as FormActions } from "./FormActions.svelte";
|
|
2
|
+
export { default as FormGrid } from "./FormGrid.svelte";
|
|
3
|
+
export { default as FormSection } from "./FormSection.svelte";
|
|
4
|
+
export { default as FormValidationSummary } from "./FormValidationSummary.svelte";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/patterns/forms/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Form pattern components - layout and structure for forms
|
|
2
|
+
export { default as FormActions } from './FormActions.svelte';
|
|
3
|
+
export { default as FormGrid } from './FormGrid.svelte';
|
|
4
|
+
export { default as FormSection } from './FormSection.svelte';
|
|
5
|
+
export { default as FormValidationSummary } from './FormValidationSummary.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/patterns/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// PATTERNS - Layout & flow components (Layer 3)
|
|
3
|
+
// =============================================================================
|
|
4
|
+
|
|
5
|
+
// Forms - re-export from forms/index.js
|
|
6
|
+
export * from './forms/index.js';
|
|
7
|
+
|
|
8
|
+
// Navigation - re-export from navigation/index.js
|
|
9
|
+
export * from './navigation/index.js';
|
|
10
|
+
|
|
11
|
+
// Page - re-export from page/index.js
|
|
12
|
+
export * from './page/index.js';
|
|
13
|
+
|
|
14
|
+
// Data - re-export from data/index.js
|
|
15
|
+
export * from './data/index.js';
|
|
16
|
+
|
|
17
|
+
// Layout - re-export from layout/index.js
|
|
18
|
+
export * from './layout/index.js';
|