Skip to content

Commit e11874f

Browse files
committed
chore: update new element story template
use the new storybook syntax as default for new elements
1 parent 72c788e commit e11874f

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed
Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
---
22
to: src/<%= name %>-element.stories.ts
33
---
4-
import { withKnobs, number } from '@storybook/addon-knobs';
5-
import { storiesOf } from '@storybook/web-components';
64
import { html } from 'lit-html';
75
import './<%= name %>-element';
86

9-
storiesOf('<%= h.changeCase.title(h.className(name)) %>', module)
10-
.addParameters({ component: 'wokwi-<%= name %>' })
11-
.addDecorator(withKnobs)
12-
.add(
13-
'Default',
14-
() => html`
15-
<wokwi-<%= name %>
16-
value=${number('value', 5, { min: 1, max: 10 })}
17-
></wokwi-<%= name %>>
18-
`
19-
);
7+
export default {
8+
title: '<%= h.changeCase.title(h.className(name)) %>',
9+
component: 'wokwi-<%= name %>',
10+
argTypes: {
11+
value: { control: { type: 'number', min: 1, max: 10, step: 1 } },
12+
},
13+
args: {
14+
value: 5,
15+
},
16+
};
17+
18+
const Template = ({ value }) => html`<wokwi-<%= name %> value=${value}></wokwi-<%= name %>>`;
19+
20+
export const Default = Template.bind({});
21+
Default.args = { value: 5 };
22+
23+
export const Large = Template.bind({});
24+
Large.args = { value: 10 };

0 commit comments

Comments
 (0)