@okta/odyssey-react-mui 1.9.0 → 1.9.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 CHANGED
@@ -3,6 +3,18 @@
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.9.2](https://github.com/okta/odyssey/compare/v1.9.1...v1.9.2) (2023-12-08)
7
+
8
+ ### Bug Fixes
9
+
10
+ - add back props removed from odyssey cache provider ([#2066](https://github.com/okta/odyssey/issues/2066)) ([782475c](https://github.com/okta/odyssey/commit/782475cc222069f0417b08cb40ed57d298903b1d))
11
+
12
+ ## [1.9.1](https://github.com/okta/odyssey/compare/v1.9.0...v1.9.1) (2023-12-05)
13
+
14
+ ### Bug Fixes
15
+
16
+ - fixed typing for shadow root element. updated tests to reflect changes ([#2048](https://github.com/okta/odyssey/issues/2048)) ([3ae92a1](https://github.com/okta/odyssey/commit/3ae92a1b91451c6bb9bb2a512571fbbe4b833022))
17
+
6
18
  ## [1.9.0](https://github.com/okta/odyssey/compare/v1.8.2...v1.9.0) (2023-12-04)
7
19
 
8
20
  ### Features
@@ -11,31 +11,32 @@
11
11
  */
12
12
 
13
13
  import createCache from "@emotion/cache";
14
- import { CacheProvider } from "@emotion/react";
15
14
  import { memo, useMemo } from "react";
16
15
  import { useUniqueAlphabeticalId } from "./useUniqueAlphabeticalId.js";
16
+ import { CacheProvider } from "@emotion/react";
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
18
  const OdysseyCacheProvider = _ref => {
19
19
  let {
20
20
  children,
21
+ emotionRoot,
21
22
  nonce,
22
- shadowDomElement,
23
23
  stylisPlugins
24
24
  } = _ref;
25
25
  const uniqueAlphabeticalId = useUniqueAlphabeticalId();
26
- const emotionRootElement = useMemo(() => {
27
- const emotionRootElement = document.createElement("div");
28
- emotionRootElement.setAttribute("data-emotion-root", "data-emotion-root");
29
- shadowDomElement?.prepend?.(emotionRootElement);
30
- return emotionRootElement;
31
- }, [shadowDomElement]);
32
- const emotionCache = useMemo(() => createCache({
33
- container: emotionRootElement,
34
- key: uniqueAlphabeticalId,
35
- nonce: nonce || window.cspNonce,
36
- prepend: Boolean(emotionRootElement),
37
- stylisPlugins
38
- }), [emotionRootElement, nonce, stylisPlugins, uniqueAlphabeticalId]);
26
+ const emotionCache = useMemo(() => {
27
+ return createCache({
28
+ ...(emotionRoot && {
29
+ container: emotionRoot
30
+ }),
31
+ key: uniqueAlphabeticalId,
32
+ nonce: nonce ?? window.cspNonce,
33
+ prepend: true,
34
+ speedy: false,
35
+ ...(stylisPlugins && {
36
+ stylisPlugins
37
+ })
38
+ });
39
+ }, [emotionRoot, nonce, stylisPlugins, uniqueAlphabeticalId]);
39
40
  return _jsx(CacheProvider, {
40
41
  value: emotionCache,
41
42
  children: children
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyCacheProvider.js","names":["createCache","CacheProvider","memo","useMemo","useUniqueAlphabeticalId","jsx","_jsx","OdysseyCacheProvider","_ref","children","nonce","shadowDomElement","stylisPlugins","uniqueAlphabeticalId","emotionRootElement","document","createElement","setAttribute","prepend","emotionCache","container","key","window","cspNonce","Boolean","value","MemoizedOdysseyCacheProvider","displayName"],"sources":["../src/OdysseyCacheProvider.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\ndeclare global {\n interface Window {\n cspNonce: string;\n }\n}\n\nimport createCache, { StylisPlugin } from \"@emotion/cache\";\nimport { CacheProvider } from \"@emotion/react\";\nimport { memo, ReactNode, useMemo } from \"react\";\n\nimport { useUniqueAlphabeticalId } from \"./useUniqueAlphabeticalId\";\n\nexport type OdysseyCacheProviderProps = {\n children: ReactNode;\n /**\n * Emotion renders into this HTML element.\n * When enabling this prop, Emotion renders at the top of this component rather than the bottom like it does in the HTML `<head>`.\n */\n nonce?: string;\n shadowDomElement?: HTMLDivElement;\n stylisPlugins?: StylisPlugin[];\n};\n\nconst OdysseyCacheProvider = ({\n children,\n nonce,\n shadowDomElement,\n stylisPlugins,\n}: OdysseyCacheProviderProps) => {\n const uniqueAlphabeticalId = useUniqueAlphabeticalId();\n\n const emotionRootElement = useMemo(() => {\n const emotionRootElement = document.createElement(\"div\");\n\n emotionRootElement.setAttribute(\"data-emotion-root\", \"data-emotion-root\");\n\n shadowDomElement?.prepend?.(emotionRootElement);\n\n return emotionRootElement;\n }, [shadowDomElement]);\n\n const emotionCache = useMemo(\n () =>\n createCache({\n container: emotionRootElement,\n key: uniqueAlphabeticalId,\n nonce: nonce || window.cspNonce,\n prepend: Boolean(emotionRootElement),\n stylisPlugins,\n }),\n [emotionRootElement, nonce, stylisPlugins, uniqueAlphabeticalId]\n );\n\n return <CacheProvider value={emotionCache}>{children}</CacheProvider>;\n};\n\nconst MemoizedOdysseyCacheProvider = memo(OdysseyCacheProvider);\nMemoizedOdysseyCacheProvider.displayName = \"OdysseyCacheProvider\";\n\nexport { MemoizedOdysseyCacheProvider as OdysseyCacheProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,WAAW,MAAwB,gBAAgB;AAC1D,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,IAAI,EAAaC,OAAO,QAAQ,OAAO;AAAC,SAExCC,uBAAuB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAahC,MAAMC,oBAAoB,GAAGC,IAAA,IAKI;EAAA,IALH;IAC5BC,QAAQ;IACRC,KAAK;IACLC,gBAAgB;IAChBC;EACyB,CAAC,GAAAJ,IAAA;EAC1B,MAAMK,oBAAoB,GAAGT,uBAAuB,CAAC,CAAC;EAEtD,MAAMU,kBAAkB,GAAGX,OAAO,CAAC,MAAM;IACvC,MAAMW,kBAAkB,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;IAExDF,kBAAkB,CAACG,YAAY,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAEzEN,gBAAgB,EAAEO,OAAO,GAAGJ,kBAAkB,CAAC;IAE/C,OAAOA,kBAAkB;EAC3B,CAAC,EAAE,CAACH,gBAAgB,CAAC,CAAC;EAEtB,MAAMQ,YAAY,GAAGhB,OAAO,CAC1B,MACEH,WAAW,CAAC;IACVoB,SAAS,EAAEN,kBAAkB;IAC7BO,GAAG,EAAER,oBAAoB;IACzBH,KAAK,EAAEA,KAAK,IAAIY,MAAM,CAACC,QAAQ;IAC/BL,OAAO,EAAEM,OAAO,CAACV,kBAAkB,CAAC;IACpCF;EACF,CAAC,CAAC,EACJ,CAACE,kBAAkB,EAAEJ,KAAK,EAAEE,aAAa,EAAEC,oBAAoB,CACjE,CAAC;EAED,OAAOP,IAAA,CAACL,aAAa;IAACwB,KAAK,EAAEN,YAAa;IAAAV,QAAA,EAAEA;EAAQ,CAAgB,CAAC;AACvE,CAAC;AAED,MAAMiB,4BAA4B,GAAGxB,IAAI,CAACK,oBAAoB,CAAC;AAC/DmB,4BAA4B,CAACC,WAAW,GAAG,sBAAsB;AAEjE,SAASD,4BAA4B,IAAInB,oBAAoB"}
1
+ {"version":3,"file":"OdysseyCacheProvider.js","names":["createCache","memo","useMemo","useUniqueAlphabeticalId","CacheProvider","jsx","_jsx","OdysseyCacheProvider","_ref","children","emotionRoot","nonce","stylisPlugins","uniqueAlphabeticalId","emotionCache","container","key","window","cspNonce","prepend","speedy","value","MemoizedOdysseyCacheProvider","displayName"],"sources":["../src/OdysseyCacheProvider.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\ndeclare global {\n interface Window {\n cspNonce: string;\n }\n}\n\nimport createCache, { StylisPlugin } from \"@emotion/cache\";\nimport { memo, useMemo, ReactNode } from \"react\";\nimport { useUniqueAlphabeticalId } from \"./useUniqueAlphabeticalId\";\nimport { CacheProvider } from \"@emotion/react\";\n\nexport type OdysseyCacheProviderProps = {\n children: ReactNode;\n nonce?: string;\n /**\n * Emotion caches styles into the style element.\n * When enabling this prop, Emotion caches the styles at this element, rather than in <head>.\n */\n emotionRoot?: HTMLStyleElement;\n /**\n * Emotion renders into this HTML element.\n * When enabling this prop, Emotion renders at the top of this component rather than the bottom like it does in the HTML `<head>`.\n */\n shadowDomElement?: HTMLDivElement | HTMLElement;\n stylisPlugins?: StylisPlugin[];\n};\n\nconst OdysseyCacheProvider = ({\n children,\n emotionRoot,\n nonce,\n stylisPlugins,\n}: OdysseyCacheProviderProps) => {\n const uniqueAlphabeticalId = useUniqueAlphabeticalId();\n\n const emotionCache = useMemo(() => {\n return createCache({\n ...(emotionRoot && { container: emotionRoot }),\n key: uniqueAlphabeticalId,\n nonce: nonce ?? window.cspNonce,\n prepend: true,\n speedy: false, // <-- Needs to be set to false when shadow-dom is used!! https://github.com/emotion-js/emotion/issues/2053#issuecomment-713429122\n ...(stylisPlugins && { stylisPlugins }),\n });\n }, [emotionRoot, nonce, stylisPlugins, uniqueAlphabeticalId]);\n\n return <CacheProvider value={emotionCache}>{children}</CacheProvider>;\n};\n\nconst MemoizedOdysseyCacheProvider = memo(OdysseyCacheProvider);\nMemoizedOdysseyCacheProvider.displayName = \"OdysseyCacheProvider\";\n\nexport { MemoizedOdysseyCacheProvider as OdysseyCacheProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,WAAW,MAAwB,gBAAgB;AAC1D,SAASC,IAAI,EAAEC,OAAO,QAAmB,OAAO;AAAC,SACxCC,uBAAuB;AAChC,SAASC,aAAa,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAkB/C,MAAMC,oBAAoB,GAAGC,IAAA,IAKI;EAAA,IALH;IAC5BC,QAAQ;IACRC,WAAW;IACXC,KAAK;IACLC;EACyB,CAAC,GAAAJ,IAAA;EAC1B,MAAMK,oBAAoB,GAAGV,uBAAuB,CAAC,CAAC;EAEtD,MAAMW,YAAY,GAAGZ,OAAO,CAAC,MAAM;IACjC,OAAOF,WAAW,CAAC;MACjB,IAAIU,WAAW,IAAI;QAAEK,SAAS,EAAEL;MAAY,CAAC,CAAC;MAC9CM,GAAG,EAAEH,oBAAoB;MACzBF,KAAK,EAAEA,KAAK,IAAIM,MAAM,CAACC,QAAQ;MAC/BC,OAAO,EAAE,IAAI;MACbC,MAAM,EAAE,KAAK;MACb,IAAIR,aAAa,IAAI;QAAEA;MAAc,CAAC;IACxC,CAAC,CAAC;EACJ,CAAC,EAAE,CAACF,WAAW,EAAEC,KAAK,EAAEC,aAAa,EAAEC,oBAAoB,CAAC,CAAC;EAE7D,OAAOP,IAAA,CAACF,aAAa;IAACiB,KAAK,EAAEP,YAAa;IAAAL,QAAA,EAAEA;EAAQ,CAAgB,CAAC;AACvE,CAAC;AAED,MAAMa,4BAA4B,GAAGrB,IAAI,CAACM,oBAAoB,CAAC;AAC/De,4BAA4B,CAACC,WAAW,GAAG,sBAAsB;AAEjE,SAASD,4BAA4B,IAAIf,oBAAoB"}
@@ -20,6 +20,7 @@ const OdysseyProvider = _ref => {
20
20
  let {
21
21
  children,
22
22
  designTokensOverride,
23
+ emotionRoot,
23
24
  shadowDomElement,
24
25
  languageCode,
25
26
  nonce,
@@ -29,12 +30,15 @@ const OdysseyProvider = _ref => {
29
30
  } = _ref;
30
31
  return _jsx(OdysseyCacheProvider, {
31
32
  nonce: nonce,
33
+ emotionRoot: emotionRoot,
32
34
  shadowDomElement: shadowDomElement,
33
35
  stylisPlugins: stylisPlugins,
34
36
  children: _jsx(OdysseyThemeProvider, {
35
37
  designTokensOverride: designTokensOverride,
38
+ emotionRoot: emotionRoot,
36
39
  shadowDomElement: shadowDomElement,
37
40
  themeOverride: themeOverride,
41
+ withCache: false,
38
42
  children: _jsx(_ScopedCssBaseline, {
39
43
  children: _jsx(OdysseyTranslationProvider, {
40
44
  languageCode: languageCode,
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyProvider.js","names":["memo","OdysseyCacheProvider","OdysseyThemeProvider","OdysseyTranslationProvider","jsx","_jsx","OdysseyProvider","_ref","children","designTokensOverride","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\";\n\nexport type OdysseyProviderProps = OdysseyCacheProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps & {\n children: ReactNode;\n };\n\nconst OdysseyProvider = ({\n children,\n designTokensOverride,\n shadowDomElement,\n languageCode,\n nonce,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps) => (\n <OdysseyCacheProvider\n nonce={nonce}\n shadowDomElement={shadowDomElement}\n stylisPlugins={stylisPlugins}\n >\n <OdysseyThemeProvider\n designTokensOverride={designTokensOverride}\n shadowDomElement={shadowDomElement}\n themeOverride={themeOverride}\n >\n <ScopedCssBaseline>\n <OdysseyTranslationProvider\n languageCode={languageCode}\n translationOverrides={translationOverrides}\n >\n {children}\n </OdysseyTranslationProvider>\n </ScopedCssBaseline>\n </OdysseyThemeProvider>\n </OdysseyCacheProvider>\n);\n\nconst MemoizedThemeProvider = memo(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;AAU5B,MAAMC,eAAe,GAAGC,IAAA;EAAA,IAAC;IACvBC,QAAQ;IACRC,oBAAoB;IACpBC,gBAAgB;IAChBC,YAAY;IACZC,KAAK;IACLC,aAAa;IACbC,aAAa;IACbC;EACoB,CAAC,GAAAR,IAAA;EAAA,OACrBF,IAAA,CAACJ,oBAAoB;IACnBW,KAAK,EAAEA,KAAM;IACbF,gBAAgB,EAAEA,gBAAiB;IACnCG,aAAa,EAAEA,aAAc;IAAAL,QAAA,EAE7BH,IAAA,CAACH,oBAAoB;MACnBO,oBAAoB,EAAEA,oBAAqB;MAC3CC,gBAAgB,EAAEA,gBAAiB;MACnCI,aAAa,EAAEA,aAAc;MAAAN,QAAA,EAE7BH,IAAA,CAAAW,kBAAA;QAAAR,QAAA,EACEH,IAAA,CAACF,0BAA0B;UACzBQ,YAAY,EAAEA,YAAa;UAC3BI,oBAAoB,EAAEA,oBAAqB;UAAAP,QAAA,EAE1CA;QAAQ,CACiB;MAAC,CACZ;IAAC,CACA;EAAC,CACH,CAAC;AAAA,CACxB;AAED,MAAMS,qBAAqB,GAAGjB,IAAI,CAACM,eAAe,CAAC;AAEnD,SAASW,qBAAqB,IAAIX,eAAe"}
1
+ {"version":3,"file":"OdysseyProvider.js","names":["memo","OdysseyCacheProvider","OdysseyThemeProvider","OdysseyTranslationProvider","jsx","_jsx","OdysseyProvider","_ref","children","designTokensOverride","emotionRoot","shadowDomElement","languageCode","nonce","stylisPlugins","themeOverride","translationOverrides","withCache","_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\";\n\nexport type OdysseyProviderProps = OdysseyCacheProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps & {\n children: ReactNode;\n };\n\nconst OdysseyProvider = ({\n children,\n designTokensOverride,\n emotionRoot,\n shadowDomElement,\n languageCode,\n nonce,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps) => (\n <OdysseyCacheProvider\n nonce={nonce}\n emotionRoot={emotionRoot}\n shadowDomElement={shadowDomElement}\n stylisPlugins={stylisPlugins}\n >\n <OdysseyThemeProvider\n designTokensOverride={designTokensOverride}\n emotionRoot={emotionRoot}\n shadowDomElement={shadowDomElement}\n themeOverride={themeOverride}\n withCache={false}\n >\n <ScopedCssBaseline>\n <OdysseyTranslationProvider\n languageCode={languageCode}\n translationOverrides={translationOverrides}\n >\n {children}\n </OdysseyTranslationProvider>\n </ScopedCssBaseline>\n </OdysseyThemeProvider>\n </OdysseyCacheProvider>\n);\n\nconst MemoizedThemeProvider = memo(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;AAU5B,MAAMC,eAAe,GAAGC,IAAA;EAAA,IAAC;IACvBC,QAAQ;IACRC,oBAAoB;IACpBC,WAAW;IACXC,gBAAgB;IAChBC,YAAY;IACZC,KAAK;IACLC,aAAa;IACbC,aAAa;IACbC;EACoB,CAAC,GAAAT,IAAA;EAAA,OACrBF,IAAA,CAACJ,oBAAoB;IACnBY,KAAK,EAAEA,KAAM;IACbH,WAAW,EAAEA,WAAY;IACzBC,gBAAgB,EAAEA,gBAAiB;IACnCG,aAAa,EAAEA,aAAc;IAAAN,QAAA,EAE7BH,IAAA,CAACH,oBAAoB;MACnBO,oBAAoB,EAAEA,oBAAqB;MAC3CC,WAAW,EAAEA,WAAY;MACzBC,gBAAgB,EAAEA,gBAAiB;MACnCI,aAAa,EAAEA,aAAc;MAC7BE,SAAS,EAAE,KAAM;MAAAT,QAAA,EAEjBH,IAAA,CAAAa,kBAAA;QAAAV,QAAA,EACEH,IAAA,CAACF,0BAA0B;UACzBS,YAAY,EAAEA,YAAa;UAC3BI,oBAAoB,EAAEA,oBAAqB;UAAAR,QAAA,EAE1CA;QAAQ,CACiB;MAAC,CACZ;IAAC,CACA;EAAC,CACH,CAAC;AAAA,CACxB;AAED,MAAMW,qBAAqB,GAAGnB,IAAI,CAACM,eAAe,CAAC;AAEnD,SAASa,qBAAqB,IAAIb,eAAe"}
@@ -16,13 +16,18 @@ 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";
19
22
  import { jsx as _jsx } from "react/jsx-runtime";
20
23
  const OdysseyThemeProvider = _ref => {
21
24
  let {
22
25
  children,
23
26
  designTokensOverride,
27
+ emotionRoot,
24
28
  shadowDomElement,
25
- themeOverride
29
+ themeOverride,
30
+ withCache = true
26
31
  } = _ref;
27
32
  const odysseyTokens = useMemo(() => ({
28
33
  ...Tokens,
@@ -33,6 +38,28 @@ const OdysseyThemeProvider = _ref => {
33
38
  shadowDomElement
34
39
  }), [odysseyTokens, shadowDomElement]);
35
40
  const customOdysseyTheme = useMemo(() => themeOverride && createTheme(deepmerge(odysseyTheme, themeOverride)), [odysseyTheme, themeOverride]);
41
+ const uniqueAlphabeticalId = useUniqueAlphabeticalId();
42
+ const cache = useMemo(() => createCache({
43
+ ...(emotionRoot && {
44
+ container: emotionRoot
45
+ }),
46
+ key: uniqueAlphabeticalId,
47
+ prepend: true,
48
+ nonce: window.cspNonce,
49
+ speedy: false
50
+ }), [emotionRoot, uniqueAlphabeticalId]);
51
+ if (withCache) {
52
+ return _jsx(CacheProvider, {
53
+ value: cache,
54
+ children: _jsx(MuiThemeProvider, {
55
+ theme: customOdysseyTheme ?? odysseyTheme,
56
+ children: _jsx(OdysseyDesignTokensContext.Provider, {
57
+ value: odysseyTokens,
58
+ children: children
59
+ })
60
+ })
61
+ });
62
+ }
36
63
  return _jsx(MuiThemeProvider, {
37
64
  theme: customOdysseyTheme ?? odysseyTheme,
38
65
  children: _jsx(OdysseyDesignTokensContext.Provider, {
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyThemeProvider.js","names":["createTheme","ThemeProvider","MuiThemeProvider","memo","useMemo","deepmerge","createOdysseyMuiTheme","Tokens","OdysseyDesignTokensContext","jsx","_jsx","OdysseyThemeProvider","_ref","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;\n themeOverride?: ThemeOptions;\n};\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 OdysseyThemeProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,WAAW,EACXC,aAAa,IAAIC,gBAAgB,QAC5B,sBAAsB;AAC7B,SAASC,IAAI,EAAaC,OAAO,QAAQ,OAAO;AAGhD,SAASC,SAAS,QAAQ,YAAY;AAAC,SAC9BC,qBAAqB;AAC9B,OAAO,KAAKC,MAAM,MAAM,6BAA6B;AAAC,SAC7CC,0BAA0B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AASnC,MAAMC,oBAAoB,GAAGC,IAAA,IAKI;EAAA,IALH;IAC5BC,QAAQ;IACRC,oBAAoB;IACpBC,gBAAgB;IAChBC;EACyB,CAAC,GAAAJ,IAAA;EAC1B,MAAMK,aAAa,GAAGb,OAAO,CAC3B,OAAO;IAAE,GAAGG,MAAM;IAAE,GAAGO;EAAqB,CAAC,CAAC,EAC9C,CAACA,oBAAoB,CACvB,CAAC;EACD,MAAMI,YAAY,GAAGd,OAAO,CAC1B,MACEE,qBAAqB,CAAC;IACpBW,aAAa;IACbF;EACF,CAAC,CAAC,EACJ,CAACE,aAAa,EAAEF,gBAAgB,CAClC,CAAC;EAED,MAAMI,kBAAkB,GAAGf,OAAO,CAChC,MAAMY,aAAa,IAAIhB,WAAW,CAACK,SAAS,CAACa,YAAY,EAAEF,aAAa,CAAC,CAAC,EAC1E,CAACE,YAAY,EAAEF,aAAa,CAC9B,CAAC;EAED,OACEN,IAAA,CAACR,gBAAgB;IAACkB,KAAK,EAAED,kBAAkB,IAAID,YAAa;IAAAL,QAAA,EAC1DH,IAAA,CAACF,0BAA0B,CAACa,QAAQ;MAACC,KAAK,EAAEL,aAAc;MAAAJ,QAAA,EACvDA;IAAQ,CAC0B;EAAC,CACtB,CAAC;AAEvB,CAAC;AAED,MAAMU,4BAA4B,GAAGpB,IAAI,CAACQ,oBAAoB,CAAC;AAE/D,SAASY,4BAA4B,IAAIZ,oBAAoB"}
1
+ {"version":3,"file":"OdysseyThemeProvider.js","names":["createTheme","ThemeProvider","MuiThemeProvider","memo","useMemo","deepmerge","createOdysseyMuiTheme","Tokens","OdysseyDesignTokensContext","CacheProvider","createCache","useUniqueAlphabeticalId","jsx","_jsx","OdysseyThemeProvider","_ref","children","designTokensOverride","emotionRoot","shadowDomElement","themeOverride","withCache","odysseyTokens","odysseyTheme","customOdysseyTheme","uniqueAlphabeticalId","cache","container","key","prepend","nonce","window","cspNonce","speedy","value","theme","Provider","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\";\nimport { CacheProvider } from \"@emotion/react\";\nimport createCache from \"@emotion/cache\";\nimport { useUniqueAlphabeticalId } from \"./useUniqueAlphabeticalId\";\n\nexport type OdysseyThemeProviderProps = {\n children: ReactNode;\n designTokensOverride?: DesignTokensOverride;\n emotionRoot?: HTMLStyleElement;\n shadowDomElement?: HTMLDivElement | HTMLElement | undefined;\n themeOverride?: ThemeOptions;\n withCache?: boolean;\n};\n\nconst OdysseyThemeProvider = ({\n children,\n designTokensOverride,\n emotionRoot,\n shadowDomElement,\n themeOverride,\n withCache = true,\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 const uniqueAlphabeticalId = useUniqueAlphabeticalId();\n\n const cache = useMemo(\n () =>\n createCache({\n ...(emotionRoot && { container: emotionRoot }),\n key: uniqueAlphabeticalId,\n prepend: true,\n nonce: window.cspNonce,\n speedy: false, // <-- Needs to be set to false when shadow-dom is used!! https://github.com/emotion-js/emotion/issues/2053#issuecomment-713429122\n }),\n [emotionRoot, uniqueAlphabeticalId]\n );\n\n if (withCache) {\n return (\n <CacheProvider value={cache}>\n <MuiThemeProvider theme={customOdysseyTheme ?? odysseyTheme}>\n <OdysseyDesignTokensContext.Provider value={odysseyTokens}>\n {children}\n </OdysseyDesignTokensContext.Provider>\n </MuiThemeProvider>\n </CacheProvider>\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 OdysseyThemeProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,WAAW,EACXC,aAAa,IAAIC,gBAAgB,QAC5B,sBAAsB;AAC7B,SAASC,IAAI,EAAaC,OAAO,QAAQ,OAAO;AAGhD,SAASC,SAAS,QAAQ,YAAY;AAAC,SAC9BC,qBAAqB;AAC9B,OAAO,KAAKC,MAAM,MAAM,6BAA6B;AAAC,SAC7CC,0BAA0B;AACnC,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,OAAOC,WAAW,MAAM,gBAAgB;AAAC,SAChCC,uBAAuB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAWhC,MAAMC,oBAAoB,GAAGC,IAAA,IAOI;EAAA,IAPH;IAC5BC,QAAQ;IACRC,oBAAoB;IACpBC,WAAW;IACXC,gBAAgB;IAChBC,aAAa;IACbC,SAAS,GAAG;EACa,CAAC,GAAAN,IAAA;EAC1B,MAAMO,aAAa,GAAGlB,OAAO,CAC3B,OAAO;IAAE,GAAGG,MAAM;IAAE,GAAGU;EAAqB,CAAC,CAAC,EAC9C,CAACA,oBAAoB,CACvB,CAAC;EACD,MAAMM,YAAY,GAAGnB,OAAO,CAC1B,MACEE,qBAAqB,CAAC;IACpBgB,aAAa;IACbH;EACF,CAAC,CAAC,EACJ,CAACG,aAAa,EAAEH,gBAAgB,CAClC,CAAC;EAED,MAAMK,kBAAkB,GAAGpB,OAAO,CAChC,MAAMgB,aAAa,IAAIpB,WAAW,CAACK,SAAS,CAACkB,YAAY,EAAEH,aAAa,CAAC,CAAC,EAC1E,CAACG,YAAY,EAAEH,aAAa,CAC9B,CAAC;EAED,MAAMK,oBAAoB,GAAGd,uBAAuB,CAAC,CAAC;EAEtD,MAAMe,KAAK,GAAGtB,OAAO,CACnB,MACEM,WAAW,CAAC;IACV,IAAIQ,WAAW,IAAI;MAAES,SAAS,EAAET;IAAY,CAAC,CAAC;IAC9CU,GAAG,EAAEH,oBAAoB;IACzBI,OAAO,EAAE,IAAI;IACbC,KAAK,EAAEC,MAAM,CAACC,QAAQ;IACtBC,MAAM,EAAE;EACV,CAAC,CAAC,EACJ,CAACf,WAAW,EAAEO,oBAAoB,CACpC,CAAC;EAED,IAAIJ,SAAS,EAAE;IACb,OACER,IAAA,CAACJ,aAAa;MAACyB,KAAK,EAAER,KAAM;MAAAV,QAAA,EAC1BH,IAAA,CAACX,gBAAgB;QAACiC,KAAK,EAAEX,kBAAkB,IAAID,YAAa;QAAAP,QAAA,EAC1DH,IAAA,CAACL,0BAA0B,CAAC4B,QAAQ;UAACF,KAAK,EAAEZ,aAAc;UAAAN,QAAA,EACvDA;QAAQ,CAC0B;MAAC,CACtB;IAAC,CACN,CAAC;EAEpB;EACA,OACEH,IAAA,CAACX,gBAAgB;IAACiC,KAAK,EAAEX,kBAAkB,IAAID,YAAa;IAAAP,QAAA,EAC1DH,IAAA,CAACL,0BAA0B,CAAC4B,QAAQ;MAACF,KAAK,EAAEZ,aAAc;MAAAN,QAAA,EACvDA;IAAQ,CAC0B;EAAC,CACtB,CAAC;AAEvB,CAAC;AAED,MAAMqB,4BAA4B,GAAGlC,IAAI,CAACW,oBAAoB,CAAC;AAE/D,SAASuB,4BAA4B,IAAIvB,oBAAoB"}
@@ -14,8 +14,13 @@ export const createShadowRootElement = containerElement => {
14
14
  const shadowRoot = containerElement.attachShadow({
15
15
  mode: "open"
16
16
  });
17
+ const emotionRoot = document.createElement("style");
18
+ emotionRoot.setAttribute("id", "style-root");
19
+ emotionRoot.setAttribute("nonce", window.cspNonce);
17
20
  const shadowRootElement = document.createElement("div");
18
- shadowRoot.append(shadowRootElement);
19
- return shadowRoot;
21
+ shadowRootElement.setAttribute("id", "shadow-root");
22
+ shadowRoot.appendChild(emotionRoot);
23
+ shadowRoot.appendChild(shadowRootElement);
24
+ return [emotionRoot, shadowRootElement];
20
25
  };
21
26
  //# sourceMappingURL=createShadowRootElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createShadowRootElement.js","names":["createShadowRootElement","containerElement","shadowRoot","attachShadow","mode","shadowRootElement","document","createElement","append"],"sources":["../src/createShadowRootElement.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-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\nexport const createShadowRootElement = (containerElement: HTMLElement) => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n const shadowRootElement = document.createElement(\"div\");\n\n shadowRoot.append(shadowRootElement);\n\n return shadowRoot;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,uBAAuB,GAAIC,gBAA6B,IAAK;EACxE,MAAMC,UAAU,GAAGD,gBAAgB,CAACE,YAAY,CAAC;IAAEC,IAAI,EAAE;EAAO,CAAC,CAAC;EAElE,MAAMC,iBAAiB,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAEvDL,UAAU,CAACM,MAAM,CAACH,iBAAiB,CAAC;EAEpC,OAAOH,UAAU;AACnB,CAAC"}
1
+ {"version":3,"file":"createShadowRootElement.js","names":["createShadowRootElement","containerElement","shadowRoot","attachShadow","mode","emotionRoot","document","createElement","setAttribute","window","cspNonce","shadowRootElement","appendChild"],"sources":["../src/createShadowRootElement.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-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\nexport const createShadowRootElement = (\n containerElement: HTMLElement\n): [HTMLStyleElement, HTMLDivElement] => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n // the element that styles will be cached into\n const emotionRoot = document.createElement(\"style\");\n emotionRoot.setAttribute(\"id\", \"style-root\");\n emotionRoot.setAttribute(\"nonce\", window.cspNonce);\n\n // the element that emotion renders html into\n const shadowRootElement = document.createElement(\"div\");\n shadowRootElement.setAttribute(\"id\", \"shadow-root\");\n\n shadowRoot.appendChild(emotionRoot);\n shadowRoot.appendChild(shadowRootElement);\n\n return [emotionRoot, shadowRootElement];\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,uBAAuB,GAClCC,gBAA6B,IACU;EACvC,MAAMC,UAAU,GAAGD,gBAAgB,CAACE,YAAY,CAAC;IAAEC,IAAI,EAAE;EAAO,CAAC,CAAC;EAGlE,MAAMC,WAAW,GAAGC,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;EACnDF,WAAW,CAACG,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;EAC5CH,WAAW,CAACG,YAAY,CAAC,OAAO,EAAEC,MAAM,CAACC,QAAQ,CAAC;EAGlD,MAAMC,iBAAiB,GAAGL,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACvDI,iBAAiB,CAACH,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC;EAEnDN,UAAU,CAACU,WAAW,CAACP,WAAW,CAAC;EACnCH,UAAU,CAACU,WAAW,CAACD,iBAAiB,CAAC;EAEzC,OAAO,CAACN,WAAW,EAAEM,iBAAiB,CAAC;AACzC,CAAC"}
@@ -18,14 +18,19 @@ import { StylisPlugin } from "@emotion/cache";
18
18
  import { ReactNode } from "react";
19
19
  export type OdysseyCacheProviderProps = {
20
20
  children: ReactNode;
21
+ nonce?: string;
22
+ /**
23
+ * Emotion caches styles into the style element.
24
+ * When enabling this prop, Emotion caches the styles at this element, rather than in <head>.
25
+ */
26
+ emotionRoot?: HTMLStyleElement;
21
27
  /**
22
28
  * Emotion renders into this HTML element.
23
29
  * When enabling this prop, Emotion renders at the top of this component rather than the bottom like it does in the HTML `<head>`.
24
30
  */
25
- nonce?: string;
26
- shadowDomElement?: HTMLDivElement;
31
+ shadowDomElement?: HTMLDivElement | HTMLElement;
27
32
  stylisPlugins?: StylisPlugin[];
28
33
  };
29
- declare const MemoizedOdysseyCacheProvider: import("react").MemoExoticComponent<({ children, nonce, shadowDomElement, stylisPlugins, }: OdysseyCacheProviderProps) => JSX.Element>;
34
+ declare const MemoizedOdysseyCacheProvider: import("react").MemoExoticComponent<({ children, emotionRoot, nonce, stylisPlugins, }: OdysseyCacheProviderProps) => JSX.Element>;
30
35
  export { MemoizedOdysseyCacheProvider as OdysseyCacheProvider };
31
36
  //# sourceMappingURL=OdysseyCacheProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyCacheProvider.d.ts","sourceRoot":"","sources":["../../src/OdysseyCacheProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB;CACF;AAED,OAAoB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAQ,SAAS,EAAW,MAAM,OAAO,CAAC;AAIjD,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,cAAc,CAAC;IAClC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC,CAAC;AAmCF,QAAA,MAAM,4BAA4B,8FA5B/B,yBAAyB,iBA4BmC,CAAC;AAGhE,OAAO,EAAE,4BAA4B,IAAI,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"OdysseyCacheProvider.d.ts","sourceRoot":"","sources":["../../src/OdysseyCacheProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB;CACF;AAED,OAAoB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjD,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC;IAChD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC,CAAC;AAwBF,QAAA,MAAM,4BAA4B,yFAjB/B,yBAAyB,iBAiBmC,CAAC;AAGhE,OAAO,EAAE,4BAA4B,IAAI,oBAAoB,EAAE,CAAC"}
@@ -16,6 +16,6 @@ import { OdysseyTranslationProviderProps } from "./OdysseyTranslationProvider";
16
16
  export type OdysseyProviderProps = OdysseyCacheProviderProps & OdysseyThemeProviderProps & OdysseyTranslationProviderProps & {
17
17
  children: ReactNode;
18
18
  };
19
- declare const MemoizedThemeProvider: import("react").MemoExoticComponent<({ children, designTokensOverride, shadowDomElement, languageCode, nonce, stylisPlugins, themeOverride, translationOverrides, }: OdysseyProviderProps) => JSX.Element>;
19
+ declare const MemoizedThemeProvider: import("react").MemoExoticComponent<({ children, designTokensOverride, emotionRoot, shadowDomElement, languageCode, nonce, stylisPlugins, themeOverride, translationOverrides, }: OdysseyProviderProps) => JSX.Element>;
20
20
  export { MemoizedThemeProvider as OdysseyProvider };
21
21
  //# sourceMappingURL=OdysseyProvider.d.ts.map
@@ -1 +1 @@
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;AAEtC,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAC1D,yBAAyB,GACzB,+BAA+B,GAAG;IAChC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAkCJ,QAAA,MAAM,qBAAqB,uKAvBxB,oBAAoB,iBAuB4B,CAAC;AAEpD,OAAO,EAAE,qBAAqB,IAAI,eAAe,EAAE,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;AAEtC,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAC1D,yBAAyB,GACzB,+BAA+B,GAAG;IAChC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAsCJ,QAAA,MAAM,qBAAqB,oLA1BxB,oBAAoB,iBA0B4B,CAAC;AAEpD,OAAO,EAAE,qBAAqB,IAAI,eAAe,EAAE,CAAC"}
@@ -15,9 +15,11 @@ import { DesignTokensOverride } from "./theme";
15
15
  export type OdysseyThemeProviderProps = {
16
16
  children: ReactNode;
17
17
  designTokensOverride?: DesignTokensOverride;
18
- shadowDomElement?: HTMLDivElement;
18
+ emotionRoot?: HTMLStyleElement;
19
+ shadowDomElement?: HTMLDivElement | HTMLElement | undefined;
19
20
  themeOverride?: ThemeOptions;
21
+ withCache?: boolean;
20
22
  };
21
- declare const MemoizedOdysseyThemeProvider: import("react").MemoExoticComponent<({ children, designTokensOverride, shadowDomElement, themeOverride, }: OdysseyThemeProviderProps) => JSX.Element>;
23
+ declare const MemoizedOdysseyThemeProvider: import("react").MemoExoticComponent<({ children, designTokensOverride, emotionRoot, shadowDomElement, themeOverride, withCache, }: OdysseyThemeProviderProps) => JSX.Element>;
22
24
  export { MemoizedOdysseyThemeProvider as OdysseyThemeProvider };
23
25
  //# 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;AAItE,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,gBAAgB,CAAC,EAAE,cAAc,CAAC;IAClC,aAAa,CAAC,EAAE,YAAY,CAAC;CAC9B,CAAC;AAmCF,QAAA,MAAM,4BAA4B,6GA5B/B,yBAAyB,iBA4BmC,CAAC;AAEhE,OAAO,EAAE,4BAA4B,IAAI,oBAAoB,EAAE,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;AAOtE,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,gBAAgB,CAAC,EAAE,cAAc,GAAG,WAAW,GAAG,SAAS,CAAC;IAC5D,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AA8DF,QAAA,MAAM,4BAA4B,qIArD/B,yBAAyB,iBAqDmC,CAAC;AAEhE,OAAO,EAAE,4BAA4B,IAAI,oBAAoB,EAAE,CAAC"}
@@ -9,5 +9,5 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
- export declare const createShadowRootElement: (containerElement: HTMLElement) => ShadowRoot;
12
+ export declare const createShadowRootElement: (containerElement: HTMLElement) => [HTMLStyleElement, HTMLDivElement];
13
13
  //# sourceMappingURL=createShadowRootElement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createShadowRootElement.d.ts","sourceRoot":"","sources":["../../src/createShadowRootElement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,uBAAuB,qBAAsB,WAAW,eAQpE,CAAC"}
1
+ {"version":3,"file":"createShadowRootElement.d.ts","sourceRoot":"","sources":["../../src/createShadowRootElement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,uBAAuB,qBAChB,WAAW,KAC5B,CAAC,gBAAgB,EAAE,cAAc,CAgBnC,CAAC"}
@@ -13,6 +13,6 @@ import { ThemeOptions } from "@mui/material";
13
13
  import { DesignTokens } from "./theme";
14
14
  export declare const components: ({ odysseyTokens, shadowDomElement, }: {
15
15
  odysseyTokens: DesignTokens;
16
- shadowDomElement?: HTMLDivElement | undefined;
16
+ shadowDomElement?: HTMLElement | undefined;
17
17
  }) => ThemeOptions["components"];
18
18
  //# sourceMappingURL=components.d.ts.map
@@ -18,6 +18,6 @@ export type DesignTokens = typeof Tokens;
18
18
  export type DesignTokensOverride = Partial<typeof Tokens>;
19
19
  export declare const createOdysseyMuiTheme: ({ odysseyTokens, shadowDomElement, }: {
20
20
  odysseyTokens: DesignTokens;
21
- shadowDomElement?: HTMLDivElement | undefined;
21
+ shadowDomElement?: HTMLElement | undefined;
22
22
  }) => import("@mui/material/styles").Theme;
23
23
  //# sourceMappingURL=createOdysseyMuiTheme.d.ts.map