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