Skip to content

feat(text-input): new xs size#22038

Merged
maradwan26 merged 7 commits into
carbon-design-system:mainfrom
maradwan26:textinput-xs-condensed
Apr 22, 2026
Merged

feat(text-input): new xs size#22038
maradwan26 merged 7 commits into
carbon-design-system:mainfrom
maradwan26:textinput-xs-condensed

Conversation

@maradwan26

@maradwan26 maradwan26 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Closes #21781
Partially addresses #21969
Contributes to #21786

Adds xs size to TextInput with contextual layout token support in Web Components

Changelog

New

  • Added xs size and updated storybook control accordingly
  • Set up contextual layout tokens support in Web Components
  • Added "Inline" story to React and Web Components
  • Added size prop/attribute to TextInputSkeleton, along with the new xs size
  • Unrelated to TextInput: Fixed an issue with the cds--form-requirement class not breaking words to wrap text
    • Before:
      • Screenshot 2026-04-15 at 4 13 59 PM
    • After:
      • Screenshot 2026-04-15 at 4 14 09 PM

Changed

  • Aligned inline variant with design spec
    • Changed render layout
    • Updated respective styles
  • Fixed an issue with TextInput where the invalid and ai-label icons were rendering in the incorrect order.
    • Updated order from ai-label -> invalid to invalid -> ai-label
  • Fixed some padding issues with TextInput where the input text would overlap with the AILabel icon
  • Fixed an issue with PasswordInput where invalidText would not render when in inline variant
  • Fixed an issue with PasswordInput where invalidText did not have the colour $text-error when in inline variant
  • Increased the max-inline-size of the label/helper/invalid/warn-text from 128px to 142px to align with the design spec and fit "Error message goes here" into one line and not overflow into a second line
    • Please let me know if you think this should be reverted back to 128px

Removed

  • Removed cds--label--inline--lg class from the styles

Testing / Reviewing

  • Check TextInput stories in React and WC
  • xs, sm, md, and lg should render as expected
  • TextInputSkeleton should render as expected and also respect size
  • There should be no regressions to TextInput or any other related components

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation and storybook examples
  • [ ] Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

@netlify

netlify Bot commented Apr 15, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 8cfee54
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/69e003da14ee6300085ee46f
😎 Deploy Preview https://deploy-preview-22038--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Apr 15, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 8cfee54
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/69e003dacee52d00094dda28
😎 Deploy Preview https://deploy-preview-22038--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Apr 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.38710% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.89%. Comparing base (b43ddc5) to head (8cfee54).
⚠️ Report is 34 commits behind head on main.

Files with missing lines Patch % Lines
...components/src/components/text-input/text-input.ts 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #22038      +/-   ##
==========================================
- Coverage   94.91%   94.89%   -0.02%     
==========================================
  Files         539      539              
  Lines       45015    45055      +40     
  Branches     6352     6419      +67     
==========================================
+ Hits        42727    42756      +29     
- Misses       2156     2167      +11     
  Partials      132      132              
Flag Coverage Δ
main-packages 89.00% <100.00%> (+<0.01%) ⬆️
web-components 97.71% <98.07%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@maradwan26 maradwan26 marked this pull request as ready for review April 15, 2026 21:28
@maradwan26 maradwan26 requested review from a team as code owners April 15, 2026 21:28
@maradwan26

maradwan26 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

@alina-jacob

Just had some thoughts regarding the inline variants:

So in the design spec, it shows the inline variant with and without an invalid state, with the input field having the same size in both of them. I think it's worth noting that these two components shown are technically different sizes in a dev environment:

image

So for example, if an adopter was using the size of the inline text-input on the top, and then set the state to invalid afterwards, it would not look like the invalid state shown in the screenshot above. The input field would shrink to fit the error message since it's longer than the helper text. This is because let's say the TextInput is 500px wide for example, the label text, input field, and helper text all share that 500px width. If an invalid state is then set, with an error message that is longer than the helper text, since the TextInput is 500px wide, the input field has to shrink to accommodate for the error message. It would essentially look like if the invalid state in the screenshot above shrunk its input field to fit within the pink line I drew.

There's also the case of text overflow. I'm not sure if long error messages are advised against or not for inline variants, but nonetheless, if the error message is super long it can wrap to 2+ lines and hang down below the input field.

I've aligned the TextInput inline variant with the design spec in this PR, but let me know if this variant needs to be revisited. Right now a lot of the components do not follow the current inline variant design spec (e.g. Dropdown, MultiSelect, etc.) so I think it's still early enough to define how inline should behave.

@alina-jacob alina-jacob left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @maradwan26, thanks for working on this.
Everything from an XS size implementation perspective looks good to go! 🚀
Extra thanks for the detailed PR description, super helpful!


To address some of your open questions, I had to go down the history lane to find Inline Text input's introduction

  • I think the Inline Text input was implemented without a design spec.
  • This PR doesn't fully resolve error and warning states for Inline components, attaching screenshot for reference.
image
  • For now, in context of this PR, your current implementation looks better than existing buggy implementation, but definitely worth having a solid opinion on all Inline field input components. I have created an issue for the same.

@tay1orjones tay1orjones enabled auto-merge April 22, 2026 14:18
@tay1orjones tay1orjones added this pull request to the merge queue Apr 22, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 22, 2026
@maradwan26 maradwan26 added this pull request to the merge queue Apr 22, 2026
Merged via the queue into carbon-design-system:main with commit 8959b3a Apr 22, 2026
38 of 39 checks passed
@maradwan26 maradwan26 deleted the textinput-xs-condensed branch April 22, 2026 16:17
MarianaAa01 pushed a commit to MarianaAa01/carbon that referenced this pull request May 29, 2026
* feat(text-input): new xs size

* fix: password input, flex wrap

* fix(form): break word on overflow

* feat(storybook): new size control and inline story

* chore: update snapshots

* feat(skeleton): size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Condensed components] Text input: Implementation

4 participants