@digital-b2c/coreui-kit 0.12.0 → 0.13.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.
package/dist/index.d.cts CHANGED
@@ -117,7 +117,7 @@ interface BrandsStripProps {
117
117
 
118
118
  declare const BrandsStrip: ({ className, variant, title, logos, cta, size, }: BrandsStripProps) => react_jsx_runtime.JSX.Element;
119
119
 
120
- declare const ButtonVariantReadOnly: readonly ["primary", "secondary", "ghost", "nofill", "grey", "nofillblack", "shiny", "tabbutton"];
120
+ declare const ButtonVariantReadOnly: readonly ["primary", "secondary", "ghost", "nofill", "grey", "nofillblack", "shiny", "tabbutton", "navnofillblack"];
121
121
  type TButtonVariant = (typeof ButtonVariantReadOnly)[number];
122
122
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
123
123
  variant?: TButtonVariant;
@@ -626,6 +626,34 @@ declare const MiniSectionCta: (({ className, variant, theme, title, subtitle, ct
626
626
  Subtitle: ({ children }: MiniSectionCtaSubtitleProps) => react_jsx_runtime.JSX.Element;
627
627
  };
628
628
 
629
+ interface BaseNavItem {
630
+ title: string;
631
+ description: string;
632
+ }
633
+ interface NavLink {
634
+ type: 'link';
635
+ cta?: ICta;
636
+ }
637
+ interface NavDropdown extends BaseNavItem {
638
+ type: 'dropdown';
639
+ items: NavItem[];
640
+ cta?: ICta;
641
+ }
642
+ type NavItem = NavLink | NavDropdown;
643
+ interface NavigationProps {
644
+ className?: string;
645
+ variant?: 'transparent';
646
+ mainLogo?: string;
647
+ homeCta?: string;
648
+ loginCta?: ICta;
649
+ rightButton?: ICta;
650
+ navigationItems?: {
651
+ items: NavItem[];
652
+ };
653
+ }
654
+
655
+ declare const Navigation: (props: NavigationProps) => react_jsx_runtime.JSX.Element;
656
+
629
657
  type PracticePathCardsFooterProps = {
630
658
  children: ReactNode;
631
659
  };
@@ -934,6 +962,8 @@ type IntersectionObserverResult<T extends Element> = {
934
962
  };
935
963
  declare function useIntersectionObserver<T extends Element = Element>({ animateOnce, options, }?: UseIntersectionObserverProps): IntersectionObserverResult<T>;
936
964
 
965
+ declare const useIsAtTop: () => boolean;
966
+
937
967
  type SlotComponent = React.ComponentType<any>;
938
968
  type SlotMap = Record<string, SlotComponent>;
939
969
  /**
@@ -943,4 +973,4 @@ type SlotMap = Record<string, SlotComponent>;
943
973
  */
944
974
  declare function resolveCompoundSlots(children: ReactNode, slots: SlotMap): Record<string, ReactNode>;
945
975
 
946
- export { Anchor, type AnchorProps, Badge, type BadgeProps, BlogCardGrid, type BlogCardGridProps, BlogPost, BlogPostContent, type BlogPostContentProps, type BlogPostProps, BlogSearchResultsList, type BlogSearchResultsListProps, BrandsStrip, type BrandsStripProps, Button, type ButtonProps, Card, CardCollection, type CardCollectionProps, type CardProps, ConditionalWrapper, type ConditionalWrapperProps, ContactModule, type ContactModuleProps, Container, type ContainerProps, CountingCard, type CountingCardProps, EventList, type EventListProps, FeaturedNewsHighlights, type FeaturedNewsHighlightsProps, FilterBar, type FilterBarProps, type FilterOption, Footer, type FooterProps, GlobalSearchResultsList, type GlobalSearchResultsListProps, type GridItemProps, type GridProps, HeroBanner, HeroBannerCarousel, type HeroBannerCarouselProps, type HeroBannerProps, type ICta, type ICtaHoverLogo, type ICtaIcon, type ICtaLogo, type IFooterSupportGroup, type IPicture, Icon, type IconType, InfoCard, type InfoCardProps, Input, type InputProps, InternalBrandsTab, type InternalBrandsTabProps, MiniBanner, type MiniBannerProps, MiniSectionCta, type MiniSectionCtaProps, NewsCard, NewsCardList, type NewsCardListProps, type NewsCardProps, Pagination, type PaginationProps, Picture, type PictureProps, PracticeCard, type PracticeCardProps, PracticePathCards, type PracticePathCardsProps, ResourceCardItem, type ResourceCardItemProps, type ResourceItem, type ResourceItemType, type ResourceView, ResourcesGridList, type ResourcesGridListProps, Sidebar, type SidebarCategory, type SidebarProps, type SortOption, Teaser5050With3Text, type Teaser5050With3TextProps, Teaser5050WithCta, type Teaser5050WithCtaProps, TextBody, type TextBodyProps, TextCenterCtaInBottom, type TextCenterCtaInBottomProps, TextEvent, type TextEventProps, UpcomingEventCard, type UpcomingEventCardProps, resolveCompoundSlots, svgs, useIntersectionObserver };
976
+ export { Anchor, type AnchorProps, Badge, type BadgeProps, BlogCardGrid, type BlogCardGridProps, BlogPost, BlogPostContent, type BlogPostContentProps, type BlogPostProps, BlogSearchResultsList, type BlogSearchResultsListProps, BrandsStrip, type BrandsStripProps, Button, type ButtonProps, Card, CardCollection, type CardCollectionProps, type CardProps, ConditionalWrapper, type ConditionalWrapperProps, ContactModule, type ContactModuleProps, Container, type ContainerProps, CountingCard, type CountingCardProps, EventList, type EventListProps, FeaturedNewsHighlights, type FeaturedNewsHighlightsProps, FilterBar, type FilterBarProps, type FilterOption, Footer, type FooterProps, GlobalSearchResultsList, type GlobalSearchResultsListProps, type GridItemProps, type GridProps, HeroBanner, HeroBannerCarousel, type HeroBannerCarouselProps, type HeroBannerProps, type ICta, type ICtaHoverLogo, type ICtaIcon, type ICtaLogo, type IFooterSupportGroup, type IPicture, Icon, type IconType, InfoCard, type InfoCardProps, Input, type InputProps, InternalBrandsTab, type InternalBrandsTabProps, MiniBanner, type MiniBannerProps, MiniSectionCta, type MiniSectionCtaProps, Navigation, type NavigationProps, NewsCard, NewsCardList, type NewsCardListProps, type NewsCardProps, Pagination, type PaginationProps, Picture, type PictureProps, PracticeCard, type PracticeCardProps, PracticePathCards, type PracticePathCardsProps, ResourceCardItem, type ResourceCardItemProps, type ResourceItem, type ResourceItemType, type ResourceView, ResourcesGridList, type ResourcesGridListProps, Sidebar, type SidebarCategory, type SidebarProps, type SortOption, type TButtonVariant, Teaser5050With3Text, type Teaser5050With3TextProps, Teaser5050WithCta, type Teaser5050WithCtaProps, TextBody, type TextBodyProps, TextCenterCtaInBottom, type TextCenterCtaInBottomProps, TextEvent, type TextEventProps, UpcomingEventCard, type UpcomingEventCardProps, resolveCompoundSlots, svgs, useIntersectionObserver, useIsAtTop };
package/dist/index.d.ts CHANGED
@@ -117,7 +117,7 @@ interface BrandsStripProps {
117
117
 
118
118
  declare const BrandsStrip: ({ className, variant, title, logos, cta, size, }: BrandsStripProps) => react_jsx_runtime.JSX.Element;
119
119
 
120
- declare const ButtonVariantReadOnly: readonly ["primary", "secondary", "ghost", "nofill", "grey", "nofillblack", "shiny", "tabbutton"];
120
+ declare const ButtonVariantReadOnly: readonly ["primary", "secondary", "ghost", "nofill", "grey", "nofillblack", "shiny", "tabbutton", "navnofillblack"];
121
121
  type TButtonVariant = (typeof ButtonVariantReadOnly)[number];
122
122
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
123
123
  variant?: TButtonVariant;
@@ -626,6 +626,34 @@ declare const MiniSectionCta: (({ className, variant, theme, title, subtitle, ct
626
626
  Subtitle: ({ children }: MiniSectionCtaSubtitleProps) => react_jsx_runtime.JSX.Element;
627
627
  };
628
628
 
629
+ interface BaseNavItem {
630
+ title: string;
631
+ description: string;
632
+ }
633
+ interface NavLink {
634
+ type: 'link';
635
+ cta?: ICta;
636
+ }
637
+ interface NavDropdown extends BaseNavItem {
638
+ type: 'dropdown';
639
+ items: NavItem[];
640
+ cta?: ICta;
641
+ }
642
+ type NavItem = NavLink | NavDropdown;
643
+ interface NavigationProps {
644
+ className?: string;
645
+ variant?: 'transparent';
646
+ mainLogo?: string;
647
+ homeCta?: string;
648
+ loginCta?: ICta;
649
+ rightButton?: ICta;
650
+ navigationItems?: {
651
+ items: NavItem[];
652
+ };
653
+ }
654
+
655
+ declare const Navigation: (props: NavigationProps) => react_jsx_runtime.JSX.Element;
656
+
629
657
  type PracticePathCardsFooterProps = {
630
658
  children: ReactNode;
631
659
  };
@@ -934,6 +962,8 @@ type IntersectionObserverResult<T extends Element> = {
934
962
  };
935
963
  declare function useIntersectionObserver<T extends Element = Element>({ animateOnce, options, }?: UseIntersectionObserverProps): IntersectionObserverResult<T>;
936
964
 
965
+ declare const useIsAtTop: () => boolean;
966
+
937
967
  type SlotComponent = React.ComponentType<any>;
938
968
  type SlotMap = Record<string, SlotComponent>;
939
969
  /**
@@ -943,4 +973,4 @@ type SlotMap = Record<string, SlotComponent>;
943
973
  */
944
974
  declare function resolveCompoundSlots(children: ReactNode, slots: SlotMap): Record<string, ReactNode>;
945
975
 
946
- export { Anchor, type AnchorProps, Badge, type BadgeProps, BlogCardGrid, type BlogCardGridProps, BlogPost, BlogPostContent, type BlogPostContentProps, type BlogPostProps, BlogSearchResultsList, type BlogSearchResultsListProps, BrandsStrip, type BrandsStripProps, Button, type ButtonProps, Card, CardCollection, type CardCollectionProps, type CardProps, ConditionalWrapper, type ConditionalWrapperProps, ContactModule, type ContactModuleProps, Container, type ContainerProps, CountingCard, type CountingCardProps, EventList, type EventListProps, FeaturedNewsHighlights, type FeaturedNewsHighlightsProps, FilterBar, type FilterBarProps, type FilterOption, Footer, type FooterProps, GlobalSearchResultsList, type GlobalSearchResultsListProps, type GridItemProps, type GridProps, HeroBanner, HeroBannerCarousel, type HeroBannerCarouselProps, type HeroBannerProps, type ICta, type ICtaHoverLogo, type ICtaIcon, type ICtaLogo, type IFooterSupportGroup, type IPicture, Icon, type IconType, InfoCard, type InfoCardProps, Input, type InputProps, InternalBrandsTab, type InternalBrandsTabProps, MiniBanner, type MiniBannerProps, MiniSectionCta, type MiniSectionCtaProps, NewsCard, NewsCardList, type NewsCardListProps, type NewsCardProps, Pagination, type PaginationProps, Picture, type PictureProps, PracticeCard, type PracticeCardProps, PracticePathCards, type PracticePathCardsProps, ResourceCardItem, type ResourceCardItemProps, type ResourceItem, type ResourceItemType, type ResourceView, ResourcesGridList, type ResourcesGridListProps, Sidebar, type SidebarCategory, type SidebarProps, type SortOption, Teaser5050With3Text, type Teaser5050With3TextProps, Teaser5050WithCta, type Teaser5050WithCtaProps, TextBody, type TextBodyProps, TextCenterCtaInBottom, type TextCenterCtaInBottomProps, TextEvent, type TextEventProps, UpcomingEventCard, type UpcomingEventCardProps, resolveCompoundSlots, svgs, useIntersectionObserver };
976
+ export { Anchor, type AnchorProps, Badge, type BadgeProps, BlogCardGrid, type BlogCardGridProps, BlogPost, BlogPostContent, type BlogPostContentProps, type BlogPostProps, BlogSearchResultsList, type BlogSearchResultsListProps, BrandsStrip, type BrandsStripProps, Button, type ButtonProps, Card, CardCollection, type CardCollectionProps, type CardProps, ConditionalWrapper, type ConditionalWrapperProps, ContactModule, type ContactModuleProps, Container, type ContainerProps, CountingCard, type CountingCardProps, EventList, type EventListProps, FeaturedNewsHighlights, type FeaturedNewsHighlightsProps, FilterBar, type FilterBarProps, type FilterOption, Footer, type FooterProps, GlobalSearchResultsList, type GlobalSearchResultsListProps, type GridItemProps, type GridProps, HeroBanner, HeroBannerCarousel, type HeroBannerCarouselProps, type HeroBannerProps, type ICta, type ICtaHoverLogo, type ICtaIcon, type ICtaLogo, type IFooterSupportGroup, type IPicture, Icon, type IconType, InfoCard, type InfoCardProps, Input, type InputProps, InternalBrandsTab, type InternalBrandsTabProps, MiniBanner, type MiniBannerProps, MiniSectionCta, type MiniSectionCtaProps, Navigation, type NavigationProps, NewsCard, NewsCardList, type NewsCardListProps, type NewsCardProps, Pagination, type PaginationProps, Picture, type PictureProps, PracticeCard, type PracticeCardProps, PracticePathCards, type PracticePathCardsProps, ResourceCardItem, type ResourceCardItemProps, type ResourceItem, type ResourceItemType, type ResourceView, ResourcesGridList, type ResourcesGridListProps, Sidebar, type SidebarCategory, type SidebarProps, type SortOption, type TButtonVariant, Teaser5050With3Text, type Teaser5050With3TextProps, Teaser5050WithCta, type Teaser5050WithCtaProps, TextBody, type TextBodyProps, TextCenterCtaInBottom, type TextCenterCtaInBottomProps, TextEvent, type TextEventProps, UpcomingEventCard, type UpcomingEventCardProps, resolveCompoundSlots, svgs, useIntersectionObserver, useIsAtTop };
package/dist/index.mjs CHANGED
@@ -397,11 +397,12 @@ var Button_module_default = {
397
397
  ghost: "Button_module_ghost",
398
398
  nofill: "Button_module_nofill",
399
399
  nofillblack: "Button_module_nofillblack",
400
+ navnofillblack: "Button_module_navnofillblack",
401
+ active: "Button_module_active",
400
402
  grey: "Button_module_grey",
401
403
  shiny: "Button_module_shiny",
402
404
  rotateGradient: "Button_module_rotateGradient",
403
405
  tabbutton: "Button_module_tabbutton",
404
- active: "Button_module_active",
405
406
  icon: "Button_module_icon",
406
407
  logo: "Button_module_logo"
407
408
  };
@@ -2791,6 +2792,424 @@ var MiniSectionCta2 = Object.assign(MiniSectionCta, {
2791
2792
  Title: MiniSectionCtaTitle,
2792
2793
  Subtitle: MiniSectionCtaSubtitle
2793
2794
  });
2795
+ function useIntersectionObserver({
2796
+ animateOnce = false,
2797
+ options = {}
2798
+ } = {}) {
2799
+ const observeRef = useRef(null);
2800
+ const [isVisible, setIsVisible] = useState(false);
2801
+ if (typeof IntersectionObserver === "undefined") {
2802
+ console.warn("IntersectionObserver is not supported in this browser.");
2803
+ return { observeRef, isVisible: true };
2804
+ }
2805
+ useEffect(() => {
2806
+ const currentRef = observeRef.current;
2807
+ if (!currentRef) return;
2808
+ const observer = new IntersectionObserver((entries) => {
2809
+ const entry = entries[0];
2810
+ if (!entry) return;
2811
+ setIsVisible(entry.isIntersecting);
2812
+ if (entry.isIntersecting && animateOnce) {
2813
+ observer.disconnect();
2814
+ }
2815
+ }, options);
2816
+ observer.observe(currentRef);
2817
+ return () => {
2818
+ observer.disconnect();
2819
+ };
2820
+ }, [observeRef, animateOnce, options]);
2821
+ return { observeRef, isVisible };
2822
+ }
2823
+ var useIsAtTop = () => {
2824
+ const [isAtTop, setIsAtTop] = useState(true);
2825
+ useEffect(() => {
2826
+ const handleScroll = () => setIsAtTop(window.scrollY === 0);
2827
+ window.addEventListener("scroll", handleScroll, { passive: true });
2828
+ return () => window.removeEventListener("scroll", handleScroll);
2829
+ }, []);
2830
+ return isAtTop;
2831
+ };
2832
+
2833
+ // src/widgets/Navigation/Navigation.module.scss
2834
+ var Navigation_module_default = {
2835
+ dropdownTitle: "Navigation_module_dropdownTitle",
2836
+ dropdownLink: "Navigation_module_dropdownLink",
2837
+ dropdownDescription: "Navigation_module_dropdownDescription",
2838
+ mobileItemLink: "Navigation_module_mobileItemLink",
2839
+ mobileItemTrigger: "Navigation_module_mobileItemTrigger",
2840
+ mobileSubLink: "Navigation_module_mobileSubLink",
2841
+ navigationWrapper: "Navigation_module_navigationWrapper",
2842
+ dropdownOpen: "Navigation_module_dropdownOpen",
2843
+ variantTransparent: "Navigation_module_variantTransparent",
2844
+ transparent: "Navigation_module_transparent",
2845
+ navigation: "Navigation_module_navigation",
2846
+ upperNav: "Navigation_module_upperNav",
2847
+ mainLogo: "Navigation_module_mainLogo",
2848
+ mainLogoLink: "Navigation_module_mainLogoLink",
2849
+ upperRight: "Navigation_module_upperRight",
2850
+ lowerNav: "Navigation_module_lowerNav",
2851
+ lowerNavItem: "Navigation_module_lowerNavItem",
2852
+ overlay: "Navigation_module_overlay",
2853
+ dropdownTrigger: "Navigation_module_dropdownTrigger",
2854
+ dropdownTriggerOpen: "Navigation_module_dropdownTriggerOpen",
2855
+ dropdownPanel: "Navigation_module_dropdownPanel",
2856
+ dropdownPanelOpen: "Navigation_module_dropdownPanelOpen",
2857
+ dropdownInner: "Navigation_module_dropdownInner",
2858
+ dropdownLinks: "Navigation_module_dropdownLinks",
2859
+ dropdownLinkContainer: "Navigation_module_dropdownLinkContainer",
2860
+ dropdownInfo: "Navigation_module_dropdownInfo",
2861
+ mainLogoMobile: "Navigation_module_mainLogoMobile",
2862
+ hamburgerButton: "Navigation_module_hamburgerButton",
2863
+ mobileMenu: "Navigation_module_mobileMenu",
2864
+ mobileMenuOpen: "Navigation_module_mobileMenuOpen",
2865
+ mobileMenuHeader: "Navigation_module_mobileMenuHeader",
2866
+ mobileMenuItems: "Navigation_module_mobileMenuItems",
2867
+ mobileItem: "Navigation_module_mobileItem",
2868
+ mobileItemChevron: "Navigation_module_mobileItemChevron",
2869
+ mobileItemChevronOpen: "Navigation_module_mobileItemChevronOpen",
2870
+ mobileSubItems: "Navigation_module_mobileSubItems",
2871
+ mobileSubItemsOpen: "Navigation_module_mobileSubItemsOpen",
2872
+ mobileSubItemsInner: "Navigation_module_mobileSubItemsInner",
2873
+ mobileMenuCtas: "Navigation_module_mobileMenuCtas"
2874
+ };
2875
+ var NavigationDesktop = ({
2876
+ navigationItems,
2877
+ isTransparent,
2878
+ onDropdownOpenChange
2879
+ }) => {
2880
+ var _a;
2881
+ const [activeDropdown, setActiveDropdown] = useState(null);
2882
+ const closeTimer = useRef(null);
2883
+ const dropdownWrapperRefs = useRef([]);
2884
+ const baseId = useId();
2885
+ const setDropdown = (index) => {
2886
+ setActiveDropdown(index);
2887
+ onDropdownOpenChange == null ? void 0 : onDropdownOpenChange(index !== null);
2888
+ };
2889
+ const handleDropdownEnter = (index) => {
2890
+ if (closeTimer.current) clearTimeout(closeTimer.current);
2891
+ setDropdown(index);
2892
+ };
2893
+ const handleDropdownLeave = () => {
2894
+ closeTimer.current = setTimeout(() => setDropdown(null), 100);
2895
+ };
2896
+ const handleDropdownBlur = (e, index) => {
2897
+ if (!e.currentTarget.contains(e.relatedTarget)) {
2898
+ if (activeDropdown === index) setDropdown(null);
2899
+ }
2900
+ };
2901
+ const handleTriggerKeyDown = (e, index) => {
2902
+ if (e.key === "Escape") {
2903
+ setDropdown(null);
2904
+ } else if ((e.key === "Enter" || e.key === " ") && activeDropdown !== index) {
2905
+ e.preventDefault();
2906
+ setDropdown(index);
2907
+ }
2908
+ };
2909
+ const handleDropdownKeyDown = (e, index) => {
2910
+ var _a2, _b;
2911
+ if (e.key === "Escape") {
2912
+ setDropdown(null);
2913
+ (_b = (_a2 = dropdownWrapperRefs.current[index]) == null ? void 0 : _a2.querySelector("button")) == null ? void 0 : _b.focus();
2914
+ }
2915
+ };
2916
+ if (!((_a = navigationItems == null ? void 0 : navigationItems.items) == null ? void 0 : _a.length)) return null;
2917
+ return /* @__PURE__ */ jsx("ul", { className: Navigation_module_default.lowerNav, children: navigationItems.items.map((item, index) => {
2918
+ var _a2, _b, _c;
2919
+ const panelId = `${baseId}-panel-${index}`;
2920
+ const isOpen = activeDropdown === index;
2921
+ return item.type === "dropdown" ? /* @__PURE__ */ jsxs(
2922
+ "li",
2923
+ {
2924
+ className: Navigation_module_default.lowerNavItem,
2925
+ ref: (el) => {
2926
+ dropdownWrapperRefs.current[index] = el;
2927
+ },
2928
+ onBlur: (e) => handleDropdownBlur(e, index),
2929
+ children: [
2930
+ /* @__PURE__ */ jsx(
2931
+ Button,
2932
+ {
2933
+ variant: "navnofillblack",
2934
+ className: clsx16(Navigation_module_default.dropdownTrigger, { [Navigation_module_default.dropdownTriggerOpen]: isOpen }),
2935
+ icon: isTransparent ? "downChevronWhite" : "downChevronBlack",
2936
+ isActive: isOpen,
2937
+ "aria-expanded": isOpen,
2938
+ "aria-haspopup": "true",
2939
+ "aria-controls": panelId,
2940
+ onMouseEnter: () => handleDropdownEnter(index),
2941
+ onMouseLeave: handleDropdownLeave,
2942
+ onClick: () => setDropdown(isOpen ? null : index),
2943
+ onKeyDown: (e) => handleTriggerKeyDown(e, index),
2944
+ children: item.title
2945
+ }
2946
+ ),
2947
+ /* @__PURE__ */ jsx(
2948
+ "div",
2949
+ {
2950
+ id: panelId,
2951
+ className: clsx16(Navigation_module_default.dropdownPanel, { [Navigation_module_default.dropdownPanelOpen]: isOpen }),
2952
+ "aria-hidden": !isOpen,
2953
+ onMouseEnter: () => handleDropdownEnter(index),
2954
+ onMouseLeave: handleDropdownLeave,
2955
+ onKeyDown: (e) => handleDropdownKeyDown(e, index),
2956
+ children: /* @__PURE__ */ jsxs("div", { className: Navigation_module_default.dropdownInner, children: [
2957
+ /* @__PURE__ */ jsx("ul", { className: Navigation_module_default.dropdownLinks, children: item.items.map(
2958
+ (subItem, i) => {
2959
+ var _a3, _b2;
2960
+ return subItem.type === "link" ? /* @__PURE__ */ jsx("li", { className: Navigation_module_default.dropdownLinkContainer, children: /* @__PURE__ */ jsx(
2961
+ "a",
2962
+ {
2963
+ href: (_a3 = subItem.cta) == null ? void 0 : _a3.url,
2964
+ className: Navigation_module_default.dropdownLink,
2965
+ tabIndex: isOpen ? void 0 : -1,
2966
+ children: (_b2 = subItem.cta) == null ? void 0 : _b2.label
2967
+ }
2968
+ ) }, i) : null;
2969
+ }
2970
+ ) }),
2971
+ /* @__PURE__ */ jsxs("div", { className: Navigation_module_default.dropdownInfo, children: [
2972
+ /* @__PURE__ */ jsx("h3", { className: Navigation_module_default.dropdownTitle, children: item.title }),
2973
+ /* @__PURE__ */ jsx("p", { className: Navigation_module_default.dropdownDescription, children: item.description })
2974
+ ] })
2975
+ ] })
2976
+ }
2977
+ )
2978
+ ]
2979
+ },
2980
+ index
2981
+ ) : /* @__PURE__ */ jsx("li", { className: Navigation_module_default.lowerNavItem, children: /* @__PURE__ */ jsx(Button, { variant: "navnofillblack", href: (_a2 = item.cta) == null ? void 0 : _a2.url, isExternal: (_b = item.cta) == null ? void 0 : _b.isExternal, children: (_c = item.cta) == null ? void 0 : _c.label }) }, index);
2982
+ }) });
2983
+ };
2984
+ var NavigationLogo = ({
2985
+ mainLogo,
2986
+ homeCta,
2987
+ className,
2988
+ onClick,
2989
+ logoAlt = "Home"
2990
+ }) => {
2991
+ if (!mainLogo) return null;
2992
+ if (homeCta) {
2993
+ return /* @__PURE__ */ jsx("a", { href: homeCta, className: Navigation_module_default.mainLogoLink, onClick, "aria-label": logoAlt, children: /* @__PURE__ */ jsx(Picture, { className, src: mainLogo, alt: logoAlt || "" }) });
2994
+ }
2995
+ return /* @__PURE__ */ jsx(Picture, { className, src: mainLogo, alt: logoAlt });
2996
+ };
2997
+ var NavigationCtas = ({
2998
+ loginCta,
2999
+ rightButton,
3000
+ loginVariant,
3001
+ className
3002
+ }) => {
3003
+ return /* @__PURE__ */ jsxs("div", { className, children: [
3004
+ (loginCta == null ? void 0 : loginCta.label) && /* @__PURE__ */ jsx(Button, { variant: loginVariant, href: loginCta.url, isExternal: loginCta.isExternal, children: loginCta.label }),
3005
+ (rightButton == null ? void 0 : rightButton.label) && /* @__PURE__ */ jsx(Button, { variant: "primary", href: rightButton.url, isExternal: rightButton.isExternal, children: rightButton.label })
3006
+ ] });
3007
+ };
3008
+ var NavigationMobile = ({
3009
+ id,
3010
+ navigationItems,
3011
+ mainLogo,
3012
+ homeCta,
3013
+ loginCta,
3014
+ rightButton,
3015
+ isOpen,
3016
+ onClose
3017
+ }) => {
3018
+ var _a;
3019
+ const [expanded, setExpanded] = useState([]);
3020
+ const baseId = useId();
3021
+ const toggleExpanded = (index) => {
3022
+ setExpanded((prev) => prev.includes(index) ? prev.filter((i) => i !== index) : [...prev, index]);
3023
+ };
3024
+ return /* @__PURE__ */ jsxs(
3025
+ "div",
3026
+ {
3027
+ id,
3028
+ className: clsx16(Navigation_module_default.mobileMenu, isOpen && Navigation_module_default.mobileMenuOpen),
3029
+ role: "dialog",
3030
+ "aria-modal": "true",
3031
+ "aria-label": "Navigation menu",
3032
+ "aria-hidden": !isOpen,
3033
+ children: [
3034
+ /* @__PURE__ */ jsxs("div", { className: Navigation_module_default.mobileMenuHeader, children: [
3035
+ /* @__PURE__ */ jsx(
3036
+ NavigationLogo,
3037
+ {
3038
+ mainLogo,
3039
+ homeCta,
3040
+ className: Navigation_module_default.mainLogoMobile,
3041
+ onClick: onClose
3042
+ }
3043
+ ),
3044
+ /* @__PURE__ */ jsx(
3045
+ "button",
3046
+ {
3047
+ type: "button",
3048
+ className: Navigation_module_default.hamburgerButton,
3049
+ onClick: onClose,
3050
+ "aria-label": "Close navigation menu",
3051
+ children: /* @__PURE__ */ jsx(Icon, { type: "xBlack", size: 24, "aria-hidden": "true" })
3052
+ }
3053
+ )
3054
+ ] }),
3055
+ /* @__PURE__ */ jsx("ul", { className: Navigation_module_default.mobileMenuItems, children: (_a = navigationItems == null ? void 0 : navigationItems.items) == null ? void 0 : _a.map((item, index) => {
3056
+ var _a2, _b;
3057
+ const subMenuId = `${baseId}-submenu-${index}`;
3058
+ const isExpanded = expanded.includes(index);
3059
+ return item.type === "dropdown" ? /* @__PURE__ */ jsxs("li", { className: Navigation_module_default.mobileItem, children: [
3060
+ /* @__PURE__ */ jsxs(
3061
+ "button",
3062
+ {
3063
+ type: "button",
3064
+ className: Navigation_module_default.mobileItemTrigger,
3065
+ onClick: () => toggleExpanded(index),
3066
+ "aria-expanded": isExpanded,
3067
+ "aria-controls": subMenuId,
3068
+ children: [
3069
+ item.title,
3070
+ /* @__PURE__ */ jsx(
3071
+ "span",
3072
+ {
3073
+ className: clsx16(
3074
+ Navigation_module_default.mobileItemChevron,
3075
+ isExpanded && Navigation_module_default.mobileItemChevronOpen
3076
+ ),
3077
+ "aria-hidden": "true",
3078
+ children: /* @__PURE__ */ jsx(Icon, { type: "downChevronBlack", size: 24 })
3079
+ }
3080
+ )
3081
+ ]
3082
+ }
3083
+ ),
3084
+ /* @__PURE__ */ jsx(
3085
+ "div",
3086
+ {
3087
+ id: subMenuId,
3088
+ className: clsx16(Navigation_module_default.mobileSubItems, isExpanded && Navigation_module_default.mobileSubItemsOpen),
3089
+ children: /* @__PURE__ */ jsx("ul", { className: Navigation_module_default.mobileSubItemsInner, children: item.items.map(
3090
+ (subItem, i) => {
3091
+ var _a3, _b2;
3092
+ return subItem.type === "link" ? /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
3093
+ "a",
3094
+ {
3095
+ href: (_a3 = subItem.cta) == null ? void 0 : _a3.url,
3096
+ className: Navigation_module_default.mobileSubLink,
3097
+ onClick: onClose,
3098
+ children: (_b2 = subItem.cta) == null ? void 0 : _b2.label
3099
+ }
3100
+ ) }, i) : null;
3101
+ }
3102
+ ) })
3103
+ }
3104
+ )
3105
+ ] }, index) : /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", { href: (_a2 = item.cta) == null ? void 0 : _a2.url, className: Navigation_module_default.mobileItemLink, onClick: onClose, children: (_b = item.cta) == null ? void 0 : _b.label }) }, index);
3106
+ }) }),
3107
+ /* @__PURE__ */ jsx(
3108
+ NavigationCtas,
3109
+ {
3110
+ className: Navigation_module_default.mobileMenuCtas,
3111
+ loginCta,
3112
+ rightButton,
3113
+ loginVariant: "nofillblack"
3114
+ }
3115
+ )
3116
+ ]
3117
+ }
3118
+ );
3119
+ };
3120
+ var Navigation2 = (props) => {
3121
+ const { className, variant, homeCta, loginCta, mainLogo, rightButton, navigationItems } = props;
3122
+ const [isHovered, setIsHovered] = useState(false);
3123
+ const [hasOpenDropdown, setHasOpenDropdown] = useState(false);
3124
+ const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
3125
+ const isAtTop = useIsAtTop();
3126
+ const { is } = useViewPort_default();
3127
+ const mobileMenuId = useId();
3128
+ const isTabletBelow = is("tablet", "below");
3129
+ const isTransparent = variant === "transparent" && isAtTop && !isHovered && !hasOpenDropdown;
3130
+ useEffect(() => {
3131
+ document.body.style.overflow = isMobileMenuOpen ? "hidden" : "";
3132
+ return () => {
3133
+ document.body.style.overflow = "";
3134
+ };
3135
+ }, [isMobileMenuOpen]);
3136
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3137
+ /* @__PURE__ */ jsx(
3138
+ "div",
3139
+ {
3140
+ className: clsx16(
3141
+ Navigation_module_default.navigationWrapper,
3142
+ variant === "transparent" && Navigation_module_default.variantTransparent,
3143
+ isTransparent && Navigation_module_default.transparent,
3144
+ hasOpenDropdown && !isTabletBelow && Navigation_module_default.dropdownOpen
3145
+ ),
3146
+ onMouseEnter: () => setIsHovered(true),
3147
+ onMouseLeave: () => setIsHovered(false),
3148
+ children: /* @__PURE__ */ jsxs("nav", { className: clsx16(Navigation_module_default.navigation, className), "aria-label": "Main", children: [
3149
+ /* @__PURE__ */ jsxs("div", { className: Navigation_module_default.upperNav, children: [
3150
+ /* @__PURE__ */ jsx(
3151
+ NavigationLogo,
3152
+ {
3153
+ mainLogo,
3154
+ homeCta,
3155
+ className: clsx16(Navigation_module_default.mainLogo, isTabletBelow && Navigation_module_default.mainLogoMobile)
3156
+ }
3157
+ ),
3158
+ isTabletBelow ? /* @__PURE__ */ jsx(
3159
+ "button",
3160
+ {
3161
+ type: "button",
3162
+ className: Navigation_module_default.hamburgerButton,
3163
+ onClick: () => setIsMobileMenuOpen(true),
3164
+ "aria-label": "Open navigation menu",
3165
+ "aria-haspopup": "dialog",
3166
+ "aria-expanded": isMobileMenuOpen,
3167
+ "aria-controls": mobileMenuId,
3168
+ children: /* @__PURE__ */ jsx(
3169
+ Icon,
3170
+ {
3171
+ type: isTransparent ? "menuWhite" : "menuBlack",
3172
+ size: 24,
3173
+ "aria-hidden": "true"
3174
+ }
3175
+ )
3176
+ }
3177
+ ) : /* @__PURE__ */ jsx(
3178
+ NavigationCtas,
3179
+ {
3180
+ className: Navigation_module_default.upperRight,
3181
+ loginCta,
3182
+ rightButton,
3183
+ loginVariant: isTransparent ? "ghost" : "nofillblack"
3184
+ }
3185
+ )
3186
+ ] }),
3187
+ isTabletBelow ? /* @__PURE__ */ jsx(
3188
+ NavigationMobile,
3189
+ {
3190
+ id: mobileMenuId,
3191
+ navigationItems,
3192
+ mainLogo,
3193
+ homeCta,
3194
+ loginCta,
3195
+ rightButton,
3196
+ isOpen: isMobileMenuOpen,
3197
+ onClose: () => setIsMobileMenuOpen(false)
3198
+ }
3199
+ ) : /* @__PURE__ */ jsx(
3200
+ NavigationDesktop,
3201
+ {
3202
+ navigationItems,
3203
+ isTransparent,
3204
+ onDropdownOpenChange: setHasOpenDropdown
3205
+ }
3206
+ )
3207
+ ] })
3208
+ }
3209
+ ),
3210
+ hasOpenDropdown && !isTabletBelow && /* @__PURE__ */ jsx("div", { className: Navigation_module_default.overlay, "aria-hidden": "true" })
3211
+ ] });
3212
+ };
2794
3213
  var PracticePathCardsFooter = ({ children }) => {
2795
3214
  return /* @__PURE__ */ jsx(Fragment, { children });
2796
3215
  };
