@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,436 @@
1
+ /**
2
+ * FormExamples.stories.tsx
3
+ *
4
+ * Form-based examples for AtomixGlass including login, registration,
5
+ * payment, and subscription forms.
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 { Input } from '../../Form/Input';
19
+ import { Badge } from '../../Badge';
20
+
21
+ const meta: Meta<typeof AtomixGlass> = {
22
+ title: 'Components/AtomixGlass/Examples/Form Examples',
23
+ component: AtomixGlass,
24
+ parameters: {
25
+ layout: 'centered',
26
+ docs: {
27
+ description: {
28
+ component:
29
+ 'Form-based examples demonstrating AtomixGlass for authentication, payment, and data input interfaces.',
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
+ * Login Form
45
+ *
46
+ * Modern authentication form with email/password inputs, social login options, and loading states.
47
+ */
48
+ export const LoginForm: Story = {
49
+ render: () => {
50
+ const [email, setEmail] = useState('');
51
+ const [password, setPassword] = useState('');
52
+ const [rememberMe, setRememberMe] = useState(false);
53
+ const [isLoading, setIsLoading] = useState(false);
54
+
55
+ const handleSubmit = (e: React.FormEvent) => {
56
+ e.preventDefault();
57
+ setIsLoading(true);
58
+ setTimeout(() => setIsLoading(false), 2000);
59
+ };
60
+
61
+ return (
62
+ <StoryErrorBoundary>
63
+ <BackgroundWrapper
64
+ backgroundImage={backgroundImages[3]}
65
+ overlay
66
+ overlayOpacity={0.3}
67
+ >
68
+ <div style={{ maxWidth: '380px' }} className="u-mx-auto">
69
+ <AtomixGlass
70
+ displacementScale={50}
71
+ blurAmount={1}
72
+ saturation={130}
73
+ aberrationIntensity={2}
74
+ borderRadius={24}
75
+ mode="standard"
76
+ padding="32px"
77
+ >
78
+ <div className="u-text-white">
79
+ {/* Logo/Header */}
80
+ <div className="u-text-center u-mb-5">
81
+ <div
82
+ style={{
83
+ width: '72px',
84
+ height: '72px',
85
+ borderRadius: '20px',
86
+ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
87
+ display: 'flex',
88
+ alignItems: 'center',
89
+ justifyContent: 'center',
90
+ fontSize: '32px',
91
+ margin: '0 auto 24px',
92
+ boxShadow: '0 12px 32px rgba(102, 126, 234, 0.4)',
93
+ position: 'relative',
94
+ }}
95
+ aria-hidden="true"
96
+ >
97
+ <div
98
+ style={{
99
+ position: 'absolute',
100
+ inset: '-4px',
101
+ borderRadius: '24px',
102
+ background: 'linear-gradient(135deg, #667eea, #764ba2)',
103
+ opacity: 0.4,
104
+ filter: 'blur(16px)',
105
+ }}
106
+ />
107
+ <span role="img" aria-label="Lock icon" style={{ position: 'relative', zIndex: 1 }}>
108
+ 🔒
109
+ </span>
110
+ </div>
111
+ <h2
112
+ className="u-m-0 u-mb-2 u-text-3 u-font-bold"
113
+ style={{
114
+ fontSize: '32px',
115
+ marginBottom: '12px',
116
+ background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.9) 100%)',
117
+ WebkitBackgroundClip: 'text',
118
+ WebkitTextFillColor: 'transparent',
119
+ backgroundClip: 'text',
120
+ }}
121
+ >
122
+ Welcome Back
123
+ </h2>
124
+ <p className="u-m-0 u-opacity-70 u-text-7" style={{ fontSize: '15px' }}>
125
+ Sign in to continue to your account
126
+ </p>
127
+ </div>
128
+
129
+ {/* Form */}
130
+ <form onSubmit={handleSubmit}>
131
+ <div className="u-mb-3">
132
+ <label className="u-block u-text-7 u-font-semibold u-mb-2">
133
+ Email Address
134
+ </label>
135
+ <Input
136
+ type="email"
137
+ value={email}
138
+ onChange={(e) => setEmail(e.target.value)}
139
+ placeholder="you@example.com"
140
+ required
141
+ glass={{ elasticity: 0 }}
142
+ />
143
+ </div>
144
+
145
+ <div className="u-mb-3">
146
+ <label className="u-block u-text-7 u-font-semibold u-mb-2">
147
+ Password
148
+ </label>
149
+ <Input
150
+ type="password"
151
+ value={password}
152
+ onChange={(e) => setPassword(e.target.value)}
153
+ placeholder="••••••••"
154
+ required
155
+ glass={{ elasticity: 0 }}
156
+ />
157
+ </div>
158
+
159
+ <div
160
+ style={{
161
+ display: 'flex',
162
+ justifyContent: 'space-between',
163
+ alignItems: 'center',
164
+ marginBottom: '20px',
165
+ }}
166
+ >
167
+ <label
168
+ style={{
169
+ display: 'flex',
170
+ alignItems: 'center',
171
+ gap: '8px',
172
+ fontSize: '12px',
173
+ cursor: 'pointer',
174
+ }}
175
+ >
176
+ <input
177
+ type="checkbox"
178
+ checked={rememberMe}
179
+ onChange={(e) => setRememberMe(e.target.checked)}
180
+ style={{ accentColor: '#667eea' }}
181
+ />
182
+ Remember me
183
+ </label>
184
+ <a
185
+ href="#"
186
+ style={{
187
+ fontSize: '12px',
188
+ color: '#667eea',
189
+ textDecoration: 'none',
190
+ fontWeight: 600,
191
+ }}
192
+ >
193
+ Forgot password?
194
+ </a>
195
+ </div>
196
+
197
+ <Button
198
+ type="submit"
199
+ disabled={isLoading}
200
+ variant="primary"
201
+ glass={{ elasticity: 0 }}
202
+ className="u-block u-w-100"
203
+ >
204
+ {isLoading ? 'Signing in...' : 'Sign In'}
205
+ </Button>
206
+ </form>
207
+
208
+ {/* Social Login */}
209
+ <div style={{ marginTop: '20px' }}>
210
+ <div
211
+ style={{
212
+ position: 'relative',
213
+ textAlign: 'center',
214
+ marginBottom: '20px',
215
+ }}
216
+ >
217
+ <div
218
+ style={{
219
+ position: 'absolute',
220
+ top: '50%',
221
+ left: 0,
222
+ right: 0,
223
+ height: '1px',
224
+ background: 'rgba(255,255,255,0.1)',
225
+ }}
226
+ />
227
+ <span
228
+ style={{
229
+ position: 'relative',
230
+ padding: '0 16px',
231
+ background: 'inherit',
232
+ fontSize: '12px',
233
+ opacity: 0.6,
234
+ }}
235
+ >
236
+ Or continue with
237
+ </span>
238
+ </div>
239
+
240
+ <div style={{ display: 'flex', gap: '12px' }}>
241
+ <button
242
+ style={{
243
+ flex: 1,
244
+ padding: '10px',
245
+ borderRadius: '10px',
246
+ border: '1px solid rgba(255,255,255,0.2)',
247
+ background: 'rgba(255,255,255,0.05)',
248
+ color: 'inherit',
249
+ cursor: 'pointer',
250
+ fontSize: '12px',
251
+ fontWeight: 600,
252
+ display: 'flex',
253
+ alignItems: 'center',
254
+ justifyContent: 'center',
255
+ gap: '8px',
256
+ }}
257
+ >
258
+ <span aria-hidden="true">🔵</span> Google
259
+ </button>
260
+ <button
261
+ style={{
262
+ flex: 1,
263
+ padding: '10px',
264
+ borderRadius: '10px',
265
+ border: '1px solid rgba(255,255,255,0.2)',
266
+ background: 'rgba(255,255,255,0.05)',
267
+ color: 'inherit',
268
+ cursor: 'pointer',
269
+ fontSize: '12px',
270
+ fontWeight: 600,
271
+ display: 'flex',
272
+ alignItems: 'center',
273
+ justifyContent: 'center',
274
+ gap: '8px',
275
+ }}
276
+ >
277
+ <span aria-hidden="true">⚫</span> GitHub
278
+ </button>
279
+ </div>
280
+ </div>
281
+
282
+ {/* Sign Up Link */}
283
+ <div style={{ marginTop: '20px', textAlign: 'center', fontSize: '12px' }}>
284
+ Don't have an account?{' '}
285
+ <a
286
+ href="#"
287
+ style={{
288
+ color: '#667eea',
289
+ textDecoration: 'none',
290
+ fontWeight: 600,
291
+ }}
292
+ >
293
+ Sign up
294
+ </a>
295
+ </div>
296
+ </div>
297
+ </AtomixGlass>
298
+ </div>
299
+ </BackgroundWrapper>
300
+ </StoryErrorBoundary>
301
+ );
302
+ },
303
+ parameters: {
304
+ docs: {
305
+ description: {
306
+ story:
307
+ 'Modern login form with email/password inputs, remember me functionality, social login options, and loading states.',
308
+ },
309
+ },
310
+ },
311
+ };
312
+
313
+ /**
314
+ * Newsletter Subscription Form
315
+ *
316
+ * Clean subscription form with email validation and success states.
317
+ */
318
+ export const NewsletterSubscription: Story = {
319
+ render: () => {
320
+ const [email, setEmail] = useState('');
321
+ const [subscribed, setSubscribed] = useState(false);
322
+
323
+ const handleSubmit = (e: React.FormEvent) => {
324
+ e.preventDefault();
325
+ setSubscribed(true);
326
+ };
327
+
328
+ return (
329
+ <StoryErrorBoundary>
330
+ <BackgroundWrapper backgroundImage={backgroundImages[6]} overlay overlayOpacity={0.4}>
331
+ <div style={{ maxWidth: '420px' }} className="u-mx-auto">
332
+ <AtomixGlass
333
+ displacementScale={60}
334
+ blurAmount={0.75}
335
+ saturation={140}
336
+ borderRadius={24}
337
+ mode="standard"
338
+ padding="40px"
339
+ >
340
+ <div className="u-text-center u-text-white">
341
+ <div
342
+ style={{
343
+ width: '64px',
344
+ height: '64px',
345
+ borderRadius: '16px',
346
+ background: 'rgba(167, 139, 250, 0.2)',
347
+ display: 'flex',
348
+ alignItems: 'center',
349
+ justifyContent: 'center',
350
+ fontSize: '32px',
351
+ margin: '0 auto 24px',
352
+ }}
353
+ aria-hidden="true"
354
+ >
355
+ 📧
356
+ </div>
357
+
358
+ {!subscribed ? (
359
+ <>
360
+ <h3 className="u-mt-0 u-text-2xl u-font-bold u-mb-2">
361
+ Subscribe to Our Newsletter
362
+ </h3>
363
+ <p
364
+ className="u-text-sm u-opacity-90 u-mb-5"
365
+ style={{ lineHeight: 1.6 }}
366
+ >
367
+ Get the latest updates, articles, and resources sent to your inbox weekly.
368
+ </p>
369
+
370
+ <form onSubmit={handleSubmit}>
371
+ <div className="u-mb-3">
372
+ <Input
373
+ type="email"
374
+ value={email}
375
+ onChange={(e) => setEmail(e.target.value)}
376
+ placeholder="Enter your email"
377
+ required
378
+ glass={{ elasticity: 0 }}
379
+ />
380
+ </div>
381
+
382
+ <Button
383
+ type="submit"
384
+ variant="primary"
385
+ glass={{ elasticity: 0 }}
386
+ className="u-block u-w-100"
387
+ size="lg"
388
+ >
389
+ Subscribe Now
390
+ </Button>
391
+ </form>
392
+
393
+ <p className="u-text-xs u-opacity-70 u-mt-4">
394
+ No spam. Unsubscribe at any time.
395
+ </p>
396
+ </>
397
+ ) : (
398
+ <div className="u-py-4">
399
+ <Badge variant="success" size="lg" className="u-mb-3">
400
+ ✓ Successfully Subscribed!
401
+ </Badge>
402
+ <p className="u-text-lg u-font-medium u-mb-2">
403
+ Thank you for subscribing!
404
+ </p>
405
+ <p className="u-text-sm u-opacity-80">
406
+ Please check your inbox to confirm your subscription.
407
+ </p>
408
+ <Button
409
+ variant="outline-light"
410
+ glass={{ elasticity: 0 }}
411
+ onClick={() => {
412
+ setSubscribed(false);
413
+ setEmail('');
414
+ }}
415
+ className="u-mt-4"
416
+ >
417
+ Subscribe Another Email
418
+ </Button>
419
+ </div>
420
+ )}
421
+ </div>
422
+ </AtomixGlass>
423
+ </div>
424
+ </BackgroundWrapper>
425
+ </StoryErrorBoundary>
426
+ );
427
+ },
428
+ parameters: {
429
+ docs: {
430
+ description: {
431
+ story:
432
+ 'Newsletter subscription form with email validation, success state, and confirmation message.',
433
+ },
434
+ },
435
+ },
436
+ };
@@ -0,0 +1,264 @@
1
+ /**
2
+ * HeroExamples.stories.tsx
3
+ *
4
+ * Hero section and landing page examples for AtomixGlass.
5
+ * Demonstrates usage in prominent, attention-grabbing layouts.
6
+ *
7
+ * @package Atomix
8
+ * @component AtomixGlass
9
+ */
10
+ import React from 'react';
11
+ import { Meta, StoryObj } from '@storybook/react';
12
+ import AtomixGlass from '../AtomixGlass';
13
+ import { BackgroundWrapper, backgroundImages, StoryErrorBoundary } from './shared-components';
14
+ import { baseArgTypes } from './argTypes';
15
+ import type { AtomixGlassStoryProps } from './types';
16
+
17
+ import { Button } from '../../Button';
18
+
19
+ const meta: Meta<typeof AtomixGlass> = {
20
+ title: 'Components/AtomixGlass/Examples/Hero Examples',
21
+ component: AtomixGlass,
22
+ parameters: {
23
+ layout: 'fullscreen',
24
+ docs: {
25
+ description: {
26
+ component:
27
+ 'Hero section examples showing how to use AtomixGlass for landing pages and prominent UI elements.',
28
+ },
29
+ },
30
+ },
31
+ tags: ['!autodocs'],
32
+ argTypes: {
33
+ ...baseArgTypes,
34
+ children: { control: false },
35
+ },
36
+ };
37
+
38
+ export default meta;
39
+ type Story = StoryObj<typeof AtomixGlass>;
40
+
41
+ /**
42
+ * Basic Hero Section
43
+ *
44
+ * A clean hero section with gradient background and call-to-action buttons.
45
+ */
46
+ export const BasicHero: Story = {
47
+ render: () => (
48
+ <StoryErrorBoundary>
49
+ <BackgroundWrapper backgroundImage={backgroundImages[2]}>
50
+ <div style={{ maxWidth: '900px' }} className="u-mx-auto">
51
+ <AtomixGlass
52
+ displacementScale={100}
53
+ blurAmount={1}
54
+ borderRadius={30}
55
+ mode="shader"
56
+ shaderVariant="premiumGlass"
57
+ padding="48px 40px"
58
+ >
59
+ <div className="u-text-center u-text-white">
60
+ <div
61
+ style={{
62
+ width: '96px',
63
+ height: '96px',
64
+ margin: '0 auto 32px',
65
+ borderRadius: '24px',
66
+ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
67
+ display: 'flex',
68
+ alignItems: 'center',
69
+ justifyContent: 'center',
70
+ fontSize: '48px',
71
+ boxShadow: '0 16px 40px rgba(102, 126, 234, 0.5)',
72
+ }}
73
+ aria-hidden="true"
74
+ >
75
+
76
+ </div>
77
+ <h1
78
+ className="u-mt-0 u-text-1 u-font-bold"
79
+ style={{
80
+ fontSize: '48px',
81
+ marginBottom: '20px',
82
+ background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
83
+ WebkitBackgroundClip: 'text',
84
+ WebkitTextFillColor: 'transparent',
85
+ backgroundClip: 'text',
86
+ letterSpacing: '-1px',
87
+ }}
88
+ >
89
+ Modern Glass UI
90
+ </h1>
91
+ <p
92
+ className="u-text-4 u-mb-4"
93
+ style={{
94
+ fontSize: '18px',
95
+ lineHeight: 1.7,
96
+ color: 'rgba(255, 255, 255, 0.9)',
97
+ maxWidth: '600px',
98
+ margin: '0 auto 32px',
99
+ }}
100
+ >
101
+ Create stunning interfaces with the AtomixGlass component. Perfect for modern, sleek
102
+ designs that stand out.
103
+ </p>
104
+ <div className="u-flex u-gap-3 u-justify-center u-flex-wrap" style={{ gap: '16px' }}>
105
+ <Button glass size="lg">
106
+ Get Started
107
+ </Button>
108
+ <Button glass variant="light" size="lg">
109
+ Learn More
110
+ </Button>
111
+ </div>
112
+ </div>
113
+ </AtomixGlass>
114
+ </div>
115
+ </BackgroundWrapper>
116
+ </StoryErrorBoundary>
117
+ ),
118
+ parameters: {
119
+ docs: {
120
+ description: {
121
+ story:
122
+ 'A basic hero section demonstrating AtomixGlass for landing page headers with call-to-action buttons.',
123
+ },
124
+ },
125
+ },
126
+ };
127
+
128
+ /**
129
+ * Feature Announcement Hero
130
+ *
131
+ * Hero section highlighting a new feature or product announcement.
132
+ */
133
+ export const FeatureAnnouncement: Story = {
134
+ render: () => (
135
+ <StoryErrorBoundary>
136
+ <BackgroundWrapper backgroundImage={backgroundImages[4]} overlay overlayOpacity={0.3}>
137
+ <div style={{ maxWidth: '1000px' }} className="u-mx-auto">
138
+ <AtomixGlass
139
+ displacementScale={80}
140
+ blurAmount={0.5}
141
+ saturation={140}
142
+ borderRadius={24}
143
+ mode="standard"
144
+ padding="40px"
145
+ >
146
+ <div className="u-flex u-flex-column u-items-center u-text-center">
147
+ <Badge variant="primary" size="lg" className="u-mb-4">
148
+ New Release
149
+ </Badge>
150
+ <h2
151
+ className="u-mt-0 u-text-1 u-font-bold u-text-white"
152
+ style={{ fontSize: '42px', marginBottom: '16px' }}
153
+ >
154
+ Introducing Dark Mode
155
+ </h2>
156
+ <p
157
+ className="u-text-4 u-mb-5"
158
+ style={{
159
+ fontSize: '18px',
160
+ lineHeight: 1.8,
161
+ color: 'rgba(255, 255, 255, 0.9)',
162
+ maxWidth: '700px',
163
+ margin: '0 auto 32px',
164
+ }}
165
+ >
166
+ Experience your favorite interface in a whole new light. Dark mode reduces eye strain
167
+ and provides a modern aesthetic for nighttime usage.
168
+ </p>
169
+ <div className="u-flex u-gap-3" style={{ gap: '16px' }}>
170
+ <Button glass size="lg" variant="primary">
171
+ Try Dark Mode
172
+ </Button>
173
+ <Button glass size="lg" variant="outline-light">
174
+ Read Documentation
175
+ </Button>
176
+ </div>
177
+ </div>
178
+ </AtomixGlass>
179
+ </div>
180
+ </BackgroundWrapper>
181
+ </StoryErrorBoundary>
182
+ ),
183
+ parameters: {
184
+ docs: {
185
+ description: {
186
+ story:
187
+ 'Feature announcement hero with badge and dual call-to-action buttons for product updates.',
188
+ },
189
+ },
190
+ },
191
+ };
192
+
193
+ /**
194
+ * Pricing Hero Section
195
+ *
196
+ * Hero section designed for pricing or product showcase pages.
197
+ */
198
+ export const PricingHero: Story = {
199
+ render: () => (
200
+ <StoryErrorBoundary>
201
+ <BackgroundWrapper backgroundImage={backgroundImages[0]} overlay overlayOpacity={0.4}>
202
+ <Container>
203
+ <div className="u-py-5">
204
+ <AtomixGlass
205
+ displacementScale={90}
206
+ blurAmount={0.75}
207
+ saturation={150}
208
+ borderRadius={28}
209
+ mode="prominent"
210
+ padding="48px"
211
+ >
212
+ <div className="u-text-center u-text-white">
213
+ <h1
214
+ className="u-mt-0 u-text-1 u-font-bold"
215
+ style={{
216
+ fontSize: '56px',
217
+ marginBottom: '24px',
218
+ background: 'linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%)',
219
+ WebkitBackgroundClip: 'text',
220
+ WebkitTextFillColor: 'transparent',
221
+ backgroundClip: 'text',
222
+ }}
223
+ >
224
+ Simple, Transparent Pricing
225
+ </h1>
226
+ <p
227
+ className="u-text-4 u-mb-5"
228
+ style={{
229
+ fontSize: '20px',
230
+ lineHeight: 1.8,
231
+ color: 'rgba(255, 255, 255, 0.95)',
232
+ maxWidth: '650px',
233
+ margin: '0 auto 40px',
234
+ }}
235
+ >
236
+ Choose the perfect plan for your needs. No hidden fees, no surprises.
237
+ </p>
238
+ <div
239
+ className="u-flex u-gap-4 u-justify-center u-flex-wrap"
240
+ style={{ gap: '20px' }}
241
+ >
242
+ <Button glass size="xl" variant="primary">
243
+ Start Free Trial
244
+ </Button>
245
+ <Button glass size="xl" variant="outline-light">
246
+ Contact Sales
247
+ </Button>
248
+ </div>
249
+ </div>
250
+ </AtomixGlass>
251
+ </div>
252
+ </Container>
253
+ </BackgroundWrapper>
254
+ </StoryErrorBoundary>
255
+ ),
256
+ parameters: {
257
+ docs: {
258
+ description: {
259
+ story:
260
+ 'Pricing page hero with gradient text effect and prominent call-to-action buttons.',
261
+ },
262
+ },
263
+ },
264
+ };