@shohojdhara/atomix 0.2.3 → 0.2.5

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 (225) hide show
  1. package/README.md +19 -0
  2. package/dist/atomix.css +1703 -1544
  3. package/dist/atomix.min.css +4 -4
  4. package/dist/index.d.ts +1465 -963
  5. package/dist/index.esm.js +16289 -25908
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.js +15650 -21780
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.js +1 -1
  10. package/dist/index.min.js.map +1 -1
  11. package/dist/themes/applemix.css +15008 -0
  12. package/dist/themes/applemix.min.css +72 -0
  13. package/dist/themes/boomdevs.css +1608 -1450
  14. package/dist/themes/boomdevs.min.css +5 -5
  15. package/dist/themes/esrar.css +1702 -1543
  16. package/dist/themes/esrar.min.css +4 -4
  17. package/dist/themes/flashtrade.css +15159 -0
  18. package/dist/themes/flashtrade.min.css +86 -0
  19. package/dist/themes/mashroom.css +1699 -1540
  20. package/dist/themes/mashroom.min.css +7 -7
  21. package/dist/themes/shaj-default.css +1693 -1534
  22. package/dist/themes/shaj-default.min.css +4 -4
  23. package/package.json +6 -17
  24. package/src/components/Accordion/Accordion.stories.tsx +662 -21
  25. package/src/components/Accordion/Accordion.tsx +21 -14
  26. package/src/components/AtomixGlass/AtomixGlass.test.tsx +106 -72
  27. package/src/components/AtomixGlass/AtomixGlass.tsx +529 -1195
  28. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +400 -0
  29. package/src/components/AtomixGlass/GlassFilter.tsx +156 -0
  30. package/src/components/AtomixGlass/README.md +124 -2
  31. package/src/components/AtomixGlass/atomixGLass.old.tsx +1266 -0
  32. package/src/components/AtomixGlass/glass-utils.ts +263 -0
  33. package/src/components/AtomixGlass/shader-utils.ts +792 -68
  34. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1250 -0
  35. package/src/components/AtomixGlass/stories/Examples.stories.tsx +5768 -0
  36. package/src/components/AtomixGlass/stories/Modes.stories.tsx +1065 -0
  37. package/src/components/AtomixGlass/stories/Playground.stories.tsx +1129 -0
  38. package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +395 -0
  39. package/src/components/AtomixGlass/stories/shared-components.tsx +301 -0
  40. package/src/components/AtomixGlass/utils.ts +3 -3
  41. package/src/components/Avatar/Avatar.tsx +3 -0
  42. package/src/components/Avatar/AvatarGroup.tsx +2 -1
  43. package/src/components/Badge/Badge.stories.tsx +76 -55
  44. package/src/components/Badge/Badge.tsx +12 -14
  45. package/src/components/Breadcrumb/Breadcrumb.tsx +23 -4
  46. package/src/components/Button/Button.stories.tsx +501 -20
  47. package/src/components/Button/Button.tsx +5 -8
  48. package/src/components/Callout/Callout.stories.tsx +86 -35
  49. package/src/components/Callout/Callout.tsx +31 -9
  50. package/src/components/Card/Card.stories.tsx +565 -2
  51. package/src/components/Card/Card.tsx +15 -4
  52. package/src/components/Card/ElevationCard.tsx +2 -0
  53. package/src/components/Chart/AnimatedChart.tsx +179 -156
  54. package/src/components/Chart/AreaChart.tsx +123 -12
  55. package/src/components/Chart/BarChart.tsx +91 -100
  56. package/src/components/Chart/BaseChart.tsx +80 -0
  57. package/src/components/Chart/BubbleChart.tsx +114 -290
  58. package/src/components/Chart/CandlestickChart.tsx +282 -622
  59. package/src/components/Chart/Chart.stories.tsx +576 -179
  60. package/src/components/Chart/Chart.tsx +374 -75
  61. package/src/components/Chart/ChartRenderer.tsx +371 -220
  62. package/src/components/Chart/ChartToolbar.tsx +372 -61
  63. package/src/components/Chart/ChartTooltip.tsx +33 -18
  64. package/src/components/Chart/DonutChart.tsx +172 -254
  65. package/src/components/Chart/FunnelChart.tsx +169 -240
  66. package/src/components/Chart/GaugeChart.tsx +224 -392
  67. package/src/components/Chart/HeatmapChart.tsx +302 -440
  68. package/src/components/Chart/LineChart.tsx +148 -103
  69. package/src/components/Chart/MultiAxisChart.tsx +267 -395
  70. package/src/components/Chart/PieChart.tsx +114 -64
  71. package/src/components/Chart/RadarChart.tsx +202 -218
  72. package/src/components/Chart/ScatterChart.tsx +111 -97
  73. package/src/components/Chart/TreemapChart.tsx +147 -222
  74. package/src/components/Chart/WaterfallChart.tsx +253 -291
  75. package/src/components/Chart/index.ts +11 -9
  76. package/src/components/Chart/types.ts +85 -9
  77. package/src/components/Chart/utils.ts +66 -0
  78. package/src/components/ColorModeToggle/ColorModeToggle.tsx +6 -3
  79. package/src/components/Countdown/Countdown.tsx +4 -0
  80. package/src/components/DataTable/DataTable.tsx +2 -1
  81. package/src/components/DatePicker/DatePicker.stories.tsx +689 -12
  82. package/src/components/DatePicker/DatePicker.tsx +3 -9
  83. package/src/components/DatePicker/types.ts +5 -0
  84. package/src/components/Dropdown/Dropdown.stories.tsx +32 -25
  85. package/src/components/Dropdown/Dropdown.tsx +26 -28
  86. package/src/components/EdgePanel/EdgePanel.stories.tsx +473 -2
  87. package/src/components/EdgePanel/EdgePanel.tsx +101 -13
  88. package/src/components/Footer/Footer.stories.tsx +187 -60
  89. package/src/components/Footer/Footer.test.tsx +134 -0
  90. package/src/components/Footer/Footer.tsx +133 -34
  91. package/src/components/Footer/FooterLink.tsx +1 -1
  92. package/src/components/Footer/FooterSection.tsx +53 -36
  93. package/src/components/Footer/FooterSocialLink.tsx +32 -29
  94. package/src/components/Footer/README.md +82 -3
  95. package/src/components/Footer/index.ts +1 -1
  96. package/src/components/Form/Checkbox.stories.tsx +13 -5
  97. package/src/components/Form/Checkbox.tsx +3 -6
  98. package/src/components/Form/Form.stories.tsx +10 -3
  99. package/src/components/Form/Form.tsx +2 -0
  100. package/src/components/Form/FormGroup.tsx +2 -1
  101. package/src/components/Form/Input.stories.tsx +12 -11
  102. package/src/components/Form/Input.tsx +97 -95
  103. package/src/components/Form/Radio.stories.tsx +22 -7
  104. package/src/components/Form/Radio.tsx +3 -6
  105. package/src/components/Form/Select.stories.tsx +21 -6
  106. package/src/components/Form/Select.tsx +3 -5
  107. package/src/components/Form/Textarea.stories.tsx +13 -11
  108. package/src/components/Form/Textarea.tsx +88 -86
  109. package/src/components/Hero/Hero.stories.tsx +2 -3
  110. package/src/components/Hero/Hero.tsx +5 -6
  111. package/src/components/Icon/Icon.tsx +12 -1
  112. package/src/components/List/List.tsx +2 -1
  113. package/src/components/List/ListGroup.tsx +2 -1
  114. package/src/components/Messages/Messages.stories.tsx +113 -0
  115. package/src/components/Messages/Messages.tsx +52 -9
  116. package/src/components/Modal/Modal.stories.tsx +48 -32
  117. package/src/components/Modal/Modal.tsx +19 -24
  118. package/src/components/Navigation/Menu/MegaMenu.tsx +2 -2
  119. package/src/components/Navigation/Menu/Menu.tsx +2 -2
  120. package/src/components/Navigation/Nav/Nav.stories.tsx +469 -0
  121. package/src/components/Navigation/Nav/Nav.tsx +22 -4
  122. package/src/components/Navigation/Nav/NavDropdown.tsx +10 -1
  123. package/src/components/Navigation/Navbar/Navbar.stories.tsx +413 -0
  124. package/src/components/Navigation/Navbar/Navbar.tsx +70 -29
  125. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +340 -0
  126. package/src/components/Navigation/SideMenu/SideMenu.tsx +29 -2
  127. package/src/components/Pagination/Pagination.stories.tsx +13 -6
  128. package/src/components/Pagination/Pagination.tsx +7 -6
  129. package/src/components/PhotoViewer/PhotoViewer.tsx +2 -1
  130. package/src/components/Popover/Popover.stories.tsx +32 -24
  131. package/src/components/Popover/Popover.tsx +4 -1
  132. package/src/components/ProductReview/ProductReview.tsx +8 -2
  133. package/src/components/Progress/Progress.tsx +19 -3
  134. package/src/components/Rating/Rating.stories.tsx +11 -6
  135. package/src/components/Rating/Rating.tsx +3 -5
  136. package/src/components/River/River.tsx +5 -5
  137. package/src/components/SectionIntro/SectionIntro.tsx +8 -2
  138. package/src/components/Slider/Slider.stories.tsx +4 -4
  139. package/src/components/Slider/Slider.tsx +4 -3
  140. package/src/components/Spinner/Spinner.tsx +19 -3
  141. package/src/components/Steps/Steps.stories.tsx +5 -4
  142. package/src/components/Steps/Steps.tsx +8 -5
  143. package/src/components/Tab/Tab.stories.tsx +4 -3
  144. package/src/components/Tab/Tab.tsx +8 -6
  145. package/src/components/Testimonial/Testimonial.tsx +8 -2
  146. package/src/components/Todo/Todo.tsx +2 -1
  147. package/src/components/Toggle/Toggle.stories.tsx +5 -4
  148. package/src/components/Toggle/Toggle.tsx +8 -5
  149. package/src/components/Tooltip/Tooltip.stories.tsx +40 -30
  150. package/src/components/Tooltip/Tooltip.tsx +9 -2
  151. package/src/components/Upload/Upload.stories.tsx +252 -0
  152. package/src/components/Upload/Upload.tsx +92 -53
  153. package/src/components/VideoPlayer/VideoPlayer.tsx +3 -1
  154. package/src/components/index.ts +0 -4
  155. package/src/layouts/Grid/Grid.stories.tsx +10 -23
  156. package/src/layouts/Grid/Grid.tsx +20 -1
  157. package/src/layouts/Grid/GridCol.tsx +76 -48
  158. package/src/lib/composables/useAtomixGlass.ts +861 -44
  159. package/src/lib/composables/useBarChart.ts +21 -4
  160. package/src/lib/composables/useChart.ts +227 -370
  161. package/src/lib/composables/useChartExport.ts +19 -78
  162. package/src/lib/composables/useChartToolbar.ts +11 -21
  163. package/src/lib/composables/useEdgePanel.ts +125 -71
  164. package/src/lib/composables/useFooter.ts +3 -3
  165. package/src/lib/composables/useGlassContainer.ts +16 -7
  166. package/src/lib/composables/useLineChart.ts +11 -2
  167. package/src/lib/composables/usePieChart.ts +4 -14
  168. package/src/lib/composables/useRiver.ts +5 -0
  169. package/src/lib/composables/useSlider.ts +62 -24
  170. package/src/lib/composables/useVideoPlayer.ts +60 -63
  171. package/src/lib/constants/components.ts +147 -32
  172. package/src/lib/types/components.ts +355 -25
  173. package/src/lib/utils/displacement-generator.ts +55 -49
  174. package/src/lib/utils/icons.ts +1 -1
  175. package/src/lib/utils/index.ts +16 -10
  176. package/src/styles/01-settings/_settings.accordion.scss +19 -19
  177. package/src/styles/01-settings/_settings.animations.scss +5 -5
  178. package/src/styles/01-settings/_settings.avatar-group.scss +1 -1
  179. package/src/styles/01-settings/_settings.avatar.scss +17 -17
  180. package/src/styles/01-settings/_settings.background.scss +0 -3
  181. package/src/styles/01-settings/_settings.badge.scss +1 -1
  182. package/src/styles/01-settings/_settings.breadcrumb.scss +1 -1
  183. package/src/styles/01-settings/_settings.card.scss +1 -1
  184. package/src/styles/01-settings/_settings.chart.scss +65 -2
  185. package/src/styles/01-settings/_settings.dropdown.scss +1 -1
  186. package/src/styles/01-settings/_settings.edge-panel.scss +1 -1
  187. package/src/styles/01-settings/_settings.footer.scss +35 -42
  188. package/src/styles/01-settings/_settings.input.scss +1 -1
  189. package/src/styles/01-settings/_settings.list.scss +1 -1
  190. package/src/styles/01-settings/_settings.rating.scss +1 -1
  191. package/src/styles/01-settings/_settings.tabs.scss +1 -1
  192. package/src/styles/01-settings/_settings.upload.scss +6 -5
  193. package/src/styles/02-tools/_tools.animations.scss +4 -5
  194. package/src/styles/02-tools/_tools.background.scss +1 -13
  195. package/src/styles/02-tools/_tools.glass.scss +0 -1
  196. package/src/styles/02-tools/_tools.utility-api.scss +91 -48
  197. package/src/styles/03-generic/_generic.root.scss +1 -4
  198. package/src/styles/04-elements/_elements.body.scss +0 -1
  199. package/src/styles/06-components/_components.atomix-glass.scss +249 -0
  200. package/src/styles/06-components/_components.badge.scss +8 -23
  201. package/src/styles/06-components/_components.button.scss +8 -3
  202. package/src/styles/06-components/_components.callout.scss +10 -5
  203. package/src/styles/06-components/_components.card.scss +2 -14
  204. package/src/styles/06-components/_components.chart.scss +969 -1449
  205. package/src/styles/06-components/_components.dropdown.scss +19 -7
  206. package/src/styles/06-components/_components.edge-panel.scss +103 -0
  207. package/src/styles/06-components/_components.footer.scss +166 -85
  208. package/src/styles/06-components/_components.input.scss +8 -9
  209. package/src/styles/06-components/_components.list.scss +1 -0
  210. package/src/styles/06-components/_components.messages.scss +176 -0
  211. package/src/styles/06-components/_components.modal.scss +16 -4
  212. package/src/styles/06-components/_components.navbar.scss +12 -1
  213. package/src/styles/06-components/_components.side-menu.scss +5 -0
  214. package/src/styles/06-components/_components.skeleton.scss +8 -6
  215. package/src/styles/06-components/_components.upload.scss +219 -4
  216. package/src/styles/06-components/old.chart.styles.scss +1 -30
  217. package/src/styles/99-utilities/_index.scss +1 -0
  218. package/src/styles/99-utilities/_utilities.glass-fixes.scss +1 -0
  219. package/src/styles/99-utilities/_utilities.scss +1 -1
  220. package/src/components/AtomixGlass/AtomixGlass.stories.tsx +0 -3011
  221. package/src/components/AtomixGlass/AtomixGlassComprehensivePreview.stories.tsx +0 -1369
  222. package/src/components/Chart/AdvancedChart.tsx +0 -624
  223. package/src/components/Chart/LineChartNew.tsx +0 -167
  224. package/src/components/Chart/RealTimeChart.tsx +0 -436
  225. package/src/components/DatePicker/DatePicker copy.tsx +0 -551
