@mankindui/core
Version:
- a react component library - you can see how @mankindui/core can be used via examples: [usage examples](https://github.com/clarklindev/mankindui-test)
90 lines (89 loc) • 2.75 kB
JavaScript
import { j as r } from "../../_virtual/jsx-runtime.js";
import { useRef as f } from "react";
const o = ({ variation: t = "horizontal", children: e, ...a }) => {
const l = f(null);
switch (t) {
case "horizontal":
return /* @__PURE__ */ r.jsx(
"div",
{
"data-component": `${o.displayName}-Horizontal`,
className: [e ? "border-none" : "border-b border-gray-400/50 border-solid", e ? "m-0" : "my-0 mx-0", "inline-flex flex-row", "relative", "w-full"].join(" "),
...a,
children: e && /* @__PURE__ */ r.jsx(
"span",
{
className: [
"flex",
"flex-row",
"items-center",
"w-full",
"relative",
"before:w-full",
"before:content-[' ']",
"before:border-b",
"before:border-solid",
"before:border-gray-400/50",
"before:mr-4",
"after:w-full",
"after:content-[' ']",
"after:border-b",
"after:border-solid",
"after:border-gray-400/50",
"after:ml-4"
].join(" "),
children: e
}
)
}
);
case "vertical":
return /* @__PURE__ */ r.jsx(
"div",
{
ref: l,
"data-component": `${o.displayName}-Vertical`,
className: ["h-full relative inline-flex items-stretch", e ? "border-r-0" : "border-r border-solid border-gray-400/50 ", e ? "m-0" : "my-0 mx-2.5"].join(" "),
...a,
children: e && /* @__PURE__ */ r.jsx(
"span",
{
className: [
"flex",
"flex-col",
"items-center",
"h-full",
"relative",
"w-5",
"overflow-wrap-normal",
"before:flex",
"before:h-full",
"before:min-h-5",
"before:content-[' ']",
"before:border-r",
"before:border-solid",
"before:border-gray-400/50",
"before:mb-4",
"after:flex",
"after:h-full",
"after:min-h-5",
"after:content-[' ']",
"after:border-r",
"after:border-solid",
"after:border-gray-400/50",
"after:mt-4"
].join(" "),
children: e
}
)
}
);
default:
return null;
}
};
o.displayName = "Divider";
export {
o as Divider
};
//# sourceMappingURL=index.js.map