@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,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 { Link, Typography } from '@
|
|
13
|
+
import { Link, Typography } from '@mui/material';
|
|
14
14
|
import {
|
|
15
15
|
attributesToProps,
|
|
16
16
|
DOMNode,
|
|
@@ -78,3 +78,5 @@ export const getHeadingReplacerFn = (
|
|
|
78
78
|
return undefined;
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
|
+
|
|
82
|
+
export const wrapInTranslateNo = (string: string): string => `<span translate="no">${string}</span>`;
|
package/src/v3/util/index.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
export * from './browserUtils';
|
|
14
14
|
export * from './buildErrorMessageIds';
|
|
15
|
+
export * from './buildFieldLevelErrorMessages';
|
|
15
16
|
export * from './buildPasswordRequirementNotMetErrorList';
|
|
16
17
|
export * from './clipboard';
|
|
17
18
|
export * from './configuredFlowUtils';
|
|
@@ -35,6 +36,7 @@ export * from './htmlContentParserUtils';
|
|
|
35
36
|
export * from './idpIconMap';
|
|
36
37
|
export * from './idxUtils';
|
|
37
38
|
export * from './isInteractiveElement';
|
|
39
|
+
export * from './isLtrField';
|
|
38
40
|
export * from './isPasswordRecovery';
|
|
39
41
|
export * from './isPollingStep';
|
|
40
42
|
export * from './languageUtils';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// fields with these names should stay LTR by default
|
|
14
|
+
const ltrOnlyFieldNames = [
|
|
15
|
+
'credentials.passcode',
|
|
16
|
+
'identifier',
|
|
17
|
+
'credentials.newPassword',
|
|
18
|
+
'confirmPassword',
|
|
19
|
+
'extension',
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
export const isLtrField = (fieldName: string) => ltrOnlyFieldNames.includes(fieldName) || fieldName.endsWith('phoneNumber');
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import { OdysseyI18nResourceKeys, odysseyI18nResourceKeysList } from '@okta/odyssey-react-mui';
|
|
14
|
+
|
|
13
15
|
import Bundles from '../../../util/Bundles';
|
|
14
16
|
import { WidgetProps } from '../types';
|
|
15
17
|
import { getLanguageCode, getSupportedLanguages } from './settingsUtils';
|
|
@@ -24,3 +26,15 @@ export const loadLanguage = async (widgetProps: WidgetProps): Promise<void> => {
|
|
|
24
26
|
rewrite: rewrite ?? ((val) => val),
|
|
25
27
|
}, supportedLanguages);
|
|
26
28
|
};
|
|
29
|
+
|
|
30
|
+
export const getOdysseyTranslationOverrides = (): Partial<OdysseyI18nResourceKeys> => (
|
|
31
|
+
odysseyI18nResourceKeysList
|
|
32
|
+
.reduce((overrides: Partial<OdysseyI18nResourceKeys>,
|
|
33
|
+
key: typeof odysseyI18nResourceKeysList[number]) => {
|
|
34
|
+
const updatedOverrides = { ...overrides };
|
|
35
|
+
if (Bundles.login && Object.prototype.hasOwnProperty.call(Bundles.login, key)) {
|
|
36
|
+
updatedOverrides[key] = (Bundles.login as Partial<OdysseyI18nResourceKeys>)[key];
|
|
37
|
+
}
|
|
38
|
+
return updatedOverrides;
|
|
39
|
+
}, {})
|
|
40
|
+
);
|
|
@@ -0,0 +1,571 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/* eslint-disable max-classes-per-file */
|
|
14
|
+
declare module '@adobe/leonardo-contrast-colors' {
|
|
15
|
+
import type ChromaJs from 'chroma-js';
|
|
16
|
+
|
|
17
|
+
type ColorTuple = [number, number, number];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Supported colorspaces from the {@link https://www.w3.org/TR/css-color-4/ W3C CSS Color Module Level 4} spec.
|
|
21
|
+
* @example '#RRGGBB' // HEX
|
|
22
|
+
* @example 'rgb(255 255 255)' // RGB
|
|
23
|
+
* @example 'hsl(360deg 0% 100%)' // HSL
|
|
24
|
+
* @example 'hsv(360deg 0% 100%)' // HSV
|
|
25
|
+
* @example 'hsluv(360 0 100)' // HSLuv
|
|
26
|
+
* @example 'lab(100% 0 0)' // LAB
|
|
27
|
+
* @example 'lch(100% 0 360deg)' // LCH
|
|
28
|
+
* @example 'oklab(100% 0 0)' // OKLAB
|
|
29
|
+
* @example 'oklch(100% 0 360deg)' // OKLCH
|
|
30
|
+
* @example 'jab(100% 0 0)' // CAM02
|
|
31
|
+
* @example 'jch(100% 0 360deg)' // CAM02p
|
|
32
|
+
*/
|
|
33
|
+
type Colorspace =
|
|
34
|
+
| 'HEX'
|
|
35
|
+
| 'RGB'
|
|
36
|
+
| 'HSL'
|
|
37
|
+
| 'HSV'
|
|
38
|
+
| 'HSLuv'
|
|
39
|
+
| 'LAB'
|
|
40
|
+
| 'LCH'
|
|
41
|
+
| 'OKLAB'
|
|
42
|
+
| 'OKLCH'
|
|
43
|
+
| 'CAM02'
|
|
44
|
+
| 'CAM02p';
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Supported interpolation colorspaces from the {@link https://www.w3.org/TR/css-color-4/ W3C CSS Color Module Level 4} spec.
|
|
48
|
+
* @example 'rgb(255 255 255)' // RGB
|
|
49
|
+
* @example 'hsl(360deg 0% 100%)' // HSL
|
|
50
|
+
* @example 'hsv(360deg 0% 100%)' // HSV
|
|
51
|
+
* @example 'hsluv(360 0 100)' // HSLuv
|
|
52
|
+
* @example 'lab(100% 0 0)' // LAB
|
|
53
|
+
* @example 'lch(100% 0 360deg)' // LCH
|
|
54
|
+
* @example 'oklab(100% 0 0)' // OKLAB
|
|
55
|
+
* @example 'oklch(100% 0 360deg)' // OKLCH
|
|
56
|
+
* @example 'jab(100% 0 0)' // CAM02
|
|
57
|
+
* @example 'jch(100% 0 360deg)' // CAM02p
|
|
58
|
+
*/
|
|
59
|
+
type InterpolationColorspace = Exclude<Colorspace, 'HEX'>;
|
|
60
|
+
|
|
61
|
+
type RGBArray = ColorTuple;
|
|
62
|
+
|
|
63
|
+
interface ColorBase {
|
|
64
|
+
/**
|
|
65
|
+
* User-defined name for a color, (eg "Blue"). Used to name output color values.
|
|
66
|
+
*/
|
|
67
|
+
name: string
|
|
68
|
+
/**
|
|
69
|
+
* List of specific colors to interpolate between in order to generate a full lightness scale of the color.
|
|
70
|
+
* @remarks Strings are passed to {@link ChromaJs.valid}
|
|
71
|
+
*/
|
|
72
|
+
colorKeys: CssColor[]
|
|
73
|
+
/**
|
|
74
|
+
* The colorspace in which the key colors will be interpolated.
|
|
75
|
+
*/
|
|
76
|
+
colorspace?: InterpolationColorspace
|
|
77
|
+
/**
|
|
78
|
+
* List of target contrast ratios, or object with named keys for each value.
|
|
79
|
+
* @see {@link RatiosArray}, {@link RatiosObject}
|
|
80
|
+
*/
|
|
81
|
+
ratios: RatiosArray | RatiosObject
|
|
82
|
+
/**
|
|
83
|
+
* Applies bezier smoothing to interpolation.
|
|
84
|
+
*/
|
|
85
|
+
smooth?: boolean
|
|
86
|
+
/**
|
|
87
|
+
* Desired color output format.
|
|
88
|
+
*/
|
|
89
|
+
output?: Colorspace
|
|
90
|
+
saturation?: number
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export class Color implements Required<ColorBase> {
|
|
94
|
+
constructor({
|
|
95
|
+
name, colorKeys, colorspace, ratios, smooth, output, saturation,
|
|
96
|
+
}: ColorBase)
|
|
97
|
+
name: string;
|
|
98
|
+
|
|
99
|
+
colorKeys: CssColor[];
|
|
100
|
+
|
|
101
|
+
colorspace: InterpolationColorspace;
|
|
102
|
+
|
|
103
|
+
ratios: RatiosArray | RatiosObject;
|
|
104
|
+
|
|
105
|
+
smooth: boolean;
|
|
106
|
+
|
|
107
|
+
output: Colorspace;
|
|
108
|
+
|
|
109
|
+
saturation: number;
|
|
110
|
+
|
|
111
|
+
readonly colorScale: ChromaJs.Scale;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export class BackgroundColor extends Color {
|
|
115
|
+
readonly backgroundColorScale: ChromaJs.Scale;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @see {@link https://www.w3.org/TR/WCAG22/#contrast-minimum}
|
|
119
|
+
* @see {@link https://www.w3.org/TR/wcag-3.0/#visual-contrast-of-text}
|
|
120
|
+
*/
|
|
121
|
+
type ContrastFormula = 'wcag2' | 'wcag3';
|
|
122
|
+
type LightnessDistribution = 'linear' | 'polynomial';
|
|
123
|
+
|
|
124
|
+
interface UpdateColorOptions extends Partial<ColorBase> {
|
|
125
|
+
/**
|
|
126
|
+
* The current name of the color to be updated.
|
|
127
|
+
*/
|
|
128
|
+
color: string
|
|
129
|
+
/**
|
|
130
|
+
* A new name for the color.
|
|
131
|
+
*/
|
|
132
|
+
name?: string
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export class Theme implements Required<ThemeBase> {
|
|
136
|
+
constructor({
|
|
137
|
+
colors,
|
|
138
|
+
backgroundColor,
|
|
139
|
+
lightness,
|
|
140
|
+
/**
|
|
141
|
+
* @default 1
|
|
142
|
+
*/
|
|
143
|
+
contrast,
|
|
144
|
+
/**
|
|
145
|
+
* @default 100
|
|
146
|
+
*/
|
|
147
|
+
saturation,
|
|
148
|
+
/**
|
|
149
|
+
* @default 'HEX'
|
|
150
|
+
*/
|
|
151
|
+
output,
|
|
152
|
+
/** @default 'wcag2' */
|
|
153
|
+
formula,
|
|
154
|
+
}: ThemeBase)
|
|
155
|
+
|
|
156
|
+
colors: Color[];
|
|
157
|
+
|
|
158
|
+
backgroundColor: BackgroundColor;
|
|
159
|
+
|
|
160
|
+
lightness: number;
|
|
161
|
+
|
|
162
|
+
contrast: number;
|
|
163
|
+
|
|
164
|
+
output: Colorspace;
|
|
165
|
+
|
|
166
|
+
saturation: number;
|
|
167
|
+
|
|
168
|
+
formula: ContrastFormula;
|
|
169
|
+
|
|
170
|
+
readonly backgroundColorValue: number;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Each color is an object named by user-defined value (eg `name: 'gray'`). `values` array consists of all generated color values for the color, with properties name, contrast, and value.
|
|
174
|
+
* @example
|
|
175
|
+
* [
|
|
176
|
+
{ background: "#e0e0e0" },
|
|
177
|
+
{
|
|
178
|
+
name: 'gray',
|
|
179
|
+
values: [
|
|
180
|
+
{name: "gray100", contrast: 1, value: "#e0e0e0"},
|
|
181
|
+
{name: "gray200", contrast: 2, value: "#a0a0a0"},
|
|
182
|
+
{name: "gray300", contrast: 3, value: "#808080"},
|
|
183
|
+
{name: "gray400", contrast: 4.5, value: "#646464"}
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: 'blue',
|
|
188
|
+
values: [
|
|
189
|
+
{name: "blue100", contrast: 2, value: "#b18cff"},
|
|
190
|
+
{name: "blue200", contrast: 3, value: "#8d63ff"},
|
|
191
|
+
{name: "blue300", contrast: 4.5, value: "#623aff"},
|
|
192
|
+
{name: "blue400", contrast: 8, value: "#1c0ad1"}
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
*/
|
|
197
|
+
readonly contrastColors: [
|
|
198
|
+
ContrastColorBackground,
|
|
199
|
+
...ContrastColor[],
|
|
200
|
+
];
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Simplified format as an object of key-value pairs. Property is equal to the {@link RatiosArray generated} or {@link RatiosObject user-defined name} for each generated value.
|
|
204
|
+
* @example {
|
|
205
|
+
* "gray100": "#e0e0e0",
|
|
206
|
+
* "gray200": "#a0a0a0",
|
|
207
|
+
* "gray300": "#808080",
|
|
208
|
+
* "gray400": "#646464",
|
|
209
|
+
* "blue100": "#b18cff",
|
|
210
|
+
* "blue200": "#8d63ff",
|
|
211
|
+
* "blue300": "#623aff",
|
|
212
|
+
* "blue400": "#1c0ad1"
|
|
213
|
+
* }
|
|
214
|
+
*/
|
|
215
|
+
readonly contrastColorPairs: Record<string, CssColor>;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* All color values in a flat array.
|
|
219
|
+
* @example [ "#e0e0e0", "#a0a0a0", "#808080", "#646464", "#b18cff", "#8d63ff", "#623aff", "#1c0ad1" ]
|
|
220
|
+
*/
|
|
221
|
+
readonly contrastColorValues: CssColor[];
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Add a {@link Color} to the theme
|
|
225
|
+
* @example ```
|
|
226
|
+
* const red = new Color({...})
|
|
227
|
+
* theme.addColor = red;
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
set addColor(arg: Color)
|
|
231
|
+
/**
|
|
232
|
+
* Remove a {@link Color} from an existing theme. Accepts an object with the Color's name and value, or by passing the Color class itself.
|
|
233
|
+
* @example ```
|
|
234
|
+
* // Remove via color name
|
|
235
|
+
theme.removeColor = {name: 'Red'};
|
|
236
|
+
* ```
|
|
237
|
+
* @example ```
|
|
238
|
+
* // Remove via Color class
|
|
239
|
+
* const red = new Color({...})
|
|
240
|
+
* theme.removeColor = red;
|
|
241
|
+
* ```
|
|
242
|
+
*/
|
|
243
|
+
set removeColor(arg: Color | { name: string })
|
|
244
|
+
/**
|
|
245
|
+
* Update a {@link Color} via its setters from the theme. Accepts an object with the name of the color you wish to modify, followed by the property and the new value you wish to modify.
|
|
246
|
+
* @example ```
|
|
247
|
+
* // Change the colors ratios
|
|
248
|
+
* theme.updateColor = {name: 'red', ratios: [3, 4.5, 7]};
|
|
249
|
+
* ```
|
|
250
|
+
* @example ```
|
|
251
|
+
* // Change the colors colorKeys
|
|
252
|
+
* theme.updateColor = {name: 'red', colorKeys: ['#ff0000']};
|
|
253
|
+
* ```
|
|
254
|
+
* @example ```
|
|
255
|
+
* // Change the color's name
|
|
256
|
+
* theme.updateColor = {name: 'red', name: 'Crimson'};
|
|
257
|
+
* ```
|
|
258
|
+
*/
|
|
259
|
+
set updateColor(arg: UpdateColorOptions | UpdateColorOptions[])
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* When passing a flat array of target ratios, the output colors in your Theme will be generated by concatenating the color name (eg "Blue") with numeric increments. Colors with a positive contrast ratio with the base (ie, 2:1) will be named in increments of 100. For example, `gray100`, `gray200`.
|
|
264
|
+
*
|
|
265
|
+
* Colors with a negative contrast ratio with the base (ie -2:1) will be named in increments less than 100 and based on the number of negative values declared. For example, if there are 3 negative values `[-1.4, -1.3, -1.2, 1, 2, 3]`, the name for those values will be incremented by 100/4 (length plus one to avoid a `0` value), such as `gray25`, `gray50`, and `gray75`.
|
|
266
|
+
* @example ```
|
|
267
|
+
* new Color({
|
|
268
|
+
name: 'blue',
|
|
269
|
+
colorKeys: ['#5CDBFF', '#0000FF'],
|
|
270
|
+
colorSpace: 'LCH',
|
|
271
|
+
ratios: [3, 4.5]
|
|
272
|
+
});
|
|
273
|
+
// Returns:
|
|
274
|
+
[
|
|
275
|
+
{
|
|
276
|
+
name: 'blue',
|
|
277
|
+
values: [
|
|
278
|
+
{name: "blue100", contrast: 3, value: "#8d63ff"},
|
|
279
|
+
{name: "blue200", contrast: 4.5, value: "#623aff"}
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
```
|
|
284
|
+
*/
|
|
285
|
+
type RatiosArray = number[];
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* When defining ratios as an object with key-value pairs, you define what name will be output in your Leonardo theme.
|
|
289
|
+
* @example ```
|
|
290
|
+
* new Color({
|
|
291
|
+
name: 'blue',
|
|
292
|
+
colorKeys: ['#5CDBFF', '#0000FF'],
|
|
293
|
+
colorSpace: 'LCH',
|
|
294
|
+
ratios: {
|
|
295
|
+
'blue--largeText': 3,
|
|
296
|
+
'blue--normalText': 4.5
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
// Returns:
|
|
300
|
+
[
|
|
301
|
+
{
|
|
302
|
+
name: 'blue',
|
|
303
|
+
values: [
|
|
304
|
+
{name: "blue--largeText", contrast: 3, value: "#8d63ff"},
|
|
305
|
+
{name: "blue--normalText", contrast: 4.5, value: "#623aff"}
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
]
|
|
309
|
+
* ```
|
|
310
|
+
*/
|
|
311
|
+
type RatiosObject = Record<string, number>;
|
|
312
|
+
|
|
313
|
+
interface ContrastColorBackground {
|
|
314
|
+
background: CssColor
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
interface ContrastColor {
|
|
318
|
+
name: string
|
|
319
|
+
values: ContrastColorValue[]
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
interface ContrastColorValue {
|
|
323
|
+
name: string,
|
|
324
|
+
contrast: number
|
|
325
|
+
value: CssColor
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
interface ThemeBase {
|
|
329
|
+
/**
|
|
330
|
+
* List of {@link Color} classes to generate theme colors for.
|
|
331
|
+
*/
|
|
332
|
+
colors: Color[]
|
|
333
|
+
/**
|
|
334
|
+
* A single {@link BackgroundColor} class is required.
|
|
335
|
+
*/
|
|
336
|
+
backgroundColor: BackgroundColor
|
|
337
|
+
/**
|
|
338
|
+
* Value from 0-100 for desired lightness of generated theme background color (whole number).
|
|
339
|
+
*/
|
|
340
|
+
lightness: number
|
|
341
|
+
/**
|
|
342
|
+
* Multiplier to increase or decrease contrast for all theme colors.
|
|
343
|
+
*/
|
|
344
|
+
contrast?: number
|
|
345
|
+
/**
|
|
346
|
+
* Value from 0-100 for decreasing saturation of all theme colors.
|
|
347
|
+
*/
|
|
348
|
+
saturation?: number
|
|
349
|
+
/**
|
|
350
|
+
* Desired color output format.
|
|
351
|
+
*/
|
|
352
|
+
output?: Colorspace
|
|
353
|
+
formula?: ContrastFormula
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* A valid CSS color.
|
|
358
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/color_value}
|
|
359
|
+
*/
|
|
360
|
+
type CssColor = RgbHexColor | RgbColor | HslColor | HsvColor | HsluvColor | LabColor | LchColor
|
|
361
|
+
| OkLabColor | OkLchColor | Cam02Color | Cam02pColor | CssColorName;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* A string representing a CSS hexadecimal RGB color.
|
|
365
|
+
* @example '#ff0000'
|
|
366
|
+
* @example '#369'
|
|
367
|
+
* @remarks Significantly more permissive than hex colors are, but probably the safest solution given the current limitations of Typescript's string literals.
|
|
368
|
+
*/
|
|
369
|
+
type RgbHexColor = `#${string}`;
|
|
370
|
+
/**
|
|
371
|
+
* A CSS RGB color function.
|
|
372
|
+
* @example 'rgb(255 255 255)'
|
|
373
|
+
*/
|
|
374
|
+
type RgbColor = `rgb(${number} ${number} ${number})`;
|
|
375
|
+
/**
|
|
376
|
+
* A CSS HSL color function.
|
|
377
|
+
* @example 'hsl(360deg 0% 100%)'
|
|
378
|
+
*/
|
|
379
|
+
type HslColor = `hsl(${Degrees} ${Percent} ${Percent})`;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* @example 'hsv(360deg 0% 100%)'
|
|
383
|
+
*/
|
|
384
|
+
type HsvColor = `hsv(${Degrees} ${Percent} ${Percent})`;
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* @example 'hsluv(360 0 100)'
|
|
388
|
+
*/
|
|
389
|
+
type HsluvColor = `hsluv(${number} ${number} ${number})`;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* @example 'lab(100% 0 0)'
|
|
393
|
+
*/
|
|
394
|
+
type LabColor = `lab(${Percent} ${number} ${number})`;
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* @example 'lch(100% 0 360deg)'
|
|
398
|
+
*/
|
|
399
|
+
type LchColor = `lch(${Percent} ${number} ${Degrees})`;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* @example 'oklab(100% 0 0)'
|
|
403
|
+
*/
|
|
404
|
+
type OkLabColor = `oklab(${Percent} ${number} ${number})`;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* @example 'oklch(100% 0 360deg)'
|
|
408
|
+
*/
|
|
409
|
+
type OkLchColor = `oklch(${Percent} ${number} ${Degrees})`;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* @example 'jab(100% 0 0)'
|
|
413
|
+
*/
|
|
414
|
+
type Cam02Color = `jab(${Percent} ${number} ${number})`;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* @example 'jch(100% 0 360deg)'
|
|
418
|
+
*/
|
|
419
|
+
type Cam02pColor = `jch(${Percent} ${number} ${Degrees})`;
|
|
420
|
+
type Percent = `${number}%`;
|
|
421
|
+
type Degrees = `${number}deg`;
|
|
422
|
+
|
|
423
|
+
type CssColorName = 'aliceblue' |
|
|
424
|
+
'antiquewhite' |
|
|
425
|
+
'aqua' |
|
|
426
|
+
'aquamarine' |
|
|
427
|
+
'azure' |
|
|
428
|
+
'beige' |
|
|
429
|
+
'bisque' |
|
|
430
|
+
'black' |
|
|
431
|
+
'blanchedalmond' |
|
|
432
|
+
'blue' |
|
|
433
|
+
'blueviolet' |
|
|
434
|
+
'brown' |
|
|
435
|
+
'burlywood' |
|
|
436
|
+
'cadetblue' |
|
|
437
|
+
'chartreuse' |
|
|
438
|
+
'chocolate' |
|
|
439
|
+
'coral' |
|
|
440
|
+
'cornflowerblue' |
|
|
441
|
+
'cornsilk' |
|
|
442
|
+
'crimson' |
|
|
443
|
+
'cyan' |
|
|
444
|
+
'darkblue' |
|
|
445
|
+
'darkcyan' |
|
|
446
|
+
'darkgoldenrod' |
|
|
447
|
+
'darkgray' |
|
|
448
|
+
'darkgreen' |
|
|
449
|
+
'darkgrey' |
|
|
450
|
+
'darkkhaki' |
|
|
451
|
+
'darkmagenta' |
|
|
452
|
+
'darkolivegreen' |
|
|
453
|
+
'darkorange' |
|
|
454
|
+
'darkorchid' |
|
|
455
|
+
'darkred' |
|
|
456
|
+
'darksalmon' |
|
|
457
|
+
'darkseagreen' |
|
|
458
|
+
'darkslateblue' |
|
|
459
|
+
'darkslategray' |
|
|
460
|
+
'darkslategrey' |
|
|
461
|
+
'darkturquoise' |
|
|
462
|
+
'darkviolet' |
|
|
463
|
+
'deeppink' |
|
|
464
|
+
'deepskyblue' |
|
|
465
|
+
'dimgray' |
|
|
466
|
+
'dimgrey' |
|
|
467
|
+
'dodgerblue' |
|
|
468
|
+
'firebrick' |
|
|
469
|
+
'floralwhite' |
|
|
470
|
+
'forestgreen' |
|
|
471
|
+
'fuchsia' |
|
|
472
|
+
'gainsboro' |
|
|
473
|
+
'ghostwhite' |
|
|
474
|
+
'goldenrod' |
|
|
475
|
+
'gold' |
|
|
476
|
+
'gray' |
|
|
477
|
+
'green' |
|
|
478
|
+
'greenyellow' |
|
|
479
|
+
'grey' |
|
|
480
|
+
'honeydew' |
|
|
481
|
+
'hotpink' |
|
|
482
|
+
'indianred' |
|
|
483
|
+
'indigo' |
|
|
484
|
+
'ivory' |
|
|
485
|
+
'khaki' |
|
|
486
|
+
'lavenderblush' |
|
|
487
|
+
'lavender' |
|
|
488
|
+
'lawngreen' |
|
|
489
|
+
'lemonchiffon' |
|
|
490
|
+
'lightblue' |
|
|
491
|
+
'lightcoral' |
|
|
492
|
+
'lightcyan' |
|
|
493
|
+
'lightgoldenrodyellow' |
|
|
494
|
+
'lightgray' |
|
|
495
|
+
'lightgreen' |
|
|
496
|
+
'lightgrey' |
|
|
497
|
+
'lightpink' |
|
|
498
|
+
'lightsalmon' |
|
|
499
|
+
'lightseagreen' |
|
|
500
|
+
'lightskyblue' |
|
|
501
|
+
'lightslategray' |
|
|
502
|
+
'lightslategrey' |
|
|
503
|
+
'lightsteelblue' |
|
|
504
|
+
'lightyellow' |
|
|
505
|
+
'lime' |
|
|
506
|
+
'limegreen' |
|
|
507
|
+
'linen' |
|
|
508
|
+
'magenta' |
|
|
509
|
+
'maroon' |
|
|
510
|
+
'mediumaquamarine' |
|
|
511
|
+
'mediumblue' |
|
|
512
|
+
'mediumorchid' |
|
|
513
|
+
'mediumpurple' |
|
|
514
|
+
'mediumseagreen' |
|
|
515
|
+
'mediumslateblue' |
|
|
516
|
+
'mediumspringgreen' |
|
|
517
|
+
'mediumturquoise' |
|
|
518
|
+
'mediumvioletred' |
|
|
519
|
+
'midnightblue' |
|
|
520
|
+
'mintcream' |
|
|
521
|
+
'mistyrose' |
|
|
522
|
+
'moccasin' |
|
|
523
|
+
'navajowhite' |
|
|
524
|
+
'navy' |
|
|
525
|
+
'oldlace' |
|
|
526
|
+
'olive' |
|
|
527
|
+
'olivedrab' |
|
|
528
|
+
'orange' |
|
|
529
|
+
'orangered' |
|
|
530
|
+
'orchid' |
|
|
531
|
+
'palegoldenrod' |
|
|
532
|
+
'palegreen' |
|
|
533
|
+
'paleturquoise' |
|
|
534
|
+
'palevioletred' |
|
|
535
|
+
'papayawhip' |
|
|
536
|
+
'peachpuff' |
|
|
537
|
+
'peru' |
|
|
538
|
+
'pink' |
|
|
539
|
+
'plum' |
|
|
540
|
+
'powderblue' |
|
|
541
|
+
'purple' |
|
|
542
|
+
'rebeccapurple' |
|
|
543
|
+
'red' |
|
|
544
|
+
'rosybrown' |
|
|
545
|
+
'royalblue' |
|
|
546
|
+
'saddlebrown' |
|
|
547
|
+
'salmon' |
|
|
548
|
+
'sandybrown' |
|
|
549
|
+
'seagreen' |
|
|
550
|
+
'seashell' |
|
|
551
|
+
'sienna' |
|
|
552
|
+
'silver' |
|
|
553
|
+
'skyblue' |
|
|
554
|
+
'slateblue' |
|
|
555
|
+
'slategray' |
|
|
556
|
+
'slategrey' |
|
|
557
|
+
'snow' |
|
|
558
|
+
'springgreen' |
|
|
559
|
+
'steelblue' |
|
|
560
|
+
'tan' |
|
|
561
|
+
'teal' |
|
|
562
|
+
'thistle' |
|
|
563
|
+
'tomato' |
|
|
564
|
+
'turquoise' |
|
|
565
|
+
'violet' |
|
|
566
|
+
'wheat' |
|
|
567
|
+
'white' |
|
|
568
|
+
'whitesmoke' |
|
|
569
|
+
'yellow' |
|
|
570
|
+
'yellowgreen';
|
|
571
|
+
}
|
|
@@ -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 { CSSInterpolation
|
|
13
|
+
import { CSSInterpolation } from '@mui/material';
|
|
14
|
+
import { ThemeOptions } from '@okta/odyssey-react-mui';
|
|
14
15
|
import { merge } from 'lodash';
|
|
15
16
|
|
|
16
17
|
import { cssInterpolate } from './cssInterpolate';
|
|
@@ -77,6 +78,36 @@ export const mergeThemes = (
|
|
|
77
78
|
// @ts-expect-error FIXME CSSInterpolation may not be CSSObject
|
|
78
79
|
...resolve(config.styleOverrides?.input, options),
|
|
79
80
|
}),
|
|
81
|
+
adornedEnd: (options: Record<string, unknown>) => ({
|
|
82
|
+
// @ts-expect-error FIXME CSSInterpolation may not be CSSObject
|
|
83
|
+
...resolve(prev.components?.[component]?.styleOverrides?.adornedEnd, options),
|
|
84
|
+
// @ts-expect-error FIXME CSSInterpolation may not be CSSObject
|
|
85
|
+
...resolve(config.styleOverrides?.adornedEnd, options),
|
|
86
|
+
}),
|
|
87
|
+
adornedStart: (options: Record<string, unknown>) => ({
|
|
88
|
+
// @ts-expect-error FIXME CSSInterpolation may not be CSSObject
|
|
89
|
+
...resolve(prev.components?.[component]?.styleOverrides?.adornedStart, options),
|
|
90
|
+
// @ts-expect-error FIXME CSSInterpolation may not be CSSObject
|
|
91
|
+
...resolve(config.styleOverrides?.adornedStart, options),
|
|
92
|
+
}),
|
|
93
|
+
label: (options: Record<string, unknown>) => ({
|
|
94
|
+
// @ts-expect-error FIXME CSSInterpolation may not be CSSObject
|
|
95
|
+
...resolve(prev.components?.[component]?.styleOverrides?.label, options),
|
|
96
|
+
// @ts-expect-error FIXME CSSInterpolation may not be CSSObject
|
|
97
|
+
...resolve(config.styleOverrides?.label, options),
|
|
98
|
+
}),
|
|
99
|
+
button: (options: Record<string, unknown>) => ({
|
|
100
|
+
// @ts-expect-error FIXME CSSInterpolation may not be CSSObject
|
|
101
|
+
...resolve(prev.components?.[component]?.styleOverrides?.button, options),
|
|
102
|
+
// @ts-expect-error FIXME CSSInterpolation may not be CSSObject
|
|
103
|
+
...resolve(config.styleOverrides?.button, options),
|
|
104
|
+
}),
|
|
105
|
+
select: (options: Record<string, unknown>) => ({
|
|
106
|
+
// @ts-expect-error FIXME CSSInterpolation may not be CSSObject
|
|
107
|
+
...resolve(prev.components?.[component]?.styleOverrides?.select, options),
|
|
108
|
+
// @ts-expect-error FIXME CSSInterpolation may not be CSSObject
|
|
109
|
+
...resolve(config.styleOverrides?.select, options),
|
|
110
|
+
}),
|
|
80
111
|
},
|
|
81
112
|
},
|
|
82
113
|
},
|