/
checkbox.stories.ts
48 lines (44 loc) · 1.37 KB
/
checkbox.stories.ts
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
import { html } from '@microsoft/fast-element';
import type { Meta, StoryObj } from '@storybook/html';
import { withXD } from 'storybook-addon-xd-designs';
import { createRenderer } from '../../utilities/tests/storybook';
import '../index';
interface CheckboxArgs {
label: string;
checked: boolean;
disabled: boolean;
}
const metadata: Meta<CheckboxArgs> = {
title: 'Checkbox',
decorators: [withXD],
parameters: {
docs: {
description: {
component:
'Per [W3C](https://w3c.github.io/aria-practices/#checkbox) – The dual-state checkbox is the most common type, as it allows the user to toggle between two choices -- checked and not checked.'
}
},
design: {
artboardUrl:
'https://xd.adobe.com/view/8ce280ab-1559-4961-945c-182955c7780b-d9b1/screen/3698340b-8162-4e5d-bf7a-20194612b3a7/specs'
},
actions: {
handles: ['change']
}
},
render: createRenderer(html`
<nimble-checkbox
?checked="${x => x.checked}"
?disabled="${x => x.disabled}"
>
${x => x.label}
</nimble-checkbox>
`),
args: {
label: 'Checkbox label',
checked: false,
disabled: false
}
};
export default metadata;
export const checkbox: StoryObj<CheckboxArgs> = {};