diff --git a/examples/external-docs/pages/_app.js b/examples/external-docs/pages/_app.js index adf9c62636e..b1d0261547b 100644 --- a/examples/external-docs/pages/_app.js +++ b/examples/external-docs/pages/_app.js @@ -1,7 +1,7 @@ /* eslint-disable react/prop-types */ import React from 'react'; import 'nextra-theme-docs/style.css'; -import { ExternalDocs, ExternalDocsContainer } from '@storybook/addon-docs'; +import { ExternalDocs } from '@storybook/addon-docs'; import * as reactAnnotations from '@storybook/react/preview'; import * as previewAnnotations from '../.storybook/preview'; diff --git a/lib/blocks/src/blocks/Docs.tsx b/lib/blocks/src/blocks/Docs.tsx index 2353fe7f9a8..c373132ef38 100644 --- a/lib/blocks/src/blocks/Docs.tsx +++ b/lib/blocks/src/blocks/Docs.tsx @@ -1,6 +1,9 @@ -import React, { FunctionComponent, ComponentType } from 'react'; -import { AnyFramework, Parameters } from '@storybook/csf'; -import { DocsContextProps } from './DocsContext'; +import React from 'react'; +import type { FunctionComponent, ComponentType } from 'react'; +import type { AnyFramework, Parameters } from '@storybook/csf'; +import type { Theme } from '@storybook/theming'; + +import type { DocsContextProps } from './DocsContext'; import { DocsContainer } from './DocsContainer'; import { DocsPage } from './DocsPage'; @@ -10,7 +13,7 @@ export type DocsProps = { }; export const Docs: FunctionComponent = ({ parameters, context }) => { - const Container: ComponentType<{ context: DocsContextProps }> = + const Container: ComponentType<{ context: DocsContextProps; theme: Theme }> = parameters.container || DocsContainer; const Page = parameters.page || DocsPage; diff --git a/lib/blocks/src/blocks/DocsContainer.tsx b/lib/blocks/src/blocks/DocsContainer.tsx index ef2f18c0ac5..d9db94465df 100644 --- a/lib/blocks/src/blocks/DocsContainer.tsx +++ b/lib/blocks/src/blocks/DocsContainer.tsx @@ -1,6 +1,6 @@ import React, { FunctionComponent, useEffect } from 'react'; import global from 'global'; -import type { Theme } from '@storybook/theming'; +import type { ThemeVars } from '@storybook/theming'; import { ThemeProvider, ensure as ensureTheme } from '@storybook/theming'; import { AnyFramework } from '@storybook/csf'; import { DocsWrapper, DocsContent } from '../components'; @@ -12,7 +12,7 @@ const { document, window: globalWindow } = global; export interface DocsContainerProps { context: DocsContextProps; - theme?: Theme; + theme?: ThemeVars; } export const DocsContainer: FunctionComponent = ({ diff --git a/lib/blocks/src/blocks/external/ExternalDocs.tsx b/lib/blocks/src/blocks/external/ExternalDocs.tsx index d802fbaa278..2cf557a0c85 100644 --- a/lib/blocks/src/blocks/external/ExternalDocs.tsx +++ b/lib/blocks/src/blocks/external/ExternalDocs.tsx @@ -1,4 +1,4 @@ -import React, { FunctionComponent, ComponentType, useRef } from 'react'; +import React, { FunctionComponent, useRef } from 'react'; import { AnyFramework, ProjectAnnotations } from '@storybook/csf'; import { composeConfigs } from '@storybook/store';