@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.
- package/README.md +5 -5
- package/dist/css/fonts.css +172 -0
- package/dist/css/okta-sign-in.next.css +1 -240
- package/dist/css/okta-sign-in.next.css.map +1 -1
- package/dist/esm/src/config/config.json.js +1 -1
- package/dist/js/okta-sign-in.classic.js +1 -1
- package/dist/js/okta-sign-in.classic.min.js +1 -1
- package/dist/js/okta-sign-in.js +1 -1
- package/dist/js/okta-sign-in.min.js +1 -1
- package/dist/js/okta-sign-in.next.js +61 -19
- package/dist/js/okta-sign-in.next.js.map +1 -1
- package/dist/js/okta-sign-in.next.no-polyfill.js +60 -18
- package/dist/js/okta-sign-in.next.no-polyfill.js.map +1 -1
- package/dist/js/okta-sign-in.no-polyfill.min.js +1 -1
- package/dist/js/okta-sign-in.oie.js +1 -1
- package/dist/js/okta-sign-in.oie.min.js +1 -1
- package/package.json +10 -5
- package/src/config/config.json +1 -1
- package/src/v3/components/AuthCoin/AuthCoin.tsx +15 -17
- package/src/v3/components/AuthContainer/AuthContainer.tsx +11 -17
- package/src/v3/components/AuthContent/AuthContent.tsx +21 -16
- package/src/v3/components/AuthHeader/AuthHeader.tsx +18 -19
- package/src/v3/components/AuthenticatorButton/AuthenticatorButton.tsx +116 -77
- package/src/v3/components/AuthenticatorButton/AuthenticatorButtonList.tsx +9 -3
- package/src/v3/components/Button/Button.tsx +16 -20
- package/src/v3/components/CaptchaContainer/CaptchaContainer.tsx +1 -1
- package/src/v3/components/Checkbox/Checkbox.tsx +33 -82
- package/src/v3/components/ConsentHeader/ConsentHeader.tsx +23 -23
- package/src/v3/components/Divider/Divider.tsx +2 -2
- package/src/v3/components/Form/Accordion.tsx +15 -36
- package/src/v3/components/Form/ElementContainer.tsx +6 -3
- package/src/v3/components/Form/Form.tsx +2 -4
- package/src/v3/components/Form/Layout.tsx +1 -1
- package/src/v3/components/Form/LayoutContainer.tsx +4 -2
- package/src/v3/components/Heading/Heading.tsx +7 -5
- package/src/v3/components/Icon/CustomAppIcon.tsx +13 -15
- package/src/v3/components/Icon/CustomOTPIcon.tsx +5 -10
- package/src/v3/components/Icon/DuoIcon.tsx +5 -10
- package/src/v3/components/Icon/EmailIcon.tsx +5 -10
- package/src/v3/components/Icon/GoogleOTPIcon.tsx +5 -10
- package/src/v3/components/Icon/IDPIcon.tsx +5 -10
- package/src/v3/components/Icon/OktaVerifyIcon.tsx +0 -7
- package/src/v3/components/Icon/OnPremMFAIcon.tsx +5 -10
- package/src/v3/components/Icon/PasswordIcon.tsx +5 -10
- package/src/v3/components/Icon/PhoneIcon.tsx +5 -10
- package/src/v3/components/Icon/RSAIcon.tsx +6 -11
- package/src/v3/components/Icon/SecurityKeyOrBiometricsIcon.tsx +5 -10
- package/src/v3/components/Icon/SecurityQuestionIcon.tsx +5 -10
- package/src/v3/components/Icon/SmartCardIcon.tsx +5 -10
- package/src/v3/components/Icon/SymantecIcon.tsx +5 -10
- package/src/v3/components/Icon/YubiKeyIcon.tsx +5 -10
- package/src/v3/components/Icon/index.tsx +0 -2
- package/src/v3/components/IdentifierContainer/IdentifierContainer.tsx +31 -47
- package/src/v3/components/Image/Image.tsx +42 -0
- package/src/v3/{src/components/CustomPluginsOdysseyCacheProvider → components/Image}/index.tsx +2 -2
- package/src/v3/components/ImageWithText/ImageWithText.tsx +7 -4
- package/src/v3/components/Images/AppIcon.tsx +16 -46
- package/src/v3/components/Images/DeviceIcon.tsx +16 -32
- package/src/v3/components/Images/LocationIcon.tsx +16 -26
- package/src/v3/components/Images/PhoneIcon.tsx +34 -29
- package/src/v3/components/Images/YubikeyDemoImage.tsx +32 -27
- package/src/v3/components/Images/index.tsx +0 -1
- package/src/v3/components/InfoBox/InfoBox.tsx +12 -12
- package/src/v3/components/InfoSection/InfoSection.tsx +20 -14
- package/src/v3/components/InformationalText/InformationalText.tsx +16 -6
- package/src/v3/components/InputPassword/InputPassword.tsx +31 -164
- package/src/v3/components/InputText/InputText.tsx +27 -103
- package/src/v3/components/LaunchAuthenticatorButton/LaunchAuthenticatorButton.tsx +14 -26
- package/src/v3/components/Link/Link.tsx +8 -20
- package/src/v3/components/List/List.tsx +16 -12
- package/src/v3/components/PIVButton/PIVButton.tsx +10 -8
- package/src/v3/components/PasswordRequirements/Icon.tsx +17 -23
- package/src/v3/components/PasswordRequirements/PasswordMatches.tsx +9 -2
- package/src/v3/components/PasswordRequirements/PasswordRequirementListItem.tsx +6 -5
- package/src/v3/components/PasswordRequirements/PasswordRequirements.tsx +5 -3
- package/src/v3/components/PhoneAuthenticator/PhoneAuthenticator.tsx +53 -137
- package/src/v3/components/QRCode/QRCode.tsx +27 -20
- package/src/v3/components/Radio/Radio.tsx +31 -93
- package/src/v3/components/ReminderPrompt/ReminderPrompt.tsx +9 -12
- package/src/v3/components/Select/Select.tsx +45 -92
- package/src/v3/components/Spinner/Spinner.tsx +6 -8
- package/src/v3/components/StepperButton/StepperButton.tsx +6 -10
- package/src/v3/components/StepperLink/StepperLink.tsx +1 -1
- package/src/v3/components/StepperRadio/StepperRadio.tsx +22 -43
- package/src/v3/components/TextWithActionLink/TextWithActionLink.tsx +1 -1
- package/src/v3/components/Title/Title.tsx +5 -9
- package/src/v3/components/WebAuthNSubmitButton/WebAuthNSubmitButton.tsx +10 -9
- package/src/v3/components/Widget/GlobalStyles.tsx +16 -21
- package/src/v3/components/Widget/index.tsx +51 -36
- package/src/v3/components/Widget/style.scss +295 -0
- package/src/v3/components/WidgetMessageContainer/WidgetMessageContainer.tsx +11 -8
- package/src/v3/components/hocs/withFormValidationState.tsx +2 -5
- package/src/v3/jest.config.js +1 -0
- package/src/v3/jest.setup.js +1 -0
- package/src/v3/package.json +11 -7
- package/src/v3/screenshots/base/UI_demo/UI_demo_RTL_VRT.png +0 -0
- package/src/v3/screenshots/base/UI_demo/UI_demo_VRT.png +0 -0
- package/src/v3/src/components/AuthCoin/AuthCoin.tsx +15 -17
- package/src/v3/src/components/AuthCoin/__snapshots__/AuthCoin.test.tsx.snap +20 -47
- package/src/v3/src/components/AuthContainer/AuthContainer.tsx +11 -17
- package/src/v3/src/components/AuthContent/AuthContent.tsx +21 -16
- package/src/v3/src/components/AuthHeader/AuthHeader.tsx +18 -19
- package/src/v3/src/components/AuthenticatorButton/AuthenticatorButton.tsx +116 -77
- package/src/v3/src/components/AuthenticatorButton/AuthenticatorButtonList.tsx +9 -3
- package/src/v3/src/components/Button/Button.tsx +16 -20
- package/src/v3/src/components/CaptchaContainer/CaptchaContainer.tsx +1 -1
- package/src/v3/src/components/Checkbox/Checkbox.tsx +33 -82
- package/src/v3/src/components/ConsentHeader/ConsentHeader.tsx +23 -23
- package/src/v3/src/components/Divider/Divider.tsx +2 -2
- package/src/v3/src/components/Form/Accordion.tsx +15 -36
- package/src/v3/src/components/Form/ElementContainer.tsx +6 -3
- package/src/v3/src/components/Form/Form.tsx +2 -4
- package/src/v3/src/components/Form/Layout.tsx +1 -1
- package/src/v3/src/components/Form/LayoutContainer.tsx +4 -2
- package/src/v3/src/components/Heading/Heading.tsx +7 -5
- package/src/v3/src/components/Icon/CustomAppIcon.tsx +13 -15
- package/src/v3/src/components/Icon/CustomOTPIcon.tsx +5 -10
- package/src/v3/src/components/Icon/DuoIcon.tsx +5 -10
- package/src/v3/src/components/Icon/EmailIcon.tsx +5 -10
- package/src/v3/src/components/Icon/GoogleOTPIcon.tsx +5 -10
- package/src/v3/src/components/Icon/IDPIcon.tsx +5 -10
- package/src/v3/src/components/Icon/OktaVerifyIcon.tsx +0 -7
- package/src/v3/src/components/Icon/OnPremMFAIcon.tsx +5 -10
- package/src/v3/src/components/Icon/PasswordIcon.tsx +5 -10
- package/src/v3/src/components/Icon/PhoneIcon.tsx +5 -10
- package/src/v3/src/components/Icon/RSAIcon.tsx +6 -11
- package/src/v3/src/components/Icon/SecurityKeyOrBiometricsIcon.tsx +5 -10
- package/src/v3/src/components/Icon/SecurityQuestionIcon.tsx +5 -10
- package/src/v3/src/components/Icon/SmartCardIcon.tsx +5 -10
- package/src/v3/src/components/Icon/SymantecIcon.tsx +5 -10
- package/src/v3/src/components/Icon/YubiKeyIcon.tsx +5 -10
- package/src/v3/src/components/Icon/index.tsx +0 -2
- package/src/v3/src/components/IdentifierContainer/IdentifierContainer.tsx +31 -47
- package/src/v3/src/components/Image/Image.tsx +42 -0
- package/src/v3/{components/CustomPluginsOdysseyCacheProvider → src/components/Image}/index.tsx +2 -2
- package/src/v3/src/components/ImageWithText/ImageWithText.tsx +7 -4
- package/src/v3/src/components/Images/AppIcon.tsx +16 -46
- package/src/v3/src/components/Images/DeviceIcon.tsx +16 -32
- package/src/v3/src/components/Images/LocationIcon.tsx +16 -26
- package/src/v3/src/components/Images/PhoneIcon.tsx +34 -29
- package/src/v3/src/components/Images/YubikeyDemoImage.tsx +32 -27
- package/src/v3/src/components/Images/index.tsx +0 -1
- package/src/v3/src/components/InfoBox/InfoBox.tsx +12 -12
- package/src/v3/src/components/InfoSection/InfoSection.tsx +20 -14
- package/src/v3/src/components/InformationalText/InformationalText.tsx +16 -6
- package/src/v3/src/components/InputPassword/InputPassword.tsx +31 -164
- package/src/v3/src/components/InputText/InputText.tsx +27 -103
- package/src/v3/src/components/LaunchAuthenticatorButton/LaunchAuthenticatorButton.tsx +14 -26
- package/src/v3/src/components/Link/Link.tsx +8 -20
- package/src/v3/src/components/List/List.tsx +16 -12
- package/src/v3/src/components/PIVButton/PIVButton.tsx +10 -8
- package/src/v3/src/components/PasswordRequirements/Icon.tsx +17 -23
- package/src/v3/src/components/PasswordRequirements/PasswordMatches.tsx +9 -2
- package/src/v3/src/components/PasswordRequirements/PasswordRequirementListItem.tsx +6 -5
- package/src/v3/src/components/PasswordRequirements/PasswordRequirements.tsx +5 -3
- package/src/v3/src/components/PhoneAuthenticator/PhoneAuthenticator.tsx +53 -137
- package/src/v3/src/components/QRCode/QRCode.tsx +27 -20
- package/src/v3/src/components/Radio/Radio.tsx +31 -93
- package/src/v3/src/components/ReminderPrompt/ReminderPrompt.tsx +9 -12
- package/src/v3/src/components/ReminderPrompt/__snapshots__/ReminderPrompt.test.tsx.snap +37 -17
- package/src/v3/src/components/Select/Select.tsx +45 -92
- package/src/v3/src/components/Spinner/Spinner.tsx +6 -8
- package/src/v3/src/components/StepperButton/StepperButton.tsx +6 -10
- package/src/v3/src/components/StepperLink/StepperLink.tsx +1 -1
- package/src/v3/src/components/StepperRadio/StepperRadio.tsx +22 -43
- package/src/v3/src/components/TextWithActionLink/TextWithActionLink.tsx +1 -1
- package/src/v3/src/components/Title/Title.tsx +5 -9
- package/src/v3/src/components/WebAuthNSubmitButton/WebAuthNSubmitButton.tsx +10 -9
- package/src/v3/src/components/Widget/GlobalStyles.tsx +16 -21
- package/src/v3/src/components/Widget/index.tsx +51 -36
- package/src/v3/src/components/Widget/style.scss +295 -0
- package/src/v3/src/components/WidgetMessageContainer/WidgetMessageContainer.tsx +11 -8
- package/src/v3/src/components/hocs/withFormValidationState.tsx +2 -5
- package/src/v3/src/transformer/button/__snapshots__/transformIDPButtons.test.ts.snap +0 -2
- package/src/v3/src/transformer/i18n/__snapshots__/transformAuthenticatorButton.test.ts.snap +4 -4
- package/src/v3/src/transformer/i18n/transformAuthenticatorButton.test.ts +3 -3
- package/src/v3/src/transformer/i18n/transformAuthenticatorButton.ts +18 -2
- package/src/v3/src/transformer/layout/development/transformEnumerateComponents.ts +72 -5
- package/src/v3/src/transformer/layout/idp/__snapshots__/transformIdpRedirect.test.ts.snap +4 -4
- package/src/v3/src/transformer/selectAuthenticator/__snapshots__/transformSelectAuthenticatorVerify.test.ts.snap +0 -3
- package/src/v3/src/transformer/selectAuthenticator/__snapshots__/transformSelectOVCustomAppMethodVerify.test.ts.snap +0 -1
- package/src/v3/src/transformer/selectAuthenticator/__snapshots__/utils.test.ts.snap +163 -42
- package/src/v3/src/transformer/selectAuthenticator/transformSelectAuthenticatorEnroll.ts +7 -1
- package/src/v3/src/transformer/selectAuthenticator/transformSelectAuthenticatorVerify.ts +0 -1
- package/src/v3/src/transformer/selectAuthenticator/transformSelectOVCustomAppMethodVerify.ts +0 -1
- package/src/v3/src/transformer/selectAuthenticator/utils.test.ts +117 -39
- package/src/v3/src/transformer/selectAuthenticator/utils.ts +102 -58
- package/src/v3/src/transformer/terminal/transformEmailMagicLinkOTPOnlyElements.ts +1 -3
- package/src/v3/src/transformer/uischema/transform.test.ts +0 -6
- package/src/v3/src/transformer/uischema/transform.ts +0 -2
- package/src/v3/src/{components/FieldLevelMessageContainer/index.tsx → types/image.ts} +10 -3
- package/src/v3/src/types/index.ts +1 -0
- package/src/v3/src/types/schema.ts +2 -1
- package/src/v3/src/types/widget.ts +3 -3
- package/src/v3/src/util/buildFieldLevelErrorMessages.ts +48 -0
- package/src/v3/src/util/formUtils.ts +5 -17
- package/src/v3/src/util/htmlContentParserUtils.tsx +3 -1
- package/src/v3/src/util/index.ts +2 -0
- package/src/v3/src/util/isLtrField.ts +22 -0
- package/src/v3/src/util/languageUtils.ts +14 -0
- package/src/v3/src/util/leonardo.d.ts +571 -0
- package/src/v3/src/util/mergeThemes.test.tsx +20 -7
- package/src/v3/src/util/mergeThemes.ts +32 -1
- package/src/v3/src/util/stylisPlugins.ts +21 -0
- package/src/v3/src/util/theme.test.ts +63 -187
- package/src/v3/src/util/theme.ts +274 -247
- package/src/v3/svgo.config.js +0 -6
- package/src/v3/transformer/i18n/transformAuthenticatorButton.ts +18 -2
- package/src/v3/transformer/layout/development/transformEnumerateComponents.ts +72 -5
- package/src/v3/transformer/selectAuthenticator/transformSelectAuthenticatorEnroll.ts +7 -1
- package/src/v3/transformer/selectAuthenticator/transformSelectAuthenticatorVerify.ts +0 -1
- package/src/v3/transformer/selectAuthenticator/transformSelectOVCustomAppMethodVerify.ts +0 -1
- package/src/v3/transformer/selectAuthenticator/utils.ts +102 -58
- package/src/v3/transformer/terminal/transformEmailMagicLinkOTPOnlyElements.ts +1 -3
- package/src/v3/transformer/uischema/transform.ts +0 -2
- package/src/v3/tsconfig.base.json +3 -0
- package/src/v3/{components/FieldLevelMessageContainer/index.tsx → types/image.ts} +10 -3
- package/src/v3/types/index.ts +1 -0
- package/src/v3/types/schema.ts +2 -1
- package/src/v3/types/widget.ts +3 -3
- package/src/v3/util/buildFieldLevelErrorMessages.ts +48 -0
- package/src/v3/util/formUtils.ts +5 -17
- package/src/v3/util/htmlContentParserUtils.tsx +3 -1
- package/src/v3/util/index.ts +2 -0
- package/src/v3/util/isLtrField.ts +22 -0
- package/src/v3/util/languageUtils.ts +14 -0
- package/src/v3/util/leonardo.d.ts +571 -0
- package/src/v3/util/mergeThemes.ts +32 -1
- package/src/v3/util/stylisPlugins.ts +21 -0
- package/src/v3/util/theme.ts +274 -247
- package/src/v3/components/CustomPluginsOdysseyCacheProvider/CustomPluginsOdysseyCacheProvider.tsx +0 -66
- package/src/v3/components/FieldLevelMessageContainer/FieldLevelMessageContainer.tsx +0 -55
- package/src/v3/components/Icon/CheckCircle.tsx +0 -30
- package/src/v3/components/Icon/RightArrowIcon.tsx +0 -30
- package/src/v3/components/Images/MobileDeviceIcon.tsx +0 -38
- package/src/v3/components/Widget/style.css +0 -181
- package/src/v3/src/components/CustomPluginsOdysseyCacheProvider/CustomPluginsOdysseyCacheProvider.tsx +0 -66
- package/src/v3/src/components/FieldLevelMessageContainer/FieldLevelMessageContainer.tsx +0 -55
- package/src/v3/src/components/Icon/CheckCircle.tsx +0 -30
- package/src/v3/src/components/Icon/RightArrowIcon.tsx +0 -30
- package/src/v3/src/components/Images/MobileDeviceIcon.tsx +0 -38
- package/src/v3/src/components/Widget/style.css +0 -181
- package/src/v3/src/transformer/uischema/setLtrFields.ts +0 -41
- package/src/v3/src/util/designTokens.ts +0 -249
- package/src/v3/transformer/uischema/setLtrFields.ts +0 -41
- package/src/v3/util/designTokens.ts +0 -249
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { Box
|
|
14
|
-
import
|
|
13
|
+
import { Box } from '@mui/material';
|
|
14
|
+
import { useOdysseyDesignTokens } from '@okta/odyssey-react-mui';
|
|
15
|
+
import { CheckCircleFilledIcon, CloseIcon, InformationCircleIcon } from '@okta/odyssey-react-mui/icons';
|
|
15
16
|
import { FunctionComponent, h } from 'preact';
|
|
16
17
|
|
|
17
18
|
import { PasswordRequirementStatus } from '../../types';
|
|
18
|
-
import { CheckCircle } from '../Icon';
|
|
19
19
|
|
|
20
20
|
type PasswordRequirementIconProps = {
|
|
21
21
|
status: PasswordRequirementStatus;
|
|
@@ -25,35 +25,29 @@ const Icon: FunctionComponent<PasswordRequirementIconProps> = (
|
|
|
25
25
|
props,
|
|
26
26
|
) => {
|
|
27
27
|
const { status } = props;
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const tokens = useOdysseyDesignTokens();
|
|
29
|
+
const statusToIcon = {
|
|
30
|
+
incomplete: { component: CloseIcon, color: tokens.PaletteNeutralMain },
|
|
31
|
+
complete: { component: CheckCircleFilledIcon, color: tokens.PaletteSuccessMain },
|
|
32
|
+
info: { component: InformationCircleIcon, color: tokens.PalettePrimaryMain },
|
|
32
33
|
};
|
|
33
|
-
const
|
|
34
|
+
const OdyIcon = statusToIcon[status].component;
|
|
34
35
|
|
|
35
36
|
return (
|
|
36
37
|
<Box
|
|
37
|
-
className={iconClasses}
|
|
38
38
|
data-se={`passwordRequirementIcon-${status}`}
|
|
39
|
-
sx={
|
|
40
|
-
marginInlineEnd:
|
|
39
|
+
sx={{
|
|
40
|
+
marginInlineEnd: tokens.Spacing2,
|
|
41
41
|
// This is to force the icon align with the top of the text
|
|
42
42
|
marginBlockStart: '2px',
|
|
43
|
-
}
|
|
43
|
+
}}
|
|
44
44
|
aria-hidden
|
|
45
45
|
>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<OdyIcon
|
|
52
|
-
name={statusToIconProps[status].name}
|
|
53
|
-
color={statusToIconProps[status].color}
|
|
54
|
-
/>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
46
|
+
<OdyIcon
|
|
47
|
+
sx={{
|
|
48
|
+
color: statusToIcon[status].color,
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
57
51
|
</Box>
|
|
58
52
|
);
|
|
59
53
|
};
|
|
@@ -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 { Box } from '@
|
|
13
|
+
import { Box } from '@mui/material';
|
|
14
|
+
import { useOdysseyDesignTokens } from '@okta/odyssey-react-mui';
|
|
14
15
|
import debounce from 'lodash/debounce';
|
|
15
16
|
import { h } from 'preact';
|
|
16
17
|
import {
|
|
@@ -38,6 +39,7 @@ const PasswordMatches: UISchemaElementComponent<{
|
|
|
38
39
|
const { confirmPassword } = data;
|
|
39
40
|
const { translations = [] } = uischema;
|
|
40
41
|
const label = getTranslation(translations, 'label');
|
|
42
|
+
const tokens = useOdysseyDesignTokens();
|
|
41
43
|
|
|
42
44
|
const [isMatching, setIsMatching] = useState<boolean>(false);
|
|
43
45
|
|
|
@@ -60,7 +62,12 @@ const PasswordMatches: UISchemaElementComponent<{
|
|
|
60
62
|
<Box
|
|
61
63
|
component="ul"
|
|
62
64
|
id="credentials.newPassword-list"
|
|
63
|
-
sx={{
|
|
65
|
+
sx={{
|
|
66
|
+
listStyle: 'none',
|
|
67
|
+
padding: '0',
|
|
68
|
+
marginBlockStart: '0',
|
|
69
|
+
marginBlockEnd: `-${tokens.Spacing3}`,
|
|
70
|
+
}}
|
|
64
71
|
aria-hidden
|
|
65
72
|
>
|
|
66
73
|
<PasswordRequirementListItem
|
|
@@ -10,8 +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
|
-
import {
|
|
13
|
+
import { Box } from '@mui/material';
|
|
14
|
+
import { Typography, useOdysseyDesignTokens } from '@okta/odyssey-react-mui';
|
|
15
15
|
import { FunctionComponent, h } from 'preact';
|
|
16
16
|
|
|
17
17
|
import { PasswordRequirementProps } from '../../types';
|
|
@@ -21,12 +21,13 @@ const PasswordRequirementListItem: FunctionComponent<PasswordRequirementProps> =
|
|
|
21
21
|
props,
|
|
22
22
|
) => {
|
|
23
23
|
const { status, label } = props;
|
|
24
|
+
const tokens = useOdysseyDesignTokens();
|
|
24
25
|
|
|
25
26
|
return (
|
|
26
27
|
<Box
|
|
27
28
|
component="li"
|
|
28
|
-
sx={{ marginBlockEnd:
|
|
29
|
-
color={status === 'complete' ?
|
|
29
|
+
sx={{ marginBlockEnd: tokens.Spacing3 }}
|
|
30
|
+
color={status === 'complete' ? tokens.PaletteSuccessMain : undefined}
|
|
30
31
|
>
|
|
31
32
|
<Box
|
|
32
33
|
display="flex"
|
|
@@ -38,7 +39,7 @@ const PasswordRequirementListItem: FunctionComponent<PasswordRequirementProps> =
|
|
|
38
39
|
* of the icon. See: OKTA-586924
|
|
39
40
|
* */}
|
|
40
41
|
<Icon status={status} />
|
|
41
|
-
<Box><Typography variant="
|
|
42
|
+
<Box><Typography variant="body">{label}</Typography></Box>
|
|
42
43
|
</Box>
|
|
43
44
|
</Box>
|
|
44
45
|
);
|
|
@@ -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 { Box } from '@
|
|
13
|
+
import { Box } from '@mui/material';
|
|
14
|
+
import { useOdysseyDesignTokens } from '@okta/odyssey-react-mui';
|
|
14
15
|
import debounce from 'lodash/debounce';
|
|
15
16
|
import { h } from 'preact';
|
|
16
17
|
import {
|
|
@@ -48,6 +49,7 @@ const PasswordRequirements: UISchemaElementComponent<{
|
|
|
48
49
|
: data['credentials.passcode'];
|
|
49
50
|
|
|
50
51
|
const [passwordValidations, setPasswordValidations] = useState<PasswordValidation>({});
|
|
52
|
+
const tokens = useOdysseyDesignTokens();
|
|
51
53
|
|
|
52
54
|
const getPasswordStatus = (
|
|
53
55
|
ruleKey: string,
|
|
@@ -96,14 +98,14 @@ const PasswordRequirements: UISchemaElementComponent<{
|
|
|
96
98
|
>
|
|
97
99
|
<Box
|
|
98
100
|
component="figcaption"
|
|
99
|
-
|
|
101
|
+
data-se="password-authenticator--heading"
|
|
100
102
|
>
|
|
101
103
|
{header}
|
|
102
104
|
</Box>
|
|
103
105
|
<Box
|
|
104
106
|
component="ul"
|
|
105
107
|
id={listId}
|
|
106
|
-
sx={{ listStyle: 'none', padding: '0', marginBlockStart:
|
|
108
|
+
sx={{ listStyle: 'none', padding: '0', marginBlockStart: tokens.Spacing3 }}
|
|
107
109
|
>
|
|
108
110
|
{requirements.map(({ ruleKey, label }) => (
|
|
109
111
|
<PasswordRequirementListItem
|
|
@@ -10,15 +10,8 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { SelectChangeEvent } from '@mui/material';
|
|
14
|
-
import {
|
|
15
|
-
Box,
|
|
16
|
-
InputAdornment,
|
|
17
|
-
InputBase,
|
|
18
|
-
InputLabel,
|
|
19
|
-
Select,
|
|
20
|
-
Typography,
|
|
21
|
-
} from '@okta/odyssey-react-mui';
|
|
13
|
+
import { Box, SelectChangeEvent } from '@mui/material';
|
|
14
|
+
import { NativeSelect, TextField, useOdysseyDesignTokens } from '@okta/odyssey-react-mui';
|
|
22
15
|
import { IdxMessage } from '@okta/okta-auth-js';
|
|
23
16
|
import { h } from 'preact';
|
|
24
17
|
import {
|
|
@@ -36,8 +29,7 @@ import {
|
|
|
36
29
|
UISchemaElementComponent,
|
|
37
30
|
UISchemaElementComponentWithValidationProps,
|
|
38
31
|
} from '../../types';
|
|
39
|
-
import { getDefaultCountryCode, getTranslation } from '../../util';
|
|
40
|
-
import FieldLevelMessageContainer from '../FieldLevelMessageContainer';
|
|
32
|
+
import { buildFieldLevelErrorMessages, getDefaultCountryCode, getTranslation } from '../../util';
|
|
41
33
|
import { withFormValidationState } from '../hocs';
|
|
42
34
|
|
|
43
35
|
const PhoneAuthenticator: UISchemaElementComponent<UISchemaElementComponentWithValidationProps> = ({
|
|
@@ -45,7 +37,6 @@ const PhoneAuthenticator: UISchemaElementComponent<UISchemaElementComponentWithV
|
|
|
45
37
|
setTouched,
|
|
46
38
|
errors,
|
|
47
39
|
handleBlur,
|
|
48
|
-
describedByIds,
|
|
49
40
|
}) => {
|
|
50
41
|
const {
|
|
51
42
|
data,
|
|
@@ -57,8 +48,6 @@ const PhoneAuthenticator: UISchemaElementComponent<UISchemaElementComponentWithV
|
|
|
57
48
|
const {
|
|
58
49
|
translations = [],
|
|
59
50
|
focus,
|
|
60
|
-
ariaDescribedBy,
|
|
61
|
-
showAsterisk,
|
|
62
51
|
options: {
|
|
63
52
|
inputMeta: {
|
|
64
53
|
name: fieldName,
|
|
@@ -69,10 +58,10 @@ const PhoneAuthenticator: UISchemaElementComponent<UISchemaElementComponentWithV
|
|
|
69
58
|
attributes,
|
|
70
59
|
},
|
|
71
60
|
} = uischema;
|
|
61
|
+
const { autocomplete, inputmode } = attributes || {};
|
|
72
62
|
const mainLabel = getTranslation(translations, 'label');
|
|
73
63
|
const extensionLabel = getTranslation(translations, 'extension');
|
|
74
64
|
const countryLabel = getTranslation(translations, 'country');
|
|
75
|
-
const optionalLabel = getTranslation(translations, 'optionalLabel');
|
|
76
65
|
|
|
77
66
|
const { features: { disableAutocomplete } = {} } = widgetProps;
|
|
78
67
|
const countries = CountryUtil.getCountries() as Record<string, string>;
|
|
@@ -86,7 +75,8 @@ const PhoneAuthenticator: UISchemaElementComponent<UISchemaElementComponentWithV
|
|
|
86
75
|
const showExtension = methodType === 'voice';
|
|
87
76
|
const onChangeHandler = useOnChange(uischema);
|
|
88
77
|
const focusRef = useAutoFocus<HTMLSelectElement>(focus);
|
|
89
|
-
const
|
|
78
|
+
const { errorMessage, errorMessageList } = buildFieldLevelErrorMessages(errors);
|
|
79
|
+
const tokens = useOdysseyDesignTokens();
|
|
90
80
|
|
|
91
81
|
const formatPhone = (
|
|
92
82
|
phoneNumber: string,
|
|
@@ -101,17 +91,19 @@ const PhoneAuthenticator: UISchemaElementComponent<UISchemaElementComponentWithV
|
|
|
101
91
|
|
|
102
92
|
const validate = useCallback((dataBag: FormBag['data']) => {
|
|
103
93
|
const fullPhoneNumber = dataBag[fieldName];
|
|
104
|
-
const
|
|
94
|
+
const blankFieldErrorMessage: IdxMessage = {
|
|
105
95
|
class: 'ERROR',
|
|
106
96
|
message: '',
|
|
107
97
|
i18n: { key: 'model.validation.field.blank' },
|
|
108
98
|
};
|
|
109
99
|
const isValid = !!fullPhoneNumber && !!phone;
|
|
110
|
-
return isValid ? undefined : [
|
|
100
|
+
return isValid ? undefined : [blankFieldErrorMessage];
|
|
111
101
|
}, [phone, fieldName]);
|
|
112
102
|
|
|
113
103
|
useEffect(() => {
|
|
114
|
-
dataSchemaRef.current
|
|
104
|
+
if (dataSchemaRef.current) {
|
|
105
|
+
dataSchemaRef.current[fieldName].validate = validate;
|
|
106
|
+
}
|
|
115
107
|
}, [dataSchemaRef, fieldName, messages.value, validate]);
|
|
116
108
|
|
|
117
109
|
useEffect(() => {
|
|
@@ -129,28 +121,17 @@ const PhoneAuthenticator: UISchemaElementComponent<UISchemaElementComponentWithV
|
|
|
129
121
|
const renderExtension = () => (
|
|
130
122
|
showExtension && (
|
|
131
123
|
<Box width={0.25}>
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
// label should remain in rtl format if rtl language is set
|
|
135
|
-
dir={languageDirection}
|
|
136
|
-
>
|
|
137
|
-
{extensionLabel}
|
|
138
|
-
</InputLabel>
|
|
139
|
-
<InputBase
|
|
140
|
-
value={extension}
|
|
141
|
-
type="text"
|
|
142
|
-
name="extension"
|
|
124
|
+
<TextField
|
|
125
|
+
autoCompleteType={disableAutocomplete ? 'off' : 'tel-extension'}
|
|
143
126
|
id="phoneExtension"
|
|
144
|
-
|
|
145
|
-
|
|
127
|
+
isDisabled={loading}
|
|
128
|
+
label={extensionLabel ?? ''}
|
|
129
|
+
name="extension"
|
|
146
130
|
onChange={(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
|
147
131
|
setExtension(e.currentTarget.value);
|
|
148
132
|
}}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
autocomplete: disableAutocomplete ? 'off' : 'tel-extension',
|
|
152
|
-
'aria-describedby': ariaDescribedBy,
|
|
153
|
-
}}
|
|
133
|
+
testId="extension"
|
|
134
|
+
value={extension}
|
|
154
135
|
/>
|
|
155
136
|
</Box>
|
|
156
137
|
)
|
|
@@ -158,53 +139,20 @@ const PhoneAuthenticator: UISchemaElementComponent<UISchemaElementComponentWithV
|
|
|
158
139
|
|
|
159
140
|
const renderCountrySelect = () => (
|
|
160
141
|
<Box marginBlockEnd={4}>
|
|
161
|
-
<
|
|
162
|
-
|
|
163
|
-
htmlFor="country"
|
|
164
|
-
// To prevent asterisk from shifting far right
|
|
165
|
-
sx={{ justifyContent: showAsterisk ? 'flex-start' : undefined }}
|
|
166
|
-
>
|
|
167
|
-
{countryLabel}
|
|
168
|
-
{showAsterisk && (
|
|
169
|
-
<Box
|
|
170
|
-
component="span"
|
|
171
|
-
sx={(theme) => ({
|
|
172
|
-
marginInlineStart: theme.spacing(1),
|
|
173
|
-
marginInlineEnd: theme.spacing(1),
|
|
174
|
-
})}
|
|
175
|
-
className="no-translate"
|
|
176
|
-
aria-hidden
|
|
177
|
-
>
|
|
178
|
-
*
|
|
179
|
-
</Box>
|
|
180
|
-
)}
|
|
181
|
-
{required === false && (
|
|
182
|
-
<Typography
|
|
183
|
-
variant="subtitle1"
|
|
184
|
-
sx={{ whiteSpace: 'nowrap' }}
|
|
185
|
-
>
|
|
186
|
-
{optionalLabel}
|
|
187
|
-
</Typography>
|
|
188
|
-
)}
|
|
189
|
-
</InputLabel>
|
|
190
|
-
<Select
|
|
142
|
+
<NativeSelect
|
|
143
|
+
autoCompleteType={disableAutocomplete ? 'off' : 'tel-country-code'}
|
|
191
144
|
id="country"
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
145
|
+
inputRef={focusRef}
|
|
146
|
+
isDisabled={loading}
|
|
147
|
+
isOptional={required === false}
|
|
148
|
+
label={countryLabel}
|
|
196
149
|
onChange={(e: SelectChangeEvent<string>) => {
|
|
197
150
|
const selectTarget = (
|
|
198
151
|
e?.target as SelectChangeEvent['target'] & { value: string; name: string; }
|
|
199
152
|
);
|
|
200
153
|
setPhoneCode(`+${CountryUtil.getCallingCodeForCountry(selectTarget.value)}`);
|
|
201
154
|
}}
|
|
202
|
-
|
|
203
|
-
inputProps={{
|
|
204
|
-
'data-se': 'country',
|
|
205
|
-
autocomplete: disableAutocomplete ? 'off' : 'tel-country-code',
|
|
206
|
-
'aria-describedby': ariaDescribedBy,
|
|
207
|
-
}}
|
|
155
|
+
testId="country"
|
|
208
156
|
>
|
|
209
157
|
{
|
|
210
158
|
Object.entries(countries).map(([code, name]) => (
|
|
@@ -217,7 +165,7 @@ const PhoneAuthenticator: UISchemaElementComponent<UISchemaElementComponentWithV
|
|
|
217
165
|
</option>
|
|
218
166
|
))
|
|
219
167
|
}
|
|
220
|
-
</
|
|
168
|
+
</NativeSelect>
|
|
221
169
|
</Box>
|
|
222
170
|
);
|
|
223
171
|
|
|
@@ -227,78 +175,46 @@ const PhoneAuthenticator: UISchemaElementComponent<UISchemaElementComponentWithV
|
|
|
227
175
|
<Box
|
|
228
176
|
display="flex"
|
|
229
177
|
justifyContent="space-between"
|
|
230
|
-
|
|
178
|
+
flexWrap="wrap"
|
|
179
|
+
flexDirection={languageDirection === 'rtl' ? 'row-reverse' : 'row'}
|
|
231
180
|
>
|
|
232
|
-
<Box
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
{
|
|
241
|
-
{
|
|
242
|
-
<Box
|
|
243
|
-
component="span"
|
|
244
|
-
sx={(theme) => ({
|
|
245
|
-
marginInlineStart: theme.spacing(1),
|
|
246
|
-
marginInlineEnd: theme.spacing(1),
|
|
247
|
-
})}
|
|
248
|
-
className="no-translate"
|
|
249
|
-
aria-hidden
|
|
250
|
-
>
|
|
251
|
-
*
|
|
252
|
-
</Box>
|
|
253
|
-
)}
|
|
254
|
-
{required === false && (
|
|
255
|
-
<Typography variant="subtitle1">{optionalLabel}</Typography>
|
|
256
|
-
)}
|
|
257
|
-
</InputLabel>
|
|
258
|
-
<InputBase
|
|
259
|
-
type="tel"
|
|
260
|
-
name={fieldName}
|
|
181
|
+
<Box
|
|
182
|
+
width={showExtension ? 0.7 : 1}
|
|
183
|
+
sx={{
|
|
184
|
+
marginRight: showExtension ? tokens.Spacing2 : tokens.Spacing0,
|
|
185
|
+
}}
|
|
186
|
+
>
|
|
187
|
+
<TextField
|
|
188
|
+
autoCompleteType={autocomplete}
|
|
189
|
+
errorMessage={errorMessage}
|
|
190
|
+
errorMessageList={errorMessageList}
|
|
261
191
|
id={fieldName}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
192
|
+
inputMode={inputmode}
|
|
193
|
+
isDisabled={loading}
|
|
194
|
+
isFullWidth
|
|
195
|
+
isOptional={required === false}
|
|
196
|
+
label={mainLabel ?? ''}
|
|
197
|
+
name={fieldName}
|
|
198
|
+
onBlur={(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
|
199
|
+
const formattedPhone = formatPhone(e?.currentTarget?.value, phoneCode, extension);
|
|
200
|
+
handleBlur?.(formattedPhone);
|
|
201
|
+
}}
|
|
265
202
|
onChange={(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
|
266
203
|
// Set new phone value without phone code
|
|
267
204
|
setPhone(e.currentTarget.value);
|
|
268
205
|
setPhoneChanged(true);
|
|
269
206
|
}}
|
|
270
|
-
onBlur={(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
|
271
|
-
const formattedPhone = formatPhone(e?.currentTarget?.value, phoneCode, extension);
|
|
272
|
-
handleBlur?.(formattedPhone);
|
|
273
|
-
}}
|
|
274
207
|
startAdornment={(
|
|
275
|
-
<
|
|
208
|
+
<Box
|
|
276
209
|
component="span"
|
|
277
|
-
|
|
278
|
-
className="no-translate"
|
|
279
|
-
sx={(theme) => ({
|
|
280
|
-
// physical properties OK because parent InputBase component
|
|
281
|
-
// is always set to "ltr"
|
|
282
|
-
marginRight: theme.spacing(2),
|
|
283
|
-
marginLeft: 0,
|
|
284
|
-
})}
|
|
210
|
+
translate="no"
|
|
285
211
|
>
|
|
286
212
|
{phoneCode}
|
|
287
|
-
</
|
|
213
|
+
</Box>
|
|
288
214
|
)}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
'data-se': fieldName,
|
|
292
|
-
'aria-describedby': describedByIds,
|
|
293
|
-
...attributes,
|
|
294
|
-
}}
|
|
215
|
+
testId={fieldName}
|
|
216
|
+
type="tel"
|
|
295
217
|
/>
|
|
296
|
-
{phoneHasErrors && (
|
|
297
|
-
<FieldLevelMessageContainer
|
|
298
|
-
messages={errors}
|
|
299
|
-
fieldName={fieldName}
|
|
300
|
-
/>
|
|
301
|
-
)}
|
|
302
218
|
</Box>
|
|
303
219
|
{renderExtension()}
|
|
304
220
|
</Box>
|
|
@@ -10,12 +10,13 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
13
|
+
import { Box } from '@mui/material';
|
|
14
|
+
import { useOdysseyDesignTokens } from '@okta/odyssey-react-mui';
|
|
15
15
|
import { h } from 'preact';
|
|
16
16
|
|
|
17
17
|
import { QRCodeElement, UISchemaElementComponent } from '../../types';
|
|
18
18
|
import { getTranslation } from '../../util';
|
|
19
|
+
import Image from '../Image';
|
|
19
20
|
|
|
20
21
|
const QRCode: UISchemaElementComponent<{
|
|
21
22
|
uischema: QRCodeElement
|
|
@@ -24,33 +25,39 @@ const QRCode: UISchemaElementComponent<{
|
|
|
24
25
|
}) => {
|
|
25
26
|
const { translations = [], options: { data } } = uischema;
|
|
26
27
|
const label = getTranslation(translations, 'label');
|
|
28
|
+
const tokens = useOdysseyDesignTokens();
|
|
29
|
+
|
|
27
30
|
return (
|
|
28
31
|
<Box
|
|
29
|
-
|
|
30
|
-
sx={
|
|
31
|
-
marginBlockStart:
|
|
32
|
-
marginBlockEnd:
|
|
33
|
-
marginInlineStart:
|
|
34
|
-
marginInlineEnd:
|
|
32
|
+
data-se="qrContainer"
|
|
33
|
+
sx={{
|
|
34
|
+
marginBlockStart: tokens.Spacing5,
|
|
35
|
+
marginBlockEnd: tokens.Spacing5,
|
|
36
|
+
marginInlineStart: tokens.Spacing1,
|
|
37
|
+
marginInlineEnd: tokens.Spacing1,
|
|
35
38
|
display: 'flex',
|
|
36
39
|
flexDirection: 'column',
|
|
37
40
|
alignItems: 'center',
|
|
38
|
-
}
|
|
41
|
+
}}
|
|
39
42
|
>
|
|
40
43
|
<Box
|
|
41
|
-
as="img"
|
|
42
|
-
className="qrImg"
|
|
43
44
|
sx={{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
borderWidth:
|
|
47
|
-
borderStyle:
|
|
48
|
-
borderColor:
|
|
49
|
-
borderRadius:
|
|
45
|
+
display: 'flex',
|
|
46
|
+
overflow: 'hidden',
|
|
47
|
+
borderWidth: tokens.BorderWidthMain,
|
|
48
|
+
borderStyle: tokens.BorderStyleMain,
|
|
49
|
+
borderColor: tokens.BorderColorDisplay,
|
|
50
|
+
borderRadius: tokens.BorderRadiusMain,
|
|
50
51
|
}}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
>
|
|
53
|
+
<Image
|
|
54
|
+
src={data}
|
|
55
|
+
alt={label ?? ''}
|
|
56
|
+
width="224px"
|
|
57
|
+
height="224px"
|
|
58
|
+
testId="qrImg"
|
|
59
|
+
/>
|
|
60
|
+
</Box>
|
|
54
61
|
</Box>
|
|
55
62
|
);
|
|
56
63
|
};
|