@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
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { Meta, StoryObj } from '@storybook/react';
3
- import { Accordion } from './Accordion';
3
+ import { fn } from '@storybook/test';
4
+ import { Accordion } from './Accordion';
4
5
  import { ACCORDION } from '../../lib/constants/components';
5
6
  import type { AtomixGlassProps } from '../../lib/types/components';
6
7
 
@@ -15,6 +16,127 @@ const BODY_CLASS = ACCORDION.SELECTORS.BODY.replace('.', '');
15
16
  const IS_OPEN_CLASS = ACCORDION.CLASSES.IS_OPEN;
16
17
  const IS_DISABLED_CLASS = ACCORDION.CLASSES.IS_DISABLED;
17
18
 
19
+ // ============================================================================
20
+ // SHARED UTILITIES & CONSTANTS
21
+ // ============================================================================
22
+
23
+ const mockHandlers = {
24
+ onOpenChange: fn(() => {}),
25
+ onOpen: fn(() => {}),
26
+ onClose: fn(() => {}),
27
+ };
28
+
29
+ // Sample content for stories
30
+ const sampleContent = (
31
+ <div>
32
+ <p>
33
+ This accordion contains rich HTML content including headings, paragraphs, and lists.
34
+ </p>
35
+ <ul>
36
+ <li>
37
+ List item with <a href="#">link</a>
38
+ </li>
39
+ <li>
40
+ List item with <strong>bold text</strong>
41
+ </li>
42
+ <li>
43
+ List item with <em>italic text</em>
44
+ </li>
45
+ </ul>
46
+ <div className="u-p-3 u-mt-3 u-bg-light u-border-radius-1">
47
+ <code>This is a code block inside the accordion</code>
48
+ </div>
49
+ </div>
50
+ );
51
+
52
+ // Component documentation
53
+ const accordionDocumentation = `
54
+ # Accordion
55
+
56
+ ## Overview
57
+
58
+ The Accordion component provides an expandable/collapsible container for content. It follows Atomix guidelines for accessibility, styling, and state management. The component supports both controlled and uncontrolled modes, custom icons, and full keyboard navigation.
59
+
60
+ ## Features
61
+
62
+ - Accessible with proper ARIA attributes
63
+ - Supports controlled and uncontrolled states
64
+ - Customizable icons and positioning
65
+ - Glass morphism effect support
66
+ - Keyboard navigation support
67
+ - Disabled state handling
68
+
69
+ ## Accessibility
70
+
71
+ - Keyboard support: Space/Enter to toggle accordion
72
+ - Screen reader: Proper ARIA labels and roles
73
+ - ARIA support: aria-expanded, aria-controls, aria-disabled
74
+ - Focus management: Maintains focus within component
75
+
76
+ ## Usage Examples
77
+
78
+ ### Basic Usage
79
+
80
+ \`\`\`tsx
81
+ <Accordion title="Section Title">
82
+ <p>Content goes here</p>
83
+ </Accordion>
84
+ \`\`\`
85
+
86
+ ### With Custom Icon
87
+
88
+ \`\`\`tsx
89
+ <Accordion
90
+ title="Custom Icon"
91
+ icon={<CustomIcon />}
92
+ >
93
+ <p>Content with custom icon</p>
94
+ </Accordion>
95
+ \`\`\`
96
+
97
+ ### Controlled State
98
+
99
+ \`\`\`tsx
100
+ <Accordion
101
+ title="Controlled Accordion"
102
+ isOpen={isOpen}
103
+ onOpenChange={setIsOpen}
104
+ >
105
+ <p>Controlled content</p>
106
+ </Accordion>
107
+ \`\`\`
108
+
109
+ ## API Reference
110
+
111
+ | Prop | Type | Default | Description |
112
+ | ---- | ---- | ------- | ----------- |
113
+ | title | string | - | Title of the accordion |
114
+ | children | ReactNode | - | Content to be shown when accordion is expanded |
115
+ | defaultOpen | boolean | false | Whether the accordion is initially open |
116
+ | iconPosition | 'right' \| 'left' | 'right' | Position of the icon |
117
+ | icon | ReactNode | - | Custom icon for the accordion |
118
+ | isOpen | boolean | - | Whether the accordion is open (controlled) |
119
+ | disabled | boolean | false | Whether the accordion is disabled |
120
+ | onOpenChange | (open: boolean) => void | - | Callback when open state changes |
121
+ | glass | AtomixGlassProps \| boolean | - | Glass morphism effect configuration |
122
+
123
+ ## Design Tokens
124
+
125
+ Used design tokens:
126
+
127
+ - \`--atomix-accordion-padding\`: Padding of the accordion
128
+ - \`--atomix-accordion-border\`: Border of the accordion
129
+ - \`--atomix-accordion-background\`: Background of the accordion
130
+
131
+ ## Notes
132
+
133
+ The Accordion component supports both controlled and uncontrolled usage patterns. Use [defaultOpen] for uncontrolled behavior and [isOpen]/[onOpenChange] for controlled behavior.
134
+ `;
135
+
136
+ // ============================================================================
137
+ // META CONFIGURATION
138
+ // ============================================================================
139
+
18
140
  const meta = {
19
141
  title: 'Components/Accordion',
20
142
  component: Accordion,
@@ -22,8 +144,7 @@ const meta = {
22
144
  layout: 'padded',
23
145
  docs: {
24
146
  description: {
25
- component:
26
- 'The Accordion component follows Atomix guidelines for accessibility, styling, and state. It supports both controlled and uncontrolled modes, custom icons, and full keyboard navigation.',
147
+ component: accordionDocumentation,
27
148
  },
28
149
  },
29
150
  },
@@ -33,28 +154,75 @@ const meta = {
33
154
  control: { type: 'radio' },
34
155
  options: ['right', 'left'],
35
156
  description: 'Position of the icon',
36
- defaultValue: 'right',
157
+ table: {
158
+ type: { summary: 'IconPosition' },
159
+ defaultValue: { summary: 'right' },
160
+ },
37
161
  },
38
162
  defaultOpen: {
39
163
  control: 'boolean',
40
164
  description: 'Whether the accordion is initially open',
41
- defaultValue: false,
165
+ table: {
166
+ type: { summary: 'boolean' },
167
+ defaultValue: { summary: 'false' },
168
+ },
42
169
  },
43
170
  disabled: {
44
171
  control: 'boolean',
45
172
  description: 'Whether the accordion is disabled',
173
+ table: {
174
+ type: { summary: 'boolean' },
175
+ defaultValue: { summary: 'false' },
176
+ },
46
177
  },
47
178
  title: {
48
179
  control: 'text',
49
180
  description: 'Title of the accordion',
181
+ table: {
182
+ type: { summary: 'string' },
183
+ },
50
184
  },
51
185
  children: {
52
186
  control: 'text',
53
187
  description: 'Content inside the accordion',
188
+ table: {
189
+ type: { summary: 'ReactNode' },
190
+ },
54
191
  },
55
192
  glass: {
56
- control: 'boolean',
193
+ control: 'object',
57
194
  description: 'Enable glass morphism effect',
195
+ table: {
196
+ type: { summary: 'AtomixGlassProps | boolean' },
197
+ },
198
+ },
199
+ isOpen: {
200
+ control: 'boolean',
201
+ description: 'Controlled open state of the accordion',
202
+ table: {
203
+ type: { summary: 'boolean' },
204
+ },
205
+ },
206
+ onOpenChange: {
207
+ action: 'onOpenChange',
208
+ description: 'Callback when the open state changes',
209
+ table: {
210
+ type: { summary: '(open: boolean) => void' },
211
+ },
212
+ },
213
+ onOpen: {
214
+ action: 'onOpen',
215
+ description: 'Callback when accordion opens',
216
+ table: {
217
+ type: { summary: '() => void' },
218
+ },
219
+ },
220
+ onClose: {
221
+ action: 'onClose',
222
+ description: 'Callback when accordion closes',
223
+ table: {
224
+ type: { summary: '() => void' },
225
+ },
58
226
  },
59
227
  },
60
228
  } satisfies Meta<typeof Accordion>;
@@ -62,53 +230,131 @@ const meta = {
62
230
  export default meta;
63
231
  type Story = StoryObj<typeof meta>;
64
232
 
65
- /**
66
- * Default accordion in closed state.
67
- */
68
- export const Default: Story = {
233
+ // ============================================================================
234
+ // BASIC USAGE STORIES
235
+ // ============================================================================
236
+
237
+ export const BasicUsage: Story = {
69
238
  args: {
70
239
  title: 'Accordion Title',
71
240
  children: <p>This is the content of the accordion that appears when expanded.</p>,
72
241
  },
242
+ parameters: {
243
+ docs: {
244
+ description: {
245
+ story: 'Basic usage of the Accordion component with minimal props.',
246
+ },
247
+ },
248
+ },
73
249
  };
74
250
 
75
- /**
76
- * Accordion in open state by default.
77
- */
78
- export const Open: Story = {
251
+ export const WithAllProps: Story = {
252
+ args: {
253
+ title: 'Fully Configured Accordion',
254
+ children: sampleContent,
255
+ defaultOpen: true,
256
+ iconPosition: 'left',
257
+ disabled: false,
258
+ onOpenChange: mockHandlers.onOpenChange,
259
+ onOpen: mockHandlers.onOpen,
260
+ onClose: mockHandlers.onClose,
261
+ },
262
+ parameters: {
263
+ docs: {
264
+ description: {
265
+ story: 'Accordion with all major props configured.',
266
+ },
267
+ },
268
+ },
269
+ };
270
+
271
+ // ============================================================================
272
+ // VARIANTS & STATES STORIES
273
+ // ============================================================================
274
+
275
+ export const DefaultState: Story = {
276
+ args: {
277
+ title: 'Default Accordion',
278
+ children: <p>This is the default state of the accordion.</p>,
279
+ },
280
+ parameters: {
281
+ docs: {
282
+ description: {
283
+ story: 'Accordion in its default, closed state.',
284
+ },
285
+ },
286
+ },
287
+ };
288
+
289
+ export const OpenState: Story = {
79
290
  args: {
80
291
  title: 'Open Accordion',
81
292
  children: <p>This accordion is open, showing its content.</p>,
82
293
  defaultOpen: true,
83
294
  },
295
+ parameters: {
296
+ docs: {
297
+ description: {
298
+ story: 'Accordion in the open state by default.',
299
+ },
300
+ },
301
+ },
84
302
  };
85
303
 
86
- /**
87
- * Disabled accordion - non-interactive state.
88
- */
89
- export const Disabled: Story = {
304
+ export const DisabledState: Story = {
90
305
  args: {
91
306
  title: 'Disabled Accordion',
92
- children: <p>This accordion is disabled.</p>,
307
+ children: <p>This accordion is disabled and cannot be interacted with.</p>,
93
308
  disabled: true,
94
309
  },
310
+ parameters: {
311
+ docs: {
312
+ description: {
313
+ story: 'Accordion in the disabled state, non-interactive.',
314
+ },
315
+ },
316
+ },
317
+ };
318
+
319
+ export const LoadingState: Story = {
320
+ args: {
321
+ title: 'Loading Content',
322
+ children: (
323
+ <div>
324
+ <p>Loading content...</p>
325
+ <div className="c-spinner c-spinner--sm">Loading...</div>
326
+ </div>
327
+ ),
328
+ },
329
+ parameters: {
330
+ docs: {
331
+ description: {
332
+ story: 'Accordion showing loading state with spinner.',
333
+ },
334
+ },
335
+ },
95
336
  };
96
337
 
97
- /**
98
- * Accordion with icon positioned on the left side.
99
- */
100
- export const IconLeft: Story = {
338
+ // ============================================================================
339
+ // ICON CONFIGURATIONS
340
+ // ============================================================================
341
+
342
+ export const WithIconLeft: Story = {
101
343
  args: {
102
344
  title: 'Icon on Left',
103
- children: <p>This accordion has the icon on the left side.</p>,
345
+ children: <p>This accordion has the icon positioned on the left side.</p>,
104
346
  iconPosition: 'left',
105
347
  },
348
+ parameters: {
349
+ docs: {
350
+ description: {
351
+ story: 'Accordion with icon positioned on the left side.',
352
+ },
353
+ },
354
+ },
106
355
  };
107
356
 
108
- /**
109
- * Accordion with custom icon instead of default chevron.
110
- */
111
- export const CustomIcon: Story = {
357
+ export const WithCustomIcon: Story = {
112
358
  args: {
113
359
  title: 'Custom Icon',
114
360
  children: <p>This accordion uses a custom plus icon.</p>,
@@ -132,11 +378,69 @@ export const CustomIcon: Story = {
132
378
  </i>
133
379
  ),
134
380
  },
381
+ parameters: {
382
+ docs: {
383
+ description: {
384
+ story: 'Accordion with a custom icon instead of the default chevron.',
385
+ },
386
+ },
387
+ },
135
388
  };
136
389
 
137
- /**
138
- * Multiple accordions grouped together.
139
- */
390
+ // ============================================================================
391
+ // ADVANCED CONFIGURATIONS
392
+ // ============================================================================
393
+
394
+ export const ControlledState: Story = {
395
+ args: {
396
+ title: 'Controlled Accordion',
397
+ children: <p>This accordion is controlled by external state.</p>,
398
+ },
399
+ render: (args) => {
400
+ const [open, setOpen] = React.useState(false);
401
+ return (
402
+ <div>
403
+ <button
404
+ className="c-btn c-btn--primary u-mb-3"
405
+ onClick={() => setOpen(prev => !prev)}
406
+ >
407
+ Toggle Accordion (Controlled)
408
+ </button>
409
+ <Accordion
410
+ {...args}
411
+ isOpen={open}
412
+ onOpenChange={setOpen}
413
+ />
414
+ </div>
415
+ );
416
+ },
417
+ parameters: {
418
+ docs: {
419
+ description: {
420
+ story: 'This story demonstrates a controlled Accordion using the `isOpen` and `onOpenChange` props.',
421
+ },
422
+ },
423
+ },
424
+ };
425
+
426
+ export const WithRichContent: Story = {
427
+ args: {
428
+ title: 'Rich Content',
429
+ children: sampleContent,
430
+ },
431
+ parameters: {
432
+ docs: {
433
+ description: {
434
+ story: 'Accordion containing rich HTML content with headings, paragraphs, and lists.',
435
+ },
436
+ },
437
+ },
438
+ };
439
+
440
+ // ============================================================================
441
+ // INTEGRATION EXAMPLES
442
+ // ============================================================================
443
+
140
444
  export const AccordionGroup: Story = {
141
445
  args: {
142
446
  title: 'Accordion Group',
@@ -145,7 +449,7 @@ export const AccordionGroup: Story = {
145
449
  render: () => (
146
450
  <div>
147
451
  <h2>Accordion Group</h2>
148
- <div className="u-flex u-flex-column u-gap-3" style={{ width: '500px' }}>
452
+ <div className="u-flex u-flex-col u-gap-3 u-w-md">
149
453
  <Accordion title="First Accordion" defaultOpen={true}>
150
454
  <p>Content of the first accordion.</p>
151
455
  </Accordion>
@@ -166,169 +470,28 @@ export const AccordionGroup: Story = {
166
470
  </div>
167
471
  </div>
168
472
  ),
169
- };
170
-
171
- /**
172
- * Showcase of all accordion variants and states.
173
- */
174
- export const AllVariants: Story = {
175
- args: {
176
- title: 'All Variants',
177
- children: <p>See render function for all variants</p>,
178
- },
179
473
  parameters: {
180
474
  docs: {
181
475
  description: {
182
- story: 'Comprehensive showcase of all accordion variants including default, open, disabled, icon positions, and custom icons.',
476
+ story: 'Multiple accordions grouped together in a vertical layout.',
183
477
  },
184
478
  },
185
479
  },
186
- render: () => (
187
- <div>
188
- <h2>All Accordion Variants</h2>
189
- <div className="u-flex u-flex-column u-gap-5">
190
- <div>
191
- <h3>Default</h3>
192
- <Accordion title="Default Accordion">
193
- <p>This is the default accordion.</p>
194
- </Accordion>
195
- </div>
196
-
197
- <div>
198
- <h3>Initially Open</h3>
199
- <Accordion title="Initially Open Accordion" defaultOpen={true}>
200
- <p>This accordion starts in the open state.</p>
201
- </Accordion>
202
- </div>
203
-
204
- <div>
205
- <h3>Disabled</h3>
206
- <Accordion title="Disabled Accordion" disabled={true}>
207
- <p>This accordion is disabled and cannot be interacted with.</p>
208
- </Accordion>
209
- </div>
210
-
211
- <div>
212
- <h3>Icon on Left</h3>
213
- <Accordion title="Icon on Left" iconPosition="left">
214
- <p>This accordion has its icon positioned on the left.</p>
215
- </Accordion>
216
- </div>
217
-
218
- <div>
219
- <h3>Custom Icon</h3>
220
- <Accordion
221
- title="Custom Icon"
222
- icon={
223
- <i className="c-accordion__icon">
224
- <svg
225
- xmlns="http://www.w3.org/2000/svg"
226
- width="24"
227
- height="24"
228
- viewBox="0 0 24 24"
229
- fill="none"
230
- stroke="currentColor"
231
- strokeWidth="2"
232
- strokeLinecap="round"
233
- strokeLinejoin="round"
234
- >
235
- <circle cx="12" cy="12" r="10" />
236
- <line x1="12" y1="8" x2="12" y2="16" />
237
- <line x1="8" y1="12" x2="16" y2="12" />
238
- </svg>
239
- </i>
240
- }
241
- >
242
- <p>This accordion uses a custom plus icon.</p>
243
- </Accordion>
244
- </div>
245
-
246
- <div>
247
- <h3>With Rich Content</h3>
248
- <Accordion title="Rich Content">
249
- <div>
250
- <h4>Section Title</h4>
251
- <p>
252
- This accordion contains rich HTML content including headings, paragraphs, and lists.
253
- </p>
254
- <ul>
255
- <li>
256
- List item with <a href="#">link</a>
257
- </li>
258
- <li>
259
- List item with <strong>bold text</strong>
260
- </li>
261
- <li>
262
- List item with <em>italic text</em>
263
- </li>
264
- </ul>
265
- <div className="u-p-3 u-mt-3 u-bg-light u-border-radius-1">
266
- <code>This is a code block inside the accordion</code>
267
- </div>
268
- </div>
269
- </Accordion>
270
- </div>
271
- </div>
272
- </div>
273
- ),
274
480
  };
275
481
 
276
- /**
277
- * Controlled accordion using external state management.
278
- */
279
- export const Controlled: Story = {
280
- args: {
281
- title: 'Controlled Accordion',
282
- children: <p>This accordion is controlled by external state.</p>,
283
- },
284
- render: () => {
285
- const [open, setOpen] = React.useState(false);
286
- return (
287
- <div>
288
- <button className="c-btn c-btn--primary u-mb-3" onClick={() => setOpen(prev => !prev)}>
289
- Toggle Accordion (Controlled)
290
- </button>
291
- <Accordion title="Controlled Accordion" isOpen={open} onOpenChange={setOpen}>
292
- <p>This accordion is controlled by external state.</p>
293
- </Accordion>
294
- </div>
295
- );
296
- },
297
- parameters: {
298
- docs: {
299
- description: {
300
- story:
301
- 'This story demonstrates a controlled Accordion using the `isOpen` and `onOpenChange` props.',
302
- },
303
- },
304
- },
305
- };
482
+ // ============================================================================
483
+ // GLASS EFFECT STORIES
484
+ // ============================================================================
306
485
 
307
- /**
308
- * Accordion with glass morphism effect enabled.
309
- */
310
- export const Glass: Story = {
486
+ export const GlassEffect: Story = {
311
487
  args: {
312
488
  title: 'Glass Accordion',
313
489
  children: <p>This accordion has a glass morphism effect applied.</p>,
314
490
  glass: true,
315
491
  },
316
- render: args => (
317
- <div
318
- style={{
319
- background:
320
- 'url(https://images.unsplash.com/photo-1759915995309-404c743bfbf9?q=80&w=3270&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D)',
321
- backgroundSize: 'cover',
322
- backgroundPosition: 'center',
323
- padding: '2rem',
324
- borderRadius: '12px',
325
- height: '97vh',
326
- display: 'flex',
327
- alignItems: 'center',
328
- justifyContent: 'center',
329
- }}
330
- >
331
- <div style={{ width: '100%', maxWidth: '500px' }}>
492
+ render: (args) => (
493
+ <div className="u-bg-cover u-bg-center u-p-8 u-rounded-xl u-min-h-97vh u-flex u-items-center u-justify-center" style={{backgroundImage: 'url(https://images.unsplash.com/photo-1759915995309-404c743bfbf9?q=80&w=3270&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D)'}}>
494
+ <div className="u-w-full u-max-w-md">
332
495
  <Accordion {...args} />
333
496
  </div>
334
497
  </div>
@@ -336,16 +499,12 @@ export const Glass: Story = {
336
499
  parameters: {
337
500
  docs: {
338
501
  description: {
339
- story:
340
- 'This story demonstrates an Accordion with glass morphism effect enabled against a gradient background.',
502
+ story: 'This story demonstrates an Accordion with glass morphism effect enabled against a gradient background.',
341
503
  },
342
504
  },
343
505
  },
344
506
  };
345
507
 
346
- /**
347
- * Accordion with custom glass morphism settings.
348
- */
349
508
  export const GlassCustom: Story = {
350
509
  args: {
351
510
  title: 'Custom Glass Accordion',
@@ -357,22 +516,8 @@ export const GlassCustom: Story = {
357
516
  mode: 'polar',
358
517
  } as GlassProps,
359
518
  },
360
- render: args => (
361
- <div
362
- style={{
363
- background:
364
- 'url(https://images.unsplash.com/photo-1754147965582-edcb63324a81?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D)',
365
- backgroundSize: '120%',
366
- backgroundPosition: 'center',
367
- padding: '2rem',
368
- borderRadius: '12px',
369
- minHeight: '97vh',
370
- display: 'flex',
371
- alignItems: 'center',
372
- justifyContent: 'center',
373
- animation: 'gradient 15s ease infinite',
374
- }}
375
- >
519
+ render: (args) => (
520
+ <div className="u-bg-cover u-bg-center u-p-8 u-rounded-xl u-min-h-97vh u-flex u-items-center u-justify-center" style={{backgroundImage: 'url(https://images.unsplash.com/photo-1754147965582-edcb63324a81?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D)', backgroundSize: '120%', animation: 'gradient 15s ease infinite'}}>
376
521
  <style>
377
522
  {`
378
523
  @keyframes gradient {
@@ -385,7 +530,7 @@ export const GlassCustom: Story = {
385
530
  }
386
531
  `}
387
532
  </style>
388
- <div style={{ width: '100%', maxWidth: '500px' }}>
533
+ <div className="u-w-full u-max-w-md">
389
534
  <Accordion {...args} />
390
535
  </div>
391
536
  </div>
@@ -393,690 +538,44 @@ export const GlassCustom: Story = {
393
538
  parameters: {
394
539
  docs: {
395
540
  description: {
396
- story:
397
- 'This story demonstrates an Accordion with custom glass morphism settings against a scenic background image.',
541
+ story: 'This story demonstrates an Accordion with custom glass morphism settings against a scenic background image.',
398
542
  },
399
543
  },
400
544
  },
401
545
  };
402
546
 
403
- // Glass Accordion Group
404
- export const GlassGroup: Story = {
547
+ // ============================================================================
548
+ // ACCESSIBILITY STORIES
549
+ // ============================================================================
550
+
551
+ export const WithAriaLabels: Story = {
405
552
  args: {
406
- title: 'Glass Accordion Group',
407
- children: <p>Group example with glass effect - see render function</p>,
408
- glass: {
409
- displacementScale: 180,
410
- blurAmount: 1,
411
- saturation: 60,
412
- mode: 'shader',
413
- ShaderVariant: 'premiumGlass',
414
- } as any,
553
+ title: 'Accessible Accordion',
554
+ children: <p>This accordion includes proper ARIA labels for screen readers.</p>,
415
555
  },
416
- render: () => (
417
- <div
418
- style={{
419
- background:
420
- 'url(https://images.unsplash.com/photo-1623237353316-417116e040a5?q=80&w=3307&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D)',
421
- backgroundSize: '150%',
422
- animation: 'gradient 15s ease infinite',
423
- padding: '2rem',
424
- borderRadius: '12px',
425
- minHeight: '97vh',
426
- }}
427
- >
428
- <style>
429
- {`
430
- @keyframes gradient {
431
- 0% { background-position: 0% 50%; }
432
- 50% { background-position: 100% 50%; }
433
- 100% { background-position: 0% 50%; }
434
- }
435
- `}
436
- </style>
437
- <h2
438
- style={{
439
- color: 'white',
440
- textAlign: 'center',
441
- marginBottom: '2rem',
442
- textShadow: '0 2px 4px rgba(0,0,0,0.3)',
443
- }}
444
- >
445
- Glass Accordion Group
446
- </h2>
447
- <div
448
- className="u-flex u-flex-column u-gap-3"
449
- style={{ width: '100%', maxWidth: '600px', margin: '0 auto' }}
450
- >
451
- <Accordion title="First Glass Accordion" defaultOpen={true} glass>
452
- <p>Content of the first glass accordion with beautiful glass morphism effect.</p>
453
- </Accordion>
454
-
455
- <Accordion title="Second Glass Accordion" glass>
456
- <p>Content of the second glass accordion showcasing the glass effect.</p>
457
- </Accordion>
458
-
459
- <Accordion title="Third Glass Accordion" glass>
460
- <p>Content of the third glass accordion with more content.</p>
461
- <p>Additional paragraph to demonstrate scrolling and glass effects.</p>
462
- <ul>
463
- <li>Glass effect item 1</li>
464
- <li>Glass effect item 2</li>
465
- <li>Glass effect item 3</li>
466
- </ul>
467
- </Accordion>
468
- </div>
469
- </div>
470
- ),
471
556
  parameters: {
472
557
  docs: {
473
558
  description: {
474
- story:
475
- 'This story demonstrates multiple Accordions with glass morphism effects against an animated gradient background.',
559
+ story: 'Accordion with proper ARIA attributes for screen reader accessibility.',
476
560
  },
477
561
  },
478
562
  },
479
563
  };
480
564
 
481
- // Glass Mode Variants - Standard
482
- export const GlassModeStandard: Story = {
483
- args: {
484
- title: 'Standard Glass Mode Accordion',
485
- children: (
486
- <div>
487
- <p>
488
- This accordion uses the standard glass mode with classic blur and displacement effects.
489
- </p>
490
- <p>The standard mode provides a refined glass appearance perfect for elegant interfaces.</p>
491
- </div>
492
- ),
493
- glass: true,
494
- },
495
- render: args => (
496
- <div
497
- style={{
498
- background:
499
- 'url(https://images.unsplash.com/photo-1689960159745-fbc6434d4434?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=1335)',
500
- backgroundSize: 'cover',
501
- backgroundPosition: 'center',
502
- padding: '3rem',
503
- borderRadius: '12px',
504
- minHeight: '95vh',
505
- display: 'flex',
506
- flexDirection: 'column',
507
- alignItems: 'center',
508
- justifyContent: 'center',
509
- gap: '2rem',
510
- }}
511
- >
512
- <div style={{ textAlign: 'center', color: 'white', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
513
- <h3 style={{ fontSize: '1.5rem', marginBottom: '0.5rem' }}>Standard Glass Mode</h3>
514
- <p style={{ fontSize: '0.875rem', opacity: 0.9 }}>
515
- Classic glass morphism with blur and displacement
516
- </p>
517
- </div>
518
- <div style={{ width: '100%', maxWidth: '600px' }}>
519
- <Accordion {...args} />
520
- </div>
521
- </div>
522
- ),
523
- };
524
-
525
- // Glass Mode Variants - Polar
526
- export const GlassModePolar: Story = {
527
- args: {
528
- title: 'Polar Glass Mode Accordion',
529
- children: (
530
- <div>
531
- <p>This accordion uses the polar glass mode with radial distortion effects.</p>
532
- <p>The polar mode creates unique distortion patterns emanating from the center point.</p>
533
- </div>
534
- ),
535
- glass: {
536
- mode: 'polar',
537
- displacementScale: 80,
538
- blurAmount: 1.5,
539
- saturation: 180,
540
- aberrationIntensity: 3,
541
- } as GlassProps,
542
- },
543
- render: args => (
544
- <div
545
- style={{
546
- background: 'url(https://images.unsplash.com/photo-1557683316-973673baf926?w=1920)',
547
- backgroundSize: 'cover',
548
- backgroundPosition: 'center',
549
- padding: '3rem',
550
- borderRadius: '12px',
551
- minHeight: '95vh',
552
- display: 'flex',
553
- flexDirection: 'column',
554
- alignItems: 'center',
555
- justifyContent: 'center',
556
- gap: '2rem',
557
- }}
558
- >
559
- <div style={{ textAlign: 'center', color: 'white', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
560
- <h3 style={{ fontSize: '1.5rem', marginBottom: '0.5rem' }}>Polar Glass Mode</h3>
561
- <p style={{ fontSize: '0.875rem', opacity: 0.9 }}>Radial distortion effect from center</p>
562
- </div>
563
- <div style={{ width: '100%', maxWidth: '600px' }}>
564
- <Accordion {...args} />
565
- </div>
566
- </div>
567
- ),
568
- };
569
-
570
- // Glass Mode Variants - Prominent
571
- export const GlassModeProminent: Story = {
572
- args: {
573
- title: 'Prominent Glass Mode Accordion',
574
- children: (
575
- <div>
576
- <p>This accordion uses the prominent glass mode with enhanced distortion effects.</p>
577
- <p>The prominent mode delivers maximum depth and visual impact for striking designs.</p>
578
- </div>
579
- ),
580
- glass: {
581
- mode: 'prominent',
582
- displacementScale: 100,
583
- blurAmount: 2.5,
584
- saturation: 200,
585
- aberrationIntensity: 4,
586
- } as GlassProps,
587
- },
588
- render: args => (
589
- <div
590
- style={{
591
- background: 'url(https://images.unsplash.com/photo-1579546929518-9e396f3cc809?w=1920)',
592
- backgroundSize: 'cover',
593
- backgroundPosition: 'center',
594
- padding: '3rem',
595
- borderRadius: '12px',
596
- minHeight: '95vh',
597
- display: 'flex',
598
- flexDirection: 'column',
599
- alignItems: 'center',
600
- justifyContent: 'center',
601
- gap: '2rem',
602
- }}
603
- >
604
- <div style={{ textAlign: 'center', color: 'white', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
605
- <h3 style={{ fontSize: '1.5rem', marginBottom: '0.5rem' }}>Prominent Glass Mode</h3>
606
- <p style={{ fontSize: '0.875rem', opacity: 0.9 }}>Enhanced distortion with maximum depth</p>
607
- </div>
608
- <div style={{ width: '100%', maxWidth: '600px' }}>
609
- <Accordion {...args} />
610
- </div>
611
- </div>
612
- ),
613
- };
614
-
615
- // Glass Mode Variants - Shader
616
- export const GlassModeShader: Story = {
565
+ export const KeyboardNavigation: Story = {
617
566
  args: {
618
- title: 'Shader Glass Mode Accordion',
567
+ title: 'Keyboard Accessible',
619
568
  children: (
620
- <div>
621
- <p>This accordion uses the shader glass mode with GPU-accelerated liquid glass effects.</p>
622
- <p>The shader mode provides smooth, performant animations with liquid glass dynamics.</p>
623
- </div>
569
+ <p>
570
+ This accordion is fully operable via keyboard navigation. Press Tab to focus and Enter/Space to toggle.
571
+ </p>
624
572
  ),
625
- glass: {
626
- mode: 'shader',
627
- shaderVariant: 'liquidGlass',
628
- displacementScale: 70,
629
- blurAmount: 1.8,
630
- saturation: 170,
631
- } as GlassProps,
632
573
  },
633
- render: args => (
634
- <div
635
- style={{
636
- background: 'url(https://images.unsplash.com/photo-1557682250-33bd709cbe85?w=1920)',
637
- backgroundSize: 'cover',
638
- backgroundPosition: 'center',
639
- padding: '3rem',
640
- borderRadius: '12px',
641
- minHeight: '95vh',
642
- display: 'flex',
643
- flexDirection: 'column',
644
- alignItems: 'center',
645
- justifyContent: 'center',
646
- gap: '2rem',
647
- }}
648
- >
649
- <div style={{ textAlign: 'center', color: 'white', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
650
- <h3 style={{ fontSize: '1.5rem', marginBottom: '0.5rem' }}>Shader Glass Mode</h3>
651
- <p style={{ fontSize: '0.875rem', opacity: 0.9 }}>GPU-accelerated liquid glass effect</p>
652
- </div>
653
- <div style={{ width: '100%', maxWidth: '600px' }}>
654
- <Accordion {...args} />
655
- </div>
656
- </div>
657
- ),
658
- };
659
-
660
- // All Glass Modes Comparison
661
- export const AllGlassModesComparison: Story = {
662
- args: {
663
- title: 'Glass Modes Comparison',
664
- children: <p>Comparison example</p>,
665
- },
666
- render: () => (
667
- <div
668
- style={{
669
- background: 'url(https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920)',
670
- backgroundSize: 'cover',
671
- backgroundPosition: 'center',
672
- padding: '3rem',
673
- borderRadius: '12px',
674
- minHeight: '95vh',
675
- overflow: 'auto',
676
- }}
677
- >
678
- <div style={{ maxWidth: '1200px', margin: '0 auto' }}>
679
- <h2
680
- style={{
681
- textAlign: 'center',
682
- color: 'white',
683
- marginBottom: '3rem',
684
- fontSize: '2rem',
685
- textShadow: '0 2px 8px rgba(0,0,0,0.5)',
686
- }}
687
- >
688
- Glass Mode Accordions Comparison
689
- </h2>
690
-
691
- <div
692
- style={{
693
- display: 'grid',
694
- gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))',
695
- gap: '2rem',
696
- }}
697
- >
698
- {/* Standard Mode */}
699
- <div>
700
- <h3
701
- style={{
702
- color: 'white',
703
- marginBottom: '1rem',
704
- fontSize: '1.25rem',
705
- textAlign: 'center',
706
- }}
707
- >
708
- Standard Mode
709
- </h3>
710
- <Accordion title="Standard Glass" glass={true}>
711
- <p>Classic blur and displacement effects for a refined glass appearance.</p>
712
- </Accordion>
713
- </div>
714
-
715
- {/* Polar Mode */}
716
- <div>
717
- <h3
718
- style={{
719
- color: 'white',
720
- marginBottom: '1rem',
721
- fontSize: '1.25rem',
722
- textAlign: 'center',
723
- }}
724
- >
725
- Polar Mode
726
- </h3>
727
- <Accordion
728
- title="Polar Glass"
729
- glass={
730
- {
731
- mode: 'polar',
732
- displacementScale: 80,
733
- blurAmount: 1.5,
734
- saturation: 180,
735
- aberrationIntensity: 3,
736
- } as GlassProps
737
- }
738
- >
739
- <p>Radial distortion effects emanating from the center point.</p>
740
- </Accordion>
741
- </div>
742
-
743
- {/* Prominent Mode */}
744
- <div>
745
- <h3
746
- style={{
747
- color: 'white',
748
- marginBottom: '1rem',
749
- fontSize: '1.25rem',
750
- textAlign: 'center',
751
- }}
752
- >
753
- Prominent Mode
754
- </h3>
755
- <Accordion
756
- title="Prominent Glass"
757
- glass={
758
- {
759
- mode: 'prominent',
760
- displacementScale: 100,
761
- blurAmount: 2.5,
762
- saturation: 200,
763
- aberrationIntensity: 4,
764
- } as GlassProps
765
- }
766
- >
767
- <p>Enhanced distortion with maximum depth and visual impact.</p>
768
- </Accordion>
769
- </div>
770
-
771
- {/* Shader Mode */}
772
- <div>
773
- <h3
774
- style={{
775
- color: 'white',
776
- marginBottom: '1rem',
777
- fontSize: '1.25rem',
778
- textAlign: 'center',
779
- }}
780
- >
781
- Shader Mode
782
- </h3>
783
- <Accordion
784
- title="Shader Glass"
785
- glass={
786
- {
787
- mode: 'shader',
788
- shaderVariant: 'liquidGlass',
789
- displacementScale: 70,
790
- blurAmount: 1.8,
791
- saturation: 170,
792
- } as GlassProps
793
- }
794
- >
795
- <p>GPU-accelerated liquid glass with smooth animations.</p>
796
- </Accordion>
797
- </div>
798
- </div>
799
- </div>
800
- </div>
801
- ),
802
- };
803
-
804
- // Glass Accordion Interactive Showcase
805
- export const GlassInteractiveShowcase: Story = {
806
- args: {
807
- title: 'Interactive Glass Accordion',
808
- children: <p>Interactive showcase</p>,
809
- },
810
- render: () => {
811
- const [openIndex, setOpenIndex] = React.useState<number | null>(0);
812
-
813
- return (
814
- <div
815
- style={{
816
- background: 'url(https://images.unsplash.com/photo-1519681393784-d120267933ba?w=1920)',
817
- backgroundSize: 'cover',
818
- backgroundPosition: 'center',
819
- padding: '3rem',
820
- borderRadius: '12px',
821
- minHeight: '95vh',
822
- overflow: 'auto',
823
- }}
824
- >
825
- <div style={{ maxWidth: '800px', margin: '0 auto' }}>
826
- <h2
827
- style={{
828
- textAlign: 'center',
829
- color: 'white',
830
- marginBottom: '3rem',
831
- fontSize: '2rem',
832
- textShadow: '0 2px 8px rgba(0,0,0,0.5)',
833
- }}
834
- >
835
- Interactive Glass Accordion Showcase
836
- </h2>
837
-
838
- <div className="u-flex u-flex-column u-gap-3">
839
- <Accordion
840
- title="Features & Benefits"
841
- isOpen={openIndex === 0}
842
- onOpenChange={open => setOpenIndex(open ? 0 : null)}
843
- glass={
844
- {
845
- mode: 'standard',
846
- displacementScale: 60,
847
- blurAmount: 2,
848
- } as any
849
- }
850
- >
851
- <div>
852
- <h4 style={{ marginBottom: '0.5rem' }}>Premium Glass Effects</h4>
853
- <ul style={{ paddingLeft: '1.5rem' }}>
854
- <li>Hardware-accelerated rendering</li>
855
- <li>Smooth mouse-responsive animations</li>
856
- <li>Multiple distortion modes</li>
857
- <li>Customizable parameters</li>
858
- </ul>
859
- </div>
860
- </Accordion>
861
-
862
- <Accordion
863
- title="Technical Specifications"
864
- isOpen={openIndex === 1}
865
- onOpenChange={open => setOpenIndex(open ? 1 : null)}
866
- glass={
867
- {
868
- mode: 'polar',
869
- displacementScale: 70,
870
- blurAmount: 1.8,
871
- } as any
872
- }
873
- >
874
- <div>
875
- <h4 style={{ marginBottom: '0.5rem' }}>Performance & Compatibility</h4>
876
- <p>Optimized for modern browsers with WebGL support.</p>
877
- <ul style={{ paddingLeft: '1.5rem', marginTop: '0.5rem' }}>
878
- <li>60 FPS animations</li>
879
- <li>Responsive design</li>
880
- <li>Accessibility compliant</li>
881
- <li>Mobile-friendly</li>
882
- </ul>
883
- </div>
884
- </Accordion>
885
-
886
- <Accordion
887
- title="Customization Options"
888
- isOpen={openIndex === 2}
889
- onOpenChange={open => setOpenIndex(open ? 2 : null)}
890
- glass={
891
- {
892
- mode: 'prominent',
893
- displacementScale: 80,
894
- blurAmount: 2.2,
895
- } as any
896
- }
897
- >
898
- <div>
899
- <h4 style={{ marginBottom: '0.5rem' }}>Flexible Configuration</h4>
900
- <p>Customize every aspect of the glass effect:</p>
901
- <ul style={{ paddingLeft: '1.5rem', marginTop: '0.5rem' }}>
902
- <li>Blur amount and saturation</li>
903
- <li>Displacement scale</li>
904
- <li>Aberration intensity</li>
905
- <li>Corner radius</li>
906
- <li>Mode selection</li>
907
- </ul>
908
- </div>
909
- </Accordion>
910
-
911
- <Accordion
912
- title="Integration Guide"
913
- isOpen={openIndex === 3}
914
- onOpenChange={open => setOpenIndex(open ? 3 : null)}
915
- glass={
916
- {
917
- mode: 'shader',
918
- shaderVariant: 'liquidGlass',
919
- displacementScale: 65,
920
- } as any
921
- }
922
- >
923
- <div>
924
- <h4 style={{ marginBottom: '0.5rem' }}>Easy Implementation</h4>
925
- <p>Simple to integrate with your existing components:</p>
926
- <div
927
- style={{
928
- background: 'rgba(0,0,0,0.3)',
929
- padding: '1rem',
930
- borderRadius: '4px',
931
- marginTop: '0.5rem',
932
- }}
933
- >
934
- <code style={{ color: '#fff', fontSize: '0.875rem' }}>
935
- {'<Accordion glass={true} />'}
936
- </code>
937
- </div>
938
- </div>
939
- </Accordion>
940
- </div>
941
- </div>
942
- </div>
943
- );
944
- },
945
- };
946
-
947
- // Glass Accordion with Rich Content
948
- export const GlassRichContent: Story = {
949
- args: {
950
- title: 'Glass Accordion with Rich Content',
951
- children: <p>Rich content example</p>,
574
+ parameters: {
575
+ docs: {
576
+ description: {
577
+ story: 'Demonstrates keyboard navigation support for the accordion component.',
578
+ },
579
+ },
952
580
  },
953
- render: () => (
954
- <div
955
- style={{
956
- background: 'url(https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?w=1920)',
957
- backgroundSize: 'cover',
958
- backgroundPosition: 'center',
959
- padding: '3rem',
960
- borderRadius: '12px',
961
- minHeight: '95vh',
962
- overflow: 'auto',
963
- }}
964
- >
965
- <div style={{ maxWidth: '800px', margin: '0 auto' }}>
966
- <h2
967
- style={{
968
- textAlign: 'center',
969
- color: 'white',
970
- marginBottom: '3rem',
971
- fontSize: '2rem',
972
- textShadow: '0 2px 8px rgba(0,0,0,0.5)',
973
- }}
974
- >
975
- Glass Accordion with Rich Content
976
- </h2>
977
-
978
- <div className="u-flex u-flex-column u-gap-3">
979
- <Accordion title="Design Philosophy" defaultOpen={true} glass={true}>
980
- <div>
981
- <p style={{ marginBottom: '1rem' }}>
982
- Our glass morphism design combines modern aesthetics with practical functionality.
983
- The translucent effects create depth and visual hierarchy while maintaining
984
- readability.
985
- </p>
986
- <div style={{ display: 'flex', gap: '1rem', marginTop: '1rem' }}>
987
- <div
988
- style={{
989
- flex: 1,
990
- background: 'rgba(255,255,255,0.1)',
991
- padding: '1rem',
992
- borderRadius: '8px',
993
- }}
994
- >
995
- <h5 style={{ marginBottom: '0.5rem' }}>Aesthetic</h5>
996
- <p style={{ fontSize: '0.875rem' }}>Beautiful, modern design</p>
997
- </div>
998
- <div
999
- style={{
1000
- flex: 1,
1001
- background: 'rgba(255,255,255,0.1)',
1002
- padding: '1rem',
1003
- borderRadius: '8px',
1004
- }}
1005
- >
1006
- <h5 style={{ marginBottom: '0.5rem' }}>Functional</h5>
1007
- <p style={{ fontSize: '0.875rem' }}>Practical and usable</p>
1008
- </div>
1009
- </div>
1010
- </div>
1011
- </Accordion>
1012
-
1013
- <Accordion
1014
- title="Component Features"
1015
- glass={
1016
- {
1017
- mode: 'polar',
1018
- displacementScale: 70,
1019
- } as any
1020
- }
1021
- >
1022
- <div>
1023
- <p style={{ marginBottom: '1rem' }}>
1024
- Explore the comprehensive features available in our glass accordion component:
1025
- </p>
1026
- <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '0.5rem' }}>
1027
- <div>✨ Glass morphism effects</div>
1028
- <div>🎨 Multiple visual modes</div>
1029
- <div>⚡ High performance</div>
1030
- <div>♿ Accessibility ready</div>
1031
- <div>📱 Mobile responsive</div>
1032
- <div>🎯 Easy customization</div>
1033
- </div>
1034
- </div>
1035
- </Accordion>
1036
-
1037
- <Accordion
1038
- title="Implementation Examples"
1039
- glass={
1040
- {
1041
- mode: 'shader',
1042
- shaderVariant: 'liquidGlass',
1043
- } as any
1044
- }
1045
- >
1046
- <div>
1047
- <p style={{ marginBottom: '1rem' }}>
1048
- Multiple ways to implement glass effects in your application:
1049
- </p>
1050
- <div
1051
- style={{
1052
- background: 'rgba(0,0,0,0.3)',
1053
- padding: '1rem',
1054
- borderRadius: '8px',
1055
- marginBottom: '1rem',
1056
- }}
1057
- >
1058
- <code
1059
- style={{
1060
- color: '#fff',
1061
- fontSize: '0.875rem',
1062
- display: 'block',
1063
- whiteSpace: 'pre',
1064
- }}
1065
- >
1066
- {`// Basic usage
1067
- <Accordion glass={true} />
1068
-
1069
- // Custom configuration
1070
- <Accordion glass={{
1071
- mode: 'polar',
1072
- displacementScale: 70
1073
- }} />`}
1074
- </code>
1075
- </div>
1076
- </div>
1077
- </Accordion>
1078
- </div>
1079
- </div>
1080
- </div>
1081
- ),
1082
- };
581
+ };