@shohojdhara/atomix 0.6.4 → 0.6.6

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 (83) hide show
  1. package/dist/atomix.css +117 -38
  2. package/dist/atomix.css.map +1 -1
  3. package/dist/atomix.min.css +1 -1
  4. package/dist/atomix.min.css.map +1 -1
  5. package/dist/atomix.umd.js +1 -1
  6. package/dist/atomix.umd.js.map +1 -1
  7. package/dist/atomix.umd.min.js +1 -1
  8. package/dist/charts.d.ts +30 -1
  9. package/dist/charts.js +625 -846
  10. package/dist/charts.js.map +1 -1
  11. package/dist/core.d.ts +30 -1
  12. package/dist/core.js +659 -873
  13. package/dist/core.js.map +1 -1
  14. package/dist/forms.d.ts +30 -1
  15. package/dist/forms.js +1171 -1402
  16. package/dist/forms.js.map +1 -1
  17. package/dist/heavy.d.ts +31 -89
  18. package/dist/heavy.js +975 -1195
  19. package/dist/heavy.js.map +1 -1
  20. package/dist/index.d.ts +383 -140
  21. package/dist/index.esm.js +1567 -1679
  22. package/dist/index.esm.js.map +1 -1
  23. package/dist/index.js +1556 -1667
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.min.js +1 -1
  26. package/dist/index.min.js.map +1 -1
  27. package/package.json +1 -1
  28. package/src/components/Accordion/Accordion.tsx +2 -5
  29. package/src/components/AtomixGlass/AtomixGlass.test.tsx +14 -16
  30. package/src/components/AtomixGlass/AtomixGlass.tsx +137 -364
  31. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +32 -251
  32. package/src/components/AtomixGlass/GlassFilter.tsx +62 -68
  33. package/src/components/AtomixGlass/README.md +2 -1
  34. package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +19 -18
  35. package/src/components/AtomixGlass/glass-border-styles.test.ts +58 -0
  36. package/src/components/AtomixGlass/glass-border-styles.ts +136 -0
  37. package/src/components/AtomixGlass/glass-utils.ts +456 -22
  38. package/src/components/AtomixGlass/shader-utils.ts +19 -77
  39. package/src/components/AtomixGlass/stories/AnimationFeatures.stories.tsx +158 -537
  40. package/src/components/AtomixGlass/stories/Border.stories.tsx +149 -0
  41. package/src/components/AtomixGlass/stories/Examples.stories.tsx +229 -89
  42. package/src/components/AtomixGlass/stories/Playground.stories.tsx +29 -340
  43. package/src/components/AtomixGlass/stories/argTypes.ts +30 -13
  44. package/src/components/AtomixGlass/stories/premium-presets.ts +206 -0
  45. package/src/components/AtomixGlass/stories/shared-components.tsx +52 -8
  46. package/src/components/Badge/Badge.tsx +4 -4
  47. package/src/components/Button/Button.tsx +2 -6
  48. package/src/components/Callout/Callout.test.tsx +4 -3
  49. package/src/components/Callout/Callout.tsx +2 -5
  50. package/src/components/Dropdown/Dropdown.tsx +3 -7
  51. package/src/components/Form/Checkbox.tsx +2 -8
  52. package/src/components/Form/Input.tsx +2 -9
  53. package/src/components/Form/Radio.tsx +2 -9
  54. package/src/components/Form/Select.test.tsx +6 -6
  55. package/src/components/Form/Select.tsx +2 -7
  56. package/src/components/Form/Textarea.stories.tsx +5 -5
  57. package/src/components/Form/Textarea.tsx +2 -9
  58. package/src/components/Messages/Messages.tsx +2 -8
  59. package/src/components/Modal/Modal.tsx +4 -5
  60. package/src/components/Navigation/Nav/Nav.tsx +2 -6
  61. package/src/components/Navigation/Navbar/Navbar.tsx +2 -9
  62. package/src/components/Navigation/SideMenu/SideMenu.tsx +2 -6
  63. package/src/components/Pagination/Pagination.tsx +2 -10
  64. package/src/components/Popover/Popover.tsx +2 -9
  65. package/src/components/Progress/Progress.tsx +2 -7
  66. package/src/components/Rating/Rating.tsx +2 -10
  67. package/src/components/Spinner/Spinner.tsx +2 -7
  68. package/src/components/Steps/Steps.tsx +2 -10
  69. package/src/components/Tabs/Tabs.tsx +2 -9
  70. package/src/components/Toggle/Toggle.tsx +2 -10
  71. package/src/components/Tooltip/Tooltip.tsx +2 -5
  72. package/src/lib/composables/useAtomixGlass.ts +42 -143
  73. package/src/lib/composables/useAtomixGlassStyles.ts +61 -77
  74. package/src/lib/composables/usePerformanceMonitor.ts +5 -66
  75. package/src/lib/constants/components.ts +363 -46
  76. package/src/lib/types/components.ts +33 -1
  77. package/src/styles/01-settings/_settings.atomix-glass.scss +66 -28
  78. package/src/styles/02-tools/_tools.button.scss +51 -42
  79. package/src/styles/02-tools/_tools.glass.scss +45 -3
  80. package/src/styles/06-components/_components.atomix-glass.scss +116 -79
  81. package/src/components/AtomixGlass/PerformanceDashboard.tsx +0 -171
  82. package/src/components/AtomixGlass/animation-system.ts +0 -578
  83. package/src/components/AtomixGlass/deprecated/AtomixGlass.deprecated.tsx +0 -390
