-
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
Open
marissahuysentruyt
wants to merge
20
commits into
barebones
Choose a base branch
from
marissahuysentruyt/swc-1260-status-light-s2-migration
base: barebones
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
b5ff0dd
feat(statuslight): create shared types file
marissahuysentruyt 14f1ddb
feat(status-light): import types into core status-light
marissahuysentruyt b551526
refactor(status-light): status light base
marissahuysentruyt c53108e
refactor(status-light): status light second-gen
marissahuysentruyt 7552d10
refactor(status-light): status light first-gen
marissahuysentruyt 2f767ea
feat(status-light): add s2 styles
marissahuysentruyt 78386c5
feat(status-light): add second-gen stories
marissahuysentruyt f3ec69c
feat(statuslight): add sizeMap decorator
marissahuysentruyt ef3c4a1
refactor(statuslight): correct accent and cyan variant selectors
marissahuysentruyt b72ca8d
feat(statuslight): add missing first-gen variants to stories
marissahuysentruyt 1dd69f0
test(status-light): add dev mode warning tests in first-gen
marissahuysentruyt 888651e
test(statuslight): add second-gen test file
marissahuysentruyt 90512a9
revert: feat(statuslight): add missing first-gen variants to stories
marissahuysentruyt 7e0108d
revert: refactor(statuslight): correct accent and cyan variant selectors
marissahuysentruyt 6528bc6
chore(statuslight): change todo to deprecated
marissahuysentruyt f5ed8fd
docs(statuslight): move variant description to JSDocs
marissahuysentruyt a4e459a
chore(statuslight): use story override patterns consistent with badge
marissahuysentruyt 282eb11
chore: use size override patterns consistent with badge
marissahuysentruyt bab9bf4
fix(statuslight): disabled logic in first-gen
marissahuysentruyt 155e58b
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