@oussemasahbeni/keycloakify-login-shadcn 250004.0.7 → 250004.0.9

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 (108) hide show
  1. package/keycloak-theme/components/langauges.tsx +1 -1
  2. package/keycloak-theme/components/theme-toggle.tsx +0 -1
  3. package/keycloak-theme/components/ui/alert.tsx +69 -62
  4. package/keycloak-theme/components/ui/button.tsx +44 -39
  5. package/keycloak-theme/components/ui/card.tsx +59 -45
  6. package/keycloak-theme/components/ui/checkbox.tsx +24 -23
  7. package/keycloak-theme/components/ui/dropdown-menu.tsx +233 -168
  8. package/keycloak-theme/components/ui/field.tsx +50 -48
  9. package/keycloak-theme/components/ui/input-otp.tsx +55 -49
  10. package/keycloak-theme/components/ui/input.tsx +18 -22
  11. package/keycloak-theme/components/ui/label.tsx +19 -21
  12. package/keycloak-theme/components/ui/radio-group.tsx +27 -26
  13. package/keycloak-theme/components/ui/select.tsx +169 -122
  14. package/keycloak-theme/components/ui/separator.tsx +23 -24
  15. package/keycloak-theme/components/ui/tooltip.tsx +53 -24
  16. package/keycloak-theme/login/KcPage.tsx +2 -5
  17. package/keycloak-theme/login/components/LogoutOtherSessions.tsx +3 -5
  18. package/keycloak-theme/login/components/PasswordWrapper.tsx +4 -4
  19. package/keycloak-theme/login/components/Template/Template.tsx +110 -58
  20. package/keycloak-theme/login/components/UserProfileFormFields/AddRemoveButtonsMultiValuedAttribute.tsx +7 -3
  21. package/keycloak-theme/login/components/UserProfileFormFields/FieldErrors.tsx +8 -4
  22. package/keycloak-theme/login/components/UserProfileFormFields/GroupLabel.tsx +33 -14
  23. package/keycloak-theme/login/components/UserProfileFormFields/InputFieldByType.tsx +9 -2
  24. package/keycloak-theme/login/components/UserProfileFormFields/InputLabel.tsx +0 -1
  25. package/keycloak-theme/login/components/UserProfileFormFields/InputTag.tsx +25 -8
  26. package/keycloak-theme/login/components/UserProfileFormFields/InputTagSelects.tsx +30 -16
  27. package/keycloak-theme/login/components/UserProfileFormFields/SelectTag.tsx +32 -11
  28. package/keycloak-theme/login/components/UserProfileFormFields/TextareaTag.tsx +19 -7
  29. package/keycloak-theme/login/components/UserProfileFormFields/UserProfileFormFields.tsx +11 -5
  30. package/keycloak-theme/login/index.css +3 -20
  31. package/keycloak-theme/login/mocks/KcPageStory.tsx +6 -2
  32. package/keycloak-theme/login/pages/PageIndex.tsx +0 -4
  33. package/keycloak-theme/login/pages/code/Page.stories.tsx +4 -5
  34. package/keycloak-theme/login/pages/code/Page.tsx +6 -6
  35. package/keycloak-theme/login/pages/delete-account-confirm/Page.stories.tsx +0 -2
  36. package/keycloak-theme/login/pages/delete-account-confirm/Page.tsx +3 -6
  37. package/keycloak-theme/login/pages/delete-credential/Page.stories.tsx +0 -1
  38. package/keycloak-theme/login/pages/delete-credential/Page.tsx +11 -6
  39. package/keycloak-theme/login/pages/error/Page.stories.tsx +0 -1
  40. package/keycloak-theme/login/pages/error/Page.tsx +13 -12
  41. package/keycloak-theme/login/pages/frontchannel-logout/Page.tsx +2 -4
  42. package/keycloak-theme/login/pages/idp-review-user-profile/Page.stories.tsx +0 -1
  43. package/keycloak-theme/login/pages/idp-review-user-profile/Page.tsx +2 -5
  44. package/keycloak-theme/login/pages/info/Page.tsx +8 -6
  45. package/keycloak-theme/login/pages/link-idp-action/Page.tsx +5 -3
  46. package/keycloak-theme/login/pages/login/Form.tsx +36 -38
  47. package/keycloak-theme/login/pages/login/Page.stories.tsx +4 -3
  48. package/keycloak-theme/login/pages/login/Page.tsx +0 -1
  49. package/keycloak-theme/login/pages/login/SocialProviders.tsx +14 -23
  50. package/keycloak-theme/login/pages/login/providers/github.svg +4 -3
  51. package/keycloak-theme/login/pages/login/providers/x.svg +4 -3
  52. package/keycloak-theme/login/pages/login/useProviderLogos.tsx +2 -3
  53. package/keycloak-theme/login/pages/login-config-totp/Page.stories.tsx +0 -1
  54. package/keycloak-theme/login/pages/login-config-totp/Page.tsx +25 -12
  55. package/keycloak-theme/login/pages/login-idp-link-confirm/Page.stories.tsx +0 -1
  56. package/keycloak-theme/login/pages/login-idp-link-confirm/Page.tsx +4 -7
  57. package/keycloak-theme/login/pages/login-idp-link-confirm-override/Page.stories.tsx +0 -1
  58. package/keycloak-theme/login/pages/login-idp-link-confirm-override/Page.tsx +4 -7
  59. package/keycloak-theme/login/pages/login-idp-link-email/Page.stories.tsx +0 -1
  60. package/keycloak-theme/login/pages/login-idp-link-email/Page.tsx +4 -7
  61. package/keycloak-theme/login/pages/login-oauth-grant/Page.tsx +21 -11
  62. package/keycloak-theme/login/pages/login-oauth2-device-verify-user-code/Page.tsx +5 -7
  63. package/keycloak-theme/login/pages/login-otp/Page.stories.tsx +0 -1
  64. package/keycloak-theme/login/pages/login-otp/Page.tsx +35 -26
  65. package/keycloak-theme/login/pages/login-page-expired/Page.stories.tsx +0 -1
  66. package/keycloak-theme/login/pages/login-page-expired/Page.tsx +4 -6
  67. package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/Page.tsx +153 -96
  68. package/keycloak-theme/login/pages/login-password/Page.tsx +14 -15
  69. package/keycloak-theme/login/pages/login-password/useScript.tsx +0 -1
  70. package/keycloak-theme/login/pages/login-recovery-authn-code-config/Page.tsx +5 -8
  71. package/keycloak-theme/login/pages/login-recovery-authn-code-input/Page.tsx +2 -3
  72. package/keycloak-theme/login/pages/login-reset-otp/Page.stories.tsx +0 -1
  73. package/keycloak-theme/login/pages/login-reset-otp/Page.tsx +3 -4
  74. package/keycloak-theme/login/pages/login-reset-password/Form.tsx +5 -6
  75. package/keycloak-theme/login/pages/login-reset-password/Page.stories.tsx +0 -1
  76. package/keycloak-theme/login/pages/login-reset-password/Page.tsx +3 -3
  77. package/keycloak-theme/login/pages/login-update-password/Page.stories.tsx +0 -1
  78. package/keycloak-theme/login/pages/login-update-password/Page.tsx +5 -7
  79. package/keycloak-theme/login/pages/login-update-profile/Page.stories.tsx +0 -1
  80. package/keycloak-theme/login/pages/login-update-profile/Page.tsx +6 -7
  81. package/keycloak-theme/login/pages/login-username/Page.stories.tsx +0 -1
  82. package/keycloak-theme/login/pages/login-username/Page.tsx +6 -6
  83. package/keycloak-theme/login/pages/login-verify-email/Page.stories.tsx +0 -1
  84. package/keycloak-theme/login/pages/login-verify-email/Page.tsx +3 -4
  85. package/keycloak-theme/login/pages/login-x509-info/Page.stories.tsx +0 -1
  86. package/keycloak-theme/login/pages/login-x509-info/Page.tsx +3 -6
  87. package/keycloak-theme/login/pages/logout-confirm/Page.stories.tsx +0 -1
  88. package/keycloak-theme/login/pages/logout-confirm/Page.tsx +3 -6
  89. package/keycloak-theme/login/pages/register/Form.tsx +8 -7
  90. package/keycloak-theme/login/pages/register/Page.stories.tsx +17 -8
  91. package/keycloak-theme/login/pages/register/TermsAcceptance.tsx +6 -7
  92. package/keycloak-theme/login/pages/saml-post-form/Page.stories.tsx +0 -1
  93. package/keycloak-theme/login/pages/saml-post-form/Page.tsx +4 -6
  94. package/keycloak-theme/login/pages/select-authenticator/Page.stories.tsx +0 -1
  95. package/keycloak-theme/login/pages/select-authenticator/Page.tsx +3 -6
  96. package/keycloak-theme/login/pages/select-organization/Page.tsx +5 -8
  97. package/keycloak-theme/login/pages/terms/Page.tsx +1 -3
  98. package/keycloak-theme/login/pages/update-email/Page.stories.tsx +0 -1
  99. package/keycloak-theme/login/pages/update-email/Page.tsx +6 -7
  100. package/keycloak-theme/login/pages/webauthn-authenticate/Page.stories.tsx +0 -1
  101. package/keycloak-theme/login/pages/webauthn-authenticate/Page.tsx +50 -46
  102. package/keycloak-theme/login/pages/webauthn-error/Page.stories.tsx +2 -5
  103. package/keycloak-theme/login/pages/webauthn-error/Page.tsx +3 -6
  104. package/keycloak-theme/login/pages/webauthn-register/Page.stories.tsx +0 -1
  105. package/keycloak-theme/login/pages/webauthn-register/Page.tsx +4 -4
  106. package/keycloak-theme/login/styleLevelCustomization.tsx +5 -6
  107. package/keycloak-theme/public/site.webmanifest +11 -1
  108. package/package.json +2 -2
