@shohojdhara/atomix 0.4.1 → 0.4.3
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/dist/atomix.css +9351 -9259
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +4 -4
- package/dist/atomix.min.css.map +1 -1
- package/dist/charts.d.ts +12 -19
- package/dist/charts.js +555 -358
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +21 -24
- package/dist/core.js +435 -265
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +11 -18
- package/dist/forms.js +411 -257
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +14 -21
- package/dist/heavy.js +409 -254
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +38 -41
- package/dist/index.esm.js +731 -487
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +733 -492
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
- package/scripts/atomix-cli.js +34 -1
- package/src/components/AtomixGlass/AtomixGlass.tsx +82 -54
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +17 -18
- package/src/components/AtomixGlass/README.md +5 -5
- package/src/components/AtomixGlass/stories/Customization.stories.tsx +2 -2
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +42 -42
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +5 -5
- package/src/components/AtomixGlass/stories/Overview.stories.tsx +3 -3
- package/src/components/AtomixGlass/stories/Performance.stories.tsx +2 -2
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +45 -45
- package/src/components/AtomixGlass/stories/Shaders.stories.tsx +3 -3
- package/src/components/Badge/Badge.stories.tsx +1 -1
- package/src/components/Badge/Badge.tsx +1 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +90 -77
- package/src/components/Breadcrumb/index.ts +2 -2
- package/src/components/Button/Button.stories.tsx +1 -1
- package/src/components/Button/Button.tsx +2 -1
- package/src/components/Button/README.md +2 -2
- package/src/components/Callout/Callout.test.tsx +3 -3
- package/src/components/Callout/Callout.tsx +2 -2
- package/src/components/Callout/README.md +2 -2
- package/src/components/Card/Card.tsx +31 -11
- package/src/components/Chart/Chart.stories.tsx +1 -1
- package/src/components/Chart/Chart.tsx +5 -5
- package/src/components/Chart/TreemapChart.tsx +37 -29
- package/src/components/DatePicker/readme.md +3 -3
- package/src/components/Dropdown/Dropdown.stories.tsx +1 -1
- package/src/components/Dropdown/Dropdown.tsx +276 -273
- package/src/components/EdgePanel/EdgePanel.stories.tsx +7 -7
- package/src/components/Footer/FooterLink.tsx +2 -2
- package/src/components/Form/Checkbox.stories.tsx +1 -1
- package/src/components/Form/Checkbox.tsx +1 -1
- package/src/components/Form/Input.stories.tsx +1 -1
- package/src/components/Form/Input.tsx +1 -1
- package/src/components/Form/Radio.stories.tsx +1 -1
- package/src/components/Form/Radio.tsx +1 -1
- package/src/components/Form/Select.stories.tsx +1 -1
- package/src/components/Form/Select.tsx +1 -1
- package/src/components/Form/Textarea.stories.tsx +1 -1
- package/src/components/Form/Textarea.tsx +1 -1
- package/src/components/Hero/Hero.stories.tsx +2 -2
- package/src/components/Hero/Hero.tsx +2 -2
- package/src/components/Messages/Messages.stories.tsx +1 -1
- package/src/components/Messages/Messages.tsx +2 -2
- package/src/components/Modal/Modal.stories.tsx +1 -1
- package/src/components/Navigation/Nav/Nav.stories.tsx +2 -2
- package/src/components/Navigation/Nav/Nav.tsx +1 -1
- package/src/components/Navigation/Nav/NavItem.tsx +6 -3
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +3 -3
- package/src/components/Navigation/Navbar/Navbar.tsx +1 -1
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +2 -2
- package/src/components/Navigation/SideMenu/SideMenu.tsx +1 -1
- package/src/components/Pagination/Pagination.stories.tsx +1 -1
- package/src/components/Pagination/Pagination.tsx +1 -1
- package/src/components/Popover/Popover.stories.tsx +1 -1
- package/src/components/Popover/Popover.tsx +1 -1
- package/src/components/Progress/Progress.tsx +1 -1
- package/src/components/Rating/Rating.stories.tsx +1 -1
- package/src/components/Rating/Rating.test.tsx +73 -0
- package/src/components/Rating/Rating.tsx +25 -37
- package/src/components/Spinner/Spinner.tsx +1 -1
- package/src/components/Steps/Steps.stories.tsx +1 -1
- package/src/components/Steps/Steps.tsx +2 -2
- package/src/components/Tabs/Tabs.stories.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +1 -1
- package/src/components/Todo/Todo.tsx +0 -1
- package/src/components/Toggle/Toggle.stories.tsx +1 -1
- package/src/components/Toggle/Toggle.tsx +1 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/components/VideoPlayer/VideoPlayer.stories.tsx +2 -2
- package/src/lib/composables/__tests__/useAtomixGlassPerf.test.tsx +88 -0
- package/src/lib/composables/__tests__/useChart.test.ts +50 -0
- package/src/lib/composables/__tests__/useChart.test.tsx +139 -0
- package/src/lib/composables/__tests__/useHeroBackgroundSlider.test.tsx +59 -0
- package/src/lib/composables/__tests__/useSliderAutoplay.test.tsx +68 -0
- package/src/lib/composables/atomix-glass/useGlassBackgroundDetection.ts +329 -0
- package/src/lib/composables/atomix-glass/useGlassCornerRadius.ts +82 -0
- package/src/lib/composables/atomix-glass/useGlassMouseTracking.ts +153 -0
- package/src/lib/composables/atomix-glass/useGlassOverLight.ts +198 -0
- package/src/lib/composables/atomix-glass/useGlassSize.ts +117 -0
- package/src/lib/composables/atomix-glass/useGlassState.ts +112 -0
- package/src/lib/composables/atomix-glass/useGlassTransforms.ts +160 -0
- package/src/lib/composables/glass-styles.ts +302 -0
- package/src/lib/composables/index.ts +0 -4
- package/src/lib/composables/useAtomixGlass.ts +331 -522
- package/src/lib/composables/useAtomixGlassStyles.ts +307 -0
- package/src/lib/composables/useBarChart.ts +1 -1
- package/src/lib/composables/useBreadcrumb.ts +6 -6
- package/src/lib/composables/useChart.ts +104 -21
- package/src/lib/composables/useHeroBackgroundSlider.ts +16 -7
- package/src/lib/composables/useSlider.ts +66 -34
- package/src/lib/theme/devtools/CLI.ts +1 -1
- package/src/lib/theme/utils/__tests__/themeUtils.test.ts +213 -0
- package/src/lib/types/components.ts +18 -21
- package/src/lib/utils/__tests__/dom.test.ts +100 -0
- package/src/lib/utils/__tests__/fontPreloader.test.ts +102 -0
- package/src/styles/02-tools/_tools.breakpoints.scss +1 -1
- package/src/styles/02-tools/_tools.utility-api.scss +6 -6
- package/src/styles/06-components/_components.accordion.scss +0 -2
- package/src/styles/06-components/_components.chart.scss +0 -1
- package/src/styles/06-components/_components.dropdown.scss +0 -1
- package/src/styles/06-components/_components.edge-panel.scss +0 -2
- package/src/styles/06-components/_components.photoviewer.scss +0 -1
- package/src/styles/06-components/_components.river.scss +0 -1
- package/src/styles/06-components/_components.slider.scss +0 -3
- package/src/styles/99-utilities/_utilities.glass-fixes.scss +0 -1
- package/src/styles/99-utilities/_utilities.text.scss +1 -0
|
@@ -39,6 +39,8 @@ export const Card = React.memo(
|
|
|
39
39
|
onFocus,
|
|
40
40
|
href,
|
|
41
41
|
target,
|
|
42
|
+
// Custom Link
|
|
43
|
+
LinkComponent,
|
|
42
44
|
// Glass
|
|
43
45
|
glass,
|
|
44
46
|
// Accessibility
|
|
@@ -242,17 +244,35 @@ export const Card = React.memo(
|
|
|
242
244
|
|
|
243
245
|
// Render as anchor if href is provided
|
|
244
246
|
if (href && !isDisabled) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
247
|
+
let anchorElement: React.ReactElement;
|
|
248
|
+
|
|
249
|
+
if (LinkComponent) {
|
|
250
|
+
const LinkComp = LinkComponent as React.ComponentType<any>;
|
|
251
|
+
anchorElement = (
|
|
252
|
+
<LinkComp
|
|
253
|
+
{...commonProps}
|
|
254
|
+
ref={ref as React.Ref<HTMLAnchorElement>}
|
|
255
|
+
href={href}
|
|
256
|
+
to={href}
|
|
257
|
+
target={target}
|
|
258
|
+
rel={target === '_blank' ? 'noopener noreferrer' : undefined}
|
|
259
|
+
>
|
|
260
|
+
{cardContent}
|
|
261
|
+
</LinkComp>
|
|
262
|
+
);
|
|
263
|
+
} else {
|
|
264
|
+
anchorElement = (
|
|
265
|
+
<a
|
|
266
|
+
{...commonProps}
|
|
267
|
+
ref={ref as React.Ref<HTMLAnchorElement>}
|
|
268
|
+
href={href}
|
|
269
|
+
target={target}
|
|
270
|
+
rel={target === '_blank' ? 'noopener noreferrer' : undefined}
|
|
271
|
+
>
|
|
272
|
+
{cardContent}
|
|
273
|
+
</a>
|
|
274
|
+
);
|
|
275
|
+
}
|
|
256
276
|
|
|
257
277
|
if (glass) {
|
|
258
278
|
const glassProps = glass === true ? {} : glass;
|
|
@@ -278,8 +278,8 @@ const Chart = memo(
|
|
|
278
278
|
saturation: 180,
|
|
279
279
|
aberrationIntensity: 1.5,
|
|
280
280
|
elasticity: 0, // No elastic effect for charts
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
withLiquidBlur: false, // Keep it simple
|
|
282
|
+
withBorder: true,
|
|
283
283
|
mode: 'standard' as const,
|
|
284
284
|
mouseContainer: chartContainerRef,
|
|
285
285
|
reducedMotion: false,
|
|
@@ -300,8 +300,8 @@ const Chart = memo(
|
|
|
300
300
|
const chartBorderRadius = useMemo(() => {
|
|
301
301
|
// Use chart border-radius design token (typically 12px from $border-radius-lg)
|
|
302
302
|
// AtomixGlass will extract from children if not provided
|
|
303
|
-
return glassProps?.
|
|
304
|
-
}, [glassProps?.
|
|
303
|
+
return glassProps?.borderRadius || undefined;
|
|
304
|
+
}, [glassProps?.borderRadius]);
|
|
305
305
|
|
|
306
306
|
// Create context value
|
|
307
307
|
const chartContextValue = useMemo<ChartContextValue>(
|
|
@@ -404,7 +404,7 @@ const Chart = memo(
|
|
|
404
404
|
const wrappedChart = glassProps ? (
|
|
405
405
|
<AtomixGlass
|
|
406
406
|
{...glassProps}
|
|
407
|
-
|
|
407
|
+
borderRadius={chartBorderRadius}
|
|
408
408
|
style={{
|
|
409
409
|
width: '100%',
|
|
410
410
|
height: '100%',
|
|
@@ -98,21 +98,25 @@ interface TreemapChartProps extends Omit<ChartProps, 'type' | 'datasets'> {
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
const DEFAULT_COLOR_CONFIG: NonNullable<TreemapChartProps['colorConfig']> = { scheme: 'category' };
|
|
102
|
+
const DEFAULT_LABEL_CONFIG = {
|
|
103
|
+
showLabels: true,
|
|
104
|
+
minSize: 1000,
|
|
105
|
+
fontSize: 12,
|
|
106
|
+
textColor: 'white',
|
|
107
|
+
};
|
|
108
|
+
const DEFAULT_CONFIG = {};
|
|
109
|
+
|
|
101
110
|
const TreemapChart = memo(
|
|
102
111
|
forwardRef<HTMLDivElement, TreemapChartProps>(
|
|
103
112
|
(
|
|
104
113
|
{
|
|
105
114
|
data = [],
|
|
106
115
|
algorithm = 'squarified',
|
|
107
|
-
colorConfig =
|
|
108
|
-
labelConfig =
|
|
109
|
-
showLabels: true,
|
|
110
|
-
minSize: 1000,
|
|
111
|
-
fontSize: 12,
|
|
112
|
-
textColor: 'white',
|
|
113
|
-
},
|
|
116
|
+
colorConfig = DEFAULT_COLOR_CONFIG,
|
|
117
|
+
labelConfig = DEFAULT_LABEL_CONFIG,
|
|
114
118
|
onDataPointClick,
|
|
115
|
-
config =
|
|
119
|
+
config = DEFAULT_CONFIG,
|
|
116
120
|
...props
|
|
117
121
|
},
|
|
118
122
|
ref
|
|
@@ -122,9 +126,7 @@ const TreemapChart = memo(
|
|
|
122
126
|
const [tooltipPosition, setTooltipPosition] = useState({ x: 0, y: 0 });
|
|
123
127
|
|
|
124
128
|
const treeData = useMemo(() => {
|
|
125
|
-
console.log('TreemapChart data:', data);
|
|
126
129
|
if (!data.length) {
|
|
127
|
-
console.log('No data provided to TreemapChart');
|
|
128
130
|
return null;
|
|
129
131
|
}
|
|
130
132
|
|
|
@@ -357,16 +359,17 @@ const TreemapChart = memo(
|
|
|
357
359
|
[]
|
|
358
360
|
);
|
|
359
361
|
|
|
360
|
-
const renderContent = (
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
362
|
+
const renderContent = useCallback(
|
|
363
|
+
({
|
|
364
|
+
scales,
|
|
365
|
+
colors,
|
|
366
|
+
datasets: renderedDatasets,
|
|
367
|
+
handlers,
|
|
368
|
+
hoveredPoint,
|
|
369
|
+
}: ChartRenderContentParams) => {
|
|
370
|
+
if (!data.length) return null;
|
|
371
|
+
|
|
372
|
+
// Calculate available space with padding
|
|
370
373
|
const padding = 20;
|
|
371
374
|
const availableWidth = scales.width - padding * 2;
|
|
372
375
|
const availableHeight = scales.height - padding * 2;
|
|
@@ -467,17 +470,22 @@ const TreemapChart = memo(
|
|
|
467
470
|
</g>
|
|
468
471
|
);
|
|
469
472
|
})}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
+
</>
|
|
474
|
+
);
|
|
475
|
+
},
|
|
476
|
+
[data, algorithm, generateColor, squarify, labelConfig, hoveredNode, selectedNode]
|
|
477
|
+
);
|
|
473
478
|
|
|
474
479
|
// Convert data to datasets format for BaseChart
|
|
475
|
-
const datasets =
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
480
|
+
const datasets = useMemo(
|
|
481
|
+
() => [
|
|
482
|
+
{
|
|
483
|
+
label: 'Treemap Data',
|
|
484
|
+
data: data,
|
|
485
|
+
},
|
|
486
|
+
],
|
|
487
|
+
[data]
|
|
488
|
+
);
|
|
481
489
|
|
|
482
490
|
return (
|
|
483
491
|
<BaseChart
|
|
@@ -152,7 +152,7 @@ const CustomGlassExample = () => {
|
|
|
152
152
|
blurAmount: 0,
|
|
153
153
|
saturation: 180,
|
|
154
154
|
aberrationIntensity: 2,
|
|
155
|
-
|
|
155
|
+
borderRadius: 16,
|
|
156
156
|
overLight: false,
|
|
157
157
|
mode: 'polar',
|
|
158
158
|
}}
|
|
@@ -184,7 +184,7 @@ const GlassRangeExample = () => {
|
|
|
184
184
|
blurAmount: 0,
|
|
185
185
|
saturation: 160,
|
|
186
186
|
aberrationIntensity: 1.5,
|
|
187
|
-
|
|
187
|
+
borderRadius: 14,
|
|
188
188
|
mode: 'prominent',
|
|
189
189
|
}}
|
|
190
190
|
/>
|
|
@@ -203,7 +203,7 @@ When `glass` is an object, it accepts the same props as the `AtomixGlass` compon
|
|
|
203
203
|
| `blurAmount` | `number` | `0` | Blur amount for the backdrop |
|
|
204
204
|
| `saturation` | `number` | `160` | Saturation percentage for the backdrop |
|
|
205
205
|
| `aberrationIntensity` | `number` | `1.5` | Chromatic aberration intensity |
|
|
206
|
-
| `
|
|
206
|
+
| `borderRadius` | `number` | `12` | Corner radius in pixels |
|
|
207
207
|
| `overLight` | `boolean` | `false` | Whether the glass is over a light background |
|
|
208
208
|
| `mode` | `'standard' \| 'polar' \| 'prominent' \| 'shader'` | `'standard'` | Glass effect mode |
|
|
209
209
|
|