Skip to content

Commit 0250d0e

Browse files
authored
fix(textfield): remove extra padding on nested label and help (#2519)
* fix(textfield): nested label extra inline start padding There were styles that were adding extra inline start padding to the label and help text, when they are nested within Textfield (as shown on the docs page for Textfield). This was particularly noticeable on the quiet variation. It looks like this previously was adding padding that matched the amount of corner rounding, so text would start where the corner started its curve. On the design, there is no additional left padding. This update removes that padding to adhere to the design. * docs(textfield): use correct icon set for valid icon in storybook Define the icon set used for the valid and invalid icons in Textfield. This necessary story update was related to recent fixes to icon that addressed the fact that icons with the same name exist in both icon sets. This one wasn't caught in VRTs because Textfield does not have a kitchen sink style story yet to represent all of its states.
1 parent 8e2010c commit 0250d0e

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

components/textfield/index.css

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -616,12 +616,6 @@ governing permissions and limitations under the License.
616616
);
617617
grid-row: 1;
618618
grid-column: 1 / span 1;
619-
padding-inline-start: calc(
620-
var(
621-
--mod-textfield-corner-radius,
622-
var(--spectrum-textfield-corner-radius)
623-
) / 2
624-
);
625619
}
626620

627621
.spectrum-Textfield--quiet & {
@@ -645,12 +639,6 @@ governing permissions and limitations under the License.
645639
);
646640
grid-row: 3;
647641
grid-column: 1 / span 2;
648-
padding-inline-start: calc(
649-
var(
650-
--mod-textfield-corner-radius,
651-
var(--spectrum-textfield-corner-radius)
652-
) / 2
653-
);
654642
}
655643
}
656644

components/textfield/stories/template.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const Template = ({
3333
labelPosition = "top",
3434
labelText,
3535
iconName,
36+
iconSet,
3637
pattern,
3738
placeholder,
3839
name,
@@ -54,8 +55,13 @@ export const Template = ({
5455
console.warn(e);
5556
}
5657

57-
if (isInvalid) iconName = "Alert";
58-
else if (isValid) iconName = "Checkmark";
58+
if (isInvalid) {
59+
iconName = "Alert";
60+
iconSet = "workflow";
61+
} else if (isValid) {
62+
iconName = "Checkmark";
63+
iconSet = "ui";
64+
}
5965

6066
return html`
6167
<div
@@ -101,6 +107,7 @@ export const Template = ({
101107
...globals,
102108
size,
103109
iconName,
110+
setName: iconSet,
104111
customClasses: [
105112
!!(isInvalid || isValid)
106113
? `${rootClass}-validationIcon`

0 commit comments

Comments
 (0)