@oussemasahbeni/keycloakify-login-shadcn 250004.0.2 → 250004.0.7

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 (174) hide show
  1. package/keycloak-theme/components/ui/alert.tsx +4 -4
  2. package/keycloak-theme/components/ui/dropdown-menu.tsx +5 -5
  3. package/keycloak-theme/components/ui/input.tsx +1 -1
  4. package/keycloak-theme/components/ui/select.tsx +4 -4
  5. package/keycloak-theme/components/ui/separator.tsx +1 -1
  6. package/keycloak-theme/login/KcContext.ts +23 -19
  7. package/keycloak-theme/login/KcPage.tsx +47 -60
  8. package/keycloak-theme/login/assets/img/auth-logo.svg +100 -100
  9. package/keycloak-theme/login/assets/img/shape.svg +71 -71
  10. package/keycloak-theme/login/components/LogoutOtherSessions.tsx +26 -26
  11. package/keycloak-theme/login/components/PasswordWrapper.tsx +35 -35
  12. package/keycloak-theme/login/components/Template/Template.tsx +227 -226
  13. package/keycloak-theme/login/components/Template/index.ts +1 -1
  14. package/keycloak-theme/login/components/Template/useInitializeTemplate.ts +61 -61
  15. package/keycloak-theme/login/components/UserProfileFormFields/AddRemoveButtonsMultiValuedAttribute.tsx +61 -61
  16. package/keycloak-theme/login/components/UserProfileFormFields/DO_MAKE_USER_CONFIRM_PASSWORD.ts +2 -2
  17. package/keycloak-theme/login/components/UserProfileFormFields/FieldErrors.tsx +28 -28
  18. package/keycloak-theme/login/components/UserProfileFormFields/GroupLabel.tsx +70 -70
  19. package/keycloak-theme/login/components/UserProfileFormFields/InputFieldByType.tsx +58 -58
  20. package/keycloak-theme/login/components/UserProfileFormFields/InputTag.tsx +116 -116
  21. package/keycloak-theme/login/components/UserProfileFormFields/InputTagSelects.tsx +135 -135
  22. package/keycloak-theme/login/components/UserProfileFormFields/SelectTag.tsx +114 -114
  23. package/keycloak-theme/login/components/UserProfileFormFields/TextareaTag.tsx +42 -42
  24. package/keycloak-theme/login/components/UserProfileFormFields/UserProfileFormFields.tsx +127 -127
  25. package/keycloak-theme/login/components/UserProfileFormFields/index.ts +1 -1
  26. package/keycloak-theme/login/i18n.ts +47 -51
  27. package/keycloak-theme/login/mocks/getKcContextMock.ts +22 -18
  28. package/keycloak-theme/login/pages/PageIndex.tsx +134 -134
  29. package/keycloak-theme/login/pages/code/Page.stories.tsx +62 -78
  30. package/keycloak-theme/login/pages/code/Page.tsx +89 -89
  31. package/keycloak-theme/login/pages/code/index.ts +3 -3
  32. package/keycloak-theme/login/pages/delete-account-confirm/Page.stories.tsx +39 -46
  33. package/keycloak-theme/login/pages/delete-account-confirm/Page.tsx +63 -63
  34. package/keycloak-theme/login/pages/delete-account-confirm/index.ts +3 -3
  35. package/keycloak-theme/login/pages/delete-credential/Page.stories.tsx +26 -30
  36. package/keycloak-theme/login/pages/delete-credential/Page.tsx +51 -51
  37. package/keycloak-theme/login/pages/delete-credential/index.ts +3 -3
  38. package/keycloak-theme/login/pages/error/Page.stories.tsx +47 -58
  39. package/keycloak-theme/login/pages/error/Page.tsx +42 -42
  40. package/keycloak-theme/login/pages/error/index.ts +3 -3
  41. package/keycloak-theme/login/pages/frontchannel-logout/Page.stories.tsx +25 -32
  42. package/keycloak-theme/login/pages/frontchannel-logout/Page.tsx +84 -84
  43. package/keycloak-theme/login/pages/frontchannel-logout/index.ts +3 -3
  44. package/keycloak-theme/login/pages/idp-review-user-profile/Page.stories.tsx +46 -58
  45. package/keycloak-theme/login/pages/idp-review-user-profile/Page.tsx +52 -52
  46. package/keycloak-theme/login/pages/idp-review-user-profile/index.ts +3 -3
  47. package/keycloak-theme/login/pages/info/Page.stories.tsx +50 -60
  48. package/keycloak-theme/login/pages/info/Page.tsx +92 -92
  49. package/keycloak-theme/login/pages/link-idp-action/Page.stories.tsx +32 -16
  50. package/keycloak-theme/login/pages/link-idp-action/Page.tsx +43 -43
  51. package/keycloak-theme/login/pages/link-idp-action/index.ts +3 -3
  52. package/keycloak-theme/login/pages/login/Form.tsx +242 -242
  53. package/keycloak-theme/login/pages/login/Info.tsx +29 -29
  54. package/keycloak-theme/login/pages/login/Page.stories.tsx +345 -365
  55. package/keycloak-theme/login/pages/login/Page.tsx +44 -44
  56. package/keycloak-theme/login/pages/login/SocialProviders.tsx +107 -107
  57. package/keycloak-theme/login/pages/login/index.ts +3 -3
  58. package/keycloak-theme/login/pages/login/providers/apple.svg +3 -3
  59. package/keycloak-theme/login/pages/login/providers/bitbucket.svg +11 -11
  60. package/keycloak-theme/login/pages/login/providers/discord.svg +4 -4
  61. package/keycloak-theme/login/pages/login/providers/facebook.svg +5 -5
  62. package/keycloak-theme/login/pages/login/providers/github.svg +3 -3
  63. package/keycloak-theme/login/pages/login/providers/gitlab.svg +7 -7
  64. package/keycloak-theme/login/pages/login/providers/google.svg +7 -7
  65. package/keycloak-theme/login/pages/login/providers/instagram.svg +31 -31
  66. package/keycloak-theme/login/pages/login/providers/linkedin.svg +3 -3
  67. package/keycloak-theme/login/pages/login/providers/microsoft.svg +6 -6
  68. package/keycloak-theme/login/pages/login/providers/oidc.svg +5 -5
  69. package/keycloak-theme/login/pages/login/providers/openshift.svg +7 -7
  70. package/keycloak-theme/login/pages/login/providers/paypal.svg +6 -6
  71. package/keycloak-theme/login/pages/login/providers/slack.svg +11 -11
  72. package/keycloak-theme/login/pages/login/providers/stackoverflow.svg +5 -5
  73. package/keycloak-theme/login/pages/login/providers/x.svg +3 -3
  74. package/keycloak-theme/login/pages/login/useProviderLogos.tsx +39 -39
  75. package/keycloak-theme/login/pages/login/useScript.tsx +62 -62
  76. package/keycloak-theme/login/pages/login-config-totp/Page.stories.tsx +45 -59
  77. package/keycloak-theme/login/pages/login-config-totp/Page.tsx +240 -240
  78. package/keycloak-theme/login/pages/login-config-totp/index.ts +3 -3
  79. package/keycloak-theme/login/pages/login-idp-link-confirm/Page.stories.tsx +30 -34
  80. package/keycloak-theme/login/pages/login-idp-link-confirm/Page.tsx +43 -43
  81. package/keycloak-theme/login/pages/login-idp-link-confirm/index.ts +3 -3
  82. package/keycloak-theme/login/pages/login-idp-link-confirm-override/Page.stories.tsx +16 -22
  83. package/keycloak-theme/login/pages/login-idp-link-confirm-override/Page.tsx +47 -47
  84. package/keycloak-theme/login/pages/login-idp-link-confirm-override/index.ts +3 -3
  85. package/keycloak-theme/login/pages/login-idp-link-email/Page.stories.tsx +54 -62
  86. package/keycloak-theme/login/pages/login-idp-link-email/Page.tsx +54 -54
  87. package/keycloak-theme/login/pages/login-idp-link-email/index.ts +3 -3
  88. package/keycloak-theme/login/pages/login-oauth-grant/Page.stories.tsx +39 -45
  89. package/keycloak-theme/login/pages/login-oauth-grant/Page.tsx +126 -126
  90. package/keycloak-theme/login/pages/login-oauth-grant/index.ts +3 -3
  91. package/keycloak-theme/login/pages/login-oauth2-device-verify-user-code/Page.stories.tsx +38 -48
  92. package/keycloak-theme/login/pages/login-oauth2-device-verify-user-code/Page.tsx +58 -58
  93. package/keycloak-theme/login/pages/login-oauth2-device-verify-user-code/index.ts +3 -3
  94. package/keycloak-theme/login/pages/login-otp/Page.stories.tsx +82 -96
  95. package/keycloak-theme/login/pages/login-otp/Page.tsx +108 -108
  96. package/keycloak-theme/login/pages/login-otp/index.ts +3 -3
  97. package/keycloak-theme/login/pages/login-page-expired/Page.stories.tsx +28 -36
  98. package/keycloak-theme/login/pages/login-page-expired/Page.tsx +47 -47
  99. package/keycloak-theme/login/pages/login-page-expired/index.ts +3 -3
  100. package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/Page.stories.tsx +20 -0
  101. package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/Page.tsx +233 -233
  102. package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/index.ts +3 -3
  103. package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/useScript.tsx +63 -63
  104. package/keycloak-theme/login/pages/login-password/Page.stories.tsx +55 -56
  105. package/keycloak-theme/login/pages/login-password/Page.tsx +149 -149
  106. package/keycloak-theme/login/pages/login-password/index.ts +3 -3
  107. package/keycloak-theme/login/pages/login-password/useScript.tsx +63 -63
  108. package/keycloak-theme/login/pages/login-recovery-authn-code-config/Page.stories.tsx +28 -36
  109. package/keycloak-theme/login/pages/login-recovery-authn-code-config/Page.tsx +181 -181
  110. package/keycloak-theme/login/pages/login-recovery-authn-code-config/index.ts +3 -3
  111. package/keycloak-theme/login/pages/login-recovery-authn-code-config/useScript.tsx +145 -145
  112. package/keycloak-theme/login/pages/login-recovery-authn-code-input/Page.stories.tsx +16 -22
  113. package/keycloak-theme/login/pages/login-recovery-authn-code-input/Page.tsx +70 -70
  114. package/keycloak-theme/login/pages/login-recovery-authn-code-input/index.ts +3 -3
  115. package/keycloak-theme/login/pages/login-reset-otp/Page.stories.tsx +62 -74
  116. package/keycloak-theme/login/pages/login-reset-otp/Page.tsx +86 -86
  117. package/keycloak-theme/login/pages/login-reset-otp/index.ts +3 -3
  118. package/keycloak-theme/login/pages/login-reset-password/Form.tsx +68 -68
  119. package/keycloak-theme/login/pages/login-reset-password/Page.stories.tsx +44 -54
  120. package/keycloak-theme/login/pages/login-reset-password/Page.tsx +27 -27
  121. package/keycloak-theme/login/pages/login-reset-password/index.ts +3 -3
  122. package/keycloak-theme/login/pages/login-update-password/Page.stories.tsx +40 -50
  123. package/keycloak-theme/login/pages/login-update-password/Page.tsx +111 -111
  124. package/keycloak-theme/login/pages/login-update-password/index.ts +3 -3
  125. package/keycloak-theme/login/pages/login-update-profile/Page.stories.tsx +28 -36
  126. package/keycloak-theme/login/pages/login-update-profile/Page.tsx +68 -68
  127. package/keycloak-theme/login/pages/login-update-profile/index.ts +3 -3
  128. package/keycloak-theme/login/pages/login-username/Page.stories.tsx +32 -42
  129. package/keycloak-theme/login/pages/login-username/Page.tsx +246 -246
  130. package/keycloak-theme/login/pages/login-username/index.ts +3 -3
  131. package/keycloak-theme/login/pages/login-username/useScript.tsx +62 -62
  132. package/keycloak-theme/login/pages/login-verify-email/Page.stories.tsx +68 -80
  133. package/keycloak-theme/login/pages/login-verify-email/Page.tsx +38 -38
  134. package/keycloak-theme/login/pages/login-verify-email/index.ts +3 -3
  135. package/keycloak-theme/login/pages/login-x509-info/Page.stories.tsx +29 -37
  136. package/keycloak-theme/login/pages/login-x509-info/Page.tsx +75 -75
  137. package/keycloak-theme/login/pages/login-x509-info/index.ts +3 -3
  138. package/keycloak-theme/login/pages/logout-confirm/Page.stories.tsx +34 -42
  139. package/keycloak-theme/login/pages/logout-confirm/Page.tsx +53 -53
  140. package/keycloak-theme/login/pages/logout-confirm/index.ts +3 -3
  141. package/keycloak-theme/login/pages/register/Form.tsx +106 -106
  142. package/keycloak-theme/login/pages/register/Page.stories.tsx +23 -6
  143. package/keycloak-theme/login/pages/register/Page.tsx +26 -26
  144. package/keycloak-theme/login/pages/register/TermsAcceptance.tsx +56 -56
  145. package/keycloak-theme/login/pages/register/index.ts +3 -3
  146. package/keycloak-theme/login/pages/saml-post-form/Page.stories.tsx +16 -22
  147. package/keycloak-theme/login/pages/saml-post-form/Page.tsx +66 -66
  148. package/keycloak-theme/login/pages/saml-post-form/index.ts +3 -3
  149. package/keycloak-theme/login/pages/select-authenticator/Page.stories.tsx +83 -95
  150. package/keycloak-theme/login/pages/select-authenticator/Page.tsx +100 -100
  151. package/keycloak-theme/login/pages/select-authenticator/index.ts +3 -3
  152. package/keycloak-theme/login/pages/select-organization/Page.stories.tsx +62 -49
  153. package/keycloak-theme/login/pages/select-organization/Page.tsx +126 -126
  154. package/keycloak-theme/login/pages/select-organization/index.ts +3 -3
  155. package/keycloak-theme/login/pages/terms/Page.stories.tsx +15 -0
  156. package/keycloak-theme/login/pages/terms/Page.tsx +51 -51
  157. package/keycloak-theme/login/pages/terms/index.ts +3 -3
  158. package/keycloak-theme/login/pages/update-email/Page.stories.tsx +27 -35
  159. package/keycloak-theme/login/pages/update-email/Page.tsx +62 -62
  160. package/keycloak-theme/login/pages/update-email/index.ts +3 -3
  161. package/keycloak-theme/login/pages/webauthn-authenticate/Page.stories.tsx +112 -126
  162. package/keycloak-theme/login/pages/webauthn-authenticate/Page.tsx +202 -202
  163. package/keycloak-theme/login/pages/webauthn-authenticate/index.ts +3 -3
  164. package/keycloak-theme/login/pages/webauthn-authenticate/useScript.tsx +55 -55
  165. package/keycloak-theme/login/pages/webauthn-error/Page.stories.tsx +54 -66
  166. package/keycloak-theme/login/pages/webauthn-error/Page.tsx +73 -73
  167. package/keycloak-theme/login/pages/webauthn-error/index.ts +3 -3
  168. package/keycloak-theme/login/pages/webauthn-register/Page.stories.tsx +39 -49
  169. package/keycloak-theme/login/pages/webauthn-register/Page.tsx +78 -78
  170. package/keycloak-theme/login/pages/webauthn-register/index.ts +3 -3
  171. package/keycloak-theme/login/pages/webauthn-register/useScript.tsx +62 -62
  172. package/keycloak-theme/login/shared/getColorScheme.ts +45 -0
  173. package/keycloak-theme/login/styleLevelCustomization.tsx +36 -17
  174. package/package.json +6 -5
