@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
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
<Story name="Group">
|
|
34
34
|
{#snippet template()}
|
|
35
35
|
<div class="space-y-3">
|
|
36
|
-
<p class="text-sm font-medium text-
|
|
36
|
+
<p class="text-sm font-medium text-text-secondary">Select size:</p>
|
|
37
37
|
<Radio name="size" value="sm" label="Small" bind:group={selectedSize} />
|
|
38
38
|
<Radio name="size" value="md" label="Medium" bind:group={selectedSize} />
|
|
39
39
|
<Radio name="size" value="lg" label="Large" bind:group={selectedSize} />
|
|
40
|
-
<p class="text-xs text-
|
|
40
|
+
<p class="text-xs text-muted-foreground mt-2">Selected: {selectedSize}</p>
|
|
41
41
|
</div>
|
|
42
42
|
{/snippet}
|
|
43
43
|
</Story>
|
|
@@ -55,13 +55,13 @@
|
|
|
55
55
|
<Story name="Pricing Plans">
|
|
56
56
|
{#snippet template()}
|
|
57
57
|
<div class="space-y-3">
|
|
58
|
-
<p class="text-sm font-medium text-
|
|
58
|
+
<p class="text-sm font-medium text-text-secondary">Choose your plan:</p>
|
|
59
59
|
<div class="space-y-2">
|
|
60
60
|
<Radio name="plan" value="basic" label="Basic - Free" bind:group={selectedPlan} />
|
|
61
61
|
<Radio name="plan" value="pro" label="Pro - $29/month" bind:group={selectedPlan} />
|
|
62
62
|
<Radio name="plan" value="enterprise" label="Enterprise - Contact us" bind:group={selectedPlan} />
|
|
63
63
|
</div>
|
|
64
|
-
<p class="text-xs text-
|
|
64
|
+
<p class="text-xs text-muted-foreground mt-2">Selected plan: {selectedPlan}</p>
|
|
65
65
|
</div>
|
|
66
66
|
{/snippet}
|
|
67
67
|
</Story>
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
<Story name="Horizontal Layout">
|
|
70
70
|
{#snippet template()}
|
|
71
71
|
<div class="space-y-2">
|
|
72
|
-
<p class="text-sm font-medium text-
|
|
72
|
+
<p class="text-sm font-medium text-text-secondary">Payment method:</p>
|
|
73
73
|
<div class="flex gap-6">
|
|
74
74
|
<Radio name="payment" value="card" label="Credit Card" />
|
|
75
75
|
<Radio name="payment" value="paypal" label="PayPal" />
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const colorClasses = {
|
|
38
|
-
blue: 'text-
|
|
39
|
-
red: 'text-
|
|
40
|
-
green: 'text-
|
|
41
|
-
purple: 'text-
|
|
42
|
-
orange: 'text-
|
|
43
|
-
yellow: 'text-
|
|
38
|
+
blue: 'text-brand-primary',
|
|
39
|
+
red: 'text-accent-danger',
|
|
40
|
+
green: 'text-accent-success',
|
|
41
|
+
purple: 'text-brand-primary',
|
|
42
|
+
orange: 'text-accent-warning',
|
|
43
|
+
yellow: 'text-accent-warning'
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
let colorClass = $derived(colorClasses[color] || colorClasses.blue);
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
{disabled}
|
|
58
58
|
checked={isChecked}
|
|
59
59
|
onchange={handleChange}
|
|
60
|
-
class="w-4 h-4 bg-
|
|
60
|
+
class="w-4 h-4 bg-muted border-stroke-primary focus:outline-hidden {colorClass}"
|
|
61
61
|
/>
|
|
62
62
|
{#if children}
|
|
63
|
-
<span class="text-sm font-medium text-
|
|
63
|
+
<span class="text-sm font-medium text-text-primary">
|
|
64
64
|
{@render children()}
|
|
65
65
|
</span>
|
|
66
66
|
{/if}
|
|
@@ -60,15 +60,15 @@
|
|
|
60
60
|
|
|
61
61
|
// Simple mode (no type): rounded with blue hover
|
|
62
62
|
const simpleBaseClasses = 'w-full text-left rounded-lg font-medium leading-none focus:outline-hidden transition-all duration-150 ease-out select-none';
|
|
63
|
-
const simpleDefaultClasses = 'text-
|
|
64
|
-
const simpleSelectedClasses = 'text-
|
|
63
|
+
const simpleDefaultClasses = 'text-text-primary bg-transparent border-transparent hover:bg-status-info-bg focus:bg-status-info-bg';
|
|
64
|
+
const simpleSelectedClasses = 'text-text-primary bg-status-info-bg';
|
|
65
65
|
|
|
66
66
|
// Typed mode (with type): colored left border, gray hover
|
|
67
67
|
const typedBaseClasses = 'w-full text-left font-medium leading-none focus:outline-hidden transition-all duration-150 ease-out select-none border-l-3';
|
|
68
|
-
const typedDefaultClasses = 'text-
|
|
69
|
-
const typedSelectedClasses = 'text-
|
|
68
|
+
const typedDefaultClasses = 'text-text-primary bg-transparent hover:bg-bg-secondary hover:border-l-4';
|
|
69
|
+
const typedSelectedClasses = 'text-text-primary bg-primary-100 border-l-primary-600 border-l-4';
|
|
70
70
|
|
|
71
|
-
const disabledClasses = 'text-
|
|
71
|
+
const disabledClasses = 'text-muted-foreground cursor-not-allowed';
|
|
72
72
|
|
|
73
73
|
let sizeClass = $derived(buttonMenuItemSizes[size] || buttonMenuItemSizes.md);
|
|
74
74
|
let hasTrailing = $derived(typeof trailing === 'function' || trailing);
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
}: Props = $props();
|
|
33
33
|
|
|
34
34
|
const baseClasses = 'w-6 h-7 inline-flex items-center justify-center rounded-lg font-medium leading-none focus:outline-hidden transition-all duration-150 ease-out select-none';
|
|
35
|
-
const defaultClasses = 'text-
|
|
36
|
-
const disabledClasses = 'bg-
|
|
35
|
+
const defaultClasses = 'text-text-primary bg-status-info-bg border border-status-info-border hover:bg-status-info-bg/80 shadow-lg';
|
|
36
|
+
const disabledClasses = 'bg-bg-tertiary border-border text-muted-foreground cursor-not-allowed';
|
|
37
37
|
|
|
38
38
|
let classes = $derived(twMerge(
|
|
39
39
|
baseClasses,
|
|
@@ -121,7 +121,7 @@ describe('CardPlaceholder Styling', () => {
|
|
|
121
121
|
const { container } = render(CardPlaceholder);
|
|
122
122
|
const wrapper = container.querySelector('[role="status"]');
|
|
123
123
|
expect(wrapper).toHaveClass('border');
|
|
124
|
-
expect(wrapper).toHaveClass('border-
|
|
124
|
+
expect(wrapper).toHaveClass('border-border');
|
|
125
125
|
});
|
|
126
126
|
|
|
127
127
|
test('has rounded corners', () => {
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
|
|
50
50
|
<div
|
|
51
51
|
role="status"
|
|
52
|
-
class="{cardWidthClass} p-4 border border-
|
|
52
|
+
class="{cardWidthClass} p-4 border border-border rounded-lg shadow {animateClass} {className}"
|
|
53
53
|
aria-label={labels.loadingCard}
|
|
54
54
|
{...restProps}
|
|
55
55
|
>
|
|
56
56
|
{#if showImage}
|
|
57
|
-
<div class="flex items-center justify-center {imageHeightClass} mb-4 bg-
|
|
57
|
+
<div class="flex items-center justify-center {imageHeightClass} mb-4 bg-bg-quaternary rounded-lg">
|
|
58
58
|
<svg
|
|
59
|
-
class="w-10 h-10 text-
|
|
59
|
+
class="w-10 h-10 text-text-tertiary"
|
|
60
60
|
aria-hidden="true"
|
|
61
61
|
xmlns="http://www.w3.org/2000/svg"
|
|
62
62
|
fill="currentColor"
|
|
@@ -68,16 +68,16 @@
|
|
|
68
68
|
</div>
|
|
69
69
|
{/if}
|
|
70
70
|
|
|
71
|
-
<div class="h-2.5 bg-
|
|
72
|
-
<div class="h-2 bg-
|
|
73
|
-
<div class="h-2 bg-
|
|
74
|
-
<div class="h-2 bg-
|
|
75
|
-
<div class="h-2 bg-
|
|
71
|
+
<div class="h-2.5 bg-bg-tertiary rounded-full w-48 mb-4"></div>
|
|
72
|
+
<div class="h-2 bg-bg-tertiary rounded-full mb-2.5"></div>
|
|
73
|
+
<div class="h-2 bg-bg-tertiary rounded-full max-w-80 mb-2.5"></div>
|
|
74
|
+
<div class="h-2 bg-bg-tertiary rounded-full max-w-72 mb-2.5"></div>
|
|
75
|
+
<div class="h-2 bg-bg-tertiary rounded-full max-w-sm"></div>
|
|
76
76
|
|
|
77
77
|
{#if showAvatar}
|
|
78
78
|
<div class="flex items-center mt-4">
|
|
79
79
|
<svg
|
|
80
|
-
class="w-8 h-8 text-
|
|
80
|
+
class="w-8 h-8 text-text-tertiary me-3"
|
|
81
81
|
aria-hidden="true"
|
|
82
82
|
xmlns="http://www.w3.org/2000/svg"
|
|
83
83
|
fill="currentColor"
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
<path d="M10 0a10 10 0 1 0 10 10A10.011 10.011 0 0 0 10 0Zm0 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm0 13a8.949 8.949 0 0 1-4.951-1.488A3.987 3.987 0 0 1 9 13h2a3.987 3.987 0 0 1 3.951 3.512A8.949 8.949 0 0 1 10 18Z"/>
|
|
87
87
|
</svg>
|
|
88
88
|
<div>
|
|
89
|
-
<div class="h-2.5 bg-
|
|
90
|
-
<div class="h-2 bg-
|
|
89
|
+
<div class="h-2.5 bg-bg-tertiary rounded-full w-32 mb-2"></div>
|
|
90
|
+
<div class="h-2 bg-bg-tertiary rounded-full w-48"></div>
|
|
91
91
|
</div>
|
|
92
92
|
</div>
|
|
93
93
|
{/if}
|
|
@@ -87,7 +87,7 @@ describe('ImagePlaceholder ShowText', () => {
|
|
|
87
87
|
test('showText is false by default', () => {
|
|
88
88
|
const { container } = render(ImagePlaceholder);
|
|
89
89
|
// Count placeholder text bars - should only have the sr-only one
|
|
90
|
-
const textBars = container.querySelectorAll('.rounded-full.bg-
|
|
90
|
+
const textBars = container.querySelectorAll('.rounded-full.bg-bg-tertiary');
|
|
91
91
|
expect(textBars.length).toBe(0);
|
|
92
92
|
});
|
|
93
93
|
|
|
@@ -103,7 +103,7 @@ describe('ImagePlaceholder Styling', () => {
|
|
|
103
103
|
test('image container has gray background', () => {
|
|
104
104
|
const { container } = render(ImagePlaceholder);
|
|
105
105
|
const imageContainer = container.querySelector('.flex.items-center.justify-center');
|
|
106
|
-
expect(imageContainer).toHaveClass('bg-
|
|
106
|
+
expect(imageContainer).toHaveClass('bg-bg-quaternary');
|
|
107
107
|
});
|
|
108
108
|
|
|
109
109
|
test('image container has rounded corners', () => {
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
aria-label={labels.loadingImage}
|
|
43
43
|
{...restProps}
|
|
44
44
|
>
|
|
45
|
-
<div class="flex items-center justify-center w-full {imageHeightClass} bg-
|
|
45
|
+
<div class="flex items-center justify-center w-full {imageHeightClass} bg-bg-quaternary rounded-lg">
|
|
46
46
|
<svg
|
|
47
|
-
class="w-10 h-10 text-
|
|
47
|
+
class="w-10 h-10 text-text-tertiary"
|
|
48
48
|
aria-hidden="true"
|
|
49
49
|
xmlns="http://www.w3.org/2000/svg"
|
|
50
50
|
fill="currentColor"
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
|
|
57
57
|
{#if showText}
|
|
58
58
|
<div class="mt-4">
|
|
59
|
-
<div class="h-2.5 bg-
|
|
60
|
-
<div class="h-2 bg-
|
|
61
|
-
<div class="h-2 bg-
|
|
62
|
-
<div class="h-2 bg-
|
|
63
|
-
<div class="h-2 bg-
|
|
59
|
+
<div class="h-2.5 bg-bg-tertiary rounded-full w-48 mb-4"></div>
|
|
60
|
+
<div class="h-2 bg-bg-tertiary rounded-full max-w-lg mb-2.5"></div>
|
|
61
|
+
<div class="h-2 bg-bg-tertiary rounded-full mb-2.5"></div>
|
|
62
|
+
<div class="h-2 bg-bg-tertiary rounded-full max-w-md mb-2.5"></div>
|
|
63
|
+
<div class="h-2 bg-bg-tertiary rounded-full max-w-md"></div>
|
|
64
64
|
</div>
|
|
65
65
|
{/if}
|
|
66
66
|
|
|
@@ -168,14 +168,14 @@ describe('ListPlaceholder Styling', () => {
|
|
|
168
168
|
const { container } = render(ListPlaceholder);
|
|
169
169
|
const wrapper = container.querySelector('[role="status"]');
|
|
170
170
|
expect(wrapper).toHaveClass('border');
|
|
171
|
-
expect(wrapper).toHaveClass('border-
|
|
171
|
+
expect(wrapper).toHaveClass('border-border');
|
|
172
172
|
});
|
|
173
173
|
|
|
174
174
|
test('has dividers between items', () => {
|
|
175
175
|
const { container } = render(ListPlaceholder);
|
|
176
176
|
const wrapper = container.querySelector('[role="status"]');
|
|
177
177
|
expect(wrapper).toHaveClass('divide-y');
|
|
178
|
-
expect(wrapper).toHaveClass('divide-
|
|
178
|
+
expect(wrapper).toHaveClass('divide-border');
|
|
179
179
|
});
|
|
180
180
|
|
|
181
181
|
test('has rounded corners', () => {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
<div
|
|
53
53
|
role="status"
|
|
54
|
-
class="{containerWidthClass} p-4 space-y-4 border border-
|
|
54
|
+
class="{containerWidthClass} p-4 space-y-4 border border-border divide-y divide-border rounded-lg shadow {animateClass} {className}"
|
|
55
55
|
aria-label={labels.loadingList}
|
|
56
56
|
{...restProps}
|
|
57
57
|
>
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
<div class="flex items-center">
|
|
61
61
|
{#if showIcon}
|
|
62
62
|
<svg
|
|
63
|
-
class="{iconSizeClass} text-
|
|
63
|
+
class="{iconSizeClass} text-text-tertiary me-3"
|
|
64
64
|
aria-hidden="true"
|
|
65
65
|
xmlns="http://www.w3.org/2000/svg"
|
|
66
66
|
fill="currentColor"
|
|
@@ -70,13 +70,13 @@
|
|
|
70
70
|
</svg>
|
|
71
71
|
{/if}
|
|
72
72
|
<div>
|
|
73
|
-
<div class="h-2.5 bg-
|
|
74
|
-
<div class="h-2 bg-
|
|
73
|
+
<div class="h-2.5 bg-bg-quaternary rounded-full w-24 mb-2.5"></div>
|
|
74
|
+
<div class="h-2 bg-bg-tertiary rounded-full w-32"></div>
|
|
75
75
|
</div>
|
|
76
76
|
</div>
|
|
77
77
|
|
|
78
78
|
{#if showAction}
|
|
79
|
-
<div class="h-2.5 bg-
|
|
79
|
+
<div class="h-2.5 bg-bg-quaternary rounded-full w-12"></div>
|
|
80
80
|
{/if}
|
|
81
81
|
</div>
|
|
82
82
|
{/each}
|
|
@@ -35,19 +35,19 @@ describe('Skeleton Component', () => {
|
|
|
35
35
|
describe('Skeleton Lines', () => {
|
|
36
36
|
test('defaults to 3 lines', () => {
|
|
37
37
|
const { container } = render(Skeleton);
|
|
38
|
-
const lines = container.querySelectorAll('.rounded-full.bg-
|
|
38
|
+
const lines = container.querySelectorAll('.rounded-full.bg-bg-tertiary');
|
|
39
39
|
expect(lines.length).toBe(3);
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
test('renders custom number of lines', () => {
|
|
43
43
|
const { container } = render(Skeleton, { props: { lines: 5 } });
|
|
44
|
-
const lineElements = container.querySelectorAll('.rounded-full.bg-
|
|
44
|
+
const lineElements = container.querySelectorAll('.rounded-full.bg-bg-tertiary');
|
|
45
45
|
expect(lineElements.length).toBe(5);
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
test('renders 1 line when lines=1', () => {
|
|
49
49
|
const { container } = render(Skeleton, { props: { lines: 1 } });
|
|
50
|
-
const lineElements = container.querySelectorAll('.rounded-full.bg-
|
|
50
|
+
const lineElements = container.querySelectorAll('.rounded-full.bg-bg-tertiary');
|
|
51
51
|
expect(lineElements.length).toBe(1);
|
|
52
52
|
});
|
|
53
53
|
|
|
@@ -59,19 +59,19 @@ describe('Skeleton Lines', () => {
|
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
test('lines have bg-
|
|
62
|
+
test('lines have bg-bg-tertiary background', () => {
|
|
63
63
|
const { container } = render(Skeleton);
|
|
64
64
|
const lines = container.querySelectorAll('[role="status"] > div');
|
|
65
65
|
lines.forEach(line => {
|
|
66
|
-
expect(line).toHaveClass('bg-
|
|
66
|
+
expect(line).toHaveClass('bg-bg-tertiary');
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
test('lines have
|
|
70
|
+
test('lines have token-based background', () => {
|
|
71
71
|
const { container } = render(Skeleton);
|
|
72
72
|
const lines = container.querySelectorAll('[role="status"] > div');
|
|
73
73
|
lines.forEach(line => {
|
|
74
|
-
expect(line).toHaveClass('
|
|
74
|
+
expect(line).toHaveClass('bg-bg-tertiary');
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
77
|
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
{#snippet template()}
|
|
125
125
|
<div class="space-y-8">
|
|
126
126
|
<div>
|
|
127
|
-
<h3 class="text-sm font-medium text-
|
|
127
|
+
<h3 class="text-sm font-medium text-text-secondary mb-3">Basic Skeleton</h3>
|
|
128
128
|
<div class="space-y-2 max-w-md">
|
|
129
129
|
<Skeleton class="h-4 w-full" />
|
|
130
130
|
<Skeleton class="h-4 w-3/4" />
|
|
@@ -134,15 +134,15 @@
|
|
|
134
134
|
|
|
135
135
|
<div class="grid grid-cols-3 gap-6">
|
|
136
136
|
<div>
|
|
137
|
-
<h3 class="text-sm font-medium text-
|
|
137
|
+
<h3 class="text-sm font-medium text-text-secondary mb-3">Image Placeholder</h3>
|
|
138
138
|
<ImagePlaceholder />
|
|
139
139
|
</div>
|
|
140
140
|
<div>
|
|
141
|
-
<h3 class="text-sm font-medium text-
|
|
141
|
+
<h3 class="text-sm font-medium text-text-secondary mb-3">Card Placeholder</h3>
|
|
142
142
|
<CardPlaceholder />
|
|
143
143
|
</div>
|
|
144
144
|
<div>
|
|
145
|
-
<h3 class="text-sm font-medium text-
|
|
145
|
+
<h3 class="text-sm font-medium text-text-secondary mb-3">List Placeholder</h3>
|
|
146
146
|
<ListPlaceholder />
|
|
147
147
|
</div>
|
|
148
148
|
</div>
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
>
|
|
49
49
|
{#each Array(lines) as _, i}
|
|
50
50
|
<div
|
|
51
|
-
class="{heightClass} bg-
|
|
51
|
+
class="{heightClass} bg-bg-tertiary rounded-full {widthPatterns[i % widthPatterns.length]} {i < lines - 1 ? 'mb-2.5' : ''}"
|
|
52
52
|
></div>
|
|
53
53
|
{/each}
|
|
54
54
|
<span class="sr-only">{labels.loading}</span>
|
|
@@ -44,17 +44,16 @@ describe("Spinner Component Tests", () => {
|
|
|
44
44
|
expect(svg).toHaveAttribute("viewBox", "0 0 100 101");
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
test("Has
|
|
47
|
+
test("Has text color classes", () => {
|
|
48
48
|
const { container } = render(Spinner);
|
|
49
49
|
const svg = container.querySelector("svg");
|
|
50
|
-
expect(svg).toHaveClass("text-
|
|
51
|
-
expect(svg).toHaveClass("dark:text-gray-600");
|
|
50
|
+
expect(svg).toHaveClass("text-text-tertiary");
|
|
52
51
|
});
|
|
53
52
|
|
|
54
53
|
test("Has default blue fill color", () => {
|
|
55
54
|
const { container } = render(Spinner);
|
|
56
55
|
const svg = container.querySelector("svg");
|
|
57
|
-
expect(svg).toHaveClass("fill-
|
|
56
|
+
expect(svg).toHaveClass("fill-brand-primary");
|
|
58
57
|
});
|
|
59
58
|
|
|
60
59
|
test("Accepts custom class", () => {
|
|
@@ -79,6 +78,6 @@ describe("Spinner Component Tests", () => {
|
|
|
79
78
|
test("Falls back to blue color when an invalid color is provided", () => {
|
|
80
79
|
const { container } = render(Spinner, { color: "invalid-color" });
|
|
81
80
|
const svg = container.querySelector("svg");
|
|
82
|
-
expect(svg).toHaveClass("fill-
|
|
81
|
+
expect(svg).toHaveClass("fill-brand-primary");
|
|
83
82
|
});
|
|
84
83
|
});
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
</Story>
|
|
17
17
|
|
|
18
18
|
<Story name="Spinner in Container">
|
|
19
|
-
<div class="flex items-center justify-center h-40 bg-
|
|
19
|
+
<div class="flex items-center justify-center h-40 bg-muted rounded-lg">
|
|
20
20
|
<Spinner />
|
|
21
21
|
</div>
|
|
22
22
|
</Story>
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
<Story name="Spinner with Text">
|
|
25
25
|
<div class="flex flex-col items-center gap-4">
|
|
26
26
|
<Spinner />
|
|
27
|
-
<p class="text-
|
|
27
|
+
<p class="text-muted-foreground">Loading data...</p>
|
|
28
28
|
</div>
|
|
29
29
|
</Story>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
<svg
|
|
35
35
|
aria-hidden="true"
|
|
36
|
-
class="{sizeClass} text-
|
|
36
|
+
class="{sizeClass} text-text-tertiary animate-spin {colorClass} {className}"
|
|
37
37
|
viewBox="0 0 100 101"
|
|
38
38
|
fill="none"
|
|
39
39
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -42,7 +42,7 @@ describe('Tabs Styles - Underline', () => {
|
|
|
42
42
|
const { container } = render(Tabs, { props: { tabStyle: 'underline' } });
|
|
43
43
|
const tablist = container.querySelector('ul[role="tablist"]');
|
|
44
44
|
expect(tablist).toHaveClass('border-b');
|
|
45
|
-
expect(tablist).toHaveClass('border-
|
|
45
|
+
expect(tablist).toHaveClass('border-border');
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
test('underline style has -mb-px class', () => {
|
|
@@ -77,7 +77,7 @@ describe('Tabs Styles - Full', () => {
|
|
|
77
77
|
const { container } = render(Tabs, { props: { tabStyle: 'full' } });
|
|
78
78
|
const tablist = container.querySelector('ul[role="tablist"]');
|
|
79
79
|
expect(tablist).toHaveClass('divide-x');
|
|
80
|
-
expect(tablist).toHaveClass('divide-
|
|
80
|
+
expect(tablist).toHaveClass('divide-border');
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
test('full style has rounded-lg class', () => {
|
|
@@ -151,17 +151,17 @@ describe('Tabs Accessibility', () => {
|
|
|
151
151
|
});
|
|
152
152
|
});
|
|
153
153
|
|
|
154
|
-
describe('Tabs
|
|
155
|
-
test('underline has
|
|
154
|
+
describe('Tabs Token-Based Styling', () => {
|
|
155
|
+
test('underline has token-based border class', () => {
|
|
156
156
|
const { container } = render(Tabs, { props: { tabStyle: 'underline' } });
|
|
157
157
|
const tablist = container.querySelector('ul[role="tablist"]');
|
|
158
|
-
expect(tablist).toHaveClass('
|
|
158
|
+
expect(tablist).toHaveClass('border-border');
|
|
159
159
|
});
|
|
160
160
|
|
|
161
|
-
test('full style has
|
|
161
|
+
test('full style has token-based divide class', () => {
|
|
162
162
|
const { container } = render(Tabs, { props: { tabStyle: 'full' } });
|
|
163
163
|
const tablist = container.querySelector('ul[role="tablist"]');
|
|
164
|
-
expect(tablist).toHaveClass('
|
|
164
|
+
expect(tablist).toHaveClass('divide-border');
|
|
165
165
|
});
|
|
166
166
|
});
|
|
167
167
|
|
|
@@ -254,13 +254,13 @@ describe('Tabs with TabItems - registerTab functionality', () => {
|
|
|
254
254
|
const buttons = container.querySelectorAll('button[role="tab"]');
|
|
255
255
|
|
|
256
256
|
// Active tab should have pills active classes
|
|
257
|
-
expect(buttons[0]).toHaveClass('bg-
|
|
257
|
+
expect(buttons[0]).toHaveClass('bg-brand-primary');
|
|
258
258
|
expect(buttons[0]).toHaveClass('text-white');
|
|
259
259
|
expect(buttons[0]).toHaveClass('rounded-lg');
|
|
260
260
|
|
|
261
261
|
// Inactive tabs should have pills inactive classes
|
|
262
262
|
expect(buttons[1]).toHaveClass('rounded-lg');
|
|
263
|
-
expect(buttons[1]).not.toHaveClass('bg-
|
|
263
|
+
expect(buttons[1]).not.toHaveClass('bg-brand-primary');
|
|
264
264
|
});
|
|
265
265
|
|
|
266
266
|
test('pills style inactive tab hover state', async () => {
|
|
@@ -272,8 +272,8 @@ describe('Tabs with TabItems - registerTab functionality', () => {
|
|
|
272
272
|
|
|
273
273
|
// Check that inactive button has hover classes in its className
|
|
274
274
|
const inactiveButton = buttons[1];
|
|
275
|
-
expect(inactiveButton.className).toContain('hover:text-
|
|
276
|
-
expect(inactiveButton.className).toContain('hover:bg-
|
|
275
|
+
expect(inactiveButton.className).toContain('hover:text-text-primary');
|
|
276
|
+
expect(inactiveButton.className).toContain('hover:bg-muted');
|
|
277
277
|
});
|
|
278
278
|
|
|
279
279
|
test('full style applies correct classes', async () => {
|
|
@@ -285,11 +285,11 @@ describe('Tabs with TabItems - registerTab functionality', () => {
|
|
|
285
285
|
|
|
286
286
|
// Active tab should have full active classes
|
|
287
287
|
expect(buttons[0]).toHaveClass('w-full');
|
|
288
|
-
expect(buttons[0]).toHaveClass('bg-
|
|
289
|
-
expect(buttons[0]).toHaveClass('text-
|
|
288
|
+
expect(buttons[0]).toHaveClass('bg-muted');
|
|
289
|
+
expect(buttons[0]).toHaveClass('text-text-primary');
|
|
290
290
|
|
|
291
291
|
// Inactive tabs should have full inactive classes
|
|
292
292
|
expect(buttons[1]).toHaveClass('w-full');
|
|
293
|
-
expect(buttons[1]).toHaveClass('bg-
|
|
293
|
+
expect(buttons[1]).toHaveClass('bg-card');
|
|
294
294
|
});
|
|
295
295
|
});
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
<TabItem title="Profile">
|
|
26
26
|
<div class="p-4">
|
|
27
27
|
<h3 class="font-medium mb-2">Profile Settings</h3>
|
|
28
|
-
<p class="text-
|
|
28
|
+
<p class="text-text-secondary">Manage your profile information and preferences.</p>
|
|
29
29
|
</div>
|
|
30
30
|
</TabItem>
|
|
31
31
|
<TabItem title="Account">
|
|
32
32
|
<div class="p-4">
|
|
33
33
|
<h3 class="font-medium mb-2">Account Settings</h3>
|
|
34
|
-
<p class="text-
|
|
34
|
+
<p class="text-text-secondary">Manage your account security and billing.</p>
|
|
35
35
|
</div>
|
|
36
36
|
</TabItem>
|
|
37
37
|
<TabItem title="Notifications">
|
|
38
38
|
<div class="p-4">
|
|
39
39
|
<h3 class="font-medium mb-2">Notification Settings</h3>
|
|
40
|
-
<p class="text-
|
|
40
|
+
<p class="text-text-secondary">Configure how you receive notifications.</p>
|
|
41
41
|
</div>
|
|
42
42
|
</TabItem>
|
|
43
43
|
</Tabs>
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<Story name="Controlled">
|
|
48
48
|
{#snippet template()}
|
|
49
49
|
<div>
|
|
50
|
-
<p class="text-sm text-
|
|
50
|
+
<p class="text-sm text-muted-foreground mb-4">Active tab: {activeTab}</p>
|
|
51
51
|
<Tabs bind:activeTab={activeTab}>
|
|
52
52
|
<TabItem title="Tab 1">
|
|
53
53
|
<div class="p-4">Content for Tab 1</div>
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
</Tabs>
|
|
62
62
|
<div class="mt-4 flex gap-2">
|
|
63
63
|
<button
|
|
64
|
-
class="px-3 py-1 bg-
|
|
64
|
+
class="px-3 py-1 bg-bg-tertiary rounded text-sm"
|
|
65
65
|
onclick={() => activeTab = 0}
|
|
66
66
|
>Go to Tab 1</button>
|
|
67
67
|
<button
|
|
68
|
-
class="px-3 py-1 bg-
|
|
68
|
+
class="px-3 py-1 bg-bg-tertiary rounded text-sm"
|
|
69
69
|
onclick={() => activeTab = 2}
|
|
70
70
|
>Go to Tab 3</button>
|
|
71
71
|
</div>
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
|
|
85
85
|
// Tab list classes by style
|
|
86
86
|
const tabListClasses = {
|
|
87
|
-
underline: `flex flex-wrap -mb-px ${typography.sm} font-medium text-center border-b border-
|
|
87
|
+
underline: `flex flex-wrap -mb-px ${typography.sm} font-medium text-center border-b border-border overflow-x-auto scrollbar-none`,
|
|
88
88
|
pills: `flex flex-wrap ${typography.smMuted} font-medium text-center gap-2`,
|
|
89
|
-
full: `flex flex-wrap ${typography.smMuted} font-medium text-center divide-x divide-
|
|
89
|
+
full: `flex flex-wrap ${typography.smMuted} font-medium text-center divide-x divide-border rounded-lg shadow overflow-hidden`
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
// Tab button classes by style
|
|
@@ -96,16 +96,16 @@
|
|
|
96
96
|
switch (tabStyle) {
|
|
97
97
|
case 'underline':
|
|
98
98
|
return isActive
|
|
99
|
-
? `${base} p-4 text-
|
|
100
|
-
: `${base} p-4 border-b-2 border-transparent rounded-t-lg hover:text-
|
|
99
|
+
? `${base} p-4 text-brand-primary border-b-2 border-brand-primary rounded-t-lg active`
|
|
100
|
+
: `${base} p-4 border-b-2 border-transparent rounded-t-lg hover:text-text-secondary hover:border-stroke-primary`;
|
|
101
101
|
case 'pills':
|
|
102
102
|
return isActive
|
|
103
|
-
? `${base} px-4 py-3 text-white bg-
|
|
104
|
-
: `${base} px-4 py-3 rounded-lg hover:text-
|
|
103
|
+
? `${base} px-4 py-3 text-white bg-brand-primary rounded-lg active`
|
|
104
|
+
: `${base} px-4 py-3 rounded-lg hover:text-text-primary hover:bg-muted`;
|
|
105
105
|
case 'full':
|
|
106
106
|
return isActive
|
|
107
|
-
? `${base} w-full p-4 text-
|
|
108
|
-
: `${base} w-full p-4 bg-
|
|
107
|
+
? `${base} w-full p-4 text-text-primary bg-muted`
|
|
108
|
+
: `${base} w-full p-4 bg-card hover:text-text-secondary hover:bg-bg-secondary`;
|
|
109
109
|
default:
|
|
110
110
|
return base;
|
|
111
111
|
}
|
|
@@ -124,11 +124,10 @@ describe('Toggle Component', () => {
|
|
|
124
124
|
expect(switchEl).toHaveClass('toggle-lg');
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
it('has
|
|
127
|
+
it('has bg-bg-tertiary class for track', () => {
|
|
128
128
|
const { container } = render(Toggle);
|
|
129
129
|
const switchEl = container.querySelector('[role="switch"]');
|
|
130
|
-
expect(switchEl).toHaveClass('
|
|
131
|
-
expect(switchEl).toHaveClass('dark:peer-focus:ring-blue-800');
|
|
130
|
+
expect(switchEl).toHaveClass('bg-bg-tertiary');
|
|
132
131
|
});
|
|
133
132
|
|
|
134
133
|
it('accepts custom class', () => {
|
|
@@ -141,13 +140,12 @@ describe('Toggle Component', () => {
|
|
|
141
140
|
const { container } = render(Toggle);
|
|
142
141
|
const switchEl = container.querySelector('[role="switch"]');
|
|
143
142
|
expect(switchEl).toHaveClass('peer-focus:ring-4');
|
|
144
|
-
expect(switchEl).toHaveClass('peer-focus:ring-blue-300');
|
|
145
143
|
});
|
|
146
144
|
|
|
147
145
|
it('has blue background when checked', () => {
|
|
148
146
|
const { container } = render(Toggle);
|
|
149
147
|
const switchEl = container.querySelector('[role="switch"]');
|
|
150
|
-
expect(switchEl).toHaveClass('peer-checked:bg-
|
|
148
|
+
expect(switchEl).toHaveClass('peer-checked:bg-brand-primary');
|
|
151
149
|
});
|
|
152
150
|
});
|
|
153
151
|
|