quirk-ui 0.0.468 → 0.0.470
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.
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Se=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],_e=G.createLucideIcon("search",Se),Le={standard:e.styles.standard,transparent:e.styles.transparent},Me={left:e.styles.left,center:e.styles.center,right:e.styles.right},Ee=({spotlight:a,renderText:b})=>{var t,C,k,p,j,S,m,_,L,M,y;const w=(t=a.image)==null?void 0:t.asset.altText,x=((C=a.callToAction.linkOptions)==null?void 0:C.linkType)==="external";let u="#";return((k=a.callToAction.linkOptions)==null?void 0:k.linkType)==="external"&&((p=a.callToAction.linkOptions)!=null&&p.externalUrl)?u=(j=a.callToAction.linkOptions)==null?void 0:j.externalUrl:((S=a.callToAction.linkOptions)==null?void 0:S.linkType)==="internal"&&((_=(m=a.callToAction.linkOptions)==null?void 0:m.internalUrl)!=null&&_.slug.current)&&(u=`/${(M=(L=a.callToAction.linkOptions)==null?void 0:L.internalUrl)==null?void 0:M.slug.current}`),s.jsxs("div",{className:e.styles.spotlight,children:[a.image&&s.jsx("div",{className:e.styles.imageWrapper,children:s.jsx("img",{src:(a==null?void 0:a.image.imageUrl)??"",alt:w||a.image.asset.description||"Content image",width:600,height:400})}),s.jsxs("div",{className:e.styles.content,children:[a.title&&s.jsx("div",{className:e.styles.title,children:b==null?void 0:b(a.title,e.styles.title)}),a.description&&s.jsx("div",{className:e.styles.description,children:b==null?void 0:b(a.description,e.styles.description)})]}),((y=a.callToAction)==null?void 0:y.linkOptions)&&s.jsx("div",{className:e.styles.actions,children:s.jsx(O.CallToAction,{as:"a",variant:a.callToAction.variant??"primary",href:u,target:x?"_blank":"_self",rel:x?"noopener noreferrer":"","aria-label":a.callToAction.ariaLabel||a.callToAction.label,children:a.callToAction.label})})]})};function Ae({renderText:a,title:b,logo:w,items:x,groups:u,utilityItems:t,isSticky:C=!1,showSearch:k=!0,showLocaleSelect:p=!0,alignment:j="right",variant:S="standard",navigationType:m="default",searchComponent:_,localeSelectComponent:L,className:M}){const[y,U]=r.useState(!1),[X,f]=r.useState(null),[ce,re]=r.useState(0),[oe,de]=r.useState(!1),[ye,ue]=r.useState(null),[o,N]=r.useState([]),[E,q]=r.useState(0),[he,H]=r.useState(null),[$,be]=r.useState(!1),[A,T]=r.useState("forward"),B=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} ${e.styles.searchWrapper}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(te.Modal,{className:e.styles.searchModal,trigger:s.jsx("button",{title:"Search","aria-label":"Search",className:e.styles.search,children:s.jsx(_e,{size:16})}),content:_})})}),V=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} `,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(te.Modal,{className:e.styles.localeModal,trigger:s.jsx("button",{title:"Locale Select","aria-label":"Locale Select",role:"menuitem",className:e.styles.locale,children:s.jsx(ge,{size:16})}),content:L})})});r.useEffect(()=>{if(typeof window<"u"){const l=()=>{const n=window.innerWidth<768;be(n)};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}},[]);const fe=()=>{N([])},xe=l=>{T("forward"),N([{title:l.title,primary:l.primaryItems??[],secondary:l.secondaryItems??[],description:""}])},J=l=>{T("forward"),N(n=>[...n,{title:l.label,primary:l.sublinks??[],secondary:[],description:l.description}])},me=()=>{T("backward"),N(l=>l.slice(0,-1))},F=r.useRef(null),g=r.useRef(null),W=r.useRef(new Map),ke=()=>{U(l=>{const n=!l;return n||(N([]),T("forward"),f(null)),n})},K=l=>{const n=W.current.get(l);if(n&&g.current){const d=n.getBoundingClientRect(),h=g.current.getBoundingClientRect(),c=d.left-h.left+d.width/2;ue(c)}},je=l=>{f(n=>n===l?null:l)},Q=r.useCallback(l=>{F.current&&!F.current.contains(l.target)&&f(null)},[]),Y=r.useCallback(()=>{Z(),typeof window<"u"&&window.innerWidth>768&&(U(!1),f(null),typeof document<"u"&&(document.body.style.overflow=""))},[]),Z=r.useCallback(()=>{if(g.current){const l=g.current.getBoundingClientRect().width;re(l),de(!0)}},[]);r.useEffect(()=>{const l=typeof window<"u",n=typeof document<"u";return l&&window.addEventListener("resize",Y),n&&document.addEventListener("click",Q),Z(),()=>{l&&window.removeEventListener("resize",Y),n&&document.removeEventListener("click",Q)}},[]),r.useEffect(()=>{if(typeof document<"u")return y?I.lockScroll():I.unlockScroll(),()=>I.unlockScroll()},[y]);const ve=l=>l.map((n,d)=>{var P,ee,se,le,ne;const h=`group-${d}`,z=he===d,c=(P=n.primaryItems)==null?void 0:P[E??0];return s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{H(d),f(h),K(h)},onMouseLeave:()=>{H(null),q(0),f(null)},children:[s.jsx("div",{className:e.styles.linkItem,children:s.jsxs("button",{ref:i=>{W.current.set(h,i)},role:"menuitem","aria-haspopup":"true","aria-expanded":z,"aria-controls":`submenu-${d}`,className:`${e.styles.sublinkToggle} ${z?e.styles.open:""} `,children:[n.title,s.jsx(Ne.ChevronDown,{size:18,className:e.styles.chevron})]})}),s.jsx("div",{id:`submenu-${d}`,className:`${e.styles.sublinks} ${z?e.styles.show:""}`,role:"menu","aria-label":`${n.title} submenu`,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}),(ee=n.primaryItems)==null?void 0:ee.map((i,v)=>i.href?s.jsxs("a",{href:i.href,className:`${e.styles.link} ${E===v?e.styles.open:""}`,target:i.isExternal?"_blank":"_self",rel:i.isExternal?"noopener noreferrer":void 0,onClick:()=>{var ae;f(null),(ae=i.onClick)==null||ae.call(i)},onMouseEnter:()=>i.sublinks?q(v):null,role:"menuitem",children:[s.jsxs("span",{className:e.styles.linkContent,children:[i.label,i.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:i.subtitle})]}),i.isExternal&&s.jsx(D.ExternalLink,{className:e.styles.newTabIcon,size:16})]},i._key??v):s.jsx("button",{className:`${e.styles.sublinkToggle} ${E===v?e.styles.open:""}`,onMouseEnter:()=>q(v),children:s.jsxs("span",{className:e.styles.linkContent,children:[i.label,i.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:i.subtitle})]})},i._key??v))]}),(c==null?void 0:c.sublinks)&&((se=c==null?void 0:c.sublinks)==null?void 0:se.length)>0&&s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.fadeInFromLeft}`,children:[(c==null?void 0:c.description)&&s.jsxs("div",{className:e.styles.sublinksDescription,children:[s.jsx("p",{children:"TEXT HERE"}),a==null?void 0:a(c.description)]}),(c==null?void 0:c.sublinks)&&R(c.sublinks,`${h}-${E}`)]},`${c.label}-${(le=c==null?void 0:c.sublinks)==null?void 0:le.length}`),(n==null?void 0:n.secondaryItems)&&((ne=n==null?void 0:n.secondaryItems)==null?void 0:ne.length)>0&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.secondaryColumn}`,children:n.secondaryItems&&n.secondaryItems.length>0&&R(n.secondaryItems,`${h}-secondary`)}),n.spotlight&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.spotlightColumn}`,children:s.jsx(Ee,{spotlight:n.spotlight,renderText:a??(i=>String(i))})})]})})})]},n._key??`group-${d}`)}),R=(l,n="")=>l.map(d=>{const h=`${n}/${d.label}`;return s.jsx(e.NavLink,{link:d,path:h,parentPath:n,openPath:X,togglePath:je,updateTriangleIndicator:K,setOpenPath:f,renderLinks:R,buttonRefs:W},d._key??h)});return s.jsx("header",{ref:F,className:`${M??""} ${Me[j]} ${Le[S]} ${e.styles.navbar} ${C?e.styles.sticky:""} ${u&&u.length?e.styles.advanced:e.styles.default}`,"aria-label":"Main navigation",children:s.jsxs("div",{className:`${e.styles.container} ${(!t||t.length===0)&&j!=="center"?e.styles.twoColumn:""}`,children:[w?s.jsx("div",{className:e.styles.logo,children:w}):s.jsx("div",{className:e.styles.title,children:b}),s.jsx("nav",{ref:g,style:{left:j==="center"?`calc(50% - ${ce/2}px)`:"0"},className:`${e.styles.nav} ${y?e.styles.open:""} ${oe?e.styles.visible:e.styles.hidden}`,id:"main-menu",role:"menubar","aria-label":"Main navigation",children:s.jsxs("div",{className:e.styles.navInner,children:[s.jsx("svg",{style:{left:`${ye}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",children:s.jsx("polygon",{points:"50,5 95,70 5,70",strokeLinejoin:"round",fill:"white",stroke:"white"})}),m==="default"&&x&&s.jsxs("div",{className:e.styles.grid,children:[x&&x.length>0&&R(x),k&&!$&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(B,{})]}),p&&s.jsx(V,{})]}),!$&&m==="advanced"&&u&&s.jsxs("div",{className:e.styles.grid,children:[u.length>0&&ve(u),k&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(B,{})]}),p&&s.jsx(V,{})]}),$&&m==="advanced"&&y&&o.length===0&&u&&s.jsx("div",{className:`${e.styles.mobileMenu}`,children:u.map((l,n)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>xe(l),children:l.title})},l._key??n))}),$&&m==="advanced"&&y&&o.length>0&&s.jsxs("div",{className:`${e.styles.mobileMenuSlide} `,children:[s.jsx("button",{className:e.styles.back,onClick:o.length===1?fe:me,children:s.jsx(O.ChevronLeft,{size:18,"aria-hidden":"true",focusable:"false"})}),o[o.length-1].description&&s.jsx("div",{className:`${e.styles.sublinksDescription} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:a==null?void 0:a(o[o.length-1].description)}),o[o.length-1].primary.map((l,n)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:l.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>J(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(D.ExternalLink,{className:e.styles.newTabIcon,size:16})]})},l._key??`primary-${n}`)),o[o.length-1].secondary.length>0&&s.jsx("hr",{className:e.styles.groupDivider}),o[o.length-1].secondary.map((l,n)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:l.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>J(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(D.ExternalLink,{className:e.styles.newTabIcon,size:16})]})},l._key??`secondary-${n}`))]},`stack-${o.length}`)]})}),t&&t.length>0&&s.jsx("nav",{className:e.styles.utility,"aria-label":"Utility navigation",children:s.jsx(ie.ButtonGroup,{children:t.map((l,n)=>s.jsx(O.CallToAction,{as:"a",href:l.href??"/",variant:l.variant??"primary",displayType:l.displayType??"text",imageSrc:l.imageSrc,imageAlt:l.imageAlt,"aria-label":l.ariaLabel??l.label,icon:l.icon,iconAlignment:l.iconAlignment,children:l.imageSrc?s.jsx("img",{src:l.imageSrc,alt:l.imageAlt??l.ariaLabel??l.label}):l.label},l._key||n))})}),t&&t.length>0&&s.jsx("nav",{"aria-label":"Utility navigation",className:`${e.styles.utilityMobile} ${y?e.styles.open:""}`,children:s.jsx(ie.ButtonGroup,{alignment:"center",children:s.jsx(O.CallToAction,{as:"a",href:t[1].href??"/",variant:t[1].variant??"primary",displayType:t[1].displayType??"text",imageSrc:t[1].imageSrc,imageAlt:t[1].imageAlt,"aria-label":t[1].ariaLabel??t[1].label,icon:t[1].icon,iconAlignment:t[1].iconAlignment,children:t[1].imageSrc?s.jsx("img",{src:t[1].imageSrc,"aria-label":t[1].imageAlt??t[1].ariaLabel??t[1].label}):t[1].label})})}),s.jsxs("div",{className:e.styles.mobileButtons,children:[$&&k&&s.jsx(B,{}),s.jsx("button",{className:e.styles.menuToggle,onClick:ke,"aria-label":y?"Close menu":"Open menu","aria-expanded":y,"aria-controls":"main-menu",children:y?s.jsx(pe.X,{size:24}):s.jsx(Ce,{size:24})})]})]})})}exports.Navbar=Ae;
|
|
16
|
+
*/const Se=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],_e=G.createLucideIcon("search",Se),Le={standard:e.styles.standard,transparent:e.styles.transparent},Me={left:e.styles.left,center:e.styles.center,right:e.styles.right},Ee=({spotlight:a,renderText:b})=>{var t,C,k,p,j,S,m,_,L,M,y;const w=(t=a.image)==null?void 0:t.asset.altText,x=((C=a.callToAction.linkOptions)==null?void 0:C.linkType)==="external";let u="#";return((k=a.callToAction.linkOptions)==null?void 0:k.linkType)==="external"&&((p=a.callToAction.linkOptions)!=null&&p.externalUrl)?u=(j=a.callToAction.linkOptions)==null?void 0:j.externalUrl:((S=a.callToAction.linkOptions)==null?void 0:S.linkType)==="internal"&&((_=(m=a.callToAction.linkOptions)==null?void 0:m.internalUrl)!=null&&_.slug.current)&&(u=`/${(M=(L=a.callToAction.linkOptions)==null?void 0:L.internalUrl)==null?void 0:M.slug.current}`),s.jsxs("div",{className:e.styles.spotlight,children:[a.image&&s.jsx("div",{className:e.styles.imageWrapper,children:s.jsx("img",{src:(a==null?void 0:a.image.imageUrl)??"",alt:w||a.image.asset.description||"Content image",width:600,height:400})}),s.jsxs("div",{className:e.styles.content,children:[a.title&&s.jsx("div",{className:e.styles.title,children:b==null?void 0:b(a.title,e.styles.title)}),a.description&&s.jsx("div",{className:e.styles.description,children:b==null?void 0:b(a.description,e.styles.description)})]}),((y=a.callToAction)==null?void 0:y.linkOptions)&&s.jsx("div",{className:e.styles.actions,children:s.jsx(O.CallToAction,{as:"a",variant:a.callToAction.variant??"primary",href:u,target:x?"_blank":"_self",rel:x?"noopener noreferrer":"","aria-label":a.callToAction.ariaLabel||a.callToAction.label,children:a.callToAction.label})})]})};function Ae({renderText:a,title:b,logo:w,items:x,groups:u,utilityItems:t,isSticky:C=!1,showSearch:k=!0,showLocaleSelect:p=!0,alignment:j="right",variant:S="standard",navigationType:m="default",searchComponent:_,localeSelectComponent:L,className:M}){const[y,U]=r.useState(!1),[X,f]=r.useState(null),[ce,re]=r.useState(0),[oe,de]=r.useState(!1),[ye,ue]=r.useState(null),[o,N]=r.useState([]),[E,q]=r.useState(0),[he,H]=r.useState(null),[$,be]=r.useState(!1),[A,T]=r.useState("forward"),B=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} ${e.styles.searchWrapper}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(te.Modal,{className:e.styles.searchModal,trigger:s.jsx("button",{title:"Search","aria-label":"Search",className:e.styles.search,children:s.jsx(_e,{size:16})}),content:_})})}),V=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} `,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(te.Modal,{className:e.styles.localeModal,trigger:s.jsx("button",{title:"Locale Select","aria-label":"Locale Select",role:"menuitem",className:e.styles.locale,children:s.jsx(ge,{size:16})}),content:L})})});r.useEffect(()=>{if(typeof window<"u"){const l=()=>{const n=window.innerWidth<768;be(n)};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}},[]);const fe=()=>{N([])},xe=l=>{T("forward"),N([{title:l.title,primary:l.primaryItems??[],secondary:l.secondaryItems??[],description:""}])},J=l=>{T("forward"),N(n=>[...n,{title:l.label,primary:l.sublinks??[],secondary:[],description:l.description}])},me=()=>{T("backward"),N(l=>l.slice(0,-1))},F=r.useRef(null),g=r.useRef(null),W=r.useRef(new Map),ke=()=>{U(l=>{const n=!l;return n||(N([]),T("forward"),f(null)),n})},K=l=>{const n=W.current.get(l);if(n&&g.current){const d=n.getBoundingClientRect(),h=g.current.getBoundingClientRect(),c=d.left-h.left+d.width/2;ue(c)}},je=l=>{f(n=>n===l?null:l)},Q=r.useCallback(l=>{F.current&&!F.current.contains(l.target)&&f(null)},[]),Y=r.useCallback(()=>{Z(),typeof window<"u"&&window.innerWidth>768&&(U(!1),f(null),typeof document<"u"&&(document.body.style.overflow=""))},[]),Z=r.useCallback(()=>{if(g.current){const l=g.current.getBoundingClientRect().width;re(l),de(!0)}},[]);r.useEffect(()=>{const l=typeof window<"u",n=typeof document<"u";return l&&window.addEventListener("resize",Y),n&&document.addEventListener("click",Q),Z(),()=>{l&&window.removeEventListener("resize",Y),n&&document.removeEventListener("click",Q)}},[]),r.useEffect(()=>{if(typeof document<"u")return y?setTimeout(()=>{I.lockScroll()},0):I.unlockScroll(),()=>I.unlockScroll()},[y]);const ve=l=>l.map((n,d)=>{var P,ee,se,le,ne;const h=`group-${d}`,z=he===d,c=(P=n.primaryItems)==null?void 0:P[E??0];return s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{H(d),f(h),K(h)},onMouseLeave:()=>{H(null),q(0),f(null)},children:[s.jsx("div",{className:e.styles.linkItem,children:s.jsxs("button",{ref:i=>{W.current.set(h,i)},role:"menuitem","aria-haspopup":"true","aria-expanded":z,"aria-controls":`submenu-${d}`,className:`${e.styles.sublinkToggle} ${z?e.styles.open:""} `,children:[n.title,s.jsx(Ne.ChevronDown,{size:18,className:e.styles.chevron})]})}),s.jsx("div",{id:`submenu-${d}`,className:`${e.styles.sublinks} ${z?e.styles.show:""}`,role:"menu","aria-label":`${n.title} submenu`,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}),(ee=n.primaryItems)==null?void 0:ee.map((i,v)=>i.href?s.jsxs("a",{href:i.href,className:`${e.styles.link} ${E===v?e.styles.open:""}`,target:i.isExternal?"_blank":"_self",rel:i.isExternal?"noopener noreferrer":void 0,onClick:()=>{var ae;f(null),(ae=i.onClick)==null||ae.call(i)},onMouseEnter:()=>i.sublinks?q(v):null,role:"menuitem",children:[s.jsxs("span",{className:e.styles.linkContent,children:[i.label,i.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:i.subtitle})]}),i.isExternal&&s.jsx(D.ExternalLink,{className:e.styles.newTabIcon,size:16})]},i._key??v):s.jsx("button",{className:`${e.styles.sublinkToggle} ${E===v?e.styles.open:""}`,onMouseEnter:()=>q(v),children:s.jsxs("span",{className:e.styles.linkContent,children:[i.label,i.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:i.subtitle})]})},i._key??v))]}),(c==null?void 0:c.sublinks)&&((se=c==null?void 0:c.sublinks)==null?void 0:se.length)>0&&s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.fadeInFromLeft}`,children:[(c==null?void 0:c.description)&&s.jsxs("div",{className:e.styles.sublinksDescription,children:[s.jsx("p",{children:"TEXT HERE"}),a==null?void 0:a(c.description)]}),(c==null?void 0:c.sublinks)&&R(c.sublinks,`${h}-${E}`)]},`${c.label}-${(le=c==null?void 0:c.sublinks)==null?void 0:le.length}`),(n==null?void 0:n.secondaryItems)&&((ne=n==null?void 0:n.secondaryItems)==null?void 0:ne.length)>0&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.secondaryColumn}`,children:n.secondaryItems&&n.secondaryItems.length>0&&R(n.secondaryItems,`${h}-secondary`)}),n.spotlight&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.spotlightColumn}`,children:s.jsx(Ee,{spotlight:n.spotlight,renderText:a??(i=>String(i))})})]})})})]},n._key??`group-${d}`)}),R=(l,n="")=>l.map(d=>{const h=`${n}/${d.label}`;return s.jsx(e.NavLink,{link:d,path:h,parentPath:n,openPath:X,togglePath:je,updateTriangleIndicator:K,setOpenPath:f,renderLinks:R,buttonRefs:W},d._key??h)});return s.jsx("header",{ref:F,className:`${M??""} ${Me[j]} ${Le[S]} ${e.styles.navbar} ${C?e.styles.sticky:""} ${u&&u.length?e.styles.advanced:e.styles.default}`,"aria-label":"Main navigation",children:s.jsxs("div",{className:`${e.styles.container} ${(!t||t.length===0)&&j!=="center"?e.styles.twoColumn:""}`,children:[w?s.jsx("div",{className:e.styles.logo,children:w}):s.jsx("div",{className:e.styles.title,children:b}),s.jsx("nav",{ref:g,style:{left:j==="center"?`calc(50% - ${ce/2}px)`:"0"},className:`${e.styles.nav} ${y?e.styles.open:""} ${oe?e.styles.visible:e.styles.hidden}`,id:"main-menu",role:"menubar","aria-label":"Main navigation",children:s.jsxs("div",{className:e.styles.navInner,children:[s.jsx("svg",{style:{left:`${ye}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",children:s.jsx("polygon",{points:"50,5 95,70 5,70",strokeLinejoin:"round",fill:"white",stroke:"white"})}),m==="default"&&x&&s.jsxs("div",{className:e.styles.grid,children:[x&&x.length>0&&R(x),k&&!$&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(B,{})]}),p&&s.jsx(V,{})]}),!$&&m==="advanced"&&u&&s.jsxs("div",{className:e.styles.grid,children:[u.length>0&&ve(u),k&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(B,{})]}),p&&s.jsx(V,{})]}),$&&m==="advanced"&&y&&o.length===0&&u&&s.jsx("div",{className:`${e.styles.mobileMenu}`,children:u.map((l,n)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>xe(l),children:l.title})},l._key??n))}),$&&m==="advanced"&&y&&o.length>0&&s.jsxs("div",{className:`${e.styles.mobileMenuSlide} `,children:[s.jsx("button",{className:e.styles.back,onClick:o.length===1?fe:me,children:s.jsx(O.ChevronLeft,{size:18,"aria-hidden":"true",focusable:"false"})}),o[o.length-1].description&&s.jsx("div",{className:`${e.styles.sublinksDescription} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:a==null?void 0:a(o[o.length-1].description)}),o[o.length-1].primary.map((l,n)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:l.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>J(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(D.ExternalLink,{className:e.styles.newTabIcon,size:16})]})},l._key??`primary-${n}`)),o[o.length-1].secondary.length>0&&s.jsx("hr",{className:e.styles.groupDivider}),o[o.length-1].secondary.map((l,n)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:l.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>J(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(D.ExternalLink,{className:e.styles.newTabIcon,size:16})]})},l._key??`secondary-${n}`))]},`stack-${o.length}`)]})}),t&&t.length>0&&s.jsx("nav",{className:e.styles.utility,"aria-label":"Utility navigation",children:s.jsx(ie.ButtonGroup,{children:t.map((l,n)=>s.jsx(O.CallToAction,{as:"a",href:l.href??"/",variant:l.variant??"primary",displayType:l.displayType??"text",imageSrc:l.imageSrc,imageAlt:l.imageAlt,"aria-label":l.ariaLabel??l.label,icon:l.icon,iconAlignment:l.iconAlignment,children:l.imageSrc?s.jsx("img",{src:l.imageSrc,alt:l.imageAlt??l.ariaLabel??l.label}):l.label},l._key||n))})}),t&&t.length>0&&s.jsx("nav",{"aria-label":"Utility navigation",className:`${e.styles.utilityMobile} ${y?e.styles.open:""}`,children:s.jsx(ie.ButtonGroup,{alignment:"center",children:s.jsx(O.CallToAction,{as:"a",href:t[1].href??"/",variant:t[1].variant??"primary",displayType:t[1].displayType??"text",imageSrc:t[1].imageSrc,imageAlt:t[1].imageAlt,"aria-label":t[1].ariaLabel??t[1].label,icon:t[1].icon,iconAlignment:t[1].iconAlignment,children:t[1].imageSrc?s.jsx("img",{src:t[1].imageSrc,"aria-label":t[1].imageAlt??t[1].ariaLabel??t[1].label}):t[1].label})})}),s.jsxs("div",{className:e.styles.mobileButtons,children:[$&&k&&s.jsx(B,{}),s.jsx("button",{className:e.styles.menuToggle,onClick:ke,"aria-label":y?"Close menu":"Open menu","aria-expanded":y,"aria-controls":"main-menu",children:y?s.jsx(pe.X,{size:24}):s.jsx(Ce,{size:24})})]})]})})}exports.Navbar=Ae;
|
|
@@ -26,18 +26,18 @@ const ze = [
|
|
|
26
26
|
],
|
|
27
27
|
["path", { d: "M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05", key: "14pb5j" }],
|
|
28
28
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
|
|
29
|
-
],
|
|
29
|
+
], Te = V("earth", ze);
|
|
30
30
|
/**
|
|
31
31
|
* @license lucide-react v0.488.0 - ISC
|
|
32
32
|
*
|
|
33
33
|
* This source code is licensed under the ISC license.
|
|
34
34
|
* See the LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
|
-
const
|
|
36
|
+
const xe = [
|
|
37
37
|
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
|
|
38
38
|
["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
|
|
39
39
|
["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
|
|
40
|
-
],
|
|
40
|
+
], Re = V("menu", xe);
|
|
41
41
|
/**
|
|
42
42
|
* @license lucide-react v0.488.0 - ISC
|
|
43
43
|
*
|
|
@@ -106,9 +106,9 @@ function Ye({
|
|
|
106
106
|
localeSelectComponent: _,
|
|
107
107
|
className: z
|
|
108
108
|
}) {
|
|
109
|
-
const [h, q] = b(!1), [J, k] = b(null), [me, fe] = b(0), [be, ue] = b(!1), [ke, ve] = b(null), [t, y] = b([]), [
|
|
109
|
+
const [h, q] = b(!1), [J, k] = b(null), [me, fe] = b(0), [be, ue] = b(!1), [ke, ve] = b(null), [t, y] = b([]), [T, F] = b(
|
|
110
110
|
0
|
|
111
|
-
), [pe, K] = b(null), [C, Ne] = b(!1), [
|
|
111
|
+
), [pe, K] = b(null), [C, Ne] = b(!1), [x, R] = b("forward"), B = () => /* @__PURE__ */ a(
|
|
112
112
|
"div",
|
|
113
113
|
{
|
|
114
114
|
className: `${e.linkWrapper} ${e.parent} ${e.searchWrapper}`,
|
|
@@ -140,7 +140,7 @@ function Ye({
|
|
|
140
140
|
"aria-label": "Locale Select",
|
|
141
141
|
role: "menuitem",
|
|
142
142
|
className: e.locale,
|
|
143
|
-
children: /* @__PURE__ */ a(
|
|
143
|
+
children: /* @__PURE__ */ a(Te, { size: 16 })
|
|
144
144
|
}
|
|
145
145
|
),
|
|
146
146
|
content: _
|
|
@@ -158,7 +158,7 @@ function Ye({
|
|
|
158
158
|
const $e = () => {
|
|
159
159
|
y([]);
|
|
160
160
|
}, ge = (n) => {
|
|
161
|
-
|
|
161
|
+
R("forward"), y([
|
|
162
162
|
{
|
|
163
163
|
title: n.title,
|
|
164
164
|
primary: n.primaryItems ?? [],
|
|
@@ -167,7 +167,7 @@ function Ye({
|
|
|
167
167
|
}
|
|
168
168
|
]);
|
|
169
169
|
}, Y = (n) => {
|
|
170
|
-
|
|
170
|
+
R("forward"), y((l) => [
|
|
171
171
|
...l,
|
|
172
172
|
{
|
|
173
173
|
title: n.label,
|
|
@@ -177,11 +177,11 @@ function Ye({
|
|
|
177
177
|
}
|
|
178
178
|
]);
|
|
179
179
|
}, we = () => {
|
|
180
|
-
|
|
180
|
+
R("backward"), y((n) => n.slice(0, -1));
|
|
181
181
|
}, j = I(null), L = I(null), D = I(/* @__PURE__ */ new Map()), ye = () => {
|
|
182
182
|
q((n) => {
|
|
183
183
|
const l = !n;
|
|
184
|
-
return l || (y([]),
|
|
184
|
+
return l || (y([]), R("forward"), k(null)), l;
|
|
185
185
|
});
|
|
186
186
|
}, Z = (n) => {
|
|
187
187
|
const l = D.current.get(n);
|
|
@@ -208,11 +208,13 @@ function Ye({
|
|
|
208
208
|
};
|
|
209
209
|
}, []), U(() => {
|
|
210
210
|
if (typeof document < "u")
|
|
211
|
-
return h ?
|
|
211
|
+
return h ? setTimeout(() => {
|
|
212
|
+
Ae();
|
|
213
|
+
}, 0) : he(), () => he();
|
|
212
214
|
}, [h]);
|
|
213
215
|
const Le = (n) => n.map((l, d) => {
|
|
214
216
|
var ae, le, se, ie, ce;
|
|
215
|
-
const f = `group-${d}`, W = pe === d, o = (ae = l.primaryItems) == null ? void 0 : ae[
|
|
217
|
+
const f = `group-${d}`, W = pe === d, o = (ae = l.primaryItems) == null ? void 0 : ae[T ?? 0];
|
|
216
218
|
return /* @__PURE__ */ c(
|
|
217
219
|
"div",
|
|
218
220
|
{
|
|
@@ -264,7 +266,7 @@ function Ye({
|
|
|
264
266
|
"a",
|
|
265
267
|
{
|
|
266
268
|
href: r.href,
|
|
267
|
-
className: `${e.link} ${
|
|
269
|
+
className: `${e.link} ${T === g ? e.open : ""}`,
|
|
268
270
|
target: r.isExternal ? "_blank" : "_self",
|
|
269
271
|
rel: r.isExternal ? "noopener noreferrer" : void 0,
|
|
270
272
|
onClick: () => {
|
|
@@ -291,7 +293,7 @@ function Ye({
|
|
|
291
293
|
) : /* @__PURE__ */ a(
|
|
292
294
|
"button",
|
|
293
295
|
{
|
|
294
|
-
className: `${e.sublinkToggle} ${
|
|
296
|
+
className: `${e.sublinkToggle} ${T === g ? e.open : ""}`,
|
|
295
297
|
onMouseEnter: () => F(g),
|
|
296
298
|
children: /* @__PURE__ */ c("span", { className: e.linkContent, children: [
|
|
297
299
|
r.label,
|
|
@@ -315,7 +317,7 @@ function Ye({
|
|
|
315
317
|
] }),
|
|
316
318
|
(o == null ? void 0 : o.sublinks) && O(
|
|
317
319
|
o.sublinks,
|
|
318
|
-
`${f}-${
|
|
320
|
+
`${f}-${T}`
|
|
319
321
|
)
|
|
320
322
|
]
|
|
321
323
|
},
|
|
@@ -431,7 +433,7 @@ function Ye({
|
|
|
431
433
|
C && p === "advanced" && h && t.length === 0 && m && /* @__PURE__ */ a("div", { className: `${e.mobileMenu}`, children: m.map((n, l) => /* @__PURE__ */ a(
|
|
432
434
|
"div",
|
|
433
435
|
{
|
|
434
|
-
className: `${e.mobileMenuItem} ${
|
|
436
|
+
className: `${e.mobileMenuItem} ${x === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
|
|
435
437
|
children: /* @__PURE__ */ a(
|
|
436
438
|
"button",
|
|
437
439
|
{
|
|
@@ -466,7 +468,7 @@ function Ye({
|
|
|
466
468
|
t[t.length - 1].description && /* @__PURE__ */ a(
|
|
467
469
|
"div",
|
|
468
470
|
{
|
|
469
|
-
className: `${e.sublinksDescription} ${
|
|
471
|
+
className: `${e.sublinksDescription} ${x === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
|
|
470
472
|
children: s == null ? void 0 : s(
|
|
471
473
|
t[t.length - 1].description
|
|
472
474
|
)
|
|
@@ -475,7 +477,7 @@ function Ye({
|
|
|
475
477
|
t[t.length - 1].primary.map((n, l) => /* @__PURE__ */ a(
|
|
476
478
|
"div",
|
|
477
479
|
{
|
|
478
|
-
className: `${e.mobileMenuItem} ${
|
|
480
|
+
className: `${e.mobileMenuItem} ${x === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
|
|
479
481
|
children: n.sublinks ? /* @__PURE__ */ a(
|
|
480
482
|
"button",
|
|
481
483
|
{
|
|
@@ -517,7 +519,7 @@ function Ye({
|
|
|
517
519
|
(n, l) => /* @__PURE__ */ a(
|
|
518
520
|
"div",
|
|
519
521
|
{
|
|
520
|
-
className: `${e.mobileMenuItem} ${
|
|
522
|
+
className: `${e.mobileMenuItem} ${x === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
|
|
521
523
|
children: n.sublinks ? /* @__PURE__ */ a(
|
|
522
524
|
"button",
|
|
523
525
|
{
|
|
@@ -616,7 +618,7 @@ function Ye({
|
|
|
616
618
|
"aria-label": h ? "Close menu" : "Open menu",
|
|
617
619
|
"aria-expanded": h,
|
|
618
620
|
"aria-controls": "main-menu",
|
|
619
|
-
children: h ? /* @__PURE__ */ a(Se, { size: 24 }) : /* @__PURE__ */ a(
|
|
621
|
+
children: h ? /* @__PURE__ */ a(Se, { size: 24 }) : /* @__PURE__ */ a(Re, { size: 24 })
|
|
620
622
|
}
|
|
621
623
|
)
|
|
622
624
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index11.css');const i=require("react/jsx-runtime"),s=require("../../ui/LocaleLink/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index11.css');const i=require("react/jsx-runtime"),s=require("../../ui/LocaleLink/index.cjs"),o="_additionalCategories_1630y_1",r="_container_1630y_6",a="_categories_1630y_12",c="_list_1630y_23",d="_category_1630y_31",t={additionalCategories:o,container:r,categories:a,list:c,category:d};function _({categories:e,type:l}){if((e==null?void 0:e.length)!==0)return console.log("CAT",e),i.jsx("section",{className:`${t.additionalCategories} ${l=="article"?"blog":""}`,children:i.jsx("article",{className:t.container,children:i.jsxs("div",{className:t.categories,children:[i.jsx("p",{children:"In this article:"}),i.jsx("div",{className:t.list,children:e&&e.length>0&&e.map(n=>n.slug.current.includes("keyword")&&i.jsx(s.LocaleLink,{href:`/blog?category=${n.slug.current}`,className:t.category,children:n.title},n._id))})]})})})}exports.AdditionalCategoriesBlock=_;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { LocaleLink as
|
|
3
|
-
import '../../../assets/index11.css';const
|
|
4
|
-
additionalCategories:
|
|
5
|
-
container:
|
|
1
|
+
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { LocaleLink as s } from "../../ui/LocaleLink/index.mjs";
|
|
3
|
+
import '../../../assets/index11.css';const a = "_additionalCategories_1630y_1", r = "_container_1630y_6", c = "_categories_1630y_12", d = "_list_1630y_23", _ = "_category_1630y_31", n = {
|
|
4
|
+
additionalCategories: a,
|
|
5
|
+
container: r,
|
|
6
6
|
categories: c,
|
|
7
7
|
list: d,
|
|
8
8
|
category: _
|
|
9
9
|
};
|
|
10
|
-
function
|
|
10
|
+
function m({
|
|
11
11
|
categories: i,
|
|
12
|
-
type:
|
|
12
|
+
type: l
|
|
13
13
|
}) {
|
|
14
14
|
if ((i == null ? void 0 : i.length) !== 0)
|
|
15
|
-
return /* @__PURE__ */ t(
|
|
15
|
+
return console.log("CAT", i), /* @__PURE__ */ t(
|
|
16
16
|
"section",
|
|
17
17
|
{
|
|
18
|
-
className: `${n.additionalCategories} ${
|
|
19
|
-
children: /* @__PURE__ */ t("article", { className: n.container, children: /* @__PURE__ */
|
|
18
|
+
className: `${n.additionalCategories} ${l == "article" ? "blog" : ""}`,
|
|
19
|
+
children: /* @__PURE__ */ t("article", { className: n.container, children: /* @__PURE__ */ o("div", { className: n.categories, children: [
|
|
20
20
|
/* @__PURE__ */ t("p", { children: "In this article:" }),
|
|
21
|
-
/* @__PURE__ */ t("div", { className: n.list, children:
|
|
22
|
-
(
|
|
23
|
-
|
|
21
|
+
/* @__PURE__ */ t("div", { className: n.list, children: i && i.length > 0 && i.map(
|
|
22
|
+
(e) => e.slug.current.includes("keyword") && /* @__PURE__ */ t(
|
|
23
|
+
s,
|
|
24
24
|
{
|
|
25
|
-
href: `/blog?category=${
|
|
25
|
+
href: `/blog?category=${e.slug.current}`,
|
|
26
26
|
className: n.category,
|
|
27
|
-
children:
|
|
27
|
+
children: e.title
|
|
28
28
|
},
|
|
29
|
-
|
|
29
|
+
e._id
|
|
30
30
|
)
|
|
31
31
|
) })
|
|
32
32
|
] }) })
|
|
@@ -34,5 +34,5 @@ function y({
|
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
m as AdditionalCategoriesBlock
|
|
38
38
|
};
|