@okta/okta-signin-widget 7.16.0 → 7.16.1

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 (246) hide show
  1. package/README.md +5 -5
  2. package/dist/css/fonts.css +172 -0
  3. package/dist/css/okta-sign-in.next.css +1 -240
  4. package/dist/css/okta-sign-in.next.css.map +1 -1
  5. package/dist/esm/src/config/config.json.js +1 -1
  6. package/dist/js/okta-sign-in.classic.js +1 -1
  7. package/dist/js/okta-sign-in.classic.min.js +1 -1
  8. package/dist/js/okta-sign-in.js +1 -1
  9. package/dist/js/okta-sign-in.min.js +1 -1
  10. package/dist/js/okta-sign-in.next.js +61 -19
  11. package/dist/js/okta-sign-in.next.js.map +1 -1
  12. package/dist/js/okta-sign-in.next.no-polyfill.js +60 -18
  13. package/dist/js/okta-sign-in.next.no-polyfill.js.map +1 -1
  14. package/dist/js/okta-sign-in.no-polyfill.min.js +1 -1
  15. package/dist/js/okta-sign-in.oie.js +1 -1
  16. package/dist/js/okta-sign-in.oie.min.js +1 -1
  17. package/package.json +10 -5
  18. package/src/config/config.json +1 -1
  19. package/src/v3/components/AuthCoin/AuthCoin.tsx +15 -17
  20. package/src/v3/components/AuthContainer/AuthContainer.tsx +11 -17
  21. package/src/v3/components/AuthContent/AuthContent.tsx +21 -16
  22. package/src/v3/components/AuthHeader/AuthHeader.tsx +18 -19
  23. package/src/v3/components/AuthenticatorButton/AuthenticatorButton.tsx +116 -77
  24. package/src/v3/components/AuthenticatorButton/AuthenticatorButtonList.tsx +9 -3
  25. package/src/v3/components/Button/Button.tsx +16 -20
  26. package/src/v3/components/CaptchaContainer/CaptchaContainer.tsx +1 -1
  27. package/src/v3/components/Checkbox/Checkbox.tsx +33 -82
  28. package/src/v3/components/ConsentHeader/ConsentHeader.tsx +23 -23
  29. package/src/v3/components/Divider/Divider.tsx +2 -2
  30. package/src/v3/components/Form/Accordion.tsx +15 -36
  31. package/src/v3/components/Form/ElementContainer.tsx +6 -3
  32. package/src/v3/components/Form/Form.tsx +2 -4
  33. package/src/v3/components/Form/Layout.tsx +1 -1
  34. package/src/v3/components/Form/LayoutContainer.tsx +4 -2
  35. package/src/v3/components/Heading/Heading.tsx +7 -5
  36. package/src/v3/components/Icon/CustomAppIcon.tsx +13 -15
  37. package/src/v3/components/Icon/CustomOTPIcon.tsx +5 -10
  38. package/src/v3/components/Icon/DuoIcon.tsx +5 -10
  39. package/src/v3/components/Icon/EmailIcon.tsx +5 -10
  40. package/src/v3/components/Icon/GoogleOTPIcon.tsx +5 -10
  41. package/src/v3/components/Icon/IDPIcon.tsx +5 -10
  42. package/src/v3/components/Icon/OktaVerifyIcon.tsx +0 -7
  43. package/src/v3/components/Icon/OnPremMFAIcon.tsx +5 -10
  44. package/src/v3/components/Icon/PasswordIcon.tsx +5 -10
  45. package/src/v3/components/Icon/PhoneIcon.tsx +5 -10
  46. package/src/v3/components/Icon/RSAIcon.tsx +6 -11
  47. package/src/v3/components/Icon/SecurityKeyOrBiometricsIcon.tsx +5 -10
  48. package/src/v3/components/Icon/SecurityQuestionIcon.tsx +5 -10
  49. package/src/v3/components/Icon/SmartCardIcon.tsx +5 -10
  50. package/src/v3/components/Icon/SymantecIcon.tsx +5 -10
  51. package/src/v3/components/Icon/YubiKeyIcon.tsx +5 -10
  52. package/src/v3/components/Icon/index.tsx +0 -2
  53. package/src/v3/components/IdentifierContainer/IdentifierContainer.tsx +31 -47
  54. package/src/v3/components/Image/Image.tsx +42 -0
  55. package/src/v3/{src/components/CustomPluginsOdysseyCacheProvider → components/Image}/index.tsx +2 -2
  56. package/src/v3/components/ImageWithText/ImageWithText.tsx +7 -4
  57. package/src/v3/components/Images/AppIcon.tsx +16 -46
  58. package/src/v3/components/Images/DeviceIcon.tsx +16 -32
  59. package/src/v3/components/Images/LocationIcon.tsx +16 -26
  60. package/src/v3/components/Images/PhoneIcon.tsx +34 -29
  61. package/src/v3/components/Images/YubikeyDemoImage.tsx +32 -27
  62. package/src/v3/components/Images/index.tsx +0 -1
  63. package/src/v3/components/InfoBox/InfoBox.tsx +12 -12
  64. package/src/v3/components/InfoSection/InfoSection.tsx +20 -14
  65. package/src/v3/components/InformationalText/InformationalText.tsx +16 -6
  66. package/src/v3/components/InputPassword/InputPassword.tsx +31 -164
  67. package/src/v3/components/InputText/InputText.tsx +27 -103
  68. package/src/v3/components/LaunchAuthenticatorButton/LaunchAuthenticatorButton.tsx +14 -26
  69. package/src/v3/components/Link/Link.tsx +8 -20
  70. package/src/v3/components/List/List.tsx +16 -12
  71. package/src/v3/components/PIVButton/PIVButton.tsx +10 -8
  72. package/src/v3/components/PasswordRequirements/Icon.tsx +17 -23
  73. package/src/v3/components/PasswordRequirements/PasswordMatches.tsx +9 -2
  74. package/src/v3/components/PasswordRequirements/PasswordRequirementListItem.tsx +6 -5
  75. package/src/v3/components/PasswordRequirements/PasswordRequirements.tsx +5 -3
  76. package/src/v3/components/PhoneAuthenticator/PhoneAuthenticator.tsx +53 -137
  77. package/src/v3/components/QRCode/QRCode.tsx +27 -20
  78. package/src/v3/components/Radio/Radio.tsx +31 -93
  79. package/src/v3/components/ReminderPrompt/ReminderPrompt.tsx +9 -12
  80. package/src/v3/components/Select/Select.tsx +45 -92
  81. package/src/v3/components/Spinner/Spinner.tsx +6 -8
  82. package/src/v3/components/StepperButton/StepperButton.tsx +6 -10
  83. package/src/v3/components/StepperLink/StepperLink.tsx +1 -1
  84. package/src/v3/components/StepperRadio/StepperRadio.tsx +22 -43
  85. package/src/v3/components/TextWithActionLink/TextWithActionLink.tsx +1 -1
  86. package/src/v3/components/Title/Title.tsx +5 -9
  87. package/src/v3/components/WebAuthNSubmitButton/WebAuthNSubmitButton.tsx +10 -9
  88. package/src/v3/components/Widget/GlobalStyles.tsx +16 -21
  89. package/src/v3/components/Widget/index.tsx +51 -36
  90. package/src/v3/components/Widget/style.scss +295 -0
  91. package/src/v3/components/WidgetMessageContainer/WidgetMessageContainer.tsx +11 -8
  92. package/src/v3/components/hocs/withFormValidationState.tsx +2 -5
  93. package/src/v3/jest.config.js +1 -0
  94. package/src/v3/jest.setup.js +1 -0
  95. package/src/v3/package.json +11 -7
  96. package/src/v3/screenshots/base/UI_demo/UI_demo_RTL_VRT.png +0 -0
  97. package/src/v3/screenshots/base/UI_demo/UI_demo_VRT.png +0 -0
  98. package/src/v3/src/components/AuthCoin/AuthCoin.tsx +15 -17
  99. package/src/v3/src/components/AuthCoin/__snapshots__/AuthCoin.test.tsx.snap +20 -47
  100. package/src/v3/src/components/AuthContainer/AuthContainer.tsx +11 -17
  101. package/src/v3/src/components/AuthContent/AuthContent.tsx +21 -16
  102. package/src/v3/src/components/AuthHeader/AuthHeader.tsx +18 -19
  103. package/src/v3/src/components/AuthenticatorButton/AuthenticatorButton.tsx +116 -77
  104. package/src/v3/src/components/AuthenticatorButton/AuthenticatorButtonList.tsx +9 -3
  105. package/src/v3/src/components/Button/Button.tsx +16 -20
  106. package/src/v3/src/components/CaptchaContainer/CaptchaContainer.tsx +1 -1
  107. package/src/v3/src/components/Checkbox/Checkbox.tsx +33 -82
  108. package/src/v3/src/components/ConsentHeader/ConsentHeader.tsx +23 -23
  109. package/src/v3/src/components/Divider/Divider.tsx +2 -2
  110. package/src/v3/src/components/Form/Accordion.tsx +15 -36
  111. package/src/v3/src/components/Form/ElementContainer.tsx +6 -3
  112. package/src/v3/src/components/Form/Form.tsx +2 -4
  113. package/src/v3/src/components/Form/Layout.tsx +1 -1
  114. package/src/v3/src/components/Form/LayoutContainer.tsx +4 -2
  115. package/src/v3/src/components/Heading/Heading.tsx +7 -5
  116. package/src/v3/src/components/Icon/CustomAppIcon.tsx +13 -15
  117. package/src/v3/src/components/Icon/CustomOTPIcon.tsx +5 -10
  118. package/src/v3/src/components/Icon/DuoIcon.tsx +5 -10
  119. package/src/v3/src/components/Icon/EmailIcon.tsx +5 -10
  120. package/src/v3/src/components/Icon/GoogleOTPIcon.tsx +5 -10
  121. package/src/v3/src/components/Icon/IDPIcon.tsx +5 -10
  122. package/src/v3/src/components/Icon/OktaVerifyIcon.tsx +0 -7
  123. package/src/v3/src/components/Icon/OnPremMFAIcon.tsx +5 -10
  124. package/src/v3/src/components/Icon/PasswordIcon.tsx +5 -10
  125. package/src/v3/src/components/Icon/PhoneIcon.tsx +5 -10
  126. package/src/v3/src/components/Icon/RSAIcon.tsx +6 -11
  127. package/src/v3/src/components/Icon/SecurityKeyOrBiometricsIcon.tsx +5 -10
  128. package/src/v3/src/components/Icon/SecurityQuestionIcon.tsx +5 -10
  129. package/src/v3/src/components/Icon/SmartCardIcon.tsx +5 -10
  130. package/src/v3/src/components/Icon/SymantecIcon.tsx +5 -10
  131. package/src/v3/src/components/Icon/YubiKeyIcon.tsx +5 -10
  132. package/src/v3/src/components/Icon/index.tsx +0 -2
  133. package/src/v3/src/components/IdentifierContainer/IdentifierContainer.tsx +31 -47
  134. package/src/v3/src/components/Image/Image.tsx +42 -0
  135. package/src/v3/{components/CustomPluginsOdysseyCacheProvider → src/components/Image}/index.tsx +2 -2
  136. package/src/v3/src/components/ImageWithText/ImageWithText.tsx +7 -4
  137. package/src/v3/src/components/Images/AppIcon.tsx +16 -46
  138. package/src/v3/src/components/Images/DeviceIcon.tsx +16 -32
  139. package/src/v3/src/components/Images/LocationIcon.tsx +16 -26
  140. package/src/v3/src/components/Images/PhoneIcon.tsx +34 -29
  141. package/src/v3/src/components/Images/YubikeyDemoImage.tsx +32 -27
  142. package/src/v3/src/components/Images/index.tsx +0 -1
  143. package/src/v3/src/components/InfoBox/InfoBox.tsx +12 -12
  144. package/src/v3/src/components/InfoSection/InfoSection.tsx +20 -14
  145. package/src/v3/src/components/InformationalText/InformationalText.tsx +16 -6
  146. package/src/v3/src/components/InputPassword/InputPassword.tsx +31 -164
  147. package/src/v3/src/components/InputText/InputText.tsx +27 -103
  148. package/src/v3/src/components/LaunchAuthenticatorButton/LaunchAuthenticatorButton.tsx +14 -26
  149. package/src/v3/src/components/Link/Link.tsx +8 -20
  150. package/src/v3/src/components/List/List.tsx +16 -12
  151. package/src/v3/src/components/PIVButton/PIVButton.tsx +10 -8
  152. package/src/v3/src/components/PasswordRequirements/Icon.tsx +17 -23
  153. package/src/v3/src/components/PasswordRequirements/PasswordMatches.tsx +9 -2
  154. package/src/v3/src/components/PasswordRequirements/PasswordRequirementListItem.tsx +6 -5
  155. package/src/v3/src/components/PasswordRequirements/PasswordRequirements.tsx +5 -3
  156. package/src/v3/src/components/PhoneAuthenticator/PhoneAuthenticator.tsx +53 -137
  157. package/src/v3/src/components/QRCode/QRCode.tsx +27 -20
  158. package/src/v3/src/components/Radio/Radio.tsx +31 -93
  159. package/src/v3/src/components/ReminderPrompt/ReminderPrompt.tsx +9 -12
  160. package/src/v3/src/components/ReminderPrompt/__snapshots__/ReminderPrompt.test.tsx.snap +37 -17
  161. package/src/v3/src/components/Select/Select.tsx +45 -92
  162. package/src/v3/src/components/Spinner/Spinner.tsx +6 -8
  163. package/src/v3/src/components/StepperButton/StepperButton.tsx +6 -10
  164. package/src/v3/src/components/StepperLink/StepperLink.tsx +1 -1
  165. package/src/v3/src/components/StepperRadio/StepperRadio.tsx +22 -43
  166. package/src/v3/src/components/TextWithActionLink/TextWithActionLink.tsx +1 -1
  167. package/src/v3/src/components/Title/Title.tsx +5 -9
  168. package/src/v3/src/components/WebAuthNSubmitButton/WebAuthNSubmitButton.tsx +10 -9
  169. package/src/v3/src/components/Widget/GlobalStyles.tsx +16 -21
  170. package/src/v3/src/components/Widget/index.tsx +51 -36
  171. package/src/v3/src/components/Widget/style.scss +295 -0
  172. package/src/v3/src/components/WidgetMessageContainer/WidgetMessageContainer.tsx +11 -8
  173. package/src/v3/src/components/hocs/withFormValidationState.tsx +2 -5
  174. package/src/v3/src/transformer/button/__snapshots__/transformIDPButtons.test.ts.snap +0 -2
  175. package/src/v3/src/transformer/i18n/__snapshots__/transformAuthenticatorButton.test.ts.snap +4 -4
  176. package/src/v3/src/transformer/i18n/transformAuthenticatorButton.test.ts +3 -3
  177. package/src/v3/src/transformer/i18n/transformAuthenticatorButton.ts +18 -2
  178. package/src/v3/src/transformer/layout/development/transformEnumerateComponents.ts +72 -5
  179. package/src/v3/src/transformer/layout/idp/__snapshots__/transformIdpRedirect.test.ts.snap +4 -4
  180. package/src/v3/src/transformer/selectAuthenticator/__snapshots__/transformSelectAuthenticatorVerify.test.ts.snap +0 -3
  181. package/src/v3/src/transformer/selectAuthenticator/__snapshots__/transformSelectOVCustomAppMethodVerify.test.ts.snap +0 -1
  182. package/src/v3/src/transformer/selectAuthenticator/__snapshots__/utils.test.ts.snap +163 -42
  183. package/src/v3/src/transformer/selectAuthenticator/transformSelectAuthenticatorEnroll.ts +7 -1
  184. package/src/v3/src/transformer/selectAuthenticator/transformSelectAuthenticatorVerify.ts +0 -1
  185. package/src/v3/src/transformer/selectAuthenticator/transformSelectOVCustomAppMethodVerify.ts +0 -1
  186. package/src/v3/src/transformer/selectAuthenticator/utils.test.ts +117 -39
  187. package/src/v3/src/transformer/selectAuthenticator/utils.ts +102 -58
  188. package/src/v3/src/transformer/terminal/transformEmailMagicLinkOTPOnlyElements.ts +1 -3
  189. package/src/v3/src/transformer/uischema/transform.test.ts +0 -6
  190. package/src/v3/src/transformer/uischema/transform.ts +0 -2
  191. package/src/v3/src/{components/FieldLevelMessageContainer/index.tsx → types/image.ts} +10 -3
  192. package/src/v3/src/types/index.ts +1 -0
  193. package/src/v3/src/types/schema.ts +2 -1
  194. package/src/v3/src/types/widget.ts +3 -3
  195. package/src/v3/src/util/buildFieldLevelErrorMessages.ts +48 -0
  196. package/src/v3/src/util/formUtils.ts +5 -17
  197. package/src/v3/src/util/htmlContentParserUtils.tsx +3 -1
  198. package/src/v3/src/util/index.ts +2 -0
  199. package/src/v3/src/util/isLtrField.ts +22 -0
  200. package/src/v3/src/util/languageUtils.ts +14 -0
  201. package/src/v3/src/util/leonardo.d.ts +571 -0
  202. package/src/v3/src/util/mergeThemes.test.tsx +20 -7
  203. package/src/v3/src/util/mergeThemes.ts +32 -1
  204. package/src/v3/src/util/stylisPlugins.ts +21 -0
  205. package/src/v3/src/util/theme.test.ts +63 -187
  206. package/src/v3/src/util/theme.ts +274 -247
  207. package/src/v3/svgo.config.js +0 -6
  208. package/src/v3/transformer/i18n/transformAuthenticatorButton.ts +18 -2
  209. package/src/v3/transformer/layout/development/transformEnumerateComponents.ts +72 -5
  210. package/src/v3/transformer/selectAuthenticator/transformSelectAuthenticatorEnroll.ts +7 -1
  211. package/src/v3/transformer/selectAuthenticator/transformSelectAuthenticatorVerify.ts +0 -1
  212. package/src/v3/transformer/selectAuthenticator/transformSelectOVCustomAppMethodVerify.ts +0 -1
  213. package/src/v3/transformer/selectAuthenticator/utils.ts +102 -58
  214. package/src/v3/transformer/terminal/transformEmailMagicLinkOTPOnlyElements.ts +1 -3
  215. package/src/v3/transformer/uischema/transform.ts +0 -2
  216. package/src/v3/tsconfig.base.json +3 -0
  217. package/src/v3/{components/FieldLevelMessageContainer/index.tsx → types/image.ts} +10 -3
  218. package/src/v3/types/index.ts +1 -0
  219. package/src/v3/types/schema.ts +2 -1
  220. package/src/v3/types/widget.ts +3 -3
  221. package/src/v3/util/buildFieldLevelErrorMessages.ts +48 -0
  222. package/src/v3/util/formUtils.ts +5 -17
  223. package/src/v3/util/htmlContentParserUtils.tsx +3 -1
  224. package/src/v3/util/index.ts +2 -0
  225. package/src/v3/util/isLtrField.ts +22 -0
  226. package/src/v3/util/languageUtils.ts +14 -0
  227. package/src/v3/util/leonardo.d.ts +571 -0
  228. package/src/v3/util/mergeThemes.ts +32 -1
  229. package/src/v3/util/stylisPlugins.ts +21 -0
  230. package/src/v3/util/theme.ts +274 -247
  231. package/src/v3/components/CustomPluginsOdysseyCacheProvider/CustomPluginsOdysseyCacheProvider.tsx +0 -66
  232. package/src/v3/components/FieldLevelMessageContainer/FieldLevelMessageContainer.tsx +0 -55
  233. package/src/v3/components/Icon/CheckCircle.tsx +0 -30
  234. package/src/v3/components/Icon/RightArrowIcon.tsx +0 -30
  235. package/src/v3/components/Images/MobileDeviceIcon.tsx +0 -38
  236. package/src/v3/components/Widget/style.css +0 -181
  237. package/src/v3/src/components/CustomPluginsOdysseyCacheProvider/CustomPluginsOdysseyCacheProvider.tsx +0 -66
  238. package/src/v3/src/components/FieldLevelMessageContainer/FieldLevelMessageContainer.tsx +0 -55
  239. package/src/v3/src/components/Icon/CheckCircle.tsx +0 -30
  240. package/src/v3/src/components/Icon/RightArrowIcon.tsx +0 -30
  241. package/src/v3/src/components/Images/MobileDeviceIcon.tsx +0 -38
  242. package/src/v3/src/components/Widget/style.css +0 -181
  243. package/src/v3/src/transformer/uischema/setLtrFields.ts +0 -41
  244. package/src/v3/src/util/designTokens.ts +0 -249
  245. package/src/v3/transformer/uischema/setLtrFields.ts +0 -41
  246. package/src/v3/util/designTokens.ts +0 -249
