@shohojdhara/atomix 0.3.14 → 0.4.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 (343) 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 +44 -0
  12. package/build-tools/index.js +88 -0
  13. package/build-tools/package.json +50 -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 +21044 -2618
  20. package/dist/atomix.css.map +1 -1
  21. package/dist/atomix.min.css +77 -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 +44 -0
  33. package/dist/build-tools/index.js +88 -0
  34. package/dist/build-tools/package.json +50 -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 +152 -78
  53. package/dist/index.esm.js +346 -340
  54. package/dist/index.esm.js.map +1 -1
  55. package/dist/index.js +359 -353
  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/dist/layout.js.map +1 -1
  60. package/dist/theme.d.ts +9 -9
  61. package/dist/theme.js.map +1 -1
  62. package/package.json +23 -8
  63. package/scripts/atomix-cli.js +170 -73
  64. package/scripts/cli/__tests__/README.md +81 -0
  65. package/scripts/cli/__tests__/basic.test.js +115 -0
  66. package/scripts/cli/__tests__/component-generator.test.js +332 -0
  67. package/scripts/cli/__tests__/integration.test.js +327 -0
  68. package/scripts/cli/__tests__/test-setup.js +133 -0
  69. package/scripts/cli/__tests__/token-manager.test.js +251 -0
  70. package/scripts/cli/__tests__/utils.test.js +161 -0
  71. package/scripts/cli/component-generator.js +253 -299
  72. package/scripts/cli/dependency-checker.js +355 -0
  73. package/scripts/cli/interactive-init.js +46 -5
  74. package/scripts/cli/template-manager.js +0 -2
  75. package/scripts/cli/templates/common-templates.js +636 -0
  76. package/scripts/cli/templates/composable-templates.js +148 -126
  77. package/scripts/cli/templates/index.js +23 -16
  78. package/scripts/cli/templates/project-templates.js +151 -23
  79. package/scripts/cli/templates/react-templates.js +280 -210
  80. package/scripts/cli/templates/scss-templates.js +90 -91
  81. package/scripts/cli/templates/testing-templates.js +206 -27
  82. package/scripts/cli/templates/testing-utils.js +278 -0
  83. package/scripts/cli/templates/types-templates.js +70 -56
  84. package/scripts/cli/theme-bridge.js +8 -2
  85. package/scripts/cli/token-manager.js +318 -206
  86. package/scripts/cli/utils.js +0 -1
  87. package/src/components/Accordion/Accordion.stories.tsx +358 -850
  88. package/src/components/Accordion/Accordion.test.tsx +70 -50
  89. package/src/components/Accordion/Accordion.tsx +99 -94
  90. package/src/components/AtomixGlass/AtomixGlass.test.tsx +1 -1
  91. package/src/components/AtomixGlass/AtomixGlass.tsx +80 -39
  92. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +103 -81
  93. package/src/components/AtomixGlass/GlassFilter.tsx +9 -16
  94. package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +8 -7
  95. package/src/components/AtomixGlass/glass-utils.ts +6 -5
  96. package/src/components/AtomixGlass/shader-utils.ts +133 -52
  97. package/src/components/AtomixGlass/stories/Customization.stories.tsx +131 -0
  98. package/src/components/AtomixGlass/stories/Examples.stories.tsx +2957 -2853
  99. package/src/components/AtomixGlass/stories/Modes.stories.tsx +1 -1
  100. package/src/components/AtomixGlass/stories/Overview.stories.tsx +348 -0
  101. package/src/components/AtomixGlass/stories/Performance.stories.tsx +103 -0
  102. package/src/components/AtomixGlass/stories/Playground.stories.tsx +51 -36
  103. package/src/components/AtomixGlass/stories/{ShaderVariants.stories.tsx → Shaders.stories.tsx} +2 -2
  104. package/src/components/AtomixGlass/stories/shared-components.tsx +90 -190
  105. package/src/components/Avatar/Avatar.stories.tsx +195 -0
  106. package/src/components/Avatar/Avatar.tsx +58 -56
  107. package/src/components/Badge/Badge.stories.tsx +122 -352
  108. package/src/components/Badge/Badge.test.tsx +41 -41
  109. package/src/components/Badge/Badge.tsx +64 -62
  110. package/src/components/Block/Block.stories.tsx +30 -11
  111. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +142 -23
  112. package/src/components/Breadcrumb/Breadcrumb.tsx +62 -60
  113. package/src/components/Button/Button.stories.tsx +454 -1126
  114. package/src/components/Button/Button.test.tsx +123 -0
  115. package/src/components/Button/Button.tsx +88 -60
  116. package/src/components/Button/ButtonGroup.stories.tsx +376 -215
  117. package/src/components/Button/ButtonGroup.tsx +4 -15
  118. package/src/components/Callout/Callout.stories.tsx +316 -568
  119. package/src/components/Card/Card.stories.tsx +292 -81
  120. package/src/components/Card/Card.tsx +30 -14
  121. package/src/components/Chart/AreaChart.tsx +1 -1
  122. package/src/components/Chart/CandlestickChart.tsx +23 -16
  123. package/src/components/Chart/Chart.stories.tsx +153 -16
  124. package/src/components/Chart/Chart.tsx +40 -44
  125. package/src/components/Chart/ChartRenderer.tsx +39 -12
  126. package/src/components/Chart/ChartToolbar.tsx +21 -5
  127. package/src/components/Chart/DonutChart.tsx +1 -1
  128. package/src/components/Chart/FunnelChart.tsx +4 -1
  129. package/src/components/Chart/GaugeChart.tsx +3 -1
  130. package/src/components/Chart/HeatmapChart.tsx +50 -37
  131. package/src/components/Chart/LineChart.tsx +3 -2
  132. package/src/components/Chart/MultiAxisChart.tsx +24 -16
  133. package/src/components/Chart/RadarChart.tsx +19 -17
  134. package/src/components/Chart/ScatterChart.tsx +29 -21
  135. package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +152 -66
  136. package/src/components/ColorModeToggle/ColorModeToggle.tsx +15 -3
  137. package/src/components/Countdown/Countdown.stories.tsx +114 -7
  138. package/src/components/DataTable/DataTable.stories.tsx +349 -144
  139. package/src/components/DataTable/DataTable.test.tsx +26 -148
  140. package/src/components/DataTable/DataTable.tsx +485 -456
  141. package/src/components/DatePicker/DatePicker.stories.tsx +310 -1066
  142. package/src/components/DatePicker/DatePicker.tsx +31 -26
  143. package/src/components/Dropdown/Dropdown.stories.tsx +153 -36
  144. package/src/components/Dropdown/Dropdown.tsx +313 -299
  145. package/src/components/EdgePanel/EdgePanel.stories.tsx +221 -25
  146. package/src/components/EdgePanel/EdgePanel.tsx +1 -3
  147. package/src/components/Footer/Footer.stories.tsx +396 -327
  148. package/src/components/Footer/Footer.tsx +130 -128
  149. package/src/components/Footer/FooterLink.tsx +2 -2
  150. package/src/components/Form/Checkbox.stories.tsx +140 -6
  151. package/src/components/Form/Checkbox.test.tsx +63 -0
  152. package/src/components/Form/Checkbox.tsx +122 -78
  153. package/src/components/Form/Form.stories.tsx +110 -19
  154. package/src/components/Form/FormGroup.stories.tsx +127 -4
  155. package/src/components/Form/Input.stories.tsx +22 -39
  156. package/src/components/Form/Input.test.tsx +38 -44
  157. package/src/components/Form/Radio.stories.tsx +146 -17
  158. package/src/components/Form/Radio.tsx +68 -66
  159. package/src/components/Form/Select.stories.tsx +140 -8
  160. package/src/components/Form/Select.tsx +184 -182
  161. package/src/components/Form/Textarea.stories.tsx +149 -6
  162. package/src/components/Form/Textarea.test.tsx +27 -32
  163. package/src/components/Hero/Hero.stories.tsx +372 -38
  164. package/src/components/Hero/Hero.tsx +201 -55
  165. package/src/components/Icon/index.ts +7 -1
  166. package/src/components/List/List.stories.tsx +141 -3
  167. package/src/components/List/List.tsx +19 -23
  168. package/src/components/Modal/Modal.stories.tsx +183 -43
  169. package/src/components/Modal/Modal.tsx +130 -127
  170. package/src/components/Navigation/Menu/MegaMenu.tsx +70 -70
  171. package/src/components/Navigation/Nav/NavDropdown.tsx +1 -5
  172. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +128 -28
  173. package/src/components/Navigation/SideMenu/SideMenu.tsx +5 -7
  174. package/src/components/Navigation/SideMenu/SideMenuItem.tsx +4 -5
  175. package/src/components/Pagination/Pagination.stories.tsx +7 -4
  176. package/src/components/Pagination/Pagination.tsx +199 -202
  177. package/src/components/PhotoViewer/PhotoViewer.tsx +4 -1
  178. package/src/components/Popover/Popover.stories.tsx +354 -97
  179. package/src/components/Popover/Popover.tsx +41 -37
  180. package/src/components/Progress/Progress.stories.tsx +160 -7
  181. package/src/components/River/River.stories.tsx +3 -2
  182. package/src/components/SectionIntro/SectionIntro.stories.tsx +239 -47
  183. package/src/components/Slider/Slider.stories.tsx +12 -4
  184. package/src/components/Spinner/Spinner.stories.tsx +104 -8
  185. package/src/components/Spinner/Spinner.test.tsx +23 -23
  186. package/src/components/Spinner/Spinner.tsx +43 -46
  187. package/src/components/Steps/Steps.stories.tsx +173 -42
  188. package/src/components/Tabs/Tabs.stories.tsx +141 -12
  189. package/src/components/Tabs/Tabs.tsx +74 -72
  190. package/src/components/Testimonial/Testimonial.stories.tsx +120 -3
  191. package/src/components/Todo/Todo.stories.tsx +198 -9
  192. package/src/components/Toggle/Toggle.stories.tsx +137 -36
  193. package/src/components/Toggle/Toggle.test.tsx +65 -70
  194. package/src/components/Toggle/Toggle.tsx +4 -1
  195. package/src/components/Tooltip/Tooltip.stories.tsx +194 -100
  196. package/src/components/Tooltip/Tooltip.tsx +104 -106
  197. package/src/components/Upload/Upload.stories.tsx +241 -150
  198. package/src/components/Upload/Upload.tsx +287 -283
  199. package/src/components/VideoPlayer/VideoPlayer.tsx +6 -1
  200. package/src/components/index.ts +13 -2
  201. package/src/layouts/Grid/Grid.stories.tsx +9 -3
  202. package/src/layouts/MasonryGrid/MasonryGrid.tsx +5 -1
  203. package/src/lib/README.md +2 -2
  204. package/src/lib/__tests__/theme-tools.test.ts +219 -0
  205. package/src/lib/composables/index.ts +2 -2
  206. package/src/lib/composables/shared-mouse-tracker.ts +13 -14
  207. package/src/lib/composables/useAtomixGlass.ts +126 -97
  208. package/src/lib/composables/useChartExport.ts +3 -8
  209. package/src/lib/composables/useDataTable.ts +72 -43
  210. package/src/lib/composables/useHero.ts +58 -14
  211. package/src/lib/composables/useHeroBackgroundSlider.ts +2 -9
  212. package/src/lib/composables/useInput.ts +10 -8
  213. package/src/lib/composables/useSideMenu.ts +6 -5
  214. package/src/lib/composables/useTooltip.ts +1 -2
  215. package/src/lib/composables/useVideoPlayer.ts +44 -35
  216. package/src/lib/config/index.ts +154 -154
  217. package/src/lib/constants/components.ts +9 -32
  218. package/src/lib/constants/cssVariables.ts +29 -29
  219. package/src/lib/hooks/__tests__/useComponentCustomization.test.ts +2 -6
  220. package/src/lib/hooks/index.ts +1 -1
  221. package/src/lib/hooks/useComponentCustomization.ts +11 -17
  222. package/src/lib/hooks/usePerformanceMonitor.ts +6 -7
  223. package/src/lib/patterns/__tests__/slots.test.ts +1 -1
  224. package/src/lib/patterns/index.ts +1 -1
  225. package/src/lib/patterns/slots.tsx +8 -13
  226. package/src/lib/storybook/InteractiveDemo.tsx +13 -18
  227. package/src/lib/storybook/PreviewContainer.tsx +1 -1
  228. package/src/lib/storybook/VariantsGrid.tsx +3 -7
  229. package/src/lib/storybook/index.ts +1 -1
  230. package/src/lib/theme/adapters/cssVariableMapper.ts +47 -74
  231. package/src/lib/theme/adapters/index.ts +3 -9
  232. package/src/lib/theme/adapters/themeAdapter.ts +41 -26
  233. package/src/lib/theme/config/index.ts +1 -1
  234. package/src/lib/theme/config/types.ts +2 -2
  235. package/src/lib/theme/config/validator.ts +10 -5
  236. package/src/lib/theme/constants/constants.ts +2 -2
  237. package/src/lib/theme/constants/index.ts +1 -2
  238. package/src/lib/theme/core/__tests__/createTheme.test.ts +20 -22
  239. package/src/lib/theme/core/composeTheme.ts +32 -26
  240. package/src/lib/theme/core/createTheme.ts +1 -1
  241. package/src/lib/theme/core/createThemeObject.ts +308 -301
  242. package/src/lib/theme/core/index.ts +3 -3
  243. package/src/lib/theme/devtools/CLI.ts +107 -105
  244. package/src/lib/theme/devtools/Comparator.tsx +50 -32
  245. package/src/lib/theme/devtools/DesignTokensCustomizer.stories.tsx +50 -48
  246. package/src/lib/theme/devtools/DesignTokensCustomizer.tsx +257 -63
  247. package/src/lib/theme/devtools/Inspector.tsx +75 -60
  248. package/src/lib/theme/devtools/LiveEditor.tsx +97 -76
  249. package/src/lib/theme/devtools/Preview.tsx +150 -106
  250. package/src/lib/theme/devtools/ThemeValidator.ts +29 -21
  251. package/src/lib/theme/devtools/index.ts +3 -9
  252. package/src/lib/theme/devtools/useHistory.ts +23 -21
  253. package/src/lib/theme/errors/errors.ts +12 -11
  254. package/src/lib/theme/errors/index.ts +2 -7
  255. package/src/lib/theme/generators/generateCSS.ts +9 -13
  256. package/src/lib/theme/generators/generateCSSNested.ts +1 -6
  257. package/src/lib/theme/generators/generateCSSVariables.ts +673 -630
  258. package/src/lib/theme/generators/index.ts +1 -4
  259. package/src/lib/theme/i18n/index.ts +1 -1
  260. package/src/lib/theme/i18n/rtl.ts +13 -13
  261. package/src/lib/theme/index.ts +7 -16
  262. package/src/lib/theme/runtime/ThemeApplicator.ts +4 -4
  263. package/src/lib/theme/runtime/ThemeContext.tsx +1 -1
  264. package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +19 -23
  265. package/src/lib/theme/runtime/ThemeProvider.tsx +230 -239
  266. package/src/lib/theme/runtime/__tests__/ThemeProvider.integration.test.tsx +1 -1
  267. package/src/lib/theme/runtime/__tests__/ThemeProvider.test.tsx +24 -29
  268. package/src/lib/theme/runtime/index.ts +2 -5
  269. package/src/lib/theme/runtime/useTheme.ts +18 -18
  270. package/src/lib/theme/runtime/useThemeTokens.ts +22 -22
  271. package/src/lib/theme/test/testTheme.ts +15 -16
  272. package/src/lib/theme/tokens/index.ts +2 -7
  273. package/src/lib/theme/tokens/tokens.ts +25 -24
  274. package/src/lib/theme/types.ts +428 -411
  275. package/src/lib/theme/utils/__tests__/themeValidation.test.ts +3 -3
  276. package/src/lib/theme/utils/componentTheming.ts +18 -18
  277. package/src/lib/theme/utils/domUtils.ts +277 -289
  278. package/src/lib/theme/utils/index.ts +1 -2
  279. package/src/lib/theme/utils/injectCSS.ts +10 -14
  280. package/src/lib/theme/utils/naming.ts +20 -16
  281. package/src/lib/theme/utils/themeHelpers.ts +10 -12
  282. package/src/lib/theme/utils/themeUtils.ts +85 -86
  283. package/src/lib/theme/utils/themeValidation.ts +82 -33
  284. package/src/lib/theme-tools.ts +8 -6
  285. package/src/lib/types/components.ts +172 -71
  286. package/src/lib/types/partProps.ts +1 -1
  287. package/src/lib/utils/__tests__/csv.test.ts +45 -0
  288. package/src/lib/utils/componentUtils.ts +8 -12
  289. package/src/lib/utils/csv.ts +19 -0
  290. package/src/lib/utils/dataTableExport.ts +2 -15
  291. package/src/lib/utils/fontPreloader.ts +10 -19
  292. package/src/lib/utils/icons.ts +4 -1
  293. package/src/lib/utils/index.ts +2 -6
  294. package/src/lib/utils/memoryMonitor.ts +10 -8
  295. package/src/lib/utils/themeNaming.ts +2 -2
  296. package/src/styles/01-settings/_index.scss +1 -1
  297. package/src/styles/01-settings/_settings.accordion.scss +28 -7
  298. package/src/styles/01-settings/_settings.colors.scss +11 -11
  299. package/src/styles/01-settings/_settings.design-tokens.scss +61 -50
  300. package/src/styles/01-settings/_settings.navbar.scss +1 -1
  301. package/src/styles/01-settings/_settings.spacing.scss +3 -4
  302. package/src/styles/01-settings/_settings.tooltip.scss +1 -1
  303. package/src/styles/01-settings/_settings.typography.scss +4 -4
  304. package/src/styles/02-tools/_tools.button.scss +51 -21
  305. package/src/styles/02-tools/_tools.utility-api.scss +38 -12
  306. package/src/styles/03-generic/_generic.root.scss +4 -3
  307. package/src/styles/06-components/_components.accordion.scss +56 -14
  308. package/src/styles/06-components/_components.atomix-glass.scss +13 -9
  309. package/src/styles/06-components/_components.button.scss +16 -4
  310. package/src/styles/06-components/_components.callout.scss +27 -21
  311. package/src/styles/06-components/_components.card.scss +5 -14
  312. package/src/styles/06-components/_components.chart.scss +22 -19
  313. package/src/styles/06-components/_components.checkbox.scss +25 -17
  314. package/src/styles/06-components/_components.color-mode-toggle.scss +3 -1
  315. package/src/styles/06-components/_components.edge-panel.scss +9 -2
  316. package/src/styles/06-components/_components.footer.scss +1 -1
  317. package/src/styles/06-components/_components.side-menu.scss +5 -5
  318. package/src/styles/06-components/_components.toggle.scss +18 -0
  319. package/src/styles/06-components/_index.scss +1 -1
  320. package/src/styles/06-components/old.chart.styles.scss +0 -2
  321. package/src/styles/99-utilities/_index.scss +2 -0
  322. package/src/styles/99-utilities/_utilities.border.scss +69 -27
  323. package/src/styles/99-utilities/_utilities.display.scss +1 -1
  324. package/src/styles/99-utilities/_utilities.opacity.scss +10 -0
  325. package/src/styles/99-utilities/_utilities.position.scss +16 -9
  326. package/src/styles/99-utilities/_utilities.scss +2 -0
  327. package/src/styles/99-utilities/_utilities.sizes.scss +47 -18
  328. package/src/styles/99-utilities/_utilities.spacing.scss +118 -66
  329. package/src/styles/99-utilities/_utilities.text-gradient.scss +45 -0
  330. package/src/styles/99-utilities/_utilities.text.scss +67 -46
  331. package/themes/dark-complementary/README.md +98 -0
  332. package/themes/dark-complementary/index.scss +158 -0
  333. package/themes/default-light/README.md +81 -0
  334. package/themes/default-light/index.scss +154 -0
  335. package/themes/high-contrast/README.md +105 -0
  336. package/themes/high-contrast/index.scss +172 -0
  337. package/themes/test-theme/README.md +38 -0
  338. package/themes/test-theme/index.scss +47 -0
  339. package/scripts/cli/templates-original-backup.js +0 -1655
  340. package/scripts/cli/templates_backup.js +0 -684
  341. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +0 -1438
  342. package/src/lib/composables/useButton.ts +0 -93
  343. package/src/lib/composables/useCheckbox.ts +0 -70
