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

12 lines 1 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { TextArea, ValidatedOptions, } from "@patternfly/react-core"; import { useController, } from "react-hook-form"; import { FormLabel } from "../../ui-shared/controls/FormLabel"; export const TextAreaControl = (props) => { var _a, _b; const required = !!((_a = props.rules) === null || _a === void 0 ? void 0 : _a.required); const defaultValue = (_b = props.defaultValue) !== null && _b !== void 0 ? _b : ""; const { field, fieldState } = useController(Object.assign(Object.assign({}, props), { defaultValue })); return (_jsx(FormLabel, { isRequired: required, label: props.label, labelIcon: props.labelIcon, name: props.name, error: fieldState.error, children: _jsx(TextArea, Object.assign({ isRequired: required, id: props.name, "data-testid": props.name, validated: fieldState.error ? ValidatedOptions.error : ValidatedOptions.default, isDisabled: props.isDisabled }, field)) })); }; //# sourceMappingURL=TextAreaControl.js.map