neos-blocks
Version:
🌟 A simple ui-blocks library built on components from https://ui.shadcn.com/docs/components
56 lines (55 loc) • 2.21 kB
JavaScript
import * as t from "react";
import { cn as a } from "./index.es5.js";
import { buttonVariants as l } from "./index.es2.js";
import { Tooltip as s, TooltipTrigger as c, TooltipContent as d } from "./index.es7.js";
function i({ links: o, isCollapsed: r }) {
return /* @__PURE__ */ t.createElement(
"div",
{
"data-collapsed": r,
className: "group flex flex-col gap-4 py-2 data-[collapsed=true]:py-2"
},
/* @__PURE__ */ t.createElement("nav", { className: "grid gap-1 px-2 group-[[data-collapsed=true]]:justify-center group-[[data-collapsed=true]]:px-2" }, o.map(
(e, m) => r ? /* @__PURE__ */ t.createElement(s, { key: m, delayDuration: 0 }, /* @__PURE__ */ t.createElement(c, { asChild: !0 }, /* @__PURE__ */ t.createElement(
"a",
{
href: "#",
className: a(
l({ variant: e.variant, size: "icon" }),
"h-9 w-9",
e.variant === "default" && "dark:bg-muted dark:text-muted-foreground dark:hover:bg-muted dark:hover:text-white"
)
},
/* @__PURE__ */ t.createElement(e.icon, { className: "h-4 w-4" }),
/* @__PURE__ */ t.createElement("span", { className: "sr-only" }, e.title)
)), /* @__PURE__ */ t.createElement(d, { side: "right", className: "flex items-center gap-4" }, e.title, e.label && /* @__PURE__ */ t.createElement("span", { className: "ml-auto text-muted-foreground" }, e.label))) : /* @__PURE__ */ t.createElement(
"a",
{
key: m,
href: "#",
className: a(
l({ variant: e.variant, size: "sm" }),
e.variant === "default" && "dark:bg-muted dark:text-white dark:hover:bg-muted dark:hover:text-white",
"justify-start"
)
},
/* @__PURE__ */ t.createElement(e.icon, { className: "mr-2 h-4 w-4" }),
e.title,
e.label && /* @__PURE__ */ t.createElement(
"span",
{
className: a(
"ml-auto",
e.variant === "default" && "text-background dark:text-white"
)
},
e.label
)
)
))
);
}
export {
i as Nav
};
//# sourceMappingURL=index.es9.js.map