@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.cjs CHANGED
@@ -405,11 +405,12 @@ var Button_module_default = {
405
405
  ghost: "Button_module_ghost",
406
406
  nofill: "Button_module_nofill",
407
407
  nofillblack: "Button_module_nofillblack",
408
+ navnofillblack: "Button_module_navnofillblack",
409
+ active: "Button_module_active",
408
410
  grey: "Button_module_grey",
409
411
  shiny: "Button_module_shiny",
410
412
  rotateGradient: "Button_module_rotateGradient",
411
413
  tabbutton: "Button_module_tabbutton",
412
- active: "Button_module_active",
413
414
  icon: "Button_module_icon",
414
415
  logo: "Button_module_logo"
415
416
  };
@@ -513,15 +514,15 @@ var useViewPort = () => {
513
514
  window.addEventListener("resize", onWindowResizeDebounce);
514
515
  return () => window.removeEventListener("resize", onWindowResizeDebounce);
515
516
  }, [onWindowResizeDebounce]);
516
- const is = (what, range) => {
517
+ const is = (what, range2) => {
517
518
  const isArray = Array.isArray(what);
518
- if (!range && !isArray) {
519
+ if (!range2 && !isArray) {
519
520
  return what === device;
520
521
  }
521
- if (!range && isArray) {
522
+ if (!range2 && isArray) {
522
523
  return device ? what.includes(device) : false;
523
524
  }
524
- const list = range === "above" ? ORDER : [...ORDER].reverse();
525
+ const list = range2 === "above" ? ORDER : [...ORDER].reverse();
525
526
  const devices = getOtherDevices(list, what, true);
526
527
  return device && devices.includes(device);
527
528
  };
@@ -1120,6 +1121,31 @@ var InfoCard2 = Object.assign(InfoCard, {
1120
1121
  Subtitle: InfoCardSubtitle
1121
1122
  });
1122
1123
 
1124
+ // src/utils/getPaginationRange.ts
1125
+ var DOTS = "...";
1126
+ var range = (start, end) => Array.from({ length: end - start + 1 }, (_, i) => start + i);
1127
+ var getPaginationRange = (totalPages, currentPage, siblingCount = 1, boundaryCount = 1) => {
1128
+ const totalPageNumbers = siblingCount * 2 + boundaryCount * 2 + 3;
1129
+ if (totalPageNumbers >= totalPages) {
1130
+ return range(1, totalPages);
1131
+ }
1132
+ const leftSiblingIndex = Math.max(currentPage - siblingCount, boundaryCount + 1);
1133
+ const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages - boundaryCount);
1134
+ const showLeftDots = leftSiblingIndex > boundaryCount + 2;
1135
+ const showRightDots = rightSiblingIndex < totalPages - boundaryCount - 1;
1136
+ const firstPages = range(1, boundaryCount);
1137
+ const lastPages = range(totalPages - boundaryCount + 1, totalPages);
1138
+ if (!showLeftDots && showRightDots) {
1139
+ const leftRange = range(1, boundaryCount + siblingCount * 2 + 2);
1140
+ return [...leftRange, DOTS, ...lastPages];
1141
+ }
1142
+ if (showLeftDots && !showRightDots) {
1143
+ const rightRange = range(totalPages - (boundaryCount + siblingCount * 2 + 1), totalPages);
1144
+ return [...firstPages, DOTS, ...rightRange];
1145
+ }
1146
+ return [...firstPages, DOTS, ...range(leftSiblingIndex, rightSiblingIndex), DOTS, ...lastPages];
1147
+ };
1148
+
1123
1149
  // src/components/Pagination/Pagination.module.scss
1124
1150
  var Pagination_module_default = {
1125
1151
  pagination: "Pagination_module_pagination",
@@ -1127,8 +1153,10 @@ var Pagination_module_default = {
1127
1153
  prev: "Pagination_module_prev",
1128
1154
  pages: "Pagination_module_pages",
1129
1155
  page: "Pagination_module_page",
1156
+ "no-border": "Pagination_module_no-border",
1157
+ number: "Pagination_module_number",
1130
1158
  active: "Pagination_module_active",
1131
- number: "Pagination_module_number"
1159
+ dots: "Pagination_module_dots"
1132
1160
  };
1133
1161
  var Pagination = ({
1134
1162
  className,
@@ -1138,6 +1166,10 @@ var Pagination = ({
1138
1166
  hasNumber = false,
1139
1167
  disableArrows = false,
1140
1168
  onPageChange,
1169
+ showEllipsis,
1170
+ boundaryCount,
1171
+ siblingCount,
1172
+ hidePagesBorder = false,
1141
1173
  renderLink
1142
1174
  }) => {
1143
1175
  const [activePage, setActivePage] = React66.useState(currentPage);
@@ -1172,6 +1204,7 @@ var Pagination = ({
1172
1204
  };
1173
1205
  const prevPage = activePage === 1 ? loop ? totalPages : 1 : activePage - 1;
1174
1206
  const nextPage = activePage === totalPages ? loop ? 1 : totalPages : activePage + 1;
1207
+ const pageItems = showEllipsis ? getPaginationRange(totalPages, activePage, siblingCount, boundaryCount) : Array.from({ length: totalPages }, (_, i) => i + 1);
1175
1208
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx16__default.default(Pagination_module_default.pagination, className), children: [
1176
1209
  !disableArrows && (renderLink ? renderLink({
1177
1210
  page: prevPage,
@@ -1188,11 +1221,15 @@ var Pagination = ({
1188
1221
  children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { type: "filledChevronLeft" })
1189
1222
  }
1190
1223
  )),
1191
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: Pagination_module_default.pages, children: Array.from({ length: totalPages }, (_, i) => {
1192
- const page = i + 1;
1224
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: Pagination_module_default.pages, children: pageItems.map((item, index) => {
1225
+ if (item === "...") {
1226
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: Pagination_module_default.dots, "aria-hidden": "true", children: "\u2026" }, `dots-${index}`);
1227
+ }
1228
+ const page = item;
1193
1229
  const pageClassName = clsx16__default.default(Pagination_module_default.page, {
1194
1230
  [Pagination_module_default.active]: activePage === page,
1195
- [Pagination_module_default.number]: hasNumber
1231
+ [Pagination_module_default.number]: hasNumber,
1232
+ [Pagination_module_default["no-border"]]: hidePagesBorder
1196
1233
  });
1197
1234
  return renderLink ? /* @__PURE__ */ jsxRuntime.jsx(React66.Fragment, { children: renderLink({
1198
1235
  page,
@@ -2799,6 +2836,424 @@ var MiniSectionCta2 = Object.assign(MiniSectionCta, {
2799
2836
  Title: MiniSectionCtaTitle,
2800
2837
  Subtitle: MiniSectionCtaSubtitle
2801
2838
  });
2839
+ function useIntersectionObserver({
2840
+ animateOnce = false,
2841
+ options = {}
2842
+ } = {}) {
2843
+ const observeRef = React66.useRef(null);
2844
+ const [isVisible, setIsVisible] = React66.useState(false);
2845
+ if (typeof IntersectionObserver === "undefined") {
2846
+ console.warn("IntersectionObserver is not supported in this browser.");
2847
+ return { observeRef, isVisible: true };
2848
+ }
2849
+ React66.useEffect(() => {
2850
+ const currentRef = observeRef.current;
2851
+ if (!currentRef) return;
2852
+ const observer = new IntersectionObserver((entries) => {
2853
+ const entry = entries[0];
2854
+ if (!entry) return;
2855
+ setIsVisible(entry.isIntersecting);
2856
+ if (entry.isIntersecting && animateOnce) {
2857
+ observer.disconnect();
2858
+ }
2859
+ }, options);
2860
+ observer.observe(currentRef);
2861
+ return () => {
2862
+ observer.disconnect();
2863
+ };
2864
+ }, [observeRef, animateOnce, options]);
2865
+ return { observeRef, isVisible };
2866
+ }
2867
+ var useIsAtTop = () => {
2868
+ const [isAtTop, setIsAtTop] = React66.useState(true);
2869
+ React66.useEffect(() => {
2870
+ const handleScroll = () => setIsAtTop(window.scrollY === 0);
2871
+ window.addEventListener("scroll", handleScroll, { passive: true });
2872
+ return () => window.removeEventListener("scroll", handleScroll);
2873
+ }, []);
2874
+ return isAtTop;
2875
+ };
2876
+
2877
+ // src/widgets/Navigation/Navigation.module.scss
2878
+ var Navigation_module_default = {
2879
+ dropdownTitle: "Navigation_module_dropdownTitle",
2880
+ dropdownLink: "Navigation_module_dropdownLink",
2881
+ dropdownDescription: "Navigation_module_dropdownDescription",
2882
+ mobileItemLink: "Navigation_module_mobileItemLink",
2883
+ mobileItemTrigger: "Navigation_module_mobileItemTrigger",
2884
+ mobileSubLink: "Navigation_module_mobileSubLink",
2885
+ navigationWrapper: "Navigation_module_navigationWrapper",
2886
+ dropdownOpen: "Navigation_module_dropdownOpen",
2887
+ variantTransparent: "Navigation_module_variantTransparent",
2888
+ transparent: "Navigation_module_transparent",
2889
+ navigation: "Navigation_module_navigation",
2890
+ upperNav: "Navigation_module_upperNav",
2891
+ mainLogo: "Navigation_module_mainLogo",
2892
+ mainLogoLink: "Navigation_module_mainLogoLink",
2893
+ upperRight: "Navigation_module_upperRight",
2894
+ lowerNav: "Navigation_module_lowerNav",
2895
+ lowerNavItem: "Navigation_module_lowerNavItem",
2896
+ overlay: "Navigation_module_overlay",
2897
+ dropdownTrigger: "Navigation_module_dropdownTrigger",
2898
+ dropdownTriggerOpen: "Navigation_module_dropdownTriggerOpen",
2899
+ dropdownPanel: "Navigation_module_dropdownPanel",
2900
+ dropdownPanelOpen: "Navigation_module_dropdownPanelOpen",
2901
+ dropdownInner: "Navigation_module_dropdownInner",
2902
+ dropdownLinks: "Navigation_module_dropdownLinks",
2903
+ dropdownLinkContainer: "Navigation_module_dropdownLinkContainer",
2904
+ dropdownInfo: "Navigation_module_dropdownInfo",
2905
+ mainLogoMobile: "Navigation_module_mainLogoMobile",
2906
+ hamburgerButton: "Navigation_module_hamburgerButton",
2907
+ mobileMenu: "Navigation_module_mobileMenu",
2908
+ mobileMenuOpen: "Navigation_module_mobileMenuOpen",
2909
+ mobileMenuHeader: "Navigation_module_mobileMenuHeader",
2910
+ mobileMenuItems: "Navigation_module_mobileMenuItems",
2911
+ mobileItem: "Navigation_module_mobileItem",
2912
+ mobileItemChevron: "Navigation_module_mobileItemChevron",
2913
+ mobileItemChevronOpen: "Navigation_module_mobileItemChevronOpen",
2914
+ mobileSubItems: "Navigation_module_mobileSubItems",
2915
+ mobileSubItemsOpen: "Navigation_module_mobileSubItemsOpen",
2916
+ mobileSubItemsInner: "Navigation_module_mobileSubItemsInner",
2917
+ mobileMenuCtas: "Navigation_module_mobileMenuCtas"
2918
+ };
2919
+ var NavigationDesktop = ({
2920
+ navigationItems,
2921
+ isTransparent,
2922
+ onDropdownOpenChange
2923
+ }) => {
2924
+ var _a;
2925
+ const [activeDropdown, setActiveDropdown] = React66.useState(null);
2926
+ const closeTimer = React66.useRef(null);
2927
+ const dropdownWrapperRefs = React66.useRef([]);
2928
+ const baseId = React66.useId();
2929
+ const setDropdown = (index) => {
2930
+ setActiveDropdown(index);
2931
+ onDropdownOpenChange == null ? void 0 : onDropdownOpenChange(index !== null);
2932
+ };
2933
+ const handleDropdownEnter = (index) => {
2934
+ if (closeTimer.current) clearTimeout(closeTimer.current);
2935
+ setDropdown(index);
2936
+ };
2937
+ const handleDropdownLeave = () => {
2938
+ closeTimer.current = setTimeout(() => setDropdown(null), 100);
2939
+ };
2940
+ const handleDropdownBlur = (e, index) => {
2941
+ if (!e.currentTarget.contains(e.relatedTarget)) {
2942
+ if (activeDropdown === index) setDropdown(null);
2943
+ }
2944
+ };
2945
+ const handleTriggerKeyDown = (e, index) => {
2946
+ if (e.key === "Escape") {
2947
+ setDropdown(null);
2948
+ } else if ((e.key === "Enter" || e.key === " ") && activeDropdown !== index) {
2949
+ e.preventDefault();
2950
+ setDropdown(index);
2951
+ }
2952
+ };
2953
+ const handleDropdownKeyDown = (e, index) => {
2954
+ var _a2, _b;
2955
+ if (e.key === "Escape") {
2956
+ setDropdown(null);
2957
+ (_b = (_a2 = dropdownWrapperRefs.current[index]) == null ? void 0 : _a2.querySelector("button")) == null ? void 0 : _b.focus();
2958
+ }
2959
+ };
2960
+ if (!((_a = navigationItems == null ? void 0 : navigationItems.items) == null ? void 0 : _a.length)) return null;
2961
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: Navigation_module_default.lowerNav, children: navigationItems.items.map((item, index) => {
2962
+ var _a2, _b, _c;
2963
+ const panelId = `${baseId}-panel-${index}`;
2964
+ const isOpen = activeDropdown === index;
2965
+ return item.type === "dropdown" ? /* @__PURE__ */ jsxRuntime.jsxs(
2966
+ "li",
2967
+ {
2968
+ className: Navigation_module_default.lowerNavItem,
2969
+ ref: (el) => {
2970
+ dropdownWrapperRefs.current[index] = el;
2971
+ },
2972
+ onBlur: (e) => handleDropdownBlur(e, index),
2973
+ children: [
2974
+ /* @__PURE__ */ jsxRuntime.jsx(
2975
+ Button,
2976
+ {
2977
+ variant: "navnofillblack",
2978
+ className: clsx16__default.default(Navigation_module_default.dropdownTrigger, { [Navigation_module_default.dropdownTriggerOpen]: isOpen }),
2979
+ icon: isTransparent ? "downChevronWhite" : "downChevronBlack",
2980
+ isActive: isOpen,
2981
+ "aria-expanded": isOpen,
2982
+ "aria-haspopup": "true",
2983
+ "aria-controls": panelId,
2984
+ onMouseEnter: () => handleDropdownEnter(index),
2985
+ onMouseLeave: handleDropdownLeave,
2986
+ onClick: () => setDropdown(isOpen ? null : index),
2987
+ onKeyDown: (e) => handleTriggerKeyDown(e, index),
2988
+ children: item.title
2989
+ }
2990
+ ),
2991
+ /* @__PURE__ */ jsxRuntime.jsx(
2992
+ "div",
2993
+ {
2994
+ id: panelId,
2995
+ className: clsx16__default.default(Navigation_module_default.dropdownPanel, { [Navigation_module_default.dropdownPanelOpen]: isOpen }),
2996
+ "aria-hidden": !isOpen,
2997
+ onMouseEnter: () => handleDropdownEnter(index),
2998
+ onMouseLeave: handleDropdownLeave,
2999
+ onKeyDown: (e) => handleDropdownKeyDown(e, index),
3000
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.dropdownInner, children: [
3001
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: Navigation_module_default.dropdownLinks, children: item.items.map(
3002
+ (subItem, i) => {
3003
+ var _a3, _b2;
3004
+ return subItem.type === "link" ? /* @__PURE__ */ jsxRuntime.jsx("li", { className: Navigation_module_default.dropdownLinkContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
3005
+ "a",
3006
+ {
3007
+ href: (_a3 = subItem.cta) == null ? void 0 : _a3.url,
3008
+ className: Navigation_module_default.dropdownLink,
3009
+ tabIndex: isOpen ? void 0 : -1,
3010
+ children: (_b2 = subItem.cta) == null ? void 0 : _b2.label
3011
+ }
3012
+ ) }, i) : null;
3013
+ }
3014
+ ) }),
3015
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.dropdownInfo, children: [
3016
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: Navigation_module_default.dropdownTitle, children: item.title }),
3017
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: Navigation_module_default.dropdownDescription, children: item.description })
3018
+ ] })
3019
+ ] })
3020
+ }
3021
+ )
3022
+ ]
3023
+ },
3024
+ index
3025
+ ) : /* @__PURE__ */ jsxRuntime.jsx("li", { className: Navigation_module_default.lowerNavItem, children: /* @__PURE__ */ jsxRuntime.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);
3026
+ }) });
3027
+ };
3028
+ var NavigationLogo = ({
3029
+ mainLogo,
3030
+ homeCta,
3031
+ className,
3032
+ onClick,
3033
+ logoAlt = "Home"
3034
+ }) => {
3035
+ if (!mainLogo) return null;
3036
+ if (homeCta) {
3037
+ return /* @__PURE__ */ jsxRuntime.jsx("a", { href: homeCta, className: Navigation_module_default.mainLogoLink, onClick, "aria-label": logoAlt, children: /* @__PURE__ */ jsxRuntime.jsx(Picture, { className, src: mainLogo, alt: logoAlt || "" }) });
3038
+ }
3039
+ return /* @__PURE__ */ jsxRuntime.jsx(Picture, { className, src: mainLogo, alt: logoAlt });
3040
+ };
3041
+ var NavigationCtas = ({
3042
+ loginCta,
3043
+ rightButton,
3044
+ loginVariant,
3045
+ className
3046
+ }) => {
3047
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
3048
+ (loginCta == null ? void 0 : loginCta.label) && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: loginVariant, href: loginCta.url, isExternal: loginCta.isExternal, children: loginCta.label }),
3049
+ (rightButton == null ? void 0 : rightButton.label) && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", href: rightButton.url, isExternal: rightButton.isExternal, children: rightButton.label })
3050
+ ] });
3051
+ };
3052
+ var NavigationMobile = ({
3053
+ id,
3054
+ navigationItems,
3055
+ mainLogo,
3056
+ homeCta,
3057
+ loginCta,
3058
+ rightButton,
3059
+ isOpen,
3060
+ onClose
3061
+ }) => {
3062
+ var _a;
3063
+ const [expanded, setExpanded] = React66.useState([]);
3064
+ const baseId = React66.useId();
3065
+ const toggleExpanded = (index) => {
3066
+ setExpanded((prev) => prev.includes(index) ? prev.filter((i) => i !== index) : [...prev, index]);
3067
+ };
3068
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3069
+ "div",
3070
+ {
3071
+ id,
3072
+ className: clsx16__default.default(Navigation_module_default.mobileMenu, isOpen && Navigation_module_default.mobileMenuOpen),
3073
+ role: "dialog",
3074
+ "aria-modal": "true",
3075
+ "aria-label": "Navigation menu",
3076
+ "aria-hidden": !isOpen,
3077
+ children: [
3078
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.mobileMenuHeader, children: [
3079
+ /* @__PURE__ */ jsxRuntime.jsx(
3080
+ NavigationLogo,
3081
+ {
3082
+ mainLogo,
3083
+ homeCta,
3084
+ className: Navigation_module_default.mainLogoMobile,
3085
+ onClick: onClose
3086
+ }
3087
+ ),
3088
+ /* @__PURE__ */ jsxRuntime.jsx(
3089
+ "button",
3090
+ {
3091
+ type: "button",
3092
+ className: Navigation_module_default.hamburgerButton,
3093
+ onClick: onClose,
3094
+ "aria-label": "Close navigation menu",
3095
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { type: "xBlack", size: 24, "aria-hidden": "true" })
3096
+ }
3097
+ )
3098
+ ] }),
3099
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: Navigation_module_default.mobileMenuItems, children: (_a = navigationItems == null ? void 0 : navigationItems.items) == null ? void 0 : _a.map((item, index) => {
3100
+ var _a2, _b;
3101
+ const subMenuId = `${baseId}-submenu-${index}`;
3102
+ const isExpanded = expanded.includes(index);
3103
+ return item.type === "dropdown" ? /* @__PURE__ */ jsxRuntime.jsxs("li", { className: Navigation_module_default.mobileItem, children: [
3104
+ /* @__PURE__ */ jsxRuntime.jsxs(
3105
+ "button",
3106
+ {
3107
+ type: "button",
3108
+ className: Navigation_module_default.mobileItemTrigger,
3109
+ onClick: () => toggleExpanded(index),
3110
+ "aria-expanded": isExpanded,
3111
+ "aria-controls": subMenuId,
3112
+ children: [
3113
+ item.title,
3114
+ /* @__PURE__ */ jsxRuntime.jsx(
3115
+ "span",
3116
+ {
3117
+ className: clsx16__default.default(
3118
+ Navigation_module_default.mobileItemChevron,
3119
+ isExpanded && Navigation_module_default.mobileItemChevronOpen
3120
+ ),
3121
+ "aria-hidden": "true",
3122
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { type: "downChevronBlack", size: 24 })
3123
+ }
3124
+ )
3125
+ ]
3126
+ }
3127
+ ),
3128
+ /* @__PURE__ */ jsxRuntime.jsx(
3129
+ "div",
3130
+ {
3131
+ id: subMenuId,
3132
+ className: clsx16__default.default(Navigation_module_default.mobileSubItems, isExpanded && Navigation_module_default.mobileSubItemsOpen),
3133
+ children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: Navigation_module_default.mobileSubItemsInner, children: item.items.map(
3134
+ (subItem, i) => {
3135
+ var _a3, _b2;
3136
+ return subItem.type === "link" ? /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
3137
+ "a",
3138
+ {
3139
+ href: (_a3 = subItem.cta) == null ? void 0 : _a3.url,
3140
+ className: Navigation_module_default.mobileSubLink,
3141
+ onClick: onClose,
3142
+ children: (_b2 = subItem.cta) == null ? void 0 : _b2.label
3143
+ }
3144
+ ) }, i) : null;
3145
+ }
3146
+ ) })
3147
+ }
3148
+ )
3149
+ ] }, index) : /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.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);
3150
+ }) }),
3151
+ /* @__PURE__ */ jsxRuntime.jsx(
3152
+ NavigationCtas,
3153
+ {
3154
+ className: Navigation_module_default.mobileMenuCtas,
3155
+ loginCta,
3156
+ rightButton,
3157
+ loginVariant: "nofillblack"
3158
+ }
3159
+ )
3160
+ ]
3161
+ }
3162
+ );
3163
+ };
3164
+ var Navigation2 = (props) => {
3165
+ const { className, variant, homeCta, loginCta, mainLogo, rightButton, navigationItems } = props;
3166
+ const [isHovered, setIsHovered] = React66.useState(false);
3167
+ const [hasOpenDropdown, setHasOpenDropdown] = React66.useState(false);
3168
+ const [isMobileMenuOpen, setIsMobileMenuOpen] = React66.useState(false);
3169
+ const isAtTop = useIsAtTop();
3170
+ const { is } = useViewPort_default();
3171
+ const mobileMenuId = React66.useId();
3172
+ const isTabletBelow = is("tablet", "below");
3173
+ const isTransparent = variant === "transparent" && isAtTop && !isHovered && !hasOpenDropdown;
3174
+ React66.useEffect(() => {
3175
+ document.body.style.overflow = isMobileMenuOpen ? "hidden" : "";
3176
+ return () => {
3177
+ document.body.style.overflow = "";
3178
+ };
3179
+ }, [isMobileMenuOpen]);
3180
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3181
+ /* @__PURE__ */ jsxRuntime.jsx(
3182
+ "div",
3183
+ {
3184
+ className: clsx16__default.default(
3185
+ Navigation_module_default.navigationWrapper,
3186
+ variant === "transparent" && Navigation_module_default.variantTransparent,
3187
+ isTransparent && Navigation_module_default.transparent,
3188
+ hasOpenDropdown && !isTabletBelow && Navigation_module_default.dropdownOpen
3189
+ ),
3190
+ onMouseEnter: () => setIsHovered(true),
3191
+ onMouseLeave: () => setIsHovered(false),
3192
+ children: /* @__PURE__ */ jsxRuntime.jsxs("nav", { className: clsx16__default.default(Navigation_module_default.navigation, className), "aria-label": "Main", children: [
3193
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.upperNav, children: [
3194
+ /* @__PURE__ */ jsxRuntime.jsx(
3195
+ NavigationLogo,
3196
+ {
3197
+ mainLogo,
3198
+ homeCta,
3199
+ className: clsx16__default.default(Navigation_module_default.mainLogo, isTabletBelow && Navigation_module_default.mainLogoMobile)
3200
+ }
3201
+ ),
3202
+ isTabletBelow ? /* @__PURE__ */ jsxRuntime.jsx(
3203
+ "button",
3204
+ {
3205
+ type: "button",
3206
+ className: Navigation_module_default.hamburgerButton,
3207
+ onClick: () => setIsMobileMenuOpen(true),
3208
+ "aria-label": "Open navigation menu",
3209
+ "aria-haspopup": "dialog",
3210
+ "aria-expanded": isMobileMenuOpen,
3211
+ "aria-controls": mobileMenuId,
3212
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3213
+ Icon,
3214
+ {
3215
+ type: isTransparent ? "menuWhite" : "menuBlack",
3216
+ size: 24,
3217
+ "aria-hidden": "true"
3218
+ }
3219
+ )
3220
+ }
3221
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
3222
+ NavigationCtas,
3223
+ {
3224
+ className: Navigation_module_default.upperRight,
3225
+ loginCta,
3226
+ rightButton,
3227
+ loginVariant: isTransparent ? "ghost" : "nofillblack"
3228
+ }
3229
+ )
3230
+ ] }),
3231
+ isTabletBelow ? /* @__PURE__ */ jsxRuntime.jsx(
3232
+ NavigationMobile,
3233
+ {
3234
+ id: mobileMenuId,
3235
+ navigationItems,
3236
+ mainLogo,
3237
+ homeCta,
3238
+ loginCta,
3239
+ rightButton,
3240
+ isOpen: isMobileMenuOpen,
3241
+ onClose: () => setIsMobileMenuOpen(false)
3242
+ }
3243
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
3244
+ NavigationDesktop,
3245
+ {
3246
+ navigationItems,
3247
+ isTransparent,
3248
+ onDropdownOpenChange: setHasOpenDropdown
3249
+ }
3250
+ )
3251
+ ] })
3252
+ }
3253
+ ),
3254
+ hasOpenDropdown && !isTabletBelow && /* @__PURE__ */ jsxRuntime.jsx("div", { className: Navigation_module_default.overlay, "aria-hidden": "true" })
3255
+ ] });
3256
+ };
2802
3257
  var PracticePathCardsFooter = ({ children }) => {
2803
3258
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
2804
3259
  };
