quirk-ui 0.1.91 → 0.1.92
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,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("react"),le=require("../Modal/index.cjs"),A=require("../../../index-hPJqlEOh.cjs"),te=require("../ButtonGroup/index.cjs"),e=require("../../../NavLink-D2yPDEC1.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("react"),le=require("../Modal/index.cjs"),A=require("../../../index-hPJqlEOh.cjs"),te=require("../ButtonGroup/index.cjs"),e=require("../../../NavLink-D2yPDEC1.cjs"),K=require("../../utils/NoScroll/noScroll.cjs"),Ce=require("../../../chevron-right-motlyADs.cjs"),V=require("../../../external-link-DDShu-48.cjs"),Se=require("../../../x-Dft9NVe_.cjs"),ae=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 Ie=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Me=ae.createLucideIcon("search",Ie),Re={standard:e.styles.standard,transparent:e.styles.transparent},Be={left:e.styles.left,center:e.styles.center,right:e.styles.right},qe=({spotlight:i,renderText:x})=>{var h,E,p,g,N,L;const c=i.callToAction;if(!c)return null;const k=((h=c.linkOptions)==null?void 0:h.linkType)==="external";let y="#";return k&&((E=c.linkOptions)!=null&&E.externalUrl)?y=c.linkOptions.externalUrl:((p=c.linkOptions)==null?void 0:p.linkType)==="internal"&&((N=(g=c.linkOptions)==null?void 0:g.internalUrl)!=null&&N.slug.current)&&(y=`/${c.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:((L=i.image.imageUrls)==null?void 0:L.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:x==null?void 0:x(i.title,e.styles.title)}),i.description&&s.jsx("div",{className:e.styles.description,children:x==null?void 0:x(i.description,e.styles.description)})]}),c.linkOptions&&s.jsx("div",{className:e.styles.actions,children:s.jsx(A.Button,{as:"a",variant:c.variant??"primary",href:y,target:k?"_blank":"_self",rel:k?"noopener noreferrer":void 0,"aria-label":c.ariaLabel||c.label,children:c.label})})]})};function ze({renderText:i,title:x,logo:c,items:k,groups:y,utilityItems:h,isSticky:E=!1,showSearch:p=!0,showLocaleSelect:g=!0,showThemeToggle:N=!0,themeToggleComponent:L,alignment:O="right",variant:ie="standard",navigationType:I="default",searchComponent:re,localeSelectComponent:ce,className:oe,style:de,...ue}){const[m,X]=t.useState(!1),[K,v]=t.useState(null),[ye,he]=t.useState(0),[me,be]=t.useState(!1),[fe,xe]=t.useState(null),[d,w]=t.useState([]),[M,W]=t.useState(0),[pe,J]=t.useState(null),[C,ve]=t.useState(!1),[R,B]=t.useState("forward"),D=t.useRef(null),j=t.useRef(null),Q=t.useRef(null),F=t.useRef(new Map),T=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,role:"presentation",children:s.jsx("div",{className:`${e.styles.linkItem} ${e.styles.themeToggle}`,role:"presentation",children:L})}),G=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} ${e.styles.searchWrapper}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(le.Modal,{size:"lg",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:re})})}),Y=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(le.Modal,{className:e.styles.localeModal,trigger:s.jsx("button",{title:"Locale Select","aria-label":"Locale Select",className:e.styles.locale,children:s.jsx(Le,{size:16,"aria-hidden":"true"})}),content:ce})})}),q=t.useCallback(()=>{j.current&&he(j.current.getBoundingClientRect().width)},[]),Z=()=>{X(n=>{const l=!n;return l||(w([]),B("forward"),v(null)),l})},ee=t.useCallback(n=>{const l=F.current.get(n);if(l&&j.current){const r=l.getBoundingClientRect(),o=j.current.getBoundingClientRect();xe(r.left-o.left+r.width/2)}},[]),je=t.useCallback(n=>{v(l=>l===n?null:n)},[]),U=t.useCallback(n=>{D.current&&!D.current.contains(n.target)&&v(null)},[]),P=t.useCallback(()=>{q(),typeof window<"u"&&window.innerWidth>768&&(X(!1),v(null))},[q]),ke=()=>w([]),ge=n=>{B("forward"),w([{title:n.title,primary:n.primaryItems??[],secondary:n.secondaryItems??[],description:""}])},se=n=>{B("forward"),w(l=>[...l,{title:n.label,primary:n.sublinks??[],secondary:[],description:n.description}])},Ne=()=>{B("backward"),w(n=>n.slice(0,-1))};t.useEffect(()=>{if(typeof window>"u")return;const n=()=>ve(window.innerWidth<768);return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t.useEffect(()=>{const n=typeof window<"u",l=typeof document<"u";return n&&window.addEventListener("resize",P),l&&document.addEventListener("click",U),q(),be(!0),()=>{n&&window.removeEventListener("resize",P),l&&document.removeEventListener("click",U)}},[P,U,q]),t.useEffect(()=>{if(!(typeof document>"u"))return m?setTimeout(()=>V.lockScroll(),0):V.unlockScroll(),()=>V.unlockScroll()},[m]),t.useEffect(()=>{var r;if(!m)return;const n=(r=j.current)==null?void 0:r.querySelector('a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex="-1"])');n==null||n.focus();const l=o=>{var _;if(o.key==="Escape"){Z(),(_=Q.current)==null||_.focus();return}if(o.key!=="Tab"||!j.current)return;const f=Array.from(j.current.querySelectorAll('a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(a=>!a.closest("[aria-hidden=true]"));if(f.length===0)return;const b=f[0],S=f[f.length-1];o.shiftKey?document.activeElement===b&&(o.preventDefault(),S.focus()):document.activeElement===S&&(o.preventDefault(),b.focus())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[m]);const z=(n,l="")=>n.map((r,o)=>{const f=`${l}/${r._key??r.label}-${o}`;return s.jsx(e.NavLink,{link:r,path:f,parentPath:l,openPath:K,togglePath:je,updateTriangleIndicator:ee,setOpenPath:v,renderLinks:z,buttonRefs:F},f)}),$e=n=>n.map((l,r)=>{var S,_;const o=`group-${r}`,f=pe===r,b=(S=l.primaryItems)==null?void 0:S[M??0];return s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{J(r),v(o),ee(o)},children:[s.jsx("div",{className:e.styles.linkItem,children:s.jsxs("button",{ref:a=>{F.current.set(o,a)},"aria-haspopup":!0,"aria-expanded":f,"aria-controls":`submenu-${r}`,className:`${e.styles.sublinkToggle} ${f?e.styles.open:""}`,children:[l.title,s.jsx(_e.ChevronDown,{size:18,className:e.styles.chevron,"aria-hidden":"true"})]})}),s.jsx("div",{id:`submenu-${r}`,className:`${e.styles.sublinks} ${f?e.styles.show:""}`,role:"menu","aria-label":`${l.title} submenu`,onMouseLeave:()=>{J(null),W(0),v(null)},children:s.jsx("div",{children:s.jsxs("div",{className:`${e.styles.sublinksInner} ${l.spotlight?e.styles.withSpotlight:e.styles.withoutSpotlight}`,children:[s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.primaryColumn}`,children:[s.jsx("div",{className:e.styles.linkItem}),(_=l.primaryItems)==null?void 0:_.map((a,$)=>a.href?s.jsx("div",{role:"menuitem",children:s.jsxs("a",{href:a.href,className:`${e.styles.link} ${M===$?e.styles.open:""}`,target:a.isExternal?"_blank":"_self",rel:a.isExternal?"noopener noreferrer":void 0,onClick:()=>{var ne;v(null),(ne=a.onClick)==null||ne.call(a)},onMouseEnter:()=>W($),children:[s.jsxs("span",{className:e.styles.linkContent,children:[a.label,a.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:a.subtitle})]}),a.isExternal&&s.jsx(H.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]})},a._key??$):s.jsx("div",{role:"menuitem",children:s.jsx("button",{className:`${e.styles.sublinkToggle} ${M===$?e.styles.open:""}`,onMouseEnter:()=>W($),children:s.jsxs("span",{className:e.styles.linkContent,children:[a.label,a.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:a.subtitle})]})})},a._key??$))]}),(b==null?void 0:b.sublinks)&&b.sublinks.length>0&&s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.fadeInFromLeft}`,children:[b.description&&s.jsx("div",{className:e.styles.sublinksDescription,children:i==null?void 0:i(b.description)}),z(b.sublinks,`${o}-${M}`)]},`${b.label}-${b.sublinks.length}`),l.secondaryItems&&l.secondaryItems.length>0&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.secondaryColumn}`,children:z(l.secondaryItems,`${o}-secondary`)}),l.spotlight&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.spotlightColumn}`,children:s.jsx(qe,{spotlight:l.spotlight,renderText:i})})]})})})]},l._key??`group-${r}`)}),we=[e.styles.navbar,Be[O],Re[ie],E?e.styles.sticky:"",y!=null&&y.length?e.styles.advanced:e.styles.default,oe??""].filter(Boolean).join(" "),u=h&&h.length>0?h[Math.min(1,h.length-1)]:null;return s.jsx("header",{ref:D,className:we,style:de,"aria-label":"Site header",...ue,children:s.jsxs("div",{className:`${e.styles.container} ${(!h||h.length===0)&&O!=="center"?e.styles.twoColumn:""}`,children:[c?s.jsx("div",{className:e.styles.logo,children:c}):x?s.jsx("div",{className:e.styles.title,children:x}):null,s.jsx("nav",{ref:j,style:{left:O==="center"?`calc(50% - ${ye/2}px)`:"0"},"aria-modal":m?"true":void 0,className:`${e.styles.nav} ${m?e.styles.open:""} ${me?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:`${fe}px`},className:`${e.styles.triangle} ${K?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"&&k&&s.jsxs("div",{className:e.styles.grid,children:[k.length>0&&s.jsx("div",{role:"menubar",className:e.styles.menubar,children:z(k)}),(p||g||N)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator,"aria-hidden":"true"}),s.jsxs("div",{role:"toolbar","aria-label":"Site controls",className:e.styles.toolbar,children:[N&&s.jsx(T,{}),p&&!C&&s.jsx(G,{}),g&&s.jsx(Y,{})]})]})]}),!C&&I==="advanced"&&y&&s.jsxs("div",{className:e.styles.grid,children:[y.length>0&&s.jsx("div",{role:"menubar",className:e.styles.menubar,children:$e(y)}),(p||g||N)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator,"aria-hidden":"true"}),s.jsxs("div",{role:"toolbar","aria-label":"Site controls",className:e.styles.toolbar,children:[N&&s.jsx(T,{}),p&&s.jsx(G,{}),g&&s.jsx(Y,{})]})]})]}),C&&I==="advanced"&&m&&d.length===0&&y&&s.jsx("div",{className:e.styles.mobileMenu,children:y.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${R==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>ge(n),children:n.title})},n._key??l))}),C&&I==="advanced"&&m&&d.length>0&&s.jsxs("div",{className:e.styles.mobileMenuSlide,children:[s.jsx("button",{className:e.styles.back,"aria-label":"Go back",onClick:d.length===1?ke:Ne,children:s.jsx(Ce.ChevronLeft,{size:18,"aria-hidden":"true"})}),d[d.length-1].description&&s.jsx("div",{className:`${e.styles.sublinksDescription} ${R==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:i==null?void 0:i(d[d.length-1].description)}),d[d.length-1].primary.map((n,l)=>s.jsx("div",{role:"menuitem",className:`${e.styles.mobileMenuItem} ${R==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:n.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>se(n),children:s.jsxs("span",{className:e.styles.linkContent,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:n.subtitle})]})}):s.jsxs("a",{href:n.href,className:e.styles.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,children:[s.jsxs("span",{className:e.styles.linkContent,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:n.subtitle})]}),n.isExternal&&s.jsx(H.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]})},n._key??`primary-${l}`)),d[d.length-1].secondary.length>0&&s.jsx("hr",{className:e.styles.groupDivider}),d[d.length-1].secondary.map((n,l)=>s.jsx("div",{role:"menuitem",className:`${e.styles.mobileMenuItem} ${R==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:n.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>se(n),children:n.label}):s.jsxs("a",{href:n.href,className:e.styles.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,children:[n.label,n.isExternal&&s.jsx(H.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]})},n._key??`secondary-${l}`))]},`stack-${d.length}`)]})}),h&&h.length>0&&s.jsx("nav",{className:e.styles.utility,"aria-label":"Utility navigation",children:s.jsx(te.ButtonGroup,{children:h.map((n,l)=>s.jsx(A.Button,{as:"a",href:n.href??"/",variant:n.variant??"primary",displayType:n.displayType??"text",imageSrc:n.imageSrc,imageAlt:n.imageAlt,"aria-label":n.ariaLabel,icon:n.icon,iconAlignment:n.iconAlignment,children:n.imageSrc?s.jsx("img",{src:n.imageSrc,alt:n.imageAlt??n.ariaLabel}):n.label},n._key??l))})}),u&&s.jsx("nav",{"aria-label":"Utility navigation",className:`${e.styles.utilityMobile} ${m?e.styles.open:""}`,children:s.jsx(te.ButtonGroup,{alignment:"center",children:s.jsx(A.Button,{as:"a",href:u.href??"/",variant:u.variant??"primary",displayType:u.displayType??"text",imageSrc:u.imageSrc,imageAlt:u.imageAlt,"aria-label":u.ariaLabel,icon:u.icon,iconAlignment:u.iconAlignment,children:u.imageSrc?s.jsx("img",{src:u.imageSrc,alt:u.imageAlt??u.ariaLabel}):u.label})})}),s.jsxs("div",{className:e.styles.mobileButtons,children:[C&&p&&s.jsx(G,{}),s.jsx("button",{ref:Q,className:e.styles.menuToggle,onClick:Z,"aria-label":m?"Close menu":"Open menu","aria-expanded":m,"aria-controls":"main-menu",children:m?s.jsx(Se.X,{size:24,"aria-hidden":"true"}):s.jsx(A.Menu,{size:24,"aria-hidden":"true"})})]})]})})}exports.Navbar=ze;
|
|
11
|
+
*/const Me=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Ie=ae.createLucideIcon("search",Me),Re={standard:e.styles.standard,transparent:e.styles.transparent},Be={left:e.styles.left,center:e.styles.center,right:e.styles.right},qe=({spotlight:r,renderText:x})=>{var h,E,p,g,N,L;const o=r.callToAction;if(!o)return null;const k=((h=o.linkOptions)==null?void 0:h.linkType)==="external";let y="#";return k&&((E=o.linkOptions)!=null&&E.externalUrl)?y=o.linkOptions.externalUrl:((p=o.linkOptions)==null?void 0:p.linkType)==="internal"&&((N=(g=o.linkOptions)==null?void 0:g.internalUrl)!=null&&N.slug.current)&&(y=`/${o.linkOptions.internalUrl.slug.current}`),s.jsxs("div",{className:e.styles.spotlight,children:[r.image&&s.jsx("div",{className:e.styles.imageWrapper,children:s.jsx("img",{src:((L=r.image.imageUrls)==null?void 0:L.medium)??"",alt:r.image.asset.altText||r.image.asset.description||"Content image",width:600,height:400})}),s.jsxs("div",{className:e.styles.content,children:[r.title&&s.jsx("div",{className:e.styles.title,children:x==null?void 0:x(r.title,e.styles.title)}),r.description&&s.jsx("div",{className:e.styles.description,children:x==null?void 0:x(r.description,e.styles.description)})]}),o.linkOptions&&s.jsx("div",{className:e.styles.actions,children:s.jsx(A.Button,{as:"a",variant:o.variant??"primary",href:y,target:k?"_blank":"_self",rel:k?"noopener noreferrer":void 0,"aria-label":o.ariaLabel||o.label,children:o.label})})]})};function ze({renderText:r,title:x,logo:o,items:k,groups:y,utilityItems:h,isSticky:E=!1,showSearch:p=!0,showLocaleSelect:g=!0,showThemeToggle:N=!0,themeToggleComponent:L,alignment:O="right",variant:ie="standard",navigationType:M="default",searchComponent:re,localeSelectComponent:ce,className:oe,style:de,...ue}){const[m,H]=t.useState(!1),[X,v]=t.useState(null),[ye,he]=t.useState(0),[me,be]=t.useState(!1),[fe,xe]=t.useState(null),[d,w]=t.useState([]),[I,W]=t.useState(0),[pe,J]=t.useState(null),[C,ve]=t.useState(!1),[R,B]=t.useState("forward"),D=t.useRef(null),j=t.useRef(null),Q=t.useRef(null),F=t.useRef(new Map),T=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,role:"presentation",children:s.jsx("div",{className:`${e.styles.linkItem} ${e.styles.themeToggle}`,role:"presentation",children:L})}),U=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} ${e.styles.searchWrapper}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(le.Modal,{size:"lg",className:e.styles.searchModal,trigger:s.jsx("button",{title:"Search","aria-label":"Search",className:e.styles.search,children:s.jsx(Ie,{size:16,"aria-hidden":"true"})}),content:re})})}),Y=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(le.Modal,{className:e.styles.localeModal,trigger:s.jsx("button",{title:"Locale Select","aria-label":"Locale Select",className:e.styles.locale,children:s.jsx(Le,{size:16,"aria-hidden":"true"})}),content:ce})})}),q=t.useCallback(()=>{j.current&&he(j.current.getBoundingClientRect().width)},[]),Z=()=>{H(n=>{const l=!n;return l||(w([]),B("forward"),v(null)),l})},ee=t.useCallback(n=>{const l=F.current.get(n);if(l&&j.current){const c=l.getBoundingClientRect(),i=j.current.getBoundingClientRect();xe(c.left-i.left+c.width/2)}},[]),je=t.useCallback(n=>{v(l=>l===n?null:n)},[]),G=t.useCallback(n=>{D.current&&!D.current.contains(n.target)&&v(null)},[]),P=t.useCallback(()=>{q(),typeof window<"u"&&window.innerWidth>768&&(H(!1),v(null))},[q]),ke=()=>w([]),ge=n=>{B("forward"),w([{title:n.title,primary:n.primaryItems??[],secondary:n.secondaryItems??[],description:""}])},se=n=>{B("forward"),w(l=>[...l,{title:n.label,primary:n.sublinks??[],secondary:[],description:n.description}])},Ne=()=>{B("backward"),w(n=>n.slice(0,-1))};t.useEffect(()=>{if(typeof window>"u")return;const n=()=>ve(window.innerWidth<768);return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t.useEffect(()=>{const n=typeof window<"u",l=typeof document<"u";return n&&window.addEventListener("resize",P),l&&document.addEventListener("click",G),q(),be(!0),()=>{n&&window.removeEventListener("resize",P),l&&document.removeEventListener("click",G)}},[P,G,q]),t.useEffect(()=>{if(!(typeof document>"u"))return m?setTimeout(()=>K.lockScroll(),0):K.unlockScroll(),()=>K.unlockScroll()},[m]),t.useEffect(()=>{var c;if(!m)return;if(typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(pointer: fine)").matches){const i=(c=j.current)==null?void 0:c.querySelector('a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex="-1"])');i==null||i.focus()}const l=i=>{var _;if(i.key==="Escape"){Z(),(_=Q.current)==null||_.focus();return}if(i.key!=="Tab"||!j.current)return;const f=Array.from(j.current.querySelectorAll('a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(a=>!a.closest("[aria-hidden=true]"));if(f.length===0)return;const b=f[0],S=f[f.length-1];i.shiftKey?document.activeElement===b&&(i.preventDefault(),S.focus()):document.activeElement===S&&(i.preventDefault(),b.focus())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[m]);const z=(n,l="")=>n.map((c,i)=>{const f=`${l}/${c._key??c.label}-${i}`;return s.jsx(e.NavLink,{link:c,path:f,parentPath:l,openPath:X,togglePath:je,updateTriangleIndicator:ee,setOpenPath:v,renderLinks:z,buttonRefs:F},f)}),$e=n=>n.map((l,c)=>{var S,_;const i=`group-${c}`,f=pe===c,b=(S=l.primaryItems)==null?void 0:S[I??0];return s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{J(c),v(i),ee(i)},children:[s.jsx("div",{className:e.styles.linkItem,children:s.jsxs("button",{ref:a=>{F.current.set(i,a)},"aria-haspopup":!0,"aria-expanded":f,"aria-controls":`submenu-${c}`,className:`${e.styles.sublinkToggle} ${f?e.styles.open:""}`,children:[l.title,s.jsx(_e.ChevronDown,{size:18,className:e.styles.chevron,"aria-hidden":"true"})]})}),s.jsx("div",{id:`submenu-${c}`,className:`${e.styles.sublinks} ${f?e.styles.show:""}`,role:"menu","aria-label":`${l.title} submenu`,onMouseLeave:()=>{J(null),W(0),v(null)},children:s.jsx("div",{children:s.jsxs("div",{className:`${e.styles.sublinksInner} ${l.spotlight?e.styles.withSpotlight:e.styles.withoutSpotlight}`,children:[s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.primaryColumn}`,children:[s.jsx("div",{className:e.styles.linkItem}),(_=l.primaryItems)==null?void 0:_.map((a,$)=>a.href?s.jsx("div",{role:"menuitem",children:s.jsxs("a",{href:a.href,className:`${e.styles.link} ${I===$?e.styles.open:""}`,target:a.isExternal?"_blank":"_self",rel:a.isExternal?"noopener noreferrer":void 0,onClick:()=>{var ne;v(null),(ne=a.onClick)==null||ne.call(a)},onMouseEnter:()=>W($),children:[s.jsxs("span",{className:e.styles.linkContent,children:[a.label,a.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:a.subtitle})]}),a.isExternal&&s.jsx(V.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]})},a._key??$):s.jsx("div",{role:"menuitem",children:s.jsx("button",{className:`${e.styles.sublinkToggle} ${I===$?e.styles.open:""}`,onMouseEnter:()=>W($),children:s.jsxs("span",{className:e.styles.linkContent,children:[a.label,a.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:a.subtitle})]})})},a._key??$))]}),(b==null?void 0:b.sublinks)&&b.sublinks.length>0&&s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.fadeInFromLeft}`,children:[b.description&&s.jsx("div",{className:e.styles.sublinksDescription,children:r==null?void 0:r(b.description)}),z(b.sublinks,`${i}-${I}`)]},`${b.label}-${b.sublinks.length}`),l.secondaryItems&&l.secondaryItems.length>0&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.secondaryColumn}`,children:z(l.secondaryItems,`${i}-secondary`)}),l.spotlight&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.spotlightColumn}`,children:s.jsx(qe,{spotlight:l.spotlight,renderText:r})})]})})})]},l._key??`group-${c}`)}),we=[e.styles.navbar,Be[O],Re[ie],E?e.styles.sticky:"",y!=null&&y.length?e.styles.advanced:e.styles.default,oe??""].filter(Boolean).join(" "),u=h&&h.length>0?h[Math.min(1,h.length-1)]:null;return s.jsx("header",{ref:D,className:we,style:de,"aria-label":"Site header",...ue,children:s.jsxs("div",{className:`${e.styles.container} ${(!h||h.length===0)&&O!=="center"?e.styles.twoColumn:""}`,children:[o?s.jsx("div",{className:e.styles.logo,children:o}):x?s.jsx("div",{className:e.styles.title,children:x}):null,s.jsx("nav",{ref:j,style:{left:O==="center"?`calc(50% - ${ye/2}px)`:"0"},"aria-modal":m?"true":void 0,className:`${e.styles.nav} ${m?e.styles.open:""} ${me?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:`${fe}px`},className:`${e.styles.triangle} ${X?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"})}),M==="default"&&k&&s.jsxs("div",{className:e.styles.grid,children:[k.length>0&&s.jsx("div",{role:"menubar",className:e.styles.menubar,children:z(k)}),(p||g||N)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator,"aria-hidden":"true"}),s.jsxs("div",{role:"toolbar","aria-label":"Site controls",className:e.styles.toolbar,children:[N&&s.jsx(T,{}),p&&!C&&s.jsx(U,{}),g&&s.jsx(Y,{})]})]})]}),!C&&M==="advanced"&&y&&s.jsxs("div",{className:e.styles.grid,children:[y.length>0&&s.jsx("div",{role:"menubar",className:e.styles.menubar,children:$e(y)}),(p||g||N)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator,"aria-hidden":"true"}),s.jsxs("div",{role:"toolbar","aria-label":"Site controls",className:e.styles.toolbar,children:[N&&s.jsx(T,{}),p&&s.jsx(U,{}),g&&s.jsx(Y,{})]})]})]}),C&&M==="advanced"&&m&&d.length===0&&y&&s.jsx("div",{className:e.styles.mobileMenu,children:y.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${R==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>ge(n),children:n.title})},n._key??l))}),C&&M==="advanced"&&m&&d.length>0&&s.jsxs("div",{className:e.styles.mobileMenuSlide,children:[s.jsx("button",{className:e.styles.back,"aria-label":"Go back",onClick:d.length===1?ke:Ne,children:s.jsx(Ce.ChevronLeft,{size:18,"aria-hidden":"true"})}),d[d.length-1].description&&s.jsx("div",{className:`${e.styles.sublinksDescription} ${R==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:r==null?void 0:r(d[d.length-1].description)}),d[d.length-1].primary.map((n,l)=>s.jsx("div",{role:"menuitem",className:`${e.styles.mobileMenuItem} ${R==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:n.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>se(n),children:s.jsxs("span",{className:e.styles.linkContent,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:n.subtitle})]})}):s.jsxs("a",{href:n.href,className:e.styles.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,children:[s.jsxs("span",{className:e.styles.linkContent,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:n.subtitle})]}),n.isExternal&&s.jsx(V.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]})},n._key??`primary-${l}`)),d[d.length-1].secondary.length>0&&s.jsx("hr",{className:e.styles.groupDivider}),d[d.length-1].secondary.map((n,l)=>s.jsx("div",{role:"menuitem",className:`${e.styles.mobileMenuItem} ${R==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:n.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>se(n),children:n.label}):s.jsxs("a",{href:n.href,className:e.styles.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,children:[n.label,n.isExternal&&s.jsx(V.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]})},n._key??`secondary-${l}`))]},`stack-${d.length}`)]})}),h&&h.length>0&&s.jsx("nav",{className:e.styles.utility,"aria-label":"Utility navigation",children:s.jsx(te.ButtonGroup,{children:h.map((n,l)=>s.jsx(A.Button,{as:"a",href:n.href??"/",variant:n.variant??"primary",displayType:n.displayType??"text",imageSrc:n.imageSrc,imageAlt:n.imageAlt,"aria-label":n.ariaLabel,icon:n.icon,iconAlignment:n.iconAlignment,children:n.imageSrc?s.jsx("img",{src:n.imageSrc,alt:n.imageAlt??n.ariaLabel}):n.label},n._key??l))})}),u&&s.jsx("nav",{"aria-label":"Utility navigation",className:`${e.styles.utilityMobile} ${m?e.styles.open:""}`,children:s.jsx(te.ButtonGroup,{alignment:"center",children:s.jsx(A.Button,{as:"a",href:u.href??"/",variant:u.variant??"primary",displayType:u.displayType??"text",imageSrc:u.imageSrc,imageAlt:u.imageAlt,"aria-label":u.ariaLabel,icon:u.icon,iconAlignment:u.iconAlignment,children:u.imageSrc?s.jsx("img",{src:u.imageSrc,alt:u.imageAlt??u.ariaLabel}):u.label})})}),s.jsxs("div",{className:e.styles.mobileButtons,children:[C&&p&&s.jsx(U,{}),s.jsx("button",{ref:Q,className:e.styles.menuToggle,onClick:Z,"aria-label":m?"Close menu":"Open menu","aria-expanded":m,"aria-controls":"main-menu",children:m?s.jsx(Se.X,{size:24,"aria-hidden":"true"}):s.jsx(A.Menu,{size:24,"aria-hidden":"true"})})]})]})})}exports.Navbar=ze;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as n, jsxs as i, Fragment as
|
|
2
|
-
import { useState as v, useRef as
|
|
1
|
+
import { jsx as n, jsxs as i, Fragment as re } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v, useRef as U, useCallback as _, useEffect as F } from "react";
|
|
3
3
|
import { Modal as se } from "../Modal/index.mjs";
|
|
4
4
|
import { B as J, M as ze } from "../../../index-paelIj6o.js";
|
|
5
5
|
import { ButtonGroup as ce } from "../ButtonGroup/index.mjs";
|
|
6
6
|
import { s as e, N as xe } from "../../../NavLink-orip5ARe.js";
|
|
7
7
|
import { lockScroll as Ae, unlockScroll as oe } from "../../utils/NoScroll/noScroll.mjs";
|
|
8
8
|
import { C as Re } from "../../../chevron-right-Cim1KPuL.js";
|
|
9
|
-
import { E as
|
|
9
|
+
import { E as X } from "../../../external-link-BOPobeQJ.js";
|
|
10
10
|
import { X as Be } from "../../../x-CnsEH4Ox.js";
|
|
11
11
|
import { c as de } from "../../../createLucideIcon-C8GTh_Qx.js";
|
|
12
12
|
import { C as Oe } from "../../../chevron-down-DSUzBz9F.js";
|
|
@@ -34,10 +34,10 @@ const We = [
|
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
36
|
*/
|
|
37
|
-
const
|
|
37
|
+
const Ue = [
|
|
38
38
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
39
39
|
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
|
|
40
|
-
],
|
|
40
|
+
], Fe = de("search", Ue), je = {
|
|
41
41
|
standard: e.standard,
|
|
42
42
|
transparent: e.transparent
|
|
43
43
|
}, Ge = {
|
|
@@ -45,46 +45,46 @@ const Fe = [
|
|
|
45
45
|
center: e.center,
|
|
46
46
|
right: e.right
|
|
47
47
|
}, Pe = ({
|
|
48
|
-
spotlight:
|
|
48
|
+
spotlight: s,
|
|
49
49
|
renderText: k
|
|
50
50
|
}) => {
|
|
51
51
|
var h, z, g, w, C, x;
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
54
|
-
const $ = ((h =
|
|
52
|
+
const o = s.callToAction;
|
|
53
|
+
if (!o) return null;
|
|
54
|
+
const $ = ((h = o.linkOptions) == null ? void 0 : h.linkType) === "external";
|
|
55
55
|
let m = "#";
|
|
56
|
-
return $ && ((z =
|
|
57
|
-
|
|
56
|
+
return $ && ((z = o.linkOptions) != null && z.externalUrl) ? m = o.linkOptions.externalUrl : ((g = o.linkOptions) == null ? void 0 : g.linkType) === "internal" && ((C = (w = o.linkOptions) == null ? void 0 : w.internalUrl) != null && C.slug.current) && (m = `/${o.linkOptions.internalUrl.slug.current}`), /* @__PURE__ */ i("div", { className: e.spotlight, children: [
|
|
57
|
+
s.image && /* @__PURE__ */ n("div", { className: e.imageWrapper, children: /* @__PURE__ */ n(
|
|
58
58
|
"img",
|
|
59
59
|
{
|
|
60
|
-
src: ((x =
|
|
61
|
-
alt:
|
|
60
|
+
src: ((x = s.image.imageUrls) == null ? void 0 : x.medium) ?? "",
|
|
61
|
+
alt: s.image.asset.altText || s.image.asset.description || "Content image",
|
|
62
62
|
width: 600,
|
|
63
63
|
height: 400
|
|
64
64
|
}
|
|
65
65
|
) }),
|
|
66
66
|
/* @__PURE__ */ i("div", { className: e.content, children: [
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
s.title && /* @__PURE__ */ n("div", { className: e.title, children: k == null ? void 0 : k(s.title, e.title) }),
|
|
68
|
+
s.description && /* @__PURE__ */ n("div", { className: e.description, children: k == null ? void 0 : k(s.description, e.description) })
|
|
69
69
|
] }),
|
|
70
|
-
|
|
70
|
+
o.linkOptions && /* @__PURE__ */ n("div", { className: e.actions, children: /* @__PURE__ */ n(
|
|
71
71
|
J,
|
|
72
72
|
{
|
|
73
73
|
as: "a",
|
|
74
|
-
variant:
|
|
74
|
+
variant: o.variant ?? "primary",
|
|
75
75
|
href: m,
|
|
76
76
|
target: $ ? "_blank" : "_self",
|
|
77
77
|
rel: $ ? "noopener noreferrer" : void 0,
|
|
78
|
-
"aria-label":
|
|
79
|
-
children:
|
|
78
|
+
"aria-label": o.ariaLabel || o.label,
|
|
79
|
+
children: o.label
|
|
80
80
|
}
|
|
81
81
|
) })
|
|
82
82
|
] });
|
|
83
83
|
};
|
|
84
84
|
function an({
|
|
85
|
-
renderText:
|
|
85
|
+
renderText: s,
|
|
86
86
|
title: k,
|
|
87
|
-
logo:
|
|
87
|
+
logo: o,
|
|
88
88
|
items: $,
|
|
89
89
|
groups: m,
|
|
90
90
|
utilityItems: h,
|
|
@@ -102,9 +102,9 @@ function an({
|
|
|
102
102
|
style: be,
|
|
103
103
|
...pe
|
|
104
104
|
}) {
|
|
105
|
-
const [f, Q] = v(!1), [Y, N] = v(null), [ve, ke] = v(0), [ge, Ne] = v(!1), [ye, $e] = v(null), [d,
|
|
105
|
+
const [f, Q] = v(!1), [Y, N] = v(null), [ve, ke] = v(0), [ge, Ne] = v(!1), [ye, $e] = v(null), [d, E] = v([]), [R, G] = v(
|
|
106
106
|
0
|
|
107
|
-
), [we, Z] = v(null), [
|
|
107
|
+
), [we, Z] = v(null), [I, Ce] = v(!1), [B, O] = v("forward"), P = U(null), y = U(null), T = U(null), q = U(/* @__PURE__ */ new Map()), ee = () => /* @__PURE__ */ n(
|
|
108
108
|
"div",
|
|
109
109
|
{
|
|
110
110
|
className: `${e.linkWrapper} ${e.parent}`,
|
|
@@ -118,7 +118,7 @@ function an({
|
|
|
118
118
|
}
|
|
119
119
|
)
|
|
120
120
|
}
|
|
121
|
-
),
|
|
121
|
+
), K = () => /* @__PURE__ */ n(
|
|
122
122
|
"div",
|
|
123
123
|
{
|
|
124
124
|
className: `${e.linkWrapper} ${e.parent} ${e.searchWrapper}`,
|
|
@@ -133,7 +133,7 @@ function an({
|
|
|
133
133
|
title: "Search",
|
|
134
134
|
"aria-label": "Search",
|
|
135
135
|
className: e.search,
|
|
136
|
-
children: /* @__PURE__ */ n(
|
|
136
|
+
children: /* @__PURE__ */ n(Fe, { size: 16, "aria-hidden": "true" })
|
|
137
137
|
}
|
|
138
138
|
),
|
|
139
139
|
content: me
|
|
@@ -160,22 +160,22 @@ function an({
|
|
|
160
160
|
}, []), ae = () => {
|
|
161
161
|
Q((a) => {
|
|
162
162
|
const l = !a;
|
|
163
|
-
return l || (
|
|
163
|
+
return l || (E([]), O("forward"), N(null)), l;
|
|
164
164
|
});
|
|
165
165
|
}, le = _((a) => {
|
|
166
166
|
const l = q.current.get(a);
|
|
167
167
|
if (l && y.current) {
|
|
168
|
-
const
|
|
169
|
-
$e(
|
|
168
|
+
const c = l.getBoundingClientRect(), r = y.current.getBoundingClientRect();
|
|
169
|
+
$e(c.left - r.left + c.width / 2);
|
|
170
170
|
}
|
|
171
|
-
}, []),
|
|
171
|
+
}, []), Me = _((a) => {
|
|
172
172
|
N((l) => l === a ? null : a);
|
|
173
|
-
}, []),
|
|
173
|
+
}, []), V = _((a) => {
|
|
174
174
|
P.current && !P.current.contains(a.target) && N(null);
|
|
175
|
-
}, []),
|
|
175
|
+
}, []), H = _(() => {
|
|
176
176
|
W(), typeof window < "u" && window.innerWidth > 768 && (Q(!1), N(null));
|
|
177
|
-
}, [W]),
|
|
178
|
-
O("forward"),
|
|
177
|
+
}, [W]), Ee = () => E([]), Ie = (a) => {
|
|
178
|
+
O("forward"), E([
|
|
179
179
|
{
|
|
180
180
|
title: a.title,
|
|
181
181
|
primary: a.primaryItems ?? [],
|
|
@@ -184,7 +184,7 @@ function an({
|
|
|
184
184
|
}
|
|
185
185
|
]);
|
|
186
186
|
}, ie = (a) => {
|
|
187
|
-
O("forward"),
|
|
187
|
+
O("forward"), E((l) => [
|
|
188
188
|
...l,
|
|
189
189
|
{
|
|
190
190
|
title: a.label,
|
|
@@ -194,55 +194,57 @@ function an({
|
|
|
194
194
|
}
|
|
195
195
|
]);
|
|
196
196
|
}, Le = () => {
|
|
197
|
-
O("backward"),
|
|
197
|
+
O("backward"), E((a) => a.slice(0, -1));
|
|
198
198
|
};
|
|
199
|
-
|
|
199
|
+
F(() => {
|
|
200
200
|
if (typeof window > "u") return;
|
|
201
201
|
const a = () => Ce(window.innerWidth < 768);
|
|
202
202
|
return a(), window.addEventListener("resize", a), () => window.removeEventListener("resize", a);
|
|
203
|
-
}, []),
|
|
203
|
+
}, []), F(() => {
|
|
204
204
|
const a = typeof window < "u", l = typeof document < "u";
|
|
205
|
-
return a && window.addEventListener("resize",
|
|
206
|
-
a && window.removeEventListener("resize",
|
|
205
|
+
return a && window.addEventListener("resize", H), l && document.addEventListener("click", V), W(), Ne(!0), () => {
|
|
206
|
+
a && window.removeEventListener("resize", H), l && document.removeEventListener("click", V);
|
|
207
207
|
};
|
|
208
|
-
}, [
|
|
208
|
+
}, [H, V, W]), F(() => {
|
|
209
209
|
if (!(typeof document > "u"))
|
|
210
210
|
return f ? setTimeout(() => Ae(), 0) : oe(), () => oe();
|
|
211
|
-
}, [f]),
|
|
212
|
-
var
|
|
211
|
+
}, [f]), F(() => {
|
|
212
|
+
var c;
|
|
213
213
|
if (!f) return;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
214
|
+
if (typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(pointer: fine)").matches) {
|
|
215
|
+
const r = (c = y.current) == null ? void 0 : c.querySelector(
|
|
216
|
+
'a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
217
|
+
);
|
|
218
|
+
r == null || r.focus();
|
|
219
|
+
}
|
|
220
|
+
const l = (r) => {
|
|
219
221
|
var S;
|
|
220
|
-
if (
|
|
222
|
+
if (r.key === "Escape") {
|
|
221
223
|
ae(), (S = T.current) == null || S.focus();
|
|
222
224
|
return;
|
|
223
225
|
}
|
|
224
|
-
if (
|
|
226
|
+
if (r.key !== "Tab" || !y.current) return;
|
|
225
227
|
const p = Array.from(
|
|
226
228
|
y.current.querySelectorAll(
|
|
227
229
|
'a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
228
230
|
)
|
|
229
|
-
).filter((
|
|
231
|
+
).filter((t) => !t.closest("[aria-hidden=true]"));
|
|
230
232
|
if (p.length === 0) return;
|
|
231
233
|
const b = p[0], L = p[p.length - 1];
|
|
232
|
-
|
|
234
|
+
r.shiftKey ? document.activeElement === b && (r.preventDefault(), L.focus()) : document.activeElement === L && (r.preventDefault(), b.focus());
|
|
233
235
|
};
|
|
234
236
|
return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
|
|
235
237
|
}, [f]);
|
|
236
|
-
const D = (a, l = "") => a.map((
|
|
237
|
-
const p = `${l}/${
|
|
238
|
+
const D = (a, l = "") => a.map((c, r) => {
|
|
239
|
+
const p = `${l}/${c._key ?? c.label}-${r}`;
|
|
238
240
|
return /* @__PURE__ */ n(
|
|
239
241
|
xe,
|
|
240
242
|
{
|
|
241
|
-
link:
|
|
243
|
+
link: c,
|
|
242
244
|
path: p,
|
|
243
245
|
parentPath: l,
|
|
244
246
|
openPath: Y,
|
|
245
|
-
togglePath:
|
|
247
|
+
togglePath: Me,
|
|
246
248
|
updateTriangleIndicator: le,
|
|
247
249
|
setOpenPath: N,
|
|
248
250
|
renderLinks: D,
|
|
@@ -250,26 +252,26 @@ function an({
|
|
|
250
252
|
},
|
|
251
253
|
p
|
|
252
254
|
);
|
|
253
|
-
}), Se = (a) => a.map((l,
|
|
255
|
+
}), Se = (a) => a.map((l, c) => {
|
|
254
256
|
var L, S;
|
|
255
|
-
const
|
|
257
|
+
const r = `group-${c}`, p = we === c, b = (L = l.primaryItems) == null ? void 0 : L[R ?? 0];
|
|
256
258
|
return /* @__PURE__ */ i(
|
|
257
259
|
"div",
|
|
258
260
|
{
|
|
259
261
|
className: `${e.linkWrapper} ${e.parent}`,
|
|
260
262
|
onMouseEnter: () => {
|
|
261
|
-
Z(
|
|
263
|
+
Z(c), N(r), le(r);
|
|
262
264
|
},
|
|
263
265
|
children: [
|
|
264
266
|
/* @__PURE__ */ n("div", { className: e.linkItem, children: /* @__PURE__ */ i(
|
|
265
267
|
"button",
|
|
266
268
|
{
|
|
267
|
-
ref: (
|
|
268
|
-
q.current.set(
|
|
269
|
+
ref: (t) => {
|
|
270
|
+
q.current.set(r, t);
|
|
269
271
|
},
|
|
270
272
|
"aria-haspopup": !0,
|
|
271
273
|
"aria-expanded": p,
|
|
272
|
-
"aria-controls": `submenu-${
|
|
274
|
+
"aria-controls": `submenu-${c}`,
|
|
273
275
|
className: `${e.sublinkToggle} ${p ? e.open : ""}`,
|
|
274
276
|
children: [
|
|
275
277
|
l.title,
|
|
@@ -287,7 +289,7 @@ function an({
|
|
|
287
289
|
/* @__PURE__ */ n(
|
|
288
290
|
"div",
|
|
289
291
|
{
|
|
290
|
-
id: `submenu-${
|
|
292
|
+
id: `submenu-${c}`,
|
|
291
293
|
className: `${e.sublinks} ${p ? e.show : ""}`,
|
|
292
294
|
role: "menu",
|
|
293
295
|
"aria-label": `${l.title} submenu`,
|
|
@@ -306,25 +308,25 @@ function an({
|
|
|
306
308
|
children: [
|
|
307
309
|
/* @__PURE__ */ n("div", { className: e.linkItem }),
|
|
308
310
|
(S = l.primaryItems) == null ? void 0 : S.map(
|
|
309
|
-
(
|
|
311
|
+
(t, M) => t.href ? /* @__PURE__ */ n("div", { role: "menuitem", children: /* @__PURE__ */ i(
|
|
310
312
|
"a",
|
|
311
313
|
{
|
|
312
|
-
href:
|
|
313
|
-
className: `${e.link} ${R ===
|
|
314
|
-
target:
|
|
315
|
-
rel:
|
|
314
|
+
href: t.href,
|
|
315
|
+
className: `${e.link} ${R === M ? e.open : ""}`,
|
|
316
|
+
target: t.isExternal ? "_blank" : "_self",
|
|
317
|
+
rel: t.isExternal ? "noopener noreferrer" : void 0,
|
|
316
318
|
onClick: () => {
|
|
317
|
-
var
|
|
318
|
-
N(null), (
|
|
319
|
+
var te;
|
|
320
|
+
N(null), (te = t.onClick) == null || te.call(t);
|
|
319
321
|
},
|
|
320
|
-
onMouseEnter: () => G(
|
|
322
|
+
onMouseEnter: () => G(M),
|
|
321
323
|
children: [
|
|
322
324
|
/* @__PURE__ */ i("span", { className: e.linkContent, children: [
|
|
323
|
-
|
|
324
|
-
|
|
325
|
+
t.label,
|
|
326
|
+
t.subtitle && /* @__PURE__ */ n("span", { className: e.subtitle, children: t.subtitle })
|
|
325
327
|
] }),
|
|
326
|
-
|
|
327
|
-
|
|
328
|
+
t.isExternal && /* @__PURE__ */ n(
|
|
329
|
+
X,
|
|
328
330
|
{
|
|
329
331
|
className: e.newTabIcon,
|
|
330
332
|
size: 16,
|
|
@@ -333,17 +335,17 @@ function an({
|
|
|
333
335
|
)
|
|
334
336
|
]
|
|
335
337
|
}
|
|
336
|
-
) },
|
|
338
|
+
) }, t._key ?? M) : /* @__PURE__ */ n("div", { role: "menuitem", children: /* @__PURE__ */ n(
|
|
337
339
|
"button",
|
|
338
340
|
{
|
|
339
|
-
className: `${e.sublinkToggle} ${R ===
|
|
340
|
-
onMouseEnter: () => G(
|
|
341
|
+
className: `${e.sublinkToggle} ${R === M ? e.open : ""}`,
|
|
342
|
+
onMouseEnter: () => G(M),
|
|
341
343
|
children: /* @__PURE__ */ i("span", { className: e.linkContent, children: [
|
|
342
|
-
|
|
343
|
-
|
|
344
|
+
t.label,
|
|
345
|
+
t.subtitle && /* @__PURE__ */ n("span", { className: e.subtitle, children: t.subtitle })
|
|
344
346
|
] })
|
|
345
347
|
}
|
|
346
|
-
) },
|
|
348
|
+
) }, t._key ?? M)
|
|
347
349
|
)
|
|
348
350
|
]
|
|
349
351
|
}
|
|
@@ -353,10 +355,10 @@ function an({
|
|
|
353
355
|
{
|
|
354
356
|
className: `${e.sublinksColumn} ${e.fadeInFromLeft}`,
|
|
355
357
|
children: [
|
|
356
|
-
b.description && /* @__PURE__ */ n("div", { className: e.sublinksDescription, children:
|
|
358
|
+
b.description && /* @__PURE__ */ n("div", { className: e.sublinksDescription, children: s == null ? void 0 : s(b.description) }),
|
|
357
359
|
D(
|
|
358
360
|
b.sublinks,
|
|
359
|
-
`${
|
|
361
|
+
`${r}-${R}`
|
|
360
362
|
)
|
|
361
363
|
]
|
|
362
364
|
},
|
|
@@ -366,7 +368,7 @@ function an({
|
|
|
366
368
|
"div",
|
|
367
369
|
{
|
|
368
370
|
className: `${e.sublinksColumn} ${e.secondaryColumn}`,
|
|
369
|
-
children: D(l.secondaryItems, `${
|
|
371
|
+
children: D(l.secondaryItems, `${r}-secondary`)
|
|
370
372
|
}
|
|
371
373
|
),
|
|
372
374
|
l.spotlight && /* @__PURE__ */ n(
|
|
@@ -377,7 +379,7 @@ function an({
|
|
|
377
379
|
Pe,
|
|
378
380
|
{
|
|
379
381
|
spotlight: l.spotlight,
|
|
380
|
-
renderText:
|
|
382
|
+
renderText: s
|
|
381
383
|
}
|
|
382
384
|
)
|
|
383
385
|
}
|
|
@@ -389,7 +391,7 @@ function an({
|
|
|
389
391
|
)
|
|
390
392
|
]
|
|
391
393
|
},
|
|
392
|
-
l._key ?? `group-${
|
|
394
|
+
l._key ?? `group-${c}`
|
|
393
395
|
);
|
|
394
396
|
}), _e = [
|
|
395
397
|
e.navbar,
|
|
@@ -412,7 +414,7 @@ function an({
|
|
|
412
414
|
{
|
|
413
415
|
className: `${e.container} ${(!h || h.length === 0) && j !== "center" ? e.twoColumn : ""}`,
|
|
414
416
|
children: [
|
|
415
|
-
|
|
417
|
+
o ? /* @__PURE__ */ n("div", { className: e.logo, children: o }) : k ? /* @__PURE__ */ n("div", { className: e.title, children: k }) : null,
|
|
416
418
|
/* @__PURE__ */ n(
|
|
417
419
|
"nav",
|
|
418
420
|
{
|
|
@@ -448,7 +450,7 @@ function an({
|
|
|
448
450
|
),
|
|
449
451
|
A === "default" && $ && /* @__PURE__ */ i("div", { className: e.grid, children: [
|
|
450
452
|
$.length > 0 && /* @__PURE__ */ n("div", { role: "menubar", className: e.menubar, children: D($) }),
|
|
451
|
-
(g || w || C) && /* @__PURE__ */ i(
|
|
453
|
+
(g || w || C) && /* @__PURE__ */ i(re, { children: [
|
|
452
454
|
/* @__PURE__ */ n("span", { className: e.separator, "aria-hidden": "true" }),
|
|
453
455
|
/* @__PURE__ */ i(
|
|
454
456
|
"div",
|
|
@@ -458,16 +460,16 @@ function an({
|
|
|
458
460
|
className: e.toolbar,
|
|
459
461
|
children: [
|
|
460
462
|
C && /* @__PURE__ */ n(ee, {}),
|
|
461
|
-
g && !
|
|
463
|
+
g && !I && /* @__PURE__ */ n(K, {}),
|
|
462
464
|
w && /* @__PURE__ */ n(ne, {})
|
|
463
465
|
]
|
|
464
466
|
}
|
|
465
467
|
)
|
|
466
468
|
] })
|
|
467
469
|
] }),
|
|
468
|
-
!
|
|
470
|
+
!I && A === "advanced" && m && /* @__PURE__ */ i("div", { className: e.grid, children: [
|
|
469
471
|
m.length > 0 && /* @__PURE__ */ n("div", { role: "menubar", className: e.menubar, children: Se(m) }),
|
|
470
|
-
(g || w || C) && /* @__PURE__ */ i(
|
|
472
|
+
(g || w || C) && /* @__PURE__ */ i(re, { children: [
|
|
471
473
|
/* @__PURE__ */ n("span", { className: e.separator, "aria-hidden": "true" }),
|
|
472
474
|
/* @__PURE__ */ i(
|
|
473
475
|
"div",
|
|
@@ -477,14 +479,14 @@ function an({
|
|
|
477
479
|
className: e.toolbar,
|
|
478
480
|
children: [
|
|
479
481
|
C && /* @__PURE__ */ n(ee, {}),
|
|
480
|
-
g && /* @__PURE__ */ n(
|
|
482
|
+
g && /* @__PURE__ */ n(K, {}),
|
|
481
483
|
w && /* @__PURE__ */ n(ne, {})
|
|
482
484
|
]
|
|
483
485
|
}
|
|
484
486
|
)
|
|
485
487
|
] })
|
|
486
488
|
] }),
|
|
487
|
-
|
|
489
|
+
I && A === "advanced" && f && d.length === 0 && m && /* @__PURE__ */ n("div", { className: e.mobileMenu, children: m.map((a, l) => /* @__PURE__ */ n(
|
|
488
490
|
"div",
|
|
489
491
|
{
|
|
490
492
|
className: `${e.mobileMenuItem} ${B === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
|
|
@@ -492,14 +494,14 @@ function an({
|
|
|
492
494
|
"button",
|
|
493
495
|
{
|
|
494
496
|
className: e.sublinkToggle,
|
|
495
|
-
onClick: () =>
|
|
497
|
+
onClick: () => Ie(a),
|
|
496
498
|
children: a.title
|
|
497
499
|
}
|
|
498
500
|
)
|
|
499
501
|
},
|
|
500
502
|
a._key ?? l
|
|
501
503
|
)) }),
|
|
502
|
-
|
|
504
|
+
I && A === "advanced" && f && d.length > 0 && /* @__PURE__ */ i(
|
|
503
505
|
"div",
|
|
504
506
|
{
|
|
505
507
|
className: e.mobileMenuSlide,
|
|
@@ -509,7 +511,7 @@ function an({
|
|
|
509
511
|
{
|
|
510
512
|
className: e.back,
|
|
511
513
|
"aria-label": "Go back",
|
|
512
|
-
onClick: d.length === 1 ?
|
|
514
|
+
onClick: d.length === 1 ? Ee : Le,
|
|
513
515
|
children: /* @__PURE__ */ n(Re, { size: 18, "aria-hidden": "true" })
|
|
514
516
|
}
|
|
515
517
|
),
|
|
@@ -517,7 +519,7 @@ function an({
|
|
|
517
519
|
"div",
|
|
518
520
|
{
|
|
519
521
|
className: `${e.sublinksDescription} ${B === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
|
|
520
|
-
children:
|
|
522
|
+
children: s == null ? void 0 : s(
|
|
521
523
|
d[d.length - 1].description
|
|
522
524
|
)
|
|
523
525
|
}
|
|
@@ -550,7 +552,7 @@ function an({
|
|
|
550
552
|
a.subtitle && /* @__PURE__ */ n("span", { className: e.subtitle, children: a.subtitle })
|
|
551
553
|
] }),
|
|
552
554
|
a.isExternal && /* @__PURE__ */ n(
|
|
553
|
-
|
|
555
|
+
X,
|
|
554
556
|
{
|
|
555
557
|
className: e.newTabIcon,
|
|
556
558
|
size: 16,
|
|
@@ -587,7 +589,7 @@ function an({
|
|
|
587
589
|
children: [
|
|
588
590
|
a.label,
|
|
589
591
|
a.isExternal && /* @__PURE__ */ n(
|
|
590
|
-
|
|
592
|
+
X,
|
|
591
593
|
{
|
|
592
594
|
className: e.newTabIcon,
|
|
593
595
|
size: 16,
|
|
@@ -659,7 +661,7 @@ function an({
|
|
|
659
661
|
}
|
|
660
662
|
),
|
|
661
663
|
/* @__PURE__ */ i("div", { className: e.mobileButtons, children: [
|
|
662
|
-
|
|
664
|
+
I && g && /* @__PURE__ */ n(K, {}),
|
|
663
665
|
/* @__PURE__ */ n(
|
|
664
666
|
"button",
|
|
665
667
|
{
|