@@ -1,11 +1,11 @@
1
- <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <title>Slack</title>
3
- <path d="M5.04235 15.1661C5.04235 16.5537 3.9088 17.6873 2.52117 17.6873C1.13355 17.6873 0 16.5537 0 15.1661C0 13.7785 1.13355 12.645 2.52117 12.645H5.04235V15.1661Z" fill="#E01E5A" />
4
- <path d="M6.3127 15.1661C6.3127 13.7785 7.44626 12.645 8.83388 12.645C10.2215 12.645 11.355 13.7785 11.355 15.1661V21.4788C11.355 22.8664 10.2215 24 8.83388 24C7.44626 24 6.3127 22.8664 6.3127 21.4788V15.1661Z" fill="#E01E5A" />
5
- <path d="M8.83388 5.04235C7.44626 5.04235 6.3127 3.9088 6.3127 2.52117C6.3127 1.13355 7.44626 0 8.83388 0C10.2215 0 11.355 1.13355 11.355 2.52117V5.04235H8.83388Z" fill="#36C5F0" />
6
- <path d="M8.83388 6.3127C10.2215 6.3127 11.355 7.44626 11.355 8.83388C11.355 10.2215 10.2215 11.355 8.83388 11.355H2.52117C1.13355 11.355 0 10.2215 0 8.83388C0 7.44626 1.13355 6.3127 2.52117 6.3127H8.83388Z" fill="#36C5F0" />
7
- <path d="M18.9577 8.83388C18.9577 7.44626 20.0912 6.3127 21.4788 6.3127C22.8664 6.3127 24 7.44626 24 8.83388C24 10.2215 22.8664 11.355 21.4788 11.355H18.9577V8.83388Z" fill="#2EB67D" />
8
- <path d="M17.6873 8.83388C17.6873 10.2215 16.5537 11.355 15.1661 11.355C13.7785 11.355 12.645 10.2215 12.645 8.83388V2.52117C12.645 1.13355 13.7785 0 15.1661 0C16.5537 0 17.6873 1.13355 17.6873 2.52117V8.83388Z" fill="#2EB67D" />
9
- <path d="M15.1661 18.9577C16.5537 18.9577 17.6873 20.0912 17.6873 21.4788C17.6873 22.8664 16.5537 24 15.1661 24C13.7785 24 12.645 22.8664 12.645 21.4788V18.9577H15.1661Z" fill="#ECB22E" />
10
- <path d="M15.1661 17.6873C13.7785 17.6873 12.645 16.5537 12.645 15.1661C12.645 13.7785 13.7785 12.645 15.1661 12.645H21.4788C22.8664 12.645 24 13.7785 24 15.1661C24 16.5537 22.8664 17.6873 21.4788 17.6873H15.1661Z" fill="#ECB22E" />
11
- </svg>
1
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <title>Slack</title>
3
+ <path d="M5.04235 15.1661C5.04235 16.5537 3.9088 17.6873 2.52117 17.6873C1.13355 17.6873 0 16.5537 0 15.1661C0 13.7785 1.13355 12.645 2.52117 12.645H5.04235V15.1661Z" fill="#E01E5A" />
4
+ <path d="M6.3127 15.1661C6.3127 13.7785 7.44626 12.645 8.83388 12.645C10.2215 12.645 11.355 13.7785 11.355 15.1661V21.4788C11.355 22.8664 10.2215 24 8.83388 24C7.44626 24 6.3127 22.8664 6.3127 21.4788V15.1661Z" fill="#E01E5A" />
5
+ <path d="M8.83388 5.04235C7.44626 5.04235 6.3127 3.9088 6.3127 2.52117C6.3127 1.13355 7.44626 0 8.83388 0C10.2215 0 11.355 1.13355 11.355 2.52117V5.04235H8.83388Z" fill="#36C5F0" />
6
+ <path d="M8.83388 6.3127C10.2215 6.3127 11.355 7.44626 11.355 8.83388C11.355 10.2215 10.2215 11.355 8.83388 11.355H2.52117C1.13355 11.355 0 10.2215 0 8.83388C0 7.44626 1.13355 6.3127 2.52117 6.3127H8.83388Z" fill="#36C5F0" />
7
+ <path d="M18.9577 8.83388C18.9577 7.44626 20.0912 6.3127 21.4788 6.3127C22.8664 6.3127 24 7.44626 24 8.83388C24 10.2215 22.8664 11.355 21.4788 11.355H18.9577V8.83388Z" fill="#2EB67D" />
8
+ <path d="M17.6873 8.83388C17.6873 10.2215 16.5537 11.355 15.1661 11.355C13.7785 11.355 12.645 10.2215 12.645 8.83388V2.52117C12.645 1.13355 13.7785 0 15.1661 0C16.5537 0 17.6873 1.13355 17.6873 2.52117V8.83388Z" fill="#2EB67D" />
9
+ <path d="M15.1661 18.9577C16.5537 18.9577 17.6873 20.0912 17.6873 21.4788C17.6873 22.8664 16.5537 24 15.1661 24C13.7785 24 12.645 22.8664 12.645 21.4788V18.9577H15.1661Z" fill="#ECB22E" />
10
+ <path d="M15.1661 17.6873C13.7785 17.6873 12.645 16.5537 12.645 15.1661C12.645 13.7785 13.7785 12.645 15.1661 12.645H21.4788C22.8664 12.645 24 13.7785 24 15.1661C24 16.5537 22.8664 17.6873 21.4788 17.6873H15.1661Z" fill="#ECB22E" />
11
+ </svg>
@@ -1,5 +1,5 @@
1
- <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <title>Stack Overflow</title>
3
- <path d="M18.9475 15.4707H21.0799V24H1.88887V15.4707H4.0212V21.8677H18.9475V15.4707Z" fill="#BBBBBB" />
4
- <path d="M6.34504 14.8368L16.8177 17.0379L17.2579 14.9444L6.78527 12.7422L6.34504 14.8368ZM7.73086 9.82211L17.4322 14.3403L18.3359 12.4001L8.63439 7.88188L7.73086 9.82211ZM10.4153 5.06255L18.6399 11.9114L20.0096 10.2666L11.785 3.41794L10.4153 5.06255ZM15.7242 0L14.0067 1.27746L20.3936 9.86495L22.1111 8.58768L15.7242 0ZM6.15354 19.7353H16.8152V17.603H6.15354V19.7353Z" fill="#F58025" />
5
- </svg>
1
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <title>Stack Overflow</title>
3
+ <path d="M18.9475 15.4707H21.0799V24H1.88887V15.4707H4.0212V21.8677H18.9475V15.4707Z" fill="#BBBBBB" />
4
+ <path d="M6.34504 14.8368L16.8177 17.0379L17.2579 14.9444L6.78527 12.7422L6.34504 14.8368ZM7.73086 9.82211L17.4322 14.3403L18.3359 12.4001L8.63439 7.88188L7.73086 9.82211ZM10.4153 5.06255L18.6399 11.9114L20.0096 10.2666L11.785 3.41794L10.4153 5.06255ZM15.7242 0L14.0067 1.27746L20.3936 9.86495L22.1111 8.58768L15.7242 0ZM6.15354 19.7353H16.8152V17.603H6.15354V19.7353Z" fill="#F58025" />
5
+ </svg>
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg width="300" height="271" xmlns="http://www.w3.org/2000/svg">
3
- <path d="m236 0h46l-101 115 118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123-113-148h94.9l65.5 86.6zm-16.1 244h25.5l-165-218h-27.4z"/>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="300" height="271" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="m236 0h46l-101 115 118 156h-92.6l-72.5-94.8-83 94.8h-46l107-123-113-148h94.9l65.5 86.6zm-16.1 244h25.5l-165-218h-27.4z"/>
4
4
  </svg>
