-
Couldn't load subscription status.
- Fork 235
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
Merged
marissahuysentruyt
merged 20 commits into
barebones
from
marissahuysentruyt/swc-1260-status-light-s2-migration
Oct 20, 2025
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
fbed559
feat(statuslight): create shared types file
marissahuysentruyt 7cff961
feat(status-light): import types into core status-light
marissahuysentruyt 45773c1
refactor(status-light): status light base
marissahuysentruyt 1ac3130
refactor(status-light): status light second-gen
marissahuysentruyt 5e40486
refactor(status-light): status light first-gen
marissahuysentruyt 4e3c524
feat(status-light): add s2 styles
marissahuysentruyt 6bc020d
feat(status-light): add second-gen stories
marissahuysentruyt a8a8cf3
feat(statuslight): add sizeMap decorator
marissahuysentruyt 90e0f34
refactor(statuslight): correct accent and cyan variant selectors
marissahuysentruyt d493e6e
feat(statuslight): add missing first-gen variants to stories
marissahuysentruyt ce33a5b
test(status-light): add dev mode warning tests in first-gen
marissahuysentruyt d0c0893
test(statuslight): add second-gen test file
marissahuysentruyt 381e1c2
revert: feat(statuslight): add missing first-gen variants to stories
marissahuysentruyt 2e7865c
revert: refactor(statuslight): correct accent and cyan variant selectors
marissahuysentruyt 625f49d
chore(statuslight): change todo to deprecated
marissahuysentruyt b6f2019
docs(statuslight): move variant description to JSDocs
marissahuysentruyt ac58a1f
chore(statuslight): use story override patterns consistent with badge
marissahuysentruyt 21c29d4
chore: use size override patterns consistent with badge
marissahuysentruyt 59a8c74
fix(statuslight): disabled logic in first-gen
marissahuysentruyt 4d57a9b
refactor: remove disabled logic from base class
marissahuysentruyt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
second-gen/packages/core/components/status-light/StatusLight.types.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| /** | ||
| * Copyright 2025 Adobe. All rights reserved. | ||
| * This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. You may obtain a copy | ||
| * of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software distributed under | ||
| * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
| * OF ANY KIND, either express or implied. See the License for the specific language | ||
| * governing permissions and limitations under the License. | ||
| */ | ||
|
|
||
| /* | ||
| * @todo The S1 types can be removed once we are no longer maintaining 1st-gen. | ||
| */ | ||
|
|
||
| export const STATUSLIGHT_VARIANTS_SEMANTIC = [ | ||
| 'neutral', | ||
| 'info', | ||
| 'positive', | ||
| 'negative', | ||
| 'notice', | ||
| ] as const; | ||
|
|
||
| export const STATUSLIGHT_VARIANTS_SEMANTIC_S1 = [ | ||
| ...STATUSLIGHT_VARIANTS_SEMANTIC, | ||
| 'accent', | ||
| ] as const; | ||
|
|
||
| export const STATUSLIGHT_VARIANTS_SEMANTIC_S2 = [ | ||
| ...STATUSLIGHT_VARIANTS_SEMANTIC, | ||
| ] as const; | ||
|
|
||
| export const STATUSLIGHT_VARIANTS_COLOR_S1 = [ | ||
| 'fuchsia', | ||
| 'indigo', | ||
| 'magenta', | ||
| 'purple', | ||
| 'seafoam', | ||
| 'yellow', | ||
| 'chartreuse', | ||
| 'celery', | ||
| 'cyan', | ||
| ] as const; | ||
|
|
||
| export const STATUSLIGHT_VARIANTS_COLOR_S2 = [ | ||
| ...STATUSLIGHT_VARIANTS_COLOR_S1, | ||
| 'pink', | ||
| 'turquoise', | ||
| 'brown', | ||
| 'cinnamon', | ||
| 'silver', | ||
| ] as const; | ||
|
|
||
| export const STATUSLIGHT_VARIANTS_S1 = [ | ||
| ...STATUSLIGHT_VARIANTS_SEMANTIC_S1, | ||
| ...STATUSLIGHT_VARIANTS_COLOR_S1, | ||
| ] as const; | ||
|
|
||
| export const STATUSLIGHT_VARIANTS_S2 = [ | ||
| ...STATUSLIGHT_VARIANTS_SEMANTIC_S2, | ||
| ...STATUSLIGHT_VARIANTS_COLOR_S2, | ||
| ] as const; | ||
|
|
||
| export type StatusLightVariantS1 = (typeof STATUSLIGHT_VARIANTS_S1)[number]; | ||
| export type StatusLightVariantS2 = (typeof STATUSLIGHT_VARIANTS_S2)[number]; | ||
| export type StatusLightVariant = StatusLightVariantS1 | StatusLightVariantS2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had Cursor help me with this- do we want tests for the dev warnings at all? Feedback on this is appreciated either way!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good idea to me, but open to dissenting opinions (cc @rubencarvalho).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we do test for dev mode on other components so I think that makes a lot of sense to add here too. Check out this reference for an example:
spectrum-web-components/first-gen/packages/alert-banner/test/alert-banner.test.ts
Line 193 in ee5fdd5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine! We’ll probably want to create a dedicated test helper to remove some boilerplate from these dev warnings tests, but this looks good for now 😃