From 11c75a168952163f2306b5bceb4c0a32e1d3c6aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Romain?= Date: Mon, 17 Jun 2024 16:27:27 +0200 Subject: [PATCH] fix: make ThemeProviderWithoutGlobals working since esm build (#5342) --- .changeset/eleven-ghosts-wait.md | 5 +++++ packages/design-system/src/components/ThemeProvider/index.ts | 2 -- .../ThemeProviderWithoutGlobals.tsx | 2 +- .../src/components/ThemeProviderWithoutGlobals/index.ts | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .changeset/eleven-ghosts-wait.md rename packages/design-system/src/components/{ThemeProvider => ThemeProviderWithoutGlobals}/ThemeProviderWithoutGlobals.tsx (95%) create mode 100644 packages/design-system/src/components/ThemeProviderWithoutGlobals/index.ts diff --git a/.changeset/eleven-ghosts-wait.md b/.changeset/eleven-ghosts-wait.md new file mode 100644 index 00000000000..814ff302e98 --- /dev/null +++ b/.changeset/eleven-ghosts-wait.md @@ -0,0 +1,5 @@ +--- +"@talend/design-system": patch +--- + +fix: make ThemeProviderWithoutGlobals working since esm build diff --git a/packages/design-system/src/components/ThemeProvider/index.ts b/packages/design-system/src/components/ThemeProvider/index.ts index 41e2b46734a..ba8ffbc9425 100644 --- a/packages/design-system/src/components/ThemeProvider/index.ts +++ b/packages/design-system/src/components/ThemeProvider/index.ts @@ -1,8 +1,6 @@ import { ThemeProvider as BaseThemeProvider, ThemeProviderProps } from './ThemeProvider'; import ThemeSwitcher from './ThemeSwitcher'; -export { ThemeProviderWithoutGlobals } from './ThemeProviderWithoutGlobals'; - export const ThemeProvider = BaseThemeProvider as typeof BaseThemeProvider & { ThemeSwitcher: typeof ThemeSwitcher; }; diff --git a/packages/design-system/src/components/ThemeProvider/ThemeProviderWithoutGlobals.tsx b/packages/design-system/src/components/ThemeProviderWithoutGlobals/ThemeProviderWithoutGlobals.tsx similarity index 95% rename from packages/design-system/src/components/ThemeProvider/ThemeProviderWithoutGlobals.tsx rename to packages/design-system/src/components/ThemeProviderWithoutGlobals/ThemeProviderWithoutGlobals.tsx index e8729c9d0cb..3686f99fc0a 100644 --- a/packages/design-system/src/components/ThemeProvider/ThemeProviderWithoutGlobals.tsx +++ b/packages/design-system/src/components/ThemeProviderWithoutGlobals/ThemeProviderWithoutGlobals.tsx @@ -6,7 +6,7 @@ import 'typeface-source-sans-pro/index.css'; // eslint-disable-next-line @talend/import-depth import '@talend/design-tokens/dist/TalendDesignTokens.css'; -import ThemeContext from './ThemeContext'; +import ThemeContext from '../ThemeProvider/ThemeContext'; export type ThemeProviderProps = PropsWithChildren<{ theme?: string; diff --git a/packages/design-system/src/components/ThemeProviderWithoutGlobals/index.ts b/packages/design-system/src/components/ThemeProviderWithoutGlobals/index.ts new file mode 100644 index 00000000000..896f0fcf5f4 --- /dev/null +++ b/packages/design-system/src/components/ThemeProviderWithoutGlobals/index.ts @@ -0,0 +1 @@ +export { ThemeProviderWithoutGlobals } from './ThemeProviderWithoutGlobals';