@@ -1,6 +1,49 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
+ import { fn } from '@storybook/test';
3
+ import { useState, useCallback } from 'react';
2
4
  import { Button } from './Button';
3
- import { SIZES } from '../../lib/constants/components';
5
+ import { SIZES, THEME_COLORS } from '../../lib/constants/components';
6
+
7
+ // ============================================================================
8
+ // TYPE DEFINITIONS
9
+ // ============================================================================
10
+
11
+ /**
12
+ * Type helper for story props without children requirement
13
+ */
14
+ type ButtonStoryProps = Omit<React.ComponentProps<typeof Button>, 'children'> & {
15
+ children?: React.ReactNode;
16
+ };
17
+
18
+ // ============================================================================
19
+ // SHARED UTILITIES & CONSTANTS
20
+ // ============================================================================
21
+
22
+ /**
23
+ * Reusable decorators for common story patterns
24
+ */
25
+ const withBackground = (bgUrl: string) => (Story: any) => (
26
+ <div
27
+ className="u-bg-cover u-bg-center u-p-10 u-rounded-xl"
28
+ style={{
29
+ backgroundImage: `url(${bgUrl})`,
30
+ }}
31
+ >
32
+ <Story />
33
+ </div>
34
+ );
35
+
36
+ /**
37
+ * Sample data for stories
38
+ */
39
+ const sampleData = {
40
+ basic: 'Example text',
41
+ longText: 'Lorem ipsum dolor sit amet...'.repeat(20),
42
+ };
43
+
44
+ // ============================================================================
45
+ // META CONFIGURATION
46
+ // ============================================================================
4
47
 
