@shohojdhara/atomix 0.3.14 → 0.3.15

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 (173) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/build-tools/EXAMPLES.md +372 -0
  3. package/build-tools/README.md +242 -0
  4. package/build-tools/__tests__/error-handler.test.js +230 -0
  5. package/build-tools/__tests__/index.test.js +141 -0
  6. package/build-tools/__tests__/rollup-plugin.test.js +194 -0
  7. package/build-tools/__tests__/utils.test.js +161 -0
  8. package/build-tools/__tests__/vite-plugin.test.js +129 -0
  9. package/build-tools/__tests__/webpack-loader.test.js +190 -0
  10. package/build-tools/error-handler.js +308 -0
  11. package/build-tools/index.d.ts +43 -0
  12. package/build-tools/index.js +88 -0
  13. package/build-tools/package.json +67 -0
  14. package/build-tools/rollup-plugin.js +236 -0
  15. package/build-tools/types.d.ts +163 -0
  16. package/build-tools/utils.js +203 -0
  17. package/build-tools/vite-plugin.js +161 -0
  18. package/build-tools/webpack-loader.js +123 -0
  19. package/dist/atomix.css +203 -90
  20. package/dist/atomix.css.map +1 -1
  21. package/dist/atomix.min.css +3 -3
  22. package/dist/atomix.min.css.map +1 -1
  23. package/dist/build-tools/EXAMPLES.md +372 -0
  24. package/dist/build-tools/README.md +242 -0
  25. package/dist/build-tools/__tests__/error-handler.test.js +230 -0
  26. package/dist/build-tools/__tests__/index.test.js +141 -0
  27. package/dist/build-tools/__tests__/rollup-plugin.test.js +194 -0
  28. package/dist/build-tools/__tests__/utils.test.js +161 -0
  29. package/dist/build-tools/__tests__/vite-plugin.test.js +129 -0
  30. package/dist/build-tools/__tests__/webpack-loader.test.js +190 -0
  31. package/dist/build-tools/error-handler.js +308 -0
  32. package/dist/build-tools/index.d.ts +43 -0
  33. package/dist/build-tools/index.js +88 -0
  34. package/dist/build-tools/package.json +67 -0
  35. package/dist/build-tools/rollup-plugin.js +236 -0
  36. package/dist/build-tools/types.d.ts +163 -0
  37. package/dist/build-tools/utils.js +203 -0
  38. package/dist/build-tools/vite-plugin.js +161 -0
  39. package/dist/build-tools/webpack-loader.js +123 -0
  40. package/dist/charts.d.ts +1 -1
  41. package/dist/charts.js +86 -57
  42. package/dist/charts.js.map +1 -1
  43. package/dist/core.d.ts +1 -1
  44. package/dist/core.js +136 -112
  45. package/dist/core.js.map +1 -1
  46. package/dist/forms.d.ts +2 -5
  47. package/dist/forms.js +140 -128
  48. package/dist/forms.js.map +1 -1
  49. package/dist/heavy.d.ts +1 -1
  50. package/dist/heavy.js +136 -112
  51. package/dist/heavy.js.map +1 -1
  52. package/dist/index.d.ts +9 -61
  53. package/dist/index.esm.js +237 -286
  54. package/dist/index.esm.js.map +1 -1
  55. package/dist/index.js +250 -299
  56. package/dist/index.js.map +1 -1
  57. package/dist/index.min.js +1 -1
  58. package/dist/index.min.js.map +1 -1
  59. package/package.json +23 -8
  60. package/scripts/atomix-cli.js +170 -73
  61. package/scripts/cli/__tests__/README.md +81 -0
  62. package/scripts/cli/__tests__/basic.test.js +115 -0
  63. package/scripts/cli/__tests__/component-generator.test.js +332 -0
  64. package/scripts/cli/__tests__/integration.test.js +327 -0
  65. package/scripts/cli/__tests__/test-setup.js +133 -0
  66. package/scripts/cli/__tests__/token-manager.test.js +251 -0
  67. package/scripts/cli/__tests__/utils.test.js +161 -0
  68. package/scripts/cli/component-generator.js +253 -299
  69. package/scripts/cli/dependency-checker.js +355 -0
  70. package/scripts/cli/interactive-init.js +46 -5
  71. package/scripts/cli/template-manager.js +0 -2
  72. package/scripts/cli/templates/common-templates.js +636 -0
  73. package/scripts/cli/templates/composable-templates.js +148 -126
  74. package/scripts/cli/templates/index.js +23 -16
  75. package/scripts/cli/templates/project-templates.js +151 -23
  76. package/scripts/cli/templates/react-templates.js +280 -210
  77. package/scripts/cli/templates/scss-templates.js +90 -91
  78. package/scripts/cli/templates/testing-templates.js +206 -27
  79. package/scripts/cli/templates/testing-utils.js +278 -0
  80. package/scripts/cli/templates/types-templates.js +70 -56
  81. package/scripts/cli/theme-bridge.js +8 -2
  82. package/scripts/cli/token-manager.js +318 -206
  83. package/scripts/cli/utils.js +0 -1
  84. package/src/components/Accordion/Accordion.stories.tsx +369 -870
  85. package/src/components/AtomixGlass/AtomixGlass.tsx +80 -39
  86. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +103 -81
  87. package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +8 -7
  88. package/src/components/AtomixGlass/glass-utils.ts +2 -2
  89. package/src/components/AtomixGlass/shader-utils.ts +5 -0
  90. package/src/components/AtomixGlass/stories/Customization.stories.tsx +131 -0
  91. package/src/components/AtomixGlass/stories/Examples.stories.tsx +2957 -2853
  92. package/src/components/AtomixGlass/stories/Modes.stories.tsx +1 -1
  93. package/src/components/AtomixGlass/stories/Overview.stories.tsx +348 -0
  94. package/src/components/AtomixGlass/stories/Performance.stories.tsx +103 -0
  95. package/src/components/AtomixGlass/stories/Playground.stories.tsx +50 -35
  96. package/src/components/AtomixGlass/stories/{ShaderVariants.stories.tsx → Shaders.stories.tsx} +1 -1
  97. package/src/components/AtomixGlass/stories/shared-components.tsx +90 -190
  98. package/src/components/Avatar/Avatar.stories.tsx +213 -1
  99. package/src/components/Badge/Badge.stories.tsx +121 -362
  100. package/src/components/Block/Block.stories.tsx +21 -12
  101. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +141 -23
  102. package/src/components/Button/Button.stories.tsx +463 -1126
  103. package/src/components/Button/Button.test.tsx +107 -0
  104. package/src/components/Button/Button.tsx +46 -50
  105. package/src/components/Button/ButtonGroup.stories.tsx +373 -217
  106. package/src/components/Callout/Callout.stories.tsx +289 -634
  107. package/src/components/Card/Card.stories.tsx +248 -68
  108. package/src/components/Chart/Chart.stories.tsx +150 -8
  109. package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +151 -69
  110. package/src/components/Countdown/Countdown.stories.tsx +115 -8
  111. package/src/components/DataTable/DataTable.stories.tsx +346 -146
  112. package/src/components/DatePicker/DatePicker.stories.tsx +325 -1066
  113. package/src/components/Dropdown/Dropdown.stories.tsx +153 -33
  114. package/src/components/EdgePanel/EdgePanel.stories.tsx +230 -21
  115. package/src/components/Footer/Footer.stories.tsx +392 -328
  116. package/src/components/Form/Checkbox.stories.tsx +140 -6
  117. package/src/components/Form/Checkbox.test.tsx +63 -0
  118. package/src/components/Form/Checkbox.tsx +87 -51
  119. package/src/components/Form/Form.stories.tsx +119 -20
  120. package/src/components/Form/FormGroup.stories.tsx +127 -4
  121. package/src/components/Form/Radio.stories.tsx +140 -5
  122. package/src/components/Form/Select.stories.tsx +140 -8
  123. package/src/components/Form/Textarea.stories.tsx +149 -6
  124. package/src/components/Hero/Hero.stories.tsx +333 -32
  125. package/src/components/List/List.stories.tsx +141 -3
  126. package/src/components/Modal/Modal.stories.tsx +181 -42
  127. package/src/components/Popover/Popover.stories.tsx +448 -98
  128. package/src/components/Progress/Progress.stories.tsx +167 -5
  129. package/src/components/River/River.stories.tsx +1 -1
  130. package/src/components/SectionIntro/SectionIntro.stories.tsx +240 -48
  131. package/src/components/Spinner/Spinner.stories.tsx +102 -8
  132. package/src/components/Steps/Steps.stories.tsx +172 -43
  133. package/src/components/Tabs/Tabs.stories.tsx +136 -10
  134. package/src/components/Testimonial/Testimonial.stories.tsx +120 -3
  135. package/src/components/Todo/Todo.stories.tsx +198 -9
  136. package/src/components/Toggle/Toggle.stories.tsx +126 -39
  137. package/src/components/Tooltip/Tooltip.stories.tsx +194 -104
  138. package/src/components/Upload/Upload.stories.tsx +113 -24
  139. package/src/lib/README.md +2 -2
  140. package/src/lib/__tests__/theme-tools.test.ts +193 -0
  141. package/src/lib/composables/index.ts +2 -2
  142. package/src/lib/composables/useAtomixGlass.ts +28 -56
  143. package/src/lib/composables/useChartExport.ts +2 -7
  144. package/src/lib/composables/useDataTable.ts +46 -29
  145. package/src/lib/constants/components.ts +9 -32
  146. package/src/lib/theme/devtools/CLI.ts +1 -1
  147. package/src/lib/types/components.ts +1 -1
  148. package/src/lib/utils/__tests__/csv.test.ts +45 -0
  149. package/src/lib/utils/csv.ts +17 -0
  150. package/src/lib/utils/dataTableExport.ts +1 -10
  151. package/src/styles/01-settings/_index.scss +2 -1
  152. package/src/styles/01-settings/_settings.accordion.scss +28 -7
  153. package/src/styles/01-settings/_settings.colors.scss +11 -11
  154. package/src/styles/01-settings/_settings.typography.scss +5 -5
  155. package/src/styles/02-tools/_tools.utility-api.scss +14 -0
  156. package/src/styles/06-components/_components.accordion.scss +56 -14
  157. package/src/styles/06-components/_components.checkbox.scss +23 -17
  158. package/src/styles/99-utilities/_index.scss +2 -0
  159. package/src/styles/99-utilities/_utilities.scss +3 -1
  160. package/src/styles/99-utilities/_utilities.text-gradient.scss +45 -0
  161. package/themes/dark-complementary/README.md +98 -0
  162. package/themes/dark-complementary/index.scss +158 -0
  163. package/themes/default-light/README.md +81 -0
  164. package/themes/default-light/index.scss +154 -0
  165. package/themes/high-contrast/README.md +105 -0
  166. package/themes/high-contrast/index.scss +172 -0
  167. package/themes/test-theme/README.md +38 -0
  168. package/themes/test-theme/index.scss +47 -0
  169. package/scripts/cli/templates-original-backup.js +0 -1655
  170. package/scripts/cli/templates_backup.js +0 -684
  171. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +0 -1438
  172. package/src/lib/composables/useButton.ts +0 -93
  173. package/src/lib/composables/useCheckbox.ts +0 -70
