@clubmed/trident-ui
Version:
Shared ClubMed React UI components
44 lines (43 loc) • 1.43 kB
JavaScript
import { jsx as e, jsxs as k } from "react/jsx-runtime";
import { c as w } from "../chunks/index.js";
import { Icon as B } from "../atoms/Icons/Icon.js";
import "@clubmed/trident-icons";
const E = {
light: {
thStart: "text-middleGrey",
thEnd: "text-black font-bold"
},
dark: {
thStart: "text-white",
thEnd: "text-white font-bold"
}
}, L = ({
className: o,
items: n,
theme: l = "light",
component: i = "a"
}) => {
const [m, h, , ...r] = n, d = r.length ? r[r.length - 1] : n[n.length - 1], x = { label: "...", href: "" }, s = r.length ? [m, h, x, d] : n, { thStart: p, thEnd: f } = E[l], g = i;
return /* @__PURE__ */ e("nav", { "data-name": "Breadcrumb", "aria-label": "Breadcrumb", className: o, children: /* @__PURE__ */ e("ul", { className: "flex items-center", children: s.map(({ label: a, href: c }, b) => {
const t = b === s.length - 1, u = c && !t;
return /* @__PURE__ */ k(
"li",
{
className: w("text-b4 flex items-center", {
[p]: !t,
[f]: t
}),
...t && { "aria-current": "page" },
children: [
/* @__PURE__ */ e("span", { children: u ? /* @__PURE__ */ e(g, { href: c, children: a }) : a }),
!t && /* @__PURE__ */ e(B, { name: "Diamond", width: "14px", className: "mx-4" })
]
},
a
);
}) }) });
};
export {
L as Breadcrumb
};
//# sourceMappingURL=Breadcrumb.js.map