@stackoverflow/stacks 2.0.9 → 2.1.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/LICENSE.MD +1 -1
- package/README.md +7 -9
- package/dist/css/stacks.css +193 -206
- package/dist/css/stacks.min.css +1 -1
- package/dist/js/stacks.js +1 -1
- package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +2 -3
- package/lib/components/activity-indicator/activity-indicator.visual.test.ts +2 -3
- package/lib/components/anchor/anchor.a11y.test.ts +2 -4
- package/lib/components/anchor/anchor.visual.test.ts +2 -4
- package/lib/components/avatar/avatar.a11y.test.ts +2 -3
- package/lib/components/avatar/avatar.visual.test.ts +2 -3
- package/lib/components/award-bling/award-bling.a11y.test.ts +2 -4
- package/lib/components/award-bling/award-bling.visual.test.ts +2 -4
- package/lib/components/badge/badge.a11y.test.ts +7 -16
- package/lib/components/badge/badge.visual.test.ts +8 -21
- package/lib/components/banner/banner.a11y.test.ts +2 -3
- package/lib/components/banner/banner.visual.test.ts +2 -3
- package/lib/components/block-link/block-link.a11y.test.ts +4 -9
- package/lib/components/block-link/block-link.less +7 -10
- package/lib/components/block-link/block-link.visual.test.ts +4 -9
- package/lib/components/breadcrumbs/breadcrumbs.a11y.test.ts +2 -3
- package/lib/components/breadcrumbs/breadcrumbs.visual.test.ts +2 -3
- package/lib/components/button/button.a11y.test.ts +2 -3
- package/lib/components/button/button.less +70 -35
- package/lib/components/button/button.visual.test.ts +2 -3
- package/lib/components/card/card.a11y.test.ts +2 -3
- package/lib/components/card/card.visual.test.ts +3 -6
- package/lib/components/check-control/check-control.a11y.test.ts +2 -4
- package/lib/components/check-control/check-control.visual.test.ts +2 -4
- package/lib/components/check-group/check-group.a11y.test.ts +2 -4
- package/lib/components/check-group/check-group.visual.test.ts +2 -4
- package/lib/components/checkbox_radio/checkbox_radio.a11y.test.ts +2 -4
- package/lib/components/checkbox_radio/checkbox_radio.less +1 -13
- package/lib/components/checkbox_radio/checkbox_radio.visual.test.ts +2 -4
- package/lib/components/code-block/code-block.a11y.test.ts +2 -4
- package/lib/components/code-block/code-block.visual.test.ts +2 -4
- package/lib/components/description/description.a11y.test.ts +2 -4
- package/lib/components/description/description.visual.test.ts +2 -4
- package/lib/components/empty-state/empty-state.a11y.test.ts +2 -3
- package/lib/components/empty-state/empty-state.visual.test.ts +2 -3
- package/lib/components/expandable/expandable.a11y.test.ts +2 -3
- package/lib/components/expandable/expandable.visual.test.ts +2 -3
- package/lib/components/input-fill/input-fill.a11y.test.ts +2 -3
- package/lib/components/input-fill/input-fill.visual.test.ts +2 -3
- package/lib/components/input-message/input-message.a11y.test.ts +2 -3
- package/lib/components/input-message/input-message.visual.test.ts +2 -3
- package/lib/components/input_textarea/input_textarea.a11y.test.ts +4 -7
- package/lib/components/input_textarea/input_textarea.less +2 -20
- package/lib/components/input_textarea/input_textarea.visual.test.ts +4 -7
- package/lib/components/label/label.a11y.test.ts +2 -3
- package/lib/components/label/label.visual.test.ts +2 -3
- package/lib/components/link/link.a11y.test.ts +2 -3
- package/lib/components/link/link.visual.test.ts +2 -3
- package/lib/components/link-preview/link-preview.a11y.test.ts +2 -3
- package/lib/components/link-preview/link-preview.visual.test.ts +3 -3
- package/lib/components/menu/menu.a11y.test.ts +2 -3
- package/lib/components/menu/menu.visual.test.ts +2 -3
- package/lib/components/modal/modal.a11y.test.ts +2 -3
- package/lib/components/modal/modal.visual.test.ts +2 -3
- package/lib/components/navigation/navigation.a11y.test.ts +2 -3
- package/lib/components/navigation/navigation.less +3 -1
- package/lib/components/navigation/navigation.visual.test.ts +3 -6
- package/lib/components/notice/notice.a11y.test.ts +2 -3
- package/lib/components/notice/notice.visual.test.ts +2 -3
- package/lib/components/page-title/page-title.a11y.test.ts +2 -3
- package/lib/components/page-title/page-title.visual.test.ts +2 -3
- package/lib/components/pagination/pagination.a11y.test.ts +2 -3
- package/lib/components/pagination/pagination.less +9 -0
- package/lib/components/pagination/pagination.visual.test.ts +2 -3
- package/lib/components/progress-bar/progress-bar.a11y.test.ts +7 -18
- package/lib/components/progress-bar/progress-bar.visual.test.ts +7 -18
- package/lib/components/select/select.less +1 -15
- package/lib/components/spinner/spinner.a11y.test.ts +2 -3
- package/lib/components/spinner/spinner.visual.test.ts +4 -7
- package/lib/components/table/table.a11y.test.ts +3 -4
- package/lib/components/table/table.visual.test.ts +2 -3
- package/lib/components/tag/tag.a11y.test.ts +2 -3
- package/lib/components/tag/tag.less +27 -21
- package/lib/components/tag/tag.visual.test.ts +3 -6
- package/lib/components/toast/toast.a11y.test.ts +2 -3
- package/lib/components/toast/toast.visual.test.ts +2 -3
- package/lib/components/toggle-switch/toggle-switch.a11y.test.ts +3 -6
- package/lib/components/toggle-switch/toggle-switch.less +5 -16
- package/lib/components/toggle-switch/toggle-switch.visual.test.ts +3 -7
- package/lib/components/topbar/topbar.less +61 -39
- package/lib/components/topbar/topbar.visual.test.ts +188 -0
- package/lib/components/uploader/uploader.less +1 -1
- package/lib/exports/__snapshots__/color-mixins.less.test.ts.snap +2 -0
- package/lib/exports/__snapshots__/color.less.test.ts.snap +12 -0
- package/lib/exports/color-sets.less +17 -7
- package/lib/exports/mixins.less +33 -0
- package/lib/input-utils.less +0 -3
- package/lib/test/a11y-test-utils.ts +94 -0
- package/lib/test/assertions.ts +10 -3
- package/lib/test/test-utils.ts +152 -300
- package/lib/test/visual-test-utils.ts +58 -0
- package/package.json +7 -8
- package/lib/components/popover/tooltip.visual.test.ts +0 -31
|
@@ -5,35 +5,49 @@
|
|
|
5
5
|
// --_bu-bg: inherit; // [1]
|
|
6
6
|
--_bu-br: var(--br-md);
|
|
7
7
|
--_bu-fc: var(--theme-button-color, var(--theme-secondary-400));
|
|
8
|
-
--_bu-focus-ring: 0 0 0 var(--su-static4) var(--focus-ring);
|
|
9
8
|
--_bu-fs: var(--fs-body1);
|
|
10
9
|
--_bu-p: 0.8em;
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
|
|
11
|
+
// Active
|
|
12
|
+
--_bu-bc-active: var(--_bu-bc);
|
|
13
13
|
--_bu-bg-active: var(--theme-button-active-background-color, var(--theme-secondary-300));
|
|
14
|
+
--_bu-fc-active: var(--theme-button-hover-color, var(--theme-secondary-500)); // Note: hover color used on purpose
|
|
15
|
+
|
|
16
|
+
// Hover
|
|
17
|
+
--_bu-bc-hover: var(--_bu-bc);
|
|
14
18
|
--_bu-bg-hover: var(--theme-button-hover-background-color, var(--theme-secondary-200));
|
|
15
|
-
--_bu-bg-selected: var(--theme-button-selected-background-color, var(--theme-secondary-300));
|
|
16
|
-
--_bu-fc-active: var(--theme-button-hover-color, var(--theme-secondary-500)); // Note: hover color used here intentionally
|
|
17
19
|
--_bu-fc-hover: var(--theme-button-hover-color, var(--theme-secondary-500));
|
|
20
|
+
|
|
21
|
+
// BASE SELECTED MODIFIER
|
|
22
|
+
--_bu-bg-selected: var(--theme-button-selected-background-color, var(--theme-secondary-300));
|
|
18
23
|
--_bu-fc-selected: var(--theme-button-selected-color, var(--theme-secondary-600));
|
|
19
|
-
|
|
24
|
+
|
|
25
|
+
// FILLED VARIANT
|
|
20
26
|
--_bu-filled-bc: transparent;
|
|
21
|
-
--_bu-filled-bc-active: transparent;
|
|
22
|
-
--_bu-filled-bc-selected: transparent;
|
|
23
27
|
--_bu-filled-bg: var(--theme-button-primary-background-color, var(--theme-secondary-400));
|
|
24
|
-
--_bu-filled-bg-active: var(--theme-button-primary-active-background-color, var(--theme-secondary-600));
|
|
25
|
-
--_bu-filled-bg-hover: var(--theme-button-primary-hover-background-color, var(--theme-secondary-500));
|
|
26
|
-
--_bu-filled-bg-selected: var(--theme-button-primary-selected-background-color, var(--theme-secondary-500));
|
|
27
28
|
--_bu-filled-fc: var(--theme-button-primary-color, var(--white));
|
|
29
|
+
// Filled + Selected
|
|
30
|
+
--_bu-filled-bc-selected: transparent;
|
|
31
|
+
--_bu-filled-bg-selected: var(--theme-button-primary-selected-background-color, var(--theme-secondary-500));
|
|
32
|
+
--_bu-filled-fc-selected: var(--theme-button-primary-selected-color, var(--white));
|
|
33
|
+
// Filled + Active
|
|
34
|
+
--_bu-filled-bc-active: var(--_bu-filled-bc);
|
|
35
|
+
--_bu-filled-bg-active: var(--theme-button-primary-active-background-color, var(--theme-secondary-600));
|
|
28
36
|
--_bu-filled-fc-active: var(--theme-button-primary-hover-color, var(--white));
|
|
37
|
+
// Filled + Hover
|
|
38
|
+
--_bu-filled-bc-hover: var(--_bu-filled-bc);
|
|
39
|
+
--_bu-filled-bg-hover: var(--theme-button-primary-hover-background-color, var(--theme-secondary-500));
|
|
29
40
|
--_bu-filled-fc-hover: var(--theme-button-primary-hover-color, var(--white));
|
|
30
|
-
|
|
31
|
-
//
|
|
41
|
+
|
|
42
|
+
// OUTLINED VARIANT
|
|
32
43
|
--_bu-outlined-bc: var(--theme-button-outlined-border-color, var(--theme-secondary-400));
|
|
33
44
|
--_bu-outlined-bg: var(--theme-button-outlined-background-color);
|
|
45
|
+
--_bg-outlined-fc: var(--theme-button-outlined-color, var(--theme-secondary-400));
|
|
46
|
+
// Outlined + Selected
|
|
34
47
|
--_bu-outlined-bc-selected: var(--theme-button-outlined-selected-border-color, var(--theme-secondary-400));
|
|
35
48
|
--_bu-outlined-bg-selected: var(--theme-button-selected-background-color, var(--theme-secondary-300));
|
|
36
49
|
--_bu-outlined-fc-selected: var(--theme-button-selected-color, var(--theme-secondary-600));
|
|
50
|
+
|
|
37
51
|
// CHILD COMPONENT CUSTOM PROPERTIES
|
|
38
52
|
--_bu-badge-o: 0.5;
|
|
39
53
|
--_bu-dropdown-bw: var(--su-static4);
|
|
@@ -81,9 +95,9 @@
|
|
|
81
95
|
}
|
|
82
96
|
|
|
83
97
|
&.is-selected,
|
|
84
|
-
|
|
98
|
+
&--radio:checked + & {
|
|
85
99
|
background-color: var(--_bu-bg-selected);
|
|
86
|
-
border-color: var(--_bu-bc-selected);
|
|
100
|
+
border-color: var(--_bu-bc-selected, transparent);
|
|
87
101
|
color: var(--_bu-fc-selected);
|
|
88
102
|
|
|
89
103
|
.s-btn--number {
|
|
@@ -139,7 +153,6 @@
|
|
|
139
153
|
&&__link {
|
|
140
154
|
--_bu-baw: 0;
|
|
141
155
|
--_bu-br: 0;
|
|
142
|
-
--_bu-focus-ring: none;
|
|
143
156
|
--_bu-p: 0;
|
|
144
157
|
|
|
145
158
|
&,
|
|
@@ -171,7 +184,6 @@
|
|
|
171
184
|
--_bu-bg: none;
|
|
172
185
|
--_bu-br: 0;
|
|
173
186
|
--_bu-fc: unset;
|
|
174
|
-
--_bu-focus-ring: none;
|
|
175
187
|
--_bu-p: 0;
|
|
176
188
|
|
|
177
189
|
cursor: default;
|
|
@@ -241,7 +253,6 @@
|
|
|
241
253
|
--_bu-fc-active: var(--_bu-fc);
|
|
242
254
|
--_bu-fc-hover: var(--red-500);
|
|
243
255
|
--_bu-fc-selected: var(--red-600);
|
|
244
|
-
--_bu-focus-ring: 0 0 0 var(--su-static4) var(--focus-ring-error);
|
|
245
256
|
--_bu-filled-bc: transparent;
|
|
246
257
|
--_bu-filled-bc-selected: var(--_bu-filled-bc);
|
|
247
258
|
--_bu-filled-bg: var(--red-400);
|
|
@@ -261,6 +272,7 @@
|
|
|
261
272
|
}
|
|
262
273
|
|
|
263
274
|
&&__muted {
|
|
275
|
+
--_bu-bc-hover: var(--black-300);
|
|
264
276
|
--_bu-bg-active: var(--black-150);
|
|
265
277
|
--_bu-bg-hover: var(--black-100);
|
|
266
278
|
--_bu-bg-selected: var(--black-200);
|
|
@@ -268,7 +280,6 @@
|
|
|
268
280
|
--_bu-fc-active: var(--_bu-fc);
|
|
269
281
|
--_bu-fc-hover: var(--black-500);
|
|
270
282
|
--_bu-fc-selected: var(--black-500);
|
|
271
|
-
--_bu-focus-ring: 0 0 0 var(--su-static4) var(--focus-ring-muted);
|
|
272
283
|
// The filled modifier on the muted button is deprecated and is to be
|
|
273
284
|
// removed in Stacks Classic v2
|
|
274
285
|
--_bu-filled-bc: transparent;
|
|
@@ -285,7 +296,11 @@
|
|
|
285
296
|
--_bu-outlined-bc-selected: var(--black-300);
|
|
286
297
|
--_bu-outlined-bg-selected: var(--_bu-bg-selected);
|
|
287
298
|
--_bu-outlined-fc-selected: var(--_bu-fc-selected);
|
|
299
|
+
--_bu-number-fc-filled: var(--white);
|
|
288
300
|
--_bu-number-fc-selected: var(--white);
|
|
301
|
+
--_bu-bg-focus: var(--black-400);
|
|
302
|
+
--_bu-fc-focus: var(--white);
|
|
303
|
+
--_bu-number-fc-focus: var(--black-500);
|
|
289
304
|
|
|
290
305
|
.highcontrast-mode({
|
|
291
306
|
--_bu-bg-hover: var(--black-225);
|
|
@@ -350,7 +365,6 @@
|
|
|
350
365
|
--_bu-fc: var(--fc-medium);
|
|
351
366
|
--_bu-fc-active: var(--fc-dark);
|
|
352
367
|
--_bu-fc-hover: var(--black-600);
|
|
353
|
-
--_bu-focus-ring: 0 0 0 var(--su-static4) var(--focus-ring-muted);
|
|
354
368
|
}
|
|
355
369
|
|
|
356
370
|
&&__github {
|
|
@@ -360,7 +374,6 @@
|
|
|
360
374
|
--_bu-fc: var(--white);
|
|
361
375
|
--_bu-fc-active: var(--white);
|
|
362
376
|
--_bu-fc-hover: var(--white);
|
|
363
|
-
--_bu-focus-ring: 0 0 0 var(--su-static4) var(--focus-ring-muted);
|
|
364
377
|
--_bu-hc-bc: transparent;
|
|
365
378
|
}
|
|
366
379
|
|
|
@@ -393,12 +406,35 @@
|
|
|
393
406
|
}
|
|
394
407
|
|
|
395
408
|
// INTERACTION
|
|
396
|
-
&:not(
|
|
397
|
-
|
|
409
|
+
&:not(&__link):not(&__unset):focus-visible,
|
|
410
|
+
&--radio:focus-visible + & {
|
|
411
|
+
border-color: var(--theme-secondary-400) !important;
|
|
412
|
+
.focus-styles(true, true);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
&:not(&__link):not(&__unset)&:not(&__facebook):not(&__github):not(&__google):not(.is-selected):focus-visible,
|
|
416
|
+
&--radio:focus-visible + & {
|
|
417
|
+
&,
|
|
418
|
+
&.s-btn__filled {
|
|
419
|
+
&:not(:hover) .s-btn--number {
|
|
420
|
+
color: var(--_bu-number-fc-focus, var(--_bu-number-fc-filled));
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
background-color: var(--_bu-bg-focus, var(--_bu-filled-bg));
|
|
424
|
+
color: var(--_bu-fc-focus, var(--_bu-filled-fc));
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
&:not(&__link):not(&__unset)&:not(&__facebook):not(&__github):not(&__google):not(.is-selected) {
|
|
429
|
+
&:hover {
|
|
398
430
|
&.s-btn__filled {
|
|
399
431
|
background-color: var(--_bu-filled-bg-hover);
|
|
432
|
+
border-color: var(--_bu-filled-bc-hover);
|
|
400
433
|
color: var(--_bu-filled-fc-hover);
|
|
401
434
|
}
|
|
435
|
+
&:not(.s-btn__outlined) {
|
|
436
|
+
border-color: var(--_bu-bc-hover);
|
|
437
|
+
}
|
|
402
438
|
|
|
403
439
|
background-color: var(--_bu-bg-hover);
|
|
404
440
|
color: var(--_bu-fc-hover);
|
|
@@ -407,28 +443,27 @@
|
|
|
407
443
|
&:active {
|
|
408
444
|
&.s-btn__filled {
|
|
409
445
|
background-color: var(--_bu-filled-bg-active);
|
|
446
|
+
border-color: var(--_bu-filled-bc-active);
|
|
410
447
|
color: var(--_bu-filled-fc-active);
|
|
411
448
|
}
|
|
412
449
|
|
|
413
450
|
background-color: var(--_bu-bg-active);
|
|
451
|
+
border-color: var(--_bu-bc-active);
|
|
414
452
|
color: var(--_bu-fc-active);
|
|
415
453
|
}
|
|
454
|
+
}
|
|
416
455
|
|
|
417
|
-
&:visited:not(:hover):not(:focus) {
|
|
418
|
-
&.s-btn__filled {
|
|
419
|
-
background-color: var(--_bu-filled-bg);
|
|
420
|
-
color: var(--_bu-filled-fc);
|
|
421
|
-
}
|
|
422
456
|
|
|
423
|
-
|
|
424
|
-
|
|
457
|
+
&:visited:not(:hover):not(:focus) {
|
|
458
|
+
&.s-btn__filled {
|
|
459
|
+
background-color: var(--_bu-filled-bg);
|
|
460
|
+
border-color: var(--_bu-filled-bc);
|
|
461
|
+
color: var(--_bu-filled-fc);
|
|
425
462
|
}
|
|
426
|
-
}
|
|
427
463
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
outline: none;
|
|
464
|
+
background-color: var(--_bu-bg);
|
|
465
|
+
border-color: var(--_bu-bc);
|
|
466
|
+
color: var(--_bu-fc);
|
|
432
467
|
}
|
|
433
468
|
|
|
434
469
|
background-color: var(--_bu-bg, inherit); // [1]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html } from "@open-wc/testing";
|
|
2
|
-
import {
|
|
2
|
+
import { runVisualTests } from "../../test/visual-test-utils";
|
|
3
3
|
import "../../index";
|
|
4
4
|
|
|
5
5
|
const getChild = (child?: string): string => {
|
|
@@ -16,8 +16,7 @@ const getChild = (child?: string): string => {
|
|
|
16
16
|
|
|
17
17
|
describe("button", () => {
|
|
18
18
|
// TODO test disabled states, interaction pseudo-classes
|
|
19
|
-
|
|
20
|
-
type: "visual",
|
|
19
|
+
runVisualTests({
|
|
21
20
|
baseClass: "s-btn",
|
|
22
21
|
variants: ["danger", "muted"],
|
|
23
22
|
modifiers: {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runA11yTests } from "../../test/a11y-test-utils";
|
|
2
2
|
import "../../index";
|
|
3
3
|
|
|
4
4
|
describe("card", () => {
|
|
5
|
-
|
|
6
|
-
type: "a11y",
|
|
5
|
+
runA11yTests({
|
|
7
6
|
baseClass: "s-card",
|
|
8
7
|
variants: ["muted"],
|
|
9
8
|
children: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html } from "@open-wc/testing";
|
|
2
|
-
import {
|
|
2
|
+
import { runVisualTests } from "../../test/visual-test-utils";
|
|
3
3
|
import "../../index";
|
|
4
4
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -25,8 +25,7 @@ const baseChild = `
|
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
27
|
describe("card", () => {
|
|
28
|
-
|
|
29
|
-
type: "visual",
|
|
28
|
+
runVisualTests({
|
|
30
29
|
baseClass: "s-card",
|
|
31
30
|
variants: ["muted"],
|
|
32
31
|
children: {
|
|
@@ -36,8 +35,7 @@ describe("card", () => {
|
|
|
36
35
|
});
|
|
37
36
|
|
|
38
37
|
// Stacked
|
|
39
|
-
|
|
40
|
-
type: "visual",
|
|
38
|
+
runVisualTests({
|
|
41
39
|
baseClass: "s-card",
|
|
42
40
|
variants: ["stacked"], // dummy variant for testid differentiation
|
|
43
41
|
children: {
|
|
@@ -48,7 +46,6 @@ describe("card", () => {
|
|
|
48
46
|
},
|
|
49
47
|
template: cardTemplate,
|
|
50
48
|
options: {
|
|
51
|
-
...defaultOptions,
|
|
52
49
|
includeNullVariant: false,
|
|
53
50
|
},
|
|
54
51
|
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runA11yTests } from "../../test/a11y-test-utils";
|
|
2
2
|
import "../../index";
|
|
3
3
|
|
|
4
4
|
["checkbox", "radio"].forEach((type) => {
|
|
5
5
|
describe("s-check-control", () => {
|
|
6
6
|
// TODO include indeterminate
|
|
7
7
|
["checked", "unchecked"].forEach((state) => {
|
|
8
|
-
|
|
9
|
-
type: "a11y",
|
|
8
|
+
runA11yTests({
|
|
10
9
|
baseClass: "s-check-control",
|
|
11
10
|
modifiers: {
|
|
12
11
|
global: ["has-warning", "has-error", "has-success"],
|
|
@@ -26,7 +25,6 @@ import "../../index";
|
|
|
26
25
|
`,
|
|
27
26
|
},
|
|
28
27
|
options: {
|
|
29
|
-
...defaultOptions,
|
|
30
28
|
testidSuffix: `${state}-${type}`,
|
|
31
29
|
},
|
|
32
30
|
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runVisualTests } from "../../test/visual-test-utils";
|
|
2
2
|
import "../../index";
|
|
3
3
|
|
|
4
4
|
["checkbox", "radio"].forEach((type) => {
|
|
5
5
|
describe("s-check-control", () => {
|
|
6
6
|
// TODO include indeterminate
|
|
7
7
|
["checked", "unchecked"].forEach((state) => {
|
|
8
|
-
|
|
9
|
-
type: "visual",
|
|
8
|
+
runVisualTests({
|
|
10
9
|
baseClass: "s-check-control",
|
|
11
10
|
modifiers: {
|
|
12
11
|
global: ["has-warning", "has-error", "has-success"],
|
|
@@ -29,7 +28,6 @@ import "../../index";
|
|
|
29
28
|
`,
|
|
30
29
|
},
|
|
31
30
|
options: {
|
|
32
|
-
...defaultOptions,
|
|
33
31
|
testidSuffix: `${state}-${type}`,
|
|
34
32
|
},
|
|
35
33
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runA11yTests } from "../../test/a11y-test-utils";
|
|
2
2
|
import "../../index";
|
|
3
3
|
|
|
4
4
|
type CheckGroup = "checkbox" | "radio";
|
|
@@ -14,8 +14,7 @@ checkTypes.forEach((type) => {
|
|
|
14
14
|
{ type, id: `test-${type}1`, state: "checked" },
|
|
15
15
|
{ type, id: `test-${type}2` },
|
|
16
16
|
];
|
|
17
|
-
|
|
18
|
-
type: "a11y",
|
|
17
|
+
runA11yTests({
|
|
19
18
|
tag: "fieldset",
|
|
20
19
|
baseClass: "s-check-group",
|
|
21
20
|
variants: ["horizontal"],
|
|
@@ -43,7 +42,6 @@ checkTypes.forEach((type) => {
|
|
|
43
42
|
`,
|
|
44
43
|
},
|
|
45
44
|
options: {
|
|
46
|
-
...defaultOptions,
|
|
47
45
|
testidSuffix: type,
|
|
48
46
|
},
|
|
49
47
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runVisualTests } from "../../test/visual-test-utils";
|
|
2
2
|
import "../../index";
|
|
3
3
|
|
|
4
4
|
type CheckGroup = "checkbox" | "radio";
|
|
@@ -16,8 +16,7 @@ const checkTypes: CheckGroup[] = ["checkbox", "radio"];
|
|
|
16
16
|
{ type, id: `test-${type}1`, state: "checked" },
|
|
17
17
|
{ type, id: `test-${type}2` },
|
|
18
18
|
];
|
|
19
|
-
|
|
20
|
-
type: "visual",
|
|
19
|
+
runVisualTests({
|
|
21
20
|
tag: "fieldset",
|
|
22
21
|
baseClass: "s-check-group",
|
|
23
22
|
attributes: {
|
|
@@ -48,7 +47,6 @@ const checkTypes: CheckGroup[] = ["checkbox", "radio"];
|
|
|
48
47
|
`,
|
|
49
48
|
},
|
|
50
49
|
options: {
|
|
51
|
-
...defaultOptions,
|
|
52
50
|
includeNullVariant: !isHorizontal,
|
|
53
51
|
testidSuffix: type,
|
|
54
52
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html } from "@open-wc/testing";
|
|
2
|
-
import {
|
|
2
|
+
import { runA11yTests } from "../../test/a11y-test-utils";
|
|
3
3
|
import "../../index";
|
|
4
4
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -13,8 +13,7 @@ const checkboxTemplate = ({ component, testid, id }: any) =>
|
|
|
13
13
|
describe(type, () => {
|
|
14
14
|
// TODO include indeterminate
|
|
15
15
|
["checked", "unchecked"].forEach((state) => {
|
|
16
|
-
|
|
17
|
-
type: "a11y",
|
|
16
|
+
runA11yTests({
|
|
18
17
|
tag: "input",
|
|
19
18
|
baseClass: `s-${type}`,
|
|
20
19
|
attributes: {
|
|
@@ -30,7 +29,6 @@ const checkboxTemplate = ({ component, testid, id }: any) =>
|
|
|
30
29
|
id: "test-id",
|
|
31
30
|
}),
|
|
32
31
|
options: {
|
|
33
|
-
...defaultOptions,
|
|
34
32
|
testidSuffix: state,
|
|
35
33
|
},
|
|
36
34
|
});
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
.s-radio {
|
|
3
3
|
--_ch-baw: var(--su-static1);
|
|
4
4
|
--_ch-bc: var(--bc-dark);
|
|
5
|
-
--_ch-bc-focus: var(--theme-secondary-400);
|
|
6
5
|
--_ch-bg: var(--white);
|
|
7
6
|
--_ch-bg-image: unset;
|
|
8
|
-
--_ch-bs-focus: 0 0 0 var(--su-static4) var(--focus-ring);
|
|
9
7
|
|
|
10
8
|
// CONTEXTUAL STYLES
|
|
11
9
|
fieldset[disabled] &,
|
|
@@ -30,7 +28,7 @@
|
|
|
30
28
|
|
|
31
29
|
// INTERACTION
|
|
32
30
|
&:focus {
|
|
33
|
-
|
|
31
|
+
.focus-styles();
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
background-color: var(--_ch-bg);
|
|
@@ -64,7 +62,6 @@
|
|
|
64
62
|
.highcontrast-dark-mode({
|
|
65
63
|
&:checked, &:indeterminate {
|
|
66
64
|
--_ch-bc: var(--blue-500) !important;
|
|
67
|
-
--_ch-bc-focus: var(--_ch-bc);
|
|
68
65
|
--_ch-bg: var(--blue-400);
|
|
69
66
|
}
|
|
70
67
|
});
|
|
@@ -73,10 +70,6 @@
|
|
|
73
70
|
&:checked, &:indeterminate {
|
|
74
71
|
--_ch-bc: var(--theme-secondary-400) !important;
|
|
75
72
|
--_ch-bg: var(--theme-secondary-400);
|
|
76
|
-
|
|
77
|
-
&:focus {
|
|
78
|
-
--_ch-bc-focus: var(--theme-secondary-400);
|
|
79
|
-
}
|
|
80
73
|
}
|
|
81
74
|
|
|
82
75
|
&:checked {
|
|
@@ -87,11 +80,6 @@
|
|
|
87
80
|
--_ch-bg-image: url("data:image/svg+xml;,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4.5 h7 v2 h-7 z' fill='@{ch-bg-image-fill}'/%3E%3C/svg%3E");
|
|
88
81
|
}
|
|
89
82
|
|
|
90
|
-
// INTERACTION
|
|
91
|
-
&:focus {
|
|
92
|
-
border-color: var(--_ch-bc-focus);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
83
|
background-image: var(--_ch-bg-image);
|
|
96
84
|
|
|
97
85
|
background-position: center center;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html } from "@open-wc/testing";
|
|
2
|
-
import {
|
|
2
|
+
import { runVisualTests } from "../../test/visual-test-utils";
|
|
3
3
|
import "../../index";
|
|
4
4
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -15,8 +15,7 @@ const checkboxTemplate = ({ component, testid }: any) =>
|
|
|
15
15
|
describe(type, () => {
|
|
16
16
|
// TODO include indeterminate
|
|
17
17
|
["checked", "unchecked"].forEach((state) => {
|
|
18
|
-
|
|
19
|
-
type: "visual",
|
|
18
|
+
runVisualTests({
|
|
20
19
|
tag: "input",
|
|
21
20
|
baseClass: `s-${type}`,
|
|
22
21
|
attributes: {
|
|
@@ -26,7 +25,6 @@ const checkboxTemplate = ({ component, testid }: any) =>
|
|
|
26
25
|
template: ({ component, testid }) =>
|
|
27
26
|
checkboxTemplate({ component, testid }),
|
|
28
27
|
options: {
|
|
29
|
-
...defaultOptions,
|
|
30
28
|
testidSuffix: state,
|
|
31
29
|
},
|
|
32
30
|
});
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runA11yTests } from "../../test/a11y-test-utils";
|
|
2
2
|
import highlightedFixtures from "./code-block.fixtures";
|
|
3
3
|
import "../../index";
|
|
4
4
|
|
|
5
5
|
describe("code block", () => {
|
|
6
6
|
Object.keys(highlightedFixtures).forEach((language) => {
|
|
7
|
-
|
|
8
|
-
type: "a11y",
|
|
7
|
+
runA11yTests({
|
|
9
8
|
tag: "pre",
|
|
10
9
|
baseClass: `s-code-block language-${language}`,
|
|
11
10
|
children: {
|
|
12
11
|
default: highlightedFixtures[language],
|
|
13
12
|
},
|
|
14
13
|
options: {
|
|
15
|
-
...defaultOptions,
|
|
16
14
|
includeNullModifier: false,
|
|
17
15
|
},
|
|
18
16
|
attributes: {
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runVisualTests } from "../../test/visual-test-utils";
|
|
2
2
|
import highlightedFixtures from "./code-block.fixtures";
|
|
3
3
|
import "../../index";
|
|
4
4
|
|
|
5
5
|
describe("code block", () => {
|
|
6
6
|
Object.keys(highlightedFixtures).forEach((language) => {
|
|
7
|
-
|
|
8
|
-
type: "visual",
|
|
7
|
+
runVisualTests({
|
|
9
8
|
tag: "pre",
|
|
10
9
|
baseClass: `s-code-block language-${language}`,
|
|
11
10
|
children: {
|
|
12
11
|
default: highlightedFixtures[language],
|
|
13
12
|
},
|
|
14
13
|
options: {
|
|
15
|
-
...defaultOptions,
|
|
16
14
|
includeNullModifier: false,
|
|
17
15
|
},
|
|
18
16
|
});
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { html } from "@open-wc/testing";
|
|
2
|
-
import {
|
|
2
|
+
import { runA11yTests } from "../../test/a11y-test-utils";
|
|
3
3
|
import "../../index";
|
|
4
4
|
|
|
5
5
|
// account for parent with `.is-disabled` class
|
|
6
6
|
[true, false].forEach((isDisabled) => {
|
|
7
7
|
describe("description", () => {
|
|
8
|
-
|
|
9
|
-
type: "a11y",
|
|
8
|
+
runA11yTests({
|
|
10
9
|
tag: "p",
|
|
11
10
|
baseClass: "s-description",
|
|
12
11
|
children: {
|
|
13
12
|
default: `Describes the site in the product, emails, integrations, and logs.`,
|
|
14
13
|
},
|
|
15
14
|
options: {
|
|
16
|
-
...defaultOptions,
|
|
17
15
|
testidSuffix: isDisabled ? "is-disabled" : "",
|
|
18
16
|
},
|
|
19
17
|
template: ({ component, testid }) => html`
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { html } from "@open-wc/testing";
|
|
2
|
-
import {
|
|
2
|
+
import { runVisualTests } from "../../test/visual-test-utils";
|
|
3
3
|
import "../../index";
|
|
4
4
|
|
|
5
5
|
// account for parent with `.is-disabled` class
|
|
6
6
|
[true, false].forEach((isDisabled) => {
|
|
7
7
|
describe("description", () => {
|
|
8
|
-
|
|
9
|
-
type: "visual",
|
|
8
|
+
runVisualTests({
|
|
10
9
|
tag: "p",
|
|
11
10
|
baseClass: "s-description",
|
|
12
11
|
children: {
|
|
13
12
|
default: `Describes the site in the product, emails, integrations, and logs.`,
|
|
14
13
|
},
|
|
15
14
|
options: {
|
|
16
|
-
...defaultOptions,
|
|
17
15
|
testidSuffix: isDisabled ? "is-disabled" : "",
|
|
18
16
|
},
|
|
19
17
|
template: ({ component, testid }) => html`
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { html } from "@open-wc/testing";
|
|
2
2
|
import { SpotEmptyXL } from "@stackoverflow/stacks-icons";
|
|
3
|
-
import {
|
|
3
|
+
import { runA11yTests } from "../../test/a11y-test-utils";
|
|
4
4
|
import "../../index";
|
|
5
5
|
|
|
6
6
|
describe("empty-state", () => {
|
|
7
|
-
|
|
8
|
-
type: "a11y",
|
|
7
|
+
runA11yTests({
|
|
9
8
|
baseClass: "s-empty-state",
|
|
10
9
|
children: {
|
|
11
10
|
default: `${SpotEmptyXL}<p class="mt24"><strong>Hello!</strong> This is a wonderful empty state component.</p>`,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { html } from "@open-wc/testing";
|
|
2
2
|
import { SpotEmptyXL } from "@stackoverflow/stacks-icons";
|
|
3
|
-
import {
|
|
3
|
+
import { runVisualTests } from "../../test/visual-test-utils";
|
|
4
4
|
import "../../index";
|
|
5
5
|
|
|
6
6
|
describe("empty-state", () => {
|
|
7
|
-
|
|
8
|
-
type: "visual",
|
|
7
|
+
runVisualTests({
|
|
9
8
|
baseClass: "s-empty-state",
|
|
10
9
|
children: {
|
|
11
10
|
default: `${SpotEmptyXL}<p class="mt24"><strong>Hello!</strong> This is a wonderful empty state component.</p>`,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { html } from "@open-wc/testing";
|
|
2
|
-
import {
|
|
2
|
+
import { runA11yTests } from "../../test/a11y-test-utils";
|
|
3
3
|
import "../../index";
|
|
4
4
|
|
|
5
5
|
describe("expandable", () => {
|
|
6
|
-
|
|
7
|
-
type: "a11y",
|
|
6
|
+
runA11yTests({
|
|
8
7
|
baseClass: "s-expandable",
|
|
9
8
|
modifiers: {
|
|
10
9
|
global: ["is-expanded"],
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { html } from "@open-wc/testing";
|
|
2
|
-
import {
|
|
2
|
+
import { runVisualTests } from "../../test/visual-test-utils";
|
|
3
3
|
import "../../index";
|
|
4
4
|
|
|
5
5
|
describe("expandable", () => {
|
|
6
|
-
|
|
7
|
-
type: "visual",
|
|
6
|
+
runVisualTests({
|
|
8
7
|
baseClass: "s-expandable",
|
|
9
8
|
modifiers: {
|
|
10
9
|
global: ["is-expanded"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html } from "@open-wc/testing";
|
|
2
|
-
import {
|
|
2
|
+
import { runA11yTests } from "../../test/a11y-test-utils";
|
|
3
3
|
import "../../index";
|
|
4
4
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -8,8 +8,7 @@ const template = ({ component, testid }: any) => html`
|
|
|
8
8
|
`;
|
|
9
9
|
|
|
10
10
|
describe("input-fill", () => {
|
|
11
|
-
|
|
12
|
-
type: "a11y",
|
|
11
|
+
runA11yTests({
|
|
13
12
|
baseClass: `s-input-fill`,
|
|
14
13
|
modifiers: {
|
|
15
14
|
global: ["order-first", "order-last"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html } from "@open-wc/testing";
|
|
2
|
-
import {
|
|
2
|
+
import { runVisualTests } from "../../test/visual-test-utils";
|
|
3
3
|
import "../../index";
|
|
4
4
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -8,8 +8,7 @@ const template = ({ component, testid }: any) => html`
|
|
|
8
8
|
`;
|
|
9
9
|
|
|
10
10
|
describe("input-fill", () => {
|
|
11
|
-
|
|
12
|
-
type: "visual",
|
|
11
|
+
runVisualTests({
|
|
13
12
|
baseClass: `s-input-fill`,
|
|
14
13
|
modifiers: {
|
|
15
14
|
global: ["order-first", "order-last"],
|