@shohojdhara/atomix 0.4.7 → 0.4.9

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 (176) hide show
  1. package/atomix.config.ts +58 -1
  2. package/dist/atomix.css +172 -157
  3. package/dist/atomix.css.map +1 -1
  4. package/dist/atomix.min.css +4 -4
  5. package/dist/atomix.min.css.map +1 -1
  6. package/dist/charts.d.ts +33 -0
  7. package/dist/charts.js +1274 -164
  8. package/dist/charts.js.map +1 -1
  9. package/dist/core.d.ts +33 -10
  10. package/dist/core.js +1099 -83
  11. package/dist/core.js.map +1 -1
  12. package/dist/forms.d.ts +33 -0
  13. package/dist/forms.js +2106 -1050
  14. package/dist/forms.js.map +1 -1
  15. package/dist/heavy.d.ts +42 -1
  16. package/dist/heavy.js +1663 -638
  17. package/dist/heavy.js.map +1 -1
  18. package/dist/index.d.ts +442 -270
  19. package/dist/index.esm.js +1947 -680
  20. package/dist/index.esm.js.map +1 -1
  21. package/dist/index.js +1982 -712
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.min.js +1 -1
  24. package/dist/index.min.js.map +1 -1
  25. package/package.json +6 -3
  26. package/scripts/atomix-cli.js +136 -1827
  27. package/scripts/cli/__tests__/basic.test.js +3 -2
  28. package/scripts/cli/__tests__/clean.test.js +278 -0
  29. package/scripts/cli/__tests__/component-validator.test.js +433 -0
  30. package/scripts/cli/__tests__/generator.test.js +613 -0
  31. package/scripts/cli/__tests__/glass-motion.test.js +256 -0
  32. package/scripts/cli/__tests__/integration.test.js +719 -108
  33. package/scripts/cli/__tests__/migrate.test.js +74 -0
  34. package/scripts/cli/__tests__/security.test.js +206 -0
  35. package/scripts/cli/__tests__/test-setup.js +3 -1
  36. package/scripts/cli/__tests__/theme-bridge.test.js +507 -0
  37. package/scripts/cli/__tests__/token-provider.test.js +361 -0
  38. package/scripts/cli/__tests__/utils.test.js +5 -5
  39. package/scripts/cli/commands/benchmark.js +105 -0
  40. package/scripts/cli/commands/build-theme.js +115 -0
  41. package/scripts/cli/commands/clean.js +109 -0
  42. package/scripts/cli/commands/doctor.js +88 -0
  43. package/scripts/cli/commands/generate.js +218 -0
  44. package/scripts/cli/commands/init.js +73 -0
  45. package/scripts/cli/commands/migrate.js +106 -0
  46. package/scripts/cli/commands/sync-tokens.js +206 -0
  47. package/scripts/cli/commands/theme-bridge.js +248 -0
  48. package/scripts/cli/commands/tokens.js +157 -0
  49. package/scripts/cli/commands/validate.js +194 -0
  50. package/scripts/cli/internal/ai-engine.js +156 -0
  51. package/scripts/cli/internal/compiler.js +114 -0
  52. package/scripts/cli/internal/component-validator.js +443 -0
  53. package/scripts/cli/internal/config-loader.js +162 -0
  54. package/scripts/cli/internal/filesystem.js +158 -0
  55. package/scripts/cli/internal/generator.js +430 -0
  56. package/scripts/cli/internal/glass-generator.js +398 -0
  57. package/scripts/cli/internal/hook-generator.js +369 -0
  58. package/scripts/cli/internal/hooks.js +61 -0
  59. package/scripts/cli/internal/itcss-generator.js +565 -0
  60. package/scripts/cli/internal/motion-generator.js +679 -0
  61. package/scripts/cli/internal/template-engine.js +301 -0
  62. package/scripts/cli/internal/theme-bridge.js +664 -0
  63. package/scripts/cli/internal/tokens/engine.js +122 -0
  64. package/scripts/cli/internal/tokens/provider.js +34 -0
  65. package/scripts/cli/internal/tokens/providers/figma.js +50 -0
  66. package/scripts/cli/internal/tokens/providers/style-dictionary.js +48 -0
  67. package/scripts/cli/internal/tokens/providers/w3c.js +48 -0
  68. package/scripts/cli/internal/tokens/token-provider.js +443 -0
  69. package/scripts/cli/internal/tokens/token-validator.js +513 -0
  70. package/scripts/cli/internal/validator.js +276 -0
  71. package/scripts/cli/internal/wizard.js +115 -0
  72. package/scripts/cli/mappings.js +23 -0
  73. package/scripts/cli/migration-tools.js +164 -94
  74. package/scripts/cli/plugins/style-dictionary.js +46 -0
  75. package/scripts/cli/templates/README.md +525 -95
  76. package/scripts/cli/templates/common-templates.js +40 -14
  77. package/scripts/cli/templates/components/react-component.ts +282 -0
  78. package/scripts/cli/templates/config/project-config.ts +112 -0
  79. package/scripts/cli/templates/hooks/use-component.ts +477 -0
  80. package/scripts/cli/templates/index.js +19 -4
  81. package/scripts/cli/templates/index.ts +171 -0
  82. package/scripts/cli/templates/next-templates.js +72 -0
  83. package/scripts/cli/templates/react-templates.js +70 -126
  84. package/scripts/cli/templates/scss-templates.js +35 -35
  85. package/scripts/cli/templates/stories/storybook-story.ts +241 -0
  86. package/scripts/cli/templates/styles/scss-component.ts +255 -0
  87. package/scripts/cli/templates/tests/vitest-test.ts +229 -0
  88. package/scripts/cli/templates/token-templates.js +337 -1
  89. package/scripts/cli/templates/tokens/token-generators.ts +1088 -0
  90. package/scripts/cli/templates/types/component-types.ts +145 -0
  91. package/scripts/cli/templates/utils/testing-utils.ts +144 -0
  92. package/scripts/cli/templates/vanilla-templates.js +39 -0
  93. package/scripts/cli/token-manager.js +8 -2
  94. package/scripts/cli/utils/cache-manager.js +240 -0
  95. package/scripts/cli/utils/detector.js +46 -0
  96. package/scripts/cli/utils/diagnostics.js +289 -0
  97. package/scripts/cli/utils/error.js +89 -0
  98. package/scripts/cli/utils/helpers.js +67 -0
  99. package/scripts/cli/utils/logger.js +75 -0
  100. package/scripts/cli/utils/security.js +302 -0
  101. package/scripts/cli/utils/telemetry.js +115 -0
  102. package/scripts/cli/utils/validation.js +37 -0
  103. package/scripts/cli/utils.js +28 -341
  104. package/src/components/Accordion/Accordion.stories.tsx +0 -18
  105. package/src/components/Accordion/Accordion.test.tsx +0 -17
  106. package/src/components/Accordion/Accordion.tsx +0 -4
  107. package/src/components/AtomixGlass/AtomixGlass.test.tsx +37 -3
  108. package/src/components/AtomixGlass/AtomixGlass.tsx +143 -31
  109. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +129 -31
  110. package/src/components/AtomixGlass/PerformanceDashboard.tsx +219 -0
  111. package/src/components/AtomixGlass/README.md +25 -10
  112. package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +216 -0
  113. package/src/components/AtomixGlass/animation-system.ts +578 -0
  114. package/src/components/AtomixGlass/shader-utils.ts +4 -1
  115. package/src/components/AtomixGlass/stories/Overview.stories.tsx +157 -6
  116. package/src/components/AtomixGlass/stories/Phase1-Animation.stories.tsx +653 -0
  117. package/src/components/AtomixGlass/stories/Phase1-Test.stories.tsx +95 -0
  118. package/src/components/AtomixGlass/stories/Playground.stories.tsx +51 -51
  119. package/src/components/AtomixGlass/stories/shared-components.tsx +6 -0
  120. package/src/components/Avatar/Avatar.tsx +1 -1
  121. package/src/components/Button/Button.stories.disabled-link.tsx +10 -0
  122. package/src/components/Button/Button.stories.tsx +10 -0
  123. package/src/components/Button/Button.test.tsx +16 -11
  124. package/src/components/Button/Button.tsx +4 -4
  125. package/src/components/Card/Card.tsx +1 -1
  126. package/src/components/Dropdown/Dropdown.tsx +12 -12
  127. package/src/components/Form/Select.tsx +62 -3
  128. package/src/components/Modal/Modal.tsx +14 -3
  129. package/src/components/Navigation/Navbar/Navbar.tsx +44 -0
  130. package/src/components/Slider/Slider.stories.tsx +3 -3
  131. package/src/components/Slider/Slider.tsx +38 -0
  132. package/src/components/Steps/Steps.tsx +3 -3
  133. package/src/components/Tabs/Tabs.tsx +77 -8
  134. package/src/components/Testimonial/Testimonial.tsx +1 -1
  135. package/src/components/TypedButton/TypedButton.stories.tsx +59 -0
  136. package/src/components/TypedButton/TypedButton.tsx +39 -0
  137. package/src/components/TypedButton/index.ts +2 -0
  138. package/src/components/VideoPlayer/VideoPlayer.tsx +11 -4
  139. package/src/lib/composables/index.ts +4 -7
  140. package/src/lib/composables/types.ts +45 -0
  141. package/src/lib/composables/useAccordion.ts +0 -7
  142. package/src/lib/composables/useAtomixGlass.ts +148 -6
  143. package/src/lib/composables/useAtomixGlassStyles.ts +9 -7
  144. package/src/lib/composables/useChartExport.ts +3 -13
  145. package/src/lib/composables/useDropdown.ts +66 -0
  146. package/src/lib/composables/useFocusTrap.ts +80 -0
  147. package/src/lib/composables/usePerformanceMonitor.ts +448 -0
  148. package/src/lib/composables/useResponsiveGlass.presets.ts +192 -0
  149. package/src/lib/composables/useResponsiveGlass.ts +441 -0
  150. package/src/lib/composables/useTooltip.ts +16 -0
  151. package/src/lib/composables/useTypedButton.ts +66 -0
  152. package/src/lib/config/index.ts +62 -5
  153. package/src/lib/constants/components.ts +62 -7
  154. package/src/lib/theme/devtools/__tests__/useHistory.test.tsx +150 -0
  155. package/src/lib/theme/tokens/centralized-tokens.ts +120 -0
  156. package/src/lib/theme/utils/__tests__/domUtils.test.ts +101 -0
  157. package/src/lib/types/components.ts +37 -11
  158. package/src/lib/types/glass.ts +35 -0
  159. package/src/lib/types/index.ts +1 -0
  160. package/src/lib/utils/displacement-generator.ts +1 -1
  161. package/src/styles/01-settings/_settings.testtypecheck.scss +53 -0
  162. package/src/styles/01-settings/_settings.typedbutton.scss +53 -0
  163. package/src/styles/06-components/_components.atomix-glass.scss +17 -21
  164. package/src/styles/06-components/_components.edge-panel.scss +1 -5
  165. package/src/styles/06-components/_components.modal.scss +1 -4
  166. package/src/styles/06-components/_components.navbar.scss +1 -1
  167. package/src/styles/06-components/_components.testbutton.scss +212 -0
  168. package/src/styles/06-components/_components.testtypecheck.scss +212 -0
  169. package/src/styles/06-components/_components.tooltip.scss +9 -5
  170. package/src/styles/06-components/_components.typedbutton.scss +212 -0
  171. package/src/styles/99-utilities/_index.scss +1 -0
  172. package/src/styles/99-utilities/_utilities.text.scss +1 -1
  173. package/src/styles/99-utilities/_utilities.touch-target.scss +36 -0
  174. package/scripts/cli/component-generator.js +0 -564
  175. package/scripts/cli/interactive-init.js +0 -357
  176. package/src/styles/06-components/old.chart.styles.scss +0 -2788
