@shohojdhara/atomix 0.2.3 → 0.2.5

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 (225) hide show
  1. package/README.md +19 -0
  2. package/dist/atomix.css +1703 -1544
  3. package/dist/atomix.min.css +4 -4
  4. package/dist/index.d.ts +1465 -963
  5. package/dist/index.esm.js +16289 -25908
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.js +15650 -21780
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.js +1 -1
  10. package/dist/index.min.js.map +1 -1
  11. package/dist/themes/applemix.css +15008 -0
  12. package/dist/themes/applemix.min.css +72 -0
  13. package/dist/themes/boomdevs.css +1608 -1450
  14. package/dist/themes/boomdevs.min.css +5 -5
  15. package/dist/themes/esrar.css +1702 -1543
  16. package/dist/themes/esrar.min.css +4 -4
  17. package/dist/themes/flashtrade.css +15159 -0
  18. package/dist/themes/flashtrade.min.css +86 -0
  19. package/dist/themes/mashroom.css +1699 -1540
  20. package/dist/themes/mashroom.min.css +7 -7
  21. package/dist/themes/shaj-default.css +1693 -1534
  22. package/dist/themes/shaj-default.min.css +4 -4
  23. package/package.json +6 -17
  24. package/src/components/Accordion/Accordion.stories.tsx +662 -21
  25. package/src/components/Accordion/Accordion.tsx +21 -14
  26. package/src/components/AtomixGlass/AtomixGlass.test.tsx +106 -72
  27. package/src/components/AtomixGlass/AtomixGlass.tsx +529 -1195
  28. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +400 -0
  29. package/src/components/AtomixGlass/GlassFilter.tsx +156 -0
  30. package/src/components/AtomixGlass/README.md +124 -2
  31. package/src/components/AtomixGlass/atomixGLass.old.tsx +1266 -0
  32. package/src/components/AtomixGlass/glass-utils.ts +263 -0
  33. package/src/components/AtomixGlass/shader-utils.ts +792 -68
  34. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1250 -0
  35. package/src/components/AtomixGlass/stories/Examples.stories.tsx +5768 -0
  36. package/src/components/AtomixGlass/stories/Modes.stories.tsx +1065 -0
  37. package/src/components/AtomixGlass/stories/Playground.stories.tsx +1129 -0
  38. package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +395 -0
  39. package/src/components/AtomixGlass/stories/shared-components.tsx +301 -0
  40. package/src/components/AtomixGlass/utils.ts +3 -3
  41. package/src/components/Avatar/Avatar.tsx +3 -0
  42. package/src/components/Avatar/AvatarGroup.tsx +2 -1
  43. package/src/components/Badge/Badge.stories.tsx +76 -55
  44. package/src/components/Badge/Badge.tsx +12 -14
  45. package/src/components/Breadcrumb/Breadcrumb.tsx +23 -4
  46. package/src/components/Button/Button.stories.tsx +501 -20
  47. package/src/components/Button/Button.tsx +5 -8
  48. package/src/components/Callout/Callout.stories.tsx +86 -35
  49. package/src/components/Callout/Callout.tsx +31 -9
  50. package/src/components/Card/Card.stories.tsx +565 -2
  51. package/src/components/Card/Card.tsx +15 -4
  52. package/src/components/Card/ElevationCard.tsx +2 -0
  53. package/src/components/Chart/AnimatedChart.tsx +179 -156
  54. package/src/components/Chart/AreaChart.tsx +123 -12
  55. package/src/components/Chart/BarChart.tsx +91 -100
  56. package/src/components/Chart/BaseChart.tsx +80 -0
  57. package/src/components/Chart/BubbleChart.tsx +114 -290
  58. package/src/components/Chart/CandlestickChart.tsx +282 -622
  59. package/src/components/Chart/Chart.stories.tsx +576 -179
  60. package/src/components/Chart/Chart.tsx +374 -75
  61. package/src/components/Chart/ChartRenderer.tsx +371 -220
  62. package/src/components/Chart/ChartToolbar.tsx +372 -61
  63. package/src/components/Chart/ChartTooltip.tsx +33 -18
  64. package/src/components/Chart/DonutChart.tsx +172 -254
  65. package/src/components/Chart/FunnelChart.tsx +169 -240
  66. package/src/components/Chart/GaugeChart.tsx +224 -392
  67. package/src/components/Chart/HeatmapChart.tsx +302 -440
  68. package/src/components/Chart/LineChart.tsx +148 -103
  69. package/src/components/Chart/MultiAxisChart.tsx +267 -395
  70. package/src/components/Chart/PieChart.tsx +114 -64
  71. package/src/components/Chart/RadarChart.tsx +202 -218
  72. package/src/components/Chart/ScatterChart.tsx +111 -97
  73. package/src/components/Chart/TreemapChart.tsx +147 -222
  74. package/src/components/Chart/WaterfallChart.tsx +253 -291
  75. package/src/components/Chart/index.ts +11 -9
  76. package/src/components/Chart/types.ts +85 -9
  77. package/src/components/Chart/utils.ts +66 -0
  78. package/src/components/ColorModeToggle/ColorModeToggle.tsx +6 -3
  79. package/src/components/Countdown/Countdown.tsx +4 -0
  80. package/src/components/DataTable/DataTable.tsx +2 -1
  81. package/src/components/DatePicker/DatePicker.stories.tsx +689 -12
  82. package/src/components/DatePicker/DatePicker.tsx +3 -9
  83. package/src/components/DatePicker/types.ts +5 -0
  84. package/src/components/Dropdown/Dropdown.stories.tsx +32 -25
  85. package/src/components/Dropdown/Dropdown.tsx +26 -28
  86. package/src/components/EdgePanel/EdgePanel.stories.tsx +473 -2
  87. package/src/components/EdgePanel/EdgePanel.tsx +101 -13
  88. package/src/components/Footer/Footer.stories.tsx +187 -60
  89. package/src/components/Footer/Footer.test.tsx +134 -0
  90. package/src/components/Footer/Footer.tsx +133 -34
  91. package/src/components/Footer/FooterLink.tsx +1 -1
  92. package/src/components/Footer/FooterSection.tsx +53 -36
  93. package/src/components/Footer/FooterSocialLink.tsx +32 -29
  94. package/src/components/Footer/README.md +82 -3
  95. package/src/components/Footer/index.ts +1 -1
  96. package/src/components/Form/Checkbox.stories.tsx +13 -5
  97. package/src/components/Form/Checkbox.tsx +3 -6
  98. package/src/components/Form/Form.stories.tsx +10 -3
  99. package/src/components/Form/Form.tsx +2 -0
  100. package/src/components/Form/FormGroup.tsx +2 -1
  101. package/src/components/Form/Input.stories.tsx +12 -11
  102. package/src/components/Form/Input.tsx +97 -95
  103. package/src/components/Form/Radio.stories.tsx +22 -7
  104. package/src/components/Form/Radio.tsx +3 -6
  105. package/src/components/Form/Select.stories.tsx +21 -6
  106. package/src/components/Form/Select.tsx +3 -5
  107. package/src/components/Form/Textarea.stories.tsx +13 -11
  108. package/src/components/Form/Textarea.tsx +88 -86
  109. package/src/components/Hero/Hero.stories.tsx +2 -3
  110. package/src/components/Hero/Hero.tsx +5 -6
  111. package/src/components/Icon/Icon.tsx +12 -1
  112. package/src/components/List/List.tsx +2 -1
  113. package/src/components/List/ListGroup.tsx +2 -1
  114. package/src/components/Messages/Messages.stories.tsx +113 -0
  115. package/src/components/Messages/Messages.tsx +52 -9
  116. package/src/components/Modal/Modal.stories.tsx +48 -32
  117. package/src/components/Modal/Modal.tsx +19 -24
  118. package/src/components/Navigation/Menu/MegaMenu.tsx +2 -2
  119. package/src/components/Navigation/Menu/Menu.tsx +2 -2
  120. package/src/components/Navigation/Nav/Nav.stories.tsx +469 -0
  121. package/src/components/Navigation/Nav/Nav.tsx +22 -4
  122. package/src/components/Navigation/Nav/NavDropdown.tsx +10 -1
  123. package/src/components/Navigation/Navbar/Navbar.stories.tsx +413 -0
  124. package/src/components/Navigation/Navbar/Navbar.tsx +70 -29
  125. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +340 -0
  126. package/src/components/Navigation/SideMenu/SideMenu.tsx +29 -2
  127. package/src/components/Pagination/Pagination.stories.tsx +13 -6
  128. package/src/components/Pagination/Pagination.tsx +7 -6
  129. package/src/components/PhotoViewer/PhotoViewer.tsx +2 -1
  130. package/src/components/Popover/Popover.stories.tsx +32 -24
  131. package/src/components/Popover/Popover.tsx +4 -1
  132. package/src/components/ProductReview/ProductReview.tsx +8 -2
  133. package/src/components/Progress/Progress.tsx +19 -3
  134. package/src/components/Rating/Rating.stories.tsx +11 -6
  135. package/src/components/Rating/Rating.tsx +3 -5
  136. package/src/components/River/River.tsx +5 -5
  137. package/src/components/SectionIntro/SectionIntro.tsx +8 -2
  138. package/src/components/Slider/Slider.stories.tsx +4 -4
  139. package/src/components/Slider/Slider.tsx +4 -3
  140. package/src/components/Spinner/Spinner.tsx +19 -3
  141. package/src/components/Steps/Steps.stories.tsx +5 -4
  142. package/src/components/Steps/Steps.tsx +8 -5
  143. package/src/components/Tab/Tab.stories.tsx +4 -3
  144. package/src/components/Tab/Tab.tsx +8 -6
  145. package/src/components/Testimonial/Testimonial.tsx +8 -2
  146. package/src/components/Todo/Todo.tsx +2 -1
  147. package/src/components/Toggle/Toggle.stories.tsx +5 -4
  148. package/src/components/Toggle/Toggle.tsx +8 -5
  149. package/src/components/Tooltip/Tooltip.stories.tsx +40 -30
  150. package/src/components/Tooltip/Tooltip.tsx +9 -2
  151. package/src/components/Upload/Upload.stories.tsx +252 -0
  152. package/src/components/Upload/Upload.tsx +92 -53
  153. package/src/components/VideoPlayer/VideoPlayer.tsx +3 -1
  154. package/src/components/index.ts +0 -4
  155. package/src/layouts/Grid/Grid.stories.tsx +10 -23
  156. package/src/layouts/Grid/Grid.tsx +20 -1
  157. package/src/layouts/Grid/GridCol.tsx +76 -48
  158. package/src/lib/composables/useAtomixGlass.ts +861 -44
  159. package/src/lib/composables/useBarChart.ts +21 -4
  160. package/src/lib/composables/useChart.ts +227 -370
  161. package/src/lib/composables/useChartExport.ts +19 -78
  162. package/src/lib/composables/useChartToolbar.ts +11 -21
  163. package/src/lib/composables/useEdgePanel.ts +125 -71
  164. package/src/lib/composables/useFooter.ts +3 -3
  165. package/src/lib/composables/useGlassContainer.ts +16 -7
  166. package/src/lib/composables/useLineChart.ts +11 -2
  167. package/src/lib/composables/usePieChart.ts +4 -14
  168. package/src/lib/composables/useRiver.ts +5 -0
  169. package/src/lib/composables/useSlider.ts +62 -24
  170. package/src/lib/composables/useVideoPlayer.ts +60 -63
  171. package/src/lib/constants/components.ts +147 -32
  172. package/src/lib/types/components.ts +355 -25
  173. package/src/lib/utils/displacement-generator.ts +55 -49
  174. package/src/lib/utils/icons.ts +1 -1
  175. package/src/lib/utils/index.ts +16 -10
  176. package/src/styles/01-settings/_settings.accordion.scss +19 -19
  177. package/src/styles/01-settings/_settings.animations.scss +5 -5
  178. package/src/styles/01-settings/_settings.avatar-group.scss +1 -1
  179. package/src/styles/01-settings/_settings.avatar.scss +17 -17
  180. package/src/styles/01-settings/_settings.background.scss +0 -3
  181. package/src/styles/01-settings/_settings.badge.scss +1 -1
  182. package/src/styles/01-settings/_settings.breadcrumb.scss +1 -1
  183. package/src/styles/01-settings/_settings.card.scss +1 -1
  184. package/src/styles/01-settings/_settings.chart.scss +65 -2
  185. package/src/styles/01-settings/_settings.dropdown.scss +1 -1
  186. package/src/styles/01-settings/_settings.edge-panel.scss +1 -1
  187. package/src/styles/01-settings/_settings.footer.scss +35 -42
  188. package/src/styles/01-settings/_settings.input.scss +1 -1
  189. package/src/styles/01-settings/_settings.list.scss +1 -1
  190. package/src/styles/01-settings/_settings.rating.scss +1 -1
  191. package/src/styles/01-settings/_settings.tabs.scss +1 -1
  192. package/src/styles/01-settings/_settings.upload.scss +6 -5
  193. package/src/styles/02-tools/_tools.animations.scss +4 -5
  194. package/src/styles/02-tools/_tools.background.scss +1 -13
  195. package/src/styles/02-tools/_tools.glass.scss +0 -1
  196. package/src/styles/02-tools/_tools.utility-api.scss +91 -48
  197. package/src/styles/03-generic/_generic.root.scss +1 -4
  198. package/src/styles/04-elements/_elements.body.scss +0 -1
  199. package/src/styles/06-components/_components.atomix-glass.scss +249 -0
  200. package/src/styles/06-components/_components.badge.scss +8 -23
  201. package/src/styles/06-components/_components.button.scss +8 -3
  202. package/src/styles/06-components/_components.callout.scss +10 -5
  203. package/src/styles/06-components/_components.card.scss +2 -14
  204. package/src/styles/06-components/_components.chart.scss +969 -1449
  205. package/src/styles/06-components/_components.dropdown.scss +19 -7
  206. package/src/styles/06-components/_components.edge-panel.scss +103 -0
  207. package/src/styles/06-components/_components.footer.scss +166 -85
  208. package/src/styles/06-components/_components.input.scss +8 -9
  209. package/src/styles/06-components/_components.list.scss +1 -0
  210. package/src/styles/06-components/_components.messages.scss +176 -0
  211. package/src/styles/06-components/_components.modal.scss +16 -4
  212. package/src/styles/06-components/_components.navbar.scss +12 -1
  213. package/src/styles/06-components/_components.side-menu.scss +5 -0
  214. package/src/styles/06-components/_components.skeleton.scss +8 -6
  215. package/src/styles/06-components/_components.upload.scss +219 -4
  216. package/src/styles/06-components/old.chart.styles.scss +1 -30
  217. package/src/styles/99-utilities/_index.scss +1 -0
  218. package/src/styles/99-utilities/_utilities.glass-fixes.scss +1 -0
  219. package/src/styles/99-utilities/_utilities.scss +1 -1
  220. package/src/components/AtomixGlass/AtomixGlass.stories.tsx +0 -3011
  221. package/src/components/AtomixGlass/AtomixGlassComprehensivePreview.stories.tsx +0 -1369
  222. package/src/components/Chart/AdvancedChart.tsx +0 -624
  223. package/src/components/Chart/LineChartNew.tsx +0 -167
  224. package/src/components/Chart/RealTimeChart.tsx +0 -436
  225. package/src/components/DatePicker/DatePicker copy.tsx +0 -551
