Skip to content

Commit cdb180d

Browse files
committed
fix(pagination): deprecate legacy features to align with foundations
1 parent 24419a9 commit cdb180d

File tree

97 files changed

+6520
-8774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+6520
-8774
lines changed

.github/workflows/development.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ jobs:
9898
files_yaml: |
9999
styles:
100100
- components/*/index.css
101-
- components/*/themes/spectrum.css
102-
- components/*/themes/express.css
101+
- components/*/themes/*.css
103102
eslint:
104103
- components/*/stories/*.js
105104
plugins:

.storybook/decorators/context.js

+3-19
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { makeDecorator, useEffect } from "@storybook/preview-api";
22
import { fetchContainers, toggleStyles } from "./helpers.js";
33

4-
import legacyTokens from "@spectrum-css/tokens-legacy/dist/index.css?inline";
54
import tokens from "@spectrum-css/tokens/dist/index.css?inline";
65

76
/**
@@ -48,8 +47,6 @@ export const withContextWrapper = makeDecorator({
4847
const isTesting = testingPreview;
4948
const isDocs = viewMode === "docs";
5049
const isRaw = Boolean(context === "raw");
51-
const isModern = Boolean(context === "spectrum");
52-
const isExpress = Boolean(context === "express");
5350

5451
// Start by attaching the appropriate tokens to the container
5552
toggleStyles(document.body, "tokens", tokens, !isRaw);
@@ -60,7 +57,7 @@ export const withContextWrapper = makeDecorator({
6057
}
6158

6259
// Start by attaching the appropriate tokens to the container
63-
toggleStyles(document.body, "tokens", isModern ? tokens : legacyTokens, !isRaw);
60+
toggleStyles(document.body, "tokens", tokens, !isRaw);
6461

6562
for (const container of fetchContainers(id, isDocs, isTesting)) {
6663
// Reset the context to the original values
@@ -85,19 +82,6 @@ export const withContextWrapper = makeDecorator({
8582
// Every container gets the spectrum class
8683
container.classList.toggle("spectrum", !isRaw);
8784

88-
// S1 and S1 Express get the legacy class
89-
container.classList.toggle("spectrum--legacy", !isModern && !isRaw);
90-
91-
// Express only gets the express class
92-
container.classList.toggle("spectrum--express", isExpress && !isRaw);
93-
94-
// Darkest is deprecated in Spectrum 2
95-
if (isModern && color === "darkest") {
96-
/* eslint-disable no-console -- notify that darkest was deprecated in S2 */
97-
console.warn("The 'darkest' color is deprecated in Spectrum 2. Please use 'dark' instead.");
98-
color = "dark";
99-
}
100-
10185
// Let the static color override the color if it's set
10286
if (hasStaticElement && staticColorSettings[staticKey]?.color) {
10387
color = staticColorSettings[staticKey].color;
@@ -109,7 +93,7 @@ export const withContextWrapper = makeDecorator({
10993
color = "light";
11094
}
11195

112-
for (let c of ["light", "dark", "darkest"]) {
96+
for (let c of ["light", "dark"]) {
11397
container.classList.toggle(`spectrum--${c}`, c === color && !isRaw);
11498
}
11599

@@ -124,7 +108,7 @@ export const withContextWrapper = makeDecorator({
124108
}
125109
}
126110

127-
}, [context, viewMode, original, staticColor, color, scale, rootClass, tokens, legacyTokens, staticColorSettings, testingPreview]);
111+
}, [context, viewMode, original, staticColor, color, scale, rootClass, tokens, staticColorSettings, testingPreview]);
128112

129113
return StoryFn(data);
130114
},

.storybook/guides/develop.mdx

+264-158
Large diffs are not rendered by default.

.storybook/modes/index.js

+13-22
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,22 @@
1212
*/
1313

1414
const modes = {
15-
"Light | LTR": {
16-
color: "light",
17-
textDirection: "ltr",
18-
},
19-
"Dark | RTL": {
20-
color: "dark",
21-
textDirection: "rtl",
22-
},
23-
"S1 | Light | LTR": {
24-
context: "legacy",
25-
color: "light",
26-
textDirection: "ltr",
27-
},
28-
"Express | Light | LTR": {
29-
context: "express",
30-
color: "light",
31-
textDirection: "ltr",
32-
},
15+
Light: {
16+
color: "light",
17+
},
18+
Dark: {
19+
color: "dark",
20+
},
21+
RTL: {
22+
textDirection: "rtl",
23+
},
3324
};
3425

3526
export default modes;
3627

3728
export const disableDefaultModes = {
38-
...Object.keys(modes).reduce((acc, key) => {
39-
acc[key] = { disable: true };
40-
return acc;
41-
}, {}),
29+
...Object.keys(modes).reduce((acc, key) => {
30+
acc[key] = { disable: true };
31+
return acc;
32+
}, {}),
4233
};

.storybook/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"@spectrum-css/button": "workspace:^",
3535
"@spectrum-css/table": "workspace:^",
3636
"@spectrum-css/tokens": "workspace:^",
37-
"@spectrum-css/tokens-legacy": "npm:@spectrum-css/tokens@^14.6.0",
3837
"@spectrum-css/typography": "workspace:^",
3938
"@spectrum-css/ui-icons": "workspace:^",
4039
"@spectrum-css/underlay": "workspace:^"

.storybook/preview.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export const parameters = {
111111
// Set an empty object to avoid the "undefined" value in the ComponentDetails doc block
112112
packageJson: {},
113113
// A list of published npm tags that should not appear in the ComponentDetails doc block
114-
ignoredTags: ["beta", "next"],
114+
ignoredTags: ["beta"],
115115
};
116116

117117
export default {

.storybook/types/global.js

-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ export default {
1313
toolbar: {
1414
items: [
1515
{ value: "spectrum", title: "Spectrum 2", right: "default" },
16-
{ value: "legacy", title: "Spectrum 1", right: "legacy" },
17-
{ value: "express", title: "Express", right: "legacy" },
1816
{ value: "raw", title: "Token-free", right: "raw" },
1917
],
2018
dynamicTitle: true,
@@ -30,7 +28,6 @@ export default {
3028
items: [
3129
{ value: "light", title: "Light", right: "default" },
3230
{ value: "dark", title: "Dark" },
33-
{ value: "darkest", title: "Darkest", right: "deprecated" },
3431
],
3532
dynamicTitle: true,
3633
},

0 commit comments

Comments
 (0)