keycloakify 10.0.0-rc.37 → 10.0.0-rc.39

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.
Files changed (307) hide show
  1. package/account/Fallback.d.ts +1 -2
  2. package/account/Fallback.js.map +1 -1
  3. package/account/KcContext/KcContext.d.ts +6 -6
  4. package/account/KcContext/getKcContextMock.d.ts +9 -9
  5. package/account/KcContext/getKcContextMock.js +3 -3
  6. package/account/KcContext/getKcContextMock.js.map +1 -1
  7. package/account/Template.d.ts +1 -2
  8. package/account/Template.js +7 -6
  9. package/account/Template.js.map +1 -1
  10. package/account/TemplateProps.d.ts +1 -3
  11. package/account/i18n/i18n.d.ts +9 -4
  12. package/account/i18n/i18n.js +132 -87
  13. package/account/i18n/i18n.js.map +1 -1
  14. package/account/i18n/index.d.ts +9 -2
  15. package/account/i18n/index.js +5 -1
  16. package/account/i18n/index.js.map +1 -1
  17. package/account/lib/kcClsx.d.ts +9 -0
  18. package/account/lib/{useGetClassName.js → kcClsx.js} +3 -3
  19. package/account/lib/kcClsx.js.map +1 -0
  20. package/account/pages/Account.d.ts +1 -2
  21. package/account/pages/Account.js +9 -7
  22. package/account/pages/Account.js.map +1 -1
  23. package/account/pages/Applications.d.ts +1 -2
  24. package/account/pages/Applications.js +7 -7
  25. package/account/pages/Applications.js.map +1 -1
  26. package/account/pages/FederatedIdentity.d.ts +1 -2
  27. package/account/pages/FederatedIdentity.js +4 -3
  28. package/account/pages/FederatedIdentity.js.map +1 -1
  29. package/account/pages/Log.d.ts +1 -2
  30. package/account/pages/Log.js +6 -5
  31. package/account/pages/Log.js.map +1 -1
  32. package/account/pages/PageProps.d.ts +2 -4
  33. package/account/pages/Password.d.ts +1 -2
  34. package/account/pages/Password.js +10 -9
  35. package/account/pages/Password.js.map +1 -1
  36. package/account/pages/Sessions.d.ts +1 -2
  37. package/account/pages/Sessions.js +6 -6
  38. package/account/pages/Sessions.js.map +1 -1
  39. package/account/pages/Totp.d.ts +1 -2
  40. package/account/pages/Totp.js +6 -5
  41. package/account/pages/Totp.js.map +1 -1
  42. package/bin/193.index.js +13 -13
  43. package/bin/{430.index.js → 214.index.js} +161 -2
  44. package/bin/3.index.js +165 -149
  45. package/bin/322.index.js +595 -0
  46. package/bin/453.index.js +3 -3
  47. package/bin/526.index.js +42 -632
  48. package/bin/538.index.js +563 -0
  49. package/bin/932.index.js +7 -7
  50. package/bin/{890.index.js → 941.index.js} +2 -159
  51. package/bin/944.index.js +621 -0
  52. package/bin/961.index.js +5 -5
  53. package/bin/97.index.js +3 -3
  54. package/bin/{314.index.js → 98.index.js} +217 -48
  55. package/bin/main.js +20 -8
  56. package/lib/getKcClsx.d.ts +11 -0
  57. package/lib/getKcClsx.js +55 -0
  58. package/lib/getKcClsx.js.map +1 -0
  59. package/login/Fallback.d.ts +2 -2
  60. package/login/Fallback.js.map +1 -1
  61. package/login/KcContext/KcContext.d.ts +6 -6
  62. package/login/KcContext/getKcContextMock.d.ts +9 -9
  63. package/login/KcContext/getKcContextMock.js +3 -3
  64. package/login/KcContext/getKcContextMock.js.map +1 -1
  65. package/login/Template.d.ts +1 -2
  66. package/login/Template.js +10 -9
  67. package/login/Template.js.map +1 -1
  68. package/login/TemplateProps.d.ts +1 -3
  69. package/login/UserProfileFormFields.d.ts +6 -5
  70. package/login/UserProfileFormFields.js +35 -36
  71. package/login/UserProfileFormFields.js.map +1 -1
  72. package/login/i18n/i18n.d.ts +9 -4
  73. package/login/i18n/i18n.js +136 -91
  74. package/login/i18n/i18n.js.map +1 -1
  75. package/login/i18n/index.d.ts +9 -2
  76. package/login/i18n/index.js +5 -1
  77. package/login/i18n/index.js.map +1 -1
  78. package/login/lib/kcClsx.d.ts +9 -0
  79. package/login/lib/{useGetClassName.js → kcClsx.js} +3 -3
  80. package/login/lib/kcClsx.js.map +1 -0
  81. package/login/lib/useUserProfileForm.d.ts +9 -6
  82. package/login/lib/useUserProfileForm.js +7 -5
  83. package/login/lib/useUserProfileForm.js.map +1 -1
  84. package/login/pages/Code.d.ts +1 -2
  85. package/login/pages/Code.js +6 -5
  86. package/login/pages/Code.js.map +1 -1
  87. package/login/pages/DeleteAccountConfirm.d.ts +1 -2
  88. package/login/pages/DeleteAccountConfirm.js +7 -7
  89. package/login/pages/DeleteAccountConfirm.js.map +1 -1
  90. package/login/pages/DeleteCredential.d.ts +1 -2
  91. package/login/pages/DeleteCredential.js +6 -6
  92. package/login/pages/DeleteCredential.js.map +1 -1
  93. package/login/pages/Error.d.ts +1 -2
  94. package/login/pages/Error.js +4 -3
  95. package/login/pages/Error.js.map +1 -1
  96. package/login/pages/FrontchannelLogout.d.ts +1 -2
  97. package/login/pages/FrontchannelLogout.js +4 -3
  98. package/login/pages/FrontchannelLogout.js.map +1 -1
  99. package/login/pages/IdpReviewUserProfile.d.ts +2 -2
  100. package/login/pages/IdpReviewUserProfile.js +6 -6
  101. package/login/pages/IdpReviewUserProfile.js.map +1 -1
  102. package/login/pages/Info.d.ts +1 -2
  103. package/login/pages/Info.js +4 -3
  104. package/login/pages/Info.js.map +1 -1
  105. package/login/pages/Login.d.ts +1 -2
  106. package/login/pages/Login.js +10 -8
  107. package/login/pages/Login.js.map +1 -1
  108. package/login/pages/LoginConfigTotp.d.ts +1 -2
  109. package/login/pages/LoginConfigTotp.js +8 -7
  110. package/login/pages/LoginConfigTotp.js.map +1 -1
  111. package/login/pages/LoginIdpLinkConfirm.d.ts +1 -2
  112. package/login/pages/LoginIdpLinkConfirm.js +6 -6
  113. package/login/pages/LoginIdpLinkConfirm.js.map +1 -1
  114. package/login/pages/LoginIdpLinkEmail.d.ts +1 -2
  115. package/login/pages/LoginIdpLinkEmail.js +4 -3
  116. package/login/pages/LoginIdpLinkEmail.js.map +1 -1
  117. package/login/pages/LoginOauth2DeviceVerifyUserCode.d.ts +1 -2
  118. package/login/pages/LoginOauth2DeviceVerifyUserCode.js +6 -6
  119. package/login/pages/LoginOauth2DeviceVerifyUserCode.js.map +1 -1
  120. package/login/pages/LoginOauthGrant.d.ts +1 -2
  121. package/login/pages/LoginOauthGrant.js +7 -7
  122. package/login/pages/LoginOauthGrant.js.map +1 -1
  123. package/login/pages/LoginOtp.d.ts +1 -2
  124. package/login/pages/LoginOtp.js +6 -6
  125. package/login/pages/LoginOtp.js.map +1 -1
  126. package/login/pages/LoginPageExpired.d.ts +1 -2
  127. package/login/pages/LoginPageExpired.js +4 -3
  128. package/login/pages/LoginPageExpired.js.map +1 -1
  129. package/login/pages/LoginPassword.d.ts +1 -2
  130. package/login/pages/LoginPassword.js +9 -7
  131. package/login/pages/LoginPassword.js.map +1 -1
  132. package/login/pages/LoginRecoveryAuthnCodeConfig.d.ts +1 -2
  133. package/login/pages/LoginRecoveryAuthnCodeConfig.js +9 -7
  134. package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -1
  135. package/login/pages/LoginRecoveryAuthnCodeInput.d.ts +1 -2
  136. package/login/pages/LoginRecoveryAuthnCodeInput.js +6 -6
  137. package/login/pages/LoginRecoveryAuthnCodeInput.js.map +1 -1
  138. package/login/pages/LoginResetOtp.d.ts +1 -2
  139. package/login/pages/LoginResetOtp.js +6 -6
  140. package/login/pages/LoginResetOtp.js.map +1 -1
  141. package/login/pages/LoginResetPassword.d.ts +1 -2
  142. package/login/pages/LoginResetPassword.js +7 -7
  143. package/login/pages/LoginResetPassword.js.map +1 -1
  144. package/login/pages/LoginUpdatePassword.d.ts +1 -2
  145. package/login/pages/LoginUpdatePassword.js +10 -9
  146. package/login/pages/LoginUpdatePassword.js.map +1 -1
  147. package/login/pages/LoginUpdateProfile.d.ts +2 -2
  148. package/login/pages/LoginUpdateProfile.js +7 -12
  149. package/login/pages/LoginUpdateProfile.js.map +1 -1
  150. package/login/pages/LoginUsername.d.ts +1 -2
  151. package/login/pages/LoginUsername.js +8 -7
  152. package/login/pages/LoginUsername.js.map +1 -1
  153. package/login/pages/LoginVerifyEmail.d.ts +1 -2
  154. package/login/pages/LoginVerifyEmail.js +4 -3
  155. package/login/pages/LoginVerifyEmail.js.map +1 -1
  156. package/login/pages/LoginX509Info.d.ts +1 -2
  157. package/login/pages/LoginX509Info.js +6 -6
  158. package/login/pages/LoginX509Info.js.map +1 -1
  159. package/login/pages/LogoutConfirm.d.ts +1 -2
  160. package/login/pages/LogoutConfirm.js +6 -6
  161. package/login/pages/LogoutConfirm.js.map +1 -1
  162. package/login/pages/PageProps.d.ts +2 -4
  163. package/login/pages/Register.d.ts +2 -2
  164. package/login/pages/Register.js +8 -16
  165. package/login/pages/Register.js.map +1 -1
  166. package/login/pages/SamlPostForm.d.ts +1 -2
  167. package/login/pages/SamlPostForm.js +4 -3
  168. package/login/pages/SamlPostForm.js.map +1 -1
  169. package/login/pages/SelectAuthenticator.d.ts +1 -2
  170. package/login/pages/SelectAuthenticator.js +6 -9
  171. package/login/pages/SelectAuthenticator.js.map +1 -1
  172. package/login/pages/Terms.d.ts +1 -2
  173. package/login/pages/Terms.js +6 -6
  174. package/login/pages/Terms.js.map +1 -1
  175. package/login/pages/UpdateEmail.d.ts +2 -2
  176. package/login/pages/UpdateEmail.js +8 -12
  177. package/login/pages/UpdateEmail.js.map +1 -1
  178. package/login/pages/WebauthnAuthenticate.d.ts +1 -2
  179. package/login/pages/WebauthnAuthenticate.js +13 -12
  180. package/login/pages/WebauthnAuthenticate.js.map +1 -1
  181. package/login/pages/WebauthnError.d.ts +1 -2
  182. package/login/pages/WebauthnError.js +7 -7
  183. package/login/pages/WebauthnError.js.map +1 -1
  184. package/login/pages/WebauthnRegister.d.ts +1 -2
  185. package/login/pages/WebauthnRegister.js +9 -8
  186. package/login/pages/WebauthnRegister.js.map +1 -1
  187. package/package.json +27 -22
  188. package/src/account/Fallback.tsx +1 -2
  189. package/src/account/KcContext/KcContext.ts +7 -7
  190. package/src/account/KcContext/getKcContextMock.ts +13 -24
  191. package/src/account/Template.tsx +8 -8
  192. package/src/account/TemplateProps.ts +1 -6
  193. package/src/account/i18n/i18n.tsx +204 -125
  194. package/src/account/i18n/index.ts +10 -2
  195. package/src/account/lib/{useGetClassName.ts → kcClsx.ts} +6 -2
  196. package/src/account/pages/Account.tsx +15 -21
  197. package/src/account/pages/Applications.tsx +8 -9
  198. package/src/account/pages/FederatedIdentity.tsx +5 -5
  199. package/src/account/pages/Log.tsx +8 -8
  200. package/src/account/pages/PageProps.ts +2 -4
  201. package/src/account/pages/Password.tsx +13 -16
  202. package/src/account/pages/Sessions.tsx +9 -10
  203. package/src/account/pages/Totp.tsx +19 -28
  204. package/src/bin/add-story.ts +3 -3
  205. package/src/bin/copy-keycloak-resources-to-public.ts +3 -3
  206. package/src/bin/download-keycloak-default-theme.ts +5 -5
  207. package/src/bin/eject-page.ts +3 -3
  208. package/src/bin/initialize-email-theme.ts +5 -5
  209. package/src/bin/keycloakify/buildJars/buildJar.ts +14 -14
  210. package/src/bin/keycloakify/buildJars/buildJars.ts +8 -8
  211. package/src/bin/keycloakify/buildJars/generatePom.ts +9 -9
  212. package/src/bin/keycloakify/generateFtl/generateFtl.ts +12 -12
  213. package/src/bin/keycloakify/generateSrcMainResources/bringInAccountV1.ts +7 -7
  214. package/src/bin/keycloakify/generateSrcMainResources/generateMessageProperties.ts +2 -66
  215. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.ts +9 -9
  216. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts +30 -24
  217. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.ts +8 -8
  218. package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +9 -9
  219. package/src/bin/keycloakify/keycloakify.ts +11 -11
  220. package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +6 -6
  221. package/src/bin/keycloakify/replacers/replaceImportsInInlineCssCode.ts +7 -7
  222. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +10 -10
  223. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +13 -13
  224. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +11 -11
  225. package/src/bin/main.ts +17 -2
  226. package/src/bin/shared/{buildOptions.ts → buildContext.ts} +65 -51
  227. package/src/bin/shared/copyKeycloakResourcesToPublic.ts +12 -12
  228. package/src/bin/shared/downloadKeycloakDefaultTheme.ts +7 -7
  229. package/src/bin/shared/downloadKeycloakStaticResources.ts +7 -7
  230. package/src/bin/shared/generateKcGenTs.ts +61 -0
  231. package/src/bin/shared/getThemeSrcDirPath.ts +3 -3
  232. package/src/bin/start-keycloak/appBuild.ts +11 -11
  233. package/src/bin/start-keycloak/keycloakifyBuild.ts +7 -7
  234. package/src/bin/start-keycloak/start-keycloak.ts +34 -22
  235. package/src/bin/tools/escapeStringForPropertiesFile.ts +64 -0
  236. package/src/bin/tools/getNpmWorkspaceRootDirPath.ts +3 -3
  237. package/src/bin/update-kc-gen.ts +13 -0
  238. package/src/lib/getKcClsx.ts +89 -0
  239. package/src/login/Fallback.tsx +2 -2
  240. package/src/login/KcContext/KcContext.ts +7 -7
  241. package/src/login/KcContext/getKcContextMock.ts +13 -24
  242. package/src/login/Template.tsx +36 -37
  243. package/src/login/TemplateProps.ts +1 -6
  244. package/src/login/UserProfileFormFields.tsx +67 -84
  245. package/src/login/i18n/i18n.tsx +208 -129
  246. package/src/login/i18n/index.ts +10 -2
  247. package/src/login/lib/{useGetClassName.ts → kcClsx.ts} +6 -2
  248. package/src/login/lib/useUserProfileForm.tsx +29 -21
  249. package/src/login/pages/Code.tsx +10 -8
  250. package/src/login/pages/DeleteAccountConfirm.tsx +9 -10
  251. package/src/login/pages/DeleteCredential.tsx +11 -10
  252. package/src/login/pages/Error.tsx +5 -5
  253. package/src/login/pages/FrontchannelLogout.tsx +7 -5
  254. package/src/login/pages/IdpReviewUserProfile.tsx +18 -21
  255. package/src/login/pages/Info.tsx +7 -5
  256. package/src/login/pages/Login.tsx +34 -53
  257. package/src/login/pages/LoginConfigTotp.tsx +30 -38
  258. package/src/login/pages/LoginIdpLinkConfirm.tsx +10 -21
  259. package/src/login/pages/LoginIdpLinkEmail.tsx +5 -5
  260. package/src/login/pages/LoginOauth2DeviceVerifyUserCode.tsx +19 -24
  261. package/src/login/pages/LoginOauthGrant.tsx +14 -21
  262. package/src/login/pages/LoginOtp.tsx +29 -33
  263. package/src/login/pages/LoginPageExpired.tsx +5 -5
  264. package/src/login/pages/LoginPassword.tsx +23 -33
  265. package/src/login/pages/LoginRecoveryAuthnCodeConfig.tsx +21 -25
  266. package/src/login/pages/LoginRecoveryAuthnCodeInput.tsx +21 -25
  267. package/src/login/pages/LoginResetOtp.tsx +21 -25
  268. package/src/login/pages/LoginResetPassword.tsx +21 -25
  269. package/src/login/pages/LoginUpdatePassword.tsx +42 -52
  270. package/src/login/pages/LoginUpdateProfile.tsx +29 -30
  271. package/src/login/pages/LoginUsername.tsx +23 -35
  272. package/src/login/pages/LoginVerifyEmail.tsx +7 -5
  273. package/src/login/pages/LoginX509Info.tsx +27 -36
  274. package/src/login/pages/LogoutConfirm.tsx +11 -17
  275. package/src/login/pages/PageProps.ts +2 -4
  276. package/src/login/pages/Register.tsx +27 -46
  277. package/src/login/pages/SamlPostForm.tsx +5 -5
  278. package/src/login/pages/SelectAuthenticator.tsx +24 -26
  279. package/src/login/pages/Terms.tsx +9 -16
  280. package/src/login/pages/UpdateEmail.tsx +29 -33
  281. package/src/login/pages/WebauthnAuthenticate.tsx +26 -32
  282. package/src/login/pages/WebauthnError.tsx +11 -22
  283. package/src/login/pages/WebauthnRegister.tsx +20 -28
  284. package/src/tools/clsx.ts +6 -48
  285. package/src/tools/clsx_withTransform.ts +55 -0
  286. package/src/vite-plugin/vite-plugin.ts +29 -21
  287. package/tools/clsx.d.ts +3 -2
  288. package/tools/clsx.js +5 -41
  289. package/tools/clsx.js.map +1 -1
  290. package/tools/clsx_withTransform.d.ts +5 -0
  291. package/tools/clsx_withTransform.js +43 -0
  292. package/tools/clsx_withTransform.js.map +1 -0
  293. package/vite-plugin/index.js +243 -102
  294. package/vite-plugin/vite-plugin.d.ts +3 -3
  295. package/account/lib/useGetClassName.d.ts +0 -7
  296. package/account/lib/useGetClassName.js.map +0 -1
  297. package/bin/795.index.js +0 -1197
  298. package/lib/isStorybook.d.ts +0 -1
  299. package/lib/isStorybook.js +0 -3
  300. package/lib/isStorybook.js.map +0 -1
  301. package/lib/useGetClassName.d.ts +0 -10
  302. package/lib/useGetClassName.js +0 -14
  303. package/lib/useGetClassName.js.map +0 -1
  304. package/login/lib/useGetClassName.d.ts +0 -7
  305. package/login/lib/useGetClassName.js.map +0 -1
  306. package/src/lib/isStorybook.ts +0 -3
  307. package/src/lib/useGetClassName.ts +0 -27