@@ -1,4 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
+ import React from 'react';
2
3
  import { useState } from 'react';
3
4
  import { Container, Grid, GridCol } from '../../layouts/Grid';
4
5
  import { Badge } from '../Badge';
@@ -10,7 +11,6 @@ import { SideMenuItem } from '../Navigation/SideMenu/SideMenuItem';
10
11
  import { SideMenuList } from '../Navigation/SideMenu/SideMenuList';
11
12
 
12
13
  import {
13
- AdvancedChart,
14
14
  AnimatedChart,
15
15
  AreaChart,
16
16
  BarChart,
@@ -25,7 +25,6 @@ import {
25
25
  MultiAxisChart,
26
26
  PieChart,
27
27
  RadarChart,
28
- RealTimeChart,
29
28
  ScatterChart,
30
29
  TreemapChart,
31
30
  WaterfallChart,
@@ -51,6 +50,94 @@ const meta: Meta<typeof Chart> = {
51
50
  export default meta;
52
51
  type Story = StoryObj<typeof Chart>;
53
52
 
53
+ // Glass Variant Story
54
+ export const GlassVariant: Story = {
55
+ render: () => {
56
+ const sampleData = [
57
+ { label: 'Jan', value: 65 },
58
+ { label: 'Feb', value: 78 },
59
+ { label: 'Mar', value: 90 },
60
+ { label: 'Apr', value: 81 },
61
+ { label: 'May', value: 56 },
62
+ { label: 'Jun', value: 55 },
63
+ { label: 'Jul', value: 40 },
64
+ ];
65
+
66
+ const datasets = [
67
+ {
68
+ label: 'Sales',
69
+ data: sampleData,
70
+ color: 'var(--atomix-primary)',
71
+ },
72
+ ];
73
+
74
+ return (
75
+ <div
76
+ style={{
77
+ padding: '2rem',
78
+ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
79
+ minHeight: '100vh',
80
+ }}
81
+ >
82
+ <Container>
83
+ <Grid>
84
+ <GridCol col={12}>
85
+ <h2 style={{ color: 'white', marginBottom: '2rem' }}>Chart Glass Variant</h2>
86
+ </GridCol>
87
+ <GridCol col={12} md={6}>
88
+ <LineChart
89
+ title="Sales Performance"
90
+ subtitle="Monthly revenue data"
91
+ datasets={datasets}
92
+ glass={true}
93
+ showToolbar={true}
94
+ config={{
95
+ showTooltips: true,
96
+ animate: true,
97
+ }}
98
+ />
99
+ </GridCol>
100
+ <GridCol col={12} md={6}>
101
+ <BarChart
102
+ title="Revenue by Month"
103
+ subtitle="Q1-Q2 comparison"
104
+ datasets={datasets}
105
+ glass={{
106
+ displacementScale: 30,
107
+ saturation: 200,
108
+ mode: 'polar',
109
+ }}
110
+ showToolbar={true}
111
+ />
112
+ </GridCol>
113
+ <GridCol col={12} md={6}>
114
+ <PieChart
115
+ title="Market Share"
116
+ data={sampleData}
117
+ glass={true}
118
+ showToolbar={true}
119
+ />
120
+ </GridCol>
121
+ <GridCol col={12} md={6}>
122
+ <AreaChart
123
+ title="Growth Trend"
124
+ subtitle="Year over year"
125
+ datasets={datasets}
126
+ glass={{
127
+ blurAmount: 0,
128
+ saturation: 180,
129
+ enableBorderEffect: true,
130
+ }}
131
+ showToolbar={true}
132
+ />
133
+ </GridCol>
134
+ </Grid>
135
+ </Container>
136
+ </div>
137
+ );
138
+ },
139
+ };
140
+
54
141
  // Data generators
55
142
  const generateData = (points = 20) =>
56
143
  Array.from({ length: points }, (_, i) => ({
@@ -60,10 +147,107 @@ const generateData = (points = 20) =>
60
147
  value: Math.floor(Math.random() * 100) + 20,
61
148
  }));
62
149
 
150
+ const generateTimeSeriesData = (points = 20) =>
151
+ Array.from({ length: points }, (_, i) => ({
152
+ label: new Date(Date.now() - (points - i) * 24 * 60 * 60 * 1000).toLocaleDateString(),
153
+ value: Math.floor(Math.random() * 1000) + 500,
154
+ }));
155
+
156
+ const generateCandlestickData = (points = 20) =>
157
+ Array.from({ length: points }, (_, i) => {
158
+ const open = Math.floor(Math.random() * 100) + 50;
159
+ const close = Math.floor(Math.random() * 100) + 50;
160
+ const high = Math.max(open, close) + Math.floor(Math.random() * 20);
161
+ const low = Math.min(open, close) - Math.floor(Math.random() * 20);
162
+ return {
163
+ date: `Day ${i + 1}`,
164
+ open,
165
+ high,
166
+ low,
167
+ close,
168
+ volume: Math.floor(Math.random() * 10000) + 1000,
169
+ };
170
+ });
171
+
172
+ const generateBubbleData = (points = 15) =>
173
+ Array.from({ length: points }, (_, i) => ({
174
+ label: `Point ${i + 1}`,
175
+ x: Math.floor(Math.random() * 100),
176
+ y: Math.floor(Math.random() * 100),
177
+ size: Math.floor(Math.random() * 50) + 10,
178
+ value: Math.floor(Math.random() * 1000),
179
+ }));
180
+
181
+ const generateHeatmapData = () => {
182
+ const days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
183
+ const hours = Array.from({ length: 24 }, (_, i) => `${i}:00`);
184
+
185
+ return days
186
+ .map(day =>
187
+ hours.map(hour => ({
188
+ x: hour,
189
+ y: day,
190
+ value: Math.floor(Math.random() * 100),
191
+ }))
192
+ )
193
+ .flat();
194
+ };
195
+
196
+ const generateTreemapData = (count = 12) => {
197
+ const categories = [
198
+ 'Technology',
199
+ 'Finance',
200
+ 'Healthcare',
201
+ 'Education',
202
+ 'Retail',
203
+ 'Manufacturing',
204
+ 'Energy',
205
+ 'Transport',
206
+ 'Media',
207
+ 'Real Estate',
208
+ 'Consulting',
209
+ 'Food & Beverage',
210
+ 'Sports',
211
+ 'Entertainment',
212
+ 'Travel',
213
+ 'Automotive',
214
+ 'Fashion',
215
+ 'Telecom',
216
+ 'Agriculture',
217
+ 'Construction',
218
+ ];
219
+
220
+ return Array.from({ length: count }, (_, i) => ({
221
+ id: `category-${i}`,
222
+ label: categories[i % categories.length] || `Category ${i + 1}`,
223
+ value: Math.floor(Math.random() * 500) + 50,
224
+ metadata: {
225
+ growth: `${(Math.random() * 20 - 10).toFixed(1)}%`,
226
+ revenue: `$${(Math.random() * 1000 + 100).toFixed(0)}K`,
227
+ },
228
+ }));
229
+ };
230
+
231
+ const generateFunnelData = () => {
232
+ const stages = [
233
+ { label: 'Awareness', value: 10000 },
234
+ { label: 'Interest', value: 5000 },
235
+ { label: 'Consideration', value: 2500 },
236
+ { label: 'Intent', value: 1200 },
237
+ { label: 'Evaluation', value: 600 },
238
+ { label: 'Purchase', value: 300 },
239
+ ];
240
+
241
+ return stages.map(stage => ({
242
+ ...stage,
243
+ percentage: ((stage.value / stages[0].value) * 100).toFixed(1),
244
+ }));
245
+ };
246
+
63
247
  const datasets = [
64
- { label: 'Sales', data: generateData(), color: '#3b82f6' },
65
- { label: 'Revenue', data: generateData(), color: '#10b981' },
66
- { label: 'Profit', data: generateData(), color: '#f59e0b' },
248
+ { label: 'Sales', data: generateData(), color: 'var(--atomix-primary)' },
249
+ { label: 'Revenue', data: generateData(), color: 'var(--atomix-success)' },
250
+ { label: 'Profit', data: generateData(), color: 'var(--atomix-warning)' },
67
251
  ];
68
252
 
69
253
  // Modern Chart Gallery
@@ -95,16 +279,14 @@ export const ChartGallery: Story = {
95
279
  { key: 'funnel', icon: 'Funnel', label: 'Funnel', desc: 'Process stages' },
96
280
  { key: 'treemap', icon: 'Tree', label: 'Treemap', desc: 'Hierarchical data' },
97
281
  { key: 'animated', icon: 'Sparkle', label: 'Animated', desc: 'Motion graphics' },
98
- { key: 'realtime', icon: 'WifiHigh', label: 'Real-time', desc: 'Live streaming' },
99
282
  { key: 'multiaxis', icon: 'ChartLineUp', label: 'Multi-axis', desc: 'Multiple scales' },
100
- { key: 'advanced', icon: 'Rocket', label: 'Advanced', desc: 'Complex features' },
101
283
  ];
102
284
 
103
285
  // Generate dynamic data based on dataPoints
104
286
  const dynamicDatasets = [
105
- { label: 'Sales', data: generateData(dataPoints), color: '#3b82f6' },
106
- { label: 'Revenue', data: generateData(dataPoints), color: '#10b981' },
107
- { label: 'Profit', data: generateData(dataPoints), color: '#f59e0b' },
287
+ { label: 'Sales', data: generateData(dataPoints), color: 'var(--atomix-primary)' },
288
+ { label: 'Revenue', data: generateData(dataPoints), color: 'var(--atomix-success)' },
289
+ { label: 'Profit', data: generateData(dataPoints), color: 'var(--atomix-warning)' },
108
290
  ];
109
291
 
110
292
  const renderChart = () => {
@@ -148,6 +330,15 @@ export const ChartGallery: Story = {
148
330
  icon={<Icon name="List" />}
149
331
  label={`${showLegend ? 'Hide' : 'Show'} legend`}
150
332
  />
333
+
334
+ {/* Animation Toggle */}
335
+ <Button
336
+ size="sm"
337
+ variant={animated ? 'success' : 'secondary'}
338
+ onClick={() => setAnimated(!animated)}
339
+ icon={<Icon name="Sparkle" />}
340
+ label={`${animated ? 'Disable' : 'Enable'} animations`}
341
+ />
151
342
  </div>
152
343
  </div>
153
344
  );
@@ -179,7 +370,7 @@ export const ChartGallery: Story = {
179
370
  <div>
180
371
  {customToolbar}
181
372
  <PieChart
182
- datasets={[{ label: 'Data', data: generateData(dataPoints) }]}
373
+ datasets={[{ label: 'Distribution', data: generateData(6) }]}
183
374
  {...commonProps}
184
375
  />
185
376
  </div>
@@ -189,7 +380,7 @@ export const ChartGallery: Story = {
189
380
  <div>
190
381
  {customToolbar}
191
382
  <DonutChart
192
- datasets={[{ label: 'Data', data: generateData(dataPoints) }]}
383
+ datasets={[{ label: 'Distribution', data: generateData(6) }]}
193
384
  {...commonProps}
194
385
  />
195
386
  </div>
@@ -205,45 +396,28 @@ export const ChartGallery: Story = {
205
396
  return (
206
397
  <div>
207
398
  {customToolbar}
208
- <RadarChart datasets={[dynamicDatasets[0]]} {...commonProps} />
399
+ <RadarChart datasets={dynamicDatasets} {...commonProps} />
209
400
  </div>
210
401
  );
211
402
  case 'bubble':
212
403
  return (
213
404
  <div>
214
405
  {customToolbar}
215
- <BubbleChart
216
- bubbleData={Array.from({ length: dataPoints }, (_, i) => ({
217
- label: `Point ${i + 1}`,
218
- x: Math.random() * 100,
219
- y: Math.random() * 100,
220
- size: Math.random() * 50 + 20,
221
- color: ['#3b82f6', '#10b981', '#f59e0b', '#ef4444'][i % 4],
222
- }))}
223
- {...commonProps}
224
- />
406
+ <BubbleChart bubbleData={generateBubbleData(dataPoints)} {...commonProps} />
225
407
  </div>
226
408
  );
227
409
  case 'gauge':
228
410
  return (
229
411
  <div>
230
412
  {customToolbar}
231
- <GaugeChart value={Math.min(dataPoints * 5, 100)} {...commonProps} />
413
+ <GaugeChart value={75} max={100} {...commonProps} />
232
414
  </div>
233
415
  );
234
416
  case 'heatmap':
235
417
  return (
236
418
  <div>
237
419
  {customToolbar}
238
- <HeatmapChart
239
- data={Array.from({ length: dataPoints * 4 }, (_, i) => ({
240
- x: i % Math.ceil(Math.sqrt(dataPoints * 4)),
241
- y: Math.floor(i / Math.ceil(Math.sqrt(dataPoints * 4))),
242
- value: Math.random() * 100,
243
- label: `${i}`,
244
- }))}
245
- {...commonProps}
246
- />
420
+ <HeatmapChart data={generateHeatmapData()} {...commonProps} />
247
421
  </div>
248
422
  );
249
423
  case 'candlestick':
@@ -251,13 +425,7 @@ export const ChartGallery: Story = {
251
425
  <div>
252
426
  {customToolbar}
253
427
  <CandlestickChart
254
- candlestickData={Array.from({ length: dataPoints }, (_, i) => ({
255
- date: new Date(2024, 0, i + 1).toISOString(),
256
- open: 100 + Math.random() * 20,
257
- high: 120 + Math.random() * 20,
258
- low: 80 + Math.random() * 20,
259
- close: 110 + Math.random() * 20,
260
- }))}
428
+ candlestickData={generateCandlestickData(dataPoints)}
261
429
  {...commonProps}
262
430
  />
263
431
  </div>
@@ -267,16 +435,13 @@ export const ChartGallery: Story = {
267
435
  <div>
268
436
  {customToolbar}
269
437
  <WaterfallChart
270
- waterfallData={Array.from({ length: Math.min(dataPoints, 8) }, (_, i) => {
271
- if (i === 0) return { label: 'Start', value: 100, type: 'total' };
272
- if (i === Math.min(dataPoints, 8) - 1)
273
- return { label: 'End', value: 100 + (i - 1) * 5, type: 'total' };
274
- return {
275
- label: `Step ${i}`,
276
- value: Math.random() > 0.5 ? Math.random() * 30 : -Math.random() * 20,
277
- type: Math.random() > 0.5 ? 'positive' : 'negative',
278
- };
279
- })}
438
+ waterfallData={[
439
+ { label: 'Starting Balance', value: 1000, type: 'subtotal' },
440
+ { label: 'Sales', value: 500, type: 'positive' },
441
+ { label: 'Expenses', value: -200, type: 'negative' },
442
+ { label: 'Taxes', value: -100, type: 'negative' },
443
+ { label: 'Net Profit', value: 200, type: 'subtotal' },
444
+ ]}
280
445
  {...commonProps}
281
446
  />
282
447
  </div>
@@ -286,10 +451,15 @@ export const ChartGallery: Story = {
286
451
  <div>
287
452
  {customToolbar}
288
453
  <FunnelChart
289
- funnelData={Array.from({ length: Math.min(dataPoints, 8) }, (_, i) => ({
290
- label: `Stage ${i + 1}`,
291
- value: 1000 - i * 100 - Math.random() * 50,
292
- }))}
454
+ funnelData={generateFunnelData()}
455
+ funnelOptions={{
456
+ showLabels: true,
457
+ showValues: true,
458
+ showPercentages: true,
459
+ showConversionRates: true,
460
+ useGradient: true,
461
+ animate: animated,
462
+ }}
293
463
  {...commonProps}
294
464
  />
295
465
  </div>
@@ -299,11 +469,15 @@ export const ChartGallery: Story = {
299
469
  <div>
300
470
  {customToolbar}
301
471
  <TreemapChart
302
- data={Array.from({ length: dataPoints }, (_, i) => ({
303
- id: `item-${i}`,
304
- label: `Category ${String.fromCharCode(65 + i)}`,
305
- value: Math.random() * 100 + 20,
306
- }))}
472
+ data={generateTreemapData(Math.min(dataPoints, 20))}
473
+ algorithm="squarified"
474
+ colorConfig={{ scheme: 'category' }}
475
+ labelConfig={{
476
+ showLabels: true,
477
+ minSize: 500,
478
+ fontSize: 12,
479
+ textColor: 'var(--atomix-text-primary)',
480
+ }}
307
481
  {...commonProps}
308
482
  />
309
483
  </div>
@@ -315,20 +489,6 @@ export const ChartGallery: Story = {
315
489
  <AnimatedChart datasets={dynamicDatasets} {...commonProps} />
316
490
  </div>
317
491
  );
318
- case 'realtime':
319
- return (
320
- <div>
321
- {customToolbar}
322
- <RealTimeChart
323
- datasets={[]}
324
- dataSource={async () => [
325
- { label: new Date().toLocaleTimeString(), value: Math.random() * 100 },
326
- ]}
327
- {...commonProps}
328
- />
329
- </div>
330
- );
331
-
332
492
  case 'multiaxis':
333
493
  return (
334
494
  <div>
@@ -344,13 +504,6 @@ export const ChartGallery: Story = {
344
504
  />
345
505
  </div>
346
506
  );
347
- case 'advanced':
348
- return (
349
- <div>
350
- {customToolbar}
351
- <AdvancedChart datasets={dynamicDatasets} {...commonProps} />
352
- </div>
353
- );
354
507
  default:
355
508
  return (
356
509
  <div>
@@ -395,7 +548,7 @@ export const ChartGallery: Story = {
395
548
  <Icon name={icon as any} size="sm" />
396
549
  <div>
397
550
  <div>{label}</div>
398
- {/* <small className="u-text-muted">{desc}</small> */}
551
+ <small className="u-text-muted">{desc}</small>
399
552
  </div>
400
553
  </div>
401
554
  </SideMenuItem>
@@ -404,9 +557,10 @@ export const ChartGallery: Story = {
404
557
  </SideMenu>
405
558
  </Card>
406
559
  </GridCol>
407
-
408
560
  <GridCol xs={9}>
409
- <Card className="u-p-4 u-min-h-600">{renderChart()}</Card>
561
+ <Card className="u-p-0 u-overflow-hidden">
562
+ <div className="u-h-100 u-min-h-100 u-overflow-auto">{renderChart()}</div>
563
+ </Card>
410
564
  </GridCol>
411
565
  </Grid>
412
566
  </Container>
@@ -414,114 +568,357 @@ export const ChartGallery: Story = {
414
568
  },
415
569
  };
416
570
 
417
- // Quick Examples
418
- export const BasicCharts: Story = {
571
+ // Individual chart stories for documentation
572
+ export const LineChartStory: Story = {
419
573
  render: () => (
420
- <Container className="u-py-4">
421
- <div
422
- className="u-d-grid u-gap-4"
423
- style={{ gridTemplateColumns: 'repeat(auto-fit, minmax(400px, 1fr))' }}
424
- >
425
- <Card className="u-p-4">
426
- <LineChart
427
- title="Line Chart"
428
- datasets={[datasets[0]]}
429
- config={{ showLegend: false }}
430
- className="u-h-100"
431
- />
432
- </Card>
574
+ <Container className="u-py-6">
575
+ <Grid>
576
+ <GridCol xs={12}>
577
+ <Card className="u-p-6">
578
+ <LineChart
579
+ datasets={[
580
+ { label: 'Sales', data: generateData(12), color: 'var(--atomix-primary)' },
581
+ { label: 'Revenue', data: generateData(12), color: 'var(--atomix-success)' },
582
+ ]}
583
+ title="Line Chart Example"
584
+ config={{ showLegend: true, animate: true }}
585
+ showToolbar
586
+ />
587
+ </Card>
588
+ </GridCol>
589
+ </Grid>
590
+ </Container>
591
+ ),
592
+ name: 'Line Chart',
593
+ };
433
594
 
434
- <Card className="u-p-4">
435
- <BarChart
436
- title="Bar Chart"
437
- datasets={[datasets[1]]}
438
- config={{ showLegend: false }}
439
- className="u-h-100"
440
- />
441
- </Card>
595
+ export const BarChartStory: Story = {
596
+ render: () => (
597
+ <Container className="u-py-6">
598
+ <Grid>
599
+ <GridCol xs={12}>
600
+ <Card className="u-p-6">
601
+ <BarChart
602
+ datasets={[
603
+ { label: 'Sales', data: generateData(8), color: 'var(--atomix-primary)' },
604
+ { label: 'Revenue', data: generateData(8), color: 'var(--atomix-success)' },
605
+ ]}
606
+ title="Bar Chart Example"
607
+ config={{ showLegend: true, animate: true }}
608
+ showToolbar
609
+ />
610
+ </Card>
611
+ </GridCol>
612
+ </Grid>
613
+ </Container>
614
+ ),
615
+ name: 'Bar Chart',
616
+ };
442
617
 
443
- <Card className="u-p-4">
444
- <PieChart
445
- title="Pie Chart"
446
- datasets={[{ label: 'Data', data: generateData(4) }]}
447
- config={{ showLegend: true }}
448
- className="u-h-100"
449
- />
450
- </Card>
618
+ export const PieChartStory: Story = {
619
+ render: () => (
620
+ <Container className="u-py-6">
621
+ <Grid>
622
+ <GridCol xs={12}>
623
+ <Card className="u-p-6">
624
+ <PieChart
625
+ datasets={[{ label: 'Market Share', data: generateData(6) }]}
626
+ title="Pie Chart Example"
627
+ config={{ showLegend: true, animate: true }}
628
+ showToolbar
629
+ />
630
+ </Card>
631
+ </GridCol>
632
+ </Grid>
633
+ </Container>
634
+ ),
635
+ name: 'Pie Chart',
636
+ };
451
637
 
452
- <Card className="u-p-4">
453
- <DonutChart
454
- title="Donut Chart"
455
- datasets={[{ label: 'Data', data: generateData(4) }]}
456
- config={{ showLegend: true }}
457
- className="u-h-100"
458
- />
459
- </Card>
460
- </div>
638
+ export const DonutChartStory: Story = {
639
+ render: () => (
640
+ <Container className="u-py-6">
641
+ <Grid>
642
+ <GridCol xs={12}>
643
+ <Card className="u-p-6">
644
+ <DonutChart
645
+ datasets={[{ label: 'Market Share', data: generateData(6) }]}
646
+ title="Donut Chart Example"
647
+ config={{ showLegend: true, animate: true }}
648
+ showToolbar
649
+ />
650
+ </Card>
651
+ </GridCol>
652
+ </Grid>
461
653
  </Container>
462
654
  ),
655
+ name: 'Donut Chart',
463
656
  };
464
657
 
465
- // Advanced Features
466
- export const AdvancedFeatures: Story = {
658
+ export const CandlestickChartStory: Story = {
467
659
  render: () => (
468
- <Container className="u-py-4">
469
- <div
470
- className="u-d-grid u-gap-4"
471
- style={{ gridTemplateColumns: 'repeat(auto-fit, minmax(500px, 1fr))' }}
472
- >
473
- <Card className="u-p-4">
474
- <MultiAxisChart
475
- title="Multi-Axis Chart"
476
- datasets={datasets}
477
- yAxes={datasets.map((d, i) => ({
478
- id: `axis${i}`,
479
- position: i % 2 ? 'right' : 'left',
480
- label: d.label,
481
- }))}
482
- className="u-h-100"
483
- />
484
- </Card>
660
+ <Container className="u-py-6">
661
+ <Grid>
662
+ <GridCol xs={12}>
663
+ <Card className="u-p-6">
664
+ <CandlestickChart
665
+ candlestickData={generateCandlestickData(20)}
666
+ title="Candlestick Chart Example"
667
+ config={{ showLegend: true, animate: true, showTooltips: true }}
668
+ candlestickOptions={{ showTooltips: true }}
669
+ showToolbar
670
+ />
671
+ </Card>
672
+ </GridCol>
673
+ </Grid>
674
+ </Container>
675
+ ),
676
+ name: 'Candlestick Chart',
677
+ };
485
678
 
486
- <Card className="u-p-4">
487
- <AnimatedChart
488
- title="Animated Chart"
489
- datasets={datasets}
490
- animationConfig={{ duration: 2000, easing: 'bounce' }}
491
- className="u-h-100"
492
- />
493
- </Card>
679
+ export const TreemapChartStory: Story = {
680
+ render: () => (
681
+ <Container className="u-py-6">
682
+ <Grid>
683
+ <GridCol xs={12}>
684
+ <Card className="u-p-6">
685
+ <TreemapChart
686
+ data={generateTreemapData(15)}
687
+ title="Treemap Chart Example"
688
+ algorithm="squarified"
689
+ colorConfig={{ scheme: 'category' }}
690
+ labelConfig={{
691
+ showLabels: true,
692
+ minSize: 500,
693
+ fontSize: 12,
694
+ textColor: 'var(--atomix-text-primary)',
695
+ }}
696
+ config={{ showLegend: true, animate: true }}
697
+ showToolbar
698
+ />
699
+ </Card>
700
+ </GridCol>
701
+ </Grid>
702
+ </Container>
703
+ ),
704
+ name: 'Treemap Chart',
705
+ };
494
706
 
495
- <Card className="u-p-4">
496
- <RealTimeChart
497
- title="Real-time Chart"
498
- datasets={[]}
499
- dataSource={async () => [
500
- {
501
- label: new Date().toLocaleTimeString(),
502
- value: Math.sin(Date.now() * 0.001) * 20 + 50,
503
- },
504
- ]}
505
- streamConfig={{ interval: 1000, maxDataPoints: 20, autoScroll: true }}
506
- className="u-h-100"
507
- />
508
- </Card>
707
+ export const FunnelChartStory: Story = {
708
+ render: () => (
709
+ <Container className="u-py-6">
710
+ <Grid>
711
+ <GridCol xs={12}>
712
+ <Card className="u-p-6">
713
+ <FunnelChart
714
+ funnelData={generateFunnelData()}
715
+ title="Funnel Chart Example"
716
+ funnelOptions={{
717
+ showLabels: true,
718
+ showValues: true,
719
+ showPercentages: true,
720
+ showConversionRates: true,
721
+ useGradient: true,
722
+ animate: true,
723
+ }}
724
+ config={{ showLegend: true, animate: true }}
725
+ showToolbar
726
+ />
727
+ </Card>
728
+ </GridCol>
729
+ </Grid>
730
+ </Container>
731
+ ),
732
+ name: 'Funnel Chart',
733
+ };
509
734
 
510
- <Card className="u-p-4">
511
- <GaugeChart
512
- title="Gauge Chart"
513
- value={78}
514
- gaugeOptions={{
515
- colorZones: [
516
- { from: 0, to: 50, color: '#ef4444' },
517
- { from: 50, to: 80, color: '#f59e0b' },
518
- { from: 80, to: 100, color: '#10b981' },
519
- ],
520
- }}
521
- className="u-h-100"
522
- />
523
- </Card>
524
- </div>
735
+ export const HeatmapChartStory: Story = {
736
+ render: () => (
737
+ <Container className="u-py-6">
738
+ <Grid>
739
+ <GridCol xs={12}>
740
+ <Card className="u-p-6">
741
+ <HeatmapChart
742
+ data={generateHeatmapData()}
743
+ title="Heatmap Chart Example"
744
+ colorScale={{
745
+ scheme: 'viridis',
746
+ steps: 9,
747
+ }}
748
+ cellConfig={{
749
+ width: 30,
750
+ height: 30,
751
+ spacing: 2,
752
+ borderRadius: 4,
753
+ showLabels: false,
754
+ }}
755
+ showColorLegend={true}
756
+ showGrid={true}
757
+ config={{ showLegend: true, animate: true }}
758
+ showToolbar
759
+ />
760
+ </Card>
761
+ </GridCol>
762
+ </Grid>
763
+ </Container>
764
+ ),
765
+ name: 'Heatmap Chart',
766
+ };
767
+
768
+ export const ScatterChartStory: Story = {
769
+ render: () => (
770
+ <Container className="u-py-6">
771
+ <Grid>
772
+ <GridCol xs={12}>
773
+ <Card className="u-p-6">
774
+ <ScatterChart
775
+ datasets={[
776
+ { label: 'Sales', data: generateData(15), color: 'var(--atomix-primary)' },
777
+ { label: 'Revenue', data: generateData(15), color: 'var(--atomix-success)' },
778
+ ]}
779
+ title="Scatter Chart Example"
780
+ scatterOptions={{
781
+ pointRadius: 5,
782
+ showLabels: false,
783
+ enableHoverEffects: true,
784
+ }}
785
+ config={{ showLegend: true, animate: true }}
786
+ showToolbar
787
+ />
788
+ </Card>
789
+ </GridCol>
790
+ </Grid>
791
+ </Container>
792
+ ),
793
+ name: 'Scatter Chart',
794
+ };
795
+
796
+ export const BubbleChartStory: Story = {
797
+ render: () => (
798
+ <Container className="u-py-6">
799
+ <Grid>
800
+ <GridCol xs={12}>
801
+ <Card className="u-p-6">
802
+ <BubbleChart
803
+ bubbleData={generateBubbleData(20)}
804
+ title="Bubble Chart Example"
805
+ bubbleOptions={{
806
+ minBubbleSize: 10,
807
+ maxBubbleSize: 60,
808
+ bubbleOpacity: 0.7,
809
+ showLabels: true,
810
+ enableAnimations: true,
811
+ }}
812
+ config={{ showLegend: true, animate: true }}
813
+ showToolbar
814
+ />
815
+ </Card>
816
+ </GridCol>
817
+ </Grid>
818
+ </Container>
819
+ ),
820
+ name: 'Bubble Chart',
821
+ };
822
+
823
+ export const RadarChartStory: Story = {
824
+ render: () => (
825
+ <Container className="u-py-6">
826
+ <Grid>
827
+ <GridCol xs={12}>
828
+ <Card className="u-p-6">
829
+ <RadarChart
830
+ datasets={[
831
+ { label: 'Performance', data: generateData(8), color: 'var(--atomix-primary)' },
832
+ { label: 'Target', data: generateData(8), color: 'var(--atomix-success)' },
833
+ ]}
834
+ title="Radar Chart Example"
835
+ radarOptions={{
836
+ gridLevels: 5,
837
+ showGrid: true,
838
+ showAxisLabels: true,
839
+ fillArea: true,
840
+ fillOpacity: 0.3,
841
+ showDataPoints: true,
842
+ pointRadius: 4,
843
+ lineWidth: 2,
844
+ }}
845
+ config={{ showLegend: true, animate: true }}
846
+ showToolbar
847
+ />
848
+ </Card>
849
+ </GridCol>
850
+ </Grid>
851
+ </Container>
852
+ ),
853
+ name: 'Radar Chart',
854
+ };
855
+
856
+ export const WaterfallChartStory: Story = {
857
+ render: () => (
858
+ <Container className="u-py-6">
859
+ <Grid>
860
+ <GridCol xs={12}>
861
+ <Card className="u-p-6">
862
+ <WaterfallChart
863
+ waterfallData={[
864
+ { label: 'Starting Balance', value: 1000, type: 'subtotal' },
865
+ { label: 'Sales', value: 500, type: 'positive' },
866
+ { label: 'Investment', value: 200, type: 'positive' },
867
+ { label: 'Expenses', value: -200, type: 'negative' },
868
+ { label: 'Taxes', value: -100, type: 'negative' },
869
+ { label: 'Fees', value: -50, type: 'negative' },
870
+ { label: 'Ending Balance', value: 1350, type: 'total' },
871
+ ]}
872
+ title="Waterfall Chart Example"
873
+ waterfallOptions={{
874
+ showConnectors: true,
875
+ showValues: true,
876
+ showBaseline: true,
877
+ animate: true,
878
+ }}
879
+ config={{ showLegend: true, animate: true }}
880
+ showToolbar
881
+ />
882
+ </Card>
883
+ </GridCol>
884
+ </Grid>
885
+ </Container>
886
+ ),
887
+ name: 'Waterfall Chart',
888
+ };
889
+
890
+ export const TooltipTestStory: Story = {
891
+ render: () => (
892
+ <Container className="u-py-6">
893
+ <Grid>
894
+ <GridCol xs={12}>
895
+ <Card className="u-p-6">
896
+ <LineChart
897
+ datasets={[
898
+ {
899
+ label: 'Sales',
900
+ data: generateData(12).map((d, i) => ({
901
+ ...d,
902
+ metadata: {
903
+ trend: i % 2 === 0 ? 'Up' : 'Down',
904
+ change: `${Math.floor(Math.random() * 10)}%`,
905
+ },
906
+ })),
907
+ color: 'var(--atomix-primary)',
908
+ },
909
+ ]}
910
+ title="Tooltip Test Chart"
911
+ config={{
912
+ showLegend: true,
913
+ animate: true,
914
+ showTooltips: true,
915
+ }}
916
+ showToolbar
917
+ />
918
+ </Card>
919
+ </GridCol>
920
+ </Grid>
525
921
  </Container>
526
922
  ),
923
+ name: 'Tooltip Test',
527
924
  };