@stanfordspezi/spezi-web-design-system
Version:
Stanford Biodesign Digital Health Spezi Web Design System
60 lines (59 loc) • 1.31 kB
JavaScript
import { jsx as e } from "react/jsx-runtime";
import { c as l } from "./index-2NvaPZWc.mjs";
import * as m from "react";
import { P as v } from "./index-WWNfSPCj.mjs";
var d = "Separator", s = "horizontal", f = ["horizontal", "vertical"], c = m.forwardRef((r, a) => {
const { decorative: o, orientation: t = s, ...i } = r, n = u(t) ? t : s, p = o ? { role: "none" } : { "aria-orientation": n === "vertical" ? n : void 0, role: "separator" };
return /* @__PURE__ */ e(
v.div,
{
"data-orientation": n,
...p,
...i,
ref: a
}
);
});
c.displayName = d;
function u(r) {
return f.includes(r);
}
var x = c;
const T = ({
className: r,
orientation: a = "horizontal",
decorative: o,
children: t,
...i
}) => /* @__PURE__ */ e(
x,
{
decorative: o ?? !!t,
orientation: a,
className: l(
"bg-border relative shrink-0",
a === "horizontal" ? "h-[1px] w-full" : "h -full w-[1px]",
r
),
...i,
children: t
}
), b = ({
className: r,
children: a,
...o
}) => /* @__PURE__ */ e(
"div",
{
className: l(
"flex-center absolute -top-2.5 left-0 w-full text-sm",
r
),
...o,
children: /* @__PURE__ */ e("div", { className: "bg-surface text-border px-4", children: a })
}
);
export {
T as S,
b as a
};