5
48
  const meta = {
6
49
  title: 'Components/Button',
@@ -9,8 +52,73 @@ const meta = {
9
52
  layout: 'centered',
10
53
  docs: {
11
54
  description: {
12
- component:
13
- 'The Button component is a versatile interactive element used to trigger actions throughout the application. It supports multiple variants, sizes, states, and can include icons. Buttons are essential for user interactions and provide clear visual feedback for clickable actions.',
55
+ component: `# Button Component
56
+
57
+ ## Overview
58
+ The Button component is a versatile interactive element used to trigger actions throughout the application. It supports multiple variants, sizes, states, and can include icons. Buttons are essential for user interactions and provide clear visual feedback for clickable actions.
59
+
60
+ ## Features
61
+ - Multiple color variants (primary, secondary, success, etc.)
62
+ - Different sizes (sm, md, lg)
63
+ - Support for icons and icon-only buttons
64
+ - Loading states with optional loading text
65
+ - Disabled, active, and selected states
66
+ - Full-width and block-level options
67
+ - Glass morphism effect support
68
+ - Rounded (pill-shaped) style option
69
+
70
+ ## Accessibility
71
+ - Keyboard support: Space and Enter keys activate the button
72
+ - Screen reader: Proper labeling and role attributes
73
+ - ARIA support: Correct roles and states for interactive elements
74
+ - Focus management: Visual focus indicator for keyboard navigation
75
+
76
+ ## Usage Examples
77
+ ### Basic Usage
78
+ \`\`\`tsx
79
+ <Button label="Click Me" variant="primary" />
80
+ \`\`\`
81
+
82
+ ### With Icon
83
+ \`\`\`tsx
84
+ <Button label="Add Item" variant="primary" icon={<PlusIcon />} />
85
+ \`\`\`
86
+
87
+ ### Loading State
88
+ \`\`\`tsx
89
+ <Button label="Saving..." variant="primary" loading />
90
+ \`\`\`
91
+
92
+ ## API Reference
93
+ | Prop | Type | Default | Description |
94
+ |------|------|---------|-------------|
95
+ | variant | string | 'primary' | Visual style variant |
96
+ | size | string | 'md' | Size of the button (sm, md, lg) |
97
+ | disabled | boolean | false | Disables button interaction |
98
+ | icon | ReactNode | - | Icon element to display in the button |
99
+ | iconOnly | boolean | false | Renders only the icon without text |
100
+ | rounded | boolean | false | Makes the button fully rounded (pill-shaped) |
101
+ | glass | boolean or GlassConfig | false | Enables glass morphism effect |
102
+ | loading | boolean | false | Shows loading spinner and disables interaction |
103
+ | loadingText | string | - | Custom text to display during loading |
104
+ | fullWidth | boolean | false | Makes button take full container width |
105
+ | block | boolean | false | Makes button a block-level element |
106
+ | active | boolean | false | Applies active state styling |
107
+ | selected | boolean | false | Applies selected state styling |
108
+ | iconPosition | 'start' or 'end' | 'start' | Position of the icon relative to text |
109
+
110
+ ## Design Tokens
111
+ - \`--atomix-btn-padding\`: Padding around button content
112
+ - \`--atomix-btn-font-size\`: Font size of button text
113
+ - \`--atomix-btn-border-radius\`: Border radius of button
114
+ - \`--atomix-btn-transition\`: Transition effect for button states
115
+ - \`--atomix-btn-bg\`: Background color of button
116
+ - \`--atomix-btn-color\`: Text color of button
117
+ - \`--atomix-btn-shadow\`: Shadow of button
118
+
119
+ ## Notes
120
+ Buttons are essential for user interactions and should be used consistently throughout the application to maintain a cohesive experience. Consider the context and purpose when choosing the appropriate variant and size.
121
+ `,
14
122
  },
15
123
  },
16
124
  },
@@ -38,62 +146,121 @@ const meta = {
38
146
  'link',
39
147
  ],
40
148
  description: 'The visual style of the button',
41
- defaultValue: 'primary',
149
+ table: {
150
+ type: { summary: 'string' },
151
+ defaultValue: { summary: 'primary' },
152
+ },
42
153
  },
43
154
  size: {
44
155
  control: { type: 'select' },
45
156
  options: SIZES,
46
157
  description: 'The size of the button',
47
- defaultValue: 'md',
158
+ table: {
159
+ type: { summary: 'string' },
160
+ defaultValue: { summary: 'md' },
161
+ },
48
162
  },
49
163
  disabled: {
50
164
  control: 'boolean',
51
165
  description: 'Whether the button is disabled',
166
+ table: {
167
+ type: { summary: 'boolean' },
168
+ defaultValue: { summary: 'false' },
169
+ },
52
170
  },
53
171
  icon: {
54
- control: 'text',
172
+ control: 'object',
55
173
  description: 'Optional icon element to display in the button',
174
+ table: {
175
+ type: { summary: 'ReactNode' },
176
+ },
56
177
  },
57
178
  iconOnly: {
58
179
  control: 'boolean',
59
180
  description: 'Whether the button should only display an icon',
181
+ table: {
182
+ type: { summary: 'boolean' },
183
+ defaultValue: { summary: 'false' },
184
+ },
60
185
  },
61
186
  rounded: {
62
187
  control: 'boolean',
63
188
  description: 'Whether the button should have a fully rounded (pill) shape',
189
+ table: {
190
+ type: { summary: 'boolean' },
191
+ defaultValue: { summary: 'false' },
192
+ },
64
193
  },
65
194
  glass: {
66
- control: { type: 'boolean' },
195
+ control: 'object',
67
196
  description: 'Apply glass morphism effect to the button',
197
+ table: {
198
+ type: { summary: 'boolean | GlassConfig' },
199
+ defaultValue: { summary: 'false' },
200
+ },
68
201
  },
69
202
  loading: {
70
203
  control: 'boolean',
71
204
  description: 'Whether the button is in a loading state',
205
+ table: {
206
+ type: { summary: 'boolean' },
207
+ defaultValue: { summary: 'false' },
208
+ },
72
209
  },
73
210
  loadingText: {
74
211
  control: 'text',
75
212
  description: 'Custom text to display during loading',
213
+ table: {
214
+ type: { summary: 'string' },
215
+ },
76
216
  },
77
217
  fullWidth: {
78
218
  control: 'boolean',
79
219
  description: 'Whether the button should take full width',
220
+ table: {
221
+ type: { summary: 'boolean' },
222
+ defaultValue: { summary: 'false' },
223
+ },
80
224
  },
81
225
  block: {
82
226
  control: 'boolean',
83
227
  description: 'Whether the button should be block-level',
228
+ table: {
229
+ type: { summary: 'boolean' },
230
+ defaultValue: { summary: 'false' },
231
+ },
84
232
  },
85
233
  active: {
86
234
  control: 'boolean',
87
235
  description: 'Whether the button is in active state',
236
+ table: {
237
+ type: { summary: 'boolean' },
238
+ defaultValue: { summary: 'false' },
239
+ },
88
240
  },
89
241
  selected: {
90
242
  control: 'boolean',
91
243
  description: 'Whether the button is selected',
244
+ table: {
245
+ type: { summary: 'boolean' },
246
+ defaultValue: { summary: 'false' },
247
+ },
92
248
  },
93
249
  iconPosition: {
94
250
  control: { type: 'select' },
95
251
  options: ['start', 'end'],
96
252
  description: 'Position of the icon',
253
+ table: {
254
+ type: { summary: '"start" | "end"' },
255
+ defaultValue: { summary: 'start' },
256
+ },
257
+ },
258
+ onClick: {
259
+ action: 'clicked',
260
+ description: 'Click event handler',
261
+ table: {
262
+ type: { summary: '(event: React.MouseEvent) => void' },
263
+ },
97
264
  },
98
265
  },
99
266
  } satisfies Meta<typeof Button>;
@@ -118,152 +285,157 @@ const Icon = () => (
118
285
  </svg>
119
286
  );
120
287
 
288
+ // ============================================================================
289
+ // BASIC USAGE STORIES
290
+ // ============================================================================
291
+
121
292
  /**
122
- * Primary button variant - the main call-to-action style.
293
+ * Basic button usage with minimal props
123
294
  */