@@ -3991,35 +4410,7 @@ var GlobalSearchResultsList2 = Object.assign(GlobalSearchResultsList, {
3991
4410
  Search: GlobalSearchResultsListSearch,
3992
4411
  Pagination: GlobalSearchResultsListPagination
3993
4412
  });
3994
- function useIntersectionObserver({
3995
- animateOnce = false,
3996
- options = {}
3997
- } = {}) {
3998
- const observeRef = useRef(null);
3999
- const [isVisible, setIsVisible] = useState(false);
4000
- if (typeof IntersectionObserver === "undefined") {
4001
- console.warn("IntersectionObserver is not supported in this browser.");
4002
- return { observeRef, isVisible: true };
4003
- }
4004
- useEffect(() => {
4005
- const currentRef = observeRef.current;
4006
- if (!currentRef) return;
4007
- const observer = new IntersectionObserver((entries) => {
4008
- const entry = entries[0];
4009
- if (!entry) return;
4010
- setIsVisible(entry.isIntersecting);
4011
- if (entry.isIntersecting && animateOnce) {
4012
- observer.disconnect();
4013
- }
4014
- }, options);
4015
- observer.observe(currentRef);
4016
- return () => {
4017
- observer.disconnect();
4018
- };
4019
- }, [observeRef, animateOnce, options]);
4020
- return { observeRef, isVisible };
4021
- }
4022
4413
 
