@getmicdrop/svelte-components 5.5.4 → 5.5.5
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/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/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/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/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/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/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/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/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/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/Stack.spec.js +3 -3
- package/dist/constants/formOptions.spec.js +9 -5
- 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 +124 -2
- package/dist/datetime/parse.js +1 -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/forms/createFormStore.svelte.js +0 -1
- package/dist/index.d.ts +4 -112
- package/dist/index.js +4 -190
- 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/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/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/forms/FormActions.spec.js +10 -3
- 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/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/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/navigation/BottomNav.svelte +4 -4
- package/dist/patterns/navigation/Header.spec.js +33 -24
- 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/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/PageLoader.spec.js +5 -2
- 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/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.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/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/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/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 +5 -2
- 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/Badges/Badge.spec.js +109 -68
- package/dist/primitives/BottomSheet/BottomSheet.spec.js +36 -27
- 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 +15 -13
- package/dist/primitives/Breadcrumb/Breadcrumb.svelte +5 -5
- package/dist/primitives/Button/Button.spec.js +83 -71
- package/dist/primitives/Button/ButtonSaveDemo.spec.js +100 -2
- 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/Card.spec.js +1 -1
- 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/DarkModeToggle.spec.js +84 -51
- 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/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/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/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 +14 -14
- package/dist/primitives/Input/Input.svelte +1 -14
- package/dist/primitives/Input/Input.svelte.d.ts.map +1 -1
- package/dist/primitives/Input/Select.spec.js +11 -17
- 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/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/Modal/Modal.spec.js +29 -25
- 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/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/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/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/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/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/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/Spinner/Spinner.spec.js +25 -29
- 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/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/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 +93 -77
- 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/ValidationError.spec.js +1 -1
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.js +3 -0
- package/dist/recipes/CropImage/CropImage.spec.js +1 -9
- 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/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/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/ErrorDisplay.spec.js +6 -6
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.spec.js +21 -17
- 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/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/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/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/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/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/inputs/MultiSelect.spec.js +4 -3
- package/dist/recipes/inputs/MultiSelect.svelte +10 -3
- 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 +52 -39
- 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/PasswordStrengthIndicator/PasswordStrengthIndicator.spec.js +253 -173
- 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/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/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/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/ConfirmationModal.spec.js +36 -21
- 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/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/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/services/ShowService.spec.js +18 -15
- 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/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/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/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/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/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +6 -5
- package/dist/telemetry.spec.js +495 -12
- 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.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/utils/apiConfig.spec.js +102 -1
- 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.spec.d.ts +2 -0
- package/dist/utils/transitions.spec.d.ts.map +1 -0
- package/dist/utils/transitions.spec.js +130 -0
- package/package.json +8 -3
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { backgroundColors, textColors, brandColors, accentColors, strokeColors, uiColors, sidebarColors, lightColors, darkColors, colors, legacyAliases } from '../colors';
|
|
3
|
+
describe('Background Colors', () => {
|
|
4
|
+
it('has light theme background colors', () => {
|
|
5
|
+
expect(backgroundColors.light['bg-primary']).toBe('0 0% 100%');
|
|
6
|
+
expect(backgroundColors.light['bg-secondary']).toBe('220 7% 97%');
|
|
7
|
+
expect(backgroundColors.light['bg-tertiary']).toBe('220 7% 94%');
|
|
8
|
+
expect(backgroundColors.light['bg-quaternary']).toBe('220 6% 91%');
|
|
9
|
+
});
|
|
10
|
+
it('has dark theme background colors', () => {
|
|
11
|
+
expect(backgroundColors.dark['bg-primary']).toBe('220 20% 18%');
|
|
12
|
+
expect(backgroundColors.dark['bg-secondary']).toBe('221 50% 10%');
|
|
13
|
+
expect(backgroundColors.dark['bg-tertiary']).toBe('221 50% 6%');
|
|
14
|
+
expect(backgroundColors.dark['bg-quaternary']).toBe('0 0% 0%');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
describe('Text Colors', () => {
|
|
18
|
+
it('has light theme text colors', () => {
|
|
19
|
+
expect(textColors.light['text-primary']).toBe('221 50% 10%');
|
|
20
|
+
expect(textColors.light['text-secondary']).toBe('220 20% 18%');
|
|
21
|
+
expect(textColors.light['text-tertiary']).toBe('221 9% 44%');
|
|
22
|
+
expect(textColors.light['text-head']).toBe('221 9% 44%');
|
|
23
|
+
});
|
|
24
|
+
it('has dark theme text colors', () => {
|
|
25
|
+
expect(textColors.dark['text-primary']).toBe('220 7% 97%');
|
|
26
|
+
expect(textColors.dark['text-secondary']).toBe('220 7% 94%');
|
|
27
|
+
expect(textColors.dark['text-tertiary']).toBe('220 6% 91%');
|
|
28
|
+
expect(textColors.dark['text-head']).toBe('220 9% 70%');
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
describe('Brand Colors', () => {
|
|
32
|
+
it('has light theme brand color', () => {
|
|
33
|
+
expect(brandColors.light['brand-primary']).toBe('209 99% 50%');
|
|
34
|
+
});
|
|
35
|
+
it('has dark theme brand color', () => {
|
|
36
|
+
expect(brandColors.dark['brand-primary']).toBe('220 89% 63%');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
describe('Accent Colors', () => {
|
|
40
|
+
it('has light theme accent colors', () => {
|
|
41
|
+
expect(accentColors.light['accent-warning']).toBe('28 100% 59%');
|
|
42
|
+
expect(accentColors.light['accent-danger']).toBe('0 100% 70%');
|
|
43
|
+
expect(accentColors.light['accent-success']).toBe('131 77% 35%');
|
|
44
|
+
});
|
|
45
|
+
it('has dark theme accent colors', () => {
|
|
46
|
+
expect(accentColors.dark['accent-warning']).toBe('30 100% 70%');
|
|
47
|
+
expect(accentColors.dark['accent-danger']).toBe('0 100% 70%');
|
|
48
|
+
expect(accentColors.dark['accent-success']).toBe('142 71% 45%');
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
describe('Stroke Colors', () => {
|
|
52
|
+
it('has light theme stroke colors', () => {
|
|
53
|
+
expect(strokeColors.light['stroke-primary']).toBe('216 6% 84%');
|
|
54
|
+
expect(strokeColors.light['stroke-secondary']).toBe('216 6% 84%');
|
|
55
|
+
expect(strokeColors.light['border']).toBe('220 13% 91%');
|
|
56
|
+
});
|
|
57
|
+
it('has dark theme stroke colors', () => {
|
|
58
|
+
expect(strokeColors.dark['stroke-primary']).toBe('220 20% 28%');
|
|
59
|
+
expect(strokeColors.dark['stroke-secondary']).toBe('220 20% 28%');
|
|
60
|
+
expect(strokeColors.dark['border']).toBe('215 27.9% 16.9%');
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
describe('UI Colors', () => {
|
|
64
|
+
it('has light theme UI colors', () => {
|
|
65
|
+
expect(uiColors.light['card']).toBeDefined();
|
|
66
|
+
expect(uiColors.light['popover']).toBeDefined();
|
|
67
|
+
expect(uiColors.light['muted']).toBeDefined();
|
|
68
|
+
expect(uiColors.light['hover-primary']).toBeDefined();
|
|
69
|
+
});
|
|
70
|
+
it('has dark theme UI colors', () => {
|
|
71
|
+
expect(uiColors.dark['card']).toBeDefined();
|
|
72
|
+
expect(uiColors.dark['popover']).toBeDefined();
|
|
73
|
+
expect(uiColors.dark['muted']).toBeDefined();
|
|
74
|
+
expect(uiColors.dark['hover-primary']).toBeDefined();
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
describe('Sidebar Colors', () => {
|
|
78
|
+
it('has light theme sidebar colors', () => {
|
|
79
|
+
expect(sidebarColors.light['sidebar-background']).toBeDefined();
|
|
80
|
+
expect(sidebarColors.light['sidebar-foreground']).toBeDefined();
|
|
81
|
+
expect(sidebarColors.light['sidebar-border']).toBeDefined();
|
|
82
|
+
expect(sidebarColors.light['sidebar-primary']).toBeDefined();
|
|
83
|
+
expect(sidebarColors.light['sidebar-primary-foreground']).toBeDefined();
|
|
84
|
+
});
|
|
85
|
+
it('has dark theme sidebar colors', () => {
|
|
86
|
+
expect(sidebarColors.dark['sidebar-background']).toBeDefined();
|
|
87
|
+
expect(sidebarColors.dark['sidebar-foreground']).toBeDefined();
|
|
88
|
+
expect(sidebarColors.dark['sidebar-border']).toBeDefined();
|
|
89
|
+
expect(sidebarColors.dark['sidebar-primary']).toBeDefined();
|
|
90
|
+
expect(sidebarColors.dark['sidebar-primary-foreground']).toBeDefined();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
describe('Combined Color Objects', () => {
|
|
94
|
+
it('lightColors contains all color categories', () => {
|
|
95
|
+
// Background
|
|
96
|
+
expect(lightColors['bg-primary']).toBeDefined();
|
|
97
|
+
// Text
|
|
98
|
+
expect(lightColors['text-primary']).toBeDefined();
|
|
99
|
+
// Brand
|
|
100
|
+
expect(lightColors['brand-primary']).toBeDefined();
|
|
101
|
+
// Accent
|
|
102
|
+
expect(lightColors['accent-warning']).toBeDefined();
|
|
103
|
+
// Stroke
|
|
104
|
+
expect(lightColors['stroke-primary']).toBeDefined();
|
|
105
|
+
// UI
|
|
106
|
+
expect(lightColors['card']).toBeDefined();
|
|
107
|
+
// Sidebar
|
|
108
|
+
expect(lightColors['sidebar-background']).toBeDefined();
|
|
109
|
+
});
|
|
110
|
+
it('darkColors contains all color categories', () => {
|
|
111
|
+
expect(darkColors['bg-primary']).toBeDefined();
|
|
112
|
+
expect(darkColors['text-primary']).toBeDefined();
|
|
113
|
+
expect(darkColors['brand-primary']).toBeDefined();
|
|
114
|
+
expect(darkColors['accent-warning']).toBeDefined();
|
|
115
|
+
expect(darkColors['stroke-primary']).toBeDefined();
|
|
116
|
+
expect(darkColors['card']).toBeDefined();
|
|
117
|
+
expect(darkColors['sidebar-background']).toBeDefined();
|
|
118
|
+
});
|
|
119
|
+
it('colors object has light and dark themes', () => {
|
|
120
|
+
expect(colors.light).toEqual(lightColors);
|
|
121
|
+
expect(colors.dark).toEqual(darkColors);
|
|
122
|
+
});
|
|
123
|
+
it('colors object has legacy aliases', () => {
|
|
124
|
+
expect(colors.aliases).toEqual(legacyAliases);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
describe('Legacy Aliases', () => {
|
|
128
|
+
it('maps PascalCase to kebab-case', () => {
|
|
129
|
+
expect(legacyAliases['BG-Primary']).toBe('bg-primary');
|
|
130
|
+
expect(legacyAliases['BG-Secondary']).toBe('bg-secondary');
|
|
131
|
+
expect(legacyAliases['Text-Primary']).toBe('text-primary');
|
|
132
|
+
expect(legacyAliases['Brand-Primary']).toBe('brand-primary');
|
|
133
|
+
expect(legacyAliases['Accent-Warning']).toBe('accent-warning');
|
|
134
|
+
expect(legacyAliases['Accent-Danger']).toBe('accent-danger');
|
|
135
|
+
expect(legacyAliases['Accent-Success']).toBe('accent-success');
|
|
136
|
+
expect(legacyAliases['Stroke-Primary']).toBe('stroke-primary');
|
|
137
|
+
});
|
|
138
|
+
it('has typo-preserved legacy alias for tertiary', () => {
|
|
139
|
+
// Note: Original has typo "Tartiary"
|
|
140
|
+
expect(legacyAliases['Text-Tartiary']).toBe('text-tertiary');
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
describe('Color Value Format', () => {
|
|
144
|
+
it('uses HSL channel format (H S% L%)', () => {
|
|
145
|
+
// All values should be in "H S% L%" format for Tailwind compatibility
|
|
146
|
+
const hslPattern = /^\d+(\.\d+)?\s+\d+(\.\d+)?%\s+\d+(\.\d+)?%$/;
|
|
147
|
+
expect(lightColors['bg-primary']).toMatch(hslPattern);
|
|
148
|
+
expect(lightColors['text-primary']).toMatch(hslPattern);
|
|
149
|
+
expect(darkColors['bg-primary']).toMatch(hslPattern);
|
|
150
|
+
expect(darkColors['text-primary']).toMatch(hslPattern);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radius.test.d.ts","sourceRoot":"","sources":["../../../src/lib/tokens/__tests__/radius.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { borderRadius, radiusAliases } from '../radius';
|
|
3
|
+
describe('Border Radius Tokens', () => {
|
|
4
|
+
it('has none radius', () => {
|
|
5
|
+
expect(borderRadius.none).toBe('0px');
|
|
6
|
+
});
|
|
7
|
+
it('has sm radius', () => {
|
|
8
|
+
expect(borderRadius.sm).toBe('0.125rem');
|
|
9
|
+
});
|
|
10
|
+
it('has default radius', () => {
|
|
11
|
+
expect(borderRadius.DEFAULT).toBe('0.25rem');
|
|
12
|
+
});
|
|
13
|
+
it('has md radius', () => {
|
|
14
|
+
expect(borderRadius.md).toBe('0.375rem');
|
|
15
|
+
});
|
|
16
|
+
it('has lg radius', () => {
|
|
17
|
+
expect(borderRadius.lg).toBe('0.5rem');
|
|
18
|
+
});
|
|
19
|
+
it('has xl radius', () => {
|
|
20
|
+
expect(borderRadius.xl).toBe('0.75rem');
|
|
21
|
+
});
|
|
22
|
+
it('has 2xl radius', () => {
|
|
23
|
+
expect(borderRadius['2xl']).toBe('1rem');
|
|
24
|
+
});
|
|
25
|
+
it('has 3xl radius', () => {
|
|
26
|
+
expect(borderRadius['3xl']).toBe('1.5rem');
|
|
27
|
+
});
|
|
28
|
+
it('has full radius for circles', () => {
|
|
29
|
+
expect(borderRadius.full).toBe('9999px');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
describe('Radius Scale Order', () => {
|
|
33
|
+
it('radii increase in size', () => {
|
|
34
|
+
const sizes = [
|
|
35
|
+
borderRadius.none,
|
|
36
|
+
borderRadius.sm,
|
|
37
|
+
borderRadius.DEFAULT,
|
|
38
|
+
borderRadius.md,
|
|
39
|
+
borderRadius.lg,
|
|
40
|
+
borderRadius.xl,
|
|
41
|
+
borderRadius['2xl'],
|
|
42
|
+
borderRadius['3xl'],
|
|
43
|
+
];
|
|
44
|
+
// Parse rem values and check they increase
|
|
45
|
+
for (let i = 0; i < sizes.length - 1; i++) {
|
|
46
|
+
const current = parseFloat(sizes[i]);
|
|
47
|
+
const next = parseFloat(sizes[i + 1]);
|
|
48
|
+
expect(next).toBeGreaterThan(current);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
describe('Radius Aliases', () => {
|
|
53
|
+
it('button uses lg radius', () => {
|
|
54
|
+
expect(radiusAliases.button).toBe(borderRadius.lg);
|
|
55
|
+
expect(radiusAliases.button).toBe('0.5rem');
|
|
56
|
+
});
|
|
57
|
+
it('input uses lg radius', () => {
|
|
58
|
+
expect(radiusAliases.input).toBe(borderRadius.lg);
|
|
59
|
+
expect(radiusAliases.input).toBe('0.5rem');
|
|
60
|
+
});
|
|
61
|
+
it('card uses xl radius', () => {
|
|
62
|
+
expect(radiusAliases.card).toBe(borderRadius.xl);
|
|
63
|
+
expect(radiusAliases.card).toBe('0.75rem');
|
|
64
|
+
});
|
|
65
|
+
it('modal uses 2xl radius', () => {
|
|
66
|
+
expect(radiusAliases.modal).toBe(borderRadius['2xl']);
|
|
67
|
+
expect(radiusAliases.modal).toBe('1rem');
|
|
68
|
+
});
|
|
69
|
+
it('badge uses full radius', () => {
|
|
70
|
+
expect(radiusAliases.badge).toBe(borderRadius.full);
|
|
71
|
+
expect(radiusAliases.badge).toBe('9999px');
|
|
72
|
+
});
|
|
73
|
+
it('avatar uses full radius', () => {
|
|
74
|
+
expect(radiusAliases.avatar).toBe(borderRadius.full);
|
|
75
|
+
expect(radiusAliases.avatar).toBe('9999px');
|
|
76
|
+
});
|
|
77
|
+
it('dropdown uses lg radius', () => {
|
|
78
|
+
expect(radiusAliases.dropdown).toBe(borderRadius.lg);
|
|
79
|
+
});
|
|
80
|
+
it('tooltip uses md radius', () => {
|
|
81
|
+
expect(radiusAliases.tooltip).toBe(borderRadius.md);
|
|
82
|
+
expect(radiusAliases.tooltip).toBe('0.375rem');
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
describe('Radius Value Formats', () => {
|
|
86
|
+
it('all rem values are valid', () => {
|
|
87
|
+
const remPattern = /^\d+(\.\d+)?rem$/;
|
|
88
|
+
const pxPattern = /^\d+px$/;
|
|
89
|
+
Object.entries(borderRadius).forEach(([key, value]) => {
|
|
90
|
+
expect(value.match(remPattern) || value.match(pxPattern)).toBeTruthy();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
it('none is 0px', () => {
|
|
94
|
+
expect(borderRadius.none).toMatch(/^0px$/);
|
|
95
|
+
});
|
|
96
|
+
it('full uses high px value for pill shape', () => {
|
|
97
|
+
expect(parseInt(borderRadius.full)).toBeGreaterThan(1000);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
describe('Alias Semantic Meaning', () => {
|
|
101
|
+
it('interactive elements share same radius', () => {
|
|
102
|
+
expect(radiusAliases.button).toBe(radiusAliases.input);
|
|
103
|
+
expect(radiusAliases.button).toBe(radiusAliases.dropdown);
|
|
104
|
+
});
|
|
105
|
+
it('circular elements share same radius', () => {
|
|
106
|
+
expect(radiusAliases.badge).toBe(radiusAliases.avatar);
|
|
107
|
+
});
|
|
108
|
+
it('card has larger radius than buttons', () => {
|
|
109
|
+
const cardRadius = parseFloat(radiusAliases.card);
|
|
110
|
+
const buttonRadius = parseFloat(radiusAliases.button);
|
|
111
|
+
expect(cardRadius).toBeGreaterThan(buttonRadius);
|
|
112
|
+
});
|
|
113
|
+
it('modal has largest container radius', () => {
|
|
114
|
+
const modalRadius = parseFloat(radiusAliases.modal);
|
|
115
|
+
const cardRadius = parseFloat(radiusAliases.card);
|
|
116
|
+
expect(modalRadius).toBeGreaterThan(cardRadius);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadows.test.d.ts","sourceRoot":"","sources":["../../../src/lib/tokens/__tests__/shadows.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { boxShadow, customShadows, shadows } from '../shadows';
|
|
3
|
+
describe('Box Shadow Tokens', () => {
|
|
4
|
+
it('has sm shadow', () => {
|
|
5
|
+
expect(boxShadow.sm).toContain('0 1px 2px');
|
|
6
|
+
expect(boxShadow.sm).toContain('rgb(0 0 0');
|
|
7
|
+
});
|
|
8
|
+
it('has DEFAULT shadow', () => {
|
|
9
|
+
expect(boxShadow.DEFAULT).toContain('0 1px 3px');
|
|
10
|
+
});
|
|
11
|
+
it('has md shadow', () => {
|
|
12
|
+
expect(boxShadow.md).toContain('0 4px 6px');
|
|
13
|
+
});
|
|
14
|
+
it('has lg shadow', () => {
|
|
15
|
+
expect(boxShadow.lg).toContain('0 10px 15px');
|
|
16
|
+
});
|
|
17
|
+
it('has xl shadow', () => {
|
|
18
|
+
expect(boxShadow.xl).toContain('0 20px 25px');
|
|
19
|
+
});
|
|
20
|
+
it('has 2xl shadow', () => {
|
|
21
|
+
expect(boxShadow['2xl']).toContain('0 25px 50px');
|
|
22
|
+
});
|
|
23
|
+
it('has inner shadow (inset)', () => {
|
|
24
|
+
expect(boxShadow.inner).toContain('inset');
|
|
25
|
+
expect(boxShadow.inner).toContain('0 2px 4px');
|
|
26
|
+
});
|
|
27
|
+
it('has none shadow', () => {
|
|
28
|
+
expect(boxShadow.none).toBe('none');
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
describe('Shadow Scale Progression', () => {
|
|
32
|
+
it('shadows increase in blur radius', () => {
|
|
33
|
+
// Extract first blur value from each shadow
|
|
34
|
+
const getFirstBlurRadius = (shadow) => {
|
|
35
|
+
const match = shadow.match(/(\d+)px/);
|
|
36
|
+
return match ? parseInt(match[1]) : 0;
|
|
37
|
+
};
|
|
38
|
+
const smBlur = getFirstBlurRadius(boxShadow.sm);
|
|
39
|
+
const defaultBlur = getFirstBlurRadius(boxShadow.DEFAULT);
|
|
40
|
+
const mdBlur = getFirstBlurRadius(boxShadow.md);
|
|
41
|
+
const lgBlur = getFirstBlurRadius(boxShadow.lg);
|
|
42
|
+
const xlBlur = getFirstBlurRadius(boxShadow.xl);
|
|
43
|
+
expect(defaultBlur).toBeGreaterThanOrEqual(smBlur);
|
|
44
|
+
expect(mdBlur).toBeGreaterThanOrEqual(defaultBlur);
|
|
45
|
+
expect(lgBlur).toBeGreaterThan(mdBlur);
|
|
46
|
+
expect(xlBlur).toBeGreaterThan(lgBlur);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
describe('Custom Shadows', () => {
|
|
50
|
+
it('has modal shadow', () => {
|
|
51
|
+
expect(customShadows.modal).toContain('0 0 31px');
|
|
52
|
+
});
|
|
53
|
+
it('has dropdown shadow', () => {
|
|
54
|
+
expect(customShadows.dropdown).toBeDefined();
|
|
55
|
+
expect(customShadows.dropdown).toContain('0 4px 6px');
|
|
56
|
+
});
|
|
57
|
+
it('has cardHover shadow', () => {
|
|
58
|
+
expect(customShadows.cardHover).toBeDefined();
|
|
59
|
+
expect(customShadows.cardHover).toContain('0 10px 15px');
|
|
60
|
+
});
|
|
61
|
+
it('has buttonHover shadow', () => {
|
|
62
|
+
expect(customShadows.buttonHover).toBeDefined();
|
|
63
|
+
});
|
|
64
|
+
it('has toast shadow', () => {
|
|
65
|
+
expect(customShadows.toast).toBeDefined();
|
|
66
|
+
});
|
|
67
|
+
it('has tooltip shadow', () => {
|
|
68
|
+
expect(customShadows.tooltip).toBeDefined();
|
|
69
|
+
});
|
|
70
|
+
it('has focusRing shadow with blue color', () => {
|
|
71
|
+
expect(customShadows.focusRing).toContain('0 0 0 3px');
|
|
72
|
+
expect(customShadows.focusRing).toContain('rgb(59 130 246');
|
|
73
|
+
});
|
|
74
|
+
it('has focusRingDanger shadow with red color', () => {
|
|
75
|
+
expect(customShadows.focusRingDanger).toContain('0 0 0 3px');
|
|
76
|
+
expect(customShadows.focusRingDanger).toContain('rgb(239 68 68');
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
describe('Combined Shadows Object', () => {
|
|
80
|
+
it('contains all boxShadow tokens', () => {
|
|
81
|
+
expect(shadows.sm).toBe(boxShadow.sm);
|
|
82
|
+
expect(shadows.DEFAULT).toBe(boxShadow.DEFAULT);
|
|
83
|
+
expect(shadows.md).toBe(boxShadow.md);
|
|
84
|
+
expect(shadows.lg).toBe(boxShadow.lg);
|
|
85
|
+
expect(shadows.none).toBe(boxShadow.none);
|
|
86
|
+
});
|
|
87
|
+
it('contains all customShadow tokens', () => {
|
|
88
|
+
expect(shadows.modal).toBe(customShadows.modal);
|
|
89
|
+
expect(shadows.dropdown).toBe(customShadows.dropdown);
|
|
90
|
+
expect(shadows.focusRing).toBe(customShadows.focusRing);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
describe('Shadow Value Format', () => {
|
|
94
|
+
it('all shadows use rgb() color format', () => {
|
|
95
|
+
const allShadows = Object.values(boxShadow).filter(v => v !== 'none');
|
|
96
|
+
allShadows.forEach(shadow => {
|
|
97
|
+
expect(shadow).toContain('rgb(');
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
it('custom shadows use rgb() color format', () => {
|
|
101
|
+
Object.values(customShadows).forEach(shadow => {
|
|
102
|
+
expect(shadow).toContain('rgb(');
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
});
|
|
@@ -50,17 +50,20 @@ describe('spacing tokens', () => {
|
|
|
50
50
|
describe('gapScale', () => {
|
|
51
51
|
describe('semantic', () => {
|
|
52
52
|
it('provides semantic gap names with Tailwind classes', () => {
|
|
53
|
-
expect(gapScale.semantic.
|
|
53
|
+
expect(gapScale.semantic.minimal).toBe('gap-1');
|
|
54
54
|
expect(gapScale.semantic.compact).toBe('gap-1.5');
|
|
55
55
|
expect(gapScale.semantic.item).toBe('gap-2');
|
|
56
56
|
expect(gapScale.semantic.group).toBe('gap-3');
|
|
57
|
+
expect(gapScale.semantic.tight).toBe('gap-4');
|
|
57
58
|
expect(gapScale.semantic.content).toBe('gap-4');
|
|
59
|
+
expect(gapScale.semantic.standard).toBe('gap-6');
|
|
58
60
|
expect(gapScale.semantic.section).toBe('gap-6');
|
|
61
|
+
expect(gapScale.semantic.spacious).toBe('gap-8');
|
|
59
62
|
expect(gapScale.semantic.layout).toBe('gap-8');
|
|
60
63
|
expect(gapScale.semantic.page).toBe('gap-12');
|
|
61
64
|
});
|
|
62
|
-
it('has
|
|
63
|
-
expect(Object.keys(gapScale.semantic)).toHaveLength(
|
|
65
|
+
it('has 11 semantic gap values', () => {
|
|
66
|
+
expect(Object.keys(gapScale.semantic)).toHaveLength(11);
|
|
64
67
|
});
|
|
65
68
|
});
|
|
66
69
|
describe('numeric', () => {
|
|
@@ -120,8 +123,8 @@ describe('spacing tokens', () => {
|
|
|
120
123
|
expect(gapMap.standard).toBe('gap-6');
|
|
121
124
|
expect(gapMap.spacious).toBe('gap-8');
|
|
122
125
|
});
|
|
123
|
-
it('
|
|
124
|
-
//
|
|
126
|
+
it('grid and semantic values with same key have same value', () => {
|
|
127
|
+
// Both semantic.tight and grid-tight map to gap-4
|
|
125
128
|
expect(gapMap.tight).toBe('gap-4');
|
|
126
129
|
});
|
|
127
130
|
it('contains all expected keys', () => {
|
|
@@ -130,10 +133,10 @@ describe('spacing tokens', () => {
|
|
|
130
133
|
'0', '1', '1.5', '2', '3', '4', '6', '8', '12', '16',
|
|
131
134
|
// legacy
|
|
132
135
|
'none', 'xs', 'sm', 'md', 'lg', 'xl',
|
|
133
|
-
// semantic
|
|
134
|
-
'compact', 'item', 'group', 'content', 'section', 'layout', 'page',
|
|
136
|
+
// semantic
|
|
137
|
+
'minimal', 'compact', 'item', 'group', 'tight', 'content', 'standard', 'section', 'spacious', 'layout', 'page',
|
|
135
138
|
// grid
|
|
136
|
-
'tight', 'standard', 'spacious',
|
|
139
|
+
'grid-tight', 'grid-standard', 'grid-spacious',
|
|
137
140
|
];
|
|
138
141
|
for (const key of expectedKeys) {
|
|
139
142
|
expect(gapMap).toHaveProperty(key);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.test.d.ts","sourceRoot":"","sources":["../../../src/lib/tokens/__tests__/typography.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { typography } from '../typography';
|
|
3
|
+
describe('Typography Headings', () => {
|
|
4
|
+
it('h1 has 2xl size and semibold weight', () => {
|
|
5
|
+
expect(typography.h1).toContain('text-2xl');
|
|
6
|
+
expect(typography.h1).toContain('font-semibold');
|
|
7
|
+
expect(typography.h1).toContain('text-gray-900');
|
|
8
|
+
expect(typography.h1).toContain('dark:text-white');
|
|
9
|
+
});
|
|
10
|
+
it('h2 has xl size and semibold weight', () => {
|
|
11
|
+
expect(typography.h2).toContain('text-xl');
|
|
12
|
+
expect(typography.h2).toContain('font-semibold');
|
|
13
|
+
});
|
|
14
|
+
it('h3 has lg size and semibold weight', () => {
|
|
15
|
+
expect(typography.h3).toContain('text-lg');
|
|
16
|
+
expect(typography.h3).toContain('font-semibold');
|
|
17
|
+
});
|
|
18
|
+
it('h4 has base size and semibold weight', () => {
|
|
19
|
+
expect(typography.h4).toContain('text-base');
|
|
20
|
+
expect(typography.h4).toContain('font-semibold');
|
|
21
|
+
});
|
|
22
|
+
it('h5 has sm size and semibold weight', () => {
|
|
23
|
+
expect(typography.h5).toContain('text-sm');
|
|
24
|
+
expect(typography.h5).toContain('font-semibold');
|
|
25
|
+
});
|
|
26
|
+
it('h6 has xs size and semibold weight', () => {
|
|
27
|
+
expect(typography.h6).toContain('text-xs');
|
|
28
|
+
expect(typography.h6).toContain('font-semibold');
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
describe('Typography Body Text', () => {
|
|
32
|
+
it('body has base size and relaxed leading', () => {
|
|
33
|
+
expect(typography.body).toContain('text-base');
|
|
34
|
+
expect(typography.body).toContain('leading-relaxed');
|
|
35
|
+
expect(typography.body).toContain('text-gray-900');
|
|
36
|
+
});
|
|
37
|
+
it('bodyMuted has muted gray color', () => {
|
|
38
|
+
expect(typography.bodyMuted).toContain('text-gray-500');
|
|
39
|
+
expect(typography.bodyMuted).toContain('dark:text-gray-400');
|
|
40
|
+
});
|
|
41
|
+
it('sm has sm size', () => {
|
|
42
|
+
expect(typography.sm).toContain('text-sm');
|
|
43
|
+
expect(typography.sm).toContain('text-gray-900');
|
|
44
|
+
});
|
|
45
|
+
it('smMuted has sm size and muted color', () => {
|
|
46
|
+
expect(typography.smMuted).toContain('text-sm');
|
|
47
|
+
expect(typography.smMuted).toContain('text-gray-500');
|
|
48
|
+
});
|
|
49
|
+
it('xs has xs size', () => {
|
|
50
|
+
expect(typography.xs).toContain('text-xs');
|
|
51
|
+
expect(typography.xs).toContain('text-gray-900');
|
|
52
|
+
});
|
|
53
|
+
it('xsMuted has xs size and muted color', () => {
|
|
54
|
+
expect(typography.xsMuted).toContain('text-xs');
|
|
55
|
+
expect(typography.xsMuted).toContain('text-gray-500');
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe('Typography Muted Colors', () => {
|
|
59
|
+
it('textMuted has muted gray color', () => {
|
|
60
|
+
expect(typography.textMuted).toContain('text-gray-500');
|
|
61
|
+
expect(typography.textMuted).toContain('dark:text-gray-400');
|
|
62
|
+
});
|
|
63
|
+
it('iconMuted matches textMuted', () => {
|
|
64
|
+
expect(typography.iconMuted).toBe(typography.textMuted);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
describe('Typography Labels', () => {
|
|
68
|
+
it('label has sm size and medium weight', () => {
|
|
69
|
+
expect(typography.label).toContain('text-sm');
|
|
70
|
+
expect(typography.label).toContain('font-medium');
|
|
71
|
+
expect(typography.label).toContain('text-gray-900');
|
|
72
|
+
});
|
|
73
|
+
it('labelSpaced includes bottom margin', () => {
|
|
74
|
+
expect(typography.labelSpaced).toContain('mb-2');
|
|
75
|
+
expect(typography.labelSpaced).toContain('text-sm');
|
|
76
|
+
expect(typography.labelSpaced).toContain('font-medium');
|
|
77
|
+
});
|
|
78
|
+
it('helper has muted color', () => {
|
|
79
|
+
expect(typography.helper).toContain('text-sm');
|
|
80
|
+
expect(typography.helper).toContain('text-gray-500');
|
|
81
|
+
});
|
|
82
|
+
it('placeholder has lighter muted color', () => {
|
|
83
|
+
expect(typography.placeholder).toContain('text-sm');
|
|
84
|
+
expect(typography.placeholder).toContain('text-gray-400');
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
describe('Typography Status Text', () => {
|
|
88
|
+
it('error has red color', () => {
|
|
89
|
+
expect(typography.error).toContain('text-sm');
|
|
90
|
+
expect(typography.error).toContain('text-red-500');
|
|
91
|
+
expect(typography.error).toContain('dark:text-red-400');
|
|
92
|
+
});
|
|
93
|
+
it('success has green color', () => {
|
|
94
|
+
expect(typography.success).toContain('text-sm');
|
|
95
|
+
expect(typography.success).toContain('text-green-600');
|
|
96
|
+
});
|
|
97
|
+
it('warning has yellow color', () => {
|
|
98
|
+
expect(typography.warning).toContain('text-sm');
|
|
99
|
+
expect(typography.warning).toContain('text-yellow-600');
|
|
100
|
+
});
|
|
101
|
+
it('info has blue color', () => {
|
|
102
|
+
expect(typography.info).toContain('text-sm');
|
|
103
|
+
expect(typography.info).toContain('text-blue-600');
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
describe('Typography Links', () => {
|
|
107
|
+
it('link has blue color and hover underline', () => {
|
|
108
|
+
expect(typography.link).toContain('text-blue-700');
|
|
109
|
+
expect(typography.link).toContain('hover:underline');
|
|
110
|
+
});
|
|
111
|
+
it('linkMuted has gray color and hover state', () => {
|
|
112
|
+
expect(typography.linkMuted).toContain('text-gray-500');
|
|
113
|
+
expect(typography.linkMuted).toContain('hover:text-gray-700');
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
describe('Typography Special Cases', () => {
|
|
117
|
+
it('price has lg size and semibold weight', () => {
|
|
118
|
+
expect(typography.price).toContain('text-lg');
|
|
119
|
+
expect(typography.price).toContain('font-semibold');
|
|
120
|
+
});
|
|
121
|
+
it('priceLg has 2xl size and bold weight', () => {
|
|
122
|
+
expect(typography.priceLg).toContain('text-2xl');
|
|
123
|
+
expect(typography.priceLg).toContain('font-bold');
|
|
124
|
+
});
|
|
125
|
+
it('badge has xs size and medium weight', () => {
|
|
126
|
+
expect(typography.badge).toContain('text-xs');
|
|
127
|
+
expect(typography.badge).toContain('font-medium');
|
|
128
|
+
});
|
|
129
|
+
it('tableHeader has uppercase tracking', () => {
|
|
130
|
+
expect(typography.tableHeader).toContain('text-xs');
|
|
131
|
+
expect(typography.tableHeader).toContain('uppercase');
|
|
132
|
+
expect(typography.tableHeader).toContain('tracking-wider');
|
|
133
|
+
});
|
|
134
|
+
it('code has mono font', () => {
|
|
135
|
+
expect(typography.code).toContain('font-mono');
|
|
136
|
+
expect(typography.code).toContain('text-sm');
|
|
137
|
+
});
|
|
138
|
+
it('codeMuted has mono font and muted color', () => {
|
|
139
|
+
expect(typography.codeMuted).toContain('font-mono');
|
|
140
|
+
expect(typography.codeMuted).toContain('text-gray-500');
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
describe('Typography Token Type', () => {
|
|
144
|
+
it('all tokens are strings', () => {
|
|
145
|
+
const tokens = ['h1', 'h2', 'body', 'label', 'error', 'link', 'code'];
|
|
146
|
+
tokens.forEach(token => {
|
|
147
|
+
expect(typeof typography[token]).toBe('string');
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
it('all tokens have dark mode variants where applicable', () => {
|
|
151
|
+
const tokensWithDarkMode = ['h1', 'body', 'sm', 'label', 'error'];
|
|
152
|
+
tokensWithDarkMode.forEach(token => {
|
|
153
|
+
expect(typography[token]).toContain('dark:');
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"z-index.test.d.ts","sourceRoot":"","sources":["../../../src/lib/tokens/__tests__/z-index.test.ts"],"names":[],"mappings":""}
|