-
Notifications
You must be signed in to change notification settings - Fork 234
feat(status-light)!: migrate status-light to s2 styles and second-gen architecture #5800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: barebones
Are you sure you want to change the base?
feat(status-light)!: migrate status-light to s2 styles and second-gen architecture #5800
Conversation
|
778adb4
to
faba5c8
Compare
- imports new types - adds the api overrides for color and semantic variants - adds documentation - ensures the disabled state is not supported in S2 and throws a warning - ensures the disabled property still adds the aria-disabled attribute for S1 - ensures the variants values are validated and throws a warning if not
faba5c8
to
f32d35c
Compare
📚 Branch Preview🔍 Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
Tachometer resultsCurrently, no packages are changed by this PR... |
- imports new S2 types for colors and semantic variants - adds the api overrides - adds documentation and example usage - refactors template render to use CSS classes and classMap()
- imports new S1 types for colors and semantic variants - adds the api overrides and extra disabled property - adds documentation, deprecation notices, and example usage
f32d35c
to
a22afc0
Compare
Description
This PR migrates the status-light component to the second-generation architecture, creating a shared base class that both first-gen and second-gen implementations extend. This enables the component to work in both Spectrum 1 and Spectrum 2 contexts while sharing common logic.
Key changes
@swc/core/components/status-light/StatusLight.base.ts
) that contains common logic for both generationsStatusLight.types.ts
) defining variants for S1 and S2:first-gen/packages/status-light/src/StatusLight.ts
) to extend the shared base classdisabled
property (deprecated in S2)second-gen/packages/swc/components/status-light/StatusLight.ts
) extending the shared base classdisabled
property (not supported in Spectrum 2)Motivation and context
This migration is part of the broader effort to support Spectrum 2 design system while maintaining backward compatibility with Spectrum 1. By creating a shared base class, we reduce code duplication and ensure consistent behavior across both generations while allowing each to have generation-specific features and styling.
Related issue(s)
Screenshots (if appropriate)
New stories for S2/second-gen:



Author's checklist
Reviewer's checklist
patch
,minor
, ormajor
featuresManual review test cases
First-gen status-light functionality
NOTE: these missing variants were an identified gap during the component analysis
disabled
state still works correctly and properly adds or removesaria-disabled
Second-gen status-light functionality
Shared base class validation
<sp-status-light size="s" variant="brown">brown</sp-status-light>
Second-gen: Try adding an extra S1-only story to the S2 storybook. For example, add:
Confirm that a browser warning appears in the console:
Replace the variant value with something valid for S2, then reconfirm the new
disabled
console warning appears in the browser:Device review