quirk-ui 0.0.521 → 0.0.522
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/components/NavBar/index.cjs +4 -4
- package/dist/core/components/NavBar/index.mjs +95 -95
- package/dist/core.d.ts +5 -0
- package/dist/main.d.ts +5 -0
- package/dist/next/blocks/ContentBlock/index.cjs +1 -1
- package/dist/next/blocks/ContentBlock/index.mjs +57 -49
- package/dist/next/blocks/StickyScrollBlock/index.cjs +1 -1
- package/dist/next/blocks/StickyScrollBlock/index.mjs +36 -36
- package/dist/next/blocks/TabsBlock/index.cjs +1 -1
- package/dist/next/blocks/TabsBlock/index.mjs +63 -60
- package/dist/next/cards/BioCard/index.cjs +1 -1
- package/dist/next/cards/BioCard/index.mjs +50 -49
- package/dist/next/cards/BlogArticleCard/index.cjs +1 -1
- package/dist/next/cards/BlogArticleCard/index.mjs +6 -6
- package/dist/next/cards/GridCard/index.cjs +1 -1
- package/dist/next/cards/GridCard/index.mjs +38 -38
- package/dist/next/cards/ProductCard/index.cjs +1 -1
- package/dist/next/cards/ProductCard/index.mjs +9 -9
- package/dist/next/cards/ReviewCard/index.cjs +1 -1
- package/dist/next/cards/ReviewCard/index.mjs +31 -31
- package/dist/next/cards/SegmentCard/index.cjs +1 -1
- package/dist/next/cards/SegmentCard/index.mjs +42 -41
- package/dist/next/cards/SpotlightCard/index.cjs +1 -1
- package/dist/next/cards/SpotlightCard/index.mjs +24 -24
- package/dist/next/cards/TestimonialCard/index.cjs +1 -1
- package/dist/next/cards/TestimonialCard/index.mjs +35 -35
- package/dist/next/ui/PortableTextRenderer/index.cjs +1 -1
- package/dist/next/ui/PortableTextRenderer/index.mjs +17 -17
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("react"),te=require("../Modal/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("react"),te=require("../Modal/index.cjs"),q=require("../../../index-BN6814Bi.cjs"),ie=require("../ButtonGroup/index.cjs"),e=require("../../../NavLink-CuZO2Wm5.cjs"),D=require("../../utils/NoScroll/noScroll.cjs"),G=require("../../../external-link-DDShu-48.cjs"),pe=require("../../../x-Dft9NVe_.cjs"),U=require("../../../createLucideIcon-DpotSgUx.cjs"),Ne=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.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const $e=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["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"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ge=
|
|
6
|
+
*/const $e=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["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"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ge=U.createLucideIcon("earth",$e);/**
|
|
7
7
|
* @license lucide-react v0.488.0 - ISC
|
|
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 we=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],Ce=
|
|
11
|
+
*/const we=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],Ce=U.createLucideIcon("menu",we);/**
|
|
12
12
|
* @license lucide-react v0.488.0 - ISC
|
|
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:m})=>{var t,C,k,p,j,S,x,_,L,M,u;const w=(t=a.image)==null?void 0:t.asset.altText,f=((C=a.callToAction.linkOptions)==null?void 0:C.linkType)==="external";let y="#";return((k=a.callToAction.linkOptions)==null?void 0:k.linkType)==="external"&&((p=a.callToAction.linkOptions)!=null&&p.externalUrl)?y=(j=a.callToAction.linkOptions)==null?void 0:j.externalUrl:((S=a.callToAction.linkOptions)==null?void 0:S.linkType)==="internal"&&((_=(x=a.callToAction.linkOptions)==null?void 0:x.internalUrl)!=null&&_.slug.current)&&(y=`/${(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:m==null?void 0:m(a.title,e.styles.title)}),a.description&&s.jsx("div",{className:e.styles.description,children:m==null?void 0:m(a.description,e.styles.description)})]}),((u=a.callToAction)==null?void 0:u.linkOptions)&&s.jsx("div",{className:e.styles.actions,children:s.jsx(O.CallToAction,{as:"a",variant:a.callToAction.variant??"primary",href:y,target:f?"_blank":"_self",rel:f?"noopener noreferrer":"","aria-label":a.callToAction.ariaLabel||a.callToAction.label,children:a.callToAction.label})})]})};function Ae({renderText:a,title:m,logo:w,items:f,groups:y,utilityItems:t,isSticky:C=!1,showSearch:k=!0,showLocaleSelect:p=!0,alignment:j="right",variant:S="standard",navigationType:x="default",searchComponent:_,localeSelectComponent:L,className:M}){const[u,U]=r.useState(!1),[X,b]=r.useState(null),[ce,re]=r.useState(0),[oe,de]=r.useState(!1),[ue,ye]=r.useState(null),[o,N]=r.useState([]),[E,q]=r.useState(0),[he,H]=r.useState(null),[$,me]=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",{role:"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:"button",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;me(n)};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}},[]);const be=()=>{N([])},fe=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}])},xe=()=>{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"),b(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;ye(c)}},je=l=>{b(n=>n===l?null:l)},Q=r.useCallback(l=>{F.current&&!F.current.contains(l.target)&&b(null)},[]),Y=r.useCallback(()=>{Z(),typeof window<"u"&&window.innerWidth>768&&(U(!1),b(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 u?setTimeout(()=>{I.lockScroll()},0):I.unlockScroll(),()=>I.unlockScroll()},[u]);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),b(h),K(h)},onMouseLeave:()=>{H(null),q(0),b(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;b(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",{role:"menuitem",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:b,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:""} ${y&&y.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:m}),s.jsx("nav",{ref:g,style:{left:j==="center"?`calc(50% - ${ce/2}px)`:"0"},className:`${e.styles.nav} ${u?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:`${ue}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"})}),x==="default"&&f&&s.jsxs("div",{className:e.styles.grid,children:[f&&f.length>0&&R(f),k&&!$&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(B,{})]}),p&&s.jsx(V,{})]}),!$&&x==="advanced"&&y&&s.jsxs("div",{className:e.styles.grid,children:[y.length>0&&ve(y),k&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(B,{})]}),p&&s.jsx(V,{})]}),$&&x==="advanced"&&u&&o.length===0&&y&&s.jsx("div",{className:`${e.styles.mobileMenu}`,children:y.map((l,n)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${A==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:s.jsx("button",{role:"menuitem",className:e.styles.sublinkToggle,onClick:()=>fe(l),children:l.title})},l._key??n))}),$&&x==="advanced"&&u&&o.length>0&&s.jsxs("div",{className:`${e.styles.mobileMenuSlide} `,children:[s.jsx("button",{role:"menuitem",className:e.styles.back,onClick:o.length===1?be:xe,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",{role:"menuitem",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",{role:"menuitem",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,role:"menu","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,role:"menuitem",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",{role:"menu","aria-label":"Utility navigation",className:`${e.styles.utilityMobile} ${u?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,role:"menuitem",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":u?"Close menu":"Open menu","aria-expanded":u,"aria-controls":"main-menu",children:u?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=U.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:m})=>{var t,S,k,p,j,_,x,L,M,E,u,N;const C=(t=a.image)==null?void 0:t.asset.altText,f=((S=a.callToAction.linkOptions)==null?void 0:S.linkType)==="external";let y="#";return((k=a.callToAction.linkOptions)==null?void 0:k.linkType)==="external"&&((p=a.callToAction.linkOptions)!=null&&p.externalUrl)?y=(j=a.callToAction.linkOptions)==null?void 0:j.externalUrl:((_=a.callToAction.linkOptions)==null?void 0:_.linkType)==="internal"&&((L=(x=a.callToAction.linkOptions)==null?void 0:x.internalUrl)!=null&&L.slug.current)&&(y=`/${(E=(M=a.callToAction.linkOptions)==null?void 0:M.internalUrl)==null?void 0:E.slug.current}`),s.jsxs("div",{className:e.styles.spotlight,children:[a.image&&s.jsx("div",{className:e.styles.imageWrapper,children:s.jsx("img",{src:((u=a==null?void 0:a.image.imageUrls)==null?void 0:u.medium)??"",alt:C||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:m==null?void 0:m(a.title,e.styles.title)}),a.description&&s.jsx("div",{className:e.styles.description,children:m==null?void 0:m(a.description,e.styles.description)})]}),((N=a.callToAction)==null?void 0:N.linkOptions)&&s.jsx("div",{className:e.styles.actions,children:s.jsx(q.CallToAction,{as:"a",variant:a.callToAction.variant??"primary",href:y,target:f?"_blank":"_self",rel:f?"noopener noreferrer":"","aria-label":a.callToAction.ariaLabel||a.callToAction.label,children:a.callToAction.label})})]})};function Ae({renderText:a,title:m,logo:C,items:f,groups:y,utilityItems:t,isSticky:S=!1,showSearch:k=!0,showLocaleSelect:p=!0,alignment:j="right",variant:_="standard",navigationType:x="default",searchComponent:L,localeSelectComponent:M,className:E}){const[u,N]=r.useState(!1),[X,b]=r.useState(null),[ce,re]=r.useState(0),[oe,de]=r.useState(!1),[ue,ye]=r.useState(null),[o,$]=r.useState([]),[A,B]=r.useState(0),[he,H]=r.useState(null),[g,me]=r.useState(!1),[T,R]=r.useState("forward"),F=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} ${e.styles.searchWrapper}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(te.Modal,{className:e.styles.searchModal,trigger:s.jsx("button",{role:"button",title:"Search","aria-label":"Search",className:e.styles.search,children:s.jsx(_e,{size:16})}),content:L})})}),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:"button",className:e.styles.locale,children:s.jsx(ge,{size:16})}),content:M})})});r.useEffect(()=>{if(typeof window<"u"){const l=()=>{const n=window.innerWidth<768;me(n)};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}},[]);const be=()=>{$([])},fe=l=>{R("forward"),$([{title:l.title,primary:l.primaryItems??[],secondary:l.secondaryItems??[],description:""}])},J=l=>{R("forward"),$(n=>[...n,{title:l.label,primary:l.sublinks??[],secondary:[],description:l.description}])},xe=()=>{R("backward"),$(l=>l.slice(0,-1))},W=r.useRef(null),w=r.useRef(null),I=r.useRef(new Map),ke=()=>{N(l=>{const n=!l;return n||($([]),R("forward"),b(null)),n})},K=l=>{const n=I.current.get(l);if(n&&w.current){const d=n.getBoundingClientRect(),h=w.current.getBoundingClientRect(),c=d.left-h.left+d.width/2;ye(c)}},je=l=>{b(n=>n===l?null:l)},Q=r.useCallback(l=>{W.current&&!W.current.contains(l.target)&&b(null)},[]),Y=r.useCallback(()=>{Z(),typeof window<"u"&&window.innerWidth>768&&(N(!1),b(null),typeof document<"u"&&(document.body.style.overflow=""))},[]),Z=r.useCallback(()=>{if(w.current){const l=w.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 u?setTimeout(()=>{D.lockScroll()},0):D.unlockScroll(),()=>D.unlockScroll()},[u]);const ve=l=>l.map((n,d)=>{var P,ee,se,le,ne;const h=`group-${d}`,O=he===d,c=(P=n.primaryItems)==null?void 0:P[A??0];return s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{H(d),b(h),K(h)},onMouseLeave:()=>{H(null),B(0),b(null)},children:[s.jsx("div",{className:e.styles.linkItem,children:s.jsxs("button",{ref:i=>{I.current.set(h,i)},role:"menuitem","aria-haspopup":"true","aria-expanded":O,"aria-controls":`submenu-${d}`,className:`${e.styles.sublinkToggle} ${O?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} ${O?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} ${A===v?e.styles.open:""}`,target:i.isExternal?"_blank":"_self",rel:i.isExternal?"noopener noreferrer":void 0,onClick:()=>{var ae;b(null),(ae=i.onClick)==null||ae.call(i)},onMouseEnter:()=>i.sublinks?B(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(G.ExternalLink,{className:e.styles.newTabIcon,size:16})]},i._key??v):s.jsx("button",{role:"menuitem",className:`${e.styles.sublinkToggle} ${A===v?e.styles.open:""}`,onMouseEnter:()=>B(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)&&z(c.sublinks,`${h}-${A}`)]},`${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&&z(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}`)}),z=(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:b,renderLinks:z,buttonRefs:I},d._key??h)});return s.jsx("header",{ref:W,className:`${E??""} ${Me[j]} ${Le[_]} ${e.styles.navbar} ${S?e.styles.sticky:""} ${y&&y.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:[C?s.jsx("div",{className:e.styles.logo,children:C}):s.jsx("div",{className:e.styles.title,children:m}),s.jsx("nav",{ref:w,style:{left:j==="center"?`calc(50% - ${ce/2}px)`:"0"},className:`${e.styles.nav} ${u?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:`${ue}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"})}),x==="default"&&f&&s.jsxs("div",{className:e.styles.grid,children:[f&&f.length>0&&z(f),k&&!g&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(F,{})]}),p&&s.jsx(V,{})]}),!g&&x==="advanced"&&y&&s.jsxs("div",{className:e.styles.grid,children:[y.length>0&&ve(y),k&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator}),s.jsx(F,{})]}),p&&s.jsx(V,{})]}),g&&x==="advanced"&&u&&o.length===0&&y&&s.jsx("div",{className:`${e.styles.mobileMenu}`,children:y.map((l,n)=>s.jsx("div",{className:`${e.styles.mobileMenuItem} ${T==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:s.jsx("button",{role:"menuitem",className:e.styles.sublinkToggle,onClick:()=>fe(l),children:l.title})},l._key??n))}),g&&x==="advanced"&&u&&o.length>0&&s.jsxs("div",{className:`${e.styles.mobileMenuSlide} `,children:[s.jsx("button",{role:"menuitem",className:e.styles.back,onClick:o.length===1?be:xe,children:s.jsx(q.ChevronLeft,{size:18,"aria-hidden":"true",focusable:"false"})}),o[o.length-1].description&&s.jsx("div",{className:`${e.styles.sublinksDescription} ${T==="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} ${T==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:l.sublinks?s.jsx("button",{role:"menuitem",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(G.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} ${T==="forward"?e.styles.fadeInFromLeft:e.styles.fadeInFromRight}`,children:l.sublinks?s.jsx("button",{role:"menuitem",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(G.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,role:"menu","aria-label":"Utility navigation",children:s.jsx(ie.ButtonGroup,{children:t.map((l,n)=>s.jsx(q.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,role:"menuitem",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",{role:"menu","aria-label":"Utility navigation",className:`${e.styles.utilityMobile} ${u?e.styles.open:""}`,children:s.jsx(ie.ButtonGroup,{alignment:"center",children:s.jsx(q.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,role:"menuitem",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:[g&&k&&s.jsx(F,{}),s.jsx("button",{className:e.styles.menuToggle,onClick:ke,"aria-label":u?"Close menu":"Open menu","aria-expanded":u,"aria-controls":"main-menu",children:u?s.jsx(pe.X,{size:24}):s.jsx(Ce,{size:24})})]})]})})}exports.Navbar=Ae;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as a, jsxs as c, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
-
import { useState as b, useEffect as
|
|
2
|
+
import { useState as b, useEffect as I, useRef as G, useCallback as X } from "react";
|
|
3
3
|
import { Modal as te } from "../Modal/index.mjs";
|
|
4
|
-
import { a as Me, C as
|
|
4
|
+
import { a as Me, C as V } from "../../../index-C-E0ib2G.js";
|
|
5
5
|
import { ButtonGroup as de } from "../ButtonGroup/index.mjs";
|
|
6
6
|
import { s as e, N as Ee } from "../../../NavLink-CsNKwUSm.js";
|
|
7
|
-
import { lockScroll as Ae, unlockScroll as
|
|
8
|
-
import { E as
|
|
7
|
+
import { lockScroll as Ae, unlockScroll as me } from "../../utils/NoScroll/noScroll.mjs";
|
|
8
|
+
import { E as H } from "../../../external-link-BOPobeQJ.js";
|
|
9
9
|
import { X as Se } from "../../../x-CnsEH4Ox.js";
|
|
10
|
-
import { c as
|
|
10
|
+
import { c as q } from "../../../createLucideIcon-C8GTh_Qx.js";
|
|
11
11
|
import { C as _e } from "../../../chevron-down-DSUzBz9F.js";
|
|
12
12
|
/**
|
|
13
13
|
* @license lucide-react v0.488.0 - ISC
|
|
@@ -26,7 +26,7 @@ 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
|
-
], Te =
|
|
29
|
+
], Te = q("earth", ze);
|
|
30
30
|
/**
|
|
31
31
|
* @license lucide-react v0.488.0 - ISC
|
|
32
32
|
*
|
|
@@ -37,7 +37,7 @@ 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
|
-
], Re =
|
|
40
|
+
], Re = q("menu", xe);
|
|
41
41
|
/**
|
|
42
42
|
* @license lucide-react v0.488.0 - ISC
|
|
43
43
|
*
|
|
@@ -47,7 +47,7 @@ const xe = [
|
|
|
47
47
|
const Oe = [
|
|
48
48
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
49
49
|
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
|
|
50
|
-
], We =
|
|
50
|
+
], We = q("search", Oe), Fe = {
|
|
51
51
|
standard: e.standard,
|
|
52
52
|
transparent: e.transparent
|
|
53
53
|
}, Be = {
|
|
@@ -58,15 +58,15 @@ const Oe = [
|
|
|
58
58
|
spotlight: i,
|
|
59
59
|
renderText: f
|
|
60
60
|
}) => {
|
|
61
|
-
var s,
|
|
62
|
-
const
|
|
63
|
-
let
|
|
64
|
-
return ((N = i.callToAction.linkOptions) == null ? void 0 : N.linkType) === "external" && ((w = i.callToAction.linkOptions) != null && w.externalUrl) ?
|
|
61
|
+
var s, A, N, w, $, S, p, _, z, T, m, y;
|
|
62
|
+
const E = (s = i.image) == null ? void 0 : s.asset.altText, v = ((A = i.callToAction.linkOptions) == null ? void 0 : A.linkType) === "external";
|
|
63
|
+
let h = "#";
|
|
64
|
+
return ((N = i.callToAction.linkOptions) == null ? void 0 : N.linkType) === "external" && ((w = i.callToAction.linkOptions) != null && w.externalUrl) ? h = ($ = i.callToAction.linkOptions) == null ? void 0 : $.externalUrl : ((S = i.callToAction.linkOptions) == null ? void 0 : S.linkType) === "internal" && ((_ = (p = i.callToAction.linkOptions) == null ? void 0 : p.internalUrl) != null && _.slug.current) && (h = `/${(T = (z = i.callToAction.linkOptions) == null ? void 0 : z.internalUrl) == null ? void 0 : T.slug.current}`), /* @__PURE__ */ c("div", { className: e.spotlight, children: [
|
|
65
65
|
i.image && /* @__PURE__ */ a("div", { className: e.imageWrapper, children: /* @__PURE__ */ a(
|
|
66
66
|
"img",
|
|
67
67
|
{
|
|
68
|
-
src: (i == null ? void 0 : i.image.
|
|
69
|
-
alt:
|
|
68
|
+
src: ((m = i == null ? void 0 : i.image.imageUrls) == null ? void 0 : m.medium) ?? "",
|
|
69
|
+
alt: E || i.image.asset.description || "Content image",
|
|
70
70
|
width: 600,
|
|
71
71
|
height: 400
|
|
72
72
|
}
|
|
@@ -75,12 +75,12 @@ const Oe = [
|
|
|
75
75
|
i.title && /* @__PURE__ */ a("div", { className: e.title, children: f == null ? void 0 : f(i.title, e.title) }),
|
|
76
76
|
i.description && /* @__PURE__ */ a("div", { className: e.description, children: f == null ? void 0 : f(i.description, e.description) })
|
|
77
77
|
] }),
|
|
78
|
-
((
|
|
79
|
-
|
|
78
|
+
((y = i.callToAction) == null ? void 0 : y.linkOptions) && /* @__PURE__ */ a("div", { className: e.actions, children: /* @__PURE__ */ a(
|
|
79
|
+
V,
|
|
80
80
|
{
|
|
81
81
|
as: "a",
|
|
82
82
|
variant: i.callToAction.variant ?? "primary",
|
|
83
|
-
href:
|
|
83
|
+
href: h,
|
|
84
84
|
target: v ? "_blank" : "_self",
|
|
85
85
|
rel: v ? "noopener noreferrer" : "",
|
|
86
86
|
"aria-label": i.callToAction.ariaLabel || i.callToAction.label,
|
|
@@ -92,23 +92,23 @@ const Oe = [
|
|
|
92
92
|
function Ye({
|
|
93
93
|
renderText: i,
|
|
94
94
|
title: f,
|
|
95
|
-
logo:
|
|
95
|
+
logo: E,
|
|
96
96
|
items: v,
|
|
97
|
-
groups:
|
|
97
|
+
groups: h,
|
|
98
98
|
utilityItems: s,
|
|
99
|
-
isSticky:
|
|
99
|
+
isSticky: A = !1,
|
|
100
100
|
showSearch: N = !0,
|
|
101
101
|
showLocaleSelect: w = !0,
|
|
102
102
|
alignment: $ = "right",
|
|
103
|
-
variant:
|
|
103
|
+
variant: S = "standard",
|
|
104
104
|
navigationType: p = "default",
|
|
105
|
-
searchComponent:
|
|
106
|
-
localeSelectComponent:
|
|
107
|
-
className:
|
|
105
|
+
searchComponent: _,
|
|
106
|
+
localeSelectComponent: z,
|
|
107
|
+
className: T
|
|
108
108
|
}) {
|
|
109
|
-
const [
|
|
109
|
+
const [m, y] = b(!1), [J, k] = b(null), [he, ue] = b(0), [be, fe] = b(!1), [ke, ve] = b(null), [t, C] = b([]), [x, B] = b(
|
|
110
110
|
0
|
|
111
|
-
), [pe, K] = b(null), [
|
|
111
|
+
), [pe, K] = b(null), [L, Ne] = b(!1), [R, O] = b("forward"), j = () => /* @__PURE__ */ a(
|
|
112
112
|
"div",
|
|
113
113
|
{
|
|
114
114
|
className: `${e.linkWrapper} ${e.parent} ${e.searchWrapper}`,
|
|
@@ -126,7 +126,7 @@ function Ye({
|
|
|
126
126
|
children: /* @__PURE__ */ a(We, { size: 16 })
|
|
127
127
|
}
|
|
128
128
|
),
|
|
129
|
-
content:
|
|
129
|
+
content: _
|
|
130
130
|
}
|
|
131
131
|
) })
|
|
132
132
|
}
|
|
@@ -144,10 +144,10 @@ function Ye({
|
|
|
144
144
|
children: /* @__PURE__ */ a(Te, { size: 16 })
|
|
145
145
|
}
|
|
146
146
|
),
|
|
147
|
-
content:
|
|
147
|
+
content: z
|
|
148
148
|
}
|
|
149
149
|
) }) });
|
|
150
|
-
|
|
150
|
+
I(() => {
|
|
151
151
|
if (typeof window < "u") {
|
|
152
152
|
const n = () => {
|
|
153
153
|
const l = window.innerWidth < 768;
|
|
@@ -157,9 +157,9 @@ function Ye({
|
|
|
157
157
|
}
|
|
158
158
|
}, []);
|
|
159
159
|
const $e = () => {
|
|
160
|
-
|
|
160
|
+
C([]);
|
|
161
161
|
}, ge = (n) => {
|
|
162
|
-
|
|
162
|
+
O("forward"), C([
|
|
163
163
|
{
|
|
164
164
|
title: n.title,
|
|
165
165
|
primary: n.primaryItems ?? [],
|
|
@@ -168,7 +168,7 @@ function Ye({
|
|
|
168
168
|
}
|
|
169
169
|
]);
|
|
170
170
|
}, Y = (n) => {
|
|
171
|
-
|
|
171
|
+
O("forward"), C((l) => [
|
|
172
172
|
...l,
|
|
173
173
|
{
|
|
174
174
|
title: n.label,
|
|
@@ -178,44 +178,44 @@ function Ye({
|
|
|
178
178
|
}
|
|
179
179
|
]);
|
|
180
180
|
}, we = () => {
|
|
181
|
-
|
|
182
|
-
},
|
|
183
|
-
|
|
181
|
+
O("backward"), C((n) => n.slice(0, -1));
|
|
182
|
+
}, D = G(null), M = G(null), U = G(/* @__PURE__ */ new Map()), ye = () => {
|
|
183
|
+
y((n) => {
|
|
184
184
|
const l = !n;
|
|
185
|
-
return l || (
|
|
185
|
+
return l || (C([]), O("forward"), k(null)), l;
|
|
186
186
|
});
|
|
187
187
|
}, Z = (n) => {
|
|
188
|
-
const l =
|
|
189
|
-
if (l &&
|
|
190
|
-
const d = l.getBoundingClientRect(), u =
|
|
188
|
+
const l = U.current.get(n);
|
|
189
|
+
if (l && M.current) {
|
|
190
|
+
const d = l.getBoundingClientRect(), u = M.current.getBoundingClientRect(), o = d.left - u.left + d.width / 2;
|
|
191
191
|
ve(o);
|
|
192
192
|
}
|
|
193
193
|
}, Ce = (n) => {
|
|
194
194
|
k((l) => l === n ? null : n);
|
|
195
|
-
}, P =
|
|
196
|
-
|
|
197
|
-
}, []), ee =
|
|
198
|
-
ne(), typeof window < "u" && window.innerWidth > 768 && (
|
|
199
|
-
}, []), ne =
|
|
200
|
-
if (
|
|
201
|
-
const n =
|
|
195
|
+
}, P = X((n) => {
|
|
196
|
+
D.current && !D.current.contains(n.target) && k(null);
|
|
197
|
+
}, []), ee = X(() => {
|
|
198
|
+
ne(), typeof window < "u" && window.innerWidth > 768 && (y(!1), k(null), typeof document < "u" && (document.body.style.overflow = ""));
|
|
199
|
+
}, []), ne = X(() => {
|
|
200
|
+
if (M.current) {
|
|
201
|
+
const n = M.current.getBoundingClientRect().width;
|
|
202
202
|
ue(n), fe(!0);
|
|
203
203
|
}
|
|
204
204
|
}, []);
|
|
205
|
-
|
|
205
|
+
I(() => {
|
|
206
206
|
const n = typeof window < "u", l = typeof document < "u";
|
|
207
207
|
return n && window.addEventListener("resize", ee), l && document.addEventListener("click", P), ne(), () => {
|
|
208
208
|
n && window.removeEventListener("resize", ee), l && document.removeEventListener("click", P);
|
|
209
209
|
};
|
|
210
|
-
}, []),
|
|
210
|
+
}, []), I(() => {
|
|
211
211
|
if (typeof document < "u")
|
|
212
|
-
return
|
|
212
|
+
return m ? setTimeout(() => {
|
|
213
213
|
Ae();
|
|
214
|
-
}, 0) :
|
|
215
|
-
}, [
|
|
214
|
+
}, 0) : me(), () => me();
|
|
215
|
+
}, [m]);
|
|
216
216
|
const Le = (n) => n.map((l, d) => {
|
|
217
217
|
var ae, le, ie, se, ce;
|
|
218
|
-
const u = `group-${d}`,
|
|
218
|
+
const u = `group-${d}`, F = pe === d, o = (ae = l.primaryItems) == null ? void 0 : ae[x ?? 0];
|
|
219
219
|
return /* @__PURE__ */ c(
|
|
220
220
|
"div",
|
|
221
221
|
{
|
|
@@ -224,20 +224,20 @@ function Ye({
|
|
|
224
224
|
K(d), k(u), Z(u);
|
|
225
225
|
},
|
|
226
226
|
onMouseLeave: () => {
|
|
227
|
-
K(null),
|
|
227
|
+
K(null), B(0), k(null);
|
|
228
228
|
},
|
|
229
229
|
children: [
|
|
230
230
|
/* @__PURE__ */ a("div", { className: e.linkItem, children: /* @__PURE__ */ c(
|
|
231
231
|
"button",
|
|
232
232
|
{
|
|
233
233
|
ref: (r) => {
|
|
234
|
-
|
|
234
|
+
U.current.set(u, r);
|
|
235
235
|
},
|
|
236
236
|
role: "menuitem",
|
|
237
237
|
"aria-haspopup": "true",
|
|
238
|
-
"aria-expanded":
|
|
238
|
+
"aria-expanded": F,
|
|
239
239
|
"aria-controls": `submenu-${d}`,
|
|
240
|
-
className: `${e.sublinkToggle} ${
|
|
240
|
+
className: `${e.sublinkToggle} ${F ? e.open : ""} `,
|
|
241
241
|
children: [
|
|
242
242
|
l.title,
|
|
243
243
|
/* @__PURE__ */ a(_e, { size: 18, className: e.chevron })
|
|
@@ -248,7 +248,7 @@ function Ye({
|
|
|
248
248
|
"div",
|
|
249
249
|
{
|
|
250
250
|
id: `submenu-${d}`,
|
|
251
|
-
className: `${e.sublinks} ${
|
|
251
|
+
className: `${e.sublinks} ${F ? e.show : ""}`,
|
|
252
252
|
role: "menu",
|
|
253
253
|
"aria-label": `${l.title} submenu`,
|
|
254
254
|
children: /* @__PURE__ */ a("div", { children: /* @__PURE__ */ c(
|
|
@@ -267,14 +267,14 @@ function Ye({
|
|
|
267
267
|
"a",
|
|
268
268
|
{
|
|
269
269
|
href: r.href,
|
|
270
|
-
className: `${e.link} ${
|
|
270
|
+
className: `${e.link} ${x === g ? e.open : ""}`,
|
|
271
271
|
target: r.isExternal ? "_blank" : "_self",
|
|
272
272
|
rel: r.isExternal ? "noopener noreferrer" : void 0,
|
|
273
273
|
onClick: () => {
|
|
274
274
|
var re;
|
|
275
275
|
k(null), (re = r.onClick) == null || re.call(r);
|
|
276
276
|
},
|
|
277
|
-
onMouseEnter: () => r.sublinks ?
|
|
277
|
+
onMouseEnter: () => r.sublinks ? B(g) : null,
|
|
278
278
|
role: "menuitem",
|
|
279
279
|
children: [
|
|
280
280
|
/* @__PURE__ */ c("span", { className: e.linkContent, children: [
|
|
@@ -282,7 +282,7 @@ function Ye({
|
|
|
282
282
|
r.subtitle && /* @__PURE__ */ a("span", { className: e.subtitle, children: r.subtitle })
|
|
283
283
|
] }),
|
|
284
284
|
r.isExternal && /* @__PURE__ */ a(
|
|
285
|
-
|
|
285
|
+
H,
|
|
286
286
|
{
|
|
287
287
|
className: e.newTabIcon,
|
|
288
288
|
size: 16
|
|
@@ -295,8 +295,8 @@ function Ye({
|
|
|
295
295
|
"button",
|
|
296
296
|
{
|
|
297
297
|
role: "menuitem",
|
|
298
|
-
className: `${e.sublinkToggle} ${
|
|
299
|
-
onMouseEnter: () =>
|
|
298
|
+
className: `${e.sublinkToggle} ${x === g ? e.open : ""}`,
|
|
299
|
+
onMouseEnter: () => B(g),
|
|
300
300
|
children: /* @__PURE__ */ c("span", { className: e.linkContent, children: [
|
|
301
301
|
r.label,
|
|
302
302
|
r.subtitle && /* @__PURE__ */ a("span", { className: e.subtitle, children: r.subtitle })
|
|
@@ -317,9 +317,9 @@ function Ye({
|
|
|
317
317
|
/* @__PURE__ */ a("p", { children: "TEXT HERE" }),
|
|
318
318
|
i == null ? void 0 : i(o.description)
|
|
319
319
|
] }),
|
|
320
|
-
(o == null ? void 0 : o.sublinks) &&
|
|
320
|
+
(o == null ? void 0 : o.sublinks) && W(
|
|
321
321
|
o.sublinks,
|
|
322
|
-
`${u}-${
|
|
322
|
+
`${u}-${x}`
|
|
323
323
|
)
|
|
324
324
|
]
|
|
325
325
|
},
|
|
@@ -329,7 +329,7 @@ function Ye({
|
|
|
329
329
|
"div",
|
|
330
330
|
{
|
|
331
331
|
className: `${e.sublinksColumn} ${e.secondaryColumn}`,
|
|
332
|
-
children: l.secondaryItems && l.secondaryItems.length > 0 &&
|
|
332
|
+
children: l.secondaryItems && l.secondaryItems.length > 0 && W(l.secondaryItems, `${u}-secondary`)
|
|
333
333
|
}
|
|
334
334
|
),
|
|
335
335
|
l.spotlight && /* @__PURE__ */ a(
|
|
@@ -354,7 +354,7 @@ function Ye({
|
|
|
354
354
|
},
|
|
355
355
|
l._key ?? `group-${d}`
|
|
356
356
|
);
|
|
357
|
-
}),
|
|
357
|
+
}), W = (n, l = "") => n.map((d) => {
|
|
358
358
|
const u = `${l}/${d.label}`;
|
|
359
359
|
return /* @__PURE__ */ a(
|
|
360
360
|
Ee,
|
|
@@ -366,8 +366,8 @@ function Ye({
|
|
|
366
366
|
togglePath: Ce,
|
|
367
367
|
updateTriangleIndicator: Z,
|
|
368
368
|
setOpenPath: k,
|
|
369
|
-
renderLinks:
|
|
370
|
-
buttonRefs:
|
|
369
|
+
renderLinks: W,
|
|
370
|
+
buttonRefs: U
|
|
371
371
|
},
|
|
372
372
|
d._key ?? u
|
|
373
373
|
);
|
|
@@ -375,23 +375,23 @@ function Ye({
|
|
|
375
375
|
return /* @__PURE__ */ a(
|
|
376
376
|
"header",
|
|
377
377
|
{
|
|
378
|
-
ref:
|
|
379
|
-
className: `${
|
|
378
|
+
ref: D,
|
|
379
|
+
className: `${T ?? ""} ${Be[$]} ${Fe[S]} ${e.navbar} ${A ? e.sticky : ""} ${h && h.length ? e.advanced : e.default}`,
|
|
380
380
|
"aria-label": "Main navigation",
|
|
381
381
|
children: /* @__PURE__ */ c(
|
|
382
382
|
"div",
|
|
383
383
|
{
|
|
384
384
|
className: `${e.container} ${(!s || s.length === 0) && $ !== "center" ? e.twoColumn : ""}`,
|
|
385
385
|
children: [
|
|
386
|
-
|
|
386
|
+
E ? /* @__PURE__ */ a("div", { className: e.logo, children: E }) : /* @__PURE__ */ a("div", { className: e.title, children: f }),
|
|
387
387
|
/* @__PURE__ */ a(
|
|
388
388
|
"nav",
|
|
389
389
|
{
|
|
390
|
-
ref:
|
|
390
|
+
ref: M,
|
|
391
391
|
style: {
|
|
392
|
-
left: $ === "center" ? `calc(50% - ${
|
|
392
|
+
left: $ === "center" ? `calc(50% - ${he / 2}px)` : "0"
|
|
393
393
|
},
|
|
394
|
-
className: `${e.nav} ${
|
|
394
|
+
className: `${e.nav} ${m ? e.open : ""} ${be ? e.visible : e.hidden}`,
|
|
395
395
|
id: "main-menu",
|
|
396
396
|
role: "menubar",
|
|
397
397
|
"aria-label": "Main navigation",
|
|
@@ -417,25 +417,25 @@ function Ye({
|
|
|
417
417
|
}
|
|
418
418
|
),
|
|
419
419
|
p === "default" && v && /* @__PURE__ */ c("div", { className: e.grid, children: [
|
|
420
|
-
v && v.length > 0 &&
|
|
421
|
-
N && !
|
|
420
|
+
v && v.length > 0 && W(v),
|
|
421
|
+
N && !L && /* @__PURE__ */ c(oe, { children: [
|
|
422
422
|
/* @__PURE__ */ a("span", { className: e.separator }),
|
|
423
|
-
/* @__PURE__ */ a(
|
|
423
|
+
/* @__PURE__ */ a(j, {})
|
|
424
424
|
] }),
|
|
425
425
|
w && /* @__PURE__ */ a(Q, {})
|
|
426
426
|
] }),
|
|
427
|
-
!
|
|
428
|
-
|
|
427
|
+
!L && p === "advanced" && h && /* @__PURE__ */ c("div", { className: e.grid, children: [
|
|
428
|
+
h.length > 0 && Le(h),
|
|
429
429
|
N && /* @__PURE__ */ c(oe, { children: [
|
|
430
430
|
/* @__PURE__ */ a("span", { className: e.separator }),
|
|
431
|
-
/* @__PURE__ */ a(
|
|
431
|
+
/* @__PURE__ */ a(j, {})
|
|
432
432
|
] }),
|
|
433
433
|
w && /* @__PURE__ */ a(Q, {})
|
|
434
434
|
] }),
|
|
435
|
-
|
|
435
|
+
L && p === "advanced" && m && t.length === 0 && h && /* @__PURE__ */ a("div", { className: `${e.mobileMenu}`, children: h.map((n, l) => /* @__PURE__ */ a(
|
|
436
436
|
"div",
|
|
437
437
|
{
|
|
438
|
-
className: `${e.mobileMenuItem} ${
|
|
438
|
+
className: `${e.mobileMenuItem} ${R === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
|
|
439
439
|
children: /* @__PURE__ */ a(
|
|
440
440
|
"button",
|
|
441
441
|
{
|
|
@@ -448,7 +448,7 @@ function Ye({
|
|
|
448
448
|
},
|
|
449
449
|
n._key ?? l
|
|
450
450
|
)) }),
|
|
451
|
-
|
|
451
|
+
L && p === "advanced" && m && t.length > 0 && /* @__PURE__ */ c(
|
|
452
452
|
"div",
|
|
453
453
|
{
|
|
454
454
|
className: `${e.mobileMenuSlide} `,
|
|
@@ -472,7 +472,7 @@ function Ye({
|
|
|
472
472
|
t[t.length - 1].description && /* @__PURE__ */ a(
|
|
473
473
|
"div",
|
|
474
474
|
{
|
|
475
|
-
className: `${e.sublinksDescription} ${
|
|
475
|
+
className: `${e.sublinksDescription} ${R === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
|
|
476
476
|
children: i == null ? void 0 : i(
|
|
477
477
|
t[t.length - 1].description
|
|
478
478
|
)
|
|
@@ -481,7 +481,7 @@ function Ye({
|
|
|
481
481
|
t[t.length - 1].primary.map((n, l) => /* @__PURE__ */ a(
|
|
482
482
|
"div",
|
|
483
483
|
{
|
|
484
|
-
className: `${e.mobileMenuItem} ${
|
|
484
|
+
className: `${e.mobileMenuItem} ${R === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
|
|
485
485
|
children: n.sublinks ? /* @__PURE__ */ a(
|
|
486
486
|
"button",
|
|
487
487
|
{
|
|
@@ -507,7 +507,7 @@ function Ye({
|
|
|
507
507
|
n.subtitle && /* @__PURE__ */ a("span", { className: e.subtitle, children: n.subtitle })
|
|
508
508
|
] }),
|
|
509
509
|
n.isExternal && /* @__PURE__ */ a(
|
|
510
|
-
|
|
510
|
+
H,
|
|
511
511
|
{
|
|
512
512
|
className: e.newTabIcon,
|
|
513
513
|
size: 16
|
|
@@ -524,7 +524,7 @@ function Ye({
|
|
|
524
524
|
(n, l) => /* @__PURE__ */ a(
|
|
525
525
|
"div",
|
|
526
526
|
{
|
|
527
|
-
className: `${e.mobileMenuItem} ${
|
|
527
|
+
className: `${e.mobileMenuItem} ${R === "forward" ? e.fadeInFromLeft : e.fadeInFromRight}`,
|
|
528
528
|
children: n.sublinks ? /* @__PURE__ */ a(
|
|
529
529
|
"button",
|
|
530
530
|
{
|
|
@@ -544,7 +544,7 @@ function Ye({
|
|
|
544
544
|
children: [
|
|
545
545
|
n.label,
|
|
546
546
|
n.isExternal && /* @__PURE__ */ a(
|
|
547
|
-
|
|
547
|
+
H,
|
|
548
548
|
{
|
|
549
549
|
className: e.newTabIcon,
|
|
550
550
|
size: 16
|
|
@@ -571,7 +571,7 @@ function Ye({
|
|
|
571
571
|
role: "menu",
|
|
572
572
|
"aria-label": "Utility navigation",
|
|
573
573
|
children: /* @__PURE__ */ a(de, { children: s.map((n, l) => /* @__PURE__ */ a(
|
|
574
|
-
|
|
574
|
+
V,
|
|
575
575
|
{
|
|
576
576
|
as: "a",
|
|
577
577
|
href: n.href ?? "/",
|
|
@@ -600,9 +600,9 @@ function Ye({
|
|
|
600
600
|
{
|
|
601
601
|
role: "menu",
|
|
602
602
|
"aria-label": "Utility navigation",
|
|
603
|
-
className: `${e.utilityMobile} ${
|
|
603
|
+
className: `${e.utilityMobile} ${m ? e.open : ""}`,
|
|
604
604
|
children: /* @__PURE__ */ a(de, { alignment: "center", children: /* @__PURE__ */ a(
|
|
605
|
-
|
|
605
|
+
V,
|
|
606
606
|
{
|
|
607
607
|
as: "a",
|
|
608
608
|
href: s[1].href ?? "/",
|
|
@@ -626,16 +626,16 @@ function Ye({
|
|
|
626
626
|
}
|
|
627
627
|
),
|
|
628
628
|
/* @__PURE__ */ c("div", { className: e.mobileButtons, children: [
|
|
629
|
-
|
|
629
|
+
L && N && /* @__PURE__ */ a(j, {}),
|
|
630
630
|
/* @__PURE__ */ a(
|
|
631
631
|
"button",
|
|
632
632
|
{
|
|
633
633
|
className: e.menuToggle,
|
|
634
634
|
onClick: ye,
|
|
635
|
-
"aria-label":
|
|
636
|
-
"aria-expanded":
|
|
635
|
+
"aria-label": m ? "Close menu" : "Open menu",
|
|
636
|
+
"aria-expanded": m,
|
|
637
637
|
"aria-controls": "main-menu",
|
|
638
|
-
children:
|
|
638
|
+
children: m ? /* @__PURE__ */ a(Se, { size: 24 }) : /* @__PURE__ */ a(Re, { size: 24 })
|
|
639
639
|
}
|
|
640
640
|
)
|
|
641
641
|
] })
|
package/dist/core.d.ts
CHANGED
package/dist/main.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index14.css');const s=require("react/jsx-runtime"),l=require("../../ui/PortableTextRenderer/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index14.css');const s=require("react/jsx-runtime"),l=require("../../ui/PortableTextRenderer/index.cjs"),V=require("../../ui/CallToActions/index.cjs"),W=require("next/image"),y=require("../../hooks/useStyleClasses.cjs"),N="_content_ivubr_1",H="_container_ivubr_7",$="_metrics_ivubr_34",B="_metric_ivubr_34",C="_metricValue_ivubr_50",k="_disclaimer_ivubr_71",w="_layoutHImageRight_ivubr_76",R="_heading_ivubr_80",z="_image_ivubr_85",g="_noImage_ivubr_95",T="_layoutHImageLeft_ivubr_99",q="_layoutVImageTop_ivubr_118",L="_layoutVImageBottom_ivubr_131",S="_title_ivubr_151",D="_text_ivubr_156",U="_cta_ivubr_170",P="_headingHorizontal_ivubr_178",F="_titleWrapper_ivubr_187",M="_headingVertical_ivubr_208",Y="_videoWrapper_ivubr_229",E="_maxWidth_ivubr_257",G="_fullBleed_ivubr_267",e={content:N,container:H,metrics:$,metric:B,metricValue:C,disclaimer:k,layoutHImageRight:w,heading:R,image:z,noImage:g,layoutHImageLeft:T,layoutVImageTop:q,layoutVImageBottom:L,title:S,text:D,cta:U,headingHorizontal:P,titleWrapper:F,headingVertical:M,videoWrapper:Y,default:"_default_ivubr_249",maxWidth:E,fullBleed:G};function J({layout:r,heading:i,image:t,video:o,metrics:u,callToAction:c,disclaimer:_,styleOptions:a}){var m;const h=y.useStyleClasses(a),d={"--container-max-width":(a==null?void 0:a.maxWidth)??"unset","--gap":r==null?void 0:r.gap},v={"--max-width":(t==null?void 0:t.display)==="max-width"?t==null?void 0:t.maxWidth:"unset"},b={"no-image":e.noImage,"horizontal-image-right":e.layoutHImageRight,"horizontal-image-left":e.layoutHImageLeft,"vertical-image-top":e.layoutVImageTop,"vertical-image-bottom":e.layoutVImageBottom}[(r==null?void 0:r.orientation)??"horizontal-image-right"],p={horizontal:e.headingHorizontal,vertical:e.headingVertical}[i.headingLayout??"horizontal"],f={default:e.default,"max-width":e.maxWidth,"full-bleed":e.fullBleed}[(t==null?void 0:t.display)??"default"],j=()=>{var x;if(!o)return null;const n=o.includes("vimeo.com"),I=o.includes("youtube.com")||o.includes("youtu.be");return n||I?s.jsx("div",{style:{maxWidth:(t==null?void 0:t.maxWidth)??"unset",flex:.65},children:s.jsx("div",{className:e.videoWrapper,children:s.jsx("iframe",{src:n?`${o}?autoplay=0&muted=0&loop=0`:`${o}?autoplay=0&mute=0&loop=0}`,allow:"autoplay; fullscreen",allowFullScreen:!0})})}):s.jsx("div",{style:{maxWidth:(t==null?void 0:t.maxWidth)??"unset",width:"100%",flex:.65},children:s.jsx("div",{className:e.videoWrapper,children:s.jsx("video",{src:o,controls:!0,poster:((x=t==null?void 0:t.imageUrls)==null?void 0:x.medium)||void 0})})})};return s.jsx("section",{className:`${h} ${e.content}`,children:s.jsxs("article",{className:`${e.container} ${b}`,style:d||{},children:[s.jsxs("div",{className:`${e.heading} ${p}`,children:[s.jsxs("div",{className:e.titleWrapper,children:[i.eyebrow&&s.jsx(l.RichText,{blocks:i.eyebrow}),i.title&&s.jsx(l.RichText,{className:e.title,blocks:i.title})]}),((i==null?void 0:i.description)||(c==null?void 0:c.items))&&s.jsxs("div",{className:e.text,children:[i.description&&s.jsx(l.RichText,{blocks:i.description}),u&&s.jsx("div",{className:e.metrics,children:u.map(n=>s.jsxs("div",{className:e.metric,children:[s.jsx("div",{className:e.metricValue,children:n.metricValue}),n.metricDescription&&s.jsx(l.RichText,{blocks:n.metricDescription})]},n._key))}),c&&s.jsx(V.CallToActions,{className:e.cta,items:c.items,alignment:c.alignment}),_&&s.jsx(l.RichText,{className:e.disclaimer,blocks:_})]})]}),(r==null?void 0:r.orientation)!=="no-image"&&o?j():(r==null?void 0:r.orientation)!=="no-image"&&t&&t.imageUrls&&s.jsx("div",{className:`${e.image} ${f}`,style:v,children:s.jsx(W,{src:(m=t==null?void 0:t.imageUrls)==null?void 0:m.medium,alt:(t==null?void 0:t.asset.altText)||(t==null?void 0:t.asset.description)||"Content image",width:600,height:400,priority:!0})})]})})}exports.ContentBlock=J;
|