@12-apps/ui 1.5.0 → 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 +16 -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 -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,1004 +0,0 @@
1
- import Analytics from '@mui/icons-material/Analytics';
2
- import BugReport from '@mui/icons-material/BugReport';
3
- import Cancel from '@mui/icons-material/Cancel';
4
- import CheckCircle from '@mui/icons-material/CheckCircle';
5
- import Code from '@mui/icons-material/Code';
6
- import Dashboard from '@mui/icons-material/Dashboard';
7
- import Edit from '@mui/icons-material/Edit';
8
- import Email from '@mui/icons-material/Email';
9
- import Error from '@mui/icons-material/Error';
10
- import Info from '@mui/icons-material/Info';
11
- import LocationOn from '@mui/icons-material/LocationOn';
12
- import Notifications from '@mui/icons-material/Notifications';
13
- import Palette from '@mui/icons-material/Palette';
14
- import Person from '@mui/icons-material/Person';
15
- import Phone from '@mui/icons-material/Phone';
16
- import PieChart from '@mui/icons-material/PieChart';
17
- import Save from '@mui/icons-material/Save';
18
- import Security from '@mui/icons-material/Security';
19
- import Settings from '@mui/icons-material/Settings';
20
- import Timeline from '@mui/icons-material/Timeline';
21
- import Warning from '@mui/icons-material/Warning';
22
- import {
23
- Avatar,
24
- Box,
25
- Button,
26
- Card,
27
- CardContent,
28
- Checkbox,
29
- Chip,
30
- FormControl,
31
- FormControlLabel,
32
- FormLabel,
33
- Grid,
34
- List,
35
- ListItem,
36
- ListItemText,
37
- Paper,
38
- Radio,
39
- RadioGroup,
40
- TextField,
41
- Typography,
42
- } from '@mui/material';
43
- import type { Meta, StoryObj } from '@storybook/react-vite';
44
- import { useState } from 'react';
45
-
46
- import { Tabs } from './Tabs';
47
- import type { TabItem } from './Tabs.types';
48
-
49
- const meta: Meta<typeof Tabs> = {
50
- title: 'Navigation/Tabs',
51
- component: Tabs,
52
- parameters: {
53
- layout: 'centered',
54
- docs: {
55
- description: {
56
- component:
57
- 'A comprehensive tabs component with multiple variants including default, pills, underline, and enclosed styles.',
58
- },
59
- },
60
- },
61
- tags: ['autodocs', 'component:Tabs'],
62
- argTypes: {
63
- variant: {
64
- control: 'select',
65
- options: ['default', 'pills', 'underline', 'enclosed'],
66
- description: 'The visual variant of the tabs',
67
- },
68
- size: {
69
- control: 'select',
70
- options: ['sm', 'md', 'lg'],
71
- description: 'Size of the tabs',
72
- },
73
- color: {
74
- control: 'select',
75
- options: ['primary', 'secondary'],
76
- description: 'Color theme for the tabs',
77
- },
78
- orientation: {
79
- control: 'select',
80
- options: ['horizontal', 'vertical'],
81
- description: 'Orientation of the tabs',
82
- },
83
- fullWidth: {
84
- control: 'boolean',
85
- description: 'Whether tabs should fill the full width',
86
- },
87
- centered: {
88
- control: 'boolean',
89
- description: 'Whether tabs are centered',
90
- },
91
- showDividers: {
92
- control: 'boolean',
93
- description: 'Whether to show dividers between tabs',
94
- },
95
- animateContent: {
96
- control: 'boolean',
97
- description: 'Whether to animate content transitions',
98
- },
99
- disabled: {
100
- control: 'boolean',
101
- description: 'Whether the tabs are disabled',
102
- },
103
- loading: {
104
- control: 'boolean',
105
- description: 'Whether to show loading state',
106
- },
107
- },
108
- };
109
-
110
- export default meta;
111
- type Story = StoryObj<typeof meta>;
112
-
113
- // Sample content components
114
- const DashboardContent = () => (
115
- <Box sx={{ p: 3 }}>
116
- <Typography variant="h5" gutterBottom>
117
- Dashboard Overview
118
- </Typography>
119
- <Grid container spacing={3}>
120
- {[
121
- { title: 'Total Users', value: '12,345', icon: <Person />, color: 'primary.main' },
122
- { title: 'Revenue', value: '$45,678', icon: <Analytics />, color: 'success.main' },
123
- { title: 'Orders', value: '1,234', icon: <Timeline />, color: 'warning.main' },
124
- { title: 'Growth', value: '+12.5%', icon: <PieChart />, color: 'info.main' },
125
- ].map((item, i) => (
126
- <Grid item xs={6} md={3} key={i}>
127
- <Card>
128
- <CardContent>
129
- <Box sx={{ display: 'flex', alignItems: 'center', mb: 1 }}>
130
- <Box sx={{ color: item.color, mr: 1 }}>{item.icon}</Box>
131
- <Typography variant="subtitle2" color="text.secondary">
132
- {item.title}
133
- </Typography>
134
- </Box>
135
- <Typography variant="h4" component="div">
136
- {item.value}
137
- </Typography>
138
- </CardContent>
139
- </Card>
140
- </Grid>
141
- ))}
142
- </Grid>
143
- </Box>
144
- );
145
-
146
- const SettingsContent = () => (
147
- <Box sx={{ p: 3, maxWidth: 600 }}>
148
- <Typography variant="h5" gutterBottom>
149
- Settings
150
- </Typography>
151
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
152
- <TextField fullWidth label="Application Name" defaultValue="My Application" />
153
- <TextField fullWidth label="Description" multiline rows={3} />
154
- <FormControl component="fieldset">
155
- <FormLabel component="legend">Theme</FormLabel>
156
- <RadioGroup defaultValue="light" row>
157
- <FormControlLabel value="light" control={<Radio />} label="Light" />
158
- <FormControlLabel value="dark" control={<Radio />} label="Dark" />
159
- <FormControlLabel value="auto" control={<Radio />} label="Auto" />
160
- </RadioGroup>
161
- </FormControl>
162
- <Box>
163
- <FormControlLabel control={<Checkbox defaultChecked />} label="Enable notifications" />
164
- <FormControlLabel control={<Checkbox />} label="Auto-save changes" />
165
- <FormControlLabel control={<Checkbox defaultChecked />} label="Show advanced options" />
166
- </Box>
167
- <Box sx={{ display: 'flex', gap: 2 }}>
168
- <Button variant="contained" startIcon={<Save />}>
169
- Save Changes
170
- </Button>
171
- <Button variant="outlined" startIcon={<Cancel />}>
172
- Cancel
173
- </Button>
174
- </Box>
175
- </Box>
176
- </Box>
177
- );
178
-
179
- const ProfileContent = () => (
180
- <Box sx={{ p: 3, maxWidth: 600 }}>
181
- <Box sx={{ display: 'flex', alignItems: 'center', mb: 3 }}>
182
- <Avatar sx={{ width: 80, height: 80, mr: 2 }}>
183
- <Person fontSize="large" />
184
- </Avatar>
185
- <Box>
186
- <Typography variant="h5">John Doe</Typography>
187
- <Typography variant="body2" color="text.secondary">
188
- Senior Developer
189
- </Typography>
190
- <Box sx={{ mt: 1, display: 'flex', gap: 1 }}>
191
- <Chip size="small" label="Admin" color="primary" />
192
- <Chip size="small" label="Verified" color="success" />
193
- </Box>
194
- </Box>
195
- </Box>
196
-
197
- <List>
198
- <ListItem>
199
- <Email sx={{ mr: 2, color: 'text.secondary' }} />
200
- <ListItemText primary="john.doe@example.com" secondary="Primary email" />
201
- </ListItem>
202
- <ListItem>
203
- <Phone sx={{ mr: 2, color: 'text.secondary' }} />
204
- <ListItemText primary="+1 (555) 123-4567" secondary="Mobile phone" />
205
- </ListItem>
206
- <ListItem>
207
- <LocationOn sx={{ mr: 2, color: 'text.secondary' }} />
208
- <ListItemText primary="San Francisco, CA" secondary="Current location" />
209
- </ListItem>
210
- </List>
211
-
212
- <Button variant="contained" startIcon={<Edit />} sx={{ mt: 2 }}>
213
- Edit Profile
214
- </Button>
215
- </Box>
216
- );
217
-
218
- const NotificationsContent = () => (
219
- <Box sx={{ p: 3 }}>
220
- <Typography variant="h5" gutterBottom>
221
- Recent Notifications
222
- </Typography>
223
- <List>
224
- {[
225
- {
226
- icon: <Info color="info" />,
227
- title: 'System Update',
228
- message: 'New features are available',
229
- time: '2 minutes ago',
230
- },
231
- {
232
- icon: <CheckCircle color="success" />,
233
- title: 'Task Completed',
234
- message: 'Your report has been generated',
235
- time: '1 hour ago',
236
- },
237
- {
238
- icon: <Warning color="warning" />,
239
- title: 'Storage Warning',
240
- message: '80% of storage is used',
241
- time: '3 hours ago',
242
- },
243
- {
244
- icon: <Error color="error" />,
245
- title: 'Failed Login',
246
- message: 'Someone tried to access your account',
247
- time: '1 day ago',
248
- },
249
- ].map((notification, i) => (
250
- <ListItem key={i} alignItems="flex-start">
251
- <Box sx={{ mr: 2, mt: 0.5 }}>{notification.icon}</Box>
252
- <ListItemText
253
- primary={notification.title}
254
- secondary={
255
- <Box>
256
- <Typography variant="body2" color="text.secondary">
257
- {notification.message}
258
- </Typography>
259
- <Typography variant="caption" color="text.disabled">
260
- {notification.time}
261
- </Typography>
262
- </Box>
263
- }
264
- />
265
- </ListItem>
266
- ))}
267
- </List>
268
- </Box>
269
- );
270
-
271
- // Interactive wrapper component
272
- const TabsWrapper = ({
273
- initialTab = 'dashboard',
274
- items,
275
- ...props
276
- }: {
277
- initialTab?: string;
278
- items: TabItem[];
279
- [key: string]: unknown;
280
- }) => {
281
- const [activeTab, setActiveTab] = useState(initialTab);
282
-
283
- const handleChange = (event: React.SyntheticEvent, tabId: string) => {
284
- setActiveTab(tabId);
285
- };
286
-
287
- return <Tabs {...props} value={activeTab} onChange={handleChange} items={items} />;
288
- };
289
-
290
- const basicTabItems = [
291
- {
292
- id: 'dashboard',
293
- label: 'Dashboard',
294
- icon: <Dashboard />,
295
- content: <DashboardContent />,
296
- },
297
- {
298
- id: 'settings',
299
- label: 'Settings',
300
- icon: <Settings />,
301
- content: <SettingsContent />,
302
- },
303
- {
304
- id: 'profile',
305
- label: 'Profile',
306
- icon: <Person />,
307
- content: <ProfileContent />,
308
- },
309
- {
310
- id: 'notifications',
311
- label: 'Notifications',
312
- icon: <Notifications />,
313
- badge: 3,
314
- content: <NotificationsContent />,
315
- },
316
- ];
317
-
318
- export const Default: Story = {
319
- args: {
320
- variant: 'default',
321
- size: 'md',
322
- },
323
- render: (args) => (
324
- <Paper elevation={2} sx={{ width: 800, minHeight: 500 }}>
325
- <TabsWrapper {...args} items={basicTabItems} />
326
- </Paper>
327
- ),
328
- };
329
-
330
- export const Pills: Story = {
331
- args: {
332
- variant: 'pills',
333
- size: 'md',
334
- },
335
- render: (args) => (
336
- <Paper elevation={2} sx={{ width: 800, minHeight: 500, p: 2 }}>
337
- <TabsWrapper {...args} items={basicTabItems} />
338
- </Paper>
339
- ),
340
- };
341
-
342
- export const Underline: Story = {
343
- args: {
344
- variant: 'underline',
345
- size: 'md',
346
- },
347
- render: (args) => (
348
- <Paper elevation={2} sx={{ width: 800, minHeight: 500, p: 2 }}>
349
- <TabsWrapper {...args} items={basicTabItems} />
350
- </Paper>
351
- ),
352
- };
353
-
354
- export const Enclosed: Story = {
355
- args: {
356
- variant: 'enclosed',
357
- size: 'md',
358
- },
359
- render: (args) => (
360
- <Box sx={{ width: 800, minHeight: 500 }}>
361
- <TabsWrapper {...args} items={basicTabItems} />
362
- </Box>
363
- ),
364
- };
365
-
366
- export const SmallSize: Story = {
367
- args: {
368
- variant: 'pills',
369
- size: 'sm',
370
- },
371
- render: (args) => (
372
- <Paper elevation={2} sx={{ width: 600, minHeight: 400, p: 2 }}>
373
- <TabsWrapper {...args} items={basicTabItems.slice(0, 3)} />
374
- </Paper>
375
- ),
376
- };
377
-
378
- export const LargeSize: Story = {
379
- args: {
380
- variant: 'default',
381
- size: 'lg',
382
- },
383
- render: (args) => (
384
- <Paper elevation={2} sx={{ width: 900, minHeight: 600 }}>
385
- <TabsWrapper {...args} items={basicTabItems.slice(0, 3)} />
386
- </Paper>
387
- ),
388
- };
389
-
390
- export const WithBadges: Story = {
391
- args: {
392
- variant: 'default',
393
- },
394
- render: (args) => {
395
- const items = [
396
- {
397
- id: 'home',
398
- label: 'Home',
399
- badge: 2,
400
- content: <Typography sx={{ p: 2 }}>Home content</Typography>,
401
- },
402
- {
403
- id: 'messages',
404
- label: 'Messages',
405
- badge: 12,
406
- content: <Typography sx={{ p: 2 }}>Messages content</Typography>,
407
- },
408
- {
409
- id: 'notifications',
410
- label: 'Notifications',
411
- badge: 99,
412
- content: <Typography sx={{ p: 2 }}>Notifications content</Typography>,
413
- },
414
- ];
415
- return (
416
- <Paper elevation={2} sx={{ width: 700, minHeight: 400 }}>
417
- <TabsWrapper {...args} items={items} initialTab="home" />
418
- </Paper>
419
- );
420
- },
421
- parameters: {
422
- test: {
423
- timeout: 30000, // 30 second timeout
424
- dangerouslyIgnoreUnhandledErrors: true,
425
- },
426
- },
427
- };
428
-
429
- const ClosableTabsComponent = () => {
430
- const [tabs, setTabs] = useState([
431
- {
432
- id: 'file1',
433
- label: 'Component.tsx',
434
- icon: <Code />,
435
- closable: true,
436
- content: (
437
- <Box sx={{ p: 3, fontFamily: 'monospace' }}>
438
- <Typography variant="body2" component="pre">
439
- {`import React from 'react';
440
-
441
- const Component = () => {
442
- return <div>Hello World</div>;
443
- };`}
444
- </Typography>
445
- </Box>
446
- ),
447
- },
448
- {
449
- id: 'file2',
450
- label: 'styles.css',
451
- icon: <Palette />,
452
- closable: true,
453
- content: (
454
- <Box sx={{ p: 3, fontFamily: 'monospace' }}>
455
- <Typography variant="body2" component="pre">
456
- {`.container {
457
- display: flex;
458
- align-items: center;
459
- }`}
460
- </Typography>
461
- </Box>
462
- ),
463
- },
464
- {
465
- id: 'file3',
466
- label: 'README.md',
467
- icon: <BugReport />,
468
- closable: true,
469
- content: (
470
- <Box sx={{ p: 3 }}>
471
- <Typography variant="h6"># Project Title</Typography>
472
- <Typography variant="body2" sx={{ mt: 2 }}>
473
- This is a sample README file for the project documentation.
474
- </Typography>
475
- </Box>
476
- ),
477
- },
478
- ]);
479
- const [activeTab, setActiveTab] = useState('file1');
480
-
481
- const handleTabClose = (tabId: string) => {
482
- const newTabs = tabs.filter((tab) => tab.id !== tabId);
483
- setTabs(newTabs);
484
- if (activeTab === tabId && newTabs.length > 0) {
485
- setActiveTab(newTabs[0].id);
486
- }
487
- };
488
-
489
- const handleChange = (event: React.SyntheticEvent, tabId: string) => {
490
- setActiveTab(tabId);
491
- };
492
-
493
- return (
494
- <Paper elevation={2} sx={{ width: 700, minHeight: 400 }}>
495
- <Tabs
496
- variant="enclosed"
497
- value={activeTab}
498
- onChange={handleChange}
499
- items={tabs}
500
- onTabClose={handleTabClose}
501
- />
502
- </Paper>
503
- );
504
- };
505
-
506
- export const ClosableTabs: Story = {
507
- render: () => <ClosableTabsComponent />,
508
- args: {},
509
- };
510
-
511
- export const WithAnimations: Story = {
512
- args: {
513
- variant: 'pills',
514
-
515
- animateContent: true,
516
- animationDuration: 500,
517
- },
518
- render: (args) => (
519
- <Paper elevation={2} sx={{ width: 800, minHeight: 500, p: 2 }}>
520
- <TabsWrapper {...args} items={basicTabItems} />
521
- </Paper>
522
- ),
523
- };
524
-
525
- export const SecondaryColor: Story = {
526
- args: {
527
- variant: 'default',
528
- color: 'secondary',
529
- },
530
- render: (args) => (
531
- <Paper elevation={2} sx={{ width: 700, minHeight: 400 }}>
532
- <TabsWrapper {...args} items={basicTabItems.slice(0, 3)} />
533
- </Paper>
534
- ),
535
- };
536
-
537
- export const FullWidth: Story = {
538
- args: {
539
- variant: 'underline',
540
- fullWidth: true,
541
- },
542
- render: (args) => (
543
- <Paper elevation={2} sx={{ width: 800, minHeight: 400 }}>
544
- <TabsWrapper {...args} items={basicTabItems.slice(0, 3)} />
545
- </Paper>
546
- ),
547
- };
548
-
549
- export const Centered: Story = {
550
- args: {
551
- variant: 'pills',
552
- centered: true,
553
- },
554
- render: (args) => (
555
- <Paper elevation={2} sx={{ width: 800, minHeight: 400, p: 2 }}>
556
- <TabsWrapper {...args} items={basicTabItems.slice(0, 3)} />
557
- </Paper>
558
- ),
559
- };
560
-
561
- export const WithDividers: Story = {
562
- args: {
563
- variant: 'underline',
564
- showDividers: true,
565
- },
566
- render: (args) => (
567
- <Paper elevation={2} sx={{ width: 800, minHeight: 400, p: 2 }}>
568
- <TabsWrapper {...args} items={basicTabItems} />
569
- </Paper>
570
- ),
571
- };
572
-
573
- export const ScrollableTabs: Story = {
574
- args: {
575
- variant: 'default',
576
- scrollable: true,
577
- },
578
- render: (args) => {
579
- const items = [
580
- ...basicTabItems,
581
- {
582
- id: 'analytics',
583
- label: 'Analytics',
584
- content: <Typography sx={{ p: 2 }}>Analytics content</Typography>,
585
- },
586
- {
587
- id: 'reports',
588
- label: 'Reports',
589
- content: <Typography sx={{ p: 2 }}>Reports content</Typography>,
590
- },
591
- {
592
- id: 'security',
593
- label: 'Security',
594
- content: <Typography sx={{ p: 2 }}>Security content</Typography>,
595
- },
596
- {
597
- id: 'logs',
598
- label: 'System Logs',
599
- content: <Typography sx={{ p: 2 }}>System logs content</Typography>,
600
- },
601
- ];
602
- return (
603
- <Paper elevation={2} sx={{ width: 600, minHeight: 400 }}>
604
- <TabsWrapper {...args} items={items} />
605
- </Paper>
606
- );
607
- },
608
- parameters: {
609
- test: {
610
- timeout: 30000, // 30 second timeout
611
- dangerouslyIgnoreUnhandledErrors: true,
612
- },
613
- },
614
- };
615
-
616
- export const StickyScrollable: Story = {
617
- args: {
618
- variant: 'underline',
619
- scrollable: true,
620
- sticky: true,
621
- stickyOffset: 0,
622
- },
623
- render: (args) => {
624
- const items = Array.from({ length: 10 }, (_, i) => ({
625
- id: `cat-${i}`,
626
- label: `Category ${i + 1}`,
627
- content: (
628
- <Typography sx={{ p: 2 }}>
629
- {Array.from({ length: 20 }, (_, n) => `Row ${n + 1} of category ${i + 1}. `).join('')}
630
- </Typography>
631
- ),
632
- }));
633
- return (
634
- <Paper elevation={2} sx={{ width: 480, height: 320, overflowY: 'auto' }}>
635
- <TabsWrapper {...args} items={items} />
636
- </Paper>
637
- );
638
- },
639
- };
640
-
641
- export const LoadingState: Story = {
642
- args: {
643
- variant: 'default',
644
- loading: true,
645
- },
646
- render: (args) => (
647
- <Paper elevation={2} sx={{ width: 700, minHeight: 400 }}>
648
- <TabsWrapper {...args} items={basicTabItems.slice(0, 2)} />
649
- </Paper>
650
- ),
651
- };
652
-
653
- export const DisabledTabs: Story = {
654
- args: {
655
- variant: 'pills',
656
- },
657
- render: (args) => {
658
- const items = [
659
- ...basicTabItems.slice(0, 2),
660
- {
661
- ...basicTabItems[2],
662
- disabled: true,
663
- },
664
- basicTabItems[3],
665
- ];
666
- return (
667
- <Paper elevation={2} sx={{ width: 700, minHeight: 400, p: 2 }}>
668
- <TabsWrapper {...args} items={items} />
669
- </Paper>
670
- );
671
- },
672
- };
673
-
674
- export const AllVariantsComparison: Story = {
675
- render: () => (
676
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 4, width: 900 }}>
677
- {[
678
- { title: 'Default', variant: 'default' },
679
- { title: 'Pills', variant: 'pills' },
680
- { title: 'Underline', variant: 'underline' },
681
- { title: 'Enclosed', variant: 'enclosed' },
682
- ].map(({ title, variant }) => (
683
- <Box key={variant}>
684
- <Typography variant="h6" gutterBottom>
685
- {title}
686
- </Typography>
687
- <Paper elevation={1} sx={{ minHeight: 300 }}>
688
- <TabsWrapper
689
- variant={variant}
690
- items={basicTabItems.slice(0, 3)}
691
- initialTab="dashboard"
692
- />
693
- </Paper>
694
- </Box>
695
- ))}
696
- </Box>
697
- ),
698
- };
699
-
700
- export const AdminDashboard: Story = {
701
- render: () => {
702
- const adminTabs = [
703
- {
704
- id: 'overview',
705
- label: 'Overview',
706
- icon: <Dashboard />,
707
- content: <DashboardContent />,
708
- },
709
- {
710
- id: 'users',
711
- label: 'Users',
712
- icon: <Person />,
713
- badge: 1250,
714
- content: (
715
- <Box sx={{ p: 3 }}>
716
- <Typography variant="h5" gutterBottom>
717
- User Management
718
- </Typography>
719
- <Typography>Manage user accounts, roles, and permissions.</Typography>
720
- </Box>
721
- ),
722
- },
723
- {
724
- id: 'settings',
725
- label: 'Settings',
726
- icon: <Settings />,
727
- content: <SettingsContent />,
728
- },
729
- {
730
- id: 'security',
731
- label: 'Security',
732
- icon: <Security />,
733
- badge: 3,
734
- content: (
735
- <Box sx={{ p: 3 }}>
736
- <Typography variant="h5" gutterBottom>
737
- Security Center
738
- </Typography>
739
- <Typography>Monitor security events and configure security settings.</Typography>
740
- </Box>
741
- ),
742
- },
743
- {
744
- id: 'logs',
745
- label: 'Logs',
746
- icon: <Code />,
747
- content: (
748
- <Box sx={{ p: 3 }}>
749
- <Typography variant="h5" gutterBottom>
750
- System Logs
751
- </Typography>
752
- <Typography>View and analyze system activity logs.</Typography>
753
- </Box>
754
- ),
755
- },
756
- ];
757
-
758
- return (
759
- <Box sx={{ width: 1000, minHeight: 600 }}>
760
- <TabsWrapper
761
- variant="default"
762
- items={adminTabs}
763
- initialTab="overview"
764
- scrollable
765
- showDividers
766
- />
767
- </Box>
768
- );
769
- },
770
- };
771
- // Required story exports for validation
772
- export const AllVariants: Story = {
773
- render: () => (
774
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 4, width: 900 }}>
775
- {[
776
- { title: 'Default', variant: 'default' },
777
- { title: 'Pills', variant: 'pills' },
778
- { title: 'Underline', variant: 'underline' },
779
- { title: 'Enclosed', variant: 'enclosed' },
780
- ].map(({ title, variant }) => (
781
- <Box key={variant}>
782
- <Typography variant="h6" gutterBottom>
783
- {title}
784
- </Typography>
785
- <Paper elevation={1} sx={{ minHeight: 300 }}>
786
- <TabsWrapper
787
- variant={variant as 'default' | 'pills' | 'underline' | 'enclosed'}
788
- items={basicTabItems.slice(0, 3)}
789
- initialTab="dashboard"
790
- />
791
- </Paper>
792
- </Box>
793
- ))}
794
- </Box>
795
- ),
796
- };
797
-
798
- export const AllSizes: Story = {
799
- render: () => (
800
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 4, width: 800 }}>
801
- {[
802
- { title: 'Small', size: 'sm' },
803
- { title: 'Medium', size: 'md' },
804
- { title: 'Large', size: 'lg' },
805
- ].map(({ title, size }) => (
806
- <Box key={size}>
807
- <Typography variant="h6" gutterBottom>
808
- {title}
809
- </Typography>
810
- <Paper elevation={1} sx={{ minHeight: 300, p: size === 'sm' ? 1 : 2 }}>
811
- <TabsWrapper
812
- variant="pills"
813
- size={size as 'sm' | 'md' | 'lg'}
814
- items={basicTabItems.slice(0, 3)}
815
- initialTab="dashboard"
816
- />
817
- </Paper>
818
- </Box>
819
- ))}
820
- </Box>
821
- ),
822
- };
823
-
824
- export const AllStates: Story = {
825
- render: () => (
826
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 4, width: 800 }}>
827
- <Box>
828
- <Typography variant="h6" gutterBottom>
829
- Normal State
830
- </Typography>
831
- <Paper elevation={1} sx={{ minHeight: 300, p: 2 }}>
832
- <TabsWrapper variant="pills" items={basicTabItems.slice(0, 3)} initialTab="dashboard" />
833
- </Paper>
834
- </Box>
835
-
836
- <Box>
837
- <Typography variant="h6" gutterBottom>
838
- Disabled Tabs
839
- </Typography>
840
- <Paper elevation={1} sx={{ minHeight: 300, p: 2 }}>
841
- <TabsWrapper
842
- variant="pills"
843
- items={[
844
- basicTabItems[0],
845
- { ...basicTabItems[1], disabled: true },
846
- { ...basicTabItems[2], disabled: true },
847
- ]}
848
- initialTab="dashboard"
849
- />
850
- </Paper>
851
- </Box>
852
-
853
- <Box>
854
- <Typography variant="h6" gutterBottom>
855
- Loading State
856
- </Typography>
857
- <Paper elevation={1} sx={{ minHeight: 300, p: 2 }}>
858
- <TabsWrapper
859
- variant="pills"
860
- items={basicTabItems.slice(0, 3)}
861
- initialTab="dashboard"
862
- loading
863
- />
864
- </Paper>
865
- </Box>
866
-
867
- <Box>
868
- <Typography variant="h6" gutterBottom>
869
- With Badges
870
- </Typography>
871
- <Paper elevation={1} sx={{ minHeight: 300, p: 2 }}>
872
- <TabsWrapper
873
- variant="pills"
874
- items={[
875
- basicTabItems[0],
876
- { ...basicTabItems[1], badge: 5 },
877
- { ...basicTabItems[2], badge: 99 },
878
- ]}
879
- initialTab="dashboard"
880
- />
881
- </Paper>
882
- </Box>
883
- </Box>
884
- ),
885
- };
886
-
887
- export const InteractiveStates: Story = {
888
- render: () => (
889
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 4, width: 800 }}>
890
- <Box>
891
- <Typography variant="h6" gutterBottom>
892
- Hover & Focus States
893
- </Typography>
894
- <Typography variant="body2" color="text.secondary" gutterBottom>
895
- Hover over tabs to see hover states, use Tab key to navigate and see focus states
896
- </Typography>
897
- <Paper elevation={1} sx={{ minHeight: 300, p: 2 }}>
898
- <TabsWrapper variant="default" items={basicTabItems.slice(0, 4)} initialTab="dashboard" />
899
- </Paper>
900
- </Box>
901
-
902
- <Box>
903
- <Typography variant="h6" gutterBottom>
904
- Active & Selected States
905
- </Typography>
906
- <Typography variant="body2" color="text.secondary" gutterBottom>
907
- Click tabs to see active/selected states with different variants
908
- </Typography>
909
- <Paper elevation={1} sx={{ minHeight: 300, p: 2 }}>
910
- <TabsWrapper
911
- variant="underline"
912
- items={basicTabItems.slice(0, 4)}
913
- initialTab="settings"
914
- />
915
- </Paper>
916
- </Box>
917
-
918
- <Box>
919
- <Typography variant="h6" gutterBottom>
920
- Closable Tabs
921
- </Typography>
922
- <Typography variant="body2" color="text.secondary" gutterBottom>
923
- Tabs with close buttons - click X to close tabs
924
- </Typography>
925
- <Paper elevation={1} sx={{ minHeight: 300 }}>
926
- <ClosableTabsComponent />
927
- </Paper>
928
- </Box>
929
- </Box>
930
- ),
931
- };
932
-
933
- export const Responsive: Story = {
934
- render: () => (
935
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
936
- <Box>
937
- <Typography variant="h6" gutterBottom>
938
- Mobile (320px)
939
- </Typography>
940
- <Box sx={{ width: 320, border: '1px solid #ddd', borderRadius: 1 }}>
941
- <TabsWrapper
942
- variant="pills"
943
- items={basicTabItems.slice(0, 3)}
944
- initialTab="dashboard"
945
- fullWidth
946
- />
947
- </Box>
948
- </Box>
949
-
950
- <Box>
951
- <Typography variant="h6" gutterBottom>
952
- Tablet (768px)
953
- </Typography>
954
- <Box sx={{ width: 768, border: '1px solid #ddd', borderRadius: 1 }}>
955
- <TabsWrapper variant="underline" items={basicTabItems} initialTab="dashboard" centered />
956
- </Box>
957
- </Box>
958
-
959
- <Box>
960
- <Typography variant="h6" gutterBottom>
961
- Desktop (1200px)
962
- </Typography>
963
- <Box sx={{ width: 1200, border: '1px solid #ddd', borderRadius: 1 }}>
964
- <TabsWrapper
965
- variant="default"
966
- items={[
967
- ...basicTabItems,
968
- ...basicTabItems.map((item) => ({
969
- ...item,
970
- id: `${item.id }_2`,
971
- label: `${item.label } 2`,
972
- })),
973
- ]}
974
- initialTab="dashboard"
975
- scrollable
976
- showDividers
977
- />
978
- </Box>
979
- </Box>
980
-
981
- <Box>
982
- <Typography variant="h6" gutterBottom>
983
- Vertical Layout (Responsive)
984
- </Typography>
985
- <Box
986
- sx={{
987
- display: 'flex',
988
- width: 800,
989
- minHeight: 400,
990
- border: '1px solid #ddd',
991
- borderRadius: 1,
992
- }}
993
- >
994
- <TabsWrapper
995
- variant="pills"
996
- orientation="vertical"
997
- items={basicTabItems.slice(0, 4)}
998
- initialTab="dashboard"
999
- />
1000
- </Box>
1001
- </Box>
1002
- </Box>
1003
- ),
1004
- };