@@ -88,6 +88,7 @@ export const Modal: React.FC<ModalProps> = ({
88
88
  backdrop = true,
89
89
  keyboard = true,
90
90
  className = '',
91
+ style,
91
92
  closeButton = true,
92
93
  footer,
93
94
  glass,
@@ -184,7 +185,7 @@ export const Modal: React.FC<ModalProps> = ({
184
185
  <div
185
186
  ref={modalRef}
186
187
  className={modalClasses}
187
- style={{ display: isOpenState ? 'block' : 'none' }}
188
+ style={{ display: isOpenState ? 'block' : 'none', ...style }}
188
189
  role="dialog"
189
190
  aria-modal="true"
190
191
  aria-hidden={!isOpenState}
@@ -192,29 +193,23 @@ export const Modal: React.FC<ModalProps> = ({
192
193
  >
193
194
  <div ref={backdropRef} className="c-modal__backdrop" onClick={handleBackdropClick} />
194
195
  <div ref={dialogRef} className="c-modal__dialog">
195
- {glass ? (
196
- // Default glass settings for modals
197
- (() => {
198
- const defaultGlassProps = {
199
- displacementScale: 100,
200
- blurAmount: 2,
201
- saturation: 180,
202
- aberrationIntensity: 1,
203
- cornerRadius: 16,
204
- mode: 'shader' as const,
205
- };
206
-
207
- const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
208
-
209
- return (
210
- <AtomixGlass {...glassProps}>
211
- {modalContent}
212
- </AtomixGlass>
213
- );
214
- })()
215
- ) : (
216
- modalContent
217
- )}
196
+ {glass
197
+ ? // Default glass settings for modals
198
+ (() => {
199
+ const defaultGlassProps = {
200
+ displacementScale: 100,
201
+ blurAmount: 2,
202
+ aberrationIntensity: 1,
203
+ cornerRadius: 12,
204
+ mode: 'shader' as const,
205
+ };
206
+
207
+ const glassProps =
208
+ glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
209
+
210
+ return <AtomixGlass {...glassProps}>{modalContent}</AtomixGlass>;
211
+ })()
212
+ : modalContent}
218
213
  </div>
219
214
  </div>
220
215
  );
@@ -8,9 +8,9 @@ import { Icon } from '../../Icon/Icon';
8
8
  import { mapIconName } from './Menu'; // Import the mapping function
9
9
 
10
10
  export const MegaMenu: React.FC<MegaMenuProps> = forwardRef<HTMLDivElement, MegaMenuProps>(
11
- ({ children, className = '', disabled = false }, ref) => {
11
+ ({ children, className = '', style, disabled = false }, ref) => {
12
12
  return (
13
- <div ref={ref} className={`c-menu c-menu--mega ${className}`}>
13
+ <div ref={ref} className={`c-menu c-menu--mega ${className}`} style={style}>
14
14
  <div className="c-menu__container">
15
15
  <div className="c-menu__grid o-grid">
16
16
  {React.Children.map(children, child => {
@@ -3,9 +3,9 @@ import { MenuProps, MenuItemProps } from '../../../lib/types/components';
3
3
  import { Icon } from '../../Icon/Icon';
4
4
 
5
5
  export const Menu: React.FC<MenuProps> = forwardRef<HTMLDivElement, MenuProps>(
6
- ({ children, className = '', disabled = false }, ref) => {
6
+ ({ children, className = '', style, disabled = false }, ref) => {
7
7
  return (
8
- <div ref={ref} className={`c-menu ${className}`}>
8
+ <div ref={ref} className={`c-menu ${className}`} style={style}>
9
9
  <ul className="c-menu__list" role="menu">
10
10
  {React.Children.map(children, child => {
11
11
  if (React.isValidElement(child)) {
@@ -377,6 +377,475 @@ export const FloatWithIcons: Story = {
377
377
  ),
378
378
  };
379
379
 
380
+ // Glass Morphism Effect Stories - Professional Showcase
381
+
382
+ /**
383
+ * Background wrapper component for consistent glass effect demonstrations
384
+ */
385
+ interface BackgroundWrapperProps {
386
+ children: React.ReactNode;
387
+ backgroundImage: string;
388
+ height?: string;
389
+ padding?: string;
390
+ overlay?: boolean;
391
+ }
392
+
393
+ const BackgroundWrapper = ({
394
+ children,
395
+ backgroundImage,
396
+ height = '90vh',
397
+ padding = '60px 40px',
398
+ overlay = false,
399
+ }: BackgroundWrapperProps) => (
400
+ <div
401
+ style={{
402
+ position: 'relative',
403
+ width: '100%',
404
+ minHeight: height,
405
+ background: `url(${backgroundImage})`,
406
+ backgroundSize: 'cover',
407
+ backgroundPosition: 'center',
408
+ backgroundAttachment: 'fixed',
409
+ display: 'flex',
410
+ alignItems: 'center',
411
+ justifyContent: 'center',
412
+ padding: padding,
413
+ borderRadius: '12px',
414
+ }}
415
+ >
416
+ {overlay && (
417
+ <div
418
+ style={{
419
+ position: 'absolute',
420
+ top: 0,
421
+ left: 0,
422
+ right: 0,
423
+ bottom: 0,
424
+ backgroundColor: 'rgba(0,0,0,0.3)',
425
+ borderRadius: '12px',
426
+ }}
427
+ />
428
+ )}
429
+ <div
430
+ style={{
431
+ position: 'relative',
432
+ width: '100%',
433
+ height: '100%',
434
+ display: 'flex',
435
+ flexDirection: 'column',
436
+ alignItems: 'center',
437
+ justifyContent: 'center',
438
+ gap: '2rem',
439
+ }}
440
+ >
441
+ {children}
442
+ </div>
443
+ </div>
444
+ );
445
+
446
+ /**
447
+ * Glass Effect - Default
448
+ *
449
+ * Demonstrates the Nav component with default glass morphism settings.
450
+ * The glass effect provides a modern, frosted appearance that works
451
+ * beautifully against detailed backgrounds.
452
+ */
453
+ export const Glass: Story = {
454
+ render: () => (
455
+ <BackgroundWrapper
456
+ backgroundImage="https://images.unsplash.com/photo-1506905925346-21bda4d32df4?q=80&w=2940&auto=format&fit=crop"
457
+ overlay
458
+ >
459
+ <div style={{ textAlign: 'center', maxWidth: '800px', marginBottom: '3rem' }}>
460
+ <h2
461
+ style={{
462
+ color: 'white',
463
+ fontSize: '32px',
464
+ fontWeight: 600,
465
+ marginBottom: '16px',
466
+ textShadow: '0 2px 10px rgba(0,0,0,0.5)',
467
+ }}
468
+ >
469
+ Glass Navigation
470
+ </h2>
471
+ <p
472
+ style={{
473
+ color: 'rgba(255,255,255,0.9)',
474
+ fontSize: '18px',
475
+ lineHeight: 1.6,
476
+ textShadow: '0 2px 10px rgba(0,0,0,0.5)',
477
+ }}
478
+ >
479
+ A modern navigation component with glassmorphism effect. Perfect for creating visually
480
+ stunning interfaces that blend seamlessly with any background.
481
+ </p>
482
+ </div>
483
+ <Nav alignment="center" glass>
484
+ <NavItem href="/" active>
485
+ Home
486
+ </NavItem>
487
+ <NavItem href="/about">About</NavItem>
488
+ <NavItem href="/services">Services</NavItem>
489
+ <NavItem href="/contact">Contact</NavItem>
490
+ </Nav>
491
+ </BackgroundWrapper>
492
+ ),
493
+ parameters: {
494
+ docs: {
495
+ description: {
496
+ story:
497
+ 'Basic glass morphism effect with default settings. The navigation maintains excellent readability while creating a beautiful frosted glass aesthetic.',
498
+ },
499
+ },
500
+ },
501
+ };
502
+
503
+ /**
504
+ * Glass Float Variants - Top & Bottom
505
+ *
506
+ * Showcases floating navigation with glass effect at different positions.
507
+ * Ideal for fixed navigation bars and mobile-first designs.
508
+ */
509
+ export const GlassFloatVariants: Story = {
510
+ render: () => (
511
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}>
512
+ <BackgroundWrapper
513
+ backgroundImage="https://images.unsplash.com/photo-1519681393784-d120267933ba?q=80&w=2940&auto=format&fit=crop"
514
+ height="80vh"
515
+ >
516
+ <div style={{ textAlign: 'center', maxWidth: '700px', marginTop: '60px' }}>
517
+ <h3
518
+ style={{
519
+ color: 'white',
520
+ fontSize: '28px',
521
+ fontWeight: 600,
522
+ marginBottom: '12px',
523
+ textShadow: '0 2px 10px rgba(0,0,0,0.5)',
524
+ }}
525
+ >
526
+ Float Top Center
527
+ </h3>
528
+ <p
529
+ style={{
530
+ color: 'rgba(255,255,255,0.85)',
531
+ fontSize: '16px',
532
+ textShadow: '0 2px 10px rgba(0,0,0,0.5)',
533
+ }}
534
+ >
535
+ Perfect for hero sections and landing pages
536
+ </p>
537
+ </div>
538
+ <Nav alignment="center" variant="float-top-center" glass>
539
+ <NavItem href="/" active>
540
+ Home
541
+ </NavItem>
542
+ <NavItem href="/explore">Explore</NavItem>
543
+ <NavItem href="/features">Features</NavItem>
544
+ <NavItem href="/pricing">Pricing</NavItem>
545
+ </Nav>
546
+ </BackgroundWrapper>
547
+
548
+ <BackgroundWrapper
549
+ backgroundImage="https://images.unsplash.com/photo-1514565131-fce0801e5785?q=80&w=2940&auto=format&fit=crop"
550
+ height="80vh"
551
+ >
552
+ <div style={{ textAlign: 'center', maxWidth: '700px' }}>
553
+ <h3
554
+ style={{
555
+ color: 'white',
556
+ fontSize: '28px',
557
+ fontWeight: 600,
558
+ marginBottom: '12px',
559
+ textShadow: '0 2px 10px rgba(0,0,0,0.5)',
560
+ }}
561
+ >
562
+ Float Bottom Center
563
+ </h3>
564
+ <p
565
+ style={{
566
+ color: 'rgba(255,255,255,0.85)',
567
+ fontSize: '16px',
568
+ textShadow: '0 2px 10px rgba(0,0,0,0.5)',
569
+ }}
570
+ >
571
+ Ideal for mobile navigation and tab bars
572
+ </p>
573
+ </div>
574
+ <Nav alignment="center" variant="float-bottom-center" glass>
575
+ <NavItem href="/" active>
576
+ <HomeIcon />
577
+ </NavItem>
578
+ <NavItem href="/search">
579
+ <UserIcon />
580
+ </NavItem>
581
+ <NavItem href="/settings">
582
+ <SettingsIcon />
583
+ </NavItem>
584
+ </Nav>
585
+ </BackgroundWrapper>
586
+ </div>
587
+ ),
588
+ parameters: {
589
+ layout: 'fullscreen',
590
+ docs: {
591
+ description: {
592
+ story:
593
+ 'Floating navigation variants that stay fixed at the top or bottom of the viewport. The glass effect creates a sense of depth while maintaining focus on content.',
594
+ },
595
+ },
596
+ },
597
+ };
598
+
599
+ /**
600
+ * Glass with Custom Properties
601
+ *
602
+ * Demonstrates advanced customization of the glass effect with various
603
+ * displacement, blur, and corner radius settings.
604
+ */
605
+ export const GlassCustom: Story = {
606
+ render: () => (
607
+ <BackgroundWrapper
608
+ backgroundImage="https://images.unsplash.com/photo-1505142468610-359e7d316be0?q=80&w=2940&auto=format&fit=crop"
609
+ overlay
610
+ >
611
+ <div style={{ textAlign: 'center', maxWidth: '800px', marginBottom: '3rem' }}>
612
+ <h2
613
+ style={{
614
+ color: 'white',
615
+ fontSize: '32px',
616
+ fontWeight: 600,
617
+ marginBottom: '16px',
618
+ textShadow: '0 2px 10px rgba(0,0,0,0.5)',
619
+ }}
620
+ >
621
+ Custom Glass Properties
622
+ </h2>
623
+ <p
624
+ style={{
625
+ color: 'rgba(255,255,255,0.9)',
626
+ fontSize: '18px',
627
+ lineHeight: 1.6,
628
+ textShadow: '0 2px 10px rgba(0,0,0,0.5)',
629
+ }}
630
+ >
631
+ Enhanced glass effect with custom displacement, blur, and corner radius. Perfect for
632
+ creating unique visual experiences.
633
+ </p>
634
+ </div>
635
+ <Nav
636
+ alignment="center"
637
+ variant="float-top-center"
638
+ glass={{
639
+ displacementScale: 80,
640
+ blurAmount: 2.5,
641
+ cornerRadius: 20,
642
+ mode: 'shader',
643
+ }}
644
+ >
645
+ <NavItem href="/" active>
646
+ Home
647
+ </NavItem>
648
+ <NavItem href="/destinations">Destinations</NavItem>
649
+ <NavItem href="/gallery">Gallery</NavItem>
650
+ <NavDropdown title="More">
651
+ <Menu>
652
+ <MenuItem href="/blog">Blog</MenuItem>
653
+ <MenuItem href="/about">About</MenuItem>
654
+ <MenuItem href="/contact">Contact</MenuItem>
655
+ </Menu>
656
+ </NavDropdown>
657
+ </Nav>
658
+ </BackgroundWrapper>
659
+ ),
660
+ parameters: {
661
+ docs: {
662
+ description: {
663
+ story:
664
+ 'Customized glass effect with increased displacement and blur for a more pronounced visual impact. Demonstrates the flexibility of the glass morphism system.',
665
+ },
666
+ },
667
+ },
668
+ };
669
+
670
+ /**
671
+ * Glass with Dropdown Integration
672
+ *
673
+ * Shows how the glass effect integrates seamlessly with dropdown menus,
674
+ * maintaining visual consistency across all interactive elements.
675
+ */
676
+ export const GlassWithDropdown: Story = {
677
+ render: () => (
678
+ <BackgroundWrapper
679
+ backgroundImage="https://images.unsplash.com/photo-1441974231531-c6227db76b6e?q=80&w=2940&auto=format&fit=crop"
680
+ overlay
681
+ >
682
+ <div style={{ textAlign: 'center', maxWidth: '800px', marginBottom: '3rem' }}>
683
+ <h2
684
+ style={{
685
+ color: 'white',
686
+ fontSize: '32px',
687
+ fontWeight: 600,
688
+ marginBottom: '16px',
689
+ textShadow: '0 2px 10px rgba(0,0,0,0.5)',
690
+ }}
691
+ >
692
+ Glass Navigation with Dropdowns
693
+ </h2>
694
+ <p
695
+ style={{
696
+ color: 'rgba(255,255,255,0.9)',
697
+ fontSize: '18px',
698
+ lineHeight: 1.6,
699
+ textShadow: '0 2px 10px rgba(0,0,0,0.5)',
700
+ }}
701
+ >
702
+ The glass effect extends to dropdown menus, creating a cohesive visual hierarchy
703
+ throughout your navigation.
704
+ </p>
705
+ </div>
706
+ <Nav alignment="center" glass>
707
+ <NavItem href="/" active>
708
+ Home
709
+ </NavItem>
710
+ <NavItem href="/explore">Explore</NavItem>
711
+ <NavDropdown title="Activities">
712
+ <Menu>
713
+ <MenuItem href="/hiking" icon={<HomeIcon />}>
714
+ Hiking
715
+ </MenuItem>
716
+ <MenuItem href="/camping" icon={<UserIcon />}>
717
+ Camping
718
+ </MenuItem>
719
+ <MenuItem href="/wildlife" icon={<SettingsIcon />}>
720
+ Wildlife
721
+ </MenuItem>
722
+ </Menu>
723
+ </NavDropdown>
724
+ <NavItem href="/guides">Guides</NavItem>
725
+ <NavItem href="/contact">Contact</NavItem>
726
+ </Nav>
727
+ </BackgroundWrapper>
728
+ ),
729
+ parameters: {
730
+ docs: {
731
+ description: {
732
+ story:
733
+ 'Glass navigation with integrated dropdown menus. The glass effect is maintained throughout the interaction, providing a consistent and polished user experience.',
734
+ },
735
+ },
736
+ },
737
+ };
738
+
739
+ /**
740
+ * Glass Theme Variations
741
+ *
742
+ * A comprehensive showcase of glass navigation across different themed
743
+ * backgrounds, demonstrating versatility and adaptability.
744
+ */
745
+ export const GlassThemeShowcase: Story = {
746
+ render: () => (
747
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '3rem' }}>
748
+ {/* Ocean Theme */}
749
+ <BackgroundWrapper
750
+ backgroundImage="https://images.unsplash.com/photo-1505142468610-359e7d316be0?q=80&w=2940&auto=format&fit=crop"
751
+ height="70vh"
752
+ >
753
+ <h3
754
+ style={{
755
+ color: 'white',
756
+ fontSize: '24px',
757
+ fontWeight: 600,
758
+ textAlign: 'center',
759
+ textShadow: '0 2px 10px rgba(0,0,0,0.5)',
760
+ }}
761
+ >
762
+ Ocean & Travel Theme
763
+ </h3>
764
+ <Nav alignment="center" glass>
765
+ <NavItem href="/" active>
766
+ Home
767
+ </NavItem>
768
+ <NavItem href="/destinations">Destinations</NavItem>
769
+ <NavItem href="/experiences">Experiences</NavItem>
770
+ <NavItem href="/booking">Book Now</NavItem>
771
+ </Nav>
772
+ </BackgroundWrapper>
773
+
774
+ {/* Sunset Theme */}
775
+ <BackgroundWrapper
776
+ backgroundImage="https://images.unsplash.com/photo-1495616811223-4d98c6e9c869?q=80&w=2940&auto=format&fit=crop"
777
+ height="70vh"
778
+ >
779
+ <h3
780
+ style={{
781
+ color: 'white',
782
+ fontSize: '24px',
783
+ fontWeight: 600,
784
+ textAlign: 'center',
785
+ textShadow: '0 2px 10px rgba(0,0,0,0.5)',
786
+ }}
787
+ >
788
+ Warm & Inviting Theme
789
+ </h3>
790
+ <Nav
791
+ alignment="center"
792
+ glass={{
793
+ displacementScale: 60,
794
+ blurAmount: 2,
795
+ cornerRadius: 16,
796
+ mode: 'shader',
797
+ }}
798
+ >
799
+ <NavItem href="/" active>
800
+ Home
801
+ </NavItem>
802
+ <NavItem href="/menu">Menu</NavItem>
803
+ <NavItem href="/reservations">Reservations</NavItem>
804
+ <NavItem href="/about">About Us</NavItem>
805
+ </Nav>
806
+ </BackgroundWrapper>
807
+
808
+ {/* Urban Theme */}
809
+ <BackgroundWrapper
810
+ backgroundImage="https://images.unsplash.com/photo-1514565131-fce0801e5785?q=80&w=2940&auto=format&fit=crop"
811
+ height="70vh"
812
+ >
813
+ <h3
814
+ style={{
815
+ color: 'white',
816
+ fontSize: '24px',
817
+ fontWeight: 600,
818
+ textAlign: 'center',
819
+ textShadow: '0 2px 10px rgba(0,0,0,0.5)',
820
+ }}
821
+ >
822
+ Modern & Professional Theme
823
+ </h3>
824
+ <Nav alignment="center" variant="float-bottom-center" glass>
825
+ <NavItem href="/" active>
826
+ <HomeIcon />
827
+ </NavItem>
828
+ <NavItem href="/portfolio">
829
+ <UserIcon />
830
+ </NavItem>
831
+ <NavItem href="/services">
832
+ <SettingsIcon />
833
+ </NavItem>
834
+ </Nav>
835
+ </BackgroundWrapper>
836
+ </div>
837
+ ),
838
+ parameters: {
839
+ layout: 'fullscreen',
840
+ docs: {
841
+ description: {
842
+ story:
843
+ 'A comprehensive showcase demonstrating how glass navigation adapts to different themes and color palettes. Each example represents a different use case and aesthetic.',
844
+ },
845
+ },
846
+ },
847
+ };
848
+
380
849
  // Complete showcase
381
850
  export const CompleteShowcase: Story = {
382
851
  args: {
@@ -1,6 +1,7 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { NavProps } from '../../../lib/types/components';
3
3
  import { useNav } from '../../../lib/composables/useNavbar';
4
+ import { AtomixGlass } from '../../AtomixGlass/AtomixGlass';
4
5
 
5
6
  /**
6
7
  * Nav component provides a container for navigation items with proper alignment and accessibility.
@@ -19,18 +20,22 @@ import { useNav } from '../../../lib/composables/useNavbar';
19
20
  */
20
21
  export const Nav = forwardRef<HTMLUListElement, NavProps>(
21
22
  (
22
- { children, alignment = 'start', variant = 'default', className = '', disabled = false },
23
+ { children, alignment = 'start', variant = 'default', className = '', disabled = false, glass },
23
24
  ref
24
25
  ) => {
25
26
  const { generateNavClass } = useNav({ alignment, variant });
26
27
 
27
28
  const navClass = generateNavClass({ alignment, variant, className });
28
29
 
29
- return (
30
- <ul ref={ref} className={navClass} role="menubar" aria-orientation="horizontal">
30
+ const navContent = (
31
+ <ul
32
+ ref={ref}
33
+ className={navClass + (glass ? ' c-nav--glass' : '')}
34
+ role="menubar"
35
+ aria-orientation="horizontal"
36
+ >
31
37
  {React.Children.map(children, child => {
32
38
  if (React.isValidElement(child)) {
33
- // Pass disabled prop down to all children if Nav is disabled
34
39
  const childProps = child.props as any;
35
40
  return React.cloneElement(child as React.ReactElement<any>, {
36
41
  ...childProps,
@@ -41,6 +46,19 @@ export const Nav = forwardRef<HTMLUListElement, NavProps>(
41
46
  })}
42
47
  </ul>
43
48
  );
49
+
50
+ if (glass) {
51
+ const defaultGlassProps = {
52
+ displacementScale: 60,
53
+ blurAmount: 1.5,
54
+ cornerRadius: 8,
55
+ mode: 'shader' as const,
56
+ };
57
+ const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
58
+ return <AtomixGlass {...glassProps}>{navContent}</AtomixGlass>;
59
+ }
60
+
61
+ return navContent;
44
62
  }
45
63
  );
46
64
 
@@ -6,7 +6,15 @@ import { Icon } from '../../Icon/Icon';
6
6
 
7
7
  export const NavDropdown: React.FC<NavDropdownProps> = forwardRef<HTMLLIElement, NavDropdownProps>(
8
8
  (
9
- { title, children, alignment = 'start', megaMenu = false, className = '', disabled = false },
9
+ {
10
+ title,
11
+ children,
12
+ alignment = 'start',
13
+ megaMenu = false,
14
+ className = '',
15
+ style,
16
+ disabled = false,
17
+ },
10
18
  ref
11
19
  ) => {
12
20
  const { generateDropdownMenuClass, getIconName } = useNavDropdown({
@@ -90,6 +98,7 @@ export const NavDropdown: React.FC<NavDropdownProps> = forwardRef<HTMLLIElement,
90
98
  href="#"
91
99
  onClick={handleToggle}
92
100
  aria-expanded={isActive}
101
+ style={style}
93
102
  >
94
103
  {titleWithIcon}
95
104
  {menuContent}