@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,7 +1,8 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
+ import { fn } from '@storybook/test';
2
3
  import { HERO } from '../../lib/constants/components';
3
4
  import { Button } from '../Button/Button';
4
- import { Hero } from './Hero';
5
+ import { Hero, HeroProps } from './Hero';
5
6
 
6
7
  // Extract class names without the leading dots
7
8
  const HERO_CLASS = HERO.SELECTORS.HERO.replace('.', '');
@@ -22,15 +23,114 @@ const RIGHT_CLASS = HERO.CLASSES.RIGHT;
22
23
  const LEFT_CLASS = HERO.CLASSES.LEFT;
23
24
  const FULL_VH_CLASS = HERO.CLASSES.FULL_VH;
24
25
 
25
- const meta = {
26
+ // Define missing variables
27
+ const demoText =
28
+ 'Our design system helps you build beautiful, consistent, and accessible user interfaces faster than ever before. With a carefully crafted collection of components and guidelines, you can easily create stunning UIs that stand out.';
29
+
30
+ const showcaseText =
31
+ 'This is an example of showcase text demonstrating the capabilities of the Atomix design system. Create beautiful interfaces with ease and consistency.';
32
+
33
+ const primaryActionButtons = (
34
+ <>
35
+ <Button variant="primary" size="lg" className="u-mr-3" onClick={fn()}>
36
+ Get Started
37
+ </Button>
38
+ <Button variant="secondary" size="lg" onClick={fn()}>
39
+ Learn More
40
+ </Button>
41
+ </>
42
+ );
43
+
44
+ const showcaseActionButtons = (
45
+ <>
46
+ <Button variant="primary" size="lg" className="u-mr-3" onClick={fn()}>
47
+ View Demo
48
+ </Button>
49
+ <Button variant="outline" size="lg" onClick={fn()}>
50
+ Contact Us
51
+ </Button>
52
+ </>
53
+ );
54
+
55
+ const meta: Meta<HeroProps> = {
26
56
  title: 'Components/Hero',
27
57
  component: Hero,
28
58
  parameters: {
29
59
  layout: 'padded',
30
60
  docs: {
31
61
  description: {
32
- component:
33
- 'The Hero component creates prominent banner sections typically used at the top of pages. It provides a flexible layout for titles, subtitles, text content, call-to-action buttons, and images. Heroes are ideal for landing pages, marketing sections, or any area requiring prominent visual presentation.',
62
+ component: `
63
+ # Hero
64
+
65
+ ## Overview
66
+
67
+ Hero creates prominent banner sections typically used at the top of pages. It provides a flexible layout for titles, subtitles, text content, call-to-action buttons, and images. Heroes are ideal for landing pages, marketing sections, or any area requiring prominent visual presentation.
68
+
69
+ ## Features
70
+
71
+ - Flexible content layout
72
+ - Customizable alignment (left, center, right)
73
+ - Background image support
74
+ - Overlay options
75
+ - Full viewport height option
76
+ - Parallax effect
77
+ - Video background support
78
+ - Responsive design
79
+ - Customizable column sizing
80
+ - Content width control
81
+
82
+ ## Accessibility
83
+
84
+ - Screen reader: Title and content announced properly
85
+ - ARIA support: Proper roles and properties for hero components
86
+ - Keyboard support: Accessible via keyboard navigation
87
+ - Focus management: Maintains focus on interactive elements
88
+
89
+ ## Usage Examples
90
+
91
+ ### Basic Usage
92
+
93
+ \`\`\`tsx
94
+ <Hero
95
+ title="Hero Title"
96
+ subtitle="Hero Subtitle"
97
+ text="Hero text content"
98
+ />
99
+ \`\`\`
100
+
101
+ ### With Image
102
+
103
+ \`\`\`tsx
104
+ <Hero
105
+ title="Hero Title"
106
+ text="Hero text content"
107
+ imageSrc="/path/to/image.jpg"
108
+ imageAlt="Description of image"
109
+ />
110
+ \`\`\`
111
+
112
+ ## API Reference
113
+
114
+ ### Props
115
+
116
+ | Prop | Type | Default | Description |
117
+ | ---- | ---- | ------- | ----------- |
118
+ | title | string | - | Hero title |
119
+ | subtitle | string | - | Hero subtitle |
120
+ | text | string | - | Hero text content |
121
+ | imageSrc | string | - | Image source URL |
122
+ | imageAlt | string | - | Image alt text |
123
+ | alignment | 'left' \\| 'center' \\| 'right' | 'left' | Content alignment |
124
+ | backgroundImageSrc | string | - | Background image source URL |
125
+ | showOverlay | boolean | false | Show background overlay |
126
+ | fullViewportHeight | boolean | false | Make hero full viewport height |
127
+ | imageColSize | number | 6 | Image column size (1-12) |
128
+ | contentColSize | number | 6 | Content column size (1-12) |
129
+ | contentWidth | string | '536px' | Custom width for the hero content |
130
+ | parallax | boolean | false | Enable parallax effect on background image |
131
+ | parallaxIntensity | number | 0.5 | Parallax effect intensity (0-1) |
132
+ | videoBackground | string | - | Video background URL |
133
+ `,
34
134
  },
35
135
  },
36
136
  },
@@ -39,104 +139,213 @@ const meta = {
39
139
  title: {
40
140
  control: 'text',
41
141
  description: 'Hero title',
142
+ table: {
143
+ type: { summary: 'string' },
144
+ defaultValue: { summary: '-' },
145
+ },
42
146
  },
43
147
  subtitle: {
44
148
  control: 'text',
45
149
  description: 'Hero subtitle',
150
+ table: {
151
+ type: { summary: 'string' },
152
+ defaultValue: { summary: '-' },
153
+ },
46
154
  },
47
155
  text: {
48
156
  control: 'text',
49
157
  description: 'Hero text content',
158
+ table: {
159
+ type: { summary: 'string' },
160
+ defaultValue: { summary: '-' },
161
+ },
50
162
  },
51
163
  imageSrc: {
52
164
  control: 'text',
53
165
  description: 'Image source URL',
166
+ table: {
167
+ type: { summary: 'string' },
168
+ defaultValue: { summary: '-' },
169
+ },
54
170
  },
55
171
  imageAlt: {
56
172
  control: 'text',
57
173
  description: 'Image alt text',
174
+ table: {
175
+ type: { summary: 'string' },
176
+ defaultValue: { summary: '-' },
177
+ },
58
178
  },
59
179
  alignment: {
60
180
  control: { type: 'select', options: ['left', 'center', 'right'] },
61
181
  description: 'Content alignment',
182
+ table: {
183
+ type: { summary: '"left" | "center" | "right"' },
184
+ defaultValue: { summary: 'left' },
185
+ },
62
186
  },
63
187
  backgroundImageSrc: {
64
188
  control: 'text',
65
189
  description: 'Background image source URL',
190
+ table: {
191
+ type: { summary: 'string' },
192
+ defaultValue: { summary: '-' },
193
+ },
66
194
  },
67
195
  showOverlay: {
68
196
  control: 'boolean',
69
197
  description: 'Show background overlay',
198
+ table: {
199
+ type: { summary: 'boolean' },
200
+ defaultValue: { summary: 'false' },
201
+ },
70
202
  },
71
203
  fullViewportHeight: {
72
204
  control: 'boolean',
73
205
  description: 'Make hero full viewport height',
206
+ table: {
207
+ type: { summary: 'boolean' },
208
+ defaultValue: { summary: 'false' },
209
+ },
74
210
  },
75
211
  imageColSize: {
76
212
  control: { type: 'range', min: 1, max: 12, step: 1 },
77
213
  description: 'Image column size (1-12)',
214
+ table: {
215
+ type: { summary: 'number' },
216
+ defaultValue: { summary: '6' },
217
+ },
78
218
  },
79
219
  contentColSize: {
80
220
  control: { type: 'range', min: 1, max: 12, step: 1 },
81
221
  description: 'Content column size (1-12)',
222
+ table: {
223
+ type: { summary: 'number' },
224
+ defaultValue: { summary: '6' },
225
+ },
82
226
  },
83
227
  contentWidth: {
84
228
  control: 'text',
85
229
  description: 'Custom width for the hero content (e.g., "800px", "50%")',
86
230
  table: {
231
+ type: { summary: 'string' },
87
232
  defaultValue: { summary: '536px' },
88
233
  },
89
234
  },
90
235
  parallax: {
91
236
  control: 'boolean',
92
237
  description: 'Enable parallax effect on background image',
238
+ table: {
239
+ type: { summary: 'boolean' },
240
+ defaultValue: { summary: 'false' },
241
+ },
93
242
  },
94
243
  parallaxIntensity: {
95
244
  control: { type: 'range', min: 0, max: 1, step: 0.1 },
96
245
  description: 'Parallax effect intensity (0-1)',
246
+ table: {
247
+ type: { summary: 'number' },
248
+ defaultValue: { summary: '0.5' },
249
+ },
97
250
  },
98
251
  videoBackground: {
99
252
  control: 'text',
100
253
  description: 'Video background URL',
101
- },
102
- glass: {
103
- control: 'object',
104
- description: 'Glass effect properties or boolean to enable/disable',
105
- },
106
- videoOptions: {
107
- control: 'object',
108
- description: 'Video background options',
109
- },
110
- backgroundSlider: {
111
- control: 'object',
112
- description: 'Background slider configuration with multiple images/videos',
254
+ table: {
255
+ type: { summary: 'string' },
256
+ defaultValue: { summary: '-' },
257
+ },
113
258
  },
114
259
  },
115
- } satisfies Meta<typeof Hero>;
260
+ } satisfies Meta<HeroProps>;
116
261
 
