Skip to content

Commit e8d5d5f

Browse files
Storybook: Fix Input story (grafana#91564)
fix type + prefix/suffix
1 parent 3ec2084 commit e8d5d5f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Diff for: packages/grafana-ui/src/components/Input/Input.story.tsx

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ import mdx from './Input.mdx';
1010
import { parseAccessory } from './storyUtils';
1111

1212
const prefixSuffixOpts = {
13-
None: null,
14-
Text: '$',
13+
$: 'Text',
1514
...getAvailableIcons().reduce<KeyValue<string>>((prev, c) => {
1615
return {
1716
...prev,
18-
[`Icon: ${c}`]: `icon-${c}`,
17+
[`icon-${c}`]: `Icon: ${c}`,
1918
};
2019
}, {}),
2120
};
@@ -43,20 +42,22 @@ const meta: Meta = {
4342
prefixVisible: {
4443
control: {
4544
type: 'select',
46-
options: prefixSuffixOpts,
45+
labels: prefixSuffixOpts,
4746
},
47+
options: [null, ...Object.keys(prefixSuffixOpts)],
4848
},
4949
suffixVisible: {
5050
control: {
5151
type: 'select',
52-
options: prefixSuffixOpts,
52+
labels: prefixSuffixOpts,
5353
},
54+
options: [null, ...Object.keys(prefixSuffixOpts)],
5455
},
5556
type: {
5657
control: {
5758
type: 'select',
58-
options: ['text', 'number', 'password'],
5959
},
60+
options: ['text', 'number', 'password'],
6061
},
6162
// validation: { name: 'Validation regex (will do a partial match if you do not anchor it)' },
6263
width: { control: { type: 'range', min: 10, max: 200, step: 10 } },

0 commit comments

Comments
 (0)