-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathstory.js
80 lines (78 loc) · 1.77 KB
/
story.js
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { html } from 'lit';
import {
CarSvg,
PlaneSvg,
SailBoatSvg,
} from '@axa-ch-webhub-cloud/materials/images';
import { args, argTypes } from './story.args';
import changelog from './CHANGELOG.md';
import readme from './README.md';
import './index';
import '../text';
import '../fieldset';
export default {
title: 'Components/Radio',
parameters: {
readme,
usage: {
propsPureHTML: 'checked',
propsReact:
'checked={checked} onChange={() => alert("you interacted with me")}',
},
changelog,
},
args,
argTypes,
};
export const Radio = ({
label,
checked,
focus,
disabled,
button,
icon,
noGap,
noAutoWidth,
}) =>
html`
<axa-text size="3">
Knobs with a * only affect the first radio button
</axa-text>
<br />
<axa-text size="2"> What type of vehicle do you want to insure? </axa-text>
<br />
<axa-fieldset ?horizontal=${button}>
<axa-radio
name="contract"
label="${label}"
?focus="${focus}"
?checked="${checked}"
icon="${icon ? CarSvg : ''}"
?nogap="${noGap}"
?button="${button}"
?disabled="${disabled}"
?noautowidth="${noAutoWidth}"
value="1"
></axa-radio>
<axa-radio
name="contract"
icon="${icon ? PlaneSvg : ''}"
?nogap="${noGap}"
?button="${button}"
?disabled="${disabled}"
?noautowidth="${noAutoWidth}"
label="plane"
value="2"
></axa-radio>
<axa-radio
name="contract"
icon="${icon ? SailBoatSvg : ''}"
?nogap="${noGap}"
?button="${button}"
?disabled="${disabled}"
?noautowidth="${noAutoWidth}"
label="sailboat"
value="3"
></axa-radio>
</axa-fieldset>
`;