Skip to content

chore: Adds internal style api v2 to select and autosuggest - #5205

Open
vvaliyev wants to merge 1 commit into
mainfrom
style-v2-select-autosuggest
Open

vvaliyev wants to merge 1 commit into
mainfrom
style-v2-select-autosuggest

Conversation

@vvaliyev

@vvaliyev vvaliyev commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Description

Adds the internal Style API v2 to Select (trigger, inlineLabel, filter forwards to Input, dropdown forwards to Dropdown) and Autosuggest (input forwards to Input, dropdown forwards to Dropdown). Options have no slot; renderOption covers them.

Changes outside the two components:

  • select/parts/styles.scss: the placeholder colour token is carried on the trigger button, which Multiselect shares; a no-op there until Multiselect passes classes.
  • internal/components/option: Options rendered with triggerVariant (the Select trigger with triggerVariant="option", and inline Tokens) get an in-trigger class that inherits font-family, font-size, font-weight and color from the host. Visual refresh is unchanged. In the classic theme, light mode, the label of a disabled Select with triggerVariant="option" now renders in the trigger's disabled text colour (#879596) instead of the option's (#aab7b8).

Known gap: with tokens on Autosuggest the visible field box is the token field, which has no slot yet; the input forward reaches only the native input inside it.

The style-docs snapshot and the VR registration of the dev pages follow in one PR for all components.

Tracker sections: P3d34KdbCd6o.

Related links, issue #, if available: n/a

How has this been tested?

Unit tests for every slot and forward, dev pages select/style-api-v2 and autosuggest/style-api-v2, build and lint green.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.76%. Comparing base (00e5e24) to head (98b1932).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5205      +/-   ##
==========================================
+ Coverage   97.74%   97.76%   +0.01%     
==========================================
  Files        1000     1003       +3     
  Lines       32346    32581     +235     
  Branches    11965    12118     +153     
==========================================
+ Hits        31616    31852     +236     
- Misses        685      723      +38     
+ Partials       45        6      -39     

☔ View full report in Codecov by Harness.
📢 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The disabled option-style select trigger does not pass its custom foreground color to the selected-value label, and this state/variant combination needs coverage.

1 open issue
What changed in this PR

Adds internal Style API v2 support to Select and Autosuggest, extending the library’s slot-based styling without adding public props.

Changes:

  • Adds Select trigger and inline-label styling, plus Input and Dropdown forwards for both components.
  • Adds placeholder-color support and font inheritance for selected options rendered inside triggers.
  • Adds forwarding tests and styled demo pages; documentation snapshots and visual regression registration remain deferred.
File Description
src/​select/​styles.scss Declares Select styling slots and placeholder token.
src/​select/​parts/​trigger.tsx Applies trigger and inline-label classes.
src/​select/​parts/​styles.scss Carries custom placeholder color to its span.
src/​select/​internal.tsx Defines and forwards Select style classes.
src/​select/​index.tsx Passes internal styling through the component entry point.
src/​select/​__tests__/​style-api.test.tsx Tests class forwarding and DOM isolation.
src/​internal/​components/​option/​styles.scss Enables font inheritance inside triggers.
src/​internal/​components/​option/​index.tsx Marks trigger-rendered options for styling.
src/​internal/​components/​autosuggest-input/​index.tsx Forwards Input and Dropdown style classes.
src/​autosuggest/​styles.scss Declares forwarded styling slots.
src/​autosuggest/​internal.tsx Defines and forwards Autosuggest style classes.
src/​autosuggest/​index.tsx Passes internal styling through the component entry point.
src/​autosuggest/​__tests__/​style-api.test.tsx Tests forwarded slots and DOM isolation.
pages/​select/​style-api-v2.scss Styles Select examples using generated mixins.
pages/​select/​style-api-v2.page.tsx Demonstrates Select slots and states.
pages/​autosuggest/​style-api-v2.scss Styles Autosuggest examples using generated mixins.
pages/​autosuggest/​style-api-v2.page.tsx Demonstrates Autosuggest slots and states.

Review effort: Balanced

Comment thread src/select/styles.scss
@include style-api.docs(
'trigger',
$trigger-tokens,
$properties: (color, background, border, border-radius, box-shadow, padding, font-family, font-size, font-weight),

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The select and autosuggest examples keep changed values only in local state instead of AppContext URL parameters, violating the demo-state convention and preventing reproduction through shared links, reloads, or test URLs.

3 open issues

Review effort: Balanced

Comment thread pages/autosuggest/style-api-v2.page.tsx Resolved
Comment thread pages/select/style-api-v2.page.tsx Resolved

This branch was successfully deployed

3 active deployments
dev-pages-react18 — 98b1932a Deployed Nov 2, 2026 by vvaliyev via deploy (React 18) / deploy #3084
dev-pages-react16 — 98b1932a Deployed Nov 2, 2026 by vvaliyev via deploy (React 16) / deploy #3084
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants