@shohojdhara/atomix 0.4.9 → 0.5.1

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 (67) hide show
  1. package/dist/atomix.css +95 -69
  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/charts.d.ts +1 -0
  6. package/dist/charts.js +231 -332
  7. package/dist/charts.js.map +1 -1
  8. package/dist/core.d.ts +1 -0
  9. package/dist/core.js +232 -333
  10. package/dist/core.js.map +1 -1
  11. package/dist/forms.d.ts +1 -0
  12. package/dist/forms.js +231 -332
  13. package/dist/forms.js.map +1 -1
  14. package/dist/heavy.d.ts +11 -2
  15. package/dist/heavy.js +233 -334
  16. package/dist/heavy.js.map +1 -1
  17. package/dist/index.d.ts +13 -2
  18. package/dist/index.esm.js +228 -327
  19. package/dist/index.esm.js.map +1 -1
  20. package/dist/index.js +227 -326
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.min.js +1 -1
  23. package/dist/index.min.js.map +1 -1
  24. package/package.json +11 -1
  25. package/src/components/AtomixGlass/AtomixGlass.tsx +188 -128
  26. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +62 -90
  27. package/src/components/AtomixGlass/PerformanceDashboard.tsx +153 -201
  28. package/src/components/AtomixGlass/glass-utils.ts +50 -0
  29. package/src/components/AtomixGlass/shader-utils.ts +1 -1
  30. package/src/components/AtomixGlass/stories/{Phase1-Animation.stories.tsx → AnimationFeatures.stories.tsx} +53 -47
  31. package/src/components/AtomixGlass/stories/Examples.stories.tsx +573 -236
  32. package/src/components/AtomixGlass/stories/Playground.stories.tsx +656 -44
  33. package/src/components/AtomixGlass/stories/argTypes.ts +384 -0
  34. package/src/components/AtomixGlass/stories/shared-components.tsx +82 -3
  35. package/src/components/AtomixGlass/stories/types.ts +127 -0
  36. package/src/lib/composables/useAtomixGlass.ts +108 -71
  37. package/src/lib/composables/useAtomixGlassStyles.ts +0 -2
  38. package/src/lib/constants/components.ts +1 -0
  39. package/src/lib/types/components.ts +1 -0
  40. package/src/lib/utils/displacement-generator.ts +1 -1
  41. package/src/styles/06-components/_components.atomix-glass.scss +158 -97
  42. package/scripts/cli/__tests__/README.md +0 -81
  43. package/scripts/cli/__tests__/basic.test.js +0 -116
  44. package/scripts/cli/__tests__/clean.test.js +0 -278
  45. package/scripts/cli/__tests__/component-generator.test.js +0 -332
  46. package/scripts/cli/__tests__/component-validator.test.js +0 -433
  47. package/scripts/cli/__tests__/generator.test.js +0 -613
  48. package/scripts/cli/__tests__/glass-motion.test.js +0 -256
  49. package/scripts/cli/__tests__/integration.test.js +0 -938
  50. package/scripts/cli/__tests__/migrate.test.js +0 -74
  51. package/scripts/cli/__tests__/security.test.js +0 -206
  52. package/scripts/cli/__tests__/test-setup.js +0 -135
  53. package/scripts/cli/__tests__/theme-bridge.test.js +0 -507
  54. package/scripts/cli/__tests__/token-manager.test.js +0 -251
  55. package/scripts/cli/__tests__/token-provider.test.js +0 -361
  56. package/scripts/cli/__tests__/utils.test.js +0 -165
  57. package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +0 -216
  58. package/src/components/AtomixGlass/stories/Customization.stories.tsx +0 -131
  59. package/src/components/AtomixGlass/stories/Modes.stories.tsx +0 -1082
  60. package/src/components/AtomixGlass/stories/Overview.stories.tsx +0 -497
  61. package/src/components/AtomixGlass/stories/Performance.stories.tsx +0 -103
  62. package/src/components/AtomixGlass/stories/Phase1-Test.stories.tsx +0 -95
  63. package/src/components/AtomixGlass/stories/Shaders.stories.tsx +0 -395
  64. package/src/components/TypedButton/TypedButton.stories.tsx +0 -59
  65. package/src/components/TypedButton/TypedButton.tsx +0 -39
  66. package/src/components/TypedButton/index.ts +0 -2
  67. package/src/lib/composables/useTypedButton.ts +0 -66
