@shohojdhara/atomix 0.3.14 → 0.3.15

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/CHANGELOG.md +20 -0
  2. package/build-tools/EXAMPLES.md +372 -0
  3. package/build-tools/README.md +242 -0
  4. package/build-tools/__tests__/error-handler.test.js +230 -0
  5. package/build-tools/__tests__/index.test.js +141 -0
  6. package/build-tools/__tests__/rollup-plugin.test.js +194 -0
  7. package/build-tools/__tests__/utils.test.js +161 -0
  8. package/build-tools/__tests__/vite-plugin.test.js +129 -0
  9. package/build-tools/__tests__/webpack-loader.test.js +190 -0
  10. package/build-tools/error-handler.js +308 -0
  11. package/build-tools/index.d.ts +43 -0
  12. package/build-tools/index.js +88 -0
  13. package/build-tools/package.json +67 -0
  14. package/build-tools/rollup-plugin.js +236 -0
  15. package/build-tools/types.d.ts +163 -0
  16. package/build-tools/utils.js +203 -0
  17. package/build-tools/vite-plugin.js +161 -0
  18. package/build-tools/webpack-loader.js +123 -0
  19. package/dist/atomix.css +203 -90
  20. package/dist/atomix.css.map +1 -1
  21. package/dist/atomix.min.css +3 -3
  22. package/dist/atomix.min.css.map +1 -1
  23. package/dist/build-tools/EXAMPLES.md +372 -0
  24. package/dist/build-tools/README.md +242 -0
  25. package/dist/build-tools/__tests__/error-handler.test.js +230 -0
  26. package/dist/build-tools/__tests__/index.test.js +141 -0
  27. package/dist/build-tools/__tests__/rollup-plugin.test.js +194 -0
  28. package/dist/build-tools/__tests__/utils.test.js +161 -0
  29. package/dist/build-tools/__tests__/vite-plugin.test.js +129 -0
  30. package/dist/build-tools/__tests__/webpack-loader.test.js +190 -0
  31. package/dist/build-tools/error-handler.js +308 -0
  32. package/dist/build-tools/index.d.ts +43 -0
  33. package/dist/build-tools/index.js +88 -0
  34. package/dist/build-tools/package.json +67 -0
  35. package/dist/build-tools/rollup-plugin.js +236 -0
  36. package/dist/build-tools/types.d.ts +163 -0
  37. package/dist/build-tools/utils.js +203 -0
  38. package/dist/build-tools/vite-plugin.js +161 -0
  39. package/dist/build-tools/webpack-loader.js +123 -0
  40. package/dist/charts.d.ts +1 -1
  41. package/dist/charts.js +86 -57
  42. package/dist/charts.js.map +1 -1
  43. package/dist/core.d.ts +1 -1
  44. package/dist/core.js +136 -112
  45. package/dist/core.js.map +1 -1
  46. package/dist/forms.d.ts +2 -5
  47. package/dist/forms.js +140 -128
  48. package/dist/forms.js.map +1 -1
  49. package/dist/heavy.d.ts +1 -1
  50. package/dist/heavy.js +136 -112
  51. package/dist/heavy.js.map +1 -1
  52. package/dist/index.d.ts +9 -61
  53. package/dist/index.esm.js +237 -286
  54. package/dist/index.esm.js.map +1 -1
  55. package/dist/index.js +250 -299
  56. package/dist/index.js.map +1 -1
  57. package/dist/index.min.js +1 -1
  58. package/dist/index.min.js.map +1 -1
  59. package/package.json +23 -8
  60. package/scripts/atomix-cli.js +170 -73
  61. package/scripts/cli/__tests__/README.md +81 -0
  62. package/scripts/cli/__tests__/basic.test.js +115 -0
  63. package/scripts/cli/__tests__/component-generator.test.js +332 -0
  64. package/scripts/cli/__tests__/integration.test.js +327 -0
  65. package/scripts/cli/__tests__/test-setup.js +133 -0
  66. package/scripts/cli/__tests__/token-manager.test.js +251 -0
  67. package/scripts/cli/__tests__/utils.test.js +161 -0
  68. package/scripts/cli/component-generator.js +253 -299
  69. package/scripts/cli/dependency-checker.js +355 -0
  70. package/scripts/cli/interactive-init.js +46 -5
  71. package/scripts/cli/template-manager.js +0 -2
  72. package/scripts/cli/templates/common-templates.js +636 -0
  73. package/scripts/cli/templates/composable-templates.js +148 -126
  74. package/scripts/cli/templates/index.js +23 -16
  75. package/scripts/cli/templates/project-templates.js +151 -23
  76. package/scripts/cli/templates/react-templates.js +280 -210
  77. package/scripts/cli/templates/scss-templates.js +90 -91
  78. package/scripts/cli/templates/testing-templates.js +206 -27
  79. package/scripts/cli/templates/testing-utils.js +278 -0
  80. package/scripts/cli/templates/types-templates.js +70 -56
  81. package/scripts/cli/theme-bridge.js +8 -2
  82. package/scripts/cli/token-manager.js +318 -206
  83. package/scripts/cli/utils.js +0 -1
  84. package/src/components/Accordion/Accordion.stories.tsx +369 -870
  85. package/src/components/AtomixGlass/AtomixGlass.tsx +80 -39
  86. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +103 -81
  87. package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +8 -7
  88. package/src/components/AtomixGlass/glass-utils.ts +2 -2
  89. package/src/components/AtomixGlass/shader-utils.ts +5 -0
  90. package/src/components/AtomixGlass/stories/Customization.stories.tsx +131 -0
  91. package/src/components/AtomixGlass/stories/Examples.stories.tsx +2957 -2853
  92. package/src/components/AtomixGlass/stories/Modes.stories.tsx +1 -1
  93. package/src/components/AtomixGlass/stories/Overview.stories.tsx +348 -0
  94. package/src/components/AtomixGlass/stories/Performance.stories.tsx +103 -0
  95. package/src/components/AtomixGlass/stories/Playground.stories.tsx +50 -35
  96. package/src/components/AtomixGlass/stories/{ShaderVariants.stories.tsx → Shaders.stories.tsx} +1 -1
  97. package/src/components/AtomixGlass/stories/shared-components.tsx +90 -190
  98. package/src/components/Avatar/Avatar.stories.tsx +213 -1
  99. package/src/components/Badge/Badge.stories.tsx +121 -362
  100. package/src/components/Block/Block.stories.tsx +21 -12
  101. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +141 -23
  102. package/src/components/Button/Button.stories.tsx +463 -1126
  103. package/src/components/Button/Button.test.tsx +107 -0
  104. package/src/components/Button/Button.tsx +46 -50
  105. package/src/components/Button/ButtonGroup.stories.tsx +373 -217
  106. package/src/components/Callout/Callout.stories.tsx +289 -634
  107. package/src/components/Card/Card.stories.tsx +248 -68
  108. package/src/components/Chart/Chart.stories.tsx +150 -8
  109. package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +151 -69
  110. package/src/components/Countdown/Countdown.stories.tsx +115 -8
  111. package/src/components/DataTable/DataTable.stories.tsx +346 -146
  112. package/src/components/DatePicker/DatePicker.stories.tsx +325 -1066
  113. package/src/components/Dropdown/Dropdown.stories.tsx +153 -33
  114. package/src/components/EdgePanel/EdgePanel.stories.tsx +230 -21
  115. package/src/components/Footer/Footer.stories.tsx +392 -328
  116. package/src/components/Form/Checkbox.stories.tsx +140 -6
  117. package/src/components/Form/Checkbox.test.tsx +63 -0
  118. package/src/components/Form/Checkbox.tsx +87 -51
  119. package/src/components/Form/Form.stories.tsx +119 -20
  120. package/src/components/Form/FormGroup.stories.tsx +127 -4
  121. package/src/components/Form/Radio.stories.tsx +140 -5
  122. package/src/components/Form/Select.stories.tsx +140 -8
  123. package/src/components/Form/Textarea.stories.tsx +149 -6
  124. package/src/components/Hero/Hero.stories.tsx +333 -32
  125. package/src/components/List/List.stories.tsx +141 -3
  126. package/src/components/Modal/Modal.stories.tsx +181 -42
  127. package/src/components/Popover/Popover.stories.tsx +448 -98
  128. package/src/components/Progress/Progress.stories.tsx +167 -5
  129. package/src/components/River/River.stories.tsx +1 -1
  130. package/src/components/SectionIntro/SectionIntro.stories.tsx +240 -48
  131. package/src/components/Spinner/Spinner.stories.tsx +102 -8
  132. package/src/components/Steps/Steps.stories.tsx +172 -43
  133. package/src/components/Tabs/Tabs.stories.tsx +136 -10
  134. package/src/components/Testimonial/Testimonial.stories.tsx +120 -3
  135. package/src/components/Todo/Todo.stories.tsx +198 -9
  136. package/src/components/Toggle/Toggle.stories.tsx +126 -39
  137. package/src/components/Tooltip/Tooltip.stories.tsx +194 -104
  138. package/src/components/Upload/Upload.stories.tsx +113 -24
  139. package/src/lib/README.md +2 -2
  140. package/src/lib/__tests__/theme-tools.test.ts +193 -0
  141. package/src/lib/composables/index.ts +2 -2
  142. package/src/lib/composables/useAtomixGlass.ts +28 -56
  143. package/src/lib/composables/useChartExport.ts +2 -7
  144. package/src/lib/composables/useDataTable.ts +46 -29
  145. package/src/lib/constants/components.ts +9 -32
  146. package/src/lib/theme/devtools/CLI.ts +1 -1
  147. package/src/lib/types/components.ts +1 -1
  148. package/src/lib/utils/__tests__/csv.test.ts +45 -0
  149. package/src/lib/utils/csv.ts +17 -0
  150. package/src/lib/utils/dataTableExport.ts +1 -10
  151. package/src/styles/01-settings/_index.scss +2 -1
  152. package/src/styles/01-settings/_settings.accordion.scss +28 -7
  153. package/src/styles/01-settings/_settings.colors.scss +11 -11
  154. package/src/styles/01-settings/_settings.typography.scss +5 -5
  155. package/src/styles/02-tools/_tools.utility-api.scss +14 -0
  156. package/src/styles/06-components/_components.accordion.scss +56 -14
  157. package/src/styles/06-components/_components.checkbox.scss +23 -17
  158. package/src/styles/99-utilities/_index.scss +2 -0
  159. package/src/styles/99-utilities/_utilities.scss +3 -1
  160. package/src/styles/99-utilities/_utilities.text-gradient.scss +45 -0
  161. package/themes/dark-complementary/README.md +98 -0
  162. package/themes/dark-complementary/index.scss +158 -0
  163. package/themes/default-light/README.md +81 -0
  164. package/themes/default-light/index.scss +154 -0
  165. package/themes/high-contrast/README.md +105 -0
  166. package/themes/high-contrast/index.scss +172 -0
  167. package/themes/test-theme/README.md +38 -0
  168. package/themes/test-theme/index.scss +47 -0
  169. package/scripts/cli/templates-original-backup.js +0 -1655
  170. package/scripts/cli/templates_backup.js +0 -684
  171. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +0 -1438
  172. package/src/lib/composables/useButton.ts +0 -93
  173. package/src/lib/composables/useCheckbox.ts +0 -70