@@ -1,39 +1,39 @@
1
- import appleLogo from "./providers/apple.svg";
2
- import bitbucketLogo from "./providers/bitbucket.svg";
3
- import discordLogo from "./providers/discord.svg";
4
- import facebookLogo from "./providers/facebook.svg";
5
- import githubLogo from "./providers/github.svg";
6
- import gitlabLogo from "./providers/gitlab.svg";
7
- import googleLogo from "./providers/google.svg";
8
- import instagramLogo from "./providers/instagram.svg";
9
- import linkedinLogo from "./providers/linkedin.svg";
10
- import microsoftLogo from "./providers/microsoft.svg";
11
- import oidcLogo from "./providers/oidc.svg";
12
- import openshiftLogo from "./providers/openshift.svg";
13
- import paypalLogo from "./providers/paypal.svg";
14
- import slackLogo from "./providers/slack.svg";
15
- import stackoverflowLogo from "./providers/stackoverflow.svg";
16
- import xLogo from "./providers/x.svg";
17
-
18
- const useProviderLogos: () => Record<string, string> = () => ({
19
- apple: appleLogo,
20
- bitbucket: bitbucketLogo,
21
- discord: discordLogo,
22
- facebook: facebookLogo,
23
- github: githubLogo,
24
- gitlab: gitlabLogo,
25
- google: googleLogo,
26
- instagram: instagramLogo,
27
- "linkedin-openid-connect": linkedinLogo,
28
- microsoft: microsoftLogo,
29
- oidc: oidcLogo,
30
- "openshift-v3": openshiftLogo,
31
- "openshift-v4": openshiftLogo,
32
- paypal: paypalLogo,
33
- slack: slackLogo,
34
- stackoverflow: stackoverflowLogo,
35
- twitter: xLogo,
36
- x: xLogo
37
- });
38
-
39
- export default useProviderLogos;
1
+ import appleLogo from "./providers/apple.svg";
2
+ import bitbucketLogo from "./providers/bitbucket.svg";
3
+ import discordLogo from "./providers/discord.svg";
4
+ import facebookLogo from "./providers/facebook.svg";
5
+ import githubLogo from "./providers/github.svg";
6
+ import gitlabLogo from "./providers/gitlab.svg";
7
+ import googleLogo from "./providers/google.svg";
8
+ import instagramLogo from "./providers/instagram.svg";
9
+ import linkedinLogo from "./providers/linkedin.svg";
10
+ import microsoftLogo from "./providers/microsoft.svg";
11
+ import oidcLogo from "./providers/oidc.svg";
12
+ import openshiftLogo from "./providers/openshift.svg";
13
+ import paypalLogo from "./providers/paypal.svg";
14
+ import slackLogo from "./providers/slack.svg";
15
+ import stackoverflowLogo from "./providers/stackoverflow.svg";
16
+ import xLogo from "./providers/x.svg";
17
+
18
+ const useProviderLogos: () => Record<string, string> = () => ({
19
+ apple: appleLogo,
20
+ bitbucket: bitbucketLogo,
21
+ discord: discordLogo,
22
+ facebook: facebookLogo,
23
+ github: githubLogo,
24
+ gitlab: gitlabLogo,
25
+ google: googleLogo,
26
+ instagram: instagramLogo,
27
+ "linkedin-openid-connect": linkedinLogo,
28
+ microsoft: microsoftLogo,
29
+ oidc: oidcLogo,
30
+ "openshift-v3": openshiftLogo,
31
+ "openshift-v4": openshiftLogo,
32
+ paypal: paypalLogo,
33
+ slack: slackLogo,
34
+ stackoverflow: stackoverflowLogo,
35
+ twitter: xLogo,
36
+ x: xLogo
37
+ });
38
+
39
+ export default useProviderLogos;
@@ -1,62 +1,62 @@
1
- import { useInsertScriptTags } from "@keycloakify/login-ui/tools/useInsertScriptTags";
2
- import { waitForElementMountedOnDom } from "@keycloakify/login-ui/tools/waitForElementMountedOnDom";
3
- import { useEffect } from "react";
4
- import { assert } from "tsafe/assert";
5
- import { useI18n } from "../../i18n";
6
- import { useKcContext } from "../../KcContext";
7
-
8
- export function useScript(params: { webAuthnButtonId: string }) {
9
- const { webAuthnButtonId } = params;
10
-
11
- const { kcContext } = useKcContext();
12
- assert(kcContext.pageId === "login.ftl");
13
-
14
- const { msgStr, isFetchingTranslations } = useI18n();
15
-
16
- const { insertScriptTags } = useInsertScriptTags({
17
- effectId: "Login",
18
- scriptTags: [
19
- {
20
- type: "module",
21
- textContent: () => `
22
- import { authenticateByWebAuthn } from "${import.meta.env.BASE_URL}keycloak-theme/login/js/webauthnAuthenticate.js";
23
- import { initAuthenticate } from "${import.meta.env.BASE_URL}keycloak-theme/login/js/passkeysConditionalAuth.js";
24
-
25
- const authButton = document.getElementById("${webAuthnButtonId}");
26
- const input = {
27
- isUserIdentified : ${kcContext.isUserIdentified},
28
- challenge : ${JSON.stringify(kcContext.challenge)},
29
- userVerification : ${JSON.stringify(kcContext.userVerification)},
30
- rpId : ${JSON.stringify(kcContext.rpId)},
31
- createTimeout : ${kcContext.createTimeout}
32
- };
33
- authButton.addEventListener("click", () => {
34
- authenticateByWebAuthn({
35
- ...input,
36
- errmsg : ${JSON.stringify(msgStr("webauthn-unsupported-browser-text"))}
37
- });
38
- });
39
-
40
- initAuthenticate({
41
- ...input,
42
- errmsg : ${JSON.stringify(msgStr("passkey-unsupported-browser-text"))}
43
- });
44
- `
45
- }
46
- ]
47
- });
48
-
49
- useEffect(() => {
50
- if (isFetchingTranslations) {
51
- return;
52
- }
53
-
54
- (async () => {
55
- await waitForElementMountedOnDom({
56
- elementId: webAuthnButtonId
57
- });
58
-
59
- insertScriptTags();
60
- })();
61
- }, [isFetchingTranslations]);
62
- }
1
+ import { useInsertScriptTags } from "@keycloakify/login-ui/tools/useInsertScriptTags";
2
+ import { waitForElementMountedOnDom } from "@keycloakify/login-ui/tools/waitForElementMountedOnDom";
3
+ import { useEffect } from "react";
4
+ import { assert } from "tsafe/assert";
5
+ import { useI18n } from "../../i18n";
6
+ import { useKcContext } from "../../KcContext";
7
+
8
+ export function useScript(params: { webAuthnButtonId: string }) {
9
+ const { webAuthnButtonId } = params;
10
+
11
+ const { kcContext } = useKcContext();
12
+ assert(kcContext.pageId === "login.ftl");
13
+
14
+ const { msgStr, isFetchingTranslations } = useI18n();
15
+
16
+ const { insertScriptTags } = useInsertScriptTags({
17
+ effectId: "Login",
18
+ scriptTags: [
19
+ {
20
+ type: "module",
21
+ textContent: () => `
22
+ import { authenticateByWebAuthn } from "${import.meta.env.BASE_URL}keycloak-theme/login/js/webauthnAuthenticate.js";
23
+ import { initAuthenticate } from "${import.meta.env.BASE_URL}keycloak-theme/login/js/passkeysConditionalAuth.js";
24
+
25
+ const authButton = document.getElementById("${webAuthnButtonId}");
26
+ const input = {
27
+ isUserIdentified : ${kcContext.isUserIdentified},
28
+ challenge : ${JSON.stringify(kcContext.challenge)},
29
+ userVerification : ${JSON.stringify(kcContext.userVerification)},
30
+ rpId : ${JSON.stringify(kcContext.rpId)},
31
+ createTimeout : ${kcContext.createTimeout}
32
+ };
33
+ authButton.addEventListener("click", () => {
34
+ authenticateByWebAuthn({
35
+ ...input,
36
+ errmsg : ${JSON.stringify(msgStr("webauthn-unsupported-browser-text"))}
37
+ });
38
+ });
39
+
40
+ initAuthenticate({
41
+ ...input,
42
+ errmsg : ${JSON.stringify(msgStr("passkey-unsupported-browser-text"))}
43
+ });
44
+ `
45
+ }
46
+ ]
47
+ });
48
+
49
+ useEffect(() => {
50
+ if (isFetchingTranslations) {
51
+ return;
52
+ }
53
+
54
+ (async () => {
55
+ await waitForElementMountedOnDom({
56
+ elementId: webAuthnButtonId
57
+ });
58
+
59
+ insertScriptTags();
60
+ })();
61
+ }, [isFetchingTranslations]);
62
+ }
@@ -12,78 +12,64 @@ export default meta;
12
12
 
