Skip to content

Commit 2080a35

Browse files
committed
build: remove theme processing, site package; add reporter
1 parent 2c43c4e commit 2080a35

File tree

114 files changed

+595
-933
lines changed

Some content is hidden

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

114 files changed

+595
-933
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
filter_mode: diff_context
9191
level: error
9292
reporter: github-pr-review
93-
# stylelint_input: "components/*/index.css
93+
# stylelint_input: "components/*/index.css"
9494
stylelint_input: "${{ inputs.styles_added_files }} ${{ inputs.styles_modified_files }}"
9595
stylelint_config: "${{ github.workspace }}/stylelint.config.js"
9696
packages: 'stylelint-header stylelint-config-standard stylelint-selector-bem-pattern stylelint-order stylelint-use-logical'

.storybook/guides/develop.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,18 @@ Each component has the following files:
3535
- `stories/*.stories.js` - The storybook file that defines the component's stories and the available knobs for the component.
3636
- `stories/template.js` - The template function that generates the component's mark-up based on the provided settings.
3737
- `stories/*.test.js` - The testing grid for visual regression testing in Chromatic.
38-
- `stories/*.mdx` - This asset generates the component-specific documentation and is rendered in Storybook as the Docs page.
3938

4039
Each component outputs the following assets to `dist`:
4140

42-
- `index.css`: This asset includes the base CSS.
41+
- `index.css`: This asset includes the CSS for the component and is meant to be loaded in conjunction with the tokens for your desired color context and scales.
4342

4443
## Adding a new component
4544

4645
1. Generate a new component using the `yarn new component` command. The generator will prompt you to answer questions about your component.
4746
2. Edit the `dependencies` within the `package.json` file to use only the dependencies your component needs. All components rely on `@spectrum-css/tokens`, and most rely on `@spectrum-css/icon`.
4847
3. Once your folder has been generated, you can run `yarn start` in the root of the project to begin developing.
49-
4. The `index.css` file is where all of your styles will be added.
50-
5. Inside the `stories` directory you will find a `template.js`, `*.stories.js`, and `*.mdx` file.
48+
4. The `index.css` file is where all of your styles should be added.
49+
5. Inside the `stories` directory you will find a `template.js` and `*.stories.js` file.
5150
- In the `*.stories.js` file, define the available knobs and properties for your component, as well as any standard variations you want to surface in [Storybook](https://storybook.js.org/docs/react/writing-stories/introduction).
5251
- Update the `template.js` file with the markup, using [lit-html syntax](https://lit.dev/docs/templates/overview/) to adjust results based on the provided settings from the Storybook knobs.
5352

.storybook/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default {
2222
},
2323
{
2424
directory: "./foundations",
25-
files: "*/*.mdx",
25+
files: "*/*.@(stories.js|mdx)",
2626
titlePrefix: "Foundations",
2727
},
2828
{

.storybook/manager.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
12
import { addons } from "@storybook/manager-api";
23
import { create } from "@storybook/theming";
34

4-
import "./assets/index.css";
55

66
import logo from "./assets/logo.svg";
77
import pkg from "./package.json";
88

9+
import "./assets/index.css";
10+
911
const root = document.body ?? document.documentElement;
1012
if (root) root.classList.add("spectrum", "spectrum--light", "spectrum--medium");
1113

@@ -64,8 +66,5 @@ addons.setConfig({
6466
}),
6567
sidebar: {
6668
showRoots: false,
67-
filters: {
68-
patterns: (item) => !item.id.includes('forced-colors') && ['is-hidden-story'].every((tag) => !item.tags.includes(tag)),
69-
},
7069
},
7170
});

.storybook/modes/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212
*/
1313

1414
const modes = {
15-
Light: {
15+
"Light | LTR": {
1616
color: "light",
17+
textDirection: "ltr",
1718
},
18-
Dark: {
19+
"Dark | RTL": {
1920
color: "dark",
20-
},
21-
RTL: {
2221
textDirection: "rtl",
2322
},
2423
};

components/accordion/dist/metadata.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@
198198
"--spectrum-neutral-content-color-key-focus",
199199
"--spectrum-sans-font-family-stack"
200200
],
201-
"system-theme": [],
202201
"passthroughs": [],
203202
"high-contrast": []
204203
}

components/actionbar/dist/metadata.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
"--spectrum-spacing-75",
8989
"--spectrum-white"
9090
],
91-
"system-theme": [],
9291
"passthroughs": [],
9392
"high-contrast": ["--highcontrast-actionbar-popover-border-color"]
9493
}

