@stackoverflow/stacks 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/stacks.css +30 -23
- package/dist/css/stacks.min.css +1 -1
- package/lib/atomic/v1/__snapshots__/border.less.test.ts.snap +1 -7
- package/lib/atomic/v1/__snapshots__/color.less.test.ts.snap +1 -7
- package/lib/atomic/v1/__snapshots__/typography.less.test.ts.snap +1 -7
- package/lib/components/anchor/anchor.less +3 -3
- package/lib/components/link/link.less +2 -2
- package/lib/components/modal/modal.a11y.test.ts +42 -0
- package/lib/components/modal/modal.less +8 -5
- package/lib/components/modal/modal.visual.test.ts +42 -0
- package/lib/exports/__snapshots__/color-mixins.less.test.ts.snap +3 -3
- package/lib/exports/__snapshots__/color.less.test.ts.snap +5 -5
- package/lib/exports/color-sets.less +5 -5
- package/lib/test/test-utils.ts +2 -2
- package/package.json +18 -18
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`atomic: border v1 > should output all v1 atomic css classes for colors 1`] = `
|
|
4
|
-
"
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
@media (prefers-color-scheme: dark) {
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.bc-white-legacy-1 {
|
|
4
|
+
".bc-white-legacy-1 {
|
|
11
5
|
border-color: var(--black-legacy-500) !important;
|
|
12
6
|
}
|
|
13
7
|
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`atomic: color v1 > should output all v1 atomic css classes for colors 1`] = `
|
|
4
|
-
"
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
@media (prefers-color-scheme: dark) {
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.fc-black-legacy-900,
|
|
4
|
+
".fc-black-legacy-900,
|
|
11
5
|
.h\\\\:fc-black-legacy-900:hover,
|
|
12
6
|
.f\\\\:fc-black-legacy-900:focus,
|
|
13
7
|
.f\\\\:fc-black-legacy-900:focus-within {
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`atomic: border v1 > should output all v1 atomic css classes for colors 1`] = `
|
|
4
|
-
"
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
@media (prefers-color-scheme: dark) {
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.fc-dark-legacy {
|
|
4
|
+
".fc-dark-legacy {
|
|
11
5
|
color: var(--fc-dark-legacy) !important;
|
|
12
6
|
}
|
|
13
7
|
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
&&__grayscale {
|
|
29
|
-
--_an-a-fc: var(--black-
|
|
30
|
-
--_an-a-fc-hover: var(--black-
|
|
31
|
-
--_an-a-fc-visited: var(--black-
|
|
29
|
+
--_an-a-fc: var(--black-500);
|
|
30
|
+
--_an-a-fc-hover: var(--black-600);
|
|
31
|
+
--_an-a-fc-visited: var(--black-400);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
&&__inherit {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { html } from "@open-wc/testing";
|
|
2
|
+
import { runComponentTests } from "../../test/test-utils";
|
|
3
|
+
import { IconClearSm } from "@stackoverflow/stacks-icons/icons";
|
|
4
|
+
import "../../index";
|
|
5
|
+
|
|
6
|
+
describe("modal", () => {
|
|
7
|
+
runComponentTests({
|
|
8
|
+
type: "a11y",
|
|
9
|
+
baseClass: `s-modal`,
|
|
10
|
+
variants: ["danger"],
|
|
11
|
+
modifiers: {
|
|
12
|
+
primary: ["celebration"],
|
|
13
|
+
secondary: ["full"],
|
|
14
|
+
},
|
|
15
|
+
children: {
|
|
16
|
+
default: `
|
|
17
|
+
<div class="s-modal--dialog" role="document">
|
|
18
|
+
<h1 class="s-modal--header" id="modal-title">Modal header</h1>
|
|
19
|
+
<p class="s-modal--body" id="modal-description">Modal body. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>
|
|
20
|
+
<div class="d-flex gx8 s-modal--footer">
|
|
21
|
+
<button class="s-btn s-btn__filled" type="button">Confirm</button>
|
|
22
|
+
<button class="s-btn s-btn__muted" type="button">Cancel</button>
|
|
23
|
+
</div>
|
|
24
|
+
<button class="s-modal--close s-btn s-btn__muted" type="button" aria-label="Close">
|
|
25
|
+
${IconClearSm}
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
`,
|
|
29
|
+
},
|
|
30
|
+
tag: "aside",
|
|
31
|
+
attributes: {
|
|
32
|
+
"id": "example-modal",
|
|
33
|
+
"tabindex": "-1",
|
|
34
|
+
"aria-hidden": "false",
|
|
35
|
+
"aria-labelledby": "modal-title",
|
|
36
|
+
"class": "ps-relative p32",
|
|
37
|
+
},
|
|
38
|
+
template: ({ component, testid }) => html`
|
|
39
|
+
<div class="m8 ws6" data-testid="${testid}">${component}</div>
|
|
40
|
+
`,
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
--_mo-header-fc: var(--fc-dark);
|
|
10
10
|
|
|
11
11
|
// CONTEXTUAL STYLES
|
|
12
|
+
.dark-mode({
|
|
13
|
+
--_mo-dialog-bg: var(--black-225);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
.highcontrast-dark-mode({
|
|
17
|
+
--_mo-dialog-bg: var(--black-200);
|
|
18
|
+
});
|
|
19
|
+
|
|
12
20
|
&[aria-hidden="false"] {
|
|
13
21
|
&,
|
|
14
22
|
.s-modal--dialog {
|
|
@@ -22,7 +30,6 @@
|
|
|
22
30
|
|
|
23
31
|
// MODIFIERS
|
|
24
32
|
&&__celebration {
|
|
25
|
-
--_mo-close-t: var(--su48);
|
|
26
33
|
--_mo-dialog-pt: var(--su64);
|
|
27
34
|
|
|
28
35
|
.s-modal--dialog {
|
|
@@ -61,10 +68,6 @@
|
|
|
61
68
|
}
|
|
62
69
|
|
|
63
70
|
& &--dialog {
|
|
64
|
-
.dark-mode({
|
|
65
|
-
--_mo-dialog-bg: var(--black-225);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
71
|
padding: var(--_mo-dialog-pt) var(--su24) var(--su24);
|
|
69
72
|
|
|
70
73
|
@scrollbar-styles();
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { html } from "@open-wc/testing";
|
|
2
|
+
import { runComponentTests } from "../../test/test-utils";
|
|
3
|
+
import { IconClearSm } from "@stackoverflow/stacks-icons/icons";
|
|
4
|
+
import "../../index";
|
|
5
|
+
|
|
6
|
+
describe("modal", () => {
|
|
7
|
+
runComponentTests({
|
|
8
|
+
type: "visual",
|
|
9
|
+
baseClass: `s-modal`,
|
|
10
|
+
variants: ["danger"],
|
|
11
|
+
modifiers: {
|
|
12
|
+
primary: ["celebration"],
|
|
13
|
+
secondary: ["full"],
|
|
14
|
+
},
|
|
15
|
+
children: {
|
|
16
|
+
default: `
|
|
17
|
+
<div class="s-modal--dialog" role="document">
|
|
18
|
+
<h1 class="s-modal--header" id="modal-title">Modal header</h1>
|
|
19
|
+
<p class="s-modal--body" id="modal-description">Modal body. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>
|
|
20
|
+
<div class="d-flex gx8 s-modal--footer">
|
|
21
|
+
<button class="s-btn s-btn__filled" type="button">Confirm</button>
|
|
22
|
+
<button class="s-btn s-btn__muted" type="button">Cancel</button>
|
|
23
|
+
</div>
|
|
24
|
+
<button class="s-modal--close s-btn s-btn__muted" type="button" aria-label="Close">
|
|
25
|
+
${IconClearSm}
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
`,
|
|
29
|
+
},
|
|
30
|
+
tag: "aside",
|
|
31
|
+
attributes: {
|
|
32
|
+
"id": "example-modal",
|
|
33
|
+
"tabindex": "-1",
|
|
34
|
+
"aria-hidden": "false",
|
|
35
|
+
"aria-labelledby": "modal-title",
|
|
36
|
+
"class": "ps-relative p32",
|
|
37
|
+
},
|
|
38
|
+
template: ({ component, testid }) => html`
|
|
39
|
+
<div class="m8 ws6" data-testid="${testid}">${component}</div>
|
|
40
|
+
`,
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -320,12 +320,12 @@ body .themed {
|
|
|
320
320
|
--red-400: hsl(0, 60%, 49%);
|
|
321
321
|
--red-500: hsl(0, 65%, 37%);
|
|
322
322
|
--red-600: hsl(0, 65%, 22%);
|
|
323
|
-
--yellow-100: hsl(43,
|
|
324
|
-
--yellow-200: hsl(43,
|
|
323
|
+
--yellow-100: hsl(43, 85%, 95%);
|
|
324
|
+
--yellow-200: hsl(43, 85%, 88%);
|
|
325
325
|
--yellow-300: hsl(43, 85%, 72%);
|
|
326
326
|
--yellow-400: hsl(43, 85%, 50%);
|
|
327
327
|
--yellow-500: hsl(43, 85%, 33%);
|
|
328
|
-
--yellow-600: hsl(43,
|
|
328
|
+
--yellow-600: hsl(43, 85%, 18%);
|
|
329
329
|
--purple-100: hsl(237, 83%, 98%);
|
|
330
330
|
--purple-200: hsl(237, 78%, 93%);
|
|
331
331
|
--purple-300: hsl(237, 60%, 83%);
|
|
@@ -108,12 +108,12 @@ body:not(.theme-highcontrast).theme-system .theme-light__forced .themed {
|
|
|
108
108
|
--red-400: hsl(0, 60%, 49%);
|
|
109
109
|
--red-500: hsl(0, 65%, 37%);
|
|
110
110
|
--red-600: hsl(0, 65%, 22%);
|
|
111
|
-
--yellow-100: hsl(43,
|
|
112
|
-
--yellow-200: hsl(43,
|
|
111
|
+
--yellow-100: hsl(43, 85%, 95%);
|
|
112
|
+
--yellow-200: hsl(43, 85%, 88%);
|
|
113
113
|
--yellow-300: hsl(43, 85%, 72%);
|
|
114
114
|
--yellow-400: hsl(43, 85%, 50%);
|
|
115
115
|
--yellow-500: hsl(43, 85%, 33%);
|
|
116
|
-
--yellow-600: hsl(43,
|
|
116
|
+
--yellow-600: hsl(43, 85%, 18%);
|
|
117
117
|
--purple-100: hsl(237, 83%, 98%);
|
|
118
118
|
--purple-200: hsl(237, 78%, 93%);
|
|
119
119
|
--purple-300: hsl(237, 60%, 83%);
|
|
@@ -485,8 +485,8 @@ body.theme-highcontrast.theme-system .theme-light__forced {
|
|
|
485
485
|
--red-400: hsl(0, 65%, 37%);
|
|
486
486
|
--red-500: hsl(0, 65%, 22%);
|
|
487
487
|
--red-600: hsl(0, 65%, 22%);
|
|
488
|
-
--yellow-100: hsl(41,
|
|
489
|
-
--yellow-200: hsl(41,
|
|
488
|
+
--yellow-100: hsl(41, 85%, 95%);
|
|
489
|
+
--yellow-200: hsl(41, 85%, 95%);
|
|
490
490
|
--yellow-300: hsl(43, 85%, 50%);
|
|
491
491
|
--yellow-400: hsl(43, 85%, 50%);
|
|
492
492
|
--yellow-500: hsl(48, 85%, 18%);
|
|
@@ -222,12 +222,12 @@
|
|
|
222
222
|
|
|
223
223
|
// Yellow
|
|
224
224
|
.set-yellow() {
|
|
225
|
-
100: hsl(43,
|
|
226
|
-
200: hsl(43,
|
|
225
|
+
100: hsl(43, 85%, 95%);
|
|
226
|
+
200: hsl(43, 85%, 88%);
|
|
227
227
|
300: hsl(43, 85%, 72%);
|
|
228
228
|
400: hsl(43, 85%, 50%);
|
|
229
229
|
500: hsl(43, 85%, 33%);
|
|
230
|
-
600: hsl(43,
|
|
230
|
+
600: hsl(43, 85%, 18%);
|
|
231
231
|
}
|
|
232
232
|
.set-yellow-dark() {
|
|
233
233
|
100: hsl(43, 50%, 17%);
|
|
@@ -238,8 +238,8 @@
|
|
|
238
238
|
600: hsl(43, 90%, 91%);
|
|
239
239
|
}
|
|
240
240
|
.set-yellow-hc() {
|
|
241
|
-
100: hsl(41,
|
|
242
|
-
200: hsl(41,
|
|
241
|
+
100: hsl(41, 85%, 95%);
|
|
242
|
+
200: hsl(41, 85%, 95%);
|
|
243
243
|
300: hsl(43, 85%, 50%);
|
|
244
244
|
400: hsl(43, 85%, 50%);
|
|
245
245
|
500: hsl(48, 85%, 18%);
|
package/lib/test/test-utils.ts
CHANGED
|
@@ -3,13 +3,13 @@ import { screen } from "@testing-library/dom";
|
|
|
3
3
|
import { visualDiff } from "@web/test-runner-visual-regression";
|
|
4
4
|
import type { TemplateResult } from "lit-html";
|
|
5
5
|
import axe from "axe-core";
|
|
6
|
-
import
|
|
6
|
+
import registerAPCACheck from "apca-check";
|
|
7
7
|
|
|
8
8
|
const customConformanceThresholdFn = (fontSize: string): number | null => {
|
|
9
9
|
return parseFloat(fontSize) >= 32 ? 45 : 60;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
registerAPCACheck("custom", customConformanceThresholdFn);
|
|
13
13
|
|
|
14
14
|
const colorThemes = ["dark", "light"];
|
|
15
15
|
const baseThemes = ["", "highcontrast"];
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/StackExchange/Stacks.git"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.0.
|
|
8
|
+
"version": "2.0.5",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
11
11
|
"lib"
|
|
@@ -46,30 +46,30 @@
|
|
|
46
46
|
"@11ty/eleventy": "^2.0.1",
|
|
47
47
|
"@highlightjs/cdn-assets": "^11.9.0",
|
|
48
48
|
"@open-wc/testing": "^3.2.0",
|
|
49
|
-
"@rollup/plugin-commonjs": "^25.0.
|
|
50
|
-
"@rollup/plugin-replace": "^5.0.
|
|
49
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
50
|
+
"@rollup/plugin-replace": "^5.0.5",
|
|
51
51
|
"@stackoverflow/stacks-editor": "^0.9.0",
|
|
52
52
|
"@stackoverflow/stacks-icons": "^6.0.0",
|
|
53
53
|
"@testing-library/dom": "^9.3.3",
|
|
54
54
|
"@testing-library/user-event": "^14.5.1",
|
|
55
|
-
"@types/cssbeautify": "^0.3.
|
|
56
|
-
"@types/less": "^3.0.
|
|
57
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
58
|
-
"@typescript-eslint/parser": "^6.
|
|
59
|
-
"@web/dev-server-esbuild": "^0.4.
|
|
60
|
-
"@web/dev-server-rollup": "^0.5.
|
|
61
|
-
"@web/test-runner": "^0.17.
|
|
62
|
-
"@web/test-runner-playwright": "^0.10.
|
|
55
|
+
"@types/cssbeautify": "^0.3.4",
|
|
56
|
+
"@types/less": "^3.0.5",
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^6.9.0",
|
|
58
|
+
"@typescript-eslint/parser": "^6.9.0",
|
|
59
|
+
"@web/dev-server-esbuild": "^0.4.3",
|
|
60
|
+
"@web/dev-server-rollup": "^0.5.4",
|
|
61
|
+
"@web/test-runner": "^0.17.2",
|
|
62
|
+
"@web/test-runner-playwright": "^0.10.2",
|
|
63
63
|
"@web/test-runner-visual-regression": "^0.8.2",
|
|
64
|
-
"
|
|
65
|
-
"concurrently": "^8.2.
|
|
64
|
+
"apca-check": "^0.1.0",
|
|
65
|
+
"concurrently": "^8.2.2",
|
|
66
66
|
"css-loader": "^6.8.1",
|
|
67
67
|
"cssbeautify": "^0.3.1",
|
|
68
68
|
"cssnano": "^6.0.1",
|
|
69
69
|
"docsearch.js": "^2.6.3",
|
|
70
70
|
"eleventy-plugin-highlightjs": "^1.1.0",
|
|
71
71
|
"eleventy-plugin-nesting-toc": "^1.3.0",
|
|
72
|
-
"eslint": "^8.
|
|
72
|
+
"eslint": "^8.52.0",
|
|
73
73
|
"eslint-config-prettier": "^9.0.0",
|
|
74
74
|
"eslint-plugin-no-unsanitized": "^4.0.2",
|
|
75
75
|
"jquery": "^3.7.1",
|
|
@@ -81,16 +81,16 @@
|
|
|
81
81
|
"postcss-loader": "^7.3.3",
|
|
82
82
|
"prettier": "^3.0.3",
|
|
83
83
|
"rollup-plugin-postcss": "^4.0.2",
|
|
84
|
-
"stylelint": "^15.
|
|
84
|
+
"stylelint": "^15.11.0",
|
|
85
85
|
"stylelint-config-recommended": "^13.0.0",
|
|
86
86
|
"stylelint-config-standard": "^34.0.0",
|
|
87
87
|
"terser-webpack-plugin": "^5.3.9",
|
|
88
88
|
"ts-loader": "^9.5.0",
|
|
89
89
|
"typescript": "^5.2.2",
|
|
90
|
-
"vitest": "^0.
|
|
91
|
-
"webpack": "^5.
|
|
90
|
+
"vitest": "^0.34.6",
|
|
91
|
+
"webpack": "^5.89.0",
|
|
92
92
|
"webpack-cli": "^5.1.4",
|
|
93
|
-
"webpack-merge": "^5.
|
|
93
|
+
"webpack-merge": "^5.10.0"
|
|
94
94
|
},
|
|
95
95
|
"browserslist": [
|
|
96
96
|
"last 2 versions",
|