@@ -10,34 +10,39 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
 
13
+ import { useOdysseyDesignTokens } from '@okta/odyssey-react-mui';
13
14
  import { FunctionComponent, h } from 'preact';
14
15
 
15
16
  import { loc } from '../../util';
16
17
 
17
- export const YubikeyDemoImage: FunctionComponent = () => (
18
- <svg
19
- xmlns="http://www.w3.org/2000/svg"
20
- width="43"
21
- height="58"
22
- fill="none"
23
- role="img"
24
- viewBox="0 0 43 58"
25
- aria-hidden="true"
26
- >
27
- <title>{loc('factor.totpHard.yubikey', 'login')}</title>
28
- <path
29
- fill="#00297A"
30
- fillRule="evenodd"
31
- d="M10.61 0a9 9 0 0 0-9 9v.5a8.5 8.5 0 0 0 8.5 8.5v-2a6.5 6.5 0 0 1-6.5-6.5V9a7 7 0 0 1 7-7h13v14h-5.75v2h7.75v-3h8V3h-8V0h-15Zm15 5v8h6V5h-6Z"
32
- class="siwIconFillPrimaryDark"
33
- clipRule="evenodd"
34
- />
35
- <path
36
- fill="#A7B5EC"
37
- fillRule="evenodd"
38
- d="M25.61 6.5h4v2h-4v-2Zm0 3h4v2h-4v-2Zm-15.356 2.486a2.986 2.986 0 0 1 5.973 0V32.86a1 1 0 1 0 2 0v-4.892a2 2 0 0 1 2-2h2.13a2 2 0 0 1 2 2v7.475a1 1 0 1 0 2 0v-1.047c0-1.633 1.352-2.975 3.005-2.975 1.619 0 2.944 1.315 2.944 2.914v5.764a1 1 0 1 0 2 0v-.614a3.042 3.042 0 1 1 6.084 0v4.683h2v-4.683a5.042 5.042 0 0 0-8.084-4.022v-1.128c0-2.724-2.24-4.914-4.944-4.914a5.003 5.003 0 0 0-3.006 1.002v-2.455a4 4 0 0 0-4-4h-2.13c-.728 0-1.411.195-2 .535V11.986a4.986 4.986 0 0 0-9.972 0v19.607c-1.398.5-2.847 1.495-4.072 2.492A29.391 29.391 0 0 0 .935 37.18l-.155.175-.062.226c-.146.542-.128 1.168-.044 1.783.086.633.254 1.345.478 2.1.447 1.509 1.139 3.276 1.93 5.082 1.581 3.616 3.6 7.483 4.977 9.943l.489.872 1.745-.977-.489-.873c-1.356-2.421-3.342-6.227-4.89-9.767-.776-1.772-1.431-3.453-1.845-4.849a12.468 12.468 0 0 1-.414-1.8 3.726 3.726 0 0 1-.038-.795 27.872 27.872 0 0 1 2.828-2.664c.943-.768 1.918-1.44 2.81-1.874v8.552a1 1 0 1 0 2 0V11.986Z"
39
- class="siwIconFillSecondary"
40
- clipRule="evenodd"
41
- />
42
- </svg>
43
- );
18
+ export const YubikeyDemoImage: FunctionComponent = () => {
19
+ const tokens = useOdysseyDesignTokens();
20
+
21
+ return (
22
+ <svg
23
+ xmlns="http://www.w3.org/2000/svg"
24
+ width={tokens.Spacing9}
25
+ height={tokens.Spacing9}
26
+ fill="none"
27
+ role="img"
28
+ viewBox="0 0 43 58"
29
+ aria-hidden="true"
30
+ >
31
+ <title>{loc('factor.totpHard.yubikey', 'login')}</title>
32
+ <path
33
+ fill="#00297A"
34
+ fillRule="evenodd"
35
+ d="M10.61 0a9 9 0 0 0-9 9v.5a8.5 8.5 0 0 0 8.5 8.5v-2a6.5 6.5 0 0 1-6.5-6.5V9a7 7 0 0 1 7-7h13v14h-5.75v2h7.75v-3h8V3h-8V0h-15Zm15 5v8h6V5h-6Z"
36
+ class="siwIconFillPrimaryDark"
37
+ clipRule="evenodd"
38
+ />
39
+ <path
40
+ fill="#A7B5EC"
41
+ fillRule="evenodd"
42
+ d="M25.61 6.5h4v2h-4v-2Zm0 3h4v2h-4v-2Zm-15.356 2.486a2.986 2.986 0 0 1 5.973 0V32.86a1 1 0 1 0 2 0v-4.892a2 2 0 0 1 2-2h2.13a2 2 0 0 1 2 2v7.475a1 1 0 1 0 2 0v-1.047c0-1.633 1.352-2.975 3.005-2.975 1.619 0 2.944 1.315 2.944 2.914v5.764a1 1 0 1 0 2 0v-.614a3.042 3.042 0 1 1 6.084 0v4.683h2v-4.683a5.042 5.042 0 0 0-8.084-4.022v-1.128c0-2.724-2.24-4.914-4.944-4.914a5.003 5.003 0 0 0-3.006 1.002v-2.455a4 4 0 0 0-4-4h-2.13c-.728 0-1.411.195-2 .535V11.986a4.986 4.986 0 0 0-9.972 0v19.607c-1.398.5-2.847 1.495-4.072 2.492A29.391 29.391 0 0 0 .935 37.18l-.155.175-.062.226c-.146.542-.128 1.168-.044 1.783.086.633.254 1.345.478 2.1.447 1.509 1.139 3.276 1.93 5.082 1.581 3.616 3.6 7.483 4.977 9.943l.489.872 1.745-.977-.489-.873c-1.356-2.421-3.342-6.227-4.89-9.767-.776-1.772-1.431-3.453-1.845-4.849a12.468 12.468 0 0 1-.414-1.8 3.726 3.726 0 0 1-.038-.795 27.872 27.872 0 0 1 2.828-2.664c.943-.768 1.918-1.44 2.81-1.874v8.552a1 1 0 1 0 2 0V11.986Z"
43
+ class="siwIconFillSecondary"
44
+ clipRule="evenodd"
45
+ />
46
+ </svg>
47
+ );
48
+ };
@@ -13,6 +13,5 @@
13
13
  export * from './AppIcon';
