Skip to content

Commit c3f57ef

Browse files
committed
chore(core): remove 1st-gen type references from 2nd-gen core
1 parent 598039b commit c3f57ef

6 files changed

Lines changed: 7 additions & 96 deletions

File tree

2nd-gen/packages/core/components/alert-banner/AlertBanner.types.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,3 @@ export const ALERT_BANNER_VALID_VARIANTS = [
1919
export type AlertBannerVariant =
2020
| (typeof ALERT_BANNER_VALID_VARIANTS)[number]
2121
| '';
22-
23-
/**
24-
* @deprecated Use `AlertBannerVariant` instead.
25-
* Kept as `string` for backward compatibility with 1st-gen.
26-
*/
27-
export type AlertBannerVariants = string;

2nd-gen/packages/core/components/badge/Badge.types.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
/*
14-
* @todo The S1 types can be removed once we are no longer maintaining 1st-gen.
15-
*/
16-
1713
import type { ElementSize } from '@spectrum-web-components/core/mixins/index.js';
1814

1915
// ──────────────────
@@ -65,32 +61,6 @@ export const FIXED_VALUES = [
6561
'inline-end',
6662
] as const;
6763

68-
// ──────────────────────────────────────────
69-
// S1-ONLY (remove with 1st-gen)
70-
// ──────────────────────────────────────────
71-
72-
export const BADGE_VARIANTS_COLOR_S1 = [
73-
'fuchsia',
74-
'indigo',
75-
'magenta',
76-
'purple',
77-
'seafoam',
78-
'yellow',
79-
'gray',
80-
'red',
81-
'orange',
82-
'chartreuse',
83-
'celery',
84-
'green',
85-
'cyan',
86-
'blue',
87-
] as const satisfies readonly BadgeColorVariant[];
88-
89-
export const BADGE_VARIANTS_S1 = [
90-
...BADGE_VARIANTS_SEMANTIC,
91-
...BADGE_VARIANTS_COLOR_S1,
92-
] as const;
93-
9464
// ──────────────────
9565
// CANONICAL
9666
// ──────────────────
@@ -109,10 +79,6 @@ export type FixedValues = (typeof FIXED_VALUES)[number];
10979
export type BadgeSize = (typeof BADGE_VALID_SIZES)[number];
11080
export type BadgeSemanticVariant = (typeof BADGE_VARIANTS_SEMANTIC)[number];
11181

112-
// S1-only (remove with 1st-gen)
113-
export type BadgeColorVariantS1 = (typeof BADGE_VARIANTS_COLOR_S1)[number]; // remove with 1st-gen
114-
export type BadgeVariantS1 = (typeof BADGE_VARIANTS_S1)[number]; // remove with 1st-gen
115-
11682
// Canonical
11783
export type BadgeColorVariant = (typeof BADGE_VARIANTS_COLOR)[number];
11884
export type BadgeVariant = (typeof BADGE_VARIANTS)[number];

2nd-gen/packages/core/components/progress-circle/ProgressCircle.types.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,8 @@ export const PROGRESS_CIRCLE_VALID_SIZES = [
1717
'm',
1818
'l',
1919
] as const satisfies ElementSize[];
20-
export const PROGRESS_CIRCLE_STATIC_COLORS_S1 = ['white'] as const;
21-
export const PROGRESS_CIRCLE_STATIC_COLORS_S2 = [
22-
...PROGRESS_CIRCLE_STATIC_COLORS_S1,
23-
'black',
24-
] as const;
20+
export const PROGRESS_CIRCLE_STATIC_COLORS_S2 = ['white', 'black'] as const;
2521

26-
export type ProgressCircleStaticColorS1 =
27-
(typeof PROGRESS_CIRCLE_STATIC_COLORS_S1)[number];
2822
export type ProgressCircleStaticColorS2 =
2923
(typeof PROGRESS_CIRCLE_STATIC_COLORS_S2)[number];
30-
export type ProgressCircleStaticColor =
31-
| ProgressCircleStaticColorS1
32-
| ProgressCircleStaticColorS2;
24+
export type ProgressCircleStaticColor = ProgressCircleStaticColorS2;

2nd-gen/packages/core/components/status-light/StatusLight.base.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,6 @@ export abstract class StatusLightBase extends SizedMixin(SpectrumElement, {
105105
}
106106
);
107107
}
108-
// Check disabled property if it exists (S1 only)
109-
if (this.hasAttribute('disabled') && !('disabled' in this)) {
110-
window.__swc.warn(
111-
this,
112-
`<${this.localName}> element does not support the disabled state.`,
113-
'https://opensource.adobe.com/spectrum-web-components/components/status-light/#states',
114-
{
115-
issues: ['disabled is not a supported property in Spectrum 2'],
116-
}
117-
);
118-
}
119108
}
120109
}
121110
}

