fui-fancyui
Version:
FancyUI Libary
85 lines (84 loc) • 1.93 kB
JavaScript
"use client";
import { jsx as c } from "react/jsx-runtime";
import { forwardRef as M, useState as O, useId as R } from "react";
import { css as W } from "styled-components";
import j from "../../atoms/NumberInput/NumberInput.js";
import E from "../../molecules/InputWrapper/InputWrapper.js";
import P from "../../../design/designFunctions/getOpositMainThemeType/getOpositMainThemeType.js";
const H = M((f, y) => {
const {
value: e,
label: h,
icon: I,
disabled: r,
systemMessage: g,
align: o = "left",
id: n,
themeType: s = "primary",
layer: b = 2,
autoWidth: i,
underline: v,
placeholder: a,
onFocus: u,
onBlur: l,
transparentBackground: B,
outlined: x,
outlinedBackgroundStrength: S,
outlinedRemoveBorder: T,
externalStyle: F,
className: N,
readOnly: d,
...k
} = f, [w, m] = O(!1), A = R(), p = n || A;
return /* @__PURE__ */ c(
E,
{
id: p,
hasValue: !!(e !== 0 && e || e === 0),
label: h,
disabled: r || d,
align: o,
placeholder: a,
isActive: w,
icon: I,
underline: v,
autoWidth: i,
systemMessage: g,
themeType: s,
layer: b,
className: N,
outlined: x,
outlinedBackgroundStrength: S,
outlinedRemoveBorder: T,
transparentBackground: B,
externalStyle: F,
InputElement: /* @__PURE__ */ c(
j,
{
ref: y,
id: p,
value: e,
align: o,
themeType: P(s),
disabled: r,
readOnly: d,
onFocus: (t) => {
u && u(t), m(!0);
},
onBlur: (t) => {
l && l(t), m(!1);
},
placeholder: a,
autoWidth: i,
externalStyle: W`
transition: width 0.3s ease-in-out;
`,
...k
}
)
}
);
});
export {
H as default
};