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