quirk-ui 0.0.435 → 0.0.437

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 Ce=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Le=D.createLucideIcon("search",Ce),_e={standard:e.styles.standard,transparent:e.styles.transparent},Se={left:e.styles.left,center:e.styles.center,right:e.styles.right},Me=({spotlight:a,renderText:b})=>{var t,w,v,p,j,C,f,L,_,S,y;const g=(t=a.image)==null?void 0:t.asset.altText,m=((w=a.callToAction.linkOptions)==null?void 0:w.linkType)==="external";let u="#";return((v=a.callToAction.linkOptions)==null?void 0:v.linkType)==="external"&&((p=a.callToAction.linkOptions)!=null&&p.externalUrl)?u=(j=a.callToAction.linkOptions)==null?void 0:j.externalUrl:((C=a.callToAction.linkOptions)==null?void 0:C.linkType)==="internal"&&((L=(f=a.callToAction.linkOptions)==null?void 0:f.internalUrl)!=null&&L.slug.current)&&(u=`/${(S=(_=a.callToAction.linkOptions)==null?void 0:_.internalUrl)==null?void 0:S.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:g||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(z.CallToAction,{as:"a",variant:a.callToAction.variant??"primary",href:u,target:m?"_blank":"_self",rel:m?"noopener noreferrer":"","aria-label":a.callToAction.ariaLabel||a.callToAction.label,children:a.callToAction.label})})]})};function Ae({renderText:a,title:b,logo:g,items:m,groups:u,utilityItems:t,isSticky:w=!1,showSearch:v=!0,showLocaleSelect:p=!0,alignment:j="right",variant:C="standard",navigationType:f="default",searchComponent:L,localeSelectComponent:_,className:S}){const[y,G]=r.useState(!1),[U,x]=r.useState(null),[ie,ce]=r.useState(0),[re,oe]=r.useState(!1),[de,ye]=r.useState(null),[o,M]=r.useState([]),[A,O]=r.useState(0),[ue,V]=r.useState(null),[N,he]=r.useState(!1),[E,q]=r.useState("forward"),B=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} ${e.styles.searchWrapper}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(ae.Modal,{className:e.styles.searchModal,trigger:s.jsx("button",{title:"Search","aria-label":"Search",role:"menuitem",className:e.styles.search,children:s.jsx(Le,{size:16})}),content:L})})}),X=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} `,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(ae.Modal,{className:e.styles.localeModal,trigger:s.jsx("button",{title:"Locale Select","aria-label":"Locale Select",role:"menuitem",className:e.styles.locale,children:s.jsx($e,{size:16})}),content:_})})});r.useEffect(()=>{if(typeof window<"u"){const n=()=>{const l=window.innerWidth<768;he(l)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}},[]);const be=()=>{M([])},me=n=>{q("forward"),M([{title:n.title,primary:n.primaryItems??[],secondary:n.secondaryItems??[],description:""}])},H=n=>{q("forward"),M(l=>[...l,{title:n.label,primary:n.sublinks??[],secondary:[],description:n.description}])},fe=()=>{q("backward"),M(n=>n.slice(0,-1))},F=r.useRef(null),$=r.useRef(null),W=r.useRef(new Map),xe=()=>{G(n=>!n)},J=n=>{const l=W.current.get(n);if(l&&$.current){const d=l.getBoundingClientRect(),h=$.current.getBoundingClientRect(),c=d.left-h.left+d.width/2;ye(c)}},ve=n=>{x(l=>l===n?null:n)},K=r.useCallback(n=>{F.current&&!F.current.contains(n.target)&&x(null)},[]),Q=r.useCallback(()=>{Y(),typeof window<"u"&&window.innerWidth>768&&(G(!1),x(null),typeof document<"u"&&(document.body.style.overflow=""))},[]),Y=r.useCallback(()=>{if($.current){const n=$.current.getBoundingClientRect().width;ce(n),oe(!0)}},[]);r.useEffect(()=>{const n=typeof window<"u",l=typeof document<"u";return n&&window.addEventListener("resize",Q),l&&document.addEventListener("click",K),Y(),()=>{n&&window.removeEventListener("resize",Q),l&&document.removeEventListener("click",K)}},[]),r.useEffect(()=>{if(typeof document<"u")return document.body.style.overflow=y?"hidden":"",()=>{document.body.style.overflow=""}},[y]);const je=n=>n.map((l,d)=>{var Z,P,ee,se,ne;const h=`group-${d}`,T=ue===d,c=(Z=l.primaryItems)==null?void 0:Z[A??0];return s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{V(d),x(h),J(h)},onMouseLeave:()=>{V(null),O(0),x(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":T,"aria-controls":`submenu-${d}`,className:`${e.styles.sublinkToggle} ${T?e.styles.open:""} `,children:[l.title,s.jsx(pe.ChevronDown,{size:18,className:e.styles.chevron})]})}),s.jsx("div",{id:`submenu-${d}`,className:`${e.styles.sublinks} ${T?e.styles.show:""}`,role:"menu","aria-label":`${l.title} submenu`,children:s.jsx("div",{children:s.jsxs("div",{className:`${e.styles.sublinksInner} ${l.spotlight?e.styles.withSpotlight:e.styles.withoutSpotlight}`,children:[s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.primaryColumn}`,children:[s.jsx("div",{className:e.styles.linkItem}),(P=l.primaryItems)==null?void 0:P.map((i,k)=>i.href?s.jsxs("a",{href:i.href,className:`${e.styles.link} ${A===k?e.styles.open:""}`,target:i.isExternal?"_blank":"_self",rel:i.isExternal?"noopener noreferrer":void 0,onClick:()=>{var le;x(null),(le=i.onClick)==null||le.call(i)},onMouseEnter:()=>i.sublinks?O(k):null,role:"menuitem",children:[s.jsxs("span",{className:e.styles.linkContent,children:[i.label,i.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:i.subtitle})]}),i.isExternal&&s.jsx(I.ExternalLink,{className:e.styles.newTabIcon,size:16})]},i._key??k):s.jsx("button",{className:`${e.styles.sublinkToggle} ${A===k?e.styles.open:""}`,onMouseEnter:()=>O(k),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??k))]}),(c==null?void 0:c.sublinks)&&((ee=c==null?void 0:c.sublinks)==null?void 0:ee.length)>0&&s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.fadeInFromLeft}`,children:[(c==null?void 0:c.description)&&s.jsx("div",{className:e.styles.sublinksDescription,children:a==null?void 0:a(c.description)}),(c==null?void 0:c.sublinks)&&R(c.sublinks,`${h}-${A}`)]},`${c.label}-${(se=c==null?void 0:c.sublinks)==null?void 0:se.length}`),(l==null?void 0:l.secondaryItems)&&((ne=l==null?void 0:l.secondaryItems)==null?void 0:ne.length)>0&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.secondaryColumn}`,children:l.secondaryItems&&l.secondaryItems.length>0&&R(l.secondaryItems,`${h}-secondary`)}),l.spotlight&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.spotlightColumn}`,children:s.jsx(Me,{spotlight:l.spotlight,renderText:a??(i=>String(i))})})]})})})]},l._key??`group-${d}`)}),R=(n,l="")=>n.map(d=>{const h=`${l}/${d.label}`;return s.jsx(e.NavLink,{link:d,path:h,parentPath:l,openPath:U,togglePath:ve,updateTriangleIndicator:J,setOpenPath:x,renderLinks:R,buttonRefs:W},d._key??h)});return s.jsx("header",{ref:F,className:`${S??""} ${Se[j]} ${_e[C]} ${e.styles.navbar} ${w?e.styles.sticky:""} ${u&&u.length?e.styles.advanced:e.styles.default}`,role:"navigation","aria-label":"Main navigation",children:s.jsxs("div",{className:`${e.styles.container} ${(!t||t.length===0)&&j!=="center"?e.styles.twoColumn:""}`,children:[g?s.jsx("div",{className:e.styles.logo,children:g}):s.jsx("div",{className:e.styles.title,children:b}),s.jsx("nav",{ref:$,style:{left:j==="center"?`calc(50% - ${ie/2}px)`:"0"},className:`${e.styles.nav} ${y?e.styles.open:""} ${re?e.styles.visible:e.styles.hidden}`,id:"main-menu",role:"menubar","aria-label":"Main navigation",children:s.jsxs("div",{className:e.styles.navInner,children:[s.jsx("svg",{style:{left:`${de}px`},className:`${e.styles.triangle} ${U?e.styles.show:""}`,width:16,height:12,viewBox:"0 0 100 75",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("polygon",{points:"50,5 95,70 5,70",strokeLinejoin:"round",fill:"white",stroke:"white"})}),f==="default"&&m&&s.jsxs("div",{className:e.styles.grid,children:[m&&m.length>0&&R(m),v&&!N&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(B,{})]}),p&&s.jsx(X,{})]}),!N&&f==="advanced"&&u&&s.jsxs("div",{className:e.styles.grid,children:[u.length>0&&je(u),v&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(B,{})]}),p&&s.jsx(X,{})]}),N&&f==="advanced"&&y&&o.length===0&&u&&s.jsx("div",{className:`${e.styles.mobileMenu}`,children:u.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${E==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>me(n),children:n.title})},n._key??l))}),N&&f==="advanced"&&y&&o.length>0&&s.jsxs("div",{className:`${e.styles.mobileMenuSlide} `,children:[s.jsx("button",{className:e.styles.back,onClick:o.length===1?be:fe,children:s.jsx(z.ChevronLeft,{size:18,"aria-hidden":"true",focusable:"false"})}),o[o.length-1].description&&s.jsx("div",{className:`${e.styles.sublinksDescription} ${E==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:o[o.length-1].description&&(a==null?void 0:a(o[o.length-1].description))}),o[o.length-1].primary.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${E==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:n.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>H(n),children:s.jsxs("span",{className:e.styles.linkContent,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:n.subtitle})]})}):s.jsxs("a",{href:n.href,className:e.styles.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,role:"menuitem",children:[s.jsxs("span",{className:e.styles.linkContent,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:n.subtitle})]}),n.isExternal&&s.jsx(I.ExternalLink,{className:e.styles.newTabIcon,size:16})]})},n._key??`primary-${l}`)),o[o.length-1].secondary.length>0&&s.jsx("hr",{className:e.styles.groupDivider}),o[o.length-1].secondary.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${E==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:n.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>H(n),children:n.label}):s.jsxs("a",{href:n.href,className:e.styles.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,role:"menuitem",children:[n.label,n.isExternal&&s.jsx(I.ExternalLink,{className:e.styles.newTabIcon,size:16})]})},n._key??`secondary-${l}`))]},`stack-${o.length}`)]})}),t&&t.length>0&&s.jsx("nav",{className:e.styles.utility,"aria-label":"Utility navigation",children:s.jsx(te.ButtonGroup,{children:t.map((n,l)=>s.jsx(z.CallToAction,{as:"a",href:n.href??"/",variant:n.variant??"primary",displayType:n.displayType??"text",imageSrc:n.imageSrc,imageAlt:n.imageAlt,"aria-label":n.ariaLabel??n.label,icon:n.icon,iconAlignment:n.iconAlignment,children:n.imageSrc?s.jsx("img",{src:n.imageSrc,alt:n.imageAlt??n.ariaLabel??n.label}):n.label},n._key||l))})}),t&&t.length>0&&s.jsx("nav",{"aria-label":"Utility navigation",className:`${e.styles.utilityMobile} ${y?e.styles.open:""}`,children:s.jsx(te.ButtonGroup,{alignment:"center",children:s.jsx(z.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:[N&&v&&s.jsx(B,{}),s.jsx("button",{className:e.styles.menuToggle,onClick:xe,"aria-label":y?"Close menu":"Open menu","aria-expanded":y,"aria-controls":"main-menu",children:y?s.jsx(ke.X,{size:24}):s.jsx(we,{size:24})})]})]})})}exports.Navbar=Ae;
16
+ */const Ce=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Le=D.createLucideIcon("search",Ce),_e={standard:e.styles.standard,transparent:e.styles.transparent},Se={left:e.styles.left,center:e.styles.center,right:e.styles.right},Me=({spotlight:a,renderText:b})=>{var t,w,j,p,v,C,x,L,_,S,y;const g=(t=a.image)==null?void 0:t.asset.altText,m=((w=a.callToAction.linkOptions)==null?void 0:w.linkType)==="external";let u="#";return((j=a.callToAction.linkOptions)==null?void 0:j.linkType)==="external"&&((p=a.callToAction.linkOptions)!=null&&p.externalUrl)?u=(v=a.callToAction.linkOptions)==null?void 0:v.externalUrl:((C=a.callToAction.linkOptions)==null?void 0:C.linkType)==="internal"&&((L=(x=a.callToAction.linkOptions)==null?void 0:x.internalUrl)!=null&&L.slug.current)&&(u=`/${(S=(_=a.callToAction.linkOptions)==null?void 0:_.internalUrl)==null?void 0:S.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:g||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(z.CallToAction,{as:"a",variant:a.callToAction.variant??"primary",href:u,target:m?"_blank":"_self",rel:m?"noopener noreferrer":"","aria-label":a.callToAction.ariaLabel||a.callToAction.label,children:a.callToAction.label})})]})};function Ee({renderText:a,title:b,logo:g,items:m,groups:u,utilityItems:t,isSticky:w=!1,showSearch:j=!0,showLocaleSelect:p=!0,alignment:v="right",variant:C="standard",navigationType:x="default",searchComponent:L,localeSelectComponent:_,className:S}){const[y,G]=r.useState(!1),[U,f]=r.useState(null),[ie,ce]=r.useState(0),[re,oe]=r.useState(!1),[de,ye]=r.useState(null),[o,M]=r.useState([]),[E,O]=r.useState(0),[ue,X]=r.useState(null),[N,he]=r.useState(!1),[A,q]=r.useState("forward"),B=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} ${e.styles.searchWrapper}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(ae.Modal,{className:e.styles.searchModal,trigger:s.jsx("button",{title:"Search","aria-label":"Search",role:"menuitem",className:e.styles.search,children:s.jsx(Le,{size:16})}),content:L})})}),H=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} `,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(ae.Modal,{className:e.styles.localeModal,trigger:s.jsx("button",{title:"Locale Select","aria-label":"Locale Select",role:"menuitem",className:e.styles.locale,children:s.jsx($e,{size:16})}),content:_})})});r.useEffect(()=>{if(typeof window<"u"){const n=()=>{const l=window.innerWidth<768;he(l)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}},[]);const be=()=>{M([])},me=n=>{q("forward"),M([{title:n.title,primary:n.primaryItems??[],secondary:n.secondaryItems??[],description:""}])},V=n=>{q("forward"),M(l=>[...l,{title:n.label,primary:n.sublinks??[],secondary:[],description:n.description}])},xe=()=>{q("backward"),M(n=>n.slice(0,-1))},F=r.useRef(null),$=r.useRef(null),W=r.useRef(new Map),fe=()=>{G(n=>!n)},J=n=>{const l=W.current.get(n);if(l&&$.current){const d=l.getBoundingClientRect(),h=$.current.getBoundingClientRect(),c=d.left-h.left+d.width/2;ye(c)}},je=n=>{f(l=>l===n?null:n)},K=r.useCallback(n=>{F.current&&!F.current.contains(n.target)&&f(null)},[]),Q=r.useCallback(()=>{Y(),typeof window<"u"&&window.innerWidth>768&&(G(!1),f(null),typeof document<"u"&&(document.body.style.overflow=""))},[]),Y=r.useCallback(()=>{if($.current){const n=$.current.getBoundingClientRect().width;ce(n),oe(!0)}},[]);r.useEffect(()=>{const n=typeof window<"u",l=typeof document<"u";return n&&window.addEventListener("resize",Q),l&&document.addEventListener("click",K),Y(),()=>{n&&window.removeEventListener("resize",Q),l&&document.removeEventListener("click",K)}},[]),r.useEffect(()=>{if(typeof document<"u")return document.body.style.overflow=y?"hidden":"",()=>{document.body.style.overflow=""}},[y]);const ve=n=>n.map((l,d)=>{var Z,P,ee,se,ne;const h=`group-${d}`,R=ue===d,c=(Z=l.primaryItems)==null?void 0:Z[E??0];return s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{X(d),f(h),J(h)},onMouseLeave:()=>{X(null),O(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":R,"aria-controls":`submenu-${d}`,className:`${e.styles.sublinkToggle} ${R?e.styles.open:""} `,children:[l.title,s.jsx(pe.ChevronDown,{size:18,className:e.styles.chevron})]})}),s.jsx("div",{id:`submenu-${d}`,className:`${e.styles.sublinks} ${R?e.styles.show:""}`,role:"menu","aria-label":`${l.title} submenu`,children:s.jsx("div",{children:s.jsxs("div",{className:`${e.styles.sublinksInner} ${l.spotlight?e.styles.withSpotlight:e.styles.withoutSpotlight}`,children:[s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.primaryColumn}`,children:[s.jsx("div",{className:e.styles.linkItem}),(P=l.primaryItems)==null?void 0:P.map((i,k)=>i.href?s.jsxs("a",{href:i.href,className:`${e.styles.link} ${E===k?e.styles.open:""}`,target:i.isExternal?"_blank":"_self",rel:i.isExternal?"noopener noreferrer":void 0,onClick:()=>{var le;f(null),(le=i.onClick)==null||le.call(i)},onMouseEnter:()=>i.sublinks?O(k):null,role:"menuitem",children:[s.jsxs("span",{className:e.styles.linkContent,children:[i.label,i.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:i.subtitle})]}),i.isExternal&&s.jsx(I.ExternalLink,{className:e.styles.newTabIcon,size:16})]},i._key??k):s.jsx("button",{className:`${e.styles.sublinkToggle} ${E===k?e.styles.open:""}`,onMouseEnter:()=>O(k),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??k))]}),(c==null?void 0:c.sublinks)&&((ee=c==null?void 0:c.sublinks)==null?void 0:ee.length)>0&&s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.fadeInFromLeft}`,children:[(c==null?void 0:c.description)&&s.jsxs("div",{className:e.styles.sublinksDescription,children:[s.jsx("p",{children:"TEXT HERE"}),a==null?void 0:a(c.description)]}),(c==null?void 0:c.sublinks)&&T(c.sublinks,`${h}-${E}`)]},`${c.label}-${(se=c==null?void 0:c.sublinks)==null?void 0:se.length}`),(l==null?void 0:l.secondaryItems)&&((ne=l==null?void 0:l.secondaryItems)==null?void 0:ne.length)>0&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.secondaryColumn}`,children:l.secondaryItems&&l.secondaryItems.length>0&&T(l.secondaryItems,`${h}-secondary`)}),l.spotlight&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.spotlightColumn}`,children:s.jsx(Me,{spotlight:l.spotlight,renderText:a??(i=>String(i))})})]})})})]},l._key??`group-${d}`)}),T=(n,l="")=>n.map(d=>{const h=`${l}/${d.label}`;return s.jsx(e.NavLink,{link:d,path:h,parentPath:l,openPath:U,togglePath:je,updateTriangleIndicator:J,setOpenPath:f,renderLinks:T,buttonRefs:W},d._key??h)});return s.jsx("header",{ref:F,className:`${S??""} ${Se[v]} ${_e[C]} ${e.styles.navbar} ${w?e.styles.sticky:""} ${u&&u.length?e.styles.advanced:e.styles.default}`,role:"navigation","aria-label":"Main navigation",children:s.jsxs("div",{className:`${e.styles.container} ${(!t||t.length===0)&&v!=="center"?e.styles.twoColumn:""}`,children:[g?s.jsx("div",{className:e.styles.logo,children:g}):s.jsx("div",{className:e.styles.title,children:b}),s.jsx("nav",{ref:$,style:{left:v==="center"?`calc(50% - ${ie/2}px)`:"0"},className:`${e.styles.nav} ${y?e.styles.open:""} ${re?e.styles.visible:e.styles.hidden}`,id:"main-menu",role:"menubar","aria-label":"Main navigation",children:s.jsxs("div",{className:e.styles.navInner,children:[s.jsx("svg",{style:{left:`${de}px`},className:`${e.styles.triangle} ${U?e.styles.show:""}`,width:16,height:12,viewBox:"0 0 100 75",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("polygon",{points:"50,5 95,70 5,70",strokeLinejoin:"round",fill:"white",stroke:"white"})}),x==="default"&&m&&s.jsxs("div",{className:e.styles.grid,children:[m&&m.length>0&&T(m),j&&!N&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(B,{})]}),p&&s.jsx(H,{})]}),!N&&x==="advanced"&&u&&s.jsxs("div",{className:e.styles.grid,children:[u.length>0&&ve(u),j&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(B,{})]}),p&&s.jsx(H,{})]}),N&&x==="advanced"&&y&&o.length===0&&u&&s.jsx("div",{className:`${e.styles.mobileMenu}`,children:u.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>me(n),children:n.title})},n._key??l))}),N&&x==="advanced"&&y&&o.length>0&&s.jsxs("div",{className:`${e.styles.mobileMenuSlide} `,children:[s.jsx("button",{className:e.styles.back,onClick:o.length===1?be:xe,children:s.jsx(z.ChevronLeft,{size:18,"aria-hidden":"true",focusable:"false"})}),o[o.length-1].description&&s.jsx("div",{className:`${e.styles.sublinksDescription} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:a==null?void 0:a(o[o.length-1].description)}),o[o.length-1].primary.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:n.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>V(n),children:s.jsxs("span",{className:e.styles.linkContent,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:n.subtitle})]})}):s.jsxs("a",{href:n.href,className:e.styles.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,role:"menuitem",children:[s.jsxs("span",{className:e.styles.linkContent,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:n.subtitle})]}),n.isExternal&&s.jsx(I.ExternalLink,{className:e.styles.newTabIcon,size:16})]})},n._key??`primary-${l}`)),o[o.length-1].secondary.length>0&&s.jsx("hr",{className:e.styles.groupDivider}),o[o.length-1].secondary.map((n,l)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:n.sublinks?s.jsx("button",{className:e.styles.sublinkToggle,onClick:()=>V(n),children:n.label}):s.jsxs("a",{href:n.href,className:e.styles.link,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,role:"menuitem",children:[n.label,n.isExternal&&s.jsx(I.ExternalLink,{className:e.styles.newTabIcon,size:16})]})},n._key??`secondary-${l}`))]},`stack-${o.length}`)]})}),t&&t.length>0&&s.jsx("nav",{className:e.styles.utility,"aria-label":"Utility navigation",children:s.jsx(te.ButtonGroup,{children:t.map((n,l)=>s.jsx(z.CallToAction,{as:"a",href:n.href??"/",variant:n.variant??"primary",displayType:n.displayType??"text",imageSrc:n.imageSrc,imageAlt:n.imageAlt,"aria-label":n.ariaLabel??n.label,icon:n.icon,iconAlignment:n.iconAlignment,children:n.imageSrc?s.jsx("img",{src:n.imageSrc,alt:n.imageAlt??n.ariaLabel??n.label}):n.label},n._key||l))})}),t&&t.length>0&&s.jsx("nav",{"aria-label":"Utility navigation",className:`${e.styles.utilityMobile} ${y?e.styles.open:""}`,children:s.jsx(te.ButtonGroup,{alignment:"center",children:s.jsx(z.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:[N&&j&&s.jsx(B,{}),s.jsx("button",{className:e.styles.menuToggle,onClick:fe,"aria-label":y?"Close menu":"Open menu","aria-expanded":y,"aria-controls":"main-menu",children:y?s.jsx(ke.X,{size:24}):s.jsx(we,{size:24})})]})]})})}exports.Navbar=Ee;
@@ -1,13 +1,13 @@
1
1
  import { jsx as a, jsxs as c, Fragment as oe } from "react/jsx-runtime";
2
2
  import { useState as f, useEffect as U, useRef as I, useCallback as G } from "react";
3
3
  import { Modal as te } from "../Modal/index.mjs";
4
- import { a as Le, C as X } from "../../../index-FuTQRxMN.js";
4
+ import { a as Le, C as H } from "../../../index-FuTQRxMN.js";
5
5
  import { ButtonGroup as de } from "../ButtonGroup/index.mjs";
6
6
  import { s as e, N as Me } from "../../../NavLink-Dk1p55ah.js";
7
- import { E as V } from "../../../external-link-BOPobeQJ.js";
8
- import { X as Ae } from "../../../x-CnsEH4Ox.js";
9
- import { c as H } from "../../../createLucideIcon-C8GTh_Qx.js";
10
- import { C as Ee } from "../../../chevron-down-DSUzBz9F.js";
7
+ import { E as X } from "../../../external-link-BOPobeQJ.js";
8
+ import { X as Ee } from "../../../x-CnsEH4Ox.js";
9
+ import { c as V } from "../../../createLucideIcon-C8GTh_Qx.js";
10
+ import { C as Ae } from "../../../chevron-down-DSUzBz9F.js";
11
11
  /**
12
12
  * @license lucide-react v0.488.0 - ISC
13
13
  *
@@ -25,7 +25,7 @@ const _e = [
25
25
  ],
26
26
  ["path", { d: "M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05", key: "14pb5j" }],
27
27
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
28
- ], Se = H("earth", _e);
28
+ ], Se = V("earth", _e);
29
29
  /**
30
30
  * @license lucide-react v0.488.0 - ISC
31
31
  *
@@ -36,7 +36,7 @@ const ze = [
36
36
  ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
37
37
  ["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
38
38
  ["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
39
- ], xe = H("menu", ze);
39
+ ], xe = V("menu", ze);
40
40
  /**
41
41
  * @license lucide-react v0.488.0 - ISC
42
42
  *
@@ -46,7 +46,7 @@ const ze = [
46
46
  const Re = [
47
47
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
48
48
  ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
49
- ], Oe = H("search", Re), Te = {
49
+ ], Te = V("search", Re), Oe = {
50
50
  standard: e.standard,
51
51
  transparent: e.transparent
52
52
  }, We = {
@@ -57,10 +57,10 @@ const Re = [
57
57
  spotlight: s,
58
58
  renderText: u
59
59
  }) => {
60
- var i, M, N, y, $, A, k, E, _, S, h;
60
+ var i, M, N, y, $, E, k, A, _, S, h;
61
61
  const L = (i = s.image) == null ? void 0 : i.asset.altText, v = ((M = s.callToAction.linkOptions) == null ? void 0 : M.linkType) === "external";
62
62
  let m = "#";
63
- return ((N = s.callToAction.linkOptions) == null ? void 0 : N.linkType) === "external" && ((y = s.callToAction.linkOptions) != null && y.externalUrl) ? m = ($ = s.callToAction.linkOptions) == null ? void 0 : $.externalUrl : ((A = s.callToAction.linkOptions) == null ? void 0 : A.linkType) === "internal" && ((E = (k = s.callToAction.linkOptions) == null ? void 0 : k.internalUrl) != null && E.slug.current) && (m = `/${(S = (_ = s.callToAction.linkOptions) == null ? void 0 : _.internalUrl) == null ? void 0 : S.slug.current}`), /* @__PURE__ */ c("div", { className: e.spotlight, children: [
63
+ return ((N = s.callToAction.linkOptions) == null ? void 0 : N.linkType) === "external" && ((y = s.callToAction.linkOptions) != null && y.externalUrl) ? m = ($ = s.callToAction.linkOptions) == null ? void 0 : $.externalUrl : ((E = s.callToAction.linkOptions) == null ? void 0 : E.linkType) === "internal" && ((A = (k = s.callToAction.linkOptions) == null ? void 0 : k.internalUrl) != null && A.slug.current) && (m = `/${(S = (_ = s.callToAction.linkOptions) == null ? void 0 : _.internalUrl) == null ? void 0 : S.slug.current}`), /* @__PURE__ */ c("div", { className: e.spotlight, children: [
64
64
  s.image && /* @__PURE__ */ a("div", { className: e.imageWrapper, children: /* @__PURE__ */ a(
65
65
  "img",
66
66
  {
@@ -75,7 +75,7 @@ const Re = [
75
75
  s.description && /* @__PURE__ */ a("div", { className: e.description, children: u == null ? void 0 : u(s.description, e.description) })
76
76
  ] }),
77
77
  ((h = s.callToAction) == null ? void 0 : h.linkOptions) && /* @__PURE__ */ a("div", { className: e.actions, children: /* @__PURE__ */ a(
78
- X,
78
+ H,
79
79
  {
80
80
  as: "a",
81
81
  variant: s.callToAction.variant ?? "primary",
@@ -99,9 +99,9 @@ function Je({
99
99
  showSearch: N = !0,
100
100
  showLocaleSelect: y = !0,
101
101
  alignment: $ = "right",
102
- variant: A = "standard",
102
+ variant: E = "standard",
103
103
  navigationType: k = "default",
104
- searchComponent: E,
104
+ searchComponent: A,
105
105
  localeSelectComponent: _,
106
106
  className: S
107
107
  }) {
@@ -122,10 +122,10 @@ function Je({
122
122
  "aria-label": "Search",
123
123
  role: "menuitem",
124
124
  className: e.search,
125
- children: /* @__PURE__ */ a(Oe, { size: 16 })
125
+ children: /* @__PURE__ */ a(Te, { size: 16 })
126
126
  }
127
127
  ),
128
- content: E
128
+ content: A
129
129
  }
130
130
  ) })
131
131
  }
@@ -211,7 +211,7 @@ function Je({
211
211
  }, [h]);
212
212
  const Ce = (n) => n.map((l, d) => {
213
213
  var ae, le, se, ie, ce;
214
- const b = `group-${d}`, T = ke === d, o = (ae = l.primaryItems) == null ? void 0 : ae[x ?? 0];
214
+ const b = `group-${d}`, O = ke === d, o = (ae = l.primaryItems) == null ? void 0 : ae[x ?? 0];
215
215
  return /* @__PURE__ */ c(
216
216
  "div",
217
217
  {
@@ -231,12 +231,12 @@ function Je({
231
231
  },
232
232
  role: "menuitem",
233
233
  "aria-haspopup": "true",
234
- "aria-expanded": T,
234
+ "aria-expanded": O,
235
235
  "aria-controls": `submenu-${d}`,
236
- className: `${e.sublinkToggle} ${T ? e.open : ""} `,
236
+ className: `${e.sublinkToggle} ${O ? e.open : ""} `,
237
237
  children: [
238
238
  l.title,
239
- /* @__PURE__ */ a(Ee, { size: 18, className: e.chevron })
239
+ /* @__PURE__ */ a(Ae, { size: 18, className: e.chevron })
240
240
  ]
241
241
  }
242
242
  ) }),
@@ -244,7 +244,7 @@ function Je({
244
244
  "div",
245
245
  {
246
246
  id: `submenu-${d}`,
247
- className: `${e.sublinks} ${T ? e.show : ""}`,
247
+ className: `${e.sublinks} ${O ? e.show : ""}`,
248
248
  role: "menu",
249
249
  "aria-label": `${l.title} submenu`,
250
250
  children: /* @__PURE__ */ a("div", { children: /* @__PURE__ */ c(
@@ -278,7 +278,7 @@ function Je({
278
278
  r.subtitle && /* @__PURE__ */ a("span", { className: e.subtitle, children: r.subtitle })
279
279
  ] }),
280
280
  r.isExternal && /* @__PURE__ */ a(
281
- V,
281
+ X,
282
282
  {
283
283
  className: e.newTabIcon,
284
284
  size: 16
@@ -308,8 +308,11 @@ function Je({
308
308
  {
309
309
  className: `${e.sublinksColumn} ${e.fadeInFromLeft}`,
310
310
  children: [
311
- (o == null ? void 0 : o.description) && /* @__PURE__ */ a("div", { className: e.sublinksDescription, children: s == null ? void 0 : s(o.description) }),
312
- (o == null ? void 0 : o.sublinks) && O(
311
+ (o == null ? void 0 : o.description) && /* @__PURE__ */ c("div", { className: e.sublinksDescription, children: [
312
+ /* @__PURE__ */ a("p", { children: "TEXT HERE" }),
313
+ s == null ? void 0 : s(o.description)
314
+ ] }),
315
+ (o == null ? void 0 : o.sublinks) && T(
313
316
  o.sublinks,
314
317
  `${b}-${x}`
315
318
  )
@@ -321,7 +324,7 @@ function Je({
321
324
  "div",
322
325
  {
323
326
  className: `${e.sublinksColumn} ${e.secondaryColumn}`,
324
- children: l.secondaryItems && l.secondaryItems.length > 0 && O(l.secondaryItems, `${b}-secondary`)
327
+ children: l.secondaryItems && l.secondaryItems.length > 0 && T(l.secondaryItems, `${b}-secondary`)
325
328
  }
326
329
  ),
327
330
  l.spotlight && /* @__PURE__ */ a(
@@ -346,7 +349,7 @@ function Je({
346
349
  },
347
350
  l._key ?? `group-${d}`
348
351
  );
349
- }), O = (n, l = "") => n.map((d) => {
352
+ }), T = (n, l = "") => n.map((d) => {
350
353
  const b = `${l}/${d.label}`;
351
354
  return /* @__PURE__ */ a(
352
355
  Me,
@@ -358,7 +361,7 @@ function Je({
358
361
  togglePath: we,
359
362
  updateTriangleIndicator: Z,
360
363
  setOpenPath: p,
361
- renderLinks: O,
364
+ renderLinks: T,
362
365
  buttonRefs: D
363
366
  },
364
367
  d._key ?? b
@@ -368,7 +371,7 @@ function Je({
368
371
  "header",
369
372
  {
370
373
  ref: j,
371
- className: `${S ?? ""} ${We[$]} ${Te[A]} ${e.navbar} ${M ? e.sticky : ""} ${m && m.length ? e.advanced : e.default}`,
374
+ className: `${S ?? ""} ${We[$]} ${Oe[E]} ${e.navbar} ${M ? e.sticky : ""} ${m && m.length ? e.advanced : e.default}`,
372
375
  role: "navigation",
373
376
  "aria-label": "Main navigation",
374
377
  children: /* @__PURE__ */ c(
@@ -410,7 +413,7 @@ function Je({
410
413
  }
411
414
  ),
412
415
  k === "default" && v && /* @__PURE__ */ c("div", { className: e.grid, children: [
413
- v && v.length > 0 && O(v),
416
+ v && v.length > 0 && T(v),
414
417
  N && !w && /* @__PURE__ */ c(oe, { children: [
415
418
  /* @__PURE__ */ a("span", { className: e.separator }),
416
419
  /* @__PURE__ */ a(B, {})
@@ -464,9 +467,9 @@ function Je({
464
467
  "div",
465
468
  {
466
469
  className: `${e.sublinksDescription} ${R === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
467
- children: t[t.length - 1].description && (s == null ? void 0 : s(
470
+ children: s == null ? void 0 : s(
468
471
  t[t.length - 1].description
469
- ))
472
+ )
470
473
  }
471
474
  ),
472
475
  t[t.length - 1].primary.map((n, l) => /* @__PURE__ */ a(
@@ -497,7 +500,7 @@ function Je({
497
500
  n.subtitle && /* @__PURE__ */ a("span", { className: e.subtitle, children: n.subtitle })
498
501
  ] }),
499
502
  n.isExternal && /* @__PURE__ */ a(
500
- V,
503
+ X,
501
504
  {
502
505
  className: e.newTabIcon,
503
506
  size: 16
@@ -533,7 +536,7 @@ function Je({
533
536
  children: [
534
537
  n.label,
535
538
  n.isExternal && /* @__PURE__ */ a(
536
- V,
539
+ X,
537
540
  {
538
541
  className: e.newTabIcon,
539
542
  size: 16
@@ -554,7 +557,7 @@ function Je({
554
557
  }
555
558
  ),
556
559
  i && i.length > 0 && /* @__PURE__ */ a("nav", { className: e.utility, "aria-label": "Utility navigation", children: /* @__PURE__ */ a(de, { children: i.map((n, l) => /* @__PURE__ */ a(
557
- X,
560
+ H,
558
561
  {
559
562
  as: "a",
560
563
  href: n.href ?? "/",
@@ -581,7 +584,7 @@ function Je({
581
584
  "aria-label": "Utility navigation",
582
585
  className: `${e.utilityMobile} ${h ? e.open : ""}`,
583
586
  children: /* @__PURE__ */ a(de, { alignment: "center", children: /* @__PURE__ */ a(
584
- X,
587
+ H,
585
588
  {
586
589
  as: "a",
587
590
  href: i[1].href ?? "/",
@@ -613,7 +616,7 @@ function Je({
613
616
  "aria-label": h ? "Close menu" : "Open menu",
614
617
  "aria-expanded": h,
615
618
  "aria-controls": "main-menu",
616
- children: h ? /* @__PURE__ */ a(Ae, { size: 24 }) : /* @__PURE__ */ a(xe, { size: 24 })
619
+ children: h ? /* @__PURE__ */ a(Ee, { size: 24 }) : /* @__PURE__ */ a(xe, { size: 24 })
617
620
  }
618
621
  )
619
622
  ] })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.0.435",
4
+ "version": "0.0.437",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {