@stanfordspezi/spezi-web-design-system
Version:
Stanford Biodesign Digital Health Spezi Web Design System
67 lines (66 loc) • 1.43 kB
JavaScript
import { jsx as r } from "react/jsx-runtime";
import { c as i } from "./index-2NvaPZWc.mjs";
import * as l from "react";
import "react-dom";
import { c as p } from "./index-D2LZVjSn.mjs";
var u = [
"a",
"button",
"div",
"form",
"h2",
"h3",
"img",
"input",
"label",
"li",
"nav",
"ol",
"p",
"select",
"span",
"svg",
"ul"
], b = u.reduce((t, e) => {
const a = p(`Primitive.${e}`), o = l.forwardRef((n, m) => {
const { asChild: d, ...c } = n, f = d ? a : e;
return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ r(f, { ...c, ref: m });
});
return o.displayName = `Primitive.${e}`, { ...t, [e]: o };
}, {}), v = "Label", s = l.forwardRef((t, e) => /* @__PURE__ */ r(
b.label,
{
...t,
ref: e,
onMouseDown: (a) => {
a.target.closest("button, input, select, textarea") || (t.onMouseDown?.(a), !a.defaultPrevented && a.detail > 1 && a.preventDefault());
}
}
));
s.displayName = v;
var w = s;
const L = ({ className: t, ...e }) => /* @__PURE__ */ r(
w,
{
"data-slot": "label",
className: i(
"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
t
),
...e
}
), P = ({
className: t,
...e
}) => /* @__PURE__ */ r(
"div",
{
"data-slot": "label-container",
className: i("mb-2 flex gap-2", t),
...e
}
);
export {
L,
P as a
};