UNPKG

fui-fancyui

Version:
34 lines (33 loc) 763 B
"use client"; import { jsx as m } from "react/jsx-runtime"; import { forwardRef as p, useState as y } from "react"; import { StyledSingleInput as d } from "./SingleInput.style.js"; const g = p((l, r) => { const { value: t, onKeyDown: u, themeType: a, layer: f, onFocus: o, onBlur: n, externalStyle: i } = l, [c, s] = y(!1); return /* @__PURE__ */ m( d, { type: "text", $themeType: a, $layer: f, maxLength: 1, value: t, onKeyDown: u, ref: r, onChange: () => { }, onFocus: (e) => { s(!0), o && o(e); }, onBlur: (e) => { s(!1), n && n(e); }, $hasValue: t.length > 0, $isFocused: c, $externalStyle: i } ); }); export { g as default };