@@ -0,0 +1,653 @@
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
12
+ */
13
+
14
+ import type { Meta, StoryObj } from '@storybook/react';
15
+ import { AtomixGlass } from '../AtomixGlass';
16
+ import { BackgroundWrapper, backgroundImages } from './shared-components';
17
+
18
+ const meta = {
19
+ title: 'Components/AtomixGlass/Phase 1 - Animation Features',
20
+ component: AtomixGlass,
21
+ parameters: {
22
+ layout: 'centered',
23
+ docs: {
24
+ description: {
25
+ 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)
47
+
48
+ **Performance Note:** These features are GPU-accelerated and automatically respect \`prefers-reduced-motion\` preferences.
49
+ `,
50
+ },
51
+ },
52
+ },
53
+ tags: ['autodocs'],
54
+ argTypes: {
55
+ // Phase 1 Animation Controls
56
+ withTimeAnimation: {
57
+ control: 'boolean',
58
+ description: 'Enable continuous time-based animations',
59
+ table: {
60
+ category: 'Phase 1 - Animation',
61
+ defaultValue: { summary: 'true' },
62
+ },
63
+ },
64
+ 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
+ },
71
+ },
72
+ withMultiLayerDistortion: {
73
+ 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
+ },
103
+ },
104
+ 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
+ },
114
+ },
115
+ 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
+ },
125
+ },
126
+ },
127
+ } satisfies Meta<typeof AtomixGlass>;
128
+
129
+ export default meta;
130
+ type Story = StoryObj<typeof meta>;
131
+
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
+ */
138
+ export const DefaultAnimation: Story = {
139
+ args: {
140
+ children: (
141
+ <div style={{ padding: '60px 40px', textAlign: 'center', color: 'white' }}>
142
+ <div
143
+ style={{
144
+ fontSize: '64px',
145
+ marginBottom: '24px',
146
+ filter: 'drop-shadow(0 4px 8px rgba(0,0,0,0.3))',
147
+ }}
148
+ >
149
+
150
+ </div>
151
+ <h2
152
+ style={{
153
+ margin: '0 0 12px 0',
154
+ fontSize: '32px',
155
+ fontWeight: 700,
156
+ background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
157
+ WebkitBackgroundClip: 'text',
158
+ WebkitTextFillColor: 'transparent',
159
+ }}
160
+ >
161
+ Time-Based Animation
162
+ </h2>
163
+ <p style={{ margin: 0, fontSize: '16px', opacity: 0.9 }}>
164
+ Organic liquid glass effect with continuous flow
165
+ </p>
166
+ </div>
167
+ ),
168
+ withTimeAnimation: true,
169
+ animationSpeed: 1.0,
170
+ withMultiLayerDistortion: true,
171
+ distortionQuality: 'high',
172
+ mode: 'shader',
173
+ displacementScale: 60,
174
+ blurAmount: 1,
175
+ saturation: 140,
176
+ borderRadius: 24,
177
+ },
178
+ decorators: [
179
+ (Story) => (
180
+ <BackgroundWrapper backgroundImage={backgroundImages[0]}>
181
+ <Story />
182
+ </BackgroundWrapper>
183
+ ),
184
+ ],
185
+ };
186
+
187
+ /**
188
+ * Breathing Effect
189
+ *
190
+ * Demonstrates subtle breathing animation with slow pulse cycle.
191
+ * Best for cards and containers that need gentle attention.
192
+ */
193
+ export const BreathingEffect: Story = {
194
+ args: {
195
+ children: (
196
+ <div style={{ padding: '40px', textAlign: 'center', color: 'white' }}>
197
+ <h2 style={{ margin: '0 0 8px 0', fontSize: '24px', fontWeight: 600 }}>
198
+ Breathing Glass
199
+ </h2>
200
+ <p style={{ margin: 0, fontSize: '14px', opacity: 0.8 }}>
201
+ Subtle pulse animation
202
+ </p>
203
+ </div>
204
+ ),
205
+ withTimeAnimation: true,
206
+ animationSpeed: 0.5, // Slower for breathing effect
207
+ withMultiLayerDistortion: false,
208
+ mode: 'standard',
209
+ displacementScale: 40,
210
+ blurAmount: 2,
211
+ saturation: 120,
212
+ borderRadius: 20,
213
+ },
214
+ decorators: [
215
+ (Story) => (
216
+ <BackgroundWrapper backgroundImage={backgroundImages[1]}>
217
+ <Story />
218
+ </BackgroundWrapper>
219
+ ),
220
+ ],
221
+ };
222
+
223
+ /**
224
+ * Ultra Distortion
225
+ *
226
+ * Maximum detail with 7 octaves of FBM noise.
227
+ * Creates highly complex, organic liquid patterns.
228
+ */
229
+ export const UltraDistortion: Story = {
230
+ args: {
231
+ children: (
232
+ <div style={{ padding: '60px 40px', textAlign: 'center', color: 'white' }}>
233
+ <div
234
+ style={{
235
+ width: '80px',
236
+ height: '80px',
237
+ margin: '0 auto 24px',
238
+ borderRadius: '20px',
239
+ background: 'rgba(255,255,255,0.2)',
240
+ display: 'flex',
241
+ alignItems: 'center',
242
+ justifyContent: 'center',
243
+ fontSize: '48px',
244
+ boxShadow: '0 8px 32px rgba(0,0,0,0.2)',
245
+ }}
246
+ >
247
+ 🌊
248
+ </div>
249
+ <h2 style={{ margin: '0 0 8px 0', fontSize: '28px', fontWeight: 700 }}>
250
+ Ultra Distortion
251
+ </h2>
252
+ <p style={{ margin: 0, fontSize: '14px', opacity: 0.8 }}>
253
+ 7 octaves of FBM complexity
254
+ </p>
255
+ </div>
256
+ ),
257
+ withTimeAnimation: true,
258
+ animationSpeed: 1.2,
259
+ withMultiLayerDistortion: true,
260
+ distortionQuality: 'ultra',
261
+ distortionOctaves: 7,
262
+ distortionLacunarity: 2.0,
263
+ distortionGain: 0.5,
264
+ mode: 'shader',
265
+ displacementScale: 80,
266
+ blurAmount: 0.5,
267
+ saturation: 160,
268
+ borderRadius: 28,
269
+ },
270
+ decorators: [
271
+ (Story) => (
272
+ <BackgroundWrapper backgroundImage={backgroundImages[2]}>
273
+ <Story />
274
+ </BackgroundWrapper>
275
+ ),
276
+ ],
277
+ };
278
+
279
+ /**
280
+ * Mobile Optimized
281
+ *
282
+ * Low distortion quality (2 octaves) optimized for mobile performance.
283
+ * Maintains visual appeal while minimizing GPU load.
284
+ */
285
+ export const MobileOptimized: Story = {
286
+ args: {
287
+ children: (
288
+ <div style={{ padding: '40px 32px', color: 'white' }}>
289
+ <h3 style={{ margin: '0 0 8px 0', fontSize: '20px', fontWeight: 600 }}>
290
+ Mobile Optimized
291
+ </h3>
292
+ <p style={{ margin: 0, fontSize: '13px', opacity: 0.85 }}>
293
+ 2 octaves • Low power
294
+ </p>
295
+ <div
296
+ style={{
297
+ marginTop: '16px',
298
+ padding: '12px',
299
+ background: 'rgba(255,255,255,0.1)',
300
+ borderRadius: '12px',
301
+ fontSize: '12px',
302
+ }}
303
+ >
304
+ Perfect for battery-conscious users
305
+ </div>
306
+ </div>
307
+ ),
308
+ withTimeAnimation: true,
309
+ animationSpeed: 1.0,
310
+ withMultiLayerDistortion: true,
311
+ distortionQuality: 'low',
312
+ distortionOctaves: 2,
313
+ mode: 'standard',
314
+ displacementScale: 50,
315
+ blurAmount: 2,
316
+ saturation: 130,
317
+ borderRadius: 16,
318
+ },
319
+ decorators: [
320
+ (Story) => (
321
+ <BackgroundWrapper backgroundImage={backgroundImages[3]}>
322
+ <Story />
323
+ </BackgroundWrapper>
324
+ ),
325
+ ],
326
+ };
327
+
328
+ /**
329
+ * Slow Motion
330
+ *
331
+ * Reduced animation speed for calm, meditative effects.
332
+ * Great for wellness and mindfulness applications.
333
+ */
334
+ export const SlowMotion: Story = {
335
+ args: {
336
+ children: (
337
+ <div style={{ padding: '60px 40px', textAlign: 'center', color: 'white' }}>
338
+ <div
339
+ style={{
340
+ fontSize: '56px',
341
+ marginBottom: '20px',
342
+ }}
343
+ >
344
+ 🧘
345
+ </div>
346
+ <h2 style={{ margin: '0 0 12px 0', fontSize: '28px', fontWeight: 600 }}>
347
+ Slow Motion
348
+ </h2>
349
+ <p style={{ margin: 0, fontSize: '15px', opacity: 0.9 }}>
350
+ Calming 0.3x speed
351
+ </p>
352
+ </div>
353
+ ),
354
+ withTimeAnimation: true,
355
+ animationSpeed: 0.3, // Very slow
356
+ withMultiLayerDistortion: true,
357
+ distortionQuality: 'medium',
358
+ mode: 'shader',
359
+ displacementScale: 45,
360
+ blurAmount: 3,
361
+ saturation: 110,
362
+ borderRadius: 24,
363
+ },
364
+ decorators: [
365
+ (Story) => (
366
+ <BackgroundWrapper backgroundImage={backgroundImages[4]}>
367
+ <Story />
368
+ </BackgroundWrapper>
369
+ ),
370
+ ],
371
+ };
372
+
373
+ /**
374
+ * Fast Flow
375
+ *
376
+ * High-speed animation for dynamic, energetic effects.
377
+ * Suitable for sports, action, and high-energy content.
378
+ */
379
+ export const FastFlow: Story = {
380
+ args: {
381
+ children: (
382
+ <div style={{ padding: '60px 40px', textAlign: 'center', color: 'white' }}>
383
+ <div
384
+ style={{
385
+ fontSize: '56px',
386
+ marginBottom: '20px',
387
+ }}
388
+ >
389
+
390
+ </div>
391
+ <h2 style={{ margin: '0 0 12px 0', fontSize: '28px', fontWeight: 700 }}>
392
+ Fast Flow
393
+ </h2>
394
+ <p style={{ margin: 0, fontSize: '15px', opacity: 0.9 }}>
395
+ Energetic 2.5x speed
396
+ </p>
397
+ </div>
398
+ ),
399
+ withTimeAnimation: true,
400
+ animationSpeed: 2.5, // Fast
401
+ withMultiLayerDistortion: true,
402
+ distortionQuality: 'high',
403
+ mode: 'shader',
404
+ displacementScale: 70,
405
+ blurAmount: 1,
406
+ saturation: 150,
407
+ borderRadius: 24,
408
+ },
409
+ decorators: [
410
+ (Story) => (
411
+ <BackgroundWrapper backgroundImage={backgroundImages[5]}>
412
+ <Story />
413
+ </BackgroundWrapper>
414
+ ),
415
+ ],
416
+ };
417
+
418
+ /**
419
+ * No Animation (Static)
420
+ *
421
+ * Demonstrates disabled time-based animations for static glass effect.
422
+ * Useful for reducing motion or improving performance.
423
+ */
424
+ export const NoAnimation: Story = {
425
+ args: {
426
+ children: (
427
+ <div style={{ padding: '40px', textAlign: 'center', color: 'white' }}>
428
+ <h2 style={{ margin: '0 0 8px 0', fontSize: '24px', fontWeight: 600 }}>
429
+ Static Glass
430
+ </h2>
431
+ <p style={{ margin: 0, fontSize: '14px', opacity: 0.8 }}>
432
+ Time animations disabled
433
+ </p>
434
+ </div>
435
+ ),
436
+ withTimeAnimation: false,
437
+ withMultiLayerDistortion: false,
438
+ mode: 'standard',
439
+ displacementScale: 50,
440
+ blurAmount: 2,
441
+ saturation: 140,
442
+ borderRadius: 20,
443
+ },
444
+ decorators: [
445
+ (Story) => (
446
+ <BackgroundWrapper backgroundImage={backgroundImages[0]}>
447
+ <Story />
448
+ </BackgroundWrapper>
449
+ ),
450
+ ],
451
+ };
452
+
453
+ /**
454
+ * Custom FBM Parameters
455
+ *
456
+ * Fine-tuned control over FBM lacunarity and gain.
457
+ * For advanced users who want specific distortion characteristics.
458
+ */
459
+ export const CustomFBMParameters: Story = {
460
+ args: {
461
+ children: (
462
+ <div style={{ padding: '60px 40px', color: 'white' }}>
463
+ <h2 style={{ margin: '0 0 12px 0', fontSize: '26px', fontWeight: 700 }}>
464
+ Custom FBM
465
+ </h2>
466
+ <div style={{ fontSize: '13px', opacity: 0.85, lineHeight: 1.8 }}>
467
+ <div>Octaves: 6</div>
468
+ <div>Lacunarity: 2.5</div>
469
+ <div>Gain: 0.65</div>
470
+ </div>
471
+ </div>
472
+ ),
473
+ withTimeAnimation: true,
474
+ animationSpeed: 1.0,
475
+ withMultiLayerDistortion: true,
476
+ distortionOctaves: 6,
477
+ distortionLacunarity: 2.5, // Higher frequency progression
478
+ distortionGain: 0.65, // Slower amplitude decay
479
+ distortionQuality: 'high', // Overridden by custom values
480
+ mode: 'shader',
481
+ displacementScale: 65,
482
+ blurAmount: 1.5,
483
+ saturation: 145,
484
+ borderRadius: 24,
485
+ },
486
+ decorators: [
487
+ (Story) => (
488
+ <BackgroundWrapper backgroundImage={backgroundImages[1]}>
489
+ <Story />
490
+ </BackgroundWrapper>
491
+ ),
492
+ ],
493
+ };
494
+
495
+ /**
496
+ * Accessibility - Reduced Motion
497
+ *
498
+ * Automatically respects prefers-reduced-motion preference.
499
+ * When enabled, all time-based animations are disabled.
500
+ */
501
+ export const AccessibilityReducedMotion: Story = {
502
+ args: {
503
+ children: (
504
+ <div style={{ padding: '40px', textAlign: 'center', color: 'white' }}>
505
+ <div style={{ fontSize: '48px', marginBottom: '16px' }}>♿</div>
506
+ <h2 style={{ margin: '0 0 8px 0', fontSize: '22px', fontWeight: 600 }}>
507
+ Reduced Motion
508
+ </h2>
509
+ <p style={{ margin: 0, fontSize: '14px', opacity: 0.8 }}>
510
+ Respects accessibility preferences
511
+ </p>
512
+ </div>
513
+ ),
514
+ withTimeAnimation: true, // Will be disabled by reducedMotion
515
+ reducedMotion: true, // Explicitly enable reduced motion
516
+ withMultiLayerDistortion: false,
517
+ mode: 'standard',
518
+ displacementScale: 40,
519
+ blurAmount: 2,
520
+ saturation: 130,
521
+ borderRadius: 20,
522
+ },
523
+ decorators: [
524
+ (Story) => (
525
+ <BackgroundWrapper backgroundImage={backgroundImages[2]}>
526
+ <Story />
527
+ </BackgroundWrapper>
528
+ ),
529
+ ],
530
+ };
531
+
532
+ /**
533
+ * Performance Comparison
534
+ *
535
+ * Side-by-side comparison of different quality presets.
536
+ * Use this to choose the right balance for your use case.
537
+ */
538
+ export const PerformanceComparison: Story = {
539
+ render: () => (
540
+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: '24px', maxWidth: '900px' }}>
541
+ {/* Low Quality */}
542
+ <div>
543
+ <AtomixGlass
544
+ withTimeAnimation={true}
545
+ animationSpeed={1.0}
546
+ withMultiLayerDistortion={true}
547
+ distortionQuality="low"
548
+ mode="shader"
549
+ displacementScale={50}
550
+ blurAmount={2}
551
+ saturation={130}
552
+ borderRadius={20}
553
+ height={200}
554
+ >
555
+ <div style={{ padding: '24px', color: 'white', textAlign: 'center' }}>
556
+ <div style={{ fontSize: '32px', marginBottom: '12px' }}>📱</div>
557
+ <h3 style={{ margin: '0 0 4px 0', fontSize: '16px', fontWeight: 600 }}>
558
+ Low
559
+ </h3>
560
+ <p style={{ margin: 0, fontSize: '11px', opacity: 0.8 }}>
561
+ 2 octaves • Mobile
562
+ </p>
563
+ </div>
564
+ </AtomixGlass>
565
+ </div>
566
+
567
+ {/* Medium Quality */}
568
+ <div>
569
+ <AtomixGlass
570
+ withTimeAnimation={true}
571
+ animationSpeed={1.0}
572
+ withMultiLayerDistortion={true}
573
+ distortionQuality="medium"
574
+ mode="shader"
575
+ displacementScale={50}
576
+ blurAmount={2}
577
+ saturation={130}
578
+ borderRadius={20}
579
+ height={200}
580
+ >
581
+ <div style={{ padding: '24px', color: 'white', textAlign: 'center' }}>
582
+ <div style={{ fontSize: '32px', marginBottom: '12px' }}>💻</div>
583
+ <h3 style={{ margin: '0 0 4px 0', fontSize: '16px', fontWeight: 600 }}>
584
+ Medium
585
+ </h3>
586
+ <p style={{ margin: 0, fontSize: '11px', opacity: 0.8 }}>
587
+ 4 octaves • Tablet
588
+ </p>
589
+ </div>
590
+ </AtomixGlass>
591
+ </div>
592
+
593
+ {/* High Quality */}
594
+ <div>
595
+ <AtomixGlass
596
+ withTimeAnimation={true}
597
+ animationSpeed={1.0}
598
+ withMultiLayerDistortion={true}
599
+ distortionQuality="high"
600
+ mode="shader"
601
+ displacementScale={50}
602
+ blurAmount={2}
603
+ saturation={130}
604
+ borderRadius={20}
605
+ height={200}
606
+ >
607
+ <div style={{ padding: '24px', color: 'white', textAlign: 'center' }}>
608
+ <div style={{ fontSize: '32px', marginBottom: '12px' }}>🖥️</div>
609
+ <h3 style={{ margin: '0 0 4px 0', fontSize: '16px', fontWeight: 600 }}>
610
+ High
611
+ </h3>
612
+ <p style={{ margin: 0, fontSize: '11px', opacity: 0.8 }}>
613
+ 5 octaves • Desktop
614
+ </p>
615
+ </div>
616
+ </AtomixGlass>
617
+ </div>
618
+
619
+ {/* Ultra Quality */}
620
+ <div>
621
+ <AtomixGlass
622
+ withTimeAnimation={true}
623
+ animationSpeed={1.0}
624
+ withMultiLayerDistortion={true}
625
+ distortionQuality="ultra"
626
+ mode="shader"
627
+ displacementScale={50}
628
+ blurAmount={2}
629
+ saturation={130}
630
+ borderRadius={20}
631
+ height={200}
632
+ >
633
+ <div style={{ padding: '24px', color: 'white', textAlign: 'center' }}>
634
+ <div style={{ fontSize: '32px', marginBottom: '12px' }}>🚀</div>
635
+ <h3 style={{ margin: '0 0 4px 0', fontSize: '16px', fontWeight: 600 }}>
636
+ Ultra
637
+ </h3>
638
+ <p style={{ margin: 0, fontSize: '11px', opacity: 0.8 }}>
639
+ 7 octaves • High-end
640
+ </p>
641
+ </div>
642
+ </AtomixGlass>
643
+ </div>
644
+ </div>
645
+ ),
646
+ decorators: [
647
+ (Story) => (
648
+ <BackgroundWrapper backgroundImage={backgroundImages[0]}>
649
+ <Story />
650
+ </BackgroundWrapper>
651
+ ),
652
+ ],
653
+ };