UNPKG

@keycloakify/keycloak-account-ui

Version:

<p align="center"> <img src="https://github.com/user-attachments/assets/e31c4910-7205-441c-9a35-e134b806b3a8"> </p> <p align="center"> <i>Repackaged Keycloak Account UI</i> <br> <br> <a href="https://github.com/keycloakify/keycloak-a

25 lines 1.65 kB
var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Button, InputGroup, InputGroupItem, TextInput, } from "@patternfly/react-core"; import { EyeIcon, EyeSlashIcon } from "@patternfly/react-icons"; import { forwardRef, useState } from "react"; import { useTranslation } from "react-i18next"; const PasswordInputBase = (_a) => { var { hasReveal = true, innerRef } = _a, rest = __rest(_a, ["hasReveal", "innerRef"]); const { t } = useTranslation(); const [hidePassword, setHidePassword] = useState(true); return (_jsxs(InputGroup, { children: [_jsx(InputGroupItem, { isFill: true, children: _jsx(TextInput, Object.assign({}, rest, { type: hidePassword ? "password" : "text", ref: innerRef })) }), hasReveal && (_jsx(Button, { variant: "control", "aria-label": t("showPassword"), onClick: () => setHidePassword(!hidePassword), children: hidePassword ? _jsx(EyeIcon, {}) : _jsx(EyeSlashIcon, {}) }))] })); }; export const PasswordInput = forwardRef((props, ref) => (_jsx(PasswordInputBase, Object.assign({}, props, { innerRef: ref })))); PasswordInput.displayName = "PasswordInput"; //# sourceMappingURL=PasswordInput.js.map