@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,518 +0,0 @@
1
- import { Box, Typography } from '@mui/material';
2
- import type { Meta, StoryObj } from '@storybook/react-vite';
3
- import { Banknote, CreditCard, Globe, Heart, Shield,Smartphone, Star, Zap } from 'lucide-react';
4
- import { useState } from 'react';
5
-
6
- import { RadioGroup } from './RadioGroup';
7
-
8
- const meta: Meta<typeof RadioGroup> = {
9
- title: 'Form/RadioGroup',
10
- component: RadioGroup,
11
- parameters: {
12
- layout: 'padded',
13
- },
14
- tags: ['autodocs', 'component:RadioGroup'],
15
- argTypes: {
16
- variant: {
17
- control: { type: 'select' },
18
- options: ['default', 'cards', 'buttons', 'segments'],
19
- },
20
- color: {
21
- control: { type: 'select' },
22
- options: ['primary', 'secondary', 'success', 'warning', 'danger', 'neutral'],
23
- },
24
- size: {
25
- control: { type: 'select' },
26
- options: ['xs', 'sm', 'md', 'lg', 'xl'],
27
- },
28
- direction: {
29
- control: { type: 'select' },
30
- options: ['row', 'column'],
31
- },
32
- },
33
- };
34
-
35
- export default meta;
36
- type Story = StoryObj<typeof meta>;
37
-
38
- const paymentOptions = [
39
- {
40
- value: 'card',
41
- label: 'Credit Card',
42
- icon: <CreditCard size={20} />,
43
- description: 'Pay with your credit or debit card',
44
- },
45
- {
46
- value: 'cash',
47
- label: 'Cash',
48
- icon: <Banknote size={20} />,
49
- description: 'Pay with cash on delivery',
50
- },
51
- {
52
- value: 'mobile',
53
- label: 'Mobile Pay',
54
- icon: <Smartphone size={20} />,
55
- description: 'Use your mobile wallet',
56
- },
57
- {
58
- value: 'online',
59
- label: 'Online Banking',
60
- icon: <Globe size={20} />,
61
- description: 'Transfer from your bank account',
62
- },
63
- ];
64
-
65
- const simpleOptions = [
66
- { value: 'option1', label: 'Option 1' },
67
- { value: 'option2', label: 'Option 2' },
68
- { value: 'option3', label: 'Option 3' },
69
- ];
70
-
71
- const priorityOptions = [
72
- { value: 'low', label: 'Low', icon: <Shield size={16} /> },
73
- { value: 'medium', label: 'Medium', icon: <Star size={16} /> },
74
- { value: 'high', label: 'High', icon: <Zap size={16} /> },
75
- { value: 'critical', label: 'Critical', icon: <Heart size={16} /> },
76
- ];
77
-
78
- export const Default: Story = {
79
- args: {
80
- options: simpleOptions,
81
- label: 'Select an option',
82
- variant: 'default',
83
- },
84
- };
85
-
86
- const VariantsComponent = () => {
87
- const [values, setValues] = useState<Record<string, string>>({
88
- default: '',
89
- cards: '',
90
- buttons: '',
91
- segments: '',
92
- });
93
-
94
- return (
95
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
96
- <Box>
97
- <Typography variant="h6" gutterBottom>
98
- Default
99
- </Typography>
100
- <RadioGroup
101
- variant="default"
102
- options={paymentOptions}
103
- value={values.default}
104
- onChange={(e) => setValues((prev) => ({ ...prev, default: e.target.value }))}
105
- />
106
- </Box>
107
-
108
- <Box>
109
- <Typography variant="h6" gutterBottom>
110
- Cards
111
- </Typography>
112
- <RadioGroup
113
- variant="cards"
114
- options={paymentOptions}
115
- value={values.cards}
116
- onChange={(e) => setValues((prev) => ({ ...prev, cards: e.target.value }))}
117
- />
118
- </Box>
119
-
120
- <Box>
121
- <Typography variant="h6" gutterBottom>
122
- Buttons
123
- </Typography>
124
- <RadioGroup
125
- variant="buttons"
126
- options={priorityOptions}
127
- direction="row"
128
- value={values.buttons}
129
- onChange={(e) => setValues((prev) => ({ ...prev, buttons: e.target.value }))}
130
- />
131
- </Box>
132
-
133
- <Box>
134
- <Typography variant="h6" gutterBottom>
135
- Segments
136
- </Typography>
137
- <RadioGroup
138
- variant="segments"
139
- options={priorityOptions}
140
- value={values.segments}
141
- onChange={(e) => setValues((prev) => ({ ...prev, segments: e.target.value }))}
142
- />
143
- </Box>
144
- </Box>
145
- );
146
- };
147
-
148
- export const Variants: Story = {
149
- render: () => <VariantsComponent />,
150
- };
151
-
152
- const ColorsComponent = () => {
153
- const [values, setValues] = useState({
154
- primary: '',
155
- secondary: '',
156
- success: '',
157
- warning: '',
158
- danger: '',
159
- neutral: '',
160
- });
161
-
162
- const colors = ['primary', 'secondary', 'success', 'warning', 'danger', 'neutral'];
163
-
164
- return (
165
- <Box
166
- sx={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: 3 }}
167
- >
168
- {colors.map((color) => (
169
- <Box key={color}>
170
- <Typography variant="h6" gutterBottom sx={{ textTransform: 'capitalize' }}>
171
- {color}
172
- </Typography>
173
- <RadioGroup
174
- variant="buttons"
175
- color={color}
176
- options={priorityOptions}
177
- direction="row"
178
- value={values[color]}
179
- onChange={(e) => setValues((prev) => ({ ...prev, [color]: e.target.value }))}
180
- />
181
- </Box>
182
- ))}
183
- </Box>
184
- );
185
- };
186
-
187
- export const Colors: Story = {
188
- render: () => <ColorsComponent />,
189
- };
190
-
191
- const SizesComponent = () => {
192
- const [values, setValues] = useState({
193
- xs: '',
194
- sm: '',
195
- md: '',
196
- lg: '',
197
- xl: '',
198
- });
199
-
200
- const sizes = ['xs', 'sm', 'md', 'lg', 'xl'];
201
-
202
- return (
203
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
204
- {sizes.map((size) => (
205
- <Box key={size}>
206
- <Typography variant="h6" gutterBottom>
207
- Size: {size.toUpperCase()}
208
- </Typography>
209
- <RadioGroup
210
- variant="buttons"
211
- size={size}
212
- options={priorityOptions}
213
- direction="row"
214
- value={values[size]}
215
- onChange={(e) => setValues((prev) => ({ ...prev, [size]: e.target.value }))}
216
- />
217
- </Box>
218
- ))}
219
- </Box>
220
- );
221
- };
222
-
223
- export const Sizes: Story = {
224
- render: () => <SizesComponent />,
225
- };
226
-
227
- const CardVariantComponent = () => {
228
- const [value, setValue] = useState('');
229
-
230
- return (
231
- <RadioGroup
232
- variant="cards"
233
- label="Payment Method"
234
- options={paymentOptions}
235
- value={value}
236
- onChange={(e) => setValue(e.target.value)}
237
- showDescriptions
238
- />
239
- );
240
- };
241
-
242
- export const CardVariant: Story = {
243
- render: () => <CardVariantComponent />,
244
- };
245
-
246
- const SpecialEffectsComponent = () => {
247
- const [values, setValues] = useState({
248
- glass: '',
249
- gradient: '',
250
- glow: '',
251
- glassLabel: '',
252
- });
253
-
254
- return (
255
- <Box
256
- sx={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: 3 }}
257
- >
258
- <Box>
259
- <Typography variant="h6" gutterBottom>
260
- Glass Morphism
261
- </Typography>
262
- <RadioGroup
263
- variant="cards"
264
- glass
265
- options={priorityOptions}
266
- value={values.glass}
267
- onChange={(e) => setValues((prev) => ({ ...prev, glass: e.target.value }))}
268
- />
269
- </Box>
270
-
271
- <Box>
272
- <Typography variant="h6" gutterBottom>
273
- Gradient
274
- </Typography>
275
- <RadioGroup
276
- variant="buttons"
277
- gradient
278
- color="secondary"
279
- options={priorityOptions}
280
- direction="row"
281
- value={values.gradient}
282
- onChange={(e) => setValues((prev) => ({ ...prev, gradient: e.target.value }))}
283
- />
284
- </Box>
285
-
286
- <Box>
287
- <Typography variant="h6" gutterBottom>
288
- Glow Effect
289
- </Typography>
290
- <RadioGroup
291
- variant="cards"
292
- glow
293
- color="success"
294
- options={priorityOptions}
295
- value={values.glow}
296
- onChange={(e) => setValues((prev) => ({ ...prev, glow: e.target.value }))}
297
- />
298
- </Box>
299
-
300
- <Box>
301
- <Typography variant="h6" gutterBottom>
302
- Glass Label
303
- </Typography>
304
- <RadioGroup
305
- variant="segments"
306
- glassLabel
307
- label="Priority Level"
308
- options={priorityOptions}
309
- value={values.glassLabel}
310
- onChange={(e) => setValues((prev) => ({ ...prev, glassLabel: e.target.value }))}
311
- />
312
- </Box>
313
- </Box>
314
- );
315
- };
316
-
317
- export const SpecialEffects: Story = {
318
- render: () => <SpecialEffectsComponent />,
319
- };
320
-
321
- const WithDirectionsComponent = () => {
322
- const [values, setValues] = useState({
323
- column: '',
324
- row: '',
325
- });
326
-
327
- return (
328
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
329
- <Box>
330
- <Typography variant="h6" gutterBottom>
331
- Column Layout
332
- </Typography>
333
- <RadioGroup
334
- variant="buttons"
335
- direction="column"
336
- options={priorityOptions}
337
- value={values.column}
338
- onChange={(e) => setValues((prev) => ({ ...prev, column: e.target.value }))}
339
- />
340
- </Box>
341
-
342
- <Box>
343
- <Typography variant="h6" gutterBottom>
344
- Row Layout
345
- </Typography>
346
- <RadioGroup
347
- variant="buttons"
348
- direction="row"
349
- options={priorityOptions}
350
- value={values.row}
351
- onChange={(e) => setValues((prev) => ({ ...prev, row: e.target.value }))}
352
- />
353
- </Box>
354
- </Box>
355
- );
356
- };
357
-
358
- export const WithDirections: Story = {
359
- render: () => <WithDirectionsComponent />,
360
- };
361
-
362
- const ErrorStateComponent = () => {
363
- const [value, setValue] = useState('');
364
-
365
- return (
366
- <RadioGroup
367
- variant="cards"
368
- label="Required Selection"
369
- options={paymentOptions}
370
- value={value}
371
- onChange={(e) => setValue(e.target.value)}
372
- error
373
- helperText="Please select a payment method"
374
- showDescriptions
375
- />
376
- );
377
- };
378
-
379
- export const ErrorState: Story = {
380
- render: () => <ErrorStateComponent />,
381
- };
382
-
383
- export const Playground: Story = {
384
- args: {
385
- options: paymentOptions,
386
- label: 'Payment Method',
387
- helperText: 'Choose your preferred payment method',
388
- variant: 'cards',
389
- color: 'primary',
390
- size: 'md',
391
- direction: 'column',
392
- showDescriptions: true,
393
- glass: false,
394
- gradient: false,
395
- glow: false,
396
- glassLabel: false,
397
- error: false,
398
- },
399
- };
400
-
401
- // Required story exports for validation
402
- export const AllVariants: Story = {
403
- render: () => <VariantsComponent />,
404
- };
405
-
406
- export const AllSizes: Story = {
407
- render: () => <SizesComponent />,
408
- };
409
-
410
- export const AllStates: Story = {
411
- render: () => (
412
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
413
- <Box>
414
- <Typography variant="h6" gutterBottom>
415
- Normal State
416
- </Typography>
417
- <RadioGroup options={priorityOptions} variant="buttons" direction="row" />
418
- </Box>
419
- <Box>
420
- <Typography variant="h6" gutterBottom>
421
- With Selection
422
- </Typography>
423
- <RadioGroup options={priorityOptions} variant="buttons" direction="row" value="medium" />
424
- </Box>
425
- <Box>
426
- <Typography variant="h6" gutterBottom>
427
- With Disabled Option
428
- </Typography>
429
- <RadioGroup
430
- options={[
431
- { value: 'option1', label: 'Option 1' },
432
- { value: 'option2', label: 'Option 2', disabled: true },
433
- { value: 'option3', label: 'Option 3' },
434
- ]}
435
- variant="buttons"
436
- direction="row"
437
- />
438
- </Box>
439
- <Box>
440
- <Typography variant="h6" gutterBottom>
441
- Error State
442
- </Typography>
443
- <RadioGroup
444
- options={priorityOptions}
445
- variant="cards"
446
- error
447
- helperText="Selection required"
448
- />
449
- </Box>
450
- </Box>
451
- ),
452
- };
453
-
454
- export const InteractiveStates: Story = {
455
- render: () => (
456
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
457
- <Box>
458
- <Typography variant="h6" gutterBottom>
459
- Hover and Focus States
460
- </Typography>
461
- <Typography variant="body2" color="text.secondary" gutterBottom>
462
- Try hovering and using keyboard navigation on the options below
463
- </Typography>
464
- <RadioGroup options={priorityOptions} variant="buttons" direction="row" color="primary" />
465
- </Box>
466
- <Box>
467
- <Typography variant="h6" gutterBottom>
468
- Card Variant Interactions
469
- </Typography>
470
- <RadioGroup options={paymentOptions} variant="cards" showDescriptions />
471
- </Box>
472
- </Box>
473
- ),
474
- };
475
-
476
- export const Responsive: Story = {
477
- render: () => (
478
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
479
- <Box>
480
- <Typography variant="h6" gutterBottom>
481
- Responsive Button Layout
482
- </Typography>
483
- <Typography variant="body2" color="text.secondary" gutterBottom>
484
- Buttons stack on mobile, inline on desktop
485
- </Typography>
486
- <RadioGroup
487
- options={priorityOptions}
488
- variant="buttons"
489
- direction="row"
490
- sx={{
491
- flexDirection: { xs: 'column', sm: 'row' },
492
- gap: 1,
493
- }}
494
- />
495
- </Box>
496
- <Box>
497
- <Typography variant="h6" gutterBottom>
498
- Responsive Card Grid
499
- </Typography>
500
- <Typography variant="body2" color="text.secondary" gutterBottom>
501
- Cards adapt to screen size
502
- </Typography>
503
- <RadioGroup
504
- options={paymentOptions}
505
- variant="cards"
506
- showDescriptions
507
- sx={{
508
- gridTemplateColumns: {
509
- xs: '1fr',
510
- sm: 'repeat(2, 1fr)',
511
- md: 'repeat(4, 1fr)',
512
- },
513
- }}
514
- />
515
- </Box>
516
- </Box>
517
- ),
518
- };