components/actionbar/index.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
--spectrum-actionbar-emphasized-background-color: var(--spectrum-informative-background-color-default);
2828
--spectrum-actionbar-emphasized-item-counter-color: var(--spectrum-white);
2929

30+
/* colors - applied to popover */
31+
--spectrum-actionbar-popover-background-color: var(--spectrum-gray-25);
32+
--spectrum-actionbar-popover-border-color: var(--spectrum-gray-400);
33+
3034
/* spacing of action bar bottom and horizontal outer edge */
3135
--spectrum-actionbar-spacing-outer-edge: var(--spectrum-spacing-300);
3236

components/actionbutton/dist/metadata.json

Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,25 @@
1414
".spectrum-ActionButton-label:empty",
1515
".spectrum-ActionButton.is-disabled",
1616
".spectrum-ActionButton.is-selected",
17+
".spectrum-ActionButton.is-selected .is-disabled.spectrum-ActionButton--staticBlack",
18+
".spectrum-ActionButton.is-selected .is-disabled.spectrum-ActionButton--staticWhite",
1719
".spectrum-ActionButton.is-selected .spectrum-ActionButton-hold",
1820
".spectrum-ActionButton.is-selected .spectrum-ActionButton-icon",
1921
".spectrum-ActionButton.is-selected .spectrum-ActionButton-label",
20-
".spectrum-ActionButton.spectrum-ActionButton--emphasized:not(.spectrum-ActionButton--staticBlack, .spectrum-ActionButton--staticWhite)",
22+
".spectrum-ActionButton.is-selected.spectrum-ActionButton--emphasized:not(.spectrum-ActionButton--staticBlack, .spectrum-ActionButton--staticWhite)",
23+
".spectrum-ActionButton.is-selected.spectrum-ActionButton--staticBlack:disabled",
24+
".spectrum-ActionButton.is-selected.spectrum-ActionButton--staticWhite:disabled",
2125
".spectrum-ActionButton.spectrum-ActionButton--quiet",
26+
".spectrum-ActionButton.spectrum-ActionButton--quiet.is-disabled:not(.is-selected)",
27+
".spectrum-ActionButton.spectrum-ActionButton--quiet:disabled:not(.is-selected)",
2228
".spectrum-ActionButton.spectrum-ActionButton--staticBlack",
29+
".spectrum-ActionButton.spectrum-ActionButton--staticBlack .is-disabled",
2330
".spectrum-ActionButton.spectrum-ActionButton--staticBlack.spectrum-ActionButton--quiet",
31+
".spectrum-ActionButton.spectrum-ActionButton--staticBlack:disabled",
2432
".spectrum-ActionButton.spectrum-ActionButton--staticWhite",
33+
".spectrum-ActionButton.spectrum-ActionButton--staticWhite .is-disabled",
2534
".spectrum-ActionButton.spectrum-ActionButton--staticWhite.spectrum-ActionButton--quiet",
35+
".spectrum-ActionButton.spectrum-ActionButton--staticWhite:disabled",
2636
".spectrum-ActionButton::-moz-focus-inner",
2737
".spectrum-ActionButton:active",
2838
".spectrum-ActionButton:after",
@@ -38,18 +48,10 @@
3848
"modifiers": [
3949
"--mod-actionbutton-animation-duration",
4050
"--mod-actionbutton-background-color-default",
41-
"--mod-actionbutton-background-color-default-selected",
42-
"--mod-actionbutton-background-color-default-selected-emphasized",
4351
"--mod-actionbutton-background-color-disabled",
4452
"--mod-actionbutton-background-color-down",
45-
"--mod-actionbutton-background-color-down-selected",
46-
"--mod-actionbutton-background-color-down-selected-emphasized",
4753
"--mod-actionbutton-background-color-focus",
48-
"--mod-actionbutton-background-color-focus-selected",
49-
"--mod-actionbutton-background-color-focus-selected-emphasized",
5054
"--mod-actionbutton-background-color-hover",
51-
"--mod-actionbutton-background-color-hover-selected",
52-
"--mod-actionbutton-background-color-hover-selected-emphasized",
5355
"--mod-actionbutton-border-color-default",
5456
"--mod-actionbutton-border-color-disabled",
5557
"--mod-actionbutton-border-color-down",
@@ -58,41 +60,32 @@
5860
"--mod-actionbutton-border-radius",
5961
"--mod-actionbutton-border-width",
6062
"--mod-actionbutton-content-color-default",
61-
"--mod-actionbutton-content-color-default-selected",
62-
"--mod-actionbutton-content-color-default-selected-emphasized",
6363
"--mod-actionbutton-content-color-disabled",
6464
"--mod-actionbutton-content-color-down",
65-
"--mod-actionbutton-content-color-down-selected",
66-
"--mod-actionbutton-content-color-down-selected-emphasized",
6765
"--mod-actionbutton-content-color-focus",
68-
"--mod-actionbutton-content-color-focus-selected",
69-
"--mod-actionbutton-content-color-focus-selected-emphasized",
7066
"--mod-actionbutton-content-color-hover",
71-
"--mod-actionbutton-content-color-hover-selected",
72-
"--mod-actionbutton-content-color-hover-selected-emphasized",
7367
"--mod-actionbutton-edge-to-hold-icon",
7468
"--mod-actionbutton-edge-to-text",
7569
"--mod-actionbutton-edge-to-visual",
7670
"--mod-actionbutton-edge-to-visual-only",
7771
"--mod-actionbutton-focus-indicator-border-radius",
7872
"--mod-actionbutton-focus-indicator-color",
7973
"--mod-actionbutton-focus-indicator-gap",
80-
"--mod-actionbutton-focus-indicator-thickness",
81-
"--mod-actionbutton-font-size",
8274
"--mod-actionbutton-height",
8375
"--mod-actionbutton-icon-size",
8476
"--mod-actionbutton-label-color",
8577
"--mod-actionbutton-min-width",
86-
"--mod-actionbutton-static-content-color",
87-
"--mod-actionbutton-text-to-visual"
78+
"--mod-actionbutton-text-to-visual",
79+
"--mod-disabled-background-color",
80+
"--mod-disabled-content-color"
8881
],
8982
"component": [
9083
"--spectrum-action-button-edge-to-hold-icon-extra-large",
9184
"--spectrum-action-button-edge-to-hold-icon-extra-small",
9285
"--spectrum-action-button-edge-to-hold-icon-large",
9386
"--spectrum-action-button-edge-to-hold-icon-medium",
9487
"--spectrum-action-button-edge-to-hold-icon-small",
95-
"--spectrum-actionbutton-background-color",
88+
"--spectrum-actionbutton-animation-duration",
9689
"--spectrum-actionbutton-background-color-default",
9790
"--spectrum-actionbutton-background-color-disabled",
9891
"--spectrum-actionbutton-background-color-down",
@@ -103,34 +96,31 @@
10396
"--spectrum-actionbutton-background-color-selected-down",
10497
"--spectrum-actionbutton-background-color-selected-focus",
10598
"--spectrum-actionbutton-background-color-selected-hover",
106-
"--spectrum-actionbutton-border-color",
10799
"--spectrum-actionbutton-border-color-default",
108100
"--spectrum-actionbutton-border-color-disabled",
109101
"--spectrum-actionbutton-border-color-down",
110102
"--spectrum-actionbutton-border-color-focus",
111103
"--spectrum-actionbutton-border-color-hover",
112104
"--spectrum-actionbutton-border-radius",
113105
"--spectrum-actionbutton-border-width",
114-
"--spectrum-actionbutton-content-color",
106+
"--spectrum-actionbutton-content-color-default",
107+
"--spectrum-actionbutton-content-color-disabled",
108+
"--spectrum-actionbutton-content-color-down",
109+
"--spectrum-actionbutton-content-color-focus",
110+
"--spectrum-actionbutton-content-color-hover",
115111
"--spectrum-actionbutton-content-color-selected",
116112
"--spectrum-actionbutton-edge-to-hold-icon",
117113
"--spectrum-actionbutton-edge-to-text",
118114
"--spectrum-actionbutton-edge-to-visual",
119115
"--spectrum-actionbutton-edge-to-visual-only",
116+
"--spectrum-actionbutton-focus-indicator-border-radius",
120117
"--spectrum-actionbutton-focus-indicator-color",
121118
"--spectrum-actionbutton-focus-indicator-gap",
122119
"--spectrum-actionbutton-focus-indicator-thickness",
123120
"--spectrum-actionbutton-font-size",
124121
"--spectrum-actionbutton-height",
125122
"--spectrum-actionbutton-icon-size",
126-
"--spectrum-actionbutton-sized-edge-to-hold-icon",
127-
"--spectrum-actionbutton-sized-edge-to-text",
128-
"--spectrum-actionbutton-sized-edge-to-visual",
129-
"--spectrum-actionbutton-sized-edge-to-visual-only",
130-
"--spectrum-actionbutton-sized-font-size",
131-
"--spectrum-actionbutton-sized-height",
132-
"--spectrum-actionbutton-sized-icon-size",
133-
"--spectrum-actionbutton-sized-text-to-visual",
123+
"--spectrum-actionbutton-min-width",
134124
"--spectrum-actionbutton-text-to-visual"
135125
],
136126
"global": [
@@ -139,7 +129,6 @@
139129
"--spectrum-accent-background-color-hover",
140130
"--spectrum-accent-background-color-key-focus",
141131
"--spectrum-animation-duration-100",
142-
"--spectrum-black",
143132
"--spectrum-border-width-100",
144133
"--spectrum-component-edge-to-text-100",
145134
"--spectrum-component-edge-to-text-200",
@@ -161,13 +150,14 @@
161150
"--spectrum-component-height-300",
162151
"--spectrum-component-height-50",
163152
"--spectrum-component-height-75",
164-
"--spectrum-corner-radius-100",
153+
"--spectrum-corner-radius-medium-size-extra-large",
154+
"--spectrum-corner-radius-medium-size-extra-small",
155+
"--spectrum-corner-radius-medium-size-large",
156+
"--spectrum-corner-radius-medium-size-medium",
157+
"--spectrum-corner-radius-medium-size-small",
158+
"--spectrum-disabled-background-color",
165159
"--spectrum-disabled-border-color",
166160
"--spectrum-disabled-content-color",
167-
"--spectrum-disabled-static-black-border-color",
168-
"--spectrum-disabled-static-black-content-color",
169-
"--spectrum-disabled-static-white-border-color",
170-
"--spectrum-disabled-static-white-content-color",
171161
"--spectrum-focus-indicator-color",
172162
"--spectrum-focus-indicator-gap",
173163
"--spectrum-focus-indicator-thickness",
@@ -178,6 +168,7 @@
178168
"--spectrum-font-size-75",
179169
"--spectrum-gray-100",
180170
"--spectrum-gray-200",
171+
"--spectrum-gray-25",
181172
"--spectrum-gray-400",
182173
"--spectrum-gray-50",
183174
"--spectrum-gray-500",
@@ -202,36 +193,41 @@
202193
"--spectrum-text-to-visual-75",
203194
"--spectrum-transparent-black-100",
204195
"--spectrum-transparent-black-200",
205-
"--spectrum-transparent-black-400",
206196
"--spectrum-transparent-black-500",
207197
"--spectrum-transparent-black-600",
208198
"--spectrum-transparent-black-700",
209-
"--spectrum-transparent-black-800",
210-
"--spectrum-transparent-black-900",
199+
"--spectrum-transparent-white-100",
211200
"--spectrum-transparent-white-200",
212-
"--spectrum-transparent-white-400",
213201
"--spectrum-transparent-white-500",
214202
"--spectrum-transparent-white-600",
215203
"--spectrum-transparent-white-700",
216-
"--spectrum-transparent-white-800",
217-
"--spectrum-transparent-white-900",
218204
"--spectrum-white",
219205
"--spectrum-workflow-icon-size-100",
220206
"--spectrum-workflow-icon-size-200",
221207
"--spectrum-workflow-icon-size-300",
222208
"--spectrum-workflow-icon-size-50",
223209
"--spectrum-workflow-icon-size-75"
224210
],
225-
"system-theme": [],
226211
"passthroughs": [
227212
"--mod-button-animation-duration",
228213
"--mod-button-font-family",
229214
"--mod-button-line-height"
230215
],
231216
"high-contrast": [
232-
"--highcontrast-actionbutton-background-color",
233-
"--highcontrast-actionbutton-border-color",
234-
"--highcontrast-actionbutton-content-color",
235-
"--highcontrast-actionbutton-focus-indicator-color"
217+
"--highcontrast-actionbutton-background-color-default",
218+
"--highcontrast-actionbutton-background-color-disabled",
219+
"--highcontrast-actionbutton-background-color-down",
220+
"--highcontrast-actionbutton-background-color-focus",
221+
"--highcontrast-actionbutton-background-color-hover",
222+
"--highcontrast-actionbutton-border-color-default",
223+
"--highcontrast-actionbutton-border-color-disabled",
224+
"--highcontrast-actionbutton-border-color-down",
225+
"--highcontrast-actionbutton-border-color-focus",
226+
"--highcontrast-actionbutton-border-color-hover",
227+
"--highcontrast-actionbutton-content-color-default",
228+
"--highcontrast-actionbutton-content-color-disabled",
229+
"--highcontrast-actionbutton-content-color-down",
230+
"--highcontrast-actionbutton-content-color-focus",
231+
"--highcontrast-actionbutton-content-color-hover"
236232
]
237233
}

0 commit comments

Comments
 (0)