@shohojdhara/atomix 0.4.8 → 0.5.0

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 (177) hide show
  1. package/atomix.config.ts +58 -1
  2. package/dist/atomix.css +148 -120
  3. package/dist/atomix.css.map +1 -1
  4. package/dist/atomix.min.css +1 -1
  5. package/dist/atomix.min.css.map +1 -1
  6. package/dist/charts.d.ts +33 -0
  7. package/dist/charts.js +1227 -122
  8. package/dist/charts.js.map +1 -1
  9. package/dist/core.d.ts +33 -10
  10. package/dist/core.js +1052 -41
  11. package/dist/core.js.map +1 -1
  12. package/dist/forms.d.ts +33 -0
  13. package/dist/forms.js +2086 -1035
  14. package/dist/forms.js.map +1 -1
  15. package/dist/heavy.d.ts +42 -1
  16. package/dist/heavy.js +1620 -600
  17. package/dist/heavy.js.map +1 -1
  18. package/dist/index.d.ts +441 -270
  19. package/dist/index.esm.js +1900 -638
  20. package/dist/index.esm.js.map +1 -1
  21. package/dist/index.js +1935 -670
  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 +148 -4
  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 +4 -1
  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 +135 -14
  44. package/scripts/cli/commands/init.js +45 -18
  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/component-validator.js +443 -0
  52. package/scripts/cli/internal/config-loader.js +162 -0
  53. package/scripts/cli/internal/filesystem.js +102 -2
  54. package/scripts/cli/internal/generator.js +359 -39
  55. package/scripts/cli/internal/glass-generator.js +398 -0
  56. package/scripts/cli/internal/hook-generator.js +369 -0
  57. package/scripts/cli/internal/hooks.js +61 -0
  58. package/scripts/cli/internal/itcss-generator.js +565 -0
  59. package/scripts/cli/internal/motion-generator.js +679 -0
  60. package/scripts/cli/internal/template-engine.js +301 -0
  61. package/scripts/cli/internal/theme-bridge.js +664 -0
  62. package/scripts/cli/internal/tokens/engine.js +122 -0
  63. package/scripts/cli/internal/tokens/provider.js +34 -0
  64. package/scripts/cli/internal/tokens/providers/figma.js +50 -0
  65. package/scripts/cli/internal/tokens/providers/style-dictionary.js +48 -0
  66. package/scripts/cli/internal/tokens/providers/w3c.js +48 -0
  67. package/scripts/cli/internal/tokens/token-provider.js +443 -0
  68. package/scripts/cli/internal/tokens/token-validator.js +513 -0
  69. package/scripts/cli/internal/validator.js +276 -0
  70. package/scripts/cli/internal/wizard.js +60 -6
  71. package/scripts/cli/mappings.js +23 -0
  72. package/scripts/cli/migration-tools.js +164 -94
  73. package/scripts/cli/plugins/style-dictionary.js +46 -0
  74. package/scripts/cli/templates/README.md +525 -95
  75. package/scripts/cli/templates/common-templates.js +40 -14
  76. package/scripts/cli/templates/components/react-component.ts +282 -0
  77. package/scripts/cli/templates/config/project-config.ts +112 -0
  78. package/scripts/cli/templates/hooks/use-component.ts +477 -0
  79. package/scripts/cli/templates/index.js +19 -4
  80. package/scripts/cli/templates/index.ts +171 -0
  81. package/scripts/cli/templates/next-templates.js +72 -0
  82. package/scripts/cli/templates/react-templates.js +70 -126
  83. package/scripts/cli/templates/scss-templates.js +35 -35
  84. package/scripts/cli/templates/stories/storybook-story.ts +241 -0
  85. package/scripts/cli/templates/styles/scss-component.ts +255 -0
  86. package/scripts/cli/templates/tests/vitest-test.ts +229 -0
  87. package/scripts/cli/templates/token-templates.js +337 -1
  88. package/scripts/cli/templates/tokens/token-generators.ts +1088 -0
  89. package/scripts/cli/templates/types/component-types.ts +145 -0
  90. package/scripts/cli/templates/utils/testing-utils.ts +144 -0
  91. package/scripts/cli/templates/vanilla-templates.js +39 -0
  92. package/scripts/cli/token-manager.js +8 -2
  93. package/scripts/cli/utils/cache-manager.js +240 -0
  94. package/scripts/cli/utils/detector.js +46 -0
  95. package/scripts/cli/utils/diagnostics.js +289 -0
  96. package/scripts/cli/utils/error.js +45 -3
  97. package/scripts/cli/utils/helpers.js +24 -0
  98. package/scripts/cli/utils/logger.js +1 -1
  99. package/scripts/cli/utils/security.js +302 -0
  100. package/scripts/cli/utils/telemetry.js +115 -0
  101. package/scripts/cli/utils/validation.js +4 -38
  102. package/scripts/cli/utils.js +46 -0
  103. package/src/components/Accordion/Accordion.stories.tsx +0 -18
  104. package/src/components/Accordion/Accordion.test.tsx +0 -17
  105. package/src/components/Accordion/Accordion.tsx +0 -4
  106. package/src/components/AtomixGlass/AtomixGlass.tsx +102 -2
  107. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +125 -12
  108. package/src/components/AtomixGlass/PerformanceDashboard.tsx +219 -0
  109. package/src/components/AtomixGlass/README.md +25 -10
  110. package/src/components/AtomixGlass/animation-system.ts +578 -0
  111. package/src/components/AtomixGlass/shader-utils.ts +3 -0
  112. package/src/components/AtomixGlass/stories/AnimationFeatures.stories.tsx +653 -0
  113. package/src/components/AtomixGlass/stories/AnimationTests.stories.tsx +95 -0
  114. package/src/components/AtomixGlass/stories/CardExamples.stories.tsx +212 -0
  115. package/src/components/AtomixGlass/stories/DashboardExamples.stories.tsx +348 -0
  116. package/src/components/AtomixGlass/stories/EcommerceExamples.stories.tsx +410 -0
  117. package/src/components/AtomixGlass/stories/FormExamples.stories.tsx +436 -0
  118. package/src/components/AtomixGlass/stories/HeroExamples.stories.tsx +264 -0
  119. package/src/components/AtomixGlass/stories/InteractivePlayground.stories.tsx +247 -0
  120. package/src/components/AtomixGlass/stories/MobileUIExamples.stories.tsx +418 -0
  121. package/src/components/AtomixGlass/stories/ModalExamples.stories.tsx +402 -0
  122. package/src/components/AtomixGlass/stories/Overview.stories.tsx +157 -6
  123. package/src/components/AtomixGlass/stories/Playground.stories.tsx +658 -93
  124. package/src/components/AtomixGlass/stories/PresetGallery.stories.tsx +335 -0
  125. package/src/components/AtomixGlass/stories/WidgetExamples.stories.tsx +441 -0
  126. package/src/components/AtomixGlass/stories/argTypes.ts +384 -0
  127. package/src/components/AtomixGlass/stories/shared-components.tsx +91 -1
  128. package/src/components/AtomixGlass/stories/types.ts +127 -0
  129. package/src/components/Avatar/Avatar.tsx +1 -1
  130. package/src/components/Button/Button.stories.disabled-link.tsx +10 -0
  131. package/src/components/Button/Button.stories.tsx +10 -0
  132. package/src/components/Button/Button.test.tsx +16 -11
  133. package/src/components/Button/Button.tsx +4 -4
  134. package/src/components/Card/Card.tsx +1 -1
  135. package/src/components/Dropdown/Dropdown.tsx +12 -12
  136. package/src/components/Form/Select.tsx +62 -3
  137. package/src/components/Modal/Modal.tsx +14 -3
  138. package/src/components/Navigation/Navbar/Navbar.tsx +44 -0
  139. package/src/components/Slider/Slider.stories.tsx +3 -3
  140. package/src/components/Slider/Slider.tsx +38 -0
  141. package/src/components/Steps/Steps.tsx +3 -3
  142. package/src/components/Tabs/Tabs.tsx +77 -8
  143. package/src/components/Testimonial/Testimonial.tsx +1 -1
  144. package/src/components/TypedButton/TypedButton.stories.tsx +59 -0
  145. package/src/components/TypedButton/TypedButton.tsx +39 -0
  146. package/src/components/TypedButton/index.ts +2 -0
  147. package/src/components/VideoPlayer/VideoPlayer.tsx +11 -4
  148. package/src/lib/composables/index.ts +4 -7
  149. package/src/lib/composables/types.ts +45 -0
  150. package/src/lib/composables/useAccordion.ts +0 -7
  151. package/src/lib/composables/useAtomixGlass.ts +144 -5
  152. package/src/lib/composables/useChartExport.ts +3 -13
  153. package/src/lib/composables/useDropdown.ts +66 -0
  154. package/src/lib/composables/useFocusTrap.ts +80 -0
  155. package/src/lib/composables/usePerformanceMonitor.ts +448 -0
  156. package/src/lib/composables/useResponsiveGlass.presets.ts +192 -0
  157. package/src/lib/composables/useResponsiveGlass.ts +441 -0
  158. package/src/lib/composables/useTooltip.ts +16 -0
  159. package/src/lib/composables/useTypedButton.ts +66 -0
  160. package/src/lib/config/index.ts +62 -5
  161. package/src/lib/constants/components.ts +55 -0
  162. package/src/lib/theme/devtools/__tests__/useHistory.test.tsx +150 -0
  163. package/src/lib/theme/tokens/centralized-tokens.ts +120 -0
  164. package/src/lib/theme/utils/__tests__/domUtils.test.ts +101 -0
  165. package/src/lib/types/components.ts +37 -11
  166. package/src/lib/types/glass.ts +35 -0
  167. package/src/lib/types/index.ts +1 -0
  168. package/src/lib/utils/displacement-generator.ts +1 -1
  169. package/src/styles/01-settings/_settings.testtypecheck.scss +53 -0
  170. package/src/styles/01-settings/_settings.typedbutton.scss +53 -0
  171. package/src/styles/06-components/_components.testbutton.scss +212 -0
  172. package/src/styles/06-components/_components.testtypecheck.scss +212 -0
  173. package/src/styles/06-components/_components.typedbutton.scss +212 -0
  174. package/src/styles/99-utilities/_index.scss +1 -0
  175. package/src/styles/99-utilities/_utilities.text.scss +1 -1
  176. package/src/styles/99-utilities/_utilities.touch-target.scss +36 -0
  177. package/src/styles/06-components/old.chart.styles.scss +0 -2788
