@stanfordspezi/spezi-web-design-system
Version:
Stanford Biodesign Digital Health Spezi Web Design System
87 lines (86 loc) • 1.91 kB
JavaScript
import { jsx as n } from "react/jsx-runtime";
import { c as p } from "./index-2NvaPZWc.mjs";
import * as m from "react";
import "react-dom";
import { c as f } from "./index-D2LZVjSn.mjs";
var u = [
"a",
"button",
"div",
"form",
"h2",
"h3",
"img",
"input",
"label",
"li",
"nav",
"ol",
"p",
"select",
"span",
"svg",
"ul"
], N = u.reduce((t, r) => {
const o = f(`Primitive.${r}`), a = m.forwardRef((e, i) => {
const { asChild: l, ...s } = e, v = l ? o : r;
return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ n(v, { ...s, ref: i });
});
return a.displayName = `Primitive.${r}`, { ...t, [r]: a };
}, {}), x = "Separator", c = "horizontal", h = ["horizontal", "vertical"], d = m.forwardRef((t, r) => {
const { decorative: o, orientation: a = c, ...e } = t, i = S(a) ? a : c, s = o ? { role: "none" } : { "aria-orientation": i === "vertical" ? i : void 0, role: "separator" };
return /* @__PURE__ */ n(
N.div,
{
"data-orientation": i,
...s,
...e,
ref: r
}
);
});
d.displayName = x;
function S(t) {
return h.includes(t);
}
var w = d;
const T = ({
className: t,
orientation: r = "horizontal",
decorative: o,
children: a,
...e
}) => /* @__PURE__ */ n(
w,
{
"data-slot": "separator",
decorative: o ?? !!a,
orientation: r,
className: p(
"bg-border relative shrink-0",
r === "horizontal" ? "h-[1px] w-full" : "h -full w-[1px]",
t
),
...e,
children: a
}
), E = ({
className: t,
children: r,
...o
}) => /* @__PURE__ */ n(
"div",
{
"data-slot": "separator-text",
className: p(
"flex-center absolute -top-2.5 left-0 w-full text-sm",
t
),
...o,
children: /* @__PURE__ */ n("div", { className: "bg-surface text-border px-4", children: r })
}
);
export {
T as S,
E as a
};