dgz-ui
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript
42 lines (41 loc) • 1.06 kB
JavaScript
import { j as s } from "./jsx-runtime-C5mzlN2N.js";
import * as l from "react";
import { P as d } from "./index-Do92jweN.js";
import { c as f } from "./utils-B6fNqzRf.js";
var v = "Separator", n = "horizontal", N = ["horizontal", "vertical"], p = l.forwardRef((r, o) => {
const { decorative: t, orientation: a = n, ...i } = r, e = u(a) ? a : n, c = t ? { role: "none" } : { "aria-orientation": e === "vertical" ? e : void 0, role: "separator" };
return /* @__PURE__ */ s.jsx(
d.div,
{
"data-orientation": e,
...c,
...i,
ref: o
}
);
});
p.displayName = v;
function u(r) {
return N.includes(r);
}
var m = p;
const h = l.forwardRef(
({ className: r, orientation: o = "horizontal", decorative: t = !0, ...a }, i) => /* @__PURE__ */ s.jsx(
m,
{
ref: i,
decorative: t,
orientation: o,
className: f(
"bg-border shrink-0",
o === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
r
),
...a
}
)
);
h.displayName = m.displayName;
export {
h as S
};