UNPKG

@playbooks/ui

Version:

An interface library for Playbooks.

70 lines (69 loc) 2.26 kB
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const require$$0 = require("react/jsx-runtime"); const html = require("./toast-context-kVz4KXNu.cjs"); const links = require("./links.cjs"); const navs = require("./navs.cjs"); const Breadcrumbs = ({ name = "Breadcrumbs", tailwind, className, children, ...props }) => { const { theme } = html.useInterface(); const base = theme.breadcrumbs(); const computed = { ...base, ...props, tailwind, className, name }; return /* @__PURE__ */ require$$0.jsx(navs.Nav, { ...computed, children: /* @__PURE__ */ require$$0.jsx(navs.NavList, { tailwind: { display: "flex flex-row", space: "space-x-2" }, children }) }); }; const BreadcrumbItem = ({ name = "BreadcrumbItem", icon = "chevron-right", arrow = true, tailwind, className, children, ...props }) => { const { theme } = html.useInterface(); const base = theme.breadcrumbItem(); const computed = { ...base, ...props, tailwind, className, name }; return /* @__PURE__ */ require$$0.jsxs(html.Li, { ...computed, children: [ children, arrow && /* @__PURE__ */ require$$0.jsx(html.FarIcon, { icon, tailwind: { color: "text-gray-400", fontSize: "text-xs", ...tailwind == null ? void 0 : tailwind.icon } }) ] }); }; const BreadcrumbBtn = ({ name = "BreadcrumbBtn", size = "xxs", active, onClick, tailwind, className, children, ...props }) => { const { theme } = html.useInterface(); const base = theme.breadcrumbBtn({ active }); const computed = { ...base, ...props, tailwind, size, className, name, active, children }; return /* @__PURE__ */ require$$0.jsx(html.TextBtn, { onClick, ...computed }); }; const BreadcrumbLink = ({ name = "BreadcrumbLink", size = "xxs", active, href, tailwind, className, children, ...props }) => { const { theme } = html.useInterface(); const base = theme.breadcrumbLink({ active }); const computed = { ...base, ...props, tailwind, size, className, name, active, children }; return /* @__PURE__ */ require$$0.jsx(links.TextLink, { href, ...computed }); }; exports.BreadcrumbBtn = BreadcrumbBtn; exports.BreadcrumbItem = BreadcrumbItem; exports.BreadcrumbLink = BreadcrumbLink; exports.Breadcrumbs = Breadcrumbs;