@better-nds/react 0.0.23 → 0.0.24

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.
@@ -1,2 +1,2 @@
1
- "use client";var e=require("react/jsx-runtime"),r=require("@hugeicons/core-free-icons"),s=require("@hugeicons/react"),n=require("radix-ui");let a={en:{open:"Open menu",close:"Close menu",menu:"Menu"},ar:{open:"فتح القائمة",close:"إغلاق القائمة",menu:"القائمة"}};exports.Menu=({frameworkLink:i,links:o,logo:l,locale:t="ar"})=>{let d=a[t];return e.jsxs(n.Dialog.Root,{children:[e.jsx(n.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(n.Dialog.Portal,{children:e.jsxs(n.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(n.Dialog.Title,{className:"sr-only",children:d.menu}),e.jsx("div",{className:"bg-nds-neutral-50 flex h-18 shrink-0 items-center 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:o.map((r,s)=>e.jsx(n.Dialog.Close,{asChild:!0,children:e.jsx(i,{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-Cxsv7XN_.cjs.map
1
+ "use client";var e=require("react/jsx-runtime"),r=require("@hugeicons/core-free-icons"),s=require("@hugeicons/react"),n=require("radix-ui");let a={en:{open:"Open menu",close:"Close menu",menu:"Menu"},ar:{open:"فتح القائمة",close:"إغلاق القائمة",menu:"القائمة"}};exports.Menu=({frameworkLink:i,links:o,logo:l,locale:t="ar"})=>{let d=a[t];return e.jsxs(n.Dialog.Root,{children:[e.jsx(n.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(n.Dialog.Portal,{children:e.jsxs(n.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 md:hidden",children:[e.jsx(n.Dialog.Title,{className:"sr-only",children:d.menu}),e.jsx("div",{className:"bg-nds-neutral-50 flex h-18 shrink-0 items-center 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:o.map((r,s)=>e.jsx(n.Dialog.Close,{asChild:!0,children:e.jsx(i,{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-B87wRaLC.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-12s-B87wRaLC.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 md:hidden\"\n >\n <Dialog.Title className=\"sr-only\">{t.menu}</Dialog.Title>\n <div className=\"bg-nds-neutral-50 flex h-18 shrink-0 items-center 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,ySAEVN,EAAAA,GAAA,CAACF,EAAAA,OAAOiB,KAAK,CAAA,CAACT,UAAU,UAAWV,SAAAA,EAAEP,IAAAA,GACrCW,EAAAA,GAAA,CAACgB,MAAAA,CAAIV,UAAU,0FACZZ,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"}
@@ -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 t}from"@hugeicons/react";import{Dialog as a}from"radix-ui";let o={en:{open:"Open menu",close:"Close menu",menu:"Menu"},ar:{open:"فتح القائمة",close:"إغلاق القائمة",menu:"القائمة"}},i=({frameworkLink:i,links:s,logo:l,locale:d="ar"})=>{let c=o[d];return e(a.Root,{children:[r(a.Trigger,{asChild:!0,children:r("button",{"aria-label":c.open,className:"w-fit p-4 md:hidden",children:r(t,{icon:n,size:24})})}),r(a.Portal,{children:e(a.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 md:hidden",children:[r(a.Title,{className:"sr-only",children:c.menu}),r("div",{className:"bg-nds-neutral-50 flex h-18 shrink-0 items-center 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:s.map((e,n)=>r(a.Close,{asChild:!0,children:r(i,{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{i as M};
2
+ //# sourceMappingURL=menu-12s-CPk1Q-BE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-12s-CPk1Q-BE.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 md:hidden\"\n >\n <Dialog.Title className=\"sr-only\">{t.menu}</Dialog.Title>\n <div className=\"bg-nds-neutral-50 flex h-18 shrink-0 items-center 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,ySAEVN,EAACF,EAAOiB,KAAK,CAAA,CAACT,UAAU,UAAWV,SAAAA,EAAER,IAAAA,GACrCY,EAACgB,MAAAA,CAAIV,UAAU,0FACZZ,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"}
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"),t=require("./menu-12s-Cxsv7XN_.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;
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("clsx"),t=require("./menu-12s-B87wRaLC.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.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import t from"clsx";import{M as l}from"./menu-12s-CwAi5eme.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};
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import t from"clsx";import{M as l}from"./menu-12s-CPk1Q-BE.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-nds/react",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "description": "React component library for better-nds",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
@@ -1,2 +0,0 @@
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 t}from"@hugeicons/react";import{Dialog as a}from"radix-ui";let o={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=o[d];return e(a.Root,{children:[r(a.Trigger,{asChild:!0,children:r("button",{"aria-label":c.open,className:"w-fit p-4 md:hidden",children:r(t,{icon:n,size:24})})}),r(a.Portal,{children:e(a.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(a.Title,{className:"sr-only",children:c.menu}),r("div",{className:"bg-nds-neutral-50 flex h-18 shrink-0 items-center 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(a.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-CwAi5eme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"menu-12s-CwAi5eme.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 items-center 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,0FACZZ,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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"menu-12s-Cxsv7XN_.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 items-center 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,0FACZZ,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"}