14
14
  export * from './DeviceIcon';
15
15
  export * from './LocationIcon';
16
- export * from './MobileDeviceIcon';
17
16
  export * from './PhoneIcon';
18
17
  export * from './YubikeyDemoImage';
@@ -10,10 +10,8 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import {
14
- Alert,
15
- Box,
16
- } from '@okta/odyssey-react-mui';
13
+ import { Box } from '@mui/material';
14
+ import { Callout, useOdysseyDesignTokens } from '@okta/odyssey-react-mui';
17
15
  import { h } from 'preact';
18
16
 
19
17
  import { useWidgetContext } from '../../contexts';
@@ -41,23 +39,25 @@ const InfoBox: UISchemaElementComponent<{
41
39
  },
42
40
  } = uischema;
43
41
 
42
+ const tokens = useOdysseyDesignTokens();
43
+
44
44
  return loading ? null : (
45
45
  <Box
46
- marginBlockEnd={4}
46
+ marginBlockEnd={tokens.Spacing4}
47
47
  width={1}
48
- data-se="message"
48
+ data-se={`infobox-${messageClass.toLowerCase()}`}
49
49
  >
50
- <Alert
50
+ <Callout
51
51
  severity={MessageTypeVariant[messageClass as MessageType] ?? MessageTypeVariant.INFO}
52
- variant="infobox"
53
- data-se={dataSe}
54
- className={`infobox-${messageClass.toLowerCase()}`}
52
+ testId={dataSe}
53
+ // visually-hidden severity text is not translated
54
+ translate="no"
55
55
  >
56
56
  {
57
57
  Array.isArray(message)
58
58
  ? message.map((msg) => (
59
59
  <Box
60
- marginBlockEnd={2}
60
+ marginBlockEnd={tokens.Spacing2}
61
61
  key={msg.message}
62
62
  >
63
63
  <WidgetMessageContainer
@@ -75,7 +75,7 @@ const InfoBox: UISchemaElementComponent<{
75
75
  />
76
76
  )
77
77
  }
78
- </Alert>
78
+ </Callout>
79
79
  </Box>
80
80
  );
81
81
  };
@@ -10,7 +10,8 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import { Alert, Box } from '@okta/odyssey-react-mui';
13
+ import { Box } from '@mui/material';
14
+ import { Callout, useOdysseyDesignTokens } from '@okta/odyssey-react-mui';
14
15
  import { IdxMessage } from '@okta/okta-auth-js';
15
16
  import { FunctionComponent, h } from 'preact';
16
17
 
@@ -20,19 +21,24 @@ type Props = {
20
21
  message?: IdxMessage;
21
22
  };
22
23
 
23
- const InfoSection: FunctionComponent<Props> = ({ message }) => (message ? (
24
- <Box
25
- marginBlockEnd={4}
26
- width={1}
27
- >
28
- <Alert
29
- key={message.i18n?.key || message.message}
30
- severity={MessageTypeVariant[message.class as MessageType] ?? MessageTypeVariant.INFO}
31
- variant="infobox"
24
+ const InfoSection: FunctionComponent<Props> = ({ message }) => {
25
+ const tokens = useOdysseyDesignTokens();
26
+
27
+ return (message ? (
28
+ <Box
29
+ marginBlockEnd={tokens.Spacing4}
30
+ width={1}
32
31
  >
33
- {message.message}
34
- </Alert>
35
- </Box>
36
- ) : null);
32
+ <Callout
33
+ key={message.i18n?.key || message.message}
34
+ severity={MessageTypeVariant[message.class as MessageType] ?? MessageTypeVariant.INFO}
35
+ // visually-hidden severity text is not translated
36
+ translate="no"
37
+ >
38
+ {message.message}
39
+ </Callout>
40
+ </Box>
41
+ ) : null);
42
+ };
37
43
 
38
44
  export default InfoSection;
@@ -10,12 +10,22 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import { Box, Typography } from '@okta/odyssey-react-mui';
13
+ import { Box } from '@mui/material';
14
+ import { Typography, TypographyVariantValue } from '@okta/odyssey-react-mui';
14
15
  import { h } from 'preact';
15
16
 
16
17
  import { useHtmlContentParser } from '../../hooks';
17
18
  import { DescriptionElement, UISchemaElementComponent } from '../../types';
18
19
 
20
+ const odyTypographyVariantMapping: Record<
21
+ 'body1' | 'subtitle1' | 'legend',
22
+ TypographyVariantValue
23
+ > = {
24
+ body1: 'body',
25
+ subtitle1: 'subordinate',
26
+ legend: 'legend',
27
+ };
28
+
19
29
  const InformationalText: UISchemaElementComponent<{
20
30
  uischema: DescriptionElement
21
31
  }> = ({
@@ -34,11 +44,11 @@ const InformationalText: UISchemaElementComponent<{
34
44
  justifyContent="flex-start"
35
45
  >
36
46
  <Typography
37
- id={uischema.id}
38
- paragraph
39
- data-se={dataSe || 'o-form-explain'}
40
- className={uischema.noTranslate ? 'no-translate' : undefined}
41
- variant={variant ?? 'body1'}
47
+ component="p"
48
+ variant={variant ? odyTypographyVariantMapping[variant]
49
+ : odyTypographyVariantMapping.body1}
50
+ testId={dataSe || 'o-form-explain'}
51
+ translate={uischema.noTranslate ? 'no' : undefined}
42
52
  >
43
53
  {parsedContent}
44
54
  </Typography>
@@ -10,20 +10,9 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import {
14
- Box,
15
- EyeIcon,
16
- EyeOffIcon,
17
- FormHelperText,
18
- IconButton,
19
- InputAdornment,
20
- InputBase,
21
- InputLabel,
22
- Tooltip,
23
- Typography,
24
- } from '@okta/odyssey-react-mui';
13
+ import { PasswordField } from '@okta/odyssey-react-mui';
25
14
  import { h } from 'preact';
26
- import { useRef, useState } from 'preact/hooks';
15
+ import { buildFieldLevelErrorMessages } from 'src/util/buildFieldLevelErrorMessages';
27
16
 
28
17
  import { useWidgetContext } from '../../contexts';
29
18
  import {
@@ -32,14 +21,16 @@ import {
32
21
  useValue,
33
22
  } from '../../hooks';
34
23
  import {
24
+ AutoCompleteValue,
35
25
  ChangeEvent,
36
26
  UISchemaElementComponent,
37
27
  UISchemaElementComponentWithValidationProps,
38
28
  } from '../../types';
39
29
  import { getTranslation } from '../../util';
40
- import FieldLevelMessageContainer from '../FieldLevelMessageContainer';
41
30
  import { withFormValidationState } from '../hocs';
42
31
 
32
+ type PasswordAutoCompleteValue = Extract<AutoCompleteValue, 'current-password' | 'new-password'> | undefined;
33
+
43
34
  const InputPassword: UISchemaElementComponent<UISchemaElementComponentWithValidationProps> = ({
44
35
  uischema,
45
36
  errors,
@@ -59,168 +50,44 @@ const InputPassword: UISchemaElementComponent<UISchemaElementComponentWithValida
59
50
  focus,
60
51
  parserOptions,
61
52
  noTranslate,
62
- showAsterisk,
63
- dir,
64
53
  } = uischema;
65
54
  const {
66
55
  attributes,
67
56
  inputMeta: { name, required },
68
57
  } = uischema.options;
58
+ const { autocomplete } = attributes || {};
69
59
  const label = getTranslation(translations, 'label');
70
60
  const hint = getTranslation(translations, 'hint');
71
61
  const explain = getTranslation(translations, 'bottomExplain');
72
- const optionalLabel = getTranslation(translations, 'optionalLabel');
73
62
  const focusRef = useAutoFocus<HTMLInputElement>(focus);
74
63
  const parsedExplainContent = useHtmlContentParser(explain, parserOptions);
75
- const hasErrors = typeof errors !== 'undefined';
76
- // TODO: OKTA-569647 - refactor logic
77
- const hintId = hint && `${name}-hint`;
78
- const explainId = explain && `${name}-explain`;
79
- const ariaDescribedByIds = [describedByIds, hintId, explainId].filter(Boolean).join(' ')
80
- || undefined;
81
- const [showPassword, setShowPassword] = useState<boolean>(false);
82
- const showPasswordTimeoutRef = useRef<number | undefined>();
83
-
84
- const handleClickShowPassword = () => {
85
- setShowPassword(!showPassword);
86
-
87
- if (showPasswordTimeoutRef.current) {
88
- window.clearTimeout(showPasswordTimeoutRef.current);
89
- }
90
- // If the new value of showPassword is being set to true, set a 30-second timeout to auto-hide the password
91
- // See: https://github.com/okta/okta-signin-widget#featuresshowpasswordtoggleonsigninpage
92
- if (!showPassword) {
93
- showPasswordTimeoutRef.current = window.setTimeout(() => {
94
- setShowPassword(false);
95
- }, 30000);
96
- }
97
- };
64
+ const { errorMessage, errorMessageList } = buildFieldLevelErrorMessages(errors);
98
65
 
99
66
  return (
100
- <Box>
101
- <InputLabel
102
- htmlFor={name}
103
- // To prevent asterisk from shifting far right
104
- sx={{ justifyContent: showAsterisk ? 'flex-start' : undefined }}
105
- >
106
- {label}
107
- {showAsterisk && (
108
- <Box
109
- component="span"
110
- sx={(theme) => ({
111
- marginInlineStart: theme.spacing(1),
112
- marginInlineEnd: theme.spacing(1),
113
- })}
114
- className="no-translate"
115
- aria-hidden
116
- >
117
- *
118
- </Box>
119
- )}
120
- {required === false && (
121
- <Typography
122
- variant="subtitle1"
123
- sx={{ whiteSpace: 'nowrap' }}
124
- >
125
- {optionalLabel}
126
- </Typography>
127
- )}
128
- </InputLabel>
129
- {hint && (
130
- <FormHelperText
131
- id={hintId}
132
- className="o-form-explain"
133
- data-se={hintId}
134
- // TODO: OKTA-577905 - Temporary fix until we can upgrade to the latest version of Odyssey
135
- sx={{ textAlign: 'start' }}
136
- >
137
- {hint}
138
- </FormHelperText>
139
- )}
140
- <InputBase
141
- id={name}
142
- name={name}
143
- error={hasErrors}
144
- inputRef={focusRef}
145
- onChange={(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
146
- handleChange?.(e.currentTarget.value);
147
- }}
148
- onBlur={(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
149
- handleBlur?.(e?.currentTarget?.value);
150
- }}
151
- type={showPassword ? 'text' : 'password'}
152
- value={value}
153
- disabled={loading}
154
- fullWidth
155
- inputProps={{
156
- 'data-se': name,
157
- 'aria-describedby': ariaDescribedByIds,
158
- ...attributes,
159
- }}
160
- className={noTranslate ? 'no-translate' : undefined}
161
- dir={dir}
162
- endAdornment={(
163
- showPasswordToggleOnSignInPage && (
164
- <InputAdornment
165
- position="end"
166
- // switching on the passed `dir` attribute is needed because plugin does not yet
167
- // handle nested [dir="ltr"] inside [dir="rtl"] well so explicitly set physical
168
- // properties when 'ltr' is passed onto this element, else can use logical
169
- sx={(theme) => (dir === 'ltr' ? {
170
- marginLeft: '8px',
171
- marginRight: theme.spacing(2),
172
- } : {
173
- marginInlineEnd: theme.spacing(2),
174
- marginInlineStart: '8px',
175
- })}
176
- >
177
- <Tooltip
178
- title={showPassword ? getTranslation(translations, 'hide') : getTranslation(translations, 'show')}
179
- PopperProps={{
180
- // keep the added tooltip element inside the SIW container
181
- disablePortal: true,
182
- }}
183
- >
184
- <IconButton
185
- aria-label={getTranslation(translations, 'visibilityToggleLabel')}
186
- aria-pressed={showPassword}
187
- aria-controls={name}
188
- onClick={handleClickShowPassword}
189
- sx={{
190
- // instead of using IconButton `edge="end"` we use this sx prop
191
- // because `edge="end"` does not use logical properties
192
- ...(dir === 'ltr' ? { marginRight: '-12px' } : { marginInlineEnd: '-12px' }),
193
- '&.Mui-focusVisible': {
194
- outlineStyle: 'solid',
195
- outlineWidth: '1px',
196
- },
197
- }}
198
- >
199
- {showPassword ? <EyeOffIcon /> : <EyeIcon />}
200
- </IconButton>
201
- </Tooltip>
202
- </InputAdornment>
203
- )
204
- )}
205
- />
206
- {hasErrors && (
207
- <FieldLevelMessageContainer
208
- messages={errors}
209
- fieldName={name}
210
- />
211
- )}
212
- {explain && (
213
- <FormHelperText
214
- id={explainId}
215
- className="o-form-explain"
216
- data-se={explainId}
217
- // TODO: OKTA-577905 - Temporary fix until we can upgrade to the latest version of Odyssey
218
- sx={{ textAlign: 'start' }}
219
- >
220
- {parsedExplainContent}
221
- </FormHelperText>
222
- )}
223
- </Box>
67
+ <PasswordField
68
+ ariaDescribedBy={describedByIds}
69
+ autoCompleteType={autocomplete as PasswordAutoCompleteValue}
70
+ errorMessage={errorMessage}
71
+ errorMessageList={errorMessageList}
72
+ hasShowPassword={showPasswordToggleOnSignInPage}
73
+ hint={hint ?? parsedExplainContent as string}
74
+ id={name}
75
+ inputRef={focusRef}
76
+ isDisabled={loading}
77
+ isFullWidth
78
+ isOptional={required === false}
79
+ name={name}
80
+ label={label ?? ''}
81
+ onChange={(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
82
+ handleChange?.(e.currentTarget.value);
83
+ }}
84
+ onBlur={(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
85
+ handleBlur?.(e?.currentTarget?.value);
86
+ }}
87
+ testId={name}
88
+ translate={noTranslate ? 'no' : undefined}
89
+ value={value as string ?? ''}
90
+ />
224
91
  );
225
92
  };
226
93
 
@@ -10,14 +10,9 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import {
14
- Box,
15
- FormHelperText,
16
- InputBase,
17
- InputLabel,
18
- Typography,
19
- } from '@okta/odyssey-react-mui';
13
+ import { TextField } from '@okta/odyssey-react-mui';
20
14
  import { h } from 'preact';
15
+ import { buildFieldLevelErrorMessages } from 'src/util/buildFieldLevelErrorMessages';
21
16
 
22
17
  import { useWidgetContext } from '../../contexts';
23
18
  import {
@@ -30,16 +25,13 @@ import {
30
25
  UISchemaElementComponent, UISchemaElementComponentWithValidationProps,
31
26
  } from '../../types';
32
27
  import { getTranslation } from '../../util';
33
- import FieldLevelMessageContainer from '../FieldLevelMessageContainer';
34
28
  import { withFormValidationState } from '../hocs';
35
29
 
36
30
  const InputText: UISchemaElementComponent<UISchemaElementComponentWithValidationProps> = ({
37
- type,
38
31
  uischema,
39
32
  errors,
40
33
  handleChange,
41
34
  handleBlur,
42
- describedByIds,
43
35
  }) => {
44
36
  const value = useValue(uischema);
45
37
  const { loading } = useWidgetContext();
@@ -47,112 +39,44 @@ const InputText: UISchemaElementComponent<UISchemaElementComponentWithValidation
47
39
  translations = [],
48
40
  focus,
49
41
  parserOptions,
50
- showAsterisk,
51
- dir,
52
42
  } = uischema;
53
43
  const label = getTranslation(translations, 'label');
54
44
  const hint = getTranslation(translations, 'hint');
55
45
  const explain = getTranslation(translations, 'bottomExplain');
56
- const optionalLabel = getTranslation(translations, 'optionalLabel');
57
46
  const {
58
47
  attributes,
59
48
  inputMeta: { name, required },
60
49
  dataSe,
61
50
  } = uischema.options;
51
+ const { autocomplete, inputmode } = attributes || {};
62
52
  const focusRef = useAutoFocus<HTMLInputElement>(focus);
63
53
  const parsedExplainContent = useHtmlContentParser(explain, parserOptions);
64
- const hasErrors = typeof errors !== 'undefined';
65
- // TODO: OKTA-569647 - refactor logic
66
- const hintId = hint && `${name}-hint`;
67
- const explainId = explain && `${name}-explain`;
68
- const ariaDescribedByIds = [describedByIds, hintId, explainId].filter(Boolean).join(' ')
69
- || undefined;
54
+ const { errorMessage, errorMessageList } = buildFieldLevelErrorMessages(errors);
70
55
 
71
56
  return (
72
- <Box>
73
- <InputLabel
74
- htmlFor={name}
75
- // To prevent asterisk from shifting far right
76
- sx={{ justifyContent: showAsterisk ? 'flex-start' : undefined }}
77
- >
78
- {label}
79
- {showAsterisk && (
80
- <Box
81
- component="span"
82
- sx={(theme) => ({
83
- marginInlineStart: theme.spacing(1),
84
- marginInlineEnd: theme.spacing(1),
85
- })}
86
- className="no-translate"
87
- aria-hidden
88
- >
89
- *
90
- </Box>
91
- )}
92
- {required === false && (
93
- <Typography
94
- variant="subtitle1"
95
- sx={{ whiteSpace: 'nowrap' }}
96
- >
97
- {optionalLabel}
98
- </Typography>
99
- )}
100
- </InputLabel>
101
- {
102
- hint && (
103
- <FormHelperText
104
- id={hintId}
105
- className="o-form-explain"
106
- data-se={hintId}
107
- // TODO: OKTA-577905 - Temporary fix until we can upgrade to the latest version of Odyssey
108
- sx={{ textAlign: 'start' }}
109
- >
110
- {hint}
111
- </FormHelperText>
112
- )
113
- }
114
- <InputBase
115
- value={value}
116
- type={type || 'text'}
117
- id={name}
118
- name={name}
119
- error={hasErrors}
120
- onChange={(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
121
- handleChange?.(e.currentTarget.value);
122
- }}
123
- onBlur={(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
124
- handleBlur?.(e?.currentTarget?.value);
125
- }}
126
- disabled={loading}
127
- fullWidth
128
- inputProps={{
129
- 'data-se': dataSe,
130
- 'aria-describedby': ariaDescribedByIds,
131
- ...attributes,
132
- }}
133
- inputRef={focusRef}
134
- dir={dir}
135
- />
136
- {hasErrors && (
137
- <FieldLevelMessageContainer
138
- messages={errors}
139
- fieldName={name}
140
- />
141
- )}
142
- {
143
- explain && (
144
- <FormHelperText
145
- id={explainId}
146
- className="o-form-explain"
147
- data-se={explainId}
148
- // TODO: OKTA-577905 - Temporary fix until we can upgrade to the latest version of Odyssey
149
- sx={{ textAlign: 'start' }}
150
- >
151
- {parsedExplainContent}
152
- </FormHelperText>
153
- )
154
- }
155
- </Box>
57
+ <TextField
58
+ autoCompleteType={autocomplete}
59
+ errorMessage={errorMessage}
60
+ errorMessageList={errorMessageList}
61
+ hint={hint ?? parsedExplainContent as string}
62
+ id={name}
63
+ inputRef={focusRef}
64
+ inputMode={inputmode}
65
+ isDisabled={loading}
66
+ isFullWidth
67
+ isOptional={required === false}
68
+ name={name}
69
+ label={label ?? ''}
70
+ onChange={(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
71
+ handleChange?.(e.currentTarget.value);
72
+ }}
73
+ onBlur={(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
74
+ handleBlur?.(e?.currentTarget?.value);
75
+ }}
76
+ testId={dataSe}
77
+ type="text"
78
+ value={value as string ?? ''}
79
+ />
156
80
  );
157
81
  };
158
82