@ugurdemirel/landcraft 0.1.12 → 0.1.14
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/cjs/components/AccordionShowcase/AccordionShowcase.cjs +3 -0
- package/dist/cjs/components/AccordionShowcase/AccordionShowcase.cjs.map +1 -0
- package/dist/cjs/components/FeatureShowcase/FeatureShowcase.cjs +2 -0
- package/dist/cjs/components/FeatureShowcase/FeatureShowcase.cjs.map +1 -0
- package/dist/cjs/components/MegaMenu/MegaMenu.cjs +1 -1
- package/dist/cjs/components/MegaMenu/MegaMenu.cjs.map +1 -1
- package/dist/cjs/components/Navbar/Navbar.cjs +1 -1
- package/dist/cjs/components/Navbar/Navbar.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/es/components/AccordionShowcase/AccordionShowcase.js +48 -0
- package/dist/es/components/AccordionShowcase/AccordionShowcase.js.map +1 -0
- package/dist/es/components/FeatureShowcase/FeatureShowcase.js +57 -0
- package/dist/es/components/FeatureShowcase/FeatureShowcase.js.map +1 -0
- package/dist/es/components/MegaMenu/MegaMenu.js +45 -45
- package/dist/es/components/MegaMenu/MegaMenu.js.map +1 -1
- package/dist/es/components/Navbar/Navbar.js +19 -19
- package/dist/es/components/Navbar/Navbar.js.map +1 -1
- package/dist/es/index.js +69 -65
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +52 -0
- package/dist/styles.css +70 -0
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),r=require("../../utils/cn.cjs"),x=require("../../icons.cjs"),o=({className:l,items:n,defaultActive:a=0,...d})=>{const[c,u]=g.useState(a);return e.jsxs("div",{className:r.cn("grid w-full gap-x-16 gap-y-12 lg:grid-cols-2 lg:items-center lg:gap-y-0",l),...d,children:[e.jsx("div",{className:"divide-y divide-border",children:n.map((s,t)=>{const i=t===c;return e.jsxs("div",{children:[e.jsx("h3",{children:e.jsxs("button",{type:"button","aria-expanded":i,onClick:()=>u(t),className:"group flex w-full cursor-pointer items-center justify-between gap-6 py-5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[e.jsx("span",{className:"font-display text-[1.375rem] font-semibold leading-tight tracking-tight text-foreground sm:text-[1.625rem]",children:s.title}),e.jsx(x.ChevronDown,{className:r.cn("h-5 w-5 shrink-0 text-foreground/40 transition-transform duration-300 sm:h-6 sm:w-6",i&&"rotate-180 text-foreground")})]})}),i&&s.description?e.jsx("div",{className:"pb-8 pr-10",children:e.jsx("p",{className:"max-w-md text-pretty text-base leading-7 text-muted-foreground sm:text-lg",children:s.description})}):null]},s.title)})}),e.jsx("div",{className:"relative",children:n.map((s,t)=>e.jsx("div",{className:r.cn(t===c?"block":"hidden"),children:s.visual},s.title))})]})};o.displayName="AccordionShowcase";exports.AccordionShowcase=o;
|
|
3
|
+
//# sourceMappingURL=AccordionShowcase.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionShowcase.cjs","sources":["../../../../src/components/AccordionShowcase/AccordionShowcase.tsx"],"sourcesContent":["\"use client\";\nimport { useState } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { ChevronDown } from \"../../icons\";\nimport type { AccordionShowcaseProps } from \"./types\";\n\nexport const AccordionShowcase = ({\n className,\n items,\n defaultActive = 0,\n ...props\n}: AccordionShowcaseProps) => {\n const [active, setActive] = useState(defaultActive);\n\n return (\n <div className={cn(\"grid w-full gap-x-16 gap-y-12 lg:grid-cols-2 lg:items-center lg:gap-y-0\", className)} {...props}>\n {/* Interactive list */}\n <div className=\"divide-y divide-border\">\n {items.map((item, index) => {\n const open = index === active;\n return (\n <div key={item.title}>\n <h3>\n <button\n type=\"button\"\n aria-expanded={open}\n onClick={() => setActive(index)}\n className=\"group flex w-full cursor-pointer items-center justify-between gap-6 py-5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n >\n <span className=\"font-display text-[1.375rem] font-semibold leading-tight tracking-tight text-foreground sm:text-[1.625rem]\">\n {item.title}\n </span>\n <ChevronDown\n className={cn(\n \"h-5 w-5 shrink-0 text-foreground/40 transition-transform duration-300 sm:h-6 sm:w-6\",\n open && \"rotate-180 text-foreground\",\n )}\n />\n </button>\n </h3>\n {open && item.description ? (\n <div className=\"pb-8 pr-10\">\n <p className=\"max-w-md text-pretty text-base leading-7 text-muted-foreground sm:text-lg\">\n {item.description}\n </p>\n </div>\n ) : null}\n </div>\n );\n })}\n </div>\n\n {/* Swapping visual */}\n <div className=\"relative\">\n {items.map((item, index) => (\n <div key={item.title} className={cn(index === active ? \"block\" : \"hidden\")}>\n {item.visual}\n </div>\n ))}\n </div>\n </div>\n );\n};\nAccordionShowcase.displayName = \"AccordionShowcase\";\n"],"names":["AccordionShowcase","className","items","defaultActive","props","active","setActive","useState","jsxs","cn","jsx","item","index","open","ChevronDown"],"mappings":"qMAMaA,EAAoB,CAAC,CAChC,UAAAC,EACA,MAAAC,EACA,cAAAC,EAAgB,EAChB,GAAGC,CACL,IAA8B,CAC5B,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAASJ,CAAa,EAElD,OACEK,EAAAA,KAAC,OAAI,UAAWC,EAAAA,GAAG,0EAA2ER,CAAS,EAAI,GAAGG,EAE5G,SAAA,CAAAM,MAAC,OAAI,UAAU,yBACZ,WAAM,IAAI,CAACC,EAAMC,IAAU,CAC1B,MAAMC,EAAOD,IAAUP,EACvB,cACG,MAAA,CACC,SAAA,CAAAK,MAAC,KAAA,CACC,SAAAF,EAAAA,KAAC,SAAA,CACC,KAAK,SACL,gBAAeK,EACf,QAAS,IAAMP,EAAUM,CAAK,EAC9B,UAAU,8NAEV,SAAA,CAAAF,EAAAA,IAAC,OAAA,CAAK,UAAU,6GACb,SAAAC,EAAK,MACR,EACAD,EAAAA,IAACI,EAAAA,YAAA,CACC,UAAWL,EAAAA,GACT,sFACAI,GAAQ,4BAAA,CACV,CAAA,CACF,CAAA,CAAA,EAEJ,EACCA,GAAQF,EAAK,YACZD,EAAAA,IAAC,OAAI,UAAU,aACb,SAAAA,EAAAA,IAAC,IAAA,CAAE,UAAU,4EACV,SAAAC,EAAK,WAAA,CACR,EACF,EACE,IAAA,CAAA,EAzBIA,EAAK,KA0Bf,CAEJ,CAAC,CAAA,CACH,EAGAD,EAAAA,IAAC,OAAI,UAAU,WACZ,WAAM,IAAI,CAACC,EAAMC,IAChBF,EAAAA,IAAC,MAAA,CAAqB,UAAWD,EAAAA,GAAGG,IAAUP,EAAS,QAAU,QAAQ,EACtE,WAAK,MAAA,EADEM,EAAK,KAEf,CACD,CAAA,CACH,CAAA,EACF,CAEJ,EACAX,EAAkB,YAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("../../utils/cn.cjs"),g=require("../../icons.cjs"),o=({className:c,items:d,visual:i,mediaSide:x="left",eyebrow:r,title:l,description:t,...u})=>{const a=x==="left";return e.jsxs("div",{className:n.cn("w-full",c),...u,children:[r||l||t?e.jsxs("div",{className:"max-w-2xl",children:[r?e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-primary",children:r}):null,l?e.jsx("h2",{className:"mt-4 font-display text-balance text-[1.9rem] font-semibold leading-[1.08] tracking-tight text-foreground sm:text-4xl",children:l}):null,t?e.jsx("p",{className:"mt-4 text-pretty text-base leading-7 text-muted-foreground sm:text-lg",children:t}):null]}):null,e.jsxs("div",{className:"mt-12 grid w-full items-center gap-10 lg:grid-cols-[1.05fr_0.95fr] lg:gap-20",children:[i?e.jsx("div",{className:n.cn("relative",a?"lg:order-1":"lg:order-2"),children:i}):null,e.jsx("div",{className:n.cn("flex flex-col divide-y divide-border",a?"lg:order-2":"lg:order-1"),children:d.map((s,f)=>e.jsxs("div",{className:"flex gap-5 py-7 first:pt-0 last:pb-0 sm:gap-6",children:[s.icon?e.jsx("div",{className:"inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-xl border border-border bg-surface text-lg text-foreground shadow-soft",children:s.icon}):null,e.jsxs("div",{children:[e.jsx("h3",{className:"font-display text-lg font-semibold tracking-tight text-foreground",children:s.title}),s.description?e.jsx("p",{className:"mt-2 text-pretty text-sm leading-6 text-muted-foreground sm:text-[15px]",children:s.description}):null,s.link?e.jsx("div",{className:"mt-3",children:s.link}):s.href?e.jsxs("a",{href:s.href,className:"group/link mt-3 inline-flex items-center gap-1.5 text-sm font-medium text-primary transition-colors hover:text-primary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[s.linkLabel??"Learn more",e.jsx(g.ArrowRight,{className:"h-4 w-4 transition-transform duration-200 group-hover/link:translate-x-0.5"})]}):null]})]},f))})]})]})};o.displayName="FeatureShowcase";exports.FeatureShowcase=o;
|
|
2
|
+
//# sourceMappingURL=FeatureShowcase.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureShowcase.cjs","sources":["../../../../src/components/FeatureShowcase/FeatureShowcase.tsx"],"sourcesContent":["import { cn } from \"../../utils/cn\";\nimport { ArrowRight } from \"../../icons\";\nimport type { FeatureShowcaseProps } from \"./types\";\n\nexport const FeatureShowcase = ({\n className,\n items,\n visual,\n mediaSide = \"left\",\n eyebrow,\n title,\n description,\n ...props\n}: FeatureShowcaseProps) => {\n const mediaLeft = mediaSide === \"left\";\n\n return (\n <div className={cn(\"w-full\", className)} {...props}>\n {eyebrow || title || description ? (\n <div className=\"max-w-2xl\">\n {eyebrow ? (\n <p className=\"text-xs font-semibold uppercase tracking-[0.18em] text-primary\">{eyebrow}</p>\n ) : null}\n {title ? (\n <h2 className=\"mt-4 font-display text-balance text-[1.9rem] font-semibold leading-[1.08] tracking-tight text-foreground sm:text-4xl\">\n {title}\n </h2>\n ) : null}\n {description ? (\n <p className=\"mt-4 text-pretty text-base leading-7 text-muted-foreground sm:text-lg\">\n {description}\n </p>\n ) : null}\n </div>\n ) : null}\n\n <div className=\"mt-12 grid w-full items-center gap-10 lg:grid-cols-[1.05fr_0.95fr] lg:gap-20\">\n {visual ? (\n <div className={cn(\"relative\", mediaLeft ? \"lg:order-1\" : \"lg:order-2\")}>{visual}</div>\n ) : null}\n\n <div\n className={cn(\n \"flex flex-col divide-y divide-border\",\n mediaLeft ? \"lg:order-2\" : \"lg:order-1\",\n )}\n >\n {items.map((item, index) => (\n <div key={index} className=\"flex gap-5 py-7 first:pt-0 last:pb-0 sm:gap-6\">\n {item.icon ? (\n <div className=\"inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-xl border border-border bg-surface text-lg text-foreground shadow-soft\">\n {item.icon}\n </div>\n ) : null}\n <div>\n <h3 className=\"font-display text-lg font-semibold tracking-tight text-foreground\">\n {item.title}\n </h3>\n {item.description ? (\n <p className=\"mt-2 text-pretty text-sm leading-6 text-muted-foreground sm:text-[15px]\">\n {item.description}\n </p>\n ) : null}\n {item.link ? (\n <div className=\"mt-3\">{item.link}</div>\n ) : item.href ? (\n <a\n href={item.href}\n className=\"group/link mt-3 inline-flex items-center gap-1.5 text-sm font-medium text-primary transition-colors hover:text-primary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n >\n {item.linkLabel ?? \"Learn more\"}\n <ArrowRight className=\"h-4 w-4 transition-transform duration-200 group-hover/link:translate-x-0.5\" />\n </a>\n ) : null}\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\nFeatureShowcase.displayName = \"FeatureShowcase\";\n"],"names":["FeatureShowcase","className","items","visual","mediaSide","eyebrow","title","description","props","mediaLeft","jsxs","cn","jsx","item","index","ArrowRight"],"mappings":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AAMG,EAAK,KACX,UAAU,wQAET,SAAA,CAAAA,EAAK,WAAa,aACnBD,EAAAA,IAACG,EAAAA,WAAA,CAAW,UAAU,4EAAA,CAA6E,CAAA,CAAA,CAAA,EAEnG,IAAA,CAAA,CACN,CAAA,CAAA,EA1BQD,CA2BV,CACD,CAAA,CAAA,CACH,CAAA,CACF,CAAA,EACF,CAEJ,EACAd,EAAgB,YAAc"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),n=require("../../utils/cn.cjs"),J=require("../../utils/contrast.cjs"),x=require("../../icons.cjs"),B="text-on-secondary",b="text-foreground",Q={classic:{shell:"border-b border-border bg-background/85 backdrop-blur-md supports-[backdrop-filter]:bg-background/75",bar:"mx-auto max-w-6xl px-5 sm:px-8",header:"px-0",trigger:"text-muted-foreground hover:text-foreground hover:bg-surface",triggerOpen:"bg-surface text-foreground",badge:"bg-primary-soft text-primary",panel:"border-border bg-surface shadow-raised",columnTitle:"text-muted-foreground/70",columnLink:"hover:bg-surface-strong",linkDescription:"text-muted-foreground",mobilePanel:"border-t border-border bg-background",mobileButton:`${b} hover:bg-surface`,mobileLink:"text-muted-foreground hover:bg-surface hover:text-foreground",brandText:b,brandDot:"bg-foreground"},floating:{shell:"px-0",bar:"mx-auto mt-3 max-w-5xl rounded-xl border border-border bg-surface/90 px-5 shadow-soft backdrop-blur-md supports-[backdrop-filter]:bg-surface/70",header:"px-3 sm:px-6",trigger:"text-muted-foreground hover:text-foreground hover:bg-surface",triggerOpen:"bg-surface text-foreground",badge:"bg-primary-soft text-primary",panel:"border-border bg-surface shadow-raised",columnTitle:"text-muted-foreground/70",columnLink:"hover:bg-surface-strong",linkDescription:"text-muted-foreground",mobilePanel:"mx-3 mb-3 max-w-5xl overflow-hidden rounded-b-xl border border-border bg-surface",mobileButton:`${b} hover:bg-surface`,mobileLink:"text-muted-foreground hover:bg-surface hover:text-foreground",brandText:b,brandDot:"bg-foreground"},inverse:{shell:"border-b border-white/10 bg-[#101010]/85 backdrop-blur-md",bar:"mx-auto max-w-6xl px-5 sm:px-8",header:"px-0",trigger:"text-on-secondary/60 hover:text-on-secondary hover:bg-white/10",triggerOpen:"bg-white/10 text-on-secondary",badge:"bg-white/15 text-on-secondary",panel:"border-white/10 bg-[#161616]",columnTitle:"text-on-secondary/45",columnLink:"hover:bg-white/10",linkDescription:"text-on-secondary/50",mobilePanel:"border-t border-white/10 bg-[#101010]",mobileButton:`${B} hover:bg-white/10`,mobileLink:"text-on-secondary/70 hover:bg-white/10 hover:text-on-secondary",brandText:B,brandDot:"bg-on-secondary"}},$=({className:q,variant:w="classic",brand:
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),n=require("../../utils/cn.cjs"),J=require("../../utils/contrast.cjs"),x=require("../../icons.cjs"),B="text-on-secondary",b="text-foreground",Q={classic:{shell:"border-b border-border bg-background/85 backdrop-blur-md supports-[backdrop-filter]:bg-background/75",bar:"mx-auto max-w-6xl px-5 sm:px-8",header:"px-0",trigger:"text-muted-foreground hover:text-foreground hover:bg-surface",triggerOpen:"bg-surface text-foreground",badge:"bg-primary-soft text-primary",panel:"border-border bg-surface shadow-raised",columnTitle:"text-muted-foreground/70",columnLink:"hover:bg-surface-strong",linkDescription:"text-muted-foreground",mobilePanel:"border-t border-border bg-background",mobileButton:`${b} hover:bg-surface`,mobileLink:"text-muted-foreground hover:bg-surface hover:text-foreground",brandText:b,brandDot:"bg-foreground"},floating:{shell:"px-0",bar:"mx-auto mt-3 max-w-5xl rounded-xl border border-border bg-surface/90 px-5 shadow-soft backdrop-blur-md supports-[backdrop-filter]:bg-surface/70",header:"px-3 sm:px-6",trigger:"text-muted-foreground hover:text-foreground hover:bg-surface",triggerOpen:"bg-surface text-foreground",badge:"bg-primary-soft text-primary",panel:"border-border bg-surface shadow-raised",columnTitle:"text-muted-foreground/70",columnLink:"hover:bg-surface-strong",linkDescription:"text-muted-foreground",mobilePanel:"mx-3 mb-3 max-w-5xl overflow-hidden rounded-b-xl border border-border bg-surface",mobileButton:`${b} hover:bg-surface`,mobileLink:"text-muted-foreground hover:bg-surface hover:text-foreground",brandText:b,brandDot:"bg-foreground"},inverse:{shell:"border-b border-white/10 bg-[#101010]/85 backdrop-blur-md",bar:"mx-auto max-w-6xl px-5 sm:px-8",header:"px-0",trigger:"text-on-secondary/60 hover:text-on-secondary hover:bg-white/10",triggerOpen:"bg-white/10 text-on-secondary",badge:"bg-white/15 text-on-secondary",panel:"border-white/10 bg-[#161616]",columnTitle:"text-on-secondary/45",columnLink:"hover:bg-white/10",linkDescription:"text-on-secondary/50",mobilePanel:"border-t border-white/10 bg-[#101010]",mobileButton:`${B} hover:bg-white/10`,mobileLink:"text-on-secondary/70 hover:bg-white/10 hover:text-on-secondary",brandText:B,brandDot:"bg-on-secondary"}},$=({className:q,variant:w="classic",brand:p,logo:E,logoSrc:k,logoAlt:I,logoClassName:S,brandHref:z="#",items:g,actions:m,cta:h,languageSwitcher:f,sticky:A=!0,LinkComponent:F,onKeyDown:j,...R})=>{const X=u.useId(),d=F??"a",[M,i]=u.useState(null),[c,v]=u.useState(!1),[y,C]=u.useState(null),t=Q[w],_=()=>i(null),N=()=>{i(null),v(!1),C(null)},L=r=>`${X}-panel-${r}`,T=E??(k?e.jsx("img",{src:k,alt:I??(typeof p=="string"?p:"Logo"),className:n.cn("h-7 w-auto",S)}):null),G=T?e.jsx("span",{className:"flex items-center",children:T}):e.jsxs("span",{className:n.cn("flex items-center gap-2 font-display text-[17px] font-bold tracking-tight",t.brandText),children:[e.jsx("span",{"aria-hidden":!0,className:n.cn("inline-block h-2.5 w-2.5 rounded-sm",t.brandDot)}),p]}),O=n.cn("flex items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition-colors duration-150",t.trigger),D=r=>{var l;return e.jsx("div",{className:n.cn("grid gap-x-10 gap-y-8 sm:grid-cols-2",r.featured?"":"lg:grid-cols-3"),children:(l=r.columns)==null?void 0:l.map((s,a)=>e.jsxs("div",{children:[s.title?e.jsx("h4",{className:n.cn("text-xs font-semibold uppercase tracking-[0.14em]",t.columnTitle),children:s.title}):null,e.jsx("ul",{className:n.cn(s.title&&"mt-3","space-y-0.5"),children:s.links.map(o=>e.jsx("li",{children:e.jsxs(d,{href:o.href,onClick:N,className:n.cn("-mx-2 block rounded-md px-2 py-2 transition-colors duration-150",t.columnLink),children:[e.jsx("span",{className:"block text-sm font-medium text-foreground",children:o.label}),o.description?e.jsx("span",{className:n.cn("mt-0.5 block text-[13px] leading-snug",t.linkDescription),children:o.description}):null]})},o.href))})]},s.title??a))})},P=(r,l=!1)=>{const s=r.featured;if(!s)return null;const a=s.accent?{backgroundColor:s.accent,color:J.getContrastText(s.accent)}:void 0;return e.jsxs(d,{href:s.href,onClick:N,className:n.cn("group relative block overflow-hidden rounded-lg p-6 transition-transform duration-150 hover:-translate-y-0.5",l&&"mt-8",!s.accent&&"bg-primary text-on-primary"),style:a,children:[e.jsxs("div",{className:"flex h-full flex-col justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-display text-base font-semibold tracking-tight",children:s.title}),s.description?e.jsx("p",{className:"mt-1.5 text-[13px] leading-relaxed opacity-80",children:s.description}):null]}),s.cta?e.jsxs("span",{className:"text-sm font-semibold underline decoration-1 underline-offset-4",children:[s.cta," →"]}):null]}),e.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute -right-8 -top-8 h-28 w-28 rounded-full opacity-20 blur-2xl bg-black/40"})]})},H=r=>{r.key==="Escape"&&N(),j==null||j(r)};return e.jsxs("header",{className:n.cn("relative w-full transition-colors duration-200",A&&"sticky top-0 z-50",t.shell,t.header,q),onKeyDown:H,...R,children:[e.jsxs("nav",{className:n.cn("relative flex h-16 w-full items-center justify-between gap-4 transition-colors duration-200",t.bar),onMouseLeave:_,"aria-label":"Mega menu",children:[e.jsx(d,{href:z,className:"shrink-0",children:G}),e.jsx("ul",{className:"hidden items-center gap-1 lg:flex",children:g.map((r,l)=>{var o;const s=!!((o=r.columns)!=null&&o.length||r.featured),a=M===l;return e.jsx("li",{className:"relative",children:s?e.jsxs("button",{type:"button","aria-haspopup":"true","aria-expanded":a,"aria-controls":L(l),onClick:()=>i(a?null:l),onMouseEnter:()=>i(l),className:n.cn(O,a&&t.triggerOpen),children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[r.label,r.badge?e.jsx("span",{className:n.cn("rounded-full px-1.5 py-0.5 text-[10px] font-semibold tracking-wide",t.badge),children:r.badge}):null]}),e.jsx(x.ChevronDown,{className:n.cn("h-4 w-4 shrink-0 transition-transform duration-150",a&&"rotate-180")})]}):e.jsxs(d,{href:r.href??"#",className:O,children:[r.label,r.badge?e.jsx("span",{className:n.cn("rounded-full px-1.5 py-0.5 text-[10px] font-semibold tracking-wide",t.badge),children:r.badge}):null]})},r.label)})}),e.jsxs("div",{className:"hidden items-center gap-3 lg:flex",children:[f,m,h]}),e.jsx("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>v(r=>!r),className:n.cn("inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-md lg:hidden","transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",t.mobileButton),children:c?e.jsx(x.X,{className:"h-5 w-5"}):e.jsx(x.Menu,{className:"h-5 w-5"})})]}),g.map((r,l)=>{var a;if(!((a=r.columns)!=null&&a.length)&&!r.featured)return null;const s=M===l;return e.jsx("div",{id:L(l),role:"region","aria-label":`${r.label} menu`,onMouseEnter:()=>i(l),className:n.cn("absolute top-full z-50 pt-2 transition-all duration-150",w==="floating"?"inset-x-0 mx-auto w-full max-w-5xl":"inset-x-0",s?"visible translate-y-0 opacity-100":"pointer-events-none invisible -translate-y-1 opacity-0"),children:e.jsxs("div",{className:n.cn("overflow-hidden rounded-xl border p-6 md:p-8",t.panel,r.featured?"lg:grid lg:grid-cols-[minmax(0,1fr)_auto] lg:gap-12":""),children:[D(r),r.featured&&e.jsx("div",{className:n.cn("mt-8 max-w-sm lg:mt-0 lg:w-64"),children:P(r)})]})},r.label)}),e.jsx("div",{className:n.cn("grid transition-[grid-template-rows,opacity] duration-200 lg:hidden",c?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0",t.mobilePanel),children:e.jsx("div",{className:"min-h-0 overflow-hidden",children:e.jsxs("ul",{className:"flex flex-col py-4",children:[f?e.jsx("li",{className:"px-5 pb-4",children:f}):null,g.map((r,l)=>{var s;return(s=r.columns)!=null&&s.length||r.featured?e.jsxs("li",{className:"px-5",children:[e.jsxs("button",{type:"button","aria-expanded":y===l,onClick:()=>C(a=>a===l?null:l),className:n.cn("flex w-full items-center justify-between rounded-md px-2 py-2.5 text-sm font-medium transition-colors duration-150",t.mobileButton),children:[e.jsxs("span",{className:"flex items-center gap-2",children:[r.label,r.badge?e.jsx("span",{className:n.cn("rounded-full px-1.5 py-0.5 text-[10px] font-semibold tracking-wide",t.badge),children:r.badge}):null]}),e.jsx(x.ChevronDown,{className:n.cn("h-4 w-4 shrink-0 transition-transform duration-150",y===l&&"rotate-180")})]}),e.jsx("div",{className:n.cn("grid transition-[grid-template-rows,opacity] duration-200",y===l?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),children:e.jsx("div",{className:"min-h-0 overflow-hidden",children:e.jsxs("div",{className:"py-2 pl-1",children:[D(r),r.featured?e.jsx("div",{className:"max-w-sm",children:P(r,!0)}):null]})})})]},r.label):e.jsx("li",{className:"px-5",children:e.jsx(d,{href:r.href??"#",onClick:()=>v(!1),className:n.cn("block rounded-md px-2 py-2.5 text-sm font-medium transition-colors duration-150",t.mobileLink),children:r.label})},r.label)}),h?e.jsx("li",{className:"px-8 pb-2 pt-3",children:h}):m?e.jsx("li",{className:"mt-3 flex flex-wrap gap-3 px-8 pb-2",children:m}):null]})})})]})};$.displayName="MegaMenu";exports.MegaMenu=$;
|
|
3
3
|
//# sourceMappingURL=MegaMenu.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MegaMenu.cjs","sources":["../../../../src/components/MegaMenu/MegaMenu.tsx"],"sourcesContent":["\"use client\";\nimport { useId, useState } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { getContrastText } from \"../../utils/contrast\";\nimport { ChevronDown, Menu, X } from \"../../icons\";\nimport type { MegaMenuProps, MegaMenuVariant, MegaMenuItem } from \"./types\";\n\ninterface MegaMenuStyle {\n shell: string;\n bar: string;\n header: string;\n trigger: string;\n triggerOpen: string;\n badge: string;\n panel: string;\n columnTitle: string;\n columnLink: string;\n linkDescription: string;\n mobilePanel: string;\n mobileButton: string;\n mobileLink: string;\n brandText: string;\n brandDot: string;\n}\n\nconst inverse = \"text-on-secondary\";\nconst light = \"text-foreground\";\n\nconst styles: Record<MegaMenuVariant, MegaMenuStyle> = {\n classic: {\n shell: \"border-b border-border bg-background/85 backdrop-blur-md supports-[backdrop-filter]:bg-background/75\",\n bar: \"mx-auto max-w-6xl px-5 sm:px-8\",\n header: \"px-0\",\n trigger: \"text-muted-foreground hover:text-foreground hover:bg-surface\",\n triggerOpen: \"bg-surface text-foreground\",\n badge: \"bg-primary-soft text-primary\",\n panel: \"border-border bg-surface shadow-raised\",\n columnTitle: \"text-muted-foreground/70\",\n columnLink: \"hover:bg-surface-strong\",\n linkDescription: \"text-muted-foreground\",\n mobilePanel: \"border-t border-border bg-background\",\n mobileButton: `${light} hover:bg-surface`,\n mobileLink: \"text-muted-foreground hover:bg-surface hover:text-foreground\",\n brandText: light,\n brandDot: \"bg-foreground\",\n },\n floating: {\n shell: \"px-0\",\n bar: \"mx-auto mt-3 max-w-5xl rounded-xl border border-border bg-surface/90 px-5 shadow-soft backdrop-blur-md supports-[backdrop-filter]:bg-surface/70\",\n header: \"px-3 sm:px-6\",\n trigger: \"text-muted-foreground hover:text-foreground hover:bg-surface\",\n triggerOpen: \"bg-surface text-foreground\",\n badge: \"bg-primary-soft text-primary\",\n panel: \"border-border bg-surface shadow-raised\",\n columnTitle: \"text-muted-foreground/70\",\n columnLink: \"hover:bg-surface-strong\",\n linkDescription: \"text-muted-foreground\",\n mobilePanel: \"mx-3 mb-3 max-w-5xl overflow-hidden rounded-b-xl border border-border bg-surface\",\n mobileButton: `${light} hover:bg-surface`,\n mobileLink: \"text-muted-foreground hover:bg-surface hover:text-foreground\",\n brandText: light,\n brandDot: \"bg-foreground\",\n },\n inverse: {\n shell: \"border-b border-white/10 bg-[#101010]/85 backdrop-blur-md\",\n bar: \"mx-auto max-w-6xl px-5 sm:px-8\",\n header: \"px-0\",\n trigger: \"text-on-secondary/60 hover:text-on-secondary hover:bg-white/10\",\n triggerOpen: \"bg-white/10 text-on-secondary\",\n badge: \"bg-white/15 text-on-secondary\",\n panel: \"border-white/10 bg-[#161616]\",\n columnTitle: \"text-on-secondary/45\",\n columnLink: \"hover:bg-white/10\",\n linkDescription: \"text-on-secondary/50\",\n mobilePanel: \"border-t border-white/10 bg-[#101010]\",\n mobileButton: `${inverse} hover:bg-white/10`,\n mobileLink: \"text-on-secondary/70 hover:bg-white/10 hover:text-on-secondary\",\n brandText: inverse,\n brandDot: \"bg-on-secondary\",\n },\n};\n\nexport const MegaMenu = ({\n className,\n variant = \"classic\",\n brand,\n logo,\n logoSrc,\n logoAlt,\n logoClassName,\n brandHref = \"#\",\n items,\n actions,\n cta,\n languageSwitcher,\n sticky = true,\n LinkComponent,\n onKeyDown,\n ...props\n}: MegaMenuProps) => {\n const ids = useId();\n const Link = LinkComponent ?? \"a\";\n const [openIndex, setOpenIndex] = useState<number | null>(null);\n const [mobileOpen, setMobileOpen] = useState(false);\n const [mobileExpanded, setMobileExpanded] = useState<number | null>(null);\n const s = styles[variant];\n\n const closePanels = () => setOpenIndex(null);\n const closeAll = () => {\n setOpenIndex(null);\n setMobileOpen(false);\n setMobileExpanded(null);\n };\n\n const panelId = (i: number) => `${ids}-panel-${i}`;\n\n const logoNode =\n logo ??\n (logoSrc ? (\n <img\n src={logoSrc}\n alt={logoAlt ?? (typeof brand === \"string\" ? brand : \"Logo\")}\n className={cn(\"h-7 w-auto\", logoClassName)}\n />\n ) : null);\n\n const brandNode = logoNode ? (\n <span className=\"flex items-center\">{logoNode}</span>\n ) : (\n <span className={cn(\"flex items-center gap-2 font-display text-[17px] font-bold tracking-tight\", s.brandText)}>\n <span aria-hidden className={cn(\"inline-block h-2.5 w-2.5 rounded-sm\", s.brandDot)} />\n {brand}\n </span>\n );\n\n const triggerClasses = cn(\n \"flex items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition-colors duration-150\",\n s.trigger,\n );\n\n const renderColumns = (item: MegaMenuItem) => (\n <div\n className={cn(\n \"grid gap-x-10 gap-y-8 sm:grid-cols-2\",\n item.featured ? \"\" : \"lg:grid-cols-3\",\n )}\n >\n {item.columns?.map((column, ci) => (\n <div key={column.title ?? ci}>\n {column.title ? (\n <h4\n className={cn(\n \"text-xs font-semibold uppercase tracking-[0.14em]\",\n s.columnTitle,\n )}\n >\n {column.title}\n </h4>\n ) : null}\n <ul className={cn(column.title && \"mt-3\", \"space-y-0.5\")}>\n {column.links.map((link) => (\n <li key={link.href}>\n <Link\n href={link.href}\n onClick={closeAll}\n className={cn(\n \"-mx-2 block rounded-md px-2 py-2 transition-colors duration-150\",\n s.columnLink,\n )}\n >\n <span className=\"block text-sm font-medium text-foreground\">\n {link.label}\n </span>\n {link.description ? (\n <span\n className={cn(\n \"mt-0.5 block text-[13px] leading-snug\",\n s.linkDescription,\n )}\n >\n {link.description}\n </span>\n ) : null}\n </Link>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n );\n\n const renderFeatured = (item: MegaMenuItem, mobile = false) => {\n const featured = item.featured;\n if (!featured) return null;\n const featuredStyle = featured.accent\n ? { backgroundColor: featured.accent, color: getContrastText(featured.accent) }\n : undefined;\n\n return (\n <Link\n href={featured.href}\n onClick={closeAll}\n className={cn(\n \"group relative block overflow-hidden rounded-lg p-6 transition-transform duration-150 hover:-translate-y-0.5\",\n mobile && \"mt-8\",\n !featured.accent && \"bg-primary text-on-primary\",\n )}\n style={featuredStyle}\n >\n <div className=\"flex h-full flex-col justify-between gap-4\">\n <div>\n <h4 className=\"font-display text-base font-semibold tracking-tight\">\n {featured.title}\n </h4>\n {featured.description ? (\n <p className=\"mt-1.5 text-[13px] leading-relaxed opacity-80\">\n {featured.description}\n </p>\n ) : null}\n </div>\n {featured.cta ? (\n <span className=\"text-sm font-semibold underline decoration-1 underline-offset-4\">\n {featured.cta} →\n </span>\n ) : null}\n </div>\n <div\n aria-hidden\n className=\"pointer-events-none absolute -right-8 -top-8 h-28 w-28 rounded-full opacity-20 blur-2xl bg-black/40\"\n />\n </Link>\n );\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n if (event.key === \"Escape\") {\n closeAll();\n }\n onKeyDown?.(event);\n };\n\n return (\n <header\n className={cn(\n \"relative w-full transition-colors duration-200\",\n sticky && \"sticky top-0 z-50\",\n s.shell,\n s.header,\n className,\n )}\n onKeyDown={handleKeyDown}\n {...props}\n >\n <nav className={cn(\"relative flex h-16 w-full items-center justify-between gap-4 transition-colors duration-200\", s.bar)} onMouseLeave={closePanels} aria-label=\"Mega menu\">\n <Link href={brandHref} className=\"shrink-0\">\n {brandNode}\n </Link>\n\n <ul className=\"hidden items-center gap-1 lg:flex\">\n {items.map((item, i) => {\n const hasPanel = Boolean(item.columns?.length || item.featured);\n const open = openIndex === i;\n return (\n <li key={item.label} className=\"relative\">\n {hasPanel ? (\n <button\n type=\"button\"\n aria-haspopup=\"true\"\n aria-expanded={open}\n aria-controls={panelId(i)}\n onClick={() => setOpenIndex(open ? null : i)}\n onMouseEnter={() => setOpenIndex(i)}\n className={cn(triggerClasses, open && s.triggerOpen)}\n >\n <span className=\"flex items-center gap-1.5\">\n {item.label}\n {item.badge ? (\n <span\n className={cn(\n \"rounded-full px-1.5 py-0.5 text-[10px] font-semibold tracking-wide\",\n s.badge,\n )}\n >\n {item.badge}\n </span>\n ) : null}\n </span>\n <ChevronDown\n className={cn(\n \"h-4 w-4 shrink-0 transition-transform duration-150\",\n open && \"rotate-180\",\n )}\n />\n </button>\n ) : (\n <Link href={item.href ?? \"#\"} className={triggerClasses}>\n {item.label}\n {item.badge ? (\n <span className={cn(\"rounded-full px-1.5 py-0.5 text-[10px] font-semibold tracking-wide\", s.badge)}>\n {item.badge}\n </span>\n ) : null}\n </Link>\n )}\n </li>\n );\n })}\n </ul>\n\n <div className=\"hidden items-center gap-3 lg:flex\">\n {languageSwitcher}\n {actions}\n {cta}\n </div>\n\n {languageSwitcher ? (\n <div className=\"flex items-center lg:hidden\">{languageSwitcher}</div>\n ) : null}\n\n <button\n type=\"button\"\n aria-label={mobileOpen ? \"Close menu\" : \"Open menu\"}\n aria-expanded={mobileOpen}\n onClick={() => setMobileOpen((o) => !o)}\n className={cn(\n \"inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-md lg:hidden\",\n \"transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n s.mobileButton,\n )}\n >\n {mobileOpen ? <X className=\"h-5 w-5\" /> : <Menu className=\"h-5 w-5\" />}\n </button>\n </nav>\n\n {items.map((item, i) => {\n if (!item.columns?.length && !item.featured) return null;\n const open = openIndex === i;\n return (\n <div\n key={item.label}\n id={panelId(i)}\n role=\"region\"\n aria-label={`${item.label} menu`}\n onMouseEnter={() => setOpenIndex(i)}\n className={cn(\n \"absolute top-full z-50 pt-2 transition-all duration-150\",\n variant === \"floating\" ? \"inset-x-0 mx-auto w-full max-w-5xl\" : \"inset-x-0\",\n open\n ? \"visible translate-y-0 opacity-100\"\n : \"pointer-events-none invisible -translate-y-1 opacity-0\",\n )}\n >\n <div\n className={cn(\n \"overflow-hidden rounded-xl border p-6 md:p-8\",\n s.panel,\n item.featured ? \"lg:grid lg:grid-cols-[minmax(0,1fr)_auto] lg:gap-12\" : \"\",\n )}\n >\n {renderColumns(item)}\n {item.featured && (\n <div className={cn(\"mt-8 max-w-sm lg:mt-0 lg:w-64\")}>\n {renderFeatured(item)}\n </div>\n )}\n </div>\n </div>\n );\n })}\n\n <div\n className={cn(\n \"grid transition-[grid-template-rows,opacity] duration-200 lg:hidden\",\n mobileOpen ? \"grid-rows-[1fr] opacity-100\" : \"grid-rows-[0fr] opacity-0\",\n s.mobilePanel,\n )}\n >\n <div className=\"min-h-0 overflow-hidden\">\n <ul className=\"flex flex-col py-4\">\n {items.map((item, i) =>\n item.columns?.length || item.featured ? (\n <li key={item.label} className=\"px-5\">\n <button\n type=\"button\"\n aria-expanded={mobileExpanded === i}\n onClick={() =>\n setMobileExpanded((prev) => (prev === i ? null : i))\n }\n className={cn(\n \"flex w-full items-center justify-between rounded-md px-2 py-2.5 text-sm font-medium transition-colors duration-150\",\n s.mobileButton,\n )}\n >\n <span className=\"flex items-center gap-2\">\n {item.label}\n {item.badge ? (\n <span className={cn(\"rounded-full px-1.5 py-0.5 text-[10px] font-semibold tracking-wide\", s.badge)}>\n {item.badge}\n </span>\n ) : null}\n </span>\n <ChevronDown\n className={cn(\n \"h-4 w-4 shrink-0 transition-transform duration-150\",\n mobileExpanded === i && \"rotate-180\",\n )}\n />\n </button>\n <div\n className={cn(\n \"grid transition-[grid-template-rows,opacity] duration-200\",\n mobileExpanded === i\n ? \"grid-rows-[1fr] opacity-100\"\n : \"grid-rows-[0fr] opacity-0\",\n )}\n >\n <div className=\"min-h-0 overflow-hidden\">\n <div className=\"py-2 pl-1\">\n {renderColumns(item)}\n {item.featured ? (\n <div className=\"max-w-sm\">{renderFeatured(item, true)}</div>\n ) : null}\n </div>\n </div>\n </div>\n </li>\n ) : (\n <li key={item.label} className=\"px-5\">\n <Link\n href={item.href ?? \"#\"}\n onClick={() => setMobileOpen(false)}\n className={cn(\n \"block rounded-md px-2 py-2.5 text-sm font-medium transition-colors duration-150\",\n s.mobileLink,\n )}\n >\n {item.label}\n </Link>\n </li>\n ),\n )}\n {cta ? (\n <li className=\"px-8 pb-2 pt-3\">{cta}</li>\n ) : actions ? (\n <li className=\"mt-3 flex flex-wrap gap-3 px-8 pb-2\">{actions}</li>\n ) : null}\n </ul>\n </div>\n </div>\n </header>\n );\n};\nMegaMenu.displayName = \"MegaMenu\";"],"names":["inverse","light","styles","MegaMenu","className","variant","brand","logo","logoSrc","logoAlt","logoClassName","brandHref","items","actions","cta","languageSwitcher","sticky","LinkComponent","onKeyDown","props","ids","useId","Link","openIndex","setOpenIndex","useState","mobileOpen","setMobileOpen","mobileExpanded","setMobileExpanded","s","closePanels","closeAll","panelId","i","logoNode","jsx","cn","brandNode","jsxs","triggerClasses","renderColumns","item","column","ci","link","renderFeatured","mobile","featured","featuredStyle","getContrastText","handleKeyDown","event","hasPanel","_a","open","ChevronDown","o","X","Menu","prev"],"mappings":"2OAyBMA,EAAU,oBACVC,EAAQ,kBAERC,EAAiD,CACrD,QAAS,CACP,MAAO,uGACP,IAAK,iCACL,OAAQ,OACR,QAAS,+DACT,YAAa,6BACb,MAAO,+BACP,MAAO,yCACP,YAAa,2BACb,WAAY,0BACZ,gBAAiB,wBACjB,YAAa,uCACb,aAAc,GAAGD,CAAK,oBACtB,WAAY,+DACZ,UAAWA,EACX,SAAU,eAAA,EAEZ,SAAU,CACR,MAAO,OACP,IAAK,kJACL,OAAQ,eACR,QAAS,+DACT,YAAa,6BACb,MAAO,+BACP,MAAO,yCACP,YAAa,2BACb,WAAY,0BACZ,gBAAiB,wBACjB,YAAa,mFACb,aAAc,GAAGA,CAAK,oBACtB,WAAY,+DACZ,UAAWA,EACX,SAAU,eAAA,EAEZ,QAAS,CACP,MAAO,4DACP,IAAK,iCACL,OAAQ,OACR,QAAS,iEACT,YAAa,gCACb,MAAO,gCACP,MAAO,+BACP,YAAa,uBACb,WAAY,oBACZ,gBAAiB,uBACjB,YAAa,wCACb,aAAc,GAAGD,CAAO,qBACxB,WAAY,iEACZ,UAAWA,EACX,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AAA,IAAC,MAAA,CACC,UAAWC,EAAAA,GACT,4DACAT,IAAmBM,EACf,8BACA,2BAAA,EAGN,eAAC,MAAA,CAAI,UAAU,0BACb,SAAAK,EAAAA,KAAC,MAAA,CAAI,UAAU,YACZ,SAAA,CAAAE,EAAcC,CAAI,EAClBA,EAAK,SACJN,MAAC,MAAA,CAAI,UAAU,WAAY,SAAAU,EAAeJ,EAAM,EAAI,CAAA,CAAE,EACpD,IAAA,CAAA,CACN,CAAA,CACF,CAAA,CAAA,CACF,GA3COA,EAAK,KA4Cd,EAEAN,EAAAA,IAAC,KAAA,CAAoB,UAAU,OAC7B,SAAAA,EAAAA,IAACd,EAAA,CACC,KAAMoB,EAAK,MAAQ,IACnB,QAAS,IAAMf,EAAc,EAAK,EAClC,UAAWU,EAAAA,GACT,kFACAP,EAAE,UAAA,EAGH,SAAAY,EAAK,KAAA,CAAA,CACR,EAVOA,EAAK,KAWd,EAAA,EAGH5B,EACCsB,EAAAA,IAAC,KAAA,CAAG,UAAU,iBAAkB,SAAAtB,CAAA,CAAI,EAClCD,EACFuB,EAAAA,IAAC,KAAA,CAAG,UAAU,sCAAuC,WAAQ,EAC3D,IAAA,CAAA,CACN,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAGN,EACAjC,EAAS,YAAc"}
|
|
1
|
+
{"version":3,"file":"MegaMenu.cjs","sources":["../../../../src/components/MegaMenu/MegaMenu.tsx"],"sourcesContent":["\"use client\";\nimport { useId, useState } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { getContrastText } from \"../../utils/contrast\";\nimport { ChevronDown, Menu, X } from \"../../icons\";\nimport type { MegaMenuProps, MegaMenuVariant, MegaMenuItem } from \"./types\";\n\ninterface MegaMenuStyle {\n shell: string;\n bar: string;\n header: string;\n trigger: string;\n triggerOpen: string;\n badge: string;\n panel: string;\n columnTitle: string;\n columnLink: string;\n linkDescription: string;\n mobilePanel: string;\n mobileButton: string;\n mobileLink: string;\n brandText: string;\n brandDot: string;\n}\n\nconst inverse = \"text-on-secondary\";\nconst light = \"text-foreground\";\n\nconst styles: Record<MegaMenuVariant, MegaMenuStyle> = {\n classic: {\n shell: \"border-b border-border bg-background/85 backdrop-blur-md supports-[backdrop-filter]:bg-background/75\",\n bar: \"mx-auto max-w-6xl px-5 sm:px-8\",\n header: \"px-0\",\n trigger: \"text-muted-foreground hover:text-foreground hover:bg-surface\",\n triggerOpen: \"bg-surface text-foreground\",\n badge: \"bg-primary-soft text-primary\",\n panel: \"border-border bg-surface shadow-raised\",\n columnTitle: \"text-muted-foreground/70\",\n columnLink: \"hover:bg-surface-strong\",\n linkDescription: \"text-muted-foreground\",\n mobilePanel: \"border-t border-border bg-background\",\n mobileButton: `${light} hover:bg-surface`,\n mobileLink: \"text-muted-foreground hover:bg-surface hover:text-foreground\",\n brandText: light,\n brandDot: \"bg-foreground\",\n },\n floating: {\n shell: \"px-0\",\n bar: \"mx-auto mt-3 max-w-5xl rounded-xl border border-border bg-surface/90 px-5 shadow-soft backdrop-blur-md supports-[backdrop-filter]:bg-surface/70\",\n header: \"px-3 sm:px-6\",\n trigger: \"text-muted-foreground hover:text-foreground hover:bg-surface\",\n triggerOpen: \"bg-surface text-foreground\",\n badge: \"bg-primary-soft text-primary\",\n panel: \"border-border bg-surface shadow-raised\",\n columnTitle: \"text-muted-foreground/70\",\n columnLink: \"hover:bg-surface-strong\",\n linkDescription: \"text-muted-foreground\",\n mobilePanel: \"mx-3 mb-3 max-w-5xl overflow-hidden rounded-b-xl border border-border bg-surface\",\n mobileButton: `${light} hover:bg-surface`,\n mobileLink: \"text-muted-foreground hover:bg-surface hover:text-foreground\",\n brandText: light,\n brandDot: \"bg-foreground\",\n },\n inverse: {\n shell: \"border-b border-white/10 bg-[#101010]/85 backdrop-blur-md\",\n bar: \"mx-auto max-w-6xl px-5 sm:px-8\",\n header: \"px-0\",\n trigger: \"text-on-secondary/60 hover:text-on-secondary hover:bg-white/10\",\n triggerOpen: \"bg-white/10 text-on-secondary\",\n badge: \"bg-white/15 text-on-secondary\",\n panel: \"border-white/10 bg-[#161616]\",\n columnTitle: \"text-on-secondary/45\",\n columnLink: \"hover:bg-white/10\",\n linkDescription: \"text-on-secondary/50\",\n mobilePanel: \"border-t border-white/10 bg-[#101010]\",\n mobileButton: `${inverse} hover:bg-white/10`,\n mobileLink: \"text-on-secondary/70 hover:bg-white/10 hover:text-on-secondary\",\n brandText: inverse,\n brandDot: \"bg-on-secondary\",\n },\n};\n\nexport const MegaMenu = ({\n className,\n variant = \"classic\",\n brand,\n logo,\n logoSrc,\n logoAlt,\n logoClassName,\n brandHref = \"#\",\n items,\n actions,\n cta,\n languageSwitcher,\n sticky = true,\n LinkComponent,\n onKeyDown,\n ...props\n}: MegaMenuProps) => {\n const ids = useId();\n const Link = LinkComponent ?? \"a\";\n const [openIndex, setOpenIndex] = useState<number | null>(null);\n const [mobileOpen, setMobileOpen] = useState(false);\n const [mobileExpanded, setMobileExpanded] = useState<number | null>(null);\n const s = styles[variant];\n\n const closePanels = () => setOpenIndex(null);\n const closeAll = () => {\n setOpenIndex(null);\n setMobileOpen(false);\n setMobileExpanded(null);\n };\n\n const panelId = (i: number) => `${ids}-panel-${i}`;\n\n const logoNode =\n logo ??\n (logoSrc ? (\n <img\n src={logoSrc}\n alt={logoAlt ?? (typeof brand === \"string\" ? brand : \"Logo\")}\n className={cn(\"h-7 w-auto\", logoClassName)}\n />\n ) : null);\n\n const brandNode = logoNode ? (\n <span className=\"flex items-center\">{logoNode}</span>\n ) : (\n <span className={cn(\"flex items-center gap-2 font-display text-[17px] font-bold tracking-tight\", s.brandText)}>\n <span aria-hidden className={cn(\"inline-block h-2.5 w-2.5 rounded-sm\", s.brandDot)} />\n {brand}\n </span>\n );\n\n const triggerClasses = cn(\n \"flex items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition-colors duration-150\",\n s.trigger,\n );\n\n const renderColumns = (item: MegaMenuItem) => (\n <div\n className={cn(\n \"grid gap-x-10 gap-y-8 sm:grid-cols-2\",\n item.featured ? \"\" : \"lg:grid-cols-3\",\n )}\n >\n {item.columns?.map((column, ci) => (\n <div key={column.title ?? ci}>\n {column.title ? (\n <h4\n className={cn(\n \"text-xs font-semibold uppercase tracking-[0.14em]\",\n s.columnTitle,\n )}\n >\n {column.title}\n </h4>\n ) : null}\n <ul className={cn(column.title && \"mt-3\", \"space-y-0.5\")}>\n {column.links.map((link) => (\n <li key={link.href}>\n <Link\n href={link.href}\n onClick={closeAll}\n className={cn(\n \"-mx-2 block rounded-md px-2 py-2 transition-colors duration-150\",\n s.columnLink,\n )}\n >\n <span className=\"block text-sm font-medium text-foreground\">\n {link.label}\n </span>\n {link.description ? (\n <span\n className={cn(\n \"mt-0.5 block text-[13px] leading-snug\",\n s.linkDescription,\n )}\n >\n {link.description}\n </span>\n ) : null}\n </Link>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n );\n\n const renderFeatured = (item: MegaMenuItem, mobile = false) => {\n const featured = item.featured;\n if (!featured) return null;\n const featuredStyle = featured.accent\n ? { backgroundColor: featured.accent, color: getContrastText(featured.accent) }\n : undefined;\n\n return (\n <Link\n href={featured.href}\n onClick={closeAll}\n className={cn(\n \"group relative block overflow-hidden rounded-lg p-6 transition-transform duration-150 hover:-translate-y-0.5\",\n mobile && \"mt-8\",\n !featured.accent && \"bg-primary text-on-primary\",\n )}\n style={featuredStyle}\n >\n <div className=\"flex h-full flex-col justify-between gap-4\">\n <div>\n <h4 className=\"font-display text-base font-semibold tracking-tight\">\n {featured.title}\n </h4>\n {featured.description ? (\n <p className=\"mt-1.5 text-[13px] leading-relaxed opacity-80\">\n {featured.description}\n </p>\n ) : null}\n </div>\n {featured.cta ? (\n <span className=\"text-sm font-semibold underline decoration-1 underline-offset-4\">\n {featured.cta} →\n </span>\n ) : null}\n </div>\n <div\n aria-hidden\n className=\"pointer-events-none absolute -right-8 -top-8 h-28 w-28 rounded-full opacity-20 blur-2xl bg-black/40\"\n />\n </Link>\n );\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n if (event.key === \"Escape\") {\n closeAll();\n }\n onKeyDown?.(event);\n };\n\n return (\n <header\n className={cn(\n \"relative w-full transition-colors duration-200\",\n sticky && \"sticky top-0 z-50\",\n s.shell,\n s.header,\n className,\n )}\n onKeyDown={handleKeyDown}\n {...props}\n >\n <nav className={cn(\"relative flex h-16 w-full items-center justify-between gap-4 transition-colors duration-200\", s.bar)} onMouseLeave={closePanels} aria-label=\"Mega menu\">\n <Link href={brandHref} className=\"shrink-0\">\n {brandNode}\n </Link>\n\n <ul className=\"hidden items-center gap-1 lg:flex\">\n {items.map((item, i) => {\n const hasPanel = Boolean(item.columns?.length || item.featured);\n const open = openIndex === i;\n return (\n <li key={item.label} className=\"relative\">\n {hasPanel ? (\n <button\n type=\"button\"\n aria-haspopup=\"true\"\n aria-expanded={open}\n aria-controls={panelId(i)}\n onClick={() => setOpenIndex(open ? null : i)}\n onMouseEnter={() => setOpenIndex(i)}\n className={cn(triggerClasses, open && s.triggerOpen)}\n >\n <span className=\"flex items-center gap-1.5\">\n {item.label}\n {item.badge ? (\n <span\n className={cn(\n \"rounded-full px-1.5 py-0.5 text-[10px] font-semibold tracking-wide\",\n s.badge,\n )}\n >\n {item.badge}\n </span>\n ) : null}\n </span>\n <ChevronDown\n className={cn(\n \"h-4 w-4 shrink-0 transition-transform duration-150\",\n open && \"rotate-180\",\n )}\n />\n </button>\n ) : (\n <Link href={item.href ?? \"#\"} className={triggerClasses}>\n {item.label}\n {item.badge ? (\n <span className={cn(\"rounded-full px-1.5 py-0.5 text-[10px] font-semibold tracking-wide\", s.badge)}>\n {item.badge}\n </span>\n ) : null}\n </Link>\n )}\n </li>\n );\n })}\n </ul>\n\n <div className=\"hidden items-center gap-3 lg:flex\">\n {languageSwitcher}\n {actions}\n {cta}\n </div>\n\n <button\n type=\"button\"\n aria-label={mobileOpen ? \"Close menu\" : \"Open menu\"}\n aria-expanded={mobileOpen}\n onClick={() => setMobileOpen((o) => !o)}\n className={cn(\n \"inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-md lg:hidden\",\n \"transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n s.mobileButton,\n )}\n >\n {mobileOpen ? <X className=\"h-5 w-5\" /> : <Menu className=\"h-5 w-5\" />}\n </button>\n </nav>\n\n {items.map((item, i) => {\n if (!item.columns?.length && !item.featured) return null;\n const open = openIndex === i;\n return (\n <div\n key={item.label}\n id={panelId(i)}\n role=\"region\"\n aria-label={`${item.label} menu`}\n onMouseEnter={() => setOpenIndex(i)}\n className={cn(\n \"absolute top-full z-50 pt-2 transition-all duration-150\",\n variant === \"floating\" ? \"inset-x-0 mx-auto w-full max-w-5xl\" : \"inset-x-0\",\n open\n ? \"visible translate-y-0 opacity-100\"\n : \"pointer-events-none invisible -translate-y-1 opacity-0\",\n )}\n >\n <div\n className={cn(\n \"overflow-hidden rounded-xl border p-6 md:p-8\",\n s.panel,\n item.featured ? \"lg:grid lg:grid-cols-[minmax(0,1fr)_auto] lg:gap-12\" : \"\",\n )}\n >\n {renderColumns(item)}\n {item.featured && (\n <div className={cn(\"mt-8 max-w-sm lg:mt-0 lg:w-64\")}>\n {renderFeatured(item)}\n </div>\n )}\n </div>\n </div>\n );\n })}\n\n <div\n className={cn(\n \"grid transition-[grid-template-rows,opacity] duration-200 lg:hidden\",\n mobileOpen ? \"grid-rows-[1fr] opacity-100\" : \"grid-rows-[0fr] opacity-0\",\n s.mobilePanel,\n )}\n >\n <div className=\"min-h-0 overflow-hidden\">\n <ul className=\"flex flex-col py-4\">\n {languageSwitcher ? (\n <li className=\"px-5 pb-4\">{languageSwitcher}</li>\n ) : null}\n {items.map((item, i) =>\n item.columns?.length || item.featured ? (\n <li key={item.label} className=\"px-5\">\n <button\n type=\"button\"\n aria-expanded={mobileExpanded === i}\n onClick={() =>\n setMobileExpanded((prev) => (prev === i ? null : i))\n }\n className={cn(\n \"flex w-full items-center justify-between rounded-md px-2 py-2.5 text-sm font-medium transition-colors duration-150\",\n s.mobileButton,\n )}\n >\n <span className=\"flex items-center gap-2\">\n {item.label}\n {item.badge ? (\n <span className={cn(\"rounded-full px-1.5 py-0.5 text-[10px] font-semibold tracking-wide\", s.badge)}>\n {item.badge}\n </span>\n ) : null}\n </span>\n <ChevronDown\n className={cn(\n \"h-4 w-4 shrink-0 transition-transform duration-150\",\n mobileExpanded === i && \"rotate-180\",\n )}\n />\n </button>\n <div\n className={cn(\n \"grid transition-[grid-template-rows,opacity] duration-200\",\n mobileExpanded === i\n ? \"grid-rows-[1fr] opacity-100\"\n : \"grid-rows-[0fr] opacity-0\",\n )}\n >\n <div className=\"min-h-0 overflow-hidden\">\n <div className=\"py-2 pl-1\">\n {renderColumns(item)}\n {item.featured ? (\n <div className=\"max-w-sm\">{renderFeatured(item, true)}</div>\n ) : null}\n </div>\n </div>\n </div>\n </li>\n ) : (\n <li key={item.label} className=\"px-5\">\n <Link\n href={item.href ?? \"#\"}\n onClick={() => setMobileOpen(false)}\n className={cn(\n \"block rounded-md px-2 py-2.5 text-sm font-medium transition-colors duration-150\",\n s.mobileLink,\n )}\n >\n {item.label}\n </Link>\n </li>\n ),\n )}\n {cta ? (\n <li className=\"px-8 pb-2 pt-3\">{cta}</li>\n ) : actions ? (\n <li className=\"mt-3 flex flex-wrap gap-3 px-8 pb-2\">{actions}</li>\n ) : null}\n </ul>\n </div>\n </div>\n </header>\n );\n};\nMegaMenu.displayName = \"MegaMenu\";"],"names":["inverse","light","styles","MegaMenu","className","variant","brand","logo","logoSrc","logoAlt","logoClassName","brandHref","items","actions","cta","languageSwitcher","sticky","LinkComponent","onKeyDown","props","ids","useId","Link","openIndex","setOpenIndex","useState","mobileOpen","setMobileOpen","mobileExpanded","setMobileExpanded","s","closePanels","closeAll","panelId","i","logoNode","jsx","cn","brandNode","jsxs","triggerClasses","renderColumns","item","column","ci","link","renderFeatured","mobile","featured","featuredStyle","getContrastText","handleKeyDown","event","hasPanel","_a","open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AAA,EAGH,SAAAY,EAAK,KAAA,CAAA,CACR,EAVOA,EAAK,KAWd,EAAA,EAGH5B,EACCsB,EAAAA,IAAC,KAAA,CAAG,UAAU,iBAAkB,SAAAtB,CAAA,CAAI,EAClCD,EACFuB,EAAAA,IAAC,KAAA,CAAG,UAAU,sCAAuC,WAAQ,EAC3D,IAAA,CAAA,CACN,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAGN,EACAjC,EAAS,YAAc"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),q=require("react"),o=require("../../utils/cn.cjs"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),q=require("react"),o=require("../../utils/cn.cjs"),p=require("../../icons.cjs"),f="text-on-secondary",t="text-foreground",B={classic:{shell:"border-b border-border bg-background/85 backdrop-blur-md supports-[backdrop-filter]:bg-background/75",bar:"mx-auto max-w-6xl px-5 sm:px-8",header:"px-0",link:"text-muted-foreground hover:text-foreground",mobilePanel:"border-t border-border bg-background",mobileLink:"text-muted-foreground hover:bg-surface hover:text-foreground",menuButton:`${t} hover:bg-surface`,brandText:t,brandDot:"bg-foreground",desktopList:"hidden items-center gap-7 md:flex"},floating:{shell:"px-0",bar:"mx-auto mt-3 max-w-5xl rounded-xl border border-border bg-surface/90 px-5 shadow-soft backdrop-blur-md supports-[backdrop-filter]:bg-surface/70",header:"px-3 sm:px-6",link:"text-muted-foreground hover:text-foreground",mobilePanel:"mx-3 mb-3 max-w-5xl overflow-hidden rounded-b-xl border border-border bg-surface",mobileLink:"text-muted-foreground hover:bg-surface hover:text-foreground",menuButton:`${t} hover:bg-surface`,brandText:t,brandDot:"bg-foreground",desktopList:"hidden items-center gap-7 md:flex"},inverse:{shell:"border-b border-white/10 bg-[#101010]/85 backdrop-blur-md",bar:"mx-auto max-w-6xl px-5 sm:px-8",header:"px-0",link:"text-on-secondary/60 hover:text-on-secondary",mobilePanel:"border-t border-white/10 bg-[#101010]",mobileLink:"text-on-secondary/70 hover:bg-white/10 hover:text-on-secondary",menuButton:`${f} hover:bg-white/10`,brandText:f,brandDot:"bg-on-secondary",desktopList:"hidden items-center gap-7 md:flex"}},g=({className:v,variant:b="classic",brand:a,logo:j,logoSrc:m,logoAlt:N,logoClassName:k,brandHref:w="#",links:x,actions:d,cta:i,languageSwitcher:l,sticky:y=!0,LinkComponent:L,...P})=>{const[s,u]=q.useState(!1),c=L??"a",r=B[b],h=j??(m?e.jsx("img",{src:m,alt:N??(typeof a=="string"?a:"Logo"),className:o.cn("h-7 w-auto",k)}):null),T=h?e.jsx("span",{className:"flex items-center",children:h}):e.jsxs("span",{className:o.cn("flex items-center gap-2 font-display text-[17px] font-bold tracking-tight",r.brandText),children:[e.jsx("span",{"aria-hidden":!0,className:o.cn("inline-block h-2.5 w-2.5 rounded-sm",r.brandDot)}),a]});return e.jsxs("header",{className:o.cn("w-full transition-colors duration-200",y&&"sticky top-0 z-50",r.shell,r.header,v),...P,children:[e.jsxs("nav",{className:o.cn("flex h-16 w-full items-center justify-between gap-4 transition-colors duration-200",r.bar),"aria-label":"Main navigation",children:[e.jsx(c,{href:w,className:"shrink-0",children:T}),e.jsx("ul",{className:r.desktopList,children:x.map(n=>e.jsx("li",{children:e.jsx(c,{href:n.href,className:o.cn("text-sm font-medium transition-colors duration-150",r.link),children:n.label})},n.href))}),e.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[l,d,i]}),e.jsx("button",{type:"button","aria-label":s?"Close menu":"Open menu","aria-expanded":s,onClick:()=>u(n=>!n),className:o.cn("inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-md md:hidden","transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",r.menuButton),children:s?e.jsx(p.X,{className:"h-5 w-5"}):e.jsx(p.Menu,{className:"h-5 w-5"})})]}),e.jsx("div",{className:o.cn("grid transition-[grid-template-rows,opacity] duration-200 md:hidden",s?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0",r.mobilePanel),children:e.jsx("div",{className:"min-h-0 overflow-hidden",children:e.jsxs("ul",{className:o.cn("flex flex-col py-4",b!=="floating"&&"px-5"),children:[l?e.jsx("li",{className:"px-2 pb-4",children:l}):null,x.map(n=>e.jsx("li",{children:e.jsx(c,{href:n.href,onClick:()=>u(!1),className:o.cn("block rounded-md px-2 py-2.5 text-sm font-medium transition-colors duration-150",r.mobileLink),children:n.label})},n.href)),i?e.jsx("li",{className:"mt-3 px-2 pb-2",children:i}):d?e.jsx("li",{className:"mt-3 flex flex-wrap gap-3 px-2 pb-2",children:d}):null]})})})]})};g.displayName="Navbar";exports.Navbar=g;
|
|
3
3
|
//# sourceMappingURL=Navbar.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navbar.cjs","sources":["../../../../src/components/Navbar/Navbar.tsx"],"sourcesContent":["\"use client\";\nimport { useState } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Menu, X } from \"../../icons\";\nimport type { NavbarProps, NavbarVariant } from \"./types\";\n\ninterface NavbarStyle {\n shell: string;\n bar: string;\n header: string;\n link: string;\n mobilePanel: string;\n mobileLink: string;\n menuButton: string;\n brandText: string;\n brandDot: string;\n desktopList: string;\n}\n\nconst inverse = \"text-on-secondary\";\nconst light = \"text-foreground\";\n\nconst styles: Record<NavbarVariant, NavbarStyle> = {\n classic: {\n shell: \"border-b border-border bg-background/85 backdrop-blur-md supports-[backdrop-filter]:bg-background/75\",\n bar: \"mx-auto max-w-6xl px-5 sm:px-8\",\n header: \"px-0\",\n link: \"text-muted-foreground hover:text-foreground\",\n mobilePanel: \"border-t border-border bg-background\",\n mobileLink:\n \"text-muted-foreground hover:bg-surface hover:text-foreground\",\n menuButton: `${light} hover:bg-surface`,\n brandText: light,\n brandDot: \"bg-foreground\",\n desktopList: \"hidden items-center gap-7 md:flex\",\n },\n floating: {\n shell: \"px-0\",\n bar: \"mx-auto mt-3 max-w-5xl rounded-xl border border-border bg-surface/90 px-5 shadow-soft backdrop-blur-md supports-[backdrop-filter]:bg-surface/70\",\n header: \"px-3 sm:px-6\",\n link: \"text-muted-foreground hover:text-foreground\",\n mobilePanel:\n \"mx-3 mb-3 max-w-5xl overflow-hidden rounded-b-xl border border-border bg-surface\",\n mobileLink:\n \"text-muted-foreground hover:bg-surface hover:text-foreground\",\n menuButton: `${light} hover:bg-surface`,\n brandText: light,\n brandDot: \"bg-foreground\",\n desktopList: \"hidden items-center gap-7 md:flex\",\n },\n inverse: {\n shell: \"border-b border-white/10 bg-[#101010]/85 backdrop-blur-md\",\n bar: \"mx-auto max-w-6xl px-5 sm:px-8\",\n header: \"px-0\",\n link: \"text-on-secondary/60 hover:text-on-secondary\",\n mobilePanel: \"border-t border-white/10 bg-[#101010]\",\n mobileLink:\n \"text-on-secondary/70 hover:bg-white/10 hover:text-on-secondary\",\n menuButton: `${inverse} hover:bg-white/10`,\n brandText: inverse,\n brandDot: \"bg-on-secondary\",\n desktopList: \"hidden items-center gap-7 md:flex\",\n },\n};\n\nexport const Navbar = ({\n className,\n variant = \"classic\",\n brand,\n logo,\n logoSrc,\n logoAlt,\n logoClassName,\n brandHref = \"#\",\n links,\n actions,\n cta,\n languageSwitcher,\n sticky = true,\n LinkComponent,\n ...props\n}: NavbarProps) => {\n const [open, setOpen] = useState(false);\n const Link = LinkComponent ?? \"a\";\n const s = styles[variant];\n\n const logoNode =\n logo ??\n (logoSrc ? (\n <img\n src={logoSrc}\n alt={logoAlt ?? (typeof brand === \"string\" ? brand : \"Logo\")}\n className={cn(\"h-7 w-auto\", logoClassName)}\n />\n ) : null);\n\n const brandNode = logoNode ? (\n <span className=\"flex items-center\">{logoNode}</span>\n ) : (\n <span className={cn(\"flex items-center gap-2 font-display text-[17px] font-bold tracking-tight\", s.brandText)}>\n <span aria-hidden className={cn(\"inline-block h-2.5 w-2.5 rounded-sm\", s.brandDot)} />\n {brand}\n </span>\n );\n\n return (\n <header className={cn(\"w-full transition-colors duration-200\", sticky && \"sticky top-0 z-50\", s.shell, s.header, className)} {...props}>\n <nav className={cn(\"flex h-16 w-full items-center justify-between gap-4 transition-colors duration-200\", s.bar)} aria-label=\"Main navigation\">\n <Link href={brandHref} className=\"shrink-0\">\n {brandNode}\n </Link>\n\n <ul className={s.desktopList}>\n {links.map((link) => (\n <li key={link.href}>\n <Link\n href={link.href}\n className={cn(\"text-sm font-medium transition-colors duration-150\", s.link)}\n >\n {link.label}\n </Link>\n </li>\n ))}\n </ul>\n\n <div className=\"hidden items-center gap-3 md:flex\">\n {languageSwitcher}\n {actions}\n {cta}\n </div>\n\n
|
|
1
|
+
{"version":3,"file":"Navbar.cjs","sources":["../../../../src/components/Navbar/Navbar.tsx"],"sourcesContent":["\"use client\";\nimport { useState } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Menu, X } from \"../../icons\";\nimport type { NavbarProps, NavbarVariant } from \"./types\";\n\ninterface NavbarStyle {\n shell: string;\n bar: string;\n header: string;\n link: string;\n mobilePanel: string;\n mobileLink: string;\n menuButton: string;\n brandText: string;\n brandDot: string;\n desktopList: string;\n}\n\nconst inverse = \"text-on-secondary\";\nconst light = \"text-foreground\";\n\nconst styles: Record<NavbarVariant, NavbarStyle> = {\n classic: {\n shell: \"border-b border-border bg-background/85 backdrop-blur-md supports-[backdrop-filter]:bg-background/75\",\n bar: \"mx-auto max-w-6xl px-5 sm:px-8\",\n header: \"px-0\",\n link: \"text-muted-foreground hover:text-foreground\",\n mobilePanel: \"border-t border-border bg-background\",\n mobileLink:\n \"text-muted-foreground hover:bg-surface hover:text-foreground\",\n menuButton: `${light} hover:bg-surface`,\n brandText: light,\n brandDot: \"bg-foreground\",\n desktopList: \"hidden items-center gap-7 md:flex\",\n },\n floating: {\n shell: \"px-0\",\n bar: \"mx-auto mt-3 max-w-5xl rounded-xl border border-border bg-surface/90 px-5 shadow-soft backdrop-blur-md supports-[backdrop-filter]:bg-surface/70\",\n header: \"px-3 sm:px-6\",\n link: \"text-muted-foreground hover:text-foreground\",\n mobilePanel:\n \"mx-3 mb-3 max-w-5xl overflow-hidden rounded-b-xl border border-border bg-surface\",\n mobileLink:\n \"text-muted-foreground hover:bg-surface hover:text-foreground\",\n menuButton: `${light} hover:bg-surface`,\n brandText: light,\n brandDot: \"bg-foreground\",\n desktopList: \"hidden items-center gap-7 md:flex\",\n },\n inverse: {\n shell: \"border-b border-white/10 bg-[#101010]/85 backdrop-blur-md\",\n bar: \"mx-auto max-w-6xl px-5 sm:px-8\",\n header: \"px-0\",\n link: \"text-on-secondary/60 hover:text-on-secondary\",\n mobilePanel: \"border-t border-white/10 bg-[#101010]\",\n mobileLink:\n \"text-on-secondary/70 hover:bg-white/10 hover:text-on-secondary\",\n menuButton: `${inverse} hover:bg-white/10`,\n brandText: inverse,\n brandDot: \"bg-on-secondary\",\n desktopList: \"hidden items-center gap-7 md:flex\",\n },\n};\n\nexport const Navbar = ({\n className,\n variant = \"classic\",\n brand,\n logo,\n logoSrc,\n logoAlt,\n logoClassName,\n brandHref = \"#\",\n links,\n actions,\n cta,\n languageSwitcher,\n sticky = true,\n LinkComponent,\n ...props\n}: NavbarProps) => {\n const [open, setOpen] = useState(false);\n const Link = LinkComponent ?? \"a\";\n const s = styles[variant];\n\n const logoNode =\n logo ??\n (logoSrc ? (\n <img\n src={logoSrc}\n alt={logoAlt ?? (typeof brand === \"string\" ? brand : \"Logo\")}\n className={cn(\"h-7 w-auto\", logoClassName)}\n />\n ) : null);\n\n const brandNode = logoNode ? (\n <span className=\"flex items-center\">{logoNode}</span>\n ) : (\n <span className={cn(\"flex items-center gap-2 font-display text-[17px] font-bold tracking-tight\", s.brandText)}>\n <span aria-hidden className={cn(\"inline-block h-2.5 w-2.5 rounded-sm\", s.brandDot)} />\n {brand}\n </span>\n );\n\n return (\n <header className={cn(\"w-full transition-colors duration-200\", sticky && \"sticky top-0 z-50\", s.shell, s.header, className)} {...props}>\n <nav className={cn(\"flex h-16 w-full items-center justify-between gap-4 transition-colors duration-200\", s.bar)} aria-label=\"Main navigation\">\n <Link href={brandHref} className=\"shrink-0\">\n {brandNode}\n </Link>\n\n <ul className={s.desktopList}>\n {links.map((link) => (\n <li key={link.href}>\n <Link\n href={link.href}\n className={cn(\"text-sm font-medium transition-colors duration-150\", s.link)}\n >\n {link.label}\n </Link>\n </li>\n ))}\n </ul>\n\n <div className=\"hidden items-center gap-3 md:flex\">\n {languageSwitcher}\n {actions}\n {cta}\n </div>\n\n <button\n type=\"button\"\n aria-label={open ? \"Close menu\" : \"Open menu\"}\n aria-expanded={open}\n onClick={() => setOpen((o) => !o)}\n className={cn(\n \"inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-md md:hidden\",\n \"transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n s.menuButton,\n )}\n >\n {open ? <X className=\"h-5 w-5\" /> : <Menu className=\"h-5 w-5\" />}\n </button>\n </nav>\n\n <div\n className={cn(\n \"grid transition-[grid-template-rows,opacity] duration-200 md:hidden\",\n open ? \"grid-rows-[1fr] opacity-100\" : \"grid-rows-[0fr] opacity-0\",\n s.mobilePanel,\n )}\n >\n <div className=\"min-h-0 overflow-hidden\">\n <ul className={cn(\"flex flex-col py-4\", variant !== \"floating\" && \"px-5\")}>\n {languageSwitcher ? (\n <li className=\"px-2 pb-4\">{languageSwitcher}</li>\n ) : null}\n {links.map((link) => (\n <li key={link.href}>\n <Link\n href={link.href}\n onClick={() => setOpen(false)}\n className={cn(\n \"block rounded-md px-2 py-2.5 text-sm font-medium transition-colors duration-150\",\n s.mobileLink,\n )}\n >\n {link.label}\n </Link>\n </li>\n ))}\n {cta ? (\n <li className=\"mt-3 px-2 pb-2\">{cta}</li>\n ) : actions ? (\n <li className=\"mt-3 flex flex-wrap gap-3 px-2 pb-2\">{actions}</li>\n ) : null}\n </ul>\n </div>\n </div>\n </header>\n );\n};\nNavbar.displayName = \"Navbar\";"],"names":["inverse","light","styles","Navbar","className","variant","brand","logo","logoSrc","logoAlt","logoClassName","brandHref","links","actions","cta","languageSwitcher","sticky","LinkComponent","props","open","setOpen","useState","Link","s","logoNode","jsx","cn","brandNode","jsxs","link","o","X","Menu"],"mappings":"qMAmBMA,EAAU,oBACVC,EAAQ,kBAERC,EAA6C,CACjD,QAAS,CACP,MAAO,uGACP,IAAK,iCACL,OAAQ,OACR,KAAM,8CACN,YAAa,uCACb,WACE,+DACF,WAAY,GAAGD,CAAK,oBACpB,UAAWA,EACX,SAAU,gBACV,YAAa,mCAAA,EAEf,SAAU,CACR,MAAO,OACP,IAAK,kJACL,OAAQ,eACR,KAAM,8CACN,YACE,mFACF,WACE,+DACF,WAAY,GAAGA,CAAK,oBACpB,UAAWA,EACX,SAAU,gBACV,YAAa,mCAAA,EAEf,QAAS,CACP,MAAO,4DACP,IAAK,iCACL,OAAQ,OACR,KAAM,+CACN,YAAa,wCACb,WACE,iEACF,WAAY,GAAGD,CAAO,qBACtB,UAAWA,EACX,SAAU,kBACV,YAAa,mCAAA,CAEjB,EAEaG,EAAS,CAAC,CACrB,UAAAC,EACA,QAAAC,EAAU,UACV,MAAAC,EACA,KAAAC,EACA,QAAAC,EACA,QAAAC,EACA,cAAAC,EACA,UAAAC,EAAY,IACZ,MAAAC,EACA,QAAAC,EACA,IAAAC,EACA,iBAAAC,EACA,OAAAC,EAAS,GACT,cAAAC,EACA,GAAGC,CACL,IAAmB,CACjB,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAS,EAAK,EAChCC,EAAOL,GAAiB,IACxBM,EAAIrB,EAAOG,CAAO,EAElBmB,EACJjB,IACCC,EACCiB,EAAAA,IAAC,MAAA,CACC,IAAKjB,EACL,IAAKC,IAAY,OAAOH,GAAU,SAAWA,EAAQ,QACrD,UAAWoB,EAAAA,GAAG,aAAchB,CAAa,CAAA,CAAA,EAEzC,MAEAiB,EAAYH,EA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ACT,sEACAP,EAAO,8BAAgC,4BACvCI,EAAE,WAAA,EAGJ,SAAAE,EAAAA,IAAC,MAAA,CAAI,UAAU,0BACb,SAAAG,OAAC,KAAA,CAAG,UAAWF,EAAAA,GAAG,qBAAsBrB,IAAY,YAAc,MAAM,EACrE,SAAA,CAAAU,EACCU,EAAAA,IAAC,KAAA,CAAG,UAAU,YAAa,WAAiB,EAC1C,KACHb,EAAM,IAAKiB,SACT,KAAA,CACC,SAAAJ,EAAAA,IAACH,EAAA,CACC,KAAMO,EAAK,KACX,QAAS,IAAMT,EAAQ,EAAK,EAC5B,UAAWM,EAAAA,GACT,kFACAH,EAAE,UAAA,EAGH,SAAAM,EAAK,KAAA,CAAA,GATDA,EAAK,IAWd,CACD,EACAf,EACCW,EAAAA,IAAC,KAAA,CAAG,UAAU,iBAAkB,SAAAX,CAAA,CAAI,EAClCD,EACFY,EAAAA,IAAC,KAAA,CAAG,UAAU,sCAAuC,WAAQ,EAC3D,IAAA,CAAA,CACN,CAAA,CACF,CAAA,CAAA,CACF,EACF,CAEJ,EACAtB,EAAO,YAAc"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./components/Button.cjs"),i=require("./components/Slot.cjs"),s=require("./components/Badge.cjs"),r=require("./components/Card.cjs"),o=require("./components/Section.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./components/Button.cjs"),i=require("./components/Slot.cjs"),s=require("./components/Badge.cjs"),r=require("./components/Card.cjs"),o=require("./components/Section.cjs"),c=require("./components/Modal.cjs"),t=require("./components/Prose.cjs"),a=require("./components/Container.cjs"),u=require("./utils/cn.cjs"),d=require("./utils/contrast.cjs"),l=require("./utils/useTokenForeground.cjs"),C=require("./utils/iso2Flag.cjs"),e=require("./icons.cjs"),g=require("./components/AccordionShowcase/AccordionShowcase.cjs"),S=require("./components/Blog/BlogCard.cjs"),q=require("./components/Blog/BlogSection.cjs"),h=require("./components/CTA/CTA.cjs"),w=require("./components/FAQ/FAQ.cjs"),F=require("./components/Features/FeatureCard.cjs"),T=require("./components/Features/FeatureGrid.cjs"),k=require("./components/FeatureShowcase/FeatureShowcase.cjs"),A=require("./components/Footer/Footer.cjs"),B=require("./components/Hero/Hero.cjs"),L=require("./components/LanguageSwitcher/LanguageSwitcher.cjs"),P=require("./components/LogoCloud/LogoCloud.cjs"),M=require("./components/MegaMenu/MegaMenu.cjs"),m=require("./components/Navbar/Navbar.cjs"),p=require("./components/Newsletter/Newsletter.cjs"),v=require("./components/Pricing/Pricing.cjs"),D=require("./components/Stats/Stats.cjs"),b=require("./components/Testimonials/TestimonialCard.cjs"),R=require("./components/Testimonials/Testimonials.cjs");exports.Button=n.Button;exports.Slot=i.Slot;exports.Badge=s.Badge;exports.Card=r.Card;exports.CardContent=r.CardContent;exports.CardDescription=r.CardDescription;exports.CardFooter=r.CardFooter;exports.CardHeader=r.CardHeader;exports.CardTitle=r.CardTitle;exports.Section=o.Section;exports.SectionHeader=o.SectionHeader;exports.Modal=c.Modal;exports.Prose=t.Prose;exports.ProseLead=t.ProseLead;exports.Container=a.Container;exports.Stack=a.Stack;exports.cn=u.cn;exports.getContrastText=d.getContrastText;exports.useTokenForeground=l.useTokenForeground;exports.iso2ToFlagEmoji=C.iso2ToFlagEmoji;exports.ArrowDown=e.ArrowDown;exports.ArrowRight=e.ArrowRight;exports.ArrowUp=e.ArrowUp;exports.ArrowUpRight=e.ArrowUpRight;exports.BarChart=e.BarChart;exports.Box=e.Box;exports.Check=e.Check;exports.ChevronDown=e.ChevronDown;exports.ChevronLeft=e.ChevronLeft;exports.ChevronRight=e.ChevronRight;exports.Clock=e.Clock;exports.Code=e.Code;exports.Cpu=e.Cpu;exports.Database=e.Database;exports.DollarSign=e.DollarSign;exports.ExternalLink=e.ExternalLink;exports.Gauge=e.Gauge;exports.Globe=e.Globe;exports.Layers=e.Layers;exports.Lock=e.Lock;exports.Mail=e.Mail;exports.Menu=e.Menu;exports.Palette=e.Palette;exports.Play=e.Play;exports.Plus=e.Plus;exports.Quote=e.Quote;exports.Rocket=e.Rocket;exports.Send=e.Send;exports.ShieldCheck=e.ShieldCheck;exports.Sliders=e.Sliders;exports.Smartphone=e.Smartphone;exports.Star=e.Star;exports.Terminal=e.Terminal;exports.Users=e.Users;exports.X=e.X;exports.Zap=e.Zap;exports.AccordionShowcase=g.AccordionShowcase;exports.BlogCard=S.BlogCard;exports.BlogSection=q.BlogSection;exports.CTA=h.CTA;exports.FAQ=w.FAQ;exports.FeatureCard=F.FeatureCard;exports.FeatureGrid=T.FeatureGrid;exports.FeatureShowcase=k.FeatureShowcase;exports.Footer=A.Footer;exports.Hero=B.Hero;exports.LanguageSwitcher=L.LanguageSwitcher;exports.LogoCloud=P.LogoCloud;exports.MegaMenu=M.MegaMenu;exports.Navbar=m.Navbar;exports.Newsletter=p.Newsletter;exports.Pricing=v.Pricing;exports.Stats=D.Stats;exports.TestimonialCard=b.TestimonialCard;exports.Testimonials=R.Testimonials;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useState as g } from "react";
|
|
4
|
+
import { cn as o } from "../../utils/cn.js";
|
|
5
|
+
import { ChevronDown as p } from "../../icons.js";
|
|
6
|
+
const f = ({
|
|
7
|
+
className: a,
|
|
8
|
+
items: n,
|
|
9
|
+
defaultActive: c = 0,
|
|
10
|
+
...d
|
|
11
|
+
}) => {
|
|
12
|
+
const [l, m] = g(c);
|
|
13
|
+
return /* @__PURE__ */ s("div", { className: o("grid w-full gap-x-16 gap-y-12 lg:grid-cols-2 lg:items-center lg:gap-y-0", a), ...d, children: [
|
|
14
|
+
/* @__PURE__ */ e("div", { className: "divide-y divide-border", children: n.map((t, i) => {
|
|
15
|
+
const r = i === l;
|
|
16
|
+
return /* @__PURE__ */ s("div", { children: [
|
|
17
|
+
/* @__PURE__ */ e("h3", { children: /* @__PURE__ */ s(
|
|
18
|
+
"button",
|
|
19
|
+
{
|
|
20
|
+
type: "button",
|
|
21
|
+
"aria-expanded": r,
|
|
22
|
+
onClick: () => m(i),
|
|
23
|
+
className: "group flex w-full cursor-pointer items-center justify-between gap-6 py-5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ e("span", { className: "font-display text-[1.375rem] font-semibold leading-tight tracking-tight text-foreground sm:text-[1.625rem]", children: t.title }),
|
|
26
|
+
/* @__PURE__ */ e(
|
|
27
|
+
p,
|
|
28
|
+
{
|
|
29
|
+
className: o(
|
|
30
|
+
"h-5 w-5 shrink-0 text-foreground/40 transition-transform duration-300 sm:h-6 sm:w-6",
|
|
31
|
+
r && "rotate-180 text-foreground"
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
) }),
|
|
38
|
+
r && t.description ? /* @__PURE__ */ e("div", { className: "pb-8 pr-10", children: /* @__PURE__ */ e("p", { className: "max-w-md text-pretty text-base leading-7 text-muted-foreground sm:text-lg", children: t.description }) }) : null
|
|
39
|
+
] }, t.title);
|
|
40
|
+
}) }),
|
|
41
|
+
/* @__PURE__ */ e("div", { className: "relative", children: n.map((t, i) => /* @__PURE__ */ e("div", { className: o(i === l ? "block" : "hidden"), children: t.visual }, t.title)) })
|
|
42
|
+
] });
|
|
43
|
+
};
|
|
44
|
+
f.displayName = "AccordionShowcase";
|
|
45
|
+
export {
|
|
46
|
+
f as AccordionShowcase
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=AccordionShowcase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionShowcase.js","sources":["../../../../src/components/AccordionShowcase/AccordionShowcase.tsx"],"sourcesContent":["\"use client\";\nimport { useState } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { ChevronDown } from \"../../icons\";\nimport type { AccordionShowcaseProps } from \"./types\";\n\nexport const AccordionShowcase = ({\n className,\n items,\n defaultActive = 0,\n ...props\n}: AccordionShowcaseProps) => {\n const [active, setActive] = useState(defaultActive);\n\n return (\n <div className={cn(\"grid w-full gap-x-16 gap-y-12 lg:grid-cols-2 lg:items-center lg:gap-y-0\", className)} {...props}>\n {/* Interactive list */}\n <div className=\"divide-y divide-border\">\n {items.map((item, index) => {\n const open = index === active;\n return (\n <div key={item.title}>\n <h3>\n <button\n type=\"button\"\n aria-expanded={open}\n onClick={() => setActive(index)}\n className=\"group flex w-full cursor-pointer items-center justify-between gap-6 py-5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n >\n <span className=\"font-display text-[1.375rem] font-semibold leading-tight tracking-tight text-foreground sm:text-[1.625rem]\">\n {item.title}\n </span>\n <ChevronDown\n className={cn(\n \"h-5 w-5 shrink-0 text-foreground/40 transition-transform duration-300 sm:h-6 sm:w-6\",\n open && \"rotate-180 text-foreground\",\n )}\n />\n </button>\n </h3>\n {open && item.description ? (\n <div className=\"pb-8 pr-10\">\n <p className=\"max-w-md text-pretty text-base leading-7 text-muted-foreground sm:text-lg\">\n {item.description}\n </p>\n </div>\n ) : null}\n </div>\n );\n })}\n </div>\n\n {/* Swapping visual */}\n <div className=\"relative\">\n {items.map((item, index) => (\n <div key={item.title} className={cn(index === active ? \"block\" : \"hidden\")}>\n {item.visual}\n </div>\n ))}\n </div>\n </div>\n );\n};\nAccordionShowcase.displayName = \"AccordionShowcase\";\n"],"names":["AccordionShowcase","className","items","defaultActive","props","active","setActive","useState","jsxs","cn","jsx","item","index","open","ChevronDown"],"mappings":";;;;AAMO,MAAMA,IAAoB,CAAC;AAAA,EAChC,WAAAC;AAAA,EACA,O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-0,0 +1,57 @@
|
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as s } from "../../utils/cn.js";
|
|
3
|
+
import { ArrowRight as x } from "../../icons.js";
|
|
4
|
+
const u = ({
|
|
5
|
+
className: d,
|
|
6
|
+
items: c,
|
|
7
|
+
visual: a,
|
|
8
|
+
mediaSide: m = "left",
|
|
9
|
+
eyebrow: t,
|
|
10
|
+
title: i,
|
|
11
|
+
description: n,
|
|
12
|
+
...f
|
|
13
|
+
}) => {
|
|
14
|
+
const o = m === "left";
|
|
15
|
+
return /* @__PURE__ */ l("div", { className: s("w-full", d), ...f, children: [
|
|
16
|
+
t || i || n ? /* @__PURE__ */ l("div", { className: "max-w-2xl", children: [
|
|
17
|
+
t ? /* @__PURE__ */ r("p", { className: "text-xs font-semibold uppercase tracking-[0.18em] text-primary", children: t }) : null,
|
|
18
|
+
i ? /* @__PURE__ */ r("h2", { className: "mt-4 font-display text-balance text-[1.9rem] font-semibold leading-[1.08] tracking-tight text-foreground sm:text-4xl", children: i }) : null,
|
|
19
|
+
n ? /* @__PURE__ */ r("p", { className: "mt-4 text-pretty text-base leading-7 text-muted-foreground sm:text-lg", children: n }) : null
|
|
20
|
+
] }) : null,
|
|
21
|
+
/* @__PURE__ */ l("div", { className: "mt-12 grid w-full items-center gap-10 lg:grid-cols-[1.05fr_0.95fr] lg:gap-20", children: [
|
|
22
|
+
a ? /* @__PURE__ */ r("div", { className: s("relative", o ? "lg:order-1" : "lg:order-2"), children: a }) : null,
|
|
23
|
+
/* @__PURE__ */ r(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: s(
|
|
27
|
+
"flex flex-col divide-y divide-border",
|
|
28
|
+
o ? "lg:order-2" : "lg:order-1"
|
|
29
|
+
),
|
|
30
|
+
children: c.map((e, g) => /* @__PURE__ */ l("div", { className: "flex gap-5 py-7 first:pt-0 last:pb-0 sm:gap-6", children: [
|
|
31
|
+
e.icon ? /* @__PURE__ */ r("div", { className: "inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-xl border border-border bg-surface text-lg text-foreground shadow-soft", children: e.icon }) : null,
|
|
32
|
+
/* @__PURE__ */ l("div", { children: [
|
|
33
|
+
/* @__PURE__ */ r("h3", { className: "font-display text-lg font-semibold tracking-tight text-foreground", children: e.title }),
|
|
34
|
+
e.description ? /* @__PURE__ */ r("p", { className: "mt-2 text-pretty text-sm leading-6 text-muted-foreground sm:text-[15px]", children: e.description }) : null,
|
|
35
|
+
e.link ? /* @__PURE__ */ r("div", { className: "mt-3", children: e.link }) : e.href ? /* @__PURE__ */ l(
|
|
36
|
+
"a",
|
|
37
|
+
{
|
|
38
|
+
href: e.href,
|
|
39
|
+
className: "group/link mt-3 inline-flex items-center gap-1.5 text-sm font-medium text-primary transition-colors hover:text-primary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
40
|
+
children: [
|
|
41
|
+
e.linkLabel ?? "Learn more",
|
|
42
|
+
/* @__PURE__ */ r(x, { className: "h-4 w-4 transition-transform duration-200 group-hover/link:translate-x-0.5" })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
) : null
|
|
46
|
+
] })
|
|
47
|
+
] }, g))
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] })
|
|
51
|
+
] });
|
|
52
|
+
};
|
|
53
|
+
u.displayName = "FeatureShowcase";
|
|
54
|
+
export {
|
|
55
|
+
u as FeatureShowcase
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=FeatureShowcase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureShowcase.js","sources":["../../../../src/components/FeatureShowcase/FeatureShowcase.tsx"],"sourcesContent":["import { cn } from \"../../utils/cn\";\nimport { ArrowRight } from \"../../icons\";\nimport type { FeatureShowcaseProps } from \"./types\";\n\nexport const FeatureShowcase = ({\n className,\n items,\n visual,\n mediaSide = \"left\",\n eyebrow,\n title,\n description,\n ...props\n}: FeatureShowcaseProps) => {\n const mediaLeft = mediaSide === \"left\";\n\n return (\n <div className={cn(\"w-full\", className)} {...props}>\n {eyebrow || title || description ? (\n <div className=\"max-w-2xl\">\n {eyebrow ? (\n <p className=\"text-xs font-semibold uppercase tracking-[0.18em] text-primary\">{eyebrow}</p>\n ) : null}\n {title ? (\n <h2 className=\"mt-4 font-display text-balance text-[1.9rem] font-semibold leading-[1.08] tracking-tight text-foreground sm:text-4xl\">\n {title}\n </h2>\n ) : null}\n {description ? (\n <p className=\"mt-4 text-pretty text-base leading-7 text-muted-foreground sm:text-lg\">\n {description}\n </p>\n ) : null}\n </div>\n ) : null}\n\n <div className=\"mt-12 grid w-full items-center gap-10 lg:grid-cols-[1.05fr_0.95fr] lg:gap-20\">\n {visual ? (\n <div className={cn(\"relative\", mediaLeft ? \"lg:order-1\" : \"lg:order-2\")}>{visual}</div>\n ) : null}\n\n <div\n className={cn(\n \"flex flex-col divide-y divide-border\",\n mediaLeft ? \"lg:order-2\" : \"lg:order-1\",\n )}\n >\n {items.map((item, index) => (\n <div key={index} className=\"flex gap-5 py-7 first:pt-0 last:pb-0 sm:gap-6\">\n {item.icon ? (\n <div className=\"inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-xl border border-border bg-surface text-lg text-foreground shadow-soft\">\n {item.icon}\n </div>\n ) : null}\n <div>\n <h3 className=\"font-display text-lg font-semibold tracking-tight text-foreground\">\n {item.title}\n </h3>\n {item.description ? (\n <p className=\"mt-2 text-pretty text-sm leading-6 text-muted-foreground sm:text-[15px]\">\n {item.description}\n </p>\n ) : null}\n {item.link ? (\n <div className=\"mt-3\">{item.link}</div>\n ) : item.href ? (\n <a\n href={item.href}\n className=\"group/link mt-3 inline-flex items-center gap-1.5 text-sm font-medium text-primary transition-colors hover:text-primary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n >\n {item.linkLabel ?? \"Learn more\"}\n <ArrowRight className=\"h-4 w-4 transition-transform duration-200 group-hover/link:translate-x-0.5\" />\n </a>\n ) : null}\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\nFeatureShowcase.displayName = \"FeatureShowcase\";\n"],"names":["FeatureShowcase","className","items","visual","mediaSide","eyebrow","title","description","props","mediaLeft","jsxs","cn","jsx","item","index","ArrowRight"],"mappings":";;;AAIO,MAAMA,IAAkB,CAAC;AAAA,EAC9B,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,GAAGC;AACL,MAA4B;AAC1B,QAAMC,IAAYL,MAAc;AAEhC,SACE,gBAAAM,EAAC,SAAI,WAAWC,EAAG,UAAUV,CAAS,GAAI,GAAGO,GAC1C,UAAA;AAAA,IAAAH,KAAWC,KAASC,IACnB,gBAAAG,EAAC,OAAA,EAAI,WAAU,aACZ,UAAA;AAAA,MAAAL,IACC,gBAAAO,EAAC,KAAA,EAAE,WAAU,kEAAkE,aAAQ,IACrF;AAAA,MACHN,IACC,gBAAAM,EAAC,MAAA,EAAG,WAAU,wHACX,aACH,IACE;AAAA,MACHL,IACC,gBAAAK,EAAC,KAAA,EAAE,WAAU,yEACV,aACH,IACE;AAAA,IAAA,EAAA,CACN,IACE;AAAA,IAEJ,gBAAAF,EAAC,OAAA,EAAI,WAAU,gFACZ,UAAA;AAAA,MAAAP,IACC,gBAAAS,EAAC,OAAA,EAAI,WAAWD,EAAG,YAAYF,IAAY,eAAe,YAAY,GAAI,UAAAN,EAAA,CAAO,IAC/E;AAAA,MAEJ,gBAAAS;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWD;AAAA,YACT;AAAA,YACAF,IAAY,eAAe;AAAA,UAAA;AAAA,UAG5B,UAAAP,EAAM,IAAI,CAACW,GAAMC,MAChB,gBAAAJ,EAAC,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