-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdnn-checkbox.stories.ts
More file actions
58 lines (53 loc) · 1.41 KB
/
dnn-checkbox.stories.ts
File metadata and controls
58 lines (53 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import type { Meta, StoryObj } from '@storybook/web-components';
import { html } from 'lit';
import { ifDefined } from 'lit-html/directives/if-defined.js';
import { actions } from '@storybook/addon-actions';
import readme from "./readme.md?raw";
const meta : Meta = {
title: 'Elements/Checkbox',
component: 'dnn-checkbox',
tags: ['autodocs'],
parameters: {
docs: {
description: {
Component: readme,
}
}
},
argTypes: {
checked: {
options: ['checked', 'unchecked', 'intermediate'],
control: 'radio',
},
useIntermediate: {
control: 'boolean',
},
value: {
control: 'text',
},
required: {
control: 'boolean',
},
},
}
const eventsFromNames = actions("checkedchange");
export default meta;
type Story = StoryObj;
export const Checkbox : Story = {
args:
{
checked: 'unchecked',
useIntermediate: false,
value: '1',
required: false,
},
render: (args) =>
html`
<dnn-checkbox
checked=${args.checked}
?use-intermediate=${ifDefined(args.useIntermediate)}
value=${args.value}
?required=${ifDefined(args.required)}
/>
`,
};