@shohojdhara/atomix 0.2.3 → 0.2.4
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.
- package/dist/atomix.css +430 -125
- package/dist/atomix.min.css +4 -4
- package/dist/index.d.ts +188 -42
- package/dist/index.esm.js +2049 -1516
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3571 -3055
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/themes/boomdevs.css +379 -74
- package/dist/themes/boomdevs.min.css +4 -4
- package/dist/themes/esrar.css +430 -125
- package/dist/themes/esrar.min.css +4 -4
- package/dist/themes/mashroom.css +429 -124
- package/dist/themes/mashroom.min.css +4 -4
- package/dist/themes/shaj-default.css +429 -124
- package/dist/themes/shaj-default.min.css +4 -4
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.stories.tsx +684 -21
- package/src/components/Accordion/Accordion.tsx +5 -7
- package/src/components/AtomixGlass/AtomixGlass.stories.tsx +456 -2237
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +2 -2
- package/src/components/AtomixGlass/AtomixGlass.tsx +728 -666
- package/src/components/AtomixGlass/shader-utils.ts +589 -33
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +5800 -0
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +1065 -0
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +1066 -0
- package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +397 -0
- package/src/components/AtomixGlass/stories/shared-components.tsx +310 -0
- package/src/components/Badge/Badge.stories.tsx +3 -2
- package/src/components/Badge/Badge.tsx +9 -7
- package/src/components/Button/Button.stories.tsx +501 -20
- package/src/components/Button/Button.tsx +4 -5
- package/src/components/Callout/Callout.tsx +27 -9
- package/src/components/Card/Card.stories.tsx +560 -1
- package/src/components/Card/Card.tsx +1 -1
- package/src/components/DatePicker/DatePicker.stories.tsx +697 -9
- package/src/components/EdgePanel/EdgePanel.stories.tsx +476 -3
- package/src/components/EdgePanel/EdgePanel.tsx +86 -13
- package/src/components/Messages/Messages.stories.tsx +113 -0
- package/src/components/Messages/Messages.tsx +51 -9
- package/src/components/Modal/Modal.stories.tsx +6 -4
- package/src/components/Modal/Modal.tsx +2 -3
- package/src/components/Navigation/Nav/Nav.stories.tsx +469 -0
- package/src/components/Navigation/Nav/Nav.tsx +17 -4
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +413 -0
- package/src/components/Navigation/Navbar/Navbar.tsx +66 -28
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +340 -0
- package/src/components/Navigation/SideMenu/SideMenu.tsx +28 -2
- package/src/components/Progress/Progress.tsx +17 -2
- package/src/components/Spinner/Spinner.tsx +17 -2
- package/src/lib/composables/useBarChart.ts +14 -4
- package/src/lib/composables/useChart.ts +223 -370
- package/src/lib/composables/useChartToolbar.ts +11 -20
- package/src/lib/composables/useEdgePanel.ts +81 -35
- package/src/lib/composables/useLineChart.ts +4 -2
- package/src/lib/composables/usePieChart.ts +4 -14
- package/src/lib/constants/components.ts +1 -0
- package/src/lib/types/components.ts +97 -15
- package/src/styles/01-settings/_settings.background.scss +2 -2
- package/src/styles/01-settings/_settings.edge-panel.scss +1 -1
- package/src/styles/02-tools/_tools.utility-api.scss +62 -27
- package/src/styles/06-components/_components.atomix-glass.scss +72 -0
- package/src/styles/06-components/_components.badge.scss +2 -15
- package/src/styles/06-components/_components.callout.scss +10 -5
- package/src/styles/06-components/_components.edge-panel.scss +101 -0
- package/src/styles/06-components/_components.messages.scss +176 -0
- package/src/styles/06-components/_components.modal.scss +13 -3
- package/src/styles/06-components/_components.navbar.scss +12 -1
- package/src/styles/06-components/_components.side-menu.scss +5 -0
- package/src/styles/99-utilities/_index.scss +1 -0
- package/src/styles/99-utilities/_utilities.glass-fixes.scss +1 -0
- package/src/styles/99-utilities/_utilities.opacity.scss +1 -1
- package/src/components/AtomixGlass/AtomixGlassComprehensivePreview.stories.tsx +0 -1369
|
@@ -567,3 +567,416 @@ export const MegaMenuVsDropdown: Story = {
|
|
|
567
567
|
</div>
|
|
568
568
|
),
|
|
569
569
|
};
|
|
570
|
+
|
|
571
|
+
// Glass Morphism Effect Stories - Professional Showcase
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Background wrapper component for consistent glass effect demonstrations
|
|
575
|
+
*/
|
|
576
|
+
interface BackgroundWrapperProps {
|
|
577
|
+
children: React.ReactNode;
|
|
578
|
+
backgroundImage: string;
|
|
579
|
+
height?: string;
|
|
580
|
+
padding?: string;
|
|
581
|
+
overlay?: boolean;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
const BackgroundWrapper = ({
|
|
585
|
+
children,
|
|
586
|
+
backgroundImage,
|
|
587
|
+
height = '90vh',
|
|
588
|
+
padding = '60px 40px',
|
|
589
|
+
overlay = false,
|
|
590
|
+
}: BackgroundWrapperProps) => (
|
|
591
|
+
<div
|
|
592
|
+
style={{
|
|
593
|
+
position: 'relative',
|
|
594
|
+
width: '100%',
|
|
595
|
+
minHeight: height,
|
|
596
|
+
background: `url(${backgroundImage})`,
|
|
597
|
+
backgroundSize: 'cover',
|
|
598
|
+
backgroundPosition: 'center',
|
|
599
|
+
backgroundAttachment: 'fixed',
|
|
600
|
+
display: 'flex',
|
|
601
|
+
alignItems: 'center',
|
|
602
|
+
justifyContent: 'center',
|
|
603
|
+
padding: padding,
|
|
604
|
+
borderRadius: '12px',
|
|
605
|
+
}}
|
|
606
|
+
>
|
|
607
|
+
{overlay && (
|
|
608
|
+
<div
|
|
609
|
+
style={{
|
|
610
|
+
position: 'absolute',
|
|
611
|
+
top: 0,
|
|
612
|
+
left: 0,
|
|
613
|
+
right: 0,
|
|
614
|
+
bottom: 0,
|
|
615
|
+
backgroundColor: 'rgba(0,0,0,0.3)',
|
|
616
|
+
borderRadius: '12px',
|
|
617
|
+
}}
|
|
618
|
+
/>
|
|
619
|
+
)}
|
|
620
|
+
<div
|
|
621
|
+
style={{
|
|
622
|
+
position: 'relative',
|
|
623
|
+
width: '100%',
|
|
624
|
+
height: '100%',
|
|
625
|
+
display: 'flex',
|
|
626
|
+
flexDirection: 'column',
|
|
627
|
+
alignItems: 'center',
|
|
628
|
+
justifyContent: 'center',
|
|
629
|
+
gap: '2rem',
|
|
630
|
+
}}
|
|
631
|
+
>
|
|
632
|
+
{children}
|
|
633
|
+
</div>
|
|
634
|
+
</div>
|
|
635
|
+
);
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Glass Effect - Default Fixed Navbar
|
|
639
|
+
*
|
|
640
|
+
* Demonstrates the Navbar component with default glass morphism settings
|
|
641
|
+
* in a fixed position. The glass effect provides a modern, frosted appearance.
|
|
642
|
+
*/
|
|
643
|
+
export const Glass: Story = {
|
|
644
|
+
render: () => (
|
|
645
|
+
<BackgroundWrapper
|
|
646
|
+
backgroundImage="https://images.unsplash.com/photo-1506905925346-21bda4d32df4?q=80&w=2940&auto=format&fit=crop"
|
|
647
|
+
overlay
|
|
648
|
+
>
|
|
649
|
+
<div style={{ width: '100%', maxWidth: '1200px' }}>
|
|
650
|
+
<Navbar brand={<LogoBrand />} position="fixed" glass>
|
|
651
|
+
<Nav alignment="end">
|
|
652
|
+
<NavItem href="/" active>
|
|
653
|
+
Home
|
|
654
|
+
</NavItem>
|
|
655
|
+
<NavItem href="/about">About</NavItem>
|
|
656
|
+
<NavItem href="/services">Services</NavItem>
|
|
657
|
+
<NavItem href="/contact">Contact</NavItem>
|
|
658
|
+
</Nav>
|
|
659
|
+
</Navbar>
|
|
660
|
+
</div>
|
|
661
|
+
<div style={{ textAlign: 'center', maxWidth: '800px', paddingTop: '100px' }}>
|
|
662
|
+
<h2
|
|
663
|
+
style={{
|
|
664
|
+
color: 'white',
|
|
665
|
+
fontSize: '32px',
|
|
666
|
+
fontWeight: 600,
|
|
667
|
+
marginBottom: '16px',
|
|
668
|
+
textShadow: '0 2px 10px rgba(0,0,0,0.5)',
|
|
669
|
+
}}
|
|
670
|
+
>
|
|
671
|
+
Glass Navbar
|
|
672
|
+
</h2>
|
|
673
|
+
<p
|
|
674
|
+
style={{
|
|
675
|
+
color: 'rgba(255,255,255,0.9)',
|
|
676
|
+
fontSize: '18px',
|
|
677
|
+
lineHeight: 1.6,
|
|
678
|
+
textShadow: '0 2px 10px rgba(0,0,0,0.5)',
|
|
679
|
+
}}
|
|
680
|
+
>
|
|
681
|
+
A modern navigation bar with glassmorphism effect. Fixed positioning keeps it accessible
|
|
682
|
+
while the transparent glass aesthetic blends beautifully with any background.
|
|
683
|
+
</p>
|
|
684
|
+
</div>
|
|
685
|
+
</BackgroundWrapper>
|
|
686
|
+
),
|
|
687
|
+
parameters: {
|
|
688
|
+
layout: 'fullscreen',
|
|
689
|
+
docs: {
|
|
690
|
+
description: {
|
|
691
|
+
story:
|
|
692
|
+
'Basic glass morphism effect with fixed positioning. The navbar maintains excellent readability while creating a beautiful frosted glass aesthetic that stays at the top of the viewport.',
|
|
693
|
+
},
|
|
694
|
+
},
|
|
695
|
+
},
|
|
696
|
+
};
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Glass with Custom Properties
|
|
700
|
+
*
|
|
701
|
+
* Demonstrates advanced customization of the glass effect with various
|
|
702
|
+
* displacement, blur, and corner radius settings.
|
|
703
|
+
*/
|
|
704
|
+
export const GlassCustom: Story = {
|
|
705
|
+
render: () => (
|
|
706
|
+
<BackgroundWrapper
|
|
707
|
+
backgroundImage="https://images.unsplash.com/photo-1505142468610-359e7d316be0?q=80&w=2940&auto=format&fit=crop"
|
|
708
|
+
overlay
|
|
709
|
+
>
|
|
710
|
+
<div style={{ width: '100%', maxWidth: '1200px' }}>
|
|
711
|
+
<Navbar
|
|
712
|
+
brand={<LogoBrand />}
|
|
713
|
+
position="fixed"
|
|
714
|
+
glass={{
|
|
715
|
+
displacementScale: 100,
|
|
716
|
+
blurAmount: 2.5,
|
|
717
|
+
cornerRadius: 0,
|
|
718
|
+
mode: 'shader',
|
|
719
|
+
}}
|
|
720
|
+
>
|
|
721
|
+
<Nav alignment="end">
|
|
722
|
+
<NavItem href="/" active>
|
|
723
|
+
Home
|
|
724
|
+
</NavItem>
|
|
725
|
+
<NavItem href="/destinations">Destinations</NavItem>
|
|
726
|
+
<NavDropdown title="Explore">
|
|
727
|
+
<Menu>
|
|
728
|
+
<MenuItem href="/beaches" icon={<Icon name="Sun" />}>
|
|
729
|
+
Beaches
|
|
730
|
+
</MenuItem>
|
|
731
|
+
<MenuItem href="/diving" icon={<Icon name="Waves" />}>
|
|
732
|
+
Diving
|
|
733
|
+
</MenuItem>
|
|
734
|
+
<MenuDivider />
|
|
735
|
+
<MenuItem href="/resorts" icon={<Icon name="House" />}>
|
|
736
|
+
Resorts
|
|
737
|
+
</MenuItem>
|
|
738
|
+
</Menu>
|
|
739
|
+
</NavDropdown>
|
|
740
|
+
<NavItem href="/contact">Contact</NavItem>
|
|
741
|
+
</Nav>
|
|
742
|
+
</Navbar>
|
|
743
|
+
</div>
|
|
744
|
+
<div style={{ textAlign: 'center', maxWidth: '800px', paddingTop: '100px' }}>
|
|
745
|
+
<h2
|
|
746
|
+
style={{
|
|
747
|
+
color: 'white',
|
|
748
|
+
fontSize: '32px',
|
|
749
|
+
fontWeight: 600,
|
|
750
|
+
marginBottom: '16px',
|
|
751
|
+
textShadow: '0 2px 10px rgba(0,0,0,0.5)',
|
|
752
|
+
}}
|
|
753
|
+
>
|
|
754
|
+
Custom Glass Properties
|
|
755
|
+
</h2>
|
|
756
|
+
<p
|
|
757
|
+
style={{
|
|
758
|
+
color: 'rgba(255,255,255,0.9)',
|
|
759
|
+
fontSize: '18px',
|
|
760
|
+
lineHeight: 1.6,
|
|
761
|
+
textShadow: '0 2px 10px rgba(0,0,0,0.5)',
|
|
762
|
+
}}
|
|
763
|
+
>
|
|
764
|
+
Enhanced glass effect with custom displacement and blur. Perfect for creating unique
|
|
765
|
+
visual experiences with more pronounced depth and refraction.
|
|
766
|
+
</p>
|
|
767
|
+
</div>
|
|
768
|
+
</BackgroundWrapper>
|
|
769
|
+
),
|
|
770
|
+
parameters: {
|
|
771
|
+
layout: 'fullscreen',
|
|
772
|
+
docs: {
|
|
773
|
+
description: {
|
|
774
|
+
story:
|
|
775
|
+
'Customized glass effect with increased displacement and blur for a more pronounced visual impact. The sharp corners (cornerRadius: 0) create a modern, edge-to-edge aesthetic.',
|
|
776
|
+
},
|
|
777
|
+
},
|
|
778
|
+
},
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Glass with Dropdown & Mega Menu
|
|
783
|
+
*
|
|
784
|
+
* Shows how the glass effect integrates seamlessly with dropdown menus
|
|
785
|
+
* and mega menus, maintaining visual consistency.
|
|
786
|
+
*/
|
|
787
|
+
|
|
788
|
+
export const GlassWithMegaMenu: Story = {
|
|
789
|
+
render: () => (
|
|
790
|
+
<BackgroundWrapper
|
|
791
|
+
backgroundImage="https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?q=80&w=2940&auto=format&fit=crop"
|
|
792
|
+
overlay
|
|
793
|
+
>
|
|
794
|
+
<div style={{ width: '100%', maxWidth: '1200px' }}>
|
|
795
|
+
<Navbar brand={<LogoBrand />} position="fixed" glass>
|
|
796
|
+
<Nav alignment="end">
|
|
797
|
+
<NavItem href="/" active>
|
|
798
|
+
Home
|
|
799
|
+
</NavItem>
|
|
800
|
+
<NavDropdown title="Products" megaMenu>
|
|
801
|
+
<MegaMenu>
|
|
802
|
+
<MegaMenuColumn title="Web Design" icon="icon-lux-circle">
|
|
803
|
+
<MegaMenuLink href="/web/templates">Templates</MegaMenuLink>
|
|
804
|
+
<MegaMenuLink href="/web/themes">Themes</MegaMenuLink>
|
|
805
|
+
<MegaMenuLink href="/web/plugins">Plugins</MegaMenuLink>
|
|
806
|
+
</MegaMenuColumn>
|
|
807
|
+
<MegaMenuColumn title="Development" icon="icon-lux-circle">
|
|
808
|
+
<MegaMenuLink href="/dev/frameworks">Frameworks</MegaMenuLink>
|
|
809
|
+
<MegaMenuLink href="/dev/libraries">Libraries</MegaMenuLink>
|
|
810
|
+
<MegaMenuLink href="/dev/tools">Tools</MegaMenuLink>
|
|
811
|
+
</MegaMenuColumn>
|
|
812
|
+
<MegaMenuColumn title="Marketing" icon="icon-lux-circle">
|
|
813
|
+
<MegaMenuLink href="/marketing/seo">SEO Tools</MegaMenuLink>
|
|
814
|
+
<MegaMenuLink href="/marketing/social">Social Media</MegaMenuLink>
|
|
815
|
+
<MegaMenuLink href="/marketing/analytics">Analytics</MegaMenuLink>
|
|
816
|
+
</MegaMenuColumn>
|
|
817
|
+
</MegaMenu>
|
|
818
|
+
</NavDropdown>
|
|
819
|
+
<NavItem href="/pricing">Pricing</NavItem>
|
|
820
|
+
<NavItem href="/about">About</NavItem>
|
|
821
|
+
</Nav>
|
|
822
|
+
</Navbar>
|
|
823
|
+
</div>
|
|
824
|
+
<div style={{ textAlign: 'center', maxWidth: '800px', paddingTop: '100px' }}>
|
|
825
|
+
<h2
|
|
826
|
+
style={{
|
|
827
|
+
color: 'white',
|
|
828
|
+
fontSize: '32px',
|
|
829
|
+
fontWeight: 600,
|
|
830
|
+
marginBottom: '16px',
|
|
831
|
+
textShadow: '0 2px 10px rgba(0,0,0,0.5)',
|
|
832
|
+
}}
|
|
833
|
+
>
|
|
834
|
+
Glass with Mega Menu
|
|
835
|
+
</h2>
|
|
836
|
+
<p
|
|
837
|
+
style={{
|
|
838
|
+
color: 'rgba(255,255,255,0.9)',
|
|
839
|
+
fontSize: '18px',
|
|
840
|
+
lineHeight: 1.6,
|
|
841
|
+
textShadow: '0 2px 10px rgba(0,0,0,0.5)',
|
|
842
|
+
}}
|
|
843
|
+
>
|
|
844
|
+
The glass effect seamlessly extends to mega menu dropdowns, creating a cohesive visual
|
|
845
|
+
experience perfect for e-commerce and content-rich websites.
|
|
846
|
+
</p>
|
|
847
|
+
</div>
|
|
848
|
+
</BackgroundWrapper>
|
|
849
|
+
),
|
|
850
|
+
parameters: {
|
|
851
|
+
layout: 'fullscreen',
|
|
852
|
+
docs: {
|
|
853
|
+
description: {
|
|
854
|
+
story:
|
|
855
|
+
'Glass navbar with integrated mega menu. The glass effect maintains consistency throughout complex navigation structures, providing a polished and professional appearance.',
|
|
856
|
+
},
|
|
857
|
+
},
|
|
858
|
+
},
|
|
859
|
+
};
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Glass Theme Variations
|
|
863
|
+
*
|
|
864
|
+
* A comprehensive showcase of glass navbar across different themed
|
|
865
|
+
* backgrounds, demonstrating versatility and variant support.
|
|
866
|
+
*/
|
|
867
|
+
export const GlassThemeShowcase: Story = {
|
|
868
|
+
render: () => (
|
|
869
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '3rem' }}>
|
|
870
|
+
{/* Nature Theme */}
|
|
871
|
+
<BackgroundWrapper
|
|
872
|
+
backgroundImage="https://images.unsplash.com/photo-1469474968028-56623f02e42e?q=80&w=2940&auto=format&fit=crop"
|
|
873
|
+
height="70vh"
|
|
874
|
+
>
|
|
875
|
+
<div style={{ width: '100%', maxWidth: '1200px' }}>
|
|
876
|
+
<Navbar brand={<LogoBrand />} position="fixed" glass>
|
|
877
|
+
<Nav alignment="end">
|
|
878
|
+
<NavItem href="/" active>
|
|
879
|
+
Home
|
|
880
|
+
</NavItem>
|
|
881
|
+
<NavItem href="/explore">Explore</NavItem>
|
|
882
|
+
<NavItem href="/adventures">Adventures</NavItem>
|
|
883
|
+
<NavItem href="/contact">Contact</NavItem>
|
|
884
|
+
</Nav>
|
|
885
|
+
</Navbar>
|
|
886
|
+
</div>
|
|
887
|
+
<div style={{ paddingTop: '100px', textAlign: 'center' }}>
|
|
888
|
+
<h3
|
|
889
|
+
style={{
|
|
890
|
+
color: 'white',
|
|
891
|
+
fontSize: '24px',
|
|
892
|
+
fontWeight: 600,
|
|
893
|
+
textShadow: '0 2px 10px rgba(0,0,0,0.5)',
|
|
894
|
+
}}
|
|
895
|
+
>
|
|
896
|
+
Nature & Adventure Theme
|
|
897
|
+
</h3>
|
|
898
|
+
</div>
|
|
899
|
+
</BackgroundWrapper>
|
|
900
|
+
|
|
901
|
+
{/* Urban Theme - Dark Variant */}
|
|
902
|
+
<BackgroundWrapper
|
|
903
|
+
backgroundImage="https://images.unsplash.com/photo-1514565131-fce0801e5785?q=80&w=2940&auto=format&fit=crop"
|
|
904
|
+
height="70vh"
|
|
905
|
+
>
|
|
906
|
+
<div style={{ width: '100%', maxWidth: '1200px' }}>
|
|
907
|
+
<Navbar brand={<LogoBrand />} position="fixed" variant="dark" glass>
|
|
908
|
+
<Nav alignment="end">
|
|
909
|
+
<NavItem href="/" active>
|
|
910
|
+
Home
|
|
911
|
+
</NavItem>
|
|
912
|
+
<NavItem href="/portfolio">Portfolio</NavItem>
|
|
913
|
+
<NavItem href="/services">Services</NavItem>
|
|
914
|
+
<NavItem href="/blog">Blog</NavItem>
|
|
915
|
+
</Nav>
|
|
916
|
+
</Navbar>
|
|
917
|
+
</div>
|
|
918
|
+
<div style={{ paddingTop: '100px', textAlign: 'center' }}>
|
|
919
|
+
<h3
|
|
920
|
+
style={{
|
|
921
|
+
color: 'white',
|
|
922
|
+
fontSize: '24px',
|
|
923
|
+
fontWeight: 600,
|
|
924
|
+
textShadow: '0 2px 10px rgba(0,0,0,0.5)',
|
|
925
|
+
}}
|
|
926
|
+
>
|
|
927
|
+
Modern & Professional Theme
|
|
928
|
+
</h3>
|
|
929
|
+
</div>
|
|
930
|
+
</BackgroundWrapper>
|
|
931
|
+
|
|
932
|
+
{/* Sunset Theme */}
|
|
933
|
+
<BackgroundWrapper
|
|
934
|
+
backgroundImage="https://images.unsplash.com/photo-1495616811223-4d98c6e9c869?q=80&w=2940&auto=format&fit=crop"
|
|
935
|
+
height="70vh"
|
|
936
|
+
>
|
|
937
|
+
<div style={{ width: '100%', maxWidth: '1200px' }}>
|
|
938
|
+
<Navbar
|
|
939
|
+
brand={<LogoBrand />}
|
|
940
|
+
position="fixed"
|
|
941
|
+
glass={{
|
|
942
|
+
displacementScale: 60,
|
|
943
|
+
blurAmount: 2,
|
|
944
|
+
cornerRadius: 0,
|
|
945
|
+
mode: 'shader',
|
|
946
|
+
}}
|
|
947
|
+
>
|
|
948
|
+
<Nav alignment="end">
|
|
949
|
+
<NavItem href="/" active>
|
|
950
|
+
Home
|
|
951
|
+
</NavItem>
|
|
952
|
+
<NavItem href="/destinations">Destinations</NavItem>
|
|
953
|
+
<NavItem href="/experiences">Experiences</NavItem>
|
|
954
|
+
<NavItem href="/booking">Book Now</NavItem>
|
|
955
|
+
</Nav>
|
|
956
|
+
</Navbar>
|
|
957
|
+
</div>
|
|
958
|
+
<div style={{ paddingTop: '100px', textAlign: 'center' }}>
|
|
959
|
+
<h3
|
|
960
|
+
style={{
|
|
961
|
+
color: 'white',
|
|
962
|
+
fontSize: '24px',
|
|
963
|
+
fontWeight: 600,
|
|
964
|
+
textShadow: '0 2px 10px rgba(0,0,0,0.5)',
|
|
965
|
+
}}
|
|
966
|
+
>
|
|
967
|
+
Travel & Hospitality Theme
|
|
968
|
+
</h3>
|
|
969
|
+
</div>
|
|
970
|
+
</BackgroundWrapper>
|
|
971
|
+
</div>
|
|
972
|
+
),
|
|
973
|
+
parameters: {
|
|
974
|
+
layout: 'fullscreen',
|
|
975
|
+
docs: {
|
|
976
|
+
description: {
|
|
977
|
+
story:
|
|
978
|
+
'A comprehensive showcase demonstrating how glass navbar adapts to different themes, color palettes, and content types. Each example represents a distinct use case with appropriate styling.',
|
|
979
|
+
},
|
|
980
|
+
},
|
|
981
|
+
},
|
|
982
|
+
};
|
|
@@ -2,6 +2,7 @@ import React, { useState, useEffect, useRef, forwardRef } from 'react';
|
|
|
2
2
|
import { NavbarProps } from '../../../lib/types/components';
|
|
3
3
|
import { useNavbar } from '../../../lib/composables/useNavbar';
|
|
4
4
|
import { NAVBAR } from '../../../lib/constants/components';
|
|
5
|
+
import { AtomixGlass } from '../../AtomixGlass/AtomixGlass';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Navbar component provides a responsive navigation header with brand, navigation items,
|
|
@@ -35,6 +36,7 @@ export const Navbar = forwardRef<HTMLElement, NavbarProps>(
|
|
|
35
36
|
closeOnEscape = true,
|
|
36
37
|
ariaLabel = 'Main navigation',
|
|
37
38
|
id,
|
|
39
|
+
glass,
|
|
38
40
|
},
|
|
39
41
|
ref
|
|
40
42
|
) => {
|
|
@@ -108,36 +110,72 @@ export const Navbar = forwardRef<HTMLElement, NavbarProps>(
|
|
|
108
110
|
}
|
|
109
111
|
};
|
|
110
112
|
|
|
113
|
+
const navbarContent = (
|
|
114
|
+
<div className="c-navbar__container" style={containerStyle}>
|
|
115
|
+
{brand &&
|
|
116
|
+
(typeof brand === 'string' ? (
|
|
117
|
+
<a href="/" className="c-navbar__brand">
|
|
118
|
+
{brand}
|
|
119
|
+
</a>
|
|
120
|
+
) : (
|
|
121
|
+
<div className="c-navbar__brand">{brand}</div>
|
|
122
|
+
))}
|
|
123
|
+
|
|
124
|
+
{collapsible && (
|
|
125
|
+
<button
|
|
126
|
+
className="c-navbar__toggler"
|
|
127
|
+
onClick={handleToggleClick}
|
|
128
|
+
aria-expanded={navbarExpanded}
|
|
129
|
+
aria-label="Toggle navigation"
|
|
130
|
+
aria-controls="navbar-collapse"
|
|
131
|
+
disabled={disabled}
|
|
132
|
+
type="button"
|
|
133
|
+
>
|
|
134
|
+
<span className="c-navbar__toggler-icon"></span>
|
|
135
|
+
</button>
|
|
136
|
+
)}
|
|
137
|
+
|
|
138
|
+
<div id="navbar-collapse" className={collapseClass} ref={collapseRef}>
|
|
139
|
+
{children}
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
if (glass) {
|
|
145
|
+
const defaultGlassProps = {
|
|
146
|
+
displacementScale: 30,
|
|
147
|
+
blurAmount: 2,
|
|
148
|
+
cornerRadius: 0,
|
|
149
|
+
elasticity: 0,
|
|
150
|
+
mode: 'shader' as const,
|
|
151
|
+
shaderVariant: 'premiumGlass' as const,
|
|
152
|
+
};
|
|
153
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
154
|
+
return (
|
|
155
|
+
<AtomixGlass
|
|
156
|
+
{...glassProps}
|
|
157
|
+
style={{
|
|
158
|
+
...(position === 'fixed' && { position: 'fixed' }),
|
|
159
|
+
left: 0,
|
|
160
|
+
right: 0,
|
|
161
|
+
top: 0,
|
|
162
|
+
}}
|
|
163
|
+
>
|
|
164
|
+
<nav
|
|
165
|
+
ref={ref}
|
|
166
|
+
className={navbarClass + ' c-navbar--glass'}
|
|
167
|
+
aria-label={ariaLabel}
|
|
168
|
+
id={id}
|
|
169
|
+
>
|
|
170
|
+
{navbarContent}
|
|
171
|
+
</nav>
|
|
172
|
+
</AtomixGlass>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
111
176
|
return (
|
|
112
177
|
<nav ref={ref} className={navbarClass} aria-label={ariaLabel} id={id}>
|
|
113
|
-
|
|
114
|
-
{brand &&
|
|
115
|
-
(typeof brand === 'string' ? (
|
|
116
|
-
<a href="/" className="c-navbar__brand">
|
|
117
|
-
{brand}
|
|
118
|
-
</a>
|
|
119
|
-
) : (
|
|
120
|
-
<div className="c-navbar__brand">{brand}</div>
|
|
121
|
-
))}
|
|
122
|
-
|
|
123
|
-
{collapsible && (
|
|
124
|
-
<button
|
|
125
|
-
className="c-navbar__toggler"
|
|
126
|
-
onClick={handleToggleClick}
|
|
127
|
-
aria-expanded={navbarExpanded}
|
|
128
|
-
aria-label="Toggle navigation"
|
|
129
|
-
aria-controls="navbar-collapse"
|
|
130
|
-
disabled={disabled}
|
|
131
|
-
type="button"
|
|
132
|
-
>
|
|
133
|
-
<span className="c-navbar__toggler-icon"></span>
|
|
134
|
-
</button>
|
|
135
|
-
)}
|
|
136
|
-
|
|
137
|
-
<div id="navbar-collapse" className={collapseClass} ref={collapseRef}>
|
|
138
|
-
{children}
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
178
|
+
{navbarContent}
|
|
141
179
|
</nav>
|
|
142
180
|
);
|
|
143
181
|
}
|