UNPKG

@teamsparta/stack-divider

Version:
44 lines (41 loc) 1.01 kB
import { __objRest, __spreadValues, getDividerStyle } from "./chunk-4DVIHWZB.mjs"; // src/Divider.tsx import { primitiveColor } from "@teamsparta/stack-tokens"; import { forwardRef } from "react"; import { jsx } from "@emotion/react/jsx-runtime"; var DEFAULT_ORIENTATION = "horizontal"; var Divider = forwardRef(function Divider2(_a, ref) { var _b = _a, { as, size = 1, color = primitiveColor.neutral[80], decorative = false, orientation = DEFAULT_ORIENTATION, isFlexItem = false } = _b, restProps = __objRest(_b, [ "as", "size", "color", "decorative", "orientation", "isFlexItem" ]); const Component = as || "hr"; const semanticProps = decorative ? { role: "none" } : { role: "separator", "aria-orientation": orientation }; return /* @__PURE__ */ jsx( Component, __spreadValues(__spreadValues({ ref, css: getDividerStyle(size, color, orientation, isFlexItem) }, semanticProps), restProps) ); }); export { Divider };