13
13
  type Story = StoryObj<typeof meta>;
14
14
 
15
- export const Default: Story = {
16
- render: () => <KcPageStory />
17
- };
15
+ export const Default: Story = {};
18
16
 
19
17
  export const Arabic: Story = {
20
- render: () => (
21
- <KcPageStory
22
- kcContext={{
23
- locale: {
24
- currentLanguageTag: "ar",
25
- rtl: true
26
- }
27
- }}
28
- />
29
- )
18
+ args: {
19
+ kcContext: {
20
+ locale: {
21
+ currentLanguageTag: "ar",
22
+ rtl: true
23
+ }
24
+ }
25
+ }
30
26
  };
31
27
  export const French: Story = {
32
- render: () => (
33
- <KcPageStory
34
- kcContext={{
35
- locale: {
36
- currentLanguageTag: "fr"
37
- }
38
- }}
39
- />
40
- )
28
+ args: {
29
+ kcContext: {
30
+ locale: {
31
+ currentLanguageTag: "fr"
32
+ }
33
+ }
34
+ }
41
35
  };
42
36
 
43
37
  export const WithManualSetUp: Story = {
44
- render: () => (
45
- <KcPageStory
46
- kcContext={{
47
- mode: "manual"
48
- }}
49
- />
50
- )
38
+ args: {
39
+ kcContext: {
40
+ mode: "manual"
41
+ }
42
+ }
51
43
  };
