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

15 lines 1.34 kB
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime"; import { FormGroup, InputGroup } from "@patternfly/react-core"; import { get } from "lodash-es"; import { FormErrorText } from "../../ui-shared/controls/FormErrorText"; import { HelpItem } from "../../ui-shared/controls/HelpItem"; import { fieldName, isRequiredAttribute, label, labelAttribute, } from "../../ui-shared/user-profile/utils"; export const UserProfileGroup = ({ t, form, attribute, renderer, children, }) => { var _a; const helpText = label(t, (_a = attribute.annotations) === null || _a === void 0 ? void 0 : _a["inputHelperTextBefore"]); const { formState: { errors }, } = form; const component = renderer === null || renderer === void 0 ? void 0 : renderer(attribute); const error = get(errors, fieldName(attribute.name)); return (_jsxs(FormGroup, { label: labelAttribute(t, attribute) || "", fieldId: attribute.name, isRequired: isRequiredAttribute(attribute), labelIcon: helpText ? (_jsx(HelpItem, { helpText: helpText, fieldLabelId: attribute.name })) : undefined, children: [component ? (_jsxs(InputGroup, { children: [children, component] })) : (children), error && (_jsx(FormErrorText, { "data-testid": `${attribute.name}-helper`, message: error.message }))] }, attribute.name)); }; //# sourceMappingURL=UserProfileGroup.js.map