@shohojdhara/atomix 0.3.15 → 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 (245) hide show
  1. package/build-tools/index.d.ts +31 -30
  2. package/build-tools/package.json +4 -21
  3. package/dist/atomix.css +20924 -2611
  4. package/dist/atomix.css.map +1 -1
  5. package/dist/atomix.min.css +76 -2
  6. package/dist/atomix.min.css.map +1 -1
  7. package/dist/build-tools/index.d.ts +31 -30
  8. package/dist/build-tools/package.json +4 -21
  9. package/dist/charts.js.map +1 -1
  10. package/dist/core.js.map +1 -1
  11. package/dist/forms.js.map +1 -1
  12. package/dist/heavy.js.map +1 -1
  13. package/dist/index.d.ts +144 -18
  14. package/dist/index.esm.js +110 -55
  15. package/dist/index.esm.js.map +1 -1
  16. package/dist/index.js +110 -55
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.min.js +1 -1
  19. package/dist/index.min.js.map +1 -1
  20. package/dist/layout.js.map +1 -1
  21. package/dist/theme.d.ts +9 -9
  22. package/dist/theme.js.map +1 -1
  23. package/package.json +1 -1
  24. package/src/components/Accordion/Accordion.stories.tsx +32 -23
  25. package/src/components/Accordion/Accordion.test.tsx +70 -50
  26. package/src/components/Accordion/Accordion.tsx +99 -94
  27. package/src/components/AtomixGlass/AtomixGlass.test.tsx +1 -1
  28. package/src/components/AtomixGlass/GlassFilter.tsx +9 -16
  29. package/src/components/AtomixGlass/glass-utils.ts +4 -3
  30. package/src/components/AtomixGlass/shader-utils.ts +128 -52
  31. package/src/components/AtomixGlass/stories/Playground.stories.tsx +1 -1
  32. package/src/components/AtomixGlass/stories/Shaders.stories.tsx +1 -1
  33. package/src/components/Avatar/Avatar.stories.tsx +45 -62
  34. package/src/components/Avatar/Avatar.tsx +58 -56
  35. package/src/components/Badge/Badge.stories.tsx +20 -9
  36. package/src/components/Badge/Badge.test.tsx +41 -41
  37. package/src/components/Badge/Badge.tsx +64 -62
  38. package/src/components/Block/Block.stories.tsx +14 -4
  39. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +9 -8
  40. package/src/components/Breadcrumb/Breadcrumb.tsx +62 -60
  41. package/src/components/Button/Button.stories.tsx +13 -22
  42. package/src/components/Button/Button.test.tsx +97 -81
  43. package/src/components/Button/Button.tsx +46 -14
  44. package/src/components/Button/ButtonGroup.stories.tsx +37 -32
  45. package/src/components/Button/ButtonGroup.tsx +4 -15
  46. package/src/components/Callout/Callout.stories.tsx +109 -16
  47. package/src/components/Card/Card.stories.tsx +67 -36
  48. package/src/components/Card/Card.tsx +30 -14
  49. package/src/components/Chart/AreaChart.tsx +1 -1
  50. package/src/components/Chart/CandlestickChart.tsx +23 -16
  51. package/src/components/Chart/Chart.stories.tsx +4 -9
  52. package/src/components/Chart/Chart.tsx +40 -44
  53. package/src/components/Chart/ChartRenderer.tsx +39 -12
  54. package/src/components/Chart/ChartToolbar.tsx +21 -5
  55. package/src/components/Chart/DonutChart.tsx +1 -1
  56. package/src/components/Chart/FunnelChart.tsx +4 -1
  57. package/src/components/Chart/GaugeChart.tsx +3 -1
  58. package/src/components/Chart/HeatmapChart.tsx +50 -37
  59. package/src/components/Chart/LineChart.tsx +3 -2
  60. package/src/components/Chart/MultiAxisChart.tsx +24 -16
  61. package/src/components/Chart/RadarChart.tsx +19 -17
  62. package/src/components/Chart/ScatterChart.tsx +29 -21
  63. package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +6 -2
  64. package/src/components/ColorModeToggle/ColorModeToggle.tsx +15 -3
  65. package/src/components/Countdown/Countdown.stories.tsx +7 -7
  66. package/src/components/DataTable/DataTable.stories.tsx +43 -38
  67. package/src/components/DataTable/DataTable.test.tsx +26 -148
  68. package/src/components/DataTable/DataTable.tsx +485 -456
  69. package/src/components/DatePicker/DatePicker.stories.tsx +32 -47
  70. package/src/components/DatePicker/DatePicker.tsx +31 -26
  71. package/src/components/Dropdown/Dropdown.stories.tsx +2 -5
  72. package/src/components/Dropdown/Dropdown.tsx +313 -299
  73. package/src/components/EdgePanel/EdgePanel.stories.tsx +6 -19
  74. package/src/components/EdgePanel/EdgePanel.tsx +1 -3
  75. package/src/components/Footer/Footer.stories.tsx +21 -16
  76. package/src/components/Footer/Footer.tsx +130 -128
  77. package/src/components/Footer/FooterLink.tsx +2 -2
  78. package/src/components/Form/Checkbox.test.tsx +49 -49
  79. package/src/components/Form/Checkbox.tsx +108 -100
  80. package/src/components/Form/Form.stories.tsx +2 -10
  81. package/src/components/Form/Input.stories.tsx +22 -39
  82. package/src/components/Form/Input.test.tsx +38 -44
  83. package/src/components/Form/Radio.stories.tsx +6 -12
  84. package/src/components/Form/Radio.tsx +68 -66
  85. package/src/components/Form/Select.tsx +184 -182
  86. package/src/components/Form/Textarea.test.tsx +27 -32
  87. package/src/components/Hero/Hero.stories.tsx +56 -23
  88. package/src/components/Hero/Hero.tsx +201 -55
  89. package/src/components/Icon/index.ts +7 -1
  90. package/src/components/List/List.tsx +19 -23
  91. package/src/components/Modal/Modal.stories.tsx +2 -1
  92. package/src/components/Modal/Modal.tsx +130 -127
  93. package/src/components/Navigation/Menu/MegaMenu.tsx +70 -70
  94. package/src/components/Navigation/Nav/NavDropdown.tsx +1 -5
  95. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +128 -28
  96. package/src/components/Navigation/SideMenu/SideMenu.tsx +5 -7
  97. package/src/components/Navigation/SideMenu/SideMenuItem.tsx +4 -5
  98. package/src/components/Pagination/Pagination.stories.tsx +7 -4
  99. package/src/components/Pagination/Pagination.tsx +199 -202
  100. package/src/components/PhotoViewer/PhotoViewer.tsx +4 -1
  101. package/src/components/Popover/Popover.stories.tsx +99 -192
  102. package/src/components/Popover/Popover.tsx +41 -37
  103. package/src/components/Progress/Progress.stories.tsx +35 -44
  104. package/src/components/River/River.stories.tsx +2 -1
  105. package/src/components/SectionIntro/SectionIntro.stories.tsx +71 -71
  106. package/src/components/Slider/Slider.stories.tsx +12 -4
  107. package/src/components/Spinner/Spinner.stories.tsx +3 -1
  108. package/src/components/Spinner/Spinner.test.tsx +23 -23
  109. package/src/components/Spinner/Spinner.tsx +43 -46
  110. package/src/components/Steps/Steps.stories.tsx +8 -6
  111. package/src/components/Tabs/Tabs.stories.tsx +12 -9
  112. package/src/components/Tabs/Tabs.tsx +74 -72
  113. package/src/components/Toggle/Toggle.stories.tsx +27 -13
  114. package/src/components/Toggle/Toggle.test.tsx +65 -70
  115. package/src/components/Toggle/Toggle.tsx +4 -1
  116. package/src/components/Tooltip/Tooltip.stories.tsx +24 -20
  117. package/src/components/Tooltip/Tooltip.tsx +104 -106
  118. package/src/components/Upload/Upload.stories.tsx +129 -127
  119. package/src/components/Upload/Upload.tsx +287 -283
  120. package/src/components/VideoPlayer/VideoPlayer.tsx +6 -1
  121. package/src/components/index.ts +13 -2
  122. package/src/layouts/Grid/Grid.stories.tsx +9 -3
  123. package/src/layouts/MasonryGrid/MasonryGrid.tsx +5 -1
  124. package/src/lib/__tests__/theme-tools.test.ts +32 -6
  125. package/src/lib/composables/shared-mouse-tracker.ts +13 -14
  126. package/src/lib/composables/useAtomixGlass.ts +106 -49
  127. package/src/lib/composables/useChartExport.ts +1 -1
  128. package/src/lib/composables/useDataTable.ts +29 -17
  129. package/src/lib/composables/useHero.ts +58 -14
  130. package/src/lib/composables/useHeroBackgroundSlider.ts +2 -9
  131. package/src/lib/composables/useInput.ts +10 -8
  132. package/src/lib/composables/useSideMenu.ts +6 -5
  133. package/src/lib/composables/useTooltip.ts +1 -2
  134. package/src/lib/composables/useVideoPlayer.ts +44 -35
  135. package/src/lib/config/index.ts +154 -154
  136. package/src/lib/constants/cssVariables.ts +29 -29
  137. package/src/lib/hooks/__tests__/useComponentCustomization.test.ts +2 -6
  138. package/src/lib/hooks/index.ts +1 -1
  139. package/src/lib/hooks/useComponentCustomization.ts +11 -17
  140. package/src/lib/hooks/usePerformanceMonitor.ts +6 -7
  141. package/src/lib/patterns/__tests__/slots.test.ts +1 -1
  142. package/src/lib/patterns/index.ts +1 -1
  143. package/src/lib/patterns/slots.tsx +8 -13
  144. package/src/lib/storybook/InteractiveDemo.tsx +13 -18
  145. package/src/lib/storybook/PreviewContainer.tsx +1 -1
  146. package/src/lib/storybook/VariantsGrid.tsx +3 -7
  147. package/src/lib/storybook/index.ts +1 -1
  148. package/src/lib/theme/adapters/cssVariableMapper.ts +47 -74
  149. package/src/lib/theme/adapters/index.ts +3 -9
  150. package/src/lib/theme/adapters/themeAdapter.ts +41 -26
  151. package/src/lib/theme/config/index.ts +1 -1
  152. package/src/lib/theme/config/types.ts +2 -2
  153. package/src/lib/theme/config/validator.ts +10 -5
  154. package/src/lib/theme/constants/constants.ts +2 -2
  155. package/src/lib/theme/constants/index.ts +1 -2
  156. package/src/lib/theme/core/__tests__/createTheme.test.ts +20 -22
  157. package/src/lib/theme/core/composeTheme.ts +32 -26
  158. package/src/lib/theme/core/createTheme.ts +1 -1
  159. package/src/lib/theme/core/createThemeObject.ts +308 -301
  160. package/src/lib/theme/core/index.ts +3 -3
  161. package/src/lib/theme/devtools/CLI.ts +106 -104
  162. package/src/lib/theme/devtools/Comparator.tsx +50 -32
  163. package/src/lib/theme/devtools/DesignTokensCustomizer.stories.tsx +50 -48
  164. package/src/lib/theme/devtools/DesignTokensCustomizer.tsx +257 -63
  165. package/src/lib/theme/devtools/Inspector.tsx +75 -60
  166. package/src/lib/theme/devtools/LiveEditor.tsx +97 -76
  167. package/src/lib/theme/devtools/Preview.tsx +150 -106
  168. package/src/lib/theme/devtools/ThemeValidator.ts +29 -21
  169. package/src/lib/theme/devtools/index.ts +3 -9
  170. package/src/lib/theme/devtools/useHistory.ts +23 -21
  171. package/src/lib/theme/errors/errors.ts +12 -11
  172. package/src/lib/theme/errors/index.ts +2 -7
  173. package/src/lib/theme/generators/generateCSS.ts +9 -13
  174. package/src/lib/theme/generators/generateCSSNested.ts +1 -6
  175. package/src/lib/theme/generators/generateCSSVariables.ts +673 -630
  176. package/src/lib/theme/generators/index.ts +1 -4
  177. package/src/lib/theme/i18n/index.ts +1 -1
  178. package/src/lib/theme/i18n/rtl.ts +13 -13
  179. package/src/lib/theme/index.ts +7 -16
  180. package/src/lib/theme/runtime/ThemeApplicator.ts +4 -4
  181. package/src/lib/theme/runtime/ThemeContext.tsx +1 -1
  182. package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +19 -23
  183. package/src/lib/theme/runtime/ThemeProvider.tsx +230 -239
  184. package/src/lib/theme/runtime/__tests__/ThemeProvider.integration.test.tsx +1 -1
  185. package/src/lib/theme/runtime/__tests__/ThemeProvider.test.tsx +24 -29
  186. package/src/lib/theme/runtime/index.ts +2 -5
  187. package/src/lib/theme/runtime/useTheme.ts +18 -18
  188. package/src/lib/theme/runtime/useThemeTokens.ts +22 -22
  189. package/src/lib/theme/test/testTheme.ts +15 -16
  190. package/src/lib/theme/tokens/index.ts +2 -7
  191. package/src/lib/theme/tokens/tokens.ts +25 -24
  192. package/src/lib/theme/types.ts +428 -411
  193. package/src/lib/theme/utils/__tests__/themeValidation.test.ts +3 -3
  194. package/src/lib/theme/utils/componentTheming.ts +18 -18
  195. package/src/lib/theme/utils/domUtils.ts +277 -289
  196. package/src/lib/theme/utils/index.ts +1 -2
  197. package/src/lib/theme/utils/injectCSS.ts +10 -14
  198. package/src/lib/theme/utils/naming.ts +20 -16
  199. package/src/lib/theme/utils/themeHelpers.ts +10 -12
  200. package/src/lib/theme/utils/themeUtils.ts +85 -86
  201. package/src/lib/theme/utils/themeValidation.ts +82 -33
  202. package/src/lib/theme-tools.ts +8 -6
  203. package/src/lib/types/components.ts +172 -71
  204. package/src/lib/types/partProps.ts +1 -1
  205. package/src/lib/utils/__tests__/csv.test.ts +1 -1
  206. package/src/lib/utils/componentUtils.ts +8 -12
  207. package/src/lib/utils/csv.ts +3 -1
  208. package/src/lib/utils/dataTableExport.ts +1 -5
  209. package/src/lib/utils/fontPreloader.ts +10 -19
  210. package/src/lib/utils/icons.ts +4 -1
  211. package/src/lib/utils/index.ts +2 -6
  212. package/src/lib/utils/memoryMonitor.ts +10 -8
  213. package/src/lib/utils/themeNaming.ts +2 -2
  214. package/src/styles/01-settings/_index.scss +0 -1
  215. package/src/styles/01-settings/_settings.colors.scss +8 -8
  216. package/src/styles/01-settings/_settings.design-tokens.scss +61 -50
  217. package/src/styles/01-settings/_settings.navbar.scss +1 -1
  218. package/src/styles/01-settings/_settings.spacing.scss +3 -4
  219. package/src/styles/01-settings/_settings.tooltip.scss +1 -1
  220. package/src/styles/01-settings/_settings.typography.scss +1 -1
  221. package/src/styles/02-tools/_tools.button.scss +51 -21
  222. package/src/styles/02-tools/_tools.utility-api.scss +30 -18
  223. package/src/styles/03-generic/_generic.root.scss +4 -3
  224. package/src/styles/06-components/_components.atomix-glass.scss +13 -9
  225. package/src/styles/06-components/_components.button.scss +16 -4
  226. package/src/styles/06-components/_components.callout.scss +27 -21
  227. package/src/styles/06-components/_components.card.scss +5 -14
  228. package/src/styles/06-components/_components.chart.scss +22 -19
  229. package/src/styles/06-components/_components.checkbox.scss +3 -1
  230. package/src/styles/06-components/_components.color-mode-toggle.scss +3 -1
  231. package/src/styles/06-components/_components.edge-panel.scss +9 -2
  232. package/src/styles/06-components/_components.footer.scss +1 -1
  233. package/src/styles/06-components/_components.side-menu.scss +5 -5
  234. package/src/styles/06-components/_components.toggle.scss +18 -0
  235. package/src/styles/06-components/_index.scss +1 -1
  236. package/src/styles/06-components/old.chart.styles.scss +0 -2
  237. package/src/styles/99-utilities/_utilities.border.scss +69 -27
  238. package/src/styles/99-utilities/_utilities.display.scss +1 -1
  239. package/src/styles/99-utilities/_utilities.opacity.scss +10 -0
  240. package/src/styles/99-utilities/_utilities.position.scss +16 -9
  241. package/src/styles/99-utilities/_utilities.scss +1 -1
  242. package/src/styles/99-utilities/_utilities.sizes.scss +47 -18
  243. package/src/styles/99-utilities/_utilities.spacing.scss +118 -66
  244. package/src/styles/99-utilities/_utilities.text-gradient.scss +30 -30
  245. package/src/styles/99-utilities/_utilities.text.scss +67 -46
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
2
2
  import { fn } from '@storybook/test';
