UNPKG

@payfit/unity-components

Version:

37 lines (36 loc) 1.24 kB
import { Icon as e } from "../../icon/Icon.js"; import { useBreadcrumbsContext as t } from "../Breadcrumbs.context.js"; import { breadcrumbsVariant as n } from "../Breadcrumbs.variant.js"; import { forwardRef as r } from "react"; import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime"; import { Breadcrumb as s } from "react-aria-components/Breadcrumbs"; //#region src/components/breadcrumbs/parts/Breadcrumb.tsx var c = 280; function l({ content: e }) { return /* @__PURE__ */ a("span", { title: typeof e == "string" ? e : void 0, className: "uy:text-nowrap uy:text-content-neutral-lowest uy:truncate", style: { maxWidth: `${c}px` }, "aria-current": "page", children: e }); } var u = r(({ children: r, ...c }, u) => { let { wrap: d } = t(), { breadcrumb: f } = n({ wrap: d }); return /* @__PURE__ */ a(s, { ref: u, ...c, className: f(), children: ({ isCurrent: t }) => { let n = r.props.children; return t ? /* @__PURE__ */ a(l, { content: n }) : /* @__PURE__ */ o(i, { children: [r, /* @__PURE__ */ a(e, { src: "CaretRightOutlined", "aria-hidden": "true", color: "content.neutral.lowest" })] }); } }); }); u.displayName = "Breadcrumb"; //#endregion export { u as Breadcrumb };