@@ -1,127 +1,96 @@
1
1
  /**
2
- * Phase 1 Animation Features Stories
3
- *
4
- * Demonstrates the new time-based animation system and multi-layer distortion effects
5
- * implemented in Phase 1 of the AtomixGlass Feature Implementation roadMap.
6
- *
7
- * Features:
8
- * - Feature 1.1: Time-Based Animation System
9
- * - Feature 1.2: Multi-Layer Distortion System (FBM)
10
- *
11
- * @see IMPLEMENTATION_PLAN.md for detailed specifications
2
+ * Phase 1 Animation Features — premium Storybook previews
3
+ *
4
+ * Time-based animation and FBM distortion with Apple-tuned glass defaults.
12
5
  */
13
6
 
7
+ import React from 'react';
14
8
  import type { Meta, StoryObj } from '@storybook/react';
15
9
  import { AtomixGlass } from '../AtomixGlass';
16
- import { BackgroundWrapper, backgroundImages } from './shared-components';
10
+ import { PremiumScene } from './shared-components';
11
+ import { PREMIUM_GLASS, premiumTypography } from './premium-presets';
12
+
13
+ const premiumPanel = (icon: string, title: string, subtitle: string) => (
14
+ <div
15
+ className="u-text-center u-text-white"
16
+ style={{
17
+ padding: '56px 44px',
18
+ fontFamily: premiumTypography.fontFamily,
19
+ minWidth: '280px',
20
+ }}
21
+ >
22
+ <div
23
+ style={{
24
+ fontSize: '52px',
25
+ marginBottom: '20px',
26
+ filter: 'drop-shadow(0 6px 16px rgba(0,0,0,0.35))',
27
+ }}
28
+ >
29
+ {icon}
30
+ </div>
31
+ <h2
32
+ style={{
33
+ margin: '0 0 10px',
34
+ fontSize: '28px',
35
+ fontWeight: 700,
36
+ background: premiumTypography.titleGradient,
37
+ WebkitBackgroundClip: 'text',
38
+ WebkitTextFillColor: 'transparent',
39
+ }}
40
+ >
41
+ {title}
42
+ </h2>
43
+ <p style={{ margin: 0, fontSize: '15px', color: premiumTypography.muted, lineHeight: 1.5 }}>
44
+ {subtitle}
45
+ </p>
46
+ </div>
47
+ );
48
+
49
+ const premiumDecorator = (photoIndex = 0) => [
50
+ (Story: () => React.ReactNode) => (
51
+ <PremiumScene photoIndex={photoIndex} height="100vh">
52
+ <Story />
53
+ </PremiumScene>
54
+ ),
55
+ ];
17
56
 
