quirk-ui 0.0.417 → 0.0.418
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/{NavLink-BTwMRfGl.js → NavLink-CHG0iIum.js} +15 -16
- package/dist/NavLink-Dr7pguuT.cjs +1 -0
- package/dist/core/components/NavBar/NavLink.cjs +1 -1
- package/dist/core/components/NavBar/NavLink.mjs +1 -1
- package/dist/core/components/NavBar/index.cjs +1 -1
- package/dist/core/components/NavBar/index.mjs +117 -124
- package/package.json +1 -1
- package/dist/NavLink-VkWDBdck.cjs +0 -1
|
@@ -2,15 +2,15 @@ import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef as v } from "react";
|
|
3
3
|
import { E as g } from "./external-link-BOPobeQJ.js";
|
|
4
4
|
import { C as k } from "./chevron-down-DSUzBz9F.js";
|
|
5
|
-
import './assets/NavLink.css';const C = "_navbar_1bon6_5", f = "_sticky_1bon6_19", w = "_left_1bon6_34", I = "_container_1bon6_35", N = "_logo_1bon6_39",
|
|
5
|
+
import './assets/NavLink.css';const C = "_navbar_1bon6_5", f = "_sticky_1bon6_19", w = "_left_1bon6_34", I = "_container_1bon6_35", N = "_logo_1bon6_39", x = "_nav_1bon6_5", T = "_center_1bon6_54", y = "_hidden_1bon6_60", E = "_visible_1bon6_67", S = "_right_1bon6_82", W = "_title_1bon6_89", $ = "_linkWrapper_1bon6_99", L = "_parent_1bon6_99", M = "_linkItem_1bon6_107", j = "_link_1bon6_99", z = "_sublinkToggle_1bon6_111", R = "_standard_1bon6_159", D = "_triangle_1bon6_167", q = "_transparent_1bon6_172", A = "_twoColumn_1bon6_276", B = "_navInner_1bon6_398", F = "_grid_1bon6_409", G = "_separator_1bon6_444", H = "_newTabIcon_1bon6_474", J = "_linkContent_1bon6_489", K = "_open_1bon6_500", Q = "_sublinks_1bon6_486", U = "_show_1bon6_571", V = "_primaryColumn_1bon6_612", X = "_spotlightColumn_1bon6_625", Y = "_sublinksInner_1bon6_629", Z = "_sublinksColumn_1bon6_647", O = "_chevron_1bon6_657", P = "_advanced_1bon6_839", nn = "_subtitle_1bon6_848", on = "_withSpotlight_1bon6_890", sn = "_withoutSpotlight_1bon6_894", en = "_searchWrapper_1bon6_940", o = {
|
|
6
6
|
navbar: C,
|
|
7
7
|
sticky: f,
|
|
8
8
|
left: w,
|
|
9
9
|
container: I,
|
|
10
10
|
logo: N,
|
|
11
|
-
nav:
|
|
12
|
-
center:
|
|
13
|
-
hidden:
|
|
11
|
+
nav: x,
|
|
12
|
+
center: T,
|
|
13
|
+
hidden: y,
|
|
14
14
|
visible: E,
|
|
15
15
|
right: S,
|
|
16
16
|
title: W,
|
|
@@ -32,19 +32,18 @@ import './assets/NavLink.css';const C = "_navbar_1bon6_5", f = "_sticky_1bon6_19
|
|
|
32
32
|
sublinks: Q,
|
|
33
33
|
show: U,
|
|
34
34
|
primaryColumn: V,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
chevron: P,
|
|
35
|
+
spotlightColumn: X,
|
|
36
|
+
sublinksInner: Y,
|
|
37
|
+
sublinksColumn: Z,
|
|
38
|
+
chevron: O,
|
|
40
39
|
default: "_default_1bon6_773",
|
|
41
|
-
advanced:
|
|
42
|
-
subtitle:
|
|
43
|
-
withSpotlight:
|
|
44
|
-
withoutSpotlight:
|
|
45
|
-
searchWrapper:
|
|
40
|
+
advanced: P,
|
|
41
|
+
subtitle: nn,
|
|
42
|
+
withSpotlight: on,
|
|
43
|
+
withoutSpotlight: sn,
|
|
44
|
+
searchWrapper: en
|
|
46
45
|
};
|
|
47
|
-
function
|
|
46
|
+
function an({
|
|
48
47
|
link: n,
|
|
49
48
|
path: s,
|
|
50
49
|
parentPath: i,
|
|
@@ -115,6 +114,6 @@ function cn({
|
|
|
115
114
|
);
|
|
116
115
|
}
|
|
117
116
|
export {
|
|
118
|
-
|
|
117
|
+
an as N,
|
|
119
118
|
o as s
|
|
120
119
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('./assets/NavLink.css');const e=require("react/jsx-runtime"),m=require("react"),v=require("./external-link-DDShu-48.cjs"),k=require("./chevron-down-DfK1XBl3.cjs"),g="_navbar_1bon6_5",C="_sticky_1bon6_19",w="_left_1bon6_34",x="_container_1bon6_35",f="_logo_1bon6_39",I="_nav_1bon6_5",N="_center_1bon6_54",j="_hidden_1bon6_60",$="_visible_1bon6_67",y="_right_1bon6_82",T="_title_1bon6_89",S="_linkWrapper_1bon6_99",W="_parent_1bon6_99",E="_linkItem_1bon6_107",q="_link_1bon6_99",L="_sublinkToggle_1bon6_111",M="_standard_1bon6_159",R="_triangle_1bon6_167",z="_transparent_1bon6_172",D="_twoColumn_1bon6_276",A="_navInner_1bon6_398",B="_grid_1bon6_409",F="_separator_1bon6_444",G="_newTabIcon_1bon6_474",H="_linkContent_1bon6_489",J="_open_1bon6_500",K="_sublinks_1bon6_486",Q="_show_1bon6_571",U="_primaryColumn_1bon6_612",V="_spotlightColumn_1bon6_625",X="_sublinksInner_1bon6_629",Y="_sublinksColumn_1bon6_647",Z="_chevron_1bon6_657",O="_advanced_1bon6_839",P="_subtitle_1bon6_848",nn="_withSpotlight_1bon6_890",on="_withoutSpotlight_1bon6_894",en="_searchWrapper_1bon6_940",o={navbar:g,sticky:C,left:w,container:x,logo:f,nav:I,center:N,hidden:j,visible:$,right:y,title:T,linkWrapper:S,parent:W,linkItem:E,link:q,sublinkToggle:L,standard:M,triangle:R,transparent:z,twoColumn:D,navInner:A,grid:B,separator:F,newTabIcon:G,linkContent:H,open:J,sublinks:K,show:Q,primaryColumn:U,spotlightColumn:V,sublinksInner:X,sublinksColumn:Y,chevron:Z,default:"_default_1bon6_773",advanced:O,subtitle:P,withSpotlight:nn,withoutSpotlight:on,searchWrapper:en};function sn({link:n,path:s,parentPath:l,openPath:u,togglePath:i,updateTriangleIndicator:d,setOpenPath:t,renderLinks:h,buttonRefs:p}){var c;const r=u===s,_=!!((c=n.sublinks)!=null&&c.length),a=m.useRef(null);return p.current.set(s,a.current),e.jsxs("div",{className:`${o.linkWrapper} ${l?"":o.parent}`,children:[e.jsx("div",{className:o.linkItem,children:n.href?e.jsxs("a",{href:n.href,className:o.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,onClick:()=>{var b;t(null),(b=n.onClick)==null||b.call(n)},onMouseEnter:()=>{l||t(null)},role:"menuitem",children:[n.label,n.isExternal&&e.jsx(v.ExternalLink,{className:o.newTabIcon,size:16})]}):e.jsxs("button",{ref:a,"aria-haspopup":_?"true":void 0,"aria-expanded":r,className:`${o.sublinkToggle} ${r?o.open:""}`,onClick:()=>i(s),onMouseEnter:()=>{d(s),t(s)},children:[n.label,_&&e.jsx(k.ChevronDown,{size:18,className:o.chevron})]})}),_&&e.jsx("div",{className:`${o.sublinks} ${r?o.show:""}`,onMouseLeave:()=>i(s),role:"menu","aria-label":`${n.label} submenu`,children:e.jsx("div",{children:e.jsx("div",{className:o.sublinksInner,children:e.jsx("div",{className:o.sublinksColumn,children:h(n.sublinks,s)})})})})]},s)}exports.NavLink=sn;exports.styles=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const e=require("../../../NavLink-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const e=require("../../../NavLink-Dr7pguuT.cjs");require("../../../external-link-DDShu-48.cjs");require("../../../chevron-down-DfK1XBl3.cjs");exports.NavLink=e.NavLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),e=require("../../../NavLink-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),e=require("../../../NavLink-Dr7pguuT.cjs"),ee=require("../../../chevron-down-DfK1XBl3.cjs"),se=require("../../../external-link-DDShu-48.cjs"),te={standard:e.styles.standard,transparent:e.styles.transparent},ne={left:e.styles.left,center:e.styles.center,right:e.styles.right};function le({title:P,logo:N,items:y,groups:d,utilityItems:w,isSticky:T=!1,showSearch:k=!0,showLocaleSelect:g=!0,alignment:f="right",variant:D="standard",navigationType:C="default",className:G}){const[X,F]=a.useState(0),[E,o]=a.useState(null),[v,V]=a.useState(!1),[L,A]=a.useState(!1),[H,J]=a.useState(!1),[K,Q]=a.useState(null),[m,p]=a.useState(0),[U,R]=a.useState(null),x=a.useRef(null),u=a.useRef(null),b=a.useRef(new Map),M=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} ${e.styles.searchWrapper}`,children:s.jsx("div",{className:e.styles.linkItem})}),I=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} `,children:s.jsx("div",{className:e.styles.linkItem})}),$=n=>{const t=b.current.get(n);if(t&&u.current){const r=t.getBoundingClientRect(),i=u.current.getBoundingClientRect(),j=r.left-i.left+r.width/2;Q(j)}};console.log($);const Y=n=>{o(t=>t===n?null:n)},Z=n=>n.map((t,r)=>{var B,q;const i=`group-${r}`,h=U===r,j=(B=t.primaryItems)==null?void 0:B[m??0];return console.log(j),s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{R(r),o(i),$(i)},onMouseLeave:()=>{R(null),p(0),o(null)},children:[s.jsx("div",{className:e.styles.linkItem,children:s.jsxs("button",{ref:l=>{b.current.set(i,l)},role:"menuitem","aria-haspopup":"true","aria-expanded":h,"aria-controls":`submenu-${r}`,className:`${e.styles.sublinkToggle} ${h?e.styles.open:""} `,children:[t.title,s.jsx(ee.ChevronDown,{size:18,className:e.styles.chevron})]})}),s.jsx("div",{id:`submenu-${r}`,className:`${e.styles.sublinks} ${h?e.styles.show:""}`,role:"menu","aria-label":`${t.title} submenu`,children:s.jsx("div",{children:s.jsxs("div",{className:`${e.styles.sublinksInner} ${t.spotlight?e.styles.withSpotlight:e.styles.withoutSpotlight}`,children:[s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.primaryColumn}`,children:[s.jsx("div",{className:e.styles.linkItem}),(q=t.primaryItems)==null?void 0:q.map((l,c)=>l.href?s.jsxs("a",{href:l.href,className:`${e.styles.link} ${m===c?e.styles.open:""}`,target:l.isExternal?"_blank":"_self",rel:l.isExternal?"noopener noreferrer":void 0,onClick:()=>{var O;o(null),(O=l.onClick)==null||O.call(l)},onMouseEnter:()=>l.sublinks?p(c):null,role:"menuitem",children:[s.jsxs("span",{className:e.styles.linkContent,children:[l.label,l.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:l.subtitle})]}),l.isExternal&&s.jsx(se.ExternalLink,{className:e.styles.newTabIcon,size:16})]},l._key??c):s.jsx("button",{className:`${e.styles.sublinkToggle} ${m===c?e.styles.open:""}`,onMouseEnter:()=>p(c),children:s.jsxs("span",{className:e.styles.linkContent,children:[l.label,l.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:l.subtitle})]})},l._key??c))]}),t.spotlight&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.spotlightColumn}`,children:t.spotlight})]})})})]},t._key??`group-${r}`)}),S=(n,t="")=>n.map(r=>{const i=`${t}/${r.label}`;return s.jsx(e.NavLink,{link:r,path:i,parentPath:t,openPath:E,togglePath:Y,updateTriangleIndicator:$,setOpenPath:o,renderLinks:S,buttonRefs:b},r._key??i)}),W=a.useCallback(n=>{x.current&&!x.current.contains(n.target)&&o(null)},[]),_=a.useCallback(()=>{z(),typeof window<"u"&&window.innerWidth>768&&(V(!1),o(null),typeof document<"u"&&(document.body.style.overflow=""))},[]),z=a.useCallback(()=>{if(u.current){const n=u.current.getBoundingClientRect().width;F(n),J(!0)}},[]);return a.useEffect(()=>{const n=typeof window<"u",t=typeof document<"u";return n&&window.addEventListener("resize",_),t&&document.addEventListener("click",W),z(),()=>{n&&window.removeEventListener("resize",_),t&&document.removeEventListener("click",W)}},[]),a.useEffect(()=>{if(typeof window<"u"){const n=()=>{const t=window.innerWidth<768;A(t)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}},[]),a.useEffect(()=>{if(typeof document<"u")return document.body.style.overflow=v?"hidden":"",()=>{document.body.style.overflow=""}},[v]),s.jsx("header",{ref:x,className:`${G??""} ${ne[f]} ${te[D]} ${e.styles.navbar} ${T?e.styles.sticky:""} ${d&&d.length?e.styles.advanced:e.styles.default}`,role:"navigation","aria-label":"Main navigation",children:s.jsxs("div",{className:`${e.styles.container} ${(!w||w.length===0)&&f!=="center"?e.styles.twoColumn:""}`,children:[N?s.jsx("div",{className:e.styles.logo,children:N}):s.jsx("div",{className:e.styles.title,children:P}),s.jsx("nav",{ref:u,style:{left:f==="center"?`calc(50% - ${X/2}px)`:"0"},className:`${e.styles.nav} ${v?e.styles.open:""} ${H?e.styles.visible:e.styles.hidden}`,id:"main-menu",role:"menubar","aria-label":"Main navigation",children:s.jsxs("div",{className:e.styles.navInner,children:[s.jsx("svg",{style:{left:`${K}px`},className:`${e.styles.triangle} ${E?e.styles.show:""}`,width:16,height:12,viewBox:"0 0 100 75",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("polygon",{points:"50,5 95,70 5,70",strokeLinejoin:"round",fill:"white",stroke:"white"})}),C==="default"&&y&&s.jsxs("div",{className:e.styles.grid,children:[y&&y.length>0&&S(y),k&&!L&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(M,{})]}),g&&s.jsx(I,{})]}),!L&&C==="advanced"&&d&&s.jsxs("div",{className:e.styles.grid,children:[d.length>0&&Z(d),k&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(M,{})]}),g&&s.jsx(I,{})]})]})})]})})}exports.Navbar=le;
|
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as o, useRef as
|
|
3
|
-
import { s as e, N as
|
|
4
|
-
import { C as
|
|
5
|
-
import { E as
|
|
6
|
-
const
|
|
1
|
+
import { jsx as n, jsxs as i, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import { useState as o, useRef as y, useCallback as C, useEffect as E } from "react";
|
|
3
|
+
import { s as e, N as ae } from "../../../NavLink-CHG0iIum.js";
|
|
4
|
+
import { C as ie } from "../../../chevron-down-DSUzBz9F.js";
|
|
5
|
+
import { E as re } from "../../../external-link-BOPobeQJ.js";
|
|
6
|
+
const oe = {
|
|
7
7
|
standard: e.standard,
|
|
8
8
|
transparent: e.transparent
|
|
9
|
-
},
|
|
9
|
+
}, ce = {
|
|
10
10
|
left: e.left,
|
|
11
11
|
center: e.center,
|
|
12
12
|
right: e.right
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
title:
|
|
14
|
+
function ve({
|
|
15
|
+
title: A,
|
|
16
16
|
logo: L,
|
|
17
|
-
items:
|
|
17
|
+
items: f,
|
|
18
18
|
groups: u,
|
|
19
|
-
utilityItems:
|
|
20
|
-
isSticky:
|
|
21
|
-
showSearch:
|
|
22
|
-
showLocaleSelect:
|
|
19
|
+
utilityItems: I,
|
|
20
|
+
isSticky: F = !1,
|
|
21
|
+
showSearch: M = !0,
|
|
22
|
+
showLocaleSelect: x = !0,
|
|
23
23
|
alignment: v = "right",
|
|
24
|
-
variant:
|
|
25
|
-
navigationType:
|
|
24
|
+
variant: H = "standard",
|
|
25
|
+
navigationType: R = "default",
|
|
26
26
|
// searchComponent,
|
|
27
27
|
// localeSelectComponent,
|
|
28
|
-
className:
|
|
28
|
+
className: q
|
|
29
29
|
}) {
|
|
30
|
-
const [
|
|
30
|
+
const [J, K] = o(0), [W, c] = o(null), [p, Q] = o(!1), [z, U] = o(!1), [Y, Z] = o(!1), [ee, ne] = o(null), [$, b] = o(
|
|
31
31
|
0
|
|
32
|
-
), [
|
|
32
|
+
), [te, B] = o(null), w = y(null), h = y(null), N = y(/* @__PURE__ */ new Map()), _ = () => /* @__PURE__ */ n(
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
35
|
className: `${e.linkWrapper} ${e.parent} ${e.searchWrapper}`,
|
|
36
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ n("div", { className: e.linkItem })
|
|
37
37
|
}
|
|
38
|
-
),
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
41
|
-
const
|
|
42
|
-
|
|
38
|
+
), O = () => /* @__PURE__ */ n("div", { className: `${e.linkWrapper} ${e.parent} `, children: /* @__PURE__ */ n("div", { className: e.linkItem }) }), k = (s) => {
|
|
39
|
+
const t = N.current.get(s);
|
|
40
|
+
if (t && h.current) {
|
|
41
|
+
const a = t.getBoundingClientRect(), r = h.current.getBoundingClientRect(), g = a.left - r.left + a.width / 2;
|
|
42
|
+
ne(g);
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
console.log(k);
|
|
46
|
-
const
|
|
47
|
-
c((
|
|
48
|
-
}, le = (s) => s.map((
|
|
49
|
-
var X, D
|
|
50
|
-
const r = `group-${
|
|
51
|
-
return console.log(
|
|
46
|
+
const se = (s) => {
|
|
47
|
+
c((t) => t === s ? null : s);
|
|
48
|
+
}, le = (s) => s.map((t, a) => {
|
|
49
|
+
var X, D;
|
|
50
|
+
const r = `group-${a}`, m = te === a, g = (X = t.primaryItems) == null ? void 0 : X[$ ?? 0];
|
|
51
|
+
return console.log(g), /* @__PURE__ */ i(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
54
|
className: `${e.linkWrapper} ${e.parent}`,
|
|
55
55
|
onMouseEnter: () => {
|
|
56
|
-
|
|
56
|
+
B(a), c(r), k(r);
|
|
57
57
|
},
|
|
58
58
|
onMouseLeave: () => {
|
|
59
|
-
|
|
59
|
+
B(null), b(0), c(null);
|
|
60
60
|
},
|
|
61
61
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ n("div", { className: e.linkItem, children: /* @__PURE__ */ i(
|
|
63
63
|
"button",
|
|
64
64
|
{
|
|
65
|
-
ref: (
|
|
66
|
-
|
|
65
|
+
ref: (l) => {
|
|
66
|
+
N.current.set(r, l);
|
|
67
67
|
},
|
|
68
68
|
role: "menuitem",
|
|
69
69
|
"aria-haspopup": "true",
|
|
70
|
-
"aria-expanded":
|
|
71
|
-
"aria-controls": `submenu-${
|
|
72
|
-
className: `${e.sublinkToggle} ${
|
|
70
|
+
"aria-expanded": m,
|
|
71
|
+
"aria-controls": `submenu-${a}`,
|
|
72
|
+
className: `${e.sublinkToggle} ${m ? e.open : ""} `,
|
|
73
73
|
children: [
|
|
74
|
-
|
|
75
|
-
/* @__PURE__ */
|
|
74
|
+
t.title,
|
|
75
|
+
/* @__PURE__ */ n(ie, { size: 18, className: e.chevron })
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
78
|
) }),
|
|
79
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ n(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
|
-
id: `submenu-${
|
|
83
|
-
className: `${e.sublinks} ${
|
|
82
|
+
id: `submenu-${a}`,
|
|
83
|
+
className: `${e.sublinks} ${m ? e.show : ""}`,
|
|
84
84
|
role: "menu",
|
|
85
|
-
"aria-label": `${
|
|
86
|
-
children: /* @__PURE__ */
|
|
85
|
+
"aria-label": `${t.title} submenu`,
|
|
86
|
+
children: /* @__PURE__ */ n("div", { children: /* @__PURE__ */ i(
|
|
87
87
|
"div",
|
|
88
88
|
{
|
|
89
|
-
className: `${e.sublinksInner} ${
|
|
89
|
+
className: `${e.sublinksInner} ${t.spotlight ? e.withSpotlight : e.withoutSpotlight}`,
|
|
90
90
|
children: [
|
|
91
91
|
/* @__PURE__ */ i(
|
|
92
92
|
"div",
|
|
93
93
|
{
|
|
94
94
|
className: `${e.sublinksColumn} ${e.primaryColumn}`,
|
|
95
95
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
(D =
|
|
98
|
-
(
|
|
96
|
+
/* @__PURE__ */ n("div", { className: e.linkItem }),
|
|
97
|
+
(D = t.primaryItems) == null ? void 0 : D.map(
|
|
98
|
+
(l, d) => l.href ? /* @__PURE__ */ i(
|
|
99
99
|
"a",
|
|
100
100
|
{
|
|
101
|
-
href:
|
|
102
|
-
className: `${e.link} ${
|
|
103
|
-
target:
|
|
104
|
-
rel:
|
|
101
|
+
href: l.href,
|
|
102
|
+
className: `${e.link} ${$ === d ? e.open : ""}`,
|
|
103
|
+
target: l.isExternal ? "_blank" : "_self",
|
|
104
|
+
rel: l.isExternal ? "noopener noreferrer" : void 0,
|
|
105
105
|
onClick: () => {
|
|
106
|
-
var
|
|
107
|
-
c(null), (
|
|
106
|
+
var S;
|
|
107
|
+
c(null), (S = l.onClick) == null || S.call(l);
|
|
108
108
|
},
|
|
109
|
-
onMouseEnter: () =>
|
|
109
|
+
onMouseEnter: () => l.sublinks ? b(d) : null,
|
|
110
110
|
role: "menuitem",
|
|
111
111
|
children: [
|
|
112
112
|
/* @__PURE__ */ i("span", { className: e.linkContent, children: [
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
l.label,
|
|
114
|
+
l.subtitle && /* @__PURE__ */ n("span", { className: e.subtitle, children: l.subtitle })
|
|
115
115
|
] }),
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
l.isExternal && /* @__PURE__ */ n(
|
|
117
|
+
re,
|
|
118
118
|
{
|
|
119
119
|
className: e.newTabIcon,
|
|
120
120
|
size: 16
|
|
@@ -122,35 +122,28 @@ function $e({
|
|
|
122
122
|
)
|
|
123
123
|
]
|
|
124
124
|
},
|
|
125
|
-
|
|
126
|
-
) : /* @__PURE__ */
|
|
125
|
+
l._key ?? d
|
|
126
|
+
) : /* @__PURE__ */ n(
|
|
127
127
|
"button",
|
|
128
128
|
{
|
|
129
|
-
className: `${e.sublinkToggle} ${
|
|
129
|
+
className: `${e.sublinkToggle} ${$ === d ? e.open : ""}`,
|
|
130
130
|
onMouseEnter: () => b(d),
|
|
131
131
|
children: /* @__PURE__ */ i("span", { className: e.linkContent, children: [
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
l.label,
|
|
133
|
+
l.subtitle && /* @__PURE__ */ n("span", { className: e.subtitle, children: l.subtitle })
|
|
134
134
|
] })
|
|
135
135
|
},
|
|
136
|
-
|
|
136
|
+
l._key ?? d
|
|
137
137
|
)
|
|
138
138
|
)
|
|
139
139
|
]
|
|
140
140
|
}
|
|
141
141
|
),
|
|
142
|
-
|
|
143
|
-
"div",
|
|
144
|
-
{
|
|
145
|
-
className: `${e.sublinksColumn} ${e.secondaryColumn}`,
|
|
146
|
-
children: n.secondaryItems && n.secondaryItems.length > 0 && y(n.secondaryItems, `${r}-secondary`)
|
|
147
|
-
}
|
|
148
|
-
),
|
|
149
|
-
n.spotlight && /* @__PURE__ */ t(
|
|
142
|
+
t.spotlight && /* @__PURE__ */ n(
|
|
150
143
|
"div",
|
|
151
144
|
{
|
|
152
145
|
className: `${e.sublinksColumn} ${e.spotlightColumn}`,
|
|
153
|
-
children:
|
|
146
|
+
children: t.spotlight
|
|
154
147
|
}
|
|
155
148
|
)
|
|
156
149
|
]
|
|
@@ -160,88 +153,88 @@ function $e({
|
|
|
160
153
|
)
|
|
161
154
|
]
|
|
162
155
|
},
|
|
163
|
-
|
|
156
|
+
t._key ?? `group-${a}`
|
|
164
157
|
);
|
|
165
|
-
}),
|
|
166
|
-
const r = `${
|
|
167
|
-
return /* @__PURE__ */
|
|
168
|
-
|
|
158
|
+
}), P = (s, t = "") => s.map((a) => {
|
|
159
|
+
const r = `${t}/${a.label}`;
|
|
160
|
+
return /* @__PURE__ */ n(
|
|
161
|
+
ae,
|
|
169
162
|
{
|
|
170
|
-
link:
|
|
163
|
+
link: a,
|
|
171
164
|
path: r,
|
|
172
|
-
parentPath:
|
|
173
|
-
openPath:
|
|
174
|
-
togglePath:
|
|
165
|
+
parentPath: t,
|
|
166
|
+
openPath: W,
|
|
167
|
+
togglePath: se,
|
|
175
168
|
updateTriangleIndicator: k,
|
|
176
169
|
setOpenPath: c,
|
|
177
|
-
renderLinks:
|
|
178
|
-
buttonRefs:
|
|
170
|
+
renderLinks: P,
|
|
171
|
+
buttonRefs: N
|
|
179
172
|
},
|
|
180
|
-
|
|
173
|
+
a._key ?? r
|
|
181
174
|
);
|
|
182
|
-
}), T =
|
|
183
|
-
|
|
184
|
-
}, []), j =
|
|
185
|
-
G(), typeof window < "u" && window.innerWidth > 768 && (
|
|
186
|
-
}, []), G =
|
|
175
|
+
}), T = C((s) => {
|
|
176
|
+
w.current && !w.current.contains(s.target) && c(null);
|
|
177
|
+
}, []), j = C(() => {
|
|
178
|
+
G(), typeof window < "u" && window.innerWidth > 768 && (Q(!1), c(null), typeof document < "u" && (document.body.style.overflow = ""));
|
|
179
|
+
}, []), G = C(() => {
|
|
187
180
|
if (h.current) {
|
|
188
181
|
const s = h.current.getBoundingClientRect().width;
|
|
189
|
-
|
|
182
|
+
K(s), Z(!0);
|
|
190
183
|
}
|
|
191
184
|
}, []);
|
|
192
185
|
return E(() => {
|
|
193
|
-
const s = typeof window < "u",
|
|
194
|
-
return s && window.addEventListener("resize", j),
|
|
195
|
-
s && window.removeEventListener("resize", j),
|
|
186
|
+
const s = typeof window < "u", t = typeof document < "u";
|
|
187
|
+
return s && window.addEventListener("resize", j), t && document.addEventListener("click", T), G(), () => {
|
|
188
|
+
s && window.removeEventListener("resize", j), t && document.removeEventListener("click", T);
|
|
196
189
|
};
|
|
197
190
|
}, []), E(() => {
|
|
198
191
|
if (typeof window < "u") {
|
|
199
192
|
const s = () => {
|
|
200
|
-
const
|
|
201
|
-
|
|
193
|
+
const t = window.innerWidth < 768;
|
|
194
|
+
U(t);
|
|
202
195
|
};
|
|
203
196
|
return s(), window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
|
|
204
197
|
}
|
|
205
198
|
}, []), E(() => {
|
|
206
199
|
if (typeof document < "u")
|
|
207
|
-
return document.body.style.overflow =
|
|
200
|
+
return document.body.style.overflow = p ? "hidden" : "", () => {
|
|
208
201
|
document.body.style.overflow = "";
|
|
209
202
|
};
|
|
210
|
-
}, [
|
|
203
|
+
}, [p]), /* @__PURE__ */ n(
|
|
211
204
|
"header",
|
|
212
205
|
{
|
|
213
|
-
ref:
|
|
214
|
-
className: `${
|
|
206
|
+
ref: w,
|
|
207
|
+
className: `${q ?? ""} ${ce[v]} ${oe[H]} ${e.navbar} ${F ? e.sticky : ""} ${u && u.length ? e.advanced : e.default}`,
|
|
215
208
|
role: "navigation",
|
|
216
209
|
"aria-label": "Main navigation",
|
|
217
210
|
children: /* @__PURE__ */ i(
|
|
218
211
|
"div",
|
|
219
212
|
{
|
|
220
|
-
className: `${e.container} ${(!
|
|
213
|
+
className: `${e.container} ${(!I || I.length === 0) && v !== "center" ? e.twoColumn : ""}`,
|
|
221
214
|
children: [
|
|
222
|
-
L ? /* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
215
|
+
L ? /* @__PURE__ */ n("div", { className: e.logo, children: L }) : /* @__PURE__ */ n("div", { className: e.title, children: A }),
|
|
216
|
+
/* @__PURE__ */ n(
|
|
224
217
|
"nav",
|
|
225
218
|
{
|
|
226
219
|
ref: h,
|
|
227
220
|
style: {
|
|
228
|
-
left: v === "center" ? `calc(50% - ${
|
|
221
|
+
left: v === "center" ? `calc(50% - ${J / 2}px)` : "0"
|
|
229
222
|
},
|
|
230
|
-
className: `${e.nav} ${
|
|
223
|
+
className: `${e.nav} ${p ? e.open : ""} ${Y ? e.visible : e.hidden}`,
|
|
231
224
|
id: "main-menu",
|
|
232
225
|
role: "menubar",
|
|
233
226
|
"aria-label": "Main navigation",
|
|
234
227
|
children: /* @__PURE__ */ i("div", { className: e.navInner, children: [
|
|
235
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ n(
|
|
236
229
|
"svg",
|
|
237
230
|
{
|
|
238
|
-
style: { left: `${
|
|
239
|
-
className: `${e.triangle} ${
|
|
231
|
+
style: { left: `${ee}px` },
|
|
232
|
+
className: `${e.triangle} ${W ? e.show : ""}`,
|
|
240
233
|
width: 16,
|
|
241
234
|
height: 12,
|
|
242
235
|
viewBox: "0 0 100 75",
|
|
243
236
|
xmlns: "http://www.w3.org/2000/svg",
|
|
244
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ n(
|
|
245
238
|
"polygon",
|
|
246
239
|
{
|
|
247
240
|
points: "50,5 95,70 5,70",
|
|
@@ -252,21 +245,21 @@ function $e({
|
|
|
252
245
|
)
|
|
253
246
|
}
|
|
254
247
|
),
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
248
|
+
R === "default" && f && /* @__PURE__ */ i("div", { className: e.grid, children: [
|
|
249
|
+
f && f.length > 0 && P(f),
|
|
250
|
+
M && !z && /* @__PURE__ */ i(V, { children: [
|
|
251
|
+
/* @__PURE__ */ n("span", { className: e.separator }),
|
|
252
|
+
/* @__PURE__ */ n(_, {})
|
|
260
253
|
] }),
|
|
261
|
-
|
|
254
|
+
x && /* @__PURE__ */ n(O, {})
|
|
262
255
|
] }),
|
|
263
|
-
!
|
|
256
|
+
!z && R === "advanced" && u && /* @__PURE__ */ i("div", { className: e.grid, children: [
|
|
264
257
|
u.length > 0 && le(u),
|
|
265
|
-
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
258
|
+
M && /* @__PURE__ */ i(V, { children: [
|
|
259
|
+
/* @__PURE__ */ n("span", { className: e.separator }),
|
|
260
|
+
/* @__PURE__ */ n(_, {})
|
|
268
261
|
] }),
|
|
269
|
-
|
|
262
|
+
x && /* @__PURE__ */ n(O, {})
|
|
270
263
|
] })
|
|
271
264
|
] })
|
|
272
265
|
}
|
|
@@ -278,5 +271,5 @@ function $e({
|
|
|
278
271
|
);
|
|
279
272
|
}
|
|
280
273
|
export {
|
|
281
|
-
|
|
274
|
+
ve as Navbar
|
|
282
275
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require('./assets/NavLink.css');const e=require("react/jsx-runtime"),p=require("react"),v=require("./external-link-DDShu-48.cjs"),k=require("./chevron-down-DfK1XBl3.cjs"),g="_navbar_1bon6_5",C="_sticky_1bon6_19",w="_left_1bon6_34",x="_container_1bon6_35",f="_logo_1bon6_39",I="_nav_1bon6_5",y="_center_1bon6_54",N="_hidden_1bon6_60",j="_visible_1bon6_67",$="_right_1bon6_82",T="_title_1bon6_89",S="_linkWrapper_1bon6_99",W="_parent_1bon6_99",E="_linkItem_1bon6_107",q="_link_1bon6_99",L="_sublinkToggle_1bon6_111",M="_standard_1bon6_159",R="_triangle_1bon6_167",z="_transparent_1bon6_172",D="_twoColumn_1bon6_276",A="_navInner_1bon6_398",B="_grid_1bon6_409",F="_separator_1bon6_444",G="_newTabIcon_1bon6_474",H="_linkContent_1bon6_489",J="_open_1bon6_500",K="_sublinks_1bon6_486",Q="_show_1bon6_571",U="_primaryColumn_1bon6_612",V="_secondaryColumn_1bon6_621",X="_spotlightColumn_1bon6_625",Y="_sublinksInner_1bon6_629",Z="_sublinksColumn_1bon6_647",O="_chevron_1bon6_657",P="_advanced_1bon6_839",nn="_subtitle_1bon6_848",on="_withSpotlight_1bon6_890",en="_withoutSpotlight_1bon6_894",sn="_searchWrapper_1bon6_940",o={navbar:g,sticky:C,left:w,container:x,logo:f,nav:I,center:y,hidden:N,visible:j,right:$,title:T,linkWrapper:S,parent:W,linkItem:E,link:q,sublinkToggle:L,standard:M,triangle:R,transparent:z,twoColumn:D,navInner:A,grid:B,separator:F,newTabIcon:G,linkContent:H,open:J,sublinks:K,show:Q,primaryColumn:U,secondaryColumn:V,spotlightColumn:X,sublinksInner:Y,sublinksColumn:Z,chevron:O,default:"_default_1bon6_773",advanced:P,subtitle:nn,withSpotlight:on,withoutSpotlight:en,searchWrapper:sn};function tn({link:n,path:s,parentPath:l,openPath:u,togglePath:i,updateTriangleIndicator:d,setOpenPath:t,renderLinks:h,buttonRefs:m}){var c;const r=u===s,_=!!((c=n.sublinks)!=null&&c.length),a=p.useRef(null);return m.current.set(s,a.current),e.jsxs("div",{className:`${o.linkWrapper} ${l?"":o.parent}`,children:[e.jsx("div",{className:o.linkItem,children:n.href?e.jsxs("a",{href:n.href,className:o.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,onClick:()=>{var b;t(null),(b=n.onClick)==null||b.call(n)},onMouseEnter:()=>{l||t(null)},role:"menuitem",children:[n.label,n.isExternal&&e.jsx(v.ExternalLink,{className:o.newTabIcon,size:16})]}):e.jsxs("button",{ref:a,"aria-haspopup":_?"true":void 0,"aria-expanded":r,className:`${o.sublinkToggle} ${r?o.open:""}`,onClick:()=>i(s),onMouseEnter:()=>{d(s),t(s)},children:[n.label,_&&e.jsx(k.ChevronDown,{size:18,className:o.chevron})]})}),_&&e.jsx("div",{className:`${o.sublinks} ${r?o.show:""}`,onMouseLeave:()=>i(s),role:"menu","aria-label":`${n.label} submenu`,children:e.jsx("div",{children:e.jsx("div",{className:o.sublinksInner,children:e.jsx("div",{className:o.sublinksColumn,children:h(n.sublinks,s)})})})})]},s)}exports.NavLink=tn;exports.styles=o;
|