Skip to content

Commit b093cff

Browse files
fix(DsfrRadioButton): Add missing small prop to use fr-radio-group--sm on DsfrRadioButton
1 parent b718760 commit b093cff

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

src/components/DsfrRadioButton/DsfrRadioButton.stories.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ export default {
1616
control: 'object',
1717
description: 'Tableau d’objets : chaque objet contient les props à passer à `DsfrRadioButton` - *N.B. : Ne fait pas partie du composant',
1818
},
19+
small: {
20+
control: 'boolean',
21+
description: 'Utilise la version réduite du bouton radio',
22+
},
1923
// label: {
2024
// control: 'text',
2125
// description: 'Label du bouton radio',
@@ -53,6 +57,7 @@ export const RadioButton = (args, { argTypes }) => ({
5357
v-for="option of options"
5458
:modelValue="modelValue"
5559
v-bind="option"
60+
:small="small"
5661
@update:modelValue="updateCheckedValue($event)"
5762
/>
5863
</div>
@@ -71,6 +76,7 @@ export const RadioButton = (args, { argTypes }) => ({
7176
})
7277
RadioButton.args = {
7378
modelValue: '3',
79+
small: false,
7480
options: [
7581
{
7682
label: 'Valeur 1',
@@ -103,6 +109,7 @@ export const RichRadioButton = (args, { argTypes }) => ({
103109
v-for="option of options"
104110
:modelValue="modelValue"
105111
v-bind="option"
112+
:small="small"
106113
@update:modelValue="updateCheckedValue($event)"
107114
/>
108115
`,
@@ -118,6 +125,7 @@ export const RichRadioButton = (args, { argTypes }) => ({
118125
})
119126
RichRadioButton.args = {
120127
modelValue: '3',
128+
small: false,
121129
options: [
122130
{
123131
label: 'Valeur 1',

src/components/DsfrRadioButton/DsfrRadioButton.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default defineComponent({
2020
type: [String, Number],
2121
default: '',
2222
},
23+
small: Boolean,
2324
value: {
2425
type: [String, Number],
2526
required: true,
@@ -51,7 +52,10 @@ export default defineComponent({
5152
<template>
5253
<div
5354
class="fr-radio-group"
54-
:class="rich ? 'fr-radio-rich' : ''"
55+
:class="{
56+
'fr-radio-rich': rich,
57+
'fr-radio-group--sm': small,
58+
}"
5559
>
5660
<input
5761
:id="id"

src/components/DsfrRadioButton/DsfrRadioButtonSet.stories.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export default {
1919
control: 'text',
2020
description: 'Valeur de l’attribut `name` de chaque bouton radio du groupe',
2121
},
22+
small: {
23+
control: 'boolean',
24+
description: 'Utilise la version réduite des boutons radio',
25+
},
2226
// legend: {
2327
// control: 'text',
2428
// description: 'Titre du groupe de bouton',
@@ -66,6 +70,7 @@ GroupeDeBoutonsRadio.args = {
6670
legend: 'Légende des champs',
6771
inline: false,
6872
modelValue: '3',
73+
small: false,
6974
options: [
7075
{
7176
label: 'Valeur 1',
@@ -107,6 +112,7 @@ GroupeDeBoutonsRadioRequis.args = {
107112
inline: false,
108113
required: true,
109114
modelValue: '3',
115+
small: false,
110116
options: [
111117
{
112118
label: 'Valeur 1',
@@ -152,6 +158,7 @@ GroupeDeBoutonsRadioRequisPersonnalise.args = {
152158
inline: false,
153159
required: true,
154160
modelValue: '3',
161+
small: false,
155162
options: [
156163
{
157164
label: 'Valeur 1',

src/components/DsfrRadioButton/DsfrRadioButtonSet.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default defineComponent({
2222
disabled: Boolean,
2323
inline: Boolean,
2424
required: Boolean,
25+
small: Boolean,
2526
name: {
2627
type: String,
2728
default: 'no-name',
@@ -111,6 +112,7 @@ export default defineComponent({
111112
:key="option.value || i"
112113
:name="name"
113114
v-bind="option"
115+
:small="small"
114116
:model-value="modelValue"
115117
@update:model-value="onChange"
116118
/>

0 commit comments

Comments
 (0)