3
3
  import { HERO } from '../../lib/constants/components';
4
4
  import { Button } from '../Button/Button';
5
- import { Hero } from './Hero';
5
+ import { Hero, HeroProps } from './Hero';
6
6
 
7
7
  // Extract class names without the leading dots
8
8
  const HERO_CLASS = HERO.SELECTORS.HERO.replace('.', '');
@@ -24,9 +24,11 @@ const LEFT_CLASS = HERO.CLASSES.LEFT;
24
24
  const FULL_VH_CLASS = HERO.CLASSES.FULL_VH;
25
25
 
26
26
  // Define missing variables
27
- const demoText = '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.';
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.';
28
29
 
29
- const showcaseText = 'This is an example of showcase text demonstrating the capabilities of the Atomix design system. Create beautiful interfaces with ease and consistency.';
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.';
30
32
 
31
33
  const primaryActionButtons = (
32
34
  <>
@@ -50,7 +52,7 @@ const showcaseActionButtons = (
50
52
  </>
51
53
  );
52
54
 
53
- const meta = {
55
+ const meta: Meta<HeroProps> = {
54
56
  title: 'Components/Hero',
55
57
  component: Hero,
56
58
  parameters: {
@@ -195,7 +197,7 @@ Hero creates prominent banner sections typically used at the top of pages. It pr
195
197
  description: 'Show background overlay',
196
198
  table: {
197
199
  type: { summary: 'boolean' },
198
- defaultValue: { summary: false },
200
+ defaultValue: { summary: 'false' },
199
201
  },
200
202
  },
201
203
  fullViewportHeight: {
@@ -203,7 +205,7 @@ Hero creates prominent banner sections typically used at the top of pages. It pr
203
205
  description: 'Make hero full viewport height',
204
206
  table: {
205
207
  type: { summary: 'boolean' },
206
- defaultValue: { summary: false },
208
+ defaultValue: { summary: 'false' },
207
209
  },
208
210
  },
209
211
  imageColSize: {
@@ -211,7 +213,7 @@ Hero creates prominent banner sections typically used at the top of pages. It pr
211
213
  description: 'Image column size (1-12)',
212
214
  table: {
213
215
  type: { summary: 'number' },
214
- defaultValue: { summary: 6 },
216
+ defaultValue: { summary: '6' },
215
217
  },
216
218
  },
217
219
  contentColSize: {
@@ -219,7 +221,7 @@ Hero creates prominent banner sections typically used at the top of pages. It pr
219
221
  description: 'Content column size (1-12)',
220
222
  table: {
221
223
  type: { summary: 'number' },
222
- defaultValue: { summary: 6 },
224
+ defaultValue: { summary: '6' },
223
225
  },
224
226
  },
225
227
  contentWidth: {
@@ -235,7 +237,7 @@ Hero creates prominent banner sections typically used at the top of pages. It pr
235
237
  description: 'Enable parallax effect on background image',
236
238
  table: {
237
239
  type: { summary: 'boolean' },
238
- defaultValue: { summary: false },
240
+ defaultValue: { summary: 'false' },
239
241
  },
240
242
  },
241
243
  parallaxIntensity: {
@@ -243,7 +245,7 @@ Hero creates prominent banner sections typically used at the top of pages. It pr
243
245
  description: 'Parallax effect intensity (0-1)',
244
246
  table: {
245
247
  type: { summary: 'number' },
246
- defaultValue: { summary: 0.5 },
248
+ defaultValue: { summary: '0.5' },
247
249
  },
248
250
  },
249
251
  videoBackground: {
@@ -255,10 +257,10 @@ Hero creates prominent banner sections typically used at the top of pages. It pr
255
257
  },
256
258
  },
257
259
  },
258
- } satisfies Meta<typeof Hero>;
260
+ } satisfies Meta<HeroProps>;
259
261
 
