@digital-b2c/coreui-kit 0.12.0 → 0.13.1

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.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
  };
@@ -505,15 +506,15 @@ var useViewPort = () => {
505
506
  window.addEventListener("resize", onWindowResizeDebounce);
506
507
  return () => window.removeEventListener("resize", onWindowResizeDebounce);
507
508
  }, [onWindowResizeDebounce]);
508
- const is = (what, range) => {
509
+ const is = (what, range2) => {
509
510
  const isArray = Array.isArray(what);
510
- if (!range && !isArray) {
511
+ if (!range2 && !isArray) {
511
512
  return what === device;
512
513
  }
513
- if (!range && isArray) {
514
+ if (!range2 && isArray) {
514
515
  return device ? what.includes(device) : false;
515
516
  }
516
- const list = range === "above" ? ORDER : [...ORDER].reverse();
517
+ const list = range2 === "above" ? ORDER : [...ORDER].reverse();
517
518
  const devices = getOtherDevices(list, what, true);
518
519
  return device && devices.includes(device);
519
520
  };
@@ -1112,6 +1113,31 @@ var InfoCard2 = Object.assign(InfoCard, {
1112
1113
  Subtitle: InfoCardSubtitle
1113
1114
  });
1114
1115
 
1116
+ // src/utils/getPaginationRange.ts
1117
+ var DOTS = "...";
1118
+ var range = (start, end) => Array.from({ length: end - start + 1 }, (_, i) => start + i);
1119
+ var getPaginationRange = (totalPages, currentPage, siblingCount = 1, boundaryCount = 1) => {
1120
+ const totalPageNumbers = siblingCount * 2 + boundaryCount * 2 + 3;
1121
+ if (totalPageNumbers >= totalPages) {
1122
+ return range(1, totalPages);
1123
+ }
1124
+ const leftSiblingIndex = Math.max(currentPage - siblingCount, boundaryCount + 1);
1125
+ const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages - boundaryCount);
1126
+ const showLeftDots = leftSiblingIndex > boundaryCount + 2;
1127
+ const showRightDots = rightSiblingIndex < totalPages - boundaryCount - 1;
1128
+ const firstPages = range(1, boundaryCount);
1129
+ const lastPages = range(totalPages - boundaryCount + 1, totalPages);
1130
+ if (!showLeftDots && showRightDots) {
1131
+ const leftRange = range(1, boundaryCount + siblingCount * 2 + 2);
1132
+ return [...leftRange, DOTS, ...lastPages];
1133
+ }
1134
+ if (showLeftDots && !showRightDots) {
1135
+ const rightRange = range(totalPages - (boundaryCount + siblingCount * 2 + 1), totalPages);
1136
+ return [...firstPages, DOTS, ...rightRange];
1137
+ }
1138
+ return [...firstPages, DOTS, ...range(leftSiblingIndex, rightSiblingIndex), DOTS, ...lastPages];
1139
+ };
1140
+
1115
1141
  // src/components/Pagination/Pagination.module.scss
1116
1142
  var Pagination_module_default = {
1117
1143
  pagination: "Pagination_module_pagination",
@@ -1119,8 +1145,10 @@ var Pagination_module_default = {
1119
1145
  prev: "Pagination_module_prev",
1120
1146
  pages: "Pagination_module_pages",
1121
1147
  page: "Pagination_module_page",
1148
+ "no-border": "Pagination_module_no-border",
1149
+ number: "Pagination_module_number",
1122
1150
  active: "Pagination_module_active",
1123
- number: "Pagination_module_number"
1151
+ dots: "Pagination_module_dots"
1124
1152
  };
1125
1153
  var Pagination = ({
1126
1154
  className,
@@ -1130,6 +1158,10 @@ var Pagination = ({
1130
1158
  hasNumber = false,
1131
1159
  disableArrows = false,
1132
1160
  onPageChange,
1161
+ showEllipsis,
1162
+ boundaryCount,
1163
+ siblingCount,
1164
+ hidePagesBorder = false,
1133
1165
  renderLink
1134
1166
  }) => {
1135
1167
  const [activePage, setActivePage] = useState(currentPage);
@@ -1164,6 +1196,7 @@ var Pagination = ({
1164
1196
  };
1165
1197
  const prevPage = activePage === 1 ? loop ? totalPages : 1 : activePage - 1;
1166
1198
  const nextPage = activePage === totalPages ? loop ? 1 : totalPages : activePage + 1;
1199
+ const pageItems = showEllipsis ? getPaginationRange(totalPages, activePage, siblingCount, boundaryCount) : Array.from({ length: totalPages }, (_, i) => i + 1);
1167
1200
  return /* @__PURE__ */ jsxs("div", { className: clsx16(Pagination_module_default.pagination, className), children: [
1168
1201
  !disableArrows && (renderLink ? renderLink({
1169
1202
  page: prevPage,
@@ -1180,11 +1213,15 @@ var Pagination = ({
1180
1213
  children: /* @__PURE__ */ jsx(Icon, { type: "filledChevronLeft" })
1181
1214
  }
1182
1215
  )),
1183
- /* @__PURE__ */ jsx("div", { className: Pagination_module_default.pages, children: Array.from({ length: totalPages }, (_, i) => {
1184
- const page = i + 1;
1216
+ /* @__PURE__ */ jsx("div", { className: Pagination_module_default.pages, children: pageItems.map((item, index) => {
1217
+ if (item === "...") {
1218
+ return /* @__PURE__ */ jsx("span", { className: Pagination_module_default.dots, "aria-hidden": "true", children: "\u2026" }, `dots-${index}`);
1219
+ }
1220
+ const page = item;
1185
1221
  const pageClassName = clsx16(Pagination_module_default.page, {
1186
1222
  [Pagination_module_default.active]: activePage === page,
1187
- [Pagination_module_default.number]: hasNumber
1223
+ [Pagination_module_default.number]: hasNumber,
1224
+ [Pagination_module_default["no-border"]]: hidePagesBorder
1188
1225
  });
1189
1226
  return renderLink ? /* @__PURE__ */ jsx(Fragment$1, { children: renderLink({
1190
1227
  page,
@@ -2791,6 +2828,424 @@ var MiniSectionCta2 = Object.assign(MiniSectionCta, {
2791
2828
  Title: MiniSectionCtaTitle,
2792
2829
  Subtitle: MiniSectionCtaSubtitle
2793
2830
  });
2831
+ function useIntersectionObserver({
2832
+ animateOnce = false,
2833
+ options = {}
2834
+ } = {}) {
2835
+ const observeRef = useRef(null);
2836
+ const [isVisible, setIsVisible] = useState(false);
2837
+ if (typeof IntersectionObserver === "undefined") {
2838
+ console.warn("IntersectionObserver is not supported in this browser.");
2839
+ return { observeRef, isVisible: true };
2840
+ }
2841
+ useEffect(() => {
2842
+ const currentRef = observeRef.current;
2843
+ if (!currentRef) return;
2844
+ const observer = new IntersectionObserver((entries) => {
2845
+ const entry = entries[0];
2846
+ if (!entry) return;
2847
+ setIsVisible(entry.isIntersecting);
2848
+ if (entry.isIntersecting && animateOnce) {
2849
+ observer.disconnect();
2850
+ }
2851
+ }, options);
2852
+ observer.observe(currentRef);
2853
+ return () => {
2854
+ observer.disconnect();
2855
+ };
2856
+ }, [observeRef, animateOnce, options]);
2857
+ return { observeRef, isVisible };
2858
+ }
2859
+ var useIsAtTop = () => {
2860
+ const [isAtTop, setIsAtTop] = useState(true);
2861
+ useEffect(() => {
2862
+ const handleScroll = () => setIsAtTop(window.scrollY === 0);
2863
+ window.addEventListener("scroll", handleScroll, { passive: true });
2864
+ return () => window.removeEventListener("scroll", handleScroll);
2865
+ }, []);
2866
+ return isAtTop;
2867
+ };
2868
+
2869
+ // src/widgets/Navigation/Navigation.module.scss
2870
+ var Navigation_module_default = {
2871
+ dropdownTitle: "Navigation_module_dropdownTitle",
2872
+ dropdownLink: "Navigation_module_dropdownLink",
2873
+ dropdownDescription: "Navigation_module_dropdownDescription",
2874
+ mobileItemLink: "Navigation_module_mobileItemLink",
2875
+ mobileItemTrigger: "Navigation_module_mobileItemTrigger",
2876
+ mobileSubLink: "Navigation_module_mobileSubLink",
2877
+ navigationWrapper: "Navigation_module_navigationWrapper",
2878
+ dropdownOpen: "Navigation_module_dropdownOpen",
2879
+ variantTransparent: "Navigation_module_variantTransparent",
2880
+ transparent: "Navigation_module_transparent",
2881
+ navigation: "Navigation_module_navigation",
2882
+ upperNav: "Navigation_module_upperNav",
2883
+ mainLogo: "Navigation_module_mainLogo",
2884
+ mainLogoLink: "Navigation_module_mainLogoLink",
2885
+ upperRight: "Navigation_module_upperRight",
2886
+ lowerNav: "Navigation_module_lowerNav",
2887
+ lowerNavItem: "Navigation_module_lowerNavItem",
2888
+ overlay: "Navigation_module_overlay",
2889
+ dropdownTrigger: "Navigation_module_dropdownTrigger",
2890
+ dropdownTriggerOpen: "Navigation_module_dropdownTriggerOpen",
2891
+ dropdownPanel: "Navigation_module_dropdownPanel",
2892
+ dropdownPanelOpen: "Navigation_module_dropdownPanelOpen",
2893
+ dropdownInner: "Navigation_module_dropdownInner",
2894
+ dropdownLinks: "Navigation_module_dropdownLinks",
2895
+ dropdownLinkContainer: "Navigation_module_dropdownLinkContainer",
2896
+ dropdownInfo: "Navigation_module_dropdownInfo",
2897
+ mainLogoMobile: "Navigation_module_mainLogoMobile",
2898
+ hamburgerButton: "Navigation_module_hamburgerButton",
2899
+ mobileMenu: "Navigation_module_mobileMenu",
2900
+ mobileMenuOpen: "Navigation_module_mobileMenuOpen",
2901
+ mobileMenuHeader: "Navigation_module_mobileMenuHeader",
2902
+ mobileMenuItems: "Navigation_module_mobileMenuItems",
2903
+ mobileItem: "Navigation_module_mobileItem",
2904
+ mobileItemChevron: "Navigation_module_mobileItemChevron",
2905
+ mobileItemChevronOpen: "Navigation_module_mobileItemChevronOpen",
2906
+ mobileSubItems: "Navigation_module_mobileSubItems",
2907
+ mobileSubItemsOpen: "Navigation_module_mobileSubItemsOpen",
2908
+ mobileSubItemsInner: "Navigation_module_mobileSubItemsInner",
2909
+ mobileMenuCtas: "Navigation_module_mobileMenuCtas"
2910
+ };
2911
+ var NavigationDesktop = ({
2912
+ navigationItems,
2913
+ isTransparent,
2914
+ onDropdownOpenChange
2915
+ }) => {
2916
+ var _a;
2917
+ const [activeDropdown, setActiveDropdown] = useState(null);
2918
+ const closeTimer = useRef(null);
2919
+ const dropdownWrapperRefs = useRef([]);
2920
+ const baseId = useId();
2921
+ const setDropdown = (index) => {
2922
+ setActiveDropdown(index);
2923
+ onDropdownOpenChange == null ? void 0 : onDropdownOpenChange(index !== null);
2924
+ };
2925
+ const handleDropdownEnter = (index) => {
2926
+ if (closeTimer.current) clearTimeout(closeTimer.current);
2927
+ setDropdown(index);
2928
+ };
2929
+ const handleDropdownLeave = () => {
2930
+ closeTimer.current = setTimeout(() => setDropdown(null), 100);
2931
+ };
2932
+ const handleDropdownBlur = (e, index) => {
2933
+ if (!e.currentTarget.contains(e.relatedTarget)) {
2934
+ if (activeDropdown === index) setDropdown(null);
2935
+ }
2936
+ };
2937
+ const handleTriggerKeyDown = (e, index) => {
2938
+ if (e.key === "Escape") {
2939
+ setDropdown(null);
2940
+ } else if ((e.key === "Enter" || e.key === " ") && activeDropdown !== index) {
2941
+ e.preventDefault();
2942
+ setDropdown(index);
2943
+ }
2944
+ };
2945
+ const handleDropdownKeyDown = (e, index) => {
2946
+ var _a2, _b;
2947
+ if (e.key === "Escape") {
2948
+ setDropdown(null);
2949
+ (_b = (_a2 = dropdownWrapperRefs.current[index]) == null ? void 0 : _a2.querySelector("button")) == null ? void 0 : _b.focus();
2950
+ }
2951
+ };
2952
+ if (!((_a = navigationItems == null ? void 0 : navigationItems.items) == null ? void 0 : _a.length)) return null;
2953
+ return /* @__PURE__ */ jsx("ul", { className: Navigation_module_default.lowerNav, children: navigationItems.items.map((item, index) => {
2954
+ var _a2, _b, _c;
2955
+ const panelId = `${baseId}-panel-${index}`;
2956
+ const isOpen = activeDropdown === index;
2957
+ return item.type === "dropdown" ? /* @__PURE__ */ jsxs(
2958
+ "li",
2959
+ {
2960
+ className: Navigation_module_default.lowerNavItem,
2961
+ ref: (el) => {
2962
+ dropdownWrapperRefs.current[index] = el;
2963
+ },
2964
+ onBlur: (e) => handleDropdownBlur(e, index),
2965
+ children: [
2966
+ /* @__PURE__ */ jsx(
2967
+ Button,
2968
+ {
2969
+ variant: "navnofillblack",
2970
+ className: clsx16(Navigation_module_default.dropdownTrigger, { [Navigation_module_default.dropdownTriggerOpen]: isOpen }),
2971
+ icon: isTransparent ? "downChevronWhite" : "downChevronBlack",
2972
+ isActive: isOpen,
2973
+ "aria-expanded": isOpen,
2974
+ "aria-haspopup": "true",
2975
+ "aria-controls": panelId,
2976
+ onMouseEnter: () => handleDropdownEnter(index),
2977
+ onMouseLeave: handleDropdownLeave,
2978
+ onClick: () => setDropdown(isOpen ? null : index),
2979
+ onKeyDown: (e) => handleTriggerKeyDown(e, index),
2980
+ children: item.title
2981
+ }
2982
+ ),
2983
+ /* @__PURE__ */ jsx(
2984
+ "div",
2985
+ {
2986
+ id: panelId,
2987
+ className: clsx16(Navigation_module_default.dropdownPanel, { [Navigation_module_default.dropdownPanelOpen]: isOpen }),
2988
+ "aria-hidden": !isOpen,
2989
+ onMouseEnter: () => handleDropdownEnter(index),
2990
+ onMouseLeave: handleDropdownLeave,
2991
+ onKeyDown: (e) => handleDropdownKeyDown(e, index),
2992
+ children: /* @__PURE__ */ jsxs("div", { className: Navigation_module_default.dropdownInner, children: [
2993
+ /* @__PURE__ */ jsx("ul", { className: Navigation_module_default.dropdownLinks, children: item.items.map(
2994
+ (subItem, i) => {
2995
+ var _a3, _b2;
2996
+ return subItem.type === "link" ? /* @__PURE__ */ jsx("li", { className: Navigation_module_default.dropdownLinkContainer, children: /* @__PURE__ */ jsx(
2997
+ "a",
2998
+ {
2999
+ href: (_a3 = subItem.cta) == null ? void 0 : _a3.url,
3000
+ className: Navigation_module_default.dropdownLink,
3001
+ tabIndex: isOpen ? void 0 : -1,
3002
+ children: (_b2 = subItem.cta) == null ? void 0 : _b2.label
3003
+ }
3004
+ ) }, i) : null;
3005
+ }
3006
+ ) }),
3007
+ /* @__PURE__ */ jsxs("div", { className: Navigation_module_default.dropdownInfo, children: [
3008
+ /* @__PURE__ */ jsx("h3", { className: Navigation_module_default.dropdownTitle, children: item.title }),
3009
+ /* @__PURE__ */ jsx("p", { className: Navigation_module_default.dropdownDescription, children: item.description })
3010
+ ] })
3011
+ ] })
3012
+ }
3013
+ )
3014
+ ]
3015
+ },
3016
+ index
3017
+ ) : /* @__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);
3018
+ }) });
3019
+ };
3020
+ var NavigationLogo = ({
3021
+ mainLogo,
3022
+ homeCta,
3023
+ className,
3024
+ onClick,
3025
+ logoAlt = "Home"
3026
+ }) => {
3027
+ if (!mainLogo) return null;
3028
+ if (homeCta) {
3029
+ return /* @__PURE__ */ jsx("a", { href: homeCta, className: Navigation_module_default.mainLogoLink, onClick, "aria-label": logoAlt, children: /* @__PURE__ */ jsx(Picture, { className, src: mainLogo, alt: logoAlt || "" }) });
3030
+ }
3031
+ return /* @__PURE__ */ jsx(Picture, { className, src: mainLogo, alt: logoAlt });
3032
+ };
3033
+ var NavigationCtas = ({
3034
+ loginCta,
3035
+ rightButton,
3036
+ loginVariant,
3037
+ className
3038
+ }) => {
3039
+ return /* @__PURE__ */ jsxs("div", { className, children: [
3040
+ (loginCta == null ? void 0 : loginCta.label) && /* @__PURE__ */ jsx(Button, { variant: loginVariant, href: loginCta.url, isExternal: loginCta.isExternal, children: loginCta.label }),
3041
+ (rightButton == null ? void 0 : rightButton.label) && /* @__PURE__ */ jsx(Button, { variant: "primary", href: rightButton.url, isExternal: rightButton.isExternal, children: rightButton.label })
3042
+ ] });
3043
+ };
3044
+ var NavigationMobile = ({
3045
+ id,
3046
+ navigationItems,
3047
+ mainLogo,
3048
+ homeCta,
3049
+ loginCta,
3050
+ rightButton,
3051
+ isOpen,
3052
+ onClose
3053
+ }) => {
3054
+ var _a;
3055
+ const [expanded, setExpanded] = useState([]);
3056
+ const baseId = useId();
3057
+ const toggleExpanded = (index) => {
3058
+ setExpanded((prev) => prev.includes(index) ? prev.filter((i) => i !== index) : [...prev, index]);
3059
+ };
3060
+ return /* @__PURE__ */ jsxs(
3061
+ "div",
3062
+ {
3063
+ id,
3064
+ className: clsx16(Navigation_module_default.mobileMenu, isOpen && Navigation_module_default.mobileMenuOpen),
3065
+ role: "dialog",
3066
+ "aria-modal": "true",
3067
+ "aria-label": "Navigation menu",
3068
+ "aria-hidden": !isOpen,
3069
+ children: [
3070
+ /* @__PURE__ */ jsxs("div", { className: Navigation_module_default.mobileMenuHeader, children: [
3071
+ /* @__PURE__ */ jsx(
3072
+ NavigationLogo,
3073
+ {
3074
+ mainLogo,
3075
+ homeCta,
3076
+ className: Navigation_module_default.mainLogoMobile,
3077
+ onClick: onClose
3078
+ }
3079
+ ),
3080
+ /* @__PURE__ */ jsx(
3081
+ "button",
3082
+ {
3083
+ type: "button",
3084
+ className: Navigation_module_default.hamburgerButton,
3085
+ onClick: onClose,
3086
+ "aria-label": "Close navigation menu",
3087
+ children: /* @__PURE__ */ jsx(Icon, { type: "xBlack", size: 24, "aria-hidden": "true" })
3088
+ }
3089
+ )
3090
+ ] }),
3091
+ /* @__PURE__ */ jsx("ul", { className: Navigation_module_default.mobileMenuItems, children: (_a = navigationItems == null ? void 0 : navigationItems.items) == null ? void 0 : _a.map((item, index) => {
3092
+ var _a2, _b;
3093
+ const subMenuId = `${baseId}-submenu-${index}`;
3094
+ const isExpanded = expanded.includes(index);
3095
+ return item.type === "dropdown" ? /* @__PURE__ */ jsxs("li", { className: Navigation_module_default.mobileItem, children: [
3096
+ /* @__PURE__ */ jsxs(
3097
+ "button",
3098
+ {
3099
+ type: "button",
3100
+ className: Navigation_module_default.mobileItemTrigger,
3101
+ onClick: () => toggleExpanded(index),
3102
+ "aria-expanded": isExpanded,
3103
+ "aria-controls": subMenuId,
3104
+ children: [
3105
+ item.title,
3106
+ /* @__PURE__ */ jsx(
3107
+ "span",
3108
+ {
3109
+ className: clsx16(
3110
+ Navigation_module_default.mobileItemChevron,
3111
+ isExpanded && Navigation_module_default.mobileItemChevronOpen
3112
+ ),
3113
+ "aria-hidden": "true",
3114
+ children: /* @__PURE__ */ jsx(Icon, { type: "downChevronBlack", size: 24 })
3115
+ }
3116
+ )
3117
+ ]
3118
+ }
3119
+ ),
3120
+ /* @__PURE__ */ jsx(
3121
+ "div",
3122
+ {
3123
+ id: subMenuId,
3124
+ className: clsx16(Navigation_module_default.mobileSubItems, isExpanded && Navigation_module_default.mobileSubItemsOpen),
3125
+ children: /* @__PURE__ */ jsx("ul", { className: Navigation_module_default.mobileSubItemsInner, children: item.items.map(
3126
+ (subItem, i) => {
3127
+ var _a3, _b2;
3128
+ return subItem.type === "link" ? /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
3129
+ "a",
3130
+ {
3131
+ href: (_a3 = subItem.cta) == null ? void 0 : _a3.url,
3132
+ className: Navigation_module_default.mobileSubLink,
3133
+ onClick: onClose,
3134
+ children: (_b2 = subItem.cta) == null ? void 0 : _b2.label
3135
+ }
3136
+ ) }, i) : null;
3137
+ }
3138
+ ) })
3139
+ }
3140
+ )
3141
+ ] }, 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);
3142
+ }) }),
3143
+ /* @__PURE__ */ jsx(
3144
+ NavigationCtas,
3145
+ {
3146
+ className: Navigation_module_default.mobileMenuCtas,
3147
+ loginCta,
3148
+ rightButton,
3149
+ loginVariant: "nofillblack"
3150
+ }
3151
+ )
3152
+ ]
3153
+ }
3154
+ );
3155
+ };
3156
+ var Navigation2 = (props) => {
3157
+ const { className, variant, homeCta, loginCta, mainLogo, rightButton, navigationItems } = props;
3158
+ const [isHovered, setIsHovered] = useState(false);
3159
+ const [hasOpenDropdown, setHasOpenDropdown] = useState(false);
3160
+ const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
3161
+ const isAtTop = useIsAtTop();
3162
+ const { is } = useViewPort_default();
3163
+ const mobileMenuId = useId();
3164
+ const isTabletBelow = is("tablet", "below");
3165
+ const isTransparent = variant === "transparent" && isAtTop && !isHovered && !hasOpenDropdown;
3166
+ useEffect(() => {
3167
+ document.body.style.overflow = isMobileMenuOpen ? "hidden" : "";
3168
+ return () => {
3169
+ document.body.style.overflow = "";
3170
+ };
3171
+ }, [isMobileMenuOpen]);
3172
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3173
+ /* @__PURE__ */ jsx(
3174
+ "div",
3175
+ {
3176
+ className: clsx16(
3177
+ Navigation_module_default.navigationWrapper,
3178
+ variant === "transparent" && Navigation_module_default.variantTransparent,
3179
+ isTransparent && Navigation_module_default.transparent,
3180
+ hasOpenDropdown && !isTabletBelow && Navigation_module_default.dropdownOpen
3181
+ ),
3182
+ onMouseEnter: () => setIsHovered(true),
3183
+ onMouseLeave: () => setIsHovered(false),
3184
+ children: /* @__PURE__ */ jsxs("nav", { className: clsx16(Navigation_module_default.navigation, className), "aria-label": "Main", children: [
3185
+ /* @__PURE__ */ jsxs("div", { className: Navigation_module_default.upperNav, children: [
3186
+ /* @__PURE__ */ jsx(
3187
+ NavigationLogo,
3188
+ {
3189
+ mainLogo,
3190
+ homeCta,
3191
+ className: clsx16(Navigation_module_default.mainLogo, isTabletBelow && Navigation_module_default.mainLogoMobile)
3192
+ }
3193
+ ),
3194
+ isTabletBelow ? /* @__PURE__ */ jsx(
3195
+ "button",
3196
+ {
3197
+ type: "button",
3198
+ className: Navigation_module_default.hamburgerButton,
3199
+ onClick: () => setIsMobileMenuOpen(true),
3200
+ "aria-label": "Open navigation menu",
3201
+ "aria-haspopup": "dialog",
3202
+ "aria-expanded": isMobileMenuOpen,
3203
+ "aria-controls": mobileMenuId,
3204
+ children: /* @__PURE__ */ jsx(
3205
+ Icon,
3206
+ {
3207
+ type: isTransparent ? "menuWhite" : "menuBlack",
3208
+ size: 24,
3209
+ "aria-hidden": "true"
3210
+ }
3211
+ )
3212
+ }
3213
+ ) : /* @__PURE__ */ jsx(
3214
+ NavigationCtas,
3215
+ {
3216
+ className: Navigation_module_default.upperRight,
3217
+ loginCta,
3218
+ rightButton,
3219
+ loginVariant: isTransparent ? "ghost" : "nofillblack"
3220
+ }
3221
+ )
3222
+ ] }),
3223
+ isTabletBelow ? /* @__PURE__ */ jsx(
3224
+ NavigationMobile,
3225
+ {
3226
+ id: mobileMenuId,
3227
+ navigationItems,
3228
+ mainLogo,
3229
+ homeCta,
3230
+ loginCta,
3231
+ rightButton,
3232
+ isOpen: isMobileMenuOpen,
3233
+ onClose: () => setIsMobileMenuOpen(false)
3234
+ }
3235
+ ) : /* @__PURE__ */ jsx(
3236
+ NavigationDesktop,
3237
+ {
3238
+ navigationItems,
3239
+ isTransparent,
3240
+ onDropdownOpenChange: setHasOpenDropdown
3241
+ }
3242
+ )
3243
+ ] })
3244
+ }
3245
+ ),
3246
+ hasOpenDropdown && !isTabletBelow && /* @__PURE__ */ jsx("div", { className: Navigation_module_default.overlay, "aria-hidden": "true" })
3247
+ ] });
3248
+ };
2794
3249
  var PracticePathCardsFooter = ({ children }) => {
2795
3250
  return /* @__PURE__ */ jsx(Fragment, { children });
2796
3251
  };
@@ -2943,7 +3398,7 @@ var Teaser5050WithCta = ({
2943
3398
  titleNode && /* @__PURE__ */ jsx("div", { className: clsx16(Teaser5050WithCta_module_default.title, "h3"), children: titleNode }),
2944
3399
  subtitleNode && /* @__PURE__ */ jsx("div", { className: "subheading", children: subtitleNode })
2945
3400
  ] }),
2946
- (ctas == null ? void 0 : ctas.length) && /* @__PURE__ */ jsx("div", { className: Teaser5050WithCta_module_default.ctaWrapper, children: ctas.map((cta, key) => /* @__PURE__ */ jsx(
3401
+ ctas && (ctas == null ? void 0 : ctas.length) > 0 && /* @__PURE__ */ jsx("div", { className: Teaser5050WithCta_module_default.ctaWrapper, children: ctas.map((cta, key) => /* @__PURE__ */ jsx(
2947
3402
  Button,
2948
3403
  {
2949
3404
  className: Teaser5050WithCta_module_default.cta,
@@ -3991,35 +4446,7 @@ var GlobalSearchResultsList2 = Object.assign(GlobalSearchResultsList, {
3991
4446
  Search: GlobalSearchResultsListSearch,
3992
4447
  Pagination: GlobalSearchResultsListPagination
3993
4448
  });
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
4449
 
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 };
4450
+ 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
4451
  //# sourceMappingURL=index.mjs.map
4025
4452
  //# sourceMappingURL=index.mjs.map