quirk-ui 0.1.24 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{NavLink-DsTlC-XU.cjs → NavLink-Bld-qcLP.cjs} +1 -1
- package/dist/{NavLink-ltVBTeWC.js → NavLink-EFx91-2v.js} +1 -0
- package/dist/core/components/NavBar/NavLink.cjs +1 -1
- package/dist/core/components/NavBar/NavLink.mjs +1 -1
- package/dist/core/components/NavBar/index.cjs +2 -2
- package/dist/core/components/NavBar/index.mjs +41 -40
- package/package.json +1 -1
|
@@ -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)},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",{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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const e=require("../../../NavLink-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const e=require("../../../NavLink-Bld-qcLP.cjs");require("../../../external-link-DDShu-48.cjs");require("../../../chevron-down-DfK1XBl3.cjs");exports.NavLink=e.NavLink;
|
|
@@ -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-
|
|
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");/**
|
|
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",{role:"menuitem",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,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,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,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,role:"menubar",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;
|
|
@@ -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-
|
|
6
|
+
import { s as e, N as Se } from "../../../NavLink-EFx91-2v.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
|
|
51
|
+
var h, _, k, $, y, S;
|
|
52
52
|
const t = r.callToAction;
|
|
53
53
|
if (!t) return null;
|
|
54
|
-
const N = ((
|
|
55
|
-
let
|
|
56
|
-
return N && ((_ = t.linkOptions) != null && _.externalUrl) ?
|
|
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:
|
|
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:
|
|
90
|
-
utilityItems:
|
|
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:
|
|
102
|
-
style:
|
|
101
|
+
className: me,
|
|
102
|
+
style: he,
|
|
103
103
|
...ue
|
|
104
104
|
}) {
|
|
105
|
-
const [
|
|
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 &&
|
|
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(),
|
|
154
|
-
ge(d.left -
|
|
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
|
|
196
|
-
}, [
|
|
197
|
-
const W = (a, l = "") => a.map((d,
|
|
198
|
-
const w = `${l}/${d._key ?? d.label}-${
|
|
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
|
|
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(
|
|
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(
|
|
229
|
+
j.current.set(f, s);
|
|
230
230
|
},
|
|
231
231
|
"aria-haspopup": !0,
|
|
232
232
|
"aria-expanded": w,
|
|
@@ -299,7 +299,6 @@ function en({
|
|
|
299
299
|
) : /* @__PURE__ */ n(
|
|
300
300
|
"button",
|
|
301
301
|
{
|
|
302
|
-
role: "menuitem",
|
|
303
302
|
className: `${e.sublinkToggle} ${R === C ? e.open : ""}`,
|
|
304
303
|
onMouseEnter: () => F(C),
|
|
305
304
|
children: /* @__PURE__ */ i("span", { className: e.linkContent, children: [
|
|
@@ -321,7 +320,7 @@ function en({
|
|
|
321
320
|
v.description && /* @__PURE__ */ n("div", { className: e.sublinksDescription, children: r == null ? void 0 : r(v.description) }),
|
|
322
321
|
W(
|
|
323
322
|
v.sublinks,
|
|
324
|
-
`${
|
|
323
|
+
`${f}-${R}`
|
|
325
324
|
)
|
|
326
325
|
]
|
|
327
326
|
},
|
|
@@ -331,7 +330,7 @@ function en({
|
|
|
331
330
|
"div",
|
|
332
331
|
{
|
|
333
332
|
className: `${e.sublinksColumn} ${e.secondaryColumn}`,
|
|
334
|
-
children: W(l.secondaryItems, `${
|
|
333
|
+
children: W(l.secondaryItems, `${f}-secondary`)
|
|
335
334
|
}
|
|
336
335
|
),
|
|
337
336
|
l.spotlight && /* @__PURE__ */ n(
|
|
@@ -361,21 +360,21 @@ function en({
|
|
|
361
360
|
je[x],
|
|
362
361
|
Ue[ce],
|
|
363
362
|
_ ? e.sticky : "",
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
].filter(Boolean).join(" "), o =
|
|
363
|
+
m != null && m.length ? e.advanced : e.default,
|
|
364
|
+
me ?? ""
|
|
365
|
+
].filter(Boolean).join(" "), o = h && h.length > 0 ? h[Math.min(1, h.length - 1)] : null;
|
|
367
366
|
return /* @__PURE__ */ n(
|
|
368
367
|
"header",
|
|
369
368
|
{
|
|
370
369
|
ref: U,
|
|
371
370
|
className: Le,
|
|
372
|
-
style:
|
|
371
|
+
style: he,
|
|
373
372
|
"aria-label": "Site header",
|
|
374
373
|
...ue,
|
|
375
374
|
children: /* @__PURE__ */ i(
|
|
376
375
|
"div",
|
|
377
376
|
{
|
|
378
|
-
className: `${e.container} ${(!
|
|
377
|
+
className: `${e.container} ${(!h || h.length === 0) && x !== "center" ? e.twoColumn : ""}`,
|
|
379
378
|
children: [
|
|
380
379
|
t ? /* @__PURE__ */ n("div", { className: e.logo, children: t }) : p ? /* @__PURE__ */ n("div", { className: e.title, children: p }) : null,
|
|
381
380
|
/* @__PURE__ */ n(
|
|
@@ -385,7 +384,7 @@ function en({
|
|
|
385
384
|
style: {
|
|
386
385
|
left: x === "center" ? `calc(50% - ${pe / 2}px)` : "0"
|
|
387
386
|
},
|
|
388
|
-
className: `${e.nav} ${
|
|
387
|
+
className: `${e.nav} ${b ? e.open : ""} ${fe ? e.visible : e.hidden}`,
|
|
389
388
|
id: "main-menu",
|
|
390
389
|
"aria-label": "Primary navigation",
|
|
391
390
|
children: /* @__PURE__ */ i("div", { className: e.navInner, children: [
|
|
@@ -410,21 +409,21 @@ function en({
|
|
|
410
409
|
)
|
|
411
410
|
}
|
|
412
411
|
),
|
|
413
|
-
z === "default" && N && /* @__PURE__ */ i("div", { className: e.grid, children: [
|
|
412
|
+
z === "default" && N && /* @__PURE__ */ i("div", { className: e.grid, role: "menubar", children: [
|
|
414
413
|
N.length > 0 && W(N),
|
|
415
414
|
(k || $ || y) && /* @__PURE__ */ n("span", { className: e.separator, "aria-hidden": "true" }),
|
|
416
415
|
y && /* @__PURE__ */ n(Y, {}),
|
|
417
416
|
k && !M && /* @__PURE__ */ n(D, {}),
|
|
418
417
|
$ && /* @__PURE__ */ n(Z, {})
|
|
419
418
|
] }),
|
|
420
|
-
!M && z === "advanced" &&
|
|
421
|
-
|
|
419
|
+
!M && z === "advanced" && m && /* @__PURE__ */ i("div", { className: e.grid, children: [
|
|
420
|
+
m.length > 0 && Ee(m),
|
|
422
421
|
(k || $ || y) && /* @__PURE__ */ n("span", { className: e.separator, "aria-hidden": "true" }),
|
|
423
422
|
y && /* @__PURE__ */ n(Y, {}),
|
|
424
423
|
k && /* @__PURE__ */ n(D, {}),
|
|
425
424
|
$ && /* @__PURE__ */ n(Z, {})
|
|
426
425
|
] }),
|
|
427
|
-
M && z === "advanced" &&
|
|
426
|
+
M && z === "advanced" && b && c.length === 0 && m && /* @__PURE__ */ n("div", { className: e.mobileMenu, children: m.map((a, l) => /* @__PURE__ */ n(
|
|
428
427
|
"div",
|
|
429
428
|
{
|
|
430
429
|
className: `${e.mobileMenuItem} ${A === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
|
|
@@ -439,7 +438,7 @@ function en({
|
|
|
439
438
|
},
|
|
440
439
|
a._key ?? l
|
|
441
440
|
)) }),
|
|
442
|
-
M && z === "advanced" &&
|
|
441
|
+
M && z === "advanced" && b && c.length > 0 && /* @__PURE__ */ i(
|
|
443
442
|
"div",
|
|
444
443
|
{
|
|
445
444
|
className: e.mobileMenuSlide,
|
|
@@ -483,6 +482,7 @@ function en({
|
|
|
483
482
|
className: e.link,
|
|
484
483
|
target: a.isExternal ? "_blank" : "_self",
|
|
485
484
|
rel: a.isExternal ? "noopener noreferrer" : void 0,
|
|
485
|
+
role: "menuitem",
|
|
486
486
|
children: [
|
|
487
487
|
/* @__PURE__ */ i("span", { className: e.linkContent, children: [
|
|
488
488
|
a.label,
|
|
@@ -522,6 +522,7 @@ function en({
|
|
|
522
522
|
className: e.link,
|
|
523
523
|
target: a.isExternal ? "_blank" : "_self",
|
|
524
524
|
rel: a.isExternal ? "noopener noreferrer" : void 0,
|
|
525
|
+
role: "menuitem",
|
|
525
526
|
children: [
|
|
526
527
|
a.label,
|
|
527
528
|
a.isExternal && /* @__PURE__ */ n(
|
|
@@ -546,7 +547,7 @@ function en({
|
|
|
546
547
|
] })
|
|
547
548
|
}
|
|
548
549
|
),
|
|
549
|
-
|
|
550
|
+
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(
|
|
550
551
|
q,
|
|
551
552
|
{
|
|
552
553
|
as: "a",
|
|
@@ -572,7 +573,7 @@ function en({
|
|
|
572
573
|
"nav",
|
|
573
574
|
{
|
|
574
575
|
"aria-label": "Utility navigation",
|
|
575
|
-
className: `${e.utilityMobile} ${
|
|
576
|
+
className: `${e.utilityMobile} ${b ? e.open : ""}`,
|
|
576
577
|
children: /* @__PURE__ */ n(se, { alignment: "center", children: /* @__PURE__ */ n(
|
|
577
578
|
q,
|
|
578
579
|
{
|
|
@@ -603,10 +604,10 @@ function en({
|
|
|
603
604
|
{
|
|
604
605
|
className: e.menuToggle,
|
|
605
606
|
onClick: ye,
|
|
606
|
-
"aria-label":
|
|
607
|
-
"aria-expanded":
|
|
607
|
+
"aria-label": b ? "Close menu" : "Open menu",
|
|
608
|
+
"aria-expanded": b,
|
|
608
609
|
"aria-controls": "main-menu",
|
|
609
|
-
children:
|
|
610
|
+
children: b ? /* @__PURE__ */ n(Ae, { size: 24, "aria-hidden": "true" }) : /* @__PURE__ */ n(_e, { size: 24, "aria-hidden": "true" })
|
|
610
611
|
}
|
|
611
612
|
)
|
|
612
613
|
] })
|