124
- export const Primary: Story = {
295
+ export const BasicUsage: Story = {
125
296
  args: {
126
- label: 'Primary Button',
297
+ label: 'Basic Button',
127
298
  variant: 'primary',
128
299
  size: 'md',
129
300
  },
130
301
  };
131
302
 
132
303
  /**
133
- * Secondary button variant - used for secondary actions.
304
+ * Button with all available props configured
134
305
  */
135
- export const Secondary: Story = {
306
+ export const WithAllProps: Story = {
136
307
  args: {
137
- label: 'Secondary Button',
138
- variant: 'secondary',
308
+ label: 'Complete Button',
309
+ variant: 'primary',
139
310
  size: 'md',
311
+ icon: <Icon />,
312
+ iconPosition: 'start',
313
+ rounded: true,
314
+ loading: false,
315
+ disabled: false,
140
316
  },
141
- };
142
-
143
- /**
144
- * Success button variant - indicates successful or positive actions.
145
- */
146
- export const Success: Story = {
147
- args: {
148
- label: 'Success Button',
149
- variant: 'success',
150
- size: 'md',
317
+ parameters: {
318
+ docs: {
319
+ description: {
320
+ story: 'Demonstrates Button with all props configured.',
321
+ },
322
+ },
151
323
  },
152
324
  };
153
325
 
154
- /**
155
- * Info button variant - used for informational actions.
156
- */
157
- export const Info: Story = {
158
- args: {
159
- label: 'Info Button',
160
- variant: 'info',
161
- size: 'md',
162
- },
163
- };
326
+ // ============================================================================
327
+ // VARIANTS & STATES STORIES
328
+ // ============================================================================
164
329
 
165
330
  /**
166
- * Warning button variant - indicates caution or warning actions.
331
+ * Shows all available button color variants
167
332
  */
168
- export const Warning: Story = {
169
- args: {
170
- label: 'Warning Button',
171
- variant: 'warning',
172
- size: 'md',
173
- },
174
- };
175
-
176
- /**
177
- * Error button variant - indicates destructive or error actions.
178
- */
179
- export const Error: Story = {
180
- args: {
181
- label: 'Error Button',
182
- variant: 'error',
183
- size: 'md',
184
- },
333
+ export const AllVariants: Story = {
334
+ render: () => (
335
+ <div className="u-flex u-flex-wrap u-gap-2">
336
+ {THEME_COLORS.map(color => (
337
+ <Button key={color} label={color} variant={color as any} />
338
+ ))}
339
+ </div>
340
+ ),
185
341
  };
186
342
 
187
343
  /**
188
- * Outline primary button variant - outlined style with primary color.
344
+ * Shows all available outline button variants
189
345
  */
190
- export const OutlinePrimary: Story = {
191
- args: {
192
- label: 'Outline Primary',
193
- variant: 'outline-primary',
194
- size: 'md',
195
- },
346
+ export const AllOutlineVariants: Story = {
347
+ render: () => (
348
+ <div className="u-flex u-flex-wrap u-gap-2">
349
+ <Button label="Outline Primary" variant="outline-primary" />
350
+ <Button label="Outline Secondary" variant="outline-secondary" />
351
+ <Button label="Outline Success" variant="outline-success" />
352
+ <Button label="Outline Info" variant="outline-info" />
353
+ <Button label="Outline Warning" variant="outline-warning" />
354
+ <Button label="Outline Danger" variant="outline-danger" />
355
+ <Button label="Outline Light" variant="outline-light" />
356
+ <Button label="Outline Dark" variant="outline-dark" />
357
+ </div>
358
+ ),
196
359
  };
197
360
 
198
361
  /**
199
- * Outline secondary button variant - outlined style with secondary color.
362
+ * Shows all available button sizes
200
363
  */
201
- export const OutlineSecondary: Story = {
202
- args: {
203
- label: 'Outline Secondary',
204
- variant: 'outline-secondary',
205
- size: 'md',
206
- },
364
+ export const AllSizes: Story = {
365
+ render: () => (
366
+ <div className="u-flex u-items-center u-gap-2">
367
+ <Button label="Small" variant="primary" size="sm" />
368
+ <Button label="Medium" variant="primary" size="md" />
369
+ <Button label="Large" variant="primary" size="lg" />
370
+ </div>
371
+ ),
207
372
  };
208
373
 
209
374
  /**
210
- * Link button variant - styled as a text link.
375
+ * Shows default state of the button (normal, interactive state)
211
376
  */
212
- export const LinkButton: Story = {
377
+ export const DefaultState: Story = {
213
378
  args: {
214
- label: 'Link Button',
215
- variant: 'link',
379
+ label: 'Default Button',
380
+ variant: 'primary',
216
381
  size: 'md',
217
382
  },
218
383
  };
219
384
 
220
385
  /**
221
- * Small size button variant.
386
+ * Shows button in loading state with spinner
222
387
  */
223
- export const Small: Story = {
388
+ export const LoadingState: Story = {
224
389
  args: {
225
- label: 'Small Button',
390
+ label: 'Loading...',
226
391
  variant: 'primary',
227
- size: 'sm',
392
+ size: 'md',
393
+ loading: true,
228
394
  },
229
395
  };
230
396
 
231
397
  /**
232
- * Medium size button variant (default).
398
+ * Shows button in disabled state (non-interactive)
233
399
  */
234
- export const Medium: Story = {
400
+ export const DisabledState: Story = {
235
401
  args: {
236
- label: 'Medium Button',
402
+ label: 'Disabled Button',
237
403
  variant: 'primary',
238
404
  size: 'md',
405
+ disabled: true,
239
406
  },
240
407
  };
241
408
 
242
409
  /**
243
- * Large size button variant.
410
+ * Shows button in active state
244
411
  */
245
- export const Large: Story = {
412
+ export const ActiveState: Story = {
246
413
  args: {
247
- label: 'Large Button',
414
+ label: 'Active Button',
248
415
  variant: 'primary',
249
- size: 'lg',
416
+ size: 'md',
417
+ active: true,
250
418
  },
251
419
  };
252
420
 
253
421
  /**
254
- * Disabled button state - non-interactive button.
422
+ * Shows button in selected state
255
423
  */
256
- export const Disabled: Story = {
424
+ export const SelectedState: Story = {
257
425
  args: {
258
- label: 'Disabled Button',
426
+ label: 'Selected Button',
259
427
  variant: 'primary',
260
428
  size: 'md',
261
- disabled: true,
429
+ selected: true,
262
430
  },
263
431
  };
264
432
 
433
+ // ============================================================================
434
+ // WITH FEATURES STORIES
435
+ // ============================================================================
436
+
265
437
  /**
266
- * Button with icon - displays an icon alongside the label.
438
+ * Shows button with icon support
267
439
  */
268
440
  export const WithIcon: Story = {
269
441
  args: {
@@ -275,11 +447,23 @@ export const WithIcon: Story = {
275
447
  };
276
448
 
277
449
  /**
278
- * Icon-only button - displays only an icon without text.
450
+ * Shows icon positioned at start and end of button
451
+ */
452
+ export const WithIconPosition: Story = {
453
+ render: () => (
454
+ <div className="u-flex u-gap-2">
455
+ <Button label="Icon Start" variant="primary" icon={<Icon />} iconPosition="start" />
456
+ <Button label="Icon End" variant="secondary" icon={<Icon />} iconPosition="end" />
457
+ </div>
458
+ ),
459
+ };
460
+
461
+ /**
462
+ * Shows button with icon only (no text)
279
463
  */
280
- export const IconOnly: Story = {
464
+ export const WithIconOnly: Story = {
281
465
  args: {
282
- label: 'Add',
466
+ label: 'Icon Only Button',
283
467
  variant: 'primary',
284
468
  size: 'md',
285
469
  icon: <Icon />,
@@ -288,1169 +472,313 @@ export const IconOnly: Story = {
288
472
  };
289
473
 
290
474
  /**
291
- * Showcase of all button color variants in a single view.
475
+ * Shows complex nested content in button
292
476
  */
293
- export const AllVariants: Story = {
294
- args: {
295
- label: 'Button',
296
- variant: 'success',
297
- },
298
- parameters: {
299
- docs: {
300
- description: {
301
- story: 'Displays all available button color variants side by side for easy comparison.',
302
- },
303
- },
304
- },
477
+ export const WithChildren: Story = {
305
478
  render: () => (
306
- <div className="u-flex u-flex-wrap u-gap-2">
307
- <Button label="Primary" variant="primary" />
308
- <Button label="Secondary" variant="secondary" />
309
- <Button label="Success" variant="success" />
310
- <Button label="Info" variant="info" />
311
- <Button label="Warning" variant="warning" />
312
- <Button label="Error" variant="error" />
313
- <Button label="Light" variant="light" />
314
- <Button label="Dark" variant="dark" />
315
- </div>
479
+ <Button variant="primary">
480
+ Button with <strong>Complex Content</strong>
481
+ </Button>
316
482
  ),
317
483
  };
318
484
 
319
485
  /**
320
- * Showcase of all outline button variants in a single view.
486
+ * Shows button with helper text or description
321
487
  */
322
- export const AllOutlineVariants: Story = {
323
- args: {
324
- label: 'Button',
325
- variant: 'outline-primary',
326
- },
327
- parameters: {
328
- docs: {
329
- description: {
330
- story: 'Displays all available outline button variants with transparent backgrounds and colored borders.',
331
- },
332
- },
333
- },
488
+ export const WithHelperText: Story = {
334
489
  render: () => (
335
- <div className="u-flex u-flex-wrap u-gap-2">
336
- <Button label="Outline Primary" variant="outline-primary" />
337
- <Button label="Outline Secondary" variant="outline-secondary" />
338
- <Button label="Outline Success" variant="outline-success" />
339
- <Button label="Outline Info" variant="outline-info" />
340
- <Button label="Outline Warning" variant="outline-warning" />
341
- <Button label="Outline Error" variant="outline-error" />
342
- <Button label="Outline Light" variant="outline-light" />
343
- <Button label="Outline Dark" variant="outline-dark" />
490
+ <div className="u-flex u-flex-column u-gap-2">
491
+ <Button label="Button with Helper" variant="primary" />
492
+ <p className="u-m-0 u-text-sm">This is a helper text for the button</p>
344
493
  </div>
345
494
  ),
346
495
  };
347
496
 
497
+ // ============================================================================
498
+ // ADVANCED CONFIGURATION STORIES
499
+ // ============================================================================
500
+
348
501
  /**
349
- * Showcase of all button sizes (small, medium, large) in a single view.
502
+ * Shows button with custom inline styles
350
503
  */
351
- export const AllSizes: Story = {
504
+ export const CustomStyling: Story = {
352
505
  args: {
353
- label: 'Button',
506
+ label: 'Custom Styled Button',
354
507
  variant: 'primary',
508
+ size: 'md',
355
509
  },
356
- parameters: {
357
- docs: {
358
- description: {
359
- story: 'Compares all available button sizes to help choose the appropriate size for your use case.',
360
- },
361
- },
362
- },
363
- render: () => (
364
- <div className="u-flex u-items-center u-gap-2">
365
- <Button label="Small" variant="primary" size="sm" />
366
- <Button label="Medium" variant="primary" size="md" />
367
- <Button label="Large" variant="primary" size="lg" />
368
- </div>
510
+ render: args => (
511
+ <Button
512
+ {...args}
513
+ style={{
514
+ background: 'linear-gradient(45deg, #667eea, #764ba2)',
515
+ border: 'none',
516
+ boxShadow: '0 4px 15px rgba(0, 0, 0, 0.2)',
517
+ }}
518
+ />
369
519
  ),
370
520
  };
371
521
 
372
522
  /**
373
- * Showcase of button icon variants and icon-only buttons.
523
+ * Shows button with custom CSS class
374
524
  */
375
- export const IconButtonVariants: Story = {
525
+ export const WithClassName: Story = {
376
526
  args: {
377
- label: 'Button',
527
+ label: 'Styled with Class',
378
528
  variant: 'primary',
379
- icon: <Icon />,
380
- iconOnly: true,
529
+ size: 'md',
530
+ className: 'custom-button-style',
381
531
  },
382
- render: () => (
383
- <div className="u-flex u-flex-wrap u-gap-2">
384
- <Button label="Add" variant="primary" icon={<Icon />} />
385
- <Button label="Add" variant="secondary" icon={<Icon />} />
386
- <Button label="Add" variant="success" icon={<Icon />} />
387
- <Button label="Add" variant="primary" icon={<Icon />} iconOnly />
388
- <Button label="Add" variant="secondary" icon={<Icon />} iconOnly />
389
- <Button label="Add" variant="success" icon={<Icon />} iconOnly />
390
- </div>
391
- ),
392
532
  };
393
533
 
394
534
  /**
395
- * Rounded button - fully rounded (pill-shaped) button style.
535
+ * Shows button with additional HTML attributes
396
536
  */
397
- export const Rounded: Story = {
537
+ export const WithAttributes: Story = {
398
538
  args: {
399
- label: 'Rounded Button',
539
+ label: 'Button with Attributes',
400
540
  variant: 'primary',
401
541
  size: 'md',
402
- rounded: true,
542
+ id: 'my-button',
543
+ 'aria-label': 'My custom button',
544
+ 'data-testid': 'test-button',
403
545
  },
404
546
  };
405
547
 
548
+ // ============================================================================
549
+ // EDGE CASES STORIES
550
+ // ============================================================================
551
+
406
552
  /**
407
- * Showcase of all button variants with rounded (pill) shape.
553
+ * Shows how button handles very long text
408
554
  */
409
- export const RoundedVariants: Story = {
555
+ export const LongText: Story = {
410
556
  args: {
411
- label: 'Button',
557
+ label: 'Very long text that might overflow or wrap to multiple lines in the button component',
412
558
  variant: 'primary',
413
- rounded: true,
559
+ size: 'md',
414
560
  },
415
- render: () => (
416
- <div className="u-flex u-flex-wrap u-gap-2">
417
- <Button label="Primary" variant="primary" rounded />
418
- <Button label="Secondary" variant="secondary" rounded />
419
- <Button label="Success" variant="success" rounded />
420
- <Button label="Info" variant="info" rounded />
421
- <Button label="Warning" variant="warning" rounded />
422
- <Button label="Error" variant="error" rounded />
423
- <Button label="Light" variant="light" rounded />
424
- <Button label="Dark" variant="dark" rounded />
425
- </div>
426
- ),
427
561
  };
428
562
 
429
563
  /**
430
- * Button using the label prop for text content.
564
+ * Shows button behavior when icon is missing
431
565
  */
432
- export const WithLabel: Story = {
566
+ export const NoIconFallback: Story = {
433
567
  args: {
434
- label: 'Button with Label',
568
+ label: 'Button without Icon',
435
569
  variant: 'primary',
570
+ size: 'md',
571
+ // Intentionally not providing icon prop to show fallback
436
572
  },
437
573
  };
438
574
 
439
575
  /**
440
- * Button using children prop for text content.
576
+ * Shows button with async callback handling
441
577
  */
442
- export const WithChildren: Story = {
443
- render: () => (
444
- <Button variant="primary">
445
- Button with Children
446
- </Button>
447
- ),
448
- };
578
+ export const WithAsyncAction: Story = {
579
+ render: () => {
580
+ const [isLoading, setIsLoading] = useState(false);
449
581
 
450
- /**
451
- * Button with icon and text content as children.
452
- */
453
- export const WithIconAndText: Story = {
454
- render: () => (
455
- <Button variant="primary">
456
- <Icon />
457
- Add Item
458
- </Button>
459
- ),
460
- };
582
+ const handleClick = useCallback(async () => {
583
+ setIsLoading(true);
584
+ // Simulate async operation
585
+ await new Promise(resolve => setTimeout(resolve, 2000));
586
+ setIsLoading(false);
587
+ }, []);
461
588
 
462
- /**
463
- * Button with glass morphism effect enabled.
464
- */
465
- export const GlassEffect: Story = {
466
- args: {
467
- label: 'Glass Button',
468
- variant: 'primary',
469
- glass: true,
589
+ return (
590
+ <Button label="Async Action" variant="primary" loading={isLoading} onClick={handleClick} />
591
+ );
470
592
  },
471
- decorators: [
472
- Story => (
473
- <div
474
- style={{
475
- background:
476
- 'url(https://cdn.pixabay.com/photo/2022/10/02/17/23/mushroom-7494046_1280.jpg)',
477
- backgroundSize: 'cover',
478
- backgroundPosition: 'center',
479
- padding: '10rem 25rem',
480
- borderRadius: '12px',
481
- }}
482
- >
483
- <Story />
484
- </div>
485
- ),
486
- ],
487
- };
488
-
489
- export const GlassEffectCustomized: Story = {
490
- args: {
491
- label: 'Customized Glass',
492
- variant: 'secondary',
493
- glass: {
494
- displacementScale: 60,
495
- blurAmount: 2,
496
- saturation: 180,
497
- aberrationIntensity: 2,
498
- cornerRadius: 12,
499
- overLight: false,
500
- mode: 'polar' as const,
501
- },
502
- },
503
- decorators: [
504
- Story => (
505
- <div
506
- style={{
507
- background:
508
- 'url(https://cdn.pixabay.com/photo/2022/10/02/17/23/mushroom-7494046_1280.jpg)',
509
- backgroundSize: 'cover',
510
- backgroundPosition: 'center',
511
- padding: '25rem',
512
- borderRadius: '12px',
513
- }}
514
- >
515
- <Story />
516
- </div>
517
- ),
518
- ],
519
593
  };
520
594
 
521
- export const GlassVariants: Story = {
522
- args: {
523
- label: 'Glass Button',
524
- variant: 'primary',
525
- glass: true,
526
- },
527
- render: () => (
528
- <div
529
- style={{
530
- background:
531
- 'url(https://cdn.pixabay.com/photo/2021/06/14/22/46/milky-way-6337038_1280.jpg)',
532
- backgroundSize: 'cover',
533
- backgroundPosition: 'center',
534
- padding: '25rem',
535
- borderRadius: '12px',
536
- }}
537
- >
538
- <div className="u-flex u-flex-wrap u-gap-2">
539
- <Button label="Primary" variant="primary" glass />
540
- <Button label="Secondary" variant="secondary" glass />
541
- <Button label="Success" variant="success" glass />
542
- <Button label="Info" variant="info" glass />
543
- <Button label="Warning" variant="warning" glass />
544
- <Button label="Error" variant="error" glass />
545
- <Button label="Light" variant="light" glass />
546
- <Button label="Dark" variant="dark" glass />
547
- </div>
548
- </div>
549
- ),
550
- };
595
+ // ============================================================================
596
+ // INTEGRATION EXAMPLES STORIES
597
+ // ============================================================================
551
598
 
552
- export const GlassOutlineVariants: Story = {
553
- args: {
554
- label: 'Glass Button',
555
- variant: 'outline-primary',
556
- glass: true,
557
- },
558
- render: () => (
559
- <div
560
- style={{
561
- background:
562
- 'url(https://cdn.pixabay.com/photo/2018/08/15/13/10/new-year-background-3608029_1280.jpg)',
563
- backgroundSize: 'cover',
564
- backgroundPosition: 'center',
565
- padding: '20rem 10rem',
566
- borderRadius: '12px',
567
- }}
568
- >
569
- <div className="u-flex u-flex-wrap u-gap-2">
570
- <Button label="Outline Primary" variant="outline-primary" glass />
571
- <Button label="Outline Secondary" variant="outline-secondary" glass />
572
- <Button label="Outline Success" variant="outline-success" glass />
573
- <Button label="Outline Info" variant="outline-info" glass />
574
- <Button label="Outline Warning" variant="outline-warning" glass />
575
- <Button label="Outline Error" variant="outline-error" glass />
576
- <Button label="Outline Light" variant="outline-light" glass />
577
- <Button label="Outline Dark" variant="outline-dark" glass />
578
- </div>
579
- </div>
580
- ),
581
- };
582
-
583
- export const GlassSizes: Story = {
584
- args: {
585
- label: 'Glass Button',
586
- variant: 'primary',
587
- glass: true,
588
- },
599
+ /**
600
+ * Button used in a form context
601
+ */
602
+ export const InForm: Story = {
589
603
  render: () => (
590
- <div
591
- style={{
592
- background: 'url(https://cdn.pixabay.com/photo/2020/12/15/01/43/street-5832394_1280.jpg)',
593
- backgroundSize: 'cover',
594
- backgroundPosition: 'center',
595
- padding: '10rem 20rem',
596
- borderRadius: '12px',
597
- }}
598
- >
599
- <div className="u-flex u-items-center u-gap-2">
600
- <Button label="Small Glass" variant="primary" size="sm" glass={{ cornerRadius: 8 }} />
601
- <Button label="Medium Glass" variant="primary" size="md" glass />
602
- <Button label="Large Glass" variant="primary" size="lg" glass />
603
- </div>
604
- </div>
604
+ <form className="u-flex u-flex-column u-gap-2">
605
+ <input type="text" placeholder="Enter name" className="u-p-2 u-mb-2 u-border u-rounded" />
606
+ <Button label="Submit Form" variant="primary" />
607
+ </form>
605
608
  ),
606
609
  };
607
610
 
608
- export const GlassWithIcons: Story = {
609
- args: {
610
- label: 'Glass Button',
611
- variant: 'primary',
612
- glass: true,
613
- icon: <Icon />,
614
- },
611
+ /**
612
+ * Button used in a card component
613
+ */
614
+ export const InCard: Story = {
615
615
  render: () => (
616
- <div
617
- style={{
618
- background: 'url(https://cdn.pixabay.com/photo/2020/12/15/01/43/street-5832394_1280.jpg)',
619
- backgroundSize: 'cover',
620
- backgroundPosition: 'center',
621
- padding: '25rem',
622
- borderRadius: '12px',
623
- }}
624
- >
625
- <div className="u-flex u-flex-wrap u-gap-2">
626
- <Button label="With Icon" variant="primary" icon={<Icon />} glass={{ cornerRadius: 12 }} />
627
- <Button
628
- label="Icon Only"
629
- variant="error"
630
- icon={<Icon />}
631
- iconOnly
632
- glass={{ cornerRadius: 12 }}
633
- />
634
- <Button
635
- label="Rounded Glass"
636
- variant="success"
637
- icon={<Icon />}
638
- rounded
639
- glass={{ cornerRadius: 24 }}
640
- />
641
- <Button
642
- label="Rounded Icon"
643
- variant="info"
644
- icon={<Icon />}
645
- iconOnly
646
- rounded
647
- glass={{ cornerRadius: 50 }}
648
- />
616
+ <div className="u-p-4 u-bg-white u-rounded-lg u-shadow u-w-64">
617
+ <h3 className="u-mt-0 u-mb-2">Sample Card</h3>
618
+ <p className="u-mb-2">Card content goes here...</p>
619
+ <div className="u-mt-2">
620
+ <Button label="Learn More" variant="primary" size="sm" />
649
621
  </div>
650
622
  </div>
651
623
  ),
652
624
  };
653
625
 
654
- export const GlassRounded: Story = {
655
- args: {
656
- label: 'Rounded Glass',
657
- variant: 'primary',
658
- glass: {
659
- cornerRadius: 22,
660
- },
661
- rounded: true,
662
- },
663
- decorators: [
664
- Story => (
665
- <div
666
- style={{
667
- background: 'url(https://cdn.pixabay.com/photo/2020/12/15/01/43/street-5832394_1280.jpg)',
668
- backgroundSize: 'cover',
669
- backgroundPosition: 'center',
670
- padding: '25rem',
671
- borderRadius: '12px',
672
- }}
673
- >
674
- <Story />
675
- </div>
676
- ),
677
- ],
678
- };
679
-
680
- // Comprehensive Glass Showcase
681
- export const GlassShowcase: Story = {
682
- args: {
683
- label: 'Glass Button',
684
- variant: 'primary',
685
- glass: true,
686
- },
626
+ /**
627
+ * Button used in a modal context
628
+ */
629
+ export const InModal: Story = {
687
630
  render: () => (
688
- <div style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}>
689
- {/* Primary Glass Variants */}
690
- <div
691
- style={{
692
- background: 'url(https://cdn.pixabay.com/photo/2021/11/13/08/50/athens-6790780_1280.jpg)',
693
- backgroundSize: 'cover',
694
- backgroundPosition: 'center',
695
- padding: '2rem',
696
- borderRadius: '12px',
697
- }}
698
- >
699
- <h3 style={{ color: 'white', marginBottom: '1rem', fontSize: '1.2rem' }}>
700
- Primary Glass Variants
701
- </h3>
702
- <div className="u-flex u-flex-wrap u-gap-2 u-items-center">
703
- <Button label="Small Glass" variant="primary" size="sm" glass={{ cornerRadius: 8 }} />
704
- <Button label="Medium Glass" variant="primary" size="md" glass />
705
- <Button label="Large Glass" variant="primary" size="lg" glass />
706
- <Button label="With Icon" variant="primary" icon={<Icon />} glass />
707
- <Button label="Icon Only" variant="primary" icon={<Icon />} iconOnly glass />
708
- <Button label="Rounded" variant="primary" rounded glass={{ cornerRadius: 24 }} />
709
- </div>
710
- </div>
711
-
712
- {/* Outline Glass Variants */}
713
- <div
714
- style={{
715
- background:
716
- 'url(https://cdn.pixabay.com/photo/2025/09/18/23/32/pattern-9842070_1280.png)',
717
- backgroundSize: 'cover',
718
- backgroundPosition: 'center',
719
- padding: '2rem',
720
- borderRadius: '12px',
721
- }}
722
- >
723
- <h3 style={{ color: 'white', marginBottom: '1rem', fontSize: '1.2rem' }}>
724
- Outline Glass Variants
725
- </h3>
726
- <div className="u-flex u-flex-wrap u-gap-2">
727
- <Button label="Outline Primary" variant="outline-primary" glass />
728
- <Button label="Outline Success" variant="outline-success" glass />
729
- <Button label="Outline Warning" variant="outline-warning" glass />
730
- <Button label="Outline Error" variant="outline-error" glass />
731
- </div>
732
- </div>
733
-
734
- {/* Custom Glass Configuration */}
735
- <div
736
- style={{
737
- background: 'url(https://cdn.pixabay.com/photo/2019/09/29/17/21/greece-4513857_1280.jpg)',
738
- backgroundSize: 'cover',
739
- backgroundPosition: 'center',
740
- padding: '2rem',
741
- borderRadius: '12px',
742
- }}
743
- >
744
- <h3 style={{ color: 'white', marginBottom: '1rem', fontSize: '1.2rem' }}>
745
- Custom Glass Effects
746
- </h3>
747
- <div className="u-flex u-flex-wrap u-gap-2">
748
- <Button
749
- label="Polar Mode"
750
- variant="secondary"
751
- glass={{
752
- displacementScale: 60,
753
- blurAmount: 2,
754
- saturation: 180,
755
- aberrationIntensity: 2,
756
- cornerRadius: 12,
757
- mode: 'polar' as const,
758
- }}
759
- />
760
- <Button
761
- label="Prominent Mode"
762
- variant="info"
763
- glass={{
764
- displacementScale: 80,
765
- blurAmount: 1,
766
- saturation: 200,
767
- aberrationIntensity: 3,
768
- cornerRadius: 12,
769
- mode: 'prominent' as const,
770
- }}
771
- />
772
- <Button
773
- label="Shader Mode"
774
- variant="success"
775
- glass={{
776
- displacementScale: 50,
777
- blurAmount: 0,
778
- saturation: 140,
779
- aberrationIntensity: 1,
780
- cornerRadius: 12,
781
- mode: 'shader' as const,
782
- }}
783
- />
784
- </div>
785
- </div>
786
-
787
- {/* Light Background */}
788
- <div
789
- style={{
790
- background: 'url(https://cdn.pixabay.com/photo/2019/09/29/17/21/greece-4513852_1280.jpg)',
791
- backgroundSize: 'cover',
792
- backgroundPosition: 'center',
793
- padding: '2rem',
794
- borderRadius: '12px',
795
- }}
796
- >
797
- <h3 style={{ color: '#333', marginBottom: '1rem', fontSize: '1.2rem' }}>
798
- Light Background
799
- </h3>
800
- <div className="u-flex u-flex-wrap u-gap-2">
801
- <Button label="Light Variant" variant="light" glass />
802
- <Button label="Outline Light" variant="outline-light" glass />
803
- <Button label="Dark on Light" variant="dark" glass />
804
- <Button
805
- label="Over Light"
806
- variant="primary"
807
- glass={{
808
- overLight: true,
809
- displacementScale: 45,
810
- saturation: 120,
811
- }}
812
- />
631
+ <div className="u-relative">
632
+ <div className="u-p-6 u-bg-white u-rounded-lg u-shadow-lg u-w-96">
633
+ <h3 className="u-mt-0 u-mb-2">Confirmation</h3>
634
+ <p className="u-mb-4">Are you sure you want to proceed?</p>
635
+ <div className="u-flex u-justify-end u-gap-2 u-mt-4">
636
+ <Button label="Cancel" variant="secondary" />
637
+ <Button label="Confirm" variant="primary" />
813
638
  </div>
814
639
  </div>
815
640
  </div>
816
641
  ),
817
642
  };
818
643
 
819
- // Glass Mode Variants - Standard
820
- export const GlassModeStandard: Story = {
821
- args: {
822
- label: 'Standard Glass Mode',
823
- variant: 'primary',
824
- glass: {
825
- mode: 'standard',
826
- displacementScale: 60,
827
- blurAmount: 2,
828
- saturation: 160,
829
- aberrationIntensity: 2,
830
- cornerRadius: 12,
831
- },
832
- },
833
- render: args => (
834
- <div
835
- style={{
836
- background: 'url(https://images.unsplash.com/photo-1518837695005-2083093ee35b?w=1920)',
837
- backgroundSize: 'cover',
838
- backgroundPosition: 'center',
839
- display: 'flex',
840
- gap: '2rem',
841
- flexDirection: 'column',
842
- alignItems: 'center',
843
- justifyContent: 'center',
844
- minWidth: '95vw',
845
- minHeight: '95vh',
846
- }}
847
- >
848
- <div style={{ textAlign: 'center', color: 'white', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
849
- <h3 style={{ fontSize: '1.5rem', marginBottom: '0.5rem' }}>Standard Glass Mode</h3>
850
- <p style={{ fontSize: '0.875rem', opacity: 0.9 }}>
851
- Classic glass morphism with blur and displacement
852
- </p>
853
- </div>
854
- <Button {...args} />
855
- </div>
856
- ),
857
- };
858
-
859
- // Glass Mode Variants - Polar
860
- export const GlassModePolar: Story = {
861
- args: {
862
- label: 'Polar Glass Mode',
863
- variant: 'secondary',
864
- glass: {
865
- mode: 'polar',
866
- displacementScale: 80,
867
- blurAmount: 1.5,
868
- saturation: 180,
869
- aberrationIntensity: 3,
870
- cornerRadius: 12,
871
- },
872
- },
873
- render: args => (
874
- <div
875
- style={{
876
- background: 'url(https://images.unsplash.com/photo-1557683316-973673baf926?w=1920)',
877
- backgroundSize: 'cover',
878
- backgroundPosition: 'center',
879
- borderRadius: '12px',
880
- display: 'flex',
881
- gap: '2rem',
882
- flexDirection: 'column',
883
- alignItems: 'center',
884
- justifyContent: 'center',
885
- minWidth: '95vw',
886
- minHeight: '95vh',
887
- }}
888
- >
889
- <div style={{ textAlign: 'center', color: 'white', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
890
- <h3 style={{ fontSize: '1.5rem', marginBottom: '0.5rem' }}>Polar Glass Mode</h3>
891
- <p style={{ fontSize: '0.875rem', opacity: 0.9 }}>Radial distortion effect from center</p>
892
- </div>
893
- <Button {...args} />
644
+ /**
645
+ * Button composed with other components
646
+ */
647
+ export const WithOtherComponents: Story = {
648
+ render: () => (
649
+ <div className="u-flex u-items-center u-gap-2">
650
+ <Button label="Previous" variant="secondary" />
651
+ <span className="u-text-sm">Page 1 of 10</span>
652
+ <Button label="Next" variant="primary" />
894
653
  </div>
895
654
  ),
896
655
  };
897
656
 
898
- // Glass Mode Variants - Prominent
899
- export const GlassModeProminent: Story = {
900
- args: {
901
- label: 'Prominent Glass Mode',
902
- variant: 'success',
903
- glass: {
904
- mode: 'prominent',
905
- displacementScale: 100,
906
- blurAmount: 2.5,
907
- saturation: 200,
908
- aberrationIntensity: 4,
909
- cornerRadius: 12,
910
- },
911
- },
912
- render: args => (
913
- <div
914
- style={{
915
- background: 'url(https://images.unsplash.com/photo-1579546929518-9e396f3cc809?w=1920)',
916
- backgroundSize: 'cover',
917
- backgroundPosition: 'center',
918
- borderRadius: '12px',
919
- display: 'flex',
920
- gap: '2rem',
921
- flexDirection: 'column',
922
- alignItems: 'center',
923
- justifyContent: 'center',
924
- minWidth: '95vw',
925
- minHeight: '95vh',
926
- }}
927
- >
928
- <div style={{ textAlign: 'center', color: 'white', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
929
- <h3 style={{ fontSize: '1.5rem', marginBottom: '0.5rem' }}>Prominent Glass Mode</h3>
930
- <p style={{ fontSize: '0.875rem', opacity: 0.9 }}>Enhanced distortion with maximum depth</p>
931
- </div>
932
- <Button {...args} />
933
- </div>
934
- ),
935
- };
657
+ // ============================================================================
658
+ // ACCESSIBILITY STORIES
659
+ // ============================================================================
936
660
 
937
- // Glass Mode Variants - Shader
938
- export const GlassModeShader: Story = {
939
- args: {
940
- label: 'Shader Glass Mode',
941
- variant: 'info',
942
- glass: {
943
- mode: 'shader',
944
- shaderVariant: 'liquidGlass',
945
- displacementScale: 70,
946
- blurAmount: 1.8,
947
- saturation: 170,
948
- cornerRadius: 12,
949
- },
950
- },
951
- render: args => (
952
- <div
953
- style={{
954
- background: 'url(https://images.unsplash.com/photo-1557682250-33bd709cbe85?w=1920)',
955
- backgroundSize: 'cover',
956
- backgroundPosition: 'center',
957
- borderRadius: '12px',
958
- display: 'flex',
959
- gap: '2rem',
960
- flexDirection: 'column',
961
- alignItems: 'center',
962
- justifyContent: 'center',
963
- minWidth: '95vw',
964
- minHeight: '95vh',
965
- }}
966
- >
967
- <div style={{ textAlign: 'center', color: 'white', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
968
- <h3 style={{ fontSize: '1.5rem', marginBottom: '0.5rem' }}>Shader Glass Mode</h3>
969
- <p style={{ fontSize: '0.875rem', opacity: 0.9 }}>GPU-accelerated liquid glass effect</p>
970
- </div>
971
- <Button {...args} />
972
- </div>
973
- ),
974
- };
975
-
976
- // All Glass Modes Comparison
977
- export const AllGlassModes: Story = {
661
+ /**
662
+ * Shows proper ARIA labels for accessibility
663
+ */
664
+ export const WithAriaLabels: Story = {
978
665
  render: () => (
979
- <div
980
- style={{
981
- background: 'url(https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920)',
982
- backgroundSize: 'cover',
983
- backgroundPosition: 'center',
984
- padding: '3rem',
985
- borderRadius: '12px',
986
- minHeight: '90vh',
987
- minWidth: '90vw',
988
- }}
989
- >
990
- <div style={{ width: '90vw', margin: '0 auto' }}>
991
- <h2
992
- style={{
993
- textAlign: 'center',
994
- color: 'white',
995
- marginBottom: '3rem',
996
- fontSize: '2rem',
997
- textShadow: '0 2px 8px rgba(0,0,0,0.5)',
998
- }}
999
- >
1000
- Glass Mode Variants Comparison
1001
- </h2>
1002
-
1003
- <div
1004
- style={{
1005
- display: 'grid',
1006
- gridTemplateColumns: 'repeat(auto-fit, minmax(250px, 1fr))',
1007
- gap: '2rem',
1008
- }}
1009
- >
1010
- {/* Standard Mode */}
1011
- <div
1012
- style={{
1013
- background: 'rgba(255,255,255,0.1)',
1014
- padding: '2rem',
1015
- borderRadius: '12px',
1016
- textAlign: 'center',
1017
- display: 'flex',
1018
- flexDirection: 'column',
1019
- alignItems: 'center',
1020
- }}
1021
- >
1022
- <h3 style={{ color: 'white', marginBottom: '1rem', fontSize: '1.25rem' }}>Standard</h3>
1023
- <p
1024
- style={{
1025
- color: 'rgba(255,255,255,0.8)',
1026
- fontSize: '0.875rem',
1027
- marginBottom: '1.5rem',
1028
- }}
1029
- >
1030
- Classic blur and displacement
1031
- </p>
1032
- <Button
1033
- label="Standard Glass"
1034
- variant="primary"
1035
- glass={{
1036
- mode: 'standard',
1037
- displacementScale: 60,
1038
- blurAmount: 2,
1039
- saturation: 160,
1040
- aberrationIntensity: 2,
1041
- }}
1042
- />
1043
- </div>
1044
-
1045
- {/* Polar Mode */}
1046
- <div
1047
- style={{
1048
- background: 'rgba(255,255,255,0.1)',
1049
- padding: '2rem',
1050
- borderRadius: '12px',
1051
- textAlign: 'center',
1052
- display: 'flex',
1053
- flexDirection: 'column',
1054
- alignItems: 'center',
1055
- }}
1056
- >
1057
- <h3 style={{ color: 'white', marginBottom: '1rem', fontSize: '1.25rem' }}>Polar</h3>
1058
- <p
1059
- style={{
1060
- color: 'rgba(255,255,255,0.8)',
1061
- fontSize: '0.875rem',
1062
- marginBottom: '1.5rem',
1063
- }}
1064
- >
1065
- Radial distortion effect
1066
- </p>
1067
- <Button
1068
- label="Polar Glass"
1069
- variant="secondary"
1070
- glass={{
1071
- mode: 'polar',
1072
- displacementScale: 80,
1073
- blurAmount: 1.5,
1074
- saturation: 180,
1075
- aberrationIntensity: 3,
1076
- }}
1077
- />
1078
- </div>
1079
-
1080
- {/* Prominent Mode */}
1081
- <div
1082
- style={{
1083
- background: 'rgba(255,255,255,0.1)',
1084
- padding: '2rem',
1085
- borderRadius: '12px',
1086
- textAlign: 'center',
1087
- display: 'flex',
1088
- flexDirection: 'column',
1089
- alignItems: 'center',
1090
- }}
1091
- >
1092
- <h3 style={{ color: 'white', marginBottom: '1rem', fontSize: '1.25rem' }}>Prominent</h3>
1093
- <p
1094
- style={{
1095
- color: 'rgba(255,255,255,0.8)',
1096
- fontSize: '0.875rem',
1097
- marginBottom: '1.5rem',
1098
- }}
1099
- >
1100
- Maximum depth and distortion
1101
- </p>
1102
- <Button
1103
- label="Prominent Glass"
1104
- variant="success"
1105
- glass={{
1106
- mode: 'prominent',
1107
- displacementScale: 100,
1108
- blurAmount: 2.5,
1109
- saturation: 200,
1110
- aberrationIntensity: 4,
1111
- }}
1112
- />
1113
- </div>
1114
-
1115
- {/* Shader Mode */}
1116
- <div
1117
- style={{
1118
- background: 'rgba(255,255,255,0.1)',
1119
- padding: '2rem',
1120
- borderRadius: '12px',
1121
- textAlign: 'center',
1122
- display: 'flex',
1123
- flexDirection: 'column',
1124
- alignItems: 'center',
1125
- }}
1126
- >
1127
- <h3 style={{ color: 'white', marginBottom: '1rem', fontSize: '1.25rem' }}>Shader</h3>
1128
- <p
1129
- style={{
1130
- color: 'rgba(255,255,255,0.8)',
1131
- fontSize: '0.875rem',
1132
- marginBottom: '1.5rem',
1133
- }}
1134
- >
1135
- GPU-accelerated liquid glass
1136
- </p>
1137
- <Button
1138
- label="Shader Glass"
1139
- variant="info"
1140
- glass={{
1141
- mode: 'shader',
1142
- shaderVariant: 'liquidGlass',
1143
- displacementScale: 70,
1144
- blurAmount: 1.8,
1145
- saturation: 170,
1146
- }}
1147
- />
1148
- </div>
1149
- </div>
1150
-
1151
- {/* All Variants with Different Colors */}
1152
- <div style={{ marginTop: '3rem' }}>
1153
- <h3
1154
- style={{
1155
- textAlign: 'center',
1156
- color: 'white',
1157
- marginBottom: '2rem',
1158
- fontSize: '1.5rem',
1159
- textShadow: '0 2px 8px rgba(0,0,0,0.5)',
1160
- }}
1161
- >
1162
- All Color Variants with Glass
1163
- </h3>
1164
- <div style={{ display: 'flex', flexWrap: 'wrap', gap: '1rem', justifyContent: 'center' }}>
1165
- <Button label="Primary" variant="primary" glass />
1166
- <Button label="Secondary" variant="secondary" glass />
1167
- <Button label="Success" variant="success" glass />
1168
- <Button label="Info" variant="info" glass />
1169
- <Button label="Warning" variant="warning" glass />
1170
- <Button label="Error" variant="error" glass />
1171
- <Button label="Light" variant="light" glass />
1172
- <Button label="Dark" variant="dark" glass />
1173
- </div>
1174
- </div>
1175
- </div>
666
+ <div className="u-flex u-flex-column u-gap-2">
667
+ <Button label="Save" variant="primary" aria-label="Save document" />
668
+ <Button label="Delete" variant="error" aria-label="Delete item permanently" />
1176
669
  </div>
1177
670
  ),
1178
671
  };
1179
672
 
1180
- // Glass Button States Showcase
1181
- export const GlassStatesShowcase: Story = {
673
+ /**
674
+ * Shows button with keyboard navigation support
675
+ */
676
+ export const WithKeyboardNavigation: Story = {
1182
677
  render: () => (
1183
- <div
1184
- style={{
1185
- background: 'url(https://images.unsplash.com/photo-1519681393784-d120267933ba?w=1920)',
1186
- backgroundSize: 'cover',
1187
- backgroundPosition: 'center',
1188
- padding: '3rem',
1189
- borderRadius: '12px',
1190
- minHeight: '90vh',
1191
- }}
1192
- >
1193
- <div style={{ maxWidth: '1200px', margin: '0 auto' }}>
1194
- <h2
1195
- style={{
1196
- textAlign: 'center',
1197
- color: 'white',
1198
- marginBottom: '3rem',
1199
- fontSize: '2rem',
1200
- textShadow: '0 2px 8px rgba(0,0,0,0.5)',
1201
- }}
1202
- >
1203
- Glass Button States & Interactions
1204
- </h2>
1205
-
1206
- <div style={{ display: 'flex', flexDirection: 'column', gap: '3rem' }}>
1207
- {/* Sizes */}
1208
- <div
1209
- style={{
1210
- background: 'rgba(255,255,255,0.08)',
1211
- padding: '2rem',
1212
- borderRadius: '12px',
1213
- backdropFilter: 'blur(10px)',
1214
- }}
1215
- >
1216
- <h3 style={{ color: 'white', marginBottom: '1.5rem' }}>Sizes</h3>
1217
- <div style={{ display: 'flex', alignItems: 'center', gap: '1rem', flexWrap: 'wrap' }}>
1218
- <Button label="Small" variant="primary" size="sm" glass={{ cornerRadius: 8 }} />
1219
- <Button label="Medium" variant="primary" size="md" glass={{ cornerRadius: 12 }} />
1220
- <Button label="Large" variant="primary" size="lg" glass={{ cornerRadius: 16 }} />
1221
- </div>
1222
- </div>
1223
-
1224
- {/* With Icons */}
1225
- <div
1226
- style={{
1227
- background: 'rgba(255,255,255,0.08)',
1228
- padding: '2rem',
1229
- borderRadius: '12px',
1230
- backdropFilter: 'blur(10px)',
1231
- }}
1232
- >
1233
- <h3 style={{ color: 'white', marginBottom: '1.5rem' }}>With Icons</h3>
1234
- <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap' }}>
1235
- <Button label="With Icon" variant="primary" icon={<Icon />} glass />
1236
- <Button label="Icon Only" variant="secondary" icon={<Icon />} iconOnly glass />
1237
- <Button
1238
- label="Rounded"
1239
- variant="success"
1240
- icon={<Icon />}
1241
- rounded
1242
- glass={{ cornerRadius: 24 }}
1243
- />
1244
- </div>
1245
- </div>
1246
-
1247
- {/* Outline Variants */}
1248
- <div
1249
- style={{
1250
- background: 'rgba(255,255,255,0.08)',
1251
- padding: '2rem',
1252
- borderRadius: '12px',
1253
- backdropFilter: 'blur(10px)',
1254
- }}
1255
- >
1256
- <h3 style={{ color: 'white', marginBottom: '1.5rem' }}>Outline Variants</h3>
1257
- <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap' }}>
1258
- <Button label="Outline Primary" variant="outline-primary" glass />
1259
- <Button label="Outline Secondary" variant="outline-secondary" glass />
1260
- <Button label="Outline Success" variant="outline-success" glass />
1261
- <Button label="Outline Error" variant="outline-error" glass />
1262
- </div>
1263
- </div>
1264
-
1265
- {/* Disabled State */}
1266
- <div
1267
- style={{
1268
- background: 'rgba(255,255,255,0.08)',
1269
- padding: '2rem',
1270
- borderRadius: '12px',
1271
- backdropFilter: 'blur(10px)',
1272
- }}
1273
- >
1274
- <h3 style={{ color: 'white', marginBottom: '1.5rem' }}>Disabled State</h3>
1275
- <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap' }}>
1276
- <Button label="Disabled Glass" variant="primary" disabled glass />
1277
- <Button label="Disabled Outline" variant="outline-primary" disabled glass />
1278
- </div>
1279
- </div>
1280
- </div>
1281
- </div>
678
+ <div className="u-flex u-gap-2">
679
+ <Button label="Button 1" variant="primary" tabIndex={0} />
680
+ <Button label="Button 2" variant="secondary" tabIndex={0} />
681
+ <Button label="Button 3" variant="success" tabIndex={0} />
1282
682
  </div>
1283
683
  ),
1284
684
  };
1285
685
 
1286
686
  /**
1287
- * Button in loading state - shows loading spinner.
687
+ * Shows button with screen reader announcements
1288
688
  */
1289
- export const Loading: Story = {
1290
- args: {
1291
- label: 'Save',
1292
- variant: 'primary',
1293
- loading: true,
1294
- },
1295
- };
1296
-
1297
- /**
1298
- * Button in loading state with custom loading text.
1299
- */
1300
- export const LoadingWithText: Story = {
1301
- args: {
1302
- label: 'Save',
1303
- variant: 'primary',
1304
- loading: true,
1305
- loadingText: 'Saving...',
1306
- },
1307
- };
1308
-
1309
- export const LoadingStates: Story = {
689
+ export const WithScreenReader: Story = {
1310
690
  render: () => (
1311
- <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap' }}>
1312
- <Button label="Loading Primary" variant="primary" loading />
1313
- <Button label="Loading Secondary" variant="secondary" loading />
1314
- <Button label="Saving..." variant="success" loading loadingText="Saving..." />
1315
- <Button label="Deleting..." variant="error" loading loadingText="Deleting..." />
691
+ <div className="u-flex u-gap-2">
692
+ <Button label="Announcement" variant="primary" aria-describedby="announcement-description" />
693
+ <div id="announcement-description" className="u-sr-only">
694
+ This button triggers an announcement
695
+ </div>
1316
696
  </div>
1317
697
  ),
1318
698
  };
1319
699
 
1320
700
  /**
1321
- * Full-width button - takes the full width of its container.
701
+ * Shows button in high contrast theme
1322
702
  */
1323
- export const FullWidth: Story = {
1324
- args: {
1325
- label: 'Full Width Button',
1326
- variant: 'primary',
1327
- fullWidth: true,
1328
- },
1329
- };
1330
-
1331
- export const FullWidthButtons: Story = {
703
+ export const HighContrastMode: Story = {
1332
704
  render: () => (
1333
- <div style={{ width: '400px', display: 'flex', flexDirection: 'column', gap: '1rem' }}>
1334
- <Button label="Full Width Primary" variant="primary" fullWidth />
1335
- <Button label="Full Width Secondary" variant="secondary" fullWidth />
1336
- <Button label="Full Width Loading" variant="success" fullWidth loading />
705
+ <div style={{ backgroundColor: '#000', padding: '1rem' }}>
706
+ <Button label="High Contrast Button" variant="light" />
1337
707
  </div>
1338
708
  ),
1339
709
  };
1340
710
 
1341
- /**
1342
- * Block-level button - displays as a block element.
1343
- */
1344
- export const Block: Story = {
1345
- args: {
1346
- label: 'Block Button',
1347
- variant: 'primary',
1348
- block: true,
1349
- },
1350
- };
711
+ // ============================================================================
712
+ // PERFORMANCE STORIES
713
+ // ============================================================================
1351
714
 
1352
715
  /**
1353
- * Button with icon positioned at the start (left side).
716
+ * Shows mobile-optimized button configuration
1354
717
  */
1355
- export const IconStart: Story = {
718
+ export const OptimizedForMobile: Story = {
1356
719
  args: {
1357
- label: 'Icon Start',
720
+ label: 'Touch-Friendly',
1358
721
  variant: 'primary',
1359
- icon: <Icon />,
1360
- iconPosition: 'start',
722
+ size: 'lg',
1361
723
  },
1362
724
  };
1363
725
 
1364
726
  /**
1365
- * Button with icon positioned at the end (right side).
727
+ * Shows multiple button instances together
1366
728
  */
1367
- export const IconEnd: Story = {
1368
- args: {
1369
- label: 'Icon End',
1370
- variant: 'primary',
1371
- icon: <Icon />,
1372
- iconPosition: 'end',
1373
- },
1374
- };
1375
-
1376
- export const IconPositions: Story = {
729
+ export const WithManyInstances: Story = {
1377
730
  render: () => (
1378
- <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap' }}>
1379
- <Button label="Icon Start" variant="primary" icon={<Icon />} iconPosition="start" />
1380
- <Button label="Icon End" variant="secondary" icon={<Icon />} iconPosition="end" />
1381
- <Button label="Loading Start" variant="success" loading iconPosition="start" />
731
+ <div className="u-flex u-flex-wrap u-gap-2">
732
+ {Array.from({ length: 15 }).map((_, i) => (
733
+ <Button key={i} label={`Button ${i + 1}`} variant="primary" size="sm" />
734
+ ))}
1382
735
  </div>
1383
736
  ),
1384
737
  };
1385
738
 
739
+ // ============================================================================
740
+ // GLASS EFFECT STORIES
741
+ // ============================================================================
742
+
1386
743
  /**
1387
- * Button in active state - visually indicates active/pressed state.
744
+ * Shows button with glass effect enabled
1388
745
  */
1389
- export const Active: Story = {
1390
- args: {
1391
- label: 'Active Button',
1392
- variant: 'primary',
1393
- active: true,
1394
- },
746
+ export const WithGlassEffect: Story = {
747
+ render: () => (
748
+ <div
749
+ className="u-bg-cover u-bg-center u-p-10 u-rounded-xl"
750
+ style={{
751
+ backgroundImage:
752
+ 'url(https://cdn.pixabay.com/photo/2022/10/02/17/23/mushroom-7494046_1280.jpg)',
753
+ }}
754
+ >
755
+ <div className="u-flex u-flex-wrap u-gap-2">
756
+ {THEME_COLORS.map(color => (
757
+ <Button key={color} label={color} variant={color as any} glass={true} />
758
+ ))}
759
+ </div>
760
+ </div>
761
+ ),
1395
762
  };
1396
763
 
1397
764
  /**
1398
- * Button in selected state - visually indicates selected state.
765
+ * Shows button with custom glass settings
1399
766
  */
1400
- export const Selected: Story = {
767
+ export const WithCustomGlassSettings: Story = {
1401
768
  args: {
1402
- label: 'Selected Button',
769
+ label: 'Custom Glass',
1403
770
  variant: 'primary',
1404
- selected: true,
1405
- },
1406
- };
1407
-
1408
- /**
1409
- * Comprehensive example showcasing multiple button features and states.
1410
- */
1411
- export const Comprehensive: Story = {
1412
- parameters: {
1413
- docs: {
1414
- description: {
1415
- story: 'A comprehensive example demonstrating various button features including loading states, layout variants, icon positioning, and different states all in one view.',
1416
- },
771
+ size: 'md',
772
+ glass: {
773
+ displacementScale: 80,
774
+ blurAmount: 2,
775
+ saturation: 200,
776
+ aberrationIntensity: 1,
777
+ cornerRadius: 16,
778
+ mode: 'polar',
1417
779
  },
1418
780
  },
1419
- render: () => (
1420
- <div style={{ display: 'flex', flexDirection: 'column', gap: '2rem', maxWidth: '600px' }}>
1421
- <div>
1422
- <h3 style={{ marginBottom: '1rem' }}>Loading States</h3>
1423
- <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap' }}>
1424
- <Button label="Save" variant="primary" loading />
1425
- <Button label="Delete" variant="error" loading loadingText="Deleting..." />
1426
- </div>
1427
- </div>
1428
-
1429
- <div>
1430
- <h3 style={{ marginBottom: '1rem' }}>Layout Variants</h3>
1431
- <div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
1432
- <Button label="Full Width Button" variant="primary" fullWidth />
1433
- <Button label="Block Button" variant="secondary" block />
1434
- </div>
1435
- </div>
1436
-
1437
- <div>
1438
- <h3 style={{ marginBottom: '1rem' }}>Icon Positioning</h3>
1439
- <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap' }}>
1440
- <Button label="Icon Start" variant="primary" icon={<Icon />} iconPosition="start" />
1441
- <Button label="Icon End" variant="secondary" icon={<Icon />} iconPosition="end" />
1442
- </div>
1443
- </div>
1444
-
1445
- <div>
1446
- <h3 style={{ marginBottom: '1rem' }}>States</h3>
1447
- <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap' }}>
1448
- <Button label="Active" variant="primary" active />
1449
- <Button label="Selected" variant="success" selected />
1450
- <Button label="Loading" variant="info" loading />
1451
- <Button label="Disabled" variant="warning" disabled />
1452
- </div>
1453
- </div>
1454
- </div>
1455
- ),
781
+ decorators: [
782
+ withBackground('https://cdn.pixabay.com/photo/2021/06/14/22/46/milky-way-6337038_1280.jpg'),
783
+ ],
1456
784
  };