117
262
  export default meta;
118
- type Story = StoryObj<typeof meta>;
263
+ type Story = StoryObj<HeroProps>;
119
264
 
120
- // Helper for button actions
121
- const primaryActionButtons = (
122
- <>
123
- <Button label="Get Started" variant="primary" />
124
- <Button label="Learn More" variant="outline-secondary" />
125
- </>
126
- );
265
+ export const BasicUsage: Story = {
266
+ args: {
267
+ title: 'Discover Amazing Things',
268
+ subtitle: 'With Atomix Design System',
269
+ text: 'Our design system helps you build beautiful, consistent, and accessible user interfaces faster than ever before.',
270
+ alignment: 'center',
271
+ fullViewportHeight: true,
272
+ },
273
+ parameters: {
274
+ docs: {
275
+ description: {
276
+ story: 'Basic hero section with centered content and full viewport height.',
277
+ },
278
+ },
279
+ },
280
+ };
127
281
 
128
- const showcaseActionButtons = (
129
- <>
130
- <Button label="Explore Components" variant="primary" />
131
- <Button label="View Documentation" variant="outline-secondary" />
132
- </>
133
- );
282
+ export const WithImage: Story = {
283
+ args: {
284
+ title: 'Beautiful Interfaces',
285
+ subtitle: 'Crafted with Atomix',
286
+ text: 'Create stunning user experiences with our carefully designed components and guidelines.',
287
+ imageSrc:
288
+ 'https://images.unsplash.com/photo-1517245386807-bb43f82c33c4?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80',
289
+ imageAlt: 'Laptop with design interface',
290
+ alignment: 'left',
291
+ fullViewportHeight: false,
292
+ },
293
+ parameters: {
294
+ docs: {
295
+ description: {
296
+ story: 'Hero section with accompanying image on the side.',
297
+ },
298
+ },
299
+ },
300
+ };
134
301
 
