mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Storybook: Fix Button story (#34357)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Meta, Story, Preview, Props } from '@storybook/addon-docs/blocks';
|
import { Meta, Preview, ArgsTable } from '@storybook/addon-docs/blocks';
|
||||||
import { Button, LinkButton } from './Button';
|
import { Button, LinkButton } from './Button';
|
||||||
|
|
||||||
<Meta title="MDX|Button" component={Button} />
|
<Meta title="MDX|Button" component={Button} />
|
||||||
@@ -80,7 +80,7 @@ Used for triggering a removing or deleting action. Because of its dominant color
|
|||||||
</div>
|
</div>
|
||||||
</Preview>
|
</Preview>
|
||||||
|
|
||||||
<Props of={Button} />
|
<ArgsTable of={Button} />
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Story, Meta } from '@storybook/react';
|
import { Story, Meta } from '@storybook/react';
|
||||||
import { allButtonVariants, allButtonFills, Button, ButtonProps } from './Button';
|
import { allButtonVariants, allButtonFills, Button, ButtonProps } from './Button';
|
||||||
import { iconOptions } from '../../utils/storybook/knobs';
|
|
||||||
import mdx from './Button.mdx';
|
import mdx from './Button.mdx';
|
||||||
import { HorizontalGroup, VerticalGroup } from '../Layout/Layout';
|
import { HorizontalGroup, VerticalGroup } from '../Layout/Layout';
|
||||||
import { ButtonGroup } from './ButtonGroup';
|
import { ButtonGroup } from './ButtonGroup';
|
||||||
@@ -11,11 +10,6 @@ import { Card } from '../Card/Card';
|
|||||||
export default {
|
export default {
|
||||||
title: 'Buttons/Button',
|
title: 'Buttons/Button',
|
||||||
component: Button,
|
component: Button,
|
||||||
argTypes: {
|
|
||||||
variant: { control: 'select' },
|
|
||||||
size: { control: 'select' },
|
|
||||||
icon: { control: { type: 'select', options: iconOptions } },
|
|
||||||
},
|
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: {
|
docs: {
|
||||||
page: mdx,
|
page: mdx,
|
||||||
@@ -23,13 +17,10 @@ export default {
|
|||||||
knobs: {
|
knobs: {
|
||||||
disable: true,
|
disable: true,
|
||||||
},
|
},
|
||||||
controls: {
|
|
||||||
exclude: ['css', 'className'],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
} as Meta;
|
} as Meta;
|
||||||
|
|
||||||
export const Variants: Story<ButtonProps> = ({ children, ...args }) => {
|
export const Variants: Story<ButtonProps> = () => {
|
||||||
const sizes: ComponentSize[] = ['lg', 'md', 'sm'];
|
const sizes: ComponentSize[] = ['lg', 'md', 'sm'];
|
||||||
return (
|
return (
|
||||||
<VerticalGroup>
|
<VerticalGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user