2nd-gen/packages/core/components/status-light/StatusLight.types.ts

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111
*/
1212

1313
/**
14-
* @todo The S1 types can be removed once we are no longer maintaining 1st-gen.
1514
* @todo Rename STATUSLIGHT_ prefix to STATUS_LIGHT_ to align with type prefix
16-
* naming convention (use underscore separators for multi-word names). This
17-
* requires updating all imports in 1st-gen and 2nd-gen that reference these
18-
* constants.
15+
* naming convention (use underscore separators for multi-word names).
1916
*/
2017
import type { ElementSize } from '@spectrum-web-components/core/mixins/index.js';
2118

@@ -34,16 +31,11 @@ export const STATUSLIGHT_VARIANTS_SEMANTIC = [
3431
'notice',
3532
] as const;
3633

37-
export const STATUSLIGHT_VARIANTS_SEMANTIC_S1 = [
38-
...STATUSLIGHT_VARIANTS_SEMANTIC,
39-
'accent',
40-
] as const;
41-
4234
export const STATUSLIGHT_VARIANTS_SEMANTIC_S2 = [
4335
...STATUSLIGHT_VARIANTS_SEMANTIC,
4436
] as const;
4537

46-
export const STATUSLIGHT_VARIANTS_COLOR_S1 = [
38+
export const STATUSLIGHT_VARIANTS_COLOR_S2 = [
4739
'fuchsia',
4840
'indigo',
4941
'magenta',
@@ -53,43 +45,25 @@ export const STATUSLIGHT_VARIANTS_COLOR_S1 = [
5345
'chartreuse',
5446
'celery',
5547
'cyan',
56-
] as const;
57-
58-
export const STATUSLIGHT_VARIANTS_COLOR_S2 = [
59-
...STATUSLIGHT_VARIANTS_COLOR_S1,
6048
'pink',
6149
'turquoise',
6250
'brown',
6351
'cinnamon',
6452
'silver',
6553
] as const;
6654

67-
export const STATUSLIGHT_VARIANTS_S1 = [
68-
...STATUSLIGHT_VARIANTS_SEMANTIC_S1,
69-
...STATUSLIGHT_VARIANTS_COLOR_S1,
70-
] as const;
71-
7255
export const STATUSLIGHT_VARIANTS_S2 = [
7356
...STATUSLIGHT_VARIANTS_SEMANTIC_S2,
7457
...STATUSLIGHT_VARIANTS_COLOR_S2,
7558
] as const;
7659

77-
export type StatusLightSemanticVariantS1 =
78-
(typeof STATUSLIGHT_VARIANTS_SEMANTIC_S1)[number];
7960
export type StatusLightSemanticVariantS2 =
8061
(typeof STATUSLIGHT_VARIANTS_SEMANTIC_S2)[number];
81-
export type StatusLightSemanticVariant =
82-
| StatusLightSemanticVariantS1
83-
| StatusLightSemanticVariantS2;
62+
export type StatusLightSemanticVariant = StatusLightSemanticVariantS2;
8463

85-
export type StatusLightColorVariantS1 =
86-
(typeof STATUSLIGHT_VARIANTS_COLOR_S1)[number];
8764
export type StatusLightColorVariantS2 =
8865
(typeof STATUSLIGHT_VARIANTS_COLOR_S2)[number];
89-
export type StatusLightColorVariant =
90-
| StatusLightColorVariantS1
91-
| StatusLightColorVariantS2;
66+
export type StatusLightColorVariant = StatusLightColorVariantS2;
9267

93-
export type StatusLightVariantS1 = (typeof STATUSLIGHT_VARIANTS_S1)[number];
9468
export type StatusLightVariantS2 = (typeof STATUSLIGHT_VARIANTS_S2)[number];
95-
export type StatusLightVariant = StatusLightVariantS1 | StatusLightVariantS2;
69+
export type StatusLightVariant = StatusLightVariantS2;

2nd-gen/packages/swc/components/badge/Badge.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ export class Badge extends BadgeBase {
7474

7575
/**
7676
* Whether the badge is subtle.
77-
*
78-
* @todo This can be moved to the base class once we are no longer maintaining 1st-gen.
7977
*/
8078
@property({ type: Boolean, reflect: true })
8179
public subtle: boolean = false;
@@ -84,8 +82,6 @@ export class Badge extends BadgeBase {
8482
* Whether the badge is outlined.
8583
*
8684
* Can only be used with semantic variants.
87-
*
88-
* @todo This can be moved to the base class once we are no longer maintaining 1st-gen.
8985
*/
9086
@property({ type: Boolean, reflect: true })
9187
public outline: boolean = false;

0 commit comments

Comments
 (0)