@@ -0,0 +1,402 @@
1
+ /**
2
+ * ModalExamples.stories.tsx
3
+ *
4
+ * Modal, dialog, and overlay examples for AtomixGlass.
5
+ * Perfect for notifications, confirmations, and interactive dialogs.
6
+ *
7
+ * @package Atomix
8
+ * @component AtomixGlass
9
+ */
10
+ import React from 'react';
11
+ import { useState } from 'react';
12
+ import { Meta, StoryObj } from '@storybook/react';
13
+ import AtomixGlass from '../AtomixGlass';
14
+ import { BackgroundWrapper, backgroundImages, StoryErrorBoundary } from './shared-components';
15
+ import { baseArgTypes } from './argTypes';
16
+
17
+ import { Button } from '../../Button';
18
+ import { Badge } from '../../Badge';
19
+ import { Icon } from '../../Icon/Icon';
20
+
21
+ const meta: Meta<typeof AtomixGlass> = {
22
+ title: 'Components/AtomixGlass/Examples/Modal Examples',
23
+ component: AtomixGlass,
24
+ parameters: {
25
+ layout: 'fullscreen',
26
+ docs: {
27
+ description: {
28
+ component:
29
+ 'Modal and dialog examples demonstrating AtomixGlass for overlays, notifications, and interactive dialogs.',
30
+ },
31
+ },
32
+ },
33
+ tags: ['!autodocs'],
34
+ argTypes: {
35
+ ...baseArgTypes,
36
+ children: { control: false },
37
+ },
38
+ };
39
+
40
+ export default meta;
41
+ type Story = StoryObj<typeof AtomixGlass>;
42
+
43
+ /**
44
+ * Confirmation Dialog
45
+ *
46
+ * Modal dialog for confirming important actions like deletions.
47
+ */
48
+ export const ConfirmationDialog: Story = {
49
+ render: () => {
50
+ const [isOpen, setIsOpen] = useState(true);
51
+
52
+ if (!isOpen) {
53
+ return (
54
+ <StoryErrorBoundary>
55
+ <BackgroundWrapper backgroundImage={backgroundImages[0]} overlay overlayOpacity={0.5}>
56
+ <div className="u-text-center u-text-white">
57
+ <Button variant="primary" size="lg" onClick={() => setIsOpen(true)}>
58
+ Open Confirmation Dialog
59
+ </Button>
60
+ </div>
61
+ </BackgroundWrapper>
62
+ </StoryErrorBoundary>
63
+ );
64
+ }
65
+
66
+ return (
67
+ <StoryErrorBoundary>
68
+ <BackgroundWrapper backgroundImage={backgroundImages[0]} overlay overlayOpacity={0.5}>
69
+ <div
70
+ style={{
71
+ display: 'flex',
72
+ alignItems: 'center',
73
+ justifyContent: 'center',
74
+ minHeight: '100vh',
75
+ padding: '20px',
76
+ }}
77
+ >
78
+ <AtomixGlass
79
+ displacementScale={70}
80
+ blurAmount={1}
81
+ saturation={140}
82
+ borderRadius={24}
83
+ mode="standard"
84
+ style={{ maxWidth: '440px', width: '100%' }}
85
+ padding="40px"
86
+ >
87
+ <div className="u-text-center u-text-white">
88
+ <div
89
+ style={{
90
+ width: '80px',
91
+ height: '80px',
92
+ borderRadius: '50%',
93
+ background: 'rgba(239, 68, 68, 0.2)',
94
+ display: 'flex',
95
+ alignItems: 'center',
96
+ justifyContent: 'center',
97
+ fontSize: '40px',
98
+ margin: '0 auto 24px',
99
+ }}
100
+ aria-hidden="true"
101
+ >
102
+ ⚠️
103
+ </div>
104
+
105
+ <h2 className="u-mt-0 u-text-2xl u-font-bold u-mb-2">
106
+ Delete Account?
107
+ </h2>
108
+ <p className="u-text-sm u-opacity-90 u-mb-5" style={{ lineHeight: 1.6 }}>
109
+ Are you sure you want to delete your account? This action cannot be undone
110
+ and all your data will be permanently removed.
111
+ </p>
112
+
113
+ <div className="u-flex u-gap-3 u-justify-center" style={{ gap: '12px' }}>
114
+ <Button
115
+ variant="outline-light"
116
+ glass={{ elasticity: 0 }}
117
+ onClick={() => setIsOpen(false)}
118
+ >
119
+ Cancel
120
+ </Button>
121
+ <Button
122
+ variant="danger"
123
+ glass={{ elasticity: 0 }}
124
+ onClick={() => {
125
+ setIsOpen(false);
126
+ alert('Account deleted');
127
+ }}
128
+ >
129
+ Delete Account
130
+ </Button>
131
+ </div>
132
+ </div>
133
+ </AtomixGlass>
134
+ </div>
135
+ </BackgroundWrapper>
136
+ </StoryErrorBoundary>
137
+ );
138
+ },
139
+ parameters: {
140
+ docs: {
141
+ description: {
142
+ story:
143
+ 'Confirmation dialog modal for critical actions with cancel and confirm buttons.',
144
+ },
145
+ },
146
+ },
147
+ };
148
+
149
+ /**
150
+ * Success Notification
151
+ *
152
+ * Toast-style notification for success messages.
153
+ */
154
+ export const SuccessNotification: Story = {
155
+ render: () => {
156
+ const [isVisible, setIsVisible] = useState(true);
157
+
158
+ if (!isVisible) {
159
+ return (
160
+ <StoryErrorBoundary>
161
+ <BackgroundWrapper backgroundImage={backgroundImages[2]}>
162
+ <div className="u-text-center">
163
+ <Button variant="primary" size="lg" onClick={() => setIsVisible(true)}>
164
+ Show Success Notification
165
+ </Button>
166
+ </div>
167
+ </BackgroundWrapper>
168
+ </StoryErrorBoundary>
169
+ );
170
+ }
171
+
172
+ return (
173
+ <StoryErrorBoundary>
174
+ <BackgroundWrapper backgroundImage={backgroundImages[2]}>
175
+ <div
176
+ style={{
177
+ position: 'fixed',
178
+ top: '24px',
179
+ right: '24px',
180
+ zIndex: 1000,
181
+ }}
182
+ >
183
+ <AtomixGlass
184
+ displacementScale={50}
185
+ blurAmount={0.5}
186
+ saturation={130}
187
+ borderRadius={16}
188
+ mode="standard"
189
+ style={{ minWidth: '320px' }}
190
+ padding="20px"
191
+ >
192
+ <div className="u-flex u-items-center u-gap-3 u-text-white">
193
+ <div
194
+ style={{
195
+ width: '40px',
196
+ height: '40px',
197
+ borderRadius: '50%',
198
+ background: 'rgba(34, 197, 94, 0.2)',
199
+ display: 'flex',
200
+ alignItems: 'center',
201
+ justifyContent: 'center',
202
+ fontSize: '20px',
203
+ flexShrink: 0,
204
+ }}
205
+ aria-hidden="true"
206
+ >
207
+
208
+ </div>
209
+
210
+ <div className="u-flex-1">
211
+ <p className="u-m-0 u-font-semibold u-text-sm">Payment Successful!</p>
212
+ <p className="u-m-0 u-text-xs u-opacity-80">
213
+ Your transaction has been completed.
214
+ </p>
215
+ </div>
216
+
217
+ <button
218
+ onClick={() => setIsVisible(false)}
219
+ style={{
220
+ background: 'transparent',
221
+ border: 'none',
222
+ color: 'rgba(255,255,255,0.6)',
223
+ cursor: 'pointer',
224
+ padding: '4px',
225
+ fontSize: '20px',
226
+ lineHeight: 1,
227
+ }}
228
+ aria-label="Close notification"
229
+ >
230
+ ×
231
+ </button>
232
+ </div>
233
+ </AtomixGlass>
234
+ </div>
235
+ </BackgroundWrapper>
236
+ </StoryErrorBoundary>
237
+ );
238
+ },
239
+ parameters: {
240
+ docs: {
241
+ description: {
242
+ story:
243
+ 'Success notification toast with auto-dismiss capability and close button.',
244
+ },
245
+ },
246
+ },
247
+ };
248
+
249
+ /**
250
+ * Settings Modal
251
+ *
252
+ * Modal dialog for displaying settings and preferences.
253
+ */
254
+ export const SettingsModal: Story = {
255
+ render: () => {
256
+ const [isOpen, setIsOpen] = useState(true);
257
+ const [notifications, setNotifications] = useState(true);
258
+ const [darkMode, setDarkMode] = useState(false);
259
+ const [autoSave, setAutoSave] = useState(true);
260
+
261
+ if (!isOpen) {
262
+ return (
263
+ <StoryErrorBoundary>
264
+ <BackgroundWrapper backgroundImage={backgroundImages[4]}>
265
+ <div className="u-text-center u-text-white">
266
+ <Button variant="primary" size="lg" onClick={() => setIsOpen(true)}>
267
+ Open Settings
268
+ </Button>
269
+ </div>
270
+ </BackgroundWrapper>
271
+ </StoryErrorBoundary>
272
+ );
273
+ }
274
+
275
+ return (
276
+ <StoryErrorBoundary>
277
+ <BackgroundWrapper backgroundImage={backgroundImages[4]} overlay overlayOpacity={0.5}>
278
+ <div
279
+ style={{
280
+ display: 'flex',
281
+ alignItems: 'center',
282
+ justifyContent: 'center',
283
+ minHeight: '100vh',
284
+ padding: '20px',
285
+ }}
286
+ >
287
+ <AtomixGlass
288
+ displacementScale={65}
289
+ blurAmount={0.75}
290
+ saturation={135}
291
+ borderRadius={24}
292
+ mode="standard"
293
+ style={{ maxWidth: '500px', width: '100%' }}
294
+ >
295
+ <div className="u-text-white" style={{ padding: '32px' }}>
296
+ <div className="u-flex u-items-center u-justify-between u-mb-4">
297
+ <h2 className="u-m-0 u-text-2xl u-font-bold">Settings</h2>
298
+ <button
299
+ onClick={() => setIsOpen(false)}
300
+ style={{
301
+ background: 'transparent',
302
+ border: 'none',
303
+ color: 'rgba(255,255,255,0.6)',
304
+ cursor: 'pointer',
305
+ padding: '8px',
306
+ fontSize: '24px',
307
+ lineHeight: 1,
308
+ }}
309
+ aria-label="Close settings"
310
+ >
311
+ ×
312
+ </button>
313
+ </div>
314
+
315
+ <div className="u-divide-y" style={{ borderColor: 'rgba(255,255,255,0.1)' }}>
316
+ {/* Notifications Setting */}
317
+ <div className="u-py-3 u-flex u-items-center u-justify-between">
318
+ <div>
319
+ <p className="u-m-0 u-font-medium u-text-base">Push Notifications</p>
320
+ <p className="u-m-0 u-text-xs u-opacity-70 u-mt-1">
321
+ Receive updates and alerts
322
+ </p>
323
+ </div>
324
+ <label style={{ display: 'flex', alignItems: 'center', cursor: 'pointer' }}>
325
+ <input
326
+ type="checkbox"
327
+ checked={notifications}
328
+ onChange={(e) => setNotifications(e.target.checked)}
329
+ style={{ accentColor: '#667eea', width: '20px', height: '20px' }}
330
+ />
331
+ </label>
332
+ </div>
333
+
334
+ {/* Dark Mode Setting */}
335
+ <div className="u-py-3 u-flex u-items-center u-justify-between">
336
+ <div>
337
+ <p className="u-m-0 u-font-medium u-text-base">Dark Mode</p>
338
+ <p className="u-m-0 u-text-xs u-opacity-70 u-mt-1">
339
+ Use dark theme across the app
340
+ </p>
341
+ </div>
342
+ <label style={{ display: 'flex', alignItems: 'center', cursor: 'pointer' }}>
343
+ <input
344
+ type="checkbox"
345
+ checked={darkMode}
346
+ onChange={(e) => setDarkMode(e.target.checked)}
347
+ style={{ accentColor: '#667eea', width: '20px', height: '20px' }}
348
+ />
349
+ </label>
350
+ </div>
351
+
352
+ {/* Auto Save Setting */}
353
+ <div className="u-py-3 u-flex u-items-center u-justify-between">
354
+ <div>
355
+ <p className="u-m-0 u-font-medium u-text-base">Auto-Save</p>
356
+ <p className="u-m-0 u-text-xs u-opacity-70 u-mt-1">
357
+ Automatically save your work
358
+ </p>
359
+ </div>
360
+ <label style={{ display: 'flex', alignItems: 'center', cursor: 'pointer' }}>
361
+ <input
362
+ type="checkbox"
363
+ checked={autoSave}
364
+ onChange={(e) => setAutoSave(e.target.checked)}
365
+ style={{ accentColor: '#667eea', width: '20px', height: '20px' }}
366
+ />
367
+ </label>
368
+ </div>
369
+ </div>
370
+
371
+ <div className="u-flex u-gap-3 u-justify-end u-mt-5" style={{ gap: '12px' }}>
372
+ <Button
373
+ variant="outline-light"
374
+ glass={{ elasticity: 0 }}
375
+ onClick={() => setIsOpen(false)}
376
+ >
377
+ Cancel
378
+ </Button>
379
+ <Button
380
+ variant="primary"
381
+ glass={{ elasticity: 0 }}
382
+ onClick={() => setIsOpen(false)}
383
+ >
384
+ Save Changes
385
+ </Button>
386
+ </div>
387
+ </div>
388
+ </AtomixGlass>
389
+ </div>
390
+ </BackgroundWrapper>
391
+ </StoryErrorBoundary>
392
+ );
393
+ },
394
+ parameters: {
395
+ docs: {
396
+ description: {
397
+ story:
398
+ 'Settings modal with toggle switches for user preferences and configuration options.',
399
+ },
400
+ },
401
+ },
402
+ };
@@ -224,7 +224,111 @@ This component is performance-intensive. Use sparingly and consider performance
224
224
  description: 'Padding for the glass component',
