Skip to content

Commit 688c9f8

Browse files
committed
feat: allow description in boolean field
1 parent 81d2841 commit 688c9f8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/components/Form/BooleanField/BooleanFieldCheckbox.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export type BooleanFieldCheckboxProps = Simplify<
1313
>;
1414

1515
export const BooleanFieldCheckbox = ({
16+
description,
1617
disabled,
1718
error,
1819
label,
@@ -36,6 +37,7 @@ export const BooleanFieldCheckbox = ({
3637
}}
3738
/>
3839
<Label htmlFor={name}>{label}</Label>
40+
<FieldGroup.Description description={description} />
3941
</FieldGroup.Row>
4042
<FieldGroup.Error error={error} />
4143
</FieldGroup>

src/components/Form/BooleanField/BooleanFieldRadio.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type BooleanFieldRadioProps = Simplify<
2424
>;
2525

2626
export const BooleanFieldRadio = ({
27+
description,
2728
disabled,
2829
error,
2930
label,
@@ -55,11 +56,12 @@ export const BooleanFieldRadio = ({
5556
value={stringifyBoolean(value)}
5657
onValueChange={handleValueChange}
5758
>
59+
<FieldGroup.Description description={description} />
5860
<FieldGroup.Row>
5961
<RadioGroup.Item id={`${name}-true`} value="true" />
6062
<Label
6163
aria-disabled={disabled || readOnly}
62-
className="font-normal text-muted-foreground"
64+
className="text-muted-foreground font-normal"
6365
htmlFor={`${name}-true`}
6466
>
6567
{options?.true ?? t('form.radioLabels.true')}
@@ -69,7 +71,7 @@ export const BooleanFieldRadio = ({
6971
<RadioGroup.Item id={`${name}-false`} value="false" />
7072
<Label
7173
aria-disabled={disabled || readOnly}
72-
className="font-normal text-muted-foreground"
74+
className="text-muted-foreground font-normal"
7375
htmlFor={`${name}-false`}
7476
>
7577
{options?.false ?? t('form.radioLabels.false')}

0 commit comments

Comments
 (0)