@@ -2,19 +2,18 @@ import { Alert, AlertDescription } from "@/components/ui/alert";
2
2
  import { Button } from "@/components/ui/button";
3
3
  import { Checkbox } from "@/components/ui/checkbox";
4
4
  import { Label } from "@/components/ui/label";
5
- import { LogoutOtherSessions } from '@/login/components/LogoutOtherSessions';
6
- import { useI18n } from '@/login/i18n';
7
- import { useKcContext } from '@/login/KcContext';
5
+ import { LogoutOtherSessions } from "@/login/components/LogoutOtherSessions";
6
+ import { useI18n } from "@/login/i18n";
7
+ import { useKcContext } from "@/login/KcContext";
8
8
  import { Copy, Download, Printer } from "lucide-react";
9
9
  import { assert } from "tsafe/assert";
10
10
  import { Template } from "../../components/Template";
11
- import { useScript } from './useScript';
11
+ import { useScript } from "./useScript";
12
12
 
13
13
  export function Page() {
14
14
  const { kcContext } = useKcContext();
15
15
  assert(kcContext.pageId === "login-recovery-authn-code-config.ftl");
16
16
 
17
-
18
17
  const { recoveryAuthnCodesConfigBean, isAppInitiatedAction } = kcContext;
19
18
 
20
19
  const { msg, msgStr } = useI18n();
@@ -24,9 +23,7 @@ export function Page() {
24
23
  useScript({ olRecoveryCodesListId });
25
24
 
26
25
  return (
27
- <Template
28
- headerNode={msg("recovery-code-config-header")}
29
- >
26
+ <Template headerNode={msg("recovery-code-config-header")}>
30
27
  <div className="space-y-6">
31
28
  <Alert variant="warning">
32
29
  <AlertDescription>
@@ -1,14 +1,13 @@
1
1
  import { Button } from "@/components/ui/button";
2
2
  import { Field, FieldError, FieldLabel } from "@/components/ui/field";
3
3
  import { Input } from "@/components/ui/input";
4
- import { useI18n } from '@/login/i18n';
5
- import { useKcContext } from '@/login/KcContext';
4
+ import { useI18n } from "@/login/i18n";
5
+ import { useKcContext } from "@/login/KcContext";
6
6
  import { kcSanitize } from "keycloakify/lib/kcSanitize";
7
7
  import { assert } from "tsafe/assert";
8
8
  import { Template } from "../../components/Template";
9
9
 
10
10
  export function Page() {
11
-
12
11
  const { kcContext } = useKcContext();
13
12
  assert(kcContext.pageId === "login-recovery-authn-code-input.ftl");
14
13
 
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  const { KcPageStory } = createKcPageStory({ pageId: "login-reset-otp.ftl" });
5
4
 
6
5
  const meta = {
@@ -1,16 +1,15 @@
1
1
  import { Button } from "@/components/ui/button";
2
2
  import { Label } from "@/components/ui/label";
3
3
  import { RadioGroupItem } from "@/components/ui/radio-group";
4
- import { useI18n } from '@/login/i18n';
5
- import { useKcContext } from '@/login/KcContext';
6
- import { useKcClsx } from '@keycloakify/login-ui/useKcClsx';
4
+ import { useI18n } from "@/login/i18n";
5
+ import { useKcContext } from "@/login/KcContext";
6
+ import { useKcClsx } from "@keycloakify/login-ui/useKcClsx";
7
7
  import { RadioGroup } from "@radix-ui/react-radio-group";
8
8
  import { Smartphone } from "lucide-react";
9
9
  import { assert } from "tsafe/assert";
10
10
  import { Template } from "../../components/Template";
11
11
 
12
12
  export function Page() {
13
-
14
13
  const { kcContext } = useKcContext();
15
14
  assert(kcContext.pageId === "login-reset-otp.ftl");
16
15
 
@@ -1,7 +1,6 @@
1
-
2
- import { Button } from '@/components/ui/button';
3
- import { Field, FieldError, FieldLabel } from '@/components/ui/field';
4
- import { Input } from '@/components/ui/input';
1
+ import { Button } from "@/components/ui/button";
2
+ import { Field, FieldError, FieldLabel } from "@/components/ui/field";
3
+ import { Input } from "@/components/ui/input";
5
4
  import { kcSanitize } from "@keycloakify/login-ui/kcSanitize";
6
5
  import { assert } from "tsafe/assert";
7
6
  import { useKcContext } from "../../KcContext";
@@ -26,8 +25,8 @@ export function Form() {
26
25
  {!kcContext.realm.loginWithEmailAllowed
27
26
  ? msg("username")
28
27
  : !kcContext.realm.registrationEmailAsUsername
29
- ? msg("usernameOrEmail")
30
- : msg("email")}
28
+ ? msg("usernameOrEmail")
29
+ : msg("email")}
31
30
  </FieldLabel>
32
31
  <Input
33
32
  type="text"
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  const { KcPageStory } = createKcPageStory({ pageId: "login-reset-password.ftl" });
5
4
 
6
5
  const meta = {
@@ -1,8 +1,8 @@
1
- import { useI18n } from '@/login/i18n';
2
- import { useKcContext } from '@/login/KcContext';
1
+ import { useI18n } from "@/login/i18n";
2
+ import { useKcContext } from "@/login/KcContext";
3
3
  import { assert } from "tsafe/assert";
4
4
  import { Template } from "../../components/Template";
5
- import { Form } from './Form';
5
+ import { Form } from "./Form";
6
6
 
7
7
  export function Page() {
8
8
  const { kcContext } = useKcContext();
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  const { KcPageStory } = createKcPageStory({ pageId: "login-update-password.ftl" });
5
4
 
6
5
  const meta = {
@@ -1,17 +1,15 @@
1
-
2
1
  import { Button } from "@/components/ui/button";
3
2
  import { Field, FieldError, FieldLabel } from "@/components/ui/field";
4
3
  import { Input } from "@/components/ui/input";
5
- import { LogoutOtherSessions } from '@/login/components/LogoutOtherSessions';
6
- import { PasswordWrapper } from '@/login/components/PasswordWrapper';
7
- import { useI18n } from '@/login/i18n';
8
- import { useKcContext } from '@/login/KcContext';
4
+ import { LogoutOtherSessions } from "@/login/components/LogoutOtherSessions";
5
+ import { PasswordWrapper } from "@/login/components/PasswordWrapper";
6
+ import { useI18n } from "@/login/i18n";
7
+ import { useKcContext } from "@/login/KcContext";
9
8
  import { kcSanitize } from "keycloakify/lib/kcSanitize";
10
9
  import { assert } from "tsafe/assert";
11
10
  import { Template } from "../../components/Template";
12
11
 
13
12
  export function Page() {
14
-
15
13
  const { kcContext } = useKcContext();
16
14
  assert(kcContext.pageId === "login-update-password.ftl");
17
15
 
@@ -32,7 +30,7 @@ export function Page() {
32
30
  >
33
31
  <Field>
34
32
  <FieldLabel htmlFor="password-new">{msg("passwordNew")}</FieldLabel>
35
- <PasswordWrapper passwordInputId="password-new" >
33
+ <PasswordWrapper passwordInputId="password-new">
36
34
  <Input
37
35
  type="password"
38
36
  id="password-new"
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  const { KcPageStory } = createKcPageStory({ pageId: "login-update-profile.ftl" });
5
4
 
6
5
  const meta = {
@@ -1,16 +1,13 @@
1
1
  import { Button } from "@/components/ui/button";
2
- import { useI18n } from '@/login/i18n';
3
- import { useKcContext } from '@/login/KcContext';
4
- import { useKcClsx } from '@keycloakify/login-ui/useKcClsx';
2
+ import { useI18n } from "@/login/i18n";
3
+ import { useKcContext } from "@/login/KcContext";
4
+ import { useKcClsx } from "@keycloakify/login-ui/useKcClsx";
5
5
  import { useState } from "react";
6
6
  import { assert } from "tsafe/assert";
7
7
  import { Template } from "../../components/Template";
8
8
  import { UserProfileFormFields } from "../../components/UserProfileFormFields";
9
9
 
10
-
11
-
12
10
  export function Page() {
13
-
14
11
  const { kcContext } = useKcContext();
15
12
  assert(kcContext.pageId === "login-update-profile.ftl");
16
13
 
@@ -34,7 +31,9 @@ export function Page() {
34
31
  action={url.loginAction}
35
32
  method="post"
36
33
  >
37
- <UserProfileFormFields onIsFormSubmittableValueChange={setIsFormSubmittable} />
34
+ <UserProfileFormFields
35
+ onIsFormSubmittableValueChange={setIsFormSubmittable}
36
+ />
38
37
 
39
38
  <div className={kcClsx("kcFormGroupClass")}>
40
39
  <div id="kc-form-options" className={kcClsx("kcFormOptionsClass")}>
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  const { KcPageStory } = createKcPageStory({ pageId: "login-username.ftl" });
5
4
 
6
5
  const meta = {
@@ -6,14 +6,14 @@ import { clsx } from "keycloakify/tools/clsx";
6
6
  import { useState } from "react";
7
7
 
8
8
  import { Field, FieldError, FieldLabel } from "@/components/ui/field";
9
- import { useI18n } from '@/login/i18n';
10
- import { useKcContext } from '@/login/KcContext';
11
- import { useKcClsx } from '@keycloakify/login-ui/useKcClsx';
9
+ import { useI18n } from "@/login/i18n";
10
+ import { useKcContext } from "@/login/KcContext";
11
+ import { useKcClsx } from "@keycloakify/login-ui/useKcClsx";
12
12
  import { kcSanitize } from "keycloakify/lib/kcSanitize";
13
13
  import { Fingerprint } from "lucide-react";
14
14
  import { assert } from "tsafe/assert";
15
15
  import { Template } from "../../components/Template";
16
- import { useScript } from './useScript';
16
+ import { useScript } from "./useScript";
17
17
 
18
18
  export function Page() {
19
19
  const { kcContext } = useKcContext();
@@ -123,8 +123,8 @@ export function Page() {
123
123
  {!realm.loginWithEmailAllowed
124
124
  ? msg("email")
125
125
  : !realm.registrationEmailAsUsername
126
- ? msg("usernameOrEmail")
127
- : msg("username")}
126
+ ? msg("usernameOrEmail")
127
+ : msg("username")}
128
128
  </FieldLabel>
129
129
  <Input
130
130
  tabIndex={2}
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  const { KcPageStory } = createKcPageStory({ pageId: "login-verify-email.ftl" });
5
4
 
6
5
  const meta = {
@@ -1,9 +1,8 @@
1
- import { useI18n } from '@/login/i18n';
2
- import { useKcContext } from '@/login/KcContext';
3
- import { assert } from 'tsafe/assert';
1
+ import { useI18n } from "@/login/i18n";
2
+ import { useKcContext } from "@/login/KcContext";
3
+ import { assert } from "tsafe/assert";
4
4
  import { Template } from "../../components/Template";
5
5
 
6
-
7
6
  export function Page() {
8
7
  const { kcContext } = useKcContext();
9
8
  assert(kcContext.pageId === "login-verify-email.ftl");
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  const { KcPageStory } = createKcPageStory({ pageId: "login-x509-info.ftl" });
5
4
 
6
5
  const meta = {
@@ -1,7 +1,7 @@
1
1
  import { Button } from "@/components/ui/button";
2
2
  import { Label } from "@/components/ui/label";
3
- import { useI18n } from '@/login/i18n';
4
- import { useKcContext } from '@/login/KcContext';
3
+ import { useI18n } from "@/login/i18n";
4
+ import { useKcContext } from "@/login/KcContext";
5
5
  import { assert } from "tsafe/assert";
6
6
  import { Template } from "../../components/Template";
7
7
 
@@ -9,15 +9,12 @@ export function Page() {
9
9
  const { kcContext } = useKcContext();
10
10
  assert(kcContext.pageId === "login-x509-info.ftl");
11
11
 
12
-
13
12
  const { url, x509 } = kcContext;
14
13
 
15
14
  const { msg, msgStr } = useI18n();
16
15
 
17
16
  return (
18
- <Template
19
- headerNode={msg("doLogIn")}
20
- >
17
+ <Template headerNode={msg("doLogIn")}>
21
18
  <form
22
19
  id="kc-x509-login-info"
23
20
  className="space-y-6"
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  const { KcPageStory } = createKcPageStory({ pageId: "logout-confirm.ftl" });
5
4
 
6
5
  const meta = {
@@ -1,6 +1,6 @@
1
1
  import { Button } from "@/components/ui/button";
2
- import { useI18n } from '@/login/i18n';
3
- import { useKcContext } from '@/login/KcContext';
2
+ import { useI18n } from "@/login/i18n";
3
+ import { useKcContext } from "@/login/KcContext";
4
4
  import { assert } from "tsafe/assert";
5
5
  import { Template } from "../../components/Template";
6
6
 
@@ -8,14 +8,11 @@ export function Page() {
8
8
  const { kcContext } = useKcContext();
9
9
  assert(kcContext.pageId === "logout-confirm.ftl");
10
10
 
11
-
12
11
  const { url, client, logoutConfirm } = kcContext;
13
12
 
14
13
  const { msg, msgStr } = useI18n();
15
14
  return (
16
- <Template
17
- headerNode={msg("logoutConfirmTitle")}
18
- >
15
+ <Template headerNode={msg("logoutConfirmTitle")}>
19
16
  <div className="space-y-4">
20
17
  <p className="text-foreground ">{msg("logoutConfirmHeader")}</p>
21
18
 
@@ -1,4 +1,4 @@
1
- import { Button } from '@/components/ui/button';
1
+ import { Button } from "@/components/ui/button";
2
2
  import { clsx } from "@keycloakify/login-ui/tools/clsx";
3
3
  import { useKcClsx } from "@keycloakify/login-ui/useKcClsx";
4
4
  import { useLayoutEffect, useState } from "react";
@@ -35,7 +35,9 @@ export function Form() {
35
35
  className="space-y-3"
36
36
  method="post"
37
37
  >
38
- <UserProfileFormFields onIsFormSubmittableValueChange={setIsFormSubmittable} />
38
+ <UserProfileFormFields
39
+ onIsFormSubmittableValueChange={setIsFormSubmittable}
40
+ />
39
41
  {kcContext.termsAcceptanceRequired && (
40
42
  <TermsAcceptance
41
43
  messagesPerField={kcContext.messagesPerField}
@@ -44,7 +46,8 @@ export function Form() {
44
46
  />
45
47
  )}
46
48
  {kcContext.recaptchaRequired &&
47
- (kcContext.recaptchaVisible || kcContext.recaptchaAction === undefined) && (
49
+ (kcContext.recaptchaVisible ||
50
+ kcContext.recaptchaAction === undefined) && (
48
51
  <div className="form-group">
49
52
  <div className={kcClsx("kcInputWrapperClass")}>
50
53
  <div
@@ -57,10 +60,9 @@ export function Form() {
57
60
  </div>
58
61
  )}
59
62
  <div className={kcClsx("kcFormGroupClass")}>
60
-
61
63
  {kcContext.recaptchaRequired &&
62
- !kcContext.recaptchaVisible &&
63
- kcContext.recaptchaAction !== undefined ? (
64
+ !kcContext.recaptchaVisible &&
65
+ kcContext.recaptchaAction !== undefined ? (
64
66
  <div id="kc-form-buttons" className={kcClsx("kcFormButtonsClass")}>
65
67
  <button
66
68
  className={clsx(
@@ -100,7 +102,6 @@ export function Form() {
100
102
  <a href={kcContext.url.loginUrl}>{msg("backToLogin")}</a>
101
103
  </Button>
102
104
  </div>
103
-
104
105
  </form>
105
106
  );
106
107
  }
@@ -59,7 +59,8 @@ export const WithEmailAlreadyExists: Story = {
59
59
  // existsError() so they are the only ones that need to mock.
60
60
  existsError: (fieldName: string, ...otherFieldNames: string[]) =>
61
61
  [fieldName, ...otherFieldNames].includes("email"),
62
- get: (fieldName: string) => (fieldName === "email" ? "Email already exists." : undefined)
62
+ get: (fieldName: string) =>
63
+ fieldName === "email" ? "Email already exists." : undefined
63
64
  }
64
65
  }
65
66
  }
@@ -73,12 +74,15 @@ export const WithRestrictedToMITStudents: Story = {
73
74
  email: {
74
75
  validators: {
75
76
  pattern: {
76
- pattern: "^[^@]+@([^.]+\\.)*((mit\\.edu)|(berkeley\\.edu))$",
77
- "error-message": "${profile.attributes.email.pattern.error}"
77
+ pattern:
78
+ "^[^@]+@([^.]+\\.)*((mit\\.edu)|(berkeley\\.edu))$",
79
+ "error-message":
80
+ "${profile.attributes.email.pattern.error}"
78
81
  }
79
82
  },
80
83
  annotations: {
81
- inputHelperTextBefore: "${profile.attributes.email.inputHelperTextBefore}"
84
+ inputHelperTextBefore:
85
+ "${profile.attributes.email.inputHelperTextBefore}"
82
86
  }
83
87
  }
84
88
  }
@@ -109,7 +113,8 @@ export const WithFavoritePet: Story = {
109
113
  }
110
114
  },
111
115
  annotations: {
112
- inputOptionLabelsI18nPrefix: "profile.attributes.favoritePet.options"
116
+ inputOptionLabelsI18nPrefix:
117
+ "profile.attributes.favoritePet.options"
113
118
  },
114
119
  required: false,
115
120
  readOnly: false
@@ -210,7 +215,8 @@ export const WithTermsAcceptance: Story = {
210
215
  termsAcceptanceRequired: true,
211
216
  "x-keycloakify": {
212
217
  messages: {
213
- termsText: "<a href='https://example.com/terms'>Service Terms of Use</a>"
218
+ termsText:
219
+ "<a href='https://example.com/terms'>Service Terms of Use</a>"
214
220
  }
215
221
  }
216
222
  }
@@ -225,7 +231,9 @@ export const WithTermsNotAccepted: Story = {
225
231
  messagesPerField: {
226
232
  existsError: (fieldName: string) => fieldName === "termsAccepted",
227
233
  get: (fieldName: string) =>
228
- fieldName === "termsAccepted" ? "You must accept the terms." : undefined
234
+ fieldName === "termsAccepted"
235
+ ? "You must accept the terms."
236
+ : undefined
229
237
  }
230
238
  }}
231
239
  />
@@ -241,7 +249,8 @@ export const WithFieldErrors: Story = {
241
249
  }
242
250
  },
243
251
  messagesPerField: {
244
- existsError: (fieldName: string) => ["username", "email"].includes(fieldName),
252
+ existsError: (fieldName: string) =>
253
+ ["username", "email"].includes(fieldName),
245
254
  get: (fieldName: string) => {
246
255
  if (fieldName === "username") return "Username is required.";
247
256
  if (fieldName === "email") return "Invalid email format.";
@@ -1,8 +1,8 @@
1
- import { Checkbox } from '@/components/ui/checkbox';
2
- import { FieldError } from '@/components/ui/field';
3
- import { Label } from '@/components/ui/label';
4
- import { useI18n } from '@/login/i18n';
5
- import type { KcContext } from '@/login/KcContext';
1
+ import { Checkbox } from "@/components/ui/checkbox";
2
+ import { FieldError } from "@/components/ui/field";
3
+ import { Label } from "@/components/ui/label";
4
+ import { useI18n } from "@/login/i18n";
5
+ import type { KcContext } from "@/login/KcContext";
6
6
  import { kcSanitize } from "@keycloakify/login-ui/kcSanitize";
7
7
 
8
8
  export function TermsAcceptance(props: {
@@ -10,8 +10,7 @@ export function TermsAcceptance(props: {
10
10
  areTermsAccepted: boolean;
11
11
  onAreTermsAcceptedValueChange: (areTermsAccepted: boolean) => void;
12
12
  }) {
13
- const { messagesPerField, areTermsAccepted, onAreTermsAcceptedValueChange } =
14
- props;
13
+ const { messagesPerField, areTermsAccepted, onAreTermsAcceptedValueChange } = props;
15
14
 
16
15
  const { msg } = useI18n();
17
16
 
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  const { KcPageStory } = createKcPageStory({ pageId: "saml-post-form.ftl" });
5
4
 
6
5
  const meta = {
@@ -1,7 +1,7 @@
1
- import { useI18n } from '@/login/i18n';
2
- import { useKcContext } from '@/login/KcContext';
1
+ import { useI18n } from "@/login/i18n";
2
+ import { useKcContext } from "@/login/KcContext";
3
3
  import { useEffect, useState } from "react";
4
- import { assert } from 'tsafe/assert';
4
+ import { assert } from "tsafe/assert";
5
5
  import { Template } from "../../components/Template";
6
6
 
7
7
  export function Page() {
@@ -29,9 +29,7 @@ export function Page() {
29
29
  }, [htmlFormElement]);
30
30
 
31
31
  return (
32
- <Template
33
- headerNode={msg("saml.post-form.title")}
34
- >
32
+ <Template headerNode={msg("saml.post-form.title")}>
35
33
  <p>{msg("saml.post-form.message")}</p>
36
34
  <form
37
35
  name="saml-post-binding"
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  const { KcPageStory } = createKcPageStory({ pageId: "select-authenticator.ftl" });
5
4
 
6
5
  const meta = {
@@ -1,6 +1,6 @@
1
1
  import { Button } from "@/components/ui/button";
2
- import { useI18n } from '@/login/i18n';
3
- import { useKcContext } from '@/login/KcContext';
2
+ import { useI18n } from "@/login/i18n";
3
+ import { useKcContext } from "@/login/KcContext";
4
4
  import { ChevronRight, Fingerprint, Globe, KeyRound, Shield } from "lucide-react";
5
5
  import { FaKey } from "react-icons/fa";
6
6
  import { assert } from "tsafe/assert";
@@ -58,10 +58,7 @@ export function Page() {
58
58
 
59
59
  const { msg, advancedMsg } = useI18n();
60
60
  return (
61
- <Template
62
- displayInfo={false}
63
- headerNode={msg("loginChooseAuthenticator")}
64
- >
61
+ <Template displayInfo={false} headerNode={msg("loginChooseAuthenticator")}>
65
62
  <form
66
63
  id="kc-select-credential-form"
67
64
  className="space-y-3"
@@ -6,14 +6,13 @@ import {
6
6
  SelectTrigger,
7
7
  SelectValue
8
8
  } from "@/components/ui/select";
9
- import { useI18n } from '@/login/i18n';
10
- import { useKcContext } from '@/login/KcContext';
9
+ import { useI18n } from "@/login/i18n";
10
+ import { useKcContext } from "@/login/KcContext";
11
11
  import { Building2 } from "lucide-react";
12
- import { MouseEvent, useRef, useState } from "react";
13
- import { assert } from 'tsafe/assert';
12
+ import { type MouseEvent, useRef, useState } from "react";
13
+ import { assert } from "tsafe/assert";
14
14
  import { Template } from "../../components/Template";
15
15
 
16
-
17
16
  export function Page() {
18
17
  const { kcContext } = useKcContext();
19
18
  assert(kcContext.pageId === "select-organization.ftl");
@@ -65,9 +64,7 @@ export function Page() {
65
64
  const useSelect = organizations.length > 3;
66
65
 
67
66
  return (
68
- <Template
69
- headerNode={msg("organization.selectTitle")}
70
- >
67
+ <Template headerNode={msg("organization.selectTitle")}>
71
68
  <form ref={formRef} action={kcContext.url.loginAction} method="post">
72
69
  <div id="kc-user-organizations" className="space-y-2">
73
70
  <h2 className="text-md font-semibold">
@@ -1,4 +1,4 @@
1
- import { Button } from '@/components/ui/button';
1
+ import { Button } from "@/components/ui/button";
2
2
  import { assert } from "tsafe/assert";
3
3
  import { useKcContext } from "../../KcContext";
4
4
  import { Template } from "../../components/Template";
@@ -8,7 +8,6 @@ export function Page() {
8
8
  const { kcContext } = useKcContext();
9
9
  assert(kcContext.pageId === "terms.ftl");
10
10
 
11
-
12
11
  const { msg, msgStr } = useI18n();
13
12
 
14
13
  const { url } = kcContext;
@@ -42,7 +41,6 @@ export function Page() {
42
41
  >
43
42
  {msgStr("doAccept")}
44
43
  </Button>
45
-
46
44
  </div>
47
45
  </form>
48
46
  </div>
@@ -1,6 +1,5 @@
1
1
  import { createKcPageStory, type Meta, type StoryObj } from "../../mocks/KcPageStory";
2
2
 
3
-
4
3
  const { KcPageStory } = createKcPageStory({ pageId: "update-email.ftl" });
5
4
 
6
5
  const meta = {
@@ -1,19 +1,16 @@
1
1
  import { Button } from "@/components/ui/button";
2
- import { LogoutOtherSessions } from '@/login/components/LogoutOtherSessions';
3
- import { useI18n } from '@/login/i18n';
4
- import { useKcContext } from '@/login/KcContext';
2
+ import { LogoutOtherSessions } from "@/login/components/LogoutOtherSessions";
3
+ import { useI18n } from "@/login/i18n";
4
+ import { useKcContext } from "@/login/KcContext";
5
5
  import { useState } from "react";
6
6
  import { assert } from "tsafe/assert";
7
7
  import { Template } from "../../components/Template";
8
8
  import { UserProfileFormFields } from "../../components/UserProfileFormFields";
9
9
 
10
-
11
10
  export function Page() {
12
-
13
11
  const { kcContext } = useKcContext();
14
12
  assert(kcContext.pageId === "update-email.ftl");
15
13
 
16
-
17
14
  const { msg, msgStr } = useI18n();
18
15
 
19
16
  const [isFormSubmittable, setIsFormSubmittable] = useState(false);
@@ -32,7 +29,9 @@ export function Page() {
32
29
  action={url.loginAction}
33
30
  method="post"
34
31
  >
35
- <UserProfileFormFields onIsFormSubmittableValueChange={setIsFormSubmittable} />
32
+ <UserProfileFormFields
33
+ onIsFormSubmittableValueChange={setIsFormSubmittable}
34
+ />
36
35
 
37
36
  <LogoutOtherSessions />
38
37