keycloakify 10.0.0-rc.37 → 10.0.0-rc.38

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