@12-apps/ui 1.4.1 → 1.5.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/package.json +17 -8
- package/src/button/index.ts +1 -0
- package/src/social-login-button/index.ts +1 -0
- package/src/{social-login-button.tsx → social-login-button/social-login-button.tsx} +5 -5
- package/src/user-avatar/index.ts +1 -0
- package/src/{user-avatar.tsx → user-avatar/user-avatar.tsx} +4 -4
- package/eslint.config.js +0 -77
- package/src/__tests__/data-grid.test.tsx +0 -125
- package/src/__tests__/package-wiring.test.ts +0 -41
- package/src/__tests__/setup.ts +0 -1
- package/src/__tests__/social-login-button.test.tsx +0 -186
- package/src/__tests__/user-avatar.test.tsx +0 -195
- package/src/__tests__/viewport.test.ts +0 -50
- package/src/components/command/__tests__/command.test.tsx +0 -112
- package/src/components/data-display/Alert/Alert.stories.tsx +0 -559
- package/src/components/data-display/Alert/Alert.test.stories.tsx +0 -707
- package/src/components/data-display/AlertDialog/AlertDialog.stories.tsx +0 -362
- package/src/components/data-display/AlertDialog/AlertDialog.test.stories.tsx +0 -753
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.stories.tsx +0 -230
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.test.stories.tsx +0 -270
- package/src/components/data-display/Avatar/Avatar.stories.tsx +0 -721
- package/src/components/data-display/Avatar/Avatar.test.stories.tsx +0 -822
- package/src/components/data-display/Badge/Badge.stories.tsx +0 -1134
- package/src/components/data-display/Badge/Badge.test.stories.tsx +0 -1194
- package/src/components/data-display/Banner/Banner.stories.tsx +0 -528
- package/src/components/data-display/Banner/Banner.test.stories.tsx +0 -503
- package/src/components/data-display/Carousel/Carousel.stories.tsx +0 -607
- package/src/components/data-display/Carousel/Carousel.test.stories.tsx +0 -691
- package/src/components/data-display/Chart/Chart.stories.tsx +0 -568
- package/src/components/data-display/Chart/Chart.test.stories.tsx +0 -174
- package/src/components/data-display/Chart/SpecChart.stories.tsx +0 -150
- package/src/components/data-display/Chart/SpecChart.test.stories.tsx +0 -56
- package/src/components/data-display/Chart/__tests__/SpecChart.test.tsx +0 -60
- package/src/components/data-display/Chart/__tests__/chart-format.test.ts +0 -43
- package/src/components/data-display/Chart/__tests__/chart-spec.test.ts +0 -119
- package/src/components/data-display/Chip/Chip.stories.tsx +0 -252
- package/src/components/data-display/Chip/Chip.test.stories.tsx +0 -266
- package/src/components/data-display/DataGrid/DataGrid.stories.tsx +0 -515
- package/src/components/data-display/DataGrid/DataGrid.test.stories.tsx +0 -653
- package/src/components/data-display/DataViews/__tests__/DataViewsGrid.test.tsx +0 -271
- package/src/components/data-display/DataViews/__tests__/DataViewsTableBase.test.tsx +0 -134
- package/src/components/data-display/DataViews/__tests__/SaveViewModal.test.tsx +0 -83
- package/src/components/data-display/DataViews/__tests__/data-views-filter.test.ts +0 -115
- package/src/components/data-display/DataViews/__tests__/data-views-preview.test.ts +0 -53
- package/src/components/data-display/DataViews/__tests__/range-pill.test.tsx +0 -114
- package/src/components/data-display/DataViews/base-card.stories.tsx +0 -136
- package/src/components/data-display/DescriptionItem/DescriptionItem.stories.tsx +0 -254
- package/src/components/data-display/EmptyState/EmptyState.stories.tsx +0 -282
- package/src/components/data-display/EmptyState/EmptyState.test.stories.tsx +0 -441
- package/src/components/data-display/ErrorState/ErrorState.stories.tsx +0 -110
- package/src/components/data-display/ErrorState/ErrorState.test.stories.tsx +0 -133
- package/src/components/data-display/HoverCard/HoverCard.stories.tsx +0 -650
- package/src/components/data-display/HoverCard/HoverCard.test.stories.tsx +0 -929
- package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.stories.tsx +0 -411
- package/src/components/data-display/LazyImage/LazyImage.stories.tsx +0 -387
- package/src/components/data-display/Lightbox/Lightbox.stories.tsx +0 -315
- package/src/components/data-display/Lightbox/Lightbox.test.stories.tsx +0 -598
- package/src/components/data-display/LoadingState/LoadingState.stories.tsx +0 -124
- package/src/components/data-display/LoadingState/LoadingState.test.stories.tsx +0 -99
- package/src/components/data-display/MapPreview/MapPreview.stories.tsx +0 -458
- package/src/components/data-display/MapPreview/MapPreview.test.stories.tsx +0 -394
- package/src/components/data-display/Popover/Popover.stories.tsx +0 -295
- package/src/components/data-display/Popover/Popover.test.stories.tsx +0 -1162
- package/src/components/data-display/Progress/Progress.stories.tsx +0 -481
- package/src/components/data-display/Progress/Progress.test.stories.tsx +0 -2070
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.stories.tsx +0 -160
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.test.stories.tsx +0 -190
- package/src/components/data-display/Sheet/Sheet.stories.tsx +0 -883
- package/src/components/data-display/Sheet/Sheet.test.stories.tsx +0 -1101
- package/src/components/data-display/StatCard/StatCard.stories.tsx +0 -167
- package/src/components/data-display/StatCard/StatCard.test.stories.tsx +0 -240
- package/src/components/data-display/Stepper/Stepper.stories.tsx +0 -540
- package/src/components/data-display/Stepper/Stepper.test.stories.tsx +0 -600
- package/src/components/data-display/Table/Table.stories.tsx +0 -803
- package/src/components/data-display/Table/Table.test.stories.tsx +0 -369
- package/src/components/data-display/Timeline/Timeline.stories.tsx +0 -442
- package/src/components/data-display/Timeline/Timeline.test.stories.tsx +0 -930
- package/src/components/data-display/TimingDiagram/TimingDiagram.stories.tsx +0 -475
- package/src/components/data-display/TimingDiagram/TimingDiagram.test.stories.tsx +0 -734
- package/src/components/data-display/Tooltip/Tooltip.stories.tsx +0 -468
- package/src/components/data-display/Tooltip/Tooltip.test.stories.tsx +0 -1154
- package/src/components/feedback/ConfirmAction/ConfirmAction.stories.tsx +0 -146
- package/src/components/feedback/ConfirmAction/ConfirmAction.test.stories.tsx +0 -114
- package/src/components/feedback/ConfirmAction/__tests__/confirm-action.test.tsx +0 -288
- package/src/components/feedback/Dialog/Dialog.stories.tsx +0 -833
- package/src/components/feedback/Dialog/Dialog.test.stories.tsx +0 -955
- package/src/components/feedback/Dialog/__tests__/dialog-content-spacing.test.tsx +0 -66
- package/src/components/feedback/Modal/Modal.stories.tsx +0 -765
- package/src/components/feedback/Modal/Modal.test.stories.tsx +0 -251
- package/src/components/feedback/Sonner/Sonner.stories.tsx +0 -698
- package/src/components/feedback/Sonner/Sonner.test.stories.tsx +0 -896
- package/src/components/feedback/StackedModal/StackedModal.stories.tsx +0 -1783
- package/src/components/feedback/StackedModal/StackedModal.test.stories.tsx +0 -975
- package/src/components/feedback/StackedModal/__tests__/stacked-modal-viewport.test.tsx +0 -104
- package/src/components/feedback/Toast/Toast.stories.tsx +0 -548
- package/src/components/feedback/Toast/Toast.test.stories.tsx +0 -834
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.stories.tsx +0 -691
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.test.stories.tsx +0 -634
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.stories.tsx +0 -665
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.test.stories.tsx +0 -727
- package/src/components/form/Autocomplete/Autocomplete.stories.tsx +0 -715
- package/src/components/form/Autocomplete/Autocomplete.test.stories.tsx +0 -825
- package/src/components/form/Button/Button.stories.tsx +0 -365
- package/src/components/form/Button/Button.test.stories.tsx +0 -607
- package/src/components/form/Calendar/Calendar.stories.tsx +0 -349
- package/src/components/form/Calendar/Calendar.test.stories.tsx +0 -464
- package/src/components/form/CepField/CepField.stories.tsx +0 -138
- package/src/components/form/CepField/CepField.test.stories.tsx +0 -281
- package/src/components/form/Checkbox/Checkbox.stories.tsx +0 -265
- package/src/components/form/Checkbox/Checkbox.test.stories.tsx +0 -181
- package/src/components/form/CodeEditor/CodeEditor.stories.tsx +0 -871
- package/src/components/form/CodeEditor/CodeEditor.test.stories.tsx +0 -574
- package/src/components/form/Command/Command.stories.tsx +0 -580
- package/src/components/form/Command/Command.test.stories.tsx +0 -215
- package/src/components/form/CreatableSelect/CreatableSelect.stories.tsx +0 -112
- package/src/components/form/CreatableSelect/CreatableSelect.test.stories.tsx +0 -134
- package/src/components/form/Form/Form.stories.tsx +0 -687
- package/src/components/form/Form/Form.test.stories.tsx +0 -601
- package/src/components/form/Input/Input.stories.tsx +0 -260
- package/src/components/form/Input/Input.test.stories.tsx +0 -1191
- package/src/components/form/InputOTP/InputOTP.stories.tsx +0 -774
- package/src/components/form/InputOTP/InputOTP.test.stories.tsx +0 -588
- package/src/components/form/Label/Label.stories.tsx +0 -473
- package/src/components/form/Label/Label.test.stories.tsx +0 -909
- package/src/components/form/Menubar/Menubar.stories.tsx +0 -472
- package/src/components/form/Menubar/Menubar.test.stories.tsx +0 -584
- package/src/components/form/PasswordStrength/PasswordStrength.stories.tsx +0 -562
- package/src/components/form/PasswordStrength/PasswordStrength.test.stories.tsx +0 -327
- package/src/components/form/PhoneInput/PhoneInput.stories.tsx +0 -495
- package/src/components/form/PhoneInput/PhoneInput.test.stories.tsx +0 -666
- package/src/components/form/RadioGroup/RadioGroup.stories.tsx +0 -518
- package/src/components/form/RadioGroup/RadioGroup.test.stories.tsx +0 -685
- package/src/components/form/RichTextEditor/RichTextEditor.stories.tsx +0 -261
- package/src/components/form/RichTextEditor/RichTextEditor.test.stories.tsx +0 -491
- package/src/components/form/SearchPalette/SearchPalette.stories.tsx +0 -135
- package/src/components/form/Select/Select.stories.tsx +0 -364
- package/src/components/form/Select/Select.test.stories.tsx +0 -985
- package/src/components/form/Slider/Slider.stories.tsx +0 -418
- package/src/components/form/Slider/Slider.test.stories.tsx +0 -1042
- package/src/components/form/Switch/Switch.stories.tsx +0 -697
- package/src/components/form/Switch/Switch.test.stories.tsx +0 -597
- package/src/components/form/Textarea/Textarea.stories.tsx +0 -473
- package/src/components/form/Textarea/Textarea.test.stories.tsx +0 -702
- package/src/components/form/Toggle/Toggle.stories.tsx +0 -638
- package/src/components/form/Toggle/Toggle.test.stories.tsx +0 -1159
- package/src/components/form/ToggleGroup/ToggleGroup.stories.tsx +0 -617
- package/src/components/form/ToggleGroup/ToggleGroup.test.stories.tsx +0 -918
- package/src/components/form/UploadButton/UploadButton.stories.tsx +0 -367
- package/src/components/form/UploadButton/UploadButton.test.stories.tsx +0 -573
- package/src/components/form/total-form/total-form.test.tsx +0 -214
- package/src/components/layout/Accordion/Accordion.stories.tsx +0 -694
- package/src/components/layout/Accordion/Accordion.test.stories.tsx +0 -1344
- package/src/components/layout/Card/Card.stories.tsx +0 -591
- package/src/components/layout/Card/Card.test.stories.tsx +0 -1134
- package/src/components/layout/CardGrid/__tests__/CardGrid.test.tsx +0 -92
- package/src/components/layout/Collapsible/Collapsible.stories.tsx +0 -180
- package/src/components/layout/Collapsible/Collapsible.test.stories.tsx +0 -308
- package/src/components/layout/Container/Container.stories.tsx +0 -557
- package/src/components/layout/Container/Container.test.stories.tsx +0 -745
- package/src/components/layout/ContentToolbar/ContentToolbar.stories.tsx +0 -129
- package/src/components/layout/ContentToolbar/ContentToolbar.test.stories.tsx +0 -251
- package/src/components/layout/ContentToolbar/__tests__/ColumnsMenu.test.tsx +0 -39
- package/src/components/layout/ContentToolbar/__tests__/MultiSelectDropdown.test.tsx +0 -131
- package/src/components/layout/ContentToolbar/__tests__/SavedViewsMenu.test.tsx +0 -99
- package/src/components/layout/Dashboard/Dashboard.stories.tsx +0 -104
- package/src/components/layout/Dashboard/Dashboard.test.stories.tsx +0 -190
- package/src/components/layout/Drawer/Drawer.stories.tsx +0 -658
- package/src/components/layout/Drawer/Drawer.test.stories.tsx +0 -1343
- package/src/components/layout/Resizable/Resizable.stories.tsx +0 -1039
- package/src/components/layout/Resizable/Resizable.test.stories.tsx +0 -750
- package/src/components/layout/ScrollArea/ScrollArea.stories.tsx +0 -651
- package/src/components/layout/ScrollArea/ScrollArea.test.stories.tsx +0 -619
- package/src/components/layout/Separator/Separator.stories.tsx +0 -563
- package/src/components/layout/Separator/Separator.test.stories.tsx +0 -518
- package/src/components/layout/SettingsLayout/SettingsLayout.stories.tsx +0 -192
- package/src/components/layout/SettingsLayout/SettingsLayout.test.stories.tsx +0 -175
- package/src/components/layout/Sidebar/Sidebar.stories.tsx +0 -609
- package/src/components/layout/Sidebar/Sidebar.test.stories.tsx +0 -1324
- package/src/components/layout/Skeleton/Skeleton.stories.tsx +0 -689
- package/src/components/layout/Skeleton/Skeleton.test.stories.tsx +0 -521
- package/src/components/layout/Spacer/Spacer.stories.tsx +0 -502
- package/src/components/layout/Spacer/Spacer.test.stories.tsx +0 -472
- package/src/components/layout/TableFilter/TableFilter.stories.tsx +0 -82
- package/src/components/layout/TableFilter/TableFilter.test.stories.tsx +0 -87
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.stories.tsx +0 -638
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.test.stories.tsx +0 -1008
- package/src/components/navigation/CommandPalette/CommandPalette.stories.tsx +0 -386
- package/src/components/navigation/CommandPalette/CommandPalette.test.stories.tsx +0 -435
- package/src/components/navigation/ContextMenu/ContextMenu.stories.tsx +0 -614
- package/src/components/navigation/ContextMenu/ContextMenu.test.stories.tsx +0 -845
- package/src/components/navigation/DropdownMenu/DropdownMenu.stories.tsx +0 -578
- package/src/components/navigation/DropdownMenu/DropdownMenu.test.stories.tsx +0 -660
- package/src/components/navigation/NavigationMenu/stories/NavigationMenu.stories.tsx +0 -516
- package/src/components/navigation/NavigationMenu/stories/NavigationMenu.test.stories.tsx +0 -935
- package/src/components/navigation/NavigationMenu/stories/NavigationMenuHorizontal.stories.tsx +0 -501
- package/src/components/navigation/NavigationMenu/stories/NavigationMenuVertical.stories.tsx +0 -453
- package/src/components/navigation/Pagination/Pagination.stories.tsx +0 -602
- package/src/components/navigation/Pagination/Pagination.test.stories.tsx +0 -520
- package/src/components/navigation/Tabs/Tabs.stories.tsx +0 -1004
- package/src/components/navigation/Tabs/Tabs.test.stories.tsx +0 -1225
- package/src/components/typography/Blockquote/Blockquote.stories.tsx +0 -359
- package/src/components/typography/Blockquote/Blockquote.test.stories.tsx +0 -432
- package/src/components/typography/Code/Code.stories.tsx +0 -686
- package/src/components/typography/Code/Code.test.stories.tsx +0 -703
- package/src/components/typography/Heading/Heading.stories.tsx +0 -451
- package/src/components/typography/Heading/Heading.test.stories.tsx +0 -830
- package/src/components/typography/Paragraph/Paragraph.stories.tsx +0 -280
- package/src/components/typography/Paragraph/Paragraph.test.stories.tsx +0 -231
- package/src/components/typography/Text/Text.stories.tsx +0 -359
- package/src/components/typography/Text/Text.test.stories.tsx +0 -762
- package/src/components/utility/AnimatedIcon/AnimatedIcon.stories.tsx +0 -945
- package/src/components/utility/AnimatedIcon/AnimatedIcon.test.stories.tsx +0 -603
- package/src/components/utility/AspectRatio/AspectRatio.stories.tsx +0 -414
- package/src/components/utility/AspectRatio/AspectRatio.test.stories.tsx +0 -859
- package/src/components/utility/InfiniteScroll/InfiniteScroll.stories.tsx +0 -620
- package/src/components/utility/InfiniteScroll/InfiniteScroll.test.stories.tsx +0 -361
- package/src/components/utility/InstallPrompt/InstallPrompt.stories.tsx +0 -118
- package/src/components/utility/InstallPrompt/InstallPrompt.test.stories.tsx +0 -83
- package/src/components/utility/InstallPrompt/__tests__/InstallPrompt.ios.test.tsx +0 -65
- package/src/components/utility/InstallPrompt/__tests__/usePwaInstall.test.tsx +0 -271
- package/src/components/utility/Portal/Portal.stories.tsx +0 -340
- package/src/components/utility/Portal/Portal.test.stories.tsx +0 -2086
- package/src/components/utility/Transition/Transition.stories.tsx +0 -493
- package/src/components/utility/Transition/Transition.test.stories.tsx +0 -854
- package/src/components/utility/VirtualList/VirtualList.stories.tsx +0 -1073
- package/src/components/utility/VirtualList/VirtualList.test.stories.tsx +0 -1085
- package/src/components/utility/WorkflowStep/WorkflowStep.stories.tsx +0 -431
- package/src/components/utility/WorkflowStep/WorkflowStep.test.stories.tsx +0 -364
- /package/src/{button.tsx → button/button.tsx} +0 -0
|
@@ -1,518 +0,0 @@
|
|
|
1
|
-
import { Box, Stack,Typography } from '@mui/material';
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
-
import { expect,within } from 'storybook/test';
|
|
4
|
-
|
|
5
|
-
import { Separator } from './Separator';
|
|
6
|
-
|
|
7
|
-
const meta: Meta<typeof Separator> = {
|
|
8
|
-
title: 'Layout/Separator/Tests',
|
|
9
|
-
component: Separator,
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'centered',
|
|
12
|
-
chromatic: { disableSnapshot: false },
|
|
13
|
-
},
|
|
14
|
-
tags: ['autodocs', 'test', 'component:Separator'],
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default meta;
|
|
18
|
-
type Story = StoryObj<typeof meta>;
|
|
19
|
-
|
|
20
|
-
export const BasicInteraction: Story = {
|
|
21
|
-
name: '🧪 Basic Interaction Test',
|
|
22
|
-
args: {
|
|
23
|
-
variant: 'solid',
|
|
24
|
-
orientation: 'horizontal',
|
|
25
|
-
size: 'md',
|
|
26
|
-
},
|
|
27
|
-
play: async ({ canvasElement, step }) => {
|
|
28
|
-
const canvas = within(canvasElement);
|
|
29
|
-
|
|
30
|
-
await step('Verify separator renders with correct attributes', async () => {
|
|
31
|
-
const separator = canvas.getByRole('separator');
|
|
32
|
-
await expect(separator).toBeInTheDocument();
|
|
33
|
-
await expect(separator).toHaveAttribute('aria-orientation', 'horizontal');
|
|
34
|
-
await expect(separator).toHaveAttribute('role', 'separator');
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
await step('Verify separator has correct styles', async () => {
|
|
38
|
-
const separator = canvas.getByRole('separator');
|
|
39
|
-
const computedStyle = window.getComputedStyle(separator);
|
|
40
|
-
await expect(computedStyle.display).toBe('flex');
|
|
41
|
-
await expect(computedStyle.alignItems).toBe('center');
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
render: (args) => (
|
|
45
|
-
<Box sx={{ width: '100%', p: 2 }}>
|
|
46
|
-
<Typography>Content above</Typography>
|
|
47
|
-
<Separator {...args} />
|
|
48
|
-
<Typography>Content below</Typography>
|
|
49
|
-
</Box>
|
|
50
|
-
),
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const ThemeVariations: Story = {
|
|
54
|
-
name: '🎨 Theme Variations Test',
|
|
55
|
-
play: async ({ canvasElement, step }) => {
|
|
56
|
-
const canvas = within(canvasElement);
|
|
57
|
-
|
|
58
|
-
await step('Verify all variant separators render', async () => {
|
|
59
|
-
const separators = canvas.getAllByRole('separator');
|
|
60
|
-
await expect(separators).toHaveLength(4);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
await step('Verify solid separator has correct border style', async () => {
|
|
64
|
-
const solidSeparator = canvas.getByTestId('solid-separator');
|
|
65
|
-
const computedStyle = window.getComputedStyle(solidSeparator);
|
|
66
|
-
await expect(computedStyle.borderTopStyle).toBe('solid');
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
await step('Verify dashed separator has correct border style', async () => {
|
|
70
|
-
const dashedSeparator = canvas.getByTestId('dashed-separator');
|
|
71
|
-
const computedStyle = window.getComputedStyle(dashedSeparator);
|
|
72
|
-
await expect(computedStyle.borderTopStyle).toBe('dashed');
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
await step('Verify dotted separator has correct border style', async () => {
|
|
76
|
-
const dottedSeparator = canvas.getByTestId('dotted-separator');
|
|
77
|
-
const computedStyle = window.getComputedStyle(dottedSeparator);
|
|
78
|
-
await expect(computedStyle.borderTopStyle).toBe('dotted');
|
|
79
|
-
});
|
|
80
|
-
},
|
|
81
|
-
render: () => (
|
|
82
|
-
<Stack spacing={2} sx={{ width: '100%', p: 2 }}>
|
|
83
|
-
<Box>
|
|
84
|
-
<Separator variant="solid" data-testid="solid-separator" />
|
|
85
|
-
</Box>
|
|
86
|
-
<Box>
|
|
87
|
-
<Separator variant="dashed" data-testid="dashed-separator" />
|
|
88
|
-
</Box>
|
|
89
|
-
<Box>
|
|
90
|
-
<Separator variant="dotted" data-testid="dotted-separator" />
|
|
91
|
-
</Box>
|
|
92
|
-
<Box>
|
|
93
|
-
<Separator variant="gradient" data-testid="gradient-separator" />
|
|
94
|
-
</Box>
|
|
95
|
-
</Stack>
|
|
96
|
-
),
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export const ResponsiveDesign: Story = {
|
|
100
|
-
name: '📏 Responsive Design Test',
|
|
101
|
-
play: async ({ canvasElement, step }) => {
|
|
102
|
-
const canvas = within(canvasElement);
|
|
103
|
-
|
|
104
|
-
await step('Verify all size separators render', async () => {
|
|
105
|
-
const separators = canvas.getAllByRole('separator');
|
|
106
|
-
await expect(separators).toHaveLength(5);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
await step('Verify XS separator has correct thickness', async () => {
|
|
110
|
-
const xsSeparator = canvas.getByTestId('xs-separator');
|
|
111
|
-
const computedStyle = window.getComputedStyle(xsSeparator);
|
|
112
|
-
await expect(computedStyle.borderTopWidth).toBe('1px');
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
await step('Verify MD separator has correct thickness', async () => {
|
|
116
|
-
const mdSeparator = canvas.getByTestId('md-separator');
|
|
117
|
-
const computedStyle = window.getComputedStyle(mdSeparator);
|
|
118
|
-
await expect(computedStyle.borderTopWidth).toBe('3px');
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
await step('Verify XL separator has correct thickness', async () => {
|
|
122
|
-
const xlSeparator = canvas.getByTestId('xl-separator');
|
|
123
|
-
const computedStyle = window.getComputedStyle(xlSeparator);
|
|
124
|
-
await expect(computedStyle.borderTopWidth).toBe('6px');
|
|
125
|
-
});
|
|
126
|
-
},
|
|
127
|
-
render: () => (
|
|
128
|
-
<Stack spacing={2} sx={{ width: '100%', p: 2 }}>
|
|
129
|
-
{(['xs', 'sm', 'md', 'lg', 'xl'] as const).map((size) => (
|
|
130
|
-
<Box key={size}>
|
|
131
|
-
<Typography variant="caption">{size.toUpperCase()} Size</Typography>
|
|
132
|
-
<Separator size={size} data-testid={`${size}-separator`} />
|
|
133
|
-
</Box>
|
|
134
|
-
))}
|
|
135
|
-
</Stack>
|
|
136
|
-
),
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
export const Integration: Story = {
|
|
140
|
-
name: '🔄 Integration Test',
|
|
141
|
-
play: async ({ canvasElement, step }) => {
|
|
142
|
-
const canvas = within(canvasElement);
|
|
143
|
-
|
|
144
|
-
await step('Verify horizontal separator orientation', async () => {
|
|
145
|
-
const horizontalSeparator = canvas.getByTestId('horizontal-separator');
|
|
146
|
-
await expect(horizontalSeparator).toHaveAttribute('aria-orientation', 'horizontal');
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
await step('Verify vertical separator orientation', async () => {
|
|
150
|
-
const verticalSeparator = canvas.getByTestId('vertical-separator');
|
|
151
|
-
await expect(verticalSeparator).toHaveAttribute('aria-orientation', 'vertical');
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
await step('Verify vertical separator has correct width', async () => {
|
|
155
|
-
const verticalSeparator = canvas.getByTestId('vertical-separator');
|
|
156
|
-
const computedStyle = window.getComputedStyle(verticalSeparator);
|
|
157
|
-
await expect(computedStyle.borderLeftWidth).toBe('3px');
|
|
158
|
-
await expect(computedStyle.borderTopWidth).toBe('0px');
|
|
159
|
-
});
|
|
160
|
-
},
|
|
161
|
-
render: () => (
|
|
162
|
-
<Box sx={{ p: 2 }}>
|
|
163
|
-
<Box sx={{ mb: 2 }}>
|
|
164
|
-
<Typography>Horizontal separator:</Typography>
|
|
165
|
-
<Separator orientation="horizontal" data-testid="horizontal-separator" />
|
|
166
|
-
</Box>
|
|
167
|
-
<Box sx={{ display: 'flex', alignItems: 'center', height: 80 }}>
|
|
168
|
-
<Typography>Vertical:</Typography>
|
|
169
|
-
<Separator orientation="vertical" data-testid="vertical-separator" />
|
|
170
|
-
<Typography>Separator</Typography>
|
|
171
|
-
</Box>
|
|
172
|
-
</Box>
|
|
173
|
-
),
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
export const ScreenReader: Story = {
|
|
177
|
-
name: '📝 Screen Reader Test',
|
|
178
|
-
play: async ({ canvasElement, step }) => {
|
|
179
|
-
const canvas = within(canvasElement);
|
|
180
|
-
|
|
181
|
-
await step('Verify text content is displayed', async () => {
|
|
182
|
-
const separatorText = canvas.getByText('Section Divider');
|
|
183
|
-
await expect(separatorText).toBeInTheDocument();
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
await step('Verify text has correct styling', async () => {
|
|
187
|
-
const separatorText = canvas.getByText('Section Divider');
|
|
188
|
-
const computedStyle = window.getComputedStyle(separatorText);
|
|
189
|
-
await expect(computedStyle.flexShrink).toBe('0');
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
await step('Verify separator lines exist around text', async () => {
|
|
193
|
-
// The separator with text creates a container with three elements: line, text, line
|
|
194
|
-
const container = canvas.getByText('Section Divider').parentElement;
|
|
195
|
-
expect(container).toBeInTheDocument();
|
|
196
|
-
const children = container?.children;
|
|
197
|
-
await expect(children?.length).toBeGreaterThanOrEqual(3);
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
await step('Verify empty string content handling', async () => {
|
|
201
|
-
// Empty string should still render the separator structure
|
|
202
|
-
const emptyContainer = canvas.getByTestId('empty-text-separator');
|
|
203
|
-
await expect(emptyContainer).toBeInTheDocument();
|
|
204
|
-
});
|
|
205
|
-
},
|
|
206
|
-
render: () => (
|
|
207
|
-
<Stack spacing={4} sx={{ width: '100%', p: 2 }}>
|
|
208
|
-
<Box>
|
|
209
|
-
<Typography>Before separator</Typography>
|
|
210
|
-
<Separator>Section Divider</Separator>
|
|
211
|
-
<Typography>After separator</Typography>
|
|
212
|
-
</Box>
|
|
213
|
-
<Box>
|
|
214
|
-
<Typography>Before empty separator</Typography>
|
|
215
|
-
<Box data-testid="empty-text-separator">
|
|
216
|
-
<Separator>{''}</Separator>
|
|
217
|
-
</Box>
|
|
218
|
-
<Typography>After empty separator</Typography>
|
|
219
|
-
</Box>
|
|
220
|
-
</Stack>
|
|
221
|
-
),
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
export const KeyboardNavigation: Story = {
|
|
225
|
-
name: '⚙️ Keyboard Navigation Test',
|
|
226
|
-
play: async ({ canvasElement, step }) => {
|
|
227
|
-
const canvas = within(canvasElement);
|
|
228
|
-
|
|
229
|
-
await step('Verify custom color is applied', async () => {
|
|
230
|
-
const customColorSeparator = canvas.getByTestId('custom-color-separator');
|
|
231
|
-
const computedStyle = window.getComputedStyle(customColorSeparator);
|
|
232
|
-
// Note: Color might be transformed by browser, so we check it's not the default
|
|
233
|
-
await expect(computedStyle.borderTopColor).toBeTruthy();
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
await step('Verify custom margin is applied', async () => {
|
|
237
|
-
const customMarginSeparator = canvas.getByTestId('custom-margin-separator');
|
|
238
|
-
const computedStyle = window.getComputedStyle(customMarginSeparator);
|
|
239
|
-
await expect(computedStyle.marginTop).toBe('32px');
|
|
240
|
-
await expect(computedStyle.marginBottom).toBe('32px');
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
await step('Verify custom length affects width', async () => {
|
|
244
|
-
const customLengthSeparator = canvas.getByTestId('custom-length-separator');
|
|
245
|
-
const computedStyle = window.getComputedStyle(customLengthSeparator);
|
|
246
|
-
await expect(computedStyle.width).toBe('200px');
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
await step('Verify custom className is applied', async () => {
|
|
250
|
-
const customClassSeparator = canvas.getByTestId('custom-class-separator');
|
|
251
|
-
await expect(customClassSeparator).toHaveClass('custom-separator-class');
|
|
252
|
-
});
|
|
253
|
-
},
|
|
254
|
-
render: () => (
|
|
255
|
-
<Stack spacing={4} sx={{ width: '100%', p: 2 }}>
|
|
256
|
-
<Box>
|
|
257
|
-
<Typography>Custom Color (Red):</Typography>
|
|
258
|
-
<Separator color="#ff0000" data-testid="custom-color-separator" />
|
|
259
|
-
</Box>
|
|
260
|
-
<Box>
|
|
261
|
-
<Typography>Custom Margin (32px):</Typography>
|
|
262
|
-
<Separator margin="32px" data-testid="custom-margin-separator" />
|
|
263
|
-
</Box>
|
|
264
|
-
<Box>
|
|
265
|
-
<Typography>Custom Length (200px):</Typography>
|
|
266
|
-
<Separator length="200px" data-testid="custom-length-separator" />
|
|
267
|
-
</Box>
|
|
268
|
-
<Box>
|
|
269
|
-
<Typography>Custom Class Name:</Typography>
|
|
270
|
-
<Separator className="custom-separator-class" data-testid="custom-class-separator" />
|
|
271
|
-
</Box>
|
|
272
|
-
</Stack>
|
|
273
|
-
),
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
export const FocusManagement: Story = {
|
|
277
|
-
name: '♿ Focus Management Test',
|
|
278
|
-
parameters: {
|
|
279
|
-
a11y: {
|
|
280
|
-
element: '#storybook-root',
|
|
281
|
-
config: {
|
|
282
|
-
rules: [
|
|
283
|
-
{ id: 'color-contrast', enabled: true },
|
|
284
|
-
{ id: 'aria-required-attr', enabled: true },
|
|
285
|
-
{ id: 'aria-roles', enabled: true },
|
|
286
|
-
{ id: 'aria-valid-attr-value', enabled: true },
|
|
287
|
-
],
|
|
288
|
-
},
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
play: async ({ canvasElement, step }) => {
|
|
292
|
-
const canvas = within(canvasElement);
|
|
293
|
-
|
|
294
|
-
await step('Verify ARIA role is correctly set', async () => {
|
|
295
|
-
const separators = canvas.getAllByRole('separator');
|
|
296
|
-
await expect(separators.length).toBeGreaterThan(0);
|
|
297
|
-
|
|
298
|
-
separators.forEach(async (separator) => {
|
|
299
|
-
await expect(separator).toHaveAttribute('role', 'separator');
|
|
300
|
-
});
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
await step('Verify aria-orientation attributes', async () => {
|
|
304
|
-
const horizontalSeparator = canvas.getByTestId('a11y-horizontal');
|
|
305
|
-
const verticalSeparator = canvas.getByTestId('a11y-vertical');
|
|
306
|
-
|
|
307
|
-
await expect(horizontalSeparator).toHaveAttribute('aria-orientation', 'horizontal');
|
|
308
|
-
await expect(verticalSeparator).toHaveAttribute('aria-orientation', 'vertical');
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
await step('Verify separators are not focusable', async () => {
|
|
312
|
-
const separators = canvas.getAllByRole('separator');
|
|
313
|
-
|
|
314
|
-
separators.forEach(async (separator) => {
|
|
315
|
-
await expect(separator).not.toHaveAttribute('tabindex');
|
|
316
|
-
});
|
|
317
|
-
});
|
|
318
|
-
|
|
319
|
-
await step('Verify text content is accessible', async () => {
|
|
320
|
-
const textContent = canvas.getByText('Accessible Section');
|
|
321
|
-
await expect(textContent).toBeInTheDocument();
|
|
322
|
-
// Verify the text is not hidden from screen readers
|
|
323
|
-
await expect(textContent).toBeVisible();
|
|
324
|
-
});
|
|
325
|
-
},
|
|
326
|
-
render: () => (
|
|
327
|
-
<Stack spacing={4} sx={{ width: '100%', p: 2 }}>
|
|
328
|
-
<Box>
|
|
329
|
-
<Typography>Horizontal separator with proper ARIA:</Typography>
|
|
330
|
-
<Separator data-testid="a11y-horizontal" />
|
|
331
|
-
</Box>
|
|
332
|
-
<Box sx={{ display: 'flex', alignItems: 'center', height: 60 }}>
|
|
333
|
-
<Typography>Vertical separator:</Typography>
|
|
334
|
-
<Separator orientation="vertical" data-testid="a11y-vertical" />
|
|
335
|
-
<Typography>with proper ARIA</Typography>
|
|
336
|
-
</Box>
|
|
337
|
-
<Box>
|
|
338
|
-
<Typography>Separator with accessible text:</Typography>
|
|
339
|
-
<Separator>Accessible Section</Separator>
|
|
340
|
-
</Box>
|
|
341
|
-
</Stack>
|
|
342
|
-
),
|
|
343
|
-
};
|
|
344
|
-
|
|
345
|
-
export const EdgeCases: Story = {
|
|
346
|
-
name: '🔧 Edge Cases Test',
|
|
347
|
-
play: async ({ canvasElement, step }) => {
|
|
348
|
-
const canvas = within(canvasElement);
|
|
349
|
-
|
|
350
|
-
await step('Verify long text handling', async () => {
|
|
351
|
-
const longText = canvas.getByText(/This is a very long text/);
|
|
352
|
-
await expect(longText).toBeInTheDocument();
|
|
353
|
-
// Verify it doesn't break the layout
|
|
354
|
-
const container = longText.parentElement;
|
|
355
|
-
expect(container).toBeInTheDocument();
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
await step('Verify zero margin handling', async () => {
|
|
359
|
-
const zeroMarginSeparator = canvas.getByTestId('zero-margin');
|
|
360
|
-
const computedStyle = window.getComputedStyle(zeroMarginSeparator);
|
|
361
|
-
await expect(computedStyle.marginTop).toBe('0px');
|
|
362
|
-
await expect(computedStyle.marginBottom).toBe('0px');
|
|
363
|
-
});
|
|
364
|
-
|
|
365
|
-
await step('Verify very small size handling', async () => {
|
|
366
|
-
const xsSeparator = canvas.getByTestId('xs-edge-case');
|
|
367
|
-
const computedStyle = window.getComputedStyle(xsSeparator);
|
|
368
|
-
await expect(computedStyle.borderTopWidth).toBe('1px');
|
|
369
|
-
});
|
|
370
|
-
|
|
371
|
-
await step('Verify percentage length handling', async () => {
|
|
372
|
-
const percentSeparator = canvas.getByTestId('percent-length');
|
|
373
|
-
const computedStyle = window.getComputedStyle(percentSeparator);
|
|
374
|
-
// Check if width property contains percentage or matches expected computed value
|
|
375
|
-
const width = computedStyle.width;
|
|
376
|
-
const hasPercentage = percentSeparator.style.width === '50%' || width.includes('%');
|
|
377
|
-
await expect(hasPercentage || parseFloat(width) > 0).toBeTruthy();
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
await step('Verify complex nested content', async () => {
|
|
381
|
-
const nestedContent = canvas.getByTestId('nested-content');
|
|
382
|
-
await expect(nestedContent).toBeInTheDocument();
|
|
383
|
-
const boldText = within(nestedContent).getByText('Bold Text');
|
|
384
|
-
await expect(boldText).toBeInTheDocument();
|
|
385
|
-
});
|
|
386
|
-
},
|
|
387
|
-
render: () => (
|
|
388
|
-
<Stack spacing={4} sx={{ width: '100%', p: 2 }}>
|
|
389
|
-
<Box>
|
|
390
|
-
<Typography>Long text in separator:</Typography>
|
|
391
|
-
<Separator>
|
|
392
|
-
This is a very long text that should be handled gracefully by the separator component
|
|
393
|
-
without breaking the layout
|
|
394
|
-
</Separator>
|
|
395
|
-
</Box>
|
|
396
|
-
|
|
397
|
-
<Box>
|
|
398
|
-
<Typography>Zero margin:</Typography>
|
|
399
|
-
<Separator margin={0} data-testid="zero-margin" />
|
|
400
|
-
</Box>
|
|
401
|
-
|
|
402
|
-
<Box>
|
|
403
|
-
<Typography>Very small size (xs):</Typography>
|
|
404
|
-
<Separator size="xs" data-testid="xs-edge-case" />
|
|
405
|
-
</Box>
|
|
406
|
-
|
|
407
|
-
<Box>
|
|
408
|
-
<Typography>50% length:</Typography>
|
|
409
|
-
<Separator length="50%" data-testid="percent-length" />
|
|
410
|
-
</Box>
|
|
411
|
-
|
|
412
|
-
<Box data-testid="nested-content">
|
|
413
|
-
<Typography>Nested complex content:</Typography>
|
|
414
|
-
<Separator>
|
|
415
|
-
<Box component="span" sx={{ fontWeight: 'bold', color: 'primary.main' }}>
|
|
416
|
-
Bold Text
|
|
417
|
-
</Box>
|
|
418
|
-
</Separator>
|
|
419
|
-
</Box>
|
|
420
|
-
</Stack>
|
|
421
|
-
),
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
export const VisualStates: Story = {
|
|
425
|
-
name: '👁️ Visual States Test',
|
|
426
|
-
parameters: {
|
|
427
|
-
backgrounds: {
|
|
428
|
-
default: 'light',
|
|
429
|
-
values: [
|
|
430
|
-
{ name: 'light', value: '#ffffff' },
|
|
431
|
-
{ name: 'dark', value: '#1a1a1a' },
|
|
432
|
-
],
|
|
433
|
-
},
|
|
434
|
-
},
|
|
435
|
-
play: async ({ canvasElement, step }) => {
|
|
436
|
-
const canvas = within(canvasElement);
|
|
437
|
-
|
|
438
|
-
await step('Verify default visual state', async () => {
|
|
439
|
-
const defaultSeparator = canvas.getByTestId('default-visual');
|
|
440
|
-
const computedStyle = window.getComputedStyle(defaultSeparator);
|
|
441
|
-
await expect(computedStyle.borderTopWidth).toBe('3px');
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
await step('Verify gradient background is applied', async () => {
|
|
445
|
-
const gradientSeparator = canvas.getByTestId('gradient-visual');
|
|
446
|
-
const computedStyle = window.getComputedStyle(gradientSeparator);
|
|
447
|
-
await expect(computedStyle.background).toContain('linear-gradient');
|
|
448
|
-
});
|
|
449
|
-
|
|
450
|
-
await step('Verify different variants have different styles', async () => {
|
|
451
|
-
const solidSeparator = canvas.getByTestId('solid-visual');
|
|
452
|
-
const dashedSeparator = canvas.getByTestId('dashed-visual');
|
|
453
|
-
|
|
454
|
-
const solidStyle = window.getComputedStyle(solidSeparator);
|
|
455
|
-
const dashedStyle = window.getComputedStyle(dashedSeparator);
|
|
456
|
-
|
|
457
|
-
await expect(solidStyle.borderTopStyle).toBe('solid');
|
|
458
|
-
await expect(dashedStyle.borderTopStyle).toBe('dashed');
|
|
459
|
-
});
|
|
460
|
-
},
|
|
461
|
-
render: () => (
|
|
462
|
-
<Stack spacing={4} sx={{ width: '100%', p: 2 }}>
|
|
463
|
-
<Box>
|
|
464
|
-
<Typography variant="h6">Default State</Typography>
|
|
465
|
-
<Separator data-testid="default-visual" />
|
|
466
|
-
</Box>
|
|
467
|
-
|
|
468
|
-
<Box>
|
|
469
|
-
<Typography variant="h6">Gradient Effect</Typography>
|
|
470
|
-
<Separator variant="gradient" data-testid="gradient-visual" />
|
|
471
|
-
</Box>
|
|
472
|
-
|
|
473
|
-
<Box>
|
|
474
|
-
<Typography variant="h6">Visual Comparison</Typography>
|
|
475
|
-
<Typography variant="body2">Solid</Typography>
|
|
476
|
-
<Separator variant="solid" data-testid="solid-visual" />
|
|
477
|
-
<Typography variant="body2">Dashed</Typography>
|
|
478
|
-
<Separator variant="dashed" data-testid="dashed-visual" />
|
|
479
|
-
</Box>
|
|
480
|
-
</Stack>
|
|
481
|
-
),
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
export const Performance: Story = {
|
|
485
|
-
name: '⚡ Performance Test',
|
|
486
|
-
play: async ({ canvasElement, step }) => {
|
|
487
|
-
const canvas = within(canvasElement);
|
|
488
|
-
|
|
489
|
-
// This bracketed the query below with performance.now() and asserted a
|
|
490
|
-
// wall-clock budget. That measured the machine, not the component.
|
|
491
|
-
await step('Render multiple separators', async () => {
|
|
492
|
-
const separators = canvas.getAllByRole('separator');
|
|
493
|
-
|
|
494
|
-
// Verify all separators are rendered
|
|
495
|
-
await expect(separators.length).toBe(20);
|
|
496
|
-
});
|
|
497
|
-
|
|
498
|
-
await step('Test memory usage with many separators', async () => {
|
|
499
|
-
// Verify all separators are in DOM without memory leaks
|
|
500
|
-
const separators = canvas.getAllByRole('separator');
|
|
501
|
-
|
|
502
|
-
separators.forEach(async (separator) => {
|
|
503
|
-
await expect(separator).toBeInTheDocument();
|
|
504
|
-
});
|
|
505
|
-
});
|
|
506
|
-
},
|
|
507
|
-
render: () => (
|
|
508
|
-
<Stack spacing={1} sx={{ width: '100%', p: 2, maxHeight: 400, overflow: 'auto' }}>
|
|
509
|
-
<Typography variant="h6">Performance Test - 20 Separators</Typography>
|
|
510
|
-
{Array.from({ length: 20 }, (_, i) => (
|
|
511
|
-
<Box key={i}>
|
|
512
|
-
<Typography variant="body2">Section {i + 1}</Typography>
|
|
513
|
-
<Separator variant={i % 2 === 0 ? 'solid' : 'dashed'} />
|
|
514
|
-
</Box>
|
|
515
|
-
))}
|
|
516
|
-
</Stack>
|
|
517
|
-
),
|
|
518
|
-
};
|