@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,658 +0,0 @@
1
- import Analytics from '@mui/icons-material/Analytics';
2
- import Dashboard from '@mui/icons-material/Dashboard';
3
- import Help from '@mui/icons-material/Help';
4
- import Home from '@mui/icons-material/Home';
5
- import MenuIcon from '@mui/icons-material/Menu';
6
- import Notifications from '@mui/icons-material/Notifications';
7
- import Person from '@mui/icons-material/Person';
8
- import Settings from '@mui/icons-material/Settings';
9
- import {
10
- Box,
11
- Button,
12
- Divider,
13
- IconButton,
14
- List,
15
- ListItemButton,
16
- ListItemIcon,
17
- ListItemText,
18
- Stack,
19
- Typography,
20
- } from '@mui/material';
21
- import type { Meta, StoryObj } from '@storybook/react-vite';
22
- import { useState } from 'react';
23
-
24
- import { Drawer, DrawerContent,DrawerHeader } from './Drawer';
25
-
26
- const meta: Meta<typeof Drawer> = {
27
- title: 'Layout/Drawer',
28
- component: Drawer,
29
- parameters: {
30
- layout: 'fullscreen',
31
- },
32
- tags: ['autodocs', 'component:Drawer'],
33
- argTypes: {
34
- variant: {
35
- control: { type: 'select' },
36
- options: ['left', 'right', 'top', 'bottom', 'glass'],
37
- },
38
- width: {
39
- control: { type: 'number' },
40
- },
41
- height: {
42
- control: { type: 'number' },
43
- },
44
- },
45
- };
46
-
47
- export default meta;
48
- type Story = StoryObj<typeof meta>;
49
-
50
- const DefaultComponent = (args: { open: boolean; variant: string; width: number }) => {
51
- const [open, setOpen] = useState(args.open);
52
-
53
- return (
54
- <Box sx={{ display: 'flex', height: '100vh' }}>
55
- <Button
56
- onClick={() => setOpen(true)}
57
- sx={{ position: 'fixed', top: 16, left: 16, zIndex: 1300 }}
58
- >
59
- Open Drawer
60
- </Button>
61
- <Drawer {...args} open={open} onClose={() => setOpen(false)}>
62
- <DrawerHeader onClose={() => setOpen(false)}>
63
- <Typography variant="h6">Navigation</Typography>
64
- </DrawerHeader>
65
- <DrawerContent>
66
- <List>
67
- <ListItemButton>
68
- <ListItemIcon>
69
- <Home />
70
- </ListItemIcon>
71
- <ListItemText primary="Home" />
72
- </ListItemButton>
73
- <ListItemButton>
74
- <ListItemIcon>
75
- <Dashboard />
76
- </ListItemIcon>
77
- <ListItemText primary="Dashboard" />
78
- </ListItemButton>
79
- <ListItemButton>
80
- <ListItemIcon>
81
- <Analytics />
82
- </ListItemIcon>
83
- <ListItemText primary="Analytics" />
84
- </ListItemButton>
85
- <ListItemButton>
86
- <ListItemIcon>
87
- <Settings />
88
- </ListItemIcon>
89
- <ListItemText primary="Settings" />
90
- </ListItemButton>
91
- </List>
92
- </DrawerContent>
93
- </Drawer>
94
- <Box component="main" sx={{ flexGrow: 1, p: 3 }}>
95
- <Typography>Main content area</Typography>
96
- </Box>
97
- </Box>
98
- );
99
- };
100
-
101
- export const Default: Story = {
102
- args: {
103
- open: true,
104
- variant: 'left',
105
- width: 280,
106
- },
107
- render: (args) => <DefaultComponent {...args} />,
108
- };
109
-
110
- const AllVariantsComponent = () => {
111
- const [openDrawers, setOpenDrawers] = useState({
112
- left: false,
113
- right: false,
114
- top: false,
115
- bottom: false,
116
- glass: false,
117
- });
118
-
119
- const toggleDrawer = (variant: keyof typeof openDrawers) => {
120
- setOpenDrawers((prev) => ({
121
- ...prev,
122
- [variant]: !prev[variant],
123
- }));
124
- };
125
-
126
- const DrawerButton = ({
127
- variant,
128
- label,
129
- }: {
130
- variant: keyof typeof openDrawers;
131
- label: string;
132
- }) => (
133
- <Button variant="outlined" onClick={() => toggleDrawer(variant)} sx={{ m: 1 }}>
134
- {label}
135
- </Button>
136
- );
137
-
138
- return (
139
- <Box sx={{ height: '100vh', position: 'relative' }}>
140
- <Stack direction="row" spacing={2} sx={{ p: 2 }}>
141
- <DrawerButton variant="left" label="Left Drawer" />
142
- <DrawerButton variant="right" label="Right Drawer" />
143
- <DrawerButton variant="top" label="Top Drawer" />
144
- <DrawerButton variant="bottom" label="Bottom Drawer" />
145
- <DrawerButton variant="glass" label="Glass Drawer" />
146
- </Stack>
147
-
148
- {/* Left Drawer */}
149
- <Drawer open={openDrawers.left} onClose={() => toggleDrawer('left')} variant="left">
150
- <DrawerHeader onClose={() => toggleDrawer('left')}>Left Navigation</DrawerHeader>
151
- <DrawerContent>
152
- <List>
153
- <ListItemButton>
154
- <ListItemIcon>
155
- <Home />
156
- </ListItemIcon>
157
- <ListItemText primary="Home" />
158
- </ListItemButton>
159
- <ListItemButton>
160
- <ListItemIcon>
161
- <Person />
162
- </ListItemIcon>
163
- <ListItemText primary="Profile" />
164
- </ListItemButton>
165
- </List>
166
- </DrawerContent>
167
- </Drawer>
168
-
169
- {/* Right Drawer */}
170
- <Drawer open={openDrawers.right} onClose={() => toggleDrawer('right')} variant="right">
171
- <DrawerHeader onClose={() => toggleDrawer('right')}>Right Panel</DrawerHeader>
172
- <DrawerContent>
173
- <List>
174
- <ListItemButton>
175
- <ListItemIcon>
176
- <Settings />
177
- </ListItemIcon>
178
- <ListItemText primary="Settings" />
179
- </ListItemButton>
180
- <ListItemButton>
181
- <ListItemIcon>
182
- <Help />
183
- </ListItemIcon>
184
- <ListItemText primary="Help" />
185
- </ListItemButton>
186
- </List>
187
- </DrawerContent>
188
- </Drawer>
189
-
190
- {/* Top Drawer */}
191
- <Drawer open={openDrawers.top} onClose={() => toggleDrawer('top')} variant="top" height={200}>
192
- <DrawerHeader onClose={() => toggleDrawer('top')}>Top Panel</DrawerHeader>
193
- <DrawerContent>
194
- <Typography variant="body2">
195
- This is a top drawer that slides down from the top of the screen.
196
- </Typography>
197
- </DrawerContent>
198
- </Drawer>
199
-
200
- {/* Bottom Drawer */}
201
- <Drawer
202
- open={openDrawers.bottom}
203
- onClose={() => toggleDrawer('bottom')}
204
- variant="bottom"
205
- height={200}
206
- >
207
- <DrawerHeader onClose={() => toggleDrawer('bottom')}>Bottom Panel</DrawerHeader>
208
- <DrawerContent>
209
- <Typography variant="body2">
210
- This is a bottom drawer that slides up from the bottom of the screen.
211
- </Typography>
212
- </DrawerContent>
213
- </Drawer>
214
-
215
- {/* Glass Drawer */}
216
- <Drawer open={openDrawers.glass} onClose={() => toggleDrawer('glass')} variant="glass">
217
- <DrawerHeader onClose={() => toggleDrawer('glass')}>Glass Panel</DrawerHeader>
218
- <DrawerContent>
219
- <Typography variant="body2" sx={{ p: 2 }}>
220
- This drawer uses a glass morphism effect with backdrop blur.
221
- </Typography>
222
- <List>
223
- <ListItemButton>
224
- <ListItemIcon>
225
- <Notifications />
226
- </ListItemIcon>
227
- <ListItemText primary="Notifications" />
228
- </ListItemButton>
229
- </List>
230
- </DrawerContent>
231
- </Drawer>
232
-
233
- {/* Main Content */}
234
- <Box sx={{ p: 4, pt: 10 }}>
235
- <Typography variant="h4" gutterBottom>
236
- Drawer Variants Demo
237
- </Typography>
238
- <Typography variant="body1">
239
- Click the buttons above to open different drawer variants. Each variant demonstrates
240
- different positioning and styling options.
241
- </Typography>
242
- </Box>
243
- </Box>
244
- );
245
- };
246
-
247
- export const AllVariants: Story = {
248
- render: () => <AllVariantsComponent />,
249
- };
250
-
251
- const NavigationDrawerComponent = () => {
252
- const [open, setOpen] = useState(false);
253
- const [persistent, setPersistent] = useState(false);
254
- const [selectedItem, setSelectedItem] = useState('home');
255
-
256
- const navItems = [
257
- { id: 'home', label: 'Home', icon: <Home /> },
258
- { id: 'dashboard', label: 'Dashboard', icon: <Dashboard /> },
259
- { id: 'analytics', label: 'Analytics', icon: <Analytics /> },
260
- { id: 'settings', label: 'Settings', icon: <Settings /> },
261
- { id: 'profile', label: 'Profile', icon: <Person /> },
262
- { id: 'help', label: 'Help', icon: <Help /> },
263
- ];
264
-
265
- return (
266
- <Box sx={{ display: 'flex', height: '100vh' }}>
267
- <Drawer open={open} onClose={() => setOpen(false)} persistent={persistent}>
268
- <DrawerHeader>
269
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
270
- <Box
271
- sx={{
272
- width: 40,
273
- height: 40,
274
- borderRadius: '50%',
275
- bgcolor: 'primary.main',
276
- display: 'flex',
277
- alignItems: 'center',
278
- justifyContent: 'center',
279
- color: 'white',
280
- fontWeight: 'bold',
281
- }}
282
- >
283
- P
284
- </Box>
285
- <Typography variant="h6">Procurement</Typography>
286
- </Box>
287
- </DrawerHeader>
288
- <DrawerContent>
289
- <List>
290
- {navItems.map((item) => (
291
- <ListItemButton
292
- key={item.id}
293
- selected={selectedItem === item.id}
294
- onClick={() => setSelectedItem(item.id)}
295
- >
296
- <ListItemIcon
297
- sx={{
298
- color: selectedItem === item.id ? 'primary.main' : 'inherit',
299
- }}
300
- >
301
- {item.icon}
302
- </ListItemIcon>
303
- <ListItemText primary={item.label} />
304
- </ListItemButton>
305
- ))}
306
- </List>
307
- <Divider sx={{ my: 2 }} />
308
- <Typography variant="caption" sx={{ px: 2, color: 'text.secondary' }}>
309
- Version 1.0.0
310
- </Typography>
311
- </DrawerContent>
312
- </Drawer>
313
-
314
- <Box component="main" sx={{ flexGrow: 1, display: 'flex', flexDirection: 'column' }}>
315
- <Box
316
- sx={{
317
- p: 2,
318
- borderBottom: 1,
319
- borderColor: 'divider',
320
- display: 'flex',
321
- alignItems: 'center',
322
- gap: 2,
323
- }}
324
- >
325
- <IconButton onClick={() => setOpen(!open)}>
326
- <MenuIcon />
327
- </IconButton>
328
- <Typography variant="h6">
329
- {navItems.find((item) => item.id === selectedItem)?.label}
330
- </Typography>
331
- <Box sx={{ marginLeft: 'auto', display: 'flex', gap: 1 }}>
332
- <Button
333
- size="small"
334
- variant={persistent ? 'contained' : 'outlined'}
335
- onClick={() => setPersistent(!persistent)}
336
- >
337
- {persistent ? 'Persistent' : 'Temporary'}
338
- </Button>
339
- </Box>
340
- </Box>
341
- <Box sx={{ p: 3, flex: 1 }}>
342
- <Typography variant="h4" gutterBottom>
343
- {navItems.find((item) => item.id === selectedItem)?.label} Page
344
- </Typography>
345
- <Typography variant="body1">
346
- This is the content for the{' '}
347
- {navItems.find((item) => item.id === selectedItem)?.label.toLowerCase()} section. The
348
- drawer can be toggled using the menu button in the header.
349
- </Typography>
350
- </Box>
351
- </Box>
352
- </Box>
353
- );
354
- };
355
-
356
- export const NavigationDrawer: Story = {
357
- render: () => <NavigationDrawerComponent />,
358
- };
359
-
360
- // Required story exports for validation
361
-
362
- const AllSizesComponent = () => {
363
- const [openDrawers, setOpenDrawers] = useState({
364
- small: false,
365
- medium: false,
366
- large: false,
367
- fullHeight: false,
368
- });
369
-
370
- const toggleDrawer = (size: keyof typeof openDrawers) => {
371
- setOpenDrawers((prev) => ({
372
- ...prev,
373
- [size]: !prev[size],
374
- }));
375
- };
376
-
377
- return (
378
- <Box sx={{ height: '100vh', p: 2 }}>
379
- <Typography variant="h5" gutterBottom>
380
- Drawer Size Variations
381
- </Typography>
382
- <Stack direction="row" spacing={2} sx={{ mb: 3 }}>
383
- <Button variant="outlined" onClick={() => toggleDrawer('small')}>
384
- Small (200px)
385
- </Button>
386
- <Button variant="outlined" onClick={() => toggleDrawer('medium')}>
387
- Medium (300px)
388
- </Button>
389
- <Button variant="outlined" onClick={() => toggleDrawer('large')}>
390
- Large (400px)
391
- </Button>
392
- <Button variant="outlined" onClick={() => toggleDrawer('fullHeight')}>
393
- Full Height
394
- </Button>
395
- </Stack>
396
-
397
- <Drawer open={openDrawers.small} onClose={() => toggleDrawer('small')} width={200}>
398
- <DrawerHeader onClose={() => toggleDrawer('small')}>Small Drawer</DrawerHeader>
399
- <DrawerContent>
400
- <Typography sx={{ p: 2 }}>Width: 200px</Typography>
401
- </DrawerContent>
402
- </Drawer>
403
-
404
- <Drawer open={openDrawers.medium} onClose={() => toggleDrawer('medium')} width={300}>
405
- <DrawerHeader onClose={() => toggleDrawer('medium')}>Medium Drawer</DrawerHeader>
406
- <DrawerContent>
407
- <Typography sx={{ p: 2 }}>Width: 300px</Typography>
408
- </DrawerContent>
409
- </Drawer>
410
-
411
- <Drawer open={openDrawers.large} onClose={() => toggleDrawer('large')} width={400}>
412
- <DrawerHeader onClose={() => toggleDrawer('large')}>Large Drawer</DrawerHeader>
413
- <DrawerContent>
414
- <Typography sx={{ p: 2 }}>Width: 400px</Typography>
415
- </DrawerContent>
416
- </Drawer>
417
-
418
- <Drawer
419
- open={openDrawers.fullHeight}
420
- onClose={() => toggleDrawer('fullHeight')}
421
- variant="top"
422
- height="100%"
423
- >
424
- <DrawerHeader onClose={() => toggleDrawer('fullHeight')}>Full Height Drawer</DrawerHeader>
425
- <DrawerContent>
426
- <Typography sx={{ p: 2 }}>Height: 100% of viewport</Typography>
427
- </DrawerContent>
428
- </Drawer>
429
- </Box>
430
- );
431
- };
432
-
433
- export const AllSizes: Story = {
434
- render: () => <AllSizesComponent />,
435
- };
436
-
437
- const AllStatesComponent = () => {
438
- const [persistent, setPersistent] = useState(true);
439
- const [temporary, setTemporary] = useState(false);
440
- const [withBackdrop, setWithBackdrop] = useState(false);
441
- const [withoutBackdrop, setWithoutBackdrop] = useState(false);
442
-
443
- return (
444
- <Box sx={{ height: '100vh', p: 2 }}>
445
- <Typography variant="h5" gutterBottom>
446
- Drawer States
447
- </Typography>
448
- <Stack direction="row" spacing={2} sx={{ mb: 3 }}>
449
- <Button variant="outlined" onClick={() => setPersistent(!persistent)}>
450
- Persistent State
451
- </Button>
452
- <Button variant="outlined" onClick={() => setTemporary(!temporary)}>
453
- Temporary State
454
- </Button>
455
- <Button variant="outlined" onClick={() => setWithBackdrop(!withBackdrop)}>
456
- With Backdrop
457
- </Button>
458
- <Button variant="outlined" onClick={() => setWithoutBackdrop(!withoutBackdrop)}>
459
- Without Backdrop
460
- </Button>
461
- </Stack>
462
-
463
- <Drawer open={persistent} onClose={() => setPersistent(false)} persistent={true}>
464
- <DrawerHeader onClose={() => setPersistent(false)}>Persistent Drawer</DrawerHeader>
465
- <DrawerContent>
466
- <Typography sx={{ p: 2 }}>This drawer stays open persistently</Typography>
467
- </DrawerContent>
468
- </Drawer>
469
-
470
- <Drawer open={temporary} onClose={() => setTemporary(false)} temporary={true}>
471
- <DrawerHeader onClose={() => setTemporary(false)}>Temporary Drawer</DrawerHeader>
472
- <DrawerContent>
473
- <Typography sx={{ p: 2 }}>This is a temporary drawer</Typography>
474
- </DrawerContent>
475
- </Drawer>
476
-
477
- <Drawer open={withBackdrop} onClose={() => setWithBackdrop(false)} backdrop={true}>
478
- <DrawerHeader onClose={() => setWithBackdrop(false)}>With Backdrop</DrawerHeader>
479
- <DrawerContent>
480
- <Typography sx={{ p: 2 }}>This drawer has a backdrop</Typography>
481
- </DrawerContent>
482
- </Drawer>
483
-
484
- <Drawer open={withoutBackdrop} onClose={() => setWithoutBackdrop(false)} hideBackdrop={true}>
485
- <DrawerHeader onClose={() => setWithoutBackdrop(false)}>Without Backdrop</DrawerHeader>
486
- <DrawerContent>
487
- <Typography sx={{ p: 2 }}>This drawer has no backdrop</Typography>
488
- </DrawerContent>
489
- </Drawer>
490
- </Box>
491
- );
492
- };
493
-
494
- export const AllStates: Story = {
495
- render: () => <AllStatesComponent />,
496
- };
497
-
498
- const InteractiveStatesComponent = () => {
499
- const [drawerOpen, setDrawerOpen] = useState(false);
500
- const [selectedItem, setSelectedItem] = useState<string | null>(null);
501
- const [hoverItem, setHoverItem] = useState<string | null>(null);
502
-
503
- const items = ['Home', 'Dashboard', 'Settings', 'Profile', 'Help'];
504
-
505
- return (
506
- <Box sx={{ height: '100vh', p: 2 }}>
507
- <Typography variant="h5" gutterBottom>
508
- Interactive States Demo
509
- </Typography>
510
- <Button variant="contained" onClick={() => setDrawerOpen(true)}>
511
- Open Interactive Drawer
512
- </Button>
513
-
514
- <Drawer open={drawerOpen} onClose={() => setDrawerOpen(false)}>
515
- <DrawerHeader onClose={() => setDrawerOpen(false)}>Interactive Menu</DrawerHeader>
516
- <DrawerContent>
517
- <List>
518
- {items.map((item) => (
519
- <ListItemButton
520
- key={item}
521
- selected={selectedItem === item}
522
- onClick={() => setSelectedItem(item)}
523
- onMouseEnter={() => setHoverItem(item)}
524
- onMouseLeave={() => setHoverItem(null)}
525
- sx={{
526
- backgroundColor:
527
- hoverItem === item
528
- ? 'action.hover'
529
- : selectedItem === item
530
- ? 'action.selected'
531
- : 'transparent',
532
- }}
533
- >
534
- <ListItemText primary={item} />
535
- </ListItemButton>
536
- ))}
537
- </List>
538
- <Divider sx={{ my: 2 }} />
539
- <Box sx={{ p: 2 }}>
540
- <Typography variant="caption" color="text.secondary">
541
- Selected: {selectedItem || 'None'}
542
- </Typography>
543
- </Box>
544
- </DrawerContent>
545
- </Drawer>
546
- </Box>
547
- );
548
- };
549
-
550
- export const InteractiveStates: Story = {
551
- render: () => <InteractiveStatesComponent />,
552
- };
553
-
554
- const ResponsiveComponent = () => {
555
- const [mobileOpen, setMobileOpen] = useState(false);
556
- const [tabletOpen, setTabletOpen] = useState(false);
557
- const [desktopOpen, setDesktopOpen] = useState(false);
558
-
559
- return (
560
- <Box sx={{ height: '100vh', p: 2 }}>
561
- <Typography variant="h5" gutterBottom>
562
- Responsive Drawer Behavior
563
- </Typography>
564
- <Stack direction="row" spacing={2} sx={{ mb: 3 }}>
565
- <Button variant="outlined" onClick={() => setMobileOpen(true)}>
566
- Mobile View (240px)
567
- </Button>
568
- <Button variant="outlined" onClick={() => setTabletOpen(true)}>
569
- Tablet View (320px)
570
- </Button>
571
- <Button variant="outlined" onClick={() => setDesktopOpen(true)}>
572
- Desktop View (400px)
573
- </Button>
574
- </Stack>
575
-
576
- {/* Mobile Drawer */}
577
- <Drawer open={mobileOpen} onClose={() => setMobileOpen(false)} width={240} variant="left">
578
- <DrawerHeader onClose={() => setMobileOpen(false)}>Mobile Menu</DrawerHeader>
579
- <DrawerContent>
580
- <Typography sx={{ p: 2 }}>Optimized for mobile devices with 240px width</Typography>
581
- <List>
582
- <ListItemButton>
583
- <ListItemIcon>
584
- <Home />
585
- </ListItemIcon>
586
- <ListItemText primary="Home" />
587
- </ListItemButton>
588
- <ListItemButton>
589
- <ListItemIcon>
590
- <Settings />
591
- </ListItemIcon>
592
- <ListItemText primary="Settings" />
593
- </ListItemButton>
594
- </List>
595
- </DrawerContent>
596
- </Drawer>
597
-
598
- {/* Tablet Drawer */}
599
- <Drawer open={tabletOpen} onClose={() => setTabletOpen(false)} width={320} variant="right">
600
- <DrawerHeader onClose={() => setTabletOpen(false)}>Tablet Menu</DrawerHeader>
601
- <DrawerContent>
602
- <Typography sx={{ p: 2 }}>Optimized for tablet devices with 320px width</Typography>
603
- <List>
604
- <ListItemButton>
605
- <ListItemIcon>
606
- <Dashboard />
607
- </ListItemIcon>
608
- <ListItemText primary="Dashboard" />
609
- </ListItemButton>
610
- <ListItemButton>
611
- <ListItemIcon>
612
- <Analytics />
613
- </ListItemIcon>
614
- <ListItemText primary="Analytics" />
615
- </ListItemButton>
616
- </List>
617
- </DrawerContent>
618
- </Drawer>
619
-
620
- {/* Desktop Drawer */}
621
- <Drawer open={desktopOpen} onClose={() => setDesktopOpen(false)} width={400} variant="glass">
622
- <DrawerHeader onClose={() => setDesktopOpen(false)}>Desktop Menu</DrawerHeader>
623
- <DrawerContent>
624
- <Typography sx={{ p: 2 }}>Full-featured desktop drawer with 400px width</Typography>
625
- <List>
626
- <ListItemButton>
627
- <ListItemIcon>
628
- <Home />
629
- </ListItemIcon>
630
- <ListItemText primary="Home" secondary="Go to homepage" />
631
- </ListItemButton>
632
- <ListItemButton>
633
- <ListItemIcon>
634
- <Dashboard />
635
- </ListItemIcon>
636
- <ListItemText primary="Dashboard" secondary="View analytics" />
637
- </ListItemButton>
638
- <ListItemButton>
639
- <ListItemIcon>
640
- <Person />
641
- </ListItemIcon>
642
- <ListItemText primary="Profile" secondary="Manage account" />
643
- </ListItemButton>
644
- </List>
645
- </DrawerContent>
646
- </Drawer>
647
-
648
- <Typography variant="body1" sx={{ mt: 3 }}>
649
- Click the buttons above to see how the drawer adapts to different screen sizes. Each drawer
650
- is optimized for its target device category.
651
- </Typography>
652
- </Box>
653
- );
654
- };
655
-
656
- export const Responsive: Story = {
657
- render: () => <ResponsiveComponent />,
658
- };