@playbooks/ui
Version:
An interface library for Playbooks.
38 lines (37 loc) • 1.55 kB
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require$$0 = require("react/jsx-runtime");
const transforms = require("./transforms-Ca9m4pGF.cjs");
const html = require("./toast-context-kVz4KXNu.cjs");
const links = require("./links.cjs");
const Navbar = ({ name = "Navbar", tailwind, className, children, ...props }) => {
const { theme } = html.useInterface();
const base = theme.navbar();
const formatted = { ...base, ...props, ...tailwind };
const filtered = transforms.computeProps(props);
return /* @__PURE__ */ require$$0.jsx(transforms.Nav, { name, tailwind: formatted, className, ...filtered, children });
};
const NavbarBrand = ({
name = "NavbarBrand",
href = "/",
src,
alt = "home",
tailwind,
className,
children,
...props
}) => {
const { theme } = html.useInterface();
const base = theme.navbarBrand();
const computed = { ...base, ...props, tailwind, className };
return /* @__PURE__ */ require$$0.jsx(links.LinkWrapper, { alt, name, href, ...computed, children: /* @__PURE__ */ require$$0.jsx(html.Img, { src, alt: "Brand logo", width: "w-full" }) });
};
const NavbarList = ({ name = "NavbarList", tailwind, className, children, ...props }) => {
const { theme } = html.useInterface();
const base = theme.navbarList();
const computed = { ...base, ...props, tailwind, className, name };
return /* @__PURE__ */ require$$0.jsx(html.Ul, { ...computed, children });
};
exports.Navbar = Navbar;
exports.NavbarBrand = NavbarBrand;
exports.NavbarList = NavbarList;