Skip to content

Commit

Permalink
Design tweaks for 35.2.x (primer#2013)
Browse files Browse the repository at this point in the history
* fixes spacing in TextInputWithTokens when there is a loading spinner

* bolds input validation text

* adds changeset

* Update src/_InputValidation.tsx

Co-authored-by: Cole Bemis <[email protected]>

* fixes linting issues and updates snapshots

* empty commit to run CI

Co-authored-by: Cole Bemis <[email protected]>
  • Loading branch information
mperrotti and colebemis authored Apr 19, 2022
1 parent 13fb052 commit 5f6c5e2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
6 changes: 6 additions & 0 deletions .changeset/orange-eels-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@primer/react': patch
---

1. Fix a spacing issue with the loading spinner in a `TextInputWithTokens`
2. Bolds form validation text to be visually balanced with the icon
4 changes: 2 additions & 2 deletions src/TextInputWithTokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ function TextInputWithTokensInnerComponent<TokenComponentType extends AnyReactCo
className={className}
contrast={contrast}
disabled={disabled}
hasLeadingVisual={Boolean(LeadingVisual)}
hasTrailingVisual={Boolean(TrailingVisual)}
hasLeadingVisual={Boolean(LeadingVisual || showLeadingLoadingIndicator)}
hasTrailingVisual={Boolean(TrailingVisual || showTrailingLoadingIndicator)}
width={widthProp}
minWidth={minWidthProp}
maxWidth={maxWidthProp}
Expand Down
3 changes: 2 additions & 1 deletion src/_InputValidation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ const InputValidation: React.FC<Props> = ({children, id, validationStatus, sx})

return (
<Text
fontSize={0}
sx={{
fontSize: 0,
fontWeight: 'bold',
alignItems: 'center',
color: fgColor,
display: 'flex',
Expand Down
20 changes: 10 additions & 10 deletions src/__tests__/__snapshots__/TextInputWithTokens.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6507,7 +6507,7 @@ Array [
background-repeat: no-repeat;
background-position: right 8px center;
padding-left: 0;
padding-right: 0;
padding-right: 12px;
padding-left: 12px;
padding-top: calc(12px / 2);
padding-bottom: calc(12px / 2);
Expand Down Expand Up @@ -6556,7 +6556,7 @@ Array [
.c0 > input,
.c0 > select {
padding-left: 12px;
padding-right: 12px;
padding-right: 0;
}
.c3 {
Expand Down Expand Up @@ -7230,7 +7230,7 @@ Array [
padding-bottom: calc(12px / 2);
background-repeat: no-repeat;
background-position: right 8px center;
padding-left: 0;
padding-left: 12px;
padding-right: 0;
padding-left: 12px;
padding-top: calc(12px / 2);
Expand Down Expand Up @@ -7279,7 +7279,7 @@ Array [
.c0 > input,
.c0 > select {
padding-left: 12px;
padding-left: 0;
padding-right: 12px;
}
Expand Down Expand Up @@ -7999,7 +7999,7 @@ Array [
background-repeat: no-repeat;
background-position: right 8px center;
padding-left: 0;
padding-right: 0;
padding-right: 12px;
padding-left: 12px;
padding-top: calc(12px / 2);
padding-bottom: calc(12px / 2);
Expand Down Expand Up @@ -8048,7 +8048,7 @@ Array [
.c0 > input,
.c0 > select {
padding-left: 12px;
padding-right: 12px;
padding-right: 0;
}
.c3 {
Expand Down Expand Up @@ -10343,7 +10343,7 @@ Array [
background-repeat: no-repeat;
background-position: right 8px center;
padding-left: 12px;
padding-right: 0;
padding-right: 12px;
padding-left: 12px;
padding-top: calc(12px / 2);
padding-bottom: calc(12px / 2);
Expand Down Expand Up @@ -10392,7 +10392,7 @@ Array [
.c0 > input,
.c0 > select {
padding-left: 0;
padding-right: 12px;
padding-right: 0;
}
.c6 {
Expand Down Expand Up @@ -11914,7 +11914,7 @@ Array [
padding-bottom: calc(12px / 2);
background-repeat: no-repeat;
background-position: right 8px center;
padding-left: 0;
padding-left: 12px;
padding-right: 12px;
padding-left: 12px;
padding-top: calc(12px / 2);
Expand Down Expand Up @@ -11963,7 +11963,7 @@ Array [
.c0 > input,
.c0 > select {
padding-left: 12px;
padding-left: 0;
padding-right: 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,7 @@ exports[`ChoiceFieldset renders with a success validation message 1`] = `
.c12 {
font-size: 12px;
font-weight: bold;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
Expand Down Expand Up @@ -1050,7 +1051,6 @@ exports[`ChoiceFieldset renders with a success validation message 1`] = `
>
<span
class="c12"
font-size="0"
>
<span
aria-hidden="true"
Expand Down Expand Up @@ -1163,6 +1163,7 @@ exports[`ChoiceFieldset renders with an error validation message 1`] = `
.c12 {
font-size: 12px;
font-weight: bold;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
Expand Down Expand Up @@ -1296,7 +1297,6 @@ exports[`ChoiceFieldset renders with an error validation message 1`] = `
>
<span
class="c12"
font-size="0"
>
<span
aria-hidden="true"
Expand Down

0 comments on commit 5f6c5e2

Please sign in to comment.