@okta/odyssey-react-mui 1.14.1 → 1.14.2
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/CHANGELOG.md +6 -0
- package/dist/OdysseyProvider.js +0 -2
- package/dist/OdysseyProvider.js.map +1 -1
- package/dist/OdysseyThemeProvider.js +1 -28
- package/dist/OdysseyThemeProvider.js.map +1 -1
- package/dist/src/OdysseyProvider.d.ts.map +1 -1
- package/dist/src/OdysseyThemeProvider.d.ts +1 -3
- package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/OdysseyProvider.tsx +0 -2
- package/src/OdysseyThemeProvider.tsx +5 -32
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.14.2](https://github.com/okta/odyssey/compare/v1.14.1...v1.14.2) (2024-02-27)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- removed OdysseyCacheProvider from OdysseyThemeProvider ([#2110](https://github.com/okta/odyssey/issues/2110)) ([9106341](https://github.com/okta/odyssey/commit/9106341d37fc57d8c2edf57db9683acdb065c73e))
|
|
11
|
+
|
|
6
12
|
## [1.14.1](https://github.com/okta/odyssey/compare/v1.14.0...v1.14.1) (2024-02-26)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @okta/odyssey-react-mui
|
package/dist/OdysseyProvider.js
CHANGED
|
@@ -33,10 +33,8 @@ const OdysseyProvider = ({
|
|
|
33
33
|
stylisPlugins: stylisPlugins,
|
|
34
34
|
children: _jsx(OdysseyThemeProvider, {
|
|
35
35
|
designTokensOverride: designTokensOverride,
|
|
36
|
-
emotionRoot: emotionRoot,
|
|
37
36
|
shadowDomElement: shadowDomElement,
|
|
38
37
|
themeOverride: themeOverride,
|
|
39
|
-
withCache: false,
|
|
40
38
|
children: _jsx(_ScopedCssBaseline, {
|
|
41
39
|
children: _jsx(OdysseyTranslationProvider, {
|
|
42
40
|
languageCode: languageCode,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OdysseyProvider.js","names":["memo","OdysseyCacheProvider","OdysseyThemeProvider","OdysseyTranslationProvider","jsx","_jsx","OdysseyProvider","children","designTokensOverride","emotionRoot","shadowDomElement","languageCode","nonce","stylisPlugins","themeOverride","translationOverrides","
|
|
1
|
+
{"version":3,"file":"OdysseyProvider.js","names":["memo","OdysseyCacheProvider","OdysseyThemeProvider","OdysseyTranslationProvider","jsx","_jsx","OdysseyProvider","children","designTokensOverride","emotionRoot","shadowDomElement","languageCode","nonce","stylisPlugins","themeOverride","translationOverrides","_ScopedCssBaseline","MemoizedThemeProvider"],"sources":["../src/OdysseyProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, ReactNode } from \"react\";\nimport { ScopedCssBaseline } from \"@mui/material\";\n\nimport {\n OdysseyCacheProvider,\n OdysseyCacheProviderProps,\n} from \"./OdysseyCacheProvider\";\nimport {\n OdysseyThemeProvider,\n OdysseyThemeProviderProps,\n} from \"./OdysseyThemeProvider\";\nimport {\n OdysseyTranslationProvider,\n OdysseyTranslationProviderProps,\n} from \"./OdysseyTranslationProvider\";\nimport { DefaultSupportedLanguages } from \"./OdysseyTranslationProvider.types\";\n\nexport type OdysseyProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = OdysseyCacheProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps<SupportedLanguages> & {\n children: ReactNode;\n };\n\nconst OdysseyProvider = <SupportedLanguages extends string>({\n children,\n designTokensOverride,\n emotionRoot,\n shadowDomElement,\n languageCode,\n nonce,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps<SupportedLanguages>) => (\n <OdysseyCacheProvider\n nonce={nonce}\n emotionRoot={emotionRoot}\n shadowDomElement={shadowDomElement}\n stylisPlugins={stylisPlugins}\n >\n <OdysseyThemeProvider\n designTokensOverride={designTokensOverride}\n shadowDomElement={shadowDomElement}\n themeOverride={themeOverride}\n >\n <ScopedCssBaseline>\n <OdysseyTranslationProvider<SupportedLanguages>\n languageCode={languageCode}\n translationOverrides={translationOverrides}\n >\n {children}\n </OdysseyTranslationProvider>\n </ScopedCssBaseline>\n </OdysseyThemeProvider>\n </OdysseyCacheProvider>\n);\n\nconst MemoizedThemeProvider = memo(OdysseyProvider) as typeof OdysseyProvider;\n\nexport { MemoizedThemeProvider as OdysseyProvider };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAAC,SAItCC,oBAAoB;AAAA,SAIpBC,oBAAoB;AAAA,SAIpBC,0BAA0B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAa5B,MAAMC,eAAe,GAAGA,CAAoC;EAC1DC,QAAQ;EACRC,oBAAoB;EACpBC,WAAW;EACXC,gBAAgB;EAChBC,YAAY;EACZC,KAAK;EACLC,aAAa;EACbC,aAAa;EACbC;AACwC,CAAC,KACzCV,IAAA,CAACJ,oBAAoB;EACnBW,KAAK,EAAEA,KAAM;EACbH,WAAW,EAAEA,WAAY;EACzBC,gBAAgB,EAAEA,gBAAiB;EACnCG,aAAa,EAAEA,aAAc;EAAAN,QAAA,EAE7BF,IAAA,CAACH,oBAAoB;IACnBM,oBAAoB,EAAEA,oBAAqB;IAC3CE,gBAAgB,EAAEA,gBAAiB;IACnCI,aAAa,EAAEA,aAAc;IAAAP,QAAA,EAE7BF,IAAA,CAAAW,kBAAA;MAAAT,QAAA,EACEF,IAAA,CAACF,0BAA0B;QACzBQ,YAAY,EAAEA,YAAa;QAC3BI,oBAAoB,EAAEA,oBAAqB;QAAAR,QAAA,EAE1CA;MAAQ,CACiB;IAAC,CACZ;EAAC,CACA;AAAC,CACH,CACvB;AAED,MAAMU,qBAAqB,GAAGjB,IAAI,CAACM,eAAe,CAA2B;AAE7E,SAASW,qBAAqB,IAAIX,eAAe"}
|
|
@@ -16,17 +16,12 @@ import { deepmerge } from "@mui/utils";
|
|
|
16
16
|
import { createOdysseyMuiTheme } from "./theme/index.js";
|
|
17
17
|
import * as Tokens from "@okta/odyssey-design-tokens";
|
|
18
18
|
import { OdysseyDesignTokensContext } from "./OdysseyDesignTokensContext.js";
|
|
19
|
-
import { CacheProvider } from "@emotion/react";
|
|
20
|
-
import createCache from "@emotion/cache";
|
|
21
|
-
import { useUniqueAlphabeticalId } from "./useUniqueAlphabeticalId.js";
|
|
22
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
20
|
const OdysseyThemeProvider = ({
|
|
24
21
|
children,
|
|
25
22
|
designTokensOverride,
|
|
26
|
-
emotionRoot,
|
|
27
23
|
shadowDomElement,
|
|
28
|
-
themeOverride
|
|
29
|
-
withCache = true
|
|
24
|
+
themeOverride
|
|
30
25
|
}) => {
|
|
31
26
|
const odysseyTokens = useMemo(() => ({
|
|
32
27
|
...Tokens,
|
|
@@ -37,28 +32,6 @@ const OdysseyThemeProvider = ({
|
|
|
37
32
|
shadowDomElement
|
|
38
33
|
}), [odysseyTokens, shadowDomElement]);
|
|
39
34
|
const customOdysseyTheme = useMemo(() => themeOverride && createTheme(deepmerge(odysseyTheme, themeOverride)), [odysseyTheme, themeOverride]);
|
|
40
|
-
const uniqueAlphabeticalId = useUniqueAlphabeticalId();
|
|
41
|
-
const cache = useMemo(() => createCache({
|
|
42
|
-
...(emotionRoot && {
|
|
43
|
-
container: emotionRoot
|
|
44
|
-
}),
|
|
45
|
-
key: uniqueAlphabeticalId,
|
|
46
|
-
prepend: true,
|
|
47
|
-
nonce: window.cspNonce,
|
|
48
|
-
speedy: false
|
|
49
|
-
}), [emotionRoot, uniqueAlphabeticalId]);
|
|
50
|
-
if (withCache) {
|
|
51
|
-
return _jsx(CacheProvider, {
|
|
52
|
-
value: cache,
|
|
53
|
-
children: _jsx(MuiThemeProvider, {
|
|
54
|
-
theme: customOdysseyTheme ?? odysseyTheme,
|
|
55
|
-
children: _jsx(OdysseyDesignTokensContext.Provider, {
|
|
56
|
-
value: odysseyTokens,
|
|
57
|
-
children: children
|
|
58
|
-
})
|
|
59
|
-
})
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
35
|
return _jsx(MuiThemeProvider, {
|
|
63
36
|
theme: customOdysseyTheme ?? odysseyTheme,
|
|
64
37
|
children: _jsx(OdysseyDesignTokensContext.Provider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OdysseyThemeProvider.js","names":["createTheme","ThemeProvider","MuiThemeProvider","memo","useMemo","deepmerge","createOdysseyMuiTheme","Tokens","OdysseyDesignTokensContext","
|
|
1
|
+
{"version":3,"file":"OdysseyThemeProvider.js","names":["createTheme","ThemeProvider","MuiThemeProvider","memo","useMemo","deepmerge","createOdysseyMuiTheme","Tokens","OdysseyDesignTokensContext","jsx","_jsx","OdysseyThemeProvider","children","designTokensOverride","shadowDomElement","themeOverride","odysseyTokens","odysseyTheme","customOdysseyTheme","theme","Provider","value","MemoizedOdysseyThemeProvider"],"sources":["../src/OdysseyThemeProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createTheme,\n ThemeProvider as MuiThemeProvider,\n} from \"@mui/material/styles\";\nimport { memo, ReactNode, useMemo } from \"react\";\n\nimport { ThemeOptions } from \"@mui/material\";\nimport { deepmerge } from \"@mui/utils\";\nimport { createOdysseyMuiTheme, DesignTokensOverride } from \"./theme\";\nimport * as Tokens from \"@okta/odyssey-design-tokens\";\nimport { OdysseyDesignTokensContext } from \"./OdysseyDesignTokensContext\";\n\nexport type OdysseyThemeProviderProps = {\n children: ReactNode;\n designTokensOverride?: DesignTokensOverride;\n shadowDomElement?: HTMLDivElement | HTMLElement | undefined;\n themeOverride?: ThemeOptions;\n};\n\n/**\n * This function doesn't include the Emotion Cache or Translations. You should probably be using `OdysseyProvider`.\n *\n * Some teams have a need to wrap separately (SIW), but most teams will never need to use this explicitly.\n */\nconst OdysseyThemeProvider = ({\n children,\n designTokensOverride,\n shadowDomElement,\n themeOverride,\n}: OdysseyThemeProviderProps) => {\n const odysseyTokens = useMemo(\n () => ({ ...Tokens, ...designTokensOverride }),\n [designTokensOverride],\n );\n const odysseyTheme = useMemo(\n () =>\n createOdysseyMuiTheme({\n odysseyTokens,\n shadowDomElement,\n }),\n [odysseyTokens, shadowDomElement],\n );\n\n const customOdysseyTheme = useMemo(\n () => themeOverride && createTheme(deepmerge(odysseyTheme, themeOverride)),\n [odysseyTheme, themeOverride],\n );\n\n return (\n <MuiThemeProvider theme={customOdysseyTheme ?? odysseyTheme}>\n <OdysseyDesignTokensContext.Provider value={odysseyTokens}>\n {children}\n </OdysseyDesignTokensContext.Provider>\n </MuiThemeProvider>\n );\n};\n\nconst MemoizedOdysseyThemeProvider = memo(OdysseyThemeProvider);\n\nexport { MemoizedOdysseyThemeProvider as OdysseyThemePro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"OdysseyProvider.d.ts","sourceRoot":"","sources":["../../src/OdysseyProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxC,OAAO,EAEL,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,+BAA+B,EAChC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAE/E,MAAM,MAAM,oBAAoB,CAC9B,kBAAkB,SAAS,MAAM,GAAG,yBAAyB,IAC3D,yBAAyB,GAC3B,yBAAyB,GACzB,+BAA+B,CAAC,kBAAkB,CAAC,GAAG;IACpD,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"OdysseyProvider.d.ts","sourceRoot":"","sources":["../../src/OdysseyProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxC,OAAO,EAEL,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,+BAA+B,EAChC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAE/E,MAAM,MAAM,oBAAoB,CAC9B,kBAAkB,SAAS,MAAM,GAAG,yBAAyB,IAC3D,yBAAyB,GAC3B,yBAAyB,GACzB,+BAA+B,CAAC,kBAAkB,CAAC,GAAG;IACpD,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAoCJ,QAAA,MAAM,qBAAqB,uQAAkD,CAAC;AAE9E,OAAO,EAAE,qBAAqB,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -15,11 +15,9 @@ import { DesignTokensOverride } from "./theme";
|
|
|
15
15
|
export type OdysseyThemeProviderProps = {
|
|
16
16
|
children: ReactNode;
|
|
17
17
|
designTokensOverride?: DesignTokensOverride;
|
|
18
|
-
emotionRoot?: HTMLStyleElement;
|
|
19
18
|
shadowDomElement?: HTMLDivElement | HTMLElement | undefined;
|
|
20
19
|
themeOverride?: ThemeOptions;
|
|
21
|
-
withCache?: boolean;
|
|
22
20
|
};
|
|
23
|
-
declare const MemoizedOdysseyThemeProvider: import("react").MemoExoticComponent<({ children, designTokensOverride,
|
|
21
|
+
declare const MemoizedOdysseyThemeProvider: import("react").MemoExoticComponent<({ children, designTokensOverride, shadowDomElement, themeOverride, }: OdysseyThemeProviderProps) => import("react/jsx-runtime").JSX.Element>;
|
|
24
22
|
export { MemoizedOdysseyThemeProvider as OdysseyThemeProvider };
|
|
25
23
|
//# sourceMappingURL=OdysseyThemeProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OdysseyThemeProvider.d.ts","sourceRoot":"","sources":["../../src/OdysseyThemeProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,EAAQ,SAAS,EAAW,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAyB,oBAAoB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"OdysseyThemeProvider.d.ts","sourceRoot":"","sources":["../../src/OdysseyThemeProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,EAAQ,SAAS,EAAW,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAyB,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAItE,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,gBAAgB,CAAC,EAAE,cAAc,GAAG,WAAW,GAAG,SAAS,CAAC;IAC5D,aAAa,CAAC,EAAE,YAAY,CAAC;CAC9B,CAAC;AAwCF,QAAA,MAAM,4BAA4B,6GA5B/B,yBAAyB,6CA4BmC,CAAC;AAEhE,OAAO,EAAE,4BAA4B,IAAI,oBAAoB,EAAE,CAAC"}
|