@getmicdrop/svelte-components 5.5.4 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar/AboutShow/AboutShow.spec.d.ts +2 -0
- package/dist/calendar/AboutShow/AboutShow.spec.d.ts.map +1 -0
- package/dist/calendar/AboutShow/AboutShow.spec.js +791 -0
- package/dist/calendar/AboutShow/AboutShow.svelte +172 -172
- package/dist/calendar/Calendar/MiniMonthCalendar.spec.d.ts +2 -0
- package/dist/calendar/Calendar/MiniMonthCalendar.spec.d.ts.map +1 -0
- package/dist/calendar/Calendar/MiniMonthCalendar.spec.js +1191 -0
- package/dist/calendar/Calendar/MiniMonthCalendar.svelte +782 -782
- package/dist/calendar/FAQs/FAQs.spec.d.ts +2 -0
- package/dist/calendar/FAQs/FAQs.spec.d.ts.map +1 -0
- package/dist/calendar/FAQs/FAQs.spec.js +238 -0
- package/dist/calendar/FAQs/FAQs.svelte +75 -75
- package/dist/calendar/MonthSwitcher/MonthSwitcher.spec.d.ts +2 -0
- package/dist/calendar/MonthSwitcher/MonthSwitcher.spec.d.ts.map +1 -0
- package/dist/calendar/MonthSwitcher/MonthSwitcher.spec.js +420 -0
- package/dist/calendar/MonthSwitcher/MonthSwitcher.svelte +126 -126
- package/dist/calendar/OrderSummary/OrderSummary.spec.d.ts +2 -0
- package/dist/calendar/OrderSummary/OrderSummary.spec.d.ts.map +1 -0
- package/dist/calendar/OrderSummary/OrderSummary.spec.js +808 -0
- package/dist/calendar/OrderSummary/OrderSummary.svelte +367 -367
- package/dist/calendar/PublicCard/PublicCard.spec.d.ts +2 -0
- package/dist/calendar/PublicCard/PublicCard.spec.d.ts.map +1 -0
- package/dist/calendar/PublicCard/PublicCard.spec.js +301 -0
- package/dist/calendar/PublicCard/PublicCard.svelte +134 -134
- package/dist/calendar/ShowCard/ShowCard.spec.d.ts +2 -0
- package/dist/calendar/ShowCard/ShowCard.spec.d.ts.map +1 -0
- package/dist/calendar/ShowCard/ShowCard.spec.js +714 -0
- package/dist/calendar/ShowCard/ShowCard.svelte +157 -157
- package/dist/calendar/ShowTimeCard/ShowTimeCard.spec.d.ts +2 -0
- package/dist/calendar/ShowTimeCard/ShowTimeCard.spec.d.ts.map +1 -0
- package/dist/calendar/ShowTimeCard/ShowTimeCard.spec.js +241 -0
- package/dist/calendar/ShowTimeCard/ShowTimeCard.svelte +61 -61
- package/dist/components/Layout/AppShell.svelte +104 -0
- package/dist/components/Layout/AppShell.svelte.d.ts +26 -0
- package/dist/components/Layout/AppShell.svelte.d.ts.map +1 -0
- package/dist/components/Layout/ContentSection.svelte +80 -0
- package/dist/components/Layout/ContentSection.svelte.d.ts +23 -0
- package/dist/components/Layout/ContentSection.svelte.d.ts.map +1 -0
- package/dist/components/Layout/Grid.svelte +4 -4
- package/dist/components/Layout/Heading.svelte +81 -0
- package/dist/components/Layout/Heading.svelte.d.ts +24 -0
- package/dist/components/Layout/Heading.svelte.d.ts.map +1 -0
- package/dist/components/Layout/PageContainer.svelte +69 -0
- package/dist/components/Layout/PageContainer.svelte.d.ts +23 -0
- package/dist/components/Layout/PageContainer.svelte.d.ts.map +1 -0
- package/dist/components/Layout/Responsive.svelte +75 -0
- package/dist/components/Layout/Responsive.svelte.d.ts +19 -0
- package/dist/components/Layout/Responsive.svelte.d.ts.map +1 -0
- package/dist/components/Layout/Section.spec.d.ts +2 -0
- package/dist/components/Layout/Section.spec.d.ts.map +1 -0
- package/dist/components/Layout/Section.spec.js +149 -0
- package/dist/components/Layout/Section.svelte +80 -80
- package/dist/components/Layout/ShowOnDesktop.svelte +37 -0
- package/dist/components/Layout/ShowOnDesktop.svelte.d.ts +16 -0
- package/dist/components/Layout/ShowOnDesktop.svelte.d.ts.map +1 -0
- package/dist/components/Layout/ShowOnMobile.svelte +37 -0
- package/dist/components/Layout/ShowOnMobile.svelte.d.ts +16 -0
- package/dist/components/Layout/ShowOnMobile.svelte.d.ts.map +1 -0
- package/dist/components/Layout/Sidebar.spec.d.ts +2 -0
- package/dist/components/Layout/Sidebar.spec.d.ts.map +1 -0
- package/dist/components/Layout/Sidebar.spec.js +186 -0
- package/dist/components/Layout/Sidebar.svelte +108 -108
- package/dist/components/Layout/Stack.spec.js +2 -2
- package/dist/components/Layout/Stack.svelte +6 -6
- package/dist/components/Layout/Text.svelte +87 -0
- package/dist/components/Layout/Text.svelte.d.ts +28 -0
- package/dist/components/Layout/Text.svelte.d.ts.map +1 -0
- package/dist/components/Layout/TwoColumn.svelte +108 -0
- package/dist/components/Layout/TwoColumn.svelte.d.ts +28 -0
- package/dist/components/Layout/TwoColumn.svelte.d.ts.map +1 -0
- package/dist/components/Layout/__tests__/Heading.test.d.ts +2 -0
- package/dist/components/Layout/__tests__/Heading.test.d.ts.map +1 -0
- package/dist/components/Layout/__tests__/Heading.test.js +123 -0
- package/dist/components/Layout/__tests__/ShowOnDesktop.test.d.ts +2 -0
- package/dist/components/Layout/__tests__/ShowOnDesktop.test.d.ts.map +1 -0
- package/dist/components/Layout/__tests__/ShowOnDesktop.test.js +84 -0
- package/dist/components/Layout/__tests__/ShowOnMobile.test.d.ts +2 -0
- package/dist/components/Layout/__tests__/ShowOnMobile.test.d.ts.map +1 -0
- package/dist/components/Layout/__tests__/ShowOnMobile.test.js +80 -0
- package/dist/components/Layout/__tests__/Text.test.d.ts +2 -0
- package/dist/components/Layout/__tests__/Text.test.d.ts.map +1 -0
- package/dist/components/Layout/__tests__/Text.test.js +146 -0
- package/dist/components/Layout/__tests__/TwoColumn.test.d.ts +2 -0
- package/dist/components/Layout/__tests__/TwoColumn.test.d.ts.map +1 -0
- package/dist/components/Layout/__tests__/TwoColumn.test.js +129 -0
- package/dist/constants/formOptions.spec.js +9 -5
- package/dist/constants/validation.js +91 -91
- package/dist/constants/validation.spec.js +64 -64
- package/dist/datetime/__tests__/timezone.test.js +123 -1
- package/dist/forms/createFieldTracker.spec.d.ts +2 -0
- package/dist/forms/createFieldTracker.spec.d.ts.map +1 -0
- package/dist/forms/createFieldTracker.spec.js +343 -0
- package/dist/forms/createFormStore.spec.d.ts +2 -0
- package/dist/forms/createFormStore.spec.d.ts.map +1 -0
- package/dist/forms/createFormStore.spec.js +689 -0
- package/dist/index.d.ts +4 -112
- package/dist/index.js +40 -226
- package/dist/patterns/data/DataGrid.spec.d.ts +2 -0
- package/dist/patterns/data/DataGrid.spec.d.ts.map +1 -0
- package/dist/patterns/data/DataGrid.spec.js +159 -0
- package/dist/patterns/data/DataGrid.svelte +45 -45
- package/dist/patterns/data/DataList.spec.d.ts +2 -0
- package/dist/patterns/data/DataList.spec.d.ts.map +1 -0
- package/dist/patterns/data/DataList.spec.js +158 -0
- package/dist/patterns/data/DataList.svelte +24 -24
- package/dist/patterns/data/DataTable.spec.d.ts +2 -0
- package/dist/patterns/data/DataTable.spec.d.ts.map +1 -0
- package/dist/patterns/data/DataTable.spec.js +196 -0
- package/dist/patterns/data/DataTable.svelte +36 -36
- package/dist/patterns/forms/FormActions.spec.js +95 -88
- package/dist/patterns/forms/FormActions.stories.svelte +97 -97
- package/dist/patterns/forms/FormActions.svelte +46 -46
- package/dist/patterns/forms/FormGrid.spec.d.ts +2 -0
- package/dist/patterns/forms/FormGrid.spec.d.ts.map +1 -0
- package/dist/patterns/forms/FormGrid.spec.js +125 -0
- package/dist/patterns/forms/FormGrid.svelte +33 -33
- package/dist/patterns/forms/FormSection.spec.d.ts +2 -0
- package/dist/patterns/forms/FormSection.spec.d.ts.map +1 -0
- package/dist/patterns/forms/FormSection.spec.js +153 -0
- package/dist/patterns/forms/FormSection.svelte +32 -32
- package/dist/patterns/forms/FormValidationSummary.stories.svelte +83 -83
- package/dist/patterns/forms/FormValidationSummary.svelte +74 -74
- package/dist/patterns/layout/Sidebar.spec.d.ts +2 -0
- package/dist/patterns/layout/Sidebar.spec.d.ts.map +1 -0
- package/dist/patterns/layout/Sidebar.spec.js +159 -0
- package/dist/patterns/layout/Sidebar.svelte +39 -39
- package/dist/patterns/layout/index.d.ts +9 -0
- package/dist/patterns/layout/index.js +22 -0
- package/dist/patterns/navigation/BottomNav.stories.svelte +117 -117
- package/dist/patterns/navigation/BottomNav.svelte +64 -64
- package/dist/patterns/navigation/Header.spec.js +33 -24
- package/dist/patterns/navigation/Header.stories.svelte +77 -77
- package/dist/patterns/navigation/Header.svelte +193 -193
- package/dist/patterns/page/PageHeader.spec.d.ts +2 -0
- package/dist/patterns/page/PageHeader.spec.d.ts.map +1 -0
- package/dist/patterns/page/PageHeader.spec.js +167 -0
- package/dist/patterns/page/PageHeader.svelte +18 -18
- package/dist/patterns/page/PageLayout.spec.d.ts +2 -0
- package/dist/patterns/page/PageLayout.spec.d.ts.map +1 -0
- package/dist/patterns/page/PageLayout.spec.js +145 -0
- package/dist/patterns/page/PageLayout.svelte +40 -40
- package/dist/patterns/page/PageLoader.spec.js +57 -54
- package/dist/patterns/page/PageLoader.stories.svelte +137 -137
- package/dist/patterns/page/PageLoader.svelte +24 -24
- package/dist/patterns/page/SectionHeader.spec.d.ts +2 -0
- package/dist/patterns/page/SectionHeader.spec.d.ts.map +1 -0
- package/dist/patterns/page/SectionHeader.spec.js +197 -0
- package/dist/patterns/page/SectionHeader.svelte +29 -29
- package/dist/presets/badges.js +112 -112
- package/dist/presets/badges.spec.d.ts +2 -0
- package/dist/presets/badges.spec.d.ts.map +1 -0
- package/dist/presets/badges.spec.js +172 -0
- package/dist/presets/buttons.js +76 -76
- package/dist/presets/buttons.spec.d.ts +2 -0
- package/dist/presets/buttons.spec.d.ts.map +1 -0
- package/dist/presets/buttons.spec.js +135 -0
- package/dist/presets/index.js +9 -9
- package/dist/primitives/Accordion/Accordion.spec.d.ts +2 -0
- package/dist/primitives/Accordion/Accordion.spec.d.ts.map +1 -0
- package/dist/primitives/Accordion/Accordion.spec.js +83 -0
- package/dist/primitives/Accordion/Accordion.stories.svelte +75 -75
- package/dist/primitives/Accordion/Accordion.svelte +42 -42
- package/dist/primitives/Accordion/AccordionItem.spec.d.ts +2 -0
- package/dist/primitives/Accordion/AccordionItem.spec.d.ts.map +1 -0
- package/dist/primitives/Accordion/AccordionItem.spec.js +661 -0
- package/dist/primitives/Accordion/AccordionItem.svelte +95 -95
- package/dist/primitives/Accordion/AccordionItemWrapper.test.svelte +107 -0
- package/dist/primitives/Accordion/AccordionItemWrapper.test.svelte.d.ts +35 -0
- package/dist/primitives/Accordion/AccordionItemWrapper.test.svelte.d.ts.map +1 -0
- package/dist/primitives/Alert/Alert.spec.js +173 -170
- package/dist/primitives/Alert/Alert.stories.svelte +88 -88
- package/dist/primitives/Alert/Alert.svelte +27 -27
- package/dist/primitives/Avatar/Avatar.spec.d.ts +2 -0
- package/dist/primitives/Avatar/Avatar.spec.d.ts.map +1 -0
- package/dist/primitives/Avatar/Avatar.spec.js +211 -0
- package/dist/primitives/Avatar/Avatar.stories.svelte +94 -94
- package/dist/primitives/Avatar/Avatar.svelte +66 -66
- package/dist/primitives/Badges/Badge.spec.js +144 -103
- package/dist/primitives/Badges/Badge.stories.svelte +86 -86
- package/dist/primitives/Badges/Badge.svelte +79 -79
- package/dist/primitives/BottomSheet/BottomSheet.spec.js +136 -127
- package/dist/primitives/BottomSheet/BottomSheet.stories.svelte +83 -83
- package/dist/primitives/BottomSheet/BottomSheet.svelte +100 -100
- package/dist/primitives/BottomSheet/BottomSheetWrapper.test.svelte +13 -0
- package/dist/primitives/BottomSheet/BottomSheetWrapper.test.svelte.d.ts +7 -0
- package/dist/primitives/BottomSheet/BottomSheetWrapper.test.svelte.d.ts.map +1 -0
- package/dist/primitives/Breadcrumb/Breadcrumb.spec.js +122 -120
- package/dist/primitives/Breadcrumb/Breadcrumb.stories.svelte +23 -23
- package/dist/primitives/Breadcrumb/Breadcrumb.svelte +89 -89
- package/dist/primitives/Button/Button.spec.js +223 -211
- package/dist/primitives/Button/Button.stories.svelte +76 -76
- package/dist/primitives/Button/Button.svelte +270 -270
- package/dist/primitives/Button/ButtonSaveDemo.spec.js +146 -48
- package/dist/primitives/Button/ButtonSaveDemo.svelte +25 -25
- package/dist/primitives/Button/ButtonVariantShowcase.spec.d.ts +2 -0
- package/dist/primitives/Button/ButtonVariantShowcase.spec.d.ts.map +1 -0
- package/dist/primitives/Button/ButtonVariantShowcase.spec.js +202 -0
- package/dist/primitives/Button/ButtonVariantShowcase.svelte +129 -129
- package/dist/primitives/Card.spec.js +49 -49
- package/dist/primitives/Card.stories.svelte +22 -22
- package/dist/primitives/Card.svelte +28 -28
- package/dist/primitives/Checkbox/Checkbox.spec.d.ts +2 -0
- package/dist/primitives/Checkbox/Checkbox.spec.d.ts.map +1 -0
- package/dist/primitives/Checkbox/Checkbox.spec.js +252 -0
- package/dist/primitives/Checkbox/Checkbox.stories.svelte +84 -84
- package/dist/primitives/Checkbox/Checkbox.svelte +88 -88
- package/dist/primitives/DarkModeToggle.spec.js +390 -357
- package/dist/primitives/DarkModeToggle.stories.svelte +57 -57
- package/dist/primitives/DarkModeToggle.svelte +136 -136
- package/dist/primitives/Drawer/Drawer.spec.d.ts +2 -0
- package/dist/primitives/Drawer/Drawer.spec.d.ts.map +1 -0
- package/dist/primitives/Drawer/Drawer.spec.js +212 -0
- package/dist/primitives/Drawer/Drawer.stories.svelte +80 -80
- package/dist/primitives/Drawer/Drawer.svelte +120 -120
- package/dist/primitives/Dropdown/Dropdown.spec.d.ts +2 -0
- package/dist/primitives/Dropdown/Dropdown.spec.d.ts.map +1 -0
- package/dist/primitives/Dropdown/Dropdown.spec.js +366 -0
- package/dist/primitives/Dropdown/Dropdown.stories.svelte +137 -137
- package/dist/primitives/Dropdown/Dropdown.svelte +14 -14
- package/dist/primitives/Dropdown/DropdownItem.spec.d.ts +2 -0
- package/dist/primitives/Dropdown/DropdownItem.spec.d.ts.map +1 -0
- package/dist/primitives/Dropdown/DropdownItem.spec.js +182 -0
- package/dist/primitives/Dropdown/DropdownItem.svelte +80 -80
- package/dist/primitives/Icons/ArrowLeft.svelte +8 -8
- package/dist/primitives/Icons/ArrowRight.svelte +8 -8
- package/dist/primitives/Icons/Availability.svelte +14 -14
- package/dist/primitives/Icons/Back.svelte +14 -14
- package/dist/primitives/Icons/CheckCircle.svelte +6 -6
- package/dist/primitives/Icons/CheckCircleOutline.svelte +15 -15
- package/dist/primitives/Icons/ChevronLeft.svelte +4 -4
- package/dist/primitives/Icons/ChevronRight.svelte +4 -4
- package/dist/primitives/Icons/Copy.svelte +15 -15
- package/dist/primitives/Icons/Cross.svelte +5 -5
- package/dist/primitives/Icons/DownArrow.svelte +8 -8
- package/dist/primitives/Icons/ErrorCircle.svelte +6 -6
- package/dist/primitives/Icons/FacebookIcon.svelte +2 -2
- package/dist/primitives/Icons/Home.svelte +15 -15
- package/dist/primitives/Icons/Icon.spec.js +169 -169
- package/dist/primitives/Icons/Icon.stories.svelte +100 -100
- package/dist/primitives/Icons/Icon.svelte +52 -52
- package/dist/primitives/Icons/IconGallery.stories.svelte +235 -235
- package/dist/primitives/Icons/Info.svelte +7 -7
- package/dist/primitives/Icons/InstagramIcon.svelte +4 -4
- package/dist/primitives/Icons/LogoInstagram.svelte +2 -2
- package/dist/primitives/Icons/Message.svelte +15 -15
- package/dist/primitives/Icons/MoonIcon.svelte +5 -5
- package/dist/primitives/Icons/More.svelte +21 -21
- package/dist/primitives/Icons/MoreHori.spec.js +61 -61
- package/dist/primitives/Icons/MoreHori.svelte +22 -22
- package/dist/primitives/Icons/Notification.svelte +14 -14
- package/dist/primitives/Icons/Payment.svelte +14 -14
- package/dist/primitives/Icons/Profile.svelte +21 -21
- package/dist/primitives/Icons/Reload.svelte +29 -29
- package/dist/primitives/Icons/Shows.svelte +21 -21
- package/dist/primitives/Icons/Signout.svelte +21 -21
- package/dist/primitives/Icons/SunIcon.svelte +8 -8
- package/dist/primitives/Icons/TiktokIcon.svelte +2 -2
- package/dist/primitives/Icons/TwitterIcon.svelte +2 -2
- package/dist/primitives/Icons/WarningIcon.spec.js +18 -18
- package/dist/primitives/Icons/WarningIcon.svelte +5 -5
- package/dist/primitives/Icons/iconTestUtils.spec.d.ts +2 -0
- package/dist/primitives/Icons/iconTestUtils.spec.d.ts.map +1 -0
- package/dist/primitives/Icons/iconTestUtils.spec.js +235 -0
- package/dist/primitives/Input/Input.spec.js +573 -573
- package/dist/primitives/Input/Input.stories.svelte +139 -139
- package/dist/primitives/Input/Input.svelte +418 -431
- package/dist/primitives/Input/Input.svelte.d.ts.map +1 -1
- package/dist/primitives/Input/Select.spec.js +212 -218
- package/dist/primitives/Input/Select.stories.svelte +112 -112
- package/dist/primitives/Input/Select.svelte +128 -128
- package/dist/primitives/Input/Textarea.spec.d.ts +2 -0
- package/dist/primitives/Input/Textarea.spec.d.ts.map +1 -0
- package/dist/primitives/Input/Textarea.spec.js +255 -0
- package/dist/primitives/Input/Textarea.stories.svelte +137 -137
- package/dist/primitives/Input/Textarea.svelte +35 -35
- package/dist/primitives/Label/Label.spec.d.ts +2 -0
- package/dist/primitives/Label/Label.spec.d.ts.map +1 -0
- package/dist/primitives/Label/Label.spec.js +157 -0
- package/dist/primitives/Label/Label.svelte +37 -37
- package/dist/primitives/Modal/Modal.spec.js +99 -95
- package/dist/primitives/Modal/Modal.stories.svelte +86 -86
- package/dist/primitives/Modal/Modal.svelte +158 -158
- package/dist/primitives/Modal/ModalTestWrapper.svelte +65 -0
- package/dist/primitives/Modal/ModalTestWrapper.svelte.d.ts +23 -0
- package/dist/primitives/Modal/ModalTestWrapper.svelte.d.ts.map +1 -0
- package/dist/primitives/NumberInput/NumberInput.spec.d.ts +2 -0
- package/dist/primitives/NumberInput/NumberInput.spec.d.ts.map +1 -0
- package/dist/primitives/NumberInput/NumberInput.spec.js +235 -0
- package/dist/primitives/NumberInput/NumberInput.svelte +106 -106
- package/dist/primitives/Pagination/Pagination.spec.d.ts +2 -0
- package/dist/primitives/Pagination/Pagination.spec.d.ts.map +1 -0
- package/dist/primitives/Pagination/Pagination.spec.js +266 -0
- package/dist/primitives/Pagination/Pagination.stories.svelte +76 -76
- package/dist/primitives/Pagination/Pagination.svelte +261 -261
- package/dist/primitives/Radio/Radio.spec.d.ts +2 -0
- package/dist/primitives/Radio/Radio.spec.d.ts.map +1 -0
- package/dist/primitives/Radio/Radio.spec.js +206 -0
- package/dist/primitives/Radio/Radio.stories.svelte +80 -80
- package/dist/primitives/Radio/Radio.svelte +67 -67
- package/dist/primitives/Skeleton/CardPlaceholder.spec.d.ts +2 -0
- package/dist/primitives/Skeleton/CardPlaceholder.spec.d.ts.map +1 -0
- package/dist/primitives/Skeleton/CardPlaceholder.spec.js +156 -0
- package/dist/primitives/Skeleton/CardPlaceholder.svelte +87 -87
- package/dist/primitives/Skeleton/ImagePlaceholder.spec.d.ts +2 -0
- package/dist/primitives/Skeleton/ImagePlaceholder.spec.d.ts.map +1 -0
- package/dist/primitives/Skeleton/ImagePlaceholder.spec.js +120 -0
- package/dist/primitives/Skeleton/ImagePlaceholder.svelte +59 -59
- package/dist/primitives/Skeleton/ListPlaceholder.spec.d.ts +2 -0
- package/dist/primitives/Skeleton/ListPlaceholder.spec.d.ts.map +1 -0
- package/dist/primitives/Skeleton/ListPlaceholder.spec.js +220 -0
- package/dist/primitives/Skeleton/ListPlaceholder.svelte +76 -76
- package/dist/primitives/Skeleton/Skeleton.spec.d.ts +2 -0
- package/dist/primitives/Skeleton/Skeleton.spec.d.ts.map +1 -0
- package/dist/primitives/Skeleton/Skeleton.spec.js +173 -0
- package/dist/primitives/Skeleton/Skeleton.stories.svelte +151 -151
- package/dist/primitives/Skeleton/Skeleton.svelte +26 -26
- package/dist/primitives/Spinner/Spinner.spec.js +71 -75
- package/dist/primitives/Spinner/Spinner.stories.svelte +29 -29
- package/dist/primitives/Spinner/Spinner.svelte +20 -20
- package/dist/primitives/Tabs/TabItem.spec.d.ts +2 -0
- package/dist/primitives/Tabs/TabItem.spec.d.ts.map +1 -0
- package/dist/primitives/Tabs/TabItem.spec.js +130 -0
- package/dist/primitives/Tabs/TabItem.svelte +49 -49
- package/dist/primitives/Tabs/Tabs.spec.d.ts +2 -0
- package/dist/primitives/Tabs/Tabs.spec.d.ts.map +1 -0
- package/dist/primitives/Tabs/Tabs.spec.js +295 -0
- package/dist/primitives/Tabs/Tabs.stories.svelte +112 -112
- package/dist/primitives/Tabs/Tabs.svelte +123 -123
- package/dist/primitives/Tabs/TabsWithItems.test.svelte +18 -0
- package/dist/primitives/Tabs/TabsWithItems.test.svelte.d.ts +16 -0
- package/dist/primitives/Tabs/TabsWithItems.test.svelte.d.ts.map +1 -0
- package/dist/primitives/Toggle.spec.js +143 -127
- package/dist/primitives/Toggle.stories.svelte +92 -92
- package/dist/primitives/Toggle.svelte +71 -71
- package/dist/primitives/Typography/Typography.spec.d.ts +2 -0
- package/dist/primitives/Typography/Typography.spec.d.ts.map +1 -0
- package/dist/primitives/Typography/Typography.spec.js +183 -0
- package/dist/primitives/Typography/Typography.svelte +53 -53
- package/dist/primitives/ValidationError.spec.js +103 -103
- package/dist/primitives/ValidationError.stories.svelte +69 -69
- package/dist/primitives/ValidationError.svelte +29 -29
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.js +84 -81
- package/dist/recipes/CropImage/CropImage.spec.js +208 -216
- package/dist/recipes/CropImage/CropImage.stories.svelte +104 -104
- package/dist/recipes/CropImage/CropImage.svelte +238 -238
- package/dist/recipes/ImageUploader/ImageUploader.spec.d.ts +2 -0
- package/dist/recipes/ImageUploader/ImageUploader.spec.d.ts.map +1 -0
- package/dist/recipes/ImageUploader/ImageUploader.spec.js +1351 -0
- package/dist/recipes/ImageUploader/ImageUploader.stories.svelte +125 -125
- package/dist/recipes/ImageUploader/ImageUploader.svelte +804 -804
- package/dist/recipes/SuperLogin/SuperLogin.spec.d.ts +2 -0
- package/dist/recipes/SuperLogin/SuperLogin.spec.d.ts.map +1 -0
- package/dist/recipes/SuperLogin/SuperLogin.spec.js +1436 -0
- package/dist/recipes/Toaster/Toaster.stories.svelte +62 -62
- package/dist/recipes/feedback/EmptyState/EmptyState.spec.d.ts +2 -0
- package/dist/recipes/feedback/EmptyState/EmptyState.spec.d.ts.map +1 -0
- package/dist/recipes/feedback/EmptyState/EmptyState.spec.js +202 -0
- package/dist/recipes/feedback/EmptyState/EmptyState.svelte +1 -1
- package/dist/recipes/feedback/ErrorDisplay.spec.js +69 -69
- package/dist/recipes/feedback/ErrorDisplay.stories.svelte +101 -101
- package/dist/recipes/feedback/ErrorDisplay.svelte +1 -1
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.spec.js +133 -129
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.svelte +157 -157
- package/dist/recipes/fields/CheckboxField.spec.d.ts +2 -0
- package/dist/recipes/fields/CheckboxField.spec.d.ts.map +1 -0
- package/dist/recipes/fields/CheckboxField.spec.js +135 -0
- package/dist/recipes/fields/CheckboxField.svelte +85 -85
- package/dist/recipes/fields/FormField.spec.d.ts +2 -0
- package/dist/recipes/fields/FormField.spec.d.ts.map +1 -0
- package/dist/recipes/fields/FormField.spec.js +159 -0
- package/dist/recipes/fields/FormField.svelte +58 -58
- package/dist/recipes/fields/RadioGroup.spec.d.ts +2 -0
- package/dist/recipes/fields/RadioGroup.spec.d.ts.map +1 -0
- package/dist/recipes/fields/RadioGroup.spec.js +199 -0
- package/dist/recipes/fields/RadioGroup.svelte +95 -95
- package/dist/recipes/fields/SelectField.spec.d.ts +2 -0
- package/dist/recipes/fields/SelectField.spec.d.ts.map +1 -0
- package/dist/recipes/fields/SelectField.spec.js +188 -0
- package/dist/recipes/fields/SelectField.svelte +80 -80
- package/dist/recipes/fields/TextareaField.spec.d.ts +2 -0
- package/dist/recipes/fields/TextareaField.spec.d.ts.map +1 -0
- package/dist/recipes/fields/TextareaField.spec.js +205 -0
- package/dist/recipes/fields/TextareaField.svelte +97 -97
- package/dist/recipes/fields/ToggleField.spec.d.ts +2 -0
- package/dist/recipes/fields/ToggleField.spec.d.ts.map +1 -0
- package/dist/recipes/fields/ToggleField.spec.js +153 -0
- package/dist/recipes/fields/ToggleField.svelte +60 -60
- package/dist/recipes/fields/index.js +7 -7
- package/dist/recipes/inputs/MultiSelect.spec.js +258 -257
- package/dist/recipes/inputs/MultiSelect.stories.svelte +133 -133
- package/dist/recipes/inputs/MultiSelect.svelte +256 -249
- 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.spec.js +251 -238
- package/dist/recipes/inputs/OTPInput.stories.svelte +162 -162
- package/dist/recipes/inputs/OTPInput.svelte +29 -29
- package/dist/recipes/inputs/PasswordInput.spec.d.ts +2 -0
- package/dist/recipes/inputs/PasswordInput.spec.d.ts.map +1 -0
- package/dist/recipes/inputs/PasswordInput.spec.js +410 -0
- package/dist/recipes/inputs/PasswordInput.svelte +22 -22
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.spec.js +253 -173
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte +117 -117
- package/dist/recipes/inputs/PasswordStrengthIndicator/TestWrapper.svelte +71 -0
- package/dist/recipes/inputs/PasswordStrengthIndicator/TestWrapper.svelte.d.ts +9 -0
- package/dist/recipes/inputs/PasswordStrengthIndicator/TestWrapper.svelte.d.ts.map +1 -0
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.spec.js +1246 -300
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.stories.svelte +123 -123
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte +326 -326
- package/dist/recipes/inputs/Search.spec.d.ts +2 -0
- package/dist/recipes/inputs/Search.spec.d.ts.map +1 -0
- package/dist/recipes/inputs/Search.spec.js +177 -0
- package/dist/recipes/inputs/Search.svelte +37 -37
- package/dist/recipes/inputs/SelectDropdown.spec.d.ts +2 -0
- package/dist/recipes/inputs/SelectDropdown.spec.d.ts.map +1 -0
- package/dist/recipes/inputs/SelectDropdown.spec.js +512 -0
- package/dist/recipes/inputs/SelectDropdown.svelte +57 -57
- package/dist/recipes/modals/AlertModal.spec.d.ts +2 -0
- package/dist/recipes/modals/AlertModal.spec.d.ts.map +1 -0
- package/dist/recipes/modals/AlertModal.spec.js +432 -0
- package/dist/recipes/modals/AlertModal.svelte +130 -130
- package/dist/recipes/modals/ConfirmationModal.spec.js +206 -191
- package/dist/recipes/modals/ConfirmationModal.stories.svelte +119 -119
- package/dist/recipes/modals/ConfirmationModal.svelte +152 -152
- package/dist/recipes/modals/InputModal.spec.d.ts +2 -0
- package/dist/recipes/modals/InputModal.spec.d.ts.map +1 -0
- package/dist/recipes/modals/InputModal.spec.js +872 -0
- package/dist/recipes/modals/InputModal.svelte +182 -182
- package/dist/recipes/modals/ModalStateManager.spec.js +100 -100
- package/dist/recipes/modals/ModalStateManager.svelte +77 -77
- package/dist/recipes/modals/ModalTestWrapper.spec.d.ts +2 -0
- package/dist/recipes/modals/ModalTestWrapper.spec.d.ts.map +1 -0
- package/dist/recipes/modals/ModalTestWrapper.spec.js +502 -0
- package/dist/recipes/modals/ModalTestWrapper.svelte +65 -65
- package/dist/recipes/modals/StatusModal.spec.d.ts +2 -0
- package/dist/recipes/modals/StatusModal.spec.d.ts.map +1 -0
- package/dist/recipes/modals/StatusModal.spec.js +599 -0
- package/dist/recipes/modals/StatusModal.svelte +206 -206
- package/dist/services/EventService.js +75 -75
- package/dist/services/EventService.spec.js +217 -217
- package/dist/services/ShowService.spec.js +345 -342
- package/dist/stores/auth.js +36 -36
- package/dist/stores/auth.spec.js +139 -139
- package/dist/stores/toaster.js +13 -13
- package/dist/stories/ButtonAuditDashboard.spec.d.ts +2 -0
- package/dist/stories/ButtonAuditDashboard.spec.d.ts.map +1 -0
- package/dist/stories/ButtonAuditDashboard.spec.js +913 -0
- package/dist/stories/ButtonAuditReview.spec.d.ts +2 -0
- package/dist/stories/ButtonAuditReview.spec.d.ts.map +1 -0
- package/dist/stories/ButtonAuditReview.spec.js +422 -0
- package/dist/stories/ButtonAuditReview.stories.svelte +14 -14
- package/dist/stories/ButtonAuditReview.svelte +427 -427
- package/dist/stories/ButtonGridView.spec.d.ts +2 -0
- package/dist/stories/ButtonGridView.spec.d.ts.map +1 -0
- package/dist/stories/ButtonGridView.spec.js +667 -0
- package/dist/stories/ButtonShowcase.spec.d.ts +2 -0
- package/dist/stories/ButtonShowcase.spec.d.ts.map +1 -0
- package/dist/stories/ButtonShowcase.spec.js +499 -0
- package/dist/stories/PatternsGallery.spec.d.ts +2 -0
- package/dist/stories/PatternsGallery.spec.d.ts.map +1 -0
- package/dist/stories/PatternsGallery.spec.js +514 -0
- package/dist/stories/PatternsGallery.stories.svelte +19 -19
- package/dist/stories/PatternsGallery.svelte +206 -206
- package/dist/stories/PrimitivesGallery.spec.d.ts +2 -0
- package/dist/stories/PrimitivesGallery.spec.d.ts.map +1 -0
- package/dist/stories/PrimitivesGallery.spec.js +813 -0
- package/dist/stories/PrimitivesGallery.stories.svelte +19 -19
- package/dist/stories/PrimitivesGallery.svelte +725 -725
- package/dist/stories/RecipesGallery.spec.d.ts +2 -0
- package/dist/stories/RecipesGallery.spec.d.ts.map +1 -0
- package/dist/stories/RecipesGallery.spec.js +299 -0
- package/dist/stories/RecipesGallery.stories.svelte +19 -19
- package/dist/stories/RecipesGallery.svelte +271 -271
- package/dist/stories/button-audit-manifest.json +11186 -11186
- package/dist/stripe/useStripeTheme.spec.d.ts +2 -0
- package/dist/stripe/useStripeTheme.spec.d.ts.map +1 -0
- package/dist/stripe/useStripeTheme.spec.js +793 -0
- package/dist/tailwind/preset.cjs +82 -82
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +405 -404
- package/dist/telemetry.spec.js +1144 -661
- package/dist/tokens/__tests__/colors.test.d.ts +2 -0
- package/dist/tokens/__tests__/colors.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/colors.test.js +152 -0
- package/dist/tokens/__tests__/radius.test.d.ts +2 -0
- package/dist/tokens/__tests__/radius.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/radius.test.js +118 -0
- package/dist/tokens/__tests__/shadows.test.d.ts +2 -0
- package/dist/tokens/__tests__/shadows.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/shadows.test.js +105 -0
- package/dist/tokens/__tests__/spacing.test.js +11 -8
- package/dist/tokens/__tests__/typography-base.test.d.ts +2 -0
- package/dist/tokens/__tests__/typography-base.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/typography-base.test.js +138 -0
- package/dist/tokens/__tests__/typography.test.d.ts +2 -0
- package/dist/tokens/__tests__/typography.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/typography.test.js +156 -0
- package/dist/tokens/__tests__/z-index.test.d.ts +2 -0
- package/dist/tokens/__tests__/z-index.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/z-index.test.js +121 -0
- package/dist/tokens/tokens.css +87 -87
- package/dist/tokens/typography-base.css +163 -0
- package/dist/utils/apiConfig.spec.js +219 -118
- package/dist/utils/formatters.spec.d.ts +2 -0
- package/dist/utils/formatters.spec.d.ts.map +1 -0
- package/dist/utils/formatters.spec.js +82 -0
- package/dist/utils/transitions.js +62 -62
- package/dist/utils/transitions.spec.d.ts +2 -0
- package/dist/utils/transitions.spec.d.ts.map +1 -0
- package/dist/utils/transitions.spec.js +130 -0
- package/dist/utils/utils.js +354 -354
- package/package.json +292 -286
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
/**
|
|
3
|
-
* NumberInput Component - Flowbite Native (Pure Tailwind)
|
|
4
|
-
* Quantity stepper with increment/decrement buttons
|
|
5
|
-
*
|
|
6
|
-
* Matches Figma design:
|
|
7
|
-
* - Buttons: bg-gray-100, border-gray-300, outer corners rounded
|
|
8
|
-
* - Display: bg-gray-50, border-gray-300
|
|
9
|
-
* - Height: 37px
|
|
10
|
-
* - Icons: 10x10px
|
|
11
|
-
*/
|
|
12
|
-
import { twMerge } from 'tailwind-merge';
|
|
13
|
-
|
|
14
|
-
/** @type {{
|
|
15
|
-
value?: number,
|
|
16
|
-
min?: number,
|
|
17
|
-
max?: number,
|
|
18
|
-
disabled?: boolean,
|
|
19
|
-
onchange?: (value: number) => void,
|
|
20
|
-
class?: string,
|
|
21
|
-
[key: string]: any
|
|
22
|
-
}} */
|
|
23
|
-
let {
|
|
24
|
-
value = 0,
|
|
25
|
-
min = 0,
|
|
26
|
-
max = Infinity,
|
|
27
|
-
disabled = false,
|
|
28
|
-
onchange,
|
|
29
|
-
class: className = "",
|
|
30
|
-
...restProps
|
|
31
|
-
} = $props();
|
|
32
|
-
|
|
33
|
-
function increment() {
|
|
34
|
-
if (value < max && !disabled) {
|
|
35
|
-
const newValue = value + 1;
|
|
36
|
-
onchange?.(newValue);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function decrement() {
|
|
41
|
-
if (value > min && !disabled) {
|
|
42
|
-
const newValue = value - 1;
|
|
43
|
-
onchange?.(newValue);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
let isMinDisabled = $derived(disabled || value <= min);
|
|
48
|
-
let isMaxDisabled = $derived(disabled || value >= max);
|
|
49
|
-
|
|
50
|
-
// Button base classes matching Figma spec
|
|
51
|
-
const buttonBase = "h-[37px] px-3 flex items-center justify-center bg-gray-100 border border-gray-300 transition-colors dark:bg-gray-700 dark:border-gray-600";
|
|
52
|
-
const buttonHover = "hover:bg-gray-200 dark:hover:bg-gray-600";
|
|
53
|
-
const buttonDisabled = "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-gray-100 dark:disabled:hover:bg-gray-700";
|
|
54
|
-
|
|
55
|
-
let decrementClasses = $derived(twMerge(
|
|
56
|
-
buttonBase,
|
|
57
|
-
buttonHover,
|
|
58
|
-
buttonDisabled,
|
|
59
|
-
"rounded-l-lg"
|
|
60
|
-
));
|
|
61
|
-
|
|
62
|
-
let incrementClasses = $derived(twMerge(
|
|
63
|
-
buttonBase,
|
|
64
|
-
buttonHover,
|
|
65
|
-
buttonDisabled,
|
|
66
|
-
"rounded-r-lg"
|
|
67
|
-
));
|
|
68
|
-
|
|
69
|
-
// Display classes matching Figma spec
|
|
70
|
-
const displayClasses = "h-[37px] px-4 flex items-center justify-center text-gray-500 text-sm bg-gray-50 border-y border-gray-300 -mx-px dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600";
|
|
71
|
-
|
|
72
|
-
let containerClasses = $derived(twMerge(
|
|
73
|
-
"inline-flex items-center",
|
|
74
|
-
className
|
|
75
|
-
));
|
|
76
|
-
</script>
|
|
77
|
-
|
|
78
|
-
<div class={containerClasses} {...restProps}>
|
|
79
|
-
<button
|
|
80
|
-
type="button"
|
|
81
|
-
class={decrementClasses}
|
|
82
|
-
onclick={decrement}
|
|
83
|
-
disabled={isMinDisabled}
|
|
84
|
-
aria-label="Decrease quantity"
|
|
85
|
-
>
|
|
86
|
-
<svg class="w-3 h-3 text-gray-800 dark:text-white" fill="none" viewBox="0 0 18 2">
|
|
87
|
-
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 1h16"/>
|
|
88
|
-
</svg>
|
|
89
|
-
</button>
|
|
90
|
-
|
|
91
|
-
<span class={displayClasses}>
|
|
92
|
-
{value}
|
|
93
|
-
</span>
|
|
94
|
-
|
|
95
|
-
<button
|
|
96
|
-
type="button"
|
|
97
|
-
class={incrementClasses}
|
|
98
|
-
onclick={increment}
|
|
99
|
-
disabled={isMaxDisabled}
|
|
100
|
-
aria-label="Increase quantity"
|
|
101
|
-
>
|
|
102
|
-
<svg class="w-3 h-3 text-gray-800 dark:text-white" fill="none" viewBox="0 0 18 18">
|
|
103
|
-
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/>
|
|
104
|
-
</svg>
|
|
105
|
-
</button>
|
|
106
|
-
</div>
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* NumberInput Component - Flowbite Native (Pure Tailwind)
|
|
4
|
+
* Quantity stepper with increment/decrement buttons
|
|
5
|
+
*
|
|
6
|
+
* Matches Figma design:
|
|
7
|
+
* - Buttons: bg-gray-100, border-gray-300, outer corners rounded
|
|
8
|
+
* - Display: bg-gray-50, border-gray-300
|
|
9
|
+
* - Height: 37px
|
|
10
|
+
* - Icons: 10x10px
|
|
11
|
+
*/
|
|
12
|
+
import { twMerge } from 'tailwind-merge';
|
|
13
|
+
|
|
14
|
+
/** @type {{
|
|
15
|
+
value?: number,
|
|
16
|
+
min?: number,
|
|
17
|
+
max?: number,
|
|
18
|
+
disabled?: boolean,
|
|
19
|
+
onchange?: (value: number) => void,
|
|
20
|
+
class?: string,
|
|
21
|
+
[key: string]: any
|
|
22
|
+
}} */
|
|
23
|
+
let {
|
|
24
|
+
value = 0,
|
|
25
|
+
min = 0,
|
|
26
|
+
max = Infinity,
|
|
27
|
+
disabled = false,
|
|
28
|
+
onchange,
|
|
29
|
+
class: className = "",
|
|
30
|
+
...restProps
|
|
31
|
+
} = $props();
|
|
32
|
+
|
|
33
|
+
function increment() {
|
|
34
|
+
if (value < max && !disabled) {
|
|
35
|
+
const newValue = value + 1;
|
|
36
|
+
onchange?.(newValue);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function decrement() {
|
|
41
|
+
if (value > min && !disabled) {
|
|
42
|
+
const newValue = value - 1;
|
|
43
|
+
onchange?.(newValue);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
let isMinDisabled = $derived(disabled || value <= min);
|
|
48
|
+
let isMaxDisabled = $derived(disabled || value >= max);
|
|
49
|
+
|
|
50
|
+
// Button base classes matching Figma spec
|
|
51
|
+
const buttonBase = "h-[37px] px-3 flex items-center justify-center bg-gray-100 border border-gray-300 transition-colors dark:bg-gray-700 dark:border-gray-600";
|
|
52
|
+
const buttonHover = "hover:bg-gray-200 dark:hover:bg-gray-600";
|
|
53
|
+
const buttonDisabled = "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-gray-100 dark:disabled:hover:bg-gray-700";
|
|
54
|
+
|
|
55
|
+
let decrementClasses = $derived(twMerge(
|
|
56
|
+
buttonBase,
|
|
57
|
+
buttonHover,
|
|
58
|
+
buttonDisabled,
|
|
59
|
+
"rounded-l-lg"
|
|
60
|
+
));
|
|
61
|
+
|
|
62
|
+
let incrementClasses = $derived(twMerge(
|
|
63
|
+
buttonBase,
|
|
64
|
+
buttonHover,
|
|
65
|
+
buttonDisabled,
|
|
66
|
+
"rounded-r-lg"
|
|
67
|
+
));
|
|
68
|
+
|
|
69
|
+
// Display classes matching Figma spec
|
|
70
|
+
const displayClasses = "h-[37px] px-4 flex items-center justify-center text-gray-500 text-sm bg-gray-50 border-y border-gray-300 -mx-px dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600";
|
|
71
|
+
|
|
72
|
+
let containerClasses = $derived(twMerge(
|
|
73
|
+
"inline-flex items-center",
|
|
74
|
+
className
|
|
75
|
+
));
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<div class={containerClasses} {...restProps}>
|
|
79
|
+
<button
|
|
80
|
+
type="button"
|
|
81
|
+
class={decrementClasses}
|
|
82
|
+
onclick={decrement}
|
|
83
|
+
disabled={isMinDisabled}
|
|
84
|
+
aria-label="Decrease quantity"
|
|
85
|
+
>
|
|
86
|
+
<svg class="w-3 h-3 text-gray-800 dark:text-white" fill="none" viewBox="0 0 18 2">
|
|
87
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 1h16"/>
|
|
88
|
+
</svg>
|
|
89
|
+
</button>
|
|
90
|
+
|
|
91
|
+
<span class={displayClasses}>
|
|
92
|
+
{value}
|
|
93
|
+
</span>
|
|
94
|
+
|
|
95
|
+
<button
|
|
96
|
+
type="button"
|
|
97
|
+
class={incrementClasses}
|
|
98
|
+
onclick={increment}
|
|
99
|
+
disabled={isMaxDisabled}
|
|
100
|
+
aria-label="Increase quantity"
|
|
101
|
+
>
|
|
102
|
+
<svg class="w-3 h-3 text-gray-800 dark:text-white" fill="none" viewBox="0 0 18 18">
|
|
103
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/>
|
|
104
|
+
</svg>
|
|
105
|
+
</button>
|
|
106
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Pagination/Pagination.spec.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/svelte';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { expect, describe, test, vi } from 'vitest';
|
|
4
|
+
import Pagination from './Pagination.svelte';
|
|
5
|
+
|
|
6
|
+
describe('Pagination Component', () => {
|
|
7
|
+
test('renders navigation element', () => {
|
|
8
|
+
const { container } = render(Pagination, { props: { totalPages: 5 } });
|
|
9
|
+
expect(container.querySelector('nav')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('has aria-label="Pagination"', () => {
|
|
13
|
+
const { container } = render(Pagination, { props: { totalPages: 5 } });
|
|
14
|
+
const nav = container.querySelector('nav');
|
|
15
|
+
expect(nav).toHaveAttribute('aria-label', 'Pagination');
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('applies custom className', () => {
|
|
19
|
+
const { container } = render(Pagination, { props: { totalPages: 5, class: 'custom-pagination' } });
|
|
20
|
+
const nav = container.querySelector('nav');
|
|
21
|
+
expect(nav).toHaveClass('custom-pagination');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('passes through additional props', () => {
|
|
25
|
+
const { container } = render(Pagination, { props: { totalPages: 5, 'data-testid': 'my-pagination' } });
|
|
26
|
+
const nav = container.querySelector('[data-testid="my-pagination"]');
|
|
27
|
+
expect(nav).toBeInTheDocument();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe('Pagination Page Numbers', () => {
|
|
32
|
+
test('renders correct number of page buttons', () => {
|
|
33
|
+
const { container } = render(Pagination, { props: { totalPages: 5, currentPage: 1 } });
|
|
34
|
+
const pageButtons = container.querySelectorAll('button');
|
|
35
|
+
// 5 pages + prev + next = 7 buttons
|
|
36
|
+
expect(pageButtons.length).toBe(7);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('currentPage button has aria-current="page"', () => {
|
|
40
|
+
const { container } = render(Pagination, { props: { totalPages: 5, currentPage: 2 } });
|
|
41
|
+
const currentButton = container.querySelector('[aria-current="page"]');
|
|
42
|
+
expect(currentButton).toBeInTheDocument();
|
|
43
|
+
expect(currentButton).toHaveTextContent('2');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('first page is shown by default', () => {
|
|
47
|
+
render(Pagination, { props: { totalPages: 5 } });
|
|
48
|
+
expect(screen.getByRole('button', { name: '1' })).toBeInTheDocument();
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
describe('Pagination Navigation Buttons', () => {
|
|
53
|
+
test('shows prev/next buttons by default', () => {
|
|
54
|
+
const { container } = render(Pagination, { props: { totalPages: 5 } });
|
|
55
|
+
expect(container.querySelector('[aria-label="Previous page"]')).toBeInTheDocument();
|
|
56
|
+
expect(container.querySelector('[aria-label="Next page"]')).toBeInTheDocument();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('hides prev/next when showPrevNext is false', () => {
|
|
60
|
+
const { container } = render(Pagination, { props: { totalPages: 5, showPrevNext: false } });
|
|
61
|
+
expect(container.querySelector('[aria-label="Previous page"]')).not.toBeInTheDocument();
|
|
62
|
+
expect(container.querySelector('[aria-label="Next page"]')).not.toBeInTheDocument();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('previous button is disabled on first page', () => {
|
|
66
|
+
const { container } = render(Pagination, { props: { totalPages: 5, currentPage: 1 } });
|
|
67
|
+
const prevButton = container.querySelector('[aria-label="Previous page"]');
|
|
68
|
+
expect(prevButton).toBeDisabled();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('next button is disabled on last page', () => {
|
|
72
|
+
const { container } = render(Pagination, { props: { totalPages: 5, currentPage: 5 } });
|
|
73
|
+
const nextButton = container.querySelector('[aria-label="Next page"]');
|
|
74
|
+
expect(nextButton).toBeDisabled();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('previous button is enabled when not on first page', () => {
|
|
78
|
+
const { container } = render(Pagination, { props: { totalPages: 5, currentPage: 3 } });
|
|
79
|
+
const prevButton = container.querySelector('[aria-label="Previous page"]');
|
|
80
|
+
expect(prevButton).not.toBeDisabled();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('next button is enabled when not on last page', () => {
|
|
84
|
+
const { container } = render(Pagination, { props: { totalPages: 5, currentPage: 3 } });
|
|
85
|
+
const nextButton = container.querySelector('[aria-label="Next page"]');
|
|
86
|
+
expect(nextButton).not.toBeDisabled();
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
describe('Pagination Click Events', () => {
|
|
91
|
+
test('calls onchange when page button is clicked', async () => {
|
|
92
|
+
const user = userEvent.setup();
|
|
93
|
+
const onchange = vi.fn();
|
|
94
|
+
render(Pagination, { props: { totalPages: 5, currentPage: 1, onchange } });
|
|
95
|
+
|
|
96
|
+
await user.click(screen.getByRole('button', { name: '3' }));
|
|
97
|
+
expect(onchange).toHaveBeenCalledWith({ page: 3 });
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test('calls onPageChange when page button is clicked', async () => {
|
|
101
|
+
const user = userEvent.setup();
|
|
102
|
+
const onPageChange = vi.fn();
|
|
103
|
+
render(Pagination, { props: { totalPages: 5, currentPage: 1, onPageChange } });
|
|
104
|
+
|
|
105
|
+
await user.click(screen.getByRole('button', { name: '2' }));
|
|
106
|
+
expect(onPageChange).toHaveBeenCalledWith(2);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
test('clicking next moves to next page', async () => {
|
|
110
|
+
const user = userEvent.setup();
|
|
111
|
+
const onchange = vi.fn();
|
|
112
|
+
const { container } = render(Pagination, { props: { totalPages: 5, currentPage: 2, onchange } });
|
|
113
|
+
|
|
114
|
+
const nextButton = container.querySelector('[aria-label="Next page"]');
|
|
115
|
+
await user.click(nextButton);
|
|
116
|
+
expect(onchange).toHaveBeenCalledWith({ page: 3 });
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
test('clicking previous moves to previous page', async () => {
|
|
120
|
+
const user = userEvent.setup();
|
|
121
|
+
const onchange = vi.fn();
|
|
122
|
+
const { container } = render(Pagination, { props: { totalPages: 5, currentPage: 3, onchange } });
|
|
123
|
+
|
|
124
|
+
const prevButton = container.querySelector('[aria-label="Previous page"]');
|
|
125
|
+
await user.click(prevButton);
|
|
126
|
+
expect(onchange).toHaveBeenCalledWith({ page: 2 });
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
describe('Pagination Sizes', () => {
|
|
131
|
+
test('sm size applies correct classes', () => {
|
|
132
|
+
const { container } = render(Pagination, { props: { totalPages: 3, size: 'sm' } });
|
|
133
|
+
const button = container.querySelector('[aria-label="Previous page"]');
|
|
134
|
+
expect(button).toHaveClass('h-8');
|
|
135
|
+
expect(button).toHaveClass('text-sm');
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
test('md size applies correct classes', () => {
|
|
139
|
+
const { container } = render(Pagination, { props: { totalPages: 3, size: 'md' } });
|
|
140
|
+
const button = container.querySelector('[aria-label="Previous page"]');
|
|
141
|
+
expect(button).toHaveClass('h-9');
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
test('lg size applies correct classes', () => {
|
|
145
|
+
const { container } = render(Pagination, { props: { totalPages: 3, size: 'lg' } });
|
|
146
|
+
const button = container.querySelector('[aria-label="Previous page"]');
|
|
147
|
+
expect(button).toHaveClass('h-10');
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
describe('Pagination Variant', () => {
|
|
152
|
+
test('table variant renders with entries text', () => {
|
|
153
|
+
const { container } = render(Pagination, { props: {
|
|
154
|
+
variant: 'table',
|
|
155
|
+
totalPages: 5,
|
|
156
|
+
totalItems: 50,
|
|
157
|
+
perPage: 10,
|
|
158
|
+
currentPage: 1
|
|
159
|
+
} });
|
|
160
|
+
// Check that the component renders in table variant mode
|
|
161
|
+
const wrapper = container.querySelector('div.flex.flex-col');
|
|
162
|
+
expect(wrapper).toBeInTheDocument();
|
|
163
|
+
expect(container.textContent).toContain('entries');
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
test('table variant shows nav element', () => {
|
|
167
|
+
const { container } = render(Pagination, { props: {
|
|
168
|
+
variant: 'table',
|
|
169
|
+
totalPages: 5,
|
|
170
|
+
totalItems: 50,
|
|
171
|
+
perPage: 10,
|
|
172
|
+
currentPage: 1
|
|
173
|
+
} });
|
|
174
|
+
expect(container.querySelector('nav')).toBeInTheDocument();
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
test('default variant has inline-flex class', () => {
|
|
178
|
+
const { container } = render(Pagination, { props: { totalPages: 5 } });
|
|
179
|
+
const nav = container.querySelector('nav');
|
|
180
|
+
expect(nav).toHaveClass('inline-flex');
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
describe('Pagination Button Styling', () => {
|
|
185
|
+
test('buttons have flex and items-center classes', () => {
|
|
186
|
+
const { container } = render(Pagination, { props: { totalPages: 3 } });
|
|
187
|
+
const button = container.querySelector('[aria-label="Previous page"]');
|
|
188
|
+
expect(button).toHaveClass('flex');
|
|
189
|
+
expect(button).toHaveClass('items-center');
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
test('buttons have border classes', () => {
|
|
193
|
+
const { container } = render(Pagination, { props: { totalPages: 3 } });
|
|
194
|
+
const button = container.querySelector('[aria-label="Previous page"]');
|
|
195
|
+
expect(button).toHaveClass('border');
|
|
196
|
+
expect(button).toHaveClass('border-gray-300');
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
test('buttons have bg-white background', () => {
|
|
200
|
+
const { container } = render(Pagination, { props: { totalPages: 3, currentPage: 1 } });
|
|
201
|
+
const nextButton = container.querySelector('[aria-label="Next page"]');
|
|
202
|
+
expect(nextButton).toHaveClass('bg-white');
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
test('prev button has rounded-s-lg', () => {
|
|
206
|
+
const { container } = render(Pagination, { props: { totalPages: 3 } });
|
|
207
|
+
const prevButton = container.querySelector('[aria-label="Previous page"]');
|
|
208
|
+
expect(prevButton).toHaveClass('rounded-s-lg');
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
test('next button has rounded-e-lg', () => {
|
|
212
|
+
const { container } = render(Pagination, { props: { totalPages: 3 } });
|
|
213
|
+
const nextButton = container.querySelector('[aria-label="Next page"]');
|
|
214
|
+
expect(nextButton).toHaveClass('rounded-e-lg');
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
test('active page has bg-blue-50', () => {
|
|
218
|
+
const { container } = render(Pagination, { props: { totalPages: 3, currentPage: 2 } });
|
|
219
|
+
const activeButton = container.querySelector('[aria-current="page"]');
|
|
220
|
+
expect(activeButton).toHaveClass('bg-blue-50');
|
|
221
|
+
expect(activeButton).toHaveClass('text-blue-600');
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
test('disabled buttons have opacity-50', () => {
|
|
225
|
+
const { container } = render(Pagination, { props: { totalPages: 5, currentPage: 1 } });
|
|
226
|
+
const prevButton = container.querySelector('[aria-label="Previous page"]');
|
|
227
|
+
expect(prevButton).toHaveClass('opacity-50');
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
describe('Pagination Ellipsis', () => {
|
|
232
|
+
test('shows ellipsis when needed', () => {
|
|
233
|
+
const { container } = render(Pagination, { props: { totalPages: 10, currentPage: 8, maxVisible: 3 } });
|
|
234
|
+
const ellipses = container.querySelectorAll('.cursor-default');
|
|
235
|
+
expect(ellipses.length).toBeGreaterThan(0);
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
test('shows page 1 with ellipsis when not in visible range', () => {
|
|
239
|
+
render(Pagination, { props: { totalPages: 10, currentPage: 8, maxVisible: 3 } });
|
|
240
|
+
expect(screen.getByRole('button', { name: '1' })).toBeInTheDocument();
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
describe('Pagination Props', () => {
|
|
245
|
+
test('maxVisible controls visible page count', () => {
|
|
246
|
+
const { container } = render(Pagination, { props: { totalPages: 10, maxVisible: 3, currentPage: 5 } });
|
|
247
|
+
// Should have 3 visible pages plus ellipsis buttons plus prev/next
|
|
248
|
+
const pageButtons = container.querySelectorAll('button');
|
|
249
|
+
expect(pageButtons.length).toBeGreaterThan(3);
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
test('showIcons prop works as alias for showPrevNext', () => {
|
|
253
|
+
const { container } = render(Pagination, { props: { totalPages: 5, showIcons: false } });
|
|
254
|
+
expect(container.querySelector('[aria-label="Previous page"]')).not.toBeInTheDocument();
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
test('previousLabel replaces chevron icon', () => {
|
|
258
|
+
render(Pagination, { props: { totalPages: 5, previousLabel: 'Back' } });
|
|
259
|
+
expect(screen.getByText('Back')).toBeInTheDocument();
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
test('nextLabel replaces chevron icon', () => {
|
|
263
|
+
render(Pagination, { props: { totalPages: 5, nextLabel: 'Forward' } });
|
|
264
|
+
expect(screen.getByText('Forward')).toBeInTheDocument();
|
|
265
|
+
});
|
|
266
|
+
});
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Pagination from './Pagination.svelte';
|
|
4
|
-
|
|
5
|
-
const { Story } = defineMeta({
|
|
6
|
-
title: 'Primitives/Pagination',
|
|
7
|
-
component: Pagination,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
argTypes: {
|
|
10
|
-
totalPages: { control: 'number' },
|
|
11
|
-
currentPage: { control: 'number' },
|
|
12
|
-
},
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component: 'Page navigation control for paginated data.',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
let page1 = $state(1);
|
|
23
|
-
let page2 = $state(5);
|
|
24
|
-
let page3 = $state(1);
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<Story name="Default">
|
|
28
|
-
{#snippet template()}
|
|
29
|
-
<div>
|
|
30
|
-
<Pagination totalPages={10} bind:currentPage={page1} />
|
|
31
|
-
<p class="text-sm text-gray-500 mt-4">Current page: {page1}</p>
|
|
32
|
-
</div>
|
|
33
|
-
{/snippet}
|
|
34
|
-
</Story>
|
|
35
|
-
|
|
36
|
-
<Story name="Middle Page">
|
|
37
|
-
{#snippet template()}
|
|
38
|
-
<div>
|
|
39
|
-
<Pagination totalPages={10} bind:currentPage={page2} />
|
|
40
|
-
<p class="text-sm text-gray-500 mt-4">Current page: {page2}</p>
|
|
41
|
-
</div>
|
|
42
|
-
{/snippet}
|
|
43
|
-
</Story>
|
|
44
|
-
|
|
45
|
-
<Story name="Few Pages">
|
|
46
|
-
{#snippet template()}
|
|
47
|
-
<div>
|
|
48
|
-
<Pagination totalPages={3} bind:currentPage={page3} />
|
|
49
|
-
<p class="text-sm text-gray-500 mt-4">Current page: {page3}</p>
|
|
50
|
-
</div>
|
|
51
|
-
{/snippet}
|
|
52
|
-
</Story>
|
|
53
|
-
|
|
54
|
-
<Story name="Many Pages">
|
|
55
|
-
{#snippet template()}
|
|
56
|
-
<Pagination totalPages={100} currentPage={50} />
|
|
57
|
-
{/snippet}
|
|
58
|
-
</Story>
|
|
59
|
-
|
|
60
|
-
<Story name="In Context">
|
|
61
|
-
{#snippet template()}
|
|
62
|
-
<div class="border rounded-lg p-4">
|
|
63
|
-
<h3 class="font-medium mb-4">Search Results</h3>
|
|
64
|
-
<ul class="space-y-2 mb-4">
|
|
65
|
-
{#each [1, 2, 3, 4, 5] as i}
|
|
66
|
-
<li class="p-3 border rounded hover:bg-gray-50">
|
|
67
|
-
Result item {i}
|
|
68
|
-
</li>
|
|
69
|
-
{/each}
|
|
70
|
-
</ul>
|
|
71
|
-
<div class="border-t pt-4">
|
|
72
|
-
<Pagination totalPages={20} bind:currentPage={page1} />
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
{/snippet}
|
|
76
|
-
</Story>
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Pagination from './Pagination.svelte';
|
|
4
|
+
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
title: 'Primitives/Pagination',
|
|
7
|
+
component: Pagination,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
argTypes: {
|
|
10
|
+
totalPages: { control: 'number' },
|
|
11
|
+
currentPage: { control: 'number' },
|
|
12
|
+
},
|
|
13
|
+
parameters: {
|
|
14
|
+
docs: {
|
|
15
|
+
description: {
|
|
16
|
+
component: 'Page navigation control for paginated data.',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
let page1 = $state(1);
|
|
23
|
+
let page2 = $state(5);
|
|
24
|
+
let page3 = $state(1);
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<Story name="Default">
|
|
28
|
+
{#snippet template()}
|
|
29
|
+
<div>
|
|
30
|
+
<Pagination totalPages={10} bind:currentPage={page1} />
|
|
31
|
+
<p class="text-sm text-gray-500 mt-4">Current page: {page1}</p>
|
|
32
|
+
</div>
|
|
33
|
+
{/snippet}
|
|
34
|
+
</Story>
|
|
35
|
+
|
|
36
|
+
<Story name="Middle Page">
|
|
37
|
+
{#snippet template()}
|
|
38
|
+
<div>
|
|
39
|
+
<Pagination totalPages={10} bind:currentPage={page2} />
|
|
40
|
+
<p class="text-sm text-gray-500 mt-4">Current page: {page2}</p>
|
|
41
|
+
</div>
|
|
42
|
+
{/snippet}
|
|
43
|
+
</Story>
|
|
44
|
+
|
|
45
|
+
<Story name="Few Pages">
|
|
46
|
+
{#snippet template()}
|
|
47
|
+
<div>
|
|
48
|
+
<Pagination totalPages={3} bind:currentPage={page3} />
|
|
49
|
+
<p class="text-sm text-gray-500 mt-4">Current page: {page3}</p>
|
|
50
|
+
</div>
|
|
51
|
+
{/snippet}
|
|
52
|
+
</Story>
|
|
53
|
+
|
|
54
|
+
<Story name="Many Pages">
|
|
55
|
+
{#snippet template()}
|
|
56
|
+
<Pagination totalPages={100} currentPage={50} />
|
|
57
|
+
{/snippet}
|
|
58
|
+
</Story>
|
|
59
|
+
|
|
60
|
+
<Story name="In Context">
|
|
61
|
+
{#snippet template()}
|
|
62
|
+
<div class="border rounded-lg p-4">
|
|
63
|
+
<h3 class="font-medium mb-4">Search Results</h3>
|
|
64
|
+
<ul class="space-y-2 mb-4">
|
|
65
|
+
{#each [1, 2, 3, 4, 5] as i}
|
|
66
|
+
<li class="p-3 border rounded hover:bg-gray-50">
|
|
67
|
+
Result item {i}
|
|
68
|
+
</li>
|
|
69
|
+
{/each}
|
|
70
|
+
</ul>
|
|
71
|
+
<div class="border-t pt-4">
|
|
72
|
+
<Pagination totalPages={20} bind:currentPage={page1} />
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
{/snippet}
|
|
76
|
+
</Story>
|