fix: storybook with typescript (#2926)
* fix storybook for typescript * fix babel
This commit is contained in:
1 parent
1b30ff83a5
commit
f9449e97df
38 files changed
+153
-130
No files matched your search
@@ -0,0 +1,83 @@
|
||||
import React from 'react';
|
||||
import { addParameters } from '@storybook/react';
|
||||
import { DocsPage, DocsContainer } from '@storybook/addon-docs';
|
||||
import {
|
||||
Heading,
|
||||
SectionName,
|
||||
Footer,
|
||||
AnchorListItem,
|
||||
LinkComponent,
|
||||
} from '../src/storybook/components';
|
||||
|
||||
import '../src/tailwind.css';
|
||||
import './custom.css';
|
||||
|
||||
// https://github.com/mondaycom/monday-ui-react-core/tree/master/.storybook
|
||||
addParameters({
|
||||
docs: {
|
||||
inlineStories: true,
|
||||
container: ({ children, context }) => (
|
||||
<DocsContainer context={context}>{children}</DocsContainer>
|
||||
),
|
||||
page: DocsPage,
|
||||
components: {
|
||||
Heading,
|
||||
Footer,
|
||||
h2: SectionName,
|
||||
h3: ({ children }) => (
|
||||
<h3 className="my-2 text-xl to-blue-900">{children}</h3>
|
||||
),
|
||||
li: AnchorListItem,
|
||||
a: LinkComponent,
|
||||
p: ({ children }) => (
|
||||
<p className="my-2 text-gray-800 font-inter">{children}</p>
|
||||
),
|
||||
// todo: add pre and code
|
||||
},
|
||||
},
|
||||
viewMode: 'docs',
|
||||
previewTabs: {
|
||||
'storybook/docs/panel': {
|
||||
index: -1,
|
||||
},
|
||||
canvas: { title: 'Sandbox' },
|
||||
},
|
||||
actions: { argTypesRegex: '^on[A-Z].*' },
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/,
|
||||
},
|
||||
},
|
||||
viewport: {
|
||||
disable: true,
|
||||
},
|
||||
backgrounds: {
|
||||
default: 'OHIF-v3',
|
||||
values: [
|
||||
{
|
||||
name: 'White',
|
||||
value: '#FFFFFF',
|
||||
},
|
||||
{
|
||||
name: 'OHIF-v3',
|
||||
value: '#090C29',
|
||||
},
|
||||
{
|
||||
name: 'Light',
|
||||
value: '#F8F8F8',
|
||||
},
|
||||
{
|
||||
name: 'Dark',
|
||||
value: '#333333',
|
||||
},
|
||||
],
|
||||
},
|
||||
options: {
|
||||
storySort: {
|
||||
order: ['Welcome', 'Contribute', 'Foundations', 'Modals', '*'],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const decorators = [];
|
||||
Reference in new issue
Block a user