fix: improve Input component alignment and sizing - #4531
Conversation
6a3fda2 to
47b80a7
Compare
|
@claude review |
|
Claude finished @pomfrida's task in 1m 27s —— View job Code Review Complete
SummaryThis is a well-executed PR that improves the Input component's sizing, alignment, and token usage. The code quality is high and follows EDS conventions. I found a few minor issues and suggestions for improvement. Issues Found1. Potential CSS Variable Override Risk (
|
- Add showErrorIcon prop to optionally hide error icon (for Search pattern) - Fix button alignment in adornments (constrain to 20x20px) - Fix adornment colors to stay subtle in all states - Update comfortable density to 24px height (from 28px) - Add negative margins to align buttons with icon adornments - Remove data-font-family from adornment wrappers - Use tokens instead of hardcoded values where possible - Update stories with Search patterns and European currency examples - Add comprehensive tests for showErrorIcon behavior - Update documentation to remove incorrect color inheritance claims Fixes #4522 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
47b80a7 to
737c27b
Compare
- Remove incorrect placeholder color override in readonly state (lines 102-106) This was creating a CSS variable scoping issue where placeholder used the default color instead of readonly color - Add test for readonly + invalid showing neutral appearance - Add test for error icon hidden in readonly + invalid state Addresses review feedback on PR #4531 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
pomfrida
left a comment
There was a problem hiding this comment.
Nice job improving, looking good ✨
A few observations for future iterations (not blocking):
- Overriding Button size/padding from Input's CSS is a reasonable approach for the current use case, though a dedicated small button variant could be cleaner long-term (already discussed but will need a more thorough plan how to do this)
- data-invalid still being set on the container when readOnly is harmless since the readonly CSS rules come after and override the invalid styles — just worth being aware of if the CSS is eve reordered
- Tests using container.querySelector('.eds-error-icon') work fine; adding a data-testid would be a nice-to-have to avoid the eslint-disable comments
Summary
Fixes #4522 - Improves Input component
button alignment, sizing, density
handling, and token usage.
Key Changes
Button Alignment & Sizing:
20x20px to match Input content height
align buttons with icon adornments
wrappers to allow margins to work
margins
Density Support:
(was 28px)
--eds-spacing-proportions-xs-vertical
token for comfortable override
Semantic Token Aliases:
background (until proper token
available)
.eds-input element (ensures gray in
invalid state)
readonly text
--eds-color-text-disabled (aligned with
PR refactor: use semantic disabled tokens in next components #4529)
API Improvements:
(more intuitive - only set when hiding)
documentation
TextField Storybook Improvements:
containerClassName controls
categories (States, Styling, Other)
descriptions from adornments
Other Improvements:
(margin-inline-start/end)
default placeholder
and European currency examples
Visual Changes
Comfortable 24px ✓
aligned with icons
state (background/border turn red)
states
Test Plan
rename
both densities
correctly
states
🤖 Generated with
https://claude.com/claude-code