@12-apps/ui 1.5.0 → 1.5.2

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.
Files changed (229) hide show
  1. package/package.json +17 -9
  2. package/src/button/index.ts +1 -0
  3. package/src/social-login-button/index.ts +1 -0
  4. package/src/{social-login-button.tsx → social-login-button/social-login-button.tsx} +5 -5
  5. package/src/user-avatar/index.ts +1 -0
  6. package/src/{user-avatar.tsx → user-avatar/user-avatar.tsx} +4 -4
  7. package/eslint.config.js +0 -89
  8. package/src/__tests__/data-grid.test.tsx +0 -125
  9. package/src/__tests__/package-wiring.test.ts +0 -41
  10. package/src/__tests__/setup.ts +0 -1
  11. package/src/__tests__/social-login-button.test.tsx +0 -186
  12. package/src/__tests__/user-avatar.test.tsx +0 -195
  13. package/src/__tests__/viewport.test.ts +0 -50
  14. package/src/components/command/__tests__/command.test.tsx +0 -112
  15. package/src/components/data-display/Alert/Alert.stories.tsx +0 -559
  16. package/src/components/data-display/Alert/Alert.test.stories.tsx +0 -707
  17. package/src/components/data-display/AlertDialog/AlertDialog.stories.tsx +0 -362
  18. package/src/components/data-display/AlertDialog/AlertDialog.test.stories.tsx +0 -763
  19. package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.stories.tsx +0 -230
  20. package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.test.stories.tsx +0 -270
  21. package/src/components/data-display/Avatar/Avatar.stories.tsx +0 -721
  22. package/src/components/data-display/Avatar/Avatar.test.stories.tsx +0 -822
  23. package/src/components/data-display/Badge/Badge.stories.tsx +0 -1134
  24. package/src/components/data-display/Badge/Badge.test.stories.tsx +0 -1194
  25. package/src/components/data-display/Banner/Banner.stories.tsx +0 -528
  26. package/src/components/data-display/Banner/Banner.test.stories.tsx +0 -511
  27. package/src/components/data-display/Carousel/Carousel.stories.tsx +0 -607
  28. package/src/components/data-display/Carousel/Carousel.test.stories.tsx +0 -701
  29. package/src/components/data-display/Chart/Chart.stories.tsx +0 -568
  30. package/src/components/data-display/Chart/Chart.test.stories.tsx +0 -174
  31. package/src/components/data-display/Chart/SpecChart.stories.tsx +0 -150
  32. package/src/components/data-display/Chart/SpecChart.test.stories.tsx +0 -56
  33. package/src/components/data-display/Chart/__tests__/SpecChart.test.tsx +0 -60
  34. package/src/components/data-display/Chart/__tests__/chart-format.test.ts +0 -43
  35. package/src/components/data-display/Chart/__tests__/chart-spec.test.ts +0 -119
  36. package/src/components/data-display/Chip/Chip.stories.tsx +0 -252
  37. package/src/components/data-display/Chip/Chip.test.stories.tsx +0 -266
  38. package/src/components/data-display/DataGrid/DataGrid.stories.tsx +0 -515
  39. package/src/components/data-display/DataGrid/DataGrid.test.stories.tsx +0 -653
  40. package/src/components/data-display/DataViews/__tests__/DataViewsGrid.test.tsx +0 -271
  41. package/src/components/data-display/DataViews/__tests__/DataViewsTableBase.test.tsx +0 -134
  42. package/src/components/data-display/DataViews/__tests__/SaveViewModal.test.tsx +0 -83
  43. package/src/components/data-display/DataViews/__tests__/data-views-filter.test.ts +0 -115
  44. package/src/components/data-display/DataViews/__tests__/data-views-preview.test.ts +0 -53
  45. package/src/components/data-display/DataViews/__tests__/range-pill.test.tsx +0 -114
  46. package/src/components/data-display/DataViews/base-card.stories.tsx +0 -136
  47. package/src/components/data-display/DescriptionItem/DescriptionItem.stories.tsx +0 -254
  48. package/src/components/data-display/EmptyState/EmptyState.stories.tsx +0 -282
  49. package/src/components/data-display/EmptyState/EmptyState.test.stories.tsx +0 -441
  50. package/src/components/data-display/ErrorState/ErrorState.stories.tsx +0 -110
  51. package/src/components/data-display/ErrorState/ErrorState.test.stories.tsx +0 -133
  52. package/src/components/data-display/HoverCard/HoverCard.stories.tsx +0 -650
  53. package/src/components/data-display/HoverCard/HoverCard.test.stories.tsx +0 -929
  54. package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.stories.tsx +0 -411
  55. package/src/components/data-display/LazyImage/LazyImage.stories.tsx +0 -387
  56. package/src/components/data-display/Lightbox/Lightbox.stories.tsx +0 -315
  57. package/src/components/data-display/Lightbox/Lightbox.test.stories.tsx +0 -598
  58. package/src/components/data-display/LoadingState/LoadingState.stories.tsx +0 -124
  59. package/src/components/data-display/LoadingState/LoadingState.test.stories.tsx +0 -99
  60. package/src/components/data-display/MapPreview/MapPreview.stories.tsx +0 -458
  61. package/src/components/data-display/MapPreview/MapPreview.test.stories.tsx +0 -394
  62. package/src/components/data-display/Popover/Popover.stories.tsx +0 -295
  63. package/src/components/data-display/Popover/Popover.test.stories.tsx +0 -1162
  64. package/src/components/data-display/Progress/Progress.stories.tsx +0 -481
  65. package/src/components/data-display/Progress/Progress.test.stories.tsx +0 -2070
  66. package/src/components/data-display/SectionOnboarding/SectionOnboarding.stories.tsx +0 -160
  67. package/src/components/data-display/SectionOnboarding/SectionOnboarding.test.stories.tsx +0 -190
  68. package/src/components/data-display/Sheet/Sheet.stories.tsx +0 -883
  69. package/src/components/data-display/Sheet/Sheet.test.stories.tsx +0 -1105
  70. package/src/components/data-display/StatCard/StatCard.stories.tsx +0 -167
  71. package/src/components/data-display/StatCard/StatCard.test.stories.tsx +0 -240
  72. package/src/components/data-display/Stepper/Stepper.stories.tsx +0 -540
  73. package/src/components/data-display/Stepper/Stepper.test.stories.tsx +0 -600
  74. package/src/components/data-display/Table/Table.stories.tsx +0 -803
  75. package/src/components/data-display/Table/Table.test.stories.tsx +0 -369
  76. package/src/components/data-display/Timeline/Timeline.stories.tsx +0 -442
  77. package/src/components/data-display/Timeline/Timeline.test.stories.tsx +0 -930
  78. package/src/components/data-display/TimingDiagram/TimingDiagram.stories.tsx +0 -475
  79. package/src/components/data-display/TimingDiagram/TimingDiagram.test.stories.tsx +0 -734
  80. package/src/components/data-display/Tooltip/Tooltip.stories.tsx +0 -468
  81. package/src/components/data-display/Tooltip/Tooltip.test.stories.tsx +0 -1154
  82. package/src/components/feedback/ConfirmAction/ConfirmAction.stories.tsx +0 -146
  83. package/src/components/feedback/ConfirmAction/ConfirmAction.test.stories.tsx +0 -114
  84. package/src/components/feedback/ConfirmAction/__tests__/confirm-action.test.tsx +0 -288
  85. package/src/components/feedback/Dialog/Dialog.stories.tsx +0 -833
  86. package/src/components/feedback/Dialog/Dialog.test.stories.tsx +0 -964
  87. package/src/components/feedback/Dialog/__tests__/dialog-content-spacing.test.tsx +0 -66
  88. package/src/components/feedback/Modal/Modal.stories.tsx +0 -765
  89. package/src/components/feedback/Modal/Modal.test.stories.tsx +0 -251
  90. package/src/components/feedback/Sonner/Sonner.stories.tsx +0 -698
  91. package/src/components/feedback/Sonner/Sonner.test.stories.tsx +0 -896
  92. package/src/components/feedback/StackedModal/StackedModal.stories.tsx +0 -1783
  93. package/src/components/feedback/StackedModal/StackedModal.test.stories.tsx +0 -973
  94. package/src/components/feedback/StackedModal/__tests__/stacked-modal-viewport.test.tsx +0 -104
  95. package/src/components/feedback/Toast/Toast.stories.tsx +0 -548
  96. package/src/components/feedback/Toast/Toast.test.stories.tsx +0 -834
  97. package/src/components/feedback/TutorialOverlay/TutorialOverlay.stories.tsx +0 -691
  98. package/src/components/feedback/TutorialOverlay/TutorialOverlay.test.stories.tsx +0 -634
  99. package/src/components/form/AddressAutocomplete/AddressAutocomplete.stories.tsx +0 -665
  100. package/src/components/form/AddressAutocomplete/AddressAutocomplete.test.stories.tsx +0 -727
  101. package/src/components/form/Autocomplete/Autocomplete.stories.tsx +0 -715
  102. package/src/components/form/Autocomplete/Autocomplete.test.stories.tsx +0 -825
  103. package/src/components/form/Button/Button.stories.tsx +0 -365
  104. package/src/components/form/Button/Button.test.stories.tsx +0 -607
  105. package/src/components/form/Calendar/Calendar.stories.tsx +0 -349
  106. package/src/components/form/Calendar/Calendar.test.stories.tsx +0 -464
  107. package/src/components/form/CepField/CepField.stories.tsx +0 -138
  108. package/src/components/form/CepField/CepField.test.stories.tsx +0 -281
  109. package/src/components/form/Checkbox/Checkbox.stories.tsx +0 -265
  110. package/src/components/form/Checkbox/Checkbox.test.stories.tsx +0 -181
  111. package/src/components/form/CodeEditor/CodeEditor.stories.tsx +0 -871
  112. package/src/components/form/CodeEditor/CodeEditor.test.stories.tsx +0 -574
  113. package/src/components/form/Command/Command.stories.tsx +0 -580
  114. package/src/components/form/Command/Command.test.stories.tsx +0 -215
  115. package/src/components/form/CreatableSelect/CreatableSelect.stories.tsx +0 -112
  116. package/src/components/form/CreatableSelect/CreatableSelect.test.stories.tsx +0 -134
  117. package/src/components/form/Form/Form.stories.tsx +0 -687
  118. package/src/components/form/Form/Form.test.stories.tsx +0 -601
  119. package/src/components/form/Input/Input.stories.tsx +0 -260
  120. package/src/components/form/Input/Input.test.stories.tsx +0 -1191
  121. package/src/components/form/InputOTP/InputOTP.stories.tsx +0 -774
  122. package/src/components/form/InputOTP/InputOTP.test.stories.tsx +0 -588
  123. package/src/components/form/Label/Label.stories.tsx +0 -473
  124. package/src/components/form/Label/Label.test.stories.tsx +0 -915
  125. package/src/components/form/Menubar/Menubar.stories.tsx +0 -472
  126. package/src/components/form/Menubar/Menubar.test.stories.tsx +0 -584
  127. package/src/components/form/PasswordStrength/PasswordStrength.stories.tsx +0 -562
  128. package/src/components/form/PasswordStrength/PasswordStrength.test.stories.tsx +0 -327
  129. package/src/components/form/PhoneInput/PhoneInput.stories.tsx +0 -495
  130. package/src/components/form/PhoneInput/PhoneInput.test.stories.tsx +0 -666
  131. package/src/components/form/RadioGroup/RadioGroup.stories.tsx +0 -518
  132. package/src/components/form/RadioGroup/RadioGroup.test.stories.tsx +0 -685
  133. package/src/components/form/RichTextEditor/RichTextEditor.stories.tsx +0 -261
  134. package/src/components/form/RichTextEditor/RichTextEditor.test.stories.tsx +0 -491
  135. package/src/components/form/SearchPalette/SearchPalette.stories.tsx +0 -135
  136. package/src/components/form/Select/Select.stories.tsx +0 -364
  137. package/src/components/form/Select/Select.test.stories.tsx +0 -985
  138. package/src/components/form/Slider/Slider.stories.tsx +0 -418
  139. package/src/components/form/Slider/Slider.test.stories.tsx +0 -1042
  140. package/src/components/form/Switch/Switch.stories.tsx +0 -697
  141. package/src/components/form/Switch/Switch.test.stories.tsx +0 -597
  142. package/src/components/form/Textarea/Textarea.stories.tsx +0 -473
  143. package/src/components/form/Textarea/Textarea.test.stories.tsx +0 -702
  144. package/src/components/form/Toggle/Toggle.stories.tsx +0 -638
  145. package/src/components/form/Toggle/Toggle.test.stories.tsx +0 -1159
  146. package/src/components/form/ToggleGroup/ToggleGroup.stories.tsx +0 -617
  147. package/src/components/form/ToggleGroup/ToggleGroup.test.stories.tsx +0 -915
  148. package/src/components/form/UploadButton/UploadButton.stories.tsx +0 -367
  149. package/src/components/form/UploadButton/UploadButton.test.stories.tsx +0 -573
  150. package/src/components/form/total-form/total-form.test.tsx +0 -214
  151. package/src/components/layout/Accordion/Accordion.stories.tsx +0 -694
  152. package/src/components/layout/Accordion/Accordion.test.stories.tsx +0 -1344
  153. package/src/components/layout/Card/Card.stories.tsx +0 -591
  154. package/src/components/layout/Card/Card.test.stories.tsx +0 -1134
  155. package/src/components/layout/CardGrid/__tests__/CardGrid.test.tsx +0 -92
  156. package/src/components/layout/Collapsible/Collapsible.stories.tsx +0 -180
  157. package/src/components/layout/Collapsible/Collapsible.test.stories.tsx +0 -308
  158. package/src/components/layout/Container/Container.stories.tsx +0 -557
  159. package/src/components/layout/Container/Container.test.stories.tsx +0 -745
  160. package/src/components/layout/ContentToolbar/ContentToolbar.stories.tsx +0 -129
  161. package/src/components/layout/ContentToolbar/ContentToolbar.test.stories.tsx +0 -251
  162. package/src/components/layout/ContentToolbar/__tests__/ColumnsMenu.test.tsx +0 -39
  163. package/src/components/layout/ContentToolbar/__tests__/MultiSelectDropdown.test.tsx +0 -131
  164. package/src/components/layout/ContentToolbar/__tests__/SavedViewsMenu.test.tsx +0 -99
  165. package/src/components/layout/Dashboard/Dashboard.stories.tsx +0 -104
  166. package/src/components/layout/Dashboard/Dashboard.test.stories.tsx +0 -190
  167. package/src/components/layout/Drawer/Drawer.stories.tsx +0 -658
  168. package/src/components/layout/Drawer/Drawer.test.stories.tsx +0 -1343
  169. package/src/components/layout/Resizable/Resizable.stories.tsx +0 -1039
  170. package/src/components/layout/Resizable/Resizable.test.stories.tsx +0 -754
  171. package/src/components/layout/ScrollArea/ScrollArea.stories.tsx +0 -651
  172. package/src/components/layout/ScrollArea/ScrollArea.test.stories.tsx +0 -619
  173. package/src/components/layout/Separator/Separator.stories.tsx +0 -563
  174. package/src/components/layout/Separator/Separator.test.stories.tsx +0 -518
  175. package/src/components/layout/SettingsLayout/SettingsLayout.stories.tsx +0 -192
  176. package/src/components/layout/SettingsLayout/SettingsLayout.test.stories.tsx +0 -175
  177. package/src/components/layout/Sidebar/Sidebar.stories.tsx +0 -609
  178. package/src/components/layout/Sidebar/Sidebar.test.stories.tsx +0 -1324
  179. package/src/components/layout/Skeleton/Skeleton.stories.tsx +0 -689
  180. package/src/components/layout/Skeleton/Skeleton.test.stories.tsx +0 -521
  181. package/src/components/layout/Spacer/Spacer.stories.tsx +0 -502
  182. package/src/components/layout/Spacer/Spacer.test.stories.tsx +0 -474
  183. package/src/components/layout/TableFilter/TableFilter.stories.tsx +0 -82
  184. package/src/components/layout/TableFilter/TableFilter.test.stories.tsx +0 -87
  185. package/src/components/navigation/Breadcrumbs/Breadcrumbs.stories.tsx +0 -638
  186. package/src/components/navigation/Breadcrumbs/Breadcrumbs.test.stories.tsx +0 -1008
  187. package/src/components/navigation/CommandPalette/CommandPalette.stories.tsx +0 -386
  188. package/src/components/navigation/CommandPalette/CommandPalette.test.stories.tsx +0 -435
  189. package/src/components/navigation/ContextMenu/ContextMenu.stories.tsx +0 -614
  190. package/src/components/navigation/ContextMenu/ContextMenu.test.stories.tsx +0 -845
  191. package/src/components/navigation/DropdownMenu/DropdownMenu.stories.tsx +0 -578
  192. package/src/components/navigation/DropdownMenu/DropdownMenu.test.stories.tsx +0 -660
  193. package/src/components/navigation/NavigationMenu/stories/NavigationMenu.stories.tsx +0 -516
  194. package/src/components/navigation/NavigationMenu/stories/NavigationMenu.test.stories.tsx +0 -935
  195. package/src/components/navigation/NavigationMenu/stories/NavigationMenuHorizontal.stories.tsx +0 -501
  196. package/src/components/navigation/NavigationMenu/stories/NavigationMenuVertical.stories.tsx +0 -453
  197. package/src/components/navigation/Pagination/Pagination.stories.tsx +0 -602
  198. package/src/components/navigation/Pagination/Pagination.test.stories.tsx +0 -520
  199. package/src/components/navigation/Tabs/Tabs.stories.tsx +0 -1004
  200. package/src/components/navigation/Tabs/Tabs.test.stories.tsx +0 -1225
  201. package/src/components/typography/Blockquote/Blockquote.stories.tsx +0 -359
  202. package/src/components/typography/Blockquote/Blockquote.test.stories.tsx +0 -432
  203. package/src/components/typography/Code/Code.stories.tsx +0 -686
  204. package/src/components/typography/Code/Code.test.stories.tsx +0 -703
  205. package/src/components/typography/Heading/Heading.stories.tsx +0 -451
  206. package/src/components/typography/Heading/Heading.test.stories.tsx +0 -830
  207. package/src/components/typography/Paragraph/Paragraph.stories.tsx +0 -280
  208. package/src/components/typography/Paragraph/Paragraph.test.stories.tsx +0 -231
  209. package/src/components/typography/Text/Text.stories.tsx +0 -359
  210. package/src/components/typography/Text/Text.test.stories.tsx +0 -759
  211. package/src/components/utility/AnimatedIcon/AnimatedIcon.stories.tsx +0 -945
  212. package/src/components/utility/AnimatedIcon/AnimatedIcon.test.stories.tsx +0 -603
  213. package/src/components/utility/AspectRatio/AspectRatio.stories.tsx +0 -414
  214. package/src/components/utility/AspectRatio/AspectRatio.test.stories.tsx +0 -859
  215. package/src/components/utility/InfiniteScroll/InfiniteScroll.stories.tsx +0 -620
  216. package/src/components/utility/InfiniteScroll/InfiniteScroll.test.stories.tsx +0 -361
  217. package/src/components/utility/InstallPrompt/InstallPrompt.stories.tsx +0 -118
  218. package/src/components/utility/InstallPrompt/InstallPrompt.test.stories.tsx +0 -83
  219. package/src/components/utility/InstallPrompt/__tests__/InstallPrompt.ios.test.tsx +0 -65
  220. package/src/components/utility/InstallPrompt/__tests__/usePwaInstall.test.tsx +0 -271
  221. package/src/components/utility/Portal/Portal.stories.tsx +0 -340
  222. package/src/components/utility/Portal/Portal.test.stories.tsx +0 -2086
  223. package/src/components/utility/Transition/Transition.stories.tsx +0 -493
  224. package/src/components/utility/Transition/Transition.test.stories.tsx +0 -854
  225. package/src/components/utility/VirtualList/VirtualList.stories.tsx +0 -1073
  226. package/src/components/utility/VirtualList/VirtualList.test.stories.tsx +0 -1085
  227. package/src/components/utility/WorkflowStep/WorkflowStep.stories.tsx +0 -431
  228. package/src/components/utility/WorkflowStep/WorkflowStep.test.stories.tsx +0 -364
  229. /package/src/{button.tsx → button/button.tsx} +0 -0
