mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-02 05:03:44 +08:00
Fixes
This commit is contained in:
parent
d98b616979
commit
756f74cec0
@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable react/prop-types */
|
/* eslint-disable react/prop-types */
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import 'nextra-theme-docs/style.css';
|
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 reactAnnotations from '@storybook/react/preview';
|
||||||
import * as previewAnnotations from '../.storybook/preview';
|
import * as previewAnnotations from '../.storybook/preview';
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
import React, { FunctionComponent, ComponentType } from 'react';
|
import React from 'react';
|
||||||
import { AnyFramework, Parameters } from '@storybook/csf';
|
import type { FunctionComponent, ComponentType } from 'react';
|
||||||
import { DocsContextProps } from './DocsContext';
|
import type { AnyFramework, Parameters } from '@storybook/csf';
|
||||||
|
import type { Theme } from '@storybook/theming';
|
||||||
|
|
||||||
|
import type { DocsContextProps } from './DocsContext';
|
||||||
import { DocsContainer } from './DocsContainer';
|
import { DocsContainer } from './DocsContainer';
|
||||||
import { DocsPage } from './DocsPage';
|
import { DocsPage } from './DocsPage';
|
||||||
|
|
||||||
@ -10,7 +13,7 @@ export type DocsProps<TFramework extends AnyFramework = AnyFramework> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const Docs: FunctionComponent<DocsProps> = ({ parameters, context }) => {
|
export const Docs: FunctionComponent<DocsProps> = ({ parameters, context }) => {
|
||||||
const Container: ComponentType<{ context: DocsContextProps }> =
|
const Container: ComponentType<{ context: DocsContextProps; theme: Theme }> =
|
||||||
parameters.container || DocsContainer;
|
parameters.container || DocsContainer;
|
||||||
|
|
||||||
const Page = parameters.page || DocsPage;
|
const Page = parameters.page || DocsPage;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { FunctionComponent, useEffect } from 'react';
|
import React, { FunctionComponent, useEffect } from 'react';
|
||||||
import global from 'global';
|
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 { ThemeProvider, ensure as ensureTheme } from '@storybook/theming';
|
||||||
import { AnyFramework } from '@storybook/csf';
|
import { AnyFramework } from '@storybook/csf';
|
||||||
import { DocsWrapper, DocsContent } from '../components';
|
import { DocsWrapper, DocsContent } from '../components';
|
||||||
@ -12,7 +12,7 @@ const { document, window: globalWindow } = global;
|
|||||||
|
|
||||||
export interface DocsContainerProps<TFramework extends AnyFramework = AnyFramework> {
|
export interface DocsContainerProps<TFramework extends AnyFramework = AnyFramework> {
|
||||||
context: DocsContextProps<TFramework>;
|
context: DocsContextProps<TFramework>;
|
||||||
theme?: Theme;
|
theme?: ThemeVars;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DocsContainer: FunctionComponent<DocsContainerProps> = ({
|
export const DocsContainer: FunctionComponent<DocsContainerProps> = ({
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, { FunctionComponent, ComponentType, useRef } from 'react';
|
import React, { FunctionComponent, useRef } from 'react';
|
||||||
import { AnyFramework, ProjectAnnotations } from '@storybook/csf';
|
import { AnyFramework, ProjectAnnotations } from '@storybook/csf';
|
||||||
import { composeConfigs } from '@storybook/store';
|
import { composeConfigs } from '@storybook/store';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user