@getmicdrop/svelte-components 5.5.5 → 5.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar/AboutShow/AboutShow.svelte +172 -172
- package/dist/calendar/Calendar/MiniMonthCalendar.svelte +782 -782
- package/dist/calendar/FAQs/FAQs.svelte +75 -75
- package/dist/calendar/MonthSwitcher/MonthSwitcher.svelte +126 -126
- package/dist/calendar/OrderSummary/OrderSummary.svelte +367 -367
- package/dist/calendar/PublicCard/PublicCard.svelte +134 -134
- package/dist/calendar/ShowCard/ShowCard.svelte +157 -157
- 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.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.svelte +108 -108
- package/dist/components/Layout/Stack.spec.js +1 -1
- package/dist/components/Layout/Stack.svelte +6 -6
- package/dist/components/Layout/Text.svelte +87 -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__/AppShell.test.d.ts +2 -0
- package/dist/components/Layout/__tests__/AppShell.test.d.ts.map +1 -0
- package/dist/components/Layout/__tests__/AppShell.test.js +95 -0
- package/dist/components/Layout/__tests__/ContentSection.test.d.ts +2 -0
- package/dist/components/Layout/__tests__/ContentSection.test.d.ts.map +1 -0
- package/dist/components/Layout/__tests__/ContentSection.test.js +112 -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__/PageContainer.test.d.ts +2 -0
- package/dist/components/Layout/__tests__/PageContainer.test.d.ts.map +1 -0
- package/dist/components/Layout/__tests__/PageContainer.test.js +133 -0
- package/dist/components/Layout/__tests__/Responsive.test.d.ts +2 -0
- package/dist/components/Layout/__tests__/Responsive.test.d.ts.map +1 -0
- package/dist/components/Layout/__tests__/Responsive.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/validation.js +91 -91
- package/dist/constants/validation.spec.js +64 -64
- package/dist/datetime/__tests__/format.test.js +1 -1
- package/dist/datetime/__tests__/parse.test.js +1 -1
- package/dist/datetime/__tests__/timezone.test.js +1 -1
- package/dist/datetime/parse.js +1 -1
- package/dist/forms/createFormStore.svelte.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/patterns/data/DataGrid.svelte +45 -45
- package/dist/patterns/data/DataList.svelte +24 -24
- package/dist/patterns/data/DataTable.svelte +36 -36
- package/dist/patterns/forms/FormActions.spec.js +95 -95
- package/dist/patterns/forms/FormActions.stories.svelte +97 -97
- package/dist/patterns/forms/FormActions.svelte +46 -46
- package/dist/patterns/forms/FormGrid.svelte +33 -33
- package/dist/patterns/forms/FormSection.svelte +32 -32
- package/dist/patterns/forms/FormValidationSummary.stories.svelte +83 -83
- package/dist/patterns/forms/FormValidationSummary.svelte +74 -74
- package/dist/patterns/layout/Sidebar.svelte +39 -39
- package/dist/patterns/layout/index.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 +74 -64
- package/dist/patterns/navigation/BottomNav.svelte.d.ts.map +1 -1
- package/dist/patterns/navigation/Header.stories.svelte +77 -77
- package/dist/patterns/navigation/Header.svelte +193 -193
- package/dist/patterns/page/PageHeader.svelte +18 -18
- package/dist/patterns/page/PageLayout.svelte +40 -40
- package/dist/patterns/page/PageLoader.spec.js +57 -57
- package/dist/patterns/page/PageLoader.stories.svelte +137 -137
- package/dist/patterns/page/PageLoader.svelte +24 -24
- package/dist/patterns/page/SectionHeader.svelte +29 -29
- package/dist/presets/badges.js +112 -112
- package/dist/presets/buttons.js +76 -76
- package/dist/presets/index.js +9 -9
- package/dist/primitives/Accordion/Accordion.stories.svelte +75 -75
- package/dist/primitives/Accordion/Accordion.svelte +42 -42
- package/dist/primitives/Accordion/AccordionItem.svelte +95 -95
- package/dist/primitives/Accordion/AccordionItemWrapper.test.svelte +107 -107
- package/dist/primitives/Accordion/AccordionItemWrapper.test.svelte.d.ts +2 -2
- package/dist/primitives/Accordion/AccordionItemWrapper.test.svelte.d.ts.map +1 -1
- package/dist/primitives/Alert/Alert.spec.js +173 -173
- package/dist/primitives/Alert/Alert.stories.svelte +88 -88
- package/dist/primitives/Alert/Alert.svelte +27 -27
- package/dist/primitives/Avatar/Avatar.stories.svelte +94 -94
- package/dist/primitives/Avatar/Avatar.svelte +66 -66
- package/dist/primitives/Badges/Badge.spec.js +144 -144
- 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 -136
- package/dist/primitives/BottomSheet/BottomSheet.stories.svelte +83 -83
- package/dist/primitives/BottomSheet/BottomSheet.svelte +100 -100
- package/dist/primitives/Breadcrumb/Breadcrumb.spec.js +122 -122
- 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 -223
- 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 -146
- package/dist/primitives/Button/ButtonSaveDemo.svelte +25 -25
- package/dist/primitives/Button/ButtonVariantShowcase.svelte +129 -129
- package/dist/primitives/Card.spec.js +49 -49
- package/dist/primitives/Card.stories.svelte +22 -22
- package/dist/primitives/Card.svelte +28 -28
- package/dist/primitives/Checkbox/Checkbox.stories.svelte +84 -84
- package/dist/primitives/Checkbox/Checkbox.svelte +88 -88
- package/dist/primitives/DarkModeToggle.spec.js +390 -390
- package/dist/primitives/DarkModeToggle.stories.svelte +57 -57
- package/dist/primitives/DarkModeToggle.svelte +136 -136
- package/dist/primitives/Drawer/Drawer.stories.svelte +80 -80
- package/dist/primitives/Drawer/Drawer.svelte +120 -120
- package/dist/primitives/Dropdown/Dropdown.stories.svelte +137 -137
- package/dist/primitives/Dropdown/Dropdown.svelte +14 -14
- package/dist/primitives/Dropdown/DropdownDivider.svelte +9 -0
- package/dist/primitives/Dropdown/DropdownDivider.svelte.d.ts +7 -0
- package/dist/primitives/Dropdown/DropdownDivider.svelte.d.ts.map +1 -0
- package/dist/primitives/Dropdown/DropdownItem.svelte +80 -80
- package/dist/primitives/Helper/Helper.svelte +33 -0
- package/dist/primitives/Helper/Helper.svelte.d.ts +18 -0
- package/dist/primitives/Helper/Helper.svelte.d.ts.map +1 -0
- package/dist/primitives/Icons/ArrowLeft.svelte +8 -8
- package/dist/primitives/Icons/ArrowRight.svelte +8 -8
- package/dist/primitives/Icons/Availability.svelte +14 -14
- package/dist/primitives/Icons/Back.svelte +14 -14
- package/dist/primitives/Icons/CheckCircle.svelte +6 -6
- package/dist/primitives/Icons/CheckCircleOutline.svelte +15 -15
- package/dist/primitives/Icons/ChevronLeft.svelte +4 -4
- package/dist/primitives/Icons/ChevronRight.svelte +4 -4
- package/dist/primitives/Icons/Copy.svelte +15 -15
- package/dist/primitives/Icons/Cross.svelte +5 -5
- package/dist/primitives/Icons/DownArrow.svelte +8 -8
- package/dist/primitives/Icons/ErrorCircle.svelte +6 -6
- package/dist/primitives/Icons/FacebookIcon.svelte +2 -2
- package/dist/primitives/Icons/Home.svelte +15 -15
- package/dist/primitives/Icons/Icon.spec.js +169 -169
- package/dist/primitives/Icons/Icon.stories.svelte +100 -100
- package/dist/primitives/Icons/Icon.svelte +52 -52
- package/dist/primitives/Icons/IconGallery.stories.svelte +235 -235
- package/dist/primitives/Icons/Info.svelte +7 -7
- package/dist/primitives/Icons/InstagramIcon.svelte +4 -4
- package/dist/primitives/Icons/LogoInstagram.svelte +2 -2
- package/dist/primitives/Icons/Message.svelte +15 -15
- package/dist/primitives/Icons/MoonIcon.svelte +5 -5
- package/dist/primitives/Icons/More.svelte +21 -21
- package/dist/primitives/Icons/MoreHori.spec.js +61 -61
- package/dist/primitives/Icons/MoreHori.svelte +22 -22
- package/dist/primitives/Icons/Notification.svelte +14 -14
- package/dist/primitives/Icons/Payment.svelte +14 -14
- package/dist/primitives/Icons/Profile.svelte +21 -21
- package/dist/primitives/Icons/Reload.svelte +29 -29
- package/dist/primitives/Icons/Shows.svelte +21 -21
- package/dist/primitives/Icons/Signout.svelte +21 -21
- package/dist/primitives/Icons/SunIcon.svelte +8 -8
- package/dist/primitives/Icons/TiktokIcon.svelte +2 -2
- package/dist/primitives/Icons/TwitterIcon.svelte +2 -2
- package/dist/primitives/Icons/WarningIcon.spec.js +18 -18
- package/dist/primitives/Icons/WarningIcon.svelte +5 -5
- package/dist/primitives/Input/Input.spec.js +573 -573
- package/dist/primitives/Input/Input.stories.svelte +139 -139
- package/dist/primitives/Input/Input.svelte +1 -2
- package/dist/primitives/Input/Input.svelte.d.ts +2 -4
- package/dist/primitives/Input/Input.svelte.d.ts.map +1 -1
- package/dist/primitives/Input/Select.spec.js +212 -212
- package/dist/primitives/Input/Select.stories.svelte +112 -112
- package/dist/primitives/Input/Select.svelte +128 -128
- package/dist/primitives/Input/Textarea.stories.svelte +137 -137
- package/dist/primitives/Input/Textarea.svelte +35 -35
- package/dist/primitives/Label/Label.svelte +37 -37
- package/dist/primitives/Modal/Modal.spec.js +99 -99
- package/dist/primitives/Modal/Modal.stories.svelte +86 -86
- package/dist/primitives/Modal/Modal.svelte +3 -4
- package/dist/primitives/Modal/Modal.svelte.d.ts +6 -8
- package/dist/primitives/Modal/Modal.svelte.d.ts.map +1 -1
- package/dist/primitives/NumberInput/NumberInput.svelte +0 -1
- package/dist/primitives/NumberInput/NumberInput.svelte.d.ts +0 -2
- package/dist/primitives/NumberInput/NumberInput.svelte.d.ts.map +1 -1
- package/dist/primitives/Pagination/Pagination.stories.svelte +76 -76
- package/dist/primitives/Pagination/Pagination.svelte +261 -261
- package/dist/primitives/Radio/Radio.stories.svelte +80 -80
- package/dist/primitives/Radio/Radio.svelte +67 -67
- package/dist/primitives/Skeleton/CardPlaceholder.svelte +87 -87
- package/dist/primitives/Skeleton/ImagePlaceholder.svelte +59 -59
- package/dist/primitives/Skeleton/ListPlaceholder.svelte +76 -76
- package/dist/primitives/Skeleton/Skeleton.stories.svelte +151 -151
- package/dist/primitives/Skeleton/Skeleton.svelte +26 -26
- package/dist/primitives/Spinner/Spinner.spec.js +71 -71
- package/dist/primitives/Spinner/Spinner.stories.svelte +29 -29
- package/dist/primitives/Spinner/Spinner.svelte +20 -20
- package/dist/primitives/Tabs/TabItem.svelte +49 -49
- package/dist/primitives/Tabs/Tabs.stories.svelte +112 -112
- package/dist/primitives/Tabs/Tabs.svelte +123 -123
- package/dist/primitives/Toggle.spec.js +143 -143
- package/dist/primitives/Toggle.stories.svelte +92 -92
- package/dist/primitives/Toggle.svelte +1 -2
- package/dist/primitives/Toggle.svelte.d.ts +2 -4
- package/dist/primitives/Toggle.svelte.d.ts.map +1 -1
- package/dist/primitives/Tooltip/Tooltip.svelte +83 -0
- package/dist/primitives/Tooltip/Tooltip.svelte.d.ts +15 -0
- package/dist/primitives/Tooltip/Tooltip.svelte.d.ts.map +1 -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 +3 -0
- package/dist/primitives/index.js +91 -84
- package/dist/recipes/CropImage/CropImage.spec.js +208 -208
- package/dist/recipes/CropImage/CropImage.stories.svelte +104 -104
- package/dist/recipes/CropImage/CropImage.svelte +238 -238
- package/dist/recipes/ImageUploader/ImageUploader.spec.js +6 -5
- package/dist/recipes/ImageUploader/ImageUploader.stories.svelte +125 -125
- package/dist/recipes/ImageUploader/ImageUploader.svelte +804 -804
- package/dist/recipes/SuperLogin/SuperLogin.spec.js +17 -17
- package/dist/recipes/Toaster/Toaster.stories.svelte +62 -62
- package/dist/recipes/feedback/EmptyState/EmptyState.svelte +1 -1
- package/dist/recipes/feedback/ErrorDisplay.spec.js +69 -69
- package/dist/recipes/feedback/ErrorDisplay.stories.svelte +101 -101
- package/dist/recipes/feedback/ErrorDisplay.svelte +1 -1
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.spec.js +133 -133
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.svelte +157 -157
- package/dist/recipes/fields/CheckboxField.svelte +85 -85
- package/dist/recipes/fields/FormField.svelte +58 -58
- package/dist/recipes/fields/RadioGroup.svelte +95 -95
- package/dist/recipes/fields/SelectField.svelte +80 -80
- package/dist/recipes/fields/TextareaField.svelte +97 -97
- package/dist/recipes/fields/ToggleField.svelte +60 -60
- package/dist/recipes/fields/index.js +7 -7
- package/dist/recipes/inputs/MultiSelect.spec.js +258 -258
- package/dist/recipes/inputs/MultiSelect.stories.svelte +133 -133
- package/dist/recipes/inputs/MultiSelect.svelte +29 -8
- package/dist/recipes/inputs/MultiSelect.svelte.d.ts +54 -21
- package/dist/recipes/inputs/MultiSelect.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/OTPInput.spec.js +251 -251
- package/dist/recipes/inputs/OTPInput.stories.svelte +162 -162
- package/dist/recipes/inputs/OTPInput.svelte +29 -29
- package/dist/recipes/inputs/PasswordInput.svelte +22 -22
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte +117 -117
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.spec.js +9 -4
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.stories.svelte +123 -123
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte +30 -25
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte.d.ts +12 -1
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/Search.svelte +37 -37
- package/dist/recipes/inputs/SelectDropdown.svelte +57 -57
- package/dist/recipes/modals/AlertModal.svelte +130 -130
- package/dist/recipes/modals/ConfirmationModal.spec.js +206 -206
- package/dist/recipes/modals/ConfirmationModal.stories.svelte +119 -119
- package/dist/recipes/modals/ConfirmationModal.svelte +152 -152
- 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.svelte +65 -65
- 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 -345
- package/dist/stores/auth.js +44 -36
- package/dist/stores/auth.spec.js +139 -139
- package/dist/stores/auth.svelte.d.ts +39 -0
- package/dist/stores/auth.svelte.d.ts.map +1 -0
- package/dist/stores/auth.svelte.js +60 -0
- package/dist/stores/formDataStore.d.ts.map +1 -1
- package/dist/stores/formDataStore.js +8 -0
- package/dist/stores/formDataStore.svelte.d.ts +47 -0
- package/dist/stores/formDataStore.svelte.d.ts.map +1 -0
- package/dist/stores/formDataStore.svelte.js +84 -0
- package/dist/stores/formSave.d.ts.map +1 -1
- package/dist/stores/formSave.js +8 -0
- package/dist/stores/formSave.svelte.d.ts +33 -0
- package/dist/stores/formSave.svelte.d.ts.map +1 -0
- package/dist/stores/formSave.svelte.js +113 -0
- package/dist/stores/navigation.d.ts.map +1 -1
- package/dist/stores/navigation.js +8 -0
- package/dist/stores/navigation.svelte.d.ts +35 -0
- package/dist/stores/navigation.svelte.d.ts.map +1 -0
- package/dist/stores/navigation.svelte.js +69 -0
- package/dist/stores/toaster.js +13 -13
- package/dist/stories/ButtonAuditReview.stories.svelte +14 -14
- package/dist/stories/ButtonAuditReview.svelte +427 -427
- package/dist/stories/PatternsGallery.stories.svelte +19 -19
- package/dist/stories/PatternsGallery.svelte +206 -206
- package/dist/stories/PrimitivesGallery.stories.svelte +19 -19
- package/dist/stories/PrimitivesGallery.svelte +725 -725
- 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/tailwind/preset.cjs +82 -82
- package/dist/telemetry.js +405 -405
- package/dist/telemetry.server.spec.js +11 -8
- package/dist/telemetry.spec.js +1169 -1144
- 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/tokens.css +87 -87
- package/dist/tokens/typography-base.css +163 -0
- package/dist/utils/apiConfig.spec.js +219 -219
- package/dist/utils/imageValidation.spec.js +62 -59
- package/dist/utils/logger.d.ts +19 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +47 -0
- package/dist/utils/transitions.js +62 -62
- package/dist/utils/utils.js +354 -354
- package/package.json +21 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Layout/Text.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGpC,KAAK,OAAO,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAC5F,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;AAC/C,KAAK,WAAW,GAAG,GAAG,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;AAElD,UAAU,KAAK;IACb,yBAAyB;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,6BAA6B;IAC7B,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,kBAAkB;IAClB,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;IACnD,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;IACrE,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAsEH,QAAA,MAAM,IAAI,2CAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
type Gap = 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
type Ratio = 'equal' | '1:2' | '2:1' | '1:3' | '3:1';
|
|
6
|
+
type StackAt = 'sm' | 'md' | 'lg' | 'never';
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
/** Gap between columns */
|
|
10
|
+
gap?: Gap;
|
|
11
|
+
/** Column ratio */
|
|
12
|
+
ratio?: Ratio;
|
|
13
|
+
/** Breakpoint at which columns stack vertically */
|
|
14
|
+
stackAt?: StackAt;
|
|
15
|
+
/** Reverse order when stacked */
|
|
16
|
+
reverseOnStack?: boolean;
|
|
17
|
+
/** Vertical alignment */
|
|
18
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
19
|
+
/** Additional CSS classes */
|
|
20
|
+
class?: string;
|
|
21
|
+
/** Left column content */
|
|
22
|
+
left?: Snippet;
|
|
23
|
+
/** Right column content */
|
|
24
|
+
right?: Snippet;
|
|
25
|
+
/** Children (alternative to left/right slots) */
|
|
26
|
+
children?: Snippet;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let {
|
|
30
|
+
gap = 'md',
|
|
31
|
+
ratio = 'equal',
|
|
32
|
+
stackAt = 'md',
|
|
33
|
+
reverseOnStack = false,
|
|
34
|
+
align = 'stretch',
|
|
35
|
+
class: className = '',
|
|
36
|
+
left,
|
|
37
|
+
right,
|
|
38
|
+
children,
|
|
39
|
+
}: Props = $props();
|
|
40
|
+
|
|
41
|
+
const gapClasses: Record<Gap, string> = {
|
|
42
|
+
none: 'gap-0',
|
|
43
|
+
sm: 'gap-2',
|
|
44
|
+
md: 'gap-4',
|
|
45
|
+
lg: 'gap-6',
|
|
46
|
+
xl: 'gap-8',
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Stack classes: normal and reversed versions
|
|
50
|
+
const stackAtClasses: Record<StackAt, string> = {
|
|
51
|
+
sm: 'flex-col sm:flex-row',
|
|
52
|
+
md: 'flex-col md:flex-row',
|
|
53
|
+
lg: 'flex-col lg:flex-row',
|
|
54
|
+
never: 'flex-row',
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const stackAtReversedClasses: Record<StackAt, string> = {
|
|
58
|
+
sm: 'flex-col-reverse sm:flex-row',
|
|
59
|
+
md: 'flex-col-reverse md:flex-row',
|
|
60
|
+
lg: 'flex-col-reverse lg:flex-row',
|
|
61
|
+
never: 'flex-row',
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const alignClasses: Record<string, string> = {
|
|
65
|
+
start: 'items-start',
|
|
66
|
+
center: 'items-center',
|
|
67
|
+
end: 'items-end',
|
|
68
|
+
stretch: 'items-stretch',
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// Ratio classes for each column
|
|
72
|
+
const ratioLeftClasses: Record<Ratio, string> = {
|
|
73
|
+
equal: 'flex-1',
|
|
74
|
+
'1:2': 'w-full md:w-1/3',
|
|
75
|
+
'2:1': 'w-full md:w-2/3',
|
|
76
|
+
'1:3': 'w-full md:w-1/4',
|
|
77
|
+
'3:1': 'w-full md:w-3/4',
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const ratioRightClasses: Record<Ratio, string> = {
|
|
81
|
+
equal: 'flex-1',
|
|
82
|
+
'1:2': 'w-full md:w-2/3',
|
|
83
|
+
'2:1': 'w-full md:w-1/3',
|
|
84
|
+
'1:3': 'w-full md:w-3/4',
|
|
85
|
+
'3:1': 'w-full md:w-1/4',
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
let containerClasses = $derived([
|
|
89
|
+
'flex',
|
|
90
|
+
reverseOnStack ? stackAtReversedClasses[stackAt] : stackAtClasses[stackAt],
|
|
91
|
+
gapClasses[gap],
|
|
92
|
+
alignClasses[align],
|
|
93
|
+
className,
|
|
94
|
+
].filter(Boolean).join(' '));
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<div class={containerClasses}>
|
|
98
|
+
{#if left && right}
|
|
99
|
+
<div class={ratioLeftClasses[ratio]}>
|
|
100
|
+
{@render left()}
|
|
101
|
+
</div>
|
|
102
|
+
<div class={ratioRightClasses[ratio]}>
|
|
103
|
+
{@render right()}
|
|
104
|
+
</div>
|
|
105
|
+
{:else if children}
|
|
106
|
+
{@render children()}
|
|
107
|
+
{/if}
|
|
108
|
+
</div>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type Gap = 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
type Ratio = 'equal' | '1:2' | '2:1' | '1:3' | '3:1';
|
|
4
|
+
type StackAt = 'sm' | 'md' | 'lg' | 'never';
|
|
5
|
+
interface Props {
|
|
6
|
+
/** Gap between columns */
|
|
7
|
+
gap?: Gap;
|
|
8
|
+
/** Column ratio */
|
|
9
|
+
ratio?: Ratio;
|
|
10
|
+
/** Breakpoint at which columns stack vertically */
|
|
11
|
+
stackAt?: StackAt;
|
|
12
|
+
/** Reverse order when stacked */
|
|
13
|
+
reverseOnStack?: boolean;
|
|
14
|
+
/** Vertical alignment */
|
|
15
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
16
|
+
/** Additional CSS classes */
|
|
17
|
+
class?: string;
|
|
18
|
+
/** Left column content */
|
|
19
|
+
left?: Snippet;
|
|
20
|
+
/** Right column content */
|
|
21
|
+
right?: Snippet;
|
|
22
|
+
/** Children (alternative to left/right slots) */
|
|
23
|
+
children?: Snippet;
|
|
24
|
+
}
|
|
25
|
+
declare const TwoColumn: import("svelte").Component<Props, {}, "">;
|
|
26
|
+
type TwoColumn = ReturnType<typeof TwoColumn>;
|
|
27
|
+
export default TwoColumn;
|
|
28
|
+
//# sourceMappingURL=TwoColumn.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwoColumn.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Layout/TwoColumn.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGpC,KAAK,GAAG,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9C,KAAK,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AACrD,KAAK,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,OAAO,CAAC;AAE5C,UAAU,KAAK;IACb,0BAA0B;IAC1B,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,mBAAmB;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,mDAAmD;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iCAAiC;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yBAAyB;IACzB,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;IAC/C,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA2FH,QAAA,MAAM,SAAS,2CAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppShell.test.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Layout/__tests__/AppShell.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/svelte';
|
|
3
|
+
import AppShell from '../AppShell.svelte';
|
|
4
|
+
describe('AppShell', () => {
|
|
5
|
+
describe('basic rendering', () => {
|
|
6
|
+
it('renders the shell container', () => {
|
|
7
|
+
const { container } = render(AppShell);
|
|
8
|
+
const shell = container.querySelector('div');
|
|
9
|
+
expect(shell).toBeTruthy();
|
|
10
|
+
});
|
|
11
|
+
it('applies min-h-screen class', () => {
|
|
12
|
+
const { container } = render(AppShell);
|
|
13
|
+
const shell = container.querySelector('div');
|
|
14
|
+
expect(shell?.classList.contains('min-h-screen')).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
it('renders main element', () => {
|
|
17
|
+
const { container } = render(AppShell);
|
|
18
|
+
expect(container.querySelector('main')).toBeTruthy();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe('variant prop', () => {
|
|
22
|
+
it('applies admin background by default', () => {
|
|
23
|
+
const { container } = render(AppShell);
|
|
24
|
+
const shell = container.querySelector('div');
|
|
25
|
+
expect(shell?.classList.contains('bg-gray-50')).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
it('applies admin background for variant="admin"', () => {
|
|
28
|
+
const { container } = render(AppShell, { variant: 'admin' });
|
|
29
|
+
const shell = container.querySelector('div');
|
|
30
|
+
expect(shell?.classList.contains('bg-gray-50')).toBe(true);
|
|
31
|
+
});
|
|
32
|
+
it('applies performer background for variant="performer"', () => {
|
|
33
|
+
const { container } = render(AppShell, { variant: 'performer' });
|
|
34
|
+
const shell = container.querySelector('div');
|
|
35
|
+
expect(shell?.classList.contains('bg-gray-50')).toBe(true);
|
|
36
|
+
});
|
|
37
|
+
it('applies public background for variant="public"', () => {
|
|
38
|
+
const { container } = render(AppShell, { variant: 'public' });
|
|
39
|
+
const shell = container.querySelector('div');
|
|
40
|
+
expect(shell?.classList.contains('bg-white')).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
it('applies minimal background for variant="minimal"', () => {
|
|
43
|
+
const { container } = render(AppShell, { variant: 'minimal' });
|
|
44
|
+
const shell = container.querySelector('div');
|
|
45
|
+
expect(shell?.classList.contains('bg-white')).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe('fixedHeader prop', () => {
|
|
49
|
+
it('applies pt-16 to main when fixedHeader=true', () => {
|
|
50
|
+
const { container } = render(AppShell, { fixedHeader: true });
|
|
51
|
+
const main = container.querySelector('main');
|
|
52
|
+
expect(main?.classList.contains('pt-16')).toBe(true);
|
|
53
|
+
});
|
|
54
|
+
it('does not apply pt-16 to main when fixedHeader=false', () => {
|
|
55
|
+
const { container } = render(AppShell, { fixedHeader: false });
|
|
56
|
+
const main = container.querySelector('main');
|
|
57
|
+
expect(main?.classList.contains('pt-16')).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
describe('sidebarCollapsed prop', () => {
|
|
61
|
+
// Note: sidebar tests require the sidebar snippet to be provided
|
|
62
|
+
// These tests verify the main content margin adjusts correctly
|
|
63
|
+
it('applies transition classes to main', () => {
|
|
64
|
+
const { container } = render(AppShell);
|
|
65
|
+
const main = container.querySelector('main');
|
|
66
|
+
expect(main?.classList.contains('transition-all')).toBe(true);
|
|
67
|
+
expect(main?.classList.contains('duration-300')).toBe(true);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
describe('class prop', () => {
|
|
71
|
+
it('applies custom classes to main element', () => {
|
|
72
|
+
const { container } = render(AppShell, { class: 'custom-main-class' });
|
|
73
|
+
const main = container.querySelector('main');
|
|
74
|
+
expect(main?.classList.contains('custom-main-class')).toBe(true);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
describe('structural elements', () => {
|
|
78
|
+
it('does not render header when no header snippet provided', () => {
|
|
79
|
+
const { container } = render(AppShell);
|
|
80
|
+
expect(container.querySelector('header')).toBeFalsy();
|
|
81
|
+
});
|
|
82
|
+
it('does not render aside when no sidebar snippet provided', () => {
|
|
83
|
+
const { container } = render(AppShell);
|
|
84
|
+
expect(container.querySelector('aside')).toBeFalsy();
|
|
85
|
+
});
|
|
86
|
+
it('does not render nav when showBottomNav=false', () => {
|
|
87
|
+
const { container } = render(AppShell, { showBottomNav: false });
|
|
88
|
+
expect(container.querySelector('nav')).toBeFalsy();
|
|
89
|
+
});
|
|
90
|
+
it('does not render nav when no bottomNav snippet provided', () => {
|
|
91
|
+
const { container } = render(AppShell, { showBottomNav: true });
|
|
92
|
+
expect(container.querySelector('nav')).toBeFalsy();
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentSection.test.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Layout/__tests__/ContentSection.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/svelte';
|
|
3
|
+
import ContentSection from '../ContentSection.svelte';
|
|
4
|
+
describe('ContentSection', () => {
|
|
5
|
+
describe('basic rendering', () => {
|
|
6
|
+
it('renders a section element', () => {
|
|
7
|
+
const { container } = render(ContentSection);
|
|
8
|
+
expect(container.querySelector('section')).toBeTruthy();
|
|
9
|
+
});
|
|
10
|
+
it('applies default spacing class', () => {
|
|
11
|
+
const { container } = render(ContentSection);
|
|
12
|
+
const section = container.querySelector('section');
|
|
13
|
+
expect(section?.classList.contains('mb-6')).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
describe('title prop', () => {
|
|
17
|
+
it('renders title when provided', () => {
|
|
18
|
+
const { container } = render(ContentSection, { title: 'Test Title' });
|
|
19
|
+
expect(container.textContent).toContain('Test Title');
|
|
20
|
+
});
|
|
21
|
+
it('renders title as h2 by default', () => {
|
|
22
|
+
const { container } = render(ContentSection, { title: 'Test Title' });
|
|
23
|
+
const h2 = container.querySelector('h2');
|
|
24
|
+
expect(h2).toBeTruthy();
|
|
25
|
+
expect(h2?.textContent).toBe('Test Title');
|
|
26
|
+
});
|
|
27
|
+
it('applies title size classes', () => {
|
|
28
|
+
const { container } = render(ContentSection, { title: 'Test', titleSize: 'lg' });
|
|
29
|
+
const heading = container.querySelector('h2');
|
|
30
|
+
expect(heading?.classList.contains('text-xl')).toBe(true);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
describe('subtitle prop', () => {
|
|
34
|
+
it('renders subtitle when provided', () => {
|
|
35
|
+
const { container } = render(ContentSection, { title: 'Title', subtitle: 'Subtitle text' });
|
|
36
|
+
expect(container.textContent).toContain('Subtitle text');
|
|
37
|
+
});
|
|
38
|
+
it('applies subtitle styling', () => {
|
|
39
|
+
const { container } = render(ContentSection, { title: 'Title', subtitle: 'Subtitle' });
|
|
40
|
+
const subtitle = container.querySelector('p');
|
|
41
|
+
expect(subtitle?.classList.contains('text-sm')).toBe(true);
|
|
42
|
+
expect(subtitle?.classList.contains('text-gray-500')).toBe(true);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
describe('headingLevel prop', () => {
|
|
46
|
+
it('renders h2 by default', () => {
|
|
47
|
+
const { container } = render(ContentSection, { title: 'Test' });
|
|
48
|
+
expect(container.querySelector('h2')).toBeTruthy();
|
|
49
|
+
});
|
|
50
|
+
it('renders h3 when headingLevel=3', () => {
|
|
51
|
+
const { container } = render(ContentSection, { title: 'Test', headingLevel: 3 });
|
|
52
|
+
expect(container.querySelector('h3')).toBeTruthy();
|
|
53
|
+
});
|
|
54
|
+
it('renders h4 when headingLevel=4', () => {
|
|
55
|
+
const { container } = render(ContentSection, { title: 'Test', headingLevel: 4 });
|
|
56
|
+
expect(container.querySelector('h4')).toBeTruthy();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
describe('titleSize prop', () => {
|
|
60
|
+
it('applies text-base for titleSize="sm"', () => {
|
|
61
|
+
const { container } = render(ContentSection, { title: 'Test', titleSize: 'sm' });
|
|
62
|
+
const heading = container.querySelector('h2');
|
|
63
|
+
expect(heading?.classList.contains('text-base')).toBe(true);
|
|
64
|
+
});
|
|
65
|
+
it('applies text-lg for titleSize="base"', () => {
|
|
66
|
+
const { container } = render(ContentSection, { title: 'Test', titleSize: 'base' });
|
|
67
|
+
const heading = container.querySelector('h2');
|
|
68
|
+
expect(heading?.classList.contains('text-lg')).toBe(true);
|
|
69
|
+
});
|
|
70
|
+
it('applies text-xl for titleSize="lg"', () => {
|
|
71
|
+
const { container } = render(ContentSection, { title: 'Test', titleSize: 'lg' });
|
|
72
|
+
const heading = container.querySelector('h2');
|
|
73
|
+
expect(heading?.classList.contains('text-xl')).toBe(true);
|
|
74
|
+
});
|
|
75
|
+
it('applies text-2xl for titleSize="xl"', () => {
|
|
76
|
+
const { container } = render(ContentSection, { title: 'Test', titleSize: 'xl' });
|
|
77
|
+
const heading = container.querySelector('h2');
|
|
78
|
+
expect(heading?.classList.contains('text-2xl')).toBe(true);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
describe('spacing prop', () => {
|
|
82
|
+
it('applies no margin for spacing="none"', () => {
|
|
83
|
+
const { container } = render(ContentSection, { spacing: 'none' });
|
|
84
|
+
const section = container.querySelector('section');
|
|
85
|
+
expect(section?.classList.contains('mb-4')).toBe(false);
|
|
86
|
+
expect(section?.classList.contains('mb-6')).toBe(false);
|
|
87
|
+
expect(section?.classList.contains('mb-8')).toBe(false);
|
|
88
|
+
});
|
|
89
|
+
it('applies mb-4 for spacing="sm"', () => {
|
|
90
|
+
const { container } = render(ContentSection, { spacing: 'sm' });
|
|
91
|
+
const section = container.querySelector('section');
|
|
92
|
+
expect(section?.classList.contains('mb-4')).toBe(true);
|
|
93
|
+
});
|
|
94
|
+
it('applies mb-6 for spacing="md"', () => {
|
|
95
|
+
const { container } = render(ContentSection, { spacing: 'md' });
|
|
96
|
+
const section = container.querySelector('section');
|
|
97
|
+
expect(section?.classList.contains('mb-6')).toBe(true);
|
|
98
|
+
});
|
|
99
|
+
it('applies mb-8 for spacing="lg"', () => {
|
|
100
|
+
const { container } = render(ContentSection, { spacing: 'lg' });
|
|
101
|
+
const section = container.querySelector('section');
|
|
102
|
+
expect(section?.classList.contains('mb-8')).toBe(true);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
describe('class prop', () => {
|
|
106
|
+
it('applies custom classes', () => {
|
|
107
|
+
const { container } = render(ContentSection, { class: 'custom-class' });
|
|
108
|
+
const section = container.querySelector('section');
|
|
109
|
+
expect(section?.classList.contains('custom-class')).toBe(true);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Heading.test.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Layout/__tests__/Heading.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/svelte';
|
|
3
|
+
import Heading from '../Heading.svelte';
|
|
4
|
+
describe('Heading', () => {
|
|
5
|
+
describe('basic rendering', () => {
|
|
6
|
+
it('renders as h2 element by default', () => {
|
|
7
|
+
const { container } = render(Heading);
|
|
8
|
+
expect(container.querySelector('h2')).toBeTruthy();
|
|
9
|
+
});
|
|
10
|
+
it('applies default variant classes', () => {
|
|
11
|
+
const { container } = render(Heading);
|
|
12
|
+
const h2 = container.querySelector('h2');
|
|
13
|
+
expect(h2?.classList.contains('text-gray-900')).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
it('applies default size class based on level', () => {
|
|
16
|
+
const { container } = render(Heading);
|
|
17
|
+
const h2 = container.querySelector('h2');
|
|
18
|
+
expect(h2?.classList.contains('text-2xl')).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
it('applies font-semibold by default', () => {
|
|
21
|
+
const { container } = render(Heading);
|
|
22
|
+
const h2 = container.querySelector('h2');
|
|
23
|
+
expect(h2?.classList.contains('font-semibold')).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
describe('level prop', () => {
|
|
27
|
+
it('renders h1 for level=1', () => {
|
|
28
|
+
const { container } = render(Heading, { level: 1 });
|
|
29
|
+
expect(container.querySelector('h1')).toBeTruthy();
|
|
30
|
+
expect(container.querySelector('h1')?.classList.contains('text-3xl')).toBe(true);
|
|
31
|
+
});
|
|
32
|
+
it('renders h2 for level=2', () => {
|
|
33
|
+
const { container } = render(Heading, { level: 2 });
|
|
34
|
+
expect(container.querySelector('h2')).toBeTruthy();
|
|
35
|
+
expect(container.querySelector('h2')?.classList.contains('text-2xl')).toBe(true);
|
|
36
|
+
});
|
|
37
|
+
it('renders h3 for level=3', () => {
|
|
38
|
+
const { container } = render(Heading, { level: 3 });
|
|
39
|
+
expect(container.querySelector('h3')).toBeTruthy();
|
|
40
|
+
expect(container.querySelector('h3')?.classList.contains('text-xl')).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
it('renders h4 for level=4', () => {
|
|
43
|
+
const { container } = render(Heading, { level: 4 });
|
|
44
|
+
expect(container.querySelector('h4')).toBeTruthy();
|
|
45
|
+
expect(container.querySelector('h4')?.classList.contains('text-lg')).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
it('renders h5 for level=5', () => {
|
|
48
|
+
const { container } = render(Heading, { level: 5 });
|
|
49
|
+
expect(container.querySelector('h5')).toBeTruthy();
|
|
50
|
+
expect(container.querySelector('h5')?.classList.contains('text-base')).toBe(true);
|
|
51
|
+
});
|
|
52
|
+
it('renders h6 for level=6', () => {
|
|
53
|
+
const { container } = render(Heading, { level: 6 });
|
|
54
|
+
expect(container.querySelector('h6')).toBeTruthy();
|
|
55
|
+
expect(container.querySelector('h6')?.classList.contains('text-sm')).toBe(true);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe('size prop override', () => {
|
|
59
|
+
it('overrides default size when size prop is provided', () => {
|
|
60
|
+
const { container } = render(Heading, { level: 1, size: 'lg' });
|
|
61
|
+
const h1 = container.querySelector('h1');
|
|
62
|
+
expect(h1?.classList.contains('text-lg')).toBe(true);
|
|
63
|
+
expect(h1?.classList.contains('text-3xl')).toBe(false);
|
|
64
|
+
});
|
|
65
|
+
it('applies text-xs for size="xs"', () => {
|
|
66
|
+
const { container } = render(Heading, { size: 'xs' });
|
|
67
|
+
const h2 = container.querySelector('h2');
|
|
68
|
+
expect(h2?.classList.contains('text-xs')).toBe(true);
|
|
69
|
+
});
|
|
70
|
+
it('applies text-4xl for size="4xl"', () => {
|
|
71
|
+
const { container } = render(Heading, { size: '4xl' });
|
|
72
|
+
const h2 = container.querySelector('h2');
|
|
73
|
+
expect(h2?.classList.contains('text-4xl')).toBe(true);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
describe('variant prop', () => {
|
|
77
|
+
it('applies default variant classes', () => {
|
|
78
|
+
const { container } = render(Heading, { variant: 'default' });
|
|
79
|
+
const h2 = container.querySelector('h2');
|
|
80
|
+
expect(h2?.classList.contains('text-gray-900')).toBe(true);
|
|
81
|
+
});
|
|
82
|
+
it('applies muted variant classes', () => {
|
|
83
|
+
const { container } = render(Heading, { variant: 'muted' });
|
|
84
|
+
const h2 = container.querySelector('h2');
|
|
85
|
+
expect(h2?.classList.contains('text-gray-600')).toBe(true);
|
|
86
|
+
});
|
|
87
|
+
it('applies primary variant classes', () => {
|
|
88
|
+
const { container } = render(Heading, { variant: 'primary' });
|
|
89
|
+
const h2 = container.querySelector('h2');
|
|
90
|
+
expect(h2?.classList.contains('text-primary')).toBe(true);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
describe('weight prop', () => {
|
|
94
|
+
it('applies font-medium for weight="medium"', () => {
|
|
95
|
+
const { container } = render(Heading, { weight: 'medium' });
|
|
96
|
+
const h2 = container.querySelector('h2');
|
|
97
|
+
expect(h2?.classList.contains('font-medium')).toBe(true);
|
|
98
|
+
});
|
|
99
|
+
it('applies font-semibold for weight="semibold"', () => {
|
|
100
|
+
const { container } = render(Heading, { weight: 'semibold' });
|
|
101
|
+
const h2 = container.querySelector('h2');
|
|
102
|
+
expect(h2?.classList.contains('font-semibold')).toBe(true);
|
|
103
|
+
});
|
|
104
|
+
it('applies font-bold for weight="bold"', () => {
|
|
105
|
+
const { container } = render(Heading, { weight: 'bold' });
|
|
106
|
+
const h2 = container.querySelector('h2');
|
|
107
|
+
expect(h2?.classList.contains('font-bold')).toBe(true);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
describe('class prop', () => {
|
|
111
|
+
it('applies custom classes', () => {
|
|
112
|
+
const { container } = render(Heading, { class: 'custom-class' });
|
|
113
|
+
const h2 = container.querySelector('h2');
|
|
114
|
+
expect(h2?.classList.contains('custom-class')).toBe(true);
|
|
115
|
+
});
|
|
116
|
+
it('preserves default classes when adding custom classes', () => {
|
|
117
|
+
const { container } = render(Heading, { class: 'custom-class' });
|
|
118
|
+
const h2 = container.querySelector('h2');
|
|
119
|
+
expect(h2?.classList.contains('text-2xl')).toBe(true);
|
|
120
|
+
expect(h2?.classList.contains('custom-class')).toBe(true);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageContainer.test.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Layout/__tests__/PageContainer.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/svelte';
|
|
3
|
+
import PageContainer from '../PageContainer.svelte';
|
|
4
|
+
describe('PageContainer', () => {
|
|
5
|
+
describe('basic rendering', () => {
|
|
6
|
+
it('renders a div element', () => {
|
|
7
|
+
const { container } = render(PageContainer);
|
|
8
|
+
expect(container.querySelector('div')).toBeTruthy();
|
|
9
|
+
});
|
|
10
|
+
it('applies default max-w-full class', () => {
|
|
11
|
+
const { container } = render(PageContainer);
|
|
12
|
+
const div = container.querySelector('div');
|
|
13
|
+
expect(div?.classList.contains('max-w-full')).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
it('applies mx-auto for centering by default', () => {
|
|
16
|
+
const { container } = render(PageContainer);
|
|
17
|
+
const div = container.querySelector('div');
|
|
18
|
+
expect(div?.classList.contains('mx-auto')).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe('maxWidth prop', () => {
|
|
22
|
+
it('applies max-w-sm for maxWidth="sm"', () => {
|
|
23
|
+
const { container } = render(PageContainer, { maxWidth: 'sm' });
|
|
24
|
+
const div = container.querySelector('div');
|
|
25
|
+
expect(div?.classList.contains('max-w-sm')).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
it('applies max-w-md for maxWidth="md"', () => {
|
|
28
|
+
const { container } = render(PageContainer, { maxWidth: 'md' });
|
|
29
|
+
const div = container.querySelector('div');
|
|
30
|
+
expect(div?.classList.contains('max-w-md')).toBe(true);
|
|
31
|
+
});
|
|
32
|
+
it('applies max-w-lg for maxWidth="lg"', () => {
|
|
33
|
+
const { container } = render(PageContainer, { maxWidth: 'lg' });
|
|
34
|
+
const div = container.querySelector('div');
|
|
35
|
+
expect(div?.classList.contains('max-w-lg')).toBe(true);
|
|
36
|
+
});
|
|
37
|
+
it('applies max-w-xl for maxWidth="xl"', () => {
|
|
38
|
+
const { container } = render(PageContainer, { maxWidth: 'xl' });
|
|
39
|
+
const div = container.querySelector('div');
|
|
40
|
+
expect(div?.classList.contains('max-w-xl')).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
it('applies max-w-2xl for maxWidth="2xl"', () => {
|
|
43
|
+
const { container } = render(PageContainer, { maxWidth: '2xl' });
|
|
44
|
+
const div = container.querySelector('div');
|
|
45
|
+
expect(div?.classList.contains('max-w-2xl')).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
it('applies max-w-4xl for maxWidth="4xl"', () => {
|
|
48
|
+
const { container } = render(PageContainer, { maxWidth: '4xl' });
|
|
49
|
+
const div = container.querySelector('div');
|
|
50
|
+
expect(div?.classList.contains('max-w-4xl')).toBe(true);
|
|
51
|
+
});
|
|
52
|
+
it('applies max-w-6xl for maxWidth="6xl"', () => {
|
|
53
|
+
const { container } = render(PageContainer, { maxWidth: '6xl' });
|
|
54
|
+
const div = container.querySelector('div');
|
|
55
|
+
expect(div?.classList.contains('max-w-6xl')).toBe(true);
|
|
56
|
+
});
|
|
57
|
+
it('applies max-w-full for maxWidth="full"', () => {
|
|
58
|
+
const { container } = render(PageContainer, { maxWidth: 'full' });
|
|
59
|
+
const div = container.querySelector('div');
|
|
60
|
+
expect(div?.classList.contains('max-w-full')).toBe(true);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
describe('padding prop', () => {
|
|
64
|
+
it('applies no padding for padding="none"', () => {
|
|
65
|
+
const { container } = render(PageContainer, { padding: 'none' });
|
|
66
|
+
const div = container.querySelector('div');
|
|
67
|
+
expect(div?.classList.contains('px-4')).toBe(false);
|
|
68
|
+
expect(div?.classList.contains('py-6')).toBe(false);
|
|
69
|
+
});
|
|
70
|
+
it('applies tight padding for padding="tight"', () => {
|
|
71
|
+
const { container } = render(PageContainer, { padding: 'tight' });
|
|
72
|
+
const div = container.querySelector('div');
|
|
73
|
+
expect(div?.classList.contains('px-2')).toBe(true);
|
|
74
|
+
expect(div?.classList.contains('py-2')).toBe(true);
|
|
75
|
+
});
|
|
76
|
+
it('applies default padding for padding="default"', () => {
|
|
77
|
+
const { container } = render(PageContainer, { padding: 'default' });
|
|
78
|
+
const div = container.querySelector('div');
|
|
79
|
+
expect(div?.classList.contains('px-4')).toBe(true);
|
|
80
|
+
expect(div?.classList.contains('py-6')).toBe(true);
|
|
81
|
+
});
|
|
82
|
+
it('applies spacious padding for padding="spacious"', () => {
|
|
83
|
+
const { container } = render(PageContainer, { padding: 'spacious' });
|
|
84
|
+
const div = container.querySelector('div');
|
|
85
|
+
expect(div?.classList.contains('px-4')).toBe(true);
|
|
86
|
+
expect(div?.classList.contains('py-8')).toBe(true);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
describe('center prop', () => {
|
|
90
|
+
it('applies mx-auto when center=true', () => {
|
|
91
|
+
const { container } = render(PageContainer, { center: true });
|
|
92
|
+
const div = container.querySelector('div');
|
|
93
|
+
expect(div?.classList.contains('mx-auto')).toBe(true);
|
|
94
|
+
});
|
|
95
|
+
it('does not apply mx-auto when center=false', () => {
|
|
96
|
+
const { container } = render(PageContainer, { center: false });
|
|
97
|
+
const div = container.querySelector('div');
|
|
98
|
+
expect(div?.classList.contains('mx-auto')).toBe(false);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
describe('background prop', () => {
|
|
102
|
+
it('applies no background for background="none"', () => {
|
|
103
|
+
const { container } = render(PageContainer, { background: 'none' });
|
|
104
|
+
const div = container.querySelector('div');
|
|
105
|
+
expect(div?.classList.contains('bg-white')).toBe(false);
|
|
106
|
+
expect(div?.classList.contains('bg-gray-50')).toBe(false);
|
|
107
|
+
});
|
|
108
|
+
it('applies white background for background="white"', () => {
|
|
109
|
+
const { container } = render(PageContainer, { background: 'white' });
|
|
110
|
+
const div = container.querySelector('div');
|
|
111
|
+
expect(div?.classList.contains('bg-white')).toBe(true);
|
|
112
|
+
});
|
|
113
|
+
it('applies gray background for background="gray"', () => {
|
|
114
|
+
const { container } = render(PageContainer, { background: 'gray' });
|
|
115
|
+
const div = container.querySelector('div');
|
|
116
|
+
expect(div?.classList.contains('bg-gray-50')).toBe(true);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
describe('class prop', () => {
|
|
120
|
+
it('applies custom classes', () => {
|
|
121
|
+
const { container } = render(PageContainer, { class: 'custom-class' });
|
|
122
|
+
const div = container.querySelector('div');
|
|
123
|
+
expect(div?.classList.contains('custom-class')).toBe(true);
|
|
124
|
+
});
|
|
125
|
+
it('preserves default classes when adding custom classes', () => {
|
|
126
|
+
const { container } = render(PageContainer, { class: 'custom-class' });
|
|
127
|
+
const div = container.querySelector('div');
|
|
128
|
+
expect(div?.classList.contains('max-w-full')).toBe(true);
|
|
129
|
+
expect(div?.classList.contains('mx-auto')).toBe(true);
|
|
130
|
+
expect(div?.classList.contains('custom-class')).toBe(true);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Responsive.test.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Layout/__tests__/Responsive.test.ts"],"names":[],"mappings":""}
|