52
44
 
53
45
  export const WithError: Story = {
54
- render: () => (
55
- <KcPageStory
56
- kcContext={{
57
- messagesPerField: {
58
- get: (fieldName: string) =>
59
- fieldName === "totp" ? "Invalid TOTP" : undefined,
60
- exists: (fieldName: string) => fieldName === "totp",
61
- existsError: (fieldName: string) => fieldName === "totp",
62
- printIfExists: <T,>(fieldName: string, x: T) =>
63
- fieldName === "totp" ? x : undefined
64
- }
65
- }}
66
- />
67
- )
46
+ args: {
47
+ kcContext: {
48
+ messagesPerField: {
49
+ get: (fieldName: string) =>
50
+ fieldName === "totp" ? "Invalid TOTP" : undefined,
51
+ exists: (fieldName: string) => fieldName === "totp",
52
+ existsError: (fieldName: string) => fieldName === "totp",
53
+ printIfExists: <T,>(fieldName: string, x: T) =>
54
+ fieldName === "totp" ? x : undefined
55
+ }
56
+ }
57
+ }
68
58
  };
69
59
  export const WithAppInitiatedAction: Story = {
70
- render: () => (
71
- <KcPageStory
72
- kcContext={{
73
- isAppInitiatedAction: true
74
- }}
75
- />
76
- )
60
+ args: {
61
+ kcContext: {
62
+ isAppInitiatedAction: true
63
+ }
64
+ }
77
65
  };
78
66
 
79
67
  export const WithPreFilledUserLabel: Story = {
80
- render: () => (
81
- <KcPageStory
82
- kcContext={{
83
- totp: {
84
- otpCredentials: [{ userLabel: "MyDevice" }]
85
- }
86
- }}
87
- />
88
- )
68
+ args: {
69
+ kcContext: {
70
+ totp: {
71
+ otpCredentials: [{ userLabel: "MyDevice" }]
72
+ }
73
+ }
74
+ }
89
75
  };