@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/LICENSE.txt +21 -21
- package/README.md +52 -52
- package/dist/index.cjs +422 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +430 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +32 -2
- package/dist/index.d.ts +32 -2
- package/dist/index.mjs +421 -30
- package/dist/index.mjs.map +1 -1
- package/dist/types/global.d.ts +25 -25
- package/package.json +100 -100
package/LICENSE.txt
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Luxottica
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Luxottica
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
# CoreUI Kit
|
|
2
|
-
|
|
3
|
-
A React‑based design system and component library.
|
|
4
|
-
|
|
5
|
-
## 🚀 Getting Started
|
|
6
|
-
|
|
7
|
-
Install
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Development
|
|
14
|
-
|
|
15
|
-
- Run the build in watch mode
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm run dev
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Start Storybook
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npm run storybook
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Run tests
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm test
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Lint/format
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
npm run lint
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## 🛠️ Usage
|
|
40
|
-
|
|
41
|
-
Import components in other projects:
|
|
42
|
-
|
|
43
|
-
```ts
|
|
44
|
-
import '@digital-b2c/coreui-kit/styles.css'
|
|
45
|
-
|
|
46
|
-
import { MiniSectionCta } from '@digital-b2c/coreui-kit'
|
|
47
|
-
|
|
48
|
-
<MiniSectionCta>
|
|
49
|
-
<MiniSectionCta.Title>Header</MiniSectionCta.Title>
|
|
50
|
-
<MiniSectionCta.Subtitle>Description</MiniSectionCta.Subtitle>
|
|
51
|
-
</MiniSectionCta>
|
|
52
|
-
```
|
|
1
|
+
# CoreUI Kit
|
|
2
|
+
|
|
3
|
+
A React‑based design system and component library.
|
|
4
|
+
|
|
5
|
+
## 🚀 Getting Started
|
|
6
|
+
|
|
7
|
+
Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Development
|
|
14
|
+
|
|
15
|
+
- Run the build in watch mode
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm run dev
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Start Storybook
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run storybook
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Run tests
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Lint/format
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm run lint
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 🛠️ Usage
|
|
40
|
+
|
|
41
|
+
Import components in other projects:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import '@digital-b2c/coreui-kit/styles.css'
|
|
45
|
+
|
|
46
|
+
import { MiniSectionCta } from '@digital-b2c/coreui-kit'
|
|
47
|
+
|
|
48
|
+
<MiniSectionCta>
|
|
49
|
+
<MiniSectionCta.Title>Header</MiniSectionCta.Title>
|
|
50
|
+
<MiniSectionCta.Subtitle>Description</MiniSectionCta.Subtitle>
|
|
51
|
+
</MiniSectionCta>
|
|
52
|
+
```
|
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
|
};
|
|
@@ -2799,6 +2800,424 @@ var MiniSectionCta2 = Object.assign(MiniSectionCta, {
|
|
|
2799
2800
|
Title: MiniSectionCtaTitle,
|
|
2800
2801
|
Subtitle: MiniSectionCtaSubtitle
|
|
2801
2802
|
});
|
|
2803
|
+
function useIntersectionObserver({
|
|
2804
|
+
animateOnce = false,
|
|
2805
|
+
options = {}
|
|
2806
|
+
} = {}) {
|
|
2807
|
+
const observeRef = React66.useRef(null);
|
|
2808
|
+
const [isVisible, setIsVisible] = React66.useState(false);
|
|
2809
|
+
if (typeof IntersectionObserver === "undefined") {
|
|
2810
|
+
console.warn("IntersectionObserver is not supported in this browser.");
|
|
2811
|
+
return { observeRef, isVisible: true };
|
|
2812
|
+
}
|
|
2813
|
+
React66.useEffect(() => {
|
|
2814
|
+
const currentRef = observeRef.current;
|
|
2815
|
+
if (!currentRef) return;
|
|
2816
|
+
const observer = new IntersectionObserver((entries) => {
|
|
2817
|
+
const entry = entries[0];
|
|
2818
|
+
if (!entry) return;
|
|
2819
|
+
setIsVisible(entry.isIntersecting);
|
|
2820
|
+
if (entry.isIntersecting && animateOnce) {
|
|
2821
|
+
observer.disconnect();
|
|
2822
|
+
}
|
|
2823
|
+
}, options);
|
|
2824
|
+
observer.observe(currentRef);
|
|
2825
|
+
return () => {
|
|
2826
|
+
observer.disconnect();
|
|
2827
|
+
};
|
|
2828
|
+
}, [observeRef, animateOnce, options]);
|
|
2829
|
+
return { observeRef, isVisible };
|
|
2830
|
+
}
|
|
2831
|
+
var useIsAtTop = () => {
|
|
2832
|
+
const [isAtTop, setIsAtTop] = React66.useState(true);
|
|
2833
|
+
React66.useEffect(() => {
|
|
2834
|
+
const handleScroll = () => setIsAtTop(window.scrollY === 0);
|
|
2835
|
+
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
2836
|
+
return () => window.removeEventListener("scroll", handleScroll);
|
|
2837
|
+
}, []);
|
|
2838
|
+
return isAtTop;
|
|
2839
|
+
};
|
|
2840
|
+
|
|
2841
|
+
// src/widgets/Navigation/Navigation.module.scss
|
|
2842
|
+
var Navigation_module_default = {
|
|
2843
|
+
dropdownTitle: "Navigation_module_dropdownTitle",
|
|
2844
|
+
dropdownLink: "Navigation_module_dropdownLink",
|
|
2845
|
+
dropdownDescription: "Navigation_module_dropdownDescription",
|
|
2846
|
+
mobileItemLink: "Navigation_module_mobileItemLink",
|
|
2847
|
+
mobileItemTrigger: "Navigation_module_mobileItemTrigger",
|
|
2848
|
+
mobileSubLink: "Navigation_module_mobileSubLink",
|
|
2849
|
+
navigationWrapper: "Navigation_module_navigationWrapper",
|
|
2850
|
+
dropdownOpen: "Navigation_module_dropdownOpen",
|
|
2851
|
+
variantTransparent: "Navigation_module_variantTransparent",
|
|
2852
|
+
transparent: "Navigation_module_transparent",
|
|
2853
|
+
navigation: "Navigation_module_navigation",
|
|
2854
|
+
upperNav: "Navigation_module_upperNav",
|
|
2855
|
+
mainLogo: "Navigation_module_mainLogo",
|
|
2856
|
+
mainLogoLink: "Navigation_module_mainLogoLink",
|
|
2857
|
+
upperRight: "Navigation_module_upperRight",
|
|
2858
|
+
lowerNav: "Navigation_module_lowerNav",
|
|
2859
|
+
lowerNavItem: "Navigation_module_lowerNavItem",
|
|
2860
|
+
overlay: "Navigation_module_overlay",
|
|
2861
|
+
dropdownTrigger: "Navigation_module_dropdownTrigger",
|
|
2862
|
+
dropdownTriggerOpen: "Navigation_module_dropdownTriggerOpen",
|
|
2863
|
+
dropdownPanel: "Navigation_module_dropdownPanel",
|
|
2864
|
+
dropdownPanelOpen: "Navigation_module_dropdownPanelOpen",
|
|
2865
|
+
dropdownInner: "Navigation_module_dropdownInner",
|
|
2866
|
+
dropdownLinks: "Navigation_module_dropdownLinks",
|
|
2867
|
+
dropdownLinkContainer: "Navigation_module_dropdownLinkContainer",
|
|
2868
|
+
dropdownInfo: "Navigation_module_dropdownInfo",
|
|
2869
|
+
mainLogoMobile: "Navigation_module_mainLogoMobile",
|
|
2870
|
+
hamburgerButton: "Navigation_module_hamburgerButton",
|
|
2871
|
+
mobileMenu: "Navigation_module_mobileMenu",
|
|
2872
|
+
mobileMenuOpen: "Navigation_module_mobileMenuOpen",
|
|
2873
|
+
mobileMenuHeader: "Navigation_module_mobileMenuHeader",
|
|
2874
|
+
mobileMenuItems: "Navigation_module_mobileMenuItems",
|
|
2875
|
+
mobileItem: "Navigation_module_mobileItem",
|
|
2876
|
+
mobileItemChevron: "Navigation_module_mobileItemChevron",
|
|
2877
|
+
mobileItemChevronOpen: "Navigation_module_mobileItemChevronOpen",
|
|
2878
|
+
mobileSubItems: "Navigation_module_mobileSubItems",
|
|
2879
|
+
mobileSubItemsOpen: "Navigation_module_mobileSubItemsOpen",
|
|
2880
|
+
mobileSubItemsInner: "Navigation_module_mobileSubItemsInner",
|
|
2881
|
+
mobileMenuCtas: "Navigation_module_mobileMenuCtas"
|
|
2882
|
+
};
|
|
2883
|
+
var NavigationDesktop = ({
|
|
2884
|
+
navigationItems,
|
|
2885
|
+
isTransparent,
|
|
2886
|
+
onDropdownOpenChange
|
|
2887
|
+
}) => {
|
|
2888
|
+
var _a;
|
|
2889
|
+
const [activeDropdown, setActiveDropdown] = React66.useState(null);
|
|
2890
|
+
const closeTimer = React66.useRef(null);
|
|
2891
|
+
const dropdownWrapperRefs = React66.useRef([]);
|
|
2892
|
+
const baseId = React66.useId();
|
|
2893
|
+
const setDropdown = (index) => {
|
|
2894
|
+
setActiveDropdown(index);
|
|
2895
|
+
onDropdownOpenChange == null ? void 0 : onDropdownOpenChange(index !== null);
|
|
2896
|
+
};
|
|
2897
|
+
const handleDropdownEnter = (index) => {
|
|
2898
|
+
if (closeTimer.current) clearTimeout(closeTimer.current);
|
|
2899
|
+
setDropdown(index);
|
|
2900
|
+
};
|
|
2901
|
+
const handleDropdownLeave = () => {
|
|
2902
|
+
closeTimer.current = setTimeout(() => setDropdown(null), 100);
|
|
2903
|
+
};
|
|
2904
|
+
const handleDropdownBlur = (e, index) => {
|
|
2905
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
2906
|
+
if (activeDropdown === index) setDropdown(null);
|
|
2907
|
+
}
|
|
2908
|
+
};
|
|
2909
|
+
const handleTriggerKeyDown = (e, index) => {
|
|
2910
|
+
if (e.key === "Escape") {
|
|
2911
|
+
setDropdown(null);
|
|
2912
|
+
} else if ((e.key === "Enter" || e.key === " ") && activeDropdown !== index) {
|
|
2913
|
+
e.preventDefault();
|
|
2914
|
+
setDropdown(index);
|
|
2915
|
+
}
|
|
2916
|
+
};
|
|
2917
|
+
const handleDropdownKeyDown = (e, index) => {
|
|
2918
|
+
var _a2, _b;
|
|
2919
|
+
if (e.key === "Escape") {
|
|
2920
|
+
setDropdown(null);
|
|
2921
|
+
(_b = (_a2 = dropdownWrapperRefs.current[index]) == null ? void 0 : _a2.querySelector("button")) == null ? void 0 : _b.focus();
|
|
2922
|
+
}
|
|
2923
|
+
};
|
|
2924
|
+
if (!((_a = navigationItems == null ? void 0 : navigationItems.items) == null ? void 0 : _a.length)) return null;
|
|
2925
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: Navigation_module_default.lowerNav, children: navigationItems.items.map((item, index) => {
|
|
2926
|
+
var _a2, _b, _c;
|
|
2927
|
+
const panelId = `${baseId}-panel-${index}`;
|
|
2928
|
+
const isOpen = activeDropdown === index;
|
|
2929
|
+
return item.type === "dropdown" ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2930
|
+
"li",
|
|
2931
|
+
{
|
|
2932
|
+
className: Navigation_module_default.lowerNavItem,
|
|
2933
|
+
ref: (el) => {
|
|
2934
|
+
dropdownWrapperRefs.current[index] = el;
|
|
2935
|
+
},
|
|
2936
|
+
onBlur: (e) => handleDropdownBlur(e, index),
|
|
2937
|
+
children: [
|
|
2938
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2939
|
+
Button,
|
|
2940
|
+
{
|
|
2941
|
+
variant: "navnofillblack",
|
|
2942
|
+
className: clsx16__default.default(Navigation_module_default.dropdownTrigger, { [Navigation_module_default.dropdownTriggerOpen]: isOpen }),
|
|
2943
|
+
icon: isTransparent ? "downChevronWhite" : "downChevronBlack",
|
|
2944
|
+
isActive: isOpen,
|
|
2945
|
+
"aria-expanded": isOpen,
|
|
2946
|
+
"aria-haspopup": "true",
|
|
2947
|
+
"aria-controls": panelId,
|
|
2948
|
+
onMouseEnter: () => handleDropdownEnter(index),
|
|
2949
|
+
onMouseLeave: handleDropdownLeave,
|
|
2950
|
+
onClick: () => setDropdown(isOpen ? null : index),
|
|
2951
|
+
onKeyDown: (e) => handleTriggerKeyDown(e, index),
|
|
2952
|
+
children: item.title
|
|
2953
|
+
}
|
|
2954
|
+
),
|
|
2955
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2956
|
+
"div",
|
|
2957
|
+
{
|
|
2958
|
+
id: panelId,
|
|
2959
|
+
className: clsx16__default.default(Navigation_module_default.dropdownPanel, { [Navigation_module_default.dropdownPanelOpen]: isOpen }),
|
|
2960
|
+
"aria-hidden": !isOpen,
|
|
2961
|
+
onMouseEnter: () => handleDropdownEnter(index),
|
|
2962
|
+
onMouseLeave: handleDropdownLeave,
|
|
2963
|
+
onKeyDown: (e) => handleDropdownKeyDown(e, index),
|
|
2964
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.dropdownInner, children: [
|
|
2965
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: Navigation_module_default.dropdownLinks, children: item.items.map(
|
|
2966
|
+
(subItem, i) => {
|
|
2967
|
+
var _a3, _b2;
|
|
2968
|
+
return subItem.type === "link" ? /* @__PURE__ */ jsxRuntime.jsx("li", { className: Navigation_module_default.dropdownLinkContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2969
|
+
"a",
|
|
2970
|
+
{
|
|
2971
|
+
href: (_a3 = subItem.cta) == null ? void 0 : _a3.url,
|
|
2972
|
+
className: Navigation_module_default.dropdownLink,
|
|
2973
|
+
tabIndex: isOpen ? void 0 : -1,
|
|
2974
|
+
children: (_b2 = subItem.cta) == null ? void 0 : _b2.label
|
|
2975
|
+
}
|
|
2976
|
+
) }, i) : null;
|
|
2977
|
+
}
|
|
2978
|
+
) }),
|
|
2979
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.dropdownInfo, children: [
|
|
2980
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: Navigation_module_default.dropdownTitle, children: item.title }),
|
|
2981
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: Navigation_module_default.dropdownDescription, children: item.description })
|
|
2982
|
+
] })
|
|
2983
|
+
] })
|
|
2984
|
+
}
|
|
2985
|
+
)
|
|
2986
|
+
]
|
|
2987
|
+
},
|
|
2988
|
+
index
|
|
2989
|
+
) : /* @__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);
|
|
2990
|
+
}) });
|
|
2991
|
+
};
|
|
2992
|
+
var NavigationLogo = ({
|
|
2993
|
+
mainLogo,
|
|
2994
|
+
homeCta,
|
|
2995
|
+
className,
|
|
2996
|
+
onClick,
|
|
2997
|
+
logoAlt = "Home"
|
|
2998
|
+
}) => {
|
|
2999
|
+
if (!mainLogo) return null;
|
|
3000
|
+
if (homeCta) {
|
|
3001
|
+
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 || "" }) });
|
|
3002
|
+
}
|
|
3003
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Picture, { className, src: mainLogo, alt: logoAlt });
|
|
3004
|
+
};
|
|
3005
|
+
var NavigationCtas = ({
|
|
3006
|
+
loginCta,
|
|
3007
|
+
rightButton,
|
|
3008
|
+
loginVariant,
|
|
3009
|
+
className
|
|
3010
|
+
}) => {
|
|
3011
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
|
|
3012
|
+
(loginCta == null ? void 0 : loginCta.label) && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: loginVariant, href: loginCta.url, isExternal: loginCta.isExternal, children: loginCta.label }),
|
|
3013
|
+
(rightButton == null ? void 0 : rightButton.label) && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", href: rightButton.url, isExternal: rightButton.isExternal, children: rightButton.label })
|
|
3014
|
+
] });
|
|
3015
|
+
};
|
|
3016
|
+
var NavigationMobile = ({
|
|
3017
|
+
id,
|
|
3018
|
+
navigationItems,
|
|
3019
|
+
mainLogo,
|
|
3020
|
+
homeCta,
|
|
3021
|
+
loginCta,
|
|
3022
|
+
rightButton,
|
|
3023
|
+
isOpen,
|
|
3024
|
+
onClose
|
|
3025
|
+
}) => {
|
|
3026
|
+
var _a;
|
|
3027
|
+
const [expanded, setExpanded] = React66.useState([]);
|
|
3028
|
+
const baseId = React66.useId();
|
|
3029
|
+
const toggleExpanded = (index) => {
|
|
3030
|
+
setExpanded((prev) => prev.includes(index) ? prev.filter((i) => i !== index) : [...prev, index]);
|
|
3031
|
+
};
|
|
3032
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3033
|
+
"div",
|
|
3034
|
+
{
|
|
3035
|
+
id,
|
|
3036
|
+
className: clsx16__default.default(Navigation_module_default.mobileMenu, isOpen && Navigation_module_default.mobileMenuOpen),
|
|
3037
|
+
role: "dialog",
|
|
3038
|
+
"aria-modal": "true",
|
|
3039
|
+
"aria-label": "Navigation menu",
|
|
3040
|
+
"aria-hidden": !isOpen,
|
|
3041
|
+
children: [
|
|
3042
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.mobileMenuHeader, children: [
|
|
3043
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3044
|
+
NavigationLogo,
|
|
3045
|
+
{
|
|
3046
|
+
mainLogo,
|
|
3047
|
+
homeCta,
|
|
3048
|
+
className: Navigation_module_default.mainLogoMobile,
|
|
3049
|
+
onClick: onClose
|
|
3050
|
+
}
|
|
3051
|
+
),
|
|
3052
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3053
|
+
"button",
|
|
3054
|
+
{
|
|
3055
|
+
type: "button",
|
|
3056
|
+
className: Navigation_module_default.hamburgerButton,
|
|
3057
|
+
onClick: onClose,
|
|
3058
|
+
"aria-label": "Close navigation menu",
|
|
3059
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { type: "xBlack", size: 24, "aria-hidden": "true" })
|
|
3060
|
+
}
|
|
3061
|
+
)
|
|
3062
|
+
] }),
|
|
3063
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: Navigation_module_default.mobileMenuItems, children: (_a = navigationItems == null ? void 0 : navigationItems.items) == null ? void 0 : _a.map((item, index) => {
|
|
3064
|
+
var _a2, _b;
|
|
3065
|
+
const subMenuId = `${baseId}-submenu-${index}`;
|
|
3066
|
+
const isExpanded = expanded.includes(index);
|
|
3067
|
+
return item.type === "dropdown" ? /* @__PURE__ */ jsxRuntime.jsxs("li", { className: Navigation_module_default.mobileItem, children: [
|
|
3068
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3069
|
+
"button",
|
|
3070
|
+
{
|
|
3071
|
+
type: "button",
|
|
3072
|
+
className: Navigation_module_default.mobileItemTrigger,
|
|
3073
|
+
onClick: () => toggleExpanded(index),
|
|
3074
|
+
"aria-expanded": isExpanded,
|
|
3075
|
+
"aria-controls": subMenuId,
|
|
3076
|
+
children: [
|
|
3077
|
+
item.title,
|
|
3078
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3079
|
+
"span",
|
|
3080
|
+
{
|
|
3081
|
+
className: clsx16__default.default(
|
|
3082
|
+
Navigation_module_default.mobileItemChevron,
|
|
3083
|
+
isExpanded && Navigation_module_default.mobileItemChevronOpen
|
|
3084
|
+
),
|
|
3085
|
+
"aria-hidden": "true",
|
|
3086
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { type: "downChevronBlack", size: 24 })
|
|
3087
|
+
}
|
|
3088
|
+
)
|
|
3089
|
+
]
|
|
3090
|
+
}
|
|
3091
|
+
),
|
|
3092
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3093
|
+
"div",
|
|
3094
|
+
{
|
|
3095
|
+
id: subMenuId,
|
|
3096
|
+
className: clsx16__default.default(Navigation_module_default.mobileSubItems, isExpanded && Navigation_module_default.mobileSubItemsOpen),
|
|
3097
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: Navigation_module_default.mobileSubItemsInner, children: item.items.map(
|
|
3098
|
+
(subItem, i) => {
|
|
3099
|
+
var _a3, _b2;
|
|
3100
|
+
return subItem.type === "link" ? /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3101
|
+
"a",
|
|
3102
|
+
{
|
|
3103
|
+
href: (_a3 = subItem.cta) == null ? void 0 : _a3.url,
|
|
3104
|
+
className: Navigation_module_default.mobileSubLink,
|
|
3105
|
+
onClick: onClose,
|
|
3106
|
+
children: (_b2 = subItem.cta) == null ? void 0 : _b2.label
|
|
3107
|
+
}
|
|
3108
|
+
) }, i) : null;
|
|
3109
|
+
}
|
|
3110
|
+
) })
|
|
3111
|
+
}
|
|
3112
|
+
)
|
|
3113
|
+
] }, 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);
|
|
3114
|
+
}) }),
|
|
3115
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3116
|
+
NavigationCtas,
|
|
3117
|
+
{
|
|
3118
|
+
className: Navigation_module_default.mobileMenuCtas,
|
|
3119
|
+
loginCta,
|
|
3120
|
+
rightButton,
|
|
3121
|
+
loginVariant: "nofillblack"
|
|
3122
|
+
}
|
|
3123
|
+
)
|
|
3124
|
+
]
|
|
3125
|
+
}
|
|
3126
|
+
);
|
|
3127
|
+
};
|
|
3128
|
+
var Navigation2 = (props) => {
|
|
3129
|
+
const { className, variant, homeCta, loginCta, mainLogo, rightButton, navigationItems } = props;
|
|
3130
|
+
const [isHovered, setIsHovered] = React66.useState(false);
|
|
3131
|
+
const [hasOpenDropdown, setHasOpenDropdown] = React66.useState(false);
|
|
3132
|
+
const [isMobileMenuOpen, setIsMobileMenuOpen] = React66.useState(false);
|
|
3133
|
+
const isAtTop = useIsAtTop();
|
|
3134
|
+
const { is } = useViewPort_default();
|
|
3135
|
+
const mobileMenuId = React66.useId();
|
|
3136
|
+
const isTabletBelow = is("tablet", "below");
|
|
3137
|
+
const isTransparent = variant === "transparent" && isAtTop && !isHovered && !hasOpenDropdown;
|
|
3138
|
+
React66.useEffect(() => {
|
|
3139
|
+
document.body.style.overflow = isMobileMenuOpen ? "hidden" : "";
|
|
3140
|
+
return () => {
|
|
3141
|
+
document.body.style.overflow = "";
|
|
3142
|
+
};
|
|
3143
|
+
}, [isMobileMenuOpen]);
|
|
3144
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3145
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3146
|
+
"div",
|
|
3147
|
+
{
|
|
3148
|
+
className: clsx16__default.default(
|
|
3149
|
+
Navigation_module_default.navigationWrapper,
|
|
3150
|
+
variant === "transparent" && Navigation_module_default.variantTransparent,
|
|
3151
|
+
isTransparent && Navigation_module_default.transparent,
|
|
3152
|
+
hasOpenDropdown && !isTabletBelow && Navigation_module_default.dropdownOpen
|
|
3153
|
+
),
|
|
3154
|
+
onMouseEnter: () => setIsHovered(true),
|
|
3155
|
+
onMouseLeave: () => setIsHovered(false),
|
|
3156
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("nav", { className: clsx16__default.default(Navigation_module_default.navigation, className), "aria-label": "Main", children: [
|
|
3157
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.upperNav, children: [
|
|
3158
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3159
|
+
NavigationLogo,
|
|
3160
|
+
{
|
|
3161
|
+
mainLogo,
|
|
3162
|
+
homeCta,
|
|
3163
|
+
className: clsx16__default.default(Navigation_module_default.mainLogo, isTabletBelow && Navigation_module_default.mainLogoMobile)
|
|
3164
|
+
}
|
|
3165
|
+
),
|
|
3166
|
+
isTabletBelow ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3167
|
+
"button",
|
|
3168
|
+
{
|
|
3169
|
+
type: "button",
|
|
3170
|
+
className: Navigation_module_default.hamburgerButton,
|
|
3171
|
+
onClick: () => setIsMobileMenuOpen(true),
|
|
3172
|
+
"aria-label": "Open navigation menu",
|
|
3173
|
+
"aria-haspopup": "dialog",
|
|
3174
|
+
"aria-expanded": isMobileMenuOpen,
|
|
3175
|
+
"aria-controls": mobileMenuId,
|
|
3176
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3177
|
+
Icon,
|
|
3178
|
+
{
|
|
3179
|
+
type: isTransparent ? "menuWhite" : "menuBlack",
|
|
3180
|
+
size: 24,
|
|
3181
|
+
"aria-hidden": "true"
|
|
3182
|
+
}
|
|
3183
|
+
)
|
|
3184
|
+
}
|
|
3185
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3186
|
+
NavigationCtas,
|
|
3187
|
+
{
|
|
3188
|
+
className: Navigation_module_default.upperRight,
|
|
3189
|
+
loginCta,
|
|
3190
|
+
rightButton,
|
|
3191
|
+
loginVariant: isTransparent ? "ghost" : "nofillblack"
|
|
3192
|
+
}
|
|
3193
|
+
)
|
|
3194
|
+
] }),
|
|
3195
|
+
isTabletBelow ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3196
|
+
NavigationMobile,
|
|
3197
|
+
{
|
|
3198
|
+
id: mobileMenuId,
|
|
3199
|
+
navigationItems,
|
|
3200
|
+
mainLogo,
|
|
3201
|
+
homeCta,
|
|
3202
|
+
loginCta,
|
|
3203
|
+
rightButton,
|
|
3204
|
+
isOpen: isMobileMenuOpen,
|
|
3205
|
+
onClose: () => setIsMobileMenuOpen(false)
|
|
3206
|
+
}
|
|
3207
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3208
|
+
NavigationDesktop,
|
|
3209
|
+
{
|
|
3210
|
+
navigationItems,
|
|
3211
|
+
isTransparent,
|
|
3212
|
+
onDropdownOpenChange: setHasOpenDropdown
|
|
3213
|
+
}
|
|
3214
|
+
)
|
|
3215
|
+
] })
|
|
3216
|
+
}
|
|
3217
|
+
),
|
|
3218
|
+
hasOpenDropdown && !isTabletBelow && /* @__PURE__ */ jsxRuntime.jsx("div", { className: Navigation_module_default.overlay, "aria-hidden": "true" })
|
|
3219
|
+
] });
|
|
3220
|
+
};
|
|
2802
3221
|
var PracticePathCardsFooter = ({ children }) => {
|
|
2803
3222
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
2804
3223
|
};
|
|
@@ -3999,34 +4418,6 @@ var GlobalSearchResultsList2 = Object.assign(GlobalSearchResultsList, {
|
|
|
3999
4418
|
Search: GlobalSearchResultsListSearch,
|
|
4000
4419
|
Pagination: GlobalSearchResultsListPagination
|
|
4001
4420
|
});
|
|
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
4421
|
|
|
4031
4422
|
exports.Anchor = Anchor;
|
|
4032
4423
|
exports.Badge = Badge;
|
|
@@ -4055,6 +4446,7 @@ exports.Input = Input;
|
|
|
4055
4446
|
exports.InternalBrandsTab = InternalBrandsTab2;
|
|
4056
4447
|
exports.MiniBanner = MiniBanner2;
|
|
4057
4448
|
exports.MiniSectionCta = MiniSectionCta2;
|
|
4449
|
+
exports.Navigation = Navigation2;
|
|
4058
4450
|
exports.NewsCard = NewsCard;
|
|
4059
4451
|
exports.NewsCardList = NewsCardList2;
|
|
4060
4452
|
exports.Pagination = Pagination;
|
|
@@ -4073,5 +4465,6 @@ exports.UpcomingEventCard = UpcomingEventCard;
|
|
|
4073
4465
|
exports.resolveCompoundSlots = resolveCompoundSlots;
|
|
4074
4466
|
exports.svgs = svgs;
|
|
4075
4467
|
exports.useIntersectionObserver = useIntersectionObserver;
|
|
4468
|
+
exports.useIsAtTop = useIsAtTop;
|
|
4076
4469
|
//# sourceMappingURL=index.cjs.map
|
|
4077
4470
|
//# sourceMappingURL=index.cjs.map
|