135
- const demoText =
136
- 'Build modern, responsive interfaces with a clean, consistent design language. Our component library helps you create beautiful user experiences with minimal effort.';
302
+ export const WithBackgroundImage: Story = {
303
+ args: {
304
+ title: 'Adventure Awaits',
305
+ subtitle: 'Begin Your Journey',
306
+ text: 'Explore new possibilities and create amazing products with our design system.',
307
+ backgroundImageSrc:
308
+ 'https://images.unsplash.com/photo-1506744038136-46273834b3fb?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80',
309
+ showOverlay: true,
310
+ alignment: 'center',
311
+ fullViewportHeight: true,
312
+ },
313
+ parameters: {
314
+ docs: {
315
+ description: {
316
+ story: 'Hero section with background image and overlay.',
317
+ },
318
+ },
319
+ },
320
+ };
137
321
 
138
- const showcaseText =
139
- 'Atomix provides a complete design system with powerful, flexible components that follow best practices for accessibility, performance, and user experience.';
322
+ export const WithActions: Story = {
323
+ render: args => (
324
+ <Hero {...args}>
325
+ <div className={ACTIONS_CLASS}>
326
+ <Button variant="primary" size="lg" className="u-mr-3">
327
+ Get Started
328
+ </Button>
329
+ <Button variant="secondary" size="lg">
330
+ Learn More
331
+ </Button>
332
+ </div>
333
+ </Hero>
334
+ ),
335
+ args: {
336
+ title: 'Ready to Get Started?',
337
+ text: 'Join thousands of satisfied users who have transformed their design workflow.',
338
+ alignment: 'center',
339
+ fullViewportHeight: true,
340
+ },
341
+ parameters: {
342
+ docs: {
343
+ description: {
344
+ story: 'Hero section with call-to-action buttons.',
345
+ },
346
+ },
347
+ },
348
+ };
140
349
 
141
350
  /**
142
351
  * Default Hero component with right-aligned content and image
@@ -190,8 +399,6 @@ export const WithCustomGlassEffect: Story = {
190
399
  cornerRadius: 45,
191
400
  mode: 'standard',
192
401
  elasticity: 0.2,
193
- showBorderEffects: true,
194
- showHoverEffects: true,
195
402
  onClick: () => {
196
403
  console.log('Clicked!');
197
404
  },
@@ -229,7 +436,7 @@ export const CenterAligned: Story = {
229
436
  /**
230
437
  * Hero with background image
231
438
  */
232
- export const WithBackgroundImage: Story = {
439
+ export const UniqueWithBackgroundImage: Story = {
233
440
  args: {
234
441
  ...Default.args,
235
442
  title: 'Powerful Design System',
@@ -649,3 +856,130 @@ export const FullHeightSlider: Story = {
649
856
  },
650
857
  },
651
858
  };
859
+
860
+ // Enhanced preview examples showcasing the most impressive capabilities
861
+ /**
862
+ * Premium showcase combining multiple advanced features
863
+ */
864
+ export const PremiumShowcase: Story = {
865
+ args: {
866
+ title: 'Premium Hero Experience',
867
+ subtitle: 'Advanced Capabilities Combined',
868
+ text: 'This hero combines multiple advanced features: glass effect, background slider with videos, full viewport height, and interactive elements for a premium user experience.',
869
+ alignment: 'center',
870
+ showOverlay: true,
871
+ fullViewportHeight: true,
872
+ glass: {
873
+ displacementScale: 50,
874
+ blurAmount: 2,
875
+ saturation: 150,
876
+ aberrationIntensity: 0.5,
877
+ cornerRadius: 20,
878
+ overLight: true,
879
+ mode: 'standard',
880
+ },
881
+ actions: (
882
+ <>
883
+ <Button variant="primary" size="lg" className="u-mr-3" onClick={fn()}>
884
+ Explore Features
885
+ </Button>
886
+ <Button variant="secondary" size="lg" onClick={fn()}>
887
+ Get Started Now
888
+ </Button>
889
+ </>
890
+ ),
891
+ contentWidth: '900px',
892
+ backgroundSlider: {
893
+ slides: [
894
+ {
895
+ type: 'video',
896
+ src: 'https://cdn.pixabay.com/video/2023/08/17/173860-844114591_large.mp4',
897
+ videoOptions: {
898
+ autoplay: true,
899
+ loop: true,
900
+ muted: true,
901
+ posterUrl: 'https://picsum.photos/id/1015/1920/1080',
902
+ },
903
+ },
904
+ {
905
+ type: 'image',
906
+ src: 'https://picsum.photos/id/1018/1920/1080',
907
+ alt: 'Stunning landscape',
908
+ },
909
+ {
910
+ type: 'video',
911
+ src: 'https://cdn.pixabay.com/video/2023/11/18/189639-886016299_large.mp4',
912
+ videoOptions: {
913
+ autoplay: true,
914
+ loop: true,
915
+ muted: true,
916
+ posterUrl: 'https://picsum.photos/id/1025/1920/1080',
917
+ },
918
+ },
919
+ ],
920
+ autoplay: {
921
+ delay: 6000,
922
+ pauseOnHover: true,
923
+ },
924
+ loop: true,
925
+ transition: 'slide',
926
+ transitionDuration: 2000,
927
+ },
928
+ },
929
+ parameters: {
930
+ docs: {
931
+ description: {
932
+ story:
933
+ 'Premium showcase combining multiple advanced features: glass effect, background slider with videos, full viewport height, and interactive elements.',
934
+ },
935
+ },
936
+ },
937
+ };
938
+
939
+ /**
940
+ * Minimalist design focusing on typography and content
941
+ */
942
+ export const MinimalistDesign: Story = {
943
+ args: {
944
+ title: 'Focus on What Matters',
945
+ subtitle: 'Clean & Minimal Approach',
946
+ text: 'Sometimes simplicity speaks louder than complexity. This minimalist hero focuses purely on your content with subtle animations and refined typography.',
947
+ alignment: 'center',
948
+ fullViewportHeight: true,
949
+ showOverlay: false,
950
+ contentWidth: '700px',
951
+ },
952
+ parameters: {
953
+ docs: {
954
+ description: {
955
+ story:
956
+ 'Minimalist design focusing on typography and content, with subtle animations and refined aesthetics.',
957
+ },
958
+ },
959
+ },
960
+ };
961
+
962
+ /**
963
+ * Hero with custom column styles
964
+ */
965
+ export const WithCustomColumnStyles: Story = {
966
+ args: {
967
+ ...Default.args,
968
+ title: 'Customized Columns',
969
+ text: 'This hero uses custom classes and inline styles on its layout columns. The content column has a custom background and padding, while the image column has a custom rotation effect.',
970
+ imageSrc: 'https://picsum.photos/id/20/712/500',
971
+ contentColClassName: 'u-bg-primary-50 u-p-6 u-rounded-lg',
972
+ contentColStyle: { border: '2px solid var(--atomix-color-primary-500)' },
973
+ imageColClassName: 'u-shadow-lg',
974
+ imageColStyle: { transform: 'rotate(-2deg)', transition: 'transform 0.3s ease' },
975
+ alignment: 'left',
976
+ },
977
+ parameters: {
978
+ docs: {
979
+ description: {
980
+ story:
981
+ 'Demonstrates the use of imageColClassName, imageColStyle, contentColClassName, and contentColStyle to individually style the layout columns.',
982
+ },
983
+ },
984
+ },
985
+ };