18
57
  const meta = {
19
58
  title: 'Components/AtomixGlass/Features/Animation Features',
20
59
  component: AtomixGlass,
21
60
  parameters: {
22
- layout: 'centered',
61
+ layout: 'fullscreen',
23
62
  docs: {
24
63
  description: {
25
64
  component: `
26
- ## Phase 1 Animation Features
27
-
28
- This story showcases the newly implemented Phase 1 features for AtomixGlass:
29
-
30
- ### Feature 1.1: Time-Based Animation System
31
- Continuous time-driven animations for organic, flowing glass effects that evolve over time without user interaction.
32
-
33
- **Key Capabilities:**
34
- - Breathing Effect: Subtle scale/opacity pulsing (0.5-2 second cycles)
35
- - Flow Animation: Continuous liquid movement
36
- - Wave Propagation: Radial waves emanating from center
37
- - Configurable animation speed (0.5x - 5.0x)
38
-
39
- ### Feature 1.2: Multi-Layer Distortion System
40
- Fractal Brownian Motion (FBM) noise with multiple octaves creating complex, layered distortion effects.
41
-
42
- **Quality Presets:**
43
- - Low: 2 octaves (mobile optimized)
44
- - Medium: 4 octaves (tablet)
45
- - High: 5 octaves (desktop default)
46
- - Ultra: 7 octaves (high-end devices)
65
+ Premium animation demos for AtomixGlass — shader flow, FBM layers, and time-based motion
66
+ using production glass tuning (deep blur, 180% saturation, restrained displacement).
47
67
 
48
- **Performance Note:** These features are GPU-accelerated and automatically respect \`prefers-reduced-motion\` preferences.
68
+ Respects \`prefers-reduced-motion\` when \`reducedMotion\` is set.
49
69
  `,
50
70
  },
51
71
  },
52
72
  },
53
73
  tags: ['autodocs'],
54
74
  argTypes: {
55
- // Phase 1 Animation Controls
56
75
  withTimeAnimation: {
57
76
  control: 'boolean',
58
- description: 'Enable continuous time-based animations',
59
- table: {
60
- category: 'Phase 1 - Animation',
61
- defaultValue: { summary: 'true' },
62
- },
77
+ table: { category: 'Animation', defaultValue: { summary: 'true' } },
63
78
  },
64
79
  animationSpeed: {
65
- control: { type: 'range', min: 0.1, max: 5.0, step: 0.1 },
66
- description: 'Animation speed multiplier',
67
- table: {
68
- category: 'Phase 1 - Animation',
69
- defaultValue: { summary: '1.0' },
70
- },
80
+ control: { type: 'range', min: 0.1, max: 5, step: 0.1 },
81
+ table: { category: 'Animation', defaultValue: { summary: '1.0' } },
71
82
  },
72
83
  withMultiLayerDistortion: {
73
84
  control: 'boolean',
74
- description: 'Enable multi-layer FBM distortion',
75
- table: {
76
- category: 'Phase 1 - Animation',
77
- defaultValue: { summary: 'false' },
78
- },
79
- },
80
- distortionOctaves: {
81
- control: { type: 'range', min: 1, max: 8, step: 1 },
82
- description: 'Number of noise octaves for FBM',
83
- table: {
84
- category: 'Phase 1 - Animation',
85
- defaultValue: { summary: '5' },
86
- },
87
- },
88
- distortionLacunarity: {
89
- control: { type: 'range', min: 1.0, max: 4.0, step: 0.1 },
90
- description: 'Frequency multiplier per octave',
91
- table: {
92
- category: 'Phase 1 - Animation',
93
- defaultValue: { summary: '2.0' },
94
- },
95
- },
96
- distortionGain: {
97
- control: { type: 'range', min: 0.1, max: 1.0, step: 0.05 },
98
- description: 'Amplitude multiplier per octave',
99
- table: {
100
- category: 'Phase 1 - Animation',
101
- defaultValue: { summary: '0.5' },
102
- },
85
+ table: { category: 'Animation', defaultValue: { summary: 'true' } },
103
86
  },
104
87
  distortionQuality: {
105
- control: {
106
- type: 'select',
107
- options: ['low', 'medium', 'high', 'ultra'],
108
- },
109
- description: 'Quality preset for distortion effects',
110
- table: {
111
- category: 'Phase 1 - Animation',
112
- defaultValue: { summary: 'high' },
113
- },
88
+ control: { type: 'select', options: ['low', 'medium', 'high', 'ultra'] },
89
+ table: { category: 'Animation', defaultValue: { summary: 'high' } },
114
90
  },
115
91
  mode: {
116
- control: {
117
- type: 'select',
118
- options: ['standard', 'polar', 'prominent', 'shader'],
119
- },
120
- description: 'Glass effect mode (shader mode recommended for animations)',
121
- table: {
122
- category: 'Visual',
123
- defaultValue: { summary: 'standard' },
124
- },
92
+ control: { type: 'select', options: ['standard', 'polar', 'prominent', 'shader'] },
93
+ table: { category: 'Visual', defaultValue: { summary: 'shader' } },
125
94
  },
126
95
  },
127
96
  } satisfies Meta<typeof AtomixGlass>;
@@ -129,531 +98,183 @@ Fractal Brownian Motion (FBM) noise with multiple octaves creating complex, laye
129
98
  export default meta;
130
99
  type Story = StoryObj<typeof meta>;
131
100
 
