@shohojdhara/atomix 0.2.4 → 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 (211) hide show
  1. package/README.md +19 -0
  2. package/dist/atomix.css +1266 -1412
  3. package/dist/atomix.min.css +3 -3
  4. package/dist/index.d.ts +1232 -876
  5. package/dist/index.esm.js +16212 -26364
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.js +15652 -22298
  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 +1266 -1413
  14. package/dist/themes/boomdevs.min.css +3 -3
  15. package/dist/themes/esrar.css +1267 -1413
  16. package/dist/themes/esrar.min.css +3 -3
  17. package/dist/themes/flashtrade.css +15159 -0
  18. package/dist/themes/flashtrade.min.css +86 -0
  19. package/dist/themes/mashroom.css +1264 -1410
  20. package/dist/themes/mashroom.min.css +5 -5
  21. package/dist/themes/shaj-default.css +1266 -1412
  22. package/dist/themes/shaj-default.min.css +3 -3
  23. package/package.json +6 -17
  24. package/src/components/Accordion/Accordion.stories.tsx +4 -26
  25. package/src/components/Accordion/Accordion.tsx +21 -12
  26. package/src/components/AtomixGlass/AtomixGlass.test.tsx +106 -72
  27. package/src/components/AtomixGlass/AtomixGlass.tsx +487 -1215
  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 +404 -236
  34. package/src/components/AtomixGlass/{AtomixGlass.stories.tsx → stories/AtomixGlass.stories.tsx} +55 -35
  35. package/src/components/AtomixGlass/stories/Examples.stories.tsx +57 -89
  36. package/src/components/AtomixGlass/stories/Modes.stories.tsx +149 -149
  37. package/src/components/AtomixGlass/stories/Playground.stories.tsx +95 -32
  38. package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +0 -2
  39. package/src/components/AtomixGlass/stories/shared-components.tsx +9 -18
  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 +74 -54
  44. package/src/components/Badge/Badge.tsx +8 -12
  45. package/src/components/Breadcrumb/Breadcrumb.tsx +23 -4
  46. package/src/components/Button/Button.tsx +3 -5
  47. package/src/components/Callout/Callout.stories.tsx +86 -35
  48. package/src/components/Callout/Callout.tsx +4 -0
  49. package/src/components/Card/Card.stories.tsx +89 -85
  50. package/src/components/Card/Card.tsx +15 -4
  51. package/src/components/Card/ElevationCard.tsx +2 -0
  52. package/src/components/Chart/AnimatedChart.tsx +179 -156
  53. package/src/components/Chart/AreaChart.tsx +123 -12
  54. package/src/components/Chart/BarChart.tsx +91 -100
  55. package/src/components/Chart/BaseChart.tsx +80 -0
  56. package/src/components/Chart/BubbleChart.tsx +114 -290
  57. package/src/components/Chart/CandlestickChart.tsx +282 -622
  58. package/src/components/Chart/Chart.stories.tsx +576 -179
  59. package/src/components/Chart/Chart.tsx +374 -75
  60. package/src/components/Chart/ChartRenderer.tsx +371 -220
  61. package/src/components/Chart/ChartToolbar.tsx +372 -61
  62. package/src/components/Chart/ChartTooltip.tsx +33 -18
  63. package/src/components/Chart/DonutChart.tsx +172 -254
  64. package/src/components/Chart/FunnelChart.tsx +169 -240
  65. package/src/components/Chart/GaugeChart.tsx +224 -392
  66. package/src/components/Chart/HeatmapChart.tsx +302 -440
  67. package/src/components/Chart/LineChart.tsx +148 -103
  68. package/src/components/Chart/MultiAxisChart.tsx +267 -395
  69. package/src/components/Chart/PieChart.tsx +114 -64
  70. package/src/components/Chart/RadarChart.tsx +202 -218
  71. package/src/components/Chart/ScatterChart.tsx +111 -97
  72. package/src/components/Chart/TreemapChart.tsx +147 -222
  73. package/src/components/Chart/WaterfallChart.tsx +253 -291
  74. package/src/components/Chart/index.ts +11 -9
  75. package/src/components/Chart/types.ts +85 -9
  76. package/src/components/Chart/utils.ts +66 -0
  77. package/src/components/ColorModeToggle/ColorModeToggle.tsx +6 -3
  78. package/src/components/Countdown/Countdown.tsx +4 -0
  79. package/src/components/DataTable/DataTable.tsx +2 -1
  80. package/src/components/DatePicker/DatePicker.stories.tsx +0 -11
  81. package/src/components/DatePicker/DatePicker.tsx +3 -9
  82. package/src/components/DatePicker/types.ts +5 -0
  83. package/src/components/Dropdown/Dropdown.stories.tsx +32 -25
  84. package/src/components/Dropdown/Dropdown.tsx +26 -28
  85. package/src/components/EdgePanel/EdgePanel.stories.tsx +13 -15
  86. package/src/components/EdgePanel/EdgePanel.tsx +20 -5
  87. package/src/components/Footer/Footer.stories.tsx +187 -60
  88. package/src/components/Footer/Footer.test.tsx +134 -0
  89. package/src/components/Footer/Footer.tsx +133 -34
  90. package/src/components/Footer/FooterLink.tsx +1 -1
  91. package/src/components/Footer/FooterSection.tsx +53 -36
  92. package/src/components/Footer/FooterSocialLink.tsx +32 -29
  93. package/src/components/Footer/README.md +82 -3
  94. package/src/components/Footer/index.ts +1 -1
  95. package/src/components/Form/Checkbox.stories.tsx +13 -5
  96. package/src/components/Form/Checkbox.tsx +3 -6
  97. package/src/components/Form/Form.stories.tsx +10 -3
  98. package/src/components/Form/Form.tsx +2 -0
  99. package/src/components/Form/FormGroup.tsx +2 -1
  100. package/src/components/Form/Input.stories.tsx +12 -11
  101. package/src/components/Form/Input.tsx +97 -95
  102. package/src/components/Form/Radio.stories.tsx +22 -7
  103. package/src/components/Form/Radio.tsx +3 -6
  104. package/src/components/Form/Select.stories.tsx +21 -6
  105. package/src/components/Form/Select.tsx +3 -5
  106. package/src/components/Form/Textarea.stories.tsx +13 -11
  107. package/src/components/Form/Textarea.tsx +88 -86
  108. package/src/components/Hero/Hero.stories.tsx +2 -3
  109. package/src/components/Hero/Hero.tsx +5 -6
  110. package/src/components/Icon/Icon.tsx +12 -1
  111. package/src/components/List/List.tsx +2 -1
  112. package/src/components/List/ListGroup.tsx +2 -1
  113. package/src/components/Messages/Messages.tsx +3 -2
  114. package/src/components/Modal/Modal.stories.tsx +48 -34
  115. package/src/components/Modal/Modal.tsx +19 -23
  116. package/src/components/Navigation/Menu/MegaMenu.tsx +2 -2
  117. package/src/components/Navigation/Menu/Menu.tsx +2 -2
  118. package/src/components/Navigation/Nav/Nav.tsx +6 -1
  119. package/src/components/Navigation/Nav/NavDropdown.tsx +10 -1
  120. package/src/components/Navigation/Navbar/Navbar.tsx +4 -1
  121. package/src/components/Navigation/SideMenu/SideMenu.tsx +3 -2
  122. package/src/components/Pagination/Pagination.stories.tsx +13 -6
  123. package/src/components/Pagination/Pagination.tsx +7 -6
  124. package/src/components/PhotoViewer/PhotoViewer.tsx +2 -1
  125. package/src/components/Popover/Popover.stories.tsx +32 -24
  126. package/src/components/Popover/Popover.tsx +4 -1
  127. package/src/components/ProductReview/ProductReview.tsx +8 -2
  128. package/src/components/Progress/Progress.tsx +2 -1
  129. package/src/components/Rating/Rating.stories.tsx +11 -6
  130. package/src/components/Rating/Rating.tsx +3 -5
  131. package/src/components/River/River.tsx +5 -5
  132. package/src/components/SectionIntro/SectionIntro.tsx +8 -2
  133. package/src/components/Slider/Slider.stories.tsx +4 -4
  134. package/src/components/Slider/Slider.tsx +4 -3
  135. package/src/components/Spinner/Spinner.tsx +2 -1
  136. package/src/components/Steps/Steps.stories.tsx +5 -4
  137. package/src/components/Steps/Steps.tsx +8 -5
  138. package/src/components/Tab/Tab.stories.tsx +4 -3
  139. package/src/components/Tab/Tab.tsx +8 -6
  140. package/src/components/Testimonial/Testimonial.tsx +8 -2
  141. package/src/components/Todo/Todo.tsx +2 -1
  142. package/src/components/Toggle/Toggle.stories.tsx +5 -4
  143. package/src/components/Toggle/Toggle.tsx +8 -5
  144. package/src/components/Tooltip/Tooltip.stories.tsx +40 -30
  145. package/src/components/Tooltip/Tooltip.tsx +9 -2
  146. package/src/components/Upload/Upload.stories.tsx +252 -0
  147. package/src/components/Upload/Upload.tsx +92 -53
  148. package/src/components/VideoPlayer/VideoPlayer.tsx +3 -1
  149. package/src/components/index.ts +0 -4
  150. package/src/layouts/Grid/Grid.stories.tsx +10 -23
  151. package/src/layouts/Grid/Grid.tsx +20 -1
  152. package/src/layouts/Grid/GridCol.tsx +76 -48
  153. package/src/lib/composables/useAtomixGlass.ts +861 -44
  154. package/src/lib/composables/useBarChart.ts +13 -6
  155. package/src/lib/composables/useChart.ts +17 -13
  156. package/src/lib/composables/useChartExport.ts +19 -78
  157. package/src/lib/composables/useChartToolbar.ts +0 -1
  158. package/src/lib/composables/useEdgePanel.ts +111 -103
  159. package/src/lib/composables/useFooter.ts +3 -3
  160. package/src/lib/composables/useGlassContainer.ts +16 -7
  161. package/src/lib/composables/useLineChart.ts +8 -1
  162. package/src/lib/composables/useRiver.ts +5 -0
  163. package/src/lib/composables/useSlider.ts +62 -24
  164. package/src/lib/composables/useVideoPlayer.ts +60 -63
  165. package/src/lib/constants/components.ts +146 -32
  166. package/src/lib/types/components.ts +258 -10
  167. package/src/lib/utils/displacement-generator.ts +55 -49
  168. package/src/lib/utils/icons.ts +1 -1
  169. package/src/lib/utils/index.ts +16 -10
  170. package/src/styles/01-settings/_settings.accordion.scss +19 -19
  171. package/src/styles/01-settings/_settings.animations.scss +5 -5
  172. package/src/styles/01-settings/_settings.avatar-group.scss +1 -1
  173. package/src/styles/01-settings/_settings.avatar.scss +17 -17
  174. package/src/styles/01-settings/_settings.background.scss +1 -4
  175. package/src/styles/01-settings/_settings.badge.scss +1 -1
  176. package/src/styles/01-settings/_settings.breadcrumb.scss +1 -1
  177. package/src/styles/01-settings/_settings.card.scss +1 -1
  178. package/src/styles/01-settings/_settings.chart.scss +65 -2
  179. package/src/styles/01-settings/_settings.dropdown.scss +1 -1
  180. package/src/styles/01-settings/_settings.footer.scss +35 -42
  181. package/src/styles/01-settings/_settings.input.scss +1 -1
  182. package/src/styles/01-settings/_settings.list.scss +1 -1
  183. package/src/styles/01-settings/_settings.rating.scss +1 -1
  184. package/src/styles/01-settings/_settings.tabs.scss +1 -1
  185. package/src/styles/01-settings/_settings.upload.scss +6 -5
  186. package/src/styles/02-tools/_tools.animations.scss +4 -5
  187. package/src/styles/02-tools/_tools.background.scss +1 -13
  188. package/src/styles/02-tools/_tools.glass.scss +0 -1
  189. package/src/styles/02-tools/_tools.utility-api.scss +42 -34
  190. package/src/styles/03-generic/_generic.root.scss +1 -4
  191. package/src/styles/04-elements/_elements.body.scss +0 -1
  192. package/src/styles/06-components/_components.atomix-glass.scss +216 -39
  193. package/src/styles/06-components/_components.badge.scss +6 -8
  194. package/src/styles/06-components/_components.button.scss +8 -3
  195. package/src/styles/06-components/_components.card.scss +2 -14
  196. package/src/styles/06-components/_components.chart.scss +969 -1449
  197. package/src/styles/06-components/_components.dropdown.scss +19 -7
  198. package/src/styles/06-components/_components.edge-panel.scss +4 -2
  199. package/src/styles/06-components/_components.footer.scss +166 -85
  200. package/src/styles/06-components/_components.input.scss +8 -9
  201. package/src/styles/06-components/_components.list.scss +1 -0
  202. package/src/styles/06-components/_components.modal.scss +5 -3
  203. package/src/styles/06-components/_components.skeleton.scss +8 -6
  204. package/src/styles/06-components/_components.upload.scss +219 -4
  205. package/src/styles/06-components/old.chart.styles.scss +1 -30
  206. package/src/styles/99-utilities/_utilities.opacity.scss +1 -1
  207. package/src/styles/99-utilities/_utilities.scss +1 -1
  208. package/src/components/Chart/AdvancedChart.tsx +0 -624
  209. package/src/components/Chart/LineChartNew.tsx +0 -167
  210. package/src/components/Chart/RealTimeChart.tsx +0 -436
  211. package/src/components/DatePicker/DatePicker copy.tsx +0 -551
