Skip to content

Commit 04b6544

Browse files
authored
Update label spacing on various components (#416)
* update label spacing on select component * update label spacing on taggroup component * update label spacing on textfield component * simplify isRequired handling and remove unused class * update label spacing on textarea component * simplify isRequired handling and remove unused class
1 parent 94931bf commit 04b6544

File tree

5 files changed

+7
-11
lines changed

5 files changed

+7
-11
lines changed

packages/react-components/src/components/Select/Select.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.bcds-react-aria-Select {
22
display: flex;
33
flex-direction: column;
4-
gap: var(--layout-margin-small);
54
align-items: flex-start;
65
/* Hacks for `stretch`: https://caniuse.com/mdn-css_properties_max-width_stretch */
76
max-width: -moz-available;
@@ -12,6 +11,7 @@
1211
.bcds-react-aria-Select--Label {
1312
color: var(--typography-color-secondary);
1413
font: var(--typography-regular-small-body);
14+
padding: var(--layout-padding-xsmall) var(--layout-padding-none);
1515
}
1616
.bcds-react-aria-Select[data-disabled] > .bcds-react-aria-Select--Label {
1717
color: var(--typography-color-disabled);

packages/react-components/src/components/TagGroup/TagGroup.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.bcds-react-aria-TagGroup--Text-description,
88
.bcds-react-aria-TagGroup--Text-error {
99
display: block;
10-
margin: var(--layout-margin-small) var(--layout-margin-none);
10+
padding: var(--layout-padding-xsmall) var(--layout-padding-none);
1111
}
1212

1313
.bcds-react-aria-TagGroup--Text-error {

packages/react-components/src/components/TextArea/TextArea.css

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@
1111
.bcds-react-aria-TextArea--Label {
1212
font: var(--typography-regular-small-body);
1313
color: var(--typography-color-primary);
14-
}
15-
16-
.bcds-react-aria-TextArea--Label > .required {
17-
color: var(--typography-color-secondary);
18-
padding: var(--layout-padding-none) var(--layout-padding-xsmall);
14+
padding: var(--layout-padding-xsmall) var(--layout-padding-none);
1915
}
2016

2117
/* Styles for the description and character count slot below the input field */
2218
.bcds-react-aria-TextArea--Description {
2319
display: grid;
2420
gap: var(--layout-margin-medium);
21+
padding: var(--layout-padding-xsmall) var(--layout-padding-none);
2522
font: var(--typography-regular-small-body);
2623
color: var(--typography-color-secondary);
2724
}
@@ -51,7 +48,6 @@
5148
var(--surface-color-border-default);
5249
border-radius: var(--layout-border-radius-medium);
5350
padding: var(--layout-padding-small) 12px;
54-
margin: var(--layout-margin-small) var(--layout-margin-none);
5551
}
5652

5753
/* Text input field */

packages/react-components/src/components/TextArea/TextArea.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ export default function TextArea({
4444
<>
4545
{label && (
4646
<Label className="bcds-react-aria-TextArea--Label">
47-
{label}
48-
{isRequired && <span className="required">(required)</span>}
47+
{isRequired ? `${label} (required)` : label}
4948
</Label>
5049
)}
5150
<div className="bcds-react-aria-TextArea--Container">

packages/react-components/src/components/TextField/TextField.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
.bcds-react-aria-TextField--Label {
1212
font: var(--typography-regular-small-body);
1313
color: var(--typography-color-primary);
14+
padding: var(--layout-padding-xsmall) var(--layout-padding-none);
1415
}
1516

1617
.bcds-react-aria-TextField--Label .required {
@@ -22,6 +23,7 @@
2223
.bcds-react-aria-TextField--Description {
2324
font: var(--typography-regular-small-body);
2425
color: var(--typography-color-secondary);
26+
padding: var(--layout-padding-xsmall) var(--layout-padding-none);
2527
}
2628

2729
/* Styles for the input field container */
@@ -36,7 +38,6 @@
3638
border: var(--layout-border-width-small) solid
3739
var(--surface-color-border-default);
3840
border-radius: var(--layout-border-radius-medium);
39-
margin: var(--layout-margin-small) var(--layout-margin-none);
4041
padding: var(--layout-padding-small) 12px;
4142
}
4243

0 commit comments

Comments
 (0)