diff --git a/packages/superset-ui-demo/.storybook/themeDecorator.js b/packages/superset-ui-demo/.storybook/themeDecorator.js index 8b7cbc70b6..407fcbac07 100644 --- a/packages/superset-ui-demo/.storybook/themeDecorator.js +++ b/packages/superset-ui-demo/.storybook/themeDecorator.js @@ -1,7 +1,6 @@ // themeDecorator.js import React from "react" -import { ThemeProvider } from 'emotion-theming'; -import { supersetTheme } from '@superset-ui/style'; +import { supersetTheme, ThemeProvider } from '@superset-ui/style'; const ThemeDecorator = storyFn => ( {storyFn()} diff --git a/packages/superset-ui-style/README.md b/packages/superset-ui-style/README.md index 398c67d86e..3915f877b6 100644 --- a/packages/superset-ui-style/README.md +++ b/packages/superset-ui-style/README.md @@ -8,8 +8,7 @@ Provides a style object containing a variety of style parameters for theming Sup ## Usage ```ts -import { ThemeProvider } from 'emotion-theming'; -import styled, { supersetTheme } from '@superset-ui/style'; +import styled, { supersetTheme, ThemeProvider } from '@superset-ui/style'; // use emotion api as normal, but the theme uses the correct types const MyHeader = styled.h1` diff --git a/packages/superset-ui-style/package.json b/packages/superset-ui-style/package.json index b482950752..197ac68364 100644 --- a/packages/superset-ui-style/package.json +++ b/packages/superset-ui-style/package.json @@ -30,6 +30,7 @@ }, "dependencies": { "@emotion/core": "^10.0.28", - "@emotion/styled": "^10.0.27" + "@emotion/styled": "^10.0.27", + "emotion-theming": "^10.0.27" } } diff --git a/packages/superset-ui-style/src/index.ts b/packages/superset-ui-style/src/index.ts index b865b37551..7fb834c9c8 100644 --- a/packages/superset-ui-style/src/index.ts +++ b/packages/superset-ui-style/src/index.ts @@ -67,3 +67,5 @@ export const supersetTheme = defaultTheme; export interface SupersetThemeProps { theme: typeof defaultTheme; } + +export { useTheme, ThemeProvider } from 'emotion-theming';