4023
- export { Anchor, Badge, BlogCardGrid2 as BlogCardGrid, BlogPost2 as BlogPost, BlogPostContent2 as BlogPostContent, BlogSearchResultsList2 as BlogSearchResultsList, BrandsStrip, Button, Card2 as Card, CardCollection2 as CardCollection, ConditionalWrapper, ContactModule2 as ContactModule, Container, CountingCard2 as CountingCard, EventList2 as EventList, FeaturedNewsHighlights2 as FeaturedNewsHighlights, FilterBar, Footer, GlobalSearchResultsList2 as GlobalSearchResultsList, HeroBanner2 as HeroBanner, HeroBannerCarousel, Icon, InfoCard2 as InfoCard, Input, InternalBrandsTab2 as InternalBrandsTab, MiniBanner2 as MiniBanner, MiniSectionCta2 as MiniSectionCta, NewsCard, NewsCardList2 as NewsCardList, Pagination, Picture, PracticeCard, PracticePathCards2 as PracticePathCards, ResourceCardItem, ResourcesGridList, Sidebar, Teaser5050With3Text2 as Teaser5050With3Text, Teaser5050WithCta2 as Teaser5050WithCta, TextBody2 as TextBody, TextCenterCtaInBottom2 as TextCenterCtaInBottom, TextEvent2 as TextEvent, UpcomingEventCard, resolveCompoundSlots, svgs, useIntersectionObserver };
4414
+ export { Anchor, Badge, BlogCardGrid2 as BlogCardGrid, BlogPost2 as BlogPost, BlogPostContent2 as BlogPostContent, BlogSearchResultsList2 as BlogSearchResultsList, BrandsStrip, Button, Card2 as Card, CardCollection2 as CardCollection, ConditionalWrapper, ContactModule2 as ContactModule, Container, CountingCard2 as CountingCard, EventList2 as EventList, FeaturedNewsHighlights2 as FeaturedNewsHighlights, FilterBar, Footer, GlobalSearchResultsList2 as GlobalSearchResultsList, HeroBanner2 as HeroBanner, HeroBannerCarousel, Icon, InfoCard2 as InfoCard, Input, InternalBrandsTab2 as InternalBrandsTab, MiniBanner2 as MiniBanner, MiniSectionCta2 as MiniSectionCta, Navigation2 as Navigation, NewsCard, NewsCardList2 as NewsCardList, Pagination, Picture, PracticeCard, PracticePathCards2 as PracticePathCards, ResourceCardItem, ResourcesGridList, Sidebar, Teaser5050With3Text2 as Teaser5050With3Text, Teaser5050WithCta2 as Teaser5050WithCta, TextBody2 as TextBody, TextCenterCtaInBottom2 as TextCenterCtaInBottom, TextEvent2 as TextEvent, UpcomingEventCard, resolveCompoundSlots, svgs, useIntersectionObserver, useIsAtTop };
4024
4415
  //# sourceMappingURL=index.mjs.map
4025
4416
  //# sourceMappingURL=index.mjs.map