@@ -2951,7 +3406,7 @@ var Teaser5050WithCta = ({
2951
3406
  titleNode && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx16__default.default(Teaser5050WithCta_module_default.title, "h3"), children: titleNode }),
2952
3407
  subtitleNode && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "subheading", children: subtitleNode })
2953
3408
  ] }),
2954
- (ctas == null ? void 0 : ctas.length) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: Teaser5050WithCta_module_default.ctaWrapper, children: ctas.map((cta, key) => /* @__PURE__ */ jsxRuntime.jsx(
3409
+ ctas && (ctas == null ? void 0 : ctas.length) > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: Teaser5050WithCta_module_default.ctaWrapper, children: ctas.map((cta, key) => /* @__PURE__ */ jsxRuntime.jsx(
2955
3410
  Button,
2956
3411
  {
2957
3412
  className: Teaser5050WithCta_module_default.cta,
@@ -3999,34 +4454,6 @@ var GlobalSearchResultsList2 = Object.assign(GlobalSearchResultsList, {
3999
4454
  Search: GlobalSearchResultsListSearch,
4000
4455
  Pagination: GlobalSearchResultsListPagination
4001
4456
  });
4002
- function useIntersectionObserver({
4003
- animateOnce = false,
4004
- options = {}
4005
- } = {}) {
4006
- const observeRef = React66.useRef(null);
4007
- const [isVisible, setIsVisible] = React66.useState(false);
4008
- if (typeof IntersectionObserver === "undefined") {
4009
- console.warn("IntersectionObserver is not supported in this browser.");
4010
- return { observeRef, isVisible: true };
4011
- }
4012
- React66.useEffect(() => {
4013
- const currentRef = observeRef.current;
4014
- if (!currentRef) return;
4015
- const observer = new IntersectionObserver((entries) => {
4016
- const entry = entries[0];
4017
- if (!entry) return;
4018
- setIsVisible(entry.isIntersecting);
4019
- if (entry.isIntersecting && animateOnce) {
4020
- observer.disconnect();
4021
- }
4022
- }, options);
4023
- observer.observe(currentRef);
4024
- return () => {
4025
- observer.disconnect();
4026
- };
4027
- }, [observeRef, animateOnce, options]);
4028
- return { observeRef, isVisible };
4029
- }
4030
4457
 
4031
4458
  exports.Anchor = Anchor;
4032
4459
  exports.Badge = Badge;
@@ -4055,6 +4482,7 @@ exports.Input = Input;
4055
4482
  exports.InternalBrandsTab = InternalBrandsTab2;
4056
4483
  exports.MiniBanner = MiniBanner2;
4057
4484
  exports.MiniSectionCta = MiniSectionCta2;
4485
+ exports.Navigation = Navigation2;
4058
4486
  exports.NewsCard = NewsCard;
4059
4487
  exports.NewsCardList = NewsCardList2;
4060
4488
  exports.Pagination = Pagination;
@@ -4073,5 +4501,6 @@ exports.UpcomingEventCard = UpcomingEventCard;
4073
4501
  exports.resolveCompoundSlots = resolveCompoundSlots;
4074
4502
  exports.svgs = svgs;
4075
4503
  exports.useIntersectionObserver = useIntersectionObserver;
4504
+ exports.useIsAtTop = useIsAtTop;
4076
4505
  //# sourceMappingURL=index.cjs.map
4077
4506
  //# sourceMappingURL=index.cjs.map