quirk-ui 0.1.25 → 0.1.27

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";require('./assets/NavLink.css');const e=require("react/jsx-runtime"),d=require("react"),h=require("./external-link-DDShu-48.cjs"),k=require("./chevron-down-DfK1XBl3.cjs"),v="_navbar_p4o24_5",f="_sticky_p4o24_19",I="_left_p4o24_35",C="_container_p4o24_36",M="_logo_p4o24_40",w="_nav_p4o24_5",y="_center_p4o24_55",x="_hidden_p4o24_63",T="_visible_p4o24_70",N="_right_p4o24_85",j="_title_p4o24_92",S="_linkWrapper_p4o24_102",W="_parent_p4o24_102",$="_linkItem_p4o24_109",D="_link_p4o24_102",L="_search_p4o24_115",E="_locale_p4o24_116",F="_themeToggle_p4o24_117",q="_sublinkToggle_p4o24_118",R="_standard_p4o24_169",B="_triangle_p4o24_177",z="_twoColumn_p4o24_204",A="_mobileButtons_p4o24_213",G="_menuToggle_p4o24_281",H="_utilityMobile_p4o24_299",J="_utility_p4o24_299",K="_navInner_p4o24_327",Q="_grid_p4o24_338",U="_searchModal_p4o24_357",V="_localeModal_p4o24_358",X="_separator_p4o24_377",Y="_newTabIcon_p4o24_408",Z="_sublinksDescription_p4o24_421",O="_linkContent_p4o24_424",P="_open_p4o24_437",oo="_back_p4o24_461",no="_sublinks_p4o24_421",eo="_show_p4o24_510",to="_primaryColumn_p4o24_559",so="_secondaryColumn_p4o24_568",_o="_spotlightColumn_p4o24_572",io="_sublinksInner_p4o24_576",lo="_sublinksColumn_p4o24_596",ro="_chevron_p4o24_606",co="_advanced_p4o24_798",ao="_subtitle_p4o24_807",po="_withSpotlight_p4o24_849",uo="_withoutSpotlight_p4o24_853",mo="_transparent_p4o24_891",bo="_groupDivider_p4o24_1002",go="_searchWrapper_p4o24_1010",ho="_mobileMenu_p4o24_1017",ko="_mobileMenuSlide_p4o24_1018",vo="_mobileMenuItem_p4o24_1028",fo="_fadeInFromLeft_p4o24_1032",Io="_fadeInFromRight_p4o24_1036",Co="_spotlight_p4o24_572",Mo="_imageWrapper_p4o24_1046",wo="_content_p4o24_1068",yo="_description_p4o24_1083",xo="_actions_p4o24_1087",n={navbar:v,sticky:f,left:I,container:C,logo:M,nav:w,center:y,hidden:x,visible:T,right:N,title:j,linkWrapper:S,parent:W,linkItem:$,link:D,search:L,locale:E,themeToggle:F,sublinkToggle:q,standard:R,triangle:B,twoColumn:z,mobileButtons:A,menuToggle:G,utilityMobile:H,utility:J,navInner:K,grid:Q,searchModal:U,localeModal:V,separator:X,newTabIcon:Y,sublinksDescription:Z,linkContent:O,open:P,back:oo,sublinks:no,show:eo,primaryColumn:to,secondaryColumn:so,spotlightColumn:_o,sublinksInner:io,sublinksColumn:lo,chevron:ro,default:"_default_p4o24_729",advanced:co,subtitle:ao,withSpotlight:po,withoutSpotlight:uo,transparent:mo,groupDivider:bo,searchWrapper:go,mobileMenu:ho,mobileMenuSlide:ko,mobileMenuItem:vo,fadeInFromLeft:fo,fadeInFromRight:Io,spotlight:Co,imageWrapper:Mo,content:wo,description:yo,actions:xo};function To({link:o,path:t,parentPath:r,openPath:m,togglePath:c,updateTriangleIndicator:b,setOpenPath:_,renderLinks:g,buttonRefs:i}){var p;const l=m===t,s=!!((p=o.sublinks)!=null&&p.length),a=d.useRef(null);return d.useEffect(()=>(i.current.set(t,a.current),()=>{i.current.delete(t)}),[t,i]),e.jsxs("div",{className:`${n.linkWrapper} ${r?"":n.parent}`,children:[e.jsx("div",{className:n.linkItem,children:o.href?e.jsxs("a",{href:o.href,className:n.link,target:o.isExternal?"_blank":"_self",rel:o.isExternal?"noopener noreferrer":void 0,onClick:()=>{var u;_(null),(u=o.onClick)==null||u.call(o)},onMouseEnter:()=>{r||_(null)},role:"menuitem",children:[o.label,o.isExternal&&e.jsx(h.ExternalLink,{className:n.newTabIcon,size:16,"aria-hidden":"true"})]}):e.jsxs("button",{ref:a,"aria-haspopup":s?!0:void 0,"aria-expanded":s?l:void 0,className:`${n.sublinkToggle} ${l?n.open:""}`,onClick:()=>c(t),onMouseEnter:()=>{b(t),_(t)},children:[o.label,s&&e.jsx(k.ChevronDown,{size:18,className:n.chevron,"aria-hidden":"true"})]})}),s&&e.jsx("div",{className:`${n.sublinks} ${l?n.show:""}`,onMouseLeave:()=>c(t),role:"menu","aria-label":`${o.label} submenu`,children:e.jsx("div",{children:e.jsx("div",{className:n.sublinksInner,children:e.jsx("div",{className:n.sublinksColumn,children:g(o.sublinks,t)})})})})]})}exports.NavLink=To;exports.styles=n;
1
+ "use strict";require('./assets/NavLink.css');const e=require("react/jsx-runtime"),d=require("react"),h=require("./external-link-DDShu-48.cjs"),k=require("./chevron-down-DfK1XBl3.cjs"),v="_navbar_p4o24_5",f="_sticky_p4o24_19",I="_left_p4o24_35",C="_container_p4o24_36",M="_logo_p4o24_40",w="_nav_p4o24_5",y="_center_p4o24_55",x="_hidden_p4o24_63",T="_visible_p4o24_70",N="_right_p4o24_85",j="_title_p4o24_92",S="_linkWrapper_p4o24_102",W="_parent_p4o24_102",$="_linkItem_p4o24_109",D="_link_p4o24_102",L="_search_p4o24_115",E="_locale_p4o24_116",F="_themeToggle_p4o24_117",q="_sublinkToggle_p4o24_118",R="_standard_p4o24_169",B="_triangle_p4o24_177",z="_twoColumn_p4o24_204",A="_mobileButtons_p4o24_213",G="_menuToggle_p4o24_281",H="_utilityMobile_p4o24_299",J="_utility_p4o24_299",K="_navInner_p4o24_327",Q="_grid_p4o24_338",U="_searchModal_p4o24_357",V="_localeModal_p4o24_358",X="_separator_p4o24_377",Y="_newTabIcon_p4o24_408",Z="_sublinksDescription_p4o24_421",O="_linkContent_p4o24_424",P="_open_p4o24_437",oo="_back_p4o24_461",no="_sublinks_p4o24_421",eo="_show_p4o24_510",to="_primaryColumn_p4o24_559",so="_secondaryColumn_p4o24_568",_o="_spotlightColumn_p4o24_572",io="_sublinksInner_p4o24_576",lo="_sublinksColumn_p4o24_596",ro="_chevron_p4o24_606",co="_advanced_p4o24_798",ao="_subtitle_p4o24_807",po="_withSpotlight_p4o24_849",uo="_withoutSpotlight_p4o24_853",mo="_transparent_p4o24_891",bo="_groupDivider_p4o24_1002",go="_searchWrapper_p4o24_1010",ho="_mobileMenu_p4o24_1017",ko="_mobileMenuSlide_p4o24_1018",vo="_mobileMenuItem_p4o24_1028",fo="_fadeInFromLeft_p4o24_1032",Io="_fadeInFromRight_p4o24_1036",Co="_spotlight_p4o24_572",Mo="_imageWrapper_p4o24_1046",wo="_content_p4o24_1068",yo="_description_p4o24_1083",xo="_actions_p4o24_1087",n={navbar:v,sticky:f,left:I,container:C,logo:M,nav:w,center:y,hidden:x,visible:T,right:N,title:j,linkWrapper:S,parent:W,linkItem:$,link:D,search:L,locale:E,themeToggle:F,sublinkToggle:q,standard:R,triangle:B,twoColumn:z,mobileButtons:A,menuToggle:G,utilityMobile:H,utility:J,navInner:K,grid:Q,searchModal:U,localeModal:V,separator:X,newTabIcon:Y,sublinksDescription:Z,linkContent:O,open:P,back:oo,sublinks:no,show:eo,primaryColumn:to,secondaryColumn:so,spotlightColumn:_o,sublinksInner:io,sublinksColumn:lo,chevron:ro,default:"_default_p4o24_729",advanced:co,subtitle:ao,withSpotlight:po,withoutSpotlight:uo,transparent:mo,groupDivider:bo,searchWrapper:go,mobileMenu:ho,mobileMenuSlide:ko,mobileMenuItem:vo,fadeInFromLeft:fo,fadeInFromRight:Io,spotlight:Co,imageWrapper:Mo,content:wo,description:yo,actions:xo};function To({link:o,path:t,parentPath:r,openPath:m,togglePath:c,updateTriangleIndicator:b,setOpenPath:_,renderLinks:g,buttonRefs:i}){var p;const l=m===t,s=!!((p=o.sublinks)!=null&&p.length),a=d.useRef(null);return d.useEffect(()=>(i.current.set(t,a.current),()=>{i.current.delete(t)}),[t,i]),e.jsxs("div",{role:"menuitem",className:`${n.linkWrapper} ${r?"":n.parent}`,children:[e.jsx("div",{className:n.linkItem,children:o.href?e.jsxs("a",{href:o.href,className:n.link,target:o.isExternal?"_blank":"_self",rel:o.isExternal?"noopener noreferrer":void 0,onClick:()=>{var u;_(null),(u=o.onClick)==null||u.call(o)},onMouseEnter:()=>{r||_(null)},children:[o.label,o.isExternal&&e.jsx(h.ExternalLink,{className:n.newTabIcon,size:16,"aria-hidden":"true"})]}):e.jsxs("button",{ref:a,"aria-haspopup":s?!0:void 0,"aria-expanded":s?l:void 0,className:`${n.sublinkToggle} ${l?n.open:""}`,onClick:()=>c(t),onMouseEnter:()=>{b(t),_(t)},children:[o.label,s&&e.jsx(k.ChevronDown,{size:18,className:n.chevron,"aria-hidden":"true"})]})}),s&&e.jsx("div",{className:`${n.sublinks} ${l?n.show:""}`,onMouseLeave:()=>c(t),role:"menu","aria-label":`${o.label} submenu`,children:e.jsx("div",{children:e.jsx("div",{className:n.sublinksInner,children:e.jsx("div",{className:n.sublinksColumn,children:g(o.sublinks,t)})})})})]})}exports.NavLink=To;exports.styles=n;
@@ -84,6 +84,7 @@ function $o({
84
84
  }), [e, i]), /* @__PURE__ */ r(
85
85
  "div",
86
86
  {
87
+ role: "menuitem",
87
88
  className: `${n.linkWrapper} ${c ? "" : n.parent}`,
88
89
  children: [
89
90
  /* @__PURE__ */ t("div", { className: n.linkItem, children: o.href ? /* @__PURE__ */ r(
@@ -100,7 +101,6 @@ function $o({
100
101
  onMouseEnter: () => {
101
102
  c || _(null);
102
103
  },
103
- role: "menuitem",
104
104
  children: [
105
105
  o.label,
106
106
  o.isExternal && /* @__PURE__ */ t(
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const e=require("../../../NavLink-Bld-qcLP.cjs");require("../../../external-link-DDShu-48.cjs");require("../../../chevron-down-DfK1XBl3.cjs");exports.NavLink=e.NavLink;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const e=require("../../../NavLink-BVoXgmyD.cjs");require("../../../external-link-DDShu-48.cjs");require("../../../chevron-down-DfK1XBl3.cjs");exports.NavLink=e.NavLink;
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { N as a } from "../../../NavLink-EFx91-2v.js";
3
+ import { N as a } from "../../../NavLink-Dxf80v5Z.js";
4
4
  import "../../../external-link-BOPobeQJ.js";
5
5
  import "../../../chevron-down-DSUzBz9F.js";
6
6
  export {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),se=require("../Modal/index.cjs"),q=require("../../../index-CVFNs6JY.cjs"),le=require("../ButtonGroup/index.cjs"),e=require("../../../NavLink-Bld-qcLP.cjs"),U=require("../../utils/NoScroll/noScroll.cjs"),we=require("../../../chevron-right-motlyADs.cjs"),P=require("../../../external-link-DDShu-48.cjs"),Ce=require("../../../x-Dft9NVe_.cjs"),ne=require("../../../createLucideIcon-DpotSgUx.cjs"),_e=require("../../../chevron-down-DfK1XBl3.cjs");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),se=require("../Modal/index.cjs"),q=require("../../../index-CVFNs6JY.cjs"),le=require("../ButtonGroup/index.cjs"),e=require("../../../NavLink-BVoXgmyD.cjs"),U=require("../../utils/NoScroll/noScroll.cjs"),we=require("../../../chevron-right-motlyADs.cjs"),P=require("../../../external-link-DDShu-48.cjs"),Ce=require("../../../x-Dft9NVe_.cjs"),ne=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.
@@ -8,4 +8,4 @@
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 Le=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Me=ne.createLucideIcon("search",Le),Ee={standard:e.styles.standard,transparent:e.styles.transparent},Be={left:e.styles.left,center:e.styles.center,right:e.styles.right},Re=({spotlight:i,renderText:h})=>{var y,_,p,k,v,S;const r=i.callToAction;if(!r)return null;const j=((y=r.linkOptions)==null?void 0:y.linkType)==="external";let u="#";return j&&((_=r.linkOptions)!=null&&_.externalUrl)?u=r.linkOptions.externalUrl:((p=r.linkOptions)==null?void 0:p.linkType)==="internal"&&((v=(k=r.linkOptions)==null?void 0:k.internalUrl)!=null&&v.slug.current)&&(u=`/${r.linkOptions.internalUrl.slug.current}`),s.jsxs("div",{className:e.styles.spotlight,children:[i.image&&s.jsx("div",{className:e.styles.imageWrapper,children:s.jsx("img",{src:((S=i.image.imageUrls)==null?void 0:S.medium)??"",alt:i.image.asset.altText||i.image.asset.description||"Content image",width:600,height:400})}),s.jsxs("div",{className:e.styles.content,children:[i.title&&s.jsx("div",{className:e.styles.title,children:h==null?void 0:h(i.title,e.styles.title)}),i.description&&s.jsx("div",{className:e.styles.description,children:h==null?void 0:h(i.description,e.styles.description)})]}),r.linkOptions&&s.jsx("div",{className:e.styles.actions,children:s.jsx(q.Button,{as:"a",variant:r.variant??"primary",href:u,target:j?"_blank":"_self",rel:j?"noopener noreferrer":void 0,"aria-label":r.ariaLabel||r.label,children:r.label})})]})};function qe({renderText:i,title:h,logo:r,items:j,groups:u,utilityItems:y,isSticky:_=!1,showSearch:p=!0,showLocaleSelect:k=!0,showThemeToggle:v=!0,themeToggleComponent:S,alignment:z="right",variant:ae="standard",navigationType:I="default",searchComponent:te,localeSelectComponent:ie,className:re,style:ce,...oe}){const[m,V]=a.useState(!1),[H,f]=a.useState(null),[de,ue]=a.useState(0),[ye,he]=a.useState(!1),[me,be]=a.useState(null),[c,$]=a.useState([]),[L,O]=a.useState(0),[xe,X]=a.useState(null),[w,pe]=a.useState(!1),[M,E]=a.useState("forward"),A=a.useRef(null),C=a.useRef(null),W=a.useRef(new Map),J=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,children:s.jsx("div",{className:`${e.styles.linkItem} ${e.styles.themeToggle}`,children:S})}),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(se.Modal,{className:e.styles.searchModal,trigger:s.jsx("button",{title:"Search","aria-label":"Search",className:e.styles.search,children:s.jsx(Me,{size:16,"aria-hidden":"true"})}),content:te})})}),K=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(se.Modal,{className:e.styles.localeModal,trigger:s.jsx("button",{title:"Locale Select","aria-label":"Locale Select",className:e.styles.locale,children:s.jsx(Ie,{size:16,"aria-hidden":"true"})}),content:ie})})}),B=a.useCallback(()=>{C.current&&ue(C.current.getBoundingClientRect().width)},[]),fe=()=>{V(l=>{const n=!l;return n||($([]),E("forward"),f(null)),n})},Q=a.useCallback(l=>{const n=W.current.get(l);if(n&&C.current){const d=n.getBoundingClientRect(),b=C.current.getBoundingClientRect();be(d.left-b.left+d.width/2)}},[]),je=a.useCallback(l=>{f(n=>n===l?null:l)},[]),G=a.useCallback(l=>{A.current&&!A.current.contains(l.target)&&f(null)},[]),D=a.useCallback(()=>{B(),typeof window<"u"&&window.innerWidth>768&&(V(!1),f(null))},[B]),ke=()=>$([]),ve=l=>{E("forward"),$([{title:l.title,primary:l.primaryItems??[],secondary:l.secondaryItems??[],description:""}])},Y=l=>{E("forward"),$(n=>[...n,{title:l.label,primary:l.sublinks??[],secondary:[],description:l.description}])},ge=()=>{E("backward"),$(l=>l.slice(0,-1))};a.useEffect(()=>{if(typeof window>"u")return;const l=()=>pe(window.innerWidth<768);return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]),a.useEffect(()=>{const l=typeof window<"u",n=typeof document<"u";return l&&window.addEventListener("resize",D),n&&document.addEventListener("click",G),B(),he(!0),()=>{l&&window.removeEventListener("resize",D),n&&document.removeEventListener("click",G)}},[D,G,B]),a.useEffect(()=>{if(!(typeof document>"u"))return m?setTimeout(()=>U.lockScroll(),0):U.unlockScroll(),()=>U.unlockScroll()},[m]);const R=(l,n="")=>l.map((d,b)=>{const g=`${n}/${d._key??d.label}-${b}`;return s.jsx(e.NavLink,{link:d,path:g,parentPath:n,openPath:H,togglePath:je,updateTriangleIndicator:Q,setOpenPath:f,renderLinks:R,buttonRefs:W},g)}),Ne=l=>l.map((n,d)=>{var Z,T;const b=`group-${d}`,g=xe===d,x=(Z=n.primaryItems)==null?void 0:Z[L??0];return s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{X(d),f(b),Q(b)},children:[s.jsx("div",{className:e.styles.linkItem,children:s.jsxs("button",{ref:t=>{W.current.set(b,t)},"aria-haspopup":!0,"aria-expanded":g,"aria-controls":`submenu-${d}`,className:`${e.styles.sublinkToggle} ${g?e.styles.open:""}`,children:[n.title,s.jsx(_e.ChevronDown,{size:18,className:e.styles.chevron,"aria-hidden":"true"})]})}),s.jsx("div",{id:`submenu-${d}`,className:`${e.styles.sublinks} ${g?e.styles.show:""}`,role:"menu","aria-label":`${n.title} submenu`,onMouseLeave:()=>{X(null),O(0),f(null)},children:s.jsx("div",{children:s.jsxs("div",{className:`${e.styles.sublinksInner} ${n.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}),(T=n.primaryItems)==null?void 0:T.map((t,N)=>t.href?s.jsxs("a",{href:t.href,className:`${e.styles.link} ${L===N?e.styles.open:""}`,target:t.isExternal?"_blank":"_self",rel:t.isExternal?"noopener noreferrer":void 0,onClick:()=>{var ee;f(null),(ee=t.onClick)==null||ee.call(t)},onMouseEnter:()=>O(N),role:"menuitem",children:[s.jsxs("span",{className:e.styles.linkContent,children:[t.label,t.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:t.subtitle})]}),t.isExternal&&s.jsx(P.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]},t._key??N):s.jsx("button",{className:`${e.styles.sublinkToggle} ${L===N?e.styles.open:""}`,onMouseEnter:()=>O(N),children:s.jsxs("span",{className:e.styles.linkContent,children:[t.label,t.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:t.subtitle})]})},t._key??N))]}),(x==null?void 0:x.sublinks)&&x.sublinks.length>0&&s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.fadeInFromLeft}`,children:[x.description&&s.jsx("div",{className:e.styles.sublinksDescription,children:i==null?void 0:i(x.description)}),R(x.sublinks,`${b}-${L}`)]},`${x.label}-${x.sublinks.length}`),n.secondaryItems&&n.secondaryItems.length>0&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.secondaryColumn}`,children:R(n.secondaryItems,`${b}-secondary`)}),n.spotlight&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.spotlightColumn}`,children:s.jsx(Re,{spotlight:n.spotlight,renderText:i})})]})})})]},n._key??`group-${d}`)}),$e=[e.styles.navbar,Be[z],Ee[ae],_?e.styles.sticky:"",u!=null&&u.length?e.styles.advanced:e.styles.default,re??""].filter(Boolean).join(" "),o=y&&y.length>0?y[Math.min(1,y.length-1)]:null;return s.jsx("header",{ref:A,className:$e,style:ce,"aria-label":"Site header",...oe,children:s.jsxs("div",{className:`${e.styles.container} ${(!y||y.length===0)&&z!=="center"?e.styles.twoColumn:""}`,children:[r?s.jsx("div",{className:e.styles.logo,children:r}):h?s.jsx("div",{className:e.styles.title,children:h}):null,s.jsx("nav",{ref:C,style:{left:z==="center"?`calc(50% - ${de/2}px)`:"0"},className:`${e.styles.nav} ${m?e.styles.open:""} ${ye?e.styles.visible:e.styles.hidden}`,id:"main-menu","aria-label":"Primary navigation",children:s.jsxs("div",{className:e.styles.navInner,children:[s.jsx("svg",{style:{left:`${me}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","aria-hidden":"true",children:s.jsx("polygon",{points:"50,5 95,70 5,70",strokeLinejoin:"round",fill:"white",stroke:"white"})}),I==="default"&&j&&s.jsxs("div",{className:e.styles.grid,children:[j.length>0&&R(j),(p||k||v)&&s.jsx("span",{className:e.styles.separator,"aria-hidden":"true"}),v&&s.jsx(J,{}),p&&!w&&s.jsx(F,{}),k&&s.jsx(K,{})]}),!w&&I==="advanced"&&u&&s.jsxs("div",{className:e.styles.grid,children:[u.length>0&&Ne(u),(p||k||v)&&s.jsx("span",{className:e.styles.separator,"aria-hidden":"true"}),v&&s.jsx(J,{}),p&&s.jsx(F,{}),k&&s.jsx(K,{})]}),w&&I==="advanced"&&m&&c.length===0&&u&&s.jsx("div",{className:e.styles.mobileMenu,children:u.map((l,n)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${M==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>ve(l),children:l.title})},l._key??n))}),w&&I==="advanced"&&m&&c.length>0&&s.jsxs("div",{className:e.styles.mobileMenuSlide,children:[s.jsx("button",{className:e.styles.back,"aria-label":"Go back",onClick:c.length===1?ke:ge,children:s.jsx(we.ChevronLeft,{size:18,"aria-hidden":"true"})}),c[c.length-1].description&&s.jsx("div",{className:`${e.styles.sublinksDescription} ${M==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:i==null?void 0:i(c[c.length-1].description)}),c[c.length-1].primary.map((l,n)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${M==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:l.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>Y(l),children:s.jsxs("span",{className:e.styles.linkContent,children:[l.label,l.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:l.subtitle})]})}):s.jsxs("a",{href:l.href,className:e.styles.link,target:l.isExternal?"_blank":"_self",rel:l.isExternal?"noopener noreferrer":void 0,role:"menuitem",children:[s.jsxs("span",{className:e.styles.linkContent,children:[l.label,l.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:l.subtitle})]}),l.isExternal&&s.jsx(P.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]})},l._key??`primary-${n}`)),c[c.length-1].secondary.length>0&&s.jsx("hr",{className:e.styles.groupDivider}),c[c.length-1].secondary.map((l,n)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${M==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:l.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>Y(l),children:l.label}):s.jsxs("a",{href:l.href,className:e.styles.link,target:l.isExternal?"_blank":"_self",rel:l.isExternal?"noopener noreferrer":void 0,role:"menuitem",children:[l.label,l.isExternal&&s.jsx(P.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]})},l._key??`secondary-${n}`))]},`stack-${c.length}`)]})}),y&&y.length>0&&s.jsx("nav",{className:e.styles.utility,"aria-label":"Utility navigation",children:s.jsx(le.ButtonGroup,{children:y.map((l,n)=>s.jsx(q.Button,{as:"a",href:l.href??"/",variant:l.variant??"primary",displayType:l.displayType??"text",imageSrc:l.imageSrc,imageAlt:l.imageAlt,"aria-label":l.ariaLabel,icon:l.icon,iconAlignment:l.iconAlignment,children:l.imageSrc?s.jsx("img",{src:l.imageSrc,alt:l.imageAlt??l.ariaLabel}):l.label},l._key??n))})}),o&&s.jsx("nav",{"aria-label":"Utility navigation",className:`${e.styles.utilityMobile} ${m?e.styles.open:""}`,children:s.jsx(le.ButtonGroup,{alignment:"center",children:s.jsx(q.Button,{as:"a",href:o.href??"/",variant:o.variant??"primary",displayType:o.displayType??"text",imageSrc:o.imageSrc,imageAlt:o.imageAlt,"aria-label":o.ariaLabel,icon:o.icon,iconAlignment:o.iconAlignment,children:o.imageSrc?s.jsx("img",{src:o.imageSrc,alt:o.imageAlt??o.ariaLabel}):o.label})})}),s.jsxs("div",{className:e.styles.mobileButtons,children:[w&&p&&s.jsx(F,{}),s.jsx("button",{className:e.styles.menuToggle,onClick:fe,"aria-label":m?"Close menu":"Open menu","aria-expanded":m,"aria-controls":"main-menu",children:m?s.jsx(Ce.X,{size:24,"aria-hidden":"true"}):s.jsx(q.Menu,{size:24,"aria-hidden":"true"})})]})]})})}exports.Navbar=qe;
11
+ */const Le=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Me=ne.createLucideIcon("search",Le),Ee={standard:e.styles.standard,transparent:e.styles.transparent},Be={left:e.styles.left,center:e.styles.center,right:e.styles.right},Re=({spotlight:i,renderText:h})=>{var y,_,p,v,k,S;const r=i.callToAction;if(!r)return null;const j=((y=r.linkOptions)==null?void 0:y.linkType)==="external";let u="#";return j&&((_=r.linkOptions)!=null&&_.externalUrl)?u=r.linkOptions.externalUrl:((p=r.linkOptions)==null?void 0:p.linkType)==="internal"&&((k=(v=r.linkOptions)==null?void 0:v.internalUrl)!=null&&k.slug.current)&&(u=`/${r.linkOptions.internalUrl.slug.current}`),s.jsxs("div",{className:e.styles.spotlight,children:[i.image&&s.jsx("div",{className:e.styles.imageWrapper,children:s.jsx("img",{src:((S=i.image.imageUrls)==null?void 0:S.medium)??"",alt:i.image.asset.altText||i.image.asset.description||"Content image",width:600,height:400})}),s.jsxs("div",{className:e.styles.content,children:[i.title&&s.jsx("div",{className:e.styles.title,children:h==null?void 0:h(i.title,e.styles.title)}),i.description&&s.jsx("div",{className:e.styles.description,children:h==null?void 0:h(i.description,e.styles.description)})]}),r.linkOptions&&s.jsx("div",{className:e.styles.actions,children:s.jsx(q.Button,{as:"a",variant:r.variant??"primary",href:u,target:j?"_blank":"_self",rel:j?"noopener noreferrer":void 0,"aria-label":r.ariaLabel||r.label,children:r.label})})]})};function qe({renderText:i,title:h,logo:r,items:j,groups:u,utilityItems:y,isSticky:_=!1,showSearch:p=!0,showLocaleSelect:v=!0,showThemeToggle:k=!0,themeToggleComponent:S,alignment:z="right",variant:ae="standard",navigationType:I="default",searchComponent:te,localeSelectComponent:ie,className:re,style:ce,...oe}){const[m,V]=a.useState(!1),[H,f]=a.useState(null),[de,ue]=a.useState(0),[ye,he]=a.useState(!1),[me,be]=a.useState(null),[c,$]=a.useState([]),[L,O]=a.useState(0),[xe,X]=a.useState(null),[w,pe]=a.useState(!1),[M,E]=a.useState("forward"),A=a.useRef(null),C=a.useRef(null),W=a.useRef(new Map),J=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,children:s.jsx("div",{className:`${e.styles.linkItem} ${e.styles.themeToggle}`,children:S})}),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(se.Modal,{className:e.styles.searchModal,trigger:s.jsx("button",{title:"Search","aria-label":"Search",className:e.styles.search,children:s.jsx(Me,{size:16,"aria-hidden":"true"})}),content:te})})}),K=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(se.Modal,{className:e.styles.localeModal,trigger:s.jsx("button",{title:"Locale Select","aria-label":"Locale Select",className:e.styles.locale,children:s.jsx(Ie,{size:16,"aria-hidden":"true"})}),content:ie})})}),B=a.useCallback(()=>{C.current&&ue(C.current.getBoundingClientRect().width)},[]),fe=()=>{V(l=>{const n=!l;return n||($([]),E("forward"),f(null)),n})},Q=a.useCallback(l=>{const n=W.current.get(l);if(n&&C.current){const d=n.getBoundingClientRect(),b=C.current.getBoundingClientRect();be(d.left-b.left+d.width/2)}},[]),je=a.useCallback(l=>{f(n=>n===l?null:l)},[]),G=a.useCallback(l=>{A.current&&!A.current.contains(l.target)&&f(null)},[]),D=a.useCallback(()=>{B(),typeof window<"u"&&window.innerWidth>768&&(V(!1),f(null))},[B]),ve=()=>$([]),ke=l=>{E("forward"),$([{title:l.title,primary:l.primaryItems??[],secondary:l.secondaryItems??[],description:""}])},Y=l=>{E("forward"),$(n=>[...n,{title:l.label,primary:l.sublinks??[],secondary:[],description:l.description}])},ge=()=>{E("backward"),$(l=>l.slice(0,-1))};a.useEffect(()=>{if(typeof window>"u")return;const l=()=>pe(window.innerWidth<768);return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]),a.useEffect(()=>{const l=typeof window<"u",n=typeof document<"u";return l&&window.addEventListener("resize",D),n&&document.addEventListener("click",G),B(),he(!0),()=>{l&&window.removeEventListener("resize",D),n&&document.removeEventListener("click",G)}},[D,G,B]),a.useEffect(()=>{if(!(typeof document>"u"))return m?setTimeout(()=>U.lockScroll(),0):U.unlockScroll(),()=>U.unlockScroll()},[m]);const R=(l,n="")=>l.map((d,b)=>{const g=`${n}/${d._key??d.label}-${b}`;return s.jsx(e.NavLink,{link:d,path:g,parentPath:n,openPath:H,togglePath:je,updateTriangleIndicator:Q,setOpenPath:f,renderLinks:R,buttonRefs:W},g)}),Ne=l=>l.map((n,d)=>{var Z,T;const b=`group-${d}`,g=xe===d,x=(Z=n.primaryItems)==null?void 0:Z[L??0];return s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{X(d),f(b),Q(b)},children:[s.jsx("div",{className:e.styles.linkItem,children:s.jsxs("button",{ref:t=>{W.current.set(b,t)},"aria-haspopup":!0,"aria-expanded":g,"aria-controls":`submenu-${d}`,className:`${e.styles.sublinkToggle} ${g?e.styles.open:""}`,children:[n.title,s.jsx(_e.ChevronDown,{size:18,className:e.styles.chevron,"aria-hidden":"true"})]})}),s.jsx("div",{id:`submenu-${d}`,className:`${e.styles.sublinks} ${g?e.styles.show:""}`,role:"menu","aria-label":`${n.title} submenu`,onMouseLeave:()=>{X(null),O(0),f(null)},children:s.jsx("div",{children:s.jsxs("div",{className:`${e.styles.sublinksInner} ${n.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}),(T=n.primaryItems)==null?void 0:T.map((t,N)=>t.href?s.jsx("div",{role:"menuitem",children:s.jsxs("a",{href:t.href,className:`${e.styles.link} ${L===N?e.styles.open:""}`,target:t.isExternal?"_blank":"_self",rel:t.isExternal?"noopener noreferrer":void 0,onClick:()=>{var ee;f(null),(ee=t.onClick)==null||ee.call(t)},onMouseEnter:()=>O(N),children:[s.jsxs("span",{className:e.styles.linkContent,children:[t.label,t.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:t.subtitle})]}),t.isExternal&&s.jsx(P.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]})},t._key??N):s.jsx("div",{role:"menuitem",children:s.jsx("button",{className:`${e.styles.sublinkToggle} ${L===N?e.styles.open:""}`,onMouseEnter:()=>O(N),children:s.jsxs("span",{className:e.styles.linkContent,children:[t.label,t.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:t.subtitle})]})})},t._key??N))]}),(x==null?void 0:x.sublinks)&&x.sublinks.length>0&&s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.fadeInFromLeft}`,children:[x.description&&s.jsx("div",{className:e.styles.sublinksDescription,children:i==null?void 0:i(x.description)}),R(x.sublinks,`${b}-${L}`)]},`${x.label}-${x.sublinks.length}`),n.secondaryItems&&n.secondaryItems.length>0&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.secondaryColumn}`,children:R(n.secondaryItems,`${b}-secondary`)}),n.spotlight&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.spotlightColumn}`,children:s.jsx(Re,{spotlight:n.spotlight,renderText:i})})]})})})]},n._key??`group-${d}`)}),$e=[e.styles.navbar,Be[z],Ee[ae],_?e.styles.sticky:"",u!=null&&u.length?e.styles.advanced:e.styles.default,re??""].filter(Boolean).join(" "),o=y&&y.length>0?y[Math.min(1,y.length-1)]:null;return s.jsx("header",{ref:A,className:$e,style:ce,"aria-label":"Site header",...oe,children:s.jsxs("div",{className:`${e.styles.container} ${(!y||y.length===0)&&z!=="center"?e.styles.twoColumn:""}`,children:[r?s.jsx("div",{className:e.styles.logo,children:r}):h?s.jsx("div",{className:e.styles.title,children:h}):null,s.jsx("nav",{ref:C,style:{left:z==="center"?`calc(50% - ${de/2}px)`:"0"},className:`${e.styles.nav} ${m?e.styles.open:""} ${ye?e.styles.visible:e.styles.hidden}`,id:"main-menu","aria-label":"Primary navigation",children:s.jsxs("div",{className:e.styles.navInner,children:[s.jsx("svg",{style:{left:`${me}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","aria-hidden":"true",children:s.jsx("polygon",{points:"50,5 95,70 5,70",strokeLinejoin:"round",fill:"white",stroke:"white"})}),I==="default"&&j&&s.jsxs("div",{className:e.styles.grid,role:"menubar",children:[j.length>0&&R(j),(p||v||k)&&s.jsx("span",{className:e.styles.separator,"aria-hidden":"true"}),k&&s.jsx(J,{}),p&&!w&&s.jsx(F,{}),v&&s.jsx(K,{})]}),!w&&I==="advanced"&&u&&s.jsxs("div",{className:e.styles.grid,children:[u.length>0&&Ne(u),(p||v||k)&&s.jsx("span",{className:e.styles.separator,"aria-hidden":"true"}),k&&s.jsx(J,{}),p&&s.jsx(F,{}),v&&s.jsx(K,{})]}),w&&I==="advanced"&&m&&c.length===0&&u&&s.jsx("div",{className:e.styles.mobileMenu,children:u.map((l,n)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${M==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>ke(l),children:l.title})},l._key??n))}),w&&I==="advanced"&&m&&c.length>0&&s.jsxs("div",{className:e.styles.mobileMenuSlide,children:[s.jsx("button",{className:e.styles.back,"aria-label":"Go back",onClick:c.length===1?ve:ge,children:s.jsx(we.ChevronLeft,{size:18,"aria-hidden":"true"})}),c[c.length-1].description&&s.jsx("div",{className:`${e.styles.sublinksDescription} ${M==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:i==null?void 0:i(c[c.length-1].description)}),c[c.length-1].primary.map((l,n)=>s.jsx("div",{role:"menuitem",className:`${e.styles.mobileMenuItem} ${M==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:l.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>Y(l),children:s.jsxs("span",{className:e.styles.linkContent,children:[l.label,l.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:l.subtitle})]})}):s.jsxs("a",{href:l.href,className:e.styles.link,target:l.isExternal?"_blank":"_self",rel:l.isExternal?"noopener noreferrer":void 0,children:[s.jsxs("span",{className:e.styles.linkContent,children:[l.label,l.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:l.subtitle})]}),l.isExternal&&s.jsx(P.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]})},l._key??`primary-${n}`)),c[c.length-1].secondary.length>0&&s.jsx("hr",{className:e.styles.groupDivider}),c[c.length-1].secondary.map((l,n)=>s.jsx("div",{role:"menuitem",className:`${e.styles.mobileMenuItem} ${M==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:l.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>Y(l),children:l.label}):s.jsxs("a",{href:l.href,className:e.styles.link,target:l.isExternal?"_blank":"_self",rel:l.isExternal?"noopener noreferrer":void 0,children:[l.label,l.isExternal&&s.jsx(P.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]})},l._key??`secondary-${n}`))]},`stack-${c.length}`)]})}),y&&y.length>0&&s.jsx("nav",{className:e.styles.utility,"aria-label":"Utility navigation",children:s.jsx(le.ButtonGroup,{children:y.map((l,n)=>s.jsx(q.Button,{as:"a",href:l.href??"/",variant:l.variant??"primary",displayType:l.displayType??"text",imageSrc:l.imageSrc,imageAlt:l.imageAlt,"aria-label":l.ariaLabel,icon:l.icon,iconAlignment:l.iconAlignment,children:l.imageSrc?s.jsx("img",{src:l.imageSrc,alt:l.imageAlt??l.ariaLabel}):l.label},l._key??n))})}),o&&s.jsx("nav",{"aria-label":"Utility navigation",className:`${e.styles.utilityMobile} ${m?e.styles.open:""}`,children:s.jsx(le.ButtonGroup,{alignment:"center",children:s.jsx(q.Button,{as:"a",href:o.href??"/",variant:o.variant??"primary",displayType:o.displayType??"text",imageSrc:o.imageSrc,imageAlt:o.imageAlt,"aria-label":o.ariaLabel,icon:o.icon,iconAlignment:o.iconAlignment,children:o.imageSrc?s.jsx("img",{src:o.imageSrc,alt:o.imageAlt??o.ariaLabel}):o.label})})}),s.jsxs("div",{className:e.styles.mobileButtons,children:[w&&p&&s.jsx(F,{}),s.jsx("button",{className:e.styles.menuToggle,onClick:fe,"aria-label":m?"Close menu":"Open menu","aria-expanded":m,"aria-controls":"main-menu",children:m?s.jsx(Ce.X,{size:24,"aria-hidden":"true"}):s.jsx(q.Menu,{size:24,"aria-hidden":"true"})})]})]})})}exports.Navbar=qe;
@@ -3,7 +3,7 @@ import { useState as u, useRef as V, useCallback as L, useEffect as H } from "re
3
3
  import { Modal as ie } from "../Modal/index.mjs";
