@okta/odyssey-react-mui 1.9.4 → 1.9.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okta/odyssey-react-mui",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "description": "React MUI components for Odyssey, Okta's design system",
5
5
  "author": "Okta, Inc.",
6
6
  "license": "Apache-2.0",
@@ -51,7 +51,7 @@
51
51
  "@mui/system": "^5.14.9",
52
52
  "@mui/utils": "^5.11.2",
53
53
  "@mui/x-date-pickers": "^5.0.15",
54
- "@okta/odyssey-design-tokens": "1.9.4",
54
+ "@okta/odyssey-design-tokens": "1.9.5",
55
55
  "date-fns": "^2.30.0",
56
56
  "i18next": "^23.5.1",
57
57
  "material-react-table": "^2.0.2",
@@ -63,5 +63,5 @@
63
63
  "react": ">=17 <19",
64
64
  "react-dom": ">=17 <19"
65
65
  },
66
- "gitHead": "c2cfdc3048a0c8a71d2728f9b1a81162db405a32"
66
+ "gitHead": "5e04a06a8f989e16d12c07fd90f4e3023a6ca02d"
67
67
  }
@@ -44,14 +44,30 @@ export type OdysseyTranslationProviderProps<
44
44
  translationOverrides?: TranslationOverrides<SupportedLanguages>;
45
45
  };
46
46
 
47
+ const formatLanguageCodeToHyphenated = <SupportedLanguages extends string>(
48
+ languageCode: OdysseyTranslationProviderProps<SupportedLanguages>["languageCode"]
49
+ ) => languageCode?.replaceAll("_", "-");
50
+
47
51
  export const OdysseyTranslationProvider = <SupportedLanguages extends string>({
48
52
  children,
49
53
  languageCode,
50
54
  translationOverrides,
51
55
  }: OdysseyTranslationProviderProps<SupportedLanguages>) => {
52
56
  useEffect(() => {
57
+ const normalizedLanguageCode =
58
+ formatLanguageCodeToHyphenated<SupportedLanguages>(languageCode);
59
+
60
+ const changeHtmlElementLanguageAttribute = () => {
61
+ window.document.documentElement.setAttribute(
62
+ "lang",
63
+ normalizedLanguageCode || "en"
64
+ );
65
+ };
53
66
  // Defaults to the browser's language if available otherwise `en` will be used
54
- i18n.changeLanguage(languageCode || window.navigator.language);
67
+ i18n.changeLanguage(
68
+ normalizedLanguageCode || window.navigator.language,
69
+ changeHtmlElementLanguageAttribute
70
+ );
55
71
  }, [languageCode]);
56
72
 
57
73
  useEffect(() => {
@@ -972,6 +972,32 @@ export const components = ({
972
972
  html {
973
973
  font-size: calc((${themeParam.typography.fontSize} / 16) * 100%);
974
974
  }
975
+
976
+ :not(code) &, :not(pre) & {
977
+ :lang(el) {
978
+ font-family: 'Noto Sans', sans-serif;
979
+ }
980
+
981
+ :lang(ja) {
982
+ font-family: 'Noto Sans JP', sans-serif;
983
+ }
984
+
985
+ :lang(ko) {
986
+ font-family: 'Noto Sans KR', sans-serif;
987
+ }
988
+
989
+ :lang(th) {
990
+ font-family: 'Noto Sans Thai', sans-serif;
991
+ }
992
+
993
+ :lang(zh-CN) {
994
+ font-family: 'Noto Sans SC', sans-serif;
995
+ }
996
+
997
+ :lang(zh-TW) {
998
+ font-family: 'Noto Sans TC', sans-serif;
999
+ }
1000
+ }
975
1001
  `,
976
1002
  },
977
1003
  MuiScopedCssBaseline: {
@@ -2115,6 +2141,8 @@ export const components = ({
2115
2141
 
2116
2142
  ...(ownerState.disabled && {
2117
2143
  color: odysseyTokens.TypographyColorDisabled,
2144
+ // !important used to override more specific .Mui-Disabled class selector
2145
+ opacity: "1 !important",
2118
2146
  }),
2119
2147
 
2120
2148
  ...(ownerState.wrapped && {