UNPKG

@carton-org/react-neumorphism

Version:

A React component library implementing the neumorphism design style

30 lines (29 loc) 985 B
import { jsxs as c, jsx as m } from "@emotion/react/jsx-runtime"; import { withTheme as i } from "@emotion/react"; import { forwardRef as v } from "react"; import { StyledButton as y } from "./button.styles.js"; import I from "../../icons/SpinnerIcon.js"; import h from "../Typography/Typography.js"; const b = v(({ size: n = "sm", iconLeft: r, iconRight: o, isLoading: t = !1, rounded: a = !1, border: e = !1, labelStyle: f, buttonStyle: p, children: s, theme: u, ...l }, $) => { const d = (r !== void 0 || o !== void 0) && s === void 0; return /* @__PURE__ */ c(y, { ref: $, $size: n, $rounded: a, $border: e, $hasIcon: r !== void 0 || o !== void 0, $hasOnlyIcon: d, $isLoading: t, $buttonStyle: p, disabled: t || l.disabled, ...l, children: [ r, d ? null : /* @__PURE__ */ m(h, { size: n, labelStyle: f, children: s }), t ? /* @__PURE__ */ m(I, { color: u.fontColor }) : o !== void 0 ? o : null ] }); }), C = i(b); export { C as default };