@shohojdhara/atomix 0.3.5 → 0.3.6

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 (173) hide show
  1. package/README.md +101 -199
  2. package/atomix.config.ts +241 -0
  3. package/dist/atomix.css +260 -179
  4. package/dist/atomix.css.map +1 -1
  5. package/dist/atomix.min.css +250 -179
  6. package/dist/atomix.min.css.map +1 -1
  7. package/dist/charts.js +61 -66
  8. package/dist/charts.js.map +1 -1
  9. package/dist/core.js +47 -31
  10. package/dist/core.js.map +1 -1
  11. package/dist/forms.js +47 -31
  12. package/dist/forms.js.map +1 -1
  13. package/dist/heavy.js +47 -31
  14. package/dist/heavy.js.map +1 -1
  15. package/dist/index.d.ts +1841 -1633
  16. package/dist/index.esm.js +4975 -4113
  17. package/dist/index.esm.js.map +1 -1
  18. package/dist/index.js +5151 -4290
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.min.js +1 -1
  21. package/dist/index.min.js.map +1 -1
  22. package/dist/theme.d.ts +1572 -1442
  23. package/dist/theme.js +4816 -4080
  24. package/dist/theme.js.map +1 -1
  25. package/package.json +6 -20
  26. package/src/components/Accordion/Accordion.stories.tsx +50 -17
  27. package/src/components/AtomixGlass/AtomixGlass.tsx +65 -31
  28. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +11 -4
  29. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1 -32
  30. package/src/components/AtomixGlass/stories/Examples.stories.tsx +2 -2
  31. package/src/components/AtomixGlass/stories/shared-components.tsx +0 -31
  32. package/src/components/Avatar/Avatar.stories.tsx +7 -0
  33. package/src/components/Badge/Badge.stories.tsx +91 -13
  34. package/src/components/Block/Block.stories.tsx +7 -23
  35. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +7 -0
  36. package/src/components/Button/Button.stories.tsx +141 -22
  37. package/src/components/Button/ButtonGroup.stories.tsx +315 -0
  38. package/src/components/Button/ButtonGroup.tsx +67 -0
  39. package/src/components/Button/index.ts +2 -0
  40. package/src/components/Callout/Callout.stories.tsx +8 -6
  41. package/src/components/Card/Card.stories.tsx +82 -28
  42. package/src/components/Chart/AnimatedChart.tsx +0 -1
  43. package/src/components/Chart/AreaChart.tsx +0 -1
  44. package/src/components/Chart/BarChart.tsx +0 -1
  45. package/src/components/Chart/BubbleChart.tsx +0 -1
  46. package/src/components/Chart/CandlestickChart.tsx +0 -1
  47. package/src/components/Chart/Chart.stories.tsx +5 -7
  48. package/src/components/Chart/Chart.tsx +0 -16
  49. package/src/components/Chart/ChartRenderer.tsx +1 -1
  50. package/src/components/Chart/DonutChart.tsx +0 -1
  51. package/src/components/Chart/FunnelChart.tsx +0 -1
  52. package/src/components/Chart/GaugeChart.tsx +0 -1
  53. package/src/components/Chart/HeatmapChart.tsx +0 -1
  54. package/src/components/Chart/LineChart.tsx +0 -1
  55. package/src/components/Chart/MultiAxisChart.tsx +0 -1
  56. package/src/components/Chart/PieChart.tsx +0 -1
  57. package/src/components/Chart/RadarChart.tsx +0 -1
  58. package/src/components/Chart/ScatterChart.tsx +0 -1
  59. package/src/components/Chart/WaterfallChart.tsx +0 -1
  60. package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +7 -0
  61. package/src/components/DataTable/DataTable.stories.tsx +23 -16
  62. package/src/components/DatePicker/DatePicker.stories.tsx +27 -19
  63. package/src/components/Dropdown/Dropdown.stories.tsx +11 -19
  64. package/src/components/EdgePanel/EdgePanel.stories.tsx +1 -0
  65. package/src/components/Footer/Footer.stories.tsx +8 -6
  66. package/src/components/Footer/FooterLink.tsx +9 -2
  67. package/src/components/Form/Checkbox.stories.tsx +7 -0
  68. package/src/components/Form/Form.stories.tsx +7 -0
  69. package/src/components/Form/FormGroup.stories.tsx +9 -1
  70. package/src/components/Form/Input.stories.tsx +69 -16
  71. package/src/components/Form/Radio.stories.tsx +9 -1
  72. package/src/components/Form/Select.stories.tsx +9 -1
  73. package/src/components/Form/Textarea.stories.tsx +10 -2
  74. package/src/components/Hero/Hero.stories.tsx +7 -0
  75. package/src/components/List/List.stories.tsx +7 -0
  76. package/src/components/Messages/Messages.stories.tsx +8 -7
  77. package/src/components/Modal/Modal.stories.tsx +17 -6
  78. package/src/components/Navigation/Menu/Menu.stories.tsx +7 -0
  79. package/src/components/Navigation/Nav/Nav.stories.tsx +7 -0
  80. package/src/components/Navigation/Navbar/Navbar.stories.tsx +1 -0
  81. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +1 -1
  82. package/src/components/Pagination/Pagination.stories.tsx +188 -111
  83. package/src/components/Pagination/Pagination.tsx +83 -3
  84. package/src/components/PhotoViewer/PhotoViewer.stories.tsx +10 -5
  85. package/src/components/Popover/Popover.stories.tsx +191 -115
  86. package/src/components/ProductReview/ProductReview.stories.tsx +80 -58
  87. package/src/components/Progress/Progress.stories.tsx +79 -49
  88. package/src/components/Rating/Rating.stories.tsx +109 -84
  89. package/src/components/River/River.stories.tsx +194 -114
  90. package/src/components/SectionIntro/SectionIntro.stories.tsx +19 -9
  91. package/src/components/Slider/Slider.stories.tsx +7 -0
  92. package/src/components/Spinner/Spinner.stories.tsx +15 -11
  93. package/src/components/Steps/Steps.stories.tsx +132 -98
  94. package/src/components/Tabs/Tabs.stories.tsx +163 -112
  95. package/src/components/Testimonial/Testimonial.stories.tsx +114 -68
  96. package/src/components/Todo/Todo.stories.tsx +38 -12
  97. package/src/components/Toggle/Toggle.stories.tsx +61 -28
  98. package/src/components/Tooltip/Tooltip.stories.tsx +318 -200
  99. package/src/components/Upload/Upload.stories.tsx +122 -84
  100. package/src/components/VideoPlayer/VideoPlayer.stories.tsx +7 -24
  101. package/src/components/index.ts +1 -0
  102. package/src/lib/composables/useAtomixGlass.ts +2 -3
  103. package/src/lib/composables/useNavbar.ts +0 -10
  104. package/src/lib/config/loader.ts +2 -1
  105. package/src/lib/constants/components.ts +10 -0
  106. package/src/lib/hooks/useComponentCustomization.ts +1 -1
  107. package/src/lib/theme/README.md +174 -0
  108. package/src/lib/theme/adapters/index.ts +31 -0
  109. package/src/lib/theme/adapters/themeAdapter.ts +287 -0
  110. package/src/lib/theme/config/__tests__/configLoader.test.ts +207 -0
  111. package/src/lib/theme/config/configLoader.ts +254 -0
  112. package/src/lib/theme/config/loader.ts +37 -48
  113. package/src/lib/theme/config/types.ts +2 -2
  114. package/src/lib/theme/config/validator.ts +15 -91
  115. package/src/lib/theme/{constants.ts → constants/constants.ts} +0 -18
  116. package/src/lib/theme/constants/index.ts +8 -0
  117. package/src/lib/theme/core/ThemeRegistry.ts +19 -6
  118. package/src/lib/theme/core/__tests__/createTheme.test.ts +132 -0
  119. package/src/lib/theme/core/composeTheme.ts +155 -0
  120. package/src/lib/theme/core/createTheme.ts +94 -0
  121. package/src/lib/theme/{createTheme.ts → core/createThemeObject.ts} +10 -6
  122. package/src/lib/theme/core/index.ts +5 -19
  123. package/src/lib/theme/devtools/Comparator.tsx +346 -22
  124. package/src/lib/theme/devtools/IMPROVEMENTS.md +139 -38
  125. package/src/lib/theme/devtools/Inspector.tsx +335 -51
  126. package/src/lib/theme/devtools/LiveEditor.tsx +478 -107
  127. package/src/lib/theme/devtools/Preview.tsx +471 -221
  128. package/src/lib/theme/{core → devtools}/ThemeValidator.ts +1 -1
  129. package/src/lib/theme/devtools/index.ts +14 -4
  130. package/src/lib/theme/devtools/useHistory.ts +130 -0
  131. package/src/lib/theme/errors/index.ts +12 -0
  132. package/src/lib/theme/generators/cssFile.ts +79 -0
  133. package/src/lib/theme/generators/generateCSS.ts +89 -0
  134. package/src/lib/theme/{generateCSSVariables.ts → generators/generateCSSVariables.ts} +3 -13
  135. package/src/lib/theme/generators/index.ts +19 -0
  136. package/src/lib/theme/i18n/rtl.ts +5 -6
  137. package/src/lib/theme/index.ts +120 -15
  138. package/src/lib/theme/runtime/ThemeApplicator.ts +52 -111
  139. package/src/lib/theme/{ThemeContext.tsx → runtime/ThemeContext.tsx} +1 -1
  140. package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +1 -1
  141. package/src/lib/theme/runtime/ThemeProvider.tsx +456 -179
  142. package/src/lib/theme/runtime/index.ts +1 -2
  143. package/src/lib/theme/runtime/useTheme.ts +1 -2
  144. package/src/lib/theme/test/testTheme.ts +385 -0
  145. package/src/lib/theme/tokens/index.ts +12 -0
  146. package/src/lib/theme/tokens/tokens.ts +721 -0
  147. package/src/lib/theme/types.ts +6 -42
  148. package/src/lib/theme/{utils.ts → utils/domUtils.ts} +2 -2
  149. package/src/lib/theme/utils/index.ts +11 -0
  150. package/src/lib/theme/utils/injectCSS.ts +90 -0
  151. package/src/lib/theme/utils/themeHelpers.ts +78 -0
  152. package/src/lib/theme/{themeUtils.ts → utils/themeUtils.ts} +1 -1
  153. package/src/lib/theme-tools.ts +7 -8
  154. package/src/lib/types/components.ts +40 -130
  155. package/src/lib/utils/componentUtils.ts +1 -1
  156. package/src/styles/01-settings/_settings.design-tokens.scss +4 -1
  157. package/src/styles/02-tools/_tools.button.scss +66 -79
  158. package/src/styles/06-components/_components.atomix-glass.scss +13 -3
  159. package/src/styles/06-components/_components.pagination.scss +88 -0
  160. package/scripts/sync-theme-config.js +0 -309
  161. package/src/lib/theme/composeTheme.ts +0 -370
  162. package/src/lib/theme/core/ThemeCache.ts +0 -283
  163. package/src/lib/theme/core/ThemeEngine.test.ts +0 -146
  164. package/src/lib/theme/core/ThemeEngine.ts +0 -665
  165. package/src/lib/theme/createThemeFromConfig.ts +0 -132
  166. package/src/lib/theme/devtools/CLI.ts +0 -364
  167. package/src/lib/theme/runtime/ThemeManager.test.ts +0 -192
  168. package/src/lib/theme/runtime/ThemeManager.ts +0 -446
  169. package/src/styles/03-generic/_generated-root.css +0 -26
  170. package/src/themes/README.md +0 -442
  171. package/src/themes/themes.config.js +0 -68
  172. /package/src/lib/theme/{cssVariableMapper.ts → adapters/cssVariableMapper.ts} +0 -0
  173. /package/src/lib/theme/{errors.ts → errors/errors.ts} +0 -0
