keycloakify 6.8.3 → 6.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/bin/tsconfig.tsbuildinfo +1 -1
- package/lib/components/IdpReviewUserProfile.js +7 -8
- package/lib/components/IdpReviewUserProfile.js.map +1 -1
- package/lib/components/Login.js +16 -17
- package/lib/components/Login.js.map +1 -1
- package/lib/components/LoginConfigTotp.js +17 -18
- package/lib/components/LoginConfigTotp.js.map +1 -1
- package/lib/components/LoginIdpLinkConfirm.js +4 -5
- package/lib/components/LoginIdpLinkConfirm.js.map +1 -1
- package/lib/components/LoginOtp.js +17 -18
- package/lib/components/LoginOtp.js.map +1 -1
- package/lib/components/LoginPassword.js +8 -9
- package/lib/components/LoginPassword.js.map +1 -1
- package/lib/components/LoginResetPassword.js +12 -13
- package/lib/components/LoginResetPassword.js.map +1 -1
- package/lib/components/LoginUpdatePassword.js +18 -19
- package/lib/components/LoginUpdatePassword.js.map +1 -1
- package/lib/components/LoginUpdateProfile.js +28 -29
- package/lib/components/LoginUpdateProfile.js.map +1 -1
- package/lib/components/LoginUsername.js +12 -13
- package/lib/components/LoginUsername.js.map +1 -1
- package/lib/components/LogoutConfirm.js +5 -6
- package/lib/components/LogoutConfirm.js.map +1 -1
- package/lib/components/Register.js +38 -39
- package/lib/components/Register.js.map +1 -1
- package/lib/components/RegisterUserProfile.js +10 -12
- package/lib/components/RegisterUserProfile.js.map +1 -1
- package/lib/components/Template.js +26 -27
- package/lib/components/Template.js.map +1 -1
- package/lib/components/Terms.js +3 -4
- package/lib/components/Terms.js.map +1 -1
- package/lib/components/UpdateUserProfile.js +8 -9
- package/lib/components/UpdateUserProfile.js.map +1 -1
- package/lib/components/WebauthnAuthenticate.js +16 -17
- package/lib/components/WebauthnAuthenticate.js.map +1 -1
- package/lib/components/shared/UserProfileCommons.js +19 -15
- package/lib/components/shared/UserProfileCommons.js.map +1 -1
- package/lib/tools/clsx.d.ts +3 -0
- package/lib/tools/clsx.js +6 -0
- package/lib/tools/clsx.js.map +1 -0
- package/lib/tools/useCssAndCx.d.ts +7 -1
- package/lib/tools/useCssAndCx.js +9 -6
- package/lib/tools/useCssAndCx.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -7
- package/src/lib/components/IdpReviewUserProfile.tsx +7 -9
- package/src/lib/components/Login.tsx +17 -19
- package/src/lib/components/LoginConfigTotp.tsx +17 -19
- package/src/lib/components/LoginIdpLinkConfirm.tsx +4 -6
- package/src/lib/components/LoginOtp.tsx +18 -20
- package/src/lib/components/LoginPassword.tsx +8 -10
- package/src/lib/components/LoginResetPassword.tsx +12 -14
- package/src/lib/components/LoginUpdatePassword.tsx +21 -21
- package/src/lib/components/LoginUpdateProfile.tsx +29 -31
- package/src/lib/components/LoginUsername.tsx +13 -15
- package/src/lib/components/LogoutConfirm.tsx +5 -7
- package/src/lib/components/Register.tsx +40 -40
- package/src/lib/components/RegisterUserProfile.tsx +10 -20
- package/src/lib/components/Template.tsx +26 -28
- package/src/lib/components/Terms.tsx +3 -5
- package/src/lib/components/UpdateUserProfile.tsx +9 -11
- package/src/lib/components/WebauthnAuthenticate.tsx +16 -18
- package/src/lib/components/shared/UserProfileCommons.tsx +30 -27
- package/src/lib/tools/clsx.ts +7 -0
- package/src/lib/tools/useCssAndCx.ts +9 -8
@@ -10,12 +10,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
10
10
|
return t;
|
11
11
|
};
|
12
12
|
import React, { memo, useEffect, Fragment } from "react";
|
13
|
-
import {
|
13
|
+
import { clsx } from "../../tools/clsx";
|
14
14
|
import { useCallbackFactory } from "powerhooks/useCallbackFactory";
|
15
15
|
import { useFormValidationSlice } from "../../useFormValidationSlice";
|
16
16
|
export const UserProfileFormFields = memo((_a) => {
|
17
17
|
var { kcContext, onIsFormSubmittableValueChange, i18n, BeforeField, AfterField } = _a, props = __rest(_a, ["kcContext", "onIsFormSubmittableValueChange", "i18n", "BeforeField", "AfterField"]);
|
18
|
-
const { cx, css } = useCssAndCx();
|
19
18
|
const { advancedMsg } = i18n;
|
20
19
|
const { formValidationState: { fieldStateByAttributeName, isFormSubmittable }, formValidationReducer, attributesWithPassword } = useFormValidationSlice({
|
21
20
|
kcContext,
|
@@ -38,19 +37,19 @@ export const UserProfileFormFields = memo((_a) => {
|
|
38
37
|
var _a;
|
39
38
|
const { group = "", groupDisplayHeader = "", groupDisplayDescription = "" } = attribute;
|
40
39
|
const { value, displayableErrors } = fieldStateByAttributeName[attribute.name];
|
41
|
-
const formGroupClassName =
|
40
|
+
const formGroupClassName = clsx(props.kcFormGroupClass, displayableErrors.length !== 0 && props.kcFormGroupErrorClass);
|
42
41
|
return (React.createElement(Fragment, { key: i },
|
43
42
|
group !== currentGroup && (currentGroup = group) !== "" && (React.createElement("div", { className: formGroupClassName },
|
44
|
-
React.createElement("div", { className:
|
45
|
-
React.createElement("label", { id: `header-${group}`, className:
|
46
|
-
groupDisplayDescription !== "" && (React.createElement("div", { className:
|
47
|
-
React.createElement("label", { id: `description-${group}`, className: `${
|
43
|
+
React.createElement("div", { className: clsx(props.kcContentWrapperClass) },
|
44
|
+
React.createElement("label", { id: `header-${group}`, className: clsx(props.kcFormGroupHeader) }, advancedMsg(groupDisplayHeader) || currentGroup)),
|
45
|
+
groupDisplayDescription !== "" && (React.createElement("div", { className: clsx(props.kcLabelWrapperClass) },
|
46
|
+
React.createElement("label", { id: `description-${group}`, className: `${clsx(props.kcLabelClass)}` }, advancedMsg(groupDisplayDescription)))))),
|
48
47
|
BeforeField && React.createElement(BeforeField, { attribute: attribute }),
|
49
48
|
React.createElement("div", { className: formGroupClassName },
|
50
|
-
React.createElement("div", { className:
|
51
|
-
React.createElement("label", { htmlFor: attribute.name, className:
|
49
|
+
React.createElement("div", { className: clsx(props.kcLabelWrapperClass) },
|
50
|
+
React.createElement("label", { htmlFor: attribute.name, className: clsx(props.kcLabelClass) }, advancedMsg((_a = attribute.displayName) !== null && _a !== void 0 ? _a : "")),
|
52
51
|
attribute.required && React.createElement(React.Fragment, null, "*")),
|
53
|
-
React.createElement("div", { className:
|
52
|
+
React.createElement("div", { className: clsx(props.kcInputWrapperClass) },
|
54
53
|
(() => {
|
55
54
|
const { options } = attribute.validators;
|
56
55
|
if (options !== undefined) {
|
@@ -64,12 +63,17 @@ export const UserProfileFormFields = memo((_a) => {
|
|
64
63
|
default:
|
65
64
|
return "text";
|
66
65
|
}
|
67
|
-
})(), id: attribute.name, name: attribute.name, value: value, onChange: onChangeFactory(attribute.name), className:
|
66
|
+
})(), id: attribute.name, name: attribute.name, value: value, onChange: onChangeFactory(attribute.name), className: clsx(props.kcInputClass), "aria-invalid": displayableErrors.length !== 0, disabled: attribute.readOnly, autoComplete: attribute.autocomplete, onBlur: onBlurFactory(attribute.name) }));
|
68
67
|
})(),
|
69
|
-
displayableErrors.length !== 0 &&
|
70
|
-
|
71
|
-
|
72
|
-
|
68
|
+
displayableErrors.length !== 0 &&
|
69
|
+
(() => {
|
70
|
+
const divId = `input-error-${attribute.name}`;
|
71
|
+
return (React.createElement(React.Fragment, null,
|
72
|
+
React.createElement("style", null, `#${divId} > span: { display: block; }`),
|
73
|
+
React.createElement("span", { id: divId, className: clsx(props.kcInputErrorMessageClass), style: {
|
74
|
+
"position": displayableErrors.length === 1 ? "absolute" : undefined
|
75
|
+
}, "aria-live": "polite" }, displayableErrors.map(({ errorMessage }) => errorMessage))));
|
76
|
+
})())),
|
73
77
|
AfterField && React.createElement(AfterField, { attribute: attribute })));
|
74
78
|
})));
|
75
79
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UserProfileCommons.js","sourceRoot":"","sources":["../../../src/lib/components/shared/UserProfileCommons.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,EAAE,
|
1
|
+
{"version":3,"file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I,CAAC,CAAC;AAC5B,CAAC,CAAC"}
|
@@ -1,4 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* @deprecated: Use clsx instead.
|
3
|
+
* import { clsx } from "keycloakify/lib/tools/clsx";
|
4
|
+
* You can use clsx as cx.
|
5
|
+
* If you where using the css() function you can import
|
6
|
+
* it from @emotion/css: https://emotion.sh/docs/@emotion/css
|
7
|
+
*/
|
1
8
|
export declare function useCssAndCx(): {
|
2
|
-
css: import("tss-react").Css;
|
3
9
|
cx: import("tss-react").Cx;
|
4
10
|
};
|
package/lib/tools/useCssAndCx.js
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
}
|
1
|
+
import { clsx as cx } from "./clsx";
|
2
|
+
/**
|
3
|
+
* @deprecated: Use clsx instead.
|
4
|
+
* import { clsx } from "keycloakify/lib/tools/clsx";
|
5
|
+
* You can use clsx as cx.
|
6
|
+
* If you where using the css() function you can import
|
7
|
+
* it from @emotion/css: https://emotion.sh/docs/@emotion/css
|
8
|
+
*/
|
5
9
|
export function useCssAndCx() {
|
6
|
-
|
7
|
-
return { css, cx };
|
10
|
+
return { cx };
|
8
11
|
}
|
9
12
|
//# sourceMappingURL=useCssAndCx.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCssAndCx.js","sourceRoot":"","sources":["../../src/lib/tools/useCssAndCx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"useCssAndCx.js","sourceRoot":"","sources":["../../src/lib/tools/useCssAndCx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,UAAU,WAAW;IACvB,OAAO,EAAE,EAAE,EAAE,CAAC;AAClB,CAAC"}
|