@@ -1,4 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
+ import { fn } from '@storybook/test';
2
3
  import React from 'react';
3
4
  import { Card, ElevationCard } from './index';
4
5
  import { Grid, GridCol } from '../../layouts';
@@ -13,69 +14,276 @@ const meta = {
13
14
  layout: 'centered',
14
15
  docs: {
15
16
  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.',
17
+ component: `
18
+ # Card
19
+
20
+ ## Overview
21
+
22
+ Cards are flexible containers for displaying content with optional headers, images, and footers. They are ideal for grouping related information, showcasing products, or presenting content in a structured format. Cards support multiple variants, sizes, and can be interactive.
23
+
24
+ ## Features
25
+
26
+ - Multiple appearance options (filled, outlined, ghost, elevated)
27
+ - Various elevation levels
28
+ - Support for headers, images, and footers
29
+ - Different color variants and sizes
30
+ - Interactive states (active, disabled, loading)
31
+ - Responsive design
32
+
33
+ ## Accessibility
34
+
35
+ - Keyboard support: Cards can be navigated using Tab key
36
+ - Screen reader: Proper semantic markup ensures content is accessible
37
+ - ARIA support: Appropriate roles and properties are automatically applied
38
+ - Focus management: Maintains focus within the card when activated
39
+
40
+ ## Usage Examples
41
+
42
+ ### Basic Usage
43
+
44
+ \`\`\`tsx
45
+ <Card title="Card Title" text="This is a basic card" />
46
+ \`\`\`
47
+
48
+ ### With Image
49
+
50
+ \`\`\`tsx
51
+ <Card
52
+ title="Card with Image"
53
+ text="This card includes an image"
54
+ image="https://example.com/image.jpg"
55
+ imageAlt="Description of image"
56
+ />
57
+ \`\`\`
58
+
59
+ ## API Reference
60
+
61
+ ### Props
62
+
63
+ | Prop | Type | Default | Description |
64
+ | ---- | ---- | ------- | ----------- |
65
+ | header | string | - | Header content for the card |
66
+ | title | string | - | Title of the card |
67
+ | text | string | - | Main text content of the card |
68
+ | image | string | - | Image URL for the card |
69
+ | imageAlt | string | - | Alt text for the card image |
70
+ | footer | string | - | Footer content for the card |
71
+ | size | 'sm' \\| 'md' \\| 'lg' | 'md' | Size of the card |
72
+ | variant | string | 'secondary' | Color variant of the card |
73
+ | appearance | 'filled' \\| 'outlined' \\| 'ghost' \\| 'elevated' | 'filled' | Visual style of the card |
74
+ | elevation | 'none' \\| 'sm' \\| 'md' \\| 'lg' \\| 'xl' | 'none' | Shadow depth of the card |
75
+ | row | boolean | false | Whether to arrange content horizontally |
76
+ | flat | boolean | false | Whether to remove border radius |
77
+ | active | boolean | false | Whether the card is in active state |
78
+ | disabled | boolean | false | Whether the card is disabled |
79
+ | loading | boolean | false | Whether the card is in loading state |
80
+ | selected | boolean | false | Whether the card is selected |
81
+ | interactive | boolean | false | Whether the card responds to interactions |
82
+ | className | string | - | Additional CSS class names |
83
+ `,
18
84
  },
19
85
  },