225
225
  table: {
226
226
  category: 'Style',
227
- defaultValue: { summary: '24px' },
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' },
228
332
  },
229
333
  },
230
334
  className: {
@@ -273,8 +377,8 @@ export const BasicUsage: Story = {
273
377
  args: {
274
378
  children: (
275
379
  <div className="u-text-center u-flex u-flex-column u-items-center u-justify-center">
276
- <h2 className="u-mb-4 u-mt-0 u-text-white u-fs-2xl u-font-bold">Basic Glass Effect</h2>
277
- <p className="u-mb-6 u-mt-0 u-text-white u-opacity-90 u-fs-base">
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">
278
382
  This is a basic AtomixGlass component with default settings.
279
383
  </p>
280
384
  <Button variant="primary" glass>
@@ -304,9 +408,9 @@ export const WithAllProps: Story = {
304
408
  args: {
305
409
  children: (
306
410
  <div className="u-text-center">
307
- <h2 className="u-mb-4 u-mt-0 u-text-white u-fs-2xl u-font-bold">Fully Configured Glass</h2>
308
- <p className="u-mb-6 u-mt-0 u-text-white u-opacity-90 u-fs-base">
309
- This glass component uses all configurable properties.
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.
310
414
  </p>
311
415
  <div className="u-flex u-gap-4 u-justify-center">
312
416
  <Button variant="primary" glass>
@@ -327,6 +431,14 @@ export const WithAllProps: Story = {
327
431
  mode: 'standard',
328
432
  overLight: true,
329
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',
330
442
  onClick: mockHandlers.onClick,
331
443
  },
332
444
  decorators: [
@@ -344,3 +456,42 @@ export const WithAllProps: Story = {
344
456
  },
345
457
  },
346
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
+ };