@@ -1,7 +1,7 @@
1
- import AdvancedChart from './AdvancedChart';
2
1
  import AnimatedChart from './AnimatedChart';
3
2
  import AreaChart from './AreaChart';
4
3
  import BarChart from './BarChart';
4
+ import BaseChart from './BaseChart';
5
5
  import BubbleChart from './BubbleChart';
6
6
  import CandlestickChart from './CandlestickChart';
7
7
  import Chart from './Chart';
@@ -16,18 +16,18 @@ import LineChart from './LineChart';
16
16
  import MultiAxisChart from './MultiAxisChart';
17
17
  import PieChart from './PieChart';
18
18
  import RadarChart from './RadarChart';
19
- import RealTimeChart from './RealTimeChart';
20
19
  import ScatterChart from './ScatterChart';
21
20
 
22
21
  import TreemapChart from './TreemapChart';
23
22
  import WaterfallChart from './WaterfallChart';
23
+ import * as ChartUtils from './utils';
24
24
 
25
25
  // Export all chart components
26
26
  export {
27
- AdvancedChart,
28
27
  AnimatedChart,
29
28
  AreaChart,
30
29
  BarChart,
30
+ BaseChart,
31
31
  BubbleChart,
32
32
  CandlestickChart,
33
33
  Chart,
@@ -42,12 +42,15 @@ export {
42
42
  MultiAxisChart,
43
43
  PieChart,
44
44
  RadarChart,
45
- RealTimeChart,
46
45
  ScatterChart,
47
46
  TreemapChart,
48
47
  WaterfallChart,
48
+ ChartUtils,
49
49
  };
50
50
 
51
+ // Export chart context
52
+ export { ChartContext, useChartContext } from './Chart';
53
+
51
54
  // Export chart hooks
52
55
  export { useBarChart } from '../../lib/composables/useBarChart';
53
56
  export {
@@ -63,10 +66,9 @@ export { useLineChart } from '../../lib/composables/useLineChart';
63
66
  export { usePieChart } from '../../lib/composables/usePieChart';
64
67
 
65
68
  // Export chart component types
66
- export type { AdvancedChartProps } from './AdvancedChart';
67
- export type { AnimatedChartProps } from './AnimatedChart';
68
69
  export type { AreaChartProps } from './AreaChart';
69
70
  export type { BarChartProps } from './BarChart';
71
+ export type { BaseChartProps } from './BaseChart';
70
72
  export type { BubbleChartProps, BubbleDataPoint } from './BubbleChart';
71
73
  export type { CandlestickChartProps, CandlestickDataPoint } from './CandlestickChart';
72
74
  export type { ChartToolbarAction, ChartToolbarGroup, ChartToolbarProps } from './ChartToolbar';
@@ -76,11 +78,10 @@ export type { FunnelChartProps, FunnelDataPoint } from './FunnelChart';
76
78
  export type { GaugeChartProps } from './GaugeChart';
77
79
  export type { HeatmapChartProps, HeatmapDataPoint } from './HeatmapChart';
78
80
  export type { LineChartProps } from './LineChart';
79
- export type { AxisConfig, MultiAxisChartProps, MultiAxisDataset } from './MultiAxisChart';
81
+ export type { MultiAxisChartProps } from './MultiAxisChart';
80
82
  export type { PieChartProps } from './PieChart';
81
83
  export type { RadarChartProps } from './RadarChart';
82
- export type { RealTimeChartProps } from './RealTimeChart';
83
- export type { ScatterChartProps, ScatterDataPoint } from './ScatterChart';
84
+ export type { ScatterChartProps } from './ScatterChart';
84
85
 
85
86
  export type { TreemapChartProps, TreemapDataPoint, TreemapNode } from './TreemapChart';
86
87
  export type {
@@ -90,6 +91,7 @@ export type {
90
91
  ChartProps,
91
92
  ChartToolbarConfig,
92
93
  ChartType,
94
+ ScatterDataPoint,
93
95
  } from './types';
94
96
  export type { WaterfallChartProps, WaterfallDataPoint } from './WaterfallChart';
95
97
 
@@ -1,5 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { BaseComponentProps, Size, Variant } from '../../lib/types/components';
1
+ import React, { ReactNode } from 'react';
2
+ import { BaseComponentProps, Size, Variant, AtomixGlassProps } from '../../lib/types/components';
3
3
 
4
4
  /**
5
5
  * Chart types - comprehensive list
@@ -35,6 +35,15 @@ export interface ChartDataPoint {
35
35
  metadata?: Record<string, any>;
36
36
  }
37
37
 
38
+ /**
39
+ * Scatter chart data point interface
40
+ */
41
+ export interface ScatterDataPoint extends ChartDataPoint {
42
+ x: number;
43
+ y: number;
44
+ size?: number;
45
+ }
46
+
38
47
  /**
39
48
  * Chart dataset interface
40
49
  */
@@ -109,6 +118,12 @@ export interface ChartProps extends BaseComponentProps {
109
118
  */
110
119
  variant?: Variant;
111
120
 
121
+ /**
122
+ * Glass morphism effect
123
+ * When true, applies default glass effect. When an object, allows custom glass configuration.
124
+ */
125
+ glass?: boolean | AtomixGlassProps;
126
+
112
127
  /**
113
128
  * Chart title
114
129
  */
@@ -274,14 +289,9 @@ export interface ChartProps extends BaseComponentProps {
274
289
 
275
290
  /**
276
291
  * Chart scales interface
292
+ * Imported from useChart for consistency
277
293
  */
278
- export interface ChartScales {
279
- xScale: (index: number) => number;
280
- yScale: (value: number) => number;
281
- width: number;
282
- height: number;
283
- padding: { top: number; right: number; bottom: number; left: number };
284
- }
294
+ export type { ChartScales } from '../../lib/composables/useChart';
285
295
 
286
296
  /**
287
297
  * Chart interaction state
@@ -291,6 +301,72 @@ export interface ChartInteraction {
291
301
  selectedIndex: number | null;
292
302
  }
293
303
 
304
+ /**
305
+ * Chart hovered point state
306
+ */
307
+ export interface ChartHoveredPoint {
308
+ datasetIndex: number;
309
+ pointIndex: number;
310
+ x: number;
311
+ y: number;
312
+ clientX: number;
313
+ clientY: number;
314
+ }
315
+
316
+ /**
317
+ * Chart event handlers interface
318
+ */
319
+ export interface ChartHandlers {
320
+ onDataPointClick?: (dataPoint: ChartDataPoint, datasetIndex: number, pointIndex: number) => void;
321
+ onPointHover: (
322
+ datasetIndex: number,
323
+ pointIndex: number,
324
+ x: number,
325
+ y: number,
326
+ clientX: number,
327
+ clientY: number
328
+ ) => void;
329
+ onPointLeave: () => void;
330
+ onMouseMove: (event: React.MouseEvent<SVGSVGElement>) => void;
331
+ onMouseDown: (event: React.MouseEvent<SVGSVGElement>) => void;
332
+ onMouseUp: () => void;
333
+ onWheel: (event: React.WheelEvent<SVGSVGElement>) => void;
334
+ }
335
+
336
+ /**
337
+ * Chart accessibility interface
338
+ */
339
+ export interface ChartAccessibility {
340
+ announcement: string;
341
+ focusedPoint: { datasetIndex: number; pointIndex: number };
342
+ getAccessibleDescription: () => string;
343
+ }
344
+
345
+ /**
346
+ * Chart toolbar state
347
+ */
348
+ export interface ChartToolbarState {
349
+ showTooltips?: boolean;
350
+ showLegend?: boolean;
351
+ animationsEnabled?: boolean;
352
+ showGrid?: boolean;
353
+ }
354
+
355
+ /**
356
+ * Chart render content parameters
357
+ */
358
+ export interface ChartRenderContentParams {
359
+ scales: ChartScales;
360
+ colors: string[];
361
+ datasets: ChartDataset[];
362
+ interactionState?: ChartInteraction;
363
+ handlers: ChartHandlers;
364
+ accessibility: ChartAccessibility;
365
+ hoveredPoint: ChartHoveredPoint | null;
366
+ toolbarState?: ChartToolbarState;
367
+ config?: ChartConfig;
368
+ }
369
+
294
370
  /**
295
371
  * Chart toolbar configuration interface
296
372
  */
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Generate a color from a color scheme based on an index
3
+ * @param colorScheme - Array of colors to choose from
4
+ * @param index - Index to select color from
5
+ * @returns Color string
6
+ */
7
+ export const getColorFromScheme = (colorScheme: string[], index: number): string => {
8
+ return colorScheme[index % colorScheme.length];
9
+ };
10
+
11
+ /**
12
+ * Generate a color based on a value within a range
13
+ * @param value - The value to map to a color
14
+ * @param minValue - The minimum value in the range
15
+ * @param maxValue - The maximum value in the range
16
+ * @param colorScheme - Array of colors to interpolate between
17
+ * @returns Color string
18
+ */
19
+ export const getColorFromValue = (
20
+ value: number,
21
+ minValue: number,
22
+ maxValue: number,
23
+ colorScheme: string[]
24
+ ): string => {
25
+ if (minValue === maxValue) {
26
+ return colorScheme[0];
27
+ }
28
+
29
+ const normalized = (value - minValue) / (maxValue - minValue);
30
+ const index = Math.floor(normalized * (colorScheme.length - 1));
31
+ return colorScheme[index];
32
+ };
33
+
34
+ /**
35
+ * Default color schemes for charts
36
+ */
37
+ export const DEFAULT_COLOR_SCHEMES = {
38
+ primary: [
39
+ 'var(--atomix-primary)',
40
+ 'var(--atomix-secondary)',
41
+ 'var(--atomix-success)',
42
+ 'var(--atomix-warning)',
43
+ 'var(--atomix-error)',
44
+ 'var(--atomix-info)',
45
+ ],
46
+ rainbow: [
47
+ 'var(--atomix-error)',
48
+ 'var(--atomix-info)',
49
+ 'var(--atomix-primary)',
50
+ 'var(--atomix-warning)',
51
+ 'var(--atomix-success)',
52
+ 'var(--atomix-primary-5)',
53
+ 'var(--atomix-primary-7)',
54
+ 'var(--atomix-warning-5)',
55
+ ],
56
+ monochrome: [
57
+ 'var(--atomix-gray-10)',
58
+ 'var(--atomix-gray-9)',
59
+ 'var(--atomix-gray-8)',
60
+ 'var(--atomix-gray-7)',
61
+ 'var(--atomix-gray-6)',
62
+ 'var(--atomix-gray-5)',
63
+ 'var(--atomix-gray-4)',
64
+ 'var(--atomix-gray-3)',
65
+ ],
66
+ };
@@ -2,9 +2,10 @@ import React, { useEffect, useState } from 'react';
2
2
 
3
3
  export interface ColorModeToggleProps {
4
4
  className?: string;
5
+ style?: React.CSSProperties;
5
6
  }
6
7
 
7
- export const ColorModeToggle: React.FC<ColorModeToggleProps> = ({ className = '' }) => {
8
+ export const ColorModeToggle: React.FC<ColorModeToggleProps> = ({ className = '', style }) => {
8
9
  const [colorMode, setColorMode] = useState<'light' | 'dark'>('light');
9
10
 
10
11
  // Initialize color mode from localStorage or system preference
@@ -22,8 +23,9 @@ export const ColorModeToggle: React.FC<ColorModeToggleProps> = ({ className = ''
22
23
 
23
24
  // Update the document theme attribute when colorMode changes
24
25
  useEffect(() => {
25
- document.body.setAttribute('data-atomix-color-mode', colorMode);
26
- localStorage.setItem('atomix-color-mode', colorMode);
26
+ const validColorMode = colorMode === 'dark' ? 'dark' : 'light';
27
+ document.body.setAttribute('data-atomix-color-mode', validColorMode);
28
+ localStorage.setItem('atomix-color-mode', validColorMode);
27
29
  }, [colorMode]);
28
30
 
29
31
  // Listen for system color scheme changes
@@ -66,6 +68,7 @@ export const ColorModeToggle: React.FC<ColorModeToggleProps> = ({ className = ''
66
68
  onClick={toggleColorMode}
67
69
  aria-label={`Switch to ${colorMode === 'light' ? 'dark' : 'light'} mode`}
68
70
  title={`Switch to ${colorMode === 'light' ? 'dark' : 'light'} mode`}
71
+ style={style}
69
72
  >
70
73
  {colorMode === 'light' ? (
71
74
  <svg viewBox="0 0 24 24" width="24" height="24" fill="currentColor">
@@ -11,6 +11,8 @@ export interface CountdownProps {
11
11
  focused?: boolean;
12
12
  /** Custom className */
13
13
  className?: string;
14
+ /** Custom style */
15
+ style?: React.CSSProperties;
14
16
  /** Optional callback when countdown reaches zero */
15
17
  onComplete?: () => void;
16
18
  }
@@ -32,6 +34,7 @@ export const Countdown: React.FC<CountdownProps> = forwardRef<HTMLDivElement, Co
32
34
  separator = ':',
33
35
  focused = false,
34
36
  className = '',
37
+ style,
35
38
  onComplete,
36
39
  },
37
40
  ref
@@ -68,6 +71,7 @@ export const Countdown: React.FC<CountdownProps> = forwardRef<HTMLDivElement, Co
68
71
  <div
69
72
  ref={ref}
70
73
  className={`c-countdown${focused ? ' c-countdown--focused' : ''} ${className}`.trim()}
74
+ style={style}
71
75
  >
72
76
  {timeParts.map((part, idx) => (
73
77
  <React.Fragment key={part.label}>
@@ -23,6 +23,7 @@ export const DataTable: React.FC<DataTableProps> = ({
23
23
  data,
24
24
  columns,
25
25
  className,
26
+ style,
26
27
  sortable = false,
27
28
  filterable = false,
28
29
  paginated = false,
@@ -193,7 +194,7 @@ export const DataTable: React.FC<DataTableProps> = ({
193
194
  };
194
195
 
195
196
  return (
196
- <div className={DATA_TABLE_CLASSES.container} {...props}>
197
+ <div className={DATA_TABLE_CLASSES.container} style={style} {...props}>
197
198
  {renderToolbar()}
198
199
  <div className={DATA_TABLE_CLASSES.tableWrapper}>
199
200
  <table ref={tableRef} className={tableClass}>
@@ -211,7 +211,6 @@ export const GlassModeStandard: Story = {
211
211
  blurAmount: 3,
212
212
  saturation: 160,
213
213
  aberrationIntensity: 0,
214
- cornerRadius: 12,
215
214
  overLight: false,
216
215
  elasticity: 0,
217
216
  } as any,
@@ -261,7 +260,6 @@ export const GlassModePolar: Story = {
261
260
  blurAmount: 2.5,
262
261
  saturation: 180,
263
262
  aberrationIntensity: 2,
264
- cornerRadius: 12,
265
263
  } as any,
266
264
  },
267
265
  render: args => {
@@ -307,7 +305,6 @@ export const GlassModeProminent: Story = {
307
305
  blurAmount: 3.5,
308
306
  saturation: 200,
309
307
  aberrationIntensity: 3,
310
- cornerRadius: 12,
311
308
  } as any,
312
309
  },
313
310
  render: args => {
@@ -355,7 +352,6 @@ export const GlassModeShader: Story = {
355
352
  displacementScale: 55,
356
353
  blurAmount: 2.8,
357
354
  saturation: 170,
358
- cornerRadius: 12,
359
355
  } as any,
360
356
  },
361
357
  render: args => {
@@ -1067,7 +1063,6 @@ export const GlassEffectCustomized: Story = {
1067
1063
  blurAmount: 0,
1068
1064
  saturation: 180,
1069
1065
  aberrationIntensity: 2,
1070
- cornerRadius: 16,
1071
1066
  overLight: false,
1072
1067
  mode: 'polar' as const,
1073
1068
  } as any,
@@ -1137,12 +1132,6 @@ export const GlassEffectRangeSelection: Story = {
1137
1132
  selectionMode: 'range',
1138
1133
  placeholder: 'Select date...',
1139
1134
  glass: {
1140
- displacementScale: 100,
1141
- blurAmount: 0,
1142
- saturation: 200,
1143
- aberrationIntensity: 4,
1144
- cornerRadius: 16,
1145
- overLight: false,
1146
1135
  mode: 'prominent' as const,
1147
1136
  } as any,
1148
1137
  },
@@ -34,6 +34,7 @@ export const DatePicker = forwardRef<DatePickerRef, DatePickerProps>(
34
34
  placement = 'bottom-start',
35
35
  inputClassName = '',
36
36
  size = 'md',
37
+ style,
37
38
  glass,
38
39
  ...props
39
40
  },
@@ -464,7 +465,7 @@ export const DatePicker = forwardRef<DatePickerRef, DatePickerProps>(
464
465
  );
465
466
 
466
467
  return (
467
- <div className={datepickerClassName} ref={datePickerRef} {...props}>
468
+ <div className={datepickerClassName} ref={datePickerRef} style={style} {...props}>
468
469
  {!inline && (
469
470
  <div className="c-datepicker__input-wrapper">
470
471
  <input
@@ -512,14 +513,7 @@ export const DatePicker = forwardRef<DatePickerRef, DatePickerProps>(
512
513
  <AtomixGlass
513
514
  {...(glass === true
514
515
  ? {
515
- displacementScale: 50,
516
- blurAmount: 3,
517
- saturation: 160,
518
- aberrationIntensity: 0,
519
- cornerRadius: 12,
520
- overLight: false,
521
- elasticity: 0,
522
- mode: 'standard' as const,
516
+ displacementScale: 20,
523
517
  }
524
518
  : glass)}
525
519
  >
@@ -150,6 +150,11 @@ export interface DatePickerProps {
150
150
  * @default false
151
151
  */
152
152
  glass?: boolean | AtomixGlassProps;
153
+
154
+ /**
155
+ * Custom style for the datepicker component
156
+ */
157
+ style?: React.CSSProperties;
153
158
  }
154
159
 
155
160
  export interface DatePickerRef {
@@ -371,12 +371,14 @@ export const GlassDropdown: Story = {
371
371
  },
372
372
  render: args => <InteractiveDropdown {...args} />,
373
373
  decorators: [
374
- (Story) => (
375
- <div style={{
376
- background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
377
- minHeight: '100vh',
378
- padding: '2rem'
379
- }}>
374
+ Story => (
375
+ <div
376
+ style={{
377
+ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
378
+ minHeight: '100vh',
379
+ padding: '2rem',
380
+ }}
381
+ >
380
382
  <Story />
381
383
  </div>
382
384
  ),
@@ -400,12 +402,14 @@ export const GlassDropdownCustom: Story = {
400
402
  },
401
403
  render: args => <InteractiveDropdown {...args} />,
402
404
  decorators: [
403
- (Story) => (
404
- <div style={{
405
- background: 'linear-gradient(45deg, #f093fb 0%, #f5576c 100%)',
406
- minHeight: '100vh',
407
- padding: '2rem'
408
- }}>
405
+ Story => (
406
+ <div
407
+ style={{
408
+ background: 'linear-gradient(45deg, #f093fb 0%, #f5576c 100%)',
409
+ minHeight: '100vh',
410
+ padding: '2rem',
411
+ }}
412
+ >
409
413
  <Story />
410
414
  </div>
411
415
  ),
@@ -422,12 +426,14 @@ export const GlassDropdownWithIcons: Story = {
422
426
  },
423
427
  render: args => <InteractiveDropdown {...args} />,
424
428
  decorators: [
425
- (Story) => (
426
- <div style={{
427
- background: 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
428
- minHeight: '100vh',
429
- padding: '2rem'
430
- }}>
429
+ Story => (
430
+ <div
431
+ style={{
432
+ background: 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
433
+ minHeight: '100vh',
434
+ padding: '2rem',
435
+ }}
436
+ >
431
437
  <Story />
432
438
  </div>
433
439
  ),
@@ -441,8 +447,7 @@ export const GlassAllVariants: Story = {
441
447
  parameters: {
442
448
  docs: {
443
449
  description: {
444
- story:
445
- 'Glass morphism effect applied to dropdowns with all color variants.',
450
+ story: 'Glass morphism effect applied to dropdowns with all color variants.',
446
451
  },
447
452
  },
448
453
  },
@@ -458,11 +463,13 @@ export const GlassAllVariants: Story = {
458
463
  };
459
464
 
460
465
  return (
461
- <div style={{
462
- background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
463
- minHeight: '100vh',
464
- padding: '2rem'
465
- }}>
466
+ <div
467
+ style={{
468
+ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
469
+ minHeight: '100vh',
470
+ padding: '2rem',
471
+ }}
472
+ >
466
473
  <div className="u-d-flex u-flex-wrap u-gap-3">
467
474
  {[
468
475
  'primary',
@@ -76,10 +76,15 @@ export const DropdownItem: React.FC<DropdownItemProps> = ({
76
76
  return (
77
77
  <li>
78
78
  {LinkComponent ? (
79
- <LinkComponent {...linkProps}>
80
- {icon && <span className="c-dropdown__menu-item-icon">{icon}</span>}
81
- {children}
82
- </LinkComponent>
79
+ (() => {
80
+ const Component = LinkComponent as React.ComponentType<any>;
81
+ return (
82
+ <Component {...linkProps}>
83
+ {icon && <span className="c-dropdown__menu-item-icon">{icon}</span>}
84
+ {children}
85
+ </Component>
86
+ );
87
+ })()
83
88
  ) : (
84
89
  <a {...linkProps}>
85
90
  {icon && <span className="c-dropdown__menu-item-icon">{icon}</span>}
@@ -139,6 +144,7 @@ export const Dropdown: React.FC<DropdownProps> = ({
139
144
  minWidth = DROPDOWN.DEFAULTS.MIN_WIDTH,
140
145
  variant,
141
146
  className = '',
147
+ style,
142
148
  glass,
143
149
  ...props
144
150
  }) => {
@@ -321,6 +327,7 @@ export const Dropdown: React.FC<DropdownProps> = ({
321
327
  <div
322
328
  ref={dropdownRef}
323
329
  className={dropdownClasses}
330
+ style={style}
324
331
  onMouseEnter={trigger === 'hover' ? handleHoverOpen : undefined}
325
332
  {...props}
326
333
  >
@@ -340,35 +347,26 @@ export const Dropdown: React.FC<DropdownProps> = ({
340
347
  <div
341
348
  ref={menuRef}
342
349
  id={dropdownId}
343
- className={`c-dropdown__menu-wrapper c-dropdown__menu-wrapper--${placement} ${isOpen ? 'is-open' : ''}`}
350
+ className={`c-dropdown__menu-wrapper c-dropdown__menu-wrapper--${placement} ${isOpen ? 'is-open' : ''} ${glass ? 'is-glass' : ''}`}
344
351
  role="menu"
345
352
  aria-orientation="vertical"
346
353
  aria-hidden={!isOpen}
347
354
  onKeyDown={handleKeyDown}
348
355
  >
349
- {glass ? (
350
- // Default glass settings for dropdowns
351
- (() => {
352
- const defaultGlassProps = {
353
- displacementScale: 60,
354
- blurAmount: 1,
355
- saturation: 160,
356
- aberrationIntensity: 0.5,
357
- cornerRadius: 12,
358
- mode: 'shader' as const,
359
- };
360
-
361
- const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
362
-
363
- return (
364
- <AtomixGlass {...glassProps} style={{position: 'absolute', width: '100%', height: '100%'}}>
365
- {menuContent}
366
- </AtomixGlass>
367
- );
368
- })()
369
- ) : (
370
- menuContent
371
- )}
356
+ {glass
357
+ ? // Default glass settings for dropdowns
358
+ (() => {
359
+ const defaultGlassProps = {
360
+ displacementScale: 20,
361
+ elasticity: 0,
362
+ };
363
+
364
+ const glassProps =
365
+ glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
366
+
367
+ return <AtomixGlass {...glassProps}>{menuContent}</AtomixGlass>;
368
+ })()
369
+ : menuContent}
372
370
  </div>
373
371
  </div>
374
372
  );
@@ -55,7 +55,8 @@ const meta = {
55
55
  style={{
56
56
  minHeight: '100vh',
57
57
  width: '100%',
58
- backgroundImage: 'url(https://images.unsplash.com/photo-1605440704530-cd6f40ecf5a9?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2670)',
58
+ backgroundImage:
59
+ 'url(https://images.unsplash.com/photo-1605440704530-cd6f40ecf5a9?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2670)',
59
60
  backgroundSize: 'cover',
60
61
  backgroundPosition: 'center',
61
62
  display: 'flex',
@@ -148,9 +149,7 @@ const EdgePanelController = ({
148
149
  }, []);
149
150
 
150
151
  return (
151
- <div
152
-
153
- >
152
+ <div>
154
153
  <Button label={`Open ${position} panel`} variant="primary" onClick={() => setOpen(true)} />
155
154
 
156
155
  <EdgePanel
@@ -316,12 +315,14 @@ export const GlassStart: Story = {
316
315
  isOpen={open}
317
316
  onOpenChange={setOpen}
318
317
  title="Glass Panel"
319
- glass={{
320
- mode: 'standard',
321
- displacementScale: 50,
322
- blurAmount: 2,
323
- saturation: 150,
324
- } as any}
318
+ glass={
319
+ {
320
+ mode: 'standard',
321
+ displacementScale: 50,
322
+ blurAmount: 2,
323
+ saturation: 150,
324
+ } as any
325
+ }
325
326
  >
326
327
  <DemoPanelContent
327
328
  position="start"
@@ -407,8 +408,7 @@ export const GlassCustom: Story = {
407
408
  }, []);
408
409
 
409
410
  return (
410
- <div
411
- >
411
+ <div>
412
412
  <Button label="Open Custom Glass Panel" variant="primary" onClick={() => setOpen(true)} />
413
413
 
414
414
  <EdgePanel
@@ -474,9 +474,7 @@ export const GlassPremium: Story = {
474
474
  }, []);
475
475
 
476
476
  return (
477
- <div
478
-
479
- >
477
+ <div>
480
478
  <Button label="Open Premium Glass Panel" variant="primary" onClick={() => setOpen(true)} />
481
479
 
482
480
  <EdgePanel