@@ -0,0 +1,315 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { ButtonGroup } from './ButtonGroup';
3
+ import { Button } from './Button';
4
+ import { SIZES } from '../../lib/constants/components';
5
+
6
+ const meta = {
7
+ title: 'Components/ButtonGroup',
8
+ component: ButtonGroup,
9
+ parameters: {
10
+ layout: 'centered',
11
+ docs: {
12
+ description: {
13
+ component:
14
+ 'The ButtonGroup component groups multiple buttons together, creating a visually connected set of buttons with proper border radius handling. Buttons in a group share borders and have rounded corners only on the outer edges.',
15
+ },
16
+ },
17
+ },
18
+ tags: ['autodocs'],
19
+ argTypes: {
20
+ className: {
21
+ control: 'text',
22
+ description: 'Additional CSS class names',
23
+ },
24
+ 'aria-label': {
25
+ control: 'text',
26
+ description: 'ARIA label for accessibility',
27
+ },
28
+ role: {
29
+ control: 'text',
30
+ description: 'ARIA role for the button group',
31
+ },
32
+ },
33
+ } satisfies Meta<typeof ButtonGroup>;
34
+
35
+ export default meta;
36
+ type Story = StoryObj<typeof meta>;
37
+
38
+ // Basic Button Groups
39
+ export const Basic: Story = {
40
+ render: () => (
41
+ <ButtonGroup>
42
+ <Button label="Left" />
43
+ <Button label="Middle" />
44
+ <Button label="Right" />
45
+ </ButtonGroup>
46
+ ),
47
+ };
48
+
49
+ export const TwoButtons: Story = {
50
+ render: () => (
51
+ <ButtonGroup>
52
+ <Button label="Cancel" variant="secondary" />
53
+ <Button label="Save" variant="primary" />
54
+ </ButtonGroup>
55
+ ),
56
+ };
57
+
58
+ export const ThreeButtons: Story = {
59
+ render: () => (
60
+ <ButtonGroup>
61
+ <Button label="Previous" variant="secondary" />
62
+ <Button label="Next" variant="primary" />
63
+ <Button label="Finish" variant="success" />
64
+ </ButtonGroup>
65
+ ),
66
+ };
67
+
68
+ // Variant Combinations
69
+ export const PrimaryGroup: Story = {
70
+ render: () => (
71
+ <ButtonGroup>
72
+ <Button label="One" variant="primary" />
73
+ <Button label="Two" variant="primary" />
74
+ <Button label="Three" variant="primary" />
75
+ </ButtonGroup>
76
+ ),
77
+ };
78
+
79
+ export const SecondaryGroup: Story = {
80
+ render: () => (
81
+ <ButtonGroup>
82
+ <Button label="One" variant="secondary" />
83
+ <Button label="Two" variant="secondary" />
84
+ <Button label="Three" variant="secondary" />
85
+ </ButtonGroup>
86
+ ),
87
+ };
88
+
89
+ export const OutlineGroup: Story = {
90
+ render: () => (
91
+ <ButtonGroup>
92
+ <Button label="One" variant="outline-primary" />
93
+ <Button label="Two" variant="outline-primary" />
94
+ <Button label="Three" variant="outline-primary" />
95
+ </ButtonGroup>
96
+ ),
97
+ };
98
+
99
+ export const MixedVariants: Story = {
100
+ render: () => (
101
+ <ButtonGroup>
102
+ <Button label="Cancel" variant="secondary" />
103
+ <Button label="Save Draft" variant="outline-primary" />
104
+ <Button label="Publish" variant="primary" />
105
+ </ButtonGroup>
106
+ ),
107
+ };
108
+
109
+ // Size Variants
110
+ export const SmallSize: Story = {
111
+ render: () => (
112
+ <ButtonGroup>
113
+ <Button label="Small" size="sm" />
114
+ <Button label="Buttons" size="sm" />
115
+ <Button label="Group" size="sm" />
116
+ </ButtonGroup>
117
+ ),
118
+ };
119
+
120
+ export const MediumSize: Story = {
121
+ render: () => (
122
+ <ButtonGroup>
123
+ <Button label="Medium" size="md" />
124
+ <Button label="Buttons" size="md" />
125
+ <Button label="Group" size="md" />
126
+ </ButtonGroup>
127
+ ),
128
+ };
129
+
130
+ export const LargeSize: Story = {
131
+ render: () => (
132
+ <ButtonGroup>
133
+ <Button label="Large" size="lg" />
134
+ <Button label="Buttons" size="lg" />
135
+ <Button label="Group" size="lg" />
136
+ </ButtonGroup>
137
+ ),
138
+ };
139
+
140
+ // With Icons
141
+ export const WithIcons: Story = {
142
+ render: () => (
143
+ <ButtonGroup>
144
+ <Button label="Previous" iconName="ArrowLeft" iconPosition="start" />
145
+ <Button label="Next" iconName="ArrowRight" iconPosition="end" />
146
+ </ButtonGroup>
147
+ ),
148
+ };
149
+
150
+ export const IconOnly: Story = {
151
+ render: () => (
152
+ <ButtonGroup>
153
+ <Button iconName="CaretLeft" iconOnly ariaLabel="Previous" />
154
+ <Button iconName="CaretRight" iconOnly ariaLabel="Next" />
155
+ </ButtonGroup>
156
+ ),
157
+ };
158
+
159
+ // States
160
+ export const WithDisabled: Story = {
161
+ render: () => (
162
+ <ButtonGroup>
163
+ <Button label="Enabled" />
164
+ <Button label="Disabled" disabled />
165
+ <Button label="Enabled" />
166
+ </ButtonGroup>
167
+ ),
168
+ };
169
+
170
+ export const WithLoading: Story = {
171
+ render: () => (
172
+ <ButtonGroup>
173
+ <Button label="Normal" />
174
+ <Button label="Loading" loading />
175
+ <Button label="Normal" />
176
+ </ButtonGroup>
177
+ ),
178
+ };
179
+
180
+ export const WithActive: Story = {
181
+ render: () => (
182
+ <ButtonGroup>
183
+ <Button label="Inactive" />
184
+ <Button label="Active" active />
185
+ <Button label="Inactive" />
186
+ </ButtonGroup>
187
+ ),
188
+ };
189
+
190
+ export const WithSelected: Story = {
191
+ render: () => (
192
+ <ButtonGroup>
193
+ <Button label="Option 1" selected />
194
+ <Button label="Option 2" />
195
+ <Button label="Option 3" />
196
+ </ButtonGroup>
197
+ ),
198
+ };
199
+
200
+ // Action Examples
201
+ export const ActionButtons: Story = {
202
+ render: () => (
203
+ <ButtonGroup>
204
+ <Button label="Delete" variant="danger" />
205
+ <Button label="Edit" variant="warning" />
206
+ <Button label="View" variant="info" />
207
+ </ButtonGroup>
208
+ ),
209
+ };
210
+
211
+ export const NavigationButtons: Story = {
212
+ render: () => (
213
+ <ButtonGroup>
214
+ <Button label="First" variant="outline-secondary" />
215
+ <Button label="Previous" variant="outline-secondary" />
216
+ <Button label="Next" variant="outline-secondary" />
217
+ <Button label="Last" variant="outline-secondary" />
218
+ </ButtonGroup>
219
+ ),
220
+ };
221
+
222
+ export const FilterButtons: Story = {
223
+ render: () => (
224
+ <ButtonGroup>
225
+ <Button label="All" selected />
226
+ <Button label="Active" />
227
+ <Button label="Completed" />
228
+ </ButtonGroup>
229
+ ),
230
+ };
231
+
232
+ // Multiple Groups
233
+ export const MultipleGroups: Story = {
234
+ render: () => (
235
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
236
+ <ButtonGroup>
237
+ <Button label="Group 1 - Button 1" />
238
+ <Button label="Group 1 - Button 2" />
239
+ <Button label="Group 1 - Button 3" />
240
+ </ButtonGroup>
241
+ <ButtonGroup>
242
+ <Button label="Group 2 - Button 1" variant="secondary" />
243
+ <Button label="Group 2 - Button 2" variant="secondary" />
244
+ </ButtonGroup>
245
+ </div>
246
+ ),
247
+ };
248
+
249
+ // Accessibility
250
+ export const WithAriaLabel: Story = {
251
+ render: () => (
252
+ <ButtonGroup aria-label="Navigation controls">
253
+ <Button label="Previous" />
254
+ <Button label="Next" />
255
+ </ButtonGroup>
256
+ ),
257
+ };
258
+
259
+ // Custom Styling
260
+ export const CustomClassName: Story = {
261
+ render: () => (
262
+ <ButtonGroup className="custom-button-group">
263
+ <Button label="Custom" />
264
+ <Button label="Styled" />
265
+ <Button label="Group" />
266
+ </ButtonGroup>
267
+ ),
268
+ };
269
+
270
+ // Edge Cases
271
+ export const SingleButton: Story = {
272
+ render: () => (
273
+ <ButtonGroup>
274
+ <Button label="Single Button" />
275
+ </ButtonGroup>
276
+ ),
277
+ };
278
+
279
+ export const ManyButtons: Story = {
280
+ render: () => (
281
+ <ButtonGroup>
282
+ <Button label="1" />
283
+ <Button label="2" />
284
+ <Button label="3" />
285
+ <Button label="4" />
286
+ <Button label="5" />
287
+ <Button label="6" />
288
+ </ButtonGroup>
289
+ ),
290
+ };
291
+
292
+ // Rounded Buttons
293
+ export const RoundedButtons: Story = {
294
+ render: () => (
295
+ <ButtonGroup>
296
+ <Button label="Rounded" rounded />
297
+ <Button label="Buttons" rounded />
298
+ <Button label="Group" rounded />
299
+ </ButtonGroup>
300
+ ),
301
+ };
302
+
303
+ // Full Width
304
+ export const FullWidth: Story = {
305
+ render: () => (
306
+ <div style={{ width: '100%', maxWidth: '600px' }}>
307
+ <ButtonGroup>
308
+ <Button label="Full" fullWidth />
309
+ <Button label="Width" fullWidth />
310
+ <Button label="Group" fullWidth />
311
+ </ButtonGroup>
312
+ </div>
313
+ ),
314
+ };
315
+
@@ -0,0 +1,67 @@
1
+ import React, { Children, cloneElement, isValidElement } from 'react';
2
+ import { ButtonGroupProps, ButtonProps } from '../../lib/types/components';
3
+ import { BUTTON_GROUP } from '../../lib/constants/components';
4
+ import { Button } from './Button';
5
+
6
+ /**
7
+ * ButtonGroup - A component for grouping buttons together
8
+ *
9
+ * Groups buttons together with proper border radius handling and spacing.
10
+ * The buttons will be visually connected with shared borders.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * <ButtonGroup>
15
+ * <Button label="Left" />
16
+ * <Button label="Middle" />
17
+ * <Button label="Right" />
18
+ * </ButtonGroup>
19
+ * ```
20
+ */
21
+ export const ButtonGroup: React.FC<ButtonGroupProps> = ({
22
+ children,
23
+ className = '',
24
+ style,
25
+ 'aria-label': ariaLabel,
26
+ role = 'group',
27
+ }) => {
28
+ // Generate CSS classes
29
+ const buttonGroupClasses = [
30
+ BUTTON_GROUP.CLASSES.BASE,
31
+ className,
32
+ ]
33
+ .filter(Boolean)
34
+ .join(' ');
35
+
36
+ // Get valid Button children
37
+ const buttonChildren = Children.toArray(children).filter(
38
+ child => isValidElement(child) && child.type === Button
39
+ );
40
+
41
+ return (
42
+ <div
43
+ className={buttonGroupClasses}
44
+ style={style}
45
+ role={role}
46
+ aria-label={ariaLabel}
47
+ >
48
+ {buttonChildren.map((child, index) => {
49
+ if (isValidElement<ButtonProps>(child)) {
50
+ // Clone the Button element to ensure proper styling
51
+ return cloneElement(child, {
52
+ key: index,
53
+ ...child.props,
54
+ });
55
+ }
56
+ return null;
57
+ })}
58
+ </div>
59
+ );
60
+ };
61
+
62
+ export type { ButtonGroupProps };
63
+
64
+ ButtonGroup.displayName = 'ButtonGroup';
65
+
66
+ export default ButtonGroup;
67
+
@@ -1,3 +1,5 @@
1
1
  export { Button } from './Button';
2
2
  export { default } from './Button';
3
3
  export type { ButtonProps } from './Button';
4
+ export { ButtonGroup } from './ButtonGroup';
5
+ export type { ButtonGroupProps } from './ButtonGroup';
@@ -1,9 +1,10 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { Meta, StoryObj } from '@storybook/react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
3
  import { Button } from '../Button/Button';
4
4
  import { Callout } from './Callout';
5
+ import { THEME_COLORS } from '../../lib/constants/components';
5
6
 
6
- const meta: Meta<typeof Callout> = {
7
+ const meta = {
7
8
  title: 'Components/Callout',
8
9
  component: Callout,
9
10
  parameters: {
@@ -11,14 +12,15 @@ const meta: Meta<typeof Callout> = {
11
12
  docs: {
12
13
  description: {
13
14
  component:
14
- 'Callout components are used to display important messages, notifications, or alerts to users. They can be used to provide feedback, warnings, errors, or general information.',
15
+ 'Callout components are used to display important messages, notifications, or alerts to users. They can be used to provide feedback, warnings, errors, or general information. Callouts support multiple variants, can include icons, and can be dismissible.',
15
16
  },
16
17
  },
17
18
  },
19
+ tags: ['autodocs'],
18
20
  argTypes: {
19
21
  variant: {
20
22
  control: 'select',
21
- options: ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'light', 'dark'],
23
+ options: THEME_COLORS,
22
24
  description: 'The color variant of the callout',
23
25
  table: {
24
26
  defaultValue: { summary: 'primary' },
@@ -86,10 +88,10 @@ const meta: Meta<typeof Callout> = {
86
88
  },
87
89
  },
88
90
  },
89
- };
91
+ } satisfies Meta<typeof Callout>;
90
92
 
91
93
  export default meta;
92
- type Story = StoryObj<typeof Callout>;
94
+ type Story = StoryObj<typeof meta>;
93
95
 
94
96
  // Icon components for different callout types
95
97
  const InfoIcon = () => (
@@ -1,39 +1,52 @@
1
- import { Meta, StoryObj } from '@storybook/react';
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
2
  import React from 'react';
3
3
  import { Card, ElevationCard } from './index';
4
4
  import { Grid, GridCol } from '../../layouts';
5
5
  import { Container } from '../../layouts/';
6
-
7
6
  import Icon from '../Icon';
7
+ import { SIZES, THEME_COLORS } from '../../lib/constants/components';
8
8
 
9
- const meta: Meta<typeof Card> = {
9
+ const meta = {
10
10
  title: 'Components/Card',
11
11
  component: Card,
12
12
  parameters: {
13
13
  layout: 'centered',
14
+ docs: {
15
+ description: {
16
+ component:
17
+ 'The Card component provides a flexible container for displaying content with optional headers, images, and footers. Cards are ideal for grouping related information, showcasing products, or presenting content in a structured format. They support multiple variants, sizes, and can be interactive.',
18
+ },
19
+ },
14
20
  },
21
+ tags: ['autodocs'],
15
22
  argTypes: {
16
- header: { control: 'text' },
17
- title: { control: 'text' },
18
- text: { control: 'text' },
19
- image: { control: 'text' },
20
- imageAlt: { control: 'text' },
21
- footer: { control: 'text' },
23
+ header: { control: 'text', description: 'Header content for the card' },
24
+ title: { control: 'text', description: 'Title of the card' },
25
+ text: { control: 'text', description: 'Main text content of the card' },
26
+ image: { control: 'text', description: 'Image URL for the card' },
27
+ imageAlt: { control: 'text', description: 'Alt text for the card image' },
28
+ footer: { control: 'text', description: 'Footer content for the card' },
22
29
  size: {
23
- control: 'select',
24
- options: ['sm', 'md', 'lg'],
30
+ control: { type: 'select' },
31
+ options: SIZES,
32
+ description: 'Size of the card',
33
+ defaultValue: 'md',
25
34
  },
26
35
  variant: {
27
- control: 'select',
28
- options: ['primary', 'secondary', 'success', 'error', 'warning', 'info', 'light', 'dark'],
36
+ control: { type: 'select' },
37
+ options: THEME_COLORS,
38
+ description: 'Color variant of the card',
39
+ defaultValue: 'secondary',
29
40
  },
30
41
  appearance: {
31
- control: 'select',
42
+ control: { type: 'select' },
32
43
  options: ['filled', 'outlined', 'ghost', 'elevated'],
44
+ defaultValue: 'filled',
33
45
  },
34
46
  elevation: {
35
- control: 'select',
47
+ control: { type: 'select' },
36
48
  options: ['none', 'sm', 'md', 'lg', 'xl'],
49
+ defaultValue: 'none',
37
50
  },
38
51
  row: { control: 'boolean' },
39
52
  flat: { control: 'boolean' },
@@ -42,14 +55,16 @@ const meta: Meta<typeof Card> = {
42
55
  loading: { control: 'boolean' },
43
56
  selected: { control: 'boolean' },
44
57
  interactive: { control: 'boolean' },
45
- className: { control: 'text' },
58
+ className: { control: 'text', description: 'Additional CSS class names' },
46
59
  },
47
- };
60
+ } satisfies Meta<typeof Card>;
48
61
 
49
62
  export default meta;
50
- type Story = StoryObj<typeof Card>;
63
+ type Story = StoryObj<typeof meta>;
51
64
 
52
- // Basic Card
65
+ /**
66
+ * Basic card with title and text content.
67
+ */
53
68
  export const Basic: Story = {
54
69
  args: {
55
70
  title: 'Card Title',
@@ -58,7 +73,9 @@ export const Basic: Story = {
58
73
  },
59
74
  };
60
75
 
61
- // Card with Image
76
+ /**
77
+ * Card with an image displayed above the content.
78
+ */
62
79
  export const WithImage: Story = {
63
80
  args: {
64
81
  title: 'Card with Image',
@@ -68,7 +85,9 @@ export const WithImage: Story = {
68
85
  },
69
86
  };
70
87
 
71
- // Card with Actions
88
+ /**
89
+ * Card with action buttons in the footer.
90
+ */
72
91
  export const WithActions: Story = {
73
92
  args: {
74
93
  title: 'Card with Actions',
@@ -82,7 +101,9 @@ export const WithActions: Story = {
82
101
  },
83
102
  };
84
103
 
85
- // Row Card
104
+ /**
105
+ * Card with horizontal (row) layout - image on the left, content on the right.
106
+ */
86
107
  export const Row: Story = {
87
108
  args: {
88
109
  title: 'Row Layout Card',
@@ -93,7 +114,9 @@ export const Row: Story = {
93
114
  },
94
115
  };
95
116
 
96
- // Flat Card
117
+ /**
118
+ * Flat style card with image extending to the edges.
119
+ */
97
120
  export const Flat: Story = {
98
121
  args: {
99
122
  title: 'Flat Style Card',
@@ -104,7 +127,9 @@ export const Flat: Story = {
104
127
  },
105
128
  };
106
129
 
107
- // Clickable Card
130
+ /**
131
+ * Clickable card with onClick handler.
132
+ */
108
133
  export const Clickable: Story = {
109
134
  args: {
110
135
  title: 'Clickable Card',
@@ -113,7 +138,9 @@ export const Clickable: Story = {
113
138
  },
114
139
  };
115
140
 
116
- // Elevation Card
141
+ /**
142
+ * Card with elevation effect that responds to hover.
143
+ */
117
144
  export const WithElevation: Story = {
118
145
  render: args => (
119
146
  <div style={{ padding: '20px', width: '300px' }}>
@@ -128,8 +155,17 @@ export const WithElevation: Story = {
128
155
  },
129
156
  };
130
157
 
131
- // Card with Glass Effect
158
+ /**
159
+ * Card with glass morphism effect enabled.
160
+ */
132
161
  export const WithGlassEffect: Story = {
162
+ parameters: {
163
+ docs: {
164
+ description: {
165
+ story: 'Demonstrates a card with glass morphism effect applied, creating a translucent, frosted appearance that works well over colorful backgrounds.',
166
+ },
167
+ },
168
+ },
133
169
  render: args => (
134
170
  <div
135
171
  style={{
@@ -464,8 +500,17 @@ export const GlassModeShader: Story = {
464
500
  ),
465
501
  };
466
502
 
467
- // All Glass Modes Comparison
503
+ /**
504
+ * Comparison of all glass morphism modes side by side.
505
+ */
468
506
  export const AllGlassModesComparison: Story = {
507
+ parameters: {
508
+ docs: {
509
+ description: {
510
+ story: 'Side-by-side comparison of all available glass morphism modes (standard, polar, prominent, shader) to help you choose the right effect for your design.',
511
+ },
512
+ },
513
+ },
469
514
  render: () => (
470
515
  <div
471
516
  style={{
@@ -956,8 +1001,17 @@ export const LinkCard: Story = {
956
1001
  },
957
1002
  };
958
1003
 
959
- // Comprehensive Example
1004
+ /**
1005
+ * Comprehensive example showcasing multiple card features and variants.
1006
+ */
960
1007
  export const Comprehensive: Story = {
1008
+ parameters: {
1009
+ docs: {
1010
+ description: {
1011
+ story: 'A comprehensive example demonstrating various card features including sizes, variants, appearances, elevations, and states in a grid layout.',
1012
+ },
1013
+ },
1014
+ },
961
1015
  render: () => (
962
1016
  <Container>
963
1017
  <Grid>
@@ -71,7 +71,6 @@ const AnimatedChart = memo(
71
71
  toolbarState,
72
72
  config: renderConfig,
73
73
  }: ChartRenderContentParams) => {
74
- // Use toolbar state if available, fallback to config for backward compatibility
75
74
  const shouldAnimate = toolbarState?.animationsEnabled ?? renderConfig?.animate ?? true;
76
75
 
77
76
  if (!chartDatasets.length) return null;
@@ -33,7 +33,6 @@ const AreaChart = memo(
33
33
  }: ChartRenderContentParams) => {
34
34
  if (!renderedDatasets.length) return null;
35
35
 
36
- // Use toolbar state if available, fallback to config for backward compatibility
37
36
  const showTooltips = toolbarState?.showTooltips ?? renderConfig?.showTooltips ?? true;
38
37
 
39
38
  return (
@@ -43,7 +43,6 @@ const BarChart = memo(
43
43
  }: ChartRenderContentParams) => {
44
44
  if (!renderedDatasets.length) return null;
45
45
 
46
- // Use toolbar state if available, fallback to config for backward compatibility
47
46
  const showTooltips = toolbarState?.showTooltips ?? renderConfig?.showTooltips ?? true;
48
47
 
49
48
  const barDimensions = calculateBarDimensions(
@@ -112,7 +112,6 @@ const BubbleChart = memo(
112
112
  }: any) => {
113
113
  if (!bubbleData.length) return null;
114
114
 
115
- // Use toolbar state if available, fallback to config for backward compatibility
116
115
  const showTooltips = toolbarState?.showTooltips ?? renderConfig?.showTooltips ?? true;
117
116
 
118
117
  // Calculate bubble sizes based on data
@@ -189,7 +189,6 @@ const CandlestickChart = memo(
189
189
  }: ChartRenderContentParams) => {
190
190
  if (!candlestickData.length) return null;
191
191
 
192
- // Use toolbar state if available, fallback to config for backward compatibility
193
192
  const showTooltips = toolbarState?.showTooltips ?? renderConfig?.showTooltips ?? candlestickOptions.showTooltips ?? true;
194
193
 
195
194
  const padding = 40;