UNPKG

@carton-org/react-neumorphism

Version:

A React component library implementing the neumorphism design style

32 lines (31 loc) 1.08 kB
import { jsxs as p, jsx as s } from "@emotion/react/jsx-runtime"; import { withTheme as h } from "@emotion/react"; import { forwardRef as u } from "react"; import { getIconDisplay as l } from "../../utils/icon.js"; import I from "../Typography/Typography.js"; import { StyledInputLabel as g, StyledInputContainer as v, StyledInput as x } from "./input.styles.js"; const D = u(({ label: r, inputSize: t = "sm", iconLeft: n, iconRight: e, iconStyle: o = "outline", disabled: i, inputStyle: m, inputContainerStyle: a, inputLabelStyle: d, ...f }, y) => { const $ = l(n, o, t), c = l(e, o, t); return /* @__PURE__ */ p(g, { $inputSize: t, children: [ r !== void 0 && /* @__PURE__ */ s(I, { size: t, labelStyle: d, children: r }), /* @__PURE__ */ p(v, { $inputSize: t, $iconStyle: o, $hasIconLeft: n !== void 0, $hasIconRight: e !== void 0, $disabled: i, $inputContainerStyle: a, children: [ $, /* @__PURE__ */ s(x, { ref: y, $inputSize: t, disabled: i, $inputStyle: m, ...f }), c ] }) ] }); }), T = h(D); export { T as default };