@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.
- package/README.md +19 -0
- package/dist/atomix.css +1703 -1544
- package/dist/atomix.min.css +4 -4
- package/dist/index.d.ts +1465 -963
- package/dist/index.esm.js +16289 -25908
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15650 -21780
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/themes/applemix.css +15008 -0
- package/dist/themes/applemix.min.css +72 -0
- package/dist/themes/boomdevs.css +1608 -1450
- package/dist/themes/boomdevs.min.css +5 -5
- package/dist/themes/esrar.css +1702 -1543
- package/dist/themes/esrar.min.css +4 -4
- package/dist/themes/flashtrade.css +15159 -0
- package/dist/themes/flashtrade.min.css +86 -0
- package/dist/themes/mashroom.css +1699 -1540
- package/dist/themes/mashroom.min.css +7 -7
- package/dist/themes/shaj-default.css +1693 -1534
- package/dist/themes/shaj-default.min.css +4 -4
- package/package.json +6 -17
- package/src/components/Accordion/Accordion.stories.tsx +662 -21
- package/src/components/Accordion/Accordion.tsx +21 -14
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +106 -72
- package/src/components/AtomixGlass/AtomixGlass.tsx +529 -1195
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +400 -0
- package/src/components/AtomixGlass/GlassFilter.tsx +156 -0
- package/src/components/AtomixGlass/README.md +124 -2
- package/src/components/AtomixGlass/atomixGLass.old.tsx +1266 -0
- package/src/components/AtomixGlass/glass-utils.ts +263 -0
- package/src/components/AtomixGlass/shader-utils.ts +792 -68
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1250 -0
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +5768 -0
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +1065 -0
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +1129 -0
- package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +395 -0
- package/src/components/AtomixGlass/stories/shared-components.tsx +301 -0
- package/src/components/AtomixGlass/utils.ts +3 -3
- package/src/components/Avatar/Avatar.tsx +3 -0
- package/src/components/Avatar/AvatarGroup.tsx +2 -1
- package/src/components/Badge/Badge.stories.tsx +76 -55
- package/src/components/Badge/Badge.tsx +12 -14
- package/src/components/Breadcrumb/Breadcrumb.tsx +23 -4
- package/src/components/Button/Button.stories.tsx +501 -20
- package/src/components/Button/Button.tsx +5 -8
- package/src/components/Callout/Callout.stories.tsx +86 -35
- package/src/components/Callout/Callout.tsx +31 -9
- package/src/components/Card/Card.stories.tsx +565 -2
- package/src/components/Card/Card.tsx +15 -4
- package/src/components/Card/ElevationCard.tsx +2 -0
- package/src/components/Chart/AnimatedChart.tsx +179 -156
- package/src/components/Chart/AreaChart.tsx +123 -12
- package/src/components/Chart/BarChart.tsx +91 -100
- package/src/components/Chart/BaseChart.tsx +80 -0
- package/src/components/Chart/BubbleChart.tsx +114 -290
- package/src/components/Chart/CandlestickChart.tsx +282 -622
- package/src/components/Chart/Chart.stories.tsx +576 -179
- package/src/components/Chart/Chart.tsx +374 -75
- package/src/components/Chart/ChartRenderer.tsx +371 -220
- package/src/components/Chart/ChartToolbar.tsx +372 -61
- package/src/components/Chart/ChartTooltip.tsx +33 -18
- package/src/components/Chart/DonutChart.tsx +172 -254
- package/src/components/Chart/FunnelChart.tsx +169 -240
- package/src/components/Chart/GaugeChart.tsx +224 -392
- package/src/components/Chart/HeatmapChart.tsx +302 -440
- package/src/components/Chart/LineChart.tsx +148 -103
- package/src/components/Chart/MultiAxisChart.tsx +267 -395
- package/src/components/Chart/PieChart.tsx +114 -64
- package/src/components/Chart/RadarChart.tsx +202 -218
- package/src/components/Chart/ScatterChart.tsx +111 -97
- package/src/components/Chart/TreemapChart.tsx +147 -222
- package/src/components/Chart/WaterfallChart.tsx +253 -291
- package/src/components/Chart/index.ts +11 -9
- package/src/components/Chart/types.ts +85 -9
- package/src/components/Chart/utils.ts +66 -0
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +6 -3
- package/src/components/Countdown/Countdown.tsx +4 -0
- package/src/components/DataTable/DataTable.tsx +2 -1
- package/src/components/DatePicker/DatePicker.stories.tsx +689 -12
- package/src/components/DatePicker/DatePicker.tsx +3 -9
- package/src/components/DatePicker/types.ts +5 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +32 -25
- package/src/components/Dropdown/Dropdown.tsx +26 -28
- package/src/components/EdgePanel/EdgePanel.stories.tsx +473 -2
- package/src/components/EdgePanel/EdgePanel.tsx +101 -13
- package/src/components/Footer/Footer.stories.tsx +187 -60
- package/src/components/Footer/Footer.test.tsx +134 -0
- package/src/components/Footer/Footer.tsx +133 -34
- package/src/components/Footer/FooterLink.tsx +1 -1
- package/src/components/Footer/FooterSection.tsx +53 -36
- package/src/components/Footer/FooterSocialLink.tsx +32 -29
- package/src/components/Footer/README.md +82 -3
- package/src/components/Footer/index.ts +1 -1
- package/src/components/Form/Checkbox.stories.tsx +13 -5
- package/src/components/Form/Checkbox.tsx +3 -6
- package/src/components/Form/Form.stories.tsx +10 -3
- package/src/components/Form/Form.tsx +2 -0
- package/src/components/Form/FormGroup.tsx +2 -1
- package/src/components/Form/Input.stories.tsx +12 -11
- package/src/components/Form/Input.tsx +97 -95
- package/src/components/Form/Radio.stories.tsx +22 -7
- package/src/components/Form/Radio.tsx +3 -6
- package/src/components/Form/Select.stories.tsx +21 -6
- package/src/components/Form/Select.tsx +3 -5
- package/src/components/Form/Textarea.stories.tsx +13 -11
- package/src/components/Form/Textarea.tsx +88 -86
- package/src/components/Hero/Hero.stories.tsx +2 -3
- package/src/components/Hero/Hero.tsx +5 -6
- package/src/components/Icon/Icon.tsx +12 -1
- package/src/components/List/List.tsx +2 -1
- package/src/components/List/ListGroup.tsx +2 -1
- package/src/components/Messages/Messages.stories.tsx +113 -0
- package/src/components/Messages/Messages.tsx +52 -9
- package/src/components/Modal/Modal.stories.tsx +48 -32
- package/src/components/Modal/Modal.tsx +19 -24
- package/src/components/Navigation/Menu/MegaMenu.tsx +2 -2
- package/src/components/Navigation/Menu/Menu.tsx +2 -2
- package/src/components/Navigation/Nav/Nav.stories.tsx +469 -0
- package/src/components/Navigation/Nav/Nav.tsx +22 -4
- package/src/components/Navigation/Nav/NavDropdown.tsx +10 -1
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +413 -0
- package/src/components/Navigation/Navbar/Navbar.tsx +70 -29
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +340 -0
- package/src/components/Navigation/SideMenu/SideMenu.tsx +29 -2
- package/src/components/Pagination/Pagination.stories.tsx +13 -6
- package/src/components/Pagination/Pagination.tsx +7 -6
- package/src/components/PhotoViewer/PhotoViewer.tsx +2 -1
- package/src/components/Popover/Popover.stories.tsx +32 -24
- package/src/components/Popover/Popover.tsx +4 -1
- package/src/components/ProductReview/ProductReview.tsx +8 -2
- package/src/components/Progress/Progress.tsx +19 -3
- package/src/components/Rating/Rating.stories.tsx +11 -6
- package/src/components/Rating/Rating.tsx +3 -5
- package/src/components/River/River.tsx +5 -5
- package/src/components/SectionIntro/SectionIntro.tsx +8 -2
- package/src/components/Slider/Slider.stories.tsx +4 -4
- package/src/components/Slider/Slider.tsx +4 -3
- package/src/components/Spinner/Spinner.tsx +19 -3
- package/src/components/Steps/Steps.stories.tsx +5 -4
- package/src/components/Steps/Steps.tsx +8 -5
- package/src/components/Tab/Tab.stories.tsx +4 -3
- package/src/components/Tab/Tab.tsx +8 -6
- package/src/components/Testimonial/Testimonial.tsx +8 -2
- package/src/components/Todo/Todo.tsx +2 -1
- package/src/components/Toggle/Toggle.stories.tsx +5 -4
- package/src/components/Toggle/Toggle.tsx +8 -5
- package/src/components/Tooltip/Tooltip.stories.tsx +40 -30
- package/src/components/Tooltip/Tooltip.tsx +9 -2
- package/src/components/Upload/Upload.stories.tsx +252 -0
- package/src/components/Upload/Upload.tsx +92 -53
- package/src/components/VideoPlayer/VideoPlayer.tsx +3 -1
- package/src/components/index.ts +0 -4
- package/src/layouts/Grid/Grid.stories.tsx +10 -23
- package/src/layouts/Grid/Grid.tsx +20 -1
- package/src/layouts/Grid/GridCol.tsx +76 -48
- package/src/lib/composables/useAtomixGlass.ts +861 -44
- package/src/lib/composables/useBarChart.ts +21 -4
- package/src/lib/composables/useChart.ts +227 -370
- package/src/lib/composables/useChartExport.ts +19 -78
- package/src/lib/composables/useChartToolbar.ts +11 -21
- package/src/lib/composables/useEdgePanel.ts +125 -71
- package/src/lib/composables/useFooter.ts +3 -3
- package/src/lib/composables/useGlassContainer.ts +16 -7
- package/src/lib/composables/useLineChart.ts +11 -2
- package/src/lib/composables/usePieChart.ts +4 -14
- package/src/lib/composables/useRiver.ts +5 -0
- package/src/lib/composables/useSlider.ts +62 -24
- package/src/lib/composables/useVideoPlayer.ts +60 -63
- package/src/lib/constants/components.ts +147 -32
- package/src/lib/types/components.ts +355 -25
- package/src/lib/utils/displacement-generator.ts +55 -49
- package/src/lib/utils/icons.ts +1 -1
- package/src/lib/utils/index.ts +16 -10
- package/src/styles/01-settings/_settings.accordion.scss +19 -19
- package/src/styles/01-settings/_settings.animations.scss +5 -5
- package/src/styles/01-settings/_settings.avatar-group.scss +1 -1
- package/src/styles/01-settings/_settings.avatar.scss +17 -17
- package/src/styles/01-settings/_settings.background.scss +0 -3
- package/src/styles/01-settings/_settings.badge.scss +1 -1
- package/src/styles/01-settings/_settings.breadcrumb.scss +1 -1
- package/src/styles/01-settings/_settings.card.scss +1 -1
- package/src/styles/01-settings/_settings.chart.scss +65 -2
- package/src/styles/01-settings/_settings.dropdown.scss +1 -1
- package/src/styles/01-settings/_settings.edge-panel.scss +1 -1
- package/src/styles/01-settings/_settings.footer.scss +35 -42
- package/src/styles/01-settings/_settings.input.scss +1 -1
- package/src/styles/01-settings/_settings.list.scss +1 -1
- package/src/styles/01-settings/_settings.rating.scss +1 -1
- package/src/styles/01-settings/_settings.tabs.scss +1 -1
- package/src/styles/01-settings/_settings.upload.scss +6 -5
- package/src/styles/02-tools/_tools.animations.scss +4 -5
- package/src/styles/02-tools/_tools.background.scss +1 -13
- package/src/styles/02-tools/_tools.glass.scss +0 -1
- package/src/styles/02-tools/_tools.utility-api.scss +91 -48
- package/src/styles/03-generic/_generic.root.scss +1 -4
- package/src/styles/04-elements/_elements.body.scss +0 -1
- package/src/styles/06-components/_components.atomix-glass.scss +249 -0
- package/src/styles/06-components/_components.badge.scss +8 -23
- package/src/styles/06-components/_components.button.scss +8 -3
- package/src/styles/06-components/_components.callout.scss +10 -5
- package/src/styles/06-components/_components.card.scss +2 -14
- package/src/styles/06-components/_components.chart.scss +969 -1449
- package/src/styles/06-components/_components.dropdown.scss +19 -7
- package/src/styles/06-components/_components.edge-panel.scss +103 -0
- package/src/styles/06-components/_components.footer.scss +166 -85
- package/src/styles/06-components/_components.input.scss +8 -9
- package/src/styles/06-components/_components.list.scss +1 -0
- package/src/styles/06-components/_components.messages.scss +176 -0
- package/src/styles/06-components/_components.modal.scss +16 -4
- package/src/styles/06-components/_components.navbar.scss +12 -1
- package/src/styles/06-components/_components.side-menu.scss +5 -0
- package/src/styles/06-components/_components.skeleton.scss +8 -6
- package/src/styles/06-components/_components.upload.scss +219 -4
- package/src/styles/06-components/old.chart.styles.scss +1 -30
- package/src/styles/99-utilities/_index.scss +1 -0
- package/src/styles/99-utilities/_utilities.glass-fixes.scss +1 -0
- package/src/styles/99-utilities/_utilities.scss +1 -1
- package/src/components/AtomixGlass/AtomixGlass.stories.tsx +0 -3011
- package/src/components/AtomixGlass/AtomixGlassComprehensivePreview.stories.tsx +0 -1369
- package/src/components/Chart/AdvancedChart.tsx +0 -624
- package/src/components/Chart/LineChartNew.tsx +0 -167
- package/src/components/Chart/RealTimeChart.tsx +0 -436
- 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 {
|
|
81
|
+
export type { MultiAxisChartProps } from './MultiAxisChart';
|
|
80
82
|
export type { PieChartProps } from './PieChart';
|
|
81
83
|
export type { RadarChartProps } from './RadarChart';
|
|
82
|
-
export type {
|
|
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
|
|
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
|
-
|
|
26
|
-
|
|
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}>
|