UNPKG

fui-fancyui

Version:
35 lines (34 loc) 926 B
"use client"; import { jsxs as w, jsx as e } from "react/jsx-runtime"; import { forwardRef as c, useState as l, useEffect as u } from "react"; import y from "../PasswordEye/PasswordEye.js"; import { Wrapper as h, WrapperEye as P } from "./PasswordInput.style.js"; import E from "../RawInput/RawInput.js"; const g = c((t, a) => { const { align: p, themeType: n = "secondary", layer: m, customEyeOpen: i, customEyeCrossed: d, showPassword: r, ...f } = t, [s, o] = l(!1); return u(() => { o(r ?? !1); }, [r]), /* @__PURE__ */ w(h, { children: [ /* @__PURE__ */ e(P, { $themeType: n, $layer: m, children: /* @__PURE__ */ e( y, { customEyeOpen: i, customEyeCrossed: d, isShow: s, onClick: () => o(!s) } ) }), /* @__PURE__ */ e(E, { type: s ? "text" : "password", $align: p, ref: a, ...f }) ] }); }); export { g as default };