@stackshift-ui/navigation 6.1.0 → 7.0.0-beta.1
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-5TVYK3JB.mjs +1 -0
- package/dist/chunk-AYUL7QX6.mjs +1 -0
- package/dist/chunk-FJRVUW5P.mjs +1 -0
- package/dist/chunk-SMYVBKA6.mjs +1 -0
- package/dist/chunk-ZCDQD6XN.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/navigation.mjs +1 -1
- package/dist/navigation_a.mjs +1 -1
- package/dist/navigation_b.mjs +1 -1
- package/dist/navigation_c.mjs +1 -1
- package/dist/navigation_d.mjs +1 -1
- package/dist/navigation_e.mjs +1 -1
- package/dist/navigation_h.mjs +1 -1
- package/package.json +14 -14
- package/src/navigation.test.tsx +2 -2
- package/src/navigation_a.tsx +49 -39
- package/src/navigation_b.tsx +45 -36
- package/src/navigation_c.tsx +48 -36
- package/src/navigation_d.tsx +50 -36
- package/src/navigation_e.tsx +21 -24
- package/src/navigation_h.tsx +53 -47
- package/dist/chunk-AV6FXT56.mjs +0 -1
- package/dist/chunk-EYE6OX2N.mjs +0 -1
- package/dist/chunk-STASA5HD.mjs +0 -1
- package/dist/chunk-TJZPE7DN.mjs +0 -1
- package/dist/chunk-Z3RUBMRD.mjs +0 -1
- /package/dist/{chunk-ISJJGULA.mjs → chunk-7JNLKLGB.mjs} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as g,b as m}from"./chunk-S35O64PB.mjs";import{Button as o}from"@stackshift-ui/button";import{Container as f}from"@stackshift-ui/container";import{Flex as d}from"@stackshift-ui/flex";import{Image as h}from"@stackshift-ui/image";import{Link as c}from"@stackshift-ui/link";import{Section as N}from"@stackshift-ui/section";import{Text as w}from"@stackshift-ui/text";import n from"react";import{jsx as a,jsxs as b}from"react/jsx-runtime";function p({links:e,primaryButton:l,secondaryButton:t,logo:i}){let[s,r]=n.useState(!1),v=()=>{r(x=>!x)};return b(N,{className:"bg-background",children:[a("nav",{className:"relative py-6",children:a(f,{maxWidth:1280,children:b(d,{align:"center",justify:"between",gap:4,children:[a(L,{links:e}),a(M,{logo:i}),a(R,{primaryButton:l,secondaryButton:t}),a(z,{showMenu:v})]})})}),a(F,{menu:s,showMenu:v,links:e,primaryButton:l,secondaryButton:t})]})}function L({links:e}){return e?a(d,{children:a("ul",{className:"hidden lg:flex lg:items-center lg:gap-5",children:e==null?void 0:e.map((l,t)=>b(n.Fragment,{children:[(l==null?void 0:l.label)&&a(C,{link:l}),e.length!==t+1?a(u,{}):null]},t))})}):null}function C({link:e}){return e?a("li",{children:a(o,{variant:"unstyled",asChild:!0,"aria-label":e==null?void 0:e.label,className:"text-sm text-gray-500 no-underline hover:text-gray-900",children:a(m,{link:e,ariaLabel:(e==null?void 0:e.label)||"Navigation link",className:"text-sm text-gray-500 no-underline hover:text-gray-900",children:e==null?void 0:e.label})})}):null}function u(){return a("li",{className:"text-gray-500",children:a("svg",{className:"w-4 h-4 current-fill",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})})}function M({logo:e}){var l;return e?a("div",{className:"w-full lg:w-fit items-center justify-center",children:a(c,{className:"w-20 h-14 flex justify-center items-center","aria-label":g(e)==="/"?"Go to home page":`Go to ${g(e)}`,href:g(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:a(h,{className:"w-fit h-full object-contain",src:`${e==null?void 0:e.image}`,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",alt:(l=e==null?void 0:e.alt)!=null?l:"navigation-logo"})})}):null}function R({primaryButton:e,secondaryButton:l}){return b("div",{className:"hidden lg:text-right lg:block lg:w-1/3",children:[(e==null?void 0:e.label)&&a(o,{asChild:!0,"aria-label":e==null?void 0:e.label,className:"px-4 py-3 text-secondary-foreground lg:ml-auto lg:mr-3 font-semibold rounded-global bg-secondary hover:bg-secondary/50",children:a(m,{link:e,ariaLabel:e==null?void 0:e.label,children:e==null?void 0:e.label})}),(l==null?void 0:l.label)&&a(o,{asChild:!0,"aria-label":l==null?void 0:l.label,className:"px-4 py-3 leading-loose text-center text-primary-foreground font-semibold bg-primary hover:bg-primary/50 rounded-global",children:a(m,{link:l,ariaLabel:l==null?void 0:l.label,children:l==null?void 0:l.label})})]})}function z({showMenu:e}){return a("div",{className:"ml-auto lg:hidden",children:a(o,{"aria-label":"Navigation menu",className:"flex items-center p-3 navbar-burger text-primary",onClick:e,children:b("svg",{className:"block w-4 h-4 fill-current",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[a("title",{children:"Mobile menu"}),a("path",{d:"M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"})]})})})}function F({menu:e,showMenu:l,links:t,primaryButton:i,secondaryButton:s}){return b("div",{className:`${e?null:"hidden"} mobile-nav relative z-50`,children:[a("div",{className:"fixed inset-0 bg-gray-800 opacity-25 navbar-backdrop",onClick:l}),b("nav",{className:"fixed top-0 bottom-0 left-0 flex flex-col w-5/6 max-w-sm px-6 py-6 overflow-y-auto bg-white border-r",children:[a("div",{className:"flex items-center mb-8",children:a(o,{"aria-label":"Close navigation menu",className:"navbar-close",onClick:l,children:a("svg",{className:"w-6 h-6 text-gray-500 cursor-pointer hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})}),a("div",{children:a("ul",{children:t&&(t==null?void 0:t.map((r,v)=>a("li",{className:"mb-1",children:a(o,{asChild:!0,"aria-label":r==null?void 0:r.label,className:"block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary",children:a(m,{link:r,ariaLabel:(r==null?void 0:r.label)||"Navigation link",className:"block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary",children:r==null?void 0:r.label})})},v)))})}),b("div",{className:"mt-auto",children:[b("div",{className:"pt-6",children:[(i==null?void 0:i.label)&&a(o,{asChild:!0,"aria-label":i==null?void 0:i.label,className:"block px-4 py-3 mb-2 text-gray-900 text-center lg:ml-auto lg:mr-3 font-semibold rounded-global bg-secondary hover:bg-secondary/50",children:a(m,{link:i,ariaLabel:i==null?void 0:i.label,className:"block px-4 py-3 mb-2 text-gray-900 text-center lg:ml-auto lg:mr-3 font-semibold rounded-global bg-secondary hover:bg-secondary/50",children:i==null?void 0:i.label})}),(s==null?void 0:s.label)&&a(o,{asChild:!0,"aria-label":s==null?void 0:s.label,className:"block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:a(m,{link:s,ariaLabel:s==null?void 0:s.label,className:"block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:s==null?void 0:s.label})})]}),a(w,{fontSize:"xs",className:"my-4 text-center text-gray-700",children:a("span",{children:`\xA9 ${new Date().getFullYear()} All rights reserved.`})})]})]})]})}export{p as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v,b}from"./chunk-S35O64PB.mjs";import{Button as w}from"@stackshift-ui/button";import{Flex as f}from"@stackshift-ui/flex";import{Grid as S}from"@stackshift-ui/grid";import{Heading as $}from"@stackshift-ui/heading";import{Image as N}from"@stackshift-ui/image";import{Link as T}from"@stackshift-ui/link";import{Section as I}from"@stackshift-ui/section";import{Text as y}from"@stackshift-ui/text";import{useClickAway as R,useWindowScroll as k}from"@uidotdev/usehooks";import h from"classnames";import g,{createContext as B,forwardRef as E,Fragment as x,useCallback as j,useEffect as F,useMemo as G,useRef as H,useState as M}from"react";import{GoPerson as z}from"react-icons/go";import{LiaSearchSolid as O}from"react-icons/lia";import{SlLocationPin as W}from"react-icons/sl";import{Fragment as A,jsx as t,jsxs as m}from"react/jsx-runtime";var D=B(void 0),K=()=>{let e=g.useContext(D);if(!e)throw new Error("useAccordion must be used within an Accordion");return e},V=({className:e,children:a,defaultValue:n=[],onValueChange:o})=>{let[s,l]=M(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(D.Provider,{value:i,children:t("div",{className:h("w-full",e),children:a})})},J=({value:e,className:a,children:n})=>{let{openItems:o,toggleItem:s}=K(),l=o.includes(e);return t("div",{className:h("border-b border-gray-200",a),children:g.Children.map(n,r=>g.isValidElement(r)?g.cloneElement(r,{isOpen:l,onClick:()=>s(e)}):r)})},U=g.forwardRef(({className:e,children:a,isOpen:n,onClick:o,...s},l)=>m("button",{ref:l,type:"button",onClick:o,className:h("flex w-full items-center justify-between py-4 text-left",e),...s,children:[a,t("svg",{className:h("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"})})]})),q=g.forwardRef(({className:e,children:a,isOpen:n},o)=>t("div",{ref:o,className:h("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})})),Q=({data:e,showMobileMenu:a,setShowMobileMenu:n})=>{let o=R(()=>{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(V,{children:e==null?void 0:e.map(s=>t(_,{megaMenu:s},s._key))})}):null},_=g.memo(({megaMenu:e})=>{var a,n;return e._type==="isLinkOnly"?t(T,{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(J,{value:e._key,children:[t(U,{className:"text-base font-medium text-gray-900 uppercase w-full py-4",children:e.title}),m(q,{children:[(a=e.groupOfLinks)==null?void 0:a.map(o=>{var s;return m("div",{className:"mt-4 pl-4",children:[t(y,{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(y,{className:"text-black font-medium leading-[30px] text-sm",children:l.title}),(r=l.links)==null?void 0:r.map(i=>{var c,d;return t(w,{asChild:!0,variant:"ghost",className:"text-black text-sm font-normal font-heading-kb leading-[30px] hover:underline block ml-4",children:t(b,{link:i,ariaLabel:(c=i.label)!=null?c:"Navigation link",children:t(b,{link:i,ariaLabel:(d=i.label)!=null?d:"Navigation link",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;return t("div",{className:"mt-4 pl-4",children:t(w,{asChild:!0,variant:"ghost",className:"text-black text-sm font-normal font-heading-kb leading-[30px]",children:t(b,{link:o.primaryButton,ariaLabel:(r=(l=o.primaryButton)==null?void 0:l.label)!=null?r:"Navigation link",children:m(f,{direction:"col",gap:3,children:[t(N,{src:(i=o.mainImage)==null?void 0:i.image,alt:(d=(c=o.mainImage)==null?void 0:c.alt)!=null?d:"",width:200,height:150,className:"w-[188px] h-[147px] object-cover object-center"},s),(u=o.primaryButton)==null?void 0:u.label]})})})},`MobileMenuContent-Item-Images-${o._key}-${s}`)})]})]})});_.displayName="MobileMenuContentItem";function X({logo:e,iconLinks:a,megaMenu:n}){let[{y:o}]=k(),[s,l]=M(!1),[r,i]=M(""),c=H(null),d=o&&o>80?"fixed w-full transition-all duration-300 ease-in-out":"sticky transition-all duration-300 ease-in-out",u=j(p=>{c.current&&clearTimeout(c.current),p===""?c.current=setTimeout(()=>{i("")},200):i(p)},[]);return F(()=>()=>{c.current&&clearTimeout(c.current)},[]),m(A,{children:[t("header",{className:h("relative top-0 left-0 border-t md:pb-3 z-50 bg-white transition-all ease-in-out duration-300",d),children:t(Y,{logo:e,iconLinks:a,megaMenu:n,setShowMobileMenu:l,currentDropdown:r,setCurrentDropdown:u})}),t(Q,{data:n,showMobileMenu:s,setShowMobileMenu:l})]})}var Y=({logo:e,iconLinks:a,megaMenu:n,setShowMobileMenu:o,currentDropdown:s,setCurrentDropdown:l})=>{var d;let[{x:r,y:i}]=k(),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(S,{columns:2,align:"center",justify:"between",gap:5,className:h("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(T,{"aria-label":`Go to ${v(e)==="/"?"home page":v(e)}`,className:"text-3xl font-bold leading-none",href:v(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:t(N,{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(ie,{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(Z,{link:u,isIcon:!0},u._key):null)})})]}),t(te,{data:n!=null?n:[],currentDropdown:s,setCurrentDropdown:l}),t(ne,{data:n!=null?n:[],currentDropdown:s,setCurrentDropdown:l})]})},Z=({link:e,isIcon:a})=>{var o;let n=ee[e==null?void 0:e.label]||null;return t("li",{children:t(w,{variant:"unstyled",asChild:!0,className:"text-sm font-label tracking-wide",children:t(b,{link:e,ariaLabel:(o=e==null?void 0:e.label)!=null?o:"Navigation link",children:a?n:e==null?void 0:e.label})})})},ee={search:t(O,{className:"w-4 h-4"}),location:t(W,{className:"w-4 h-4"}),person:t(z,{className:"w-4 h-4"})},te=({data:e,currentDropdown:a,setCurrentDropdown:n})=>{let[{x:o,y:s}]=k(),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(x,{children:r._type==="dropdown"?t(P,{dropdown:r,"aria-expanded":a===r.title,onMouseEnter:()=>{var i;return n((i=r.title)!=null?i:"")},onMouseLeave:()=>n("")},`MegaMenuDropdownTrigger-${r._key}`):t(L,{link:r},`MegaMenuLink-${r._key}`)},`MegaMenuNavLink-${r._key}`)):null,e&&e.length>0?e==null?void 0:e.slice(3,6).map(r=>t(x,{children:r._type==="dropdown"?t(P,{dropdown:r,"aria-expanded":a===r.title,onMouseEnter:()=>{var i;return n((i=r.title)!=null?i:"")},onMouseLeave:()=>n("")},`MegaMenuDropdownTrigger-${r._key}`):t(L,{link:r},`MegaMenuLink-${r._key}`)},`MegaMenuNavLink-${r._key}`)):null]})},L=({link:e,className:a})=>t(w,{asChild:!0,variant:"unstyled",className:h("relative text-black text-sm font-normal font-label uppercase tracking-widest group",a),children:e.label}),P=E((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:h("relative text-black text-sm font-normal font-label uppercase tracking-widest group",r),...i,children:n.title})}),ne=({data:e,currentDropdown:a,setCurrentDropdown:n})=>t(A,{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(oe,{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 oe({label:e,showcaseLink:a,groupedLinks:n,currentDropdown:o,setCurrentDropdown:s}){let l=o===e&&e!=="",r=n.length>0,i=a.length>0,c=G(()=>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(I,{"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(re,{groupedLinks:n}),t(ae,{hasShowcaseLinks:i,showcaseLink:a})]})})}function re({groupedLinks:e}){return t(x,{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($,{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(y,{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,u;return t(w,{"aria-label":(d=i.label)!=null?d:"",variant:"unstyled",asChild:!0,className:"text-black text-sm font-normal font-heading-kb leading-[30px] hover:underline",children:t(b,{link:i,ariaLabel:(u=i.label)!=null?u:"Navigation link",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 ae({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,C;let s=(l=n.mainImage)==null?void 0:l.image;return t(w,{"aria-label":(i=(r=n.primaryButton)==null?void 0:r.label)!=null?i:"",variant:"unstyled",asChild:!0,className:"text-center text-black text-sm font-normal font-heading-kb leading-[30px] hover:underline",children:t(b,{link:n.primaryButton,ariaLabel:(d=(c=n.primaryButton)==null?void 0:c.label)!=null?d:"Navigation link",children:m(f,{direction:"col",align:"center",justify:"center",gap:3,children:[t(N,{src:s,alt:(p=(u=n.mainImage)==null?void 0:u.alt)!=null?p:"",width:500,height:500,className:"w-[188px] h-[147px] object-cover object-center"},o),(C=n.primaryButton)==null?void 0:C.label]})})},`MegaDropdownContent-Item-Images-${n._key}-${o}`)})}):null}function ie(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{X as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d,b as o}from"./chunk-S35O64PB.mjs";import{Button as s}from"@stackshift-ui/button";import{Flex as v}from"@stackshift-ui/flex";import{Image as f}from"@stackshift-ui/image";import{Link as x}from"@stackshift-ui/link";import{Section as h}from"@stackshift-ui/section";import{Text as p}from"@stackshift-ui/text";import g from"react";import{jsx as a,jsxs as n}from"react/jsx-runtime";function u({links:e,primaryButton:l,secondaryButton:r,logo:i}){let[t,b]=g.useState(!1),m=()=>{b(c=>!c)};return n(h,{className:"bg-background",children:[a("nav",{className:"relative lg:px-6 py-6",children:n(v,{align:"center",justify:"between",gap:4,children:[a(N,{links:e}),a(k,{logo:i}),a(C,{primaryButton:l,secondaryButton:r}),a(M,{showMenu:m})]})}),a(R,{menu:t,showMenu:m,links:e,primaryButton:l,secondaryButton:r})]})}function N({links:e}){return e?a(v,{children:a("ul",{className:"hidden lg:flex lg:items-center lg:gap-3 xl:gap-5",children:e==null?void 0:e.map((l,r)=>n(g.Fragment,{children:[(l==null?void 0:l.label)&&a(w,{link:l}),e.length!==r+1?a(L,{}):null]},r))})}):null}function w({link:e}){return e?a("li",{children:a(s,{variant:"unstyled",asChild:!0,"aria-label":e==null?void 0:e.label,className:"text-sm text-gray-500 no-underline hover:text-gray-900",children:a(o,{link:e,ariaLabel:(e==null?void 0:e.label)||"Navigation link",className:"text-sm text-gray-500 no-underline hover:text-gray-900",children:e==null?void 0:e.label})})}):null}function L(){return a("li",{className:"text-gray-500",children:a("svg",{className:"w-4 h-4 current-fill",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})})}function k({logo:e}){var l;return e?a("div",{className:"w-full lg:w-fit items-center justify-center",children:a(x,{className:"w-20 h-14 flex justify-center items-center","aria-label":d(e)==="/"?"Go to home page":`Go to ${d(e)}`,href:d(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:a(f,{className:"w-fit h-full object-contain",src:`${e==null?void 0:e.image}`,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",alt:(l=e==null?void 0:e.alt)!=null?l:"navigation-logo"})})}):null}function C({primaryButton:e,secondaryButton:l}){return n("div",{className:"hidden lg:flex lg:gap-4",children:[(e==null?void 0:e.label)&&a(s,{asChild:!0,variant:"unstyled","aria-label":e==null?void 0:e.label,className:"px-4 py-3 leading-loose text-center text-secondary-foreground font-semibold rounded-global bg-secondary hover:bg-secondary/50",children:a(o,{link:e,ariaLabel:e==null?void 0:e.label,children:e==null?void 0:e.label})}),(l==null?void 0:l.label)&&a(s,{asChild:!0,variant:"unstyled","aria-label":l==null?void 0:l.label,className:"px-4 py-3 leading-loose text-center text-primary-foreground font-semibold bg-primary hover:bg-primary/50 rounded-global",children:a(o,{link:l,ariaLabel:l==null?void 0:l.label,children:l==null?void 0:l.label})})]})}function M({showMenu:e}){return a("div",{className:"ml-auto lg:hidden",children:a(s,{"aria-label":"Navigation menu",className:"flex items-center p-3 navbar-burger text-primary",onClick:e,children:n("svg",{className:"block w-4 h-4 fill-current",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[a("title",{children:"Mobile menu"}),a("path",{d:"M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"})]})})})}function R({menu:e,showMenu:l,links:r,primaryButton:i,secondaryButton:t}){return n("div",{className:`${e?null:"hidden"} mobile-nav relative z-50`,children:[a("div",{className:"fixed inset-0 bg-gray-800 opacity-25 navbar-backdrop",onClick:l}),n("nav",{className:"fixed top-0 bottom-0 left-0 flex flex-col w-5/6 max-w-sm px-6 py-6 overflow-y-auto bg-white border-r",children:[a("div",{className:"flex items-center mb-8",children:a(s,{"aria-label":"Close navigation menu",className:"navbar-close",onClick:l,children:a("svg",{className:"w-6 h-6 text-gray-500 cursor-pointer hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})}),a("ul",{children:r&&r.map((b,m)=>a("li",{className:"mb-1",children:a(s,{asChild:!0,"aria-label":b.label,className:"block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary",children:a(o,{link:b,ariaLabel:b.label||"Navigation link",className:"block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary",children:b.label})})},m))}),n("div",{className:"mt-auto pt-6",children:[(i==null?void 0:i.label)&&a(s,{asChild:!0,"aria-label":i.label,className:"block px-4 py-3 mb-2 text-center font-semibold rounded-global bg-secondary hover:bg-secondary/50",children:a(o,{link:i,ariaLabel:i.label,className:"block px-4 py-3 mb-2 text-center font-semibold rounded-global bg-secondary hover:bg-secondary/50",children:i.label})}),(t==null?void 0:t.label)&&a(s,{asChild:!0,"aria-label":t.label,className:"block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:a(o,{link:t,ariaLabel:t.label,className:"block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:t.label})})]}),a(p,{fontSize:"xs",muted:!0,className:"my-4 text-center",children:a("span",{children:`\xA9 ${new Date().getFullYear()} All rights reserved.`})})]})]})}export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as x,b as n}from"./chunk-S35O64PB.mjs";import{Button as o}from"@stackshift-ui/button";import{Flex as v}from"@stackshift-ui/flex";import{Image as f}from"@stackshift-ui/image";import{Link as c}from"@stackshift-ui/link";import{Section as h}from"@stackshift-ui/section";import{Text as w}from"@stackshift-ui/text";import d from"react";import{jsx as l,jsxs as t}from"react/jsx-runtime";function N({links:e,primaryButton:a,secondaryButton:b,logo:i}){let[s,r]=d.useState(!1),g=()=>{r(m=>!m)};return t(h,{className:"bg-background",children:[t(v,{align:"center",justify:"between",className:"px-6 py-6",gap:4,children:[l(p,{logo:i}),l(L,{links:e}),l(z,{primaryButton:a,secondaryButton:b}),l(R,{showMenu:g})]}),l(M,{menu:s,showMenu:g,links:e,primaryButton:a,secondaryButton:b})]})}function p({logo:e}){var a;return e?l("div",{className:"w-full lg:w-1/5",children:l(c,{className:"w-20 h-14 flex items-center","aria-label":x(e)==="/"?"Go to home page":`Go to ${x(e)}`,href:x(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:l(f,{className:"w-fit h-full object-contain",src:`${e==null?void 0:e.image}`,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",alt:(a=e==null?void 0:e.alt)!=null?a:"navigation-logo"})})}):null}function u(){return l("li",{className:"text-gray-500",children:l("svg",{className:"w-4 h-4 current-fill",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})})}function L({links:e}){return e?l(v,{children:l("ul",{className:"hidden lg:flex lg:items-center lg:gap-5 xl:gap-10",children:e==null?void 0:e.map((a,b)=>t(d.Fragment,{children:[l(C,{link:a},a._key),e.length!==b+1?l(u,{}):null]},b))})}):null}function C({link:e}){return e!=null&&e.label?l("li",{children:l(o,{asChild:!0,variant:"link","aria-label":e==null?void 0:e.label,className:"text-sm text-gray-500 no-underline hover:text-gray-900",children:l(n,{link:e,ariaLabel:e==null?void 0:e.label,className:"text-sm text-gray-500 no-underline hover:text-gray-900",children:e==null?void 0:e.label})})}):null}function M({menu:e,showMenu:a,links:b,primaryButton:i,secondaryButton:s}){return t("div",{className:`${e?null:"hidden"} mobile-nav relative z-50`,children:[l("div",{className:"fixed inset-0 bg-gray-800 opacity-25 navbar-backdrop",onClick:a}),t(v,{as:"nav",direction:"col",className:"fixed top-0 bottom-0 left-0 w-5/6 max-w-sm px-6 py-6 overflow-y-auto bg-white border-r",children:[l(F,{showMenu:a}),l("div",{className:"w-full",children:b?l("ul",{children:b==null?void 0:b.map((r,g)=>l("li",{className:"mb-1",children:l(o,{asChild:!0,variant:"link","aria-label":r==null?void 0:r.label,className:"block w-full cursor-pointer p-4 text-sm font-semibold text-gray-900 no-underline rounded hover:bg-secondary-foreground hover:text-primary",children:l(n,{link:r,ariaLabel:r==null?void 0:r.label,children:r==null?void 0:r.label})})},g))}):null}),t("div",{className:"w-full mt-auto",children:[t(v,{direction:"col",className:"pt-6",children:[i!=null&&i.label?l(o,{asChild:!0,"aria-label":i==null?void 0:i.label,variant:"outline",className:"block w-full px-4 py-3 mb-3 text-xs cursor-pointer font-semibold leading-loose text-center text-gray-900 rounded-global bg-secondary hover:bg-secondary/50",children:l(n,{link:i,ariaLabel:i==null?void 0:i.label,className:"block w-full px-4 py-3 mb-3 text-xs cursor-pointer font-semibold leading-loose text-center text-gray-900 rounded-global bg-secondary hover:bg-secondary/50",children:i==null?void 0:i.label})}):null,s!=null&&s.label?l(o,{asChild:!0,"aria-label":s==null?void 0:s.label,variant:"link",className:"block w-full px-4 py-3 mb-2 cursor-pointer leading-loose text-xs text-center font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:l(n,{link:s,ariaLabel:s==null?void 0:s.label,className:"block w-full px-4 py-3 mb-2 cursor-pointer leading-loose text-xs text-center font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:s==null?void 0:s.label})}):null]}),l(w,{fontSize:"xs",className:"my-4 text-center text-gray-900",children:l("span",{children:`\xA9 ${new Date().getFullYear()} All rights reserved.`})})]})]})]})}function R({showMenu:e}){return l("div",{className:"lg:hidden",children:l(o,{"aria-label":"Navigation Menu",className:"flex items-center p-3 navbar-burger text-primary",onClick:e,children:t("svg",{className:"block w-4 h-4 fill-current",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[l("title",{children:"Mobile menu"}),l("path",{d:"M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"})]})})})}function z({primaryButton:e,secondaryButton:a}){return t(v,{align:"center",gap:4,children:[e!=null&&e.label?l(o,{asChild:!0,"aria-label":e==null?void 0:e.label,variant:"outline",className:"hidden lg:flex px-4 py-3 leading-loose text-center font-semibold text-secondary-foreground rounded-global bg-secondary hover:bg-secondary/50",children:l(n,{link:e,ariaLabel:e==null?void 0:e.label,children:e==null?void 0:e.label})}):null,a!=null&&a.label?l(o,{asChild:!0,"aria-label":a==null?void 0:a.label,variant:"default",className:"hidden lg:flex px-4 py-3 leading-loose text-center font-semibold text-primary-foreground bg-primary hover:bg-primary/50 rounded-global",children:l(n,{link:a,ariaLabel:a==null?void 0:a.label,children:a==null?void 0:a.label})}):null]})}function F({showMenu:e}){return l("div",{className:"flex items-center mb-8",children:l(o,{"aria-label":"Close Navigation Menu",className:"navbar-close",onClick:e,children:l("svg",{className:"w-6 h-6 text-gray-500 cursor-pointer hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})})}export{N as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v,b as g}from"./chunk-S35O64PB.mjs";import{Button as o}from"@stackshift-ui/button";import{Container as f}from"@stackshift-ui/container";import{Flex as n}from"@stackshift-ui/flex";import{Image as h}from"@stackshift-ui/image";import{Link as c}from"@stackshift-ui/link";import{Section as N}from"@stackshift-ui/section";import{Text as w}from"@stackshift-ui/text";import d from"react";import{jsx as a,jsxs as t}from"react/jsx-runtime";function p({links:e,primaryButton:l,secondaryButton:b,logo:i}){let[s,r]=d.useState(!1),m=()=>{r(x=>!x)};return t(N,{className:"bg-background",children:[a("nav",{className:"relative py-6",children:a(f,{maxWidth:1280,children:t(n,{align:"center",justify:"between",gap:4,children:[a(L,{logo:i}),a(k,{showMenu:m}),a(C,{links:e}),a(R,{primaryButton:l,secondaryButton:b})]})})}),a(z,{menu:s,showMenu:m,links:e,primaryButton:l,secondaryButton:b})]})}function L({logo:e}){var l;return e?a("div",{className:"w-full lg:w-fit",children:a(c,{className:"w-20 h-14 flex items-center","aria-label":v(e)==="/"?"Go to home page":`Go to ${v(e)}`,href:v(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:a(h,{className:"w-fit h-full object-contain",src:`${e==null?void 0:e.image}`,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",alt:(l=e==null?void 0:e.alt)!=null?l:"navigation-logo"})})}):null}function C({links:e}){return e?a(n,{children:a("ul",{className:"hidden lg:flex lg:items-center lg:gap-5 xl:gap-10",children:e==null?void 0:e.map((l,b)=>t(d.Fragment,{children:[a(u,{link:l},l._key),e.length!==b+1?a(M,{}):null]},b))})}):null}function u({link:e}){return e?a("li",{children:a(o,{variant:"unstyled",asChild:!0,"aria-label":e==null?void 0:e.label,className:"text-sm text-gray-500 no-underline hover:text-gray-900",children:a(g,{link:e,ariaLabel:(e==null?void 0:e.label)||"Navigation link",children:e==null?void 0:e.label})})}):null}function M(){return a("li",{className:"text-gray-500",children:a("svg",{className:"w-4 h-4 current-fill",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})})}function R({primaryButton:e,secondaryButton:l}){return t(n,{align:"center",gap:4,children:[(e==null?void 0:e.label)&&a(o,{asChild:!0,"aria-label":e==null?void 0:e.label,className:"hidden lg:flex px-4 py-3 leading-loose text-center font-semibold text-secondary-foreground rounded-global bg-secondary hover:bg-secondary/50",children:a(g,{link:e,ariaLabel:e==null?void 0:e.label,children:e==null?void 0:e.label})}),(l==null?void 0:l.label)&&a(o,{asChild:!0,"aria-label":l==null?void 0:l.label,className:"hidden lg:flex px-4 py-3 leading-loose text-center font-semibold text-primary-foreground bg-primary hover:bg-primary/50 rounded-global",children:a(g,{link:l,ariaLabel:l==null?void 0:l.label,children:l==null?void 0:l.label})})]})}function k({showMenu:e}){return a("div",{className:"lg:hidden",children:a(o,{"aria-label":"Navigation menu",className:"flex items-center p-3 navbar-burger text-primary",onClick:e,children:t("svg",{className:"block w-4 h-4 fill-current",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[a("title",{children:"Mobile menu"}),a("path",{d:"M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"})]})})})}function z({menu:e,showMenu:l,links:b,primaryButton:i,secondaryButton:s}){return a(d.Fragment,{children:t("div",{className:`${e?null:"hidden"} mobile-nav relative z-50`,children:[a("div",{className:"fixed inset-0 bg-gray-800 opacity-25 navbar-backdrop",onClick:l}),t("nav",{className:"fixed top-0 bottom-0 left-0 flex flex-col w-5/6 max-w-sm px-6 py-6 overflow-y-auto bg-white border-r",children:[a("div",{className:"flex items-center mb-8",children:a(o,{"aria-label":"Close navigation menu",className:"navbar-close",onClick:l,children:a("svg",{className:"w-6 h-6 text-gray-500 cursor-pointer hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})}),b&&a("ul",{children:b==null?void 0:b.map((r,m)=>a("li",{className:"mb-1",children:a(o,{asChild:!0,"aria-label":r==null?void 0:r.label,className:"block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary",children:a(g,{link:r,ariaLabel:(r==null?void 0:r.label)||"Navigation link",className:"block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary",children:r==null?void 0:r.label})})},m))}),t("div",{className:"mt-auto",children:[t("div",{className:"pt-6",children:[(i==null?void 0:i.label)&&a(o,{asChild:!0,"aria-label":i==null?void 0:i.label,className:"block px-4 py-3 mb-2 text-gray-900 text-center lg:ml-auto lg:mr-3 font-semibold rounded-global bg-secondary hover:bg-secondary/50",children:a(g,{link:i,ariaLabel:i==null?void 0:i.label,className:"block px-4 py-3 mb-2 text-gray-900 text-center lg:ml-auto lg:mr-3 font-semibold rounded-global bg-secondary hover:bg-secondary/50",children:i==null?void 0:i.label})}),(s==null?void 0:s.label)&&a(o,{asChild:!0,"aria-label":s==null?void 0:s.label,className:"block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:a(g,{link:s,ariaLabel:s==null?void 0:s.label,className:"block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:s==null?void 0:s.label})})]}),a(w,{fontSize:"xs",className:"my-4 text-center text-gray-900",children:a("span",{children:`\xA9 ${new Date().getFullYear()} All rights reserved.`})})]})]})]})})}export{p as a};
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
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-
|
|
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-AYUL7QX6.mjs";import{a as x}from"./chunk-7JNLKLGB.mjs";import{a as o}from"./chunk-SMYVBKA6.mjs";import{a as r}from"./chunk-ZCDQD6XN.mjs";import{a as e}from"./chunk-5TVYK3JB.mjs";import{a as t}from"./chunk-FJRVUW5P.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-7JNLKLGB.mjs";export{a as Navigation};
|
package/dist/navigation_a.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-SMYVBKA6.mjs";import"./chunk-S35O64PB.mjs";export{a as Navigation_A,a as default};
|
package/dist/navigation_b.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-ZCDQD6XN.mjs";import"./chunk-S35O64PB.mjs";export{a as Navigation_B,a as default};
|
package/dist/navigation_c.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-5TVYK3JB.mjs";import"./chunk-S35O64PB.mjs";export{a as Navigation_C,a as default};
|
package/dist/navigation_d.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-FJRVUW5P.mjs";import"./chunk-S35O64PB.mjs";export{a as Navigation_D,a as default};
|
package/dist/navigation_e.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b}from"./chunk-IMQB7ODR.mjs";import{a as l}from"./chunk-S35O64PB.mjs";import{PortableText as L}from"@portabletext/react";import{Button as c}from"@stackshift-ui/button";import{Flex as g}from"@stackshift-ui/flex";import{Image as x}from"@stackshift-ui/image";import{Link as y}from"@stackshift-ui/link";import{Section as S}from"@stackshift-ui/section";import{Fragment as C,useEffect as B,useRef as k,useState as v}from"react";import{jsx as t,jsxs as a}from"react/jsx-runtime";function M({banner:e,logo:r,links:i}){let[s,u]=v(!1),[m,f]=v(!1),[o,n]=v(""),d=k("");B(()=>{d.current=o},[o]);let h=()=>u(!s),p=N=>{N.preventDefault();let w=document.getElementById("query");w&&(n(w.value),window.location.href=`/search?q=${o}`)};return a(S,{className:"relative bg-background",children:[t(F,{banner:e}),a(g,{as:"nav",justify:"between",className:"relative",children:[a(g,{align:"center",className:"w-full px-12 py-8",children:[t(R,{logo:r}),t(P,{links:i})]}),a("div",{className:"items-center hidden lg:flex lg:gap-10",children:[t(E,{showSearchBar:m,setShowSearchBar:f}),t(H,{showSearchBar:m,handleSearchRouting:p,productQuery:o,setProductQuery:n}),t(I,{}),t(Q,{})]}),t(q,{showMenu:h})]}),t(T,{logo:r,links:i,menu:s,showMenu:h,handleSearchRouting:p,productQuery:o,setProductQuery:n})]})}function F({banner:e}){return e?t("div",{className:"py-2 bg-primary",children:a(g,{align:"center",justify:"center",children:[a("svg",{className:"mr-2",width:18,height:11,viewBox:"0 0 18 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("rect",{y:"3.07129",width:4,height:10,rx:2,transform:"rotate(-45 0 3.07129)",fill:"white"}),t("rect",{x:8,y:"2.82861",width:4,height:10,rx:2,transform:"rotate(-45 8 2.82861)",fill:"white"})]}),t(L,{value:e,components:b,onMissingComponent:!1})]})}):null}function R({logo:e}){var r;return e?t(y,{"aria-label":`Go to ${l(e)==="/"?"home page":l(e)}`,className:"text-3xl font-bold leading-none",href:l(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:48,height:48,alt:(r=e==null?void 0:e.alt)!=null?r:"navigation-logo"})}):null}function P({links:e}){return e?t("ul",{className:"hidden transform main-nav top-1/2 lg:flex lg:gap-10 lg:justify-center lg:items-center",children:e.map((r,i)=>t(C,{children:t(z,{link:r})},i))}):null}function z({link:e}){return e?t("li",{children:t(c,{as:"link",variant:"link",ariaLabel:e==null?void 0:e.label,link:e,className:(e==null?void 0:e.type)==="linkInternal"?"xl:mr-12 lg:mr-8 font-bold font-heading hover:text-gray-600 no-underline text-black":"mr-12 font-bold font-heading hover:text-gray-600 no-underline text-black",children:e==null?void 0:e.label})}):null}function E({showSearchBar:e,setShowSearchBar:r}){return t(c,{as:"button",variant:"unstyled",ariaLabel:"Search button",type:"button",onClick:()=>r(!e),children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:t("path",{d:"M23.809 21.646l-6.205-6.205c1.167-1.605 1.857-3.579 1.857-5.711 0-5.365-4.365-9.73-9.731-9.73-5.365 0-9.73 4.365-9.73 9.73 0 5.366 4.365 9.73 9.73 9.73 2.034 0 3.923-.627 5.487-1.698l6.238 6.238 2.354-2.354zm-20.955-11.916c0-3.792 3.085-6.877 6.877-6.877s6.877 3.085 6.877 6.877-3.085 6.877-6.877 6.877c-3.793 0-6.877-3.085-6.877-6.877z"})})})}function H({showSearchBar:e,handleSearchRouting:r,productQuery:i,setProductQuery:s}){return e?a("form",{id:"form",className:"flex items-center pl-8 mb-10 mr-auto bg-white lg:mb-0",method:"get",role:"search",onSubmit:r,children:[t("input",{id:"query",name:"query","aria-label":"Search...",className:"inline-block w-40 h-full p-2 mt-1 text-sm bg-white border shadow-sm border-slate-300 placeholder-slate-400 focus:border-primary-foreground focus:outline-none focus:ring-1 focus:ring-primary-foreground",placeholder:"Search...",onChange:u=>s(u.target.value),type:"search"}),t(c,{as:"button",variant:"unstyled",ariaLabel:"Submit product search",className:`mt-1 inline-flex h-[35px] w-10 items-center justify-center bg-primary ${i===""?"cursor-not-allowed opacity-50":"transition duration-200 hover:bg-primary-foreground"}`,disabled:i==="",type:"submit",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:t("path",{d:"M23.809 21.646l-6.205-6.205c1.167-1.605 1.857-3.579 1.857-5.711 0-5.365-4.365-9.73-9.731-9.73-5.365 0-9.73 4.365-9.73 9.73 0 5.366 4.365 9.73 9.73 9.73 2.034 0 3.923-.627 5.487-1.698l6.238 6.238 2.354-2.354zm-20.955-11.916c0-3.792 3.085-6.877 6.877-6.877s6.877 3.085 6.877 6.877-3.085 6.877-6.877 6.877c-3.793 0-6.877-3.085-6.877-6.877z"})})})]}):null}function q({showMenu:e}){return t(c,{variant:"unstyled",as:"button",ariaLabel:"Nav Sidebar",className:"self-center mr-12 navbar-burger lg:hidden",onClick:e,children:t("svg",{width:20,height:12,viewBox:"0 0 20 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M1 2H19C19.2652 2 19.5196 1.89464 19.7071 1.70711C19.8946 1.51957 20 1.26522 20 1C20 0.734784 19.8946 0.48043 19.7071 0.292893C19.5196 0.105357 19.2652 0 19 0H1C0.734784 0 0.48043 0.105357 0.292893 0.292893C0.105357 0.48043 0 0.734784 0 1C0 1.26522 0.105357 1.51957 0.292893 1.70711C0.48043 1.89464 0.734784 2 1 2ZM19 10H1C0.734784 10 0.48043 10.1054 0.292893 10.2929C0.105357 10.4804 0 10.7348 0 11C0 11.2652 0.105357 11.5196 0.292893 11.7071C0.48043 11.8946 0.734784 12 1 12H19C19.2652 12 19.5196 11.8946 19.7071 11.7071C19.8946 11.5196 20 11.2652 20 11C20 10.7348 19.8946 10.4804 19.7071 10.2929C19.5196 10.1054 19.2652 10 19 10ZM19 5H1C0.734784 5 0.48043 5.10536 0.292893 5.29289C0.105357 5.48043 0 5.73478 0 6C0 6.26522 0.105357 6.51957 0.292893 6.70711C0.48043 6.89464 0.734784 7 1 7H19C19.2652 7 19.5196 6.89464 19.7071 6.70711C19.8946 6.51957 20 6.26522 20 6C20 5.73478 19.8946 5.48043 19.7071 5.29289C19.5196 5.10536 19.2652 5 19 5Z",fill:"currentColor"})})})}function I(){return a("div",{className:"cart-icon cart-link",children:[t("svg",{"data-icon":"BAG",className:"ec-minicart__icon",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:t("path",{d:"M20 7h-4v-3c0-2.209-1.791-4-4-4s-4 1.791-4 4v3h-4l-2 17h20l-2-17zm-11-3c0-1.654 1.346-3 3-3s3 1.346 3 3v3h-6v-3zm-4.751 18l1.529-13h2.222v1.5c0 .276.224.5.5.5s.5-.224.5-.5v-1.5h6v1.5c0 .276.224.5.5.5s.5-.224.5-.5v-1.5h2.222l1.529 13h-15.502z"})}),t("a",{className:"cart-link",href:"/cart?store-page=cart","aria-label":"Cart"})]})}function Q(){return t("a",{"aria-label":"Account",href:"/cart?store-page=account",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:t("path",{d:"M12 2c2.757 0 5 2.243 5 5.001 0 2.756-2.243 5-5 5s-5-2.244-5-5c0-2.758 2.243-5.001 5-5.001zm0-2c-3.866 0-7 3.134-7 7.001 0 3.865 3.134 7 7 7s7-3.135 7-7c0-3.867-3.134-7.001-7-7.001zm6.369 13.353c-.497.498-1.057.931-1.658 1.302 2.872 1.874 4.378 5.083 4.972 7.346h-19.387c.572-2.29 2.058-5.503 4.973-7.358-.603-.374-1.162-.811-1.658-1.312-4.258 3.072-5.611 8.506-5.611 10.669h24c0-2.142-1.44-7.557-5.631-10.647z"})})})}function T({logo:e,links:r,menu:i,showMenu:s,handleSearchRouting:u,productQuery:m,setProductQuery:f}){var o;return a("div",{className:`${i?null:"hidden"} mobile-nav fixed bottom-0 right-0 top-0 w-5/6 max-w-sm`,style:{zIndex:60},children:[t("div",{className:"fixed inset-0 bg-gray-800 opacity-25",onClick:s}),a("nav",{className:"relative flex flex-col w-full h-full px-6 py-6 overflow-y-auto bg-white border-r",children:[a("div",{className:"flex items-center mb-8",children:[e&&t(y,{"aria-label":`Go to ${l(e)==="/"?"home page":l(e)}`,className:"text-3xl font-bold leading-none",href:l(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,alt:(o=e==null?void 0:e.alt)!=null?o:"navigation-logo",width:48,height:48,className:"text-3xl font-bold leading-none"})}),t(c,{variant:"unstyled",as:"button",ariaLabel:"Close navigation menu",className:"ml-auto",onClick:s,children:t("svg",{className:"w-2 h-2 text-gray-500 cursor-pointer",width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M9.00002 1L1 9.00002M1.00003 1L9.00005 9.00002",stroke:"black",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),a("form",{id:"form",className:"flex mt-3 bg-white",method:"get",role:"search",onSubmit:u,children:[t("input",{id:"query",name:"query","aria-label":"Search product",className:"inline-block w-full h-full p-2 text-sm bg-white border shadow-sm border-slate-300 placeholder-slate-400 focus:border-primary-foreground focus:outline-none focus:ring-1 focus:ring-primary-foreground sm:w-60",placeholder:"Search...",onChange:n=>f(n.target.value),type:"search"}),t(c,{variant:"unstyled",as:"button",ariaLabel:"Submit product search",className:`inline-flex h-full w-10 items-center justify-center bg-primary ${m===""?"cursor-not-allowed opacity-50":"transition duration-200 hover:bg-primary-foreground"}`,disabled:m==="",type:"submit",children:t("svg",{width:7,height:12,viewBox:"0 0 7 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M4.125 6.00252L0 1.87752L1.17801 0.699219L6.48102 6.00252L1.17801 11.3058L0 10.1275L4.125 6.00252Z",fill:"white"})})})]}),t("ul",{className:"mt-10 mb-5",children:r&&r.map((n,d)=>{var h;return t(C,{children:t("li",{className:"mb-8",children:t(c,{as:"link",variant:"link",ariaLabel:(h=n==null?void 0:n.label)!=null?h:`navigation link ${d+1}`,link:n,className:"font-bold text-black no-underline font-heading hover:text-gray-600",children:n==null?void 0:n.label})})},d)})}),t("hr",{}),a("div",{className:"flex items-center mx-auto mt-3",children:[a("a",{className:"flex mr-10 cart-icon cart-link","aria-label":"Cart",href:"/cart?store-page=cart",children:[t("div",{"data-icon":"BAG",className:"ec-cart-widget"}),t("span",{className:"my-auto text-sm",children:"Cart"})]}),a("a",{className:"flex","aria-label":"Account",href:"/cart?store-page=account",children:[a("svg",{width:32,height:31,viewBox:"0 0 32 31",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M16.0006 16.3154C19.1303 16.3154 21.6673 13.799 21.6673 10.6948C21.6673 7.59064 19.1303 5.07422 16.0006 5.07422C12.871 5.07422 10.334 7.59064 10.334 10.6948C10.334 13.799 12.871 16.3154 16.0006 16.3154Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M24.4225 23.8963C23.6678 22.3507 22.4756 21.0445 20.9845 20.1298C19.4934 19.2151 17.7647 18.7295 15.9998 18.7295C14.2349 18.7295 12.5063 19.2151 11.0152 20.1298C9.52406 21.0445 8.33179 22.3507 7.57715 23.8963",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),t("span",{className:"my-auto text-sm",children:"Account"})]})]})]})]})}export{M as Navigation_E,M as default};
|
|
1
|
+
import{a as x}from"./chunk-IMQB7ODR.mjs";import{a as l,b as f}from"./chunk-S35O64PB.mjs";import{PortableText as S}from"@portabletext/react";import{Button as c}from"@stackshift-ui/button";import{Flex as v}from"@stackshift-ui/flex";import{Image as y}from"@stackshift-ui/image";import{Link as C}from"@stackshift-ui/link";import{Section as B}from"@stackshift-ui/section";import{Fragment as N,useEffect as k,useRef as M,useState as g}from"react";import{jsx as t,jsxs as a}from"react/jsx-runtime";function F({banner:e,logo:r,links:i}){let[s,h]=g(!1),[m,d]=g(!1),[o,n]=g(""),u=M("");k(()=>{u.current=o},[o]);let p=()=>h(!s),w=L=>{L.preventDefault();let b=document.getElementById("query");b&&(n(b.value),window.location.href=`/search?q=${o}`)};return a(B,{className:"relative bg-background",children:[t(R,{banner:e}),a(v,{as:"nav",justify:"between",className:"relative",children:[a(v,{align:"center",className:"w-full px-12 py-8",children:[t(P,{logo:r}),t(z,{links:i})]}),a("div",{className:"items-center hidden lg:flex lg:gap-10",children:[t(H,{showSearchBar:m,setShowSearchBar:d}),t(q,{showSearchBar:m,handleSearchRouting:w,productQuery:o,setProductQuery:n}),t(Q,{}),t(T,{})]}),t(I,{showMenu:p})]}),t(j,{logo:r,links:i,menu:s,showMenu:p,handleSearchRouting:w,productQuery:o,setProductQuery:n})]})}function R({banner:e}){return e?t("div",{className:"py-2 bg-primary",children:a(v,{align:"center",justify:"center",children:[a("svg",{className:"mr-2",width:18,height:11,viewBox:"0 0 18 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("rect",{y:"3.07129",width:4,height:10,rx:2,transform:"rotate(-45 0 3.07129)",fill:"white"}),t("rect",{x:8,y:"2.82861",width:4,height:10,rx:2,transform:"rotate(-45 8 2.82861)",fill:"white"})]}),t(S,{value:e,components:x,onMissingComponent:!1})]})}):null}function P({logo:e}){var r;return e?t(C,{"aria-label":`Go to ${l(e)==="/"?"home page":l(e)}`,className:"text-3xl font-bold leading-none",href:l(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:t(y,{src:e==null?void 0:e.image,width:48,height:48,alt:(r=e==null?void 0:e.alt)!=null?r:"navigation-logo"})}):null}function z({links:e}){return e?t("ul",{className:"hidden transform main-nav top-1/2 lg:flex lg:gap-10 lg:justify-center lg:items-center",children:e.map((r,i)=>t(N,{children:t(E,{link:r})},i))}):null}function E({link:e}){return e?t("li",{children:t(c,{asChild:!0,variant:"link",className:(e==null?void 0:e.type)==="linkInternal"?"xl:mr-12 lg:mr-8 font-bold font-heading hover:text-gray-600 no-underline text-black":"mr-12 font-bold font-heading hover:text-gray-600 no-underline text-black",children:t(f,{ariaLabel:(e==null?void 0:e.label)||"Navigation link",link:e,children:e==null?void 0:e.label})})}):null}function H({showSearchBar:e,setShowSearchBar:r}){return t(c,{variant:"ghost","aria-label":"Search button",type:"button",onClick:()=>r(!e),children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:t("path",{d:"M23.809 21.646l-6.205-6.205c1.167-1.605 1.857-3.579 1.857-5.711 0-5.365-4.365-9.73-9.731-9.73-5.365 0-9.73 4.365-9.73 9.73 0 5.366 4.365 9.73 9.73 9.73 2.034 0 3.923-.627 5.487-1.698l6.238 6.238 2.354-2.354zm-20.955-11.916c0-3.792 3.085-6.877 6.877-6.877s6.877 3.085 6.877 6.877-3.085 6.877-6.877 6.877c-3.793 0-6.877-3.085-6.877-6.877z"})})})}function q({showSearchBar:e,handleSearchRouting:r,productQuery:i,setProductQuery:s}){return e?a("form",{id:"form",className:"flex items-center pl-8 mb-10 mr-auto bg-white lg:mb-0",method:"get",role:"search",onSubmit:r,children:[t("input",{id:"query",name:"query","aria-label":"Search...",className:"inline-block w-40 h-full p-2 mt-1 text-sm bg-white border shadow-sm border-slate-300 placeholder-slate-400 focus:border-primary-foreground focus:outline-none focus:ring-1 focus:ring-primary-foreground",placeholder:"Search...",onChange:h=>s(h.target.value),type:"search"}),t(c,{variant:"ghost","aria-label":"Submit product search",className:`mt-1 inline-flex h-[35px] w-10 items-center justify-center bg-primary ${i===""?"cursor-not-allowed opacity-50":"transition duration-200 hover:bg-primary-foreground"}`,disabled:i==="",type:"submit",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:t("path",{d:"M23.809 21.646l-6.205-6.205c1.167-1.605 1.857-3.579 1.857-5.711 0-5.365-4.365-9.73-9.731-9.73-5.365 0-9.73 4.365-9.73 9.73 0 5.366 4.365 9.73 9.73 9.73 2.034 0 3.923-.627 5.487-1.698l6.238 6.238 2.354-2.354zm-20.955-11.916c0-3.792 3.085-6.877 6.877-6.877s6.877 3.085 6.877 6.877-3.085 6.877-6.877 6.877c-3.793 0-6.877-3.085-6.877-6.877z"})})})]}):null}function I({showMenu:e}){return t(c,{variant:"ghost","aria-label":"Nav Sidebar",className:"self-center mr-12 navbar-burger lg:hidden",onClick:e,children:t("svg",{width:20,height:12,viewBox:"0 0 20 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M1 2H19C19.2652 2 19.5196 1.89464 19.7071 1.70711C19.8946 1.51957 20 1.26522 20 1C20 0.734784 19.8946 0.48043 19.7071 0.292893C19.5196 0.105357 19.2652 0 19 0H1C0.734784 0 0.48043 0.105357 0.292893 0.292893C0.105357 0.48043 0 0.734784 0 1C0 1.26522 0.105357 1.51957 0.292893 1.70711C0.48043 1.89464 0.734784 2 1 2ZM19 10H1C0.734784 10 0.48043 10.1054 0.292893 10.2929C0.105357 10.4804 0 10.7348 0 11C0 11.2652 0.105357 11.5196 0.292893 11.7071C0.48043 11.8946 0.734784 12 1 12H19C19.2652 12 19.5196 11.8946 19.7071 11.7071C19.8946 11.5196 20 11.2652 20 11C20 10.7348 19.8946 10.4804 19.7071 10.2929C19.5196 10.1054 19.2652 10 19 10ZM19 5H1C0.734784 5 0.48043 5.10536 0.292893 5.29289C0.105357 5.48043 0 5.73478 0 6C0 6.26522 0.105357 6.51957 0.292893 6.70711C0.48043 6.89464 0.734784 7 1 7H19C19.2652 7 19.5196 6.89464 19.7071 6.70711C19.8946 6.51957 20 6.26522 20 6C20 5.73478 19.8946 5.48043 19.7071 5.29289C19.5196 5.10536 19.2652 5 19 5Z",fill:"currentColor"})})})}function Q(){return a("div",{className:"cart-icon cart-link",children:[t("svg",{"data-icon":"BAG",className:"ec-minicart__icon",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:t("path",{d:"M20 7h-4v-3c0-2.209-1.791-4-4-4s-4 1.791-4 4v3h-4l-2 17h20l-2-17zm-11-3c0-1.654 1.346-3 3-3s3 1.346 3 3v3h-6v-3zm-4.751 18l1.529-13h2.222v1.5c0 .276.224.5.5.5s.5-.224.5-.5v-1.5h6v1.5c0 .276.224.5.5.5s.5-.224.5-.5v-1.5h2.222l1.529 13h-15.502z"})}),t("a",{className:"cart-link",href:"/cart?store-page=cart","aria-label":"Cart"})]})}function T(){return t("a",{"aria-label":"Account",href:"/cart?store-page=account",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:t("path",{d:"M12 2c2.757 0 5 2.243 5 5.001 0 2.756-2.243 5-5 5s-5-2.244-5-5c0-2.758 2.243-5.001 5-5.001zm0-2c-3.866 0-7 3.134-7 7.001 0 3.865 3.134 7 7 7s7-3.135 7-7c0-3.867-3.134-7.001-7-7.001zm6.369 13.353c-.497.498-1.057.931-1.658 1.302 2.872 1.874 4.378 5.083 4.972 7.346h-19.387c.572-2.29 2.058-5.503 4.973-7.358-.603-.374-1.162-.811-1.658-1.312-4.258 3.072-5.611 8.506-5.611 10.669h24c0-2.142-1.44-7.557-5.631-10.647z"})})})}function j({logo:e,links:r,menu:i,showMenu:s,handleSearchRouting:h,productQuery:m,setProductQuery:d}){var o;return a("div",{className:`${i?null:"hidden"} mobile-nav fixed bottom-0 right-0 top-0 w-5/6 max-w-sm`,style:{zIndex:60},children:[t("div",{className:"fixed inset-0 bg-gray-800 opacity-25",onClick:s}),a("nav",{className:"relative flex flex-col w-full h-full px-6 py-6 overflow-y-auto bg-white border-r",children:[a("div",{className:"flex items-center mb-8",children:[e&&t(C,{"aria-label":`Go to ${l(e)==="/"?"home page":l(e)}`,className:"text-3xl font-bold leading-none",href:l(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:t(y,{src:e==null?void 0:e.image,alt:(o=e==null?void 0:e.alt)!=null?o:"navigation-logo",width:48,height:48,className:"text-3xl font-bold leading-none"})}),t(c,{variant:"ghost","aria-label":"Close navigation menu",className:"ml-auto",onClick:s,children:t("svg",{className:"w-2 h-2 text-gray-500 cursor-pointer",width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M9.00002 1L1 9.00002M1.00003 1L9.00005 9.00002",stroke:"black",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),a("form",{id:"form",className:"flex mt-3 bg-white",method:"get",role:"search",onSubmit:h,children:[t("input",{id:"query",name:"query","aria-label":"Search product",className:"inline-block w-full h-full p-2 text-sm bg-white border shadow-sm border-slate-300 placeholder-slate-400 focus:border-primary-foreground focus:outline-none focus:ring-1 focus:ring-primary-foreground sm:w-60",placeholder:"Search...",onChange:n=>d(n.target.value),type:"search"}),t(c,{variant:"ghost","aria-label":"Submit product search",className:`inline-flex h-full w-10 items-center justify-center bg-primary ${m===""?"cursor-not-allowed opacity-50":"transition duration-200 hover:bg-primary-foreground"}`,disabled:m==="",type:"submit",children:t("svg",{width:7,height:12,viewBox:"0 0 7 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M4.125 6.00252L0 1.87752L1.17801 0.699219L6.48102 6.00252L1.17801 11.3058L0 10.1275L4.125 6.00252Z",fill:"white"})})})]}),t("ul",{className:"mt-10 mb-5",children:r&&r.map((n,u)=>t(N,{children:t("li",{className:"mb-8",children:t(c,{asChild:!0,variant:"link",className:"font-bold text-black no-underline font-heading hover:text-gray-600",children:t(f,{ariaLabel:(n==null?void 0:n.label)||`navigation link ${u+1}`,link:n,children:n==null?void 0:n.label})})})},u))}),t("hr",{}),a("div",{className:"flex items-center mx-auto mt-3",children:[a("a",{className:"flex mr-10 cart-icon cart-link","aria-label":"Cart",href:"/cart?store-page=cart",children:[t("div",{"data-icon":"BAG",className:"ec-cart-widget"}),t("span",{className:"my-auto text-sm",children:"Cart"})]}),a("a",{className:"flex","aria-label":"Account",href:"/cart?store-page=account",children:[a("svg",{width:32,height:31,viewBox:"0 0 32 31",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M16.0006 16.3154C19.1303 16.3154 21.6673 13.799 21.6673 10.6948C21.6673 7.59064 19.1303 5.07422 16.0006 5.07422C12.871 5.07422 10.334 7.59064 10.334 10.6948C10.334 13.799 12.871 16.3154 16.0006 16.3154Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M24.4225 23.8963C23.6678 22.3507 22.4756 21.0445 20.9845 20.1298C19.4934 19.2151 17.7647 18.7295 15.9998 18.7295C14.2349 18.7295 12.5063 19.2151 11.0152 20.1298C9.52406 21.0445 8.33179 22.3507 7.57715 23.8963",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),t("span",{className:"my-auto text-sm",children:"Account"})]})]})]})]})}export{F as Navigation_E,F as default};
|
package/dist/navigation_h.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-AYUL7QX6.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": "
|
|
4
|
+
"version": "7.0.0-beta.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -38,21 +38,21 @@
|
|
|
38
38
|
"@react-spring/web": "^10.0.1",
|
|
39
39
|
"@uidotdev/usehooks": "^2.4.1",
|
|
40
40
|
"react-icons": "^5.3.0",
|
|
41
|
-
"@stackshift-ui/
|
|
42
|
-
"@stackshift-ui/
|
|
43
|
-
"@stackshift-ui/
|
|
44
|
-
"@stackshift-ui/
|
|
45
|
-
"@stackshift-ui/
|
|
46
|
-
"@stackshift-ui/section": "
|
|
47
|
-
"@stackshift-ui/
|
|
48
|
-
"@stackshift-ui/
|
|
49
|
-
"@stackshift-ui/
|
|
50
|
-
"@stackshift-ui/
|
|
51
|
-
"@stackshift-ui/
|
|
52
|
-
"@stackshift-ui/
|
|
41
|
+
"@stackshift-ui/link": "6.0.12-beta.1",
|
|
42
|
+
"@stackshift-ui/flex": "7.0.0-beta.1",
|
|
43
|
+
"@stackshift-ui/button": "6.1.0-beta.1",
|
|
44
|
+
"@stackshift-ui/system": "6.1.0-beta.1",
|
|
45
|
+
"@stackshift-ui/grid": "7.0.0-beta.1",
|
|
46
|
+
"@stackshift-ui/section": "7.0.0-beta.1",
|
|
47
|
+
"@stackshift-ui/social-icons": "7.0.0-beta.1",
|
|
48
|
+
"@stackshift-ui/container": "7.0.0-beta.1",
|
|
49
|
+
"@stackshift-ui/text": "7.0.0-beta.1",
|
|
50
|
+
"@stackshift-ui/heading": "7.0.0-beta.1",
|
|
51
|
+
"@stackshift-ui/image": "6.1.0-beta.1",
|
|
52
|
+
"@stackshift-ui/scripts": "6.1.0-beta.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@stackshift-ui/system": ">=6.0.
|
|
55
|
+
"@stackshift-ui/system": ">=6.1.0-beta.1",
|
|
56
56
|
"@types/react": "16.8 - 19",
|
|
57
57
|
"next": "10 - 14",
|
|
58
58
|
"react": "16.8 - 19",
|
package/src/navigation.test.tsx
CHANGED
|
@@ -7,7 +7,7 @@ describe.concurrent("navigation", () => {
|
|
|
7
7
|
|
|
8
8
|
test.skip("Dummy test - test if renders without errors", ({ expect }) => {
|
|
9
9
|
const clx = "my-class";
|
|
10
|
-
render(<Navigation />);
|
|
11
|
-
expect(screen.getByTestId("
|
|
10
|
+
render(<Navigation data-testid="navigation" />);
|
|
11
|
+
expect(screen.getByTestId("navigation").classList).toContain(clx);
|
|
12
12
|
});
|
|
13
13
|
});
|
package/src/navigation_a.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { Section } from "@stackshift-ui/section";
|
|
|
6
6
|
import { Text } from "@stackshift-ui/text";
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { NavigationProps, ResponsiveNavLinksProps } from ".";
|
|
9
|
-
import { logoLink } from "./helper";
|
|
9
|
+
import { ConditionalLink, logoLink } from "./helper";
|
|
10
10
|
import { LabeledRoute, LabeledRouteWithKey, Logo } from "./types";
|
|
11
11
|
|
|
12
12
|
export default function Navigation_A({
|
|
@@ -103,11 +103,16 @@ function NavItem({ link }: { link?: LabeledRoute }) {
|
|
|
103
103
|
return (
|
|
104
104
|
<li>
|
|
105
105
|
<Button
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
asChild
|
|
107
|
+
variant="link"
|
|
108
|
+
aria-label={link?.label}
|
|
109
109
|
className="text-sm text-gray-500 no-underline hover:text-gray-900">
|
|
110
|
-
|
|
110
|
+
<ConditionalLink
|
|
111
|
+
link={link}
|
|
112
|
+
ariaLabel={link?.label}
|
|
113
|
+
className="text-sm text-gray-500 no-underline hover:text-gray-900">
|
|
114
|
+
{link?.label}
|
|
115
|
+
</ConditionalLink>
|
|
111
116
|
</Button>
|
|
112
117
|
</li>
|
|
113
118
|
);
|
|
@@ -134,11 +139,13 @@ function ResponsiveNavLinks({
|
|
|
134
139
|
{links?.map((link: any, index: number) => (
|
|
135
140
|
<li className="mb-1" key={index}>
|
|
136
141
|
<Button
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
{link?.label}
|
|
142
|
+
asChild
|
|
143
|
+
variant="link"
|
|
144
|
+
aria-label={link?.label}
|
|
145
|
+
className="block w-full cursor-pointer p-4 text-sm font-semibold text-gray-900 no-underline rounded hover:bg-secondary-foreground hover:text-primary">
|
|
146
|
+
<ConditionalLink link={link} ariaLabel={link?.label}>
|
|
147
|
+
{link?.label}
|
|
148
|
+
</ConditionalLink>
|
|
142
149
|
</Button>
|
|
143
150
|
</li>
|
|
144
151
|
))}
|
|
@@ -149,22 +156,30 @@ function ResponsiveNavLinks({
|
|
|
149
156
|
<Flex direction="col" className="pt-6">
|
|
150
157
|
{primaryButton?.label ? (
|
|
151
158
|
<Button
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
ariaLabel={primaryButton?.label}
|
|
159
|
+
asChild
|
|
160
|
+
aria-label={primaryButton?.label}
|
|
155
161
|
variant="outline"
|
|
156
162
|
className="block w-full px-4 py-3 mb-3 text-xs cursor-pointer font-semibold leading-loose text-center text-gray-900 rounded-global bg-secondary hover:bg-secondary/50">
|
|
157
|
-
|
|
163
|
+
<ConditionalLink
|
|
164
|
+
link={primaryButton}
|
|
165
|
+
ariaLabel={primaryButton?.label}
|
|
166
|
+
className="block w-full px-4 py-3 mb-3 text-xs cursor-pointer font-semibold leading-loose text-center text-gray-900 rounded-global bg-secondary hover:bg-secondary/50">
|
|
167
|
+
{primaryButton?.label}
|
|
168
|
+
</ConditionalLink>
|
|
158
169
|
</Button>
|
|
159
170
|
) : null}
|
|
160
171
|
{secondaryButton?.label ? (
|
|
161
172
|
<Button
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
variant="solid"
|
|
173
|
+
asChild
|
|
174
|
+
aria-label={secondaryButton?.label}
|
|
175
|
+
variant="link"
|
|
166
176
|
className={`block w-full px-4 py-3 mb-2 cursor-pointer leading-loose text-xs text-center font-semibold bg-primary hover:bg-primary-foreground rounded-global`}>
|
|
167
|
-
|
|
177
|
+
<ConditionalLink
|
|
178
|
+
link={secondaryButton}
|
|
179
|
+
ariaLabel={secondaryButton?.label}
|
|
180
|
+
className={`block w-full px-4 py-3 mb-2 cursor-pointer leading-loose text-xs text-center font-semibold bg-primary hover:bg-primary-foreground rounded-global`}>
|
|
181
|
+
{secondaryButton?.label}
|
|
182
|
+
</ConditionalLink>
|
|
168
183
|
</Button>
|
|
169
184
|
) : null}
|
|
170
185
|
</Flex>
|
|
@@ -181,9 +196,7 @@ function MobileMenu({ showMenu }: { showMenu: () => void }) {
|
|
|
181
196
|
return (
|
|
182
197
|
<div className="lg:hidden">
|
|
183
198
|
<Button
|
|
184
|
-
|
|
185
|
-
as="button"
|
|
186
|
-
ariaLabel="Navigation Menu"
|
|
199
|
+
aria-label="Navigation Menu"
|
|
187
200
|
className="flex items-center p-3 navbar-burger text-primary"
|
|
188
201
|
onClick={showMenu}>
|
|
189
202
|
<svg
|
|
@@ -209,22 +222,24 @@ function Buttons({
|
|
|
209
222
|
<Flex align="center" gap={4}>
|
|
210
223
|
{primaryButton?.label ? (
|
|
211
224
|
<Button
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
ariaLabel={primaryButton?.label}
|
|
225
|
+
asChild
|
|
226
|
+
aria-label={primaryButton?.label}
|
|
215
227
|
variant="outline"
|
|
216
|
-
className="hidden lg:flex px-4 py-3 leading-loose text-center font-semibold text-
|
|
217
|
-
{primaryButton?.label}
|
|
228
|
+
className="hidden lg:flex px-4 py-3 leading-loose text-center font-semibold text-secondary-foreground rounded-global bg-secondary hover:bg-secondary/50">
|
|
229
|
+
<ConditionalLink link={primaryButton} ariaLabel={primaryButton?.label}>
|
|
230
|
+
{primaryButton?.label}
|
|
231
|
+
</ConditionalLink>
|
|
218
232
|
</Button>
|
|
219
233
|
) : null}
|
|
220
234
|
{secondaryButton?.label ? (
|
|
221
235
|
<Button
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
236
|
+
asChild
|
|
237
|
+
aria-label={secondaryButton?.label}
|
|
238
|
+
variant="default"
|
|
239
|
+
className="hidden lg:flex px-4 py-3 leading-loose text-center font-semibold text-primary-foreground bg-primary hover:bg-primary/50 rounded-global">
|
|
240
|
+
<ConditionalLink link={secondaryButton} ariaLabel={secondaryButton?.label}>
|
|
241
|
+
{secondaryButton?.label}
|
|
242
|
+
</ConditionalLink>
|
|
228
243
|
</Button>
|
|
229
244
|
) : null}
|
|
230
245
|
</Flex>
|
|
@@ -234,12 +249,7 @@ function Buttons({
|
|
|
234
249
|
function BurgerMenuIcon({ showMenu }: { showMenu: () => void }) {
|
|
235
250
|
return (
|
|
236
251
|
<div className="flex items-center mb-8">
|
|
237
|
-
<Button
|
|
238
|
-
variant="unstyled"
|
|
239
|
-
as="button"
|
|
240
|
-
ariaLabel="Navigation Menu"
|
|
241
|
-
className="navbar-close"
|
|
242
|
-
onClick={showMenu}>
|
|
252
|
+
<Button aria-label="Close Navigation Menu" className="navbar-close" onClick={showMenu}>
|
|
243
253
|
<svg
|
|
244
254
|
className="w-6 h-6 text-gray-500 cursor-pointer hover:text-gray-500"
|
|
245
255
|
xmlns="http://www.w3.org/2000/svg"
|
package/src/navigation_b.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { Section } from "@stackshift-ui/section";
|
|
|
7
7
|
import { Text } from "@stackshift-ui/text";
|
|
8
8
|
import React from "react";
|
|
9
9
|
import { NavigationProps, ResponsiveNavLinksProps } from ".";
|
|
10
|
-
import { logoLink } from "./helper";
|
|
10
|
+
import { ConditionalLink, logoLink } from "./helper";
|
|
11
11
|
import { LabeledRoute, LabeledRouteWithKey, Logo } from "./types";
|
|
12
12
|
|
|
13
13
|
export default function Navigation_B({
|
|
@@ -89,11 +89,13 @@ function NavItem({ link }: { link?: LabeledRouteWithKey }) {
|
|
|
89
89
|
return (
|
|
90
90
|
<li>
|
|
91
91
|
<Button
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
variant="unstyled"
|
|
93
|
+
asChild
|
|
94
|
+
aria-label={link?.label}
|
|
95
95
|
className="text-sm text-gray-500 no-underline hover:text-gray-900">
|
|
96
|
-
{link?.label}
|
|
96
|
+
<ConditionalLink link={link} ariaLabel={link?.label || "Navigation link"}>
|
|
97
|
+
{link?.label}
|
|
98
|
+
</ConditionalLink>
|
|
97
99
|
</Button>
|
|
98
100
|
</li>
|
|
99
101
|
);
|
|
@@ -129,20 +131,22 @@ function Buttons({
|
|
|
129
131
|
<Flex align="center" gap={4}>
|
|
130
132
|
{primaryButton?.label && (
|
|
131
133
|
<Button
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
asChild
|
|
135
|
+
aria-label={primaryButton?.label}
|
|
136
|
+
className="hidden lg:flex px-4 py-3 leading-loose text-center font-semibold text-secondary-foreground rounded-global bg-secondary hover:bg-secondary/50">
|
|
137
|
+
<ConditionalLink link={primaryButton} ariaLabel={primaryButton?.label}>
|
|
138
|
+
{primaryButton?.label}
|
|
139
|
+
</ConditionalLink>
|
|
137
140
|
</Button>
|
|
138
141
|
)}
|
|
139
142
|
{secondaryButton?.label && (
|
|
140
143
|
<Button
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
asChild
|
|
145
|
+
aria-label={secondaryButton?.label}
|
|
146
|
+
className="hidden lg:flex px-4 py-3 leading-loose text-center font-semibold text-primary-foreground bg-primary hover:bg-primary/50 rounded-global">
|
|
147
|
+
<ConditionalLink link={secondaryButton} ariaLabel={secondaryButton?.label}>
|
|
148
|
+
{secondaryButton?.label}
|
|
149
|
+
</ConditionalLink>
|
|
146
150
|
</Button>
|
|
147
151
|
)}
|
|
148
152
|
</Flex>
|
|
@@ -153,9 +157,7 @@ function MobileMenu({ showMenu }: { showMenu: () => void }) {
|
|
|
153
157
|
return (
|
|
154
158
|
<div className="lg:hidden">
|
|
155
159
|
<Button
|
|
156
|
-
|
|
157
|
-
as="button"
|
|
158
|
-
ariaLabel="Navigation menu"
|
|
160
|
+
aria-label="Navigation menu"
|
|
159
161
|
className="flex items-center p-3 navbar-burger text-primary"
|
|
160
162
|
onClick={showMenu}>
|
|
161
163
|
<svg
|
|
@@ -183,12 +185,7 @@ function ResponsiveNavLinks({
|
|
|
183
185
|
<div className="fixed inset-0 bg-gray-800 opacity-25 navbar-backdrop" onClick={showMenu} />
|
|
184
186
|
<nav className="fixed top-0 bottom-0 left-0 flex flex-col w-5/6 max-w-sm px-6 py-6 overflow-y-auto bg-white border-r">
|
|
185
187
|
<div className="flex items-center mb-8">
|
|
186
|
-
<Button
|
|
187
|
-
variant="unstyled"
|
|
188
|
-
as="button"
|
|
189
|
-
ariaLabel="Navigation menu"
|
|
190
|
-
className="navbar-close"
|
|
191
|
-
onClick={showMenu}>
|
|
188
|
+
<Button aria-label="Close navigation menu" className="navbar-close" onClick={showMenu}>
|
|
192
189
|
<svg
|
|
193
190
|
className="w-6 h-6 text-gray-500 cursor-pointer hover:text-gray-500"
|
|
194
191
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -209,11 +206,15 @@ function ResponsiveNavLinks({
|
|
|
209
206
|
{links?.map((link, index) => (
|
|
210
207
|
<li className="mb-1" key={index}>
|
|
211
208
|
<Button
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
link={link}
|
|
209
|
+
asChild
|
|
210
|
+
aria-label={link?.label}
|
|
215
211
|
className="block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary">
|
|
216
|
-
|
|
212
|
+
<ConditionalLink
|
|
213
|
+
link={link}
|
|
214
|
+
ariaLabel={link?.label || "Navigation link"}
|
|
215
|
+
className="block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary">
|
|
216
|
+
{link?.label}
|
|
217
|
+
</ConditionalLink>
|
|
217
218
|
</Button>
|
|
218
219
|
</li>
|
|
219
220
|
))}
|
|
@@ -223,20 +224,28 @@ function ResponsiveNavLinks({
|
|
|
223
224
|
<div className="pt-6">
|
|
224
225
|
{primaryButton?.label && (
|
|
225
226
|
<Button
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
link={primaryButton}
|
|
227
|
+
asChild
|
|
228
|
+
aria-label={primaryButton?.label}
|
|
229
229
|
className="block px-4 py-3 mb-2 text-gray-900 text-center lg:ml-auto lg:mr-3 font-semibold rounded-global bg-secondary hover:bg-secondary/50">
|
|
230
|
-
|
|
230
|
+
<ConditionalLink
|
|
231
|
+
link={primaryButton}
|
|
232
|
+
ariaLabel={primaryButton?.label}
|
|
233
|
+
className="block px-4 py-3 mb-2 text-gray-900 text-center lg:ml-auto lg:mr-3 font-semibold rounded-global bg-secondary hover:bg-secondary/50">
|
|
234
|
+
{primaryButton?.label}
|
|
235
|
+
</ConditionalLink>
|
|
231
236
|
</Button>
|
|
232
237
|
)}
|
|
233
238
|
{secondaryButton?.label && (
|
|
234
239
|
<Button
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
link={secondaryButton}
|
|
240
|
+
asChild
|
|
241
|
+
aria-label={secondaryButton?.label}
|
|
238
242
|
className="block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global">
|
|
239
|
-
|
|
243
|
+
<ConditionalLink
|
|
244
|
+
link={secondaryButton}
|
|
245
|
+
ariaLabel={secondaryButton?.label}
|
|
246
|
+
className="block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global">
|
|
247
|
+
{secondaryButton?.label}
|
|
248
|
+
</ConditionalLink>
|
|
240
249
|
</Button>
|
|
241
250
|
)}
|
|
242
251
|
</div>
|
package/src/navigation_c.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { Section } from "@stackshift-ui/section";
|
|
|
7
7
|
import { Text } from "@stackshift-ui/text";
|
|
8
8
|
import React from "react";
|
|
9
9
|
import { NavigationProps, ResponsiveNavLinksProps } from ".";
|
|
10
|
-
import { logoLink } from "./helper";
|
|
10
|
+
import { ConditionalLink, logoLink } from "./helper";
|
|
11
11
|
import { LabeledRoute, LabeledRouteWithKey, Logo } from "./types";
|
|
12
12
|
|
|
13
13
|
export default function Navigation_C({
|
|
@@ -67,11 +67,16 @@ function NavItem({ link }: { link?: LabeledRouteWithKey }) {
|
|
|
67
67
|
return (
|
|
68
68
|
<li>
|
|
69
69
|
<Button
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
variant="unstyled"
|
|
71
|
+
asChild
|
|
72
|
+
aria-label={link?.label}
|
|
73
73
|
className="text-sm text-gray-500 no-underline hover:text-gray-900">
|
|
74
|
-
|
|
74
|
+
<ConditionalLink
|
|
75
|
+
link={link}
|
|
76
|
+
ariaLabel={link?.label || "Navigation link"}
|
|
77
|
+
className="text-sm text-gray-500 no-underline hover:text-gray-900">
|
|
78
|
+
{link?.label}
|
|
79
|
+
</ConditionalLink>
|
|
75
80
|
</Button>
|
|
76
81
|
</li>
|
|
77
82
|
);
|
|
@@ -129,20 +134,22 @@ function Buttons({
|
|
|
129
134
|
<div className="hidden lg:text-right lg:block lg:w-1/3">
|
|
130
135
|
{primaryButton?.label && (
|
|
131
136
|
<Button
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
asChild
|
|
138
|
+
aria-label={primaryButton?.label}
|
|
139
|
+
className="px-4 py-3 text-secondary-foreground lg:ml-auto lg:mr-3 font-semibold rounded-global bg-secondary hover:bg-secondary/50">
|
|
140
|
+
<ConditionalLink link={primaryButton} ariaLabel={primaryButton?.label}>
|
|
141
|
+
{primaryButton?.label}
|
|
142
|
+
</ConditionalLink>
|
|
137
143
|
</Button>
|
|
138
144
|
)}
|
|
139
145
|
{secondaryButton?.label && (
|
|
140
146
|
<Button
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
asChild
|
|
148
|
+
aria-label={secondaryButton?.label}
|
|
149
|
+
className="px-4 py-3 leading-loose text-center text-primary-foreground font-semibold bg-primary hover:bg-primary/50 rounded-global">
|
|
150
|
+
<ConditionalLink link={secondaryButton} ariaLabel={secondaryButton?.label}>
|
|
151
|
+
{secondaryButton?.label}
|
|
152
|
+
</ConditionalLink>
|
|
146
153
|
</Button>
|
|
147
154
|
)}
|
|
148
155
|
</div>
|
|
@@ -153,9 +160,7 @@ function MobileMenu({ showMenu }: { showMenu: () => void }) {
|
|
|
153
160
|
return (
|
|
154
161
|
<div className="ml-auto lg:hidden">
|
|
155
162
|
<Button
|
|
156
|
-
|
|
157
|
-
as="button"
|
|
158
|
-
ariaLabel="Navigation menu"
|
|
163
|
+
aria-label="Navigation menu"
|
|
159
164
|
className="flex items-center p-3 navbar-burger text-primary"
|
|
160
165
|
onClick={showMenu}>
|
|
161
166
|
<svg
|
|
@@ -184,12 +189,7 @@ function ResponsiveNavLinks({
|
|
|
184
189
|
onClick={showMenu}></div>
|
|
185
190
|
<nav className="fixed top-0 bottom-0 left-0 flex flex-col w-5/6 max-w-sm px-6 py-6 overflow-y-auto bg-white border-r">
|
|
186
191
|
<div className="flex items-center mb-8">
|
|
187
|
-
<Button
|
|
188
|
-
variant="unstyled"
|
|
189
|
-
as="button"
|
|
190
|
-
ariaLabel="Navigation menu"
|
|
191
|
-
className="navbar-close"
|
|
192
|
-
onClick={showMenu}>
|
|
192
|
+
<Button aria-label="Close navigation menu" className="navbar-close" onClick={showMenu}>
|
|
193
193
|
<svg
|
|
194
194
|
className="w-6 h-6 text-gray-500 cursor-pointer hover:text-gray-500"
|
|
195
195
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -210,11 +210,15 @@ function ResponsiveNavLinks({
|
|
|
210
210
|
links?.map((link, index) => (
|
|
211
211
|
<li className="mb-1" key={index}>
|
|
212
212
|
<Button
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
link={link}
|
|
213
|
+
asChild
|
|
214
|
+
aria-label={link?.label}
|
|
216
215
|
className="block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary">
|
|
217
|
-
|
|
216
|
+
<ConditionalLink
|
|
217
|
+
link={link}
|
|
218
|
+
ariaLabel={link?.label || "Navigation link"}
|
|
219
|
+
className="block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary">
|
|
220
|
+
{link?.label}
|
|
221
|
+
</ConditionalLink>
|
|
218
222
|
</Button>
|
|
219
223
|
</li>
|
|
220
224
|
))}
|
|
@@ -224,20 +228,28 @@ function ResponsiveNavLinks({
|
|
|
224
228
|
<div className="pt-6">
|
|
225
229
|
{primaryButton?.label && (
|
|
226
230
|
<Button
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
link={primaryButton}
|
|
231
|
+
asChild
|
|
232
|
+
aria-label={primaryButton?.label}
|
|
230
233
|
className="block px-4 py-3 mb-2 text-gray-900 text-center lg:ml-auto lg:mr-3 font-semibold rounded-global bg-secondary hover:bg-secondary/50">
|
|
231
|
-
|
|
234
|
+
<ConditionalLink
|
|
235
|
+
link={primaryButton}
|
|
236
|
+
ariaLabel={primaryButton?.label}
|
|
237
|
+
className="block px-4 py-3 mb-2 text-gray-900 text-center lg:ml-auto lg:mr-3 font-semibold rounded-global bg-secondary hover:bg-secondary/50">
|
|
238
|
+
{primaryButton?.label}
|
|
239
|
+
</ConditionalLink>
|
|
232
240
|
</Button>
|
|
233
241
|
)}
|
|
234
242
|
{secondaryButton?.label && (
|
|
235
243
|
<Button
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
link={secondaryButton}
|
|
244
|
+
asChild
|
|
245
|
+
aria-label={secondaryButton?.label}
|
|
239
246
|
className="block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global">
|
|
240
|
-
|
|
247
|
+
<ConditionalLink
|
|
248
|
+
link={secondaryButton}
|
|
249
|
+
ariaLabel={secondaryButton?.label}
|
|
250
|
+
className="block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global">
|
|
251
|
+
{secondaryButton?.label}
|
|
252
|
+
</ConditionalLink>
|
|
241
253
|
</Button>
|
|
242
254
|
)}
|
|
243
255
|
</div>
|
package/src/navigation_d.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { Section } from "@stackshift-ui/section";
|
|
|
7
7
|
import { Text } from "@stackshift-ui/text";
|
|
8
8
|
import React from "react";
|
|
9
9
|
import { NavigationProps, ResponsiveNavLinksProps } from ".";
|
|
10
|
-
import { logoLink } from "./helper";
|
|
10
|
+
import { ConditionalLink, logoLink } from "./helper";
|
|
11
11
|
import { LabeledRoute, LabeledRouteWithKey, Logo } from "./types";
|
|
12
12
|
|
|
13
13
|
export default function Navigation_D({
|
|
@@ -65,11 +65,16 @@ function NavItem({ link }: { link?: LabeledRouteWithKey }) {
|
|
|
65
65
|
return (
|
|
66
66
|
<li>
|
|
67
67
|
<Button
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
variant="unstyled"
|
|
69
|
+
asChild
|
|
70
|
+
aria-label={link?.label}
|
|
71
71
|
className="text-sm text-gray-500 no-underline hover:text-gray-900">
|
|
72
|
-
|
|
72
|
+
<ConditionalLink
|
|
73
|
+
link={link}
|
|
74
|
+
ariaLabel={link?.label || "Navigation link"}
|
|
75
|
+
className="text-sm text-gray-500 no-underline hover:text-gray-900">
|
|
76
|
+
{link?.label}
|
|
77
|
+
</ConditionalLink>
|
|
73
78
|
</Button>
|
|
74
79
|
</li>
|
|
75
80
|
);
|
|
@@ -127,20 +132,24 @@ function Buttons({
|
|
|
127
132
|
<div className="hidden lg:flex lg:gap-4">
|
|
128
133
|
{primaryButton?.label && (
|
|
129
134
|
<Button
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
className="px-4 py-3 leading-loose text-center text-
|
|
134
|
-
{primaryButton?.label}
|
|
135
|
+
asChild
|
|
136
|
+
variant="unstyled"
|
|
137
|
+
aria-label={primaryButton?.label}
|
|
138
|
+
className="px-4 py-3 leading-loose text-center text-secondary-foreground font-semibold rounded-global bg-secondary hover:bg-secondary/50">
|
|
139
|
+
<ConditionalLink link={primaryButton} ariaLabel={primaryButton?.label}>
|
|
140
|
+
{primaryButton?.label}
|
|
141
|
+
</ConditionalLink>
|
|
135
142
|
</Button>
|
|
136
143
|
)}
|
|
137
144
|
{secondaryButton?.label && (
|
|
138
145
|
<Button
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
className="px-4 py-3 leading-loose text-center text-
|
|
143
|
-
{secondaryButton?.label}
|
|
146
|
+
asChild
|
|
147
|
+
variant="unstyled"
|
|
148
|
+
aria-label={secondaryButton?.label}
|
|
149
|
+
className="px-4 py-3 leading-loose text-center text-primary-foreground font-semibold bg-primary hover:bg-primary/50 rounded-global">
|
|
150
|
+
<ConditionalLink link={secondaryButton} ariaLabel={secondaryButton?.label}>
|
|
151
|
+
{secondaryButton?.label}
|
|
152
|
+
</ConditionalLink>
|
|
144
153
|
</Button>
|
|
145
154
|
)}
|
|
146
155
|
</div>
|
|
@@ -151,9 +160,7 @@ function MobileMenu({ showMenu }: { showMenu: () => void }) {
|
|
|
151
160
|
return (
|
|
152
161
|
<div className="ml-auto lg:hidden">
|
|
153
162
|
<Button
|
|
154
|
-
|
|
155
|
-
as="button"
|
|
156
|
-
ariaLabel="Navigation menu"
|
|
163
|
+
aria-label="Navigation menu"
|
|
157
164
|
className="flex items-center p-3 navbar-burger text-primary"
|
|
158
165
|
onClick={showMenu}>
|
|
159
166
|
<svg
|
|
@@ -182,12 +189,7 @@ function ResponsiveNavLinks({
|
|
|
182
189
|
onClick={showMenu}></div>
|
|
183
190
|
<nav className="fixed top-0 bottom-0 left-0 flex flex-col w-5/6 max-w-sm px-6 py-6 overflow-y-auto bg-white border-r">
|
|
184
191
|
<div className="flex items-center mb-8">
|
|
185
|
-
<Button
|
|
186
|
-
variant="unstyled"
|
|
187
|
-
as="button"
|
|
188
|
-
ariaLabel="Navigation menu"
|
|
189
|
-
className="navbar-close"
|
|
190
|
-
onClick={showMenu}>
|
|
192
|
+
<Button aria-label="Close navigation menu" className="navbar-close" onClick={showMenu}>
|
|
191
193
|
<svg
|
|
192
194
|
className="w-6 h-6 text-gray-500 cursor-pointer hover:text-gray-500"
|
|
193
195
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -207,11 +209,15 @@ function ResponsiveNavLinks({
|
|
|
207
209
|
links.map((link, index) => (
|
|
208
210
|
<li className="mb-1" key={index}>
|
|
209
211
|
<Button
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
link={link}
|
|
212
|
+
asChild
|
|
213
|
+
aria-label={link.label}
|
|
213
214
|
className="block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary">
|
|
214
|
-
|
|
215
|
+
<ConditionalLink
|
|
216
|
+
link={link}
|
|
217
|
+
ariaLabel={link.label || "Navigation link"}
|
|
218
|
+
className="block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary">
|
|
219
|
+
{link.label}
|
|
220
|
+
</ConditionalLink>
|
|
215
221
|
</Button>
|
|
216
222
|
</li>
|
|
217
223
|
))}
|
|
@@ -219,20 +225,28 @@ function ResponsiveNavLinks({
|
|
|
219
225
|
<div className="mt-auto pt-6">
|
|
220
226
|
{primaryButton?.label && (
|
|
221
227
|
<Button
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
link={primaryButton}
|
|
228
|
+
asChild
|
|
229
|
+
aria-label={primaryButton.label}
|
|
225
230
|
className="block px-4 py-3 mb-2 text-center font-semibold rounded-global bg-secondary hover:bg-secondary/50">
|
|
226
|
-
|
|
231
|
+
<ConditionalLink
|
|
232
|
+
link={primaryButton}
|
|
233
|
+
ariaLabel={primaryButton.label}
|
|
234
|
+
className="block px-4 py-3 mb-2 text-center font-semibold rounded-global bg-secondary hover:bg-secondary/50">
|
|
235
|
+
{primaryButton.label}
|
|
236
|
+
</ConditionalLink>
|
|
227
237
|
</Button>
|
|
228
238
|
)}
|
|
229
239
|
{secondaryButton?.label && (
|
|
230
240
|
<Button
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
link={secondaryButton}
|
|
241
|
+
asChild
|
|
242
|
+
aria-label={secondaryButton.label}
|
|
234
243
|
className="block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global">
|
|
235
|
-
|
|
244
|
+
<ConditionalLink
|
|
245
|
+
link={secondaryButton}
|
|
246
|
+
ariaLabel={secondaryButton.label}
|
|
247
|
+
className="block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global">
|
|
248
|
+
{secondaryButton.label}
|
|
249
|
+
</ConditionalLink>
|
|
236
250
|
</Button>
|
|
237
251
|
)}
|
|
238
252
|
</div>
|
package/src/navigation_e.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { Link } from "@stackshift-ui/link";
|
|
|
6
6
|
import { Section } from "@stackshift-ui/section";
|
|
7
7
|
import { Fragment, useEffect, useRef, useState } from "react";
|
|
8
8
|
import { NavigationProps, ResponsiveNavLinksProps } from ".";
|
|
9
|
-
import { logoLink } from "./helper";
|
|
9
|
+
import { ConditionalLink, logoLink } from "./helper";
|
|
10
10
|
import { blockStyle } from "./helper/blockStyle";
|
|
11
11
|
import { LabeledRouteWithKey, Logo } from "./types";
|
|
12
12
|
|
|
@@ -145,16 +145,16 @@ function NavItem({ link }: { link?: LabeledRouteWithKey }) {
|
|
|
145
145
|
return (
|
|
146
146
|
<li>
|
|
147
147
|
<Button
|
|
148
|
-
|
|
148
|
+
asChild
|
|
149
149
|
variant="link"
|
|
150
|
-
ariaLabel={link?.label}
|
|
151
|
-
link={link}
|
|
152
150
|
className={
|
|
153
151
|
link?.type === "linkInternal"
|
|
154
152
|
? "xl:mr-12 lg:mr-8 font-bold font-heading hover:text-gray-600 no-underline text-black"
|
|
155
153
|
: "mr-12 font-bold font-heading hover:text-gray-600 no-underline text-black"
|
|
156
154
|
}>
|
|
157
|
-
{link?.label}
|
|
155
|
+
<ConditionalLink ariaLabel={link?.label || "Navigation link"} link={link}>
|
|
156
|
+
{link?.label}
|
|
157
|
+
</ConditionalLink>
|
|
158
158
|
</Button>
|
|
159
159
|
</li>
|
|
160
160
|
);
|
|
@@ -169,9 +169,8 @@ function SearchButton({
|
|
|
169
169
|
}) {
|
|
170
170
|
return (
|
|
171
171
|
<Button
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
ariaLabel="Search button"
|
|
172
|
+
variant="ghost"
|
|
173
|
+
aria-label="Search button"
|
|
175
174
|
type="button"
|
|
176
175
|
onClick={() => setShowSearchBar(!showSearchBar)}>
|
|
177
176
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
@@ -213,9 +212,8 @@ function SearchForm({
|
|
|
213
212
|
type="search"
|
|
214
213
|
/>
|
|
215
214
|
<Button
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
ariaLabel="Submit product search"
|
|
215
|
+
variant="ghost"
|
|
216
|
+
aria-label="Submit product search"
|
|
219
217
|
className={`mt-1 inline-flex h-[35px] w-10 items-center justify-center bg-primary ${
|
|
220
218
|
productQuery === ""
|
|
221
219
|
? "cursor-not-allowed opacity-50"
|
|
@@ -234,9 +232,8 @@ function SearchForm({
|
|
|
234
232
|
function MenuIcon({ showMenu }: { showMenu: () => void }) {
|
|
235
233
|
return (
|
|
236
234
|
<Button
|
|
237
|
-
variant="
|
|
238
|
-
|
|
239
|
-
ariaLabel="Nav Sidebar"
|
|
235
|
+
variant="ghost"
|
|
236
|
+
aria-label="Nav Sidebar"
|
|
240
237
|
className="self-center mr-12 navbar-burger lg:hidden"
|
|
241
238
|
onClick={showMenu}>
|
|
242
239
|
<svg
|
|
@@ -322,9 +319,8 @@ function ResponsiveNavLinks({
|
|
|
322
319
|
)}
|
|
323
320
|
|
|
324
321
|
<Button
|
|
325
|
-
variant="
|
|
326
|
-
|
|
327
|
-
ariaLabel="Close navigation menu"
|
|
322
|
+
variant="ghost"
|
|
323
|
+
aria-label="Close navigation menu"
|
|
328
324
|
className="ml-auto"
|
|
329
325
|
onClick={showMenu}>
|
|
330
326
|
<svg
|
|
@@ -361,9 +357,8 @@ function ResponsiveNavLinks({
|
|
|
361
357
|
type="search"
|
|
362
358
|
/>
|
|
363
359
|
<Button
|
|
364
|
-
variant="
|
|
365
|
-
|
|
366
|
-
ariaLabel="Submit product search"
|
|
360
|
+
variant="ghost"
|
|
361
|
+
aria-label="Submit product search"
|
|
367
362
|
className={`inline-flex h-full w-10 items-center justify-center bg-primary ${
|
|
368
363
|
productQuery === ""
|
|
369
364
|
? "cursor-not-allowed opacity-50"
|
|
@@ -391,12 +386,14 @@ function ResponsiveNavLinks({
|
|
|
391
386
|
<Fragment key={index}>
|
|
392
387
|
<li className="mb-8">
|
|
393
388
|
<Button
|
|
394
|
-
|
|
389
|
+
asChild
|
|
395
390
|
variant="link"
|
|
396
|
-
ariaLabel={link?.label ?? `navigation link ${index + 1}`}
|
|
397
|
-
link={link}
|
|
398
391
|
className="font-bold text-black no-underline font-heading hover:text-gray-600">
|
|
399
|
-
|
|
392
|
+
<ConditionalLink
|
|
393
|
+
ariaLabel={link?.label || `navigation link ${index + 1}`}
|
|
394
|
+
link={link}>
|
|
395
|
+
{link?.label}
|
|
396
|
+
</ConditionalLink>
|
|
400
397
|
</Button>
|
|
401
398
|
</li>
|
|
402
399
|
</Fragment>
|
package/src/navigation_h.tsx
CHANGED
|
@@ -23,7 +23,7 @@ import { GoPerson } from "react-icons/go";
|
|
|
23
23
|
import { LiaSearchSolid } from "react-icons/lia";
|
|
24
24
|
import { SlLocationPin } from "react-icons/sl";
|
|
25
25
|
import { NavigationProps } from ".";
|
|
26
|
-
import { logoLink } from "./helper";
|
|
26
|
+
import { ConditionalLink, logoLink } from "./helper";
|
|
27
27
|
import { LabeledRouteWithKey, Logo, MegaMenu } from "./types";
|
|
28
28
|
|
|
29
29
|
interface AccordionProps {
|
|
@@ -222,12 +222,14 @@ const MobileMenuContentItem = React.memo(({ megaMenu }: MobileMenuContentItemPro
|
|
|
222
222
|
{groupedLinksItem.links?.map(link => (
|
|
223
223
|
<Button
|
|
224
224
|
key={`MobileMenuContent-Item-Group-Link-${link._key}`}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
link={link ?? {}}
|
|
228
|
-
variant="unstyled"
|
|
225
|
+
asChild
|
|
226
|
+
variant="ghost"
|
|
229
227
|
className="text-black text-sm font-normal font-heading-kb leading-[30px] hover:underline block ml-4">
|
|
230
|
-
{link.label}
|
|
228
|
+
<ConditionalLink link={link} ariaLabel={link.label ?? "Navigation link"}>
|
|
229
|
+
<ConditionalLink link={link} ariaLabel={link.label ?? "Navigation link"}>
|
|
230
|
+
{link.label}
|
|
231
|
+
</ConditionalLink>
|
|
232
|
+
</ConditionalLink>
|
|
231
233
|
</Button>
|
|
232
234
|
))}
|
|
233
235
|
</div>
|
|
@@ -239,22 +241,24 @@ const MobileMenuContentItem = React.memo(({ megaMenu }: MobileMenuContentItemPro
|
|
|
239
241
|
{megaMenu.showcaseLink?.map((link, i) => (
|
|
240
242
|
<div key={`MobileMenuContent-Item-Images-${link._key}-${i}`} className="mt-4 pl-4">
|
|
241
243
|
<Button
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
link={link.primaryButton ?? {}}
|
|
245
|
-
variant="unstyled"
|
|
244
|
+
asChild
|
|
245
|
+
variant="ghost"
|
|
246
246
|
className="text-black text-sm font-normal font-heading-kb leading-[30px]">
|
|
247
|
-
<
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
247
|
+
<ConditionalLink
|
|
248
|
+
link={link.primaryButton}
|
|
249
|
+
ariaLabel={link.primaryButton?.label ?? "Navigation link"}>
|
|
250
|
+
<Flex direction="col" gap={3}>
|
|
251
|
+
<Image
|
|
252
|
+
key={i}
|
|
253
|
+
src={link.mainImage?.image}
|
|
254
|
+
alt={link.mainImage?.alt ?? ""}
|
|
255
|
+
width={200}
|
|
256
|
+
height={150}
|
|
257
|
+
className="w-[188px] h-[147px] object-cover object-center"
|
|
258
|
+
/>
|
|
259
|
+
{link.primaryButton?.label}
|
|
260
|
+
</Flex>
|
|
261
|
+
</ConditionalLink>
|
|
258
262
|
</Button>
|
|
259
263
|
</div>
|
|
260
264
|
))}
|
|
@@ -414,12 +418,10 @@ const NavItem = ({ link, isIcon }: NavItemProps) => {
|
|
|
414
418
|
|
|
415
419
|
return (
|
|
416
420
|
<li>
|
|
417
|
-
<Button
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
className="text-sm font-label tracking-wide">
|
|
422
|
-
{!isIcon ? link?.label : icon}
|
|
421
|
+
<Button variant="unstyled" asChild className="text-sm font-label tracking-wide">
|
|
422
|
+
<ConditionalLink link={link} ariaLabel={link?.label ?? "Navigation link"}>
|
|
423
|
+
{!isIcon ? link?.label : icon}
|
|
424
|
+
</ConditionalLink>
|
|
423
425
|
</Button>
|
|
424
426
|
</li>
|
|
425
427
|
);
|
|
@@ -497,10 +499,8 @@ interface MegaMenuNavLinkProps {
|
|
|
497
499
|
const MegaMenuNavLink = ({ link, className }: MegaMenuNavLinkProps) => {
|
|
498
500
|
return (
|
|
499
501
|
<Button
|
|
500
|
-
|
|
501
|
-
as="link"
|
|
502
|
+
asChild
|
|
502
503
|
variant="unstyled"
|
|
503
|
-
link={link}
|
|
504
504
|
className={cn(
|
|
505
505
|
"relative text-black text-sm font-normal font-label uppercase tracking-widest group",
|
|
506
506
|
className,
|
|
@@ -677,12 +677,15 @@ function MegaDropdownGroupedLinks({ groupedLinks }: { groupedLinks: LabeledRoute
|
|
|
677
677
|
return (
|
|
678
678
|
<Button
|
|
679
679
|
key={`MegaDropdownContent-Item-Link-${link._key}-${i}`}
|
|
680
|
-
|
|
681
|
-
as="link"
|
|
682
|
-
link={link ?? {}}
|
|
680
|
+
aria-label={link.label ?? ""}
|
|
683
681
|
variant="unstyled"
|
|
682
|
+
asChild
|
|
684
683
|
className="text-black text-sm font-normal font-heading-kb leading-[30px] hover:underline">
|
|
685
|
-
|
|
684
|
+
<ConditionalLink
|
|
685
|
+
link={link}
|
|
686
|
+
ariaLabel={link.label ?? "Navigation link"}>
|
|
687
|
+
{link?.label}
|
|
688
|
+
</ConditionalLink>
|
|
686
689
|
</Button>
|
|
687
690
|
);
|
|
688
691
|
})}
|
|
@@ -715,21 +718,24 @@ function MegaDropdownShowcaseLinks({
|
|
|
715
718
|
return (
|
|
716
719
|
<Button
|
|
717
720
|
key={`MegaDropdownContent-Item-Images-${link._key}-${i}`}
|
|
718
|
-
|
|
719
|
-
as="link"
|
|
720
|
-
link={link.primaryButton ?? {}}
|
|
721
|
+
aria-label={link.primaryButton?.label ?? ""}
|
|
721
722
|
variant="unstyled"
|
|
723
|
+
asChild
|
|
722
724
|
className="text-center text-black text-sm font-normal font-heading-kb leading-[30px] hover:underline">
|
|
723
|
-
<
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
725
|
+
<ConditionalLink
|
|
726
|
+
link={link.primaryButton}
|
|
727
|
+
ariaLabel={link.primaryButton?.label ?? "Navigation link"}>
|
|
728
|
+
<Flex direction="col" align="center" justify="center" gap={3}>
|
|
729
|
+
<Image
|
|
730
|
+
key={i}
|
|
731
|
+
src={imageUrl}
|
|
732
|
+
alt={link.mainImage?.alt ?? ""}
|
|
733
|
+
width={500}
|
|
734
|
+
height={500}
|
|
735
|
+
className="w-[188px] h-[147px] object-cover object-center"></Image>
|
|
736
|
+
{link.primaryButton?.label}
|
|
737
|
+
</Flex>
|
|
738
|
+
</ConditionalLink>
|
|
733
739
|
</Button>
|
|
734
740
|
);
|
|
735
741
|
})}
|
package/dist/chunk-AV6FXT56.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk-S35O64PB.mjs";import{Button as o}from"@stackshift-ui/button";import{Flex as b}from"@stackshift-ui/flex";import{Image as f}from"@stackshift-ui/image";import{Link as x}from"@stackshift-ui/link";import{Section as d}from"@stackshift-ui/section";import{Text as u}from"@stackshift-ui/text";import g from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";function h({links:e,primaryButton:a,secondaryButton:t,logo:i}){let[s,r]=g.useState(!1),v=()=>{r(c=>!c)};return n(d,{className:"bg-background",children:[n(b,{align:"center",justify:"between",className:"px-6 py-6",gap:4,children:[l(w,{logo:i}),l(N,{links:e}),l(k,{primaryButton:a,secondaryButton:t}),l(R,{showMenu:v})]}),l(M,{menu:s,showMenu:v,links:e,primaryButton:a,secondaryButton:t})]})}function w({logo:e}){var a;return e?l("div",{className:"w-full lg:w-1/5",children:l(x,{className:"w-20 h-14 flex items-center","aria-label":m(e)==="/"?"Go to home page":`Go to ${m(e)}`,href:m(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:l(f,{className:"w-fit h-full object-contain",src:`${e==null?void 0:e.image}`,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",alt:(a=e==null?void 0:e.alt)!=null?a:"navigation-logo"})})}):null}function p(){return l("li",{className:"text-gray-500",children:l("svg",{className:"w-4 h-4 current-fill",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})})}function N({links:e}){return e?l(b,{children:l("ul",{className:"hidden lg:flex lg:items-center lg:gap-5 xl:gap-10",children:e==null?void 0:e.map((a,t)=>n(g.Fragment,{children:[l(L,{link:a},a._key),e.length!==t+1?l(p,{}):null]},t))})}):null}function L({link:e}){return e!=null&&e.label?l("li",{children:l(o,{as:"link",link:e,ariaLabel:e==null?void 0:e.label,className:"text-sm text-gray-500 no-underline hover:text-gray-900",children:e==null?void 0:e.label})}):null}function M({menu:e,showMenu:a,links:t,primaryButton:i,secondaryButton:s}){return n("div",{className:`${e?null:"hidden"} mobile-nav relative z-50`,children:[l("div",{className:"fixed inset-0 bg-gray-800 opacity-25 navbar-backdrop",onClick:a}),n(b,{as:"nav",direction:"col",className:"fixed top-0 bottom-0 left-0 w-5/6 max-w-sm px-6 py-6 overflow-y-auto bg-white border-r",children:[l(z,{showMenu:a}),l("div",{className:"w-full",children:t?l("ul",{children:t==null?void 0:t.map((r,v)=>l("li",{className:"mb-1",children:l(o,{as:"link",ariaLabel:r==null?void 0:r.label,className:"block w-full cursor-pointer p-4 text-sm font-semibold text-gray-900 no-underline rounded hover:bg-secondary-foreground hover:text-primary",link:r,children:r==null?void 0:r.label})},v))}):null}),n("div",{className:"w-full mt-auto",children:[n(b,{direction:"col",className:"pt-6",children:[i!=null&&i.label?l(o,{as:"link",link:i,ariaLabel:i==null?void 0:i.label,variant:"outline",className:"block w-full px-4 py-3 mb-3 text-xs cursor-pointer font-semibold leading-loose text-center text-gray-900 rounded-global bg-secondary hover:bg-secondary/50",children:i==null?void 0:i.label}):null,s!=null&&s.label?l(o,{as:"link",link:s,ariaLabel:s==null?void 0:s.label,variant:"solid",className:"block w-full px-4 py-3 mb-2 cursor-pointer leading-loose text-xs text-center font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:s==null?void 0:s.label}):null]}),l(u,{fontSize:"xs",className:"my-4 text-center text-gray-900",children:l("span",{children:`\xA9 ${new Date().getFullYear()} All rights reserved.`})})]})]})]})}function R({showMenu:e}){return l("div",{className:"lg:hidden",children:l(o,{variant:"unstyled",as:"button",ariaLabel:"Navigation Menu",className:"flex items-center p-3 navbar-burger text-primary",onClick:e,children:n("svg",{className:"block w-4 h-4 fill-current",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[l("title",{children:"Mobile menu"}),l("path",{d:"M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"})]})})})}function k({primaryButton:e,secondaryButton:a}){return n(b,{align:"center",gap:4,children:[e!=null&&e.label?l(o,{as:"link",link:e,ariaLabel:e==null?void 0:e.label,variant:"outline",className:"hidden lg:flex px-4 py-3 leading-loose text-center font-semibold text-gray-900 rounded-global bg-secondary hover:bg-secondary/50",children:e==null?void 0:e.label}):null,a!=null&&a.label?l(o,{as:"link",link:a,ariaLabel:a==null?void 0:a.label,variant:"solid",className:"hidden lg:flex px-4 py-3 leading-loose text-center font-semibold text-white bg-primary hover:bg-primary-foreground rounded-global",children:a==null?void 0:a.label}):null]})}function z({showMenu:e}){return l("div",{className:"flex items-center mb-8",children:l(o,{variant:"unstyled",as:"button",ariaLabel:"Navigation Menu",className:"navbar-close",onClick:e,children:l("svg",{className:"w-6 h-6 text-gray-500 cursor-pointer hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})})}export{h as a};
|
package/dist/chunk-EYE6OX2N.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-S35O64PB.mjs";import{Button as s}from"@stackshift-ui/button";import{Flex as v}from"@stackshift-ui/flex";import{Image as d}from"@stackshift-ui/image";import{Link as f}from"@stackshift-ui/link";import{Section as x}from"@stackshift-ui/section";import{Text as u}from"@stackshift-ui/text";import c from"react";import{jsx as a,jsxs as n}from"react/jsx-runtime";function p({links:e,primaryButton:l,secondaryButton:t,logo:i}){let[r,o]=c.useState(!1),m=()=>{o(g=>!g)};return n(x,{className:"bg-background",children:[a("nav",{className:"relative lg:px-6 py-6",children:n(v,{align:"center",justify:"between",gap:4,children:[a(h,{links:e}),a(L,{logo:i}),a(k,{primaryButton:l,secondaryButton:t}),a(M,{showMenu:m})]})}),a(R,{menu:r,showMenu:m,links:e,primaryButton:l,secondaryButton:t})]})}function h({links:e}){return e?a(v,{children:a("ul",{className:"hidden lg:flex lg:items-center lg:gap-3 xl:gap-5",children:e==null?void 0:e.map((l,t)=>n(c.Fragment,{children:[(l==null?void 0:l.label)&&a(w,{link:l}),e.length!==t+1?a(N,{}):null]},t))})}):null}function w({link:e}){return e?a("li",{children:a(s,{as:"link",ariaLabel:e==null?void 0:e.label,link:e,className:"text-sm text-gray-500 no-underline hover:text-gray-900",children:e==null?void 0:e.label})}):null}function N(){return a("li",{className:"text-gray-500",children:a("svg",{className:"w-4 h-4 current-fill",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})})}function L({logo:e}){var l;return e?a("div",{className:"w-full lg:w-fit items-center justify-center",children:a(f,{className:"w-20 h-14 flex justify-center items-center","aria-label":b(e)==="/"?"Go to home page":`Go to ${b(e)}`,href:b(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:a(d,{className:"w-fit h-full object-contain",src:`${e==null?void 0:e.image}`,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",alt:(l=e==null?void 0:e.alt)!=null?l:"navigation-logo"})})}):null}function k({primaryButton:e,secondaryButton:l}){return n("div",{className:"hidden lg:flex lg:gap-4",children:[(e==null?void 0:e.label)&&a(s,{as:"link",ariaLabel:e==null?void 0:e.label,link:e,className:"px-4 py-3 leading-loose text-center text-gray-900 font-semibold rounded-global bg-secondary hover:bg-secondary/50",children:e==null?void 0:e.label}),(l==null?void 0:l.label)&&a(s,{as:"link",ariaLabel:l==null?void 0:l.label,link:l,className:"px-4 py-3 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:l==null?void 0:l.label})]})}function M({showMenu:e}){return a("div",{className:"ml-auto lg:hidden",children:a(s,{variant:"unstyled",as:"button",ariaLabel:"Navigation menu",className:"flex items-center p-3 navbar-burger text-primary",onClick:e,children:n("svg",{className:"block w-4 h-4 fill-current",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[a("title",{children:"Mobile menu"}),a("path",{d:"M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"})]})})})}function R({menu:e,showMenu:l,links:t,primaryButton:i,secondaryButton:r}){return n("div",{className:`${e?null:"hidden"} mobile-nav relative z-50`,children:[a("div",{className:"fixed inset-0 bg-gray-800 opacity-25 navbar-backdrop",onClick:l}),n("nav",{className:"fixed top-0 bottom-0 left-0 flex flex-col w-5/6 max-w-sm px-6 py-6 overflow-y-auto bg-white border-r",children:[a("div",{className:"flex items-center mb-8",children:a(s,{variant:"unstyled",as:"button",ariaLabel:"Navigation menu",className:"navbar-close",onClick:l,children:a("svg",{className:"w-6 h-6 text-gray-500 cursor-pointer hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})}),a("ul",{children:t&&t.map((o,m)=>a("li",{className:"mb-1",children:a(s,{as:"link",ariaLabel:o.label,link:o,className:"block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary",children:o.label})},m))}),n("div",{className:"mt-auto pt-6",children:[(i==null?void 0:i.label)&&a(s,{as:"link",ariaLabel:i.label,link:i,className:"block px-4 py-3 mb-2 text-center font-semibold rounded-global bg-secondary hover:bg-secondary/50",children:i.label}),(r==null?void 0:r.label)&&a(s,{as:"link",ariaLabel:r.label,link:r,className:"block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:r.label})]}),a(u,{fontSize:"xs",muted:!0,className:"my-4 text-center",children:a("span",{children:`\xA9 ${new Date().getFullYear()} All rights reserved.`})})]})]})}export{p as a};
|
package/dist/chunk-STASA5HD.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as v}from"./chunk-S35O64PB.mjs";import{Button as b}from"@stackshift-ui/button";import{Container as x}from"@stackshift-ui/container";import{Flex as o}from"@stackshift-ui/flex";import{Image as c}from"@stackshift-ui/image";import{Link as d}from"@stackshift-ui/link";import{Section as h}from"@stackshift-ui/section";import{Text as p}from"@stackshift-ui/text";import g from"react";import{jsx as a,jsxs as n}from"react/jsx-runtime";function w({links:e,primaryButton:l,secondaryButton:s,logo:t}){let[i,r]=g.useState(!1),m=()=>{r(f=>!f)};return n(h,{className:"bg-background",children:[a("nav",{className:"relative py-6",children:a(x,{maxWidth:1280,children:n(o,{align:"center",justify:"between",gap:4,children:[a(N,{logo:t}),a(R,{showMenu:m}),a(u,{links:e}),a(M,{primaryButton:l,secondaryButton:s})]})})}),a(z,{menu:i,showMenu:m,links:e,primaryButton:l,secondaryButton:s})]})}function N({logo:e}){var l;return e?a("div",{className:"w-full lg:w-fit",children:a(d,{className:"w-20 h-14 flex items-center","aria-label":v(e)==="/"?"Go to home page":`Go to ${v(e)}`,href:v(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:a(c,{className:"w-fit h-full object-contain",src:`${e==null?void 0:e.image}`,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",alt:(l=e==null?void 0:e.alt)!=null?l:"navigation-logo"})})}):null}function u({links:e}){return e?a(o,{children:a("ul",{className:"hidden lg:flex lg:items-center lg:gap-5 xl:gap-10",children:e==null?void 0:e.map((l,s)=>n(g.Fragment,{children:[a(L,{link:l},l._key),e.length!==s+1?a(k,{}):null]},s))})}):null}function L({link:e}){return e?a("li",{children:a(b,{as:"link",ariaLabel:e==null?void 0:e.label,link:e,className:"text-sm text-gray-500 no-underline hover:text-gray-900",children:e==null?void 0:e.label})}):null}function k(){return a("li",{className:"text-gray-500",children:a("svg",{className:"w-4 h-4 current-fill",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})})}function M({primaryButton:e,secondaryButton:l}){return n(o,{align:"center",gap:4,children:[(e==null?void 0:e.label)&&a(b,{as:"link",ariaLabel:e==null?void 0:e.label,link:e,className:"hidden lg:flex px-4 py-3 leading-loose text-center font-semibold text-gray-900 rounded-global bg-secondary hover:bg-secondary/50",children:e==null?void 0:e.label}),(l==null?void 0:l.label)&&a(b,{as:"link",ariaLabel:l==null?void 0:l.label,link:l,className:"hidden lg:flex px-4 py-3 leading-loose text-center font-semibold text-white bg-primary hover:bg-primary-foreground rounded-global",children:l==null?void 0:l.label})]})}function R({showMenu:e}){return a("div",{className:"lg:hidden",children:a(b,{variant:"unstyled",as:"button",ariaLabel:"Navigation menu",className:"flex items-center p-3 navbar-burger text-primary",onClick:e,children:n("svg",{className:"block w-4 h-4 fill-current",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[a("title",{children:"Mobile menu"}),a("path",{d:"M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"})]})})})}function z({menu:e,showMenu:l,links:s,primaryButton:t,secondaryButton:i}){return a(g.Fragment,{children:n("div",{className:`${e?null:"hidden"} mobile-nav relative z-50`,children:[a("div",{className:"fixed inset-0 bg-gray-800 opacity-25 navbar-backdrop",onClick:l}),n("nav",{className:"fixed top-0 bottom-0 left-0 flex flex-col w-5/6 max-w-sm px-6 py-6 overflow-y-auto bg-white border-r",children:[a("div",{className:"flex items-center mb-8",children:a(b,{variant:"unstyled",as:"button",ariaLabel:"Navigation menu",className:"navbar-close",onClick:l,children:a("svg",{className:"w-6 h-6 text-gray-500 cursor-pointer hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})}),s&&a("ul",{children:s==null?void 0:s.map((r,m)=>a("li",{className:"mb-1",children:a(b,{as:"link",ariaLabel:r==null?void 0:r.label,link:r,className:"block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary",children:r==null?void 0:r.label})},m))}),n("div",{className:"mt-auto",children:[n("div",{className:"pt-6",children:[(t==null?void 0:t.label)&&a(b,{as:"link",ariaLabel:t==null?void 0:t.label,link:t,className:"block px-4 py-3 mb-2 text-gray-900 text-center lg:ml-auto lg:mr-3 font-semibold rounded-global bg-secondary hover:bg-secondary/50",children:t==null?void 0:t.label}),(i==null?void 0:i.label)&&a(b,{as:"link",ariaLabel:i==null?void 0:i.label,link:i,className:"block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:i==null?void 0:i.label})]}),a(p,{fontSize:"xs",className:"my-4 text-center text-gray-900",children:a("span",{children:`\xA9 ${new Date().getFullYear()} All rights reserved.`})})]})]})]})})}export{w as a};
|
package/dist/chunk-TJZPE7DN.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk-S35O64PB.mjs";import{Button as v}from"@stackshift-ui/button";import{Container as c}from"@stackshift-ui/container";import{Flex as o}from"@stackshift-ui/flex";import{Image as d}from"@stackshift-ui/image";import{Link as x}from"@stackshift-ui/link";import{Section as h}from"@stackshift-ui/section";import{Text as w}from"@stackshift-ui/text";import g from"react";import{jsx as a,jsxs as b}from"react/jsx-runtime";function N({links:e,primaryButton:l,secondaryButton:s,logo:t}){let[i,r]=g.useState(!1),m=()=>{r(f=>!f)};return b(h,{className:"bg-background",children:[a("nav",{className:"relative py-6",children:a(c,{maxWidth:1280,children:b(o,{align:"center",justify:"between",gap:4,children:[a(p,{links:e}),a(M,{logo:t}),a(R,{primaryButton:l,secondaryButton:s}),a(k,{showMenu:m})]})})}),a(z,{menu:i,showMenu:m,links:e,primaryButton:l,secondaryButton:s})]})}function p({links:e}){return e?a(o,{children:a("ul",{className:"hidden lg:flex lg:items-center lg:gap-5",children:e==null?void 0:e.map((l,s)=>b(g.Fragment,{children:[(l==null?void 0:l.label)&&a(u,{link:l}),e.length!==s+1?a(L,{}):null]},s))})}):null}function u({link:e}){return e?a("li",{children:a(v,{as:"link",ariaLabel:e==null?void 0:e.label,link:e,className:"text-sm text-gray-500 no-underline hover:text-gray-900",children:e==null?void 0:e.label})}):null}function L(){return a("li",{className:"text-gray-500",children:a("svg",{className:"w-4 h-4 current-fill",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})})}function M({logo:e}){var l;return e?a("div",{className:"w-full lg:w-fit items-center justify-center",children:a(x,{className:"w-20 h-14 flex justify-center items-center","aria-label":n(e)==="/"?"Go to home page":`Go to ${n(e)}`,href:n(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:a(d,{className:"w-fit h-full object-contain",src:`${e==null?void 0:e.image}`,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",alt:(l=e==null?void 0:e.alt)!=null?l:"navigation-logo"})})}):null}function R({primaryButton:e,secondaryButton:l}){return b("div",{className:"hidden lg:text-right lg:block lg:w-1/3",children:[(e==null?void 0:e.label)&&a(v,{as:"link",ariaLabel:e==null?void 0:e.label,link:e,className:"px-4 py-3 text-gray-900 lg:ml-auto lg:mr-3 font-semibold rounded-global bg-secondary hover:bg-secondary/50",children:e==null?void 0:e.label}),(l==null?void 0:l.label)&&a(v,{as:"link",ariaLabel:l==null?void 0:l.label,link:l,className:"px-4 py-3 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:l==null?void 0:l.label})]})}function k({showMenu:e}){return a("div",{className:"ml-auto lg:hidden",children:a(v,{variant:"unstyled",as:"button",ariaLabel:"Navigation menu",className:"flex items-center p-3 navbar-burger text-primary",onClick:e,children:b("svg",{className:"block w-4 h-4 fill-current",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[a("title",{children:"Mobile menu"}),a("path",{d:"M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"})]})})})}function z({menu:e,showMenu:l,links:s,primaryButton:t,secondaryButton:i}){return b("div",{className:`${e?null:"hidden"} mobile-nav relative z-50`,children:[a("div",{className:"fixed inset-0 bg-gray-800 opacity-25 navbar-backdrop",onClick:l}),b("nav",{className:"fixed top-0 bottom-0 left-0 flex flex-col w-5/6 max-w-sm px-6 py-6 overflow-y-auto bg-white border-r",children:[a("div",{className:"flex items-center mb-8",children:a(v,{variant:"unstyled",as:"button",ariaLabel:"Navigation menu",className:"navbar-close",onClick:l,children:a("svg",{className:"w-6 h-6 text-gray-500 cursor-pointer hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})}),a("div",{children:a("ul",{children:s&&(s==null?void 0:s.map((r,m)=>a("li",{className:"mb-1",children:a(v,{as:"link",ariaLabel:r==null?void 0:r.label,link:r,className:"block p-4 text-sm font-semibold text-gray-700 no-underline rounded hover:bg-secondary-foreground hover:text-primary",children:r==null?void 0:r.label})},m)))})}),b("div",{className:"mt-auto",children:[b("div",{className:"pt-6",children:[(t==null?void 0:t.label)&&a(v,{as:"link",ariaLabel:t==null?void 0:t.label,link:t,className:"block px-4 py-3 mb-2 text-gray-900 text-center lg:ml-auto lg:mr-3 font-semibold rounded-global bg-secondary hover:bg-secondary/50",children:t==null?void 0:t.label}),(i==null?void 0:i.label)&&a(v,{as:"link",ariaLabel:i==null?void 0:i.label,link:i,className:"block px-4 py-3 mb-2 leading-loose text-center text-white font-semibold bg-primary hover:bg-primary-foreground rounded-global",children:i==null?void 0:i.label})]}),a(w,{fontSize:"xs",className:"my-4 text-center text-gray-700",children:a("span",{children:`\xA9 ${new Date().getFullYear()} All rights reserved.`})})]})]})]})}export{N as a};
|
package/dist/chunk-Z3RUBMRD.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 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};
|
|
File without changes
|