quirk-ui 0.0.459 → 0.0.461

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index33.css');const e=require("react/jsx-runtime"),r=require("react"),_=require("react-dom"),h=require("../../../x-Dft9NVe_.cjs"),j="_overlay_140ia_1",x="_modal_140ia_16",b="_closeButton_140ia_26",g="_content_140ia_37",o={overlay:j,modal:x,closeButton:b,content:g};function $({content:u,trigger:m,isOpen:c,onOpen:n,onClose:s,className:i}){const[t,f]=r.useState(!1),a=c!==void 0,d=a?c:t,l=()=>{a?t?s==null||s():n==null||n():f(!d)};r.useEffect(()=>{if(typeof document<"u")return document.body.style.overflow=t?"hidden":"",()=>{document.body.style.overflow=""}},[t]);const y=d?e.jsx("div",{className:o.overlay,onClick:l,children:e.jsxs("div",{className:`${i??""} ${o.modal}`,onClick:v=>v.stopPropagation(),children:[e.jsx("button",{"aria-label":"Close",className:`${o.closeButton} modalClose`,onClick:l,children:e.jsx(h.X,{size:21})}),e.jsx("div",{className:`${o.content} modalContent`,children:u})]})}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:i??void 0,onClick:l,children:m}),typeof window<"u"&&_.createPortal(y,document.body)]})}exports.Modal=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index33.css');const e=require("react/jsx-runtime"),y=require("react"),j=require("react-dom"),x=require("../../../x-Dft9NVe_.cjs"),f="_overlay_140ia_1",h="_modal_140ia_16",g="_closeButton_140ia_26",$="_content_140ia_37",t={overlay:f,modal:h,closeButton:g,content:$};function b({content:d,trigger:u,isOpen:l,onOpen:o,onClose:s,className:c}){const[a,m]=y.useState(!1),i=l!==void 0,r=i?l:a,n=()=>{i?a?s==null||s():o==null||o():m(!r)},_=r?e.jsx("div",{className:t.overlay,onClick:n,children:e.jsxs("div",{className:`${c??""} ${t.modal}`,onClick:v=>v.stopPropagation(),children:[e.jsx("button",{"aria-label":"Close",className:`${t.closeButton} modalClose`,onClick:n,children:e.jsx(x.X,{size:21})}),e.jsx("div",{className:`${t.content} modalContent`,children:d})]})}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:c??void 0,onClick:n,children:u}),typeof window<"u"&&j.createPortal(_,document.body)]})}exports.Modal=b;
@@ -1,54 +1,47 @@
1
- import { jsxs as r, Fragment as _, jsx as o } from "react/jsx-runtime";
2
- import { useState as h, useEffect as p } from "react";
3
- import { createPortal as b } from "react-dom";
1
+ import { jsxs as r, Fragment as h, jsx as o } from "react/jsx-runtime";
2
+ import { useState as p } from "react";
3
+ import { createPortal as y } from "react-dom";
4
4
  import { X as C } from "../../../x-CnsEH4Ox.js";
