import { jsx as l } from "react/jsx-runtime";
import { c as y, a as f } from "../index-BmAFn37q.mjs";
import { tw as t } from "@spark-ui/internal-utils";
import * as z from "react";
import { P as E } from "../index-MSR-vgWR.mjs";
var h = "Separator", c = "horizontal", x = ["horizontal", "vertical"], d = z.forwardRef((r, i) => {
  const { decorative: n, orientation: e = c, ...a } = r, o = N(e) ? e : c, s = n ? { role: "none" } : { "aria-orientation": o === "vertical" ? o : void 0, role: "separator" };
  return /* @__PURE__ */ l(
    E.div,
    {
      "data-orientation": o,
      ...s,
      ...a,
      ref: i
    }
  );
});
d.displayName = h;
function N(r) {
  return x.includes(r);
}
var D = d;
const O = [
  // current
  {
    intent: "current",
    isEmpty: !0,
    class: t(["border-current"])
  },
  {
    intent: "current",
    isEmpty: !1,
    class: t(["before:border-current after:border-current"])
  },
  // outline
  {
    intent: "outline",
    isEmpty: !0,
    class: t(["border-outline"])
  },
  {
    intent: "outline",
    isEmpty: !1,
    class: t(["before:border-outline after:border-outline"])
  }
], M = y(["overflow-hidden group"], {
  variants: {
    isEmpty: {
      true: ["border-solid"],
      false: ["inline-flex items-center", "after:border-solid before:border-solid"]
    },
    orientation: {
      vertical: ["w-fit inline-flex"],
      horizontal: ["w-full"]
    },
    writingMode: {
      "horizontal-tb": [],
      "vertical-lr": []
    },
    alignment: {
      start: [],
      end: [],
      center: []
    },
    intent: {
      current: [],
      outline: []
    }
  },
  defaultVariants: {
    orientation: "horizontal",
    writingMode: "horizontal-tb",
    alignment: "center",
    intent: "outline"
  },
  compoundVariants: [
    {
      isEmpty: !0,
      orientation: "horizontal",
      class: t(["my-lg border-t-sm"])
    },
    {
      isEmpty: !0,
      orientation: "vertical",
      class: t(["mx-lg min-h-sz-24 border-l-sm"])
    },
    {
      isEmpty: !1,
      orientation: "horizontal",
      writingMode: "horizontal-tb",
      class: t(["flex-row my-sm grow-0", "before:border-t-sm", "after:border-t-sm", "*:px-lg"])
    },
    {
      isEmpty: !1,
      orientation: "vertical",
      writingMode: "horizontal-tb",
      class: t(["flex-col mx-sm", "before:border-l-sm", "after:border-l-sm", "*:py-lg"])
    },
    {
      isEmpty: !1,
      orientation: "vertical",
      writingMode: "vertical-lr",
      class: t(["flex-col mx-sm", "before:border-l-sm", "after:border-l-sm", "*:px-lg"])
    },
    {
      isEmpty: !1,
      orientation: "horizontal",
      alignment: "end",
      class: t(["after:w-sz-40 before:grow after:grow-0"])
    },
    {
      isEmpty: !1,
      orientation: "horizontal",
      alignment: "start",
      class: t(["before:w-sz-40 before:grow-0 after:grow"])
    },
    {
      isEmpty: !1,
      orientation: "horizontal",
      alignment: "center",
      class: t(["justify-center before:grow after:grow"])
    },
    {
      isEmpty: !1,
      orientation: "vertical",
      alignment: "end",
      class: t(["after:h-sz-40 before:grow after:grow-0 before:min-h-sz-40"])
    },
    {
      isEmpty: !1,
      orientation: "vertical",
      alignment: "start",
      class: t(["before:h-sz-40 before:grow-0 after:grow after:min-h-sz-40"])
    },
    {
      isEmpty: !1,
      orientation: "vertical",
      alignment: "center",
      class: t(["justify-center before:grow after:grow before:min-h-sz-40 after:min-h-sz-40"])
    },
    ...O
  ]
}), p = ({
  asChild: r,
  className: i,
  isDecorative: n = !1,
  children: e,
  orientation: a = "horizontal",
  writingMode: o = "horizontal-tb",
  alignment: m = "center",
  intent: s = "outline",
  ref: v,
  ...u
}) => {
  const w = r ? !e?.props?.children : !e;
  return /* @__PURE__ */ l(
    D,
    {
      "data-spark-component": "divider",
      asChild: r,
      className: f(
        M({ isEmpty: w, orientation: a, alignment: m, intent: s, writingMode: o }),
        i
      ),
      orientation: a,
      ref: v,
      decorative: n,
      ...u,
      "data-writing-mode": o,
      children: e
    }
  );
};
p.displayName = "Divider";
const b = ({ children: r, ref: i, className: n, ...e }) => r ? /* @__PURE__ */ l(
  "span",
  {
    "data-spark-component": "divider-content",
    ref: i,
    ...e,
    className: f("group-data-[writing-mode=vertical-lr]:[writing-mode:vertical-lr]", n),
    children: r
  }
) : null;
b.displayName = "Divider.Content";
const g = Object.assign(p, {
  Content: b
});
g.displayName = "Divider";
g.Content.displayName = "Divider.Content";
export {
  g as Divider
};
//# sourceMappingURL=index.mjs.map
