import { jsxs as n, jsx as t } from "react/jsx-runtime";
import { useBreadcrumbItem as f } from "@react-aria/breadcrumbs";
import { useFocusRing as h } from "@react-aria/focus";
import { mergeProps as g } from "@react-aria/utils";
import { useRef as b } from "react";
import { getItemElementType as y } from "../../utilities/elements.es.js";
import { FOCUS_STYLE_NO_OFFSET as F } from "../../utilities/focusStyle.es.js";
import { merge as N } from "../../utilities/merge.es.js";
const T = () => /* @__PURE__ */ t(
  "svg",
  {
    "aria-hidden": "true",
    width: "13",
    height: "17",
    viewBox: "0 0 13 17",
    fill: "none",
    className: "tw-stroke-current tw-text-black-20",
    xmlns: "http://www.w3.org/2000/svg",
    children: /* @__PURE__ */ t("line", { x1: "3.52447", y1: "16.0623", x2: "8.46874", y2: "0.845385" })
  }
), P = ({
  decorator: i,
  label: r,
  link: s,
  onClick: o,
  showSeparator: a,
  children: c,
  "data-test-id": p = "breadcrumb"
}) => {
  const m = b(null), e = y(s, o), { itemProps: l } = f(
    {
      isCurrent: !1,
      children: r,
      elementType: e
    },
    m
  ), { isFocusVisible: w, focusProps: d } = h(), u = g(l, d, { a: { href: s }, button: { onClick: o, type: "button" }, span: {} }[e]), x = N([
    "tw-flex tw-gap-x-1 tw-items-center tw-leading-4 tw-h-6 tw-whitespace-pre-wrap tw-rounded",
    w && F
  ]);
  return /* @__PURE__ */ n(
    "li",
    {
      className: "tw-flex tw-items-center tw-text-text-weak hover:tw-text-text tw-text-xs tw-transition-colors",
      "data-test-id": `${p}-item`,
      children: [
        c ?? /* @__PURE__ */ n(e, { ref: m, ...u, className: x, children: [
          i,
          r
        ] }),
        a && /* @__PURE__ */ t(T, {})
      ]
    }
  );
};
P.displayName = "FondueBreadcrumbItem";
export {
  P as BreadcrumbItem
};
//# sourceMappingURL=BreadcrumbItem.es.js.map
