@stackshift-ui/navigation 6.1.0-alpha.2 → 6.1.0-alpha.4

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.
@@ -0,0 +1 @@
1
+ import{lazy as e}from"react";import{jsx as V}from"react/jsx-runtime";var i={variant_a:e(()=>import("./navigation_a.mjs")),variant_b:e(()=>import("./navigation_b.mjs")),variant_c:e(()=>import("./navigation_c.mjs")),variant_d:e(()=>import("./navigation_d.mjs")),variant_f:e(()=>import("./navigation_f.mjs")),variant_g:e(()=>import("./navigation_g.mjs")),variant_h:e(()=>import("./navigation_h.mjs"))},C="Navigation",F=({data:n})=>{var s,u,l,p,v,c,L,m,t,y,f,g,b,k,M,R,B,h,_,N,K,W,w,P,S,x;let o=n==null?void 0:n.variant,r=o&&(i==null?void 0:i[o]),z={logo:(u=(s=n==null?void 0:n.variants)==null?void 0:s.logo)!=null?u:void 0,links:(p=(l=n==null?void 0:n.variants)==null?void 0:l.routes)!=null?p:void 0,primaryButton:(c=(v=n==null?void 0:n.variants)==null?void 0:v.primaryButton)!=null?c:void 0,secondaryButton:(m=(L=n==null?void 0:n.variants)==null?void 0:L.secondaryButton)!=null?m:void 0,banner:(y=(t=n==null?void 0:n.variants)==null?void 0:t.banner)!=null?y:void 0,multipleLinks:(g=(f=n==null?void 0:n.variants)==null?void 0:f.multipleLinks)!=null?g:void 0,title:(k=(b=n==null?void 0:n.variants)==null?void 0:b.title)!=null?k:void 0,dropdownMenu:(R=(M=n==null?void 0:n.variants)==null?void 0:M.dropdownMenu)!=null?R:void 0,logos:(h=(B=n==null?void 0:n.variants)==null?void 0:B.logos)!=null?h:void 0,socialMedia:(N=(_=n==null?void 0:n.variants)==null?void 0:_.socialMedia)!=null?N:void 0,socialLinks:(W=(K=n==null?void 0:n.variants)==null?void 0:K.socialLinks)!=null?W:void 0,iconLinks:(P=(w=n==null?void 0:n.variants)==null?void 0:w.iconLinks)!=null?P:void 0,megaMenu:(x=(S=n==null?void 0:n.variants)==null?void 0:S.megaMenu)!=null?x:void 0};return r?V(r,{...z}):null};F.displayName=C;export{F as a};
@@ -0,0 +1 @@
1
+ import{Link as f}from"@stackshift-ui/link";import{jsx as y}from"react/jsx-runtime";var b=r=>{var a,u,p;return r!=null&&r.internalLink&&(r==null?void 0:r.type)==="linkInternal"?(u=(a=r==null?void 0:r.internalLink)==null?void 0:a.toLowerCase())!=null&&u.includes("home")?"/":`/${r.internalLink}`:r!=null&&r.externalLink&&(r==null?void 0:r.type)==="linkExternal"&&(p=r==null?void 0:r.externalLink)!=null?p:"/"},o=({className:r,ariaLabel:a,style:u={},children:p,link:e,target:n})=>{var c,s;let L="inline-block py-2 px-6 rounded-l-xl rounded-t-xl bg-primary hover:bg-primary-foreground text-gray-50 font-bold leading-loose outline-none transition duration-200";if(!(e!=null&&e.internalLink)&&!(e!=null&&e.externalLink))return y("a",{className:r!=null?r:L,"aria-label":a,target:n,href:"/page-not-found",children:p});if(((e==null?void 0:e.type)==="linkInternal"||e.linkType==="linkInternal")&&((c=e==null?void 0:e.internalLink)==null?void 0:c.toLowerCase())==="home")return y(f,{href:(e==null?void 0:e.referenceType)==="projects"?"/projects":"/","aria-label":a,className:r!=null?r:L,target:n,children:p});if((e==null?void 0:e.type)==="linkInternal"||(e==null?void 0:e.linkType)==="linkInternal"){let t="";switch(e==null?void 0:e.referenceType){case"projects":t=`/projects/${e==null?void 0:e.internalLink}`;break;case"commercial":t=`/projects/commercial/${e==null?void 0:e.internalLink}`;break;case"residential":t=`/projects/residential/${e==null?void 0:e.internalLink}`;break;case"landscape":t=`/projects/landscape/${e==null?void 0:e.internalLink}`;break;case"public":t=`/projects/public/${e==null?void 0:e.internalLink}`;break;case"teaching":t=`/projects/teaching/${e==null?void 0:e.internalLink}`;break;case"designInMotion":t=`/projects/future-projects/${e==null?void 0:e.internalLink}`;break;case"renovation":t=`/projects/residential/renovation/${e==null?void 0:e.internalLink}`;break;case"newConstruction":t=`/projects/residential/new-construction/${e==null?void 0:e.internalLink}`;break;case"ourTeam":t=`/our-team/${e==null?void 0:e.internalLink}`;break;case"recognition":t=`/recognition/${e==null?void 0:e.internalLink}`;break;default:t=`/${e==null?void 0:e.internalLink}`}return y(f,{href:t,"aria-label":a,className:r!=null?r:L,target:n,children:p})}else return(e==null?void 0:e.type)==="linkExternal"||(e==null?void 0:e.linkType)==="linkExternal"?y("a",{"aria-label":a,className:r!=null?r:L,href:(s=e==null?void 0:e.externalLink)!=null?s:"",target:n,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":void 0,children:p}):y(f,{href:"/","aria-label":a,className:r!=null?r:L,target:n,children:p})};export{b as a,o as b};
@@ -1 +1 @@
1
- import{a as E,b as h}from"./chunk-V7KKZJMX.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 $,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,D]=y(!1),[i,C]=y(!1),M=d=>{n.current&&!n.current.contains(d.target)&&l(null)};$(()=>{let d=x=>{M(x)};return document.addEventListener("click",d),()=>{document.removeEventListener("click",d)}},[]);let w=d=>{d&&d.stopPropagation(),D(x=>!x)};return $(()=>{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 ${a?"text-white":"text-black"}`,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);$(()=>{let t=()=>u(window.scrollY>0);return window.addEventListener("scroll",t),()=>window.removeEventListener("scroll",t)},[]),$(()=>{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})},D=(t,b,v=!1,m)=>{let g=(t==null?void 0:t.label)==="New Construction",S=(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||S?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 D(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};
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 $,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,D]=y(!1),[i,C]=y(!1),M=d=>{n.current&&!n.current.contains(d.target)&&l(null)};$(()=>{let d=x=>{M(x)};return document.addEventListener("click",d),()=>{document.removeEventListener("click",d)}},[]);let w=d=>{d&&d.stopPropagation(),D(x=>!x)};return $(()=>{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 ${a?"text-white":"text-black"}`,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);$(()=>{let t=()=>u(window.scrollY>0);return window.addEventListener("scroll",t),()=>window.removeEventListener("scroll",t)},[]),$(()=>{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})},D=(t,b,v=!1,m)=>{let g=(t==null?void 0:t.label)==="New Construction",S=(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||S?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 D(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 y}from"./chunk-4N6ET2I6.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 j}from"@stackshift-ui/social-icons";import R,{Fragment as C,useState as $}from"react";import{BsChevronDown as B}from"react-icons/bs";import{animated as T,useSpring as P}from"@react-spring/web";import{useWindowScroll as H}from"@uidotdev/usehooks";import{Fragment as S,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]=$(!1),[s,u]=R.useState(!1),[f,p]=$(null),[x,g]=$(!1),v=()=>{u(h=>!h),s?document.body.style.overflow="unset":document.body.style.overflow="hidden"},i=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}]=H(),_=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=>{g(h)};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"} ${_}`,onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!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:x,setShowDropdown:d})]}),a(q,{menu:s,showMenu:v,firstLine:i,secondLine:m})]})}),a(E,{menu:s,showMenu:v,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:(console.log("\u{1F680} ~ dropdownMenu",e),a(C,{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,d,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"&&((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(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 d,s,u,f,p,x,g,v,i,m;return c("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: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:[((d=e==null?void 0:e.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(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:(v=(g=(x=e==null?void 0:e.featuredRoute)==null?void 0:x.mainImage)==null?void 0:g.alt)!=null?v:"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 ${((i=e==null?void 0:e.multipleRoutes)==null?void 0:i.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: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(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 d,s,u,f,p,x,g,v,i;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"?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(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:(v=(g=(x=t==null?void 0:t.featuredRoute)==null?void 0:x.mainImage)==null?void 0:g.alt)!=null?v:"image"})]})}),(t==null?void 0:t.multipleRoutes)&&a("ul",{className:"flex flex-col justify-center space-y-1 pl-[15px]",children:(i=t==null?void 0:t.multipleRoutes)==null?void 0:i.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(j,{social:o==null?void 0:o.socialMedia})},o==null?void 0:o._key))}):null}function q({menu:e,showMenu:o,firstLine:r,secondLine:t}){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:"#ffffff",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 c("button",{onClick:t,className:`${o} flex items-center justify-between w-full`,children:[e,a(B,{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,b}from"../chunk-V7KKZJMX.mjs";export{b as ConditionalLink,a as logoLink};
1
+ import{a,b}from"../chunk-S35O64PB.mjs";export{b as ConditionalLink,a as logoLink};
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";import{a as f}from"./chunk-6QSBJPEW.mjs";import{a as m}from"./chunk-PCTXJCVP.mjs";import{a as p}from"./chunk-P3TZNIE6.mjs";import"./chunk-V7KKZJMX.mjs";import"./chunk-OXF5VEOU.mjs";import{a as x}from"./chunk-MSVUIX4E.mjs";import{a as o}from"./chunk-SVLHEWIY.mjs";import{a as r}from"./chunk-LBUYM4NV.mjs";import{a as e}from"./chunk-EASZP4S2.mjs";import{a as t}from"./chunk-67XVPRGX.mjs";import"./chunk-4N6ET2I6.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};
2
+ "use strict";import{a as f}from"./chunk-TCOSJJF3.mjs";import{a as m}from"./chunk-X2X45FZ6.mjs";import{a as p}from"./chunk-P3TZNIE6.mjs";import"./chunk-S35O64PB.mjs";import"./chunk-OXF5VEOU.mjs";import{a as x}from"./chunk-CUJMKP26.mjs";import{a as o}from"./chunk-SVLHEWIY.mjs";import{a as r}from"./chunk-LBUYM4NV.mjs";import{a as e}from"./chunk-EASZP4S2.mjs";import{a as t}from"./chunk-67XVPRGX.mjs";import"./chunk-4N6ET2I6.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};
@@ -9,7 +9,6 @@ export interface ResponsiveNavLinksProps {
9
9
  export interface NavigationProps {
10
10
  template?: any;
11
11
  logo?: Logo;
12
- smallLogo?: Logo;
13
12
  logos?: Logos[];
14
13
  links?: LabeledRouteWithKey[];
15
14
  primaryButton?: LabeledRoute;
@@ -1 +1 @@
1
- import{a}from"./chunk-MSVUIX4E.mjs";export{a as Navigation};
1
+ import{a}from"./chunk-CUJMKP26.mjs";export{a as Navigation};
@@ -1 +1 @@
1
- import{a}from"./chunk-6QSBJPEW.mjs";import"./chunk-V7KKZJMX.mjs";export{a as Navigation_F,a as default};
1
+ import{a}from"./chunk-TCOSJJF3.mjs";import"./chunk-S35O64PB.mjs";export{a as Navigation_F,a as default};
@@ -1,3 +1,3 @@
1
- import { NavigationProps } from "./navigation";
2
- export default function Navigation_G({ logo, smallLogo, socialMedia, dropdownMenu, }: NavigationProps): import("react/jsx-runtime").JSX.Element;
1
+ import { NavigationProps } from ".";
2
+ export default function Navigation_G({ logo, socialMedia, dropdownMenu }: NavigationProps): import("react/jsx-runtime").JSX.Element;
3
3
  export { Navigation_G };
@@ -1 +1 @@
1
- import{a}from"./chunk-PCTXJCVP.mjs";import"./chunk-4N6ET2I6.mjs";export{a as Navigation_G,a as default};
1
+ import{a}from"./chunk-X2X45FZ6.mjs";import"./chunk-4N6ET2I6.mjs";export{a as Navigation_G,a as default};
package/dist/types.d.ts CHANGED
@@ -24,7 +24,7 @@ export interface Logo extends ConditionalLink {
24
24
  image?: string;
25
25
  }
26
26
  export interface Logos {
27
- logo: Logo;
27
+ logo: Logo[];
28
28
  }
29
29
  export interface GroupOfLink {
30
30
  _type: string;
@@ -252,7 +252,6 @@ export interface Variants {
252
252
  megaMenu?: MegaMenu[];
253
253
  arrayOfTitleAndText?: ArrayOfTitleAndText[] | null;
254
254
  logo?: Logo | null;
255
- smallLogo?: Logo | null;
256
255
  logos?: Logos[] | null;
257
256
  primaryButton?: LabeledRoute | null;
258
257
  secondaryButton?: LabeledRoute | null;
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.2",
4
+ "version": "6.1.0-alpha.4",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.js",
@@ -38,19 +38,18 @@
38
38
  "@react-spring/web": "^10.0.1",
39
39
  "@uidotdev/usehooks": "^2.4.1",
40
40
  "react-icons": "^5.3.0",
41
- "react-sticky-el": "^2.1.1",
42
41
  "@stackshift-ui/button": "6.0.11",
43
42
  "@stackshift-ui/container": "6.0.11",
44
- "@stackshift-ui/image": "6.0.11",
45
- "@stackshift-ui/scripts": "6.0.10",
46
43
  "@stackshift-ui/flex": "6.0.11",
47
- "@stackshift-ui/grid": "6.0.11",
44
+ "@stackshift-ui/image": "6.0.11",
48
45
  "@stackshift-ui/link": "6.0.11",
49
- "@stackshift-ui/heading": "6.0.11",
46
+ "@stackshift-ui/scripts": "6.0.10",
50
47
  "@stackshift-ui/section": "6.0.11",
51
- "@stackshift-ui/social-icons": "6.0.12",
48
+ "@stackshift-ui/text": "6.0.11",
49
+ "@stackshift-ui/grid": "6.0.11",
52
50
  "@stackshift-ui/system": "6.0.11",
53
- "@stackshift-ui/text": "6.0.11"
51
+ "@stackshift-ui/social-icons": "6.0.12",
52
+ "@stackshift-ui/heading": "6.0.11"
54
53
  },
55
54
  "peerDependencies": {
56
55
  "@stackshift-ui/system": ">=6.0.11",
@@ -37,7 +37,7 @@ export const ConditionalLink = ({
37
37
  </a>
38
38
  );
39
39
  } else if (
40
- link?.type === "linkInternal" &&
40
+ (link?.type === "linkInternal" || link.linkType === "linkInternal") &&
41
41
  // link?.internalLink?.toLowerCase()?.includes("home")
42
42
  link?.internalLink?.toLowerCase() === "home"
43
43
  ) {
@@ -51,7 +51,7 @@ export const ConditionalLink = ({
51
51
  {children}
52
52
  </Link>
53
53
  );
54
- } else if (link?.type === "linkInternal") {
54
+ } else if (link?.type === "linkInternal" || link?.linkType === "linkInternal") {
55
55
  let hrefPath = "";
56
56
 
57
57
  switch (link?.referenceType) {
@@ -103,7 +103,7 @@ export const ConditionalLink = ({
103
103
  {children}
104
104
  </Link>
105
105
  );
106
- } else if (link?.type === "linkExternal") {
106
+ } else if (link?.type === "linkExternal" || link?.linkType === "linkExternal") {
107
107
  return (
108
108
  <a
109
109
  aria-label={ariaLabel}
@@ -30,7 +30,6 @@ export interface ResponsiveNavLinksProps {
30
30
  export interface NavigationProps {
31
31
  template?: any;
32
32
  logo?: Logo;
33
- smallLogo?: Logo;
34
33
  logos?: Logos[];
35
34
  links?: LabeledRouteWithKey[];
36
35
  primaryButton?: LabeledRoute;
@@ -52,7 +51,6 @@ export const Navigation: React.FC<SectionsProps> = ({ data }) => {
52
51
 
53
52
  const props = {
54
53
  logo: data?.variants?.logo ?? undefined,
55
- smallLogo: data?.variants?.smallLogo ?? undefined,
56
54
  links: data?.variants?.routes ?? undefined,
57
55
  primaryButton: data?.variants?.primaryButton ?? undefined,
58
56
  secondaryButton: data?.variants?.secondaryButton ?? undefined,
@@ -7,45 +7,20 @@ import { BsChevronDown } from "react-icons/bs";
7
7
 
8
8
  import { animated, useSpring } from "@react-spring/web";
9
9
  import { useWindowScroll } from "@uidotdev/usehooks";
10
- import Sticky from "react-sticky-el";
11
10
 
11
+ import { NavigationProps } from "./";
12
12
  import { logoLink } from "./helper";
13
- import { NavigationProps } from "./navigation";
14
13
  import { Socials } from "./types";
15
14
 
16
15
  const navlinkStyle =
17
16
  "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";
18
17
 
19
- export default function Navigation_G({
20
- logo,
21
- smallLogo,
22
- socialMedia,
23
- dropdownMenu,
24
- }: NavigationProps) {
18
+ export default function Navigation_G({ logo, socialMedia, dropdownMenu }: NavigationProps) {
25
19
  const [showDropdown, setShowDropdown] = useState(false);
26
20
  const [menu, setMenu] = React.useState(false);
27
21
  const [openAccordion, setOpenAccordion] = useState<string | null>(null);
28
22
  const [isNavHovered, setIsNavHovered] = useState<boolean>(false);
29
23
 
30
- let smallLogoLink;
31
- if (smallLogo?.type === "linkInternal") {
32
- if (smallLogo?.internalLink === undefined) {
33
- smallLogoLink = `/`;
34
- } else {
35
- if (smallLogo?.internalLink === "Home" || smallLogo?.internalLink === "home") {
36
- smallLogoLink = `/`;
37
- } else {
38
- smallLogoLink = `/${smallLogo?.internalLink}`;
39
- }
40
- }
41
- } else {
42
- if (smallLogo?.externalLink === undefined) {
43
- smallLogoLink = `/`;
44
- } else {
45
- smallLogoLink = smallLogo?.externalLink;
46
- }
47
- }
48
-
49
24
  const showMenu = () => {
50
25
  setMenu(prevState => !prevState);
51
26
 
@@ -80,60 +55,50 @@ export default function Navigation_G({
80
55
  };
81
56
 
82
57
  return (
83
- <Section className="w-full flex flex-col absolute top-0 z-50">
84
- <Sticky stickyClassName="pt-[80px]" topOffset={100} isIOSFixEnabled={false}>
85
- <nav
86
- className={`w-full z-50 md:gap-2 gap-0 hover:bg-black/80 transition-colors duration-300 ${
87
- showDropdown ? "!bg-black border-b-white" : "border-b-transparent"
88
- } ${sticky}`}
89
- onMouseEnter={() => handleNavHover(true)}
90
- onMouseLeave={() => handleNavHover(false)}>
91
- <div className={`container z-10`}>
92
- <div
93
- className={`w-full flex flex-wrap justify-between items-center ${
94
- isScrolled ? "py-6" : "py-6"
95
- }`}>
96
- <div className="flex items-center space-x-[50px]">
97
- <LogoSection logo={logo} smallLogo={smallLogo} smallLogoLink={smallLogoLink} />
98
- <DropdownMenuSection
99
- dropdownMenu={dropdownMenu}
100
- isNavHovered={isNavHovered}
101
- setShowDropdown={setShowDropdown}
102
- />
103
- </div>
104
- <BurgerMenuButton
105
- menu={menu}
106
- showMenu={showMenu}
107
- firstLine={firstLine}
108
- secondLine={secondLine}
58
+ <Section className="!px-0 w-full flex flex-col absolute top-0 z-50">
59
+ <nav
60
+ className={`w-full z-50 md:gap-2 gap-0 hover:bg-black/80 transition-colors duration-300 ${
61
+ showDropdown ? "!bg-black border-b-white" : "border-b-transparent"
62
+ } ${sticky}`}
63
+ onMouseEnter={() => handleNavHover(true)}
64
+ onMouseLeave={() => handleNavHover(false)}>
65
+ <div className="w-full z-10 px-4">
66
+ <div
67
+ className={`w-full flex flex-wrap justify-between items-center ${
68
+ isScrolled ? "py-6" : "py-6"
69
+ }`}>
70
+ <div className="flex items-center space-x-[50px]">
71
+ <LogoSection logo={logo} />
72
+ <DropdownMenuSection
73
+ dropdownMenu={dropdownMenu}
74
+ isNavHovered={isNavHovered}
75
+ setShowDropdown={setShowDropdown}
109
76
  />
110
77
  </div>
78
+ <BurgerMenuButton
79
+ menu={menu}
80
+ showMenu={showMenu}
81
+ firstLine={firstLine}
82
+ secondLine={secondLine}
83
+ isNavHovered={isNavHovered}
84
+ />
111
85
  </div>
112
- <MobileNavSidebar
113
- menu={menu}
114
- showMenu={showMenu}
115
- smallLogo={smallLogo}
116
- smallLogoLink={smallLogoLink}
117
- dropdownMenu={dropdownMenu}
118
- openAccordion={openAccordion}
119
- toggleAccordion={toggleAccordion}
120
- socialMedia={socialMedia}
121
- />
122
- </nav>
123
- </Sticky>
86
+ </div>
87
+ <MobileNavSidebar
88
+ menu={menu}
89
+ showMenu={showMenu}
90
+ dropdownMenu={dropdownMenu}
91
+ logo={logo}
92
+ openAccordion={openAccordion}
93
+ toggleAccordion={toggleAccordion}
94
+ socialMedia={socialMedia}
95
+ />
96
+ </nav>
124
97
  </Section>
125
98
  );
126
99
  }
127
100
 
128
- function LogoSection({
129
- logo,
130
- smallLogo,
131
- smallLogoLink,
132
- }: {
133
- logo: NavigationProps["logo"];
134
- smallLogo: NavigationProps["smallLogo"];
135
- smallLogoLink: string;
136
- }) {
101
+ function LogoSection({ logo }: { logo: NavigationProps["logo"] }) {
137
102
  return (
138
103
  <div className="w-[200px] relative z-20">
139
104
  {logo?.image && (
@@ -142,7 +107,7 @@ function LogoSection({
142
107
  className="text-3xl font-bold leading-none"
143
108
  href={logoLink(logo)}>
144
109
  <Image
145
- className={`md:h-[75px] hidden md:inline-block`}
110
+ className={`md:h-[75px]`}
146
111
  src={logo?.image}
147
112
  alt={logo?.alt ?? "navigation-logo"}
148
113
  width={100}
@@ -150,21 +115,6 @@ function LogoSection({
150
115
  />
151
116
  </Link>
152
117
  )}
153
-
154
- {smallLogo?.image && (
155
- <Link
156
- aria-label={`Go to ${smallLogoLink === "/" ? "Homepage" : smallLogoLink}`}
157
- className="text-3xl font-bold leading-none"
158
- href={smallLogoLink}>
159
- <Image
160
- className={`h-[20px] inline-block md:hidden`}
161
- src={smallLogo?.image}
162
- alt={smallLogo?.alt ?? "navigation-logo"}
163
- width={100}
164
- height={100}
165
- />
166
- </Link>
167
- )}
168
118
  </div>
169
119
  );
170
120
  }
@@ -285,7 +235,9 @@ function HoverMenu({
285
235
  return (
286
236
  <div className="group relative" onMouseEnter={onHover} onMouseLeave={onLeave}>
287
237
  <button
288
- className={`${navlinkStyle} group-hover:after:!w-full flex items-center space-x-2 ${isNavHovered ? "text-white" : "text-black"}`}>
238
+ className={`${navlinkStyle} group-hover:after:!w-full flex items-center space-x-2 ${
239
+ isNavHovered ? "text-white" : "text-black"
240
+ }`}>
289
241
  <span>{link?.label}</span>
290
242
  </button>
291
243
 
@@ -350,8 +302,7 @@ function HoverMenu({
350
302
  function MobileNavSidebar({
351
303
  menu,
352
304
  showMenu,
353
- smallLogo,
354
- smallLogoLink,
305
+ logo,
355
306
  dropdownMenu,
356
307
  openAccordion,
357
308
  toggleAccordion,
@@ -359,8 +310,7 @@ function MobileNavSidebar({
359
310
  }: {
360
311
  menu: boolean;
361
312
  showMenu: () => void;
362
- smallLogo: any;
363
- smallLogoLink: string;
313
+ logo: any;
364
314
  dropdownMenu: NavigationProps["dropdownMenu"];
365
315
  openAccordion: string | null;
366
316
  toggleAccordion: (key: string) => void;
@@ -371,7 +321,7 @@ function MobileNavSidebar({
371
321
  <div className="fixed inset-0 bg-black/80" onClick={showMenu}></div>
372
322
  <div className="fixed top-0 right-0 bottom-0 flex flex-col w-full sm:max-w-sm bg-black/80">
373
323
  <nav className="flex flex-col w-full py-6 px-6 overflow-y-auto h-screen">
374
- <MobileNavImage smallLogo={smallLogo} smallLogoLink={smallLogoLink} showMenu={showMenu} />
324
+ <MobileNavImage logo={logo} showMenu={showMenu} />
375
325
  <MobileNavDropdown
376
326
  dropdownMenu={dropdownMenu}
377
327
  openAccordion={openAccordion}
@@ -388,25 +338,23 @@ function MobileNavSidebar({
388
338
  }
389
339
 
390
340
  function MobileNavImage({
391
- smallLogo,
392
- smallLogoLink,
341
+ logo,
393
342
  showMenu,
394
343
  }: {
395
- smallLogo: NavigationProps["smallLogo"];
396
- smallLogoLink: string;
344
+ logo: NavigationProps["logo"];
397
345
  showMenu: () => void;
398
346
  }) {
399
- if (!smallLogo?.image) return null;
347
+ if (!logo?.image) return null;
400
348
  return (
401
349
  <Link
402
- aria-label={`Go to ${smallLogoLink === "/" ? "Homepage" : smallLogoLink}`}
350
+ aria-label={`Go to ${logoLink(logo)}`}
403
351
  className="text-3xl font-bold leading-none h-[40px] w-[100px] flex items-center justify-start mt-0 md:ml-[15px]"
404
352
  onClick={showMenu}
405
- href={smallLogoLink}>
353
+ href={logoLink(logo)}>
406
354
  <Image
407
355
  className="h-[20px] object-contain"
408
- src={smallLogo?.image}
409
- alt={smallLogo?.alt ?? "navigation-logo"}
356
+ src={logo?.image}
357
+ alt={logo?.alt ?? "navigation-logo"}
410
358
  />
411
359
  </Link>
412
360
  );
@@ -526,15 +474,17 @@ function BurgerMenuButton({
526
474
  showMenu,
527
475
  firstLine,
528
476
  secondLine,
477
+ isNavHovered,
529
478
  }: {
530
479
  menu: boolean;
531
480
  showMenu: () => void;
532
481
  firstLine: any;
533
482
  secondLine: any;
483
+ isNavHovered: boolean;
534
484
  }) {
535
485
  return (
536
486
  <div
537
- className={`block lg:hidden z-[99] ${
487
+ className={`block pr-4 lg:hidden z-[99] ${
538
488
  menu ? "fixed right-[20px] md:right-[50px]" : "relative"
539
489
  }`}>
540
490
  <svg
@@ -542,7 +492,7 @@ function BurgerMenuButton({
542
492
  width="40"
543
493
  height="40"
544
494
  viewBox="0 0 44 44"
545
- fill="#ffffff"
495
+ fill={isNavHovered ? "#ffffff" : "#000000"}
546
496
  xmlns="http://www.w3.org/2000/svg"
547
497
  className="cursor-pointer">
548
498
  <animated.rect width="20" height="3" style={firstLine} />
@@ -251,6 +251,8 @@ const MobileMenuContentItem = React.memo(({ megaMenu }: MobileMenuContentItemPro
251
251
  MobileMenuContentItem.displayName = "MobileMenuContentItem";
252
252
 
253
253
  export default function Navigation_H({ logo, iconLinks, megaMenu }: NavigationProps) {
254
+ console.log("🚀 ~ iconLinks", iconLinks);
255
+ console.log("🚀 ~ megaMenu", megaMenu);
254
256
  const [{ y }] = useWindowScroll();
255
257
  const sticky =
256
258
  y && y > 80
package/src/types.ts CHANGED
@@ -295,7 +295,6 @@ export interface Variants {
295
295
  megaMenu?: MegaMenu[];
296
296
  arrayOfTitleAndText?: ArrayOfTitleAndText[] | null;
297
297
  logo?: Logo | null;
298
- smallLogo?: Logo | null;
299
298
  logos?: Logos[] | null;
300
299
  primaryButton?: LabeledRoute | null;
301
300
  secondaryButton?: LabeledRoute | null;
@@ -1 +0,0 @@
1
- import{lazy as e}from"react";import{jsx as A}from"react/jsx-runtime";var o={variant_a:e(()=>import("./navigation_a.mjs")),variant_b:e(()=>import("./navigation_b.mjs")),variant_c:e(()=>import("./navigation_c.mjs")),variant_d:e(()=>import("./navigation_d.mjs")),variant_f:e(()=>import("./navigation_f.mjs")),variant_g:e(()=>import("./navigation_g.mjs")),variant_h:e(()=>import("./navigation_h.mjs"))},V="Navigation",q=({data:n})=>{var s,l,u,p,v,L,m,c,g,f,y,t,b,k,M,R,B,h,_,N,K,W,w,P,S,x,z,C;let i=n==null?void 0:n.variant,r=i&&(o==null?void 0:o[i]),F={logo:(l=(s=n==null?void 0:n.variants)==null?void 0:s.logo)!=null?l:void 0,smallLogo:(p=(u=n==null?void 0:n.variants)==null?void 0:u.smallLogo)!=null?p:void 0,links:(L=(v=n==null?void 0:n.variants)==null?void 0:v.routes)!=null?L:void 0,primaryButton:(c=(m=n==null?void 0:n.variants)==null?void 0:m.primaryButton)!=null?c:void 0,secondaryButton:(f=(g=n==null?void 0:n.variants)==null?void 0:g.secondaryButton)!=null?f:void 0,banner:(t=(y=n==null?void 0:n.variants)==null?void 0:y.banner)!=null?t:void 0,multipleLinks:(k=(b=n==null?void 0:n.variants)==null?void 0:b.multipleLinks)!=null?k:void 0,title:(R=(M=n==null?void 0:n.variants)==null?void 0:M.title)!=null?R:void 0,dropdownMenu:(h=(B=n==null?void 0:n.variants)==null?void 0:B.dropdownMenu)!=null?h:void 0,logos:(N=(_=n==null?void 0:n.variants)==null?void 0:_.logos)!=null?N:void 0,socialMedia:(W=(K=n==null?void 0:n.variants)==null?void 0:K.socialMedia)!=null?W:void 0,socialLinks:(P=(w=n==null?void 0:n.variants)==null?void 0:w.socialLinks)!=null?P:void 0,iconLinks:(x=(S=n==null?void 0:n.variants)==null?void 0:S.iconLinks)!=null?x:void 0,megaMenu:(C=(z=n==null?void 0:n.variants)==null?void 0:z.megaMenu)!=null?C:void 0};return r?A(r,{...F}):null};q.displayName=V;export{q as a};
@@ -1 +0,0 @@
1
- import{a as R}from"./chunk-4N6ET2I6.mjs";import{Image as w}from"@stackshift-ui/image";import{Link as y}from"@stackshift-ui/link";import{Section as j}from"@stackshift-ui/section";import{SocialIcons as B}from"@stackshift-ui/social-icons";import T,{Fragment as F,useState as A}from"react";import{BsChevronDown as D}from"react-icons/bs";import{animated as S,useSpring as _}from"@react-spring/web";import{useWindowScroll as O}from"@uidotdev/usehooks";import G from"react-sticky-el";import{Fragment as I,jsx as r,jsxs as d}from"react/jsx-runtime";var v="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 E({logo:e,smallLogo:a,socialMedia:o,dropdownMenu:t}){let[c,n]=A(!1),[s,u]=T.useState(!1),[p,x]=A(null),[m,h]=A(!1),f;(a==null?void 0:a.type)==="linkInternal"?(a==null?void 0:a.internalLink)===void 0||(a==null?void 0:a.internalLink)==="Home"||(a==null?void 0:a.internalLink)==="home"?f="/":f=`/${a==null?void 0:a.internalLink}`:(a==null?void 0:a.externalLink)===void 0?f="/":f=a==null?void 0:a.externalLink;let i=()=>{u(N=>!N),s?document.body.style.overflow="unset":document.body.style.overflow="hidden"},b=_({transform:s?"translate(9px, 32px) rotate(-45deg) scaleX(1.5)":"translate(17px, 17px) rotate(0deg) scaleX(1)"}),M=_({transform:s?"translate(12px, 11px) rotate(45deg)":"translate(7px, 27px) rotate(0deg)"}),[{x:k,y:$}]=O(),z=$&&$>5?"bg-black fixed top-0":"fixed bg-transparent",H=$&&$>5,C=N=>{N&&x(p===N?null:N)},P=N=>{h(N)};return r(j,{className:"w-full flex flex-col absolute top-0 z-50",children:r(G,{stickyClassName:"pt-[80px]",topOffset:100,isIOSFixEnabled:!1,children:d("nav",{className:`w-full z-50 md:gap-2 gap-0 hover:bg-black/80 transition-colors duration-300 ${c?"!bg-black border-b-white":"border-b-transparent"} ${z}`,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),children:[r("div",{className:"container z-10",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:[r(X,{logo:e,smallLogo:a,smallLogoLink:f}),r(W,{dropdownMenu:t,isNavHovered:m,setShowDropdown:n})]}),r(U,{menu:s,showMenu:i,firstLine:b,secondLine:M})]})}),r(q,{menu:s,showMenu:i,smallLogo:a,smallLogoLink:f,dropdownMenu:t,openAccordion:p,toggleAccordion:C,socialMedia:o})]})})})}function X({logo:e,smallLogo:a,smallLogoLink:o}){var t,c;return d("div",{className:"w-[200px] relative z-20",children:[(e==null?void 0:e.image)&&r(y,{"aria-label":`Go to ${R(e)}`,className:"text-3xl font-bold leading-none",href:R(e),children:r(w,{className:"md:h-[75px] hidden md:inline-block",src:e==null?void 0:e.image,alt:(t=e==null?void 0:e.alt)!=null?t:"navigation-logo",width:100,height:100})}),(a==null?void 0:a.image)&&r(y,{"aria-label":`Go to ${o==="/"?"Homepage":o}`,className:"text-3xl font-bold leading-none",href:o,children:r(w,{className:"h-[20px] inline-block md:hidden",src:a==null?void 0:a.image,alt:(c=a==null?void 0:a.alt)!=null?c:"navigation-logo",width:100,height:100})})]})}function W({dropdownMenu:e,isNavHovered:a,setShowDropdown:o}){return!e||(e==null?void 0:e.length)===0?null:r(F,{children:e&&(e==null?void 0:e.length)>0&&r("ul",{className:"hidden lg:flex flex-wrap space-x-[50px] xl:min-w-max",children:e==null?void 0:e.map(t=>r(T.Fragment,{children:(t==null?void 0:t.label)&&(t==null?void 0:t._key)&&r("li",{className:"static z-20 hover:z-10",children:(t==null?void 0:t.routeType)==="singleRoute"?r(g,{link:t,style:`${v} ${a?"text-white":"text-black"}`}):(t==null?void 0:t.routeType)==="multipleRoute"?r(Y,{link:t,isNavHovered:a,onHover:()=>o(!0),onLeave:()=>o(!1)}):r("span",{className:`${v} ${a?"text-white":"text-black"}`,children:t==null?void 0:t.label})})},t._key))})})}function g({link:e,style:a=v}){var o,t,c,n,s,u,p;return r(I,{children:e.linkType==="linkInternal"?r(y,{"aria-label":`Navigation ${(o=e==null?void 0:e.label)!=null?o:"Menu"} links which directs to ${(e==null?void 0:e.internalLink)===void 0?"page-not-found":e==null?void 0:e.internalLink}`,className:a,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))!=="/"?r("a",{href:e!=null&&e.linkText?e==null?void 0:e.linkText:"link-not-found","aria-label":`Navigation ${(n=e==null?void 0:e.label)!=null?n:"Menu"} links which directs to ${(e==null?void 0:e.linkText)===void 0?"link-not-found":e==null?void 0:e.linkText}`,className:a,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"&&((s=e==null?void 0:e.linkText)==null?void 0:s.slice(0,1))==="/"?r(y,{"aria-label":`Navigation ${(u=e==null?void 0:e.label)!=null?u:"Menu"} links which directs to ${(e==null?void 0:e.linkText)===void 0?"link-not-found":e==null?void 0:e.linkText}`,className:a,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}):r("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:a,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 Y({link:e,onHover:a,onLeave:o,isNavHovered:t}){var c,n,s,u,p,x,m,h,f,i;return d("div",{className:"group relative",onMouseEnter:a,onMouseLeave:o,children:[r("button",{className:`${v} group-hover:after:!w-full flex items-center space-x-2 ${t?"text-white":"text-black"}`,children:r("span",{children:e==null?void 0:e.label})}),r("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:r("div",{className:"w-3/4 mx-auto bg-black",children:r("div",{className:"max-w-[1440px] mx-auto px-4",children:r("div",{className:"p-[30px]",children:d("div",{className:"grid grid-cols-5 gap-[30px]",children:[(e==null?void 0:e.featuredRoute)&&r("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)&&r("div",{className:"absolute w-full h-full inset-0 p-[15px] flex flex-col justify-end z-10",children:r("span",{children:r(g,{link:(n=e==null?void 0:e.featuredRoute)==null?void 0:n.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"})})}),((s=e==null?void 0:e.featuredRoute)==null?void 0:s.mainImage)&&r(w,{src:(p=(u=e==null?void 0:e.featuredRoute)==null?void 0:u.mainImage)==null?void 0:p.image,alt:(h=(m=(x=e==null?void 0:e.featuredRoute)==null?void 0:x.mainImage)==null?void 0:m.alt)!=null?h:"image",width:100,height:100,className:"object-cover absolute inset-0 w-full h-full"})]})}),(e==null?void 0:e.multipleRoutes)&&r("div",{className:"col-span-3 py-[20px]",children:d("div",{className:"flex flex-col space-y-10",children:[(e==null?void 0:e.label)&&r("p",{className:"h3 text-white",children:e==null?void 0:e.label}),r("ul",{className:`grid gap-x-[60px] gap-y-3 ${((f=e==null?void 0:e.multipleRoutes)==null?void 0:f.length)>3?"grid-cols-2":"grid-cols-1"}`,children:(i=e==null?void 0:e.multipleRoutes)==null?void 0:i.map(b=>r("li",{children:(b==null?void 0:b.label)&&r(g,{link:b,style:v})},b._key))})]})})]})})})})})]})}function q({menu:e,showMenu:a,smallLogo:o,smallLogoLink:t,dropdownMenu:c,openAccordion:n,toggleAccordion:s,socialMedia:u}){return d("div",{className:`${e?"block":"hidden"} navbar-menu fixed inset-0 z-50`,children:[r("div",{className:"fixed inset-0 bg-black/80",onClick:a}),r("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:[r(J,{smallLogo:o,smallLogoLink:t,showMenu:a}),r(K,{dropdownMenu:c,openAccordion:n,toggleAccordion:s}),r(Q,{socialMedia:u}),r("div",{className:"mt-auto pt-20 text-gray-400",children:r("span",{className:"text-sm text-center block",children:`\xA9 ${new Date().getFullYear()} All rights reserved.`})})]})})]})}function J({smallLogo:e,smallLogoLink:a,showMenu:o}){var t;return e!=null&&e.image?r(y,{"aria-label":`Go to ${a==="/"?"Homepage":a}`,className:"text-3xl font-bold leading-none h-[40px] w-[100px] flex items-center justify-start mt-0 md:ml-[15px]",onClick:o,href:a,children:r(w,{className:"h-[20px] object-contain",src:e==null?void 0:e.image,alt:(t=e==null?void 0:e.alt)!=null?t:"navigation-logo"})}):null}function K({dropdownMenu:e,openAccordion:a,toggleAccordion:o}){return r("div",{className:"mt-[70px]",children:r(V,{children:e==null?void 0:e.map(t=>{var c,n,s,u,p,x,m,h,f;return r(T.Fragment,{children:(t==null?void 0:t.label)&&(t==null?void 0:t._key)&&r(I,{children:(t==null?void 0:t.routeType)==="singleRoute"?r("span",{children:r(g,{link:t,style:`${v} !text-base !h-auto text-white`})}):(t==null?void 0:t.routeType)==="multipleRoute"?d(Z,{children:[r(l,{isOpen:a===t._key,onClick:()=>t._key&&o(t._key),className:`${v} after:!w-0 !p-0 text-white`,children:t==null?void 0:t.label}),r(L,{isOpen:a===t._key,children:d("div",{className:"py-6 flex flex-col space-y-2",children:[(t==null?void 0:t.featuredRoute)&&r("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)&&r("div",{className:"absolute w-full h-full inset-0 p-[15px] flex flex-col justify-end z-10",children:r("span",{children:r(g,{link:(n=t==null?void 0:t.featuredRoute)==null?void 0:n.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"})})}),((s=t==null?void 0:t.featuredRoute)==null?void 0:s.mainImage)&&r(w,{src:(p=(u=t==null?void 0:t.featuredRoute)==null?void 0:u.mainImage)==null?void 0:p.image,className:"object-cover absolute inset-0 w-full h-full",alt:(h=(m=(x=t==null?void 0:t.featuredRoute)==null?void 0:x.mainImage)==null?void 0:m.alt)!=null?h:"image"})]})}),(t==null?void 0:t.multipleRoutes)&&r("ul",{className:"flex flex-col justify-center space-y-1 pl-[15px]",children:(f=t==null?void 0:t.multipleRoutes)==null?void 0:f.map(i=>r("li",{children:(i==null?void 0:i.label)&&r(g,{link:i,style:`${v} text-white`})},i._key))})]})})]}):r("span",{className:`${v} text-white`,children:t==null?void 0:t.label})})},t._key)})})})}function Q({socialMedia:e}){return e?r("div",{className:"mt-[70px] flex justify-center space-x-[50px]",children:e==null?void 0:e.map(a=>(a==null?void 0:a.socialMediaLink)&&r(y,{"aria-label":(a==null?void 0:a.socialMedia)||(a==null?void 0:a.socialMediaPlatform)||"social-media-link",className:"text-white hover:text-gray-2 leading-none transition",style:{fontSize:"24px"},target:"_blank",rel:"noopener noreferrer",href:a==null?void 0:a.socialMediaLink,children:r(B,{social:a==null?void 0:a.socialMedia})},a==null?void 0:a._key))}):null}function U({menu:e,showMenu:a,firstLine:o,secondLine:t}){return r("div",{className:`block lg:hidden z-[99] ${e?"fixed right-[20px] md:right-[50px]":"relative"}`,children:d("svg",{onClick:a,width:"40",height:"40",viewBox:"0 0 44 44",fill:"#ffffff",xmlns:"http://www.w3.org/2000/svg",className:"cursor-pointer",children:[r(S.rect,{width:"20",height:"3",style:o}),r(S.rect,{width:"30",height:"3",style:t})]})})}function V({children:e,className:a=""}){return r("div",{className:`flex flex-col space-y-6 ${a}`,children:e})}function Z({children:e,className:a=""}){return r("div",{className:`border-none ${a}`,children:e})}function l({children:e,className:a="",isOpen:o,onClick:t}){return d("button",{onClick:t,className:`${a} flex items-center justify-between w-full`,children:[e,r(D,{className:`transform transition-transform duration-200 ${o?"rotate-180":""}`})]})}function L({children:e,isOpen:a}){return r("div",{className:`overflow-hidden transition-all duration-200 ${a?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"}`,children:e})}export{E as a};
@@ -1 +0,0 @@
1
- import{Link as y}from"@stackshift-ui/link";import{jsx as u}from"react/jsx-runtime";var b=r=>{var a,f,p;return r!=null&&r.internalLink&&(r==null?void 0:r.type)==="linkInternal"?(f=(a=r==null?void 0:r.internalLink)==null?void 0:a.toLowerCase())!=null&&f.includes("home")?"/":`/${r.internalLink}`:r!=null&&r.externalLink&&(r==null?void 0:r.type)==="linkExternal"&&(p=r==null?void 0:r.externalLink)!=null?p:"/"},o=({className:r,ariaLabel:a,style:f={},children:p,link:e,target:n})=>{var c,s;let L="inline-block py-2 px-6 rounded-l-xl rounded-t-xl bg-primary hover:bg-primary-foreground text-gray-50 font-bold leading-loose outline-none transition duration-200";if(!(e!=null&&e.internalLink)&&!(e!=null&&e.externalLink))return u("a",{className:r!=null?r:L,"aria-label":a,target:n,href:"/page-not-found",children:p});if((e==null?void 0:e.type)==="linkInternal"&&((c=e==null?void 0:e.internalLink)==null?void 0:c.toLowerCase())==="home")return u(y,{href:(e==null?void 0:e.referenceType)==="projects"?"/projects":"/","aria-label":a,className:r!=null?r:L,target:n,children:p});if((e==null?void 0:e.type)==="linkInternal"){let t="";switch(e==null?void 0:e.referenceType){case"projects":t=`/projects/${e==null?void 0:e.internalLink}`;break;case"commercial":t=`/projects/commercial/${e==null?void 0:e.internalLink}`;break;case"residential":t=`/projects/residential/${e==null?void 0:e.internalLink}`;break;case"landscape":t=`/projects/landscape/${e==null?void 0:e.internalLink}`;break;case"public":t=`/projects/public/${e==null?void 0:e.internalLink}`;break;case"teaching":t=`/projects/teaching/${e==null?void 0:e.internalLink}`;break;case"designInMotion":t=`/projects/future-projects/${e==null?void 0:e.internalLink}`;break;case"renovation":t=`/projects/residential/renovation/${e==null?void 0:e.internalLink}`;break;case"newConstruction":t=`/projects/residential/new-construction/${e==null?void 0:e.internalLink}`;break;case"ourTeam":t=`/our-team/${e==null?void 0:e.internalLink}`;break;case"recognition":t=`/recognition/${e==null?void 0:e.internalLink}`;break;default:t=`/${e==null?void 0:e.internalLink}`}return u(y,{href:t,"aria-label":a,className:r!=null?r:L,target:n,children:p})}else return(e==null?void 0:e.type)==="linkExternal"?u("a",{"aria-label":a,className:r!=null?r:L,href:(s=e==null?void 0:e.externalLink)!=null?s:"",target:n,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":void 0,children:p}):u(y,{href:"/","aria-label":a,className:r!=null?r:L,target:n,children:p})};export{b as a,o as b};