20
86
  },
21
87
  tags: ['autodocs'],
22
88
  argTypes: {
23
- header: { control: 'text', description: 'Header content for the card' },
24
89
  title: { control: 'text', description: 'Title of the card' },
25
90
  text: { control: 'text', description: 'Main text content of the card' },
26
91
  image: { control: 'text', description: 'Image URL for the card' },
27
92
  imageAlt: { control: 'text', description: 'Alt text for the card image' },
28
- footer: { control: 'text', description: 'Footer content for the card' },
29
93
  size: {
30
94
  control: { type: 'select' },
31
95
  options: SIZES,
32
96
  description: 'Size of the card',
33
97
  defaultValue: 'md',
98
+ table: {
99
+ type: { summary: 'string' },
100
+ defaultValue: { summary: 'md' },
101
+ },
34
102
  },
35
103
  variant: {
36
104
  control: { type: 'select' },
37
105
  options: THEME_COLORS,
38
106
  description: 'Color variant of the card',
39
107
  defaultValue: 'secondary',
108
+ table: {
109
+ type: { summary: 'string' },
110
+ defaultValue: { summary: 'secondary' },
111
+ },
40
112
  },
41
113
  appearance: {
42
114
  control: { type: 'select' },
43
115
  options: ['filled', 'outlined', 'ghost', 'elevated'],
116
+ description: 'Visual style of the card',
44
117
  defaultValue: 'filled',
118
+ table: {
119
+ type: { summary: '"filled" | "outlined" | "ghost" | "elevated"' },
120
+ defaultValue: { summary: 'filled' },
121
+ },
45
122
  },
46
123
  elevation: {
47
124
  control: { type: 'select' },
48
125
  options: ['none', 'sm', 'md', 'lg', 'xl'],
126
+ description: 'Shadow depth of the card',
49
127
  defaultValue: 'none',
128
+ table: {
129
+ type: { summary: '"none" | "sm" | "md" | "lg" | "xl"' },
130
+ defaultValue: { summary: 'none' },
131
+ },
132
+ },
133
+ row: {
134
+ control: 'boolean',
135
+ description: 'Whether to arrange content horizontally',
136
+ table: {
137
+ type: { summary: 'boolean' },
138
+ defaultValue: { summary: false },
139
+ },
140
+ },
141
+ flat: {
142
+ control: 'boolean',
143
+ description: 'Whether to remove border radius',
144
+ table: {
145
+ type: { summary: 'boolean' },
146
+ defaultValue: { summary: false },
147
+ },
148
+ },
149
+ active: {
150
+ control: 'boolean',
151
+ description: 'Whether the card is in active state',
152
+ table: {
153
+ type: { summary: 'boolean' },
154
+ defaultValue: { summary: false },
155
+ },
156
+ },
157
+ disabled: {
158
+ control: 'boolean',
159
+ description: 'Whether the card is disabled',
160
+ table: {
161
+ type: { summary: 'boolean' },
162
+ defaultValue: { summary: false },
163
+ },
164
+ },
165
+ loading: {
166
+ control: 'boolean',
167
+ description: 'Whether the card is in loading state',
168
+ table: {
169
+ type: { summary: 'boolean' },
170
+ defaultValue: { summary: false },
171
+ },
172
+ },
173
+ selected: {
174
+ control: 'boolean',
175
+ description: 'Whether the card is selected',
176
+ table: {
177
+ type: { summary: 'boolean' },
178
+ defaultValue: { summary: false },
179
+ },
180
+ },
181
+ interactive: {
182
+ control: 'boolean',
183
+ description: 'Whether the card responds to interactions',
184
+ table: {
185
+ type: { summary: 'boolean' },
186
+ defaultValue: { summary: false },
187
+ },
188
+ },
189
+ className: {
190
+ control: 'text',
191
+ description: 'Additional CSS class names',
192
+ table: {
193
+ type: { summary: 'string' },
194
+ defaultValue: { summary: '-' },
195
+ },
196
+ },
197
+ onClick: {
198
+ action: 'clicked',
199
+ description: 'Callback when card is clicked',
200
+ },
201
+ header: {
202
+ control: 'boolean',
203
+ description: 'Whether to show the header',
204
+ table: {
205
+ type: { summary: 'boolean' },
206
+ defaultValue: { summary: false },
207
+ },
208
+ },
209
+ footer: {
210
+ control: 'boolean',
211
+ description: 'Whether to show the footer',
212
+ table: {
213
+ type: { summary: 'boolean' },
214
+ defaultValue: { summary: false },
215
+ },
216
+ },
217
+ glass: {
218
+ control: 'boolean',
219
+ description: 'Enable glass morphism effect',
220
+ table: {
221
+ type: { summary: 'boolean' },
222
+ defaultValue: { summary: false },
223
+ },
224
+ },
225
+ rounded: {
226
+ control: 'boolean',
227
+ description: 'Whether the card has rounded corners',
228
+ table: {
229
+ type: { summary: 'boolean' },
230
+ defaultValue: { summary: false },
231
+ },
232
+ },
233
+ border: {
234
+ control: 'boolean',
235
+ description: 'Whether the card has a border',
236
+ table: {
237
+ type: { summary: 'boolean' },
238
+ defaultValue: { summary: false },
239
+ },
240
+ },
241
+ shadow: {
242
+ control: 'boolean',
243
+ description: 'Whether the card has a shadow',
244
+ table: {
245
+ type: { summary: 'boolean' },
246
+ defaultValue: { summary: false },
247
+ },
248
+ },
249
+ hoverable: {
250
+ control: 'boolean',
251
+ description: 'Whether the card has hover effects',
252
+ table: {
253
+ type: { summary: 'boolean' },
254
+ defaultValue: { summary: false },
255
+ },
256
+ },
257
+ mode: {
258
+ control: 'radio',
259
+ options: ['cartesian', 'polar', 'bipolar'],
260
+ description: 'The displacement mode for the glass effect',
261
+ table: {
262
+ type: { summary: '"cartesian" | "polar" | "bipolar"' },
263
+ defaultValue: { summary: 'polar' },
264
+ },
50
265
  },
51
- row: { control: 'boolean' },
52
- flat: { control: 'boolean' },
53
- active: { control: 'boolean' },
54
- disabled: { control: 'boolean' },
55
- loading: { control: 'boolean' },
56
- selected: { control: 'boolean' },
57
- interactive: { control: 'boolean' },
58
- className: { control: 'text', description: 'Additional CSS class names' },
59
266
  },
