@shohojdhara/atomix 0.6.4 → 0.6.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/dist/atomix.css +117 -38
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +1 -1
- package/dist/atomix.min.css.map +1 -1
- package/dist/atomix.umd.js +1 -1
- package/dist/atomix.umd.js.map +1 -1
- package/dist/atomix.umd.min.js +1 -1
- package/dist/charts.d.ts +30 -1
- package/dist/charts.js +566 -597
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +30 -1
- package/dist/core.js +600 -624
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +30 -1
- package/dist/forms.js +1122 -1163
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +31 -89
- package/dist/heavy.js +1015 -1045
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +378 -104
- package/dist/index.esm.js +10959 -10837
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10935 -10812
- 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/src/components/Accordion/Accordion.tsx +2 -5
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +14 -16
- package/src/components/AtomixGlass/AtomixGlass.tsx +137 -355
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +32 -249
- package/src/components/AtomixGlass/GlassFilter.tsx +62 -68
- package/src/components/AtomixGlass/README.md +2 -1
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +19 -18
- package/src/components/AtomixGlass/glass-border-styles.test.ts +58 -0
- package/src/components/AtomixGlass/glass-border-styles.ts +136 -0
- package/src/components/AtomixGlass/glass-utils.ts +411 -6
- package/src/components/AtomixGlass/stories/AnimationFeatures.stories.tsx +158 -537
- package/src/components/AtomixGlass/stories/Border.stories.tsx +149 -0
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +229 -89
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +29 -340
- package/src/components/AtomixGlass/stories/argTypes.ts +30 -13
- package/src/components/AtomixGlass/stories/premium-presets.ts +206 -0
- package/src/components/AtomixGlass/stories/shared-components.tsx +52 -8
- package/src/components/Badge/Badge.tsx +4 -4
- package/src/components/Button/Button.tsx +2 -6
- package/src/components/Callout/Callout.test.tsx +4 -3
- package/src/components/Callout/Callout.tsx +2 -5
- package/src/components/Dropdown/Dropdown.tsx +3 -7
- package/src/components/Form/Checkbox.tsx +2 -8
- package/src/components/Form/Input.tsx +2 -9
- package/src/components/Form/Radio.tsx +2 -9
- package/src/components/Form/Select.tsx +2 -7
- package/src/components/Form/Textarea.tsx +2 -9
- package/src/components/Messages/Messages.tsx +2 -8
- package/src/components/Modal/Modal.tsx +4 -5
- package/src/components/Navigation/Nav/Nav.tsx +2 -6
- package/src/components/Navigation/Navbar/Navbar.tsx +2 -9
- package/src/components/Navigation/SideMenu/SideMenu.tsx +2 -6
- package/src/components/Pagination/Pagination.tsx +2 -10
- package/src/components/Popover/Popover.tsx +2 -9
- package/src/components/Progress/Progress.tsx +2 -7
- package/src/components/Rating/Rating.tsx +2 -10
- package/src/components/Spinner/Spinner.tsx +2 -7
- package/src/components/Steps/Steps.tsx +2 -10
- package/src/components/Tabs/Tabs.tsx +2 -9
- package/src/components/Toggle/Toggle.tsx +2 -10
- package/src/components/Tooltip/Tooltip.tsx +2 -5
- package/src/lib/composables/useAtomixGlass.ts +41 -10
- package/src/lib/composables/useAtomixGlassStyles.ts +59 -75
- package/src/lib/composables/usePerformanceMonitor.ts +5 -0
- package/src/lib/constants/components.ts +358 -46
- package/src/lib/types/components.ts +33 -1
- package/src/styles/01-settings/_settings.atomix-glass.scss +66 -28
- package/src/styles/02-tools/_tools.glass.scss +45 -3
- package/src/styles/06-components/_components.atomix-glass.scss +114 -77
- package/src/components/AtomixGlass/deprecated/AtomixGlass.deprecated.tsx +0 -390
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
import { Meta, StoryObj } from '@storybook/react';
|
|
13
13
|
import AtomixGlass from '../AtomixGlass';
|
|
14
14
|
import Button from '../../Button/Button';
|
|
15
|
+
import {
|
|
16
|
+
PLAYGROUND_DEFAULT_SETTINGS,
|
|
17
|
+
PLAYGROUND_PRESETS,
|
|
18
|
+
PREMIUM_GLASS,
|
|
19
|
+
} from './premium-presets';
|
|
20
|
+
import { advancedArgTypes } from './argTypes';
|
|
15
21
|
import { useState, useEffect, useCallback, useRef } from 'react';
|
|
16
22
|
import React from 'react';
|
|
17
23
|
import type { RefObject } from 'react';
|
|
@@ -26,127 +32,16 @@ const meta: Meta<typeof AtomixGlass> = {
|
|
|
26
32
|
title: 'Components/AtomixGlass',
|
|
27
33
|
component: AtomixGlass,
|
|
28
34
|
parameters: {
|
|
29
|
-
layout: '
|
|
35
|
+
layout: 'fullscreen',
|
|
30
36
|
docs: {
|
|
31
37
|
description: {
|
|
32
38
|
component:
|
|
33
|
-
'
|
|
39
|
+
'Premium liquid glass with Apple-tuned defaults: deep backdrop frost (20–40px blur), 180% saturation, subtle displacement, and dark-mode smoky tint. Use the Playground story to explore presets from UI chrome through cinematic shader modes.',
|
|
34
40
|
},
|
|
35
41
|
},
|
|
36
42
|
},
|
|
37
43
|
tags: ['autodocs'],
|
|
38
|
-
argTypes:
|
|
39
|
-
children: {
|
|
40
|
-
control: 'text',
|
|
41
|
-
description: 'Content to display inside the glass effect',
|
|
42
|
-
},
|
|
43
|
-
displacementScale: {
|
|
44
|
-
control: { type: 'range', min: 0, max: 100, step: 1 },
|
|
45
|
-
description: 'Displacement scale for the glass effect (default: 70)',
|
|
46
|
-
table: { defaultValue: { summary: '70' } },
|
|
47
|
-
},
|
|
48
|
-
blurAmount: {
|
|
49
|
-
control: { type: 'range', min: 0, max: 10, step: 0.5 },
|
|
50
|
-
description: 'Blur amount for the backdrop (default: 0.0625)',
|
|
51
|
-
table: { defaultValue: { summary: '0.0625' } },
|
|
52
|
-
},
|
|
53
|
-
saturation: {
|
|
54
|
-
control: { type: 'range', min: 100, max: 300, step: 5 },
|
|
55
|
-
description: 'Saturation percentage for the backdrop (default: 140)',
|
|
56
|
-
table: { defaultValue: { summary: '140' } },
|
|
57
|
-
},
|
|
58
|
-
aberrationIntensity: {
|
|
59
|
-
control: { type: 'range', min: 0, max: 10, step: 0.1 },
|
|
60
|
-
description: 'Chromatic aberration intensity (default: 2)',
|
|
61
|
-
table: { defaultValue: { summary: '2' } },
|
|
62
|
-
},
|
|
63
|
-
elasticity: {
|
|
64
|
-
control: { type: 'range', min: 0, max: 1, step: 0.01 },
|
|
65
|
-
description: 'Elasticity factor for mouse interactions (default: 0.15)',
|
|
66
|
-
table: { defaultValue: { summary: '0.15' } },
|
|
67
|
-
},
|
|
68
|
-
borderRadius: {
|
|
69
|
-
control: { type: 'range', min: 0, max: 50, step: 1 },
|
|
70
|
-
description: 'Corner radius in pixels (default: 20)',
|
|
71
|
-
table: { defaultValue: { summary: '20' } },
|
|
72
|
-
},
|
|
73
|
-
globalMousePosition: {
|
|
74
|
-
control: 'object',
|
|
75
|
-
description: 'External global mouse position { x: number; y: number }',
|
|
76
|
-
},
|
|
77
|
-
mouseOffset: {
|
|
78
|
-
control: 'object',
|
|
79
|
-
description: 'External mouse offset { x: number; y: number }',
|
|
80
|
-
},
|
|
81
|
-
mouseContainer: {
|
|
82
|
-
control: false,
|
|
83
|
-
description: 'React ref object for mouse container element',
|
|
84
|
-
},
|
|
85
|
-
padding: {
|
|
86
|
-
control: 'text',
|
|
87
|
-
description: 'Padding for the glass container (default: "0 0")',
|
|
88
|
-
table: { defaultValue: { summary: '"0 0"' } },
|
|
89
|
-
},
|
|
90
|
-
overLight: {
|
|
91
|
-
control: 'boolean',
|
|
92
|
-
description: 'Whether the glass is over a light background (default: false)',
|
|
93
|
-
table: { defaultValue: { summary: 'false' } },
|
|
94
|
-
},
|
|
95
|
-
mode: {
|
|
96
|
-
control: 'select',
|
|
97
|
-
options: ['standard', 'polar', 'prominent', 'shader'],
|
|
98
|
-
description: 'Glass effect mode (default: "standard")',
|
|
99
|
-
table: { defaultValue: { summary: '"standard"' } },
|
|
100
|
-
},
|
|
101
|
-
onClick: {
|
|
102
|
-
action: 'clicked',
|
|
103
|
-
description: 'Click event handler',
|
|
104
|
-
},
|
|
105
|
-
className: {
|
|
106
|
-
control: 'text',
|
|
107
|
-
description: 'Additional CSS class names',
|
|
108
|
-
},
|
|
109
|
-
style: {
|
|
110
|
-
control: 'object',
|
|
111
|
-
description: 'CSS style object',
|
|
112
|
-
},
|
|
113
|
-
'aria-label': {
|
|
114
|
-
control: 'text',
|
|
115
|
-
description: 'ARIA label for accessibility',
|
|
116
|
-
},
|
|
117
|
-
'aria-describedby': {
|
|
118
|
-
control: 'text',
|
|
119
|
-
description: 'ARIA describedby attribute for accessibility',
|
|
120
|
-
},
|
|
121
|
-
role: {
|
|
122
|
-
control: 'text',
|
|
123
|
-
description: 'ARIA role attribute',
|
|
124
|
-
},
|
|
125
|
-
tabIndex: {
|
|
126
|
-
control: 'number',
|
|
127
|
-
description: 'Tab index for keyboard navigation',
|
|
128
|
-
},
|
|
129
|
-
reducedMotion: {
|
|
130
|
-
control: 'boolean',
|
|
131
|
-
description: 'Override for reduced motion preference (default: false)',
|
|
132
|
-
table: { defaultValue: { summary: 'false' } },
|
|
133
|
-
},
|
|
134
|
-
highContrast: {
|
|
135
|
-
control: 'boolean',
|
|
136
|
-
description: 'Override for high contrast preference (default: false)',
|
|
137
|
-
table: { defaultValue: { summary: 'false' } },
|
|
138
|
-
},
|
|
139
|
-
withoutEffects: {
|
|
140
|
-
control: 'boolean',
|
|
141
|
-
description: 'Disable all visual effects (default: false)',
|
|
142
|
-
table: { defaultValue: { summary: 'false' } },
|
|
143
|
-
},
|
|
144
|
-
debugPerformance: {
|
|
145
|
-
control: 'boolean',
|
|
146
|
-
description: 'Enable performance monitoring (default: false)',
|
|
147
|
-
table: { defaultValue: { summary: 'false' } },
|
|
148
|
-
},
|
|
149
|
-
},
|
|
44
|
+
argTypes: advancedArgTypes,
|
|
150
45
|
};
|
|
151
46
|
|
|
152
47
|
export default meta;
|
|
@@ -313,31 +208,7 @@ export const Playground: Story = {
|
|
|
313
208
|
disableResponsiveBreakpoints: boolean;
|
|
314
209
|
debugPerformance: boolean;
|
|
315
210
|
debugOverLight: boolean;
|
|
316
|
-
}>({
|
|
317
|
-
displacementScale: 40,
|
|
318
|
-
blurAmount: 1,
|
|
319
|
-
saturation: 140,
|
|
320
|
-
aberrationIntensity: 2,
|
|
321
|
-
elasticity: 0.15,
|
|
322
|
-
borderRadius: 20,
|
|
323
|
-
overLight: false,
|
|
324
|
-
reducedMotion: false,
|
|
325
|
-
highContrast: false,
|
|
326
|
-
withoutEffects: false,
|
|
327
|
-
withLiquidBlur: false,
|
|
328
|
-
withBorder: true,
|
|
329
|
-
withTimeAnimation: true,
|
|
330
|
-
animationSpeed: 1.0,
|
|
331
|
-
withMultiLayerDistortion: false,
|
|
332
|
-
distortionOctaves: 3,
|
|
333
|
-
distortionLacunarity: 2.0,
|
|
334
|
-
distortionGain: 0.5,
|
|
335
|
-
distortionQuality: 'medium',
|
|
336
|
-
devicePreset: 'balanced',
|
|
337
|
-
disableResponsiveBreakpoints: false,
|
|
338
|
-
debugPerformance: false,
|
|
339
|
-
debugOverLight: false,
|
|
340
|
-
});
|
|
211
|
+
}>({ ...PLAYGROUND_DEFAULT_SETTINGS });
|
|
341
212
|
|
|
342
213
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
343
214
|
const [backgroundIndex, setBackgroundIndex] = useState(0);
|
|
@@ -366,163 +237,7 @@ export const Playground: Story = {
|
|
|
366
237
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
367
238
|
const backgroundsArrayRef = useRef<typeof backgrounds | null>(null);
|
|
368
239
|
|
|
369
|
-
const presets =
|
|
370
|
-
minimal: {
|
|
371
|
-
name: 'Minimal',
|
|
372
|
-
icon: '🌿',
|
|
373
|
-
settings: {
|
|
374
|
-
displacementScale: 40,
|
|
375
|
-
blurAmount: 0.5,
|
|
376
|
-
saturation: 110,
|
|
377
|
-
aberrationIntensity: 0.5,
|
|
378
|
-
elasticity: 0.05,
|
|
379
|
-
borderRadius: 12,
|
|
380
|
-
overLight: false,
|
|
381
|
-
reducedMotion: false,
|
|
382
|
-
highContrast: false,
|
|
383
|
-
withoutEffects: false,
|
|
384
|
-
withLiquidBlur: false,
|
|
385
|
-
withBorder: true,
|
|
386
|
-
withTimeAnimation: false,
|
|
387
|
-
animationSpeed: 1.0,
|
|
388
|
-
withMultiLayerDistortion: false,
|
|
389
|
-
distortionOctaves: 3,
|
|
390
|
-
distortionLacunarity: 2.0,
|
|
391
|
-
distortionGain: 0.5,
|
|
392
|
-
distortionQuality: 'medium' as const,
|
|
393
|
-
devicePreset: 'balanced' as const,
|
|
394
|
-
disableResponsiveBreakpoints: false,
|
|
395
|
-
debugPerformance: false,
|
|
396
|
-
debugOverLight: false,
|
|
397
|
-
},
|
|
398
|
-
mode: 'standard' as const,
|
|
399
|
-
shader: 'liquidGlass' as const,
|
|
400
|
-
},
|
|
401
|
-
standard: {
|
|
402
|
-
name: 'Standard',
|
|
403
|
-
icon: '⚖️',
|
|
404
|
-
settings: {
|
|
405
|
-
displacementScale: 80,
|
|
406
|
-
blurAmount: 1,
|
|
407
|
-
saturation: 140,
|
|
408
|
-
aberrationIntensity: 2,
|
|
409
|
-
elasticity: 0.15,
|
|
410
|
-
borderRadius: 20,
|
|
411
|
-
overLight: false,
|
|
412
|
-
reducedMotion: false,
|
|
413
|
-
highContrast: false,
|
|
414
|
-
withoutEffects: false,
|
|
415
|
-
withLiquidBlur: false,
|
|
416
|
-
withBorder: true,
|
|
417
|
-
withTimeAnimation: true,
|
|
418
|
-
animationSpeed: 1.0,
|
|
419
|
-
withMultiLayerDistortion: false,
|
|
420
|
-
distortionOctaves: 3,
|
|
421
|
-
distortionLacunarity: 2.0,
|
|
422
|
-
distortionGain: 0.5,
|
|
423
|
-
distortionQuality: 'medium' as const,
|
|
424
|
-
devicePreset: 'balanced' as const,
|
|
425
|
-
disableResponsiveBreakpoints: false,
|
|
426
|
-
debugPerformance: false,
|
|
427
|
-
debugOverLight: false,
|
|
428
|
-
},
|
|
429
|
-
mode: 'standard' as const,
|
|
430
|
-
shader: 'liquidGlass' as const,
|
|
431
|
-
},
|
|
432
|
-
liquid: {
|
|
433
|
-
name: 'Liquid Glass',
|
|
434
|
-
icon: '💧',
|
|
435
|
-
settings: {
|
|
436
|
-
displacementScale: 150,
|
|
437
|
-
blurAmount: 2.5,
|
|
438
|
-
saturation: 180,
|
|
439
|
-
aberrationIntensity: 4.0,
|
|
440
|
-
elasticity: 0.35,
|
|
441
|
-
borderRadius: 40,
|
|
442
|
-
overLight: false,
|
|
443
|
-
reducedMotion: false,
|
|
444
|
-
highContrast: false,
|
|
445
|
-
withoutEffects: false,
|
|
446
|
-
withLiquidBlur: true,
|
|
447
|
-
withBorder: true,
|
|
448
|
-
withTimeAnimation: true,
|
|
449
|
-
animationSpeed: 1.2,
|
|
450
|
-
withMultiLayerDistortion: true,
|
|
451
|
-
distortionOctaves: 4,
|
|
452
|
-
distortionLacunarity: 2.2,
|
|
453
|
-
distortionGain: 0.55,
|
|
454
|
-
distortionQuality: 'high' as const,
|
|
455
|
-
devicePreset: 'quality' as const,
|
|
456
|
-
disableResponsiveBreakpoints: false,
|
|
457
|
-
debugPerformance: false,
|
|
458
|
-
debugOverLight: false,
|
|
459
|
-
},
|
|
460
|
-
mode: 'prominent' as const,
|
|
461
|
-
shader: 'appleFluid' as const,
|
|
462
|
-
},
|
|
463
|
-
premium: {
|
|
464
|
-
name: 'Premium',
|
|
465
|
-
icon: '💎',
|
|
466
|
-
settings: {
|
|
467
|
-
displacementScale: 180,
|
|
468
|
-
blurAmount: 1.5,
|
|
469
|
-
saturation: 170,
|
|
470
|
-
aberrationIntensity: 3.5,
|
|
471
|
-
elasticity: 0.25,
|
|
472
|
-
borderRadius: 28,
|
|
473
|
-
overLight: false,
|
|
474
|
-
reducedMotion: false,
|
|
475
|
-
highContrast: false,
|
|
476
|
-
withoutEffects: false,
|
|
477
|
-
withLiquidBlur: true,
|
|
478
|
-
withBorder: true,
|
|
479
|
-
withTimeAnimation: true,
|
|
480
|
-
animationSpeed: 1.2,
|
|
481
|
-
withMultiLayerDistortion: true,
|
|
482
|
-
distortionOctaves: 5,
|
|
483
|
-
distortionLacunarity: 2.5,
|
|
484
|
-
distortionGain: 0.6,
|
|
485
|
-
distortionQuality: 'high' as const,
|
|
486
|
-
devicePreset: 'quality' as const,
|
|
487
|
-
disableResponsiveBreakpoints: false,
|
|
488
|
-
debugPerformance: false,
|
|
489
|
-
debugOverLight: false,
|
|
490
|
-
},
|
|
491
|
-
mode: 'prominent' as const,
|
|
492
|
-
shader: 'plasma' as const,
|
|
493
|
-
},
|
|
494
|
-
dramatic: {
|
|
495
|
-
name: 'Dramatic',
|
|
496
|
-
icon: '🎭',
|
|
497
|
-
settings: {
|
|
498
|
-
displacementScale: 200,
|
|
499
|
-
blurAmount: 1,
|
|
500
|
-
saturation: 200,
|
|
501
|
-
aberrationIntensity: 5,
|
|
502
|
-
elasticity: 0.35,
|
|
503
|
-
borderRadius: 32,
|
|
504
|
-
overLight: false,
|
|
505
|
-
reducedMotion: false,
|
|
506
|
-
highContrast: false,
|
|
507
|
-
withoutEffects: false,
|
|
508
|
-
withLiquidBlur: true,
|
|
509
|
-
withBorder: true,
|
|
510
|
-
withTimeAnimation: true,
|
|
511
|
-
animationSpeed: 1.5,
|
|
512
|
-
withMultiLayerDistortion: true,
|
|
513
|
-
distortionOctaves: 6,
|
|
514
|
-
distortionLacunarity: 3.0,
|
|
515
|
-
distortionGain: 0.7,
|
|
516
|
-
distortionQuality: 'ultra' as const,
|
|
517
|
-
devicePreset: 'quality' as const,
|
|
518
|
-
disableResponsiveBreakpoints: false,
|
|
519
|
-
debugPerformance: false,
|
|
520
|
-
debugOverLight: false,
|
|
521
|
-
},
|
|
522
|
-
mode: 'shader' as const,
|
|
523
|
-
shader: 'waves' as const,
|
|
524
|
-
},
|
|
525
|
-
};
|
|
240
|
+
const presets = PLAYGROUND_PRESETS;
|
|
526
241
|
|
|
527
242
|
const applyPreset = (presetKey: keyof typeof presets) => {
|
|
528
243
|
const preset = presets[presetKey];
|
|
@@ -625,10 +340,12 @@ export const Playground: Story = {
|
|
|
625
340
|
Math.min(
|
|
626
341
|
100,
|
|
627
342
|
100 -
|
|
628
|
-
settings.displacementScale * 0.
|
|
629
|
-
Math.abs(settings.blurAmount) *
|
|
630
|
-
settings.aberrationIntensity *
|
|
631
|
-
settings.elasticity *
|
|
343
|
+
settings.displacementScale * 0.35 -
|
|
344
|
+
Math.abs(settings.blurAmount) * 0.85 -
|
|
345
|
+
settings.aberrationIntensity * 8 -
|
|
346
|
+
settings.elasticity * 35 -
|
|
347
|
+
(settings.withMultiLayerDistortion ? 12 : 0) -
|
|
348
|
+
(settings.withTimeAnimation ? 6 : 0)
|
|
632
349
|
)
|
|
633
350
|
);
|
|
634
351
|
|
|
@@ -806,7 +523,7 @@ export const Playground: Story = {
|
|
|
806
523
|
>
|
|
807
524
|
{/* Control Panel Sidebar */}
|
|
808
525
|
<div className="u-h-100 u-relative">
|
|
809
|
-
<AtomixGlass
|
|
526
|
+
<AtomixGlass {...PREMIUM_GLASS.chrome} borderRadius={20}>
|
|
810
527
|
<div
|
|
811
528
|
className="u-h-100 u-p-3 custom-scrollbar"
|
|
812
529
|
style={{
|
|
@@ -920,7 +637,7 @@ export const Playground: Story = {
|
|
|
920
637
|
</label>
|
|
921
638
|
<div
|
|
922
639
|
className="u-grid u-gap-2"
|
|
923
|
-
style={{ gridTemplateColumns: 'repeat(
|
|
640
|
+
style={{ gridTemplateColumns: 'repeat(auto-fit, minmax(72px, 1fr))' }}
|
|
924
641
|
>
|
|
925
642
|
{Object.entries(presets).map(([key, preset]) => (
|
|
926
643
|
<button
|
|
@@ -1029,10 +746,14 @@ export const Playground: Story = {
|
|
|
1029
746
|
: key === 'aberrationIntensity'
|
|
1030
747
|
? 10
|
|
1031
748
|
: key === 'blurAmount'
|
|
1032
|
-
?
|
|
749
|
+
? 50
|
|
1033
750
|
: 1;
|
|
1034
751
|
const step =
|
|
1035
|
-
key === 'aberrationIntensity'
|
|
752
|
+
key === 'aberrationIntensity'
|
|
753
|
+
? 0.05
|
|
754
|
+
: key === 'blurAmount'
|
|
755
|
+
? 1
|
|
756
|
+
: 1;
|
|
1036
757
|
const label = key
|
|
1037
758
|
.replace(/([A-Z])/g, ' $1')
|
|
1038
759
|
.replace(/^./, s => s.toUpperCase());
|
|
@@ -1052,9 +773,8 @@ export const Playground: Story = {
|
|
|
1052
773
|
textAlign: 'center',
|
|
1053
774
|
}}
|
|
1054
775
|
>
|
|
1055
|
-
{(value as number).toFixed(
|
|
1056
|
-
|
|
1057
|
-
)}
|
|
776
|
+
{(value as number).toFixed(key === 'aberrationIntensity' ? 2 : 0)}
|
|
777
|
+
{key === 'blurAmount' ? 'px' : ''}
|
|
1058
778
|
</span>
|
|
1059
779
|
</div>
|
|
1060
780
|
<div className="u-relative" style={{ height: '20px' }}>
|
|
@@ -2125,33 +1845,7 @@ export const Playground: Story = {
|
|
|
2125
1845
|
variant="ghost"
|
|
2126
1846
|
size="sm"
|
|
2127
1847
|
onClick={() => {
|
|
2128
|
-
|
|
2129
|
-
displacementScale: 120,
|
|
2130
|
-
blurAmount: 0,
|
|
2131
|
-
saturation: 140,
|
|
2132
|
-
aberrationIntensity: 2,
|
|
2133
|
-
elasticity: 0.15,
|
|
2134
|
-
borderRadius: 20,
|
|
2135
|
-
overLight: false,
|
|
2136
|
-
reducedMotion: false,
|
|
2137
|
-
highContrast: false,
|
|
2138
|
-
withoutEffects: false,
|
|
2139
|
-
withLiquidBlur: false,
|
|
2140
|
-
withBorder: true,
|
|
2141
|
-
withTimeAnimation: true,
|
|
2142
|
-
animationSpeed: 1.0,
|
|
2143
|
-
withMultiLayerDistortion: false,
|
|
2144
|
-
distortionOctaves: 3,
|
|
2145
|
-
distortionLacunarity: 2.0,
|
|
2146
|
-
distortionGain: 0.5,
|
|
2147
|
-
distortionQuality: 'medium',
|
|
2148
|
-
devicePreset: 'balanced',
|
|
2149
|
-
disableResponsiveBreakpoints: false,
|
|
2150
|
-
debugPerformance: false,
|
|
2151
|
-
debugOverLight: false,
|
|
2152
|
-
});
|
|
2153
|
-
setSelectedMode('standard');
|
|
2154
|
-
setSelectedShader('liquidGlass');
|
|
1848
|
+
applyPreset('apple');
|
|
2155
1849
|
}}
|
|
2156
1850
|
className="u-w-100"
|
|
2157
1851
|
>
|
|
@@ -2166,12 +1860,7 @@ export const Playground: Story = {
|
|
|
2166
1860
|
<div className="u-w-100 u-h-100 u-flex u-items-center u-justify-center u-p-2 u-p-lg-4">
|
|
2167
1861
|
{showCode ? (
|
|
2168
1862
|
<div className="u-w-100 u-h-100 u-flex u-items-center">
|
|
2169
|
-
<AtomixGlass
|
|
2170
|
-
displacementScale={80}
|
|
2171
|
-
aberrationIntensity={1}
|
|
2172
|
-
borderRadius={20}
|
|
2173
|
-
saturation={120}
|
|
2174
|
-
>
|
|
1863
|
+
<AtomixGlass {...PREMIUM_GLASS.card} borderRadius={20}>
|
|
2175
1864
|
<div className="u-p-6">
|
|
2176
1865
|
<div className="u-flex u-justify-between u-items-center u-mb-6">
|
|
2177
1866
|
<div>
|
|
@@ -27,50 +27,67 @@ export const baseArgTypes = {
|
|
|
27
27
|
// Visual category
|
|
28
28
|
displacementScale: {
|
|
29
29
|
control: { type: 'range', min: 0, max: 100, step: 1 },
|
|
30
|
-
description: 'Displacement scale
|
|
30
|
+
description: 'Displacement scale — Apple chrome ~24, hero ~48 (default: 28)',
|
|
31
31
|
table: {
|
|
32
32
|
category: 'Visual' as ArgTypeCategory,
|
|
33
|
-
defaultValue: { summary: '
|
|
33
|
+
defaultValue: { summary: '28' },
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
blurAmount: {
|
|
37
|
-
control: { type: 'range', min: 0, max:
|
|
38
|
-
description: '
|
|
37
|
+
control: { type: 'range', min: 0, max: 50, step: 1 },
|
|
38
|
+
description: 'Backdrop blur in pixels — Apple frost ~20–40 (default: 20)',
|
|
39
39
|
table: {
|
|
40
40
|
category: 'Visual' as ArgTypeCategory,
|
|
41
|
-
defaultValue: { summary: '
|
|
41
|
+
defaultValue: { summary: '20' },
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
saturation: {
|
|
45
45
|
control: { type: 'range', min: 100, max: 300, step: 5 },
|
|
46
|
-
description: '
|
|
46
|
+
description: 'Backdrop saturation % (default: 180 — Apple recipe)',
|
|
47
47
|
table: {
|
|
48
48
|
category: 'Visual' as ArgTypeCategory,
|
|
49
|
-
defaultValue: { summary: '
|
|
49
|
+
defaultValue: { summary: '180' },
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
52
|
aberrationIntensity: {
|
|
53
53
|
control: { type: 'range', min: 0, max: 10, step: 0.1 },
|
|
54
|
-
description: 'Chromatic aberration intensity (default:
|
|
54
|
+
description: 'Chromatic aberration intensity (default: ~0.56)',
|
|
55
55
|
table: {
|
|
56
56
|
category: 'Visual' as ArgTypeCategory,
|
|
57
|
-
defaultValue: { summary: '
|
|
57
|
+
defaultValue: { summary: '0.56' },
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
elasticity: {
|
|
61
61
|
control: { type: 'range', min: 0, max: 1, step: 0.01 },
|
|
62
|
-
description: 'Elasticity
|
|
62
|
+
description: 'Elasticity for mouse tracking (default: 0.05)',
|
|
63
63
|
table: {
|
|
64
64
|
category: 'Visual' as ArgTypeCategory,
|
|
65
|
-
defaultValue: { summary: '0.
|
|
65
|
+
defaultValue: { summary: '0.05' },
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
68
|
borderRadius: {
|
|
69
69
|
control: { type: 'range', min: 0, max: 50, step: 1 },
|
|
70
|
-
description: 'Corner radius in pixels (default:
|
|
70
|
+
description: 'Corner radius in pixels (default: 16)',
|
|
71
71
|
table: {
|
|
72
72
|
category: 'Visual' as ArgTypeCategory,
|
|
73
|
-
defaultValue: { summary: '
|
|
73
|
+
defaultValue: { summary: '16' },
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
border: {
|
|
77
|
+
control: { type: 'boolean' },
|
|
78
|
+
description:
|
|
79
|
+
'Liquid glass rim (0.5px hairline). Use structured config in code: border={{ width, opacity, animated }}',
|
|
80
|
+
table: {
|
|
81
|
+
category: 'Visual' as ArgTypeCategory,
|
|
82
|
+
defaultValue: { summary: 'true' },
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
withBorder: {
|
|
86
|
+
control: { type: 'boolean' },
|
|
87
|
+
description: '@deprecated Use `border` instead',
|
|
88
|
+
table: {
|
|
89
|
+
category: 'Visual' as ArgTypeCategory,
|
|
90
|
+
defaultValue: { summary: 'true' },
|
|
74
91
|
},
|
|
75
92
|
},
|
|
76
93
|
overLight: {
|