Skip to content

feat(search): contextual layout tokens, xs size#21721

Merged
maradwan26 merged 23 commits into
carbon-design-system:mainfrom
maradwan26:search-xs-condensed
Apr 24, 2026
Merged

feat(search): contextual layout tokens, xs size#21721
maradwan26 merged 23 commits into
carbon-design-system:mainfrom
maradwan26:search-xs-condensed

Conversation

@maradwan26

@maradwan26 maradwan26 commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Closes #21685
Closes #20949
Partially addresses #13923

Adds xs size and its respective styles to the Search component in React and WC as well as connecting to contextual layout tokens. Also adds controls to all stories.

Changelog

New

  • Added xs size and its respective styles in React and WC
  • Fixes an issue where disabled styles were not properly rendering in Web Components
  • Added controls to every story
  • Added a new defs.ts file for cds-search since xs is not available in text-input/defs.ts
    • Updated related imports
  • Setup contextual layout tokens
    • Added styles to cds-table-toolbar-search for the close button that match the ones present in React: 1, 2.
      • This was done because the WC version of table-toolbar-search was relying on a size selector search--lg for the appropriate styles to be applied. This PR removes that size selector, so I've moved the styles to the table-toolbar-search itself, like how it's done in React

Changed

  • Fixed Search Skeleton in both React and WC
    • Deprecated small prop in React in favour of new size prop
    • Aligned both with design spec
    • Added a story to showcase this component
    • Removed cds--search--xl class in React since the class does not have any attached styles

Removed

  • Removed size classes (e.g. search--sm) and size related style rules in favour of using contextual layout tokens
    • This should not cause any breaking visual changes changes to Search, nor any other components
    • Added TODO comments for these classes to be removed in V12

Testing / Reviewing

  • Check Search stories in React and WC
  • xs, sm, md, and lg should render as expected
  • SearchSkeleton should render as expected and also respect size
  • There should be no regressions to Search 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

More details can be found in the pull request guide

@netlify

netlify Bot commented Mar 5, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 007801e
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/69a9b7b845508b000856d303
😎 Deploy Preview https://deploy-preview-21721--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 Mar 5, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c95851b
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/69e7cddb6553d100080b61d0
😎 Deploy Preview https://deploy-preview-21721--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.

@maradwan26 maradwan26 marked this pull request as ready for review March 5, 2026 17:18
@maradwan26 maradwan26 requested a review from a team as a code owner March 5, 2026 17:18
@maradwan26 maradwan26 requested a review from a team as a code owner March 5, 2026 17:21
@maradwan26 maradwan26 requested a review from tay1orjones March 5, 2026 17:21
@netlify

netlify Bot commented Mar 5, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit c95851b
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/69e7cddb1912800008122ae7
😎 Deploy Preview https://deploy-preview-21721--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 Mar 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.02%. Comparing base (0df8173) to head (c95851b).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21721      +/-   ##
==========================================
+ Coverage   95.01%   95.02%   +0.01%     
==========================================
  Files         538      539       +1     
  Lines       44982    45022      +40     
  Branches     6459     6517      +58     
==========================================
+ Hits        42739    42784      +45     
+ Misses       2114     2109       -5     
  Partials      129      129              
Flag Coverage Δ
main-packages 89.05% <100.00%> (+0.02%) ⬆️
web-components 97.86% <100.00%> (+<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.

Comment thread packages/react/src/components/Search/Search.stories.js Outdated
Comment thread packages/react/src/components/Search/Search.stories.js Outdated
Comment thread packages/styles/scss/components/search/_search.scss Outdated
@laurenmrice laurenmrice requested review from laurenmrice and removed request for alina-jacob March 5, 2026 21:11

@laurenmrice laurenmrice 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.

There are unrelated bugs to this PR which I opened a separate issue for in regards to the disabled state. (#21725)


React

  • Looks good to me!

WC

Expandable With Layer and With Layer stories

  • When changing the size, not to just xs but to any other size, the storybook only visually changes the $background example. If you hit the refresh button, then it changes the other $layer-01 and $layer-02 examples. But I am just wondering if it can change without having to click refresh like React currently does.

@maradwan26

Copy link
Copy Markdown
Contributor Author

@laurenmrice

When changing the size, not to just xs but to any other size, the storybook only visually changes the $background example. If you hit the refresh button

This is a bug with the storybook with-layer template in Web Components. I was just about to open an issue for this but it looks like a PR that fixes this was just opened yesterday 🥳

@maradwan26 maradwan26 requested a review from laurenmrice March 6, 2026 16:43
@devadula-nandan

devadula-nandan commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Hi @maradwan26,
As per the epic

Dev: Implement in both React and Web Components as well as connecting to the Contextual layout tokens. Question for Dev: Figma Code Connect?

Looks like the goal is to adopt contextual layout tokens into mentioned components?
as per the discussions in todays round robin, we might as well look into bringing the contextual layout token support into WC if not yet explored.

Please feel free to review the scope and determine whether we need to revisit Contextual layout tokens later. and update the epic.

@laurenmrice laurenmrice 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.

Oh okay great, thanks @maradwan26, looks good visually!

I agree with Nandan above^, we need to figure out if we will be connecting contextual tokens at this time in these PRs, or if we should do them separately.

@maradwan26 maradwan26 marked this pull request as ready for review April 9, 2026 22:52
@maradwan26

maradwan26 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

@devadula-nandan @sangeethababu9223 @tay1orjones @laurenmrice @adamalston

This PR is ready for review 🚀. Contextual layout tokens have been set up, PR description has been updated as some other changes were made and some fixes have been made to the SearchSkeleton to align it with its design spec

I re-requested a visual review mainly for the SearchSkeleton, the normal Search should still look and behave the same as it did when it got approved.

@maradwan26 maradwan26 moved this from 🏗 In Progress to 🚦 In Review in Design System Apr 9, 2026
@maradwan26 maradwan26 changed the title feat(search): new xs size feat(search): contextual layout tokens, xs size Apr 9, 2026
Comment thread packages/react/src/components/Search/Search.Skeleton.tsx Outdated
Comment thread packages/react/src/components/Search/Search-test.js
@maradwan26 maradwan26 added this pull request to the merge queue Apr 24, 2026
Merged via the queue into carbon-design-system:main with commit 9156074 Apr 24, 2026
39 checks passed
@maradwan26 maradwan26 deleted the search-xs-condensed branch April 24, 2026 15:55
@github-project-automation github-project-automation Bot moved this from 🚦 In Review to ✅ Done in Design System Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

[Condensed components] Search: Implementation [Search]: add controls args to every story

4 participants