5
- import '../../../assets/index33.css';const g = "_overlay_140ia_1", k = "_modal_140ia_16", w = "_closeButton_140ia_26", B = "_content_140ia_37", e = {
5
+ import '../../../assets/index33.css';const g = "_overlay_140ia_1", k = "_modal_140ia_16", B = "_closeButton_140ia_26", N = "_content_140ia_37", t = {
6
6
  overlay: g,
7
7
  modal: k,
8
- closeButton: w,
9
- content: B
8
+ closeButton: B,
9
+ content: N
10
10
  };
11
- function P({
11
+ function w({
12
12
  content: m,
13
- trigger: f,
14
- isOpen: i,
15
- onOpen: n,
13
+ trigger: _,
14
+ isOpen: a,
15
+ onOpen: e,
16
16
  onClose: l,
17
- className: s
17
+ className: i
18
18
  }) {
19
- const [t, u] = h(!1), a = i !== void 0, d = a ? i : t, c = () => {
20
- a ? t ? l == null || l() : n == null || n() : u(!d);
21
- };
22
- p(() => {
23
- if (typeof document < "u")
24
- return document.body.style.overflow = t ? "hidden" : "", () => {
25
- document.body.style.overflow = "";
26
- };
27
- }, [t]);
28
- const v = d ? /* @__PURE__ */ o("div", { className: e.overlay, onClick: c, children: /* @__PURE__ */ r(
19
+ const [s, u] = p(!1), c = a !== void 0, d = c ? a : s, n = () => {
20
+ c ? s ? l == null || l() : e == null || e() : u(!d);
21
+ }, f = d ? /* @__PURE__ */ o("div", { className: t.overlay, onClick: n, children: /* @__PURE__ */ r(
29
22
  "div",
30
23
  {
31
- className: `${s ?? ""} ${e.modal}`,
32
- onClick: (y) => y.stopPropagation(),
24
+ className: `${i ?? ""} ${t.modal}`,
25
+ onClick: (v) => v.stopPropagation(),
33
26
  children: [
34
27
  /* @__PURE__ */ o(
35
28
  "button",
36
29
  {
37
30
  "aria-label": "Close",
38
- className: `${e.closeButton} modalClose`,
39
- onClick: c,
31
+ className: `${t.closeButton} modalClose`,
32
+ onClick: n,
40
33
  children: /* @__PURE__ */ o(C, { size: 21 })
41
34
  }
42
35
  ),
43
- /* @__PURE__ */ o("div", { className: `${e.content} modalContent`, children: m })
36
+ /* @__PURE__ */ o("div", { className: `${t.content} modalContent`, children: m })
44
37
  ]
45
38
  }
46
39
  ) }) : null;
47
- return /* @__PURE__ */ r(_, { children: [
48
- /* @__PURE__ */ o("div", { className: s ?? void 0, onClick: c, children: f }),
49
- typeof window < "u" && b(v, document.body)
40
+ return /* @__PURE__ */ r(h, { children: [
41
+ /* @__PURE__ */ o("div", { className: i ?? void 0, onClick: n, children: _ }),
42
+ typeof window < "u" && y(f, document.body)
50
43
  ] });
51
44
  }
52
45
  export {
53
- P as Modal
46
+ w as Modal
54
47
  };
@@ -1,16 +1,16 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("react"),ae=require("../Modal/index.cjs"),O=require("../../../index-DpYgzTme.cjs"),te=require("../ButtonGroup/index.cjs"),e=require("../../../NavLink-By_lBPb-.cjs"),I=require("../../../external-link-DDShu-48.cjs"),ve=require("../../../x-Dft9NVe_.cjs"),D=require("../../../createLucideIcon-DpotSgUx.cjs"),pe=require("../../../chevron-down-DfK1XBl3.cjs");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("react"),ie=require("../Modal/index.cjs"),q=require("../../../index-DpYgzTme.cjs"),ce=require("../ButtonGroup/index.cjs"),e=require("../../../NavLink-By_lBPb-.cjs"),D=require("../../../external-link-DDShu-48.cjs"),Ne=require("../../../x-Dft9NVe_.cjs"),G=require("../../../createLucideIcon-DpotSgUx.cjs"),$e=require("../../../chevron-down-DfK1XBl3.cjs");/**
2
2
  * @license lucide-react v0.488.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const Ne=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],$e=D.createLucideIcon("earth",Ne);/**
6
+ */const ge=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],we=G.createLucideIcon("earth",ge);/**
7
7
  * @license lucide-react v0.488.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const ge=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],we=D.createLucideIcon("menu",ge);/**
11
+ */const Ce=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],Le=G.createLucideIcon("menu",Ce);/**
12
12
  * @license lucide-react v0.488.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const Ce=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Le=D.createLucideIcon("search",Ce),_e={standard:e.styles.standard,transparent:e.styles.transparent},Se={left:e.styles.left,center:e.styles.center,right:e.styles.right},Me=({spotlight:a,renderText:b})=>{var t,C,j,p,k,L,m,_,S,M,y;const w=(t=a.image)==null?void 0:t.asset.altText,x=((C=a.callToAction.linkOptions)==null?void 0:C.linkType)==="external";let u="#";return((j=a.callToAction.linkOptions)==null?void 0:j.linkType)==="external"&&((p=a.callToAction.linkOptions)!=null&&p.externalUrl)?u=(k=a.callToAction.linkOptions)==null?void 0:k.externalUrl:((L=a.callToAction.linkOptions)==null?void 0:L.linkType)==="internal"&&((_=(m=a.callToAction.linkOptions)==null?void 0:m.internalUrl)!=null&&_.slug.current)&&(u=`/${(M=(S=a.callToAction.linkOptions)==null?void 0:S.internalUrl)==null?void 0:M.slug.current}`),s.jsxs("div",{className:e.styles.spotlight,children:[a.image&&s.jsx("div",{className:e.styles.imageWrapper,children:s.jsx("img",{src:(a==null?void 0:a.image.imageUrl)??"",alt:w||a.image.asset.description||"Content image",width:600,height:400})}),s.jsxs("div",{className:e.styles.content,children:[a.title&&s.jsx("div",{className:e.styles.title,children:b==null?void 0:b(a.title,e.styles.title)}),a.description&&s.jsx("div",{className:e.styles.description,children:b==null?void 0:b(a.description,e.styles.description)})]}),((y=a.callToAction)==null?void 0:y.linkOptions)&&s.jsx("div",{className:e.styles.actions,children:s.jsx(O.CallToAction,{as:"a",variant:a.callToAction.variant??"primary",href:u,target:x?"_blank":"_self",rel:x?"noopener noreferrer":"","aria-label":a.callToAction.ariaLabel||a.callToAction.label,children:a.callToAction.label})})]})};function Ee({renderText:a,title:b,logo:w,items:x,groups:u,utilityItems:t,isSticky:C=!1,showSearch:j=!0,showLocaleSelect:p=!0,alignment:k="right",variant:L="standard",navigationType:m="default",searchComponent:_,localeSelectComponent:S,className:M}){const[y,G]=r.useState(!1),[U,f]=r.useState(null),[ie,ce]=r.useState(0),[re,oe]=r.useState(!1),[de,ye]=r.useState(null),[o,N]=r.useState([]),[E,q]=r.useState(0),[ue,X]=r.useState(null),[$,he]=r.useState(!1),[A,T]=r.useState("forward"),B=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} ${e.styles.searchWrapper}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(ae.Modal,{className:e.styles.searchModal,trigger:s.jsx("button",{title:"Search","aria-label":"Search",className:e.styles.search,children:s.jsx(Le,{size:16})}),content:_})})}),H=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} `,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(ae.Modal,{className:e.styles.localeModal,trigger:s.jsx("button",{title:"Locale Select","aria-label":"Locale Select",role:"menuitem",className:e.styles.locale,children:s.jsx($e,{size:16})}),content:S})})});r.useEffect(()=>{if(typeof window<"u"){const n=()=>{const l=window.innerWidth<768;he(l)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}},[]);const be=()=>{N([])},fe=n=>{T("forward"),N([{title:n.title,primary:n.primaryItems??[],secondary:n.secondaryItems??[],description:""}])},V=n=>{T("forward"),N(l=>[...l,{title:n.label,primary:n.sublinks??[],secondary:[],description:n.description}])},xe=()=>{T("backward"),N(n=>n.slice(0,-1))},F=r.useRef(null),g=r.useRef(null),W=r.useRef(new Map),me=()=>{G(n=>{const l=!n;return l||(N([]),T("forward"),f(null)),l})},J=n=>{const l=W.current.get(n);if(l&&g.current){const d=l.getBoundingClientRect(),h=g.current.getBoundingClientRect(),c=d.left-h.left+d.width/2;ye(c)}},je=n=>{f(l=>l===n?null:n)},K=r.useCallback(n=>{F.current&&!F.current.contains(n.target)&&f(null)},[]),Q=r.useCallback(()=>{Y(),typeof window<"u"&&window.innerWidth>768&&(G(!1),f(null),typeof document<"u"&&(document.body.style.overflow=""))},[]),Y=r.useCallback(()=>{if(g.current){const n=g.current.getBoundingClientRect().width;ce(n),oe(!0)}},[]);r.useEffect(()=>{const n=typeof window<"u",l=typeof document<"u";return n&&window.addEventListener("resize",Q),l&&document.addEventListener("click",K),Y(),()=>{n&&window.removeEventListener("resize",Q),l&&document.removeEventListener("click",K)}},[]),r.useEffect(()=>{if(typeof document<"u")return document.body.style.overflow=y?"hidden":"",()=>{document.body.style.overflow=""}},[y]);const ke=n=>n.map((l,d)=>{var Z,P,ee,se,ne;const h=`group-${d}`,z=ue===d,c=(Z=l.primaryItems)==null?void 0:Z[E??0];return s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{X(d),f(h),J(h)},onMouseLeave:()=>{X(null),q(0),f(null)},children:[s.jsx("div",{className:e.styles.linkItem,children:s.jsxs("button",{ref:i=>{W.current.set(h,i)},role:"menuitem","aria-haspopup":"true","aria-expanded":z,"aria-controls":`submenu-${d}`,className:`${e.styles.sublinkToggle} ${z?e.styles.open:""} `,children:[l.title,s.jsx(pe.ChevronDown,{size:18,className:e.styles.chevron})]})}),s.jsx("div",{id:`submenu-${d}`,className:`${e.styles.sublinks} ${z?e.styles.show:""}`,role:"menu","aria-label":`${l.title} submenu`,children:s.jsx("div",{children:s.jsxs("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}),(P=l.primaryItems)==null?void 0:P.map((i,v)=>i.href?s.jsxs("a",{href:i.href,className:`${e.styles.link} ${E===v?e.styles.open:""}`,target:i.isExternal?"_blank":"_self",rel:i.isExternal?"noopener noreferrer":void 0,onClick:()=>{var le;f(null),(le=i.onClick)==null||le.call(i)},onMouseEnter:()=>i.sublinks?q(v):null,role:"menuitem",children:[s.jsxs("span",{className:e.styles.linkContent,children:[i.label,i.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:i.subtitle})]}),i.isExternal&&s.jsx(I.ExternalLink,{className:e.styles.newTabIcon,size:16})]},i._key??v):s.jsx("button",{className:`${e.styles.sublinkToggle} ${E===v?e.styles.open:""}`,onMouseEnter:()=>q(v),children:s.jsxs("span",{className:e.styles.linkContent,children:[i.label,i.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:i.subtitle})]})},i._key??v))]}),(c==null?void 0:c.sublinks)&&((ee=c==null?void 0:c.sublinks)==null?void 0:ee.length)>0&&s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.fadeInFromLeft}`,children:[(c==null?void 0:c.description)&&s.jsxs("div",{className:e.styles.sublinksDescription,children:[s.jsx("p",{children:"TEXT HERE"}),a==null?void 0:a(c.description)]}),(c==null?void 0:c.sublinks)&&R(c.sublinks,`${h}-${E}`)]},`${c.label}-${(se=c==null?void 0:c.sublinks)==null?void 0:se.length}`),(l==null?void 0:l.secondaryItems)&&((ne=l==null?void 0:l.secondaryItems)==null?void 0:ne.length)>0&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.secondaryColumn}`,children:l.secondaryItems&&l.secondaryItems.length>0&&R(l.secondaryItems,`${h}-secondary`)}),l.spotlight&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.spotlightColumn}`,children:s.jsx(Me,{spotlight:l.spotlight,renderText:a??(i=>String(i))})})]})})})]},l._key??`group-${d}`)}),R=(n,l="")=>n.map(d=>{const h=`${l}/${d.label}`;return s.jsx(e.NavLink,{link:d,path:h,parentPath:l,openPath:U,togglePath:je,updateTriangleIndicator:J,setOpenPath:f,renderLinks:R,buttonRefs:W},d._key??h)});return s.jsx("header",{ref:F,className:`${M??""} ${Se[k]} ${_e[L]} ${e.styles.navbar} ${C?e.styles.sticky:""} ${u&&u.length?e.styles.advanced:e.styles.default}`,"aria-label":"Main navigation",children:s.jsxs("div",{className:`${e.styles.container} ${(!t||t.length===0)&&k!=="center"?e.styles.twoColumn:""}`,children:[w?s.jsx("div",{className:e.styles.logo,children:w}):s.jsx("div",{className:e.styles.title,children:b}),s.jsx("nav",{ref:g,style:{left:k==="center"?`calc(50% - ${ie/2}px)`:"0"},className:`${e.styles.nav} ${y?e.styles.open:""} ${re?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:`${de}px`},className:`${e.styles.triangle} ${U?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"})}),m==="default"&&x&&s.jsxs("div",{className:e.styles.grid,children:[x&&x.length>0&&R(x),j&&!$&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(B,{})]}),p&&s.jsx(H,{})]}),!$&&m==="advanced"&&u&&s.jsxs("div",{className:e.styles.grid,children:[u.length>0&&ke(u),j&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(B,{})]}),p&&s.jsx(H,{})]}),$&&m==="advanced"&&y&&o.length===0&&u&&s.jsx("div",{className:`${e.styles.mobileMenu}`,children:u.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>fe(n),children:n.title})},n._key??l))}),$&&m==="advanced"&&y&&o.length>0&&s.jsxs("div",{className:`${e.styles.mobileMenuSlide} `,children:[s.jsx("button",{className:e.styles.back,onClick:o.length===1?be:xe,children:s.jsx(O.ChevronLeft,{size:18,"aria-hidden":"true",focusable:"false"})}),o[o.length-1].description&&s.jsx("div",{className:`${e.styles.sublinksDescription} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:a==null?void 0:a(o[o.length-1].description)}),o[o.length-1].primary.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:n.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>V(n),children:s.jsxs("span",{className:e.styles.linkContent,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:n.subtitle})]})}):s.jsxs("a",{href:n.href,className:e.styles.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,role:"menuitem",children:[s.jsxs("span",{className:e.styles.linkContent,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:n.subtitle})]}),n.isExternal&&s.jsx(I.ExternalLink,{className:e.styles.newTabIcon,size:16})]})},n._key??`primary-${l}`)),o[o.length-1].secondary.length>0&&s.jsx("hr",{className:e.styles.groupDivider}),o[o.length-1].secondary.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:n.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>V(n),children:n.label}):s.jsxs("a",{href:n.href,className:e.styles.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,role:"menuitem",children:[n.label,n.isExternal&&s.jsx(I.ExternalLink,{className:e.styles.newTabIcon,size:16})]})},n._key??`secondary-${l}`))]},`stack-${o.length}`)]})}),t&&t.length>0&&s.jsx("nav",{className:e.styles.utility,"aria-label":"Utility navigation",children:s.jsx(te.ButtonGroup,{children:t.map((n,l)=>s.jsx(O.CallToAction,{as:"a",href:n.href??"/",variant:n.variant??"primary",displayType:n.displayType??"text",imageSrc:n.imageSrc,imageAlt:n.imageAlt,"aria-label":n.ariaLabel??n.label,icon:n.icon,iconAlignment:n.iconAlignment,children:n.imageSrc?s.jsx("img",{src:n.imageSrc,alt:n.imageAlt??n.ariaLabel??n.label}):n.label},n._key||l))})}),t&&t.length>0&&s.jsx("nav",{"aria-label":"Utility navigation",className:`${e.styles.utilityMobile} ${y?e.styles.open:""}`,children:s.jsx(te.ButtonGroup,{alignment:"center",children:s.jsx(O.CallToAction,{as:"a",href:t[1].href??"/",variant:t[1].variant??"primary",displayType:t[1].displayType??"text",imageSrc:t[1].imageSrc,imageAlt:t[1].imageAlt,"aria-label":t[1].ariaLabel??t[1].label,icon:t[1].icon,iconAlignment:t[1].iconAlignment,children:t[1].imageSrc?s.jsx("img",{src:t[1].imageSrc,"aria-label":t[1].imageAlt??t[1].ariaLabel??t[1].label}):t[1].label})})}),s.jsxs("div",{className:e.styles.mobileButtons,children:[$&&j&&s.jsx(B,{}),s.jsx("button",{className:e.styles.menuToggle,onClick:me,"aria-label":y?"Close menu":"Open menu","aria-expanded":y,"aria-controls":"main-menu",children:y?s.jsx(ve.X,{size:24}):s.jsx(we,{size:24})})]})]})})}exports.Navbar=Ee;
16
+ */const _e=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Se=G.createLucideIcon("search",_e),Me={standard:e.styles.standard,transparent:e.styles.transparent},Ee={left:e.styles.left,center:e.styles.center,right:e.styles.right},Ae=({spotlight:a,renderText:b})=>{var t,C,j,p,k,L,m,_,S,M,y;const w=(t=a.image)==null?void 0:t.asset.altText,x=((C=a.callToAction.linkOptions)==null?void 0:C.linkType)==="external";let u="#";return((j=a.callToAction.linkOptions)==null?void 0:j.linkType)==="external"&&((p=a.callToAction.linkOptions)!=null&&p.externalUrl)?u=(k=a.callToAction.linkOptions)==null?void 0:k.externalUrl:((L=a.callToAction.linkOptions)==null?void 0:L.linkType)==="internal"&&((_=(m=a.callToAction.linkOptions)==null?void 0:m.internalUrl)!=null&&_.slug.current)&&(u=`/${(M=(S=a.callToAction.linkOptions)==null?void 0:S.internalUrl)==null?void 0:M.slug.current}`),s.jsxs("div",{className:e.styles.spotlight,children:[a.image&&s.jsx("div",{className:e.styles.imageWrapper,children:s.jsx("img",{src:(a==null?void 0:a.image.imageUrl)??"",alt:w||a.image.asset.description||"Content image",width:600,height:400})}),s.jsxs("div",{className:e.styles.content,children:[a.title&&s.jsx("div",{className:e.styles.title,children:b==null?void 0:b(a.title,e.styles.title)}),a.description&&s.jsx("div",{className:e.styles.description,children:b==null?void 0:b(a.description,e.styles.description)})]}),((y=a.callToAction)==null?void 0:y.linkOptions)&&s.jsx("div",{className:e.styles.actions,children:s.jsx(q.CallToAction,{as:"a",variant:a.callToAction.variant??"primary",href:u,target:x?"_blank":"_self",rel:x?"noopener noreferrer":"","aria-label":a.callToAction.ariaLabel||a.callToAction.label,children:a.callToAction.label})})]})};function Te({renderText:a,title:b,logo:w,items:x,groups:u,utilityItems:t,isSticky:C=!1,showSearch:j=!0,showLocaleSelect:p=!0,alignment:k="right",variant:L="standard",navigationType:m="default",searchComponent:_,localeSelectComponent:S,className:M}){const[y,U]=r.useState(!1),[X,E]=r.useState(!1),[H,f]=r.useState(null),[re,oe]=r.useState(0),[de,ye]=r.useState(!1),[ue,he]=r.useState(null),[o,N]=r.useState([]),[A,B]=r.useState(0),[be,V]=r.useState(null),[$,fe]=r.useState(!1),[T,O]=r.useState("forward"),F=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} ${e.styles.searchWrapper}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(ie.Modal,{className:e.styles.searchModal,onOpen:()=>E(!0),onClose:()=>E(!1),trigger:s.jsx("button",{title:"Search","aria-label":"Search",className:e.styles.search,children:s.jsx(Se,{size:16})}),content:_})})}),J=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} `,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(ie.Modal,{className:e.styles.localeModal,onOpen:()=>E(!0),onClose:()=>E(!1),trigger:s.jsx("button",{title:"Locale Select","aria-label":"Locale Select",role:"menuitem",className:e.styles.locale,children:s.jsx(we,{size:16})}),content:S})})});r.useEffect(()=>{if(typeof window<"u"){const n=()=>{const l=window.innerWidth<768;fe(l)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}},[]);const xe=()=>{N([])},me=n=>{O("forward"),N([{title:n.title,primary:n.primaryItems??[],secondary:n.secondaryItems??[],description:""}])},K=n=>{O("forward"),N(l=>[...l,{title:n.label,primary:n.sublinks??[],secondary:[],description:n.description}])},je=()=>{O("backward"),N(n=>n.slice(0,-1))},W=r.useRef(null),g=r.useRef(null),I=r.useRef(new Map),ke=()=>{U(n=>{const l=!n;return l||(N([]),O("forward"),f(null)),l})},Q=n=>{const l=I.current.get(n);if(l&&g.current){const d=l.getBoundingClientRect(),h=g.current.getBoundingClientRect(),c=d.left-h.left+d.width/2;he(c)}},ve=n=>{f(l=>l===n?null:n)},Y=r.useCallback(n=>{W.current&&!W.current.contains(n.target)&&f(null)},[]),Z=r.useCallback(()=>{P(),typeof window<"u"&&window.innerWidth>768&&(U(!1),f(null),typeof document<"u"&&(document.body.style.overflow=""))},[]),P=r.useCallback(()=>{if(g.current){const n=g.current.getBoundingClientRect().width;oe(n),ye(!0)}},[]);r.useEffect(()=>{const n=typeof window<"u",l=typeof document<"u";return n&&window.addEventListener("resize",Z),l&&document.addEventListener("click",Y),P(),()=>{n&&window.removeEventListener("resize",Z),l&&document.removeEventListener("click",Y)}},[]),r.useEffect(()=>{if(typeof document<"u")return document.body.style.overflow=y||X?"hidden":"",()=>{document.body.style.overflow=""}},[y,X]);const pe=n=>n.map((l,d)=>{var ee,se,ne,le,ae;const h=`group-${d}`,z=be===d,c=(ee=l.primaryItems)==null?void 0:ee[A??0];return s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{V(d),f(h),Q(h)},onMouseLeave:()=>{V(null),B(0),f(null)},children:[s.jsx("div",{className:e.styles.linkItem,children:s.jsxs("button",{ref:i=>{I.current.set(h,i)},role:"menuitem","aria-haspopup":"true","aria-expanded":z,"aria-controls":`submenu-${d}`,className:`${e.styles.sublinkToggle} ${z?e.styles.open:""} `,children:[l.title,s.jsx($e.ChevronDown,{size:18,className:e.styles.chevron})]})}),s.jsx("div",{id:`submenu-${d}`,className:`${e.styles.sublinks} ${z?e.styles.show:""}`,role:"menu","aria-label":`${l.title} submenu`,children:s.jsx("div",{children:s.jsxs("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}),(se=l.primaryItems)==null?void 0:se.map((i,v)=>i.href?s.jsxs("a",{href:i.href,className:`${e.styles.link} ${A===v?e.styles.open:""}`,target:i.isExternal?"_blank":"_self",rel:i.isExternal?"noopener noreferrer":void 0,onClick:()=>{var te;f(null),(te=i.onClick)==null||te.call(i)},onMouseEnter:()=>i.sublinks?B(v):null,role:"menuitem",children:[s.jsxs("span",{className:e.styles.linkContent,children:[i.label,i.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:i.subtitle})]}),i.isExternal&&s.jsx(D.ExternalLink,{className:e.styles.newTabIcon,size:16})]},i._key??v):s.jsx("button",{className:`${e.styles.sublinkToggle} ${A===v?e.styles.open:""}`,onMouseEnter:()=>B(v),children:s.jsxs("span",{className:e.styles.linkContent,children:[i.label,i.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:i.subtitle})]})},i._key??v))]}),(c==null?void 0:c.sublinks)&&((ne=c==null?void 0:c.sublinks)==null?void 0:ne.length)>0&&s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.fadeInFromLeft}`,children:[(c==null?void 0:c.description)&&s.jsxs("div",{className:e.styles.sublinksDescription,children:[s.jsx("p",{children:"TEXT HERE"}),a==null?void 0:a(c.description)]}),(c==null?void 0:c.sublinks)&&R(c.sublinks,`${h}-${A}`)]},`${c.label}-${(le=c==null?void 0:c.sublinks)==null?void 0:le.length}`),(l==null?void 0:l.secondaryItems)&&((ae=l==null?void 0:l.secondaryItems)==null?void 0:ae.length)>0&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.secondaryColumn}`,children:l.secondaryItems&&l.secondaryItems.length>0&&R(l.secondaryItems,`${h}-secondary`)}),l.spotlight&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.spotlightColumn}`,children:s.jsx(Ae,{spotlight:l.spotlight,renderText:a??(i=>String(i))})})]})})})]},l._key??`group-${d}`)}),R=(n,l="")=>n.map(d=>{const h=`${l}/${d.label}`;return s.jsx(e.NavLink,{link:d,path:h,parentPath:l,openPath:H,togglePath:ve,updateTriangleIndicator:Q,setOpenPath:f,renderLinks:R,buttonRefs:I},d._key??h)});return s.jsx("header",{ref:W,className:`${M??""} ${Ee[k]} ${Me[L]} ${e.styles.navbar} ${C?e.styles.sticky:""} ${u&&u.length?e.styles.advanced:e.styles.default}`,"aria-label":"Main navigation",children:s.jsxs("div",{className:`${e.styles.container} ${(!t||t.length===0)&&k!=="center"?e.styles.twoColumn:""}`,children:[w?s.jsx("div",{className:e.styles.logo,children:w}):s.jsx("div",{className:e.styles.title,children:b}),s.jsx("nav",{ref:g,style:{left:k==="center"?`calc(50% - ${re/2}px)`:"0"},className:`${e.styles.nav} ${y?e.styles.open:""} ${de?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:`${ue}px`},className:`${e.styles.triangle} ${H?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"})}),m==="default"&&x&&s.jsxs("div",{className:e.styles.grid,children:[x&&x.length>0&&R(x),j&&!$&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(F,{})]}),p&&s.jsx(J,{})]}),!$&&m==="advanced"&&u&&s.jsxs("div",{className:e.styles.grid,children:[u.length>0&&pe(u),j&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(F,{})]}),p&&s.jsx(J,{})]}),$&&m==="advanced"&&y&&o.length===0&&u&&s.jsx("div",{className:`${e.styles.mobileMenu}`,children:u.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${T==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>me(n),children:n.title})},n._key??l))}),$&&m==="advanced"&&y&&o.length>0&&s.jsxs("div",{className:`${e.styles.mobileMenuSlide} `,children:[s.jsx("button",{className:e.styles.back,onClick:o.length===1?xe:je,children:s.jsx(q.ChevronLeft,{size:18,"aria-hidden":"true",focusable:"false"})}),o[o.length-1].description&&s.jsx("div",{className:`${e.styles.sublinksDescription} ${T==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:a==null?void 0:a(o[o.length-1].description)}),o[o.length-1].primary.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${T==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:n.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>K(n),children:s.jsxs("span",{className:e.styles.linkContent,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:n.subtitle})]})}):s.jsxs("a",{href:n.href,className:e.styles.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,role:"menuitem",children:[s.jsxs("span",{className:e.styles.linkContent,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:n.subtitle})]}),n.isExternal&&s.jsx(D.ExternalLink,{className:e.styles.newTabIcon,size:16})]})},n._key??`primary-${l}`)),o[o.length-1].secondary.length>0&&s.jsx("hr",{className:e.styles.groupDivider}),o[o.length-1].secondary.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${T==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:n.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>K(n),children:n.label}):s.jsxs("a",{href:n.href,className:e.styles.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,role:"menuitem",children:[n.label,n.isExternal&&s.jsx(D.ExternalLink,{className:e.styles.newTabIcon,size:16})]})},n._key??`secondary-${l}`))]},`stack-${o.length}`)]})}),t&&t.length>0&&s.jsx("nav",{className:e.styles.utility,"aria-label":"Utility navigation",children:s.jsx(ce.ButtonGroup,{children:t.map((n,l)=>s.jsx(q.CallToAction,{as:"a",href:n.href??"/",variant:n.variant??"primary",displayType:n.displayType??"text",imageSrc:n.imageSrc,imageAlt:n.imageAlt,"aria-label":n.ariaLabel??n.label,icon:n.icon,iconAlignment:n.iconAlignment,children:n.imageSrc?s.jsx("img",{src:n.imageSrc,alt:n.imageAlt??n.ariaLabel??n.label}):n.label},n._key||l))})}),t&&t.length>0&&s.jsx("nav",{"aria-label":"Utility navigation",className:`${e.styles.utilityMobile} ${y?e.styles.open:""}`,children:s.jsx(ce.ButtonGroup,{alignment:"center",children:s.jsx(q.CallToAction,{as:"a",href:t[1].href??"/",variant:t[1].variant??"primary",displayType:t[1].displayType??"text",imageSrc:t[1].imageSrc,imageAlt:t[1].imageAlt,"aria-label":t[1].ariaLabel??t[1].label,icon:t[1].icon,iconAlignment:t[1].iconAlignment,children:t[1].imageSrc?s.jsx("img",{src:t[1].imageSrc,"aria-label":t[1].imageAlt??t[1].ariaLabel??t[1].label}):t[1].label})})}),s.jsxs("div",{className:e.styles.mobileButtons,children:[$&&j&&s.jsx(F,{}),s.jsx("button",{className:e.styles.menuToggle,onClick:ke,"aria-label":y?"Close menu":"Open menu","aria-expanded":y,"aria-controls":"main-menu",children:y?s.jsx(Ne.X,{size:24}):s.jsx(Le,{size:24})})]})]})})}exports.Navbar=Te;
@@ -1,20 +1,20 @@
1
- import { jsx as a, jsxs as c, Fragment as oe } from "react/jsx-runtime";
2
- import { useState as f, useEffect as U, useRef as I, useCallback as G } from "react";
3
- import { Modal as te } from "../Modal/index.mjs";
4
- import { a as Le, C as H } from "../../../index-CIb65n0z.js";
5
- import { ButtonGroup as de } from "../ButtonGroup/index.mjs";
6
- import { s as e, N as Me } from "../../../NavLink-CQpDLYjg.js";
7
- import { E as X } from "../../../external-link-BOPobeQJ.js";
8
- import { X as Ee } from "../../../x-CnsEH4Ox.js";
9
- import { c as V } from "../../../createLucideIcon-C8GTh_Qx.js";
10
- import { C as Ae } from "../../../chevron-down-DSUzBz9F.js";
1
+ import { jsx as a, jsxs as c, Fragment as de } from "react/jsx-runtime";
2
+ import { useState as f, useEffect as U, useRef as G, useCallback as X } from "react";
3
+ import { Modal as he } from "../Modal/index.mjs";
4
+ import { a as Ee, C as V } from "../../../index-CIb65n0z.js";
5
+ import { ButtonGroup as me } from "../ButtonGroup/index.mjs";
6
+ import { s as e, N as Ae } from "../../../NavLink-CQpDLYjg.js";
7
+ import { E as H } from "../../../external-link-BOPobeQJ.js";
8
+ import { X as _e } from "../../../x-CnsEH4Ox.js";
9
+ import { c as q } from "../../../createLucideIcon-C8GTh_Qx.js";
10
+ import { C as Se } from "../../../chevron-down-DSUzBz9F.js";
11
11
  /**
12
12
  * @license lucide-react v0.488.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
16
  */
17
- const _e = [
17
+ const Oe = [
18
18
  ["path", { d: "M21.54 15H17a2 2 0 0 0-2 2v4.54", key: "1djwo0" }],
19
19
  [
20
20
  "path",
@@ -25,47 +25,47 @@ const _e = [
25
25
  ],
26
26
  ["path", { d: "M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05", key: "14pb5j" }],
27
27
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
28
- ], Se = V("earth", _e);
28
+ ], ze = q("earth", Oe);
29
29
  /**
30
30
  * @license lucide-react v0.488.0 - ISC
31
31
  *
32
32
  * This source code is licensed under the ISC license.
33
33
  * See the LICENSE file in the root directory of this source tree.
34
34
  */
35
- const ze = [
35
+ const xe = [
36
36
  ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
37
37
  ["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
38
38
  ["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
39
- ], xe = V("menu", ze);
39
+ ], Re = q("menu", xe);
40
40
  /**
41
41
  * @license lucide-react v0.488.0 - ISC
42
42
  *
43
43
  * This source code is licensed under the ISC license.
44
44
  * See the LICENSE file in the root directory of this source tree.
45
45
  */
46
- const Re = [
46
+ const Te = [
47
47
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
48
48
  ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
49
- ], Te = V("search", Re), Oe = {
49
+ ], We = q("search", Te), Fe = {
50
50
  standard: e.standard,
51
51
  transparent: e.transparent
52
- }, We = {
52
+ }, Be = {
53
53
  left: e.left,
54
54
  center: e.center,
55
55
  right: e.right
56
- }, Fe = ({
56
+ }, je = ({
57
57
  spotlight: s,
58
58
  renderText: u
59
59
  }) => {
60
- var i, E, N, w, $, A, p, _, S, z, h;
61
- const M = (i = s.image) == null ? void 0 : i.asset.altText, k = ((E = s.callToAction.linkOptions) == null ? void 0 : E.linkType) === "external";
60
+ var i, E, N, w, $, A, p, _, S, O, h;
61
+ const L = (i = s.image) == null ? void 0 : i.asset.altText, k = ((E = s.callToAction.linkOptions) == null ? void 0 : E.linkType) === "external";
62
62
  let m = "#";
63
- return ((N = s.callToAction.linkOptions) == null ? void 0 : N.linkType) === "external" && ((w = s.callToAction.linkOptions) != null && w.externalUrl) ? m = ($ = s.callToAction.linkOptions) == null ? void 0 : $.externalUrl : ((A = s.callToAction.linkOptions) == null ? void 0 : A.linkType) === "internal" && ((_ = (p = s.callToAction.linkOptions) == null ? void 0 : p.internalUrl) != null && _.slug.current) && (m = `/${(z = (S = s.callToAction.linkOptions) == null ? void 0 : S.internalUrl) == null ? void 0 : z.slug.current}`), /* @__PURE__ */ c("div", { className: e.spotlight, children: [
63
+ return ((N = s.callToAction.linkOptions) == null ? void 0 : N.linkType) === "external" && ((w = s.callToAction.linkOptions) != null && w.externalUrl) ? m = ($ = s.callToAction.linkOptions) == null ? void 0 : $.externalUrl : ((A = s.callToAction.linkOptions) == null ? void 0 : A.linkType) === "internal" && ((_ = (p = s.callToAction.linkOptions) == null ? void 0 : p.internalUrl) != null && _.slug.current) && (m = `/${(O = (S = s.callToAction.linkOptions) == null ? void 0 : S.internalUrl) == null ? void 0 : O.slug.current}`), /* @__PURE__ */ c("div", { className: e.spotlight, children: [
64
64
  s.image && /* @__PURE__ */ a("div", { className: e.imageWrapper, children: /* @__PURE__ */ a(
65
65
  "img",
66
66
  {
67
67
  src: (s == null ? void 0 : s.image.imageUrl) ?? "",
68
- alt: M || s.image.asset.description || "Content image",
68
+ alt: L || s.image.asset.description || "Content image",
69
69
  width: 600,
70
70
  height: 400
71
71
  }
@@ -75,7 +75,7 @@ const Re = [
75
75
  s.description && /* @__PURE__ */ a("div", { className: e.description, children: u == null ? void 0 : u(s.description, e.description) })
76
76
  ] }),
77
77
  ((h = s.callToAction) == null ? void 0 : h.linkOptions) && /* @__PURE__ */ a("div", { className: e.actions, children: /* @__PURE__ */ a(
78
- H,
78
+ V,
79
79
  {
80
80
  as: "a",
81
81
  variant: s.callToAction.variant ?? "primary",
@@ -88,10 +88,10 @@ const Re = [
88
88
  ) })
89
89
  ] });
90
90
  };
91
- function Je({
91
+ function Qe({
92
92
  renderText: s,
93
93
  title: u,
94
- logo: M,
94
+ logo: L,
95
95
  items: k,
96
96
  groups: m,
97
97
  utilityItems: i,
@@ -103,35 +103,39 @@ function Je({
103
103
  navigationType: p = "default",
104
104
  searchComponent: _,
105
105
  localeSelectComponent: S,
106
- className: z
106
+ className: O
107
107
  }) {
108
- const [h, q] = f(!1), [J, v] = f(null), [he, me] = f(0), [be, fe] = f(!1), [ue, ve] = f(null), [t, y] = f([]), [x, F] = f(
108
+ const [h, J] = f(!1), [K, z] = f(!1), [Q, v] = f(null), [fe, be] = f(0), [ue, ve] = f(!1), [ke, pe] = f(null), [t, y] = f([]), [x, B] = f(
109
109
  0
110
- ), [ke, K] = f(null), [C, pe] = f(!1), [R, T] = f("forward"), B = () => /* @__PURE__ */ a(
110
+ ), [Ne, Y] = f(null), [C, $e] = f(!1), [R, T] = f("forward"), j = () => /* @__PURE__ */ a(
111
111
  "div",
112
112
  {
113
113
  className: `${e.linkWrapper} ${e.parent} ${e.searchWrapper}`,
114
114
  children: /* @__PURE__ */ a("div", { className: e.linkItem, children: /* @__PURE__ */ a(
115
- te,
115
+ he,
116
116
  {
117
117
  className: e.searchModal,
118
+ onOpen: () => z(!0),
119
+ onClose: () => z(!1),
118
120
  trigger: /* @__PURE__ */ a(
119
121
  "button",
120
122
  {
121
123
  title: "Search",
122
124
  "aria-label": "Search",
123
125
  className: e.search,
124
- children: /* @__PURE__ */ a(Te, { size: 16 })
126
+ children: /* @__PURE__ */ a(We, { size: 16 })
125
127
  }
126
128
  ),
127
129
  content: _
128
130
  }
129
131
  ) })
130
132
  }
131
- ), Q = () => /* @__PURE__ */ a("div", { className: `${e.linkWrapper} ${e.parent} `, children: /* @__PURE__ */ a("div", { className: e.linkItem, children: /* @__PURE__ */ a(
132
- te,
133
+ ), Z = () => /* @__PURE__ */ a("div", { className: `${e.linkWrapper} ${e.parent} `, children: /* @__PURE__ */ a("div", { className: e.linkItem, children: /* @__PURE__ */ a(
134
+ he,
133
135
  {
134
136
  className: e.localeModal,
137
+ onOpen: () => z(!0),
138
+ onClose: () => z(!1),
135
139
  trigger: /* @__PURE__ */ a(
136
140
  "button",
137
141
  {
@@ -139,7 +143,7 @@ function Je({
139
143
  "aria-label": "Locale Select",
140
144
  role: "menuitem",
141
145
  className: e.locale,
142
- children: /* @__PURE__ */ a(Se, { size: 16 })
146
+ children: /* @__PURE__ */ a(ze, { size: 16 })
143
147
  }
144
148
  ),
145
149
  content: S
@@ -149,14 +153,14 @@ function Je({
149
153
  if (typeof window < "u") {
150
154
  const n = () => {
151
155
  const l = window.innerWidth < 768;
152
- pe(l);
156
+ $e(l);
153
157
  };
154
158
  return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
155
159
  }
156
160
  }, []);
157
- const Ne = () => {
161
+ const ge = () => {
158
162
  y([]);
159
- }, $e = (n) => {
163
+ }, we = (n) => {
160
164
  T("forward"), y([
161
165
  {
162
166
  title: n.title,
@@ -165,7 +169,7 @@ function Je({
165
169
  description: ""
166
170
  }
167
171
  ]);
168
- }, Y = (n) => {
172
+ }, P = (n) => {
169
173
  T("forward"), y((l) => [
170
174
  ...l,
171
175
  {
@@ -175,70 +179,70 @@ function Je({
175
179
  description: n.description
176
180
  }
177
181
  ]);
178
- }, ge = () => {
182
+ }, ye = () => {
179
183
  T("backward"), y((n) => n.slice(0, -1));
180
- }, j = I(null), L = I(null), D = I(/* @__PURE__ */ new Map()), we = () => {
181
- q((n) => {
184
+ }, D = G(null), M = G(null), I = G(/* @__PURE__ */ new Map()), Ce = () => {
185
+ J((n) => {
182
186
  const l = !n;
183
187
  return l || (y([]), T("forward"), v(null)), l;
184
188
  });
185
- }, Z = (n) => {
186
- const l = D.current.get(n);
187
- if (l && L.current) {
188
- const d = l.getBoundingClientRect(), b = L.current.getBoundingClientRect(), o = d.left - b.left + d.width / 2;
189
- ve(o);
189
+ }, ee = (n) => {
190
+ const l = I.current.get(n);
191
+ if (l && M.current) {
192
+ const d = l.getBoundingClientRect(), b = M.current.getBoundingClientRect(), o = d.left - b.left + d.width / 2;
193
+ pe(o);
190
194
  }
191
- }, ye = (n) => {
195
+ }, Me = (n) => {
192
196
  v((l) => l === n ? null : n);
193
- }, P = G((n) => {
194
- j.current && !j.current.contains(n.target) && v(null);
195
- }, []), ee = G(() => {
196
- ne(), typeof window < "u" && window.innerWidth > 768 && (q(!1), v(null), typeof document < "u" && (document.body.style.overflow = ""));
197
- }, []), ne = G(() => {
198
- if (L.current) {
199
- const n = L.current.getBoundingClientRect().width;
200
- me(n), fe(!0);
197
+ }, ne = X((n) => {
198
+ D.current && !D.current.contains(n.target) && v(null);
199
+ }, []), ae = X(() => {
200
+ le(), typeof window < "u" && window.innerWidth > 768 && (J(!1), v(null), typeof document < "u" && (document.body.style.overflow = ""));
201
+ }, []), le = X(() => {
202
+ if (M.current) {
203
+ const n = M.current.getBoundingClientRect().width;
204
+ be(n), ve(!0);
201
205
  }
202
206
  }, []);
203
207
  U(() => {
204
208
  const n = typeof window < "u", l = typeof document < "u";
205
- return n && window.addEventListener("resize", ee), l && document.addEventListener("click", P), ne(), () => {
206
- n && window.removeEventListener("resize", ee), l && document.removeEventListener("click", P);
209
+ return n && window.addEventListener("resize", ae), l && document.addEventListener("click", ne), le(), () => {
210
+ n && window.removeEventListener("resize", ae), l && document.removeEventListener("click", ne);
207
211
  };
208
212
  }, []), U(() => {
209
213
  if (typeof document < "u")
210
- return document.body.style.overflow = h ? "hidden" : "", () => {
214
+ return document.body.style.overflow = h || K ? "hidden" : "", () => {
211
215
  document.body.style.overflow = "";
212
216
  };
213
- }, [h]);
214
- const Ce = (n) => n.map((l, d) => {
215
- var ae, le, se, ie, ce;
216
- const b = `group-${d}`, W = ke === d, o = (ae = l.primaryItems) == null ? void 0 : ae[x ?? 0];
217
+ }, [h, K]);
218
+ const Le = (n) => n.map((l, d) => {
219
+ var se, ie, ce, re, oe;
220
+ const b = `group-${d}`, F = Ne === d, o = (se = l.primaryItems) == null ? void 0 : se[x ?? 0];
217
221
  return /* @__PURE__ */ c(
218
222
  "div",
219
223
  {
220
224
  className: `${e.linkWrapper} ${e.parent}`,
221
225
  onMouseEnter: () => {
222
- K(d), v(b), Z(b);
226
+ Y(d), v(b), ee(b);
223
227
  },
224
228
  onMouseLeave: () => {
225
- K(null), F(0), v(null);
229
+ Y(null), B(0), v(null);
226
230
  },
227
231
  children: [
228
232
  /* @__PURE__ */ a("div", { className: e.linkItem, children: /* @__PURE__ */ c(
229
233
  "button",
230
234
  {
231
235
  ref: (r) => {
232
- D.current.set(b, r);
236
+ I.current.set(b, r);
233
237
  },
234
238
  role: "menuitem",
235
239
  "aria-haspopup": "true",
236
- "aria-expanded": W,
240
+ "aria-expanded": F,
237
241
  "aria-controls": `submenu-${d}`,
238
- className: `${e.sublinkToggle} ${W ? e.open : ""} `,
242
+ className: `${e.sublinkToggle} ${F ? e.open : ""} `,
239
243
  children: [
240
244
  l.title,
241
- /* @__PURE__ */ a(Ae, { size: 18, className: e.chevron })
245
+ /* @__PURE__ */ a(Se, { size: 18, className: e.chevron })
242
246
  ]
243
247
  }
244
248
  ) }),
@@ -246,7 +250,7 @@ function Je({
246
250
  "div",
247
251
  {
248
252
  id: `submenu-${d}`,
249
- className: `${e.sublinks} ${W ? e.show : ""}`,
253
+ className: `${e.sublinks} ${F ? e.show : ""}`,
250
254
  role: "menu",
251
255
  "aria-label": `${l.title} submenu`,
252
256
  children: /* @__PURE__ */ a("div", { children: /* @__PURE__ */ c(
@@ -260,7 +264,7 @@ function Je({
260
264
  className: `${e.sublinksColumn} ${e.primaryColumn}`,
261
265
  children: [
262
266
  /* @__PURE__ */ a("div", { className: e.linkItem }),
263
- (le = l.primaryItems) == null ? void 0 : le.map(
267
+ (ie = l.primaryItems) == null ? void 0 : ie.map(
264
268
  (r, g) => r.href ? /* @__PURE__ */ c(
265
269
  "a",
266
270
  {
@@ -269,10 +273,10 @@ function Je({
269
273
  target: r.isExternal ? "_blank" : "_self",
270
274
  rel: r.isExternal ? "noopener noreferrer" : void 0,
271
275
  onClick: () => {
272
- var re;
273
- v(null), (re = r.onClick) == null || re.call(r);
276
+ var te;
277
+ v(null), (te = r.onClick) == null || te.call(r);
274
278
  },
275
- onMouseEnter: () => r.sublinks ? F(g) : null,
279
+ onMouseEnter: () => r.sublinks ? B(g) : null,
276
280
  role: "menuitem",
277
281
  children: [
278
282
  /* @__PURE__ */ c("span", { className: e.linkContent, children: [
@@ -280,7 +284,7 @@ function Je({
280
284
  r.subtitle && /* @__PURE__ */ a("span", { className: e.subtitle, children: r.subtitle })
281
285
  ] }),
282
286
  r.isExternal && /* @__PURE__ */ a(
283
- X,
287
+ H,
284
288
  {
285
289
  className: e.newTabIcon,
286
290
  size: 16
@@ -293,7 +297,7 @@ function Je({
293
297
  "button",
294
298
  {
295
299
  className: `${e.sublinkToggle} ${x === g ? e.open : ""}`,
296
- onMouseEnter: () => F(g),
300
+ onMouseEnter: () => B(g),
297
301
  children: /* @__PURE__ */ c("span", { className: e.linkContent, children: [
298
302
  r.label,
299
303
  r.subtitle && /* @__PURE__ */ a("span", { className: e.subtitle, children: r.subtitle })
@@ -305,7 +309,7 @@ function Je({
305
309
  ]
306
310
  }
307
311
  ),
308
- (o == null ? void 0 : o.sublinks) && ((se = o == null ? void 0 : o.sublinks) == null ? void 0 : se.length) > 0 && /* @__PURE__ */ c(
312
+ (o == null ? void 0 : o.sublinks) && ((ce = o == null ? void 0 : o.sublinks) == null ? void 0 : ce.length) > 0 && /* @__PURE__ */ c(
309
313
  "div",
310
314
  {
311
315
  className: `${e.sublinksColumn} ${e.fadeInFromLeft}`,
@@ -314,19 +318,19 @@ function Je({
314
318
  /* @__PURE__ */ a("p", { children: "TEXT HERE" }),
315
319
  s == null ? void 0 : s(o.description)
316
320
  ] }),
317
- (o == null ? void 0 : o.sublinks) && O(
321
+ (o == null ? void 0 : o.sublinks) && W(
318
322
  o.sublinks,
319
323
  `${b}-${x}`
320
324
  )
321
325
  ]
322
326
  },
323
- `${o.label}-${(ie = o == null ? void 0 : o.sublinks) == null ? void 0 : ie.length}`
327
+ `${o.label}-${(re = o == null ? void 0 : o.sublinks) == null ? void 0 : re.length}`
324
328
  ),
325
- (l == null ? void 0 : l.secondaryItems) && ((ce = l == null ? void 0 : l.secondaryItems) == null ? void 0 : ce.length) > 0 && /* @__PURE__ */ a(
329
+ (l == null ? void 0 : l.secondaryItems) && ((oe = l == null ? void 0 : l.secondaryItems) == null ? void 0 : oe.length) > 0 && /* @__PURE__ */ a(
326
330
  "div",
327
331
  {
328
332
  className: `${e.sublinksColumn} ${e.secondaryColumn}`,
329
- children: l.secondaryItems && l.secondaryItems.length > 0 && O(l.secondaryItems, `${b}-secondary`)
333
+ children: l.secondaryItems && l.secondaryItems.length > 0 && W(l.secondaryItems, `${b}-secondary`)
330
334
  }
331
335
  ),
332
336
  l.spotlight && /* @__PURE__ */ a(
@@ -334,7 +338,7 @@ function Je({
334
338
  {
335
339
  className: `${e.sublinksColumn} ${e.spotlightColumn}`,
336
340
  children: /* @__PURE__ */ a(
337
- Fe,
341
+ je,
338
342
  {
339
343
  spotlight: l.spotlight,
340
344
  renderText: s ?? ((r) => String(r))
@@ -351,20 +355,20 @@ function Je({
351
355
  },
352
356
  l._key ?? `group-${d}`
353
357
  );
354
- }), O = (n, l = "") => n.map((d) => {
358
+ }), W = (n, l = "") => n.map((d) => {
355
359
  const b = `${l}/${d.label}`;
356
360
  return /* @__PURE__ */ a(
357
- Me,
361
+ Ae,
358
362
  {
359
363
  link: d,
360
364
  path: b,
361
365
  parentPath: l,
362
- openPath: J,
363
- togglePath: ye,
364
- updateTriangleIndicator: Z,
366
+ openPath: Q,
367
+ togglePath: Me,
368
+ updateTriangleIndicator: ee,
365
369
  setOpenPath: v,
366
- renderLinks: O,
367
- buttonRefs: D
370
+ renderLinks: W,
371
+ buttonRefs: I
368
372
  },
369
373
  d._key ?? b
370
374
  );
@@ -372,23 +376,23 @@ function Je({
372
376
  return /* @__PURE__ */ a(
373
377
  "header",
374
378
  {
375
- ref: j,
376
- className: `${z ?? ""} ${We[$]} ${Oe[A]} ${e.navbar} ${E ? e.sticky : ""} ${m && m.length ? e.advanced : e.default}`,
379
+ ref: D,
380
+ className: `${O ?? ""} ${Be[$]} ${Fe[A]} ${e.navbar} ${E ? e.sticky : ""} ${m && m.length ? e.advanced : e.default}`,
377
381
  "aria-label": "Main navigation",
378
382
  children: /* @__PURE__ */ c(
379
383
  "div",
380
384
  {
381
385
  className: `${e.container} ${(!i || i.length === 0) && $ !== "center" ? e.twoColumn : ""}`,
382
386
  children: [
383
- M ? /* @__PURE__ */ a("div", { className: e.logo, children: M }) : /* @__PURE__ */ a("div", { className: e.title, children: u }),
387
+ L ? /* @__PURE__ */ a("div", { className: e.logo, children: L }) : /* @__PURE__ */ a("div", { className: e.title, children: u }),
384
388
  /* @__PURE__ */ a(
385
389
  "nav",
386
390
  {
387
- ref: L,
391
+ ref: M,
388
392
  style: {
389
- left: $ === "center" ? `calc(50% - ${he / 2}px)` : "0"
393
+ left: $ === "center" ? `calc(50% - ${fe / 2}px)` : "0"
390
394
  },
391
- className: `${e.nav} ${h ? e.open : ""} ${be ? e.visible : e.hidden}`,
395
+ className: `${e.nav} ${h ? e.open : ""} ${ue ? e.visible : e.hidden}`,
392
396
  id: "main-menu",
393
397
  role: "menubar",
394
398
  "aria-label": "Main navigation",
@@ -396,8 +400,8 @@ function Je({
396
400
  /* @__PURE__ */ a(
397
401
  "svg",
398
402
  {
399
- style: { left: `${ue}px` },
400
- className: `${e.triangle} ${J ? e.show : ""}`,
403
+ style: { left: `${ke}px` },
404
+ className: `${e.triangle} ${Q ? e.show : ""}`,
401
405
  width: 16,
402
406
  height: 12,
403
407
  viewBox: "0 0 100 75",
@@ -414,20 +418,20 @@ function Je({
414
418
  }
415
419
  ),
416
420
  p === "default" && k && /* @__PURE__ */ c("div", { className: e.grid, children: [
417
- k && k.length > 0 && O(k),
418
- N && !C && /* @__PURE__ */ c(oe, { children: [
421
+ k && k.length > 0 && W(k),
422
+ N && !C && /* @__PURE__ */ c(de, { children: [
419
423
  /* @__PURE__ */ a("span", { className: e.separator }),
420
- /* @__PURE__ */ a(B, {})
424
+ /* @__PURE__ */ a(j, {})
421
425
  ] }),
422
- w && /* @__PURE__ */ a(Q, {})
426
+ w && /* @__PURE__ */ a(Z, {})
423
427
  ] }),
424
428
  !C && p === "advanced" && m && /* @__PURE__ */ c("div", { className: e.grid, children: [
425
- m.length > 0 && Ce(m),
426
- N && /* @__PURE__ */ c(oe, { children: [
429
+ m.length > 0 && Le(m),
430
+ N && /* @__PURE__ */ c(de, { children: [
427
431
  /* @__PURE__ */ a("span", { className: e.separator }),
428
- /* @__PURE__ */ a(B, {})
432
+ /* @__PURE__ */ a(j, {})
429
433
  ] }),
430
- w && /* @__PURE__ */ a(Q, {})
434
+ w && /* @__PURE__ */ a(Z, {})
431
435
  ] }),
432
436
  C && p === "advanced" && h && t.length === 0 && m && /* @__PURE__ */ a("div", { className: `${e.mobileMenu}`, children: m.map((n, l) => /* @__PURE__ */ a(
433
437
  "div",
@@ -437,7 +441,7 @@ function Je({
437
441
  "button",
438
442
  {
439
443
  className: e.sublinkToggle,
440
- onClick: () => $e(n),
444
+ onClick: () => we(n),
441
445
  children: n.title
442
446
  }
443
447
  )
@@ -453,9 +457,9 @@ function Je({
453
457
  "button",
454
458
  {
455
459
  className: e.back,
456
- onClick: t.length === 1 ? Ne : ge,
460
+ onClick: t.length === 1 ? ge : ye,
457
461
  children: /* @__PURE__ */ a(
458
- Le,
462
+ Ee,
459
463
  {
460
464
  size: 18,
461
465
  "aria-hidden": "true",
@@ -481,7 +485,7 @@ function Je({
481
485
  "button",
482
486
  {
483
487
  className: e.sublinkToggle,
484
- onClick: () => Y(n),
488
+ onClick: () => P(n),
485
489
  children: /* @__PURE__ */ c("span", { className: e.linkContent, children: [
486
490
  n.label,
487
491
  n.subtitle && /* @__PURE__ */ a("span", { className: e.subtitle, children: n.subtitle })
@@ -501,7 +505,7 @@ function Je({
501
505
  n.subtitle && /* @__PURE__ */ a("span", { className: e.subtitle, children: n.subtitle })
502
506
  ] }),
503
507
  n.isExternal && /* @__PURE__ */ a(
504
- X,
508
+ H,
505
509
  {
506
510
  className: e.newTabIcon,
507
511
  size: 16
@@ -523,7 +527,7 @@ function Je({
523
527
  "button",
524
528
  {
525
529
  className: e.sublinkToggle,
526
- onClick: () => Y(n),
530
+ onClick: () => P(n),
527
531
  children: n.label
528
532
  }
529
533
  ) : /* @__PURE__ */ c(
@@ -537,7 +541,7 @@ function Je({
537
541
  children: [
538
542
  n.label,
539
543
  n.isExternal && /* @__PURE__ */ a(
540
- X,
544
+ H,
541
545
  {
542
546
  className: e.newTabIcon,
543
547
  size: 16
@@ -557,8 +561,8 @@ function Je({
557
561
  ] })
558
562
  }
559
563
  ),
560
- i && i.length > 0 && /* @__PURE__ */ a("nav", { className: e.utility, "aria-label": "Utility navigation", children: /* @__PURE__ */ a(de, { children: i.map((n, l) => /* @__PURE__ */ a(
561
- H,
564
+ i && i.length > 0 && /* @__PURE__ */ a("nav", { className: e.utility, "aria-label": "Utility navigation", children: /* @__PURE__ */ a(me, { children: i.map((n, l) => /* @__PURE__ */ a(
565
+ V,
562
566
  {
563
567
  as: "a",
564
568
  href: n.href ?? "/",
@@ -584,8 +588,8 @@ function Je({
584
588
  {
585
589
  "aria-label": "Utility navigation",
586
590
  className: `${e.utilityMobile} ${h ? e.open : ""}`,
587
- children: /* @__PURE__ */ a(de, { alignment: "center", children: /* @__PURE__ */ a(
588
- H,
591
+ children: /* @__PURE__ */ a(me, { alignment: "center", children: /* @__PURE__ */ a(
592
+ V,
589
593
  {
590
594
  as: "a",
591
595
  href: i[1].href ?? "/",
@@ -608,16 +612,16 @@ function Je({
608
612
  }
609
613
  ),
610
614
  /* @__PURE__ */ c("div", { className: e.mobileButtons, children: [
611
- C && N && /* @__PURE__ */ a(B, {}),
615
+ C && N && /* @__PURE__ */ a(j, {}),
612
616
  /* @__PURE__ */ a(
613
617
  "button",
614
618
  {
615
619
  className: e.menuToggle,
616
- onClick: we,
620
+ onClick: Ce,
617
621
  "aria-label": h ? "Close menu" : "Open menu",
618
622
  "aria-expanded": h,
619
623
  "aria-controls": "main-menu",
620
- children: h ? /* @__PURE__ */ a(Ee, { size: 24 }) : /* @__PURE__ */ a(xe, { size: 24 })
624
+ children: h ? /* @__PURE__ */ a(_e, { size: 24 }) : /* @__PURE__ */ a(Re, { size: 24 })
621
625
  }
622
626
  )
623
627
  ] })
@@ -628,5 +632,5 @@ function Je({
628
632
  );
629
633
  }
630
634
  export {
631
- Je as Navbar
635
+ Qe as Navbar
632
636
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.0.459",
4
+ "version": "0.0.461",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {