@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,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
|
-
import {
|
|
15
|
-
|
|
16
|
-
ArrowRightIcon,
|
|
17
|
-
Box,
|
|
18
|
-
Typography,
|
|
19
|
-
} from '@okta/odyssey-react-mui';
|
|
20
|
-
import classNames from 'classnames';
|
|
13
|
+
import { Box, Typography } from '@mui/material';
|
|
14
|
+
import { useOdysseyDesignTokens } from '@okta/odyssey-react-mui';
|
|
15
|
+
import { AddIcon, ArrowLeftIcon, ArrowRightIcon } from '@okta/odyssey-react-mui/icons';
|
|
21
16
|
import { h } from 'preact';
|
|
22
17
|
|
|
23
18
|
import { useWidgetContext } from '../../contexts';
|
|
@@ -42,8 +37,9 @@ const AuthenticatorButton: UISchemaElementComponent<{
|
|
|
42
37
|
options: {
|
|
43
38
|
type,
|
|
44
39
|
key: authenticationKey,
|
|
40
|
+
isEnroll,
|
|
41
|
+
isAdditionalEnroll,
|
|
45
42
|
actionParams,
|
|
46
|
-
description,
|
|
47
43
|
nickname,
|
|
48
44
|
usageDescription,
|
|
49
45
|
logoUri,
|
|
@@ -57,7 +53,8 @@ const AuthenticatorButton: UISchemaElementComponent<{
|
|
|
57
53
|
ariaLabel,
|
|
58
54
|
},
|
|
59
55
|
} = uischema;
|
|
60
|
-
const label = getTranslation(translations, 'label');
|
|
56
|
+
const label = getTranslation(translations, 'label') ?? uischema.label;
|
|
57
|
+
const description = getTranslation(translations, 'description') ?? uischema.options.description;
|
|
61
58
|
const {
|
|
62
59
|
dataSchemaRef, data, loading, languageDirection,
|
|
63
60
|
} = useWidgetContext();
|
|
@@ -69,8 +66,9 @@ const AuthenticatorButton: UISchemaElementComponent<{
|
|
|
69
66
|
description && `${iconName}-description`,
|
|
70
67
|
nickname && `${iconName}-nickname`,
|
|
71
68
|
usageDescription && `${iconName}-usageDescription`,
|
|
72
|
-
`${iconName}-ctaLabel`,
|
|
69
|
+
isEnroll && `${iconName}-ctaLabel`,
|
|
73
70
|
].filter(Boolean).join(' ');
|
|
71
|
+
const tokens = useOdysseyDesignTokens();
|
|
74
72
|
|
|
75
73
|
const onClick: ClickHandler = async () => {
|
|
76
74
|
const dataSchema = dataSchemaRef.current!;
|
|
@@ -92,33 +90,46 @@ const AuthenticatorButton: UISchemaElementComponent<{
|
|
|
92
90
|
});
|
|
93
91
|
};
|
|
94
92
|
|
|
93
|
+
function createCtaIcon() {
|
|
94
|
+
if (isAdditionalEnroll) {
|
|
95
|
+
return <AddIcon titleAccess={ctaLabel} />;
|
|
96
|
+
}
|
|
97
|
+
if (languageDirection === 'rtl') {
|
|
98
|
+
return <ArrowLeftIcon titleAccess={ctaLabel} />;
|
|
99
|
+
}
|
|
100
|
+
return <ArrowRightIcon titleAccess={ctaLabel} />;
|
|
101
|
+
}
|
|
102
|
+
|
|
95
103
|
return (
|
|
96
104
|
<Box
|
|
97
105
|
component="button"
|
|
98
106
|
type={type}
|
|
99
|
-
sx={
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
outlineWidth: Tokens.FocusOutlineWidthBase,
|
|
105
|
-
},
|
|
107
|
+
sx={{
|
|
108
|
+
borderStyle: tokens.BorderStyleMain,
|
|
109
|
+
borderWidth: tokens.BorderWidthMain,
|
|
110
|
+
borderColor: tokens.BorderColorDisplay,
|
|
111
|
+
borderRadius: tokens.BorderRadiusMain,
|
|
106
112
|
'&:hover': {
|
|
107
|
-
color:
|
|
113
|
+
color: tokens.PalettePrimaryDark,
|
|
108
114
|
cursor: 'pointer',
|
|
109
|
-
borderColor:
|
|
115
|
+
borderColor: tokens.PalettePrimaryMain,
|
|
116
|
+
},
|
|
117
|
+
'&:focus': {
|
|
118
|
+
outlineColor: tokens.PalettePrimaryMain,
|
|
119
|
+
outlineOffset: tokens.FocusOutlineOffsetMain,
|
|
120
|
+
outlineStyle: tokens.FocusOutlineStyle,
|
|
121
|
+
outlineWidth: tokens.FocusOutlineWidthMain,
|
|
122
|
+
borderColor: tokens.BorderColorDisplay,
|
|
110
123
|
},
|
|
111
124
|
width: 1,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
boxShadow={Tokens.ShadowScale0}
|
|
121
|
-
className="authenticator-row"
|
|
125
|
+
display: 'flex',
|
|
126
|
+
// Assuming we want to allow users to customize this color, we should try to map this to
|
|
127
|
+
// a more semantic token. We also don't want users to override white just for this
|
|
128
|
+
backgroundColor: tokens.HueNeutralWhite,
|
|
129
|
+
paddingBlock: tokens.Spacing3,
|
|
130
|
+
paddingInline: tokens.Spacing3,
|
|
131
|
+
alignItems: !isEnroll ? 'center' : '',
|
|
132
|
+
}}
|
|
122
133
|
data-se="authenticator-button"
|
|
123
134
|
tabIndex={0}
|
|
124
135
|
onClick={onClick}
|
|
@@ -130,7 +141,6 @@ const AuthenticatorButton: UISchemaElementComponent<{
|
|
|
130
141
|
>
|
|
131
142
|
{ authenticationKey && (
|
|
132
143
|
<Box
|
|
133
|
-
className="authenticator-icon-container"
|
|
134
144
|
data-se="authenticator-icon"
|
|
135
145
|
>
|
|
136
146
|
<AuthCoin
|
|
@@ -138,18 +148,18 @@ const AuthenticatorButton: UISchemaElementComponent<{
|
|
|
138
148
|
url={logoUri}
|
|
139
149
|
name={iconName}
|
|
140
150
|
description={iconDescr}
|
|
141
|
-
customClasses={['authenticator-icon']}
|
|
142
151
|
/>
|
|
143
152
|
</Box>
|
|
144
153
|
)}
|
|
145
154
|
<Box
|
|
146
|
-
|
|
155
|
+
data-se="authenticator-button-content"
|
|
147
156
|
sx={{
|
|
148
157
|
display: 'flex',
|
|
149
158
|
flexDirection: 'column',
|
|
150
159
|
flexGrow: 1,
|
|
151
|
-
paddingBlock:
|
|
152
|
-
|
|
160
|
+
paddingBlock: tokens.Spacing0,
|
|
161
|
+
paddingInlineStart: tokens.Spacing3,
|
|
162
|
+
paddingInlineEnd: tokens.Spacing0,
|
|
153
163
|
// needed to solve ie11 'flexbug' where nested flex element overflows container
|
|
154
164
|
minInlineSize: '0%',
|
|
155
165
|
}}
|
|
@@ -158,13 +168,14 @@ const AuthenticatorButton: UISchemaElementComponent<{
|
|
|
158
168
|
variant="h3"
|
|
159
169
|
id={`${iconName}-label`}
|
|
160
170
|
sx={{
|
|
161
|
-
fontSize:
|
|
162
|
-
|
|
163
|
-
|
|
171
|
+
fontSize: tokens.TypographySizeBody,
|
|
172
|
+
fontWeight: tokens.TypographyWeightBodyBold,
|
|
173
|
+
color: tokens.TypographyColorBody,
|
|
174
|
+
margin: tokens.Spacing0,
|
|
164
175
|
textAlign: 'start',
|
|
165
176
|
}}
|
|
166
177
|
data-se="authenticator-button-label"
|
|
167
|
-
|
|
178
|
+
translate="no"
|
|
168
179
|
>
|
|
169
180
|
{label}
|
|
170
181
|
</Typography>
|
|
@@ -173,15 +184,17 @@ const AuthenticatorButton: UISchemaElementComponent<{
|
|
|
173
184
|
paragraph
|
|
174
185
|
id={`${iconName}-description`}
|
|
175
186
|
sx={{
|
|
176
|
-
fontSize:
|
|
177
|
-
|
|
178
|
-
|
|
187
|
+
fontSize: tokens.TypographySizeSubordinate,
|
|
188
|
+
fontWeight: tokens.TypographyWeightBody,
|
|
189
|
+
color: tokens.TypographyColorSubordinate,
|
|
190
|
+
margin: tokens.Spacing0,
|
|
191
|
+
marginBlockStart: tokens.Spacing1,
|
|
179
192
|
textAlign: 'start',
|
|
180
193
|
}}
|
|
181
194
|
data-se="authenticator-button-description"
|
|
182
|
-
className={classNames('authenticator-description--text', { 'no-translate': noTranslate })}
|
|
183
195
|
aria-label={punctuate(description)}
|
|
184
196
|
dir={dir}
|
|
197
|
+
translate={noTranslate ? 'no' : undefined}
|
|
185
198
|
>
|
|
186
199
|
{description}
|
|
187
200
|
</Typography>
|
|
@@ -191,9 +204,11 @@ const AuthenticatorButton: UISchemaElementComponent<{
|
|
|
191
204
|
paragraph
|
|
192
205
|
id={`${iconName}-nickname`}
|
|
193
206
|
sx={{
|
|
194
|
-
fontSize:
|
|
195
|
-
|
|
196
|
-
|
|
207
|
+
fontSize: tokens.TypographySizeSubordinate,
|
|
208
|
+
fontWeight: tokens.TypographyWeightBody,
|
|
209
|
+
color: tokens.TypographyColorSubordinate,
|
|
210
|
+
margin: tokens.Spacing0,
|
|
211
|
+
marginBlockStart: tokens.Spacing1,
|
|
197
212
|
textAlign: 'start',
|
|
198
213
|
overflow: 'hidden',
|
|
199
214
|
whiteSpace: 'nowrap',
|
|
@@ -201,8 +216,8 @@ const AuthenticatorButton: UISchemaElementComponent<{
|
|
|
201
216
|
}}
|
|
202
217
|
title={nickname}
|
|
203
218
|
data-se="authenticator-button-nickname"
|
|
204
|
-
className={classNames('authenticator-enrollment-nickname', 'no-translate')}
|
|
205
219
|
aria-label={punctuate(nickname)}
|
|
220
|
+
translate="no"
|
|
206
221
|
>
|
|
207
222
|
{nickname}
|
|
208
223
|
</Typography>
|
|
@@ -213,50 +228,74 @@ const AuthenticatorButton: UISchemaElementComponent<{
|
|
|
213
228
|
id={`${iconName}-usageDescription`}
|
|
214
229
|
textAlign="start"
|
|
215
230
|
sx={{
|
|
216
|
-
fontSize:
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
231
|
+
fontSize: tokens.TypographySizeSubordinate,
|
|
232
|
+
fontWeight: tokens.TypographyWeightBody,
|
|
233
|
+
color: tokens.TypographyColorSubordinate,
|
|
234
|
+
margin: tokens.Spacing0,
|
|
235
|
+
marginBlockStart: tokens.Spacing1,
|
|
220
236
|
}}
|
|
221
237
|
data-se="authenticator-button-usage-text"
|
|
222
|
-
className="authenticator-usage-text"
|
|
223
238
|
aria-label={punctuate(usageDescription)}
|
|
224
239
|
>
|
|
225
240
|
{usageDescription}
|
|
226
241
|
</Typography>
|
|
227
242
|
)}
|
|
243
|
+
{isEnroll && (
|
|
244
|
+
<Box
|
|
245
|
+
data-se={dataSe}
|
|
246
|
+
sx={{
|
|
247
|
+
display: 'flex',
|
|
248
|
+
alignItems: 'center',
|
|
249
|
+
marginBlockStart: tokens.Spacing3,
|
|
250
|
+
marginInline: tokens.Spacing0,
|
|
251
|
+
color: tokens.TypographyColorAction,
|
|
252
|
+
'& svg': {
|
|
253
|
+
marginBlock: tokens.Spacing0,
|
|
254
|
+
marginInlineStart: isAdditionalEnroll ? tokens.Spacing0 : tokens.Spacing1,
|
|
255
|
+
marginInlineEnd: isAdditionalEnroll ? tokens.Spacing1 : tokens.Spacing0,
|
|
256
|
+
},
|
|
257
|
+
}}
|
|
258
|
+
>
|
|
259
|
+
<Box
|
|
260
|
+
component="span"
|
|
261
|
+
id={`${iconName}-ctaLabel`}
|
|
262
|
+
sx={{
|
|
263
|
+
fontWeight: tokens.TypographyWeightBodyBold,
|
|
264
|
+
fontSize: tokens.TypographySizeBody,
|
|
265
|
+
order: isAdditionalEnroll ? 1 : 0,
|
|
266
|
+
}}
|
|
267
|
+
data-se="cta-button-label"
|
|
268
|
+
>
|
|
269
|
+
{ctaLabel}
|
|
270
|
+
</Box>
|
|
271
|
+
<Box
|
|
272
|
+
data-se="cta-button-icon"
|
|
273
|
+
sx={{
|
|
274
|
+
display: 'flex',
|
|
275
|
+
}}
|
|
276
|
+
>
|
|
277
|
+
{ createCtaIcon() }
|
|
278
|
+
</Box>
|
|
279
|
+
</Box>
|
|
280
|
+
)}
|
|
281
|
+
</Box>
|
|
282
|
+
{!isEnroll && (
|
|
228
283
|
<Box
|
|
229
|
-
className="cta-button authenticator-button"
|
|
230
284
|
data-se={dataSe}
|
|
231
|
-
sx={
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
marginBlock: '5px',
|
|
235
|
-
marginInline: 0,
|
|
236
|
-
fontWeight: 500,
|
|
237
|
-
color: theme.palette.primary.main,
|
|
238
|
-
'& svg': {
|
|
239
|
-
marginBlock: 0,
|
|
240
|
-
marginInline: '5px 0',
|
|
241
|
-
},
|
|
242
|
-
})}
|
|
285
|
+
sx={{
|
|
286
|
+
color: tokens.TypographyColorAction,
|
|
287
|
+
}}
|
|
243
288
|
>
|
|
244
289
|
<Box
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
className="button select-factor link-button"
|
|
290
|
+
data-se="cta-button-icon"
|
|
291
|
+
sx={{
|
|
292
|
+
display: 'flex',
|
|
293
|
+
}}
|
|
250
294
|
>
|
|
251
|
-
{
|
|
295
|
+
{ createCtaIcon() }
|
|
252
296
|
</Box>
|
|
253
|
-
{
|
|
254
|
-
languageDirection === 'rtl'
|
|
255
|
-
? <ArrowLeftIcon titleAccess={ctaLabel} />
|
|
256
|
-
: <ArrowRightIcon titleAccess={ctaLabel} />
|
|
257
|
-
}
|
|
258
297
|
</Box>
|
|
259
|
-
|
|
298
|
+
)}
|
|
260
299
|
</Box>
|
|
261
300
|
);
|
|
262
301
|
};
|
|
@@ -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 { h } from 'preact';
|
|
15
16
|
|
|
16
17
|
import {
|
|
@@ -24,19 +25,24 @@ const AuthenticatorButtonList: UISchemaElementComponent<{
|
|
|
24
25
|
uischema: AuthenticatorButtonListElement
|
|
25
26
|
}> = ({ uischema }) => {
|
|
26
27
|
const { buttons, dataSe } = uischema.options;
|
|
28
|
+
const tokens = useOdysseyDesignTokens();
|
|
27
29
|
|
|
28
30
|
return (
|
|
29
31
|
<Box
|
|
30
32
|
component="ul"
|
|
31
33
|
data-se={dataSe}
|
|
32
|
-
sx={{
|
|
34
|
+
sx={{
|
|
35
|
+
listStyle: 'none',
|
|
36
|
+
padding: tokens.Spacing0,
|
|
37
|
+
marginBlockStart: tokens.Spacing0,
|
|
38
|
+
}}
|
|
33
39
|
>
|
|
34
40
|
{
|
|
35
41
|
buttons.map((button: AuthenticatorButtonElement, index: number) => (
|
|
36
42
|
<Box
|
|
37
43
|
key={button.id}
|
|
38
44
|
component="li"
|
|
39
|
-
sx={{ marginBlockEnd:
|
|
45
|
+
sx={{ marginBlockEnd: tokens.Spacing4 }}
|
|
40
46
|
>
|
|
41
47
|
<AuthenticatorButton
|
|
42
48
|
uischema={{
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { Button as OdyButton } from '@okta/odyssey-react-mui';
|
|
14
14
|
import { h } from 'preact';
|
|
15
15
|
|
|
16
16
|
import { useWidgetContext } from '../../contexts';
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
ClickHandler,
|
|
21
21
|
UISchemaElementComponent,
|
|
22
22
|
} from '../../types';
|
|
23
|
+
import Image from '../Image';
|
|
23
24
|
import Spinner from '../Spinner';
|
|
24
25
|
|
|
25
26
|
const Button: UISchemaElementComponent<{
|
|
@@ -34,6 +35,7 @@ const Button: UISchemaElementComponent<{
|
|
|
34
35
|
label,
|
|
35
36
|
focus,
|
|
36
37
|
ariaDescribedBy,
|
|
38
|
+
noTranslate,
|
|
37
39
|
options: {
|
|
38
40
|
type,
|
|
39
41
|
ariaLabel,
|
|
@@ -48,18 +50,16 @@ const Button: UISchemaElementComponent<{
|
|
|
48
50
|
isActionStep,
|
|
49
51
|
step,
|
|
50
52
|
stepToRender,
|
|
51
|
-
classes,
|
|
52
53
|
disabled,
|
|
53
54
|
onClick,
|
|
54
55
|
},
|
|
55
56
|
} = uischema;
|
|
56
57
|
|
|
57
58
|
const ButtonImageIcon = typeof Icon === 'string' ? (
|
|
58
|
-
<
|
|
59
|
-
component="img"
|
|
59
|
+
<Image
|
|
60
60
|
src={Icon}
|
|
61
|
-
alt={iconAlt}
|
|
62
|
-
|
|
61
|
+
alt={iconAlt ?? ''}
|
|
62
|
+
ariaHidden
|
|
63
63
|
/>
|
|
64
64
|
) : Icon && (<Icon />);
|
|
65
65
|
|
|
@@ -79,24 +79,20 @@ const Button: UISchemaElementComponent<{
|
|
|
79
79
|
|
|
80
80
|
return (
|
|
81
81
|
<OdyButton
|
|
82
|
+
label={label ?? ''}
|
|
82
83
|
type={type}
|
|
83
84
|
variant={variant ?? 'primary'}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
data-type={dataType}
|
|
93
|
-
data-se={dataSe}
|
|
94
|
-
aria-label={ariaLabel}
|
|
85
|
+
isFullWidth={wide ?? true}
|
|
86
|
+
buttonRef={focusRef}
|
|
87
|
+
isDisabled={loading || disabled}
|
|
88
|
+
startIcon={loading ? <Spinner /> : ButtonImageIcon}
|
|
89
|
+
ariaDescribedBy={ariaDescribedBy}
|
|
90
|
+
testId={dataSe ?? dataType}
|
|
91
|
+
ariaLabel={ariaLabel}
|
|
92
|
+
translate={noTranslate ? 'no' : undefined}
|
|
95
93
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
96
94
|
{...(type !== 'submit' && { onClick: typeof onClick === 'function' ? customClickHandler : handleClick })}
|
|
97
|
-
|
|
98
|
-
{label}
|
|
99
|
-
</OdyButton>
|
|
95
|
+
/>
|
|
100
96
|
);
|
|
101
97
|
};
|
|
102
98
|
|
|
@@ -10,24 +10,17 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
Checkbox as CheckboxMui,
|
|
16
|
-
FormControl,
|
|
17
|
-
FormControlLabel,
|
|
18
|
-
FormHelperText,
|
|
19
|
-
} from '@okta/odyssey-react-mui';
|
|
20
|
-
import { Fragment, h } from 'preact';
|
|
13
|
+
import { Checkbox as OdyCheckbox, CheckboxGroup } from '@okta/odyssey-react-mui';
|
|
14
|
+
import { h } from 'preact';
|
|
21
15
|
|
|
22
16
|
import { useWidgetContext } from '../../contexts';
|
|
23
|
-
import { useAutoFocus, useValue } from '../../hooks';
|
|
17
|
+
import { useAutoFocus, useHtmlContentParser, useValue } from '../../hooks';
|
|
24
18
|
import {
|
|
25
19
|
ChangeEvent,
|
|
26
20
|
UISchemaElementComponent,
|
|
27
21
|
UISchemaElementComponentWithValidationProps,
|
|
28
22
|
} from '../../types';
|
|
29
|
-
import { getTranslationInfo } from '../../util';
|
|
30
|
-
import FieldLevelMessageContainer from '../FieldLevelMessageContainer';
|
|
23
|
+
import { buildFieldLevelErrorMessages, getTranslationInfo, wrapInTranslateNo } from '../../util';
|
|
31
24
|
import { withFormValidationState } from '../hocs';
|
|
32
25
|
|
|
33
26
|
const Checkbox: UISchemaElementComponent<UISchemaElementComponentWithValidationProps> = ({
|
|
@@ -35,7 +28,6 @@ const Checkbox: UISchemaElementComponent<UISchemaElementComponentWithValidationP
|
|
|
35
28
|
errors,
|
|
36
29
|
handleChange,
|
|
37
30
|
handleBlur,
|
|
38
|
-
describedByIds,
|
|
39
31
|
}) => {
|
|
40
32
|
const value = useValue(uischema);
|
|
41
33
|
const { loading } = useWidgetContext();
|
|
@@ -43,86 +35,45 @@ const Checkbox: UISchemaElementComponent<UISchemaElementComponentWithValidationP
|
|
|
43
35
|
const {
|
|
44
36
|
options: { inputMeta: { name, mutable } },
|
|
45
37
|
focus,
|
|
46
|
-
noTranslate,
|
|
47
38
|
translations = [],
|
|
48
|
-
showAsterisk,
|
|
49
39
|
} = uischema;
|
|
50
40
|
const isReadOnly = mutable === false;
|
|
41
|
+
const checkboxId = `${name}-checkbox`;
|
|
51
42
|
const labelInfo = getTranslationInfo(translations, 'label');
|
|
43
|
+
const label = useHtmlContentParser(labelInfo?.noTranslate
|
|
44
|
+
? wrapInTranslateNo(labelInfo.value)
|
|
45
|
+
: labelInfo?.value) as string | undefined;
|
|
52
46
|
const descriptionInfo = getTranslationInfo(translations, 'description');
|
|
47
|
+
const description = useHtmlContentParser(descriptionInfo?.noTranslate
|
|
48
|
+
? wrapInTranslateNo(descriptionInfo.value)
|
|
49
|
+
: descriptionInfo?.value) as string | undefined;
|
|
53
50
|
const focusRef = useAutoFocus<HTMLInputElement>(focus);
|
|
54
|
-
const
|
|
51
|
+
const { errorMessage, errorMessageList } = buildFieldLevelErrorMessages(errors);
|
|
55
52
|
|
|
56
53
|
return (
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
<CheckboxGroup
|
|
55
|
+
errorMessage={errorMessage}
|
|
56
|
+
errorMessageList={errorMessageList}
|
|
57
|
+
id={name}
|
|
58
|
+
label=""
|
|
62
59
|
>
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
disabled={loading || isReadOnly}
|
|
79
|
-
inputProps={{
|
|
80
|
-
'data-se': name,
|
|
81
|
-
'data-se-for-name': name,
|
|
82
|
-
}}
|
|
83
|
-
sx={(theme) => ({
|
|
84
|
-
marginInlineEnd: theme.spacing(2),
|
|
85
|
-
})}
|
|
86
|
-
/>
|
|
87
|
-
)}
|
|
88
|
-
label={(
|
|
89
|
-
<Fragment>
|
|
90
|
-
{labelInfo?.noTranslate ? (
|
|
91
|
-
<Box
|
|
92
|
-
component="span"
|
|
93
|
-
className="no-translate"
|
|
94
|
-
>
|
|
95
|
-
{labelInfo?.value as string}
|
|
96
|
-
</Box>
|
|
97
|
-
) : labelInfo?.value as string}
|
|
98
|
-
{showAsterisk && (
|
|
99
|
-
<Box
|
|
100
|
-
component="span"
|
|
101
|
-
sx={(theme) => ({
|
|
102
|
-
marginInlineStart: theme.spacing(1),
|
|
103
|
-
marginInlineEnd: theme.spacing(1),
|
|
104
|
-
})}
|
|
105
|
-
className="no-translate"
|
|
106
|
-
aria-hidden
|
|
107
|
-
>
|
|
108
|
-
*
|
|
109
|
-
</Box>
|
|
110
|
-
)}
|
|
111
|
-
{descriptionInfo?.value && (
|
|
112
|
-
<FormHelperText className={descriptionInfo.noTranslate ? 'no-translate' : undefined}>
|
|
113
|
-
{descriptionInfo.value}
|
|
114
|
-
</FormHelperText>
|
|
115
|
-
)}
|
|
116
|
-
</Fragment>
|
|
117
|
-
)}
|
|
60
|
+
<OdyCheckbox
|
|
61
|
+
hint={description}
|
|
62
|
+
id={checkboxId}
|
|
63
|
+
inputRef={focusRef}
|
|
64
|
+
isChecked={value === true}
|
|
65
|
+
isDisabled={loading || isReadOnly}
|
|
66
|
+
label={label}
|
|
67
|
+
name={name}
|
|
68
|
+
onBlur={(e: ChangeEvent<HTMLInputElement>) => {
|
|
69
|
+
handleBlur?.(e?.currentTarget?.checked);
|
|
70
|
+
}}
|
|
71
|
+
onChange={(e: ChangeEvent<HTMLInputElement>) => {
|
|
72
|
+
handleChange?.(e.currentTarget.checked);
|
|
73
|
+
}}
|
|
74
|
+
testId={name}
|
|
118
75
|
/>
|
|
119
|
-
|
|
120
|
-
<FieldLevelMessageContainer
|
|
121
|
-
messages={errors}
|
|
122
|
-
fieldName={name}
|
|
123
|
-
/>
|
|
124
|
-
)}
|
|
125
|
-
</FormControl>
|
|
76
|
+
</CheckboxGroup>
|
|
126
77
|
);
|
|
127
78
|
};
|
|
128
79
|
|