132
- /**
133
- * Default Animation Demo
134
- *
135
- * Showcases the default time-based animation settings with shader mode.
136
- * Notice the organic, flowing liquid effect that runs continuously.
137
- */
101
+ const liquidArgs = {
102
+ ...PREMIUM_GLASS.liquid,
103
+ elasticity: 0,
104
+ } as const;
105
+
138
106
  export const DefaultAnimation: Story = {
139
107
  args: {
140
- children: (
141
- <div className="u-text-center u-text-white" style={{ padding: '60px 40px' }}>
142
- <div
143
- className="u-mb-6"
144
- style={{
145
- fontSize: '64px',
146
- marginBottom: '24px',
147
- filter: 'drop-shadow(0 4px 8px rgba(0,0,0,0.3))',
148
- }}
149
- >
150
-
151
- </div>
152
- <h2
153
- className="u-mt-0 u-mb-3 u-text-5xl u-font-bold u-text-gradient-primary"
154
- style={{
155
- margin: '0 0 12px 0',
156
- fontSize: '32px',
157
- fontWeight: 700,
158
- background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
159
- WebkitBackgroundClip: 'text',
160
- WebkitTextFillColor: 'transparent',
161
- }}
162
- >
163
- Time-Based Animation
164
- </h2>
165
- <p className="u-m-0 u-text-base u-opacity-90">
166
- Organic liquid glass effect with continuous flow
167
- </p>
168
- </div>
169
- ),
170
- withTimeAnimation: true,
171
- animationSpeed: 1.0,
172
- withMultiLayerDistortion: true,
173
- distortionQuality: 'high',
174
- mode: 'shader',
175
- displacementScale: 60,
176
- blurAmount: 1,
177
- saturation: 140,
178
- borderRadius: 24,
108
+ children: premiumPanel('✨', 'Time-Based Animation', 'Organic liquid glass — continuous flow'),
109
+ ...liquidArgs,
179
110
  },
180
- decorators: [
181
- (Story) => (
182
- <BackgroundWrapper backgroundImage={backgroundImages[0]}>
183
- <Story />
184
- </BackgroundWrapper>
185
- ),
186
- ],
111
+ decorators: premiumDecorator(0),
187
112
  };
188
113
 
189
- /**
190
- * Breathing Effect
191
- *
192
- * Demonstrates subtle breathing animation with slow pulse cycle.
193
- * Best for cards and containers that need gentle attention.
194
- */
195
114
  export const BreathingEffect: Story = {
196
115
  args: {
197
- children: (
198
- <div className="u-text-center u-text-white" style={{ padding: '40px' }}>
199
- <h2 className="u-mt-0 u-mb-2 u-text-xl u-font-semibold">
200
- Breathing Glass
201
- </h2>
202
- <p className="u-m-0 u-text-sm u-opacity-80">
203
- Subtle pulse animation
204
- </p>
205
- </div>
206
- ),
116
+ children: premiumPanel('🫧', 'Breathing Glass', 'Slow 0.5× pulse for calm surfaces'),
117
+ ...PREMIUM_GLASS.card,
207
118
  withTimeAnimation: true,
208
- animationSpeed: 0.5, // Slower for breathing effect
119
+ animationSpeed: 0.5,
209
120
  withMultiLayerDistortion: false,
210
121
  mode: 'standard',
211
- displacementScale: 40,
212
- blurAmount: 2,
213
- saturation: 120,
214
- borderRadius: 20,
215
122
  },
216
- decorators: [
217
- (Story) => (
218
- <BackgroundWrapper backgroundImage={backgroundImages[1]}>
219
- <Story />
220
- </BackgroundWrapper>
221
- ),
222
- ],
123
+ decorators: premiumDecorator(1),
223
124
  };
224
125
 
225
- /**
226
- * Ultra Distortion
227
- *
228
- * Maximum detail with 7 octaves of FBM noise.
229
- * Creates highly complex, organic liquid patterns.
230
- */
231
126
  export const UltraDistortion: Story = {
232
127
  args: {
233
- children: (
234
- <div className="u-text-center u-text-white" style={{ padding: '60px 40px' }}>
235
- <div
236
- className="u-mx-auto u-mb-6 u-flex u-items-center u-justify-center u-rounded-lg"
237
- style={{
238
- width: '80px',
239
- height: '80px',
240
- margin: '0 auto 24px',
241
- borderRadius: '20px',
242
- background: 'rgba(255,255,255,0.2)',
243
- display: 'flex',
244
- alignItems: 'center',
245
- justifyContent: 'center',
246
- fontSize: '48px',
247
- boxShadow: '0 8px 32px rgba(0,0,0,0.2)',
248
- }}
249
- >
250
- 🌊
251
- </div>
252
- <h2 className="u-mt-0 u-mb-2 u-text-2xl u-font-bold">
253
- Ultra Distortion
254
- </h2>
255
- <p className="u-m-0 u-text-xs u-opacity-80">
256
- 7 octaves of FBM complexity
257
- </p>
258
- </div>
259
- ),
260
- withTimeAnimation: true,
261
- animationSpeed: 1.2,
262
- withMultiLayerDistortion: true,
128
+ children: premiumPanel('🌊', 'Ultra Distortion', '7 FBM octaves — maximum organic detail'),
129
+ ...PREMIUM_GLASS.cinematic,
263
130
  distortionQuality: 'ultra',
264
131
  distortionOctaves: 7,
265
- distortionLacunarity: 2.0,
266
- distortionGain: 0.5,
267
- mode: 'shader',
268
- displacementScale: 80,
269
- blurAmount: 0.5,
270
- saturation: 160,
271
- borderRadius: 28,
132
+ animationSpeed: 1.1,
272
133
  },
273
- decorators: [
274
- (Story) => (
275
- <BackgroundWrapper backgroundImage={backgroundImages[2]}>
276
- <Story />
277
- </BackgroundWrapper>
278
- ),
279
- ],
134
+ decorators: premiumDecorator(2),
280
135
  };
