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