mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Form Legend: updates story from knobs to controls (#32250)
This commit is contained in:
@@ -1,14 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { text } from '@storybook/addon-knobs';
|
import { Story } from '@storybook/react';
|
||||||
|
|
||||||
import { Legend } from '@grafana/ui';
|
import { Legend } from '@grafana/ui';
|
||||||
import mdx from './Legend.mdx';
|
import mdx from './Legend.mdx';
|
||||||
|
import { NOOP_CONTROL } from '../../utils/storybook/noopControl';
|
||||||
const getKnobs = () => {
|
|
||||||
return {
|
|
||||||
label: text('text', 'Form section'),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Forms/Legend',
|
title: 'Forms/Legend',
|
||||||
@@ -17,11 +12,19 @@ export default {
|
|||||||
docs: {
|
docs: {
|
||||||
page: mdx,
|
page: mdx,
|
||||||
},
|
},
|
||||||
|
knobs: {
|
||||||
|
disable: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
argTypes: {
|
||||||
|
children: { name: 'Label' },
|
||||||
|
description: NOOP_CONTROL,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const basic = () => {
|
export const Basic: Story = (args) => {
|
||||||
const { label } = getKnobs();
|
return <Legend>{args.children}</Legend>;
|
||||||
|
};
|
||||||
return <Legend>{label}</Legend>;
|
Basic.args = {
|
||||||
|
children: 'Form section',
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user