281
136
 
282
- /**
283
- * Mobile Optimized
284
- *
285
- * Low distortion quality (2 octaves) optimized for mobile performance.
286
- * Maintains visual appeal while minimizing GPU load.
287
- */
288
137
  export const MobileOptimized: Story = {
289
138
  args: {
290
139
  children: (
291
- <div className="u-text-white" style={{ padding: '40px 32px' }}>
292
- <h3 className="u-mt-0 u-mb-2 u-text-lg u-font-semibold">
293
- Mobile Optimized
294
- </h3>
295
- <p className="u-m-0 u-text-xs u-opacity-85">
296
- 2 octaves • Low power
140
+ <div
141
+ className="u-text-white"
142
+ style={{
143
+ padding: '44px 36px',
144
+ fontFamily: premiumTypography.fontFamily,
145
+ maxWidth: '300px',
146
+ }}
147
+ >
148
+ <h3 style={{ margin: '0 0 8px', fontSize: '20px', fontWeight: 600 }}>Mobile Optimized</h3>
149
+ <p style={{ margin: '0 0 16px', fontSize: '13px', color: premiumTypography.muted }}>
150
+ 2 octaves · low GPU load
297
151
  </p>
298
152
  <div
299
- className="u-mt-4 u-p-3 u-bg-white/10 u-rounded-md u-text-xs"
300
153
  style={{
301
- marginTop: '16px',
302
- padding: '12px',
303
- background: 'rgba(255,255,255,0.1)',
154
+ padding: '14px',
304
155
  borderRadius: '12px',
156
+ background: 'rgba(255,255,255,0.08)',
305
157
  fontSize: '12px',
158
+ color: premiumTypography.dim,
306
159
  }}
307
160
  >
308
- Perfect for battery-conscious users
161
+ Ideal for battery-conscious layouts
309
162
  </div>
310
163
  </div>
311
164
  ),
165
+ ...PREMIUM_GLASS.chrome,
312
166
  withTimeAnimation: true,
313
- animationSpeed: 1.0,
314
167
  withMultiLayerDistortion: true,
315
168
  distortionQuality: 'low',
316
169
  distortionOctaves: 2,
317
170
  mode: 'standard',
318
- displacementScale: 50,
319
- blurAmount: 2,
320
- saturation: 130,
321
- borderRadius: 16,
322
171
  },
323
- decorators: [
324
- (Story) => (
325
- <BackgroundWrapper backgroundImage={backgroundImages[3]}>
326
- <Story />
327
- </BackgroundWrapper>
328
- ),
329
- ],
172
+ decorators: premiumDecorator(3),
330
173
  };
331
174
 
332
- /**
333
- * Slow Motion
334
- *
335
- * Reduced animation speed for calm, meditative effects.
336
- * Great for wellness and mindfulness applications.
337
- */
338
175
  export const SlowMotion: Story = {
339
176
  args: {
340
- children: (
341
- <div className="u-text-center u-text-white" style={{ padding: '60px 40px' }}>
342
- <div
343
- className="u-text-6xl u-mb-5"
344
- style={{
345
- fontSize: '56px',
346
- marginBottom: '20px',
347
- }}
348
- >
349
- 🧘
350
- </div>
351
- <h2 className="u-mt-0 u-mb-3 u-text-2xl u-font-semibold">
352
- Slow Motion
353
- </h2>
354
- <p className="u-m-0 u-text-base u-opacity-90">
355
- Calming 0.3x speed
356
- </p>
357
- </div>
358
- ),
359
- withTimeAnimation: true,
360
- animationSpeed: 0.3, // Very slow
361
- withMultiLayerDistortion: true,
177
+ children: premiumPanel('🧘', 'Slow Motion', '0.3× speed — meditative glass flow'),
178
+ ...liquidArgs,
179
+ animationSpeed: 0.3,
362
180
  distortionQuality: 'medium',
363
- mode: 'shader',
364
- displacementScale: 45,
365
- blurAmount: 3,
366
- saturation: 110,
367
- borderRadius: 24,
368
181
  },
369
- decorators: [
370
- (Story) => (
371
- <BackgroundWrapper backgroundImage={backgroundImages[4]}>
372
- <Story />
373
- </BackgroundWrapper>
374
- ),
375
- ],
182
+ decorators: premiumDecorator(4),
376
183
  };