4
4
  import { B as q, M as _e } from "../../../index-DqfgBFpU.js";
5
5
  import { ButtonGroup as se } from "../ButtonGroup/index.mjs";
6
- import { s as e, N as Se } from "../../../NavLink-EFx91-2v.js";
6
+ import { s as e, N as Se } from "../../../NavLink-Dxf80v5Z.js";
7
7
  import { lockScroll as ze, unlockScroll as re } from "../../utils/NoScroll/noScroll.mjs";
8
8
  import { C as Re } from "../../../chevron-right-Cim1KPuL.js";
9
9
  import { E as X } from "../../../external-link-BOPobeQJ.js";
@@ -48,12 +48,12 @@ const xe = [
48
48
  spotlight: r,
49
49
  renderText: p
50
50
  }) => {
51
- var m, _, k, $, y, S;
51
+ var h, _, k, $, y, S;
52
52
  const t = r.callToAction;
53
53
  if (!t) return null;
54
- const N = ((m = t.linkOptions) == null ? void 0 : m.linkType) === "external";
55
- let h = "#";
56
- return N && ((_ = t.linkOptions) != null && _.externalUrl) ? h = t.linkOptions.externalUrl : ((k = t.linkOptions) == null ? void 0 : k.linkType) === "internal" && ((y = ($ = t.linkOptions) == null ? void 0 : $.internalUrl) != null && y.slug.current) && (h = `/${t.linkOptions.internalUrl.slug.current}`), /* @__PURE__ */ i("div", { className: e.spotlight, children: [
54
+ const N = ((h = t.linkOptions) == null ? void 0 : h.linkType) === "external";
55
+ let m = "#";
56
+ return N && ((_ = t.linkOptions) != null && _.externalUrl) ? m = t.linkOptions.externalUrl : ((k = t.linkOptions) == null ? void 0 : k.linkType) === "internal" && ((y = ($ = t.linkOptions) == null ? void 0 : $.internalUrl) != null && y.slug.current) && (m = `/${t.linkOptions.internalUrl.slug.current}`), /* @__PURE__ */ i("div", { className: e.spotlight, children: [
57
57
  r.image && /* @__PURE__ */ n("div", { className: e.imageWrapper, children: /* @__PURE__ */ n(
58
58
  "img",
59
59
  {
@@ -72,7 +72,7 @@ const xe = [
72
72
  {
73
73
  as: "a",
74
74
  variant: t.variant ?? "primary",
75
- href: h,
75
+ href: m,
76
76
  target: N ? "_blank" : "_self",
77
77
  rel: N ? "noopener noreferrer" : void 0,
78
78
  "aria-label": t.ariaLabel || t.label,
@@ -86,8 +86,8 @@ function en({
86
86
  title: p,
87
87
  logo: t,
88
88
  items: N,
89
- groups: h,
90
- utilityItems: m,
89
+ groups: m,
90
+ utilityItems: h,
91
91
  isSticky: _ = !1,
92
92
  showSearch: k = !0,
93
93
  showLocaleSelect: $ = !0,
@@ -98,11 +98,11 @@ function en({
98
98
  navigationType: z = "default",
99
99
  searchComponent: oe,
100
100
  localeSelectComponent: de,
101
- className: he,
102
- style: me,
101
+ className: me,
102
+ style: he,
103
103
  ...ue
104
104
  }) {
105
- const [f, J] = u(!1), [K, g] = u(null), [pe, fe] = u(0), [be, ve] = u(!1), [ke, ge] = u(null), [c, I] = u([]), [R, F] = u(
105
+ const [b, J] = u(!1), [K, g] = u(null), [pe, be] = u(0), [fe, ve] = u(!1), [ke, ge] = u(null), [c, I] = u([]), [R, F] = u(
106
106
  0
107
107
  ), [Ne, Q] = u(null), [M, $e] = u(!1), [A, B] = u("forward"), U = V(null), E = V(null), j = V(/* @__PURE__ */ new Map()), Y = () => /* @__PURE__ */ n("div", { className: `${e.linkWrapper} ${e.parent}`, children: /* @__PURE__ */ n("div", { className: `${e.linkItem} ${e.themeToggle}`, children: S }) }), D = () => /* @__PURE__ */ n(
108
108
  "div",
@@ -141,7 +141,7 @@ function en({
141
141
  content: de
142
142
  }
143
143
  ) }) }), O = L(() => {
144
- E.current && fe(E.current.getBoundingClientRect().width);
144
+ E.current && be(E.current.getBoundingClientRect().width);
145
145
  }, []), ye = () => {
146
146
  J((a) => {
147
147
  const l = !a;
@@ -150,8 +150,8 @@ function en({
150
150
  }, T = L((a) => {
151
151
  const l = j.current.get(a);
152
152
  if (l && E.current) {
153
- const d = l.getBoundingClientRect(), b = E.current.getBoundingClientRect();
154
- ge(d.left - b.left + d.width / 2);
153
+ const d = l.getBoundingClientRect(), f = E.current.getBoundingClientRect();
154
+ ge(d.left - f.left + d.width / 2);
155
155
  }
156
156
  }, []), we = L((a) => {
157
157
  g((l) => l === a ? null : a);
@@ -192,10 +192,10 @@ function en({
192
192
  };
193
193
  }, [P, G, O]), H(() => {
194
194
  if (!(typeof document > "u"))
195
- return f ? setTimeout(() => ze(), 0) : re(), () => re();
196
- }, [f]);
197
- const W = (a, l = "") => a.map((d, b) => {
198
- const w = `${l}/${d._key ?? d.label}-${b}`;
195
+ return b ? setTimeout(() => ze(), 0) : re(), () => re();
196
+ }, [b]);
197
+ const W = (a, l = "") => a.map((d, f) => {
198
+ const w = `${l}/${d._key ?? d.label}-${f}`;
199
199
  return /* @__PURE__ */ n(
200
200
  Se,
201
201
  {
@@ -213,20 +213,20 @@ function en({
213
213
  );
214
214
  }), Ee = (a) => a.map((l, d) => {
215
215
  var ne, ae;
216
- const b = `group-${d}`, w = Ne === d, v = (ne = l.primaryItems) == null ? void 0 : ne[R ?? 0];
216
+ const f = `group-${d}`, w = Ne === d, v = (ne = l.primaryItems) == null ? void 0 : ne[R ?? 0];
217
217
  return /* @__PURE__ */ i(
218
218
  "div",
219
219
  {
220
220
  className: `${e.linkWrapper} ${e.parent}`,
221
221
  onMouseEnter: () => {
222
- Q(d), g(b), T(b);
222
+ Q(d), g(f), T(f);
223
223
  },
224
224
  children: [
225
225
  /* @__PURE__ */ n("div", { className: e.linkItem, children: /* @__PURE__ */ i(
226
226
  "button",
227
227
  {
228
228
  ref: (s) => {
229
- j.current.set(b, s);
229
+ j.current.set(f, s);
230
230
  },
231
231
  "aria-haspopup": !0,
232
232
  "aria-expanded": w,
@@ -267,7 +267,7 @@ function en({
267
267
  children: [
268
268
  /* @__PURE__ */ n("div", { className: e.linkItem }),
269
269
  (ae = l.primaryItems) == null ? void 0 : ae.map(
270
- (s, C) => s.href ? /* @__PURE__ */ i(
270
+ (s, C) => s.href ? /* @__PURE__ */ n("div", { role: "menuitem", children: /* @__PURE__ */ i(
271
271
  "a",
272
272
  {
273
273
  href: s.href,
@@ -279,7 +279,6 @@ function en({
279
279
  g(null), (le = s.onClick) == null || le.call(s);
280
280
  },
281
281
  onMouseEnter: () => F(C),
282
- role: "menuitem",
283
282
  children: [
284
283
  /* @__PURE__ */ i("span", { className: e.linkContent, children: [
285
284
  s.label,
@@ -294,9 +293,8 @@ function en({
294
293
  }
295
294
  )
296
295
  ]
297
- },
298
- s._key ?? C
299
- ) : /* @__PURE__ */ n(
296
+ }
297
+ ) }, s._key ?? C) : /* @__PURE__ */ n("div", { role: "menuitem", children: /* @__PURE__ */ n(
300
298
  "button",
301
299
  {
302
300
  className: `${e.sublinkToggle} ${R === C ? e.open : ""}`,
@@ -305,9 +303,8 @@ function en({
305
303
  s.label,
306
304
  s.subtitle && /* @__PURE__ */ n("span", { className: e.subtitle, children: s.subtitle })
307
305
  ] })
308
- },
309
- s._key ?? C
310
- )
306
+ }
307
+ ) }, s._key ?? C)
311
308
  )
312
309
  ]
313
310
  }
@@ -320,7 +317,7 @@ function en({
320
317
  v.description && /* @__PURE__ */ n("div", { className: e.sublinksDescription, children: r == null ? void 0 : r(v.description) }),
321
318
  W(
322
319
  v.sublinks,
323
- `${b}-${R}`
320
+ `${f}-${R}`
324
321
  )
325
322
  ]
326
323
  },
@@ -330,7 +327,7 @@ function en({
330
327
  "div",
331
328
  {
332
329
  className: `${e.sublinksColumn} ${e.secondaryColumn}`,
333
- children: W(l.secondaryItems, `${b}-secondary`)
330
+ children: W(l.secondaryItems, `${f}-secondary`)
334
331
  }
335
332
  ),
336
333
  l.spotlight && /* @__PURE__ */ n(
@@ -360,21 +357,21 @@ function en({
360
357
  je[x],
361
358
  Ue[ce],
362
359
  _ ? e.sticky : "",
363
- h != null && h.length ? e.advanced : e.default,
364
- he ?? ""
365
- ].filter(Boolean).join(" "), o = m && m.length > 0 ? m[Math.min(1, m.length - 1)] : null;
360
+ m != null && m.length ? e.advanced : e.default,
361
+ me ?? ""
362
+ ].filter(Boolean).join(" "), o = h && h.length > 0 ? h[Math.min(1, h.length - 1)] : null;
366
363
  return /* @__PURE__ */ n(
367
364
  "header",
368
365
  {
369
366
  ref: U,
370
367
  className: Le,
371
- style: me,
368
+ style: he,
372
369
  "aria-label": "Site header",
373
370
  ...ue,
374
371
  children: /* @__PURE__ */ i(
375
372
  "div",
376
373
  {
377
- className: `${e.container} ${(!m || m.length === 0) && x !== "center" ? e.twoColumn : ""}`,
374
+ className: `${e.container} ${(!h || h.length === 0) && x !== "center" ? e.twoColumn : ""}`,
378
375
  children: [
379
376
  t ? /* @__PURE__ */ n("div", { className: e.logo, children: t }) : p ? /* @__PURE__ */ n("div", { className: e.title, children: p }) : null,
380
377
  /* @__PURE__ */ n(
@@ -384,7 +381,7 @@ function en({
384
381
  style: {
385
382
  left: x === "center" ? `calc(50% - ${pe / 2}px)` : "0"
386
383
  },
387
- className: `${e.nav} ${f ? e.open : ""} ${be ? e.visible : e.hidden}`,
384
+ className: `${e.nav} ${b ? e.open : ""} ${fe ? e.visible : e.hidden}`,
388
385
  id: "main-menu",
389
386
  "aria-label": "Primary navigation",
390
387
  children: /* @__PURE__ */ i("div", { className: e.navInner, children: [
@@ -409,21 +406,21 @@ function en({
409
406
  )
410
407
  }
411
408
  ),
412
- z === "default" && N && /* @__PURE__ */ i("div", { className: e.grid, children: [
409
+ z === "default" && N && /* @__PURE__ */ i("div", { className: e.grid, role: "menubar", children: [
413
410
  N.length > 0 && W(N),
414
411
  (k || $ || y) && /* @__PURE__ */ n("span", { className: e.separator, "aria-hidden": "true" }),
415
412
  y && /* @__PURE__ */ n(Y, {}),
416
413
  k && !M && /* @__PURE__ */ n(D, {}),
417
414
  $ && /* @__PURE__ */ n(Z, {})
418
415
  ] }),
419
- !M && z === "advanced" && h && /* @__PURE__ */ i("div", { className: e.grid, children: [
420
- h.length > 0 && Ee(h),
416
+ !M && z === "advanced" && m && /* @__PURE__ */ i("div", { className: e.grid, children: [
417
+ m.length > 0 && Ee(m),
421
418
  (k || $ || y) && /* @__PURE__ */ n("span", { className: e.separator, "aria-hidden": "true" }),
422
419
  y && /* @__PURE__ */ n(Y, {}),
423
420
  k && /* @__PURE__ */ n(D, {}),
424
421
  $ && /* @__PURE__ */ n(Z, {})
425
422
  ] }),
426
- M && z === "advanced" && f && c.length === 0 && h && /* @__PURE__ */ n("div", { className: e.mobileMenu, children: h.map((a, l) => /* @__PURE__ */ n(
423
+ M && z === "advanced" && b && c.length === 0 && m && /* @__PURE__ */ n("div", { className: e.mobileMenu, children: m.map((a, l) => /* @__PURE__ */ n(
427
424
  "div",
428
425
  {
429
426
  className: `${e.mobileMenuItem} ${A === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
@@ -438,7 +435,7 @@ function en({
438
435
  },
439
436
  a._key ?? l
440
437
  )) }),
441
- M && z === "advanced" && f && c.length > 0 && /* @__PURE__ */ i(
438
+ M && z === "advanced" && b && c.length > 0 && /* @__PURE__ */ i(
442
439
  "div",
443
440
  {
444
441
  className: e.mobileMenuSlide,
@@ -464,6 +461,7 @@ function en({
464
461
  c[c.length - 1].primary.map((a, l) => /* @__PURE__ */ n(
465
462
  "div",
466
463
  {
464
+ role: "menuitem",
467
465
  className: `${e.mobileMenuItem} ${A === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
468
466
  children: a.sublinks ? /* @__PURE__ */ n(
469
467
  "button",
@@ -482,7 +480,6 @@ function en({
482
480
  className: e.link,
483
481
  target: a.isExternal ? "_blank" : "_self",
484
482
  rel: a.isExternal ? "noopener noreferrer" : void 0,
485
- role: "menuitem",
486
483
  children: [
487
484
  /* @__PURE__ */ i("span", { className: e.linkContent, children: [
488
485
  a.label,
@@ -507,6 +504,7 @@ function en({
507
504
  (a, l) => /* @__PURE__ */ n(
508
505
  "div",
509
506
  {
507
+ role: "menuitem",
510
508
  className: `${e.mobileMenuItem} ${A === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
511
509
  children: a.sublinks ? /* @__PURE__ */ n(
512
510
  "button",
@@ -522,7 +520,6 @@ function en({
522
520
  className: e.link,
523
521
  target: a.isExternal ? "_blank" : "_self",
524
522
  rel: a.isExternal ? "noopener noreferrer" : void 0,
525
- role: "menuitem",
526
523
  children: [
527
524
  a.label,
528
525
  a.isExternal && /* @__PURE__ */ n(
@@ -547,7 +544,7 @@ function en({
547
544
  ] })
548
545
  }
549
546
  ),
550
- m && m.length > 0 && /* @__PURE__ */ n("nav", { className: e.utility, "aria-label": "Utility navigation", children: /* @__PURE__ */ n(se, { children: m.map((a, l) => /* @__PURE__ */ n(
547
+ h && h.length > 0 && /* @__PURE__ */ n("nav", { className: e.utility, "aria-label": "Utility navigation", children: /* @__PURE__ */ n(se, { children: h.map((a, l) => /* @__PURE__ */ n(
551
548
  q,
552
549
  {
553
550
  as: "a",
@@ -573,7 +570,7 @@ function en({
573
570
  "nav",
574
571
  {
575
572
  "aria-label": "Utility navigation",
576
- className: `${e.utilityMobile} ${f ? e.open : ""}`,
573
+ className: `${e.utilityMobile} ${b ? e.open : ""}`,
577
574
  children: /* @__PURE__ */ n(se, { alignment: "center", children: /* @__PURE__ */ n(
578
575
  q,
579
576
  {
@@ -604,10 +601,10 @@ function en({
604
601
  {
605
602
  className: e.menuToggle,
606
603
  onClick: ye,
607
- "aria-label": f ? "Close menu" : "Open menu",
608
- "aria-expanded": f,
604
+ "aria-label": b ? "Close menu" : "Open menu",
605
+ "aria-expanded": b,
609
606
  "aria-controls": "main-menu",
610
- children: f ? /* @__PURE__ */ n(Ae, { size: 24, "aria-hidden": "true" }) : /* @__PURE__ */ n(_e, { size: 24, "aria-hidden": "true" })
607
+ children: b ? /* @__PURE__ */ n(Ae, { size: 24, "aria-hidden": "true" }) : /* @__PURE__ */ n(_e, { size: 24, "aria-hidden": "true" })
611
608
  }
612
609
  )
613
610
  ] })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.1.25",
4
+ "version": "0.1.27",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {