@getmicdrop/svelte-components 5.20.2 → 5.21.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.spec.js +10 -10
- package/dist/calendar/AboutShow/AboutShow.svelte +11 -11
- package/dist/calendar/Calendar/MiniMonthCalendar.spec.js +9 -8
- package/dist/calendar/Calendar/MiniMonthCalendar.svelte +22 -25
- package/dist/calendar/Calendar/MiniMonthCalendar.svelte.d.ts.map +1 -1
- package/dist/calendar/FAQs/FAQs.spec.js +6 -6
- package/dist/calendar/FAQs/FAQs.svelte +4 -4
- package/dist/calendar/MonthSwitcher/MonthSwitcher.svelte +8 -12
- package/dist/calendar/OrderSummary/OrderSummary.svelte +36 -36
- package/dist/calendar/PublicCard/PublicCard.spec.js +3 -3
- package/dist/calendar/PublicCard/PublicCard.svelte +7 -7
- package/dist/calendar/ShowCard/ShowCard.spec.js +8 -8
- package/dist/calendar/ShowCard/ShowCard.svelte +8 -8
- package/dist/calendar/ShowTimeCard/ShowTimeCard.spec.js +4 -4
- package/dist/calendar/ShowTimeCard/ShowTimeCard.svelte +4 -4
- package/dist/components/Heading.spec.js +1 -1
- package/dist/components/Heading.svelte +1 -1
- package/dist/components/Layout/AppShell.svelte +4 -4
- package/dist/components/Layout/ContentSection.svelte +2 -2
- package/dist/components/Layout/Heading.svelte +3 -3
- package/dist/components/Layout/PageContainer.svelte +2 -2
- package/dist/components/Layout/Section.spec.js +4 -4
- package/dist/components/Layout/Text.svelte +7 -7
- package/dist/components/Layout/__tests__/AppShell.test.js +5 -5
- package/dist/components/Layout/__tests__/ContentSection.test.js +1 -1
- package/dist/components/Layout/__tests__/Heading.test.js +3 -3
- package/dist/components/Layout/__tests__/PageContainer.test.js +4 -4
- package/dist/components/Layout/__tests__/Text.test.js +9 -9
- package/dist/components/Text.spec.js +4 -4
- package/dist/components/Text.svelte +7 -7
- package/dist/patterns/chat/ChatActivityNotice.spec.js +1 -1
- package/dist/patterns/chat/ChatActivityNotice.svelte +3 -3
- package/dist/patterns/chat/ChatBubble.spec.js +1 -1
- package/dist/patterns/chat/ChatBubble.svelte +7 -7
- package/dist/patterns/chat/ChatContainer.spec.js +1 -1
- package/dist/patterns/chat/ChatContainer.svelte +3 -3
- package/dist/patterns/chat/ChatDateDivider.svelte +1 -1
- package/dist/patterns/chat/ChatInvitationBubble.spec.js +2 -2
- package/dist/patterns/chat/ChatInvitationBubble.svelte +1 -1
- package/dist/patterns/chat/ChatInvitationNotice.spec.js +2 -2
- package/dist/patterns/chat/ChatInvitationNotice.svelte +1 -1
- package/dist/patterns/chat/ChatMessageGroup.svelte +2 -2
- package/dist/patterns/chat/ChatSlotUpdate.svelte +2 -2
- package/dist/patterns/chat/ChatStatusBadge.spec.js +10 -10
- package/dist/patterns/chat/ChatStatusBadge.svelte +8 -8
- package/dist/patterns/chat/ChatStatusTransition.spec.js +9 -9
- package/dist/patterns/chat/ChatStatusTransition.svelte +5 -5
- package/dist/patterns/chat/ChatTextBubble.spec.js +4 -4
- package/dist/patterns/chat/ChatTextBubble.svelte +2 -2
- package/dist/patterns/data/DataList.spec.js +5 -5
- package/dist/patterns/data/DataList.svelte +1 -1
- package/dist/patterns/data/DataTable.spec.js +18 -18
- package/dist/patterns/data/DataTable.svelte +3 -3
- package/dist/patterns/forms/FormActions.spec.js +6 -6
- package/dist/patterns/forms/FormActions.stories.svelte +1 -1
- package/dist/patterns/forms/FormActions.svelte +1 -1
- package/dist/patterns/forms/FormSection.spec.js +4 -4
- package/dist/patterns/forms/FormSection.svelte +2 -2
- package/dist/patterns/forms/FormValidationSummary.spec.js +2 -2
- package/dist/patterns/forms/FormValidationSummary.stories.svelte +4 -4
- package/dist/patterns/forms/FormValidationSummary.svelte +4 -4
- package/dist/patterns/navigation/BottomNav.stories.svelte +23 -23
- package/dist/patterns/navigation/BottomNav.svelte +3 -3
- package/dist/patterns/navigation/Header.spec.js +9 -9
- package/dist/patterns/navigation/Header.svelte +13 -15
- package/dist/patterns/navigation/Header.svelte.d.ts.map +1 -1
- package/dist/patterns/page/PageLayout.spec.js +5 -5
- package/dist/patterns/page/PageLayout.svelte +1 -1
- package/dist/patterns/page/PageLoader.stories.svelte +5 -5
- package/dist/patterns/page/SectionHeader.spec.js +8 -8
- package/dist/patterns/page/SectionHeader.svelte +2 -2
- package/dist/presets/buttons.js +1 -1
- package/dist/presets/buttons.spec.js +4 -4
- package/dist/primitives/Accordion/Accordion.spec.js +5 -5
- package/dist/primitives/Accordion/Accordion.stories.svelte +9 -9
- package/dist/primitives/Accordion/Accordion.svelte +2 -2
- package/dist/primitives/Accordion/AccordionItem.spec.js +19 -28
- package/dist/primitives/Accordion/AccordionItem.svelte +4 -4
- package/dist/primitives/Avatar/Avatar.spec.js +11 -11
- package/dist/primitives/Avatar/Avatar.stories.svelte +6 -5
- package/dist/primitives/Avatar/Avatar.stories.svelte.d.ts.map +1 -1
- package/dist/primitives/Avatar/Avatar.svelte +3 -3
- package/dist/primitives/Badges/Badge.spec.js +10 -10
- package/dist/primitives/BottomSheet/BottomSheet.spec.js +5 -5
- package/dist/primitives/BottomSheet/BottomSheet.svelte +7 -7
- package/dist/primitives/Breadcrumb/Breadcrumb.spec.js +4 -2
- package/dist/primitives/Breadcrumb/Breadcrumb.svelte +4 -4
- package/dist/primitives/Button/Button.spec.js +15 -15
- package/dist/primitives/Button/Button.svelte +16 -16
- package/dist/primitives/Button/ButtonVariantShowcase.spec.js +1 -1
- package/dist/primitives/Button/ButtonVariantShowcase.svelte +18 -18
- package/dist/primitives/Card.spec.js +1 -1
- package/dist/primitives/Card.stories.svelte +1 -1
- package/dist/primitives/Card.svelte +1 -1
- package/dist/primitives/CardAction/CardAction.svelte +3 -3
- package/dist/primitives/Checkbox/Checkbox.spec.js +16 -16
- package/dist/primitives/Checkbox/Checkbox.stories.svelte +3 -3
- package/dist/primitives/Checkbox/Checkbox.svelte +9 -9
- package/dist/primitives/DarkModeToggle.spec.js +11 -11
- package/dist/primitives/DarkModeToggle.stories.svelte +8 -8
- package/dist/primitives/DarkModeToggle.svelte +4 -4
- package/dist/primitives/Drawer/Drawer.spec.js +4 -4
- package/dist/primitives/Drawer/Drawer.stories.svelte +6 -6
- package/dist/primitives/Drawer/Drawer.svelte +11 -11
- package/dist/primitives/Dropdown/Dropdown.spec.js +9 -9
- package/dist/primitives/Dropdown/Dropdown.stories.svelte +4 -4
- package/dist/primitives/Dropdown/Dropdown.svelte +2 -2
- package/dist/primitives/Dropdown/DropdownDivider.svelte +1 -1
- package/dist/primitives/Dropdown/DropdownItem.spec.js +8 -15
- package/dist/primitives/Dropdown/DropdownItem.svelte +3 -3
- package/dist/primitives/Helper/Helper.spec.js +6 -6
- package/dist/primitives/Helper/Helper.svelte +3 -3
- package/dist/primitives/Icons/Icon.stories.svelte +15 -15
- package/dist/primitives/Icons/IconGallery.stories.svelte +26 -26
- package/dist/primitives/Icons/Icons.spec.js +3 -3
- package/dist/primitives/Input/Input.spec.js +9 -9
- package/dist/primitives/Input/Input.svelte +11 -11
- package/dist/primitives/Input/Select.spec.js +7 -7
- package/dist/primitives/Input/Select.stories.svelte +1 -1
- package/dist/primitives/Input/Select.svelte +6 -6
- package/dist/primitives/Input/Textarea.spec.js +8 -8
- package/dist/primitives/Input/Textarea.stories.svelte +1 -1
- package/dist/primitives/Input/Textarea.svelte +2 -2
- package/dist/primitives/Label/Label.spec.js +20 -21
- package/dist/primitives/Label/Label.svelte +4 -4
- package/dist/primitives/LandingButton/LandingButton.svelte +3 -3
- package/dist/primitives/MenuItem/MenuItem.spec.js +5 -5
- package/dist/primitives/MenuItem/MenuItem.svelte +4 -4
- package/dist/primitives/Modal/Modal.stories.svelte +8 -8
- package/dist/primitives/Modal/Modal.svelte +4 -4
- package/dist/primitives/NavItem/NavItem.spec.js +2 -2
- package/dist/primitives/NavItem/NavItem.svelte +3 -3
- package/dist/primitives/NumberInput/NumberInput.spec.js +17 -17
- package/dist/primitives/NumberInput/NumberInput.svelte +8 -8
- package/dist/primitives/Pagination/DotIndicator.svelte +6 -6
- package/dist/primitives/Pagination/Pagination.spec.js +6 -6
- package/dist/primitives/Pagination/Pagination.stories.svelte +4 -4
- package/dist/primitives/Pagination/Pagination.svelte +3 -3
- package/dist/primitives/Radio/Radio.spec.js +19 -19
- package/dist/primitives/Radio/Radio.stories.svelte +5 -5
- package/dist/primitives/Radio/Radio.svelte +8 -8
- package/dist/primitives/SearchResultItem/SearchResultItem.svelte +5 -5
- package/dist/primitives/SidebarToggle/SidebarToggle.svelte +2 -2
- package/dist/primitives/Skeleton/CardPlaceholder.spec.js +1 -1
- package/dist/primitives/Skeleton/CardPlaceholder.svelte +11 -11
- package/dist/primitives/Skeleton/ImagePlaceholder.spec.js +2 -2
- package/dist/primitives/Skeleton/ImagePlaceholder.svelte +7 -7
- package/dist/primitives/Skeleton/ListPlaceholder.spec.js +2 -2
- package/dist/primitives/Skeleton/ListPlaceholder.svelte +5 -5
- package/dist/primitives/Skeleton/Skeleton.spec.js +7 -7
- package/dist/primitives/Skeleton/Skeleton.stories.svelte +4 -4
- package/dist/primitives/Skeleton/Skeleton.svelte +1 -1
- package/dist/primitives/Spinner/Spinner.spec.js +4 -5
- package/dist/primitives/Spinner/Spinner.stories.svelte +2 -2
- package/dist/primitives/Spinner/Spinner.svelte +1 -1
- package/dist/primitives/Tabs/Tabs.spec.js +14 -14
- package/dist/primitives/Tabs/Tabs.stories.svelte +6 -6
- package/dist/primitives/Tabs/Tabs.svelte +8 -8
- package/dist/primitives/Toggle.spec.js +3 -5
- package/dist/primitives/Toggle.stories.svelte +7 -7
- package/dist/primitives/Toggle.svelte +7 -7
- package/dist/primitives/Tooltip/Tooltip.svelte +5 -5
- package/dist/primitives/ValidationError.spec.js +1 -1
- package/dist/primitives/ValidationError.stories.svelte +8 -8
- package/dist/primitives/ValidationError.svelte +1 -1
- package/dist/recipes/CropImage/CropImage.stories.svelte +8 -8
- package/dist/recipes/CropImage/CropImage.svelte +7 -7
- package/dist/recipes/ImageUploader/ImageUploader.spec.js +1 -1
- package/dist/recipes/ImageUploader/ImageUploader.svelte +34 -56
- package/dist/recipes/SuperLogin/SuperLogin.svelte +25 -25
- package/dist/recipes/Toaster/Toaster.stories.svelte +10 -10
- package/dist/recipes/feedback/EmptyState/EmptyState.svelte +1 -1
- package/dist/recipes/feedback/ErrorDisplay.spec.js +1 -1
- package/dist/recipes/feedback/ErrorDisplay.stories.svelte +2 -2
- package/dist/recipes/feedback/ErrorDisplay.svelte +2 -2
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.svelte +7 -7
- package/dist/recipes/fields/CheckboxField.spec.js +2 -2
- package/dist/recipes/fields/CheckboxField.svelte +2 -2
- package/dist/recipes/fields/FormField.spec.js +4 -4
- package/dist/recipes/fields/FormField.svelte +1 -1
- package/dist/recipes/fields/RadioGroup.spec.js +1 -1
- package/dist/recipes/fields/RadioGroup.svelte +2 -2
- package/dist/recipes/fields/SelectField.spec.js +2 -2
- package/dist/recipes/fields/TextareaField.spec.js +2 -2
- package/dist/recipes/fields/ToggleField.spec.js +2 -2
- package/dist/recipes/fields/ToggleField.svelte +1 -1
- package/dist/recipes/inputs/MultiSelect.stories.svelte +2 -2
- package/dist/recipes/inputs/MultiSelect.svelte +10 -10
- package/dist/recipes/inputs/OTPInput.stories.svelte +9 -9
- package/dist/recipes/inputs/OTPInput.svelte +1 -1
- package/dist/recipes/inputs/PasswordInput.spec.js +2 -2
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.spec.js +14 -14
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte +3 -3
- package/dist/recipes/inputs/PasswordStrengthIndicator/TestWrapper.svelte +2 -2
- package/dist/recipes/inputs/PhoneInput.svelte +5 -5
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.spec.js +10 -10
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.stories.svelte +7 -7
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte +11 -14
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/Search.spec.js +3 -3
- package/dist/recipes/inputs/Search.svelte +1 -1
- package/dist/recipes/inputs/phoneInput/CountrySelector.svelte +5 -5
- package/dist/recipes/modals/AlertModal.spec.js +36 -36
- package/dist/recipes/modals/AlertModal.svelte +8 -8
- package/dist/recipes/modals/ConfirmationModal.spec.js +20 -20
- package/dist/recipes/modals/ConfirmationModal.svelte +1 -1
- package/dist/recipes/modals/FeedbackModal.svelte +7 -7
- package/dist/recipes/modals/InputModal.spec.js +17 -17
- package/dist/recipes/modals/InputModal.svelte +3 -3
- package/dist/recipes/modals/ModalStateManager.spec.js +1 -1
- package/dist/recipes/modals/ModalStateManager.svelte +2 -2
- package/dist/recipes/modals/StatusModal.spec.js +7 -7
- package/dist/recipes/modals/StatusModal.svelte +10 -10
- package/dist/schemas/__tests__/order.test.js +1 -1
- package/dist/schemas/auth.d.ts +107 -17
- package/dist/schemas/auth.d.ts.map +1 -1
- package/dist/schemas/common.d.ts +41 -13
- package/dist/schemas/common.d.ts.map +1 -1
- package/dist/schemas/event.d.ts +147 -41
- package/dist/schemas/event.d.ts.map +1 -1
- package/dist/schemas/order.d.ts +208 -51
- package/dist/schemas/order.d.ts.map +1 -1
- package/dist/schemas/performer.d.ts +199 -44
- package/dist/schemas/performer.d.ts.map +1 -1
- package/dist/schemas/promo.d.ts +221 -55
- package/dist/schemas/promo.d.ts.map +1 -1
- package/dist/schemas/ticket.d.ts +187 -61
- package/dist/schemas/ticket.d.ts.map +1 -1
- package/dist/schemas/user.d.ts +114 -54
- package/dist/schemas/user.d.ts.map +1 -1
- package/dist/schemas/venue.d.ts +238 -20
- package/dist/schemas/venue.d.ts.map +1 -1
- package/dist/stories/ButtonAuditDashboard.spec.js +12 -12
- package/dist/stories/ButtonAuditDashboard.svelte +55 -55
- package/dist/stories/ButtonAuditReview.spec.js +8 -8
- package/dist/stories/ButtonAuditReview.svelte +87 -87
- package/dist/stories/ButtonGridView.spec.js +27 -27
- package/dist/stories/ButtonGridView.svelte +22 -22
- package/dist/stories/ButtonShowcase.spec.js +4 -4
- package/dist/stories/ButtonShowcase.svelte +119 -119
- package/dist/stories/ComponentConsolidation.stories.svelte +453 -453
- package/dist/stories/DesignSystemAudit.stories.svelte +127 -127
- package/dist/stories/PatternsGallery.spec.js +3 -3
- package/dist/stories/PatternsGallery.svelte +23 -23
- package/dist/stories/PrimitivesGallery.spec.js +9 -9
- package/dist/stories/PrimitivesGallery.svelte +68 -68
- package/dist/stories/RecipesGallery.svelte +26 -26
- package/dist/tokens/__tests__/typography-base.test.js +5 -5
- package/dist/tokens/__tests__/typography.test.js +32 -36
- package/dist/tokens/__tests__/variants.test.js +63 -78
- package/dist/tokens/tokens.css +15 -15
- package/dist/tokens/typography-base.css +16 -16
- package/dist/tokens/typography.d.ts +29 -29
- package/dist/tokens/typography.js +29 -29
- package/dist/tokens/utilities.css +35 -47
- package/dist/tokens/variants.d.ts +32 -32
- package/dist/tokens/variants.js +32 -32
- package/dist/utils/utils/utils.spec.js +2 -2
- package/package.json +1 -1
|
@@ -39,7 +39,7 @@ describe('ContentSection', () => {
|
|
|
39
39
|
const { container } = render(ContentSection, { title: 'Title', subtitle: 'Subtitle' });
|
|
40
40
|
const subtitle = container.querySelector('p');
|
|
41
41
|
expect(subtitle?.classList.contains('text-sm')).toBe(true);
|
|
42
|
-
expect(subtitle?.classList.contains('text-
|
|
42
|
+
expect(subtitle?.classList.contains('text-muted-foreground')).toBe(true);
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
describe('headingLevel prop', () => {
|
|
@@ -10,7 +10,7 @@ describe('Heading', () => {
|
|
|
10
10
|
it('applies default variant classes', () => {
|
|
11
11
|
const { container } = render(Heading);
|
|
12
12
|
const h2 = container.querySelector('h2');
|
|
13
|
-
expect(h2?.classList.contains('text-
|
|
13
|
+
expect(h2?.classList.contains('text-text-primary')).toBe(true);
|
|
14
14
|
});
|
|
15
15
|
it('applies default size class based on level', () => {
|
|
16
16
|
const { container } = render(Heading);
|
|
@@ -77,12 +77,12 @@ describe('Heading', () => {
|
|
|
77
77
|
it('applies default variant classes', () => {
|
|
78
78
|
const { container } = render(Heading, { variant: 'default' });
|
|
79
79
|
const h2 = container.querySelector('h2');
|
|
80
|
-
expect(h2?.classList.contains('text-
|
|
80
|
+
expect(h2?.classList.contains('text-text-primary')).toBe(true);
|
|
81
81
|
});
|
|
82
82
|
it('applies muted variant classes', () => {
|
|
83
83
|
const { container } = render(Heading, { variant: 'muted' });
|
|
84
84
|
const h2 = container.querySelector('h2');
|
|
85
|
-
expect(h2?.classList.contains('text-
|
|
85
|
+
expect(h2?.classList.contains('text-text-secondary')).toBe(true);
|
|
86
86
|
});
|
|
87
87
|
it('applies primary variant classes', () => {
|
|
88
88
|
const { container } = render(Heading, { variant: 'primary' });
|
|
@@ -102,18 +102,18 @@ describe('PageContainer', () => {
|
|
|
102
102
|
it('applies no background for background="none"', () => {
|
|
103
103
|
const { container } = render(PageContainer, { background: 'none' });
|
|
104
104
|
const div = container.querySelector('div');
|
|
105
|
-
expect(div?.classList.contains('bg-
|
|
106
|
-
expect(div?.classList.contains('bg-
|
|
105
|
+
expect(div?.classList.contains('bg-card')).toBe(false);
|
|
106
|
+
expect(div?.classList.contains('bg-bg-secondary')).toBe(false);
|
|
107
107
|
});
|
|
108
108
|
it('applies white background for background="white"', () => {
|
|
109
109
|
const { container } = render(PageContainer, { background: 'white' });
|
|
110
110
|
const div = container.querySelector('div');
|
|
111
|
-
expect(div?.classList.contains('bg-
|
|
111
|
+
expect(div?.classList.contains('bg-card')).toBe(true);
|
|
112
112
|
});
|
|
113
113
|
it('applies gray background for background="gray"', () => {
|
|
114
114
|
const { container } = render(PageContainer, { background: 'gray' });
|
|
115
115
|
const div = container.querySelector('div');
|
|
116
|
-
expect(div?.classList.contains('bg-
|
|
116
|
+
expect(div?.classList.contains('bg-bg-secondary')).toBe(true);
|
|
117
117
|
});
|
|
118
118
|
});
|
|
119
119
|
describe('class prop', () => {
|
|
@@ -10,7 +10,7 @@ describe('Text', () => {
|
|
|
10
10
|
it('applies primary variant classes by default', () => {
|
|
11
11
|
const { container } = render(Text);
|
|
12
12
|
const p = container.querySelector('p');
|
|
13
|
-
expect(p?.classList.contains('text-
|
|
13
|
+
expect(p?.classList.contains('text-text-primary')).toBe(true);
|
|
14
14
|
});
|
|
15
15
|
it('applies base size class by default', () => {
|
|
16
16
|
const { container } = render(Text);
|
|
@@ -22,37 +22,37 @@ describe('Text', () => {
|
|
|
22
22
|
it('applies primary variant classes', () => {
|
|
23
23
|
const { container } = render(Text, { variant: 'primary' });
|
|
24
24
|
const p = container.querySelector('p');
|
|
25
|
-
expect(p?.classList.contains('text-
|
|
25
|
+
expect(p?.classList.contains('text-text-primary')).toBe(true);
|
|
26
26
|
});
|
|
27
27
|
it('applies secondary variant classes', () => {
|
|
28
28
|
const { container } = render(Text, { variant: 'secondary' });
|
|
29
29
|
const p = container.querySelector('p');
|
|
30
|
-
expect(p?.classList.contains('text-
|
|
30
|
+
expect(p?.classList.contains('text-muted-foreground')).toBe(true);
|
|
31
31
|
});
|
|
32
32
|
it('applies muted variant classes', () => {
|
|
33
33
|
const { container } = render(Text, { variant: 'muted' });
|
|
34
34
|
const p = container.querySelector('p');
|
|
35
|
-
expect(p?.classList.contains('text-
|
|
35
|
+
expect(p?.classList.contains('text-muted-foreground')).toBe(true);
|
|
36
36
|
});
|
|
37
37
|
it('applies error variant classes', () => {
|
|
38
38
|
const { container } = render(Text, { variant: 'error' });
|
|
39
39
|
const p = container.querySelector('p');
|
|
40
|
-
expect(p?.classList.contains('text-
|
|
40
|
+
expect(p?.classList.contains('text-accent-danger')).toBe(true);
|
|
41
41
|
});
|
|
42
42
|
it('applies success variant classes', () => {
|
|
43
43
|
const { container } = render(Text, { variant: 'success' });
|
|
44
44
|
const p = container.querySelector('p');
|
|
45
|
-
expect(p?.classList.contains('text-
|
|
45
|
+
expect(p?.classList.contains('text-accent-success')).toBe(true);
|
|
46
46
|
});
|
|
47
47
|
it('applies warning variant classes', () => {
|
|
48
48
|
const { container } = render(Text, { variant: 'warning' });
|
|
49
49
|
const p = container.querySelector('p');
|
|
50
|
-
expect(p?.classList.contains('text-
|
|
50
|
+
expect(p?.classList.contains('text-accent-warning')).toBe(true);
|
|
51
51
|
});
|
|
52
52
|
it('applies info variant classes', () => {
|
|
53
53
|
const { container } = render(Text, { variant: 'info' });
|
|
54
54
|
const p = container.querySelector('p');
|
|
55
|
-
expect(p?.classList.contains('text-
|
|
55
|
+
expect(p?.classList.contains('text-brand-primary')).toBe(true);
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
58
|
describe('size prop', () => {
|
|
@@ -138,7 +138,7 @@ describe('Text', () => {
|
|
|
138
138
|
it('preserves default classes when adding custom classes', () => {
|
|
139
139
|
const { container } = render(Text, { class: 'custom-class' });
|
|
140
140
|
const p = container.querySelector('p');
|
|
141
|
-
expect(p?.classList.contains('text-
|
|
141
|
+
expect(p?.classList.contains('text-text-primary')).toBe(true);
|
|
142
142
|
expect(p?.classList.contains('text-base')).toBe(true);
|
|
143
143
|
expect(p?.classList.contains('custom-class')).toBe(true);
|
|
144
144
|
});
|
|
@@ -38,22 +38,22 @@ describe('Text', () => {
|
|
|
38
38
|
|
|
39
39
|
test('default color is default (gray-900)', () => {
|
|
40
40
|
const { container } = render(Text, { props: { children: textSnippet('T') } });
|
|
41
|
-
expect(container.querySelector('span').className).toContain('text-
|
|
41
|
+
expect(container.querySelector('span').className).toContain('text-text-primary');
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
test('color muted', () => {
|
|
45
45
|
const { container } = render(Text, { props: { color: 'muted', children: textSnippet('T') } });
|
|
46
|
-
expect(container.querySelector('span').className).toContain('text-
|
|
46
|
+
expect(container.querySelector('span').className).toContain('text-muted-foreground');
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
test('color success', () => {
|
|
50
50
|
const { container } = render(Text, { props: { color: 'success', children: textSnippet('T') } });
|
|
51
|
-
expect(container.querySelector('span').className).toContain('text-
|
|
51
|
+
expect(container.querySelector('span').className).toContain('text-accent-success');
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
test('color error', () => {
|
|
55
55
|
const { container } = render(Text, { props: { color: 'error', children: textSnippet('T') } });
|
|
56
|
-
expect(container.querySelector('span').className).toContain('text-
|
|
56
|
+
expect(container.querySelector('span').className).toContain('text-accent-danger');
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
test('leading tight', () => {
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
const colorClasses: Record<string, string> = {
|
|
33
|
-
default: 'text-
|
|
34
|
-
muted: 'text-
|
|
35
|
-
primary: 'text-primary-600
|
|
36
|
-
secondary: 'text-
|
|
37
|
-
success: 'text-
|
|
38
|
-
warning: 'text-
|
|
39
|
-
error: 'text-
|
|
33
|
+
default: 'text-text-primary',
|
|
34
|
+
muted: 'text-muted-foreground',
|
|
35
|
+
primary: 'text-primary-600',
|
|
36
|
+
secondary: 'text-text-secondary',
|
|
37
|
+
success: 'text-accent-success',
|
|
38
|
+
warning: 'text-accent-warning',
|
|
39
|
+
error: 'text-accent-danger',
|
|
40
40
|
none: '',
|
|
41
41
|
};
|
|
42
42
|
|
|
@@ -48,7 +48,7 @@ describe('ChatActivityNotice', () => {
|
|
|
48
48
|
|
|
49
49
|
test('renders decorative lines', () => {
|
|
50
50
|
const { container } = render(ChatActivityNotice, { props: { actorName: 'Test' } });
|
|
51
|
-
const lines = container.querySelectorAll('.bg-
|
|
51
|
+
const lines = container.querySelectorAll('.bg-bg-tertiary, [class*="h-px"]');
|
|
52
52
|
expect(lines.length).toBeGreaterThanOrEqual(1);
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
30
|
<div class={classNames('flex items-center justify-center gap-3 py-3', className)}>
|
|
31
|
-
<div class="h-px bg-
|
|
31
|
+
<div class="h-px bg-bg-tertiary w-12"></div>
|
|
32
32
|
<div class="flex flex-col items-center gap-1">
|
|
33
33
|
{@render children?.()}
|
|
34
34
|
{#if actorName || timestamp}
|
|
35
|
-
<span class="text-[10px] text-
|
|
35
|
+
<span class="text-[10px] text-muted-foreground">
|
|
36
36
|
{#if actorName}{actorName}{/if}{#if actorName && timestamp} · {/if}{#if timestamp}{timestamp}{/if}
|
|
37
37
|
</span>
|
|
38
38
|
{/if}
|
|
39
39
|
</div>
|
|
40
|
-
<div class="h-px bg-
|
|
40
|
+
<div class="h-px bg-bg-tertiary w-12"></div>
|
|
41
41
|
</div>
|
|
@@ -51,7 +51,7 @@ describe('ChatBubble', () => {
|
|
|
51
51
|
|
|
52
52
|
test('shows failed indicator', () => {
|
|
53
53
|
const { container } = render(ChatBubble, { props: { failed: true } });
|
|
54
|
-
const redIndicator = container.querySelector('.text-
|
|
54
|
+
const redIndicator = container.querySelector('.text-accent-danger, .bg-accent-danger, [class*="red"]');
|
|
55
55
|
expect(redIndicator).toBeInTheDocument();
|
|
56
56
|
});
|
|
57
57
|
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
classNames(
|
|
57
57
|
'px-4 py-2.5 rounded-2xl text-sm',
|
|
58
58
|
isOutbound
|
|
59
|
-
? 'bg-
|
|
60
|
-
: 'bg-
|
|
59
|
+
? 'bg-brand-primary text-white rounded-br-sm'
|
|
60
|
+
: 'bg-muted text-text-primary rounded-bl-sm',
|
|
61
61
|
className
|
|
62
62
|
)
|
|
63
63
|
);
|
|
@@ -70,24 +70,24 @@
|
|
|
70
70
|
{/if}
|
|
71
71
|
<div class="flex flex-col {isOutbound ? 'items-end' : 'items-start'}">
|
|
72
72
|
{#if !isOutbound && senderName}
|
|
73
|
-
<span class="text-xs text-
|
|
73
|
+
<span class="text-xs text-muted-foreground mb-1 px-2">{senderName}</span>
|
|
74
74
|
{/if}
|
|
75
75
|
<div class="flex items-center gap-2 {isOutbound ? 'flex-row-reverse' : ''}">
|
|
76
76
|
<div class={bubbleClasses}>
|
|
77
77
|
{@render children?.()}
|
|
78
78
|
</div>
|
|
79
79
|
{#if failed}
|
|
80
|
-
<div class="flex items-center justify-center w-5 h-5 bg-
|
|
80
|
+
<div class="flex items-center justify-center w-5 h-5 bg-accent-danger rounded-full shrink-0">
|
|
81
81
|
<span class="text-white text-xs font-bold leading-none">!</span>
|
|
82
82
|
</div>
|
|
83
83
|
{/if}
|
|
84
84
|
</div>
|
|
85
85
|
{#if failed && errorMessage}
|
|
86
86
|
<div class="flex items-center gap-1 mt-0.5 px-2">
|
|
87
|
-
<span class="text-[9px] text-
|
|
87
|
+
<span class="text-[9px] text-accent-danger">{errorMessage}</span>
|
|
88
88
|
{#if onretry}
|
|
89
89
|
<button
|
|
90
|
-
class="text-[9px] text-
|
|
90
|
+
class="text-[9px] text-accent-danger hover:text-accent-danger flex items-center gap-0.5 opacity-75 hover:opacity-100"
|
|
91
91
|
onclick={onretry}
|
|
92
92
|
>
|
|
93
93
|
<Renew class="w-2 h-2" />
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
{/if}
|
|
97
97
|
</div>
|
|
98
98
|
{:else if timestamp}
|
|
99
|
-
<span class="text-[10px] text-
|
|
99
|
+
<span class="text-[10px] text-muted-foreground mt-0.5 px-2">{timestamp}</span>
|
|
100
100
|
{/if}
|
|
101
101
|
</div>
|
|
102
102
|
</div>
|
|
@@ -25,6 +25,6 @@ describe('ChatContainer', () => {
|
|
|
25
25
|
|
|
26
26
|
test('has white background', () => {
|
|
27
27
|
const { container } = render(ChatContainer);
|
|
28
|
-
expect(container.querySelector('[class*="bg-
|
|
28
|
+
expect(container.querySelector('[class*="bg-card"]')).toBeInTheDocument();
|
|
29
29
|
});
|
|
30
30
|
});
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
}: Props = $props();
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
|
-
<div class={classNames('flex flex-col h-full bg-
|
|
30
|
+
<div class={classNames('flex flex-col h-full bg-card', className)}>
|
|
31
31
|
{#if header}
|
|
32
|
-
<div class="px-4 py-3 border-b border-
|
|
32
|
+
<div class="px-4 py-3 border-b border-border shrink-0">
|
|
33
33
|
{@render header()}
|
|
34
34
|
</div>
|
|
35
35
|
{/if}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
</div>
|
|
40
40
|
|
|
41
41
|
{#if footer}
|
|
42
|
-
<div class="px-4 py-3 border-t border-
|
|
42
|
+
<div class="px-4 py-3 border-t border-border bg-card shrink-0">
|
|
43
43
|
{@render footer()}
|
|
44
44
|
</div>
|
|
45
45
|
{/if}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
23
|
<div class={classNames('text-center py-2', className)}>
|
|
24
|
-
<span class="text-xs font-semibold text-
|
|
24
|
+
<span class="text-xs font-semibold text-muted-foreground bg-muted px-3 py-1 rounded-full">
|
|
25
25
|
{label}
|
|
26
26
|
</span>
|
|
27
27
|
</div>
|
|
@@ -8,9 +8,9 @@ describe('ChatInvitationBubble', () => {
|
|
|
8
8
|
expect(screen.getByText(/Invited Alice/i)).toBeInTheDocument();
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
test('has
|
|
11
|
+
test('has brand-primary background', () => {
|
|
12
12
|
const { container } = render(ChatInvitationBubble, { props: { performerName: 'Bob' } });
|
|
13
|
-
expect(container.querySelector('[class*="
|
|
13
|
+
expect(container.querySelector('[class*="brand-primary"]')).toBeInTheDocument();
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
test('renders invitation icon', () => {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
let bubbleClasses = $derived(
|
|
35
35
|
classNames(
|
|
36
|
-
'px-4 py-2.5 rounded-2xl text-sm bg-
|
|
36
|
+
'px-4 py-2.5 rounded-2xl text-sm bg-brand-primary text-white flex items-center gap-1.5',
|
|
37
37
|
outbound ? 'rounded-br-sm' : 'rounded-bl-sm',
|
|
38
38
|
className
|
|
39
39
|
)
|
|
@@ -8,9 +8,9 @@ describe('ChatInvitationNotice', () => {
|
|
|
8
8
|
expect(screen.getByText(/Invited Alice/i)).toBeInTheDocument();
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
test('has
|
|
11
|
+
test('has brand-primary text color', () => {
|
|
12
12
|
const { container } = render(ChatInvitationNotice, { props: { performerName: 'Bob' } });
|
|
13
|
-
expect(container.querySelector('[class*="
|
|
13
|
+
expect(container.querySelector('[class*="brand-primary"]')).toBeInTheDocument();
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
test('renders icon', () => {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
let labels = $derived({ ...defaultLabels, ...userLabels });
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
|
-
<span class={classNames('text-xs font-medium text-
|
|
33
|
+
<span class={classNames('text-xs font-medium text-brand-primary flex items-center gap-1', className)}>
|
|
34
34
|
<SendAltFilled class="w-3 h-3" />
|
|
35
35
|
{typeof labels.invited === 'function' ? labels.invited(performerName) : labels.invited}
|
|
36
36
|
</span>
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
{/if}
|
|
43
43
|
<div class="flex flex-col {isOutbound ? 'items-end' : 'items-start'}">
|
|
44
44
|
{#if senderName && !isOutbound}
|
|
45
|
-
<span class="text-xs text-
|
|
45
|
+
<span class="text-xs text-muted-foreground mb-1 px-2">{senderName}</span>
|
|
46
46
|
{/if}
|
|
47
47
|
<div class="flex flex-col {isOutbound ? 'items-end' : 'items-start'} gap-1">
|
|
48
48
|
{@render children?.()}
|
|
49
49
|
</div>
|
|
50
50
|
{#if timestamp}
|
|
51
|
-
<span class="text-[10px] text-
|
|
51
|
+
<span class="text-[10px] text-muted-foreground mt-0.5 px-2">
|
|
52
52
|
{#if isOutbound && senderName}{senderName} · {/if}{timestamp}
|
|
53
53
|
</span>
|
|
54
54
|
{/if}
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
let classes = $derived(
|
|
31
31
|
variant === 'bubble'
|
|
32
32
|
? classNames(
|
|
33
|
-
'px-4 py-2.5 rounded-2xl text-sm bg-
|
|
33
|
+
'px-4 py-2.5 rounded-2xl text-sm bg-muted text-text-secondary',
|
|
34
34
|
outbound ? 'rounded-br-sm' : 'rounded-bl-sm',
|
|
35
35
|
className
|
|
36
36
|
)
|
|
37
37
|
: classNames(
|
|
38
|
-
'text-xs font-medium text-
|
|
38
|
+
'text-xs font-medium text-muted-foreground',
|
|
39
39
|
className
|
|
40
40
|
)
|
|
41
41
|
);
|
|
@@ -3,38 +3,38 @@ import { expect, describe, test } from 'vitest';
|
|
|
3
3
|
import ChatStatusBadge from './ChatStatusBadge.svelte';
|
|
4
4
|
|
|
5
5
|
describe('ChatStatusBadge', () => {
|
|
6
|
-
test('renders confirmed status with
|
|
6
|
+
test('renders confirmed status with success styling', () => {
|
|
7
7
|
const { container } = render(ChatStatusBadge, { props: { status: 'confirmed' } });
|
|
8
8
|
expect(screen.getByText(/confirmed/i)).toBeInTheDocument();
|
|
9
|
-
const badge = container.querySelector('[class*="
|
|
9
|
+
const badge = container.querySelector('[class*="accent-success"]');
|
|
10
10
|
expect(badge).toBeInTheDocument();
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
test('renders declined status with
|
|
13
|
+
test('renders declined status with danger styling', () => {
|
|
14
14
|
const { container } = render(ChatStatusBadge, { props: { status: 'declined' } });
|
|
15
15
|
expect(screen.getByText(/declined/i)).toBeInTheDocument();
|
|
16
|
-
const badge = container.querySelector('[class*="
|
|
16
|
+
const badge = container.querySelector('[class*="accent-danger"]');
|
|
17
17
|
expect(badge).toBeInTheDocument();
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
test('renders canceled status with
|
|
20
|
+
test('renders canceled status with danger styling', () => {
|
|
21
21
|
const { container } = render(ChatStatusBadge, { props: { status: 'canceled' } });
|
|
22
22
|
expect(screen.getByText(/canceled/i)).toBeInTheDocument();
|
|
23
|
-
const badge = container.querySelector('[class*="
|
|
23
|
+
const badge = container.querySelector('[class*="accent-danger"]');
|
|
24
24
|
expect(badge).toBeInTheDocument();
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
test('renders invited status with
|
|
27
|
+
test('renders invited status with brand styling', () => {
|
|
28
28
|
const { container } = render(ChatStatusBadge, { props: { status: 'invited' } });
|
|
29
29
|
expect(screen.getByText(/invited/i)).toBeInTheDocument();
|
|
30
|
-
const badge = container.querySelector('[class*="
|
|
30
|
+
const badge = container.querySelector('[class*="brand-primary"]');
|
|
31
31
|
expect(badge).toBeInTheDocument();
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
test('renders unknown status with
|
|
34
|
+
test('renders unknown status with muted styling', () => {
|
|
35
35
|
const { container } = render(ChatStatusBadge, { props: { status: 'pending' } });
|
|
36
36
|
expect(screen.getByText(/pending/i)).toBeInTheDocument();
|
|
37
|
-
const badge = container.querySelector('[class*="
|
|
37
|
+
const badge = container.querySelector('[class*="bg-muted"]');
|
|
38
38
|
expect(badge).toBeInTheDocument();
|
|
39
39
|
});
|
|
40
40
|
|
|
@@ -41,27 +41,27 @@
|
|
|
41
41
|
switch (s?.toLowerCase()) {
|
|
42
42
|
case 'confirmed':
|
|
43
43
|
return {
|
|
44
|
-
textColor: 'text-
|
|
45
|
-
bgColor: 'bg-
|
|
44
|
+
textColor: 'text-accent-success',
|
|
45
|
+
bgColor: 'bg-status-success-bg',
|
|
46
46
|
icon: CheckmarkFilled,
|
|
47
47
|
};
|
|
48
48
|
case 'declined':
|
|
49
49
|
case 'canceled':
|
|
50
50
|
return {
|
|
51
|
-
textColor: 'text-
|
|
52
|
-
bgColor: 'bg-
|
|
51
|
+
textColor: 'text-accent-danger',
|
|
52
|
+
bgColor: 'bg-status-error-bg',
|
|
53
53
|
icon: CloseFilled,
|
|
54
54
|
};
|
|
55
55
|
case 'invited':
|
|
56
56
|
return {
|
|
57
|
-
textColor: 'text-
|
|
58
|
-
bgColor: 'bg-
|
|
57
|
+
textColor: 'text-brand-primary',
|
|
58
|
+
bgColor: 'bg-status-info-bg',
|
|
59
59
|
icon: SendAltFilled,
|
|
60
60
|
};
|
|
61
61
|
default:
|
|
62
62
|
return {
|
|
63
|
-
textColor: 'text-
|
|
64
|
-
bgColor: 'bg-
|
|
63
|
+
textColor: 'text-text-secondary',
|
|
64
|
+
bgColor: 'bg-muted',
|
|
65
65
|
icon: null,
|
|
66
66
|
};
|
|
67
67
|
}
|
|
@@ -48,28 +48,28 @@ describe('ChatStatusTransition', () => {
|
|
|
48
48
|
expect(svgs.length).toBe(0);
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
test('confirmed from shows
|
|
51
|
+
test('confirmed from shows success color', () => {
|
|
52
52
|
const { container } = render(ChatStatusTransition, {
|
|
53
53
|
props: { fromStatus: 'confirmed', toStatus: 'declined' }
|
|
54
54
|
});
|
|
55
|
-
const
|
|
56
|
-
expect(
|
|
55
|
+
const success = container.querySelector('[class*="accent-success"]');
|
|
56
|
+
expect(success).toBeInTheDocument();
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
test('declined to shows
|
|
59
|
+
test('declined to shows danger color', () => {
|
|
60
60
|
const { container } = render(ChatStatusTransition, {
|
|
61
61
|
props: { fromStatus: 'confirmed', toStatus: 'declined' }
|
|
62
62
|
});
|
|
63
|
-
const
|
|
64
|
-
expect(
|
|
63
|
+
const danger = container.querySelector('[class*="accent-danger"]');
|
|
64
|
+
expect(danger).toBeInTheDocument();
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
-
test('invited status shows
|
|
67
|
+
test('invited status shows brand color', () => {
|
|
68
68
|
const { container } = render(ChatStatusTransition, {
|
|
69
69
|
props: { fromStatus: 'invited', toStatus: 'confirmed' }
|
|
70
70
|
});
|
|
71
|
-
const
|
|
72
|
-
expect(
|
|
71
|
+
const brand = container.querySelector('[class*="brand-primary"]');
|
|
72
|
+
expect(brand).toBeInTheDocument();
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
test('applies custom className', () => {
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
function getStatusStyle(status: string): StatusStyle {
|
|
35
35
|
switch (status?.toLowerCase()) {
|
|
36
36
|
case 'confirmed':
|
|
37
|
-
return { color: 'text-
|
|
37
|
+
return { color: 'text-accent-success', icon: CheckmarkFilled };
|
|
38
38
|
case 'declined':
|
|
39
39
|
case 'canceled':
|
|
40
|
-
return { color: 'text-
|
|
40
|
+
return { color: 'text-accent-danger', icon: CloseFilled };
|
|
41
41
|
case 'invited':
|
|
42
|
-
return { color: 'text-
|
|
42
|
+
return { color: 'text-brand-primary', icon: SendAltFilled };
|
|
43
43
|
default:
|
|
44
|
-
return { color: 'text-
|
|
44
|
+
return { color: 'text-text-secondary', icon: null };
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<FromIcon class="w-3 h-3 {fromStyle.color}" />
|
|
56
56
|
{/if}
|
|
57
57
|
<span class={fromStyle.color}>{fromStatus}</span>
|
|
58
|
-
<span class="text-
|
|
58
|
+
<span class="text-muted-foreground mx-1">→</span>
|
|
59
59
|
{#if toStyle.icon}
|
|
60
60
|
{@const ToIcon = toStyle.icon}
|
|
61
61
|
<ToIcon class="w-3 h-3 {toStyle.color}" />
|
|
@@ -8,14 +8,14 @@ describe('ChatTextBubble', () => {
|
|
|
8
8
|
expect(container.querySelector('.rounded-bl-sm')).toBeInTheDocument();
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
test('inbound has
|
|
11
|
+
test('inbound has muted background', () => {
|
|
12
12
|
const { container } = render(ChatTextBubble, { props: { direction: 'inbound' } });
|
|
13
|
-
expect(container.querySelector('[class*="
|
|
13
|
+
expect(container.querySelector('[class*="bg-muted"]')).toBeInTheDocument();
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
test('outbound has
|
|
16
|
+
test('outbound has brand-primary background', () => {
|
|
17
17
|
const { container } = render(ChatTextBubble, { props: { direction: 'outbound' } });
|
|
18
|
-
expect(container.querySelector('[class*="
|
|
18
|
+
expect(container.querySelector('[class*="brand-primary"]')).toBeInTheDocument();
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
test('outbound has rounded-br-sm', () => {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
classNames(
|
|
30
30
|
'px-4 py-2.5 rounded-2xl text-sm',
|
|
31
31
|
isOutbound
|
|
32
|
-
? 'bg-
|
|
33
|
-
: 'bg-
|
|
32
|
+
? 'bg-brand-primary text-white rounded-br-sm'
|
|
33
|
+
: 'bg-muted text-text-primary rounded-bl-sm',
|
|
34
34
|
className
|
|
35
35
|
)
|
|
36
36
|
);
|
|
@@ -26,27 +26,27 @@ describe('DataList Dividers', () => {
|
|
|
26
26
|
const { container } = render(DataList);
|
|
27
27
|
const list = container.querySelector('ul');
|
|
28
28
|
expect(list).toHaveClass('divide-y');
|
|
29
|
-
expect(list).toHaveClass('divide-
|
|
29
|
+
expect(list).toHaveClass('divide-border');
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
test('dividers=true shows divide classes', () => {
|
|
33
33
|
const { container } = render(DataList, { props: { dividers: true } });
|
|
34
34
|
const list = container.querySelector('ul');
|
|
35
35
|
expect(list).toHaveClass('divide-y');
|
|
36
|
-
expect(list).toHaveClass('divide-
|
|
36
|
+
expect(list).toHaveClass('divide-border');
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
test('dividers=false removes divide classes', () => {
|
|
40
40
|
const { container } = render(DataList, { props: { dividers: false } });
|
|
41
41
|
const list = container.querySelector('ul');
|
|
42
42
|
expect(list).not.toHaveClass('divide-y');
|
|
43
|
-
expect(list).not.toHaveClass('divide-
|
|
43
|
+
expect(list).not.toHaveClass('divide-border');
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
test('dividers
|
|
46
|
+
test('dividers use token-based border class', () => {
|
|
47
47
|
const { container } = render(DataList, { props: { dividers: true } });
|
|
48
48
|
const list = container.querySelector('ul');
|
|
49
|
-
expect(list).toHaveClass('
|
|
49
|
+
expect(list).toHaveClass('divide-border');
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
52
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
} = $props();
|
|
9
9
|
|
|
10
10
|
let gapClass = $derived(gap > 0 ? `space-y-${gap}` : '');
|
|
11
|
-
let dividerClass = $derived(dividers && gap === 0 ? 'divide-y divide-
|
|
11
|
+
let dividerClass = $derived(dividers && gap === 0 ? 'divide-y divide-border' : '');
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<ul class="{dividerClass} {gapClass} {className}" role="list">
|