377
184
 
378
- /**
379
- * Fast Flow
380
- *
381
- * High-speed animation for dynamic, energetic effects.
382
- * Suitable for sports, action, and high-energy content.
383
- */
384
185
  export const FastFlow: Story = {
385
186
  args: {
386
- children: (
387
- <div className="u-text-center u-text-white" style={{ padding: '60px 40px' }}>
388
- <div
389
- className="u-text-6xl u-mb-5"
390
- style={{
391
- fontSize: '56px',
392
- marginBottom: '20px',
393
- }}
394
- >
395
-
396
- </div>
397
- <h2 className="u-mt-0 u-mb-3 u-text-2xl u-font-bold">
398
- Fast Flow
399
- </h2>
400
- <p className="u-m-0 u-text-base u-opacity-90">
401
- Energetic 2.5x speed
402
- </p>
403
- </div>
404
- ),
405
- withTimeAnimation: true,
406
- animationSpeed: 2.5, // Fast
407
- withMultiLayerDistortion: true,
408
- distortionQuality: 'high',
409
- mode: 'shader',
410
- displacementScale: 70,
411
- blurAmount: 1,
412
- saturation: 150,
413
- borderRadius: 24,
187
+ children: premiumPanel('⚡', 'Fast Flow', '2.5× speed — energetic shader motion'),
188
+ ...liquidArgs,
189
+ animationSpeed: 2.5,
414
190
  },
415
- decorators: [
416
- (Story) => (
417
- <BackgroundWrapper backgroundImage={backgroundImages[5]}>
418
- <Story />
419
- </BackgroundWrapper>
420
- ),
421
- ],
191
+ decorators: premiumDecorator(5),
422
192
  };
423
193
 
424
- /**
425
- * No Animation (Static)
426
- *
427
- * Demonstrates disabled time-based animations for static glass effect.
428
- * Useful for reducing motion or improving performance.
429
- */
430
194
  export const NoAnimation: Story = {
431
195
  args: {
432
- children: (
433
- <div className="u-text-center u-text-white" style={{ padding: '40px' }}>
434
- <h2 className="u-mt-0 u-mb-2 u-text-xl u-font-semibold">
435
- Static Glass
436
- </h2>
437
- <p className="u-m-0 u-text-sm u-opacity-80">
438
- Time animations disabled
439
- </p>
440
- </div>
441
- ),
196
+ children: premiumPanel('◇', 'Static Glass', 'Time animation off — pure frost'),
197
+ ...PREMIUM_GLASS.chrome,
442
198
  withTimeAnimation: false,
443
199
  withMultiLayerDistortion: false,
444
200
  mode: 'standard',
445
- displacementScale: 40,
446
- blurAmount: 2,
447
- saturation: 140,
448
- borderRadius: 20,
449
201
  },
450
- decorators: [
451
- (Story) => (
452
- <BackgroundWrapper backgroundImage={backgroundImages[0]}>
453
- <Story />
454
- </BackgroundWrapper>
455
- ),
456
- ],
202
+ decorators: premiumDecorator(0),
457
203
  };
458
204
 
