Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.

Commit b848c7f

Browse files
authored
Merge pull request #94 from thepensionsregulator/feature-form-elements-default-spacing
default checkboxes and radio buttons spacing applied
2 parents be7d030 + 627865e commit b848c7f

5 files changed

Lines changed: 17 additions & 10 deletions

File tree

packages/forms/src/elements/checkbox/checkbox.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
font-size: $font-size-2;
3131
font-weight: $font-weight-2;
3232
margin-top: $space-2;
33-
margin-left: 60px;
33+
margin-left: 55px;
3434
}

packages/forms/src/elements/checkbox/checkbox.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ export const Checkbox: React.FC<Partial<CheckboxIconProps>> = ({
2222
<StyledInputLabel
2323
element="div"
2424
cfg={Object.assign(
25-
{ mt: 1, py: 1, alignItems: 'flex-start', flexDirection: 'column' },
25+
{
26+
mt: 1,
27+
mb: 3,
28+
alignItems: 'flex-start',
29+
flexDirection: 'column',
30+
},
2631
cfg,
2732
)}
2833
>
@@ -38,7 +43,7 @@ export const Checkbox: React.FC<Partial<CheckboxIconProps>> = ({
3843
) : (
3944
<CheckboxBlank className={styles.checkbox} />
4045
)}
41-
<P cfg={{ ml: 4, fontWeight: 3 }}>{label}</P>
46+
<P cfg={{ ml: 3, fontWeight: 3 }}>{label}</P>
4247
</label>
4348
{hint && <P className={styles.hint}>{hint}</P>}
4449
</StyledInputLabel>

packages/forms/src/elements/radio/radio.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,23 @@ import { FFRadioButton } from '@tpr/forms';
5252
name={FIELD_NAME}
5353
value="value_a"
5454
label="Select Value A"
55-
cfg={{ mb: 4 }}
5655
/>
5756
<FFRadioButton
5857
name={FIELD_NAME}
5958
value="value_b"
6059
label="Select Value B"
6160
hint="Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ea obcaecati repellat molestias nemo deleniti eveniet vel similique nesciunt fugiat nisi?"
62-
cfg={{ mb: 4 }}
6361
/>
6462
<FFRadioButton
6563
name={FIELD_NAME}
6664
value="value_c"
6765
label="Select Value C"
68-
cfg={{ mb: 4 }}
6966
/>
7067
<FFRadioButton
7168
name={FIELD_NAME}
7269
value="value_d"
7370
label="Select Value D"
7471
hint="Lorem, ipsum dolor sit amet consectetur adipisicing elit."
75-
cfg={{ mb: 4 }}
7672
/>
7773
<FFRadioButton
7874
name={FIELD_NAME}

packages/forms/src/elements/radio/radio.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
.label {
2929
line-height: 27px;
30-
padding-left: $space-2;
30+
padding-left: $space-1;
3131
cursor: pointer;
3232
}
3333

@@ -41,5 +41,5 @@
4141
font-size: $font-size-2;
4242
font-weight: $font-weight-2;
4343
margin-top: $space-2;
44-
margin-left: 60px;
44+
margin-left: 55px;
4545
}

packages/forms/src/elements/radio/radio.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ export const RadioButton: React.FC<RadioButtonProps> = ({
2525
<StyledInputLabel
2626
element="div"
2727
cfg={Object.assign(
28-
{ mt: 1, py: 1, alignItems: 'flex-start', flexDirection: 'column' },
28+
{
29+
mt: 1,
30+
mb: 3,
31+
py: 1,
32+
alignItems: 'flex-start',
33+
flexDirection: 'column',
34+
},
2935
cfg,
3036
)}
3137
>

0 commit comments

Comments
 (0)