@shohojdhara/atomix 0.5.0 → 0.5.2
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/atomix.config.ts +12 -0
- package/build-tools/webpack-loader.js +5 -4
- package/dist/atomix.css +230 -83
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +1 -1
- package/dist/atomix.min.css.map +1 -1
- package/dist/build-tools/webpack-loader.js +5 -4
- package/dist/charts.d.ts +24 -23
- package/dist/charts.js +271 -369
- package/dist/charts.js.map +1 -1
- package/dist/config.d.ts +624 -0
- package/dist/config.js +59 -0
- package/dist/config.js.map +1 -0
- package/dist/core.d.ts +3 -2
- package/dist/core.js +342 -382
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +4 -6
- package/dist/forms.js +233 -334
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +11 -2
- package/dist/heavy.js +406 -445
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +109 -65
- package/dist/index.esm.js +654 -748
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +621 -717
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layout.js +59 -60
- package/dist/layout.js.map +1 -1
- package/dist/theme.js +4 -4
- package/dist/theme.js.map +1 -1
- package/package.json +24 -9
- package/scripts/atomix-cli.js +15 -1
- package/scripts/cli/__tests__/complexity-utils.test.js +24 -0
- package/scripts/cli/__tests__/detector.test.js +50 -0
- package/scripts/cli/__tests__/template-engine.test.js +23 -0
- package/scripts/cli/__tests__/test-setup.js +1 -133
- package/scripts/cli/commands/doctor.js +15 -3
- package/scripts/cli/commands/generate.js +113 -51
- package/scripts/cli/internal/ai-engine.js +30 -10
- package/scripts/cli/internal/complexity-utils.js +60 -0
- package/scripts/cli/internal/component-validator.js +49 -16
- package/scripts/cli/internal/generator.js +89 -36
- package/scripts/cli/internal/hook-generator.js +5 -2
- package/scripts/cli/internal/itcss-generator.js +16 -12
- package/scripts/cli/templates/next-templates.js +81 -30
- package/scripts/cli/templates/storybook-templates.js +12 -2
- package/scripts/cli/utils/detector.js +45 -7
- package/scripts/cli/utils/diagnostics.js +78 -0
- package/scripts/cli/utils/telemetry.js +13 -0
- package/src/components/Accordion/Accordion.stories.tsx +4 -0
- package/src/components/AtomixGlass/AtomixGlass.tsx +188 -128
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +63 -91
- package/src/components/AtomixGlass/PerformanceDashboard.tsx +153 -201
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +9 -6
- package/src/components/AtomixGlass/glass-utils.ts +51 -1
- package/src/components/AtomixGlass/stories/AnimationFeatures.stories.tsx +52 -46
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +573 -236
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +88 -41
- package/src/components/AtomixGlass/stories/argTypes.ts +19 -19
- package/src/components/AtomixGlass/stories/shared-components.tsx +7 -12
- package/src/components/AtomixGlass/stories/types.ts +3 -3
- package/src/components/Button/Button.tsx +114 -57
- package/src/components/Callout/Callout.tsx +4 -4
- package/src/components/Chart/ChartRenderer.tsx +1 -1
- package/src/components/Chart/DonutChart.tsx +11 -8
- package/src/components/EdgePanel/EdgePanel.tsx +119 -115
- package/src/components/Form/Select.tsx +4 -4
- package/src/components/List/List.tsx +4 -4
- package/src/components/Navigation/SideMenu/SideMenu.tsx +6 -6
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +1 -1
- package/src/components/ProductReview/ProductReview.tsx +4 -2
- package/src/components/Rating/Rating.tsx +4 -2
- package/src/components/SectionIntro/SectionIntro.tsx +4 -2
- package/src/components/Steps/Steps.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +5 -5
- package/src/components/Testimonial/Testimonial.tsx +4 -2
- package/src/components/VideoPlayer/VideoPlayer.tsx +4 -2
- package/src/layouts/CssGrid/CssGrid.stories.tsx +464 -0
- package/src/layouts/CssGrid/CssGrid.tsx +215 -0
- package/src/layouts/CssGrid/index.ts +8 -0
- package/src/layouts/CssGrid/scripts/CssGrid.js +284 -0
- package/src/layouts/CssGrid/scripts/index.js +43 -0
- package/src/layouts/Grid/scripts/Container.js +139 -0
- package/src/layouts/Grid/scripts/Grid.js +184 -0
- package/src/layouts/Grid/scripts/GridCol.js +273 -0
- package/src/layouts/Grid/scripts/Row.js +154 -0
- package/src/layouts/Grid/scripts/index.js +48 -0
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +71 -59
- package/src/lib/composables/atomix-glass/useGlassSize.ts +1 -1
- package/src/lib/composables/useAccordion.ts +5 -5
- package/src/lib/composables/useAtomixGlass.ts +111 -74
- package/src/lib/composables/useAtomixGlassStyles.ts +0 -2
- package/src/lib/composables/useBarChart.ts +2 -2
- package/src/lib/composables/useChart.ts +3 -2
- package/src/lib/composables/useChartToolbar.ts +48 -66
- package/src/lib/composables/useDataTable.ts +1 -1
- package/src/lib/composables/useDatePicker.ts +2 -2
- package/src/lib/composables/useEdgePanel.ts +45 -54
- package/src/lib/composables/useHeroBackgroundSlider.ts +5 -5
- package/src/lib/composables/usePhotoViewer.ts +2 -3
- package/src/lib/composables/usePieChart.ts +1 -1
- package/src/lib/composables/usePopover.ts +151 -139
- package/src/lib/composables/useSideMenu.ts +28 -41
- package/src/lib/composables/useSlider.ts +2 -6
- package/src/lib/composables/useTooltip.ts +2 -2
- package/src/lib/config/index.ts +39 -0
- package/src/lib/constants/components.ts +1 -0
- package/src/lib/theme/devtools/Comparator.tsx +1 -1
- package/src/lib/theme/devtools/Inspector.tsx +1 -1
- package/src/lib/theme/devtools/LiveEditor.tsx +1 -1
- package/src/lib/theme/runtime/ThemeProvider.tsx +1 -1
- package/src/lib/types/components.ts +1 -0
- package/src/styles/01-settings/_index.scss +1 -0
- package/src/styles/01-settings/_settings.atomix-glass.scss +174 -0
- package/src/styles/01-settings/_settings.masonry-grid.scss +42 -6
- package/src/styles/02-tools/_tools.glass.scss +6 -0
- package/src/styles/05-objects/_objects.masonry-grid.scss +162 -24
- package/src/styles/06-components/_components.atomix-glass.scss +160 -99
- package/scripts/cli/__tests__/README.md +0 -81
- package/scripts/cli/__tests__/basic.test.js +0 -116
- package/scripts/cli/__tests__/clean.test.js +0 -278
- package/scripts/cli/__tests__/component-generator.test.js +0 -332
- package/scripts/cli/__tests__/component-validator.test.js +0 -433
- package/scripts/cli/__tests__/generator.test.js +0 -613
- package/scripts/cli/__tests__/glass-motion.test.js +0 -256
- package/scripts/cli/__tests__/integration.test.js +0 -938
- package/scripts/cli/__tests__/migrate.test.js +0 -74
- package/scripts/cli/__tests__/security.test.js +0 -206
- package/scripts/cli/__tests__/theme-bridge.test.js +0 -507
- package/scripts/cli/__tests__/token-manager.test.js +0 -251
- package/scripts/cli/__tests__/token-provider.test.js +0 -361
- package/scripts/cli/__tests__/utils.test.js +0 -165
- package/src/components/AtomixGlass/stories/AnimationTests.stories.tsx +0 -95
- package/src/components/AtomixGlass/stories/CardExamples.stories.tsx +0 -212
- package/src/components/AtomixGlass/stories/Customization.stories.tsx +0 -131
- package/src/components/AtomixGlass/stories/DashboardExamples.stories.tsx +0 -348
- package/src/components/AtomixGlass/stories/EcommerceExamples.stories.tsx +0 -410
- package/src/components/AtomixGlass/stories/FormExamples.stories.tsx +0 -436
- package/src/components/AtomixGlass/stories/HeroExamples.stories.tsx +0 -264
- package/src/components/AtomixGlass/stories/InteractivePlayground.stories.tsx +0 -247
- package/src/components/AtomixGlass/stories/MobileUIExamples.stories.tsx +0 -418
- package/src/components/AtomixGlass/stories/ModalExamples.stories.tsx +0 -402
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +0 -1082
- package/src/components/AtomixGlass/stories/Overview.stories.tsx +0 -497
- package/src/components/AtomixGlass/stories/Performance.stories.tsx +0 -103
- package/src/components/AtomixGlass/stories/PresetGallery.stories.tsx +0 -335
- package/src/components/AtomixGlass/stories/Shaders.stories.tsx +0 -395
- package/src/components/AtomixGlass/stories/WidgetExamples.stories.tsx +0 -441
- package/src/components/TypedButton/TypedButton.stories.tsx +0 -59
- package/src/components/TypedButton/TypedButton.tsx +0 -39
- package/src/components/TypedButton/index.ts +0 -2
- package/src/lib/composables/useBreadcrumb.ts +0 -81
- package/src/lib/composables/useChartInteractions.ts +0 -123
- package/src/lib/composables/useChartPerformance.ts +0 -347
- package/src/lib/composables/useDropdown.ts +0 -338
- package/src/lib/composables/useModal.ts +0 -110
- package/src/lib/composables/useTypedButton.ts +0 -66
- package/src/lib/hooks/usePerformanceMonitor.ts +0 -148
- package/src/lib/utils/displacement-generator.ts +0 -92
- package/src/lib/utils/memoryMonitor.ts +0 -191
- package/src/styles/01-settings/_settings.testtypecheck.scss +0 -53
- package/src/styles/01-settings/_settings.typedbutton.scss +0 -53
- package/src/styles/06-components/_components.testbutton.scss +0 -212
- package/src/styles/06-components/_components.testtypecheck.scss +0 -212
- package/src/styles/06-components/_components.typedbutton.scss +0 -212
|
@@ -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
|
-
};
|