mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 13:09:22 -06:00
Chore: Add controls to Label stories (#54549)
* Add controls for Label's Simple story * Add controls for Label's Categorised story
This commit is contained in:
parent
f15ce633c9
commit
822d24c123
@ -7,6 +7,10 @@ import mdx from './Label.mdx';
|
||||
const meta: ComponentMeta<typeof Label> = {
|
||||
title: 'Forms/Label',
|
||||
component: Label,
|
||||
argTypes: {
|
||||
children: { control: { type: 'text' } },
|
||||
description: { control: { type: 'text' } },
|
||||
},
|
||||
parameters: {
|
||||
docs: {
|
||||
page: mdx,
|
||||
@ -14,16 +18,27 @@ const meta: ComponentMeta<typeof Label> = {
|
||||
},
|
||||
};
|
||||
|
||||
export const simple: ComponentStory<typeof Label> = () => {
|
||||
return <Label description="Option description">Option name</Label>;
|
||||
export const simple: ComponentStory<typeof Label> = (args) => {
|
||||
return <Label {...args} />;
|
||||
};
|
||||
|
||||
export const categorised: ComponentStory<typeof Label> = () => {
|
||||
return (
|
||||
<Label category={['Category', 'Nested category']} description="Option description">
|
||||
Option name
|
||||
</Label>
|
||||
);
|
||||
simple.parameters = {
|
||||
controls: { exclude: ['category'] },
|
||||
};
|
||||
|
||||
simple.args = {
|
||||
children: 'Option name',
|
||||
description: 'Option description',
|
||||
};
|
||||
|
||||
export const categorised: ComponentStory<typeof Label> = (args) => {
|
||||
return <Label {...args} />;
|
||||
};
|
||||
|
||||
categorised.args = {
|
||||
children: 'Option name',
|
||||
description: 'Option description',
|
||||
category: ['Category', 'Nested category'],
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
Loading…
Reference in New Issue
Block a user