@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,528 +0,0 @@
1
- import Cookie from '@mui/icons-material/Cookie';
2
- import Payment from '@mui/icons-material/Payment';
3
- import Security from '@mui/icons-material/Security';
4
- import Star from '@mui/icons-material/Star';
5
- import Update from '@mui/icons-material/Update';
6
- import { Box, Container, Stack, Typography } from '@mui/material';
7
- import type { Meta, StoryObj } from '@storybook/react-vite';
8
- import React from 'react';
9
- import { fn } from 'storybook/test';
10
-
11
- import { Banner } from './Banner';
12
-
13
- const meta: Meta<typeof Banner> = {
14
- title: 'DataDisplay/Banner',
15
- component: Banner,
16
- parameters: {
17
- layout: 'fullscreen',
18
- docs: {
19
- description: {
20
- component:
21
- 'A page-level notification bar for system messages. Supports multiple variants, inline actions, dismissible functionality, and can be made sticky to affix to the top on scroll.',
22
- },
23
- },
24
- },
25
- tags: ['autodocs', 'component:Banner'],
26
- argTypes: {
27
- variant: {
28
- control: { type: 'select' },
29
- options: ['info', 'success', 'warning', 'critical'],
30
- description: 'Message severity type',
31
- table: {
32
- defaultValue: { summary: 'info' },
33
- type: { summary: 'string' },
34
- },
35
- },
36
- title: {
37
- control: { type: 'text' },
38
- description: 'Main message title text',
39
- table: {
40
- type: { summary: 'string' },
41
- },
42
- },
43
- description: {
44
- control: { type: 'text' },
45
- description: 'Additional description text',
46
- table: {
47
- type: { summary: 'string' },
48
- },
49
- },
50
- dismissible: {
51
- control: { type: 'boolean' },
52
- description: 'Whether banner can be dismissed',
53
- table: {
54
- defaultValue: { summary: 'false' },
55
- type: { summary: 'boolean' },
56
- },
57
- },
58
- sticky: {
59
- control: { type: 'boolean' },
60
- description: 'Affix banner to top on scroll',
61
- table: {
62
- defaultValue: { summary: 'false' },
63
- type: { summary: 'boolean' },
64
- },
65
- },
66
- fullWidth: {
67
- control: { type: 'boolean' },
68
- description: 'Span container or full viewport width',
69
- table: {
70
- defaultValue: { summary: 'false' },
71
- type: { summary: 'boolean' },
72
- },
73
- },
74
- },
75
- };
76
-
77
- export default meta;
78
- type Story = StoryObj<typeof meta>;
79
-
80
- // Basic variants
81
- export const Default: Story = {
82
- args: {
83
- title: 'System Notice',
84
- description: 'This is a default banner message.',
85
- },
86
- parameters: {
87
- layout: 'padded',
88
- },
89
- };
90
-
91
- export const InfoVariant: Story = {
92
- args: {
93
- variant: 'info',
94
- title: 'Information',
95
- description: 'This is an informational banner with useful details.',
96
- },
97
- parameters: {
98
- layout: 'padded',
99
- },
100
- };
101
-
102
- export const Success: Story = {
103
- args: {
104
- variant: 'success',
105
- title: 'Success!',
106
- description: 'Your action was completed successfully.',
107
- },
108
- parameters: {
109
- layout: 'padded',
110
- },
111
- };
112
-
113
- export const WarningVariant: Story = {
114
- args: {
115
- variant: 'warning',
116
- title: 'Warning',
117
- description: 'Please review your settings before continuing.',
118
- },
119
- parameters: {
120
- layout: 'padded',
121
- },
122
- };
123
-
124
- export const Critical: Story = {
125
- args: {
126
- variant: 'critical',
127
- title: 'Critical Error',
128
- description: 'An error occurred that requires immediate attention.',
129
- },
130
- parameters: {
131
- layout: 'padded',
132
- },
133
- };
134
-
135
- // With custom icon
136
- export const WithCustomIcon: Story = {
137
- args: {
138
- variant: 'info',
139
- icon: <Star />,
140
- title: 'Pro Tip',
141
- description: 'You can customize the banner icon to match your content.',
142
- },
143
- parameters: {
144
- layout: 'padded',
145
- },
146
- };
147
-
148
- // Dismissible banner
149
- export const Dismissible: Story = {
150
- args: {
151
- variant: 'info',
152
- title: 'Notification',
153
- description: 'This banner can be closed by clicking the X button.',
154
- dismissible: true,
155
- },
156
- parameters: {
157
- layout: 'padded',
158
- },
159
- };
160
-
161
- // With actions
162
- export const WithActions: Story = {
163
- args: {
164
- variant: 'info',
165
- title: 'System Update Available',
166
- description: 'A new version is available. Update now to get the latest features.',
167
- actions: [
168
- { label: 'Update Now', onClick: fn(), variant: 'primary' },
169
- { label: 'Remind Later', onClick: fn(), variant: 'secondary' },
170
- ],
171
- dismissible: true,
172
- },
173
- parameters: {
174
- layout: 'padded',
175
- },
176
- };
177
-
178
- // With multiple actions
179
- export const MultipleActions: Story = {
180
- args: {
181
- variant: 'warning',
182
- title: 'Security Alert',
183
- description: 'Unusual activity detected on your account.',
184
- actions: [
185
- { label: 'Review Activity', onClick: fn(), variant: 'primary' },
186
- { label: 'Change Password', onClick: fn(), variant: 'secondary' },
187
- { label: 'Contact Support', onClick: fn(), variant: 'secondary' },
188
- ],
189
- dismissible: true,
190
- },
191
- parameters: {
192
- layout: 'padded',
193
- },
194
- };
195
-
196
- // Sticky banner
197
- export const Sticky: Story = {
198
- render: () => (
199
- <Box>
200
- <Banner
201
- variant="warning"
202
- title="Important Notice"
203
- description="This banner will stick to the top when you scroll."
204
- sticky
205
- dismissible
206
- />
207
- <Container sx={{ mt: 2, minHeight: '200vh', py: 4 }}>
208
- <Typography variant="h4" gutterBottom>
209
- Scroll Down to See Sticky Behavior
210
- </Typography>
211
- <Typography variant="body1" paragraph>
212
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt
213
- ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
214
- ullamco laboris nisi ut aliquip ex ea commodo consequat.
215
- </Typography>
216
- <Typography variant="body1" paragraph>
217
- Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
218
- nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
219
- deserunt mollit anim id est laborum.
220
- </Typography>
221
- <Typography variant="body1" paragraph>
222
- Continue scrolling to see the sticky banner remain at the top of the viewport.
223
- </Typography>
224
- {Array.from({ length: 20 }, (_, i) => (
225
- <Typography key={i} variant="body1" paragraph>
226
- Paragraph {i + 1}: More content to demonstrate scrolling behavior. The banner should
227
- remain visible and accessible at all times.
228
- </Typography>
229
- ))}
230
- </Container>
231
- </Box>
232
- ),
233
- };
234
-
235
- // Full width banner
236
- export const FullWidth: Story = {
237
- args: {
238
- variant: 'info',
239
- title: 'Site-wide Announcement',
240
- description: 'This banner spans the full viewport width.',
241
- fullWidth: true,
242
- dismissible: true,
243
- },
244
- };
245
-
246
- // All variants showcase
247
- export const AllVariants: Story = {
248
- render: () => (
249
- <Stack spacing={2} sx={{ p: 2 }}>
250
- <Banner
251
- variant="info"
252
- title="Information"
253
- description="Informational message for users"
254
- dismissible
255
- />
256
- <Banner
257
- variant="success"
258
- title="Success"
259
- description="Operation completed successfully"
260
- dismissible
261
- />
262
- <Banner
263
- variant="warning"
264
- title="Warning"
265
- description="Please review before proceeding"
266
- dismissible
267
- />
268
- <Banner
269
- variant="critical"
270
- title="Critical Error"
271
- description="Immediate action required"
272
- dismissible
273
- />
274
- </Stack>
275
- ),
276
- };
277
-
278
- // Different content variations
279
- export const ContentVariations: Story = {
280
- render: () => (
281
- <Stack spacing={2} sx={{ p: 2 }}>
282
- <Banner variant="info" title="Title Only Banner" />
283
- <Banner variant="success" description="Description only, no title provided" />
284
- <Banner variant="warning" title="With Custom Content">
285
- <Typography variant="body2" sx={{ mt: 1 }}>
286
- Custom content can be added as children to provide more flexibility in layout and styling.
287
- </Typography>
288
- </Banner>
289
- <Banner variant="info" title="Empty Content Test" description="" />
290
- </Stack>
291
- ),
292
- };
293
-
294
- // Real-world examples
295
- const RealWorldExamplesComponent = () => {
296
- const [showCookie, setShowCookie] = React.useState(true);
297
- const [showMaintenance, setShowMaintenance] = React.useState(true);
298
- const [showPromo, setShowPromo] = React.useState(true);
299
-
300
- return (
301
- <Stack spacing={2} sx={{ p: 2 }}>
302
- {showCookie && (
303
- <Banner
304
- variant="info"
305
- icon={<Cookie />}
306
- title="Cookie Notice"
307
- description="We use cookies to enhance your experience and provide personalized content."
308
- actions={[
309
- { label: 'Accept All', onClick: () => setShowCookie(false), variant: 'primary' },
310
- { label: 'Manage Preferences', onClick: fn(), variant: 'secondary' },
311
- ]}
312
- dismissible
313
- onDismiss={() => setShowCookie(false)}
314
- />
315
- )}
316
-
317
- {showMaintenance && (
318
- <Banner
319
- variant="warning"
320
- icon={<Update />}
321
- title="Scheduled Maintenance"
322
- description="System maintenance is scheduled for tonight from 2:00 AM to 4:00 AM EST."
323
- actions={[{ label: 'Learn More', onClick: fn(), variant: 'primary' }]}
324
- dismissible
325
- onDismiss={() => setShowMaintenance(false)}
326
- />
327
- )}
328
-
329
- {showPromo && (
330
- <Banner
331
- variant="success"
332
- icon={<Payment />}
333
- title="Special Offer!"
334
- description="Upgrade to Premium and save 50% for the first three months."
335
- actions={[
336
- { label: 'Upgrade Now', onClick: fn(), variant: 'primary' },
337
- { label: 'View Details', onClick: fn(), variant: 'secondary' },
338
- ]}
339
- dismissible
340
- onDismiss={() => setShowPromo(false)}
341
- />
342
- )}
343
-
344
- <Banner
345
- variant="critical"
346
- icon={<Security />}
347
- title="Security Alert"
348
- description="Please verify your identity to continue using the application."
349
- actions={[{ label: 'Verify Now', onClick: fn(), variant: 'primary' }]}
350
- />
351
- </Stack>
352
- );
353
- };
354
-
355
- export const RealWorldExamples: Story = {
356
- render: RealWorldExamplesComponent,
357
- };
358
-
359
- // Long content handling
360
- export const LongContent: Story = {
361
- args: {
362
- variant: 'info',
363
- title: 'Terms of Service Update - Important Changes to Review',
364
- description:
365
- 'We have updated our terms of service to better protect your privacy and improve our services. These changes include enhanced data protection measures, clearer explanations of how we use your information, new rights regarding your personal data, improved security protocols, and updated billing procedures. Please review the updated terms carefully as they affect your use of our services and may impact your account settings.',
366
- actions: [
367
- { label: 'Review Terms', onClick: fn(), variant: 'primary' },
368
- { label: 'Accept Changes', onClick: fn(), variant: 'secondary' },
369
- ],
370
- dismissible: true,
371
- },
372
- parameters: {
373
- layout: 'padded',
374
- },
375
- };
376
-
377
- // Accessibility showcase
378
- export const AccessibilityFocus: Story = {
379
- render: () => (
380
- <Stack spacing={2} sx={{ p: 2 }}>
381
- <Typography variant="body2" gutterBottom>
382
- These banners are fully accessible with proper ARIA attributes and keyboard navigation
383
- </Typography>
384
- <Banner
385
- variant="info"
386
- title="Accessible Info Banner"
387
- description="This banner uses role='status' and aria-live='polite' for screen readers"
388
- dismissible
389
- actions={[{ label: 'Action Button', onClick: fn(), variant: 'primary' }]}
390
- />
391
- <Banner
392
- variant="critical"
393
- title="Urgent Critical Banner"
394
- description="This critical banner uses role='alert' and aria-live='assertive' for immediate announcement"
395
- dismissible
396
- actions={[{ label: 'Fix Issue', onClick: fn(), variant: 'primary' }]}
397
- />
398
- </Stack>
399
- ),
400
- };
401
-
402
- // Performance with multiple banners
403
- export const MultipleBanners: Story = {
404
- render: () => (
405
- <Stack spacing={1} sx={{ p: 2 }}>
406
- {Array.from({ length: 8 }, (_, i) => (
407
- <Banner
408
- key={i}
409
- variant={(['info', 'success', 'warning', 'critical'] as const)[i % 4]}
410
- title={`Banner ${i + 1}`}
411
- description={`This is banner number ${i + 1} demonstrating performance with multiple instances`}
412
- dismissible={i % 2 === 0}
413
- actions={
414
- i % 3 === 0 ? [{ label: 'Action', onClick: fn(), variant: 'primary' }] : undefined
415
- }
416
- />
417
- ))}
418
- </Stack>
419
- ),
420
- };
421
-
422
- // Required story exports for validation
423
- export const AllSizes: Story = {
424
- render: () => (
425
- <Stack spacing={2} sx={{ p: 2 }}>
426
- <Banner variant="info" title="Standard Banner" description="Standard size banner message" />
427
- <Banner
428
- variant="success"
429
- title="Success Banner"
430
- description="Standard size success message"
431
- />
432
- <Banner
433
- variant="warning"
434
- title="Warning Banner"
435
- description="Standard size warning message"
436
- />
437
- </Stack>
438
- ),
439
- };
440
-
441
- export const AllStates: Story = {
442
- render: () => (
443
- <Stack spacing={2} sx={{ p: 2 }}>
444
- <Banner variant="info" title="Info State" description="Information banner state" />
445
- <Banner variant="success" title="Success State" description="Success banner state" />
446
- <Banner variant="warning" title="Warning State" description="Warning banner state" />
447
- <Banner variant="critical" title="Critical State" description="Critical error banner state" />
448
- </Stack>
449
- ),
450
- };
451
-
452
- export const InteractiveStates: Story = {
453
- render: () => (
454
- <Stack spacing={2} sx={{ p: 2 }}>
455
- <Banner variant="info" title="Standard Banner" description="Non-interactive banner" />
456
- <Banner
457
- variant="success"
458
- title="Dismissible Banner"
459
- description="Click the X to close"
460
- dismissible
461
- />
462
- <Banner
463
- variant="warning"
464
- title="With Actions"
465
- description="Banner with action buttons"
466
- actions={[
467
- { label: 'Primary', onClick: fn(), variant: 'primary' },
468
- { label: 'Secondary', onClick: fn(), variant: 'secondary' },
469
- ]}
470
- />
471
- <Banner
472
- variant="critical"
473
- title="Full Interactive"
474
- description="Dismissible with actions"
475
- dismissible
476
- actions={[{ label: 'Fix Now', onClick: fn(), variant: 'primary' }]}
477
- />
478
- </Stack>
479
- ),
480
- };
481
-
482
- export const Responsive: Story = {
483
- render: () => (
484
- <Box>
485
- <Stack spacing={2} sx={{ p: 2 }}>
486
- <Banner
487
- variant="info"
488
- title="Responsive Banner"
489
- description="This banner adapts to different screen sizes and container widths"
490
- dismissible
491
- actions={[
492
- { label: 'Action One', onClick: fn(), variant: 'primary' },
493
- { label: 'Action Two', onClick: fn(), variant: 'secondary' },
494
- ]}
495
- />
496
- <Box sx={{ maxWidth: 600 }}>
497
- <Banner
498
- variant="success"
499
- title="Medium Container"
500
- description="Banner in a medium-width container"
501
- dismissible
502
- actions={[{ label: 'Action', onClick: fn(), variant: 'primary' }]}
503
- />
504
- </Box>
505
- <Box sx={{ maxWidth: 400 }}>
506
- <Banner
507
- variant="warning"
508
- title="Narrow Container"
509
- description="Banner in a narrow container adapts layout for mobile"
510
- dismissible
511
- />
512
- </Box>
513
- <Box sx={{ maxWidth: 300 }}>
514
- <Banner
515
- variant="critical"
516
- title="Very Narrow"
517
- description="Actions stack on mobile"
518
- actions={[
519
- { label: 'Fix', onClick: fn(), variant: 'primary' },
520
- { label: 'Later', onClick: fn(), variant: 'secondary' },
521
- ]}
522
- dismissible
523
- />
524
- </Box>
525
- </Stack>
526
- </Box>
527
- ),
528
- };