@@ -1,497 +0,0 @@
1
- /**
2
- * Overview.stories.tsx
3
- *
4
- * Overview and basic usage for AtomixGlass
5
- *
6
- * @package Atomix
7
- * @component AtomixGlass
8
- */
9
-
10
- import type { Meta, StoryObj } from '@storybook/react';
11
- import { fn } from '@storybook/test';
12
- import React from 'react';
13
- import AtomixGlass from '../AtomixGlass';
14
- import Button from '../../Button/Button';
15
- import { BackgroundWrapper, backgroundImages } from './shared-components';
16
-
17
- // ============================================================================
18
- // TYPE DEFINITIONS
19
- // ============================================================================
20
-
21
- /**
22
- * Type helper for story props without children requirement
23
- */
24
- type AtomixGlassStoryProps = Omit<React.ComponentProps<typeof AtomixGlass>, 'children'> & {
25
- children?: React.ReactNode;
26
- };
27
-
28
- // ============================================================================
29
- // EVENT HANDLERS
30
- // ============================================================================
31
-
32
- /**
33
- * Event handlers for documentation
34
- */
35
- const mockHandlers = {
36
- onClick: fn(),
37
- onAction: fn(),
38
- onChange: fn(),
39
- };
40
-
41
- // ============================================================================
42
- // META CONFIGURATION
43
- // ============================================================================
44
-
45
- const meta: Meta<typeof AtomixGlass> = {
46
- title: 'Components/AtomixGlass',
47
- component: AtomixGlass,
48
- parameters: {
49
- layout: 'fullscreen',
50
- docs: {
51
- description: {
52
- component: `
53
- # AtomixGlass
54
-
55
- ## Overview
56
-
57
- AtomixGlass is a premium glass morphism component with realistic light refraction, chromatic aberration, and interactive effects. Perfect for cards, modals, and premium UI elements that need visual depth and elegance.
58
-
59
- ## Features
60
-
61
- - Realistic glass effect with displacement and blur
62
- - Chromatic aberration for depth perception
63
- - Interactive hover effects with mouse tracking
64
- - Multiple rendering modes (standard, polar, prominent, shader)
65
- - Highly customizable parameters
66
- - Performance optimized for smooth animations
67
-
68
- ## Accessibility
69
-
70
- - Keyboard support: Full keyboard navigation compatibility
71
- - Screen reader: Proper ARIA labels and descriptions
72
- - ARIA support: All standard ARIA attributes supported
73
- - Focus management: Proper focus handling within the component
74
-
75
- ## Usage Examples
76
-
77
- ### Basic Usage
78
-
79
- \`\`\`typescript
80
- <AtomixGlass>
81
- <div>Your content here</div>
82
- </AtomixGlass>
83
- \`\`\`
84
-
85
- ### With Custom Configuration
86
-
87
- \`\`\`typescript
88
- <AtomixGlass
89
- displacementScale={80}
90
- blurAmount={0.5}
91
- saturation={140}
92
- aberrationIntensity={2}
93
- >
94
- <div>Your premium content here</div>
95
- </AtomixGlass>
96
- \`\`\`
97
-
98
- ## API Reference
99
-
100
- ### Props
101
-
102
- | Prop | Type | Default | Description |
103
- | -------- | -------------- | --------- | ----------------------- |
104
- | children | ReactNode | undefined | Content to display inside the glass effect |
105
- | displacementScale | number | 70 | Displacement scale for the glass effect |
106
- | blurAmount | number | 0.0625 | Blur amount for the backdrop |
107
- | saturation | number | 140 | Saturation percentage for the backdrop |
108
- | aberrationIntensity | number | 2 | Chromatic aberration intensity |
109
- | elasticity | number | 0.15 | Elasticity factor for mouse interactions |
110
- | borderRadius | number | 20 | Corner radius in pixels |
111
- | overLight | boolean/object | "auto" | OverLight configuration mode |
112
- | mode | "standard/polar/prominent/shader" | "standard" | Glass effect mode |
113
- | onClick | function | undefined | Click event handler |
114
-
115
- ## Design Tokens
116
-
117
- Used design tokens:
118
-
119
- - \`--atomix-glass-displacement-scale\`: Displacement scale value
120
- - \`--atomix-glass-blur-amount\`: Blur amount value
121
- - \`--atomix-glass-saturation\`: Saturation value
122
- - \`--atomix-glass-aberration-intensity\`: Aberration intensity value
123
-
124
- ## Notes
125
-
126
- This component is performance-intensive. Use sparingly and consider performance implications on mobile devices.
127
- `,
128
- },
129
- },
130
- },
131
- tags: ['autodocs'],
132
- argTypes: {
133
- children: {
134
- control: 'text',
135
- description: 'Content to display inside the glass effect',
136
- table: {
137
- category: 'Content',
138
- defaultValue: { summary: '-' },
139
- },
140
- },
141
- displacementScale: {
142
- control: { type: 'range', min: 0, max: 100, step: 1 },
143
- description: 'Displacement scale for the glass effect (default: 70)',
144
- table: {
145
- category: 'Visual',
146
- defaultValue: { summary: '70' },
147
- },
148
- },
149
- blurAmount: {
150
- control: { type: 'range', min: 0, max: 10, step: 0.5 },
151
- description: 'Blur amount for the backdrop (default: 0.0625)',
152
- table: {
153
- category: 'Visual',
154
- defaultValue: { summary: '0.0625' },
155
- },
156
- },
157
- saturation: {
158
- control: { type: 'range', min: 100, max: 300, step: 5 },
159
- description: 'Saturation percentage for the backdrop (default: 140)',
160
- table: {
161
- category: 'Visual',
162
- defaultValue: { summary: '140' },
163
- },
164
- },
165
- aberrationIntensity: {
166
- control: { type: 'range', min: 0, max: 10, step: 0.1 },
167
- description: 'Chromatic aberration intensity (default: 2)',
168
- table: {
169
- category: 'Visual',
170
- defaultValue: { summary: '2' },
171
- },
172
- },
173
- elasticity: {
174
- control: { type: 'range', min: 0, max: 1, step: 0.01 },
175
- description: 'Elasticity factor for mouse interactions (default: 0.15)',
176
- table: {
177
- category: 'Interaction',
178
- defaultValue: { summary: '0.15' },
179
- },
180
- },
181
- borderRadius: {
182
- control: { type: 'range', min: 0, max: 50, step: 1 },
183
- description: 'Corner radius in pixels (default: 20)',
184
- table: {
185
- category: 'Visual',
186
- defaultValue: { summary: '20' },
187
- },
188
- },
189
- overLight: {
190
- control: {
191
- type: 'select',
192
- labels: {
193
- false: 'false (Dark Background)',
194
- true: 'true (Light Background)',
195
- auto: 'auto (Auto-detect)',
196
- },
197
- },
198
- options: [false, true, 'auto'],
199
- description: 'OverLight configuration mode',
200
- table: {
201
- category: 'Visual',
202
- defaultValue: { summary: '"auto"' },
203
- type: { summary: 'boolean | "auto"' },
204
- },
205
- },
206
- mode: {
207
- control: { type: 'inline-radio', options: ['standard', 'polar', 'prominent', 'shader'] },
208
- description: 'Glass effect mode (default: "standard")',
209
- table: {
210
- category: 'Visual',
211
- defaultValue: { summary: '"standard"' },
212
- },
213
- },
214
- onClick: {
215
- action: 'clicked',
216
- description: 'Click event handler',
217
- table: {
218
- category: 'Events',
219
- defaultValue: { summary: '-' },
220
- },
221
- },
222
- padding: {
223
- control: { type: 'text' },
224
- description: 'Padding for the glass component',
225
- table: {
226
- category: 'Style',
227
- defaultValue: { summary: '0' },
228
- },
229
- },
230
- height: {
231
- control: { type: 'text' },
232
- description: 'Height of the glass component',
233
- table: {
234
- category: 'Style',
235
- defaultValue: { summary: 'undefined' },
236
- },
237
- },
238
- width: {
239
- control: { type: 'text' },
240
- description: 'Width of the glass component',
241
- table: {
242
- category: 'Style',
243
- defaultValue: { summary: 'undefined' },
244
- },
245
- },
246
- devicePreset: {
247
- control: { type: 'inline-radio', options: ['performance', 'balanced', 'quality'] },
248
- description: 'Device preset for responsive optimization (default: "balanced")',
249
- table: {
250
- category: 'Performance',
251
- defaultValue: { summary: '"balanced"' },
252
- },
253
- },
254
- disableResponsiveBreakpoints: {
255
- control: 'boolean',
256
- description: 'Disable responsive breakpoint system (default: false)',
257
- table: {
258
- category: 'Performance',
259
- defaultValue: { summary: 'false' },
260
- },
261
- },
262
- withTimeAnimation: {
263
- control: 'boolean',
264
- description: 'Enable time-based animation (Phase 1, default: true)',
265
- table: {
266
- category: 'Animation',
267
- defaultValue: { summary: 'true' },
268
- },
269
- },
270
- animationSpeed: {
271
- control: { type: 'range', min: 0, max: 3, step: 0.1 },
272
- description: 'Animation speed multiplier (Phase 1, default: 1.0)',
273
- table: {
274
- category: 'Animation',
275
- defaultValue: { summary: '1.0' },
276
- },
277
- },
278
- withMultiLayerDistortion: {
279
- control: 'boolean',
280
- description: 'Enable multi-layer distortion using FBM (Phase 1, default: false)',
281
- table: {
282
- category: 'Animation',
283
- defaultValue: { summary: 'false' },
284
- },
285
- },
286
- distortionOctaves: {
287
- control: { type: 'range', min: 1, max: 8, step: 1 },
288
- description: 'Number of octaves for FBM distortion (Phase 1, default: 5)',
289
- table: {
290
- category: 'Animation',
291
- defaultValue: { summary: '5' },
292
- },
293
- },
294
- distortionLacunarity: {
295
- control: { type: 'range', min: 1, max: 4, step: 0.1 },
296
- description: 'Lacunarity for FBM distortion (Phase 1, default: 2.0)',
297
- table: {
298
- category: 'Animation',
299
- defaultValue: { summary: '2.0' },
300
- },
301
- },
302
- distortionGain: {
303
- control: { type: 'range', min: 0.1, max: 1, step: 0.1 },
304
- description: 'Gain for FBM distortion (Phase 1, default: 0.5)',
305
- table: {
306
- category: 'Animation',
307
- defaultValue: { summary: '0.5' },
308
- },
309
- },
310
- distortionQuality: {
311
- control: { type: 'select', options: ['low', 'medium', 'high', 'ultra'] },
312
- description: 'Quality preset for FBM distortion (Phase 1, default: "high")',
313
- table: {
314
- category: 'Animation',
315
- defaultValue: { summary: '"high"' },
316
- },
317
- },
318
- debugPerformance: {
319
- control: 'boolean',
320
- description: 'Enable performance monitoring dashboard (development only)',
321
- table: {
322
- category: 'Debug',
323
- defaultValue: { summary: 'false' },
324
- },
325
- },
326
- debugBorderRadius: {
327
- control: 'boolean',
328
- description: 'Debug mode for corner radius extraction',
329
- table: {
330
- category: 'Debug',
331
- defaultValue: { summary: 'false' },
332
- },
333
- },
334
- className: {
335
- control: 'text',
336
- description: 'Additional CSS class names',
337
- table: {
338
- category: 'Style',
339
- defaultValue: { summary: '-' },
340
- },
341
- },
342
- style: {
343
- control: 'object',
344
- description: 'CSS style object',
345
- table: {
346
- category: 'Style',
347
- defaultValue: { summary: '{}' },
348
- },
349
- },
350
- 'aria-label': {
351
- control: 'text',
352
- description: 'ARIA label for accessibility',
353
- table: {
354
- category: 'Accessibility',
355
- defaultValue: { summary: '-' },
356
- },
357
- },
358
- reducedMotion: {
359
- control: 'boolean',
360
- description: 'Override for reduced motion preference (default: false)',
361
- table: {
362
- category: 'Accessibility',
363
- defaultValue: { summary: 'false' },
364
- },
365
- },
366
- },
367
- } satisfies Meta<typeof AtomixGlass>;
368
-
369
- export default meta;
370
- type Story = StoryObj<typeof meta>;
371
-
372
- // ============================================================================
373
- // BASIC USAGE STORIES
374
- // ============================================================================
375
-
376
- export const BasicUsage: Story = {
377
- args: {
378
- children: (
379
- <div className="u-text-center u-flex u-flex-column u-items-center u-justify-center">
380
- <h2 className="u-mb-4 u-mt-0 u-text-white u-text-2xl u-font-bold">Basic Glass Effect</h2>
381
- <p className="u-mb-6 u-mt-0 u-text-white u-opacity-90 u-text-base">
382
- This is a basic AtomixGlass component with default settings.
383
- </p>
384
- <Button variant="primary" glass>
385
- Click Me
386
- </Button>
387
- </div>
388
- ),
389
- padding: '32px', // Increased padding for better visual appearance
390
- },
391
- decorators: [
392
- Story => (
393
- <BackgroundWrapper backgroundImage={backgroundImages[2]} overlay overlayOpacity={0.2}>
394
- <Story />
395
- </BackgroundWrapper>
396
- ),
397
- ],
398
- parameters: {
399
- docs: {
400
- description: {
401
- story: 'The basic usage of the AtomixGlass component with default configuration.',
402
- },
403
- },
404
- },
405
- };
406
-
407
- export const WithAllProps: Story = {
408
- args: {
409
- children: (
410
- <div className="u-text-center">
411
- <h2 className="u-mb-4 u-mt-0 u-text-white u-text-2xl u-font-bold">Fully Configured Glass</h2>
412
- <p className="u-mb-6 u-mt-0 u-text-white u-opacity-90 u-text-base">
413
- This glass component uses all configurable props.
414
- </p>
415
- <div className="u-flex u-gap-4 u-justify-center">
416
- <Button variant="primary" glass>
417
- Primary
418
- </Button>
419
- <Button variant="outline-primary" glass>
420
- Outline
421
- </Button>
422
- </div>
423
- </div>
424
- ),
425
- displacementScale: 80,
426
- blurAmount: 0.5,
427
- saturation: 150,
428
- aberrationIntensity: 2.5,
429
- elasticity: 0.2,
430
- borderRadius: 24,
431
- mode: 'standard',
432
- overLight: true,
433
- padding: '32px', // Increased padding for better visual appearance
434
- devicePreset: 'balanced',
435
- withTimeAnimation: true,
436
- animationSpeed: 1.0,
437
- withMultiLayerDistortion: false,
438
- distortionOctaves: 5,
439
- distortionLacunarity: 2.0,
440
- distortionGain: 0.5,
441
- distortionQuality: 'high',
442
- onClick: mockHandlers.onClick,
443
- },
444
- decorators: [
445
- Story => (
446
- <BackgroundWrapper backgroundImage={backgroundImages[0]} overlay overlayOpacity={0.3}>
447
- <Story />
448
- </BackgroundWrapper>
449
- ),
450
- ],
451
- parameters: {
452
- docs: {
453
- description: {
454
- story: 'Demonstrates AtomixGlass with all configurable props set to custom values.',
455
- },
456
- },
457
- },
458
- };
459
-
460
- export const PerformanceOptimized: Story = {
461
- args: {
462
- children: (
463
- <div className="u-text-center u-flex u-flex-column u-items-center u-justify-center">
464
- <h2 className="u-mb-4 u-mt-0 u-text-white u-text-2xl u-font-bold">Performance Mode</h2>
465
- <p className="u-mb-6 u-mt-0 u-text-white u-opacity-90 u-text-base">
466
- Optimized for mobile devices with reduced quality presets.
467
- </p>
468
- <Button variant="primary" glass>
469
- Mobile Optimized
470
- </Button>
471
- </div>
472
- ),
473
- devicePreset: 'performance',
474
- disableResponsiveBreakpoints: false,
475
- distortionQuality: 'low',
476
- distortionOctaves: 2,
477
- displacementScale: 50,
478
- blurAmount: 0,
479
- saturation: 120,
480
- aberrationIntensity: 1.5,
481
- padding: '32px',
482
- },
483
- decorators: [
484
- Story => (
485
- <BackgroundWrapper backgroundImage={backgroundImages[2]} overlay overlayOpacity={0.2}>
486
- <Story />
487
- </BackgroundWrapper>
488
- ),
489
- ],
490
- parameters: {
491
- docs: {
492
- description: {
493
- story: 'Shows AtomixGlass optimized for performance on mobile devices using devicePreset="performance" and reduced distortion quality.',
494
- },
495
- },
496
- },
497
- };
@@ -1,103 +0,0 @@
1
- /**
2
- * Performance.stories.tsx
3
- *
4
- * Stories focusing on performance optimization and stress testing.
5
- *
6
- * @package Atomix
7
- * @component AtomixGlass
8
- */
9
-
10
- import React from 'react';
11
- import type { Meta, StoryObj } from '@storybook/react';
12
- import AtomixGlass from '../AtomixGlass';
13
- import { BackgroundWrapper, backgroundImages } from './shared-components';
14
-
15
- const meta: Meta<typeof AtomixGlass> = {
16
- title: 'Components/AtomixGlass/Features/Performance',
17
- component: AtomixGlass,
18
- parameters: {
19
- layout: 'fullscreen',
20
- docs: {
21
- description: {
22
- component:
23
- 'Performance-focused examples including mobile optimization and stress testing with multiple instances.',
24
- },
25
- },
26
- },
27
- };
28
-
29
- export default meta;
30
- type Story = StoryObj<typeof AtomixGlass>;
31
-
32
- export const OptimizedForMobile: Story = {
33
- args: {
34
- children: (
35
- <div className="u-text-center">
36
- <h3 className="u-m-0 u-text-white u-text-20 u-mb-3">Mobile Optimized</h3>
37
- <p className="u-m-0 u-text-white u-opacity-90 u-text-14">
38
- Lower intensity settings for better mobile performance
39
- </p>
40
- </div>
41
- ),
42
- displacementScale: 30, // Lower for performance
43
- blurAmount: 0.2,
44
- saturation: 120,
45
- aberrationIntensity: 1.0,
46
- elasticity: 0.1,
47
- borderRadius: 16,
48
- padding: '28px',
49
- },
50
- render: args => (
51
- <div className="u-bg-gradient-to-br u-from-indigo-500 u-via-purple-500 u-to-blue-500 u-min-h-screen u-w-full u-flex u-items-center u-justify-center">
52
- <div className="u-w-full u-h-full">
53
- <div className="u-flex u-justify-center u-items-center u-h-full">
54
- <AtomixGlass {...args} />
55
- </div>
56
- </div>
57
- </div>
58
- ),
59
- parameters: {
60
- docs: {
61
- description: {
62
- story: 'Optimized configuration for mobile devices with reduced performance impact.',
63
- },
64
- },
65
- },
66
- };
67
-
68
- export const WithManyInstances: Story = {
69
- parameters: {
70
- docs: {
71
- description: {
72
- story:
73
- 'Shows multiple instances of AtomixGlass in a single view - useful for performance testing.',
74
- },
75
- },
76
- },
77
- render: () => {
78
- return (
79
- <BackgroundWrapper backgroundImage={backgroundImages[3]}>
80
- <div className="u-flex u-flex-wrap u-gap-6 u-w-full u-py-60 u-max-w-7xl u-mx-auto u-p-4 u-justify-center">
81
- {[1, 2, 3, 4].map(index => (
82
- <AtomixGlass
83
- key={index}
84
- displacementScale={40}
85
- blurAmount={0.25}
86
- saturation={130}
87
- aberrationIntensity={1.2}
88
- elasticity={0.1}
89
- borderRadius={16}
90
- padding="28px"
91
- className="u-text-center"
92
- >
93
- <h4 className="u-m-0 u-text-white u-text-18 u-mb-2">Glass #{index}</h4>
94
- <p className="u-m-0 u-text-white u-opacity-80 u-text-14">
95
- Instance #{index} of AtomixGlass
96
- </p>
97
- </AtomixGlass>
98
- ))}
99
- </div>
100
- </BackgroundWrapper>
101
- );
102
- },
103
- };
@@ -1,95 +0,0 @@
1
- /**
2
- * Quick Test Story for Phase 1 Animations
3
- *
4
- * This is a minimal test to verify the animation pipeline is working
5
- */
6
-
7
- import type { Meta, StoryObj } from '@storybook/react';
8
- import { AtomixGlass } from '../AtomixGlass';
9
-
10
- const meta = {
11
- title: 'Testing/Phase 1 Animation Quick Test',
12
- component: AtomixGlass,
13
- parameters: {
14
- layout: 'centered',
15
- },
16
- tags: ['autodocs'],
17
- argTypes: {
18
- withTimeAnimation: { control: 'boolean' },
19
- animationSpeed: { control: { type: 'range', min: 0.1, max: 5.0, step: 0.1 } },
20
- distortionOctaves: { control: { type: 'range', min: 1, max: 8, step: 1 } },
21
- distortionQuality: {
22
- control: 'select',
23
- options: ['low', 'medium', 'high', 'ultra']
24
- },
25
- },
26
- } satisfies Meta<typeof AtomixGlass>;
27
-
28
- export default meta;
29
- type Story = StoryObj<typeof meta>;
30
-
31
- // Default test with animations enabled
32
- export const Animated: Story = {
33
- args: {
34
- children: (
35
- <div style={{ padding: '40px', color: 'white', textAlign: 'center' }}>
36
- <h2>Phase 1 Animation Test</h2>
37
- <p>If you see flowing liquid glass effects, it's working!</p>
38
- </div>
39
- ),
40
- mode: 'shader',
41
- withTimeAnimation: true,
42
- animationSpeed: 1.0,
43
- distortionOctaves: 4,
44
- distortionQuality: 'high',
45
- displacementScale: 30,
46
- blurAmount: 8,
47
- saturation: 180,
48
- aberrationIntensity: 3,
49
- // Dark background to make effects visible
50
- style: {
51
- background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
52
- },
53
- },
54
- };
55
-
56
- // Comparison: Same config without animations
57
- export const Static: Story = {
58
- args: {
59
- ...Animated.args,
60
- withTimeAnimation: false,
61
- },
62
- };
63
-
64
- // Speed comparison
65
- export const FastAnimation: Story = {
66
- args: {
67
- ...Animated.args,
68
- animationSpeed: 3.0,
69
- },
70
- };
71
-
72
- export const SlowAnimation: Story = {
73
- args: {
74
- ...Animated.args,
75
- animationSpeed: 0.3,
76
- },
77
- };
78
-
79
- // High complexity FBM
80
- export const HighDetailFBM: Story = {
81
- args: {
82
- ...Animated.args,
83
- distortionOctaves: 7,
84
- distortionQuality: 'ultra',
85
- },
86
- };
87
-
88
- // Mobile optimized (low quality)
89
- export const MobileOptimized: Story = {
90
- args: {
91
- ...Animated.args,
92
- distortionOctaves: 2,
93
- distortionQuality: 'low',
94
- },
95
- };