quirk-ui 0.0.520 → 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/Avatar/index.cjs +1 -1
- package/dist/core/components/Avatar/index.mjs +19 -10
- 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 +65 -57
- package/dist/next/blocks/HeroBlock/index.cjs +1 -1
- package/dist/next/blocks/HeroBlock/index.mjs +2 -2
- 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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index34.css');const i=require("react/jsx-runtime"),u="_avatar_1ihs2_1",
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index34.css');const i=require("react/jsx-runtime"),u="_avatar_1ihs2_1",h="_sm_1ihs2_17",d="_md_1ihs2_23",g="_lg_1ihs2_29",f="_xl_1ihs2_35",v="_image_1ihs2_41",b="_initials_1ihs2_48",x="_status_1ihs2_53",y="_online_1ihs2_65",$="_offline_1ihs2_69",j="_busy_1ihs2_73",s={avatar:u,sm:h,md:d,lg:g,xl:f,image:v,initials:b,status:x,online:y,offline:$,busy:j},p={sm:s.sm,md:s.md,lg:s.lg,xl:s.xl},N={online:s.online,offline:s.offline,busy:s.busy};function M({src:a,alt:t="User avatar",size:o="md",initials:_,status:n,borderColor:c,backgroundColor:r,onClick:e,className:m}){const l=!!e;return i.jsxs("div",{className:`${m??""} ${s.avatar} ${p[o]}`,style:{borderColor:c,backgroundColor:r},onClick:e,role:l?"button":void 0,"aria-label":l?t:void 0,children:[a?i.jsx("img",{src:a,alt:t,width:80,height:80,className:s.image}):i.jsx("span",{className:s.initials,children:_}),n&&i.jsx("span",{className:`${s.status} ${N[n]}`,role:"status"})]})}exports.Avatar=M;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import '../../../assets/index34.css';const u = "_avatar_1ihs2_1",
|
|
1
|
+
import { jsxs as r, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import '../../../assets/index34.css';const u = "_avatar_1ihs2_1", d = "_sm_1ihs2_17", f = "_md_1ihs2_23", g = "_lg_1ihs2_29", v = "_xl_1ihs2_35", b = "_image_1ihs2_41", x = "_initials_1ihs2_48", y = "_status_1ihs2_53", p = "_online_1ihs2_65", $ = "_offline_1ihs2_69", N = "_busy_1ihs2_73", s = {
|
|
3
3
|
avatar: u,
|
|
4
|
-
sm:
|
|
5
|
-
md:
|
|
4
|
+
sm: d,
|
|
5
|
+
md: f,
|
|
6
6
|
lg: g,
|
|
7
7
|
xl: v,
|
|
8
8
|
image: b,
|
|
@@ -21,7 +21,7 @@ import '../../../assets/index34.css';const u = "_avatar_1ihs2_1", f = "_sm_1ihs2
|
|
|
21
21
|
offline: s.offline,
|
|
22
22
|
busy: s.busy
|
|
23
23
|
};
|
|
24
|
-
function
|
|
24
|
+
function w({
|
|
25
25
|
src: a,
|
|
26
26
|
alt: t = "User avatar",
|
|
27
27
|
size: _ = "md",
|
|
@@ -30,19 +30,28 @@ function z({
|
|
|
30
30
|
borderColor: m,
|
|
31
31
|
backgroundColor: c,
|
|
32
32
|
onClick: l,
|
|
33
|
-
className:
|
|
33
|
+
className: h
|
|
34
34
|
}) {
|
|
35
35
|
const o = !!l;
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ r(
|
|
37
37
|
"div",
|
|
38
38
|
{
|
|
39
|
-
className: `${
|
|
39
|
+
className: `${h ?? ""} ${s.avatar} ${j[_]}`,
|
|
40
40
|
style: { borderColor: m, backgroundColor: c },
|
|
41
41
|
onClick: l,
|
|
42
42
|
role: o ? "button" : void 0,
|
|
43
43
|
"aria-label": o ? t : void 0,
|
|
44
44
|
children: [
|
|
45
|
-
a ? /* @__PURE__ */ i(
|
|
45
|
+
a ? /* @__PURE__ */ i(
|
|
46
|
+
"img",
|
|
47
|
+
{
|
|
48
|
+
src: a,
|
|
49
|
+
alt: t,
|
|
50
|
+
width: 80,
|
|
51
|
+
height: 80,
|
|
52
|
+
className: s.image
|
|
53
|
+
}
|
|
54
|
+
) : /* @__PURE__ */ i("span", { className: s.initials, children: e }),
|
|
46
55
|
n && /* @__PURE__ */ i(
|
|
47
56
|
"span",
|
|
48
57
|
{
|
|
@@ -55,5 +64,5 @@ function z({
|
|
|
55
64
|
);
|
|
56
65
|
}
|
|
57
66
|
export {
|
|
58
|
-
|
|
67
|
+
w as Avatar
|
|
59
68
|
};
|
|
@@ -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;
|