260
262
  export default meta;
261
- type Story = StoryObj<typeof meta>;
263
+ type Story = StoryObj<HeroProps>;
262
264
 
263
265
  export const BasicUsage: Story = {
264
266
  args: {
@@ -282,7 +284,8 @@ export const WithImage: Story = {
282
284
  title: 'Beautiful Interfaces',
283
285
  subtitle: 'Crafted with Atomix',
284
286
  text: 'Create stunning user experiences with our carefully designed components and guidelines.',
285
- imageSrc: 'https://images.unsplash.com/photo-1517245386807-bb43f82c33c4?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80',
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',
286
289
  imageAlt: 'Laptop with design interface',
287
290
  alignment: 'left',
288
291
  fullViewportHeight: false,
@@ -301,7 +304,8 @@ export const WithBackgroundImage: Story = {
301
304
  title: 'Adventure Awaits',
302
305
  subtitle: 'Begin Your Journey',
303
306
  text: 'Explore new possibilities and create amazing products with our design system.',
304
- backgroundImageSrc: 'https://images.unsplash.com/photo-1506744038136-46273834b3fb?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80',
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',
305
309
  showOverlay: true,
306
310
  alignment: 'center',
307
311
  fullViewportHeight: true,
@@ -316,11 +320,15 @@ export const WithBackgroundImage: Story = {
316
320
  };
317
321
 
318
322
  export const WithActions: Story = {
319
- render: (args) => (
323
+ render: args => (
320
324
  <Hero {...args}>
321
325
  <div className={ACTIONS_CLASS}>
322
- <Button variant="primary" size="lg" className="u-mr-3">Get Started</Button>
323
- <Button variant="secondary" size="lg">Learn More</Button>
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>
324
332
  </div>
325
333
  </Hero>
326
334
  ),
@@ -391,8 +399,6 @@ export const WithCustomGlassEffect: Story = {
391
399
  cornerRadius: 45,
392
400
  mode: 'standard',
393
401
  elasticity: 0.2,
394
- showBorderEffects: true,
395
- showHoverEffects: true,
396
402
  onClick: () => {
397
403
  console.log('Clicked!');
398
404
  },
@@ -870,7 +876,7 @@ export const PremiumShowcase: Story = {
870
876
  aberrationIntensity: 0.5,
871
877
  cornerRadius: 20,
872
878
  overLight: true,
873
- mode: 'advanced',
879
+ mode: 'standard',
874
880
  },
875
881
  actions: (
876
882
  <>
@@ -923,7 +929,8 @@ export const PremiumShowcase: Story = {
923
929
  parameters: {
924
930
  docs: {
925
931
  description: {
926
- story: 'Premium showcase combining multiple advanced features: glass effect, background slider with videos, full viewport height, and interactive elements.',
932
+ story:
933
+ 'Premium showcase combining multiple advanced features: glass effect, background slider with videos, full viewport height, and interactive elements.',
927
934
  },
928
935
  },
929
936
  },
@@ -945,8 +952,34 @@ export const MinimalistDesign: Story = {
945
952
  parameters: {
946
953
  docs: {
947
954
  description: {
948
- story: 'Minimalist design focusing on typography and content, with subtle animations and refined aesthetics.',
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.',
949
982
  },
950
983
  },
951
984
  },
952
- };
985
+ };
@@ -16,7 +16,11 @@ export const Hero: React.FC<HeroProps> = ({
16
16
  fullViewportHeight = false,
17
17
  actions,
18
18
  imageColSize = 7,
19
+ imageColClassName,
20
+ imageColStyle,
19
21
  contentColSize = 5,
22
+ contentColClassName,
23
+ contentColStyle,
20
24
  contentWidth,
21
25
  className = '',
22
26
  style,
@@ -31,7 +35,13 @@ export const Hero: React.FC<HeroProps> = ({
31
35
  muted: true,
32
36
  },
33
37
  backgroundSlider,
34
- }) => {
38
+ headingLevel = 'h1',
39
+ reverseOnMobile = false,
40
+ parts,
41
+ ...rest
42
+ }: HeroProps) => {
43
+ // Define dynamic heading tag
44
+ const HeadingTag = headingLevel;
35
45
  const {
36
46
  generateHeroClassNames,
37
47
  generateImageColClass,
@@ -44,6 +54,7 @@ export const Hero: React.FC<HeroProps> = ({
44
54
  backgroundSlider: sliderHook,
45
55
  hasBackgroundSlider,
46
56
  } = useHero({
57
+ title,
47
58
  alignment,
48
59
  imageColSize,
49
60
  contentColSize,
@@ -56,6 +67,7 @@ export const Hero: React.FC<HeroProps> = ({
56
67
  parallaxIntensity,
57
68
  videoBackground,
58
69
  backgroundSlider,
70
+ reverseOnMobile,
59
71
  });
60
72
 
61
73
  // Create custom style for hero element with content width if provided
@@ -95,16 +107,16 @@ export const Hero: React.FC<HeroProps> = ({
95
107
  let transitionClass = HERO.CLASSES.SLIDER_FADE;
96
108
  if (transition === 'slide') {
97
109
  transitionClass = HERO.CLASSES.SLIDER_SLIDE;
98
- } else if (transition === 'custom') {
99
- transitionClass = HERO.CLASSES.SLIDER_CUSTOM;
100
110
  }
101
111
 
102
112
  return (
103
113
  <div
104
114
  className={`${HERO.SELECTORS.SLIDER.replace('.', '')} ${transitionClass}`}
105
- style={{
106
- '--slider-transition-duration': `${transitionDuration}ms`,
107
- } as React.CSSProperties}
115
+ style={
116
+ {
117
+ '--slider-transition-duration': `${transitionDuration}ms`,
118
+ } as React.CSSProperties
119
+ }
108
120
  onMouseEnter={() => {
109
121
  if (backgroundSlider.autoplay?.pauseOnHover) {
110
122
  sliderHook.pauseAutoplay();
@@ -116,7 +128,7 @@ export const Hero: React.FC<HeroProps> = ({
116
128
  }
117
129
  }}
118
130
  >
119
- {slides.map((slide, index) => {
131
+ {slides.map((slide, index: number) => {
120
132
  const isActive = index === currentIndex;
121
133
  const slideRef = slideRefs[index];
122
134
  const videoRef = videoRefs[index];
@@ -125,37 +137,40 @@ export const Hero: React.FC<HeroProps> = ({
125
137
  <div
126
138
  key={index}
127
139
  ref={slideRef}
128
- className={`${HERO.SELECTORS.SLIDER_ITEM.replace('.', '')} ${
129
- isActive ? HERO.CLASSES.SLIDER_ITEM_ACTIVE : ''
130
- }`}
140
+ className={`${HERO.SELECTORS.SLIDER_ITEM.replace('.', '')} ${isActive ? HERO.CLASSES.SLIDER_ITEM_ACTIVE : ''}`}
141
+ aria-hidden={!isActive}
131
142
  >
132
- {slide.type === 'image' ? (
133
- <img
134
- src={slide.src}
135
- alt={slide.alt || 'Background slide'}
136
- className={HERO.SELECTORS.BG_IMAGE.replace('.', '')}
137
- />
138
- ) : (
143
+ {slide.type === 'video' ? (
139
144
  <video
140
145
  ref={videoRef as React.LegacyRef<HTMLVideoElement>}
141
- className="c-hero__video"
142
- autoPlay={slide.videoOptions?.autoplay !== false}
143
- loop={slide.videoOptions?.loop !== false}
144
- muted={slide.videoOptions?.muted !== false}
146
+ className={'c-hero__bg-video'}
147
+ src={slide.src}
148
+ poster={slide.videoOptions?.posterUrl || slide.alt}
149
+ muted={slide.videoOptions?.muted ?? true}
150
+ loop={slide.videoOptions?.loop ?? true}
145
151
  playsInline
146
- poster={slide.videoOptions?.posterUrl}
152
+ aria-hidden="true"
153
+ autoPlay={slide.videoOptions?.autoplay !== false}
147
154
  >
148
- <source
149
- src={slide.src}
150
- type={`video/${slide.src.split('.').pop() || 'mp4'}`}
151
- />
155
+ <source src={slide.src} type={`video/${slide.src.split('.').pop() || 'mp4'}`} />
152
156
  Your browser does not support the video tag.
153
157
  </video>
158
+ ) : (
159
+ <img
160
+ src={slide.src}
161
+ alt={slide.alt || 'Background slide'}
162
+ className={HERO.SELECTORS.BG_IMAGE.replace('.', '')}
163
+ />
154
164
  )}
155
165
  </div>
156
166
  );
157
167
  })}
158
- {showOverlay && <div className={HERO.SELECTORS.OVERLAY.replace('.', '')}></div>}
168
+ {showOverlay && (
169
+ <div
170
+ className={`${HERO.SELECTORS.OVERLAY.replace('.', '')} ${parts?.overlay?.className || ''}`.trim()}
171
+ style={parts?.overlay?.style}
172
+ ></div>
173
+ )}
159
174
  </div>
160
175
  );
161
176
  }
@@ -164,7 +179,10 @@ export const Hero: React.FC<HeroProps> = ({
164
179
  if (!hasBackgroundImage && !videoBackground) return null;
165
180
 
166
181
  return (
167
- <div className={HERO.SELECTORS.BG.replace('.', '')}>
182
+ <div
183
+ className={`${HERO.SELECTORS.BG.replace('.', '')} ${parts?.background?.className || ''}`.trim()}
184
+ style={parts?.background?.style}
185
+ >
168
186
  {backgroundImageSrc && (
169
187
  <img
170
188
  src={backgroundImageSrc}
@@ -173,18 +191,52 @@ export const Hero: React.FC<HeroProps> = ({
173
191
  />
174
192
  )}
175
193
  {renderVideoBackground()}
176
- {showOverlay && <div className={HERO.SELECTORS.OVERLAY.replace('.', '')}></div>}
194
+ {showOverlay && (
195
+ <div
196
+ className={`${HERO.SELECTORS.OVERLAY.replace('.', '')} ${parts?.overlay?.className || ''}`.trim()}
197
+ style={parts?.overlay?.style}
198
+ ></div>
199
+ )}
177
200
  </div>
178
201
  );
179
202
  };
180
203
 
181
204
  const renderContent = () => {
182
205
  const content = (
183
- <div className={HERO.SELECTORS.CONTENT.replace('.', '')}>
184
- {subtitle && <p className={HERO.SELECTORS.SUBTITLE.replace('.', '')}>{subtitle}</p>}
185
- <h1 className={HERO.SELECTORS.TITLE.replace('.', '')}>{title}</h1>
186
- {text && <p className={HERO.SELECTORS.TEXT.replace('.', '')}>{text}</p>}
187
- {actions && <div className={HERO.SELECTORS.ACTIONS.replace('.', '')}>{actions}</div>}
206
+ <div
207
+ className={`${HERO.SELECTORS.CONTENT.replace('.', '')} ${parts?.content?.className || ''}`.trim()}
208
+ style={parts?.content?.style}
209
+ >
210
+ {subtitle && (
211
+ <p
212
+ className={`${HERO.SELECTORS.SUBTITLE.replace('.', '')} ${parts?.subtitle?.className || ''}`.trim()}
213
+ style={parts?.subtitle?.style}
214
+ >
215
+ {subtitle}
216
+ </p>
217
+ )}
218
+ <HeadingTag
219
+ className={`${HERO.SELECTORS.TITLE.replace('.', '')} ${parts?.title?.className || ''}`.trim()}
220
+ style={parts?.title?.style}
221
+ >
222
+ {title}
223
+ </HeadingTag>
224
+ {text && (
225
+ <p
226
+ className={`${HERO.SELECTORS.TEXT.replace('.', '')} ${parts?.text?.className || ''}`.trim()}
227
+ style={parts?.text?.style}
228
+ >
229
+ {text}
230
+ </p>
231
+ )}
232
+ {actions && (
233
+ <div
234
+ className={`${HERO.SELECTORS.ACTIONS.replace('.', '')} ${parts?.actions?.className || ''}`.trim()}
235
+ style={parts?.actions?.style}
236
+ >
237
+ {actions}
238
+ </div>
239
+ )}
188
240
  </div>
189
241
  );
190
242
 
@@ -198,7 +250,10 @@ export const Hero: React.FC<HeroProps> = ({
198
250
  // If glass is true, use default glass props
199
251
  if (glass === true) {
200
252
  return (
201
- <div className={HERO.SELECTORS.CONTENT.replace('.', '')}>
253
+ <div
254
+ className={`${HERO.SELECTORS.CONTENT.replace('.', '')} ${parts?.content?.className || ''}`.trim()}
255
+ style={parts?.content?.style}
256
+ >
202
257
  <AtomixGlass
203
258
  displacementScale={60}
204
259
  blurAmount={3}
@@ -209,11 +264,35 @@ export const Hero: React.FC<HeroProps> = ({
209
264
  mode="standard"
210
265
  >
211
266
  <div className="u-p-4">
212
- {subtitle && <p className={HERO.SELECTORS.SUBTITLE.replace('.', '')}>{subtitle}</p>}
213
- <h1 className={HERO.SELECTORS.TITLE.replace('.', '')}>{title}</h1>
214
- {text && <p className={HERO.SELECTORS.TEXT.replace('.', '')}>{text}</p>}
267
+ {subtitle && (
268
+ <p
269
+ className={`${HERO.SELECTORS.SUBTITLE.replace('.', '')} ${parts?.subtitle?.className || ''}`.trim()}
270
+ style={parts?.subtitle?.style}
271
+ >
272
+ {subtitle}
273
+ </p>
274
+ )}
275
+ <HeadingTag
276
+ className={`${HERO.SELECTORS.TITLE.replace('.', '')} ${parts?.title?.className || ''}`.trim()}
277
+ style={parts?.title?.style}
278
+ >
279
+ {title}
280
+ </HeadingTag>
281
+ {text && (
282
+ <p
283
+ className={`${HERO.SELECTORS.TEXT.replace('.', '')} ${parts?.text?.className || ''}`.trim()}
284
+ style={parts?.text?.style}
285
+ >
286
+ {text}
287
+ </p>
288
+ )}
215
289
  {actions && (
216
- <div className={HERO.SELECTORS.ACTIONS.replace('.', '')}>{actions}</div>
290
+ <div
291
+ className={`${HERO.SELECTORS.ACTIONS.replace('.', '')} ${parts?.actions?.className || ''}`.trim()}
292
+ style={parts?.actions?.style}
293
+ >
294
+ {actions}
295
+ </div>
217
296
  )}
218
297
  </div>
219
298
  </AtomixGlass>
@@ -223,13 +302,42 @@ export const Hero: React.FC<HeroProps> = ({
223
302
 
224
303
  // If glass is an object, use provided glass props
225
304
  return (
226
- <div className={HERO.SELECTORS.CONTENT.replace('.', '')}>
305
+ <div
306
+ className={`${HERO.SELECTORS.CONTENT.replace('.', '')} ${parts?.content?.className || ''}`.trim()}
307
+ style={parts?.content?.style}
308
+ >
227
309
  <AtomixGlass {...glass}>
228
310
  <div className="u-p-4">
229
- {subtitle && <p className={HERO.SELECTORS.SUBTITLE.replace('.', '')}>{subtitle}</p>}
230
- <h1 className={HERO.SELECTORS.TITLE.replace('.', '')}>{title}</h1>
231
- {text && <p className={HERO.SELECTORS.TEXT.replace('.', '')}>{text}</p>}
232
- {actions && <div className={HERO.SELECTORS.ACTIONS.replace('.', '')}>{actions}</div>}
311
+ {subtitle && (
312
+ <p
313
+ className={`${HERO.SELECTORS.SUBTITLE.replace('.', '')} ${parts?.subtitle?.className || ''}`.trim()}
314
+ style={parts?.subtitle?.style}
315
+ >
316
+ {subtitle}
317
+ </p>
318
+ )}
319
+ <HeadingTag
320
+ className={`${HERO.SELECTORS.TITLE.replace('.', '')} ${parts?.title?.className || ''}`.trim()}
321
+ style={parts?.title?.style}
322
+ >
323
+ {title}
324
+ </HeadingTag>
325
+ {text && (
326
+ <p
327
+ className={`${HERO.SELECTORS.TEXT.replace('.', '')} ${parts?.text?.className || ''}`.trim()}
328
+ style={parts?.text?.style}
329
+ >
330
+ {text}
331
+ </p>
332
+ )}
333
+ {actions && (
334
+ <div
335
+ className={`${HERO.SELECTORS.ACTIONS.replace('.', '')} ${parts?.actions?.className || ''}`.trim()}
336
+ style={parts?.actions?.style}
337
+ >
338
+ {actions}
339
+ </div>
340
+ )}
233
341
  </div>
234
342
  </AtomixGlass>
235
343
  </div>
@@ -245,15 +353,31 @@ export const Hero: React.FC<HeroProps> = ({
245
353
 
246
354
  if (alignment === 'center') {
247
355
  return (
248
- <div className={HERO.SELECTORS.IMAGE_WRAPPER.replace('.', '')}>
249
- <img src={imageSrc} alt={imageAlt} className={HERO.SELECTORS.IMAGE.replace('.', '')} />
356
+ <div
357
+ className={`${HERO.SELECTORS.IMAGE_WRAPPER.replace('.', '')} ${imageColClassName || ''} ${parts?.imageWrapper?.className || ''}`.trim()}
358
+ style={{ ...imageColStyle, ...parts?.imageWrapper?.style }}
359
+ >
360
+ <img
361
+ src={imageSrc}
362
+ alt={imageAlt}
363
+ className={`${HERO.SELECTORS.IMAGE.replace('.', '')} ${parts?.image?.className || ''}`.trim()}
364
+ style={parts?.image?.style}
365
+ />
250
366
  </div>
251
367
  );
252
368
  }
253
369
 
254
370
  return (
255
- <div className={generateImageColClass()}>
256
- <img src={imageSrc} alt={imageAlt} className={HERO.SELECTORS.IMAGE.replace('.', '')} />
371
+ <div
372
+ className={`${generateImageColClass(imageColSize, imageColClassName)} ${parts?.imageWrapper?.className || ''}`.trim()}
373
+ style={{ ...imageColStyle, ...parts?.imageWrapper?.style }}
374
+ >
375
+ <img
376
+ src={imageSrc}
377
+ alt={imageAlt}
378
+ className={`${HERO.SELECTORS.IMAGE.replace('.', '')} ${parts?.image?.className || ''}`.trim()}
379
+ style={parts?.image?.style}
380
+ />
257
381
  </div>
258
382
  );
259
383
  };
@@ -263,7 +387,12 @@ export const Hero: React.FC<HeroProps> = ({
263
387
  if (alignment === 'left') {
264
388
  return (
265
389
  <>
266
- <div className={generateContentColClass()}>{renderContent()}</div>
390
+ <div
391
+ className={generateContentColClass(contentColSize, contentColClassName)}
392
+ style={contentColStyle}
393
+ >
394
+ {renderContent()}
395
+ </div>
267
396
  {renderForegroundImage()}
268
397
  </>
269
398
  );
@@ -273,7 +402,12 @@ export const Hero: React.FC<HeroProps> = ({
273
402
  return (
274
403
  <>
275
404
  {renderForegroundImage()}
276
- <div className={generateContentColClass()}>{renderContent()}</div>
405
+ <div
406
+ className={generateContentColClass(contentColSize, contentColClassName)}
407
+ style={contentColStyle}
408
+ >
409
+ {renderContent()}
410
+ </div>
277
411
  </>
278
412
  );
279
413
  };
@@ -281,17 +415,29 @@ export const Hero: React.FC<HeroProps> = ({
281
415
  return (
282
416
  <div
283
417
  ref={heroRef as React.LegacyRef<HTMLDivElement>}
284
- className={generateHeroClassNames(className)}
285
- style={heroStyle}
418
+ className={`${generateHeroClassNames(className)} ${parts?.root?.className || ''}`.trim()}
419
+ style={{ ...heroStyle, ...parts?.root?.style }}
286
420
  data-parallax={parallax ? 'true' : undefined}
287
421
  data-parallax-intensity={parallax ? parallaxIntensity : undefined}
422
+ {...rest}
288
423
  >
289
424
  {renderBackground()}
290
- <div className={`${HERO.SELECTORS.CONTAINER.replace('.', '')} o-container`}>
425
+ <div
426
+ className={`${HERO.SELECTORS.CONTAINER.replace('.', '')} o-container ${parts?.container?.className || ''}`.trim()}
427
+ style={parts?.container?.style}
428
+ >
291
429
  {children ? (
292
- <div className={HERO.SELECTORS.GRID.replace('.', '')}>{children}</div>
430
+ <div
431
+ className={`${HERO.SELECTORS.GRID.replace('.', '')} ${parts?.grid?.className || ''}`.trim()}
432
+ style={parts?.grid?.style}
433
+ >
434
+ {children}
435
+ </div>
293
436
  ) : useGridLayout ? (
294
- <div className={`${HERO.SELECTORS.GRID.replace('.', '')} o-grid`}>
437
+ <div
438
+ className={`${HERO.SELECTORS.GRID.replace('.', '')} o-grid ${parts?.grid?.className || ''}`.trim()}
439
+ style={parts?.grid?.style}
440
+ >
295
441
  {renderGridContent()}
296
442
  </div>
297
443
  ) : (
@@ -1,2 +1,8 @@
1
- export { Icon, type IconProps, type IconSize, type IconWeight, type PhosphorIconsType } from './Icon';
1
+ export {
2
+ Icon,
3
+ type IconProps,
4
+ type IconSize,
5
+ type IconWeight,
6
+ type PhosphorIconsType,
7
+ } from './Icon';
2
8
  export { default } from './Icon';
@@ -2,32 +2,28 @@ import React, { memo } from 'react';
2
2
  import { ListProps } from '../../lib/types/components';
3
3
  import { LIST } from '../../lib/constants/components';
4
4
 
5
- export const List: React.FC<ListProps> = memo(({
6
- children,
7
- variant = 'default',
8
- className = '',
9
- style,
10
- ...props
11
- }) => {
12
- // Generate CSS classes
13
- const listClasses = [LIST.BASE_CLASS, variant !== 'default' && `c-list--${variant}`, className]
14
- .filter(Boolean)
15
- .join(' ');
5
+ export const List: React.FC<ListProps> = memo(
6
+ ({ children, variant = 'default', className = '', style, ...props }) => {
7
+ // Generate CSS classes
8
+ const listClasses = [LIST.BASE_CLASS, variant !== 'default' && `c-list--${variant}`, className]
9
+ .filter(Boolean)
10
+ .join(' ');
16
11
 
17
- // Determine the HTML element based on variant
18
- const ListElement = ['number', 'text'].includes(variant) ? 'ol' : 'ul';
12
+ // Determine the HTML element based on variant
13
+ const ListElement = ['number', 'text'].includes(variant) ? 'ol' : 'ul';
19
14
 
20
- return (
21
- <ListElement className={listClasses} style={style} {...props}>
22
- {React.Children.map(children, child => {
23
- if (React.isValidElement(child)) {
15
+ return (
16
+ <ListElement className={listClasses} style={style} {...props}>
17
+ {React.Children.map(children, child => {
18
+ if (React.isValidElement(child)) {
19
+ return <li className="c-list__item">{child}</li>;
20
+ }
24
21
  return <li className="c-list__item">{child}</li>;
25
- }
26
- return <li className="c-list__item">{child}</li>;
27
- })}
28
- </ListElement>
29
- );
30
- });
22
+ })}
23
+ </ListElement>
24
+ );
25
+ }
26
+ );
31
27
 
32
28
  export type { ListProps };
33
29
 
@@ -649,7 +649,8 @@ export const GlassModalSizes: Story = {
649
649
  The glass effect adapts to different modal sizes while maintaining its visual appeal.
650
650
  </p>
651
651
  <p>
652
- The glass effect enhances the modal's appearance, making it visually appealing and easier to read.
652
+ The glass effect enhances the modal's appearance, making it visually appealing and
653
+ easier to read.
653
654
  </p>
654
655
  </Modal>
655
656
  </div>