@@ -1,432 +0,0 @@
1
- import { Box, Stack } from '@mui/material';
2
- import type { Meta, StoryObj } from '@storybook/react-vite';
3
- import { expect, userEvent, waitFor, within } from 'storybook/test';
4
- import React from 'react';
5
-
6
- import { Blockquote } from './Blockquote';
7
-
8
- const meta: Meta<typeof Blockquote> = {
9
- title: 'Typography/Blockquote/Tests',
10
- component: Blockquote,
11
- parameters: {
12
- layout: 'centered',
13
- chromatic: { disableSnapshot: false },
14
- },
15
- tags: ['autodocs', 'test', 'component:Blockquote'],
16
- };
17
-
18
- export default meta;
19
- export type Story = StoryObj<typeof meta>;
20
-
21
- // Test 1: Basic Interaction Test
22
- export const BasicInteraction: Story = {
23
- args: {
24
- children: 'This is a test blockquote for basic interaction testing.',
25
- author: 'Test Author',
26
- source: 'Test Source',
27
- },
28
- play: async ({ canvasElement }) => {
29
- const canvas = within(canvasElement);
30
-
31
- // Verify blockquote element exists
32
- const blockquote = canvas.getByRole('blockquote');
33
- await expect(blockquote).toBeInTheDocument();
34
-
35
- // Verify content is displayed
36
- await expect(
37
- canvas.getByText('This is a test blockquote for basic interaction testing.'),
38
- ).toBeInTheDocument();
39
-
40
- // Verify author citation
41
- await expect(canvas.getByText('— Test Author')).toBeInTheDocument();
42
-
43
- // Verify source citation
44
- await expect(canvas.getByText('Test Source')).toBeInTheDocument();
45
- },
46
- };
47
-
48
- // Test 2: State Change Test
49
- const StateChangeComponent = () => {
50
- const [variant, setVariant] = React.useState<'default' | 'bordered' | 'citation'>('default');
51
-
52
- return (
53
- <Box>
54
- <Stack direction="row" spacing={2} sx={{ mb: 2 }}>
55
- <button onClick={() => setVariant('default')}>Default</button>
56
- <button onClick={() => setVariant('bordered')}>Bordered</button>
57
- <button onClick={() => setVariant('citation')}>Citation</button>
58
- </Stack>
59
- <Blockquote variant={variant} author="Test Author">
60
- This blockquote changes variants dynamically.
61
- </Blockquote>
62
- </Box>
63
- );
64
- };
65
-
66
- export const StateChange: Story = {
67
- render: () => <StateChangeComponent />,
68
- play: async ({ canvasElement }) => {
69
- const canvas = within(canvasElement);
70
-
71
- // Test default state
72
- const blockquote = canvas.getByRole('blockquote');
73
- await expect(blockquote).toBeInTheDocument();
74
-
75
- // Click bordered button
76
- const borderedBtn = canvas.getByText('Bordered');
77
- await userEvent.click(borderedBtn);
78
- await waitFor(() => {
79
- expect(blockquote).toBeInTheDocument();
80
- });
81
-
82
- // Click citation button
83
- const citationBtn = canvas.getByText('Citation');
84
- await userEvent.click(citationBtn);
85
- await waitFor(() => {
86
- expect(blockquote).toBeInTheDocument();
87
- });
88
-
89
- // Click default button
90
- const defaultBtn = canvas.getByText('Default');
91
- await userEvent.click(defaultBtn);
92
- await waitFor(() => {
93
- expect(blockquote).toBeInTheDocument();
94
- });
95
- },
96
- };
97
-
98
- // Test 3: Keyboard Navigation Test
99
- export const KeyboardNavigation: Story = {
100
- args: {
101
- children: 'Keyboard navigation test blockquote.',
102
- author: 'Test Author',
103
- tabIndex: 0,
104
- },
105
- play: async ({ canvasElement }) => {
106
- const canvas = within(canvasElement);
107
-
108
- const blockquote = canvas.getByRole('blockquote');
109
-
110
- // Test tab navigation
111
- await userEvent.tab();
112
-
113
- // Test keyboard accessibility
114
- await expect(blockquote).toBeInTheDocument();
115
-
116
- // Test that content is accessible
117
- await expect(canvas.getByText('Keyboard navigation test blockquote.')).toBeInTheDocument();
118
- },
119
- };
120
-
121
- // Test 4: Screen Reader Test
122
- export const ScreenReader: Story = {
123
- args: {
124
- children: 'This blockquote should be accessible to screen readers.',
125
- author: 'Accessibility Author',
126
- source: 'WCAG Guidelines',
127
- },
128
- play: async ({ canvasElement }) => {
129
- const canvas = within(canvasElement);
130
-
131
- // Verify semantic blockquote element
132
- const blockquote = canvas.getByRole('blockquote');
133
- await expect(blockquote).toBeInTheDocument();
134
-
135
- // Verify content accessibility
136
- await expect(
137
- canvas.getByText('This blockquote should be accessible to screen readers.'),
138
- ).toBeInTheDocument();
139
-
140
- // Verify citation accessibility
141
- await expect(canvas.getByText('— Accessibility Author')).toBeInTheDocument();
142
- await expect(canvas.getByText('WCAG Guidelines')).toBeInTheDocument();
143
-
144
- // Verify proper semantic structure
145
- expect(blockquote.tagName.toLowerCase()).toBe('blockquote');
146
- },
147
- };
148
-
149
- // Test 5: Focus Management Test
150
- export const FocusManagement: Story = {
151
- render: () => (
152
- <Stack spacing={2}>
153
- <button>Before Blockquote</button>
154
- <Blockquote tabIndex={0} author="Focus Test">
155
- This blockquote can receive focus for testing.
156
- </Blockquote>
157
- <button>After Blockquote</button>
158
- </Stack>
159
- ),
160
- play: async ({ canvasElement }) => {
161
- const canvas = within(canvasElement);
162
-
163
- const beforeBtn = canvas.getByText('Before Blockquote');
164
- const blockquote = canvas.getByRole('blockquote');
165
- const afterBtn = canvas.getByText('After Blockquote');
166
-
167
- // Start from before button
168
- await userEvent.click(beforeBtn);
169
- await waitFor(() => expect(beforeBtn).toHaveFocus());
170
-
171
- // Tab to blockquote
172
- await userEvent.tab();
173
- await waitFor(() => expect(blockquote).toHaveFocus());
174
-
175
- // Tab to after button
176
- await userEvent.tab();
177
- await waitFor(() => expect(afterBtn).toHaveFocus());
178
- },
179
- };
180
-
181
- // Test 6: Responsive Design Test
182
- export const ResponsiveDesign: Story = {
183
- parameters: {
184
- viewport: {
185
- viewports: {
186
- mobile: { name: 'Mobile', styles: { width: '375px', height: '667px' } },
187
- tablet: { name: 'Tablet', styles: { width: '768px', height: '1024px' } },
188
- desktop: { name: 'Desktop', styles: { width: '1200px', height: '800px' } },
189
- },
190
- },
191
- },
192
- args: {
193
- children: 'This blockquote should respond to different screen sizes appropriately.',
194
- author: 'Responsive Author',
195
- source: 'Mobile-First Design',
196
- },
197
- play: async ({ canvasElement }) => {
198
- const canvas = within(canvasElement);
199
-
200
- const blockquote = canvas.getByRole('blockquote');
201
- await expect(blockquote).toBeInTheDocument();
202
-
203
- // Verify content is displayed properly
204
- await expect(
205
- canvas.getByText('This blockquote should respond to different screen sizes appropriately.'),
206
- ).toBeInTheDocument();
207
-
208
- // Test that component maintains semantic structure
209
- expect(blockquote.tagName.toLowerCase()).toBe('blockquote');
210
- },
211
- };
212
-
213
- // Test 7: Theme Variations Test
214
- export const ThemeVariations: Story = {
215
- render: () => (
216
- <Stack spacing={3}>
217
- <Blockquote variant="bordered" color="primary" author="Primary Theme">
218
- Primary color theme test
219
- </Blockquote>
220
- <Blockquote variant="bordered" color="secondary" author="Secondary Theme">
221
- Secondary color theme test
222
- </Blockquote>
223
- <Blockquote variant="bordered" color="success" author="Success Theme">
224
- Success color theme test
225
- </Blockquote>
226
- <Blockquote variant="bordered" color="warning" author="Warning Theme">
227
- Warning color theme test
228
- </Blockquote>
229
- <Blockquote variant="bordered" color="danger" author="Danger Theme">
230
- Danger color theme test
231
- </Blockquote>
232
- <Blockquote variant="bordered" color="neutral" author="Neutral Theme">
233
- Neutral color theme test
234
- </Blockquote>
235
- </Stack>
236
- ),
237
- play: async ({ canvasElement }) => {
238
- const canvas = within(canvasElement);
239
-
240
- // Test that all theme variants render
241
- await expect(canvas.getByText('Primary color theme test')).toBeInTheDocument();
242
- await expect(canvas.getByText('Secondary color theme test')).toBeInTheDocument();
243
- await expect(canvas.getByText('Success color theme test')).toBeInTheDocument();
244
- await expect(canvas.getByText('Warning color theme test')).toBeInTheDocument();
245
- await expect(canvas.getByText('Danger color theme test')).toBeInTheDocument();
246
- await expect(canvas.getByText('Neutral color theme test')).toBeInTheDocument();
247
-
248
- // Verify all blockquotes are rendered
249
- const blockquotes = canvas.getAllByRole('blockquote');
250
- expect(blockquotes).toHaveLength(6);
251
- },
252
- };
253
-
254
- // Test 8: Visual States Test
255
- export const VisualStates: Story = {
256
- render: () => (
257
- <Stack spacing={3}>
258
- <Blockquote variant="default" author="Default Variant">
259
- Default variant visual state
260
- </Blockquote>
261
- <Blockquote variant="bordered" author="Bordered Variant">
262
- Bordered variant with quote icon
263
- </Blockquote>
264
- <Blockquote variant="citation" author="Citation Variant">
265
- Citation variant with centered layout
266
- </Blockquote>
267
- <Blockquote author="Without Source">Blockquote with author but no source</Blockquote>
268
- <Blockquote source="Just Source">Blockquote with source but no author</Blockquote>
269
- <Blockquote>Blockquote without author or source</Blockquote>
270
- </Stack>
271
- ),
272
- play: async ({ canvasElement }) => {
273
- const canvas = within(canvasElement);
274
-
275
- // Verify all visual states render correctly
276
- await expect(canvas.getByText('Default variant visual state')).toBeInTheDocument();
277
- await expect(canvas.getByText('Bordered variant with quote icon')).toBeInTheDocument();
278
- await expect(canvas.getByText('Citation variant with centered layout')).toBeInTheDocument();
279
- await expect(canvas.getByText('Blockquote with author but no source')).toBeInTheDocument();
280
- await expect(canvas.getByText('Blockquote with source but no author')).toBeInTheDocument();
281
- await expect(canvas.getByText('Blockquote without author or source')).toBeInTheDocument();
282
-
283
- // Verify proper citation display
284
- await expect(canvas.getByText('— Default Variant')).toBeInTheDocument();
285
- await expect(canvas.getByText('— Without Source')).toBeInTheDocument();
286
- await expect(canvas.getByText('Just Source')).toBeInTheDocument();
287
-
288
- // Verify all blockquotes are rendered
289
- const blockquotes = canvas.getAllByRole('blockquote');
290
- expect(blockquotes).toHaveLength(6);
291
- },
292
- };
293
-
294
- // Test 9: Performance Test
295
- export const Performance: Story = {
296
- render: () => (
297
- <Stack spacing={1}>
298
- {Array.from({ length: 10 }, (_, index) => (
299
- <Blockquote key={index} variant="default" author={`Author ${index + 1}`}>
300
- Performance test blockquote number {index + 1}. This tests rendering performance with
301
- multiple instances.
302
- </Blockquote>
303
- ))}
304
- </Stack>
305
- ),
306
- play: async ({ canvasElement, step }) => {
307
- const canvas = within(canvasElement);
308
-
309
- await step('Verify multiple blockquotes render efficiently', async () => {
310
- const blockquotes = canvas.getAllByRole('blockquote');
311
- expect(blockquotes).toHaveLength(10);
312
-
313
- // Check that all items rendered
314
- for (let i = 1; i <= 10; i++) {
315
- // Matched on the part that identifies the instance rather than the whole
316
- // sentence, which would break on any wording change.
317
- await expect(
318
- canvas.getByText(new RegExp(`Performance test blockquote number ${i}\\.`)),
319
- ).toBeInTheDocument();
320
- await expect(canvas.getByText(`— Author ${i}`)).toBeInTheDocument();
321
- }
322
- });
323
- },
324
- };
325
-
326
- // Test 10: Edge Cases Test
327
- export const EdgeCases: Story = {
328
- render: () => (
329
- <Stack spacing={3}>
330
- <Blockquote author="" source="">
331
- Empty author and source
332
- </Blockquote>
333
- <Blockquote author="Very Long Author Name That Should Wrap Properly">
334
- Testing with very long author name
335
- </Blockquote>
336
- <Blockquote source="Very Long Source Name That Should Also Wrap Properly On Multiple Lines">
337
- Testing with very long source
338
- </Blockquote>
339
- <Blockquote author="Unicode Author: 你好世界" source="Unicode Source: مرحبا بالعالم">
340
- Unicode content: Lorem ipsum 你好 مرحبا 🌍
341
- </Blockquote>
342
- <Blockquote>{/* Empty content test */}</Blockquote>
343
- </Stack>
344
- ),
345
- play: async ({ canvasElement }) => {
346
- const canvas = within(canvasElement);
347
-
348
- // Verify edge cases render without errors
349
- const blockquotes = canvas.getAllByRole('blockquote');
350
- expect(blockquotes).toHaveLength(5);
351
-
352
- // Test long text handling (partial match due to text wrapping/truncation)
353
- await expect(canvas.getByText(/Very Long Author Name/)).toBeInTheDocument();
354
- await expect(
355
- canvas.getByText('Very Long Source Name That Should Also Wrap Properly On Multiple Lines'),
356
- ).toBeInTheDocument();
357
-
358
- // Test unicode content
359
- await expect(
360
- canvas.getByText(/Unicode content: Lorem ipsum 你好 مرحبا 🌍/),
361
- ).toBeInTheDocument();
362
- await expect(canvas.getByText('— Unicode Author: 你好世界')).toBeInTheDocument();
363
- await expect(canvas.getByText('Unicode Source: مرحبا بالعالم')).toBeInTheDocument();
364
- },
365
- };
366
-
367
- // Test 11: Integration Test
368
- export const Integration: Story = {
369
- render: () => (
370
- <Box sx={{ maxWidth: 600, mx: 'auto' }}>
371
- <h2>Article with Integrated Blockquotes</h2>
372
- <p>This is a sample article that integrates blockquotes naturally within the content flow.</p>
373
-
374
- <Blockquote variant="default" color="primary" author="Steve Jobs">
375
- Innovation distinguishes between a leader and a follower.
376
- </Blockquote>
377
-
378
- <p>
379
- The above quote demonstrates how blockquotes can be seamlessly integrated into article
380
- content. Here's another example with different styling:
381
- </p>
382
-
383
- <Blockquote
384
- variant="citation"
385
- color="secondary"
386
- author="Maya Angelou"
387
- source="I Know Why the Caged Bird Sings"
388
- >
389
- There is no greater agony than bearing an untold story inside you.
390
- </Blockquote>
391
-
392
- <p>Finally, here's a bordered variant that stands out:</p>
393
-
394
- <Blockquote variant="bordered" color="success" author="Albert Einstein">
395
- Imagination is more important than knowledge.
396
- </Blockquote>
397
-
398
- <p>
399
- These blockquotes demonstrate the component's ability to integrate well with other content.
400
- </p>
401
- </Box>
402
- ),
403
- play: async ({ canvasElement }) => {
404
- const canvas = within(canvasElement);
405
-
406
- // Verify article structure
407
- await expect(canvas.getByText('Article with Integrated Blockquotes')).toBeInTheDocument();
408
-
409
- // Verify all three blockquotes are present
410
- const blockquotes = canvas.getAllByRole('blockquote');
411
- expect(blockquotes).toHaveLength(3);
412
-
413
- // Verify specific quotes
414
- await expect(
415
- canvas.getByText('Innovation distinguishes between a leader and a follower.'),
416
- ).toBeInTheDocument();
417
- await expect(
418
- canvas.getByText('There is no greater agony than bearing an untold story inside you.'),
419
- ).toBeInTheDocument();
420
- await expect(
421
- canvas.getByText('Imagination is more important than knowledge.'),
422
- ).toBeInTheDocument();
423
-
424
- // Verify authors
425
- await expect(canvas.getByText('— Steve Jobs')).toBeInTheDocument();
426
- await expect(canvas.getByText('— Maya Angelou')).toBeInTheDocument();
427
- await expect(canvas.getByText('— Albert Einstein')).toBeInTheDocument();
428
-
429
- // Verify source
430
- await expect(canvas.getByText('I Know Why the Caged Bird Sings')).toBeInTheDocument();
431
- },
432
- };