@@ -2,14 +2,14 @@ import { useEffect } from "react";
2
2
  import { assert } from "keycloakify/tools/assert";
3
3
  import { clsx } from "keycloakify/tools/clsx";
4
4
  import type { TemplateProps } from "keycloakify/login/TemplateProps";
5
- import { useGetClassName } from "keycloakify/login/lib/useGetClassName";
5
+ import { getKcClsx } from "keycloakify/login/lib/kcClsx";
6
6
  import { useInsertScriptTags } from "keycloakify/tools/useInsertScriptTags";
7
7
  import { useInsertLinkTags } from "keycloakify/tools/useInsertLinkTags";
8
8
  import { useSetClassName } from "keycloakify/tools/useSetClassName";
9
9
  import type { KcContext } from "./KcContext";
10
- import type { I18n } from "./i18n";
10
+ import { useI18n } from "./i18n";
11
11
 
12
- export default function Template(props: TemplateProps<KcContext, I18n>) {
12
+ export default function Template(props: TemplateProps<KcContext>) {
13
13
  const {
14
14
  displayInfo = false,
15
15
  displayMessage = true,
@@ -21,15 +21,14 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
21
21
  documentTitle,
22
22
  bodyClassName,
23
23
  kcContext,
24
- i18n,
25
24
  doUseDefaultCss,
26
25
  classes,
27
26
  children
28
27
  } = props;
29
28
 
30
- const { getClassName } = useGetClassName({ doUseDefaultCss, classes });
29
+ const { kcClsx } = getKcClsx({ doUseDefaultCss, classes });
31
30
 
32
- const { msg, msgStr, getChangeLocalUrl, labelBySupportedLanguageTag, currentLanguageTag } = i18n;
31
+ const { msg, msgStr, getChangeLocalUrl, labelBySupportedLanguageTag, currentLanguageTag } = useI18n({ kcContext });
33
32
 
34
33
  const { realm, locale, auth, url, message, isAppInitiatedAction, authenticationSession, scripts } = kcContext;
35
34
 
@@ -39,12 +38,12 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
39
38
 
40
39
  useSetClassName({
41
40
  qualifiedName: "html",
42
- className: getClassName("kcHtmlClass")
41
+ className: kcClsx("kcHtmlClass")
43
42
  });
44
43
 
45
44
  useSetClassName({
46
45
  qualifiedName: "body",
47
- className: bodyClassName ?? getClassName("kcBodyClass")
46
+ className: bodyClassName ?? kcClsx("kcBodyClass")
48
47
  });
49
48
 
50
49
  useEffect(() => {
@@ -116,19 +115,19 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
116
115
  }
117
116
 
118
117
  return (
119
- <div className={getClassName("kcLoginClass")}>
120
- <div id="kc-header" className={getClassName("kcHeaderClass")}>
121
- <div id="kc-header-wrapper" className={getClassName("kcHeaderWrapperClass")}>
118
+ <div className={kcClsx("kcLoginClass")}>
119
+ <div id="kc-header" className={kcClsx("kcHeaderClass")}>
120
+ <div id="kc-header-wrapper" className={kcClsx("kcHeaderWrapperClass")}>
122
121
  {msg("loginTitleHtml", realm.displayNameHtml)}
123
122
  </div>
124
123
  </div>
125
124
 
126
- <div className={getClassName("kcFormCardClass")}>
127
- <header className={getClassName("kcFormHeaderClass")}>
125
+ <div className={kcClsx("kcFormCardClass")}>
126
+ <header className={kcClsx("kcFormHeaderClass")}>
128
127
  {realm.internationalizationEnabled && (assert(locale !== undefined), locale.supported.length > 1) && (
129
- <div className={getClassName("kcLocaleMainClass")} id="kc-locale">
130
- <div id="kc-locale-wrapper" className={getClassName("kcLocaleWrapperClass")}>
131
- <div id="kc-locale-dropdown" className={clsx("menu-button-links", getClassName("kcLocaleDropDownClass"))}>
128
+ <div className={kcClsx("kcLocaleMainClass")} id="kc-locale">
129
+ <div id="kc-locale-wrapper" className={kcClsx("kcLocaleWrapperClass")}>
130
+ <div id="kc-locale-dropdown" className={clsx("menu-button-links", kcClsx("kcLocaleDropDownClass"))}>
132
131
  <button
133
132
  tabIndex={1}
134
133
  id="kc-current-locale-link"
@@ -145,14 +144,14 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
145
144
  aria-labelledby="kc-current-locale-link"
146
145
  aria-activedescendant=""
147
146
  id="language-switch1"
148
- className={getClassName("kcLocaleListClass")}
147
+ className={kcClsx("kcLocaleListClass")}
149
148
  >
150
149
  {locale.supported.map(({ languageTag }, i) => (
151
- <li key={languageTag} className={getClassName("kcLocaleListItemClass")} role="none">
150
+ <li key={languageTag} className={kcClsx("kcLocaleListItemClass")} role="none">
152
151
  <a
153
152
  role="menuitem"
154
153
  id={`language-${i + 1}`}
155
- className={getClassName("kcLocaleItemClass")}
154
+ className={kcClsx("kcLocaleItemClass")}
156
155
  href={getChangeLocalUrl(languageTag)}
157
156
  >
158
157
  {labelBySupportedLanguageTag[languageTag]}
@@ -166,8 +165,8 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
166
165
  )}
167
166
  {!(auth !== undefined && auth.showUsername && !auth.showResetCredentials) ? (
168
167
  displayRequiredFields ? (
169
- <div className={getClassName("kcContentWrapperClass")}>
170
- <div className={clsx(getClassName("kcLabelWrapperClass"), "subtitle")}>
168
+ <div className={kcClsx("kcContentWrapperClass")}>
169
+ <div className={clsx(kcClsx("kcLabelWrapperClass"), "subtitle")}>
171
170
  <span className="subtitle">
172
171
  <span className="required">*</span>
173
172
  {msg("requiredFields")}
@@ -181,19 +180,19 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
181
180
  <h1 id="kc-page-title">{headerNode}</h1>
182
181
  )
183
182
  ) : displayRequiredFields ? (
184
- <div className={getClassName("kcContentWrapperClass")}>
185
- <div className={clsx(getClassName("kcLabelWrapperClass"), "subtitle")}>
183
+ <div className={kcClsx("kcContentWrapperClass")}>
184
+ <div className={clsx(kcClsx("kcLabelWrapperClass"), "subtitle")}>
186
185
  <span className="subtitle">
187
186
  <span className="required">*</span> {msg("requiredFields")}
188
187
  </span>
189
188
  </div>
190
189
  <div className="col-md-10">
191
190
  {showUsernameNode}
192
- <div id="kc-username" className={getClassName("kcFormGroupClass")}>
191
+ <div id="kc-username" className={kcClsx("kcFormGroupClass")}>
193
192
  <label id="kc-attempted-username">{auth.attemptedUsername}</label>
194
193
  <a id="reset-login" href={url.loginRestartFlowUrl} aria-label={msgStr("restartLoginTooltip")}>
195
194
  <div className="kc-login-tooltip">
196
- <i className={getClassName("kcResetFlowIcon")}></i>
195
+ <i className={kcClsx("kcResetFlowIcon")}></i>
197
196
  <span className="kc-tooltip-text">{msg("restartLoginTooltip")}</span>
198
197
  </div>
199
198
  </a>
@@ -203,11 +202,11 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
203
202
  ) : (
204
203
  <>
205
204
  {showUsernameNode}
206
- <div id="kc-username" className={getClassName("kcFormGroupClass")}>
205
+ <div id="kc-username" className={kcClsx("kcFormGroupClass")}>
207
206
  <label id="kc-attempted-username">{auth.attemptedUsername}</label>
208
207
  <a id="reset-login" href={url.loginRestartFlowUrl} aria-label={msgStr("restartLoginTooltip")}>
209
208
  <div className="kc-login-tooltip">
210
- <i className={getClassName("kcResetFlowIcon")}></i>
209
+ <i className={kcClsx("kcResetFlowIcon")}></i>
211
210
  <span className="kc-tooltip-text">{msg("restartLoginTooltip")}</span>
212
211
  </div>
213
212
  </a>
@@ -222,18 +221,18 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
222
221
  <div
223
222
  className={clsx(
224
223
  `alert-${message.type}`,
225
- getClassName("kcAlertClass"),
224
+ kcClsx("kcAlertClass"),
226
225
  `pf-m-${message?.type === "error" ? "danger" : message.type}`
227
226
  )}
228
227
  >
229
228
  <div className="pf-c-alert__icon">
230
- {message.type === "success" && <span className={getClassName("kcFeedbackSuccessIcon")}></span>}
231
- {message.type === "warning" && <span className={getClassName("kcFeedbackWarningIcon")}></span>}
232
- {message.type === "error" && <span className={getClassName("kcFeedbackErrorIcon")}></span>}
233
- {message.type === "info" && <span className={getClassName("kcFeedbackInfoIcon")}></span>}
229
+ {message.type === "success" && <span className={kcClsx("kcFeedbackSuccessIcon")}></span>}
230
+ {message.type === "warning" && <span className={kcClsx("kcFeedbackWarningIcon")}></span>}
231
+ {message.type === "error" && <span className={kcClsx("kcFeedbackErrorIcon")}></span>}
232
+ {message.type === "info" && <span className={kcClsx("kcFeedbackInfoIcon")}></span>}
234
233
  </div>
235
234
  <span
236
- className={getClassName("kcAlertTitleClass")}
235
+ className={kcClsx("kcAlertTitleClass")}
237
236
  dangerouslySetInnerHTML={{
238
237
  __html: message.summary
239
238
  }}
@@ -243,8 +242,8 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
243
242
  {children}
244
243
  {auth !== undefined && auth.showTryAnotherWayLink && (
245
244
  <form id="kc-select-try-another-way-form" action={url.loginAction} method="post">
246
- <div className={getClassName("kcFormGroupClass")}>
247
- <div className={getClassName("kcFormGroupClass")}>
245
+ <div className={kcClsx("kcFormGroupClass")}>
246
+ <div className={kcClsx("kcFormGroupClass")}>
248
247
  <input type="hidden" name="tryAnotherWay" value="on" />
249
248
  <a
250
249
  href="#"
@@ -262,8 +261,8 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
262
261
  )}
263
262
  {socialProvidersNode}
264
263
  {displayInfo && (
265
- <div id="kc-info" className={getClassName("kcSignUpClass")}>
266
- <div id="kc-info-wrapper" className={getClassName("kcInfoAreaWrapperClass")}>
264
+ <div id="kc-info" className={kcClsx("kcSignUpClass")}>
265
+ <div id="kc-info-wrapper" className={kcClsx("kcInfoAreaWrapperClass")}>
267
266
  {infoNode}
268
267
  </div>
269
268
  </div>
@@ -1,13 +1,8 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { KcContext } from "./KcContext";
3
- import type { I18n } from "./i18n";
4
3
 
5
- export type TemplateProps<
6
- KcContext extends KcContext.Common,
7
- I18nExtended extends I18n
8
- > = {
4
+ export type TemplateProps<KcContext extends KcContext.Common> = {
9
5
  kcContext: KcContext;
10
- i18n: I18nExtended;
11
6
  doUseDefaultCss: boolean;
12
7
  classes?: Partial<Record<ClassKey, string>>;
13
8
 
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useReducer, Fragment } from "react";
2
2
  import { assert } from "tsafe/assert";
3
- import type { ClassKey } from "keycloakify/login/TemplateProps";
3
+ import type { KcClsx } from "keycloakify/login/lib/kcClsx";
4
4
  import {
5
5
  useUserProfileForm,
6
6
  getButtonToDisplayForMultivaluedAttributeField,
@@ -9,13 +9,13 @@ import {
9
9
  type FormFieldError
10
10
  } from "keycloakify/login/lib/useUserProfileForm";
11
11
  import type { Attribute } from "keycloakify/login/KcContext";
12
- import type { I18n } from "./i18n";
12
+ import { useI18n, type I18n } from "./i18n";
13
13
 
14
14
  export type UserProfileFormFieldsProps = {
15
15
  kcContext: KcContextLike;
16
- i18n: I18n;
17
- getClassName: (classKey: ClassKey) => string;
16
+ kcClsx: KcClsx;
18
17
  onIsFormSubmittableValueChange: (isFormSubmittable: boolean) => void;
18
+ doMakeUserConfirmPassword: boolean;
19
19
  BeforeField?: (props: BeforeAfterFieldProps) => JSX.Element | null;
20
20
  AfterField?: (props: BeforeAfterFieldProps) => JSX.Element | null;
21
21
  };
@@ -24,24 +24,21 @@ type BeforeAfterFieldProps = {
24
24
  attribute: Attribute;
25
25
  dispatchFormAction: React.Dispatch<FormAction>;
26
26
  displayableErrors: FormFieldError[];
27
- i18n: I18n;
28
27
  valueOrValues: string | string[];
28
+ kcClsx: KcClsx;
29
+ i18n: I18n;
29
30
  };
30
31
 
31
- // NOTE: Enabled by default but it's a UX best practice to set it to false.
32
- const doMakeUserConfirmPassword = true;
33
-
34
32
  export default function UserProfileFormFields(props: UserProfileFormFieldsProps) {
35
- const { kcContext, onIsFormSubmittableValueChange, i18n, getClassName, BeforeField, AfterField } = props;
33
+ const { kcContext, kcClsx, onIsFormSubmittableValueChange, doMakeUserConfirmPassword, BeforeField, AfterField } = props;
36
34
 
37
- const { advancedMsg } = i18n;
35
+ const { advancedMsg } = useI18n({ kcContext });
38
36
 
39
37
  const {
40
38
  formState: { formFieldStates, isFormSubmittable },
41
39
  dispatchFormAction
42
40
  } = useUserProfileForm({
43
41
  kcContext,
44
- i18n,
45
42
  doMakeUserConfirmPassword
46
43
  });
47
44
 
@@ -49,6 +46,8 @@ export default function UserProfileFormFields(props: UserProfileFormFieldsProps)
49
46
  onIsFormSubmittableValueChange(isFormSubmittable);
50
47
  }, [isFormSubmittable]);
51
48
 
49
+ const i18n = useI18n({ kcContext });
50
+
52
51
  const groupNameRef = { current: "" };
53
52
 
54
53
  return (
@@ -56,32 +55,33 @@ export default function UserProfileFormFields(props: UserProfileFormFieldsProps)
56
55
  {formFieldStates.map(({ attribute, displayableErrors, valueOrValues }) => {
57
56
  return (
58
57
  <Fragment key={attribute.name}>
59
- <GroupLabel attribute={attribute} getClassName={getClassName} i18n={i18n} groupNameRef={groupNameRef} />
58
+ <GroupLabel attribute={attribute} groupNameRef={groupNameRef} i18n={i18n} kcClsx={kcClsx} />
60
59
  {BeforeField !== undefined && (
61
60
  <BeforeField
62
61
  attribute={attribute}
63
62
  dispatchFormAction={dispatchFormAction}
64
63
  displayableErrors={displayableErrors}
65
- i18n={i18n}
66
64
  valueOrValues={valueOrValues}
65
+ kcClsx={kcClsx}
66
+ i18n={i18n}
67
67
  />
68
68
  )}
69
69
  <div
70
- className={getClassName("kcFormGroupClass")}
70
+ className={kcClsx("kcFormGroupClass")}
71
71
  style={{
72
72
  display: attribute.name === "password-confirm" && !doMakeUserConfirmPassword ? "none" : undefined
73
73
  }}
74
74
  >
75
- <div className={getClassName("kcLabelWrapperClass")}>
76
- <label htmlFor={attribute.name} className={getClassName("kcLabelClass")}>
75
+ <div className={kcClsx("kcLabelWrapperClass")}>
76
+ <label htmlFor={attribute.name} className={kcClsx("kcLabelClass")}>
77
77
  {advancedMsg(attribute.displayName ?? "")}
78
78
  </label>
79
79
  {attribute.required && <>*</>}
80
80
  </div>
81
- <div className={getClassName("kcInputWrapperClass")}>
81
+ <div className={kcClsx("kcInputWrapperClass")}>
82
82
  {attribute.annotations.inputHelperTextBefore !== undefined && (
83
83
  <div
84
- className={getClassName("kcInputHelperTextBeforeClass")}
84
+ className={kcClsx("kcInputHelperTextBeforeClass")}
85
85
  id={`form-help-text-before-${attribute.name}`}
86
86
  aria-live="polite"
87
87
  >
@@ -92,19 +92,14 @@ export default function UserProfileFormFields(props: UserProfileFormFieldsProps)
92
92
  attribute={attribute}
93
93
  valueOrValues={valueOrValues}
94
94
  displayableErrors={displayableErrors}
95
- formValidationDispatch={dispatchFormAction}
96
- getClassName={getClassName}
95
+ dispatchFormAction={dispatchFormAction}
96
+ kcClsx={kcClsx}
97
97
  i18n={i18n}
98
98
  />
99
- <FieldErrors
100
- attribute={attribute}
101
- getClassName={getClassName}
102
- displayableErrors={displayableErrors}
103
- fieldIndex={undefined}
104
- />
99
+ <FieldErrors attribute={attribute} displayableErrors={displayableErrors} kcClsx={kcClsx} fieldIndex={undefined} />
105
100
  {attribute.annotations.inputHelperTextAfter !== undefined && (
106
101
  <div
107
- className={getClassName("kcInputHelperTextAfterClass")}
102
+ className={kcClsx("kcInputHelperTextAfterClass")}
108
103
  id={`form-help-text-after-${attribute.name}`}
109
104
  aria-live="polite"
110
105
  >
@@ -117,8 +112,9 @@ export default function UserProfileFormFields(props: UserProfileFormFieldsProps)
117
112
  attribute={attribute}
118
113
  dispatchFormAction={dispatchFormAction}
119
114
  displayableErrors={displayableErrors}
120
- i18n={i18n}
121
115
  valueOrValues={valueOrValues}
116
+ kcClsx={kcClsx}
117
+ i18n={i18n}
122
118
  />
123
119
  )}
124
120
  {/* NOTE: Downloading of html5DataAnnotations scripts is done in the useUserProfileForm hook */}
@@ -133,13 +129,13 @@ export default function UserProfileFormFields(props: UserProfileFormFieldsProps)
133
129
 
134
130
  function GroupLabel(props: {
135
131
  attribute: Attribute;
136
- getClassName: UserProfileFormFieldsProps["getClassName"];
137
- i18n: I18n;
138
132
  groupNameRef: {
139
133
  current: string;
140
134
  };
135
+ i18n: I18n;
136
+ kcClsx: KcClsx;
141
137
  }) {
142
- const { attribute, getClassName, i18n, groupNameRef } = props;
138
+ const { attribute, groupNameRef, i18n, kcClsx } = props;
143
139
 
144
140
  const { advancedMsg } = i18n;
145
141
 
@@ -151,7 +147,7 @@ function GroupLabel(props: {
151
147
 
152
148
  return (
153
149
  <div
154
- className={getClassName("kcFormGroupClass")}
150
+ className={kcClsx("kcFormGroupClass")}
155
151
  {...Object.fromEntries(Object.entries(attribute.group.html5DataAnnotations).map(([key, value]) => [`data-${key}`, value]))}
156
152
  >
157
153
  {(() => {
@@ -159,8 +155,8 @@ function GroupLabel(props: {
159
155
  const groupHeaderText = groupDisplayHeader !== "" ? advancedMsg(groupDisplayHeader) : attribute.group.name;
160
156
 
161
157
  return (
162
- <div className={getClassName("kcContentWrapperClass")}>
163
- <label id={`header-${attribute.group.name}`} className={getClassName("kcFormGroupHeader")}>
158
+ <div className={kcClsx("kcContentWrapperClass")}>
159
+ <label id={`header-${attribute.group.name}`} className={kcClsx("kcFormGroupHeader")}>
164
160
  {groupHeaderText}
165
161
  </label>
166
162
  </div>
@@ -173,8 +169,8 @@ function GroupLabel(props: {
173
169
  const groupDescriptionText = advancedMsg(groupDisplayDescription);
174
170
 
175
171
  return (
176
- <div className={getClassName("kcLabelWrapperClass")}>
177
- <label id={`description-${attribute.group.name}`} className={getClassName("kcLabelClass")}>
172
+ <div className={kcClsx("kcLabelWrapperClass")}>
173
+ <label id={`description-${attribute.group.name}`} className={kcClsx("kcLabelClass")}>
178
174
  {groupDescriptionText}
179
175
  </label>
180
176
  </div>
@@ -191,13 +187,8 @@ function GroupLabel(props: {
191
187
  return null;
192
188
  }
193
189
 
194
- function FieldErrors(props: {
195
- attribute: Attribute;
196
- getClassName: UserProfileFormFieldsProps["getClassName"];
197
- displayableErrors: FormFieldError[];
198
- fieldIndex: number | undefined;
199
- }) {
200
- const { attribute, getClassName, fieldIndex } = props;
190
+ function FieldErrors(props: { attribute: Attribute; displayableErrors: FormFieldError[]; fieldIndex: number | undefined; kcClsx: KcClsx }) {
191
+ const { attribute, fieldIndex, kcClsx } = props;
201
192
 
202
193
  const displayableErrors = props.displayableErrors.filter(error => error.fieldIndex === fieldIndex);
203
194
 
@@ -208,7 +199,7 @@ function FieldErrors(props: {
208
199
  return (
209
200
  <span
210
201
  id={`input-error-${attribute.name}${fieldIndex === undefined ? "" : `-${fieldIndex}`}`}
211
- className={getClassName("kcInputErrorMessageClass")}
202
+ className={kcClsx("kcInputErrorMessageClass")}
212
203
  aria-live="polite"
213
204
  >
214
205
  {displayableErrors
@@ -227,9 +218,9 @@ type InputFiledByTypeProps = {
227
218
  attribute: Attribute;
228
219
  valueOrValues: string | string[];
229
220
  displayableErrors: FormFieldError[];
230
- formValidationDispatch: React.Dispatch<FormAction>;
231
- getClassName: UserProfileFormFieldsProps["getClassName"];
221
+ dispatchFormAction: React.Dispatch<FormAction>;
232
222
  i18n: I18n;
223
+ kcClsx: KcClsx;
233
224
  };
234
225
 
235
226
  function InputFiledByType(props: InputFiledByTypeProps) {
@@ -259,7 +250,7 @@ function InputFiledByType(props: InputFiledByTypeProps) {
259
250
 
260
251
  if (attribute.name === "password" || attribute.name === "password-confirm") {
261
252
  return (
262
- <PasswordWrapper getClassName={props.getClassName} i18n={props.i18n} passwordInputId={attribute.name}>
253
+ <PasswordWrapper kcClsx={props.kcClsx} i18n={props.i18n} passwordInputId={attribute.name}>
263
254
  {inputNode}
264
255
  </PasswordWrapper>
265
256
  );
@@ -270,8 +261,8 @@ function InputFiledByType(props: InputFiledByTypeProps) {
270
261
  }
271
262
  }
272
263
 
273
- function PasswordWrapper(props: { getClassName: (classKey: ClassKey) => string; i18n: I18n; passwordInputId: string; children: JSX.Element }) {
274
- const { getClassName, i18n, passwordInputId, children } = props;
264
+ function PasswordWrapper(props: { kcClsx: KcClsx; i18n: I18n; passwordInputId: string; children: JSX.Element }) {
265
+ const { kcClsx, i18n, passwordInputId, children } = props;
275
266
 
276
267
  const { msgStr } = i18n;
277
268
 
@@ -286,26 +277,23 @@ function PasswordWrapper(props: { getClassName: (classKey: ClassKey) => string;
286
277
  }, [isPasswordRevealed]);
287
278
 
288
279
  return (
289
- <div className={getClassName("kcInputGroup")}>
280
+ <div className={kcClsx("kcInputGroup")}>
290
281
  {children}
291
282
  <button
292
283
  type="button"
293
- className={getClassName("kcFormPasswordVisibilityButtonClass")}
284
+ className={kcClsx("kcFormPasswordVisibilityButtonClass")}
294
285
  aria-label={msgStr(isPasswordRevealed ? "hidePassword" : "showPassword")}
295
286
  aria-controls={passwordInputId}
296
287
  onClick={toggleIsPasswordRevealed}
297
288
  >
298
- <i
299
- className={getClassName(isPasswordRevealed ? "kcFormPasswordVisibilityIconHide" : "kcFormPasswordVisibilityIconShow")}
300
- aria-hidden
301
- />
289
+ <i className={kcClsx(isPasswordRevealed ? "kcFormPasswordVisibilityIconHide" : "kcFormPasswordVisibilityIconShow")} aria-hidden />
302
290
  </button>
303
291
  </div>
304
292
  );
305
293
  }
306
294
 
307
295
  function InputTag(props: InputFiledByTypeProps & { fieldIndex: number | undefined }) {
308
- const { attribute, fieldIndex, getClassName, formValidationDispatch, valueOrValues, i18n, displayableErrors } = props;
296
+ const { attribute, fieldIndex, kcClsx, dispatchFormAction, valueOrValues, i18n, displayableErrors } = props;
309
297
 
310
298
  return (
311
299
  <>
@@ -331,7 +319,7 @@ function InputTag(props: InputFiledByTypeProps & { fieldIndex: number | undefine
331
319
 
332
320
  return valueOrValues;
333
321
  })()}
334
- className={getClassName("kcInputClass")}
322
+ className={kcClsx("kcInputClass")}
335
323
  aria-invalid={displayableErrors.find(error => error.fieldIndex === fieldIndex) !== undefined}
336
324
  disabled={attribute.readOnly}
337
325
  autoComplete={attribute.autocomplete}
@@ -349,7 +337,7 @@ function InputTag(props: InputFiledByTypeProps & { fieldIndex: number | undefine
349
337
  step={attribute.annotations.inputTypeStep}
350
338
  {...Object.fromEntries(Object.entries(attribute.html5DataAnnotations ?? {}).map(([key, value]) => [`data-${key}`, value]))}
351
339
  onChange={event =>
352
- formValidationDispatch({
340
+ dispatchFormAction({
353
341
  action: "update",
354
342
  name: attribute.name,
355
343
  valueOrValues: (() => {
@@ -370,7 +358,7 @@ function InputTag(props: InputFiledByTypeProps & { fieldIndex: number | undefine
370
358
  })
371
359
  }
372
360
  onBlur={() =>
373
- formValidationDispatch({
361
+ dispatchFormAction({
374
362
  action: "focus lost",
375
363
  name: attribute.name,
376
364
  fieldIndex: fieldIndex
@@ -388,17 +376,12 @@ function InputTag(props: InputFiledByTypeProps & { fieldIndex: number | undefine
388
376
 
389
377
  return (
390
378
  <>
391
- <FieldErrors
392
- attribute={attribute}
393
- getClassName={getClassName}
394
- displayableErrors={displayableErrors}
395
- fieldIndex={fieldIndex}
396
- />
379
+ <FieldErrors attribute={attribute} kcClsx={kcClsx} displayableErrors={displayableErrors} fieldIndex={fieldIndex} />
397
380
  <AddRemoveButtonsMultiValuedAttribute
398
381
  attribute={attribute}
399
382
  values={values}
400
383
  fieldIndex={fieldIndex}
401
- dispatchFormAction={formValidationDispatch}
384
+ dispatchFormAction={dispatchFormAction}
402
385
  i18n={i18n}
403
386
  />
404
387
  </>
@@ -465,7 +448,7 @@ function AddRemoveButtonsMultiValuedAttribute(props: {
465
448
  }
466
449
 
467
450
  function InputTagSelects(props: InputFiledByTypeProps) {
468
- const { attribute, formValidationDispatch, getClassName, valueOrValues } = props;
451
+ const { attribute, dispatchFormAction, kcClsx, valueOrValues } = props;
469
452
 
470
453
  const { advancedMsg } = props.i18n;
471
454
 
@@ -478,16 +461,16 @@ function InputTagSelects(props: InputFiledByTypeProps) {
478
461
  case "select-radiobuttons":
479
462
  return {
480
463
  inputType: "radio",
481
- classDiv: getClassName("kcInputClassRadio"),
482
- classInput: getClassName("kcInputClassRadioInput"),
483
- classLabel: getClassName("kcInputClassRadioLabel")
464
+ classDiv: kcClsx("kcInputClassRadio"),
465
+ classInput: kcClsx("kcInputClassRadioInput"),
466
+ classLabel: kcClsx("kcInputClassRadioLabel")
484
467
  };
485
468
  case "multiselect-checkboxes":
486
469
  return {
487
470
  inputType: "checkbox",
488
- classDiv: getClassName("kcInputClassCheckbox"),
489
- classInput: getClassName("kcInputClassCheckboxInput"),
490
- classLabel: getClassName("kcInputClassCheckboxLabel")
471
+ classDiv: kcClsx("kcInputClassCheckbox"),
472
+ classInput: kcClsx("kcInputClassCheckboxInput"),
473
+ classLabel: kcClsx("kcInputClassCheckboxLabel")
491
474
  };
492
475
  }
493
476
  })();
@@ -530,7 +513,7 @@ function InputTagSelects(props: InputFiledByTypeProps) {
530
513
  disabled={attribute.readOnly}
531
514
  checked={valueOrValues instanceof Array ? valueOrValues.includes(option) : valueOrValues === option}
532
515
  onChange={event =>
533
- formValidationDispatch({
516
+ dispatchFormAction({
534
517
  action: "update",
535
518
  name: attribute.name,
536
519
  valueOrValues: (() => {
@@ -553,7 +536,7 @@ function InputTagSelects(props: InputFiledByTypeProps) {
553
536
  })
554
537
  }
555
538
  onBlur={() =>
556
- formValidationDispatch({
539
+ dispatchFormAction({
557
540
  action: "focus lost",
558
541
  name: attribute.name,
559
542
  fieldIndex: undefined
@@ -562,7 +545,7 @@ function InputTagSelects(props: InputFiledByTypeProps) {
562
545
  />
563
546
  <label
564
547
  htmlFor={`${attribute.name}-${option}`}
565
- className={`${classLabel}${attribute.readOnly ? ` ${getClassName("kcInputClassRadioCheckboxLabelDisabled")}` : ""}`}
548
+ className={`${classLabel}${attribute.readOnly ? ` ${kcClsx("kcInputClassRadioCheckboxLabelDisabled")}` : ""}`}
566
549
  >
567
550
  {advancedMsg(option)}
568
551
  </label>
@@ -573,7 +556,7 @@ function InputTagSelects(props: InputFiledByTypeProps) {
573
556
  }
574
557
 
575
558
  function TextareaTag(props: InputFiledByTypeProps) {
576
- const { attribute, formValidationDispatch, getClassName, displayableErrors, valueOrValues } = props;
559
+ const { attribute, dispatchFormAction, kcClsx, displayableErrors, valueOrValues } = props;
577
560
 
578
561
  assert(typeof valueOrValues === "string");
579
562
 
@@ -583,7 +566,7 @@ function TextareaTag(props: InputFiledByTypeProps) {
583
566
  <textarea
584
567
  id={attribute.name}
585
568
  name={attribute.name}
586
- className={getClassName("kcInputClass")}
569
+ className={kcClsx("kcInputClass")}
587
570
  aria-invalid={displayableErrors.length !== 0}
588
571
  disabled={attribute.readOnly}
589
572
  cols={attribute.annotations.inputTypeCols === undefined ? undefined : parseInt(`${attribute.annotations.inputTypeCols}`)}
@@ -591,14 +574,14 @@ function TextareaTag(props: InputFiledByTypeProps) {
591
574
  maxLength={attribute.annotations.inputTypeMaxlength === undefined ? undefined : parseInt(`${attribute.annotations.inputTypeMaxlength}`)}
592
575
  value={value}
593
576
  onChange={event =>
594
- formValidationDispatch({
577
+ dispatchFormAction({
595
578
  action: "update",
596
579
  name: attribute.name,
597
580
  valueOrValues: event.target.value
598
581
  })
599
582
  }
600
583
  onBlur={() =>
601
- formValidationDispatch({
584
+ dispatchFormAction({
602
585
  action: "focus lost",
603
586
  name: attribute.name,
604
587
  fieldIndex: undefined
@@ -609,7 +592,7 @@ function TextareaTag(props: InputFiledByTypeProps) {
609
592
  }
610
593
 
611
594
  function SelectTag(props: InputFiledByTypeProps) {
612
- const { attribute, formValidationDispatch, getClassName, displayableErrors, i18n, valueOrValues } = props;
595
+ const { attribute, dispatchFormAction, kcClsx, displayableErrors, i18n, valueOrValues } = props;
613
596
 
614
597
  const { advancedMsg } = i18n;
615
598
 
@@ -619,14 +602,14 @@ function SelectTag(props: InputFiledByTypeProps) {
619
602
  <select
620
603
  id={attribute.name}
621
604
  name={attribute.name}
622
- className={getClassName("kcInputClass")}
605
+ className={kcClsx("kcInputClass")}
623
606
  aria-invalid={displayableErrors.length !== 0}
624
607
  disabled={attribute.readOnly}
625
608
  multiple={isMultiple}
626
609
  size={attribute.annotations.inputTypeSize === undefined ? undefined : parseInt(`${attribute.annotations.inputTypeSize}`)}
627
610
  value={valueOrValues}
628
611
  onChange={event =>
629
- formValidationDispatch({
612
+ dispatchFormAction({
630
613
  action: "update",
631
614
  name: attribute.name,
632
615
  valueOrValues: (() => {
@@ -639,7 +622,7 @@ function SelectTag(props: InputFiledByTypeProps) {
639
622
  })
640
623
  }
641
624
  onBlur={() =>
642
- formValidationDispatch({
625
+ dispatchFormAction({
643
626
  action: "focus lost",
644
627
  name: attribute.name,
645
628
  fieldIndex: undefined