60
267
  } satisfies Meta<typeof Card>;
61
268
 
62
269
  export default meta;
63
270
  type Story = StoryObj<typeof meta>;
64
271
 
65
- /**
66
- * Basic card with title and text content.
67
- */
68
- export const Basic: Story = {
272
+ export const BasicUsage: Story = {
69
273
  args: {
70
274
  title: 'Card Title',
71
275
  text: 'This is a basic card with title and text content.',
72
276
  className: 'custom-card',
73
277
  },
278
+ parameters: {
279
+ docs: {
280
+ description: {
281
+ story: 'Basic card with title and text content.',
282
+ },
283
+ },
284
+ },
74
285
  };
75
286
 
76
- /**
77
- * Card with an image displayed above the content.
78
- */
79
287
  export const WithImage: Story = {
80
288
  args: {
81
289
  title: 'Card with Image',
@@ -83,11 +291,15 @@ export const WithImage: Story = {
83
291
  image: 'https://placehold.co/600x400',
84
292
  imageAlt: 'Placeholder image',
85
293
  },
294
+ parameters: {
295
+ docs: {
296
+ description: {
297
+ story: 'Card with an image displayed above the content.',
298
+ },
299
+ },
300
+ },
86
301
  };
87
302
 
88
- /**
89
- * Card with action buttons in the footer.
90
- */
91
303
  export const WithActions: Story = {
92
304
  args: {
93
305
  title: 'Card with Actions',
@@ -99,6 +311,13 @@ export const WithActions: Story = {
99
311
  </React.Fragment>
100
312
  ),
101
313
  },
314
+ parameters: {
315
+ docs: {
316
+ description: {
317
+ story: 'Card with action buttons in the footer.',
318
+ },
319
+ },
320
+ },
102
321
  };
103
322
 
104
323
  /**
@@ -167,15 +386,9 @@ export const WithGlassEffect: Story = {
167
386
  },
168
387
  },
169
388
  render: args => (
170
- <div
389
+ <div className="u-bg-cover u-h-80vh u-w-90vw u-grid u-rounded-xl u-overflow-hidden"
171
390
  style={{
172
391
  backgroundImage: `url(https://picsum.photos/id/128/1920/1024)`,
173
- backgroundSize: 'cover',
174
- height: '80vh',
175
- width: '90vw',
176
- display: 'grid',
177
- borderRadius: '12px',
178
- placeItems: 'center',
179
392
  }}
180
393
  >
181
394
  <Card {...args} style={{ ['--atomix-card-width' as string]: '300px' }} />
@@ -753,41 +966,20 @@ export const GlassCardGallery: Story = {
753
966
  // Glass Card Layouts
754
967
  export const GlassCardLayouts: Story = {
755
968
  render: () => (
756
- <div
969
+ <div className="u-bg-cover u-bg-center u-p-12 u-rounded-xl u-min-h-95vh u-min-w-95vw u-overflow-auto"
757
970
  style={{
758
971
  backgroundImage: 'url(https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?w=1920)',
759
- backgroundSize: 'cover',
760
- backgroundPosition: 'center',
761
- padding: '3rem',
762
- borderRadius: '12px',
763
- minHeight: '95vh',
764
- minWidth: '95vw',
765
- overflow: 'auto',
766
972
  }}
767
973
  >
768
974
  <Container>
769
- <h2
770
- style={{
771
- textAlign: 'center',
772
- color: 'white',
773
- marginBottom: '3rem',
774
- fontSize: '2rem',
775
- textShadow: '0 2px 8px rgba(0,0,0,0.5)',
776
- }}
777
- >
975
+ <h2 className="u-text-center u-text-white u-mb-12 u-text-2xl u-text-shadow">
778
976
  Glass Card Layouts
779
977
  </h2>
780
978
 
781
- <div style={{ display: 'flex', gap: '2rem' }}>
979
+ <div className="u-flex u-gap-8">
782
980
  {/* Standard Layout */}
783
981
  <div className="u-w-50">
784
- <h3
785
- style={{
786
- color: 'white',
787
- marginBottom: '1rem',
788
- textShadow: '0 2px 4px rgba(0,0,0,0.5)',
789
- }}
790
- >
982
+ <h3 className="u-text-white u-mb-4 u-text-shadow">
791
983
  Standard Layout
792
984
  </h3>
793
985
  <Card
@@ -807,13 +999,7 @@ export const GlassCardLayouts: Story = {
807
999
 
808
1000
  {/* Row Layout */}
809
1001
  <div className="u-w-50">
810
- <h3
811
- style={{
812
- color: 'white',
813
- marginBottom: '1rem',
814
- textShadow: '0 2px 4px rgba(0,0,0,0.5)',
815
- }}
816
- >
1002
+ <h3 className="u-text-white u-mb-4 u-text-shadow">
817
1003
  Row Layout
818
1004
  </h3>
819
1005
  <Card
@@ -838,13 +1024,7 @@ export const GlassCardLayouts: Story = {
838
1024
 
839
1025
  {/* Flat Layout */}
840
1026
  <div className="u-w-50">
841
- <h3
842
- style={{
843
- color: 'white',
844
- marginBottom: '1rem',
845
- textShadow: '0 2px 4px rgba(0,0,0,0.5)',
846
- }}
847
- >
1027
+ <h3 className="u-text-white u-mb-4 u-text-shadow">
848
1028
  Flat Layout
849
1029
  </h3>
850
1030
  <Card
@@ -1,4 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
+ import { fn } from '@storybook/test';
2
3
  import React from 'react';
3
4
  import { useState } from 'react';
4
5
  import { Container, Grid, GridCol } from '../../layouts/Grid';
@@ -37,12 +38,140 @@ const meta = {
37
38
  layout: 'fullscreen',
38
39
  docs: {
39
40
  description: {
40
- component:
41
- 'The Chart component provides a comprehensive charting library with 20+ chart types including line, bar, pie, area, and more. Charts support real-time data updates, animations, interactive tooltips, and advanced customization options. Ideal for dashboards, analytics, data visualization, and any application requiring graphical data representation.',
41
+ component: `
42
+ # Chart
43
+
44
+ ## Overview
45
+
46
+ Charts provide a comprehensive charting library with 20+ chart types including line, bar, pie, area, and more. Charts support real-time data updates, animations, interactive tooltips, and advanced customization options. Ideal for dashboards, analytics, data visualization, and any application requiring graphical data representation.
47
+
48
+ ## Features
49
+
50
+ - Multiple chart types (Line, Bar, Pie, Area, etc.)
51
+ - Real-time data updates
52
+ - Interactive tooltips and annotations
53
+ - Animation capabilities
54
+ - Glass morphism effects
55
+ - Toolbar with export options
56
+ - Multi-axis support
57
+ - Advanced analytics integration
58
+
59
+ ## Accessibility
60
+
61
+ - Keyboard support: Charts can be navigated using Tab key and arrow keys
62
+ - Screen reader: Data points and chart information announced appropriately
63
+ - ARIA support: Roles and properties ensure chart accessibility
64
+ - Focus management: Maintains focus on interactive chart elements
65
+
66
+ ## Usage Examples
67
+
68
+ ### Basic Usage
69
+
70
+ \`\`\`tsx
71
+ <LineChart
72
+ title="Sales Performance"
73
+ datasets={[{ label: 'Sales', data: data, color: 'var(--atomix-primary)' }]}
74
+ />
75
+ \`\`\`
76
+
77
+ ### With Glass Effect
78
+
79
+ \`\`\`tsx
80
+ <BarChart
81
+ title="Revenue by Month"
82
+ datasets={datasets}
83
+ glass={true}
84
+ showToolbar={true}
85
+ />
86
+ \`\`\`
87
+
88
+ ## API Reference
89
+
90
+ ### Props
91
+
92
+ | Prop | Type | Default | Description |
93
+ | ---- | ---- | ------- | ----------- |
94
+ | title | string | - | Title of the chart |
95
+ | subtitle | string | - | Subtitle of the chart |
96
+ | datasets | Dataset[] | [] | Array of datasets to plot |
97
+ | width | string \\| number | 100% | Width of the chart |
98
+ | height | string \\| number | 400px | Height of the chart |
99
+ | glass | boolean | false | Whether to apply glass effect |
100
+ | showToolbar | boolean | false | Whether to show the toolbar |
101
+ | config | ChartConfig | {} | Additional configuration options |
102
+ | onPointClick | (point) => void | - | Callback when a data point is clicked |
103
+ | onPointHover | (point) => void | - | Callback when hovering over a data point |
104
+ `,
42
105
  },
43
106
  },
44
107
  },
45
108
  tags: ['autodocs'],
109
+ argTypes: {
110
+ title: {
111
+ control: 'text',
112
+ description: 'Title of the chart',
113
+ table: {
114
+ type: { summary: 'string' },
115
+ defaultValue: { summary: '-' },
116
+ },
117
+ },
118
+ subtitle: {
119
+ control: 'text',
120
+ description: 'Subtitle of the chart',
121
+ table: {
122
+ type: { summary: 'string' },
123
+ defaultValue: { summary: '-' },
124
+ },
125
+ },
126
+ width: {
127
+ control: 'text',
128
+ description: 'Width of the chart',
129
+ table: {
130
+ type: { summary: 'string | number' },
131
+ defaultValue: { summary: '100%' },
132
+ },
133
+ },
134
+ height: {
135
+ control: 'text',
136
+ description: 'Height of the chart',
137
+ table: {
138
+ type: { summary: 'string | number' },
139
+ defaultValue: { summary: '400px' },
140
+ },
141
+ },
142
+ glass: {
143
+ control: 'boolean',
144
+ description: 'Whether to apply glass effect',
145
+ table: {
146
+ type: { summary: 'boolean' },
147
+ defaultValue: { summary: false },
148
+ },
149
+ },
150
+ showToolbar: {
151
+ control: 'boolean',
152
+ description: 'Whether to show the toolbar',
153
+ table: {
154
+ type: { summary: 'boolean' },
155
+ defaultValue: { summary: false },
156
+ },
157
+ },
158
+ config: {
159
+ control: 'object',
160
+ description: 'Additional configuration options',
161
+ table: {
162
+ type: { summary: 'ChartConfig' },
163
+ defaultValue: { summary: '{}' },
164
+ },
165
+ },
166
+ onPointClick: {
167
+ action: 'point clicked',
168
+ description: 'Callback when a data point is clicked',
169
+ },
170
+ onPointHover: {
171
+ action: 'point hovered',
172
+ description: 'Callback when hovering over a data point',
173
+ },
174
+ },
46
175
  } satisfies Meta<typeof Chart>;
47
176
 
48
177
  export default meta;
@@ -50,7 +179,7 @@ type Story = StoryObj<typeof meta>;
50
179
 
51
180
  // Glass Variant Story
52
181
  export const GlassVariant: Story = {
53
- render: () => {
182
+ render: (args) => {
54
183
  const sampleData = [
55
184
  { label: 'Jan', value: 65 },
56
185
  { label: 'Feb', value: 78 },
@@ -84,6 +213,7 @@ export const GlassVariant: Story = {
84
213
  </GridCol>
85
214
  <GridCol col={12} md={6}>
86
215
  <LineChart
216
+ {...args}
87
217
  title="Sales Performance"
88
218
  subtitle="Monthly revenue data"
89
219
  datasets={datasets}
@@ -97,15 +227,16 @@ export const GlassVariant: Story = {
97
227
  </GridCol>
98
228
  <GridCol col={12} md={6}>
99
229
  <BarChart
230
+ {...args}
100
231
  title="Revenue by Month"
101
232
  subtitle="Q1-Q2 comparison"
102
233
  datasets={datasets}
103
- glass={{
104
- displacementScale: 30,
105
- saturation: 200,
106
- mode: 'polar',
107
- }}
234
+ glass={true}
108
235
  showToolbar={true}
236
+ config={{
237
+ showTooltips: true,
238
+ animate: true,
239
+ }}
109
240
  />
110
241
  </GridCol>
111
242
  <GridCol col={12} md={6}>
@@ -134,6 +265,17 @@ export const GlassVariant: Story = {
134
265
  </div>
135
266
  );
136
267
  },
268
+ args: {
269
+ onPointClick: fn(),
270
+ onPointHover: fn(),
271
+ },
272
+ parameters: {
273
+ docs: {
274
+ description: {
275
+ story: 'Chart with glass effect applied to demonstrate aesthetic enhancement.',
276
+ },
277
+ },
278
+ },
137
279
  };
138
280
 
139
281
  // Data generators