@@ -15,7 +15,7 @@ import React, { useState } from 'react';
15
15
  import { Grid, GridCol, Container } from '../../../layouts/Grid';
16
16
 
17
17
  const meta: Meta<typeof AtomixGlass> = {
18
- title: 'Components/AtomixGlass/Modes',
18
+ title: 'Components/AtomixGlass/Features/Modes',
19
19
  component: AtomixGlass,
20
20
  parameters: {
21
21
  layout: 'fullscreen',
@@ -0,0 +1,348 @@
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
+ | cornerRadius | 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
+ cornerRadius: {
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: '24px' },
228
+ },
229
+ },
230
+ className: {
231
+ control: 'text',
232
+ description: 'Additional CSS class names',
233
+ table: {
234
+ category: 'Style',
235
+ defaultValue: { summary: '-' },
236
+ },
237
+ },
238
+ style: {
239
+ control: 'object',
240
+ description: 'CSS style object',
241
+ table: {
242
+ category: 'Style',
243
+ defaultValue: { summary: '{}' },
244
+ },
245
+ },
246
+ 'aria-label': {
247
+ control: 'text',
248
+ description: 'ARIA label for accessibility',
249
+ table: {
250
+ category: 'Accessibility',
251
+ defaultValue: { summary: '-' },
252
+ },
253
+ },
254
+ reducedMotion: {
255
+ control: 'boolean',
256
+ description: 'Override for reduced motion preference (default: false)',
257
+ table: {
258
+ category: 'Accessibility',
259
+ defaultValue: { summary: 'false' },
260
+ },
261
+ },
262
+ },
263
+ } satisfies Meta<typeof AtomixGlass>;
264
+
265
+ export default meta;
266
+ type Story = StoryObj<typeof meta>;
267
+
268
+ // ============================================================================
269
+ // BASIC USAGE STORIES
270
+ // ============================================================================
271
+
272
+ export const BasicUsage: Story = {
273
+ args: {
274
+ children: (
275
+ <div className="u-text-center">
276
+ <h2 className="u-mb-4 u-mt-0 u-text-white u-text-28">Basic Glass Effect</h2>
277
+ <p className="u-mb-6 u-mt-0 u-text-white u-opacity-90">
278
+ This is a basic AtomixGlass component with default settings.
279
+ </p>
280
+ <Button variant="primary" glass>
281
+ Click Me
282
+ </Button>
283
+ </div>
284
+ ),
285
+ padding: '32px', // Increased padding for better visual appearance
286
+ },
287
+ render: args => (
288
+ <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">
289
+ <div className="u-w-full u-h-full">
290
+ <div className="u-flex u-justify-center u-items-center u-h-full">
291
+ <AtomixGlass {...args} />
292
+ </div>
293
+ </div>
294
+ </div>
295
+ ),
296
+ parameters: {
297
+ docs: {
298
+ description: {
299
+ story: 'The basic usage of the AtomixGlass component with default configuration.',
300
+ },
301
+ },
302
+ },
303
+ };
304
+
305
+ export const WithAllProps: Story = {
306
+ args: {
307
+ children: (
308
+ <div className="u-text-center">
309
+ <h2 className="u-mb-4 u-mt-0 u-text-white u-text-24">Fully Configured Glass</h2>
310
+ <p className="u-mb-6 u-mt-0 u-text-white u-opacity-90 u-text-16">
311
+ This glass component uses all configurable properties.
312
+ </p>
313
+ <div className="u-flex u-gap-4 u-justify-center">
314
+ <Button variant="primary" glass>
315
+ Primary
316
+ </Button>
317
+ <Button variant="outline-primary" glass>
318
+ Outline
319
+ </Button>
320
+ </div>
321
+ </div>
322
+ ),
323
+ displacementScale: 80,
324
+ blurAmount: 0.5,
325
+ saturation: 150,
326
+ aberrationIntensity: 2.5,
327
+ elasticity: 0.2,
328
+ cornerRadius: 24,
329
+ mode: 'standard',
330
+ overLight: true,
331
+ padding: '32px', // Increased padding for better visual appearance
332
+ onClick: mockHandlers.onClick,
333
+ },
334
+ render: args => (
335
+ <BackgroundWrapper backgroundImage={backgroundImages[0]}>
336
+ <div className="u-flex u-justify-center u-items-center u-h-full">
337
+ <AtomixGlass {...args} />
338
+ </div>
339
+ </BackgroundWrapper>
340
+ ),
341
+ parameters: {
342
+ docs: {
343
+ description: {
344
+ story: 'Demonstrates AtomixGlass with all configurable props set to custom values.',
345
+ },
346
+ },
347
+ },
348
+ };
@@ -0,0 +1,103 @@
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
+ cornerRadius: 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
+ cornerRadius={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
+ };
@@ -316,7 +316,7 @@ export const Playground: Story = {
316
316
  );
317
317
  // eslint-disable-next-line react-hooks/rules-of-hooks
318
318
  const [selectedShader, setSelectedShader] = useState<
319
- 'liquidGlass' | 'plasma' | 'waves' | 'noise'
319
+ 'liquidGlass' | 'plasma' | 'waves' | 'noise' | 'appleFluid' | 'liquidMetal'
320
320
  >('liquidGlass');
321
321
  // eslint-disable-next-line react-hooks/rules-of-hooks
322
322
  const [showCode, setShowCode] = useState(false);
@@ -436,6 +436,19 @@ export const Playground: Story = {
436
436
  </AtomixGlass>`;
437
437
  };
438
438
 
439
+ // ... rest of the component
440
+
441
+ const options = [
442
+ { value: 'liquidGlass', label: 'Liquid Glass (Standard)' },
443
+ { value: 'premiumGlass', label: 'Premium Glass' },
444
+ { value: 'appleFluid', label: 'Apple Fluid' },
445
+ { value: 'liquidMetal', label: 'Liquid Metal' },
446
+ { value: 'basiBasi', label: 'Expert (BasiBasi)' },
447
+ { value: 'plasma', label: 'Plasma (Legacy)' },
448
+ { value: 'waves', label: 'Waves (Legacy)' },
449
+ { value: 'noise', label: 'Noise (Legacy)' },
450
+ ];
451
+
439
452
  const copyCode = () => {
440
453
  navigator.clipboard.writeText(generateCode());
441
454
  setCopiedCode(true);
@@ -460,10 +473,10 @@ export const Playground: Story = {
460
473
  Math.min(
461
474
  100,
462
475
  100 -
463
- settings.displacementScale * 0.15 -
464
- Math.abs(settings.blurAmount) * 2 -
465
- settings.aberrationIntensity * 3 -
466
- settings.elasticity * 20
476
+ settings.displacementScale * 0.15 -
477
+ Math.abs(settings.blurAmount) * 2 -
478
+ settings.aberrationIntensity * 3 -
479
+ settings.elasticity * 20
467
480
  )
468
481
  );
469
482
 
@@ -548,7 +561,8 @@ export const Playground: Story = {
548
561
  className="u-m-0 u-text-white u-font-bold"
549
562
  style={{
550
563
  fontSize: '1.75rem',
551
- background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
564
+ background:
565
+ 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
552
566
  WebkitBackgroundClip: 'text',
553
567
  WebkitTextFillColor: 'transparent',
554
568
  backgroundClip: 'text',
@@ -690,12 +704,12 @@ export const Playground: Story = {
690
704
  : 'Off'
691
705
  : typeof value === 'number'
692
706
  ? value.toFixed(
693
- key.includes('Amount') ||
694
- key.includes('elasticity') ||
695
- key.includes('aberration')
696
- ? 2
697
- : 0
698
- )
707
+ key.includes('Amount') ||
708
+ key.includes('elasticity') ||
709
+ key.includes('aberration')
710
+ ? 2
711
+ : 0
712
+ )
699
713
  : value}
700
714
  </span>
701
715
  </div>
@@ -723,8 +737,8 @@ export const Playground: Story = {
723
737
  }
724
738
  step={
725
739
  key === 'aberrationIntensity' ||
726
- key === 'elasticity' ||
727
- key === 'blurAmount'
740
+ key === 'elasticity' ||
741
+ key === 'blurAmount'
728
742
  ? 0.01
729
743
  : 1
730
744
  }
@@ -790,18 +804,15 @@ export const Playground: Story = {
790
804
  fontSize: '1rem',
791
805
  }}
792
806
  >
793
- <option value="liquidGlass" style={{ background: '#1a1a1a' }}>
794
- Liquid Glass
795
- </option>
796
- <option value="plasma" style={{ background: '#1a1a1a' }}>
797
- Plasma
798
- </option>
799
- <option value="waves" style={{ background: '#1a1a1a' }}>
800
- Waves
801
- </option>
802
- <option value="noise" style={{ background: '#1a1a1a' }}>
803
- Noise
804
- </option>
807
+ {options.map(opt => (
808
+ <option
809
+ key={opt.value}
810
+ value={opt.value}
811
+ style={{ background: '#1a1a1a' }}
812
+ >
813
+ {opt.label}
814
+ </option>
815
+ ))}
805
816
  </select>
806
817
  </div>
807
818
  )}
@@ -908,7 +919,8 @@ export const Playground: Story = {
908
919
  className="u-m-0 u-font-bold"
909
920
  style={{
910
921
  fontSize: '1.75rem',
911
- background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
922
+ background:
923
+ 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
912
924
  WebkitBackgroundClip: 'text',
913
925
  WebkitTextFillColor: 'transparent',
914
926
  backgroundClip: 'text',
@@ -987,7 +999,8 @@ export const Playground: Story = {
987
999
  gap: '8px',
988
1000
  padding: '10px 24px',
989
1001
  borderRadius: '28px',
990
- background: 'linear-gradient(135deg, rgba(122, 255, 215, 0.25) 0%, rgba(102, 126, 234, 0.25) 100%)',
1002
+ background:
1003
+ 'linear-gradient(135deg, rgba(122, 255, 215, 0.25) 0%, rgba(102, 126, 234, 0.25) 100%)',
991
1004
  border: '1px solid rgba(122, 255, 215, 0.3)',
992
1005
  color: '#7AFFD7',
993
1006
  fontSize: '0.875rem',
@@ -1020,7 +1033,8 @@ export const Playground: Story = {
1020
1033
  className="u-mb-4 u-font-bold"
1021
1034
  style={{
1022
1035
  fontSize: '2.75rem',
1023
- background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
1036
+ background:
1037
+ 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
1024
1038
  WebkitBackgroundClip: 'text',
1025
1039
  WebkitTextFillColor: 'transparent',
1026
1040
  backgroundClip: 'text',
@@ -1043,10 +1057,7 @@ export const Playground: Story = {
1043
1057
  affects the visual appearance and performance characteristics of the glass
1044
1058
  effect.
1045
1059
  </p>
1046
- <div
1047
- className="u-flex u-justify-center u-flex-wrap"
1048
- style={{ gap: '1rem' }}
1049
- >
1060
+ <div className="u-flex u-justify-center u-flex-wrap" style={{ gap: '1rem' }}>
1050
1061
  <Button variant="primary" size="lg">
1051
1062
  Primary Action
1052
1063
  </Button>
@@ -1107,11 +1118,15 @@ export const Playground: Story = {
1107
1118
  </div>
1108
1119
  <div>
1109
1120
  <div className="u-text-xs u-opacity-70">Blur</div>
1110
- <div className="u-font-semibold">{settings.blurAmount.toFixed(2)}</div>
1121
+ <div className="u-font-semibold">
1122
+ {settings.blurAmount.toFixed(2)}
1123
+ </div>
1111
1124
  </div>
1112
1125
  <div>
1113
1126
  <div className="u-text-xs u-opacity-70">Elasticity</div>
1114
- <div className="u-font-semibold">{settings.elasticity.toFixed(2)}</div>
1127
+ <div className="u-font-semibold">
1128
+ {settings.elasticity.toFixed(2)}
1129
+ </div>
1115
1130
  </div>
1116
1131
  </div>
1117
1132
  </div>
@@ -14,7 +14,7 @@ import AtomixGlass from '../AtomixGlass';
14
14
  import { BackgroundWrapper } from './shared-components';
15
15
 
16
16
  const meta: Meta<typeof AtomixGlass> = {
17
- title: 'Components/AtomixGlass/Shader Variants',
17
+ title: 'Components/AtomixGlass/Features/Shaders',
18
18
  component: AtomixGlass,
19
19
  parameters: {
20
20
  layout: 'fullscreen',