@stackoverflow/stacks 2.1.0 → 2.2.0
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 +83 -44
- package/dist/css/stacks.min.css +1 -1
- package/lib/atomic/__snapshots__/misc.less.test.ts.snap +893 -0
- package/lib/atomic/misc.less +30 -0
- package/lib/atomic/misc.less.test.ts +12 -0
- package/lib/components/badge/badge.a11y.test.ts +59 -18
- package/lib/components/badge/badge.less +16 -1
- package/lib/components/badge/badge.visual.test.ts +44 -16
- package/lib/components/button/button.less +15 -15
- package/lib/components/input-icon/input-icon.a11y.test.ts +81 -0
- package/lib/components/input-icon/input-icon.visual.test.ts +92 -0
- package/lib/components/select/select.a11y.test.ts +72 -0
- package/lib/components/select/select.visual.test.ts +72 -0
- package/lib/exports/__snapshots__/color.less.test.ts.snap +24 -24
- package/lib/exports/color-sets.less +12 -12
- package/lib/test/test-utils.ts +6 -2
- package/package.json +6 -6
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { html } from "@open-wc/testing";
|
|
2
|
+
import { runVisualTests } from "../../test/visual-test-utils";
|
|
3
|
+
import "../../index";
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
+
const template = ({ component, testid, className }: any) => html`
|
|
7
|
+
<div class="d-inline-flex p8 ${className}" data-testid="${testid}">
|
|
8
|
+
${component}
|
|
9
|
+
</div>
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
const child = (attr?: string): string => {
|
|
13
|
+
return `<select id="select-menu" ${attr}>
|
|
14
|
+
<option value="" selected>Please select one…</option>
|
|
15
|
+
<option value="walk">Walk</option>
|
|
16
|
+
<option value="bike">Bicycle</option>
|
|
17
|
+
<option value="car">Automobile</option>
|
|
18
|
+
<option value="rail">Train</option>
|
|
19
|
+
<option value="fly">Plane</option>
|
|
20
|
+
</select>`;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
describe("select", () => {
|
|
24
|
+
// default, sizes
|
|
25
|
+
runVisualTests({
|
|
26
|
+
baseClass: "s-select",
|
|
27
|
+
modifiers: {
|
|
28
|
+
primary: ["sm", "md", "lg", "xl"],
|
|
29
|
+
},
|
|
30
|
+
children: {
|
|
31
|
+
default: child(),
|
|
32
|
+
},
|
|
33
|
+
template,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// modifier classes
|
|
37
|
+
[
|
|
38
|
+
{
|
|
39
|
+
class: "is-disabled",
|
|
40
|
+
attr: 'disabled=""',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
class: "is-readonly",
|
|
44
|
+
attr: 'readonly=""',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
class: "has-success",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
class: "has-error",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
class: "has-warning",
|
|
54
|
+
},
|
|
55
|
+
].forEach((state) => {
|
|
56
|
+
runVisualTests({
|
|
57
|
+
baseClass: "s-select",
|
|
58
|
+
modifiers: {
|
|
59
|
+
global: [`state-${state.class}`],
|
|
60
|
+
},
|
|
61
|
+
children: {
|
|
62
|
+
selected: child(state.attr),
|
|
63
|
+
},
|
|
64
|
+
template: ({ component, testid }) =>
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
66
|
+
template({ component, testid, className: state.class }),
|
|
67
|
+
options: {
|
|
68
|
+
includeNullModifier: false,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
});
|
|
@@ -249,12 +249,12 @@ body:not(.theme-highcontrast):not(.theme-dark) .theme-dark__forced .themed {
|
|
|
249
249
|
--yellow-400: hsl(43, 90%, 75%);
|
|
250
250
|
--yellow-500: hsl(43, 90%, 82%);
|
|
251
251
|
--yellow-600: hsl(43, 90%, 91%);
|
|
252
|
-
--purple-100: hsl(237,
|
|
253
|
-
--purple-200: hsl(237,
|
|
254
|
-
--purple-300: hsl(237,
|
|
255
|
-
--purple-400: hsl(237,
|
|
256
|
-
--purple-500: hsl(237,
|
|
257
|
-
--purple-600: hsl(237,
|
|
252
|
+
--purple-100: hsl(237, 26%, 23%);
|
|
253
|
+
--purple-200: hsl(237, 26%, 44%);
|
|
254
|
+
--purple-300: hsl(237, 26%, 56%);
|
|
255
|
+
--purple-400: hsl(237, 98%, 87%);
|
|
256
|
+
--purple-500: hsl(237, 98%, 92%);
|
|
257
|
+
--purple-600: hsl(237, 98%, 96%);
|
|
258
258
|
--gold-100: hsl(45, 29%, 24%);
|
|
259
259
|
--gold-200: hsl(45, 47%, 37%);
|
|
260
260
|
--gold-300: hsl(45, 92%, 62%);
|
|
@@ -382,12 +382,12 @@ body:not(.theme-highcontrast):not(.theme-dark) .theme-dark__forced .themed {
|
|
|
382
382
|
--yellow-400: hsl(43, 90%, 75%);
|
|
383
383
|
--yellow-500: hsl(43, 90%, 82%);
|
|
384
384
|
--yellow-600: hsl(43, 90%, 91%);
|
|
385
|
-
--purple-100: hsl(237,
|
|
386
|
-
--purple-200: hsl(237,
|
|
387
|
-
--purple-300: hsl(237,
|
|
388
|
-
--purple-400: hsl(237,
|
|
389
|
-
--purple-500: hsl(237,
|
|
390
|
-
--purple-600: hsl(237,
|
|
385
|
+
--purple-100: hsl(237, 26%, 23%);
|
|
386
|
+
--purple-200: hsl(237, 26%, 44%);
|
|
387
|
+
--purple-300: hsl(237, 26%, 56%);
|
|
388
|
+
--purple-400: hsl(237, 98%, 87%);
|
|
389
|
+
--purple-500: hsl(237, 98%, 92%);
|
|
390
|
+
--purple-600: hsl(237, 98%, 96%);
|
|
391
391
|
--gold-100: hsl(45, 29%, 24%);
|
|
392
392
|
--gold-200: hsl(45, 47%, 37%);
|
|
393
393
|
--gold-300: hsl(45, 92%, 62%);
|
|
@@ -630,12 +630,12 @@ body.theme-highcontrast:not(.theme-dark) .theme-dark__forced {
|
|
|
630
630
|
--yellow-400: hsl(43, 75%, 75%);
|
|
631
631
|
--yellow-500: hsl(48, 74%, 91%);
|
|
632
632
|
--yellow-600: hsl(44, 74%, 91%);
|
|
633
|
-
--purple-100: hsl(237,
|
|
634
|
-
--purple-200: hsl(237,
|
|
635
|
-
--purple-300: hsl(237,
|
|
636
|
-
--purple-400: hsl(237,
|
|
637
|
-
--purple-500: hsl(237,
|
|
638
|
-
--purple-600: hsl(237,
|
|
633
|
+
--purple-100: hsl(237, 26%, 23%);
|
|
634
|
+
--purple-200: hsl(237, 26%, 23%);
|
|
635
|
+
--purple-300: hsl(237, 98%, 87%);
|
|
636
|
+
--purple-400: hsl(237, 98%, 87%);
|
|
637
|
+
--purple-500: hsl(237, 98%, 96%);
|
|
638
|
+
--purple-600: hsl(237, 98%, 96%);
|
|
639
639
|
--gold-100: hsl(45, 22%, 25%);
|
|
640
640
|
--gold-200: hsl(45, 22%, 25%);
|
|
641
641
|
--gold-300: hsl(45, 92%, 62%);
|
|
@@ -745,12 +745,12 @@ body.theme-highcontrast:not(.theme-dark) .theme-dark__forced {
|
|
|
745
745
|
--yellow-400: hsl(43, 75%, 75%);
|
|
746
746
|
--yellow-500: hsl(48, 74%, 91%);
|
|
747
747
|
--yellow-600: hsl(44, 74%, 91%);
|
|
748
|
-
--purple-100: hsl(237,
|
|
749
|
-
--purple-200: hsl(237,
|
|
750
|
-
--purple-300: hsl(237,
|
|
751
|
-
--purple-400: hsl(237,
|
|
752
|
-
--purple-500: hsl(237,
|
|
753
|
-
--purple-600: hsl(237,
|
|
748
|
+
--purple-100: hsl(237, 26%, 23%);
|
|
749
|
+
--purple-200: hsl(237, 26%, 23%);
|
|
750
|
+
--purple-300: hsl(237, 98%, 87%);
|
|
751
|
+
--purple-400: hsl(237, 98%, 87%);
|
|
752
|
+
--purple-500: hsl(237, 98%, 96%);
|
|
753
|
+
--purple-600: hsl(237, 98%, 96%);
|
|
754
754
|
--gold-100: hsl(45, 22%, 25%);
|
|
755
755
|
--gold-200: hsl(45, 22%, 25%);
|
|
756
756
|
--gold-300: hsl(45, 92%, 62%);
|
|
@@ -264,12 +264,12 @@
|
|
|
264
264
|
600: hsl(237, 50%, 32%);
|
|
265
265
|
}
|
|
266
266
|
.set-purple-dark() {
|
|
267
|
-
100: hsl(237,
|
|
268
|
-
200: hsl(237,
|
|
269
|
-
300: hsl(237,
|
|
270
|
-
400: hsl(237,
|
|
271
|
-
500: hsl(237,
|
|
272
|
-
600: hsl(237,
|
|
267
|
+
100: hsl(237, 26%, 23%);
|
|
268
|
+
200: hsl(237, 26%, 44%);
|
|
269
|
+
300: hsl(237, 26%, 56%);
|
|
270
|
+
400: hsl(237, 98%, 87%);
|
|
271
|
+
500: hsl(237, 98%, 92%);
|
|
272
|
+
600: hsl(237, 98%, 96%);
|
|
273
273
|
}
|
|
274
274
|
.set-purple-hc() {
|
|
275
275
|
100: hsl(237, 83%, 98%);
|
|
@@ -280,12 +280,12 @@
|
|
|
280
280
|
600: hsl(237, 50%, 32%);
|
|
281
281
|
}
|
|
282
282
|
.set-purple-hc-dark() {
|
|
283
|
-
100: hsl(237,
|
|
284
|
-
200: hsl(237,
|
|
285
|
-
300: hsl(237,
|
|
286
|
-
400: hsl(237,
|
|
287
|
-
500: hsl(237,
|
|
288
|
-
600: hsl(237,
|
|
283
|
+
100: hsl(237, 26%, 23%);
|
|
284
|
+
200: hsl(237, 26%, 23%);
|
|
285
|
+
300: hsl(237, 98%, 87%);
|
|
286
|
+
400: hsl(237, 98%, 87%);
|
|
287
|
+
500: hsl(237, 98%, 96%);
|
|
288
|
+
600: hsl(237, 98%, 96%);
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
// gold
|
package/lib/test/test-utils.ts
CHANGED
|
@@ -215,10 +215,14 @@ const generatePrimitiveVariations = ({
|
|
|
215
215
|
: modifiers.primary
|
|
216
216
|
: [""];
|
|
217
217
|
const secondaryModifiers = modifiers?.secondary
|
|
218
|
-
?
|
|
218
|
+
? opts.includeNullModifier
|
|
219
|
+
? ["", ...(<[]>modifiers.secondary)]
|
|
220
|
+
: modifiers.secondary
|
|
219
221
|
: [""];
|
|
220
222
|
const globalModifiers = modifiers?.global
|
|
221
|
-
?
|
|
223
|
+
? opts.includeNullModifier
|
|
224
|
+
? ["", ...(<[]>modifiers.global)]
|
|
225
|
+
: modifiers.global
|
|
222
226
|
: [""];
|
|
223
227
|
|
|
224
228
|
primaryModifiers.forEach((primaryModifier) => {
|
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.
|
|
8
|
+
"version": "2.2.0",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
11
11
|
"lib"
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@open-wc/testing": "^4.0.0",
|
|
48
48
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
49
49
|
"@rollup/plugin-replace": "^5.0.5",
|
|
50
|
-
"@stackoverflow/stacks-editor": "^0.
|
|
51
|
-
"@stackoverflow/stacks-icons": "^6.0.
|
|
50
|
+
"@stackoverflow/stacks-editor": "^0.10.1",
|
|
51
|
+
"@stackoverflow/stacks-icons": "^6.0.1",
|
|
52
52
|
"@testing-library/dom": "^9.3.4",
|
|
53
53
|
"@testing-library/user-event": "^14.5.2",
|
|
54
54
|
"@types/cssbeautify": "^0.3.5",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@types/mocha": "^10.0.6",
|
|
57
57
|
"@typescript-eslint/eslint-plugin": "^6.20.0",
|
|
58
58
|
"@typescript-eslint/parser": "^6.21.0",
|
|
59
|
-
"@web/dev-server-esbuild": "^1.0.
|
|
59
|
+
"@web/dev-server-esbuild": "^1.0.2",
|
|
60
60
|
"@web/dev-server-rollup": "^0.6.1",
|
|
61
61
|
"@web/test-runner": "^0.18.0",
|
|
62
62
|
"@web/test-runner-playwright": "^0.11.0",
|
|
@@ -77,12 +77,12 @@
|
|
|
77
77
|
"less-loader": "^12.2.0",
|
|
78
78
|
"list.js": "^2.3.1",
|
|
79
79
|
"markdown-it": "^14.0.0",
|
|
80
|
-
"mini-css-extract-plugin": "^2.
|
|
80
|
+
"mini-css-extract-plugin": "^2.8.0",
|
|
81
81
|
"postcss-less": "^6.0.0",
|
|
82
82
|
"postcss-loader": "^8.0.0",
|
|
83
83
|
"prettier": "^3.2.4",
|
|
84
84
|
"rollup-plugin-postcss": "^4.0.2",
|
|
85
|
-
"stylelint": "^16.2.
|
|
85
|
+
"stylelint": "^16.2.1",
|
|
86
86
|
"stylelint-config-recommended": "^14.0.0",
|
|
87
87
|
"stylelint-config-standard": "^36.0.0",
|
|
88
88
|
"terser-webpack-plugin": "^5.3.10",
|