mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 07:21:17 +08:00
Addon-docs: Refactor HTML component overrides
This commit is contained in:
parent
468ad0f990
commit
0a92f4734e
@ -4,7 +4,7 @@ import React from 'react';
|
||||
import { MDXProvider } from '@mdx-js/react';
|
||||
import { ThemeProvider, ensure as ensureTheme } from '@storybook/theming';
|
||||
import { DocsWrapper, DocsContent } from '@storybook/components';
|
||||
import * as html from '@storybook/components/html';
|
||||
import { components as defaultComponents } from '@storybook/components/html';
|
||||
import { DocsContextProps, DocsContext } from './DocsContext';
|
||||
|
||||
interface DocsContainerProps {
|
||||
@ -12,14 +12,6 @@ interface DocsContainerProps {
|
||||
content: React.ElementType<any>;
|
||||
}
|
||||
|
||||
const defaultComponents = Object.entries(html).reduce(
|
||||
(acc, [k, v]) => ({
|
||||
...acc,
|
||||
[k.toLowerCase()]: v,
|
||||
}),
|
||||
{}
|
||||
);
|
||||
|
||||
export const DocsContainer: React.FunctionComponent<DocsContainerProps> = ({
|
||||
context,
|
||||
content: MDXContent,
|
||||
|
@ -1 +1,11 @@
|
||||
import * as rawComponents from './typography/DocumentFormatting';
|
||||
|
||||
export * from './typography/DocumentFormatting';
|
||||
|
||||
export const components = Object.entries(rawComponents).reduce(
|
||||
(acc, [k, v]) => ({
|
||||
...acc,
|
||||
[k.toLowerCase()]: v,
|
||||
}),
|
||||
{}
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user