UNPKG

@konstructio/ui

Version:

A set of reusable and customizable React components built for konstruct.io

43 lines (42 loc) 896 B
import { jsx as h } from "react/jsx-runtime"; import { forwardRef as c } from "react"; import { S as u } from "../../index-B_6_jmOO.js"; import { cn as l } from "../../utils/index.js"; import { buttonVariants as x } from "./Button.variants.js"; import { useTheme as T } from "../../contexts/theme.hook.js"; const B = c( ({ className: o, variant: e, theme: m, size: r, version: n, disabled: t = !1, asChild: s = !1, ...i }, f) => { const a = s ? u : "button", { theme: p } = T(); return /* @__PURE__ */ h( a, { ref: f, className: l( x({ variant: e, disabled: t, theme: m ?? p, size: r, className: o, version: n }) ), disabled: t, ...i } ); } ); B.displayName = "Button"; export { B as Button };