@stackshift-ui/navigation 6.1.0-alpha.8 → 6.1.0-alpha.9
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/chunk-2KK4WBIF.mjs +1 -0
- package/dist/{chunk-TCOSJJF3.mjs → chunk-7PZN5XLN.mjs} +1 -1
- package/dist/chunk-Z3RUBMRD.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/navigation.mjs +1 -1
- package/dist/navigation_f.mjs +1 -1
- package/dist/navigation_g.mjs +1 -1
- package/dist/navigation_h.mjs +1 -1
- package/package.json +9 -9
- package/src/navigation_f.tsx +0 -2
- package/src/navigation_h.tsx +0 -2
- package/dist/chunk-3DKGUYHM.mjs +0 -1
- package/dist/chunk-UTHMMDZO.mjs +0 -1
- package/dist/context/megaNavContext.d.ts +0 -14
- package/dist/context/megaNavContext.mjs +0 -1
- /package/dist/{chunk-YUX52K5B.mjs → chunk-ISJJGULA.mjs} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as y}from"./chunk-S35O64PB.mjs";import{Image as T}from"@stackshift-ui/image";import{Link as w}from"@stackshift-ui/link";import{Section as z}from"@stackshift-ui/section";import{SocialIcons as H}from"@stackshift-ui/social-icons";import P,{Fragment as j,useState as R}from"react";import{BsChevronDown as C}from"react-icons/bs";import{animated as S,useSpring as _}from"@react-spring/web";import{useWindowScroll as B}from"@uidotdev/usehooks";import{Fragment as I,jsx as a,jsxs as c}from"react/jsx-runtime";var n="small-text-style group-hover:text-white hover:text-white relative after:content-[''] after:w-0 hover:after:w-full h-5 !outline-none after:h-[0.5px] after:bg-white after:absolute after:bottom-0 after:left-0 after:transition-all after:duration-300";function D({logo:e,socialMedia:o,dropdownMenu:r}){let[t,d]=R(!1),[s,u]=P.useState(!1),[m,f]=R(null),[v,i]=R(!1),x=()=>{u(N=>!N),s?document.body.style.overflow="unset":document.body.style.overflow="hidden"},g=_({transform:s?"translate(9px, 32px) rotate(-45deg) scaleX(1.5)":"translate(17px, 17px) rotate(0deg) scaleX(1)"}),p=_({transform:s?"translate(12px, 11px) rotate(45deg)":"translate(7px, 27px) rotate(0deg)"}),[{x:A,y:h}]=B(),L=h&&h>5?"bg-black fixed top-0":"fixed bg-transparent",$=h&&h>5,b=N=>{N&&f(m===N?null:N)},M=N=>{i(N)};return a(z,{className:"!px-0 w-full flex flex-col absolute top-0 z-50",children:c("nav",{className:`w-full z-50 md:gap-2 gap-0 hover:bg-black/80 transition-colors duration-300 ${t?"!bg-black border-b-white":"border-b-transparent"} ${L}`,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:[a("div",{className:"w-full z-10 px-4",children:c("div",{className:"w-full flex flex-wrap justify-between items-center py-6",children:[c("div",{className:"flex items-center space-x-[50px]",children:[a(F,{logo:e}),a(O,{dropdownMenu:r,isNavHovered:v,setShowDropdown:d})]}),a(q,{menu:s,showMenu:x,firstLine:g,secondLine:p,isNavHovered:v})]})}),a(G,{menu:s,showMenu:x,dropdownMenu:r,logo:e,openAccordion:m,toggleAccordion:b,socialMedia:o})]})})}function F({logo:e}){var o;return a("div",{className:"w-[200px] relative z-20",children:(e==null?void 0:e.image)&&a(w,{"aria-label":`Go to ${y(e)}`,className:"text-3xl font-bold leading-none",href:y(e),children:a(T,{className:"md:h-[75px]",src:e==null?void 0:e.image,alt:(o=e==null?void 0:e.alt)!=null?o:"navigation-logo",width:100,height:100})})})}function O({dropdownMenu:e,isNavHovered:o,setShowDropdown:r}){return!e||(e==null?void 0:e.length)===0?null:a(j,{children:e&&(e==null?void 0:e.length)>0&&a("ul",{className:"hidden lg:flex flex-wrap space-x-[50px] xl:min-w-max",children:e==null?void 0:e.map(t=>a(P.Fragment,{children:(t==null?void 0:t.label)&&(t==null?void 0:t._key)&&a("li",{className:"static z-20 hover:z-10",children:(t==null?void 0:t.routeType)==="singleRoute"?a(l,{link:t,style:`${n} ${o?"text-white":"text-black"}`}):(t==null?void 0:t.routeType)==="multipleRoute"?a(E,{link:t,isNavHovered:o,onHover:()=>r(!0),onLeave:()=>r(!1)}):a("span",{className:`${n} ${o?"text-white":"text-black"}`,children:t==null?void 0:t.label})})},t._key))})})}function l({link:e,style:o=n}){var r,t,d,s,u,m,f;return a(I,{children:e.linkType==="linkInternal"?a(w,{"aria-label":`Navigation ${(r=e==null?void 0:e.label)!=null?r:"Menu"} links which directs to ${(e==null?void 0:e.internalLink)===void 0?"page-not-found":e==null?void 0:e.internalLink}`,className:o,target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",href:`${((t=e.internalLink)==null?void 0:t.toLowerCase())==="home"?"/":`${e.internalLink?e==null?void 0:e.internalLink:"page-not-found"}`}`,children:e==null?void 0:e.label}):(e==null?void 0:e.linkType)==="linkText"&&((d=e==null?void 0:e.linkText)==null?void 0:d.slice(0,1))!=="/"?a("a",{href:e!=null&&e.linkText?e==null?void 0:e.linkText:"link-not-found","aria-label":`Navigation ${(s=e==null?void 0:e.label)!=null?s:"Menu"} links which directs to ${(e==null?void 0:e.linkText)===void 0?"link-not-found":e==null?void 0:e.linkText}`,className:o,target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:e==null?void 0:e.label}):(e==null?void 0:e.linkType)==="linkText"&&((u=e==null?void 0:e.linkText)==null?void 0:u.slice(0,1))==="/"?a(w,{"aria-label":`Navigation ${(m=e==null?void 0:e.label)!=null?m:"Menu"} links which directs to ${(e==null?void 0:e.linkText)===void 0?"link-not-found":e==null?void 0:e.linkText}`,className:o,target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",href:e!=null&&e.linkText?e==null?void 0:e.linkText:"link-not-found",children:e==null?void 0:e.label}):a("a",{"aria-label":`Navigation ${(f=e==null?void 0:e.label)!=null?f:"Menu"} links which directs to ${(e==null?void 0:e.externalLink)===void 0?"link-not-found":e==null?void 0:e.externalLink}`,className:o,target:e==null?void 0:e.linkTarget,href:`${e.externalLink===void 0?"link-not-found":e.externalLink}`,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:e==null?void 0:e.label})})}function E({link:e,onHover:o,onLeave:r,isNavHovered:t}){var f,v,i,x,g,p,A,h,L,$;let[d,s]=R(!1);return c("div",{className:"group relative",onMouseEnter:()=>{s(!0),o()},onMouseLeave:()=>{setTimeout(()=>{s(!1),r()},100)},children:[a("button",{className:`${n} group-hover:after:!w-full flex items-center space-x-2 ${t?"text-white":"text-black"}`,children:a("span",{children:e==null?void 0:e.label})}),a("div",{className:"absolute left-0 right-0 top-full h-2 pointer-events-auto opacity-0 group-hover:pointer-events-auto"}),a("div",{className:"fixed left-0 right-0 top-[80px] pointer-events-none group-hover:pointer-events-auto opacity-0 group-hover:opacity-100 transition-opacity duration-300 z-50",children:a("div",{className:"w-3/4 mx-auto bg-black shadow-lg",children:a("div",{className:"max-w-[1440px] mx-auto px-4",children:a("div",{className:"p-[30px]",children:c("div",{className:"grid grid-cols-5 gap-[30px]",children:[(e==null?void 0:e.featuredRoute)&&a("div",{className:"col-span-2 pr-[20px]",children:c("div",{className:"w-full h-0 pb-[75%] relative bg-obsidian",children:[((f=e==null?void 0:e.featuredRoute)==null?void 0:f.featuredLink)&&a("div",{className:"absolute w-full h-full inset-0 p-[15px] flex flex-col justify-end z-10",children:a("span",{children:a(l,{link:(v=e==null?void 0:e.featuredRoute)==null?void 0:v.featuredLink,style:"small-text-style text-white underline underline-offset-4 decoration-[0.5px] opacity-50 hover:opacity-100 h-5 !outline-none transition-all duration-300 after:absolute after:inset-0"})})}),((i=e==null?void 0:e.featuredRoute)==null?void 0:i.mainImage)&&a(T,{src:(g=(x=e==null?void 0:e.featuredRoute)==null?void 0:x.mainImage)==null?void 0:g.image,alt:(h=(A=(p=e==null?void 0:e.featuredRoute)==null?void 0:p.mainImage)==null?void 0:A.alt)!=null?h:"image",width:100,height:100,className:"object-cover absolute inset-0 w-full h-full"})]})}),(e==null?void 0:e.multipleRoutes)&&a("div",{className:"col-span-3 py-[20px]",children:c("div",{className:"flex flex-col space-y-10",children:[(e==null?void 0:e.label)&&a("p",{className:"h3 text-white",children:e==null?void 0:e.label}),a("ul",{className:`grid gap-x-[60px] gap-y-3 ${((L=e==null?void 0:e.multipleRoutes)==null?void 0:L.length)>3?"grid-cols-2":"grid-cols-1"}`,children:($=e==null?void 0:e.multipleRoutes)==null?void 0:$.map(b=>a("li",{children:(b==null?void 0:b.label)&&a(l,{link:b,style:n})},b._key))})]})})]})})})})})]})}function G({menu:e,showMenu:o,logo:r,dropdownMenu:t,openAccordion:d,toggleAccordion:s,socialMedia:u}){return c("div",{className:`${e?"block":"hidden"} navbar-menu fixed inset-0 z-50`,children:[a("div",{className:"fixed inset-0 bg-black/80",onClick:o}),a("div",{className:"fixed top-0 right-0 bottom-0 flex flex-col w-full sm:max-w-sm bg-black/80",children:c("nav",{className:"flex flex-col w-full py-6 px-6 overflow-y-auto h-screen",children:[a(X,{logo:r,showMenu:o}),a(W,{dropdownMenu:t,openAccordion:d,toggleAccordion:s}),a(Y,{socialMedia:u}),a("div",{className:"mt-auto pt-20 text-gray-400",children:a("span",{className:"text-sm text-center block",children:`\xA9 ${new Date().getFullYear()} All rights reserved.`})})]})})]})}function X({logo:e,showMenu:o}){var r;return e!=null&&e.image?a(w,{"aria-label":`Go to ${y(e)}`,className:"text-3xl font-bold leading-none h-[40px] w-[100px] flex items-center justify-start mt-0 md:ml-[15px]",onClick:o,href:y(e),children:a(T,{className:"h-[20px] object-contain",src:e==null?void 0:e.image,alt:(r=e==null?void 0:e.alt)!=null?r:"navigation-logo"})}):null}function W({dropdownMenu:e,openAccordion:o,toggleAccordion:r}){return a("div",{className:"mt-[70px]",children:a(J,{children:e==null?void 0:e.map(t=>{var d,s,u,m,f,v,i,x,g;return a(P.Fragment,{children:(t==null?void 0:t.label)&&(t==null?void 0:t._key)&&a(I,{children:(t==null?void 0:t.routeType)==="singleRoute"?a("span",{children:a(l,{link:t,style:`${n} !text-base !h-auto text-white`})}):(t==null?void 0:t.routeType)==="multipleRoute"?c(K,{children:[a(Q,{isOpen:o===t._key,onClick:()=>t._key&&r(t._key),className:`${n} after:!w-0 !p-0 text-white`,children:t==null?void 0:t.label}),a(U,{isOpen:o===t._key,children:c("div",{className:"py-6 flex flex-col space-y-2",children:[(t==null?void 0:t.featuredRoute)&&a("div",{children:c("div",{className:"w-full h-0 pb-[75%] relative bg-obsidian",children:[((d=t==null?void 0:t.featuredRoute)==null?void 0:d.featuredLink)&&a("div",{className:"absolute w-full h-full inset-0 p-[15px] flex flex-col justify-end z-10",children:a("span",{children:a(l,{link:(s=t==null?void 0:t.featuredRoute)==null?void 0:s.featuredLink,style:"small-text-style text-white underline underline-offset-4 decoration-[0.5px] opacity-50 hover:opacity-100 h-5 !outline-none transition-all duration-300"})})}),((u=t==null?void 0:t.featuredRoute)==null?void 0:u.mainImage)&&a(T,{src:(f=(m=t==null?void 0:t.featuredRoute)==null?void 0:m.mainImage)==null?void 0:f.image,className:"object-cover absolute inset-0 w-full h-full",alt:(x=(i=(v=t==null?void 0:t.featuredRoute)==null?void 0:v.mainImage)==null?void 0:i.alt)!=null?x:"image"})]})}),(t==null?void 0:t.multipleRoutes)&&a("ul",{className:"flex flex-col justify-center space-y-1 pl-[15px]",children:(g=t==null?void 0:t.multipleRoutes)==null?void 0:g.map(p=>a("li",{children:(p==null?void 0:p.label)&&a(l,{link:p,style:`${n} text-white`})},p._key))})]})})]}):a("span",{className:`${n} text-white`,children:t==null?void 0:t.label})})},t._key)})})})}function Y({socialMedia:e}){return e?a("div",{className:"mt-[70px] flex justify-center space-x-[50px]",children:e==null?void 0:e.map(o=>(o==null?void 0:o.socialMediaLink)&&a(w,{"aria-label":(o==null?void 0:o.socialMedia)||(o==null?void 0:o.socialMediaPlatform)||"social-media-link",className:"text-white hover:text-gray-2 leading-none transition",style:{fontSize:"24px"},target:"_blank",rel:"noopener noreferrer",href:o==null?void 0:o.socialMediaLink,children:a(H,{social:o==null?void 0:o.socialMedia})},o==null?void 0:o._key))}):null}function q({menu:e,showMenu:o,firstLine:r,secondLine:t,isNavHovered:d}){return a("div",{className:`block pr-4 lg:hidden z-[99] ${e?"fixed right-[20px] md:right-[50px]":"relative"}`,children:c("svg",{onClick:o,width:"40",height:"40",viewBox:"0 0 44 44",fill:d?"#ffffff":"#000000",xmlns:"http://www.w3.org/2000/svg",className:"cursor-pointer",children:[a(S.rect,{width:"20",height:"3",style:r}),a(S.rect,{width:"30",height:"3",style:t})]})})}function J({children:e,className:o=""}){return a("div",{className:`flex flex-col space-y-6 ${o}`,children:e})}function K({children:e,className:o=""}){return a("div",{className:`border-none ${o}`,children:e})}function Q({children:e,className:o="",isOpen:r,onClick:t}){return c("button",{onClick:t,className:`${o} flex items-center justify-between w-full`,children:[e,a(C,{className:`transform transition-transform duration-200 ${r?"rotate-180":""}`})]})}function U({children:e,isOpen:o}){return a("div",{className:`overflow-hidden transition-all duration-200 ${o?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"}`,children:e})}export{D as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E,b as h}from"./chunk-S35O64PB.mjs";import{Container as K}from"@stackshift-ui/container";import{Flex as N}from"@stackshift-ui/flex";import{Image as W}from"@stackshift-ui/image";import{Link as z}from"@stackshift-ui/link";import{Section as I}from"@stackshift-ui/section";import{useEffect as
|
|
1
|
+
import{a as E,b as h}from"./chunk-S35O64PB.mjs";import{Container as K}from"@stackshift-ui/container";import{Flex as N}from"@stackshift-ui/flex";import{Image as W}from"@stackshift-ui/image";import{Link as z}from"@stackshift-ui/link";import{Section as I}from"@stackshift-ui/section";import{useEffect as D,useRef as T,useState as y}from"react";import{BiArrowBack as P,BiChevronDown as R,BiMenu as H}from"react-icons/bi";import{BsFillTelephoneFill as B,BsTelephone as O}from"react-icons/bs";import{MdClose as _}from"react-icons/md";import{Fragment as F,jsx as o,jsxs as c}from"react/jsx-runtime";var j=({logo:e,hasScrolled:a})=>{var s;return e!=null&&e.image?o(z,{"aria-label":`Go to ${E(e)==="/"?"home page":E(e)}`,className:"text-3xl",href:E(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:o(W,{src:a?e==null?void 0:e.image:"https://cdn.sanity.io/images/9itgab5x/staging/7f9353c628ae4dd0bdd479d3b1407a3c242755e8-1963x833.png?fm=webp&w=96&q=75",width:500,height:500,alt:(s=e==null?void 0:e.alt)!=null?s:"navigation-logo",className:`transition-all duration-500 w-28 ${a?"md:w-40":"md:w-44"}`})}):null},Y=({button:e,hasScrolled:a})=>e!=null&&e.label?c(h,{ariaLabel:e==null?void 0:e.label,link:e,target:e==null?void 0:e.linkTarget,className:`font-body ml-auto p-2.5 md:p-3 transition duration-200 font-medium flex items-center space-x-2 text-left ${a?"text-white border border-white bg-transparent hover:bg-white hover:text-black":"text-white bg-secondary hover:text-secondary hover:border hover:border-black/40 hover:bg-white"}`,children:[o("span",{className:"flex-none text-3xl sm:text-xl",children:a?o(O,{className:"text-lg md:text-xl"}):o(B,{className:"text-lg md:text-xl"})}),o("span",{className:"text-sm md:text-base sm:block hidden whitespace-nowrap",children:e==null?void 0:e.label})]}):null,q=({hasScrolled:e,menu:a,showMenu:s})=>c("div",{children:[o(H,{color:e?"white":"black",size:40,onClick:s,className:`cursor-pointer hover:scale-105 transition lg:hidden block ${a?"hidden":"block"}`}),o(_,{color:e?"white":"black",size:40,onClick:s,className:`cursor-pointer hover:scale-105 transition lg:hidden block ${a?"block":"hidden"}`})]});function A({primaryButton:e,secondaryButton:a,logo:s,multipleLinks:r,title:u}){let[p,l]=y(null),n=T(null),[f,S]=y(!1),[i,C]=y(!1),M=d=>{n.current&&!n.current.contains(d.target)&&l(null)};D(()=>{let d=x=>{M(x)};return document.addEventListener("click",d),()=>{document.removeEventListener("click",d)}},[]);let w=d=>{d&&d.stopPropagation(),S(x=>!x)};return D(()=>{let d=()=>{C(window.scrollY>0)};return window.addEventListener("scroll",d),()=>window.removeEventListener("scroll",d)},[]),o(F,{children:c(I,{className:`fixed !z-[999999] w-full left-0 transition-all top-0 ${i?"bg-black/80":"bg-background"}`,children:[o(K,{children:c("div",{className:"flex justify-between space-x-5 py-2 items-center",children:[o(j,{logo:s,hasScrolled:i}),o(N,{direction:"row",align:"center",className:"hidden lg:flex gap-x-8",children:r==null?void 0:r.map((d,x)=>o(G,{link:d,index:x,dropdown:p,setDropdown:l,hasScrolled:i,dropdownRef:n},x))}),c(N,{direction:"row",align:"center",gap:2,children:[((e==null?void 0:e.label)||(a==null?void 0:a.label))&&o("div",{className:"flex space-x-4 sm:space-x-6 items-center",children:o(Y,{button:e,hasScrolled:i})}),o(q,{hasScrolled:i,menu:f,showMenu:w})]})]})}),o(U,{links:r,open:f,showMenu:w})]})})}var G=({link:e,index:a,dropdown:s,setDropdown:r,hasScrolled:u,dropdownRef:p})=>{if(!(e!=null&&e.multipleRoutes))return o(h,{ariaLabel:(e==null?void 0:e.label)||"",link:e,target:e==null?void 0:e.linkTarget,className:`hover:text-secondary font-body text-lg whitespace-nowrap ${u?"text-white":"text-black"}`,children:e==null?void 0:e.label});let l=n=>{r(n)};return c("div",{className:"relative",children:[e!=null&&e.internalLink||e!=null&&e.externalLink?c(N,{onMouseEnter:n=>{n.stopPropagation(),l(s===a?null:a)},children:[o(h,{ariaLabel:(e==null?void 0:e.label)||"",link:e,target:e==null?void 0:e.linkTarget,className:`hover:text-secondary font-body text-lg cursor-pointer ${u?"text-white":"text-black"}`,children:e==null?void 0:e.label}),o(R,{size:24,className:`font-bold mt-0.5 font-body cursor-pointer hover:text-secondary hover:translate-y-0.5 transition ${u?"text-white":"text-black"} ${s===a&&"translate-y-0.5 !text-secondary"}`,onClick:n=>{n.stopPropagation(),l(a)}})]}):c("p",{className:`hover:text-secondary font-body text-lg cursor-pointer flex items-center group ${u?"text-white":"text-black"}`,onClick:n=>{n.stopPropagation(),l(s===a?null:a)},onMouseEnter:n=>{n.stopPropagation(),l(s===a?null:a)},children:[e==null?void 0:e.label,o(R,{size:24,className:`font-bold mt-0.5 group-hover:translate-y-0.5 transition ${s===a&&"translate-y-0.5 text-secondary"}`})]}),s===a&&o(J,{link:e,dropdownRef:p,setDropdown:r,hasScrolled:u})]})},J=({link:e,dropdownRef:a,setDropdown:s,hasScrolled:r})=>{var u;return c("div",{ref:a,className:"absolute flex flex-col top-8 bg-primary rounded rounded-tl-none",onMouseLeave:()=>s(null),children:[o("span",{className:"absolute top-0 w-0 h-0 border-x-transparent border-t-transparent border-b-primary border-[6px] transform -translate-y-3"}),(u=e==null?void 0:e.multipleRoutes)==null?void 0:u.map((p,l)=>o(Q,{mLink:p,hasScrolled:r},l))]})},Q=({mLink:e,hasScrolled:a})=>{var s;return e!=null&&e.multipleInnerRoutes?c("div",{className:"relative group",children:[e!=null&&e.internalLink||e!=null&&e.externalLink?c(N,{align:"center",children:[o(h,{ariaLabel:(e==null?void 0:e.label)||"",link:e,target:e==null?void 0:e.linkTarget,className:"font-body hover:text-secondary text-lg cursor-pointer py-2 pl-4 text-white",children:e==null?void 0:e.label}),o(R,{size:24,className:"font-bold mt-0.5 cursor-pointer group-hover:translate-y-0.5 transition group-hover:text-secondary text-white"})]}):c("p",{className:"hover:text-secondary text-lg cursor-pointer flex items-center group py-2 px-4 text-white",children:[e==null?void 0:e.label,o(R,{size:24,className:"font-bold mt-0.5 group-hover:translate-y-0.5 transition"})]}),o("div",{className:"absolute hidden flex-col top-0 left-full bg-primary rounded-r rounded-r-b group-hover:flex hover:flex",children:(s=e==null?void 0:e.multipleInnerRoutes)==null?void 0:s.map((r,u)=>o(h,{ariaLabel:(r==null?void 0:r.label)||"",link:r,target:r==null?void 0:r.linkTarget,className:"hover:text-secondary font-body text-lg py-2 px-4 whitespace-nowrap text-white",children:r==null?void 0:r.label},u))})]}):o(h,{ariaLabel:(e==null?void 0:e.label)||"",link:e,target:e==null?void 0:e.linkTarget,className:"hover:text-secondary font-body text-lg py-2 px-4 whitespace-nowrap text-white",children:e==null?void 0:e.label})},U=({links:e,open:a,showMenu:s})=>{var M,w,d,x;let[r,u]=y(!1),p=T(null);D(()=>{let t=()=>u(window.scrollY>0);return window.addEventListener("scroll",t),()=>window.removeEventListener("scroll",t)},[]),D(()=>{let t=b=>{p.current&&!p.current.contains(b.target)&&!b.target.closest(".BiMenu")&&a&&s(b)};return document.addEventListener("click",t),()=>document.removeEventListener("click",t)},[a,s]);let[l,n]=y({previous:null,index:null}),f=(t,b)=>{n({previous:t,index:b})},S=(t,b,v=!1,m)=>{let g=(t==null?void 0:t.label)==="New Construction",$=(t==null?void 0:t.label)==="Renovations"||(t==null?void 0:t.label)==="Renovation";return c("div",{className:"flex items-center py-2 px-4",children:[t!=null&&t.internalLink||t!=null&&t.externalLink?g||$?o("p",{className:`text-xl font-body ${r?"text-white":"text-black"} hover:text-secondary cursor-pointer`,onClick:()=>window.location.href=`/projects/residential?filter=${g?"new_construction":"renovations"}`,children:t==null?void 0:t.label}):o(h,{ariaLabel:(t==null?void 0:t.label)||"",link:t,target:t==null?void 0:t.linkTarget,className:`text-xl font-body ${r?"text-white":"text-black"} hover:text-secondary`,children:o("p",{className:"w-full h-full",onClick:s,children:t==null?void 0:t.label})}):o("p",{className:`text-xl font-body peer cursor-pointer ${r?"text-white":"text-black"} hover:text-secondary`,onClick:m,children:t==null?void 0:t.label}),v&&o(R,{fontSize:24,className:`hover:-rotate-90 hover:text-secondary peer-hover:-rotate-90 peer-hover:text-secondary transition duration-200 cursor-pointer ${r?"text-white":"text-black"}`,onClick:m})]},b)},i=(t,b=!1)=>t.map((v,m)=>{let g=!!(v!=null&&v.multipleRoutes||v!=null&&v.multipleInnerRoutes);return S(v,m,g,g?()=>f(b?l.index:null,m):void 0)}),C=t=>c("p",{className:`hover:text-secondary text-xl font-body py-2 px-4 flex items-center gap-2 cursor-pointer group ${r?"text-white":"text-black"}`,onClick:t,children:[o(P,{}),"Back"]});return o(N,{className:`flex sm:block text-white overflow-hidden transition lg:hidden columns-2 ${a?"animate-curtain-down mt-5":"animate-curtain-up h-0"}`,children:o("div",{ref:p,onClick:t=>t.stopPropagation(),children:a&&c(F,{children:[e&&l.index===null&&i(e),l.previous===null&&l.index!==null&&c("div",{className:"flex flex-col",children:[C(()=>f(null,null)),i(((M=e[l.index])==null?void 0:M.multipleRoutes)||[],!0)]}),l.previous!==null&&l.index!==null&&c("div",{className:"flex flex-col",children:[C(()=>n({previous:null,index:l.previous})),i(((x=(d=(w=e[l.previous])==null?void 0:w.multipleRoutes)==null?void 0:d[l.index])==null?void 0:x.multipleInnerRoutes)||[])]})]})})})};export{A as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as h}from"./chunk-S35O64PB.mjs";import{Button as b}from"@stackshift-ui/button";import{Flex as f}from"@stackshift-ui/flex";import{Grid as _}from"@stackshift-ui/grid";import{Heading as A}from"@stackshift-ui/heading";import{Image as M}from"@stackshift-ui/image";import{Link as L}from"@stackshift-ui/link";import{Section as $}from"@stackshift-ui/section";import{Text as v}from"@stackshift-ui/text";import{useClickAway as S,useWindowScroll as N}from"@uidotdev/usehooks";import w from"classnames";import g,{createContext as I,forwardRef as R,Fragment as y,useCallback as B,useEffect as E,useMemo as j,useRef as F,useState as x}from"react";import{GoPerson as G}from"react-icons/go";import{LiaSearchSolid as H}from"react-icons/lia";import{SlLocationPin as z}from"react-icons/sl";import{Fragment as D,jsx as t,jsxs as m}from"react/jsx-runtime";var P=I(void 0),O=()=>{let e=g.useContext(P);if(!e)throw new Error("useAccordion must be used within an Accordion");return e},W=({className:e,children:a,defaultValue:n=[],onValueChange:o})=>{let[s,l]=x(n),r=g.useCallback(c=>{l(d=>{let u=d.includes(c)?d.filter(p=>p!==c):[...d,c];return o==null||o(u),u})},[o]),i=g.useMemo(()=>({openItems:s,toggleItem:r}),[s,r]);return t(P.Provider,{value:i,children:t("div",{className:w("w-full",e),children:a})})},K=({value:e,className:a,children:n})=>{let{openItems:o,toggleItem:s}=O(),l=o.includes(e);return t("div",{className:w("border-b border-gray-200",a),children:g.Children.map(n,r=>g.isValidElement(r)?g.cloneElement(r,{isOpen:l,onClick:()=>s(e)}):r)})},V=g.forwardRef(({className:e,children:a,isOpen:n,onClick:o,...s},l)=>m("button",{ref:l,type:"button",onClick:o,className:w("flex w-full items-center justify-between py-4 text-left",e),...s,children:[a,t("svg",{className:w("h-5 w-5 transform transition-transform duration-200",n?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})),J=g.forwardRef(({className:e,children:a,isOpen:n},o)=>t("div",{ref:o,className:w("overflow-hidden transition-all duration-200 ease-in-out",n?"max-h-[1000px] opacity-100":"max-h-0 opacity-0",e),children:t("div",{className:"pb-4",children:a})})),U=({data:e,showMobileMenu:a,setShowMobileMenu:n})=>{let o=S(()=>{a&&n(!1)});return a?t("div",{ref:o,className:"fixed w-[75%] h-screen top-0 right-0 bg-white md:hidden z-50 py-10 px-5 overflow-y-auto",children:t(W,{children:e==null?void 0:e.map(s=>t(T,{megaMenu:s},s._key))})}):null},T=g.memo(({megaMenu:e})=>{var a,n;return e._type==="isLinkOnly"?t(L,{href:e.linkExternal||"#",target:e.linkTarget,className:"block py-4 text-base font-medium text-gray-900 hover:text-gray-700 uppercase",children:e.label}):m(K,{value:e._key,children:[t(V,{className:"text-base font-medium text-gray-900 uppercase w-full py-4",children:e.title}),m(J,{children:[(a=e.groupOfLinks)==null?void 0:a.map(o=>{var s;return m("div",{className:"mt-4 pl-4",children:[t(v,{className:"text-black font-medium leading-[30px]",children:o.title}),t(f,{direction:"col",align:"start",justify:"start",gap:1,className:"relative w-full pl-4",children:(s=o.links)==null?void 0:s.map(l=>{var r;return m("div",{className:"mb-4",children:[t(v,{className:"text-black font-medium leading-[30px] text-sm",children:l.title}),(r=l.links)==null?void 0:r.map(i=>{var c;return t(b,{ariaLabel:(c=i.label)!=null?c:"",as:"link",link:i!=null?i:{},variant:"unstyled",className:"text-black text-sm font-normal font-heading-kb leading-[30px] hover:underline block ml-4",children:i.label},`MobileMenuContent-Item-Group-Link-${i._key}`)})]},l._key)})})]},o._key)}),(n=e.showcaseLink)==null?void 0:n.map((o,s)=>{var l,r,i,c,d,u,p;return t("div",{className:"mt-4 pl-4",children:t(b,{ariaLabel:(r=(l=o.primaryButton)==null?void 0:l.label)!=null?r:"",as:"link",link:(i=o.primaryButton)!=null?i:{},variant:"unstyled",className:"text-black text-sm font-normal font-heading-kb leading-[30px]",children:m(f,{direction:"col",gap:3,children:[t(M,{src:(c=o.mainImage)==null?void 0:c.image,alt:(u=(d=o.mainImage)==null?void 0:d.alt)!=null?u:"",width:200,height:150,className:"w-[188px] h-[147px] object-cover object-center"},s),(p=o.primaryButton)==null?void 0:p.label]})})},`MobileMenuContent-Item-Images-${o._key}-${s}`)})]})]})});T.displayName="MobileMenuContentItem";function q({logo:e,iconLinks:a,megaMenu:n}){let[{y:o}]=N(),[s,l]=x(!1),[r,i]=x(""),c=F(null),d=o&&o>80?"fixed w-full transition-all duration-300 ease-in-out":"sticky transition-all duration-300 ease-in-out",u=B(p=>{c.current&&clearTimeout(c.current),p===""?c.current=setTimeout(()=>{i("")},200):i(p)},[]);return E(()=>()=>{c.current&&clearTimeout(c.current)},[]),m(D,{children:[t("header",{className:w("relative top-0 left-0 border-t md:pb-3 z-50 bg-white transition-all ease-in-out duration-300",d),children:t(Q,{logo:e,iconLinks:a,megaMenu:n,setShowMobileMenu:l,currentDropdown:r,setCurrentDropdown:u})}),t(U,{data:n,showMobileMenu:s,setShowMobileMenu:l})]})}var Q=({logo:e,iconLinks:a,megaMenu:n,setShowMobileMenu:o,currentDropdown:s,setCurrentDropdown:l})=>{var d;let[{x:r,y:i}]=N(),c=i&&i>80?"md:hidden":"";return m("div",{className:"px-0 w-full h-full transition-all duration-300 ease-in-out overflow-y-auto",children:[m(_,{columns:2,align:"center",justify:"between",gap:5,className:w("lg:pt-4 py-2 grid-cols-2 md:grid-cols-3 w-full h-full transition-all ease-in-out duration-300 px-4",c),children:[(e==null?void 0:e.image)&&t("div",{className:"relative w-20 flex items-center h-20 md:w-fit md:h-full place-self-start md:place-self-center col-start-1 md:col-start-2",children:t(L,{"aria-label":`Go to ${h(e)==="/"?"home page":h(e)}`,className:"text-3xl font-bold leading-none",href:h(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:t(M,{src:e==null?void 0:e.image,width:135,height:135,className:"object-cover transition-all ease-in-out duration-300",alt:(d=e==null?void 0:e.alt)!=null?d:"navigation-logo"})})}),t("button",{onClick:()=>o(!0),className:"md:hidden h-fit self-center place-self-end",children:t(re,{className:"w-8 h-8"})}),a&&a.length>0&&t(f,{align:"center",gap:5,className:"hidden md:flex place-self-center max-w-[144px] h-32 w-full",children:t("ul",{className:"flex gap-5",children:a==null?void 0:a.map(u=>u&&u.label?t(X,{link:u,isIcon:!0},u._key):null)})})]}),t(Z,{data:n!=null?n:[],currentDropdown:s,setCurrentDropdown:l}),t(ee,{data:n!=null?n:[],currentDropdown:s,setCurrentDropdown:l})]})},X=({link:e,isIcon:a})=>{let n=Y[e==null?void 0:e.label]||null;return t("li",{children:t(b,{as:"link",ariaLabel:e==null?void 0:e.label,link:e,className:"text-sm font-label tracking-wide",children:a?n:e==null?void 0:e.label})})},Y={search:t(H,{className:"w-4 h-4"}),location:t(z,{className:"w-4 h-4"}),person:t(G,{className:"w-4 h-4"})},Z=({data:e,currentDropdown:a,setCurrentDropdown:n})=>{let[{x:o,y:s}]=N(),l=s&&s<80||s===0?"hidden":"";return m(f,{align:"center",justify:"between",gap:5,className:"relative w-full h-full max-w-7xl mx-auto hidden md:flex pt-4 px-4 transition-all duration-300 ease-in-out",children:[e&&e.length>0?e==null?void 0:e.slice(0,3).map(r=>t(y,{children:r._type==="dropdown"?t(C,{dropdown:r,"aria-expanded":a===r.title,onMouseEnter:()=>{var i;return n((i=r.title)!=null?i:"")},onMouseLeave:()=>n("")},`MegaMenuDropdownTrigger-${r._key}`):t(k,{link:r},`MegaMenuLink-${r._key}`)},`MegaMenuNavLink-${r._key}`)):null,e&&e.length>0?e==null?void 0:e.slice(3,6).map(r=>t(y,{children:r._type==="dropdown"?t(C,{dropdown:r,"aria-expanded":a===r.title,onMouseEnter:()=>{var i;return n((i=r.title)!=null?i:"")},onMouseLeave:()=>n("")},`MegaMenuDropdownTrigger-${r._key}`):t(k,{link:r},`MegaMenuLink-${r._key}`)},`MegaMenuNavLink-${r._key}`)):null]})},k=({link:e,className:a})=>t(b,{ariaLabel:`Go to ${e.label}`,as:"link",variant:"unstyled",link:e,className:w("relative text-black text-sm font-normal font-label uppercase tracking-widest group",a),children:e.label}),C=R((e,a)=>{let{dropdown:n,onClick:o,onMouseEnter:s,onMouseLeave:l,className:r,...i}=e;return t("button",{ref:a,onClick:o,onMouseEnter:s,onMouseLeave:l,"aria-label":`Open the ${n.title} menu`,className:w("relative text-black text-sm font-normal font-label uppercase tracking-widest group",r),...i,children:n.title})}),ee=({data:e,currentDropdown:a,setCurrentDropdown:n})=>t(D,{children:e&&e.length>0?e==null?void 0:e.map(o=>{var l,r,i;let s=a===o.title&&o.title!=="";return t(te,{label:(l=o.title)!=null?l:"",showcaseLink:(r=o.showcaseLink)!=null?r:[],groupedLinks:(i=o.groupOfLinks)!=null?i:[],currentDropdown:a,setCurrentDropdown:n},`MegaMenuDropdown-${o._key}`)}):null});function te({label:e,showcaseLink:a,groupedLinks:n,currentDropdown:o,setCurrentDropdown:s}){let l=o===e&&e!=="",r=n.length>0,i=a.length>0,c=j(()=>n.length>0?n.map(u=>{var p;return((p=u.links)==null?void 0:p.length)>2?"3fr":"1fr"}).join(" "):"1fr",[n]),d=r?`${c} ${i?"2fr":""}`:i?"2fr":"1fr";return t($,{"data-show":l,onMouseEnter:()=>s(e),onMouseLeave:()=>s(""),className:`relative top-6 left-0 w-full overflow-hidden z-50 bg-primary/5 !transition-[max-height] !duration-300 !ease-in-out ${l?"max-h-[500px]":"max-h-0"}`,children:m("div",{style:{display:"grid",gridTemplateColumns:d,gridTemplateRows:"1fr"},className:"relative w-full h-auto max-w-[90rem] mx-auto",children:[t(ne,{groupedLinks:n}),t(oe,{hasShowcaseLinks:i,showcaseLink:a})]})})}function ne({groupedLinks:e}){return t(y,{children:e&&e.length>0&&(e==null?void 0:e.map((a,n)=>{var o;return m("div",{className:"relative py-10 pl-5 flex flex-col items-end justify-start h-full w-full border-r border-black last:border-r-0",children:[t(A,{fontSize:"sm",className:"text-black font-normal uppercase tracking-widest font-label self-start pb-4",children:a.title}),t(f,{direction:"row",align:"start",justify:"start",gap:4,className:"relative w-full h-full grid-flow-row",children:(o=a.links)==null?void 0:o.map((s,l)=>{var r;return m(f,{direction:"col",className:"h-fit w-fit",children:[t(v,{fontSize:"base",className:"text-black font-medium leading-[30px]",children:s.title}),t(f,{direction:"col",align:"start",justify:"start",gap:2,className:"w-fit h-full",children:(r=s.links)==null?void 0:r.map((i,c)=>{var d;return t(b,{ariaLabel:(d=i.label)!=null?d:"",as:"link",link:i!=null?i:{},variant:"unstyled",className:"text-black text-sm font-normal font-heading-kb leading-[30px] hover:underline",children:i==null?void 0:i.label},`MegaDropdownContent-Item-Link-${i._key}-${c}`)})})]},`MegaDropdownContent-Item-Link-${s._key}-${l}`)})})]},`MegaDropdownContent-Item-${a._key}-${n}`)}))})}function oe({hasShowcaseLinks:e,showcaseLink:a}){return e?t(f,{direction:"row",align:"start",justify:"start",className:"w-full h-full gap-6 pl-5 py-10",children:a==null?void 0:a.map((n,o)=>{var l,r,i,c,d,u,p;let s=(l=n.mainImage)==null?void 0:l.image;return t(b,{ariaLabel:(i=(r=n.primaryButton)==null?void 0:r.label)!=null?i:"",as:"link",link:(c=n.primaryButton)!=null?c:{},variant:"unstyled",className:"text-center text-black text-sm font-normal font-heading-kb leading-[30px] hover:underline",children:m(f,{direction:"col",align:"center",justify:"center",gap:3,children:[t(M,{src:s,alt:(u=(d=n.mainImage)==null?void 0:d.alt)!=null?u:"",width:500,height:500,className:"w-[188px] h-[147px] object-cover object-center"},o),(p=n.primaryButton)==null?void 0:p.label]})},`MegaDropdownContent-Item-Images-${n._key}-${o}`)})}):null}function re(e){return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:t("path",{fill:"currentColor",d:"M3 8V7h17v1zm17 4v1H3v-1zM3 17h17v1H3z"})})}export{q as a};
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a as f}from"./chunk-
|
|
2
|
+
"use strict";import{a as f}from"./chunk-7PZN5XLN.mjs";import{a as m}from"./chunk-2KK4WBIF.mjs";import{a as p}from"./chunk-Z3RUBMRD.mjs";import{a as x}from"./chunk-ISJJGULA.mjs";import{a as o}from"./chunk-AV6FXT56.mjs";import{a as r}from"./chunk-STASA5HD.mjs";import{a as e}from"./chunk-TJZPE7DN.mjs";import{a as t}from"./chunk-EYE6OX2N.mjs";import"./chunk-S35O64PB.mjs";export{x as Navigation,o as Navigation_A,r as Navigation_B,e as Navigation_C,t as Navigation_D,f as Navigation_F,m as Navigation_G,p as Navigation_H};
|
package/dist/navigation.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-ISJJGULA.mjs";export{a as Navigation};
|
package/dist/navigation_f.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-7PZN5XLN.mjs";import"./chunk-S35O64PB.mjs";export{a as Navigation_F,a as default};
|
package/dist/navigation_g.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-2KK4WBIF.mjs";import"./chunk-S35O64PB.mjs";export{a as Navigation_G,a as default};
|
package/dist/navigation_h.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-Z3RUBMRD.mjs";import"./chunk-S35O64PB.mjs";export{a as Navigation_H,a as default};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/navigation",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "6.1.0-alpha.
|
|
4
|
+
"version": "6.1.0-alpha.9",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"typescript": "^5.6.2",
|
|
30
30
|
"vite-tsconfig-paths": "^5.0.1",
|
|
31
31
|
"vitest": "^2.1.1",
|
|
32
|
-
"@stackshift-ui/
|
|
33
|
-
"@stackshift-ui/
|
|
32
|
+
"@stackshift-ui/eslint-config": "6.0.10",
|
|
33
|
+
"@stackshift-ui/typescript-config": "6.0.10"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"classnames": "^2.5.1",
|
|
@@ -39,17 +39,17 @@
|
|
|
39
39
|
"@uidotdev/usehooks": "^2.4.1",
|
|
40
40
|
"react-icons": "^5.3.0",
|
|
41
41
|
"@stackshift-ui/container": "6.0.11",
|
|
42
|
-
"@stackshift-ui/
|
|
42
|
+
"@stackshift-ui/flex": "6.0.11",
|
|
43
43
|
"@stackshift-ui/link": "6.0.11",
|
|
44
|
+
"@stackshift-ui/button": "6.0.11",
|
|
44
45
|
"@stackshift-ui/section": "6.0.11",
|
|
45
|
-
"@stackshift-ui/
|
|
46
|
+
"@stackshift-ui/grid": "6.0.11",
|
|
47
|
+
"@stackshift-ui/image": "6.0.11",
|
|
46
48
|
"@stackshift-ui/heading": "6.0.11",
|
|
47
49
|
"@stackshift-ui/text": "6.0.11",
|
|
48
|
-
"@stackshift-ui/
|
|
50
|
+
"@stackshift-ui/social-icons": "6.0.12",
|
|
49
51
|
"@stackshift-ui/scripts": "6.0.10",
|
|
50
|
-
"@stackshift-ui/
|
|
51
|
-
"@stackshift-ui/flex": "6.0.11",
|
|
52
|
-
"@stackshift-ui/social-icons": "6.0.12"
|
|
52
|
+
"@stackshift-ui/system": "6.0.11"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@stackshift-ui/system": ">=6.0.11",
|
package/src/navigation_f.tsx
CHANGED
|
@@ -11,7 +11,6 @@ import { NavigationProps } from ".";
|
|
|
11
11
|
import { ConditionalLink, logoLink } from "./helper/index";
|
|
12
12
|
import { LabeledRouteWithKey } from "./types";
|
|
13
13
|
|
|
14
|
-
// Types
|
|
15
14
|
type DropdownRef = React.RefObject<HTMLDivElement>;
|
|
16
15
|
|
|
17
16
|
interface DropdownState {
|
|
@@ -19,7 +18,6 @@ interface DropdownState {
|
|
|
19
18
|
index: number | null;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
// Components
|
|
23
21
|
const NavigationLogo = ({ logo, hasScrolled }: { logo: any; hasScrolled: boolean }) => {
|
|
24
22
|
if (!logo?.image) return null;
|
|
25
23
|
|
package/src/navigation_h.tsx
CHANGED
|
@@ -26,7 +26,6 @@ import { NavigationProps } from ".";
|
|
|
26
26
|
import { logoLink } from "./helper";
|
|
27
27
|
import { LabeledRouteWithKey, Logo, MegaMenu } from "./types";
|
|
28
28
|
|
|
29
|
-
// Accordion Types
|
|
30
29
|
interface AccordionProps {
|
|
31
30
|
className?: string;
|
|
32
31
|
children: React.ReactNode;
|
|
@@ -51,7 +50,6 @@ interface AccordionContentProps {
|
|
|
51
50
|
children: React.ReactNode;
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
// Accordion Context
|
|
55
53
|
interface AccordionContextType {
|
|
56
54
|
openItems: string[];
|
|
57
55
|
toggleItem: (value: string) => void;
|
package/dist/chunk-3DKGUYHM.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as h}from"./chunk-S35O64PB.mjs";import{Button as b}from"@stackshift-ui/button";import{Flex as f}from"@stackshift-ui/flex";import{Grid as _}from"@stackshift-ui/grid";import{Heading as A}from"@stackshift-ui/heading";import{Image as x}from"@stackshift-ui/image";import{Link as L}from"@stackshift-ui/link";import{Section as $}from"@stackshift-ui/section";import{Text as N}from"@stackshift-ui/text";import{useClickAway as I,useWindowScroll as M}from"@uidotdev/usehooks";import w from"classnames";import g,{createContext as R,forwardRef as S,Fragment as v,useCallback as B,useEffect as E,useMemo as j,useRef as F,useState as y}from"react";import{GoPerson as G}from"react-icons/go";import{LiaSearchSolid as H}from"react-icons/lia";import{SlLocationPin as O}from"react-icons/sl";import{Fragment as D,jsx as t,jsxs as p}from"react/jsx-runtime";var P=R(void 0),z=()=>{let e=g.useContext(P);if(!e)throw new Error("useAccordion must be used within an Accordion");return e},W=({className:e,children:a,defaultValue:n=[],onValueChange:o})=>{let[i,l]=y(n),r=g.useCallback(c=>{l(d=>{let u=d.includes(c)?d.filter(m=>m!==c):[...d,c];return o==null||o(u),u})},[o]),s=g.useMemo(()=>({openItems:i,toggleItem:r}),[i,r]);return t(P.Provider,{value:s,children:t("div",{className:w("w-full",e),children:a})})},K=({value:e,className:a,children:n})=>{let{openItems:o,toggleItem:i}=z(),l=o.includes(e);return t("div",{className:w("border-b border-gray-200",a),children:g.Children.map(n,r=>g.isValidElement(r)?g.cloneElement(r,{isOpen:l,onClick:()=>i(e)}):r)})},V=g.forwardRef(({className:e,children:a,isOpen:n,onClick:o,...i},l)=>p("button",{ref:l,type:"button",onClick:o,className:w("flex w-full items-center justify-between py-4 text-left",e),...i,children:[a,t("svg",{className:w("h-5 w-5 transform transition-transform duration-200",n?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})),J=g.forwardRef(({className:e,children:a,isOpen:n},o)=>t("div",{ref:o,className:w("overflow-hidden transition-all duration-200 ease-in-out",n?"max-h-[1000px] opacity-100":"max-h-0 opacity-0",e),children:t("div",{className:"pb-4",children:a})})),U=({data:e,showMobileMenu:a,setShowMobileMenu:n})=>{let o=I(()=>{a&&n(!1)});return a?t("div",{ref:o,className:"fixed w-[75%] h-screen top-0 right-0 bg-white md:hidden z-50 py-10 px-5 overflow-y-auto",children:t(W,{children:e==null?void 0:e.map(i=>t(T,{megaMenu:i},i._key))})}):null},T=g.memo(({megaMenu:e})=>{var a,n;return e._type==="isLinkOnly"?t(L,{href:e.linkExternal||"#",target:e.linkTarget,className:"block py-4 text-base font-medium text-gray-900 hover:text-gray-700 uppercase",children:e.label}):p(K,{value:e._key,children:[t(V,{className:"text-base font-medium text-gray-900 uppercase w-full py-4",children:e.title}),p(J,{children:[(a=e.groupOfLinks)==null?void 0:a.map(o=>{var i;return p("div",{className:"mt-4 pl-4",children:[t(N,{className:"text-black font-medium leading-[30px]",children:o.title}),t(f,{direction:"col",align:"start",justify:"start",gap:1,className:"relative w-full pl-4",children:(i=o.links)==null?void 0:i.map(l=>{var r;return p("div",{className:"mb-4",children:[t(N,{className:"text-black font-medium leading-[30px] text-sm",children:l.title}),(r=l.links)==null?void 0:r.map(s=>{var c;return t(b,{ariaLabel:(c=s.label)!=null?c:"",as:"link",link:s!=null?s:{},variant:"unstyled",className:"text-black text-sm font-normal font-heading-kb leading-[30px] hover:underline block ml-4",children:s.label},`MobileMenuContent-Item-Group-Link-${s._key}`)})]},l._key)})})]},o._key)}),(n=e.showcaseLink)==null?void 0:n.map((o,i)=>{var l,r,s,c,d,u,m;return t("div",{className:"mt-4 pl-4",children:t(b,{ariaLabel:(r=(l=o.primaryButton)==null?void 0:l.label)!=null?r:"",as:"link",link:(s=o.primaryButton)!=null?s:{},variant:"unstyled",className:"text-black text-sm font-normal font-heading-kb leading-[30px]",children:p(f,{direction:"col",gap:3,children:[t(x,{src:(c=o.mainImage)==null?void 0:c.image,alt:(u=(d=o.mainImage)==null?void 0:d.alt)!=null?u:"",width:200,height:150,className:"w-[188px] h-[147px] object-cover object-center"},i),(m=o.primaryButton)==null?void 0:m.label]})})},`MobileMenuContent-Item-Images-${o._key}-${i}`)})]})]})});T.displayName="MobileMenuContentItem";function q({logo:e,iconLinks:a,megaMenu:n}){let[{y:o}]=M(),[i,l]=y(!1),[r,s]=y(""),c=F(null),d=o&&o>80?"fixed w-full transition-all duration-300 ease-in-out":"sticky transition-all duration-300 ease-in-out",u=B(m=>{c.current&&clearTimeout(c.current),m===""?c.current=setTimeout(()=>{s("")},200):s(m)},[]);return E(()=>()=>{c.current&&clearTimeout(c.current)},[]),p(D,{children:[t("header",{className:w("relative top-0 left-0 border-t md:pb-3 z-50 bg-white transition-all ease-in-out duration-300",d),children:t(Q,{logo:e,iconLinks:a,megaMenu:n,setShowMobileMenu:l,currentDropdown:r,setCurrentDropdown:u})}),t(U,{data:n,showMobileMenu:i,setShowMobileMenu:l})]})}var Q=({logo:e,iconLinks:a,megaMenu:n,setShowMobileMenu:o,currentDropdown:i,setCurrentDropdown:l})=>{var d;let[{x:r,y:s}]=M(),c=s&&s>80?"md:hidden":"";return p("div",{className:"px-0 w-full h-full transition-all duration-300 ease-in-out overflow-y-auto",children:[p(_,{columns:2,align:"center",justify:"between",gap:5,className:w("lg:pt-4 py-2 grid-cols-2 md:grid-cols-3 w-full h-full transition-all ease-in-out duration-300 px-4",c),children:[(e==null?void 0:e.image)&&t("div",{className:"relative w-20 flex items-center h-20 md:w-fit md:h-full place-self-start md:place-self-center col-start-1 md:col-start-2",children:t(L,{"aria-label":`Go to ${h(e)==="/"?"home page":h(e)}`,className:"text-3xl font-bold leading-none",href:h(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:t(x,{src:e==null?void 0:e.image,width:135,height:135,className:"object-cover transition-all ease-in-out duration-300",alt:(d=e==null?void 0:e.alt)!=null?d:"navigation-logo"})})}),t("button",{onClick:()=>o(!0),className:"md:hidden h-fit self-center place-self-end",children:t(re,{className:"w-8 h-8"})}),a&&a.length>0&&t(f,{align:"center",gap:5,className:"hidden md:flex place-self-center max-w-[144px] h-32 w-full",children:t("ul",{className:"flex gap-5",children:a==null?void 0:a.map(u=>u&&u.label?t(X,{link:u,isIcon:!0},u._key):null)})})]}),t(Z,{data:n!=null?n:[],currentDropdown:i,setCurrentDropdown:l}),t(ee,{data:n!=null?n:[],currentDropdown:i,setCurrentDropdown:l})]})},X=({link:e,isIcon:a})=>{let n=Y[e==null?void 0:e.label]||null;return t("li",{children:t(b,{as:"link",ariaLabel:e==null?void 0:e.label,link:e,className:"text-sm font-label tracking-wide",children:a?n:e==null?void 0:e.label})})},Y={search:t(H,{className:"w-4 h-4"}),location:t(O,{className:"w-4 h-4"}),person:t(G,{className:"w-4 h-4"})},Z=({data:e,currentDropdown:a,setCurrentDropdown:n})=>{let[{x:o,y:i}]=M(),l=i&&i<80||i===0?"hidden":"";return p(f,{align:"center",justify:"between",gap:5,className:"relative w-full h-full max-w-7xl mx-auto hidden md:flex pt-4 px-4 transition-all duration-300 ease-in-out",children:[e&&e.length>0?e==null?void 0:e.slice(0,3).map(r=>t(v,{children:r._type==="dropdown"?t(C,{dropdown:r,"aria-expanded":a===r.title,onMouseEnter:()=>{var s;return n((s=r.title)!=null?s:"")},onMouseLeave:()=>n("")},`MegaMenuDropdownTrigger-${r._key}`):t(k,{link:r},`MegaMenuLink-${r._key}`)},`MegaMenuNavLink-${r._key}`)):null,e&&e.length>0?e==null?void 0:e.slice(3,6).map(r=>t(v,{children:r._type==="dropdown"?t(C,{dropdown:r,"aria-expanded":a===r.title,onMouseEnter:()=>{var s;return n((s=r.title)!=null?s:"")},onMouseLeave:()=>n("")},`MegaMenuDropdownTrigger-${r._key}`):t(k,{link:r},`MegaMenuLink-${r._key}`)},`MegaMenuNavLink-${r._key}`)):null]})},k=({link:e,className:a})=>t(b,{ariaLabel:`Go to ${e.label}`,as:"link",variant:"unstyled",link:e,className:w("relative text-black text-sm font-normal font-label uppercase tracking-widest group",a),children:e.label}),C=S((e,a)=>{let{dropdown:n,onClick:o,onMouseEnter:i,onMouseLeave:l,className:r,...s}=e;return t("button",{ref:a,onClick:o,onMouseEnter:i,onMouseLeave:l,"aria-label":`Open the ${n.title} menu`,className:w("relative text-black text-sm font-normal font-label uppercase tracking-widest group",r),...s,children:n.title})}),ee=({data:e,currentDropdown:a,setCurrentDropdown:n})=>t(D,{children:e&&e.length>0?e==null?void 0:e.map(o=>{var l,r,s;let i=a===o.title&&o.title!=="";return t(te,{label:(l=o.title)!=null?l:"",showcaseLink:(r=o.showcaseLink)!=null?r:[],groupedLinks:(s=o.groupOfLinks)!=null?s:[],currentDropdown:a,setCurrentDropdown:n},`MegaMenuDropdown-${o._key}`)}):null});function te({label:e,showcaseLink:a,groupedLinks:n,currentDropdown:o,setCurrentDropdown:i}){let l=o===e&&e!=="",r=n.length>0,s=a.length>0,c=j(()=>n.length>0?n.map(u=>{var m;return((m=u.links)==null?void 0:m.length)>2?"3fr":"1fr"}).join(" "):"1fr",[n]),d=r?`${c} ${s?"2fr":""}`:s?"2fr":"1fr";return t($,{"data-show":l,onMouseEnter:()=>i(e),onMouseLeave:()=>i(""),className:`relative top-6 left-0 w-full overflow-hidden z-50 bg-primary/5 !transition-[max-height] !duration-300 !ease-in-out ${l?"max-h-[500px]":"max-h-0"}`,children:p("div",{style:{display:"grid",gridTemplateColumns:d,gridTemplateRows:"1fr"},className:"relative w-full h-auto max-w-[90rem] mx-auto",children:[t(ne,{groupedLinks:n}),t(oe,{hasShowcaseLinks:s,showcaseLink:a})]})})}function ne({groupedLinks:e}){return t(v,{children:e&&e.length>0&&(e==null?void 0:e.map((a,n)=>{var o;return p("div",{className:"relative py-10 pl-5 flex flex-col items-end justify-start h-full w-full border-r border-black last:border-r-0",children:[t(A,{fontSize:"sm",className:"text-black font-normal uppercase tracking-widest font-label self-start pb-4",children:a.title}),t(f,{direction:"row",align:"start",justify:"start",gap:4,className:"relative w-full h-full grid-flow-row",children:(o=a.links)==null?void 0:o.map((i,l)=>{var r,s,c;return p(f,{direction:"col",className:"h-fit w-fit",children:[t(b,{ariaLabel:(r=i.title)!=null?r:"",as:"link",link:(s=i==null?void 0:i.primaryButton)!=null?s:{},variant:"unstyled",className:"text-black text-sm font-normal font-heading-kb leading-[30px] underline uppercase underline-offset-2",children:i==null?void 0:i.title}),t(f,{direction:"col",align:"start",justify:"start",gap:2,className:"w-fit h-full",children:(c=i.links)==null?void 0:c.map((d,u)=>{var m;return t(b,{ariaLabel:(m=d.label)!=null?m:"",as:"link",link:d!=null?d:{},variant:"unstyled",className:"text-black text-sm font-normal font-heading-kb leading-[30px] hover:underline",children:d==null?void 0:d.label},`MegaDropdownContent-Item-Link-${d._key}-${u}`)})})]},`MegaDropdownContent-Item-Link-${i._key}-${l}`)})})]},`MegaDropdownContent-Item-${a._key}-${n}`)}))})}function oe({hasShowcaseLinks:e,showcaseLink:a}){return e?t(f,{direction:"row",align:"start",justify:"start",className:"w-full h-full gap-6 pl-5 py-10",children:a==null?void 0:a.map((n,o)=>{var l,r,s,c,d,u,m;let i=(l=n.mainImage)==null?void 0:l.image;return t(b,{ariaLabel:(s=(r=n.primaryButton)==null?void 0:r.label)!=null?s:"",as:"link",link:(c=n.primaryButton)!=null?c:{},variant:"unstyled",className:"text-center text-black text-sm font-normal font-heading-kb leading-[30px] hover:underline",children:p(f,{direction:"col",align:"center",justify:"center",gap:3,children:[t(x,{src:i,alt:(u=(d=n.mainImage)==null?void 0:d.alt)!=null?u:"",width:500,height:500,className:"w-[188px] h-[147px] object-cover object-center"},o),(m=n.primaryButton)==null?void 0:m.label]})},`MegaDropdownContent-Item-Images-${n._key}-${o}`)})}):null}function re(e){return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:t("path",{fill:"currentColor",d:"M3 8V7h17v1zm17 4v1H3v-1zM3 17h17v1H3z"})})}export{q as a};
|
package/dist/chunk-UTHMMDZO.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk-S35O64PB.mjs";import{Image as L}from"@stackshift-ui/image";import{Link as l}from"@stackshift-ui/link";import{Section as z}from"@stackshift-ui/section";import{SocialIcons as H}from"@stackshift-ui/social-icons";import R,{Fragment as j,useState as $}from"react";import{BsChevronDown as C}from"react-icons/bs";import{animated as T,useSpring as P}from"@react-spring/web";import{useWindowScroll as B}from"@uidotdev/usehooks";import{Fragment as S,jsx as a,jsxs as d}from"react/jsx-runtime";var n="small-text-style group-hover:text-white hover:text-white relative after:content-[''] after:w-0 hover:after:w-full h-5 !outline-none after:h-[0.5px] after:bg-white after:absolute after:bottom-0 after:left-0 after:transition-all after:duration-300";function D({logo:e,socialMedia:o,dropdownMenu:r}){let[t,c]=$(!1),[s,u]=R.useState(!1),[f,p]=$(null),[v,i]=$(!1),x=()=>{u(h=>!h),s?document.body.style.overflow="unset":document.body.style.overflow="hidden"},g=P({transform:s?"translate(9px, 32px) rotate(-45deg) scaleX(1.5)":"translate(17px, 17px) rotate(0deg) scaleX(1)"}),m=P({transform:s?"translate(12px, 11px) rotate(45deg)":"translate(7px, 27px) rotate(0deg)"}),[{x:b,y:w}]=B(),_=w&&w>5?"bg-black fixed top-0":"fixed bg-transparent",M=w&&w>5,I=h=>{h&&p(f===h?null:h)},A=h=>{i(h)};return a(z,{className:"!px-0 w-full flex flex-col absolute top-0 z-50",children:d("nav",{className:`w-full z-50 md:gap-2 gap-0 hover:bg-black/80 transition-colors duration-300 ${t?"!bg-black border-b-white":"border-b-transparent"} ${_}`,onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),children:[a("div",{className:"w-full z-10 px-4",children:d("div",{className:"w-full flex flex-wrap justify-between items-center py-6",children:[d("div",{className:"flex items-center space-x-[50px]",children:[a(F,{logo:e}),a(O,{dropdownMenu:r,isNavHovered:v,setShowDropdown:c})]}),a(q,{menu:s,showMenu:x,firstLine:g,secondLine:m,isNavHovered:v})]})}),a(E,{menu:s,showMenu:x,dropdownMenu:r,logo:e,openAccordion:f,toggleAccordion:I,socialMedia:o})]})})}function F({logo:e}){var o;return a("div",{className:"w-[200px] relative z-20",children:(e==null?void 0:e.image)&&a(l,{"aria-label":`Go to ${y(e)}`,className:"text-3xl font-bold leading-none",href:y(e),children:a(L,{className:"md:h-[75px]",src:e==null?void 0:e.image,alt:(o=e==null?void 0:e.alt)!=null?o:"navigation-logo",width:100,height:100})})})}function O({dropdownMenu:e,isNavHovered:o,setShowDropdown:r}){return!e||(e==null?void 0:e.length)===0?null:a(j,{children:e&&(e==null?void 0:e.length)>0&&a("ul",{className:"hidden lg:flex flex-wrap space-x-[50px] xl:min-w-max",children:e==null?void 0:e.map(t=>a(R.Fragment,{children:(t==null?void 0:t.label)&&(t==null?void 0:t._key)&&a("li",{className:"static z-20 hover:z-10",children:(t==null?void 0:t.routeType)==="singleRoute"?a(N,{link:t,style:`${n} ${o?"text-white":"text-black"}`}):(t==null?void 0:t.routeType)==="multipleRoute"?a(G,{link:t,isNavHovered:o,onHover:()=>r(!0),onLeave:()=>r(!1)}):a("span",{className:`${n} ${o?"text-white":"text-black"}`,children:t==null?void 0:t.label})})},t._key))})})}function N({link:e,style:o=n}){var r,t,c,s,u,f,p;return a(S,{children:e.linkType==="linkInternal"?a(l,{"aria-label":`Navigation ${(r=e==null?void 0:e.label)!=null?r:"Menu"} links which directs to ${(e==null?void 0:e.internalLink)===void 0?"page-not-found":e==null?void 0:e.internalLink}`,className:o,target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",href:`${((t=e.internalLink)==null?void 0:t.toLowerCase())==="home"?"/":`${e.internalLink?e==null?void 0:e.internalLink:"page-not-found"}`}`,children:e==null?void 0:e.label}):(e==null?void 0:e.linkType)==="linkText"&&((c=e==null?void 0:e.linkText)==null?void 0:c.slice(0,1))!=="/"?a("a",{href:e!=null&&e.linkText?e==null?void 0:e.linkText:"link-not-found","aria-label":`Navigation ${(s=e==null?void 0:e.label)!=null?s:"Menu"} links which directs to ${(e==null?void 0:e.linkText)===void 0?"link-not-found":e==null?void 0:e.linkText}`,className:o,target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:e==null?void 0:e.label}):(e==null?void 0:e.linkType)==="linkText"&&((u=e==null?void 0:e.linkText)==null?void 0:u.slice(0,1))==="/"?a(l,{"aria-label":`Navigation ${(f=e==null?void 0:e.label)!=null?f:"Menu"} links which directs to ${(e==null?void 0:e.linkText)===void 0?"link-not-found":e==null?void 0:e.linkText}`,className:o,target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",href:e!=null&&e.linkText?e==null?void 0:e.linkText:"link-not-found",children:e==null?void 0:e.label}):a("a",{"aria-label":`Navigation ${(p=e==null?void 0:e.label)!=null?p:"Menu"} links which directs to ${(e==null?void 0:e.externalLink)===void 0?"link-not-found":e==null?void 0:e.externalLink}`,className:o,target:e==null?void 0:e.linkTarget,href:`${e.externalLink===void 0?"link-not-found":e.externalLink}`,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:e==null?void 0:e.label})})}function G({link:e,onHover:o,onLeave:r,isNavHovered:t}){var c,s,u,f,p,v,i,x,g,m;return d("div",{className:"group relative",onMouseEnter:o,onMouseLeave:r,children:[a("button",{className:`${n} group-hover:after:!w-full flex items-center space-x-2 ${t?"text-white":"text-black"}`,children:a("span",{children:e==null?void 0:e.label})}),a("div",{className:"fixed left-0 right-0 top-[80px] pointer-events-none group-hover:pointer-events-auto opacity-0 group-hover:opacity-100 transition-opacity duration-300",children:a("div",{className:"w-3/4 mx-auto bg-black",children:a("div",{className:"max-w-[1440px] mx-auto px-4",children:a("div",{className:"p-[30px]",children:d("div",{className:"grid grid-cols-5 gap-[30px]",children:[(e==null?void 0:e.featuredRoute)&&a("div",{className:"col-span-2 pr-[20px]",children:d("div",{className:"w-full h-0 pb-[75%] relative bg-obsidian",children:[((c=e==null?void 0:e.featuredRoute)==null?void 0:c.featuredLink)&&a("div",{className:"absolute w-full h-full inset-0 p-[15px] flex flex-col justify-end z-10",children:a("span",{children:a(N,{link:(s=e==null?void 0:e.featuredRoute)==null?void 0:s.featuredLink,style:"small-text-style text-white underline underline-offset-4 decoration-[0.5px] opacity-50 hover:opacity-100 h-5 !outline-none transition-all duration-300 after:absolute after:inset-0"})})}),((u=e==null?void 0:e.featuredRoute)==null?void 0:u.mainImage)&&a(L,{src:(p=(f=e==null?void 0:e.featuredRoute)==null?void 0:f.mainImage)==null?void 0:p.image,alt:(x=(i=(v=e==null?void 0:e.featuredRoute)==null?void 0:v.mainImage)==null?void 0:i.alt)!=null?x:"image",width:100,height:100,className:"object-cover absolute inset-0 w-full h-full"})]})}),(e==null?void 0:e.multipleRoutes)&&a("div",{className:"col-span-3 py-[20px]",children:d("div",{className:"flex flex-col space-y-10",children:[(e==null?void 0:e.label)&&a("p",{className:"h3 text-white",children:e==null?void 0:e.label}),a("ul",{className:`grid gap-x-[60px] gap-y-3 ${((g=e==null?void 0:e.multipleRoutes)==null?void 0:g.length)>3?"grid-cols-2":"grid-cols-1"}`,children:(m=e==null?void 0:e.multipleRoutes)==null?void 0:m.map(b=>a("li",{children:(b==null?void 0:b.label)&&a(N,{link:b,style:n})},b._key))})]})})]})})})})})]})}function E({menu:e,showMenu:o,logo:r,dropdownMenu:t,openAccordion:c,toggleAccordion:s,socialMedia:u}){return d("div",{className:`${e?"block":"hidden"} navbar-menu fixed inset-0 z-50`,children:[a("div",{className:"fixed inset-0 bg-black/80",onClick:o}),a("div",{className:"fixed top-0 right-0 bottom-0 flex flex-col w-full sm:max-w-sm bg-black/80",children:d("nav",{className:"flex flex-col w-full py-6 px-6 overflow-y-auto h-screen",children:[a(X,{logo:r,showMenu:o}),a(W,{dropdownMenu:t,openAccordion:c,toggleAccordion:s}),a(Y,{socialMedia:u}),a("div",{className:"mt-auto pt-20 text-gray-400",children:a("span",{className:"text-sm text-center block",children:`\xA9 ${new Date().getFullYear()} All rights reserved.`})})]})})]})}function X({logo:e,showMenu:o}){var r;return e!=null&&e.image?a(l,{"aria-label":`Go to ${y(e)}`,className:"text-3xl font-bold leading-none h-[40px] w-[100px] flex items-center justify-start mt-0 md:ml-[15px]",onClick:o,href:y(e),children:a(L,{className:"h-[20px] object-contain",src:e==null?void 0:e.image,alt:(r=e==null?void 0:e.alt)!=null?r:"navigation-logo"})}):null}function W({dropdownMenu:e,openAccordion:o,toggleAccordion:r}){return a("div",{className:"mt-[70px]",children:a(J,{children:e==null?void 0:e.map(t=>{var c,s,u,f,p,v,i,x,g;return a(R.Fragment,{children:(t==null?void 0:t.label)&&(t==null?void 0:t._key)&&a(S,{children:(t==null?void 0:t.routeType)==="singleRoute"?a("span",{children:a(N,{link:t,style:`${n} !text-base !h-auto text-white`})}):(t==null?void 0:t.routeType)==="multipleRoute"?d(K,{children:[a(Q,{isOpen:o===t._key,onClick:()=>t._key&&r(t._key),className:`${n} after:!w-0 !p-0 text-white`,children:t==null?void 0:t.label}),a(U,{isOpen:o===t._key,children:d("div",{className:"py-6 flex flex-col space-y-2",children:[(t==null?void 0:t.featuredRoute)&&a("div",{children:d("div",{className:"w-full h-0 pb-[75%] relative bg-obsidian",children:[((c=t==null?void 0:t.featuredRoute)==null?void 0:c.featuredLink)&&a("div",{className:"absolute w-full h-full inset-0 p-[15px] flex flex-col justify-end z-10",children:a("span",{children:a(N,{link:(s=t==null?void 0:t.featuredRoute)==null?void 0:s.featuredLink,style:"small-text-style text-white underline underline-offset-4 decoration-[0.5px] opacity-50 hover:opacity-100 h-5 !outline-none transition-all duration-300"})})}),((u=t==null?void 0:t.featuredRoute)==null?void 0:u.mainImage)&&a(L,{src:(p=(f=t==null?void 0:t.featuredRoute)==null?void 0:f.mainImage)==null?void 0:p.image,className:"object-cover absolute inset-0 w-full h-full",alt:(x=(i=(v=t==null?void 0:t.featuredRoute)==null?void 0:v.mainImage)==null?void 0:i.alt)!=null?x:"image"})]})}),(t==null?void 0:t.multipleRoutes)&&a("ul",{className:"flex flex-col justify-center space-y-1 pl-[15px]",children:(g=t==null?void 0:t.multipleRoutes)==null?void 0:g.map(m=>a("li",{children:(m==null?void 0:m.label)&&a(N,{link:m,style:`${n} text-white`})},m._key))})]})})]}):a("span",{className:`${n} text-white`,children:t==null?void 0:t.label})})},t._key)})})})}function Y({socialMedia:e}){return e?a("div",{className:"mt-[70px] flex justify-center space-x-[50px]",children:e==null?void 0:e.map(o=>(o==null?void 0:o.socialMediaLink)&&a(l,{"aria-label":(o==null?void 0:o.socialMedia)||(o==null?void 0:o.socialMediaPlatform)||"social-media-link",className:"text-white hover:text-gray-2 leading-none transition",style:{fontSize:"24px"},target:"_blank",rel:"noopener noreferrer",href:o==null?void 0:o.socialMediaLink,children:a(H,{social:o==null?void 0:o.socialMedia})},o==null?void 0:o._key))}):null}function q({menu:e,showMenu:o,firstLine:r,secondLine:t,isNavHovered:c}){return a("div",{className:`block pr-4 lg:hidden z-[99] ${e?"fixed right-[20px] md:right-[50px]":"relative"}`,children:d("svg",{onClick:o,width:"40",height:"40",viewBox:"0 0 44 44",fill:c?"#ffffff":"#000000",xmlns:"http://www.w3.org/2000/svg",className:"cursor-pointer",children:[a(T.rect,{width:"20",height:"3",style:r}),a(T.rect,{width:"30",height:"3",style:t})]})})}function J({children:e,className:o=""}){return a("div",{className:`flex flex-col space-y-6 ${o}`,children:e})}function K({children:e,className:o=""}){return a("div",{className:`border-none ${o}`,children:e})}function Q({children:e,className:o="",isOpen:r,onClick:t}){return d("button",{onClick:t,className:`${o} flex items-center justify-between w-full`,children:[e,a(C,{className:`transform transition-transform duration-200 ${r?"rotate-180":""}`})]})}function U({children:e,isOpen:o}){return a("div",{className:`overflow-hidden transition-all duration-200 ${o?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"}`,children:e})}export{D as a};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Context } from "react";
|
|
2
|
-
export interface MegaNavContextValues {
|
|
3
|
-
currentDropdown: string;
|
|
4
|
-
showDropdown: boolean;
|
|
5
|
-
showMobileMenu: boolean;
|
|
6
|
-
setShowDropdown: (state: boolean) => void;
|
|
7
|
-
setCurrentDropdown: (dropdown: string) => void;
|
|
8
|
-
setShowMobileMenu: (state: boolean) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare const MegaNavContext: Context<MegaNavContextValues>;
|
|
11
|
-
export declare function MegaNavContextProvider({ children }: {
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare function useMegaNavContext(): MegaNavContextValues;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createContext as h,useContext as C,useEffect as v,useMemo as f,useRef as x,useState as r}from"react";import{jsx as D}from"react/jsx-runtime";var i=h({currentDropdown:"",showDropdown:!1,showMobileMenu:!1,setShowDropdown:()=>{},setCurrentDropdown:()=>{},setShowMobileMenu:()=>{}});function N({children:o}){let[s,u]=r(""),[t,l]=r(!1),[n,w]=r(!1),e=x(null),d=()=>{l(!t)},c=a=>{e.current&&clearTimeout(e.current),a===""?e.current=setTimeout(()=>{u("")},200):u(a)},M=()=>{w(!n)};v(()=>()=>{e.current&&clearTimeout(e.current)},[]);let p=f(()=>({currentDropdown:s,showDropdown:t,showMobileMenu:n,setShowDropdown:d,setCurrentDropdown:c,setShowMobileMenu:M}),[s,t,n]);return D(i.Provider,{value:p,children:o})}function S(){let o=C(i);if(o===void 0)throw new Error("useMegaNavContext must be used within a MegaNavContextProvider");return o}export{i as MegaNavContext,N as MegaNavContextProvider,S as useMegaNavContext};
|
|
File without changes
|