refactor(badge,statuslight,sized-mixin): reorganize types and remove S2 suffix from exports#6096
refactor(badge,statuslight,sized-mixin): reorganize types and remove S2 suffix from exports#6096
Conversation
…S2 suffix from exports Reorganize Badge types into SHARED/S1-ONLY/CANONICAL sections for a clearer future S1 removal path. Remove the `S2` suffix from all canonical exports since 2nd-gen is the forward-looking default: - BADGE_VARIANTS_S2 -> BADGE_VARIANTS - BADGE_VARIANTS_COLOR_S2 -> BADGE_VARIANTS_COLOR - BadgeVariantS2 -> BadgeVariant - BadgeColorVariantS2 -> BadgeColorVariant Replace the `ElementSizes` record in sized-mixin with `ELEMENT_SIZES` and `DEFAULT_ELEMENT_SIZES` const arrays, enabling `as const satisfies` patterns. The old `ElementSizes` record is re-exported from @spectrum-web-components/base as a deprecated alias to avoid breaking 1st-gen consumers. Additional code quality updates aligned with style guide conventions: - Asset: use `when` directive, rename CSS classes from spectrum- to swc- - Divider: convert styles property to getter - ProgressCircle: rename progressCircleStyles to styles - StatusLight: add @todo annotations, fix satisfies syntax - Badge base: add @todo comments for mixin composition review Made-with: Cursor
🦋 Changeset detectedLatest commit: 8d84feb The changes in this PR will be included in the next version bump. This PR includes changesets to release 85 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📚 Branch Preview Links🔍 First Generation 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 |
Made-with: Cursor
|
closing this in favor of the original PR as feedback was not addressed before splitting |
Summary
S2suffix from canonical exports (BADGE_VARIANTS_S2->BADGE_VARIANTS,BADGE_VARIANTS_COLOR_S2->BADGE_VARIANTS_COLOR, etc.) since 2nd-gen is the forward-looking defaultElementSizesrecord withELEMENT_SIZESandDEFAULT_ELEMENT_SIZESconst arrays, enablingas const satisfiestype-safe patterns. OldElementSizesre-exported from@spectrum-web-components/baseas deprecated aliaswhendirective +swc-CSS class prefix; Divider uses styles getter; ProgressCircle uses consistentstylesnaming; StatusLight gets@todoannotationsMotivation
The
S2suffix in type exports (BADGE_VARIANTS_S2,BadgeVariantS2, etc.) creates a naming dependency that will require a breaking change to remove later. By making the canonical (unsuffixed) names the 2nd-gen default now, we avoid that future breaking change. S1-specific subsets remain with the_S1suffix and can be cleanly deleted when 1st-gen is retired.The sized mixin refactoring from
Record<string, ElementSize>toas constarrays enables better IDE autocomplete and compile-time validation throughout the codebase.Related
Test plan
ElementSizesaliaswhendirective