@1024pix/pix-ui 46.7.0 → 46.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,12 +24,16 @@ Pour les considérer comme un seul groupe d'inputs, **il est nécessaire qu'ils
|
|
|
24
24
|
|
|
25
25
|
<Story of={ComponentStories.multiple} height={140} />
|
|
26
26
|
|
|
27
|
-
###
|
|
27
|
+
### Variations graphiques du composant
|
|
28
28
|
|
|
29
|
-
PixRadioButton prend
|
|
29
|
+
Le PixRadioButton prend toute la largeur à sa disposition.
|
|
30
30
|
|
|
31
31
|
<Story of={ComponentStories.FullWidth} height={100} />
|
|
32
32
|
|
|
33
|
+
Si le paramètre `variant` est précisé avec la valeur `tile`, le radiobutton et son label sont visuellement regroupés dans un ensemble intégralement cliquable.
|
|
34
|
+
|
|
35
|
+
<Story of={ComponentStories.VariantTile} height={100} />
|
|
36
|
+
|
|
33
37
|
## Disabled
|
|
34
38
|
|
|
35
39
|
L'attribut `@isDisabled` permet de désactiver la radio en conservant la possibilité de naviguer avec le clavier ou le lecteur d'écran. Il est préféré à l'attribut natif `disabled` qui empêche ces usages.
|
|
@@ -114,6 +114,23 @@ const FullWidthTemplate = (args) => {
|
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
+
const VariantTileTemplate = (args) => {
|
|
118
|
+
return {
|
|
119
|
+
template: hbs`{{! template-lint-disable no-inline-styles }}
|
|
120
|
+
<div
|
|
121
|
+
style='border: 1px solid var(--pix-neutral-500); background: var(--pix-neutral-20); padding: var(--pix-spacing-4x); width: 500px'
|
|
122
|
+
><PixRadioButton
|
|
123
|
+
@id={{this.id}}
|
|
124
|
+
@isDisabled={{this.isDisabled}}
|
|
125
|
+
checked={{this.checked}}
|
|
126
|
+
@variant='tile'
|
|
127
|
+
>
|
|
128
|
+
<:label>{{this.label}}</:label>
|
|
129
|
+
</PixRadioButton></div>`,
|
|
130
|
+
context: args,
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
|
|
117
134
|
export const Default = Template.bind({});
|
|
118
135
|
Default.args = {
|
|
119
136
|
label: 'Poivron',
|
|
@@ -130,12 +147,25 @@ FullWidth.args = {
|
|
|
130
147
|
label: 'Une réponse',
|
|
131
148
|
};
|
|
132
149
|
|
|
150
|
+
export const VariantTile = VariantTileTemplate.bind({});
|
|
151
|
+
VariantTile.args = {
|
|
152
|
+
id: 'proposal',
|
|
153
|
+
label: 'Une réponse',
|
|
154
|
+
};
|
|
155
|
+
|
|
133
156
|
export const isDisabled = Template.bind({});
|
|
134
157
|
isDisabled.args = {
|
|
135
158
|
...Default.args,
|
|
136
159
|
isDisabled: true,
|
|
137
160
|
};
|
|
138
161
|
|
|
162
|
+
export const isDisabledVariantTile = VariantTileTemplate.bind({});
|
|
163
|
+
isDisabledVariantTile.args = {
|
|
164
|
+
id: 'accept-newsletter-2',
|
|
165
|
+
label: 'Recevoir la newsletter',
|
|
166
|
+
isDisabled: true,
|
|
167
|
+
};
|
|
168
|
+
|
|
139
169
|
export const checkedIsDisabled = Template.bind({});
|
|
140
170
|
checkedIsDisabled.args = {
|
|
141
171
|
...Default.args,
|
|
@@ -143,6 +173,14 @@ checkedIsDisabled.args = {
|
|
|
143
173
|
checked: true,
|
|
144
174
|
};
|
|
145
175
|
|
|
176
|
+
export const checkedIsDisabledVariantTile = VariantTileTemplate.bind({});
|
|
177
|
+
checkedIsDisabledVariantTile.args = {
|
|
178
|
+
id: 'accept-newsletter-2',
|
|
179
|
+
label: 'Recevoir la newsletter',
|
|
180
|
+
isDisabled: true,
|
|
181
|
+
checked: true,
|
|
182
|
+
};
|
|
183
|
+
|
|
146
184
|
/* Multiple components story */
|
|
147
185
|
const multipleTemplate = (args) => {
|
|
148
186
|
return {
|