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