@better-nds/react 0.0.20 → 0.0.22
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/menu-12s-BHfcS2RP.js +2 -0
- package/dist/menu-12s-BHfcS2RP.js.map +1 -0
- package/dist/menu-12s-CIJKylLY.cjs +2 -0
- package/dist/menu-12s-CIJKylLY.cjs.map +1 -0
- package/dist/navbar.cjs +1 -1
- package/dist/navbar.cjs.map +1 -1
- package/dist/navbar.js +1 -1
- package/dist/navbar.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{Menu01Icon as n}from"@hugeicons/core-free-icons";import{HugeiconsIcon as a}from"@hugeicons/react";import{Dialog as o}from"radix-ui";let t={en:{open:"Open menu",close:"Close menu",menu:"Menu"},ar:{open:"فتح القائمة",close:"إغلاق القائمة",menu:"القائمة"}},s=({frameworkLink:s,links:i,logo:l,locale:d="ar"})=>{let c=t[d];return e(o.Root,{children:[r(o.Trigger,{asChild:!0,children:r("button",{"aria-label":c.open,className:"w-fit p-4 md:hidden",children:r(a,{icon:n,size:24})})}),r(o.Portal,{children:e(o.Content,{"aria-describedby":void 0,className:"bg-nds-white border-nds-neutral-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-start data-[state=open]:slide-in-from-start text-nds-black fixed inset-y-0 inset-s-0 z-50 w-full max-w-64 border-e backdrop-blur-sm duration-300",children:[r(o.Title,{className:"sr-only",children:c.menu}),r("div",{className:"bg-nds-neutral-50 flex h-18 shrink-0 px-8 [&>img]:size-10.5 [&>img]:w-auto",children:l}),r("nav",{className:"flex flex-1 flex-col gap-1 overflow-y-auto p-4",children:i.map((e,n)=>r(o.Close,{asChild:!0,children:r(s,{href:e.href,className:"hover:bg-nds-neutral-100 active:bg-nds-neutral-200 hover:before:bg-nds-neutral-400 active:before:bg-nds-neutral-800 relative flex items-center rounded-sm px-4 py-2 font-semibold transition-colors before:absolute before:inset-s-0 before:h-2/3 before:w-1.5 before:rounded-full before:transition-colors",children:e.label})},`${e.href}-${n}`))})]})})]})};export{s as M};
|
|
2
|
+
//# sourceMappingURL=menu-12s-BHfcS2RP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-12s-BHfcS2RP.js","sources":["../src/blocks/navbar/menu.tsx"],"sourcesContent":["\"use client\"\n\nimport { type ReactNode } from \"react\"\nimport { Menu01Icon } from \"@hugeicons/core-free-icons\"\nimport { HugeiconsIcon } from \"@hugeicons/react\"\nimport { Dialog } from \"radix-ui\"\n\nconst translations = {\n en: { open: \"Open menu\", close: \"Close menu\", menu: \"Menu\" },\n ar: { open: \"فتح القائمة\", close: \"إغلاق القائمة\", menu: \"القائمة\" }\n}\n\nexport const Menu = ({\n frameworkLink: Link,\n links,\n logo,\n locale = \"ar\"\n}: {\n frameworkLink: (props: {\n href: string\n className?: string\n children: ReactNode\n }) => ReactNode\n links: {\n href: string\n label: string\n }[]\n logo?: ReactNode\n locale?: keyof typeof translations\n}) => {\n const t = translations[locale]\n\n return (\n <Dialog.Root>\n <Dialog.Trigger asChild>\n <button aria-label={t.open} className=\"w-fit p-4 md:hidden\">\n <HugeiconsIcon icon={Menu01Icon} size={24} />\n </button>\n </Dialog.Trigger>\n <Dialog.Portal>\n <Dialog.Content\n aria-describedby={undefined}\n className=\"bg-nds-white border-nds-neutral-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-start data-[state=open]:slide-in-from-start text-nds-black fixed inset-y-0 inset-s-0 z-50 w-full max-w-64 border-e backdrop-blur-sm duration-300\"\n >\n <Dialog.Title className=\"sr-only\">{t.menu}</Dialog.Title>\n <div className=\"bg-nds-neutral-50 flex h-18 shrink-0 px-8 [&>img]:size-10.5 [&>img]:w-auto\">\n {logo}\n </div>\n <nav className=\"flex flex-1 flex-col gap-1 overflow-y-auto p-4\">\n {links.map((link, index) => (\n <Dialog.Close asChild key={`${link.href}-${index}`}>\n <Link\n href={link.href}\n className=\"hover:bg-nds-neutral-100 active:bg-nds-neutral-200 hover:before:bg-nds-neutral-400 active:before:bg-nds-neutral-800 relative flex items-center rounded-sm px-4 py-2 font-semibold transition-colors before:absolute before:inset-s-0 before:h-2/3 before:w-1.5 before:rounded-full before:transition-colors\"\n >\n {link.label}\n </Link>\n </Dialog.Close>\n ))}\n </nav>\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog.Root>\n )\n}\n"],"names":["translations","en","open","close","menu","ar","Menu","frameworkLink","Link","links","logo","locale","t","_jsxs","Dialog","Root","_jsx","Trigger","asChild","children","button","aria-label","className","HugeiconsIcon","icon","Menu01Icon","size","Portal","Content","aria-describedby","undefined","Title","div","nav","map","link","index","Close","href","label"],"mappings":"0MAOA,IAAMA,EAAe,CACnBC,GAAI,CAAEC,KAAM,YAAaC,MAAO,aAAcC,KAAM,MAAO,EAC3DC,GAAI,CAAEH,KAAM,cAAeC,MAAO,gBAAiBC,KAAM,SAAU,CACrE,EAEaE,EAAO,CAAC,CACnBC,cAAeC,CAAI,CACnBC,MAAAA,CAAK,CACLC,KAAAA,CAAI,CACJC,OAAAA,EAAS,IAAI,CAad,IACC,IAAMC,EAAIZ,CAAY,CAACW,EAAO,CAE9B,OACEE,EAACC,EAAOC,IAAI,CAAA,WACVC,EAACF,EAAOG,OAAO,CAAA,CAACC,QAAO,CAAA,EACrBC,SAAAH,EAACI,SAAAA,CAAOC,aAAYT,EAAEV,IAAI,CAAEoB,UAAU,sBACpCH,SAAAH,EAACO,EAAAA,CAAcC,KAAMC,EAAYC,KAAM,SAG3CV,EAACF,EAAOa,MAAM,CAAA,UACZd,EAACC,EAAOc,OAAO,CAAA,CACbC,mBAAkBC,KAAAA,EAClBR,UAAU,+RAEVN,EAACF,EAAOiB,KAAK,CAAA,CAACT,UAAU,UAAWV,SAAAA,EAAER,IAAAA,GACrCY,EAACgB,MAAAA,CAAIV,UAAU,6EACZZ,SAAAA,IAEHM,EAACiB,MAAAA,CAAIX,UAAU,iDACZb,SAAAA,EAAMyB,GAAG,CAAC,CAACC,EAAMC,IAChBpB,EAACF,EAAOuB,KAAK,CAAA,CAACnB,QAAO,CAAA,EACnBC,SAAAH,EAACR,EAAAA,CACC8B,KAAMH,EAAKG,IAAI,CACfhB,UAAU,8SAETa,SAAAA,EAAKI,KAAAA,EALiB,EAAA,CAAA,EAAGJ,EAAKG,IAAI,CAAC,CAAC,EAAEF,EAAAA,CAAO,YAchE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";var e=require("react/jsx-runtime"),r=require("@hugeicons/core-free-icons"),s=require("@hugeicons/react"),a=require("radix-ui");let n={en:{open:"Open menu",close:"Close menu",menu:"Menu"},ar:{open:"فتح القائمة",close:"إغلاق القائمة",menu:"القائمة"}};exports.Menu=({frameworkLink:o,links:i,logo:l,locale:t="ar"})=>{let d=n[t];return e.jsxs(a.Dialog.Root,{children:[e.jsx(a.Dialog.Trigger,{asChild:!0,children:e.jsx("button",{"aria-label":d.open,className:"w-fit p-4 md:hidden",children:e.jsx(s.HugeiconsIcon,{icon:r.Menu01Icon,size:24})})}),e.jsx(a.Dialog.Portal,{children:e.jsxs(a.Dialog.Content,{"aria-describedby":void 0,className:"bg-nds-white border-nds-neutral-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-start data-[state=open]:slide-in-from-start text-nds-black fixed inset-y-0 inset-s-0 z-50 w-full max-w-64 border-e backdrop-blur-sm duration-300",children:[e.jsx(a.Dialog.Title,{className:"sr-only",children:d.menu}),e.jsx("div",{className:"bg-nds-neutral-50 flex h-18 shrink-0 px-8 [&>img]:size-10.5 [&>img]:w-auto",children:l}),e.jsx("nav",{className:"flex flex-1 flex-col gap-1 overflow-y-auto p-4",children:i.map((r,s)=>e.jsx(a.Dialog.Close,{asChild:!0,children:e.jsx(o,{href:r.href,className:"hover:bg-nds-neutral-100 active:bg-nds-neutral-200 hover:before:bg-nds-neutral-400 active:before:bg-nds-neutral-800 relative flex items-center rounded-sm px-4 py-2 font-semibold transition-colors before:absolute before:inset-s-0 before:h-2/3 before:w-1.5 before:rounded-full before:transition-colors",children:r.label})},`${r.href}-${s}`))})]})})]})};
|
|
2
|
+
//# sourceMappingURL=menu-12s-CIJKylLY.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-12s-CIJKylLY.cjs","sources":["../src/blocks/navbar/menu.tsx"],"sourcesContent":["\"use client\"\n\nimport { type ReactNode } from \"react\"\nimport { Menu01Icon } from \"@hugeicons/core-free-icons\"\nimport { HugeiconsIcon } from \"@hugeicons/react\"\nimport { Dialog } from \"radix-ui\"\n\nconst translations = {\n en: { open: \"Open menu\", close: \"Close menu\", menu: \"Menu\" },\n ar: { open: \"فتح القائمة\", close: \"إغلاق القائمة\", menu: \"القائمة\" }\n}\n\nexport const Menu = ({\n frameworkLink: Link,\n links,\n logo,\n locale = \"ar\"\n}: {\n frameworkLink: (props: {\n href: string\n className?: string\n children: ReactNode\n }) => ReactNode\n links: {\n href: string\n label: string\n }[]\n logo?: ReactNode\n locale?: keyof typeof translations\n}) => {\n const t = translations[locale]\n\n return (\n <Dialog.Root>\n <Dialog.Trigger asChild>\n <button aria-label={t.open} className=\"w-fit p-4 md:hidden\">\n <HugeiconsIcon icon={Menu01Icon} size={24} />\n </button>\n </Dialog.Trigger>\n <Dialog.Portal>\n <Dialog.Content\n aria-describedby={undefined}\n className=\"bg-nds-white border-nds-neutral-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-start data-[state=open]:slide-in-from-start text-nds-black fixed inset-y-0 inset-s-0 z-50 w-full max-w-64 border-e backdrop-blur-sm duration-300\"\n >\n <Dialog.Title className=\"sr-only\">{t.menu}</Dialog.Title>\n <div className=\"bg-nds-neutral-50 flex h-18 shrink-0 px-8 [&>img]:size-10.5 [&>img]:w-auto\">\n {logo}\n </div>\n <nav className=\"flex flex-1 flex-col gap-1 overflow-y-auto p-4\">\n {links.map((link, index) => (\n <Dialog.Close asChild key={`${link.href}-${index}`}>\n <Link\n href={link.href}\n className=\"hover:bg-nds-neutral-100 active:bg-nds-neutral-200 hover:before:bg-nds-neutral-400 active:before:bg-nds-neutral-800 relative flex items-center rounded-sm px-4 py-2 font-semibold transition-colors before:absolute before:inset-s-0 before:h-2/3 before:w-1.5 before:rounded-full before:transition-colors\"\n >\n {link.label}\n </Link>\n </Dialog.Close>\n ))}\n </nav>\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog.Root>\n )\n}\n"],"names":["translations","en","open","close","menu","ar","frameworkLink","Link","links","logo","locale","t","_jsxs","Dialog","Root","_jsx","Trigger","asChild","children","button","aria-label","className","HugeiconsIcon","icon","Menu01Icon","size","Portal","Content","aria-describedby","undefined","Title","div","nav","map","link","index","Close","href","label"],"mappings":"4IAOA,IAAMA,EAAe,CACnBC,GAAI,CAAEC,KAAM,YAAaC,MAAO,aAAcC,KAAM,MAAO,EAC3DC,GAAI,CAAEH,KAAM,cAAeC,MAAO,gBAAiBC,KAAM,SAAU,CACrE,eAEoB,CAAC,CACnBE,cAAeC,CAAI,CACnBC,MAAAA,CAAK,CACLC,KAAAA,CAAI,CACJC,OAAAA,EAAS,IAAI,CAad,IACC,IAAMC,EAAIX,CAAY,CAACU,EAAO,CAE9B,OACEE,EAAAA,IAAA,CAACC,EAAAA,OAAOC,IAAI,CAAA,WACVC,EAAAA,GAAA,CAACF,EAAAA,OAAOG,OAAO,CAAA,CAACC,QAAO,CAAA,EACrBC,SAAAH,EAAAA,GAAA,CAACI,SAAAA,CAAOC,aAAYT,EAAET,IAAI,CAAEmB,UAAU,sBACpCH,SAAAH,EAAAA,GAAA,CAACO,eAAAA,CAAAA,CAAcC,KAAMC,EAAAA,UAAAA,CAAYC,KAAM,SAG3CV,EAAAA,GAAA,CAACF,EAAAA,OAAOa,MAAM,CAAA,UACZd,EAAAA,IAAA,CAACC,EAAAA,OAAOc,OAAO,CAAA,CACbC,mBAAkBC,KAAAA,EAClBR,UAAU,+RAEVN,EAAAA,GAAA,CAACF,EAAAA,OAAOiB,KAAK,CAAA,CAACT,UAAU,UAAWV,SAAAA,EAAEP,IAAAA,GACrCW,EAAAA,GAAA,CAACgB,MAAAA,CAAIV,UAAU,6EACZZ,SAAAA,IAEHM,EAAAA,GAAA,CAACiB,MAAAA,CAAIX,UAAU,iDACZb,SAAAA,EAAMyB,GAAG,CAAC,CAACC,EAAMC,IAChBpB,EAAAA,GAAA,CAACF,EAAAA,OAAOuB,KAAK,CAAA,CAACnB,QAAO,CAAA,EACnBC,SAAAH,EAAAA,GAAA,CAACR,EAAAA,CACC8B,KAAMH,EAAKG,IAAI,CACfhB,UAAU,8SAETa,SAAAA,EAAKI,KAAAA,EALiB,EAAA,CAAA,EAAGJ,EAAKG,IAAI,CAAC,CAAC,EAAEF,EAAAA,CAAO,YAchE"}
|
package/dist/navbar.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("clsx");let
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("clsx"),t=require("./menu-12s-CIJKylLY.cjs");let s=(r&&r.__esModule?r:{default:r}).default("hover:bg-nds-neutral-100 active:bg-nds-neutral-200 hover:before:bg-nds-neutral-400 active:before:bg-nds-neutral-800 relative flex h-full items-center justify-center gap-1 rounded-sm px-4 py-2 font-medium transition-colors before:absolute before:bottom-0 before:z-1 before:h-1.5 before:w-[calc(100%-1rem)] before:rounded-full before:transition-colors","data-[selected=true]:hover:bg-nds-primary-700 data-[selected=true]:text-nds-white data-[selected=true]:active:bg-nds-primary-900 data-[selected=true]:bg-nds-primary-600 data-[selected=true]:before:bg-nds-primary-400");exports.Navbar=({actions:r,frameworkLink:l,links:a,logo:d})=>e.jsx("header",{className:"bg-nds-white border-nds-neutral-300 sticky top-0 flex h-18 w-full justify-center border-b pe-4 md:px-4",children:e.jsxs("div",{className:"grid h-full w-full max-w-7xl grid-cols-3 items-center justify-between md:flex",children:[e.jsx(t.Menu,{frameworkLink:l,links:a,logo:d}),e.jsxs("div",{className:"flex h-full items-center gap-4 max-md:justify-self-center",children:[d,e.jsx("nav",{className:"flex h-full items-center max-md:hidden",children:a.map((r,t)=>e.jsx(l,{href:r.href,className:s,children:r.label},`${r.href}-${t}`))})]}),e.jsx("div",{className:"flex h-full items-center max-md:justify-self-end",children:r})]})}),exports.triggerStyle=s;
|
|
2
2
|
//# sourceMappingURL=navbar.cjs.map
|
package/dist/navbar.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar.cjs","sources":["../src/blocks/navbar/index.tsx"],"sourcesContent":["import { type ReactNode } from \"react\"\nimport clsx from \"clsx\"\n\nexport const triggerStyle = clsx(\n \"hover:bg-nds-neutral-100 active:bg-nds-neutral-200 hover:before:bg-nds-neutral-400 active:before:bg-nds-neutral-800 relative flex h-full items-center justify-center gap-1 rounded-sm px-4 py-2 font-medium transition-colors before:absolute before:bottom-0 before:z-1 before:h-1.5 before:w-[calc(100%-1rem)] before:rounded-full before:transition-colors\",\n\n \"data-[selected=true]:hover:bg-nds-primary-700 data-[selected=true]:text-nds-white data-[selected=true]:active:bg-nds-primary-900 data-[selected=true]:bg-nds-primary-600 data-[selected=true]:before:bg-nds-primary-400\"\n)\n\nexport const Navbar = ({\n actions,\n frameworkLink: Link,\n links,\n logo\n}: {\n actions?: ReactNode\n frameworkLink: (props: {\n href: string\n className?: string\n children: ReactNode\n }) => ReactNode\n links: {\n href: string\n label: string\n }[]\n logo: ReactNode\n}) => {\n return (\n <header className=\"bg-nds-white border-nds-neutral-300 sticky top-0 flex h-18 w-full justify-center border-b px-4\">\n <div className=\"
|
|
1
|
+
{"version":3,"file":"navbar.cjs","sources":["../src/blocks/navbar/index.tsx"],"sourcesContent":["import { type ReactNode } from \"react\"\nimport clsx from \"clsx\"\n\nimport { Menu } from \"./menu\"\n\nexport const triggerStyle = clsx(\n \"hover:bg-nds-neutral-100 active:bg-nds-neutral-200 hover:before:bg-nds-neutral-400 active:before:bg-nds-neutral-800 relative flex h-full items-center justify-center gap-1 rounded-sm px-4 py-2 font-medium transition-colors before:absolute before:bottom-0 before:z-1 before:h-1.5 before:w-[calc(100%-1rem)] before:rounded-full before:transition-colors\",\n\n \"data-[selected=true]:hover:bg-nds-primary-700 data-[selected=true]:text-nds-white data-[selected=true]:active:bg-nds-primary-900 data-[selected=true]:bg-nds-primary-600 data-[selected=true]:before:bg-nds-primary-400\"\n)\n\nexport const Navbar = ({\n actions,\n frameworkLink: Link,\n links,\n logo\n}: {\n actions?: ReactNode\n frameworkLink: (props: {\n href: string\n className?: string\n children: ReactNode\n }) => ReactNode\n links: {\n href: string\n label: string\n }[]\n logo: ReactNode\n}) => {\n return (\n <header className=\"bg-nds-white border-nds-neutral-300 sticky top-0 flex h-18 w-full justify-center border-b pe-4 md:px-4\">\n <div className=\"grid h-full w-full max-w-7xl grid-cols-3 items-center justify-between md:flex\">\n <Menu frameworkLink={Link} links={links} logo={logo} />\n <div className=\"flex h-full items-center gap-4 max-md:justify-self-center\">\n {logo}\n <nav className=\"flex h-full items-center max-md:hidden\">\n {links.map((link, index) => (\n <Link\n key={`${link.href}-${index}`}\n href={link.href}\n className={triggerStyle}\n >\n {link.label}\n </Link>\n ))}\n </nav>\n </div>\n <div className=\"flex h-full items-center max-md:justify-self-end\">\n {actions}\n </div>\n </div>\n </header>\n )\n}\n"],"names":["triggerStyle","clsx","actions","frameworkLink","Link","links","logo","_jsx","header","className","children","_jsxs","div","Menu","nav","map","link","index","href","label"],"mappings":"iJAKO,IAAMA,EAAeC,gCAAAA,OAAAA,CAC1B,gWAEA,0OAGoB,CAAC,CACrBC,QAAAA,CAAO,CACPC,cAAeC,CAAI,CACnBC,MAAAA,CAAK,CACLC,KAAAA,CAAI,CAaL,GAEGC,EAAAA,GAAA,CAACC,SAAAA,CAAOC,UAAU,yGAChBC,SAAAC,EAAAA,IAAA,CAACC,MAAAA,CAAIH,UAAU,0FACbF,EAAAA,GAAA,CAACM,EAAAA,IAAAA,CAAAA,CAAKV,cAAeC,EAAMC,MAAOA,EAAOC,KAAMA,IAC/CK,EAAAA,IAAA,CAACC,MAAAA,CAAIH,UAAU,sEACZH,EACDC,EAAAA,GAAA,CAACO,MAAAA,CAAIL,UAAU,yCACZJ,SAAAA,EAAMU,GAAG,CAAC,CAACC,EAAMC,IAChBV,EAAAA,GAAA,CAACH,EAAAA,CAECc,KAAMF,EAAKE,IAAI,CACfT,UAAWT,EAEVgB,SAAAA,EAAKG,KAAAA,AAJD,EAAA,CAAA,EAAGH,EAAKE,IAAI,CAAC,CAAC,EAAED,EAAAA,CAAO,QASpCV,EAAAA,GAAA,CAACK,MAAAA,CAAIH,UAAU,mDACZP,SAAAA"}
|
package/dist/navbar.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import t from"clsx";let
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import t from"clsx";import{M as l}from"./menu-12s-BHfcS2RP.js";let a=t("hover:bg-nds-neutral-100 active:bg-nds-neutral-200 hover:before:bg-nds-neutral-400 active:before:bg-nds-neutral-800 relative flex h-full items-center justify-center gap-1 rounded-sm px-4 py-2 font-medium transition-colors before:absolute before:bottom-0 before:z-1 before:h-1.5 before:w-[calc(100%-1rem)] before:rounded-full before:transition-colors","data-[selected=true]:hover:bg-nds-primary-700 data-[selected=true]:text-nds-white data-[selected=true]:active:bg-nds-primary-900 data-[selected=true]:bg-nds-primary-600 data-[selected=true]:before:bg-nds-primary-400"),s=({actions:t,frameworkLink:s,links:d,logo:i})=>e("header",{className:"bg-nds-white border-nds-neutral-300 sticky top-0 flex h-18 w-full justify-center border-b pe-4 md:px-4",children:r("div",{className:"grid h-full w-full max-w-7xl grid-cols-3 items-center justify-between md:flex",children:[e(l,{frameworkLink:s,links:d,logo:i}),r("div",{className:"flex h-full items-center gap-4 max-md:justify-self-center",children:[i,e("nav",{className:"flex h-full items-center max-md:hidden",children:d.map((r,t)=>e(s,{href:r.href,className:a,children:r.label},`${r.href}-${t}`))})]}),e("div",{className:"flex h-full items-center max-md:justify-self-end",children:t})]})});export{s as Navbar,a as triggerStyle};
|
|
2
2
|
//# sourceMappingURL=navbar.js.map
|
package/dist/navbar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar.js","sources":["../src/blocks/navbar/index.tsx"],"sourcesContent":["import { type ReactNode } from \"react\"\nimport clsx from \"clsx\"\n\nexport const triggerStyle = clsx(\n \"hover:bg-nds-neutral-100 active:bg-nds-neutral-200 hover:before:bg-nds-neutral-400 active:before:bg-nds-neutral-800 relative flex h-full items-center justify-center gap-1 rounded-sm px-4 py-2 font-medium transition-colors before:absolute before:bottom-0 before:z-1 before:h-1.5 before:w-[calc(100%-1rem)] before:rounded-full before:transition-colors\",\n\n \"data-[selected=true]:hover:bg-nds-primary-700 data-[selected=true]:text-nds-white data-[selected=true]:active:bg-nds-primary-900 data-[selected=true]:bg-nds-primary-600 data-[selected=true]:before:bg-nds-primary-400\"\n)\n\nexport const Navbar = ({\n actions,\n frameworkLink: Link,\n links,\n logo\n}: {\n actions?: ReactNode\n frameworkLink: (props: {\n href: string\n className?: string\n children: ReactNode\n }) => ReactNode\n links: {\n href: string\n label: string\n }[]\n logo: ReactNode\n}) => {\n return (\n <header className=\"bg-nds-white border-nds-neutral-300 sticky top-0 flex h-18 w-full justify-center border-b px-4\">\n <div className=\"
|
|
1
|
+
{"version":3,"file":"navbar.js","sources":["../src/blocks/navbar/index.tsx"],"sourcesContent":["import { type ReactNode } from \"react\"\nimport clsx from \"clsx\"\n\nimport { Menu } from \"./menu\"\n\nexport const triggerStyle = clsx(\n \"hover:bg-nds-neutral-100 active:bg-nds-neutral-200 hover:before:bg-nds-neutral-400 active:before:bg-nds-neutral-800 relative flex h-full items-center justify-center gap-1 rounded-sm px-4 py-2 font-medium transition-colors before:absolute before:bottom-0 before:z-1 before:h-1.5 before:w-[calc(100%-1rem)] before:rounded-full before:transition-colors\",\n\n \"data-[selected=true]:hover:bg-nds-primary-700 data-[selected=true]:text-nds-white data-[selected=true]:active:bg-nds-primary-900 data-[selected=true]:bg-nds-primary-600 data-[selected=true]:before:bg-nds-primary-400\"\n)\n\nexport const Navbar = ({\n actions,\n frameworkLink: Link,\n links,\n logo\n}: {\n actions?: ReactNode\n frameworkLink: (props: {\n href: string\n className?: string\n children: ReactNode\n }) => ReactNode\n links: {\n href: string\n label: string\n }[]\n logo: ReactNode\n}) => {\n return (\n <header className=\"bg-nds-white border-nds-neutral-300 sticky top-0 flex h-18 w-full justify-center border-b pe-4 md:px-4\">\n <div className=\"grid h-full w-full max-w-7xl grid-cols-3 items-center justify-between md:flex\">\n <Menu frameworkLink={Link} links={links} logo={logo} />\n <div className=\"flex h-full items-center gap-4 max-md:justify-self-center\">\n {logo}\n <nav className=\"flex h-full items-center max-md:hidden\">\n {links.map((link, index) => (\n <Link\n key={`${link.href}-${index}`}\n href={link.href}\n className={triggerStyle}\n >\n {link.label}\n </Link>\n ))}\n </nav>\n </div>\n <div className=\"flex h-full items-center max-md:justify-self-end\">\n {actions}\n </div>\n </div>\n </header>\n )\n}\n"],"names":["triggerStyle","clsx","Navbar","actions","frameworkLink","Link","links","logo","_jsx","header","className","children","_jsxs","div","Menu","nav","map","link","index","href","label"],"mappings":"iHAKO,IAAMA,EAAeC,EAC1B,gWAEA,2NAGWC,EAAS,CAAC,CACrBC,QAAAA,CAAO,CACPC,cAAeC,CAAI,CACnBC,MAAAA,CAAK,CACLC,KAAAA,CAAI,CAaL,GAEGC,EAACC,SAAAA,CAAOC,UAAU,yGAChBC,SAAAC,EAACC,MAAAA,CAAIH,UAAU,0FACbF,EAACM,EAAAA,CAAKV,cAAeC,EAAMC,MAAOA,EAAOC,KAAMA,IAC/CK,EAACC,MAAAA,CAAIH,UAAU,sEACZH,EACDC,EAACO,MAAAA,CAAIL,UAAU,yCACZJ,SAAAA,EAAMU,GAAG,CAAC,CAACC,EAAMC,IAChBV,EAACH,EAAAA,CAECc,KAAMF,EAAKE,IAAI,CACfT,UAAWV,EAEViB,SAAAA,EAAKG,KAAAA,AAJD,EAAA,CAAA,EAAGH,EAAKE,IAAI,CAAC,CAAC,EAAED,EAAAA,CAAO,QASpCV,EAACK,MAAAA,CAAIH,UAAU,mDACZP,SAAAA"}
|