459
- /**
460
- * Custom FBM Parameters
461
- *
462
- * Fine-tuned control over FBM lacunarity and gain.
463
- * For advanced users who want specific distortion characteristics.
464
- */
465
205
  export const CustomFBMParameters: Story = {
466
206
  args: {
467
207
  children: (
468
- <div className="u-text-white" style={{ padding: '60px 40px' }}>
469
- <h2 className="u-mt-0 u-mb-3 u-text-2xl u-font-bold">
470
- Custom FBM
471
- </h2>
472
- <div className="u-text-sm u-opacity-85 u-leading-relaxed">
208
+ <div
209
+ className="u-text-white"
210
+ style={{ padding: '52px 40px', fontFamily: premiumTypography.fontFamily }}
211
+ >
212
+ <h2 style={{ margin: '0 0 12px', fontSize: '24px', fontWeight: 700 }}>Custom FBM</h2>
213
+ <div style={{ fontSize: '14px', color: premiumTypography.muted, lineHeight: 1.7 }}>
473
214
  <div>Octaves: 6</div>
474
215
  <div>Lacunarity: 2.5</div>
475
216
  <div>Gain: 0.65</div>
476
217
  </div>
477
218
  </div>
478
219
  ),
479
- withTimeAnimation: true,
480
- animationSpeed: 1.0,
481
- withMultiLayerDistortion: true,
220
+ ...liquidArgs,
482
221
  distortionOctaves: 6,
483
- distortionLacunarity: 2.5, // Higher frequency progression
484
- distortionGain: 0.65, // Slower amplitude decay
485
- distortionQuality: 'high', // Overridden by custom values
486
- mode: 'shader',
487
- displacementScale: 65,
488
- blurAmount: 1.5,
489
- saturation: 145,
490
- borderRadius: 24,
222
+ distortionLacunarity: 2.5,
223
+ distortionGain: 0.65,
491
224
  },
492
- decorators: [
493
- (Story) => (
494
- <BackgroundWrapper backgroundImage={backgroundImages[1]}>
495
- <Story />
496
- </BackgroundWrapper>
497
- ),
498
- ],
225
+ decorators: premiumDecorator(1),
499
226
  };
500
227
 
501
- /**
502
- * Accessibility - Reduced Motion
503
- *
504
- * Automatically respects prefers-reduced-motion preference.
505
- * When enabled, all time-based animations are disabled.
506
- */
507
228
  export const AccessibilityReducedMotion: Story = {
508
229
  args: {
509
- children: (
510
- <div className="u-text-center u-text-white" style={{ padding: '40px' }}>
511
- <div className="u-text-5xl u-mb-4">♿</div>
512
- <h2 className="u-mt-0 u-mb-2 u-text-lg u-font-semibold">
513
- Reduced Motion
514
- </h2>
515
- <p className="u-m-0 u-text-sm u-opacity-80">
516
- Respects accessibility preferences
517
- </p>
518
- </div>
519
- ),
520
- withTimeAnimation: true, // Will be disabled by reducedMotion
521
- reducedMotion: true, // Explicitly enable reduced motion
230
+ children: premiumPanel('♿', 'Reduced Motion', 'Animations disabled for accessibility'),
231
+ ...PREMIUM_GLASS.chrome,
232
+ withTimeAnimation: true,
233
+ reducedMotion: true,
522
234
  withMultiLayerDistortion: false,
523
235
  mode: 'standard',
524
- displacementScale: 40,
525
- blurAmount: 2,
526
- saturation: 130,
527
- borderRadius: 20,
528
236
  },
529
- decorators: [
530
- (Story) => (
531
- <BackgroundWrapper backgroundImage={backgroundImages[2]}>
532
- <Story />
533
- </BackgroundWrapper>
534
- ),
535
- ],
237
+ decorators: premiumDecorator(2),
536
238
  };
537
239
 
538
- /**
539
- * Performance Comparison
540
- *
541
- * Side-by-side comparison of different quality presets.
542
- * Use this to choose the right balance for your use case.
543
- */
240
+ const comparisonCell = (
241
+ icon: string,
242
+ label: string,
243
+ detail: string,
244
+ quality: 'low' | 'medium' | 'high' | 'ultra'
245
+ ) => (
246
+ <AtomixGlass
247
+ {...PREMIUM_GLASS.liquid}
248
+ distortionQuality={quality}
249
+ elasticity={0}
250
+ style={{ minHeight: '200px' }}
251
+ >
252
+ <div
253
+ className="u-p-6 u-text-center u-text-white"
254
+ style={{ padding: '28px', textAlign: 'center', fontFamily: premiumTypography.fontFamily }}
255
+ >
256
+ <div style={{ fontSize: '36px', marginBottom: '12px' }}>{icon}</div>
257
+ <h3 style={{ margin: '0 0 6px', fontSize: '15px', fontWeight: 600 }}>{label}</h3>
258
+ <p style={{ margin: 0, fontSize: '12px', color: premiumTypography.dim }}>{detail}</p>
259
+ </div>
260
+ </AtomixGlass>
261
+ );
262
+
544
263
  export const PerformanceComparison: Story = {
545
264
  render: () => (
546
- <div className="u-grid u-gap-6" style={{ gridTemplateColumns: 'repeat(2, 1fr)' }}>
547
- {/* Low Quality */}
548
- <div>
549
- <AtomixGlass
550
- withTimeAnimation={true}
551
- animationSpeed={1.0}
552
- withMultiLayerDistortion={true}
553
- distortionQuality="low"
554
- mode="shader"
555
- displacementScale={50}
556
- blurAmount={2}
557
- saturation={130}
558
- borderRadius={20}
559
- height={200}
560
- >
561
- <div className="u-p-6 u-text-center u-text-white" style={{ padding: '24px', color: 'white', textAlign: 'center' }}>
562
- <div className="u-text-4xl u-mb-3">📱</div>
563
- <h3 className="u-mt-0 u-mb-1 u-text-sm u-font-semibold">
564
- Low
565
- </h3>
566
- <p className="u-m-0 u-text-xs u-opacity-80">
567
- 2 octaves • Mobile
568
- </p>
569
- </div>
570
- </AtomixGlass>
571
- </div>
572
-
573
- {/* Medium Quality */}
574
- <div>
575
- <AtomixGlass
576
- withTimeAnimation={true}
577
- animationSpeed={1.0}
578
- withMultiLayerDistortion={true}
579
- distortionQuality="medium"
580
- mode="shader"
581
- displacementScale={50}
582
- blurAmount={2}
583
- saturation={130}
584
- borderRadius={20}
585
- height={200}
586
- >
587
- <div className="u-p-6 u-text-center u-text-white" style={{ padding: '24px', color: 'white', textAlign: 'center' }}>
588
- <div className="u-text-4xl u-mb-3">💻</div>
589
- <h3 className="u-mt-0 u-mb-1 u-text-sm u-font-semibold">
590
- Medium
591
- </h3>
592
- <p className="u-m-0 u-text-xs u-opacity-80">
593
- 4 octaves • Tablet
594
- </p>
595
- </div>
596
- </AtomixGlass>
597
- </div>
598
-
599
- {/* High Quality */}
600
- <div>
601
- <AtomixGlass
602
- withTimeAnimation={true}
603
- animationSpeed={1.0}
604
- withMultiLayerDistortion={true}
605
- distortionQuality="high"
606
- mode="shader"
607
- displacementScale={50}
608
- blurAmount={2}
609
- saturation={130}
610
- borderRadius={20}
611
- height={200}
612
- >
613
- <div className="u-p-6 u-text-center u-text-white" style={{ padding: '24px', color: 'white', textAlign: 'center' }}>
614
- <div className="u-text-4xl u-mb-3">🖥️</div>
615
- <h3 className="u-mt-0 u-mb-1 u-text-sm u-font-semibold">
616
- High
617
- </h3>
618
- <p className="u-m-0 u-text-xs u-opacity-80">
619
- 5 octaves • Desktop
620
- </p>
621
- </div>
622
- </AtomixGlass>
623
- </div>
624
-
625
- {/* Ultra Quality */}
626
- <div>
627
- <AtomixGlass
628
- withTimeAnimation={true}
629
- animationSpeed={1.0}
630
- withMultiLayerDistortion={true}
631
- distortionQuality="ultra"
632
- mode="shader"
633
- displacementScale={50}
634
- blurAmount={2}
635
- saturation={130}
636
- borderRadius={20}
637
- height={200}
638
- >
639
- <div className="u-p-6 u-text-center u-text-white" style={{ padding: '24px', color: 'white', textAlign: 'center' }}>
640
- <div className="u-text-4xl u-mb-3">🚀</div>
641
- <h3 className="u-mt-0 u-mb-1 u-text-sm u-font-semibold">
642
- Ultra
643
- </h3>
644
- <p className="u-m-0 u-text-xs u-opacity-80">
645
- 7 octaves • High-end
646
- </p>
647
- </div>
648
- </AtomixGlass>
649
- </div>
265
+ <div
266
+ className="u-grid u-gap-6 u-p-6"
267
+ style={{
268
+ gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))',
269
+ maxWidth: '1100px',
270
+ margin: '0 auto',
271
+ }}
272
+ >
273
+ {comparisonCell('📱', 'Low', '2 octaves · Mobile', 'low')}
274
+ {comparisonCell('💻', 'Medium', '4 octaves · Tablet', 'medium')}
275
+ {comparisonCell('🖥️', 'High', '5 octaves · Desktop', 'high')}
276
+ {comparisonCell('🚀', 'Ultra', '7 octaves · High-end', 'ultra')}
650
277
  </div>
651
278
  ),
652
- decorators: [
653
- (Story) => (
654
- <BackgroundWrapper backgroundImage={backgroundImages[0]}>
655
- <Story />
656
- </BackgroundWrapper>
657
- ),
658
- ],
659
- };
279
+ decorators: premiumDecorator(0),
280
+ };