@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.
Files changed (229) hide show
  1. package/package.json +17 -8
  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 -77
  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 -753
  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 -503
  27. package/src/components/data-display/Carousel/Carousel.stories.tsx +0 -607
  28. package/src/components/data-display/Carousel/Carousel.test.stories.tsx +0 -691
  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 -1101
  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 -955
  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 -975
  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 -909
  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 -918
  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 -750
  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 -472
  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 -762
  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,721 +0,0 @@
1
- import Email from '@mui/icons-material/Email';
2
- import Notifications from '@mui/icons-material/Notifications';
3
- import Phone from '@mui/icons-material/Phone';
4
- import Settings from '@mui/icons-material/Settings';
5
- import { Badge, Box, Paper, Stack, Typography } from '@mui/material';
6
- import type { Meta, StoryObj } from '@storybook/react-vite';
7
- import React, { useState } from 'react';
8
-
9
- import { Avatar, AvatarGroup } from './Avatar';
10
-
11
- const meta: Meta<typeof Avatar> = {
12
- title: 'DataDisplay/Avatar',
13
- component: Avatar,
14
- parameters: {
15
- layout: 'centered',
16
- docs: {
17
- description: {
18
- component:
19
- 'A beautiful, animated avatar component with support for images, initials, icons, status indicators, and various visual effects.',
20
- },
21
- },
22
- },
23
- tags: ['autodocs', 'component:Avatar'],
24
- argTypes: {
25
- variant: {
26
- control: { type: 'select' },
27
- options: ['circle', 'square', 'rounded', 'status'],
28
- description: 'The shape variant of the avatar',
29
- },
30
- size: {
31
- control: { type: 'select' },
32
- options: ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'],
33
- description: 'The size of the avatar',
34
- },
35
- color: {
36
- control: { type: 'select' },
37
- options: ['primary', 'secondary', 'success', 'warning', 'error', 'neutral'],
38
- description: 'The color scheme of the avatar',
39
- },
40
- status: {
41
- control: { type: 'select' },
42
- options: ['online', 'offline', 'away', 'busy'],
43
- description: 'Status indicator (only with status variant)',
44
- },
45
- glow: {
46
- control: { type: 'boolean' },
47
- description: 'Add a glowing effect to the avatar',
48
- },
49
- pulse: {
50
- control: { type: 'boolean' },
51
- description: 'Add a pulsing animation to the avatar',
52
- },
53
- bordered: {
54
- control: { type: 'boolean' },
55
- description: 'Add a border to the avatar',
56
- },
57
- loading: {
58
- control: { type: 'boolean' },
59
- description: 'Show loading state with shimmer effect',
60
- },
61
- interactive: {
62
- control: { type: 'boolean' },
63
- description: 'Make the avatar interactive with hover effects',
64
- },
65
- },
66
- };
67
-
68
- export default meta;
69
- type Story = StoryObj<typeof meta>;
70
-
71
- // Basic Variants
72
- export const Default: Story = {
73
- args: {
74
- fallback: 'JD',
75
- },
76
- };
77
-
78
- export const WithImage: Story = {
79
- args: {
80
- src: 'https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=150&h=150&fit=crop&crop=face',
81
- alt: 'John Doe',
82
- },
83
- };
84
-
85
- export const WithInitials: Story = {
86
- args: {
87
- fallback: 'AB',
88
- color: 'secondary',
89
- },
90
- };
91
-
92
- export const WithIcon: Story = {
93
- args: {
94
- icon: <Settings />,
95
- color: 'success',
96
- },
97
- };
98
-
99
- // Size Variations
100
- export const Sizes: Story = {
101
- render: () => (
102
- <Stack direction="row" spacing={2} alignItems="center">
103
- <Avatar size="xs" fallback="XS" />
104
- <Avatar size="sm" fallback="SM" />
105
- <Avatar size="md" fallback="MD" />
106
- <Avatar size="lg" fallback="LG" />
107
- <Avatar size="xl" fallback="XL" />
108
- <Avatar size="xxl" fallback="XXL" />
109
- </Stack>
110
- ),
111
- };
112
-
113
- // Shape Variants
114
- export const Variants: Story = {
115
- render: () => (
116
- <Stack direction="row" spacing={2} alignItems="center">
117
- <Avatar variant="circle" fallback="CI" />
118
- <Avatar variant="square" fallback="SQ" />
119
- <Avatar variant="rounded" fallback="RD" />
120
- <Avatar variant="status" fallback="ST" status="online" />
121
- </Stack>
122
- ),
123
- };
124
-
125
- // Color Variations
126
- export const Colors: Story = {
127
- render: () => (
128
- <Stack direction="row" spacing={2} alignItems="center">
129
- <Avatar color="primary" fallback="PR" />
130
- <Avatar color="secondary" fallback="SC" />
131
- <Avatar color="success" fallback="SU" />
132
- <Avatar color="warning" fallback="WA" />
133
- <Avatar color="error" fallback="ER" />
134
- <Avatar color="neutral" fallback="NT" />
135
- </Stack>
136
- ),
137
- };
138
-
139
- // Status Indicators
140
- export const StatusIndicators: Story = {
141
- render: () => (
142
- <Stack direction="row" spacing={3} alignItems="center">
143
- <Box textAlign="center">
144
- <Avatar variant="status" status="online" fallback="ON" size="lg" />
145
- <Typography variant="caption" display="block" mt={1}>
146
- Online
147
- </Typography>
148
- </Box>
149
- <Box textAlign="center">
150
- <Avatar variant="status" status="offline" fallback="OF" size="lg" />
151
- <Typography variant="caption" display="block" mt={1}>
152
- Offline
153
- </Typography>
154
- </Box>
155
- <Box textAlign="center">
156
- <Avatar variant="status" status="away" fallback="AW" size="lg" />
157
- <Typography variant="caption" display="block" mt={1}>
158
- Away
159
- </Typography>
160
- </Box>
161
- <Box textAlign="center">
162
- <Avatar variant="status" status="busy" fallback="BS" size="lg" />
163
- <Typography variant="caption" display="block" mt={1}>
164
- Busy
165
- </Typography>
166
- </Box>
167
- </Stack>
168
- ),
169
- };
170
-
171
- // Bordered Avatars
172
- export const Bordered: Story = {
173
- render: () => (
174
- <Stack direction="row" spacing={2} alignItems="center">
175
- <Avatar bordered fallback="B1" />
176
- <Avatar bordered variant="square" fallback="B2" color="secondary" />
177
- <Avatar bordered variant="rounded" fallback="B3" color="success" />
178
- <Avatar
179
- bordered
180
- variant="status"
181
- status="online"
182
- src="https://images.unsplash.com/photo-1494790108755-2616b612b789?w=150&h=150&fit=crop&crop=face"
183
- />
184
- </Stack>
185
- ),
186
- };
187
-
188
- // Visual Effects
189
- export const WithGlow: Story = {
190
- args: {
191
- glow: true,
192
- fallback: 'GW',
193
- color: 'primary',
194
- size: 'lg',
195
- },
196
- };
197
-
198
- export const WithPulse: Story = {
199
- args: {
200
- pulse: true,
201
- fallback: 'PL',
202
- color: 'success',
203
- size: 'lg',
204
- },
205
- };
206
-
207
- export const WithGlowAndPulse: Story = {
208
- args: {
209
- glow: true,
210
- pulse: true,
211
- fallback: 'GP',
212
- color: 'warning',
213
- size: 'lg',
214
- },
215
- };
216
-
217
- // Loading States
218
- export const LoadingState: Story = {
219
- args: {
220
- loading: true,
221
- size: 'lg',
222
- },
223
- };
224
-
225
- export const LoadingStatesAllSizes: Story = {
226
- render: () => (
227
- <Stack direction="row" spacing={2} alignItems="center">
228
- <Avatar loading size="xs" />
229
- <Avatar loading size="sm" />
230
- <Avatar loading size="md" />
231
- <Avatar loading size="lg" />
232
- <Avatar loading size="xl" />
233
- <Avatar loading size="xxl" />
234
- </Stack>
235
- ),
236
- };
237
-
238
- // Interactive Avatars
239
- export const Interactive: Story = {
240
- render: () => {
241
- const InteractiveAvatar = () => {
242
- const [clicked, setClicked] = useState(0);
243
- return (
244
- <Stack spacing={2} alignItems="center">
245
- <Avatar
246
- interactive
247
- fallback="CL"
248
- size="lg"
249
- color="primary"
250
- onClick={() => setClicked((c) => c + 1)}
251
- />
252
- <Typography variant="caption">Clicked: {clicked} times</Typography>
253
- </Stack>
254
- );
255
- };
256
- return <InteractiveAvatar />;
257
- },
258
- };
259
-
260
- // Image Error Handling
261
- export const ImageErrorHandling: Story = {
262
- render: () => (
263
- <Stack direction="row" spacing={2} alignItems="center">
264
- <Box textAlign="center">
265
- <Avatar
266
- src="https://invalid-url-that-will-fail.com/image.jpg"
267
- fallback="ER"
268
- alt="Error handling"
269
- size="lg"
270
- />
271
- <Typography variant="caption" display="block" mt={1}>
272
- With Fallback
273
- </Typography>
274
- </Box>
275
- <Box textAlign="center">
276
- <Avatar
277
- src="https://invalid-url-that-will-fail.com/image.jpg"
278
- fallback="NO"
279
- showFallbackOnError={false}
280
- alt="No fallback"
281
- size="lg"
282
- />
283
- <Typography variant="caption" display="block" mt={1}>
284
- No Fallback
285
- </Typography>
286
- </Box>
287
- </Stack>
288
- ),
289
- };
290
-
291
- // Avatar Groups
292
- export const GroupedAvatars: Story = {
293
- render: () => (
294
- <Stack spacing={3}>
295
- <Box>
296
- <Typography variant="subtitle2" gutterBottom>
297
- Small Group
298
- </Typography>
299
- <AvatarGroup max={4}>
300
- <Avatar src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=150&h=150&fit=crop&crop=face" />
301
- <Avatar src="https://images.unsplash.com/photo-1494790108755-2616b612b789?w=150&h=150&fit=crop&crop=face" />
302
- <Avatar src="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=150&h=150&fit=crop&crop=face" />
303
- <Avatar fallback="JD" />
304
- </AvatarGroup>
305
- </Box>
306
- <Box>
307
- <Typography variant="subtitle2" gutterBottom>
308
- Large Group with Overflow
309
- </Typography>
310
- <AvatarGroup max={3}>
311
- <Avatar src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=150&h=150&fit=crop&crop=face" />
312
- <Avatar src="https://images.unsplash.com/photo-1494790108755-2616b612b789?w=150&h=150&fit=crop&crop=face" />
313
- <Avatar src="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=150&h=150&fit=crop&crop=face" />
314
- <Avatar fallback="AL" />
315
- <Avatar fallback="MK" />
316
- <Avatar fallback="PR" />
317
- </AvatarGroup>
318
- </Box>
319
- </Stack>
320
- ),
321
- };
322
-
323
- // Animation Delays
324
- export const AnimationDelays: Story = {
325
- render: () => (
326
- <Stack direction="row" spacing={2} alignItems="center">
327
- <Avatar fallback="0" animationDelay={0} />
328
- <Avatar fallback="200" animationDelay={200} />
329
- <Avatar fallback="400" animationDelay={400} />
330
- <Avatar fallback="600" animationDelay={600} />
331
- <Avatar fallback="800" animationDelay={800} />
332
- </Stack>
333
- ),
334
- };
335
-
336
- // Real World Examples
337
- export const UserProfile: Story = {
338
- render: () => (
339
- <Paper sx={{ p: 3, maxWidth: 400 }}>
340
- <Stack direction="row" spacing={2} alignItems="center">
341
- <Avatar
342
- src="https://images.unsplash.com/photo-1494790108755-2616b612b789?w=150&h=150&fit=crop&crop=face"
343
- alt="Sarah Johnson"
344
- size="xl"
345
- variant="status"
346
- status="online"
347
- bordered
348
- interactive
349
- />
350
- <Box>
351
- <Typography variant="h6">Sarah Johnson</Typography>
352
- <Typography variant="body2" color="text.secondary">
353
- Product Manager
354
- </Typography>
355
- <Typography variant="caption" sx={{ color: 'success.main' }}>
356
- ● Online
357
- </Typography>
358
- </Box>
359
- </Stack>
360
- </Paper>
361
- ),
362
- };
363
-
364
- export const TeamMembers: Story = {
365
- render: () => (
366
- <Paper sx={{ p: 3, maxWidth: 500 }}>
367
- <Typography variant="h6" gutterBottom>
368
- Team Members
369
- </Typography>
370
- <Stack spacing={2}>
371
- {[
372
- { name: 'John Smith', role: 'Designer', status: 'online' as const, initials: 'JS' },
373
- { name: 'Emily Davis', role: 'Developer', status: 'busy' as const, initials: 'ED' },
374
- { name: 'Michael Chen', role: 'Manager', status: 'away' as const, initials: 'MC' },
375
- { name: 'Sarah Wilson', role: 'Analyst', status: 'offline' as const, initials: 'SW' },
376
- ].map((member) => (
377
- <Stack key={member.name} direction="row" spacing={2} alignItems="center">
378
- <Avatar
379
- variant="status"
380
- status={member.status}
381
- fallback={member.initials}
382
- interactive
383
- />
384
- <Box flex={1}>
385
- <Typography variant="body1">{member.name}</Typography>
386
- <Typography variant="caption" color="text.secondary">
387
- {member.role}
388
- </Typography>
389
- </Box>
390
- </Stack>
391
- ))}
392
- </Stack>
393
- </Paper>
394
- ),
395
- };
396
-
397
- export const NotificationBadges: Story = {
398
- render: () => (
399
- <Stack direction="row" spacing={3}>
400
- <Badge badgeContent={4} color="primary">
401
- <Avatar icon={<Email />} />
402
- </Badge>
403
- <Badge badgeContent={12} color="error">
404
- <Avatar icon={<Notifications />} />
405
- </Badge>
406
- <Badge variant="dot" color="success">
407
- <Avatar icon={<Phone />} />
408
- </Badge>
409
- </Stack>
410
- ),
411
- };
412
-
413
- // All Combinations
414
- export const AllSizes: Story = {
415
- name: '📏 All Sizes',
416
- render: () => (
417
- <Stack spacing={4} alignItems="center">
418
- <Stack direction="row" spacing={2} alignItems="center">
419
- <Avatar size="xs" fallback="XS" />
420
- <Avatar size="sm" fallback="SM" />
421
- <Avatar size="md" fallback="MD" />
422
- <Avatar size="lg" fallback="LG" />
423
- <Avatar size="xl" fallback="XL" />
424
- <Avatar size="xxl" fallback="XXL" />
425
- </Stack>
426
- <Stack direction="row" spacing={2} alignItems="center">
427
- <Avatar size="xs" src="https://i.pravatar.cc/150?img=3" alt="User avatar" />
428
- <Avatar size="sm" src="https://i.pravatar.cc/150?img=3" alt="User avatar" />
429
- <Avatar size="md" src="https://i.pravatar.cc/150?img=3" alt="User avatar" />
430
- <Avatar size="lg" src="https://i.pravatar.cc/150?img=3" alt="User avatar" />
431
- <Avatar size="xl" src="https://i.pravatar.cc/150?img=3" alt="User avatar" />
432
- <Avatar size="xxl" src="https://i.pravatar.cc/150?img=3" alt="User avatar" />
433
- </Stack>
434
- </Stack>
435
- ),
436
- };
437
-
438
- export const AllVariants: Story = {
439
- name: '🎨 All Variants',
440
- render: () => (
441
- <Stack spacing={4} alignItems="center">
442
- <Stack direction="row" spacing={2} alignItems="center">
443
- <Avatar variant="circle" fallback="CI" />
444
- <Avatar variant="square" fallback="SQ" />
445
- <Avatar variant="rounded" fallback="RD" />
446
- <Avatar variant="status" status="online" fallback="ST" />
447
- </Stack>
448
- <Stack direction="row" spacing={2} alignItems="center">
449
- <Avatar variant="circle" src="https://i.pravatar.cc/150?img=1" alt="Circle avatar" />
450
- <Avatar variant="square" src="https://i.pravatar.cc/150?img=2" alt="Square avatar" />
451
- <Avatar variant="rounded" src="https://i.pravatar.cc/150?img=3" alt="Rounded avatar" />
452
- <Avatar
453
- variant="status"
454
- status="online"
455
- src="https://i.pravatar.cc/150?img=4"
456
- alt="Status avatar"
457
- />
458
- </Stack>
459
- </Stack>
460
- ),
461
- };
462
-
463
- export const AllStates: Story = {
464
- name: '🔄 All States',
465
- render: () => (
466
- <Stack spacing={4} alignItems="center">
467
- <Stack direction="row" spacing={2} alignItems="center">
468
- <Avatar fallback="DT" />
469
- <Avatar fallback="LD" loading />
470
- <Avatar fallback="GL" glow />
471
- <Avatar fallback="PL" pulse />
472
- <Avatar fallback="BD" bordered />
473
- <Avatar fallback="IN" interactive />
474
- </Stack>
475
- <Stack direction="row" spacing={2} alignItems="center">
476
- <Avatar variant="status" status="online" fallback="ON" />
477
- <Avatar variant="status" status="offline" fallback="OF" />
478
- <Avatar variant="status" status="away" fallback="AW" />
479
- <Avatar variant="status" status="busy" fallback="BS" />
480
- </Stack>
481
- </Stack>
482
- ),
483
- };
484
-
485
- export const InteractiveStates: Story = {
486
- name: '🎮 Interactive States',
487
- args: {
488
- fallback: 'IN',
489
- interactive: true,
490
- },
491
- render: (args) => (
492
- <Stack spacing={4} alignItems="center">
493
- <Typography variant="caption">Hover over avatars to see effects</Typography>
494
- <Stack direction="row" spacing={2}>
495
- <Avatar {...args} />
496
- <Avatar {...args} glow />
497
- <Avatar {...args} pulse />
498
- <Avatar {...args} bordered />
499
- </Stack>
500
- </Stack>
501
- ),
502
- };
503
-
504
- export const Responsive: Story = {
505
- name: '📱 Responsive',
506
- parameters: {
507
- viewport: {
508
- defaultViewport: 'mobile1',
509
- },
510
- },
511
- render: () => (
512
- <Box sx={{ width: '100%', p: 2 }}>
513
- <Stack spacing={2}>
514
- <Typography variant="h6">Responsive Avatar Layout</Typography>
515
- <Stack direction="row" spacing={1} flexWrap="wrap">
516
- <Avatar size="xs" fallback="A" />
517
- <Avatar size="sm" fallback="B" />
518
- <Avatar size="md" fallback="C" />
519
- <Avatar size="lg" fallback="D" />
520
- </Stack>
521
- <AvatarGroup max={3}>
522
- <Avatar fallback="U1" />
523
- <Avatar fallback="U2" />
524
- <Avatar fallback="U3" />
525
- <Avatar fallback="U4" />
526
- <Avatar fallback="U5" />
527
- </AvatarGroup>
528
- </Stack>
529
- </Box>
530
- ),
531
- };
532
-
533
- export const AllSizesWithEffects: Story = {
534
- render: () => (
535
- <Stack spacing={3}>
536
- <Stack direction="row" spacing={2} alignItems="center">
537
- <Typography variant="caption" sx={{ width: 80 }}>
538
- Normal:
539
- </Typography>
540
- <Avatar size="xs" fallback="XS" />
541
- <Avatar size="sm" fallback="SM" />
542
- <Avatar size="md" fallback="MD" />
543
- <Avatar size="lg" fallback="LG" />
544
- <Avatar size="xl" fallback="XL" />
545
- <Avatar size="xxl" fallback="XXL" />
546
- </Stack>
547
- <Stack direction="row" spacing={2} alignItems="center">
548
- <Typography variant="caption" sx={{ width: 80 }}>
549
- Glow:
550
- </Typography>
551
- <Avatar size="xs" fallback="XS" glow color="primary" />
552
- <Avatar size="sm" fallback="SM" glow color="secondary" />
553
- <Avatar size="md" fallback="MD" glow color="success" />
554
- <Avatar size="lg" fallback="LG" glow color="warning" />
555
- <Avatar size="xl" fallback="XL" glow color="error" />
556
- <Avatar size="xxl" fallback="XXL" glow color="neutral" />
557
- </Stack>
558
- <Stack direction="row" spacing={2} alignItems="center">
559
- <Typography variant="caption" sx={{ width: 80 }}>
560
- Pulse:
561
- </Typography>
562
- <Avatar size="xs" fallback="XS" pulse color="primary" />
563
- <Avatar size="sm" fallback="SM" pulse color="secondary" />
564
- <Avatar size="md" fallback="MD" pulse color="success" />
565
- <Avatar size="lg" fallback="LG" pulse color="warning" />
566
- <Avatar size="xl" fallback="XL" pulse color="error" />
567
- <Avatar size="xxl" fallback="XXL" pulse color="neutral" />
568
- </Stack>
569
- <Stack direction="row" spacing={2} alignItems="center">
570
- <Typography variant="caption" sx={{ width: 80 }}>
571
- Interactive:
572
- </Typography>
573
- <Avatar size="xs" fallback="XS" interactive />
574
- <Avatar size="sm" fallback="SM" interactive />
575
- <Avatar size="md" fallback="MD" interactive />
576
- <Avatar size="lg" fallback="LG" interactive />
577
- <Avatar size="xl" fallback="XL" interactive />
578
- <Avatar size="xxl" fallback="XXL" interactive />
579
- </Stack>
580
- </Stack>
581
- ),
582
- };
583
-
584
- // Responsive Layout
585
- export const ResponsiveGrid: Story = {
586
- render: () => (
587
- <Box sx={{ width: '100%', maxWidth: 600 }}>
588
- <Box
589
- sx={{
590
- display: 'grid',
591
- gridTemplateColumns: {
592
- xs: 'repeat(4, 1fr)',
593
- sm: 'repeat(6, 1fr)',
594
- md: 'repeat(8, 1fr)',
595
- },
596
- gap: 2,
597
- }}
598
- >
599
- {Array.from({ length: 24 }, (_, i) => (
600
- <Avatar
601
- key={i}
602
- fallback={`U${i + 1}`}
603
- color={
604
- ['primary', 'secondary', 'success', 'warning', 'error', 'neutral'][i % 6] as
605
- | 'primary'
606
- | 'secondary'
607
- | 'success'
608
- | 'warning'
609
- | 'error'
610
- | 'neutral'
611
- }
612
- interactive
613
- />
614
- ))}
615
- </Box>
616
- </Box>
617
- ),
618
- };
619
-
620
- // Accessibility Demo
621
- export const AccessibilityDemo: Story = {
622
- render: () => (
623
- <Stack spacing={3}>
624
- <Typography variant="h6">Keyboard Navigation & Screen Reader Support</Typography>
625
- <Stack direction="row" spacing={2}>
626
- <Avatar
627
- fallback="KB"
628
- interactive
629
- onClick={() => window.alert('Avatar clicked!')}
630
- aria-label="Keyboard navigable avatar"
631
- />
632
- <Avatar
633
- src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=150&h=150&fit=crop&crop=face"
634
- alt="John Doe - Senior Developer"
635
- interactive
636
- onClick={() => window.alert('John Doe clicked!')}
637
- />
638
- <Avatar
639
- icon={<Settings />}
640
- interactive
641
- onClick={() => window.alert('Settings clicked!')}
642
- aria-label="Settings avatar button"
643
- />
644
- </Stack>
645
- <Typography variant="caption" color="text.secondary">
646
- Tab through the avatars and press Enter or Space to activate
647
- </Typography>
648
- </Stack>
649
- ),
650
- };
651
-
652
- // Edge Cases
653
- export const EdgeCases: Story = {
654
- render: () => (
655
- <Stack spacing={2}>
656
- <Stack direction="row" spacing={2} alignItems="center">
657
- <Avatar fallback="" />
658
- <Typography variant="caption">Empty fallback</Typography>
659
- </Stack>
660
- <Stack direction="row" spacing={2} alignItems="center">
661
- <Avatar fallback="VERYLONGTEXT" />
662
- <Typography variant="caption">Long text overflow</Typography>
663
- </Stack>
664
- <Stack direction="row" spacing={2} alignItems="center">
665
- <Avatar fallback="🎉" />
666
- <Typography variant="caption">Emoji support</Typography>
667
- </Stack>
668
- <Stack direction="row" spacing={2} alignItems="center">
669
- <Avatar fallback="中文" />
670
- <Typography variant="caption">Unicode support</Typography>
671
- </Stack>
672
- </Stack>
673
- ),
674
- };
675
-
676
- // Performance Demo
677
- export const PerformanceDemo: Story = {
678
- render: () => {
679
- const PerformanceTest = () => {
680
- const [count, setCount] = useState(50);
681
- return (
682
- <Stack spacing={2}>
683
- <Stack direction="row" spacing={2}>
684
- <button onClick={() => setCount((c) => Math.max(0, c - 10))}>-10</button>
685
- <Typography>Count: {count}</Typography>
686
- <button onClick={() => setCount((c) => c + 10)}>+10</button>
687
- </Stack>
688
- <Box
689
- sx={{
690
- display: 'flex',
691
- flexWrap: 'wrap',
692
- gap: 1,
693
- maxWidth: 600,
694
- maxHeight: 400,
695
- overflow: 'auto',
696
- }}
697
- >
698
- {Array.from({ length: count }, (_, i) => (
699
- <Avatar
700
- key={i}
701
- fallback={`${i}`}
702
- size="sm"
703
- color={
704
- ['primary', 'secondary', 'success', 'warning', 'error', 'neutral'][i % 6] as
705
- | 'primary'
706
- | 'secondary'
707
- | 'success'
708
- | 'warning'
709
- | 'error'
710
- | 'neutral'
711
- }
712
- animationDelay={i * 10}
713
- />
714
- ))}
715
- </Box>
716
- </Stack>
717
- );
718
- };
719
- return <PerformanceTest />;
720
- },
721
- };