@stackoverflow/stacks 2.4.0 → 2.5.1
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 +24 -65
- package/dist/css/stacks.min.css +1 -1
- package/lib/components/tag/tag.less +21 -68
- package/lib/exports/color-sets.less +4 -4
- package/package.json +10 -9
- package/lib/atomic/__snapshots__/color-new.less.test.ts.snap +0 -3015
- package/lib/atomic/__snapshots__/color.less.test.ts.snap +0 -3132
- package/lib/atomic/__snapshots__/misc.less.test.ts.snap +0 -893
- package/lib/atomic/__snapshots__/spacing.less.test.ts.snap +0 -1928
- package/lib/atomic/color.less.test.ts +0 -12
- package/lib/atomic/misc.less.test.ts +0 -12
- package/lib/atomic/spacing.less.test.ts +0 -12
- package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +0 -13
- package/lib/components/activity-indicator/activity-indicator.visual.test.ts +0 -22
- package/lib/components/anchor/anchor.a11y.test.ts +0 -35
- package/lib/components/anchor/anchor.visual.test.ts +0 -47
- package/lib/components/avatar/avatar.a11y.test.ts +0 -35
- package/lib/components/avatar/avatar.visual.test.ts +0 -50
- package/lib/components/award-bling/award-bling.a11y.test.ts +0 -15
- package/lib/components/award-bling/award-bling.visual.test.ts +0 -24
- package/lib/components/badge/badge.a11y.test.ts +0 -143
- package/lib/components/badge/badge.visual.test.ts +0 -165
- package/lib/components/banner/banner.a11y.test.ts +0 -36
- package/lib/components/banner/banner.test.ts +0 -73
- package/lib/components/banner/banner.visual.test.ts +0 -36
- package/lib/components/block-link/block-link.a11y.test.ts +0 -57
- package/lib/components/block-link/block-link.visual.test.ts +0 -57
- package/lib/components/breadcrumbs/breadcrumbs.a11y.test.ts +0 -36
- package/lib/components/breadcrumbs/breadcrumbs.visual.test.ts +0 -36
- package/lib/components/button/button.a11y.test.ts +0 -21
- package/lib/components/button/button.test.setup.ts +0 -36
- package/lib/components/button/button.visual.test.ts +0 -18
- package/lib/components/button-group/button-group.a11y.test.ts +0 -12
- package/lib/components/button-group/button-group.test.setup.ts +0 -77
- package/lib/components/button-group/button-group.visual.test.ts +0 -7
- package/lib/components/card/card.a11y.test.ts +0 -12
- package/lib/components/card/card.visual.test.ts +0 -52
- package/lib/components/check-control/check-control.a11y.test.ts +0 -33
- package/lib/components/check-control/check-control.visual.test.ts +0 -36
- package/lib/components/check-group/check-group.a11y.test.ts +0 -49
- package/lib/components/check-group/check-group.visual.test.ts +0 -56
- package/lib/components/checkbox_radio/checkbox_radio.a11y.test.ts +0 -37
- package/lib/components/checkbox_radio/checkbox_radio.visual.test.ts +0 -33
- package/lib/components/code-block/code-block.a11y.test.ts +0 -27
- package/lib/components/code-block/code-block.visual.test.ts +0 -18
- package/lib/components/description/description.a11y.test.ts +0 -28
- package/lib/components/description/description.visual.test.ts +0 -28
- package/lib/components/empty-state/empty-state.a11y.test.ts +0 -16
- package/lib/components/empty-state/empty-state.visual.test.ts +0 -16
- package/lib/components/expandable/expandable.a11y.test.ts +0 -26
- package/lib/components/expandable/expandable.test.ts +0 -51
- package/lib/components/expandable/expandable.visual.test.ts +0 -26
- package/lib/components/input-fill/input-fill.a11y.test.ts +0 -21
- package/lib/components/input-fill/input-fill.visual.test.ts +0 -21
- package/lib/components/input-icon/input-icon.a11y.test.ts +0 -81
- package/lib/components/input-icon/input-icon.visual.test.ts +0 -92
- package/lib/components/input-message/input-message.a11y.test.ts +0 -57
- package/lib/components/input-message/input-message.visual.test.ts +0 -58
- package/lib/components/input_textarea/input_textarea.a11y.test.ts +0 -109
- package/lib/components/input_textarea/input_textarea.visual.test.ts +0 -95
- package/lib/components/label/label.a11y.test.ts +0 -47
- package/lib/components/label/label.visual.test.ts +0 -65
- package/lib/components/link/link.a11y.test.ts +0 -27
- package/lib/components/link/link.visual.test.ts +0 -31
- package/lib/components/link-preview/link-preview.a11y.test.ts +0 -47
- package/lib/components/link-preview/link-preview.visual.test.ts +0 -52
- package/lib/components/menu/menu.a11y.test.ts +0 -39
- package/lib/components/menu/menu.visual.test.ts +0 -39
- package/lib/components/modal/modal.a11y.test.ts +0 -41
- package/lib/components/modal/modal.test.ts +0 -155
- package/lib/components/modal/modal.visual.test.ts +0 -41
- package/lib/components/navigation/navigation.a11y.test.ts +0 -81
- package/lib/components/navigation/navigation.visual.test.ts +0 -98
- package/lib/components/notice/notice.a11y.test.ts +0 -16
- package/lib/components/notice/notice.visual.test.ts +0 -25
- package/lib/components/page-title/page-title.a11y.test.ts +0 -28
- package/lib/components/page-title/page-title.visual.test.ts +0 -58
- package/lib/components/pagination/pagination.a11y.test.ts +0 -21
- package/lib/components/pagination/pagination.visual.test.ts +0 -25
- package/lib/components/popover/tooltip.test.ts +0 -62
- package/lib/components/post-summary/post-summary.a11y.test.ts +0 -25
- package/lib/components/post-summary/post-summary.test.setup.ts +0 -435
- package/lib/components/post-summary/post-summary.visual.test.ts +0 -17
- package/lib/components/progress-bar/progress-bar.a11y.test.ts +0 -189
- package/lib/components/progress-bar/progress-bar.visual.test.ts +0 -188
- package/lib/components/select/select.a11y.test.ts +0 -72
- package/lib/components/select/select.visual.test.ts +0 -72
- package/lib/components/spinner/spinner.a11y.test.ts +0 -14
- package/lib/components/spinner/spinner.visual.test.ts +0 -40
- package/lib/components/table/table.a11y.test.ts +0 -112
- package/lib/components/table/table.test.ts +0 -366
- package/lib/components/table/table.visual.test.ts +0 -104
- package/lib/components/tag/tag.a11y.test.ts +0 -28
- package/lib/components/tag/tag.visual.test.ts +0 -43
- package/lib/components/toast/toast.a11y.test.ts +0 -29
- package/lib/components/toast/toast.test.ts +0 -64
- package/lib/components/toast/toast.visual.test.ts +0 -30
- package/lib/components/toggle-switch/toggle-switch.a11y.test.ts +0 -66
- package/lib/components/toggle-switch/toggle-switch.visual.test.ts +0 -70
- package/lib/components/topbar/topbar.visual.test.ts +0 -217
- package/lib/exports/__snapshots__/color-mixins.less.test.ts.snap +0 -558
- package/lib/exports/__snapshots__/color.less.test.ts.snap +0 -819
- package/lib/exports/color-mixins.less.test.ts +0 -150
- package/lib/exports/color.less.test.ts +0 -12
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { html } from "@open-wc/testing";
|
|
2
|
-
import {
|
|
3
|
-
IconAchievementsSm,
|
|
4
|
-
IconCheckmarkSm,
|
|
5
|
-
} from "@stackoverflow/stacks-icons/icons";
|
|
6
|
-
import { runVisualTests } from "../../test/visual-test-utils";
|
|
7
|
-
import "../../index";
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
const template = ({ component, testid }: any) => html`
|
|
11
|
-
<div class="d-flex ai-center jc-center p8 ws2" data-testid="${testid}">
|
|
12
|
-
${component}
|
|
13
|
-
</div>
|
|
14
|
-
`;
|
|
15
|
-
|
|
16
|
-
const steppedItems = [
|
|
17
|
-
{
|
|
18
|
-
complete: true,
|
|
19
|
-
label: "Select plan",
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
complete: true,
|
|
23
|
-
label: "Team name",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
active: true,
|
|
27
|
-
label: "Payment",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
label: "Create account",
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
const getChildren = (type: string) => {
|
|
35
|
-
switch (type) {
|
|
36
|
-
case "badge":
|
|
37
|
-
return `<div class="s-progress--label" id="example-label">
|
|
38
|
-
<div class="s-badge--label">Electorate</div>
|
|
39
|
-
</div>
|
|
40
|
-
<div class="s-progress--bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="75" aria-labelledby="example-label" style="width: 75%;"></div>`;
|
|
41
|
-
case "circular":
|
|
42
|
-
return `<svg class="s-progress-bar" role="progressbar" viewbox="0 0 32 32" aria-valuemin="0" aria-valuemax="100" aria-valuenow="75">
|
|
43
|
-
<circle cx="16" cy="16" r="14"></circle>
|
|
44
|
-
<circle cx="16" cy="16" r="14"></circle>
|
|
45
|
-
</svg>`;
|
|
46
|
-
case "privilege":
|
|
47
|
-
return `
|
|
48
|
-
<div class="s-progress--label" id="progress-label">
|
|
49
|
-
${IconAchievementsSm}
|
|
50
|
-
Access Review Queues
|
|
51
|
-
</div>
|
|
52
|
-
<div class="s-progress--bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="75" aria-labelledby="progress-label" style="width: 75%;"></div>
|
|
53
|
-
`;
|
|
54
|
-
case "segmented":
|
|
55
|
-
return `
|
|
56
|
-
<div class="s-progress--bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="75" aria-label="…" style="width: 75%;"></div>
|
|
57
|
-
<ol class="s-progress--segments">
|
|
58
|
-
<li></li><li></li><li></li>
|
|
59
|
-
</ol>
|
|
60
|
-
`;
|
|
61
|
-
case "stepped":
|
|
62
|
-
return steppedItems
|
|
63
|
-
.map((step, i) => {
|
|
64
|
-
return `
|
|
65
|
-
<div
|
|
66
|
-
class="
|
|
67
|
-
s-progress--step
|
|
68
|
-
${step.active ? "is-active" : ""}
|
|
69
|
-
${step.complete ? "is-complete" : ""}
|
|
70
|
-
"
|
|
71
|
-
>
|
|
72
|
-
<a href="#" class="s-progress--stop">
|
|
73
|
-
${step.complete ? IconCheckmarkSm : ""}
|
|
74
|
-
<span class="v-visible-sr">${step.label} ${
|
|
75
|
-
step.complete ? "complete" : "incomplete"
|
|
76
|
-
}</span>
|
|
77
|
-
</a>
|
|
78
|
-
${
|
|
79
|
-
i > 0
|
|
80
|
-
? '<div class="s-progress--bar s-progress--bar__left"></div>'
|
|
81
|
-
: ""
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
${
|
|
85
|
-
i < steppedItems.length - 1
|
|
86
|
-
? '<div class="s-progress--bar s-progress--bar__right"></div>'
|
|
87
|
-
: ""
|
|
88
|
-
}
|
|
89
|
-
<a class="s-progress--label">${step.label}</a>
|
|
90
|
-
</div>
|
|
91
|
-
`;
|
|
92
|
-
})
|
|
93
|
-
.join("");
|
|
94
|
-
default:
|
|
95
|
-
return `<div class="s-progress--bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="75" aria-label="progress" style="width: 75%"></div>`;
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
describe("progress-bar", () => {
|
|
99
|
-
// Base
|
|
100
|
-
runVisualTests({
|
|
101
|
-
baseClass: "s-progress",
|
|
102
|
-
variants: ["brand", "info"],
|
|
103
|
-
children: {
|
|
104
|
-
default: getChildren(""),
|
|
105
|
-
},
|
|
106
|
-
template,
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// Badge
|
|
110
|
-
runVisualTests({
|
|
111
|
-
baseClass: "s-progress",
|
|
112
|
-
variants: ["badge"],
|
|
113
|
-
modifiers: {
|
|
114
|
-
primary: ["gold", "silver", "bronze"],
|
|
115
|
-
},
|
|
116
|
-
children: {
|
|
117
|
-
default: getChildren("badge"),
|
|
118
|
-
},
|
|
119
|
-
template,
|
|
120
|
-
options: {
|
|
121
|
-
includeNullVariant: false,
|
|
122
|
-
includeNullModifier: false,
|
|
123
|
-
},
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
// Circular
|
|
127
|
-
runVisualTests({
|
|
128
|
-
baseClass: "s-progress",
|
|
129
|
-
variants: ["circular"],
|
|
130
|
-
modifiers: {
|
|
131
|
-
global: ["fc-green-400", "fc-theme-primary"],
|
|
132
|
-
},
|
|
133
|
-
children: {
|
|
134
|
-
default: getChildren("circular"),
|
|
135
|
-
},
|
|
136
|
-
template,
|
|
137
|
-
attributes: {
|
|
138
|
-
style: "--s-progress-value: .75",
|
|
139
|
-
},
|
|
140
|
-
options: {
|
|
141
|
-
includeNullVariant: false,
|
|
142
|
-
includeNullModifier: false,
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
// Privilege
|
|
147
|
-
runVisualTests({
|
|
148
|
-
baseClass: "s-progress",
|
|
149
|
-
variants: ["privilege"],
|
|
150
|
-
children: {
|
|
151
|
-
default: getChildren("privilege"),
|
|
152
|
-
},
|
|
153
|
-
template,
|
|
154
|
-
options: {
|
|
155
|
-
includeNullVariant: false,
|
|
156
|
-
},
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
// Segmented
|
|
160
|
-
runVisualTests({
|
|
161
|
-
baseClass: "s-progress",
|
|
162
|
-
variants: ["segmented"],
|
|
163
|
-
children: {
|
|
164
|
-
default: getChildren("segmented"),
|
|
165
|
-
},
|
|
166
|
-
template,
|
|
167
|
-
options: {
|
|
168
|
-
includeNullVariant: false,
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
// Stepped
|
|
173
|
-
runVisualTests({
|
|
174
|
-
baseClass: "s-progress",
|
|
175
|
-
variants: ["stepped"],
|
|
176
|
-
children: {
|
|
177
|
-
default: getChildren("stepped"),
|
|
178
|
-
},
|
|
179
|
-
template: ({ component, testid }) => html`
|
|
180
|
-
<div class="d-block p8 ws5" data-testid="${testid}">
|
|
181
|
-
${component}
|
|
182
|
-
</div>
|
|
183
|
-
`,
|
|
184
|
-
options: {
|
|
185
|
-
includeNullVariant: false,
|
|
186
|
-
},
|
|
187
|
-
});
|
|
188
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { html } from "@open-wc/testing";
|
|
2
|
-
import { runA11yTests } from "../../test/a11y-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 `
|
|
14
|
-
<label for="select-menu">Transportation method</label>
|
|
15
|
-
<select id="select-menu" ${attr}>
|
|
16
|
-
<option value="" selected>Please select one…</option>
|
|
17
|
-
<option value="walk">Walk</option>
|
|
18
|
-
<option value="bike">Bicycle</option>
|
|
19
|
-
<option value="car">Automobile</option>
|
|
20
|
-
<option value="rail">Train</option>
|
|
21
|
-
<option value="fly">Plane</option>
|
|
22
|
-
</select>`;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
describe("select", () => {
|
|
26
|
-
// default, sizes
|
|
27
|
-
runA11yTests({
|
|
28
|
-
baseClass: "s-select",
|
|
29
|
-
modifiers: {
|
|
30
|
-
primary: ["sm", "md", "lg", "xl"],
|
|
31
|
-
},
|
|
32
|
-
children: {
|
|
33
|
-
default: child(),
|
|
34
|
-
},
|
|
35
|
-
template,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// modifier classes
|
|
39
|
-
[
|
|
40
|
-
{
|
|
41
|
-
class: "is-disabled",
|
|
42
|
-
attr: 'disabled=""',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
class: "is-readonly",
|
|
46
|
-
attr: 'readonly=""',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
class: "has-success",
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
class: "has-error",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
class: "has-warning",
|
|
56
|
-
},
|
|
57
|
-
].forEach((state) => {
|
|
58
|
-
runA11yTests({
|
|
59
|
-
baseClass: `s-select state-${state.class}`,
|
|
60
|
-
children: {
|
|
61
|
-
default: child(state.attr),
|
|
62
|
-
},
|
|
63
|
-
template: ({ component, testid }) =>
|
|
64
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
65
|
-
template({ component, testid, className: state.class }),
|
|
66
|
-
options: {
|
|
67
|
-
includeNullModifier: false,
|
|
68
|
-
},
|
|
69
|
-
skippedTestids: [/readonly/], // Skipping readonly since it doesn't need to meet APCA contrast minimums
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { runA11yTests } from "../../test/a11y-test-utils";
|
|
2
|
-
import "../../index";
|
|
3
|
-
|
|
4
|
-
describe("spinner", () => {
|
|
5
|
-
runA11yTests({
|
|
6
|
-
baseClass: "s-spinner",
|
|
7
|
-
modifiers: {
|
|
8
|
-
primary: ["xs", "sm", "md", "lg"],
|
|
9
|
-
},
|
|
10
|
-
children: {
|
|
11
|
-
default: `<div class="v-visible-sr">Loading…</div>`,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
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 }: any) => html`
|
|
7
|
-
<div class="d-inline-block p8" data-testid="${testid}">${component}</div>
|
|
8
|
-
`;
|
|
9
|
-
describe("spinner", () => {
|
|
10
|
-
// default, sizes
|
|
11
|
-
runVisualTests({
|
|
12
|
-
baseClass: "s-spinner",
|
|
13
|
-
modifiers: {
|
|
14
|
-
primary: ["xs", "sm", "md", "lg"],
|
|
15
|
-
},
|
|
16
|
-
children: {
|
|
17
|
-
default: `<div class="v-visible-sr">Loading…</div>`,
|
|
18
|
-
},
|
|
19
|
-
template,
|
|
20
|
-
});
|
|
21
|
-
// applied font color
|
|
22
|
-
runVisualTests({
|
|
23
|
-
baseClass: "s-spinner",
|
|
24
|
-
modifiers: {
|
|
25
|
-
global: ["fc-theme-primary"],
|
|
26
|
-
},
|
|
27
|
-
children: {
|
|
28
|
-
default: `<div class="v-visible-sr">Loading…</div>`,
|
|
29
|
-
},
|
|
30
|
-
template,
|
|
31
|
-
});
|
|
32
|
-
// .is-loading
|
|
33
|
-
runVisualTests({
|
|
34
|
-
baseClass: "is-loading",
|
|
35
|
-
children: {
|
|
36
|
-
default: `Loading…`,
|
|
37
|
-
},
|
|
38
|
-
template,
|
|
39
|
-
});
|
|
40
|
-
});
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { html } from "@open-wc/testing";
|
|
2
|
-
import { runA11yTests } from "../../test/a11y-test-utils";
|
|
3
|
-
import "../../index";
|
|
4
|
-
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
-
const template = ({ component, testid }: any) => html`
|
|
7
|
-
<div class="s-table-container p8" data-testid="${testid}">${component}</div>
|
|
8
|
-
`;
|
|
9
|
-
|
|
10
|
-
const rows = [
|
|
11
|
-
{
|
|
12
|
-
displayName: "Sponge",
|
|
13
|
-
fullName: "Bobby Geometrislacks",
|
|
14
|
-
progress: 10,
|
|
15
|
-
active: true,
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
displayName: "Patty",
|
|
19
|
-
fullName: "Pat Supernova",
|
|
20
|
-
progress: 50,
|
|
21
|
-
active: true,
|
|
22
|
-
// }, {
|
|
23
|
-
// displayName: "Crustoph",
|
|
24
|
-
// fullName: "Eugene Harold K",
|
|
25
|
-
// progress: 75,
|
|
26
|
-
// active: false, // TODO reintroduce once disabled rows pass contrast requirements
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
displayName: "SCheeks",
|
|
30
|
-
fullName: "Sandra C.",
|
|
31
|
-
progress: 100,
|
|
32
|
-
active: true,
|
|
33
|
-
},
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
const children = {
|
|
37
|
-
default: `
|
|
38
|
-
<thead>
|
|
39
|
-
<tr>
|
|
40
|
-
<th scope="col" class="s-table--bulk">
|
|
41
|
-
<label class="v-visible-sr" for="check">bulk action</label>
|
|
42
|
-
<input type="checkbox" class="s-checkbox" id="check">
|
|
43
|
-
</th>
|
|
44
|
-
<th scope="col">Display Name</th>
|
|
45
|
-
<th scope="col">Full name</th>
|
|
46
|
-
<th scope="col" colspan="2">Progress</th>
|
|
47
|
-
<th scope="col"><span>class="v-visible-sr">Bar</span></th>
|
|
48
|
-
</tr>
|
|
49
|
-
</thead>
|
|
50
|
-
<tbody>
|
|
51
|
-
${rows
|
|
52
|
-
.map(
|
|
53
|
-
(row, i) => `
|
|
54
|
-
<tr class="${row.active ? "" : "is-disabled"}">
|
|
55
|
-
<th scope="row">
|
|
56
|
-
<label class="v-visible-sr" for="check-${i}">bulk</label>
|
|
57
|
-
<input type="checkbox" class="s-checkbox" id="check-${i}">
|
|
58
|
-
</th>
|
|
59
|
-
<td>${row.displayName}</td>
|
|
60
|
-
<td>${row.fullName}</td>
|
|
61
|
-
<td class="s-table--progress">${row.progress}</td>
|
|
62
|
-
<td class="s-table--progress-bar">
|
|
63
|
-
<div class="s-progress bg-white">
|
|
64
|
-
<div class="s-progress--bar bg-blue-400" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="${
|
|
65
|
-
row.progress
|
|
66
|
-
}" aria-label="progressbar" style="width: ${
|
|
67
|
-
row.progress
|
|
68
|
-
}%"></div>
|
|
69
|
-
</div>
|
|
70
|
-
</td>
|
|
71
|
-
<td><a class="s-link" href="#">Add</a></td>
|
|
72
|
-
</tr>
|
|
73
|
-
`
|
|
74
|
-
)
|
|
75
|
-
.join("")}
|
|
76
|
-
</tbody>
|
|
77
|
-
<tfoot class="s-table--totals">
|
|
78
|
-
<tr>
|
|
79
|
-
<td><span class="v-visible-sr">Empty</span></td>
|
|
80
|
-
<th scope="row" class="ta-left">Totals</th>
|
|
81
|
-
<td><span class="v-visible-sr">Empty</span></td>
|
|
82
|
-
<td colspan="2">160</td>
|
|
83
|
-
<td><span class="v-visible-sr">Empty</span></td>
|
|
84
|
-
</tr>
|
|
85
|
-
</tfoot>
|
|
86
|
-
`,
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
describe("table", () => {
|
|
90
|
-
// default, sizes
|
|
91
|
-
runA11yTests({
|
|
92
|
-
baseClass: "s-table",
|
|
93
|
-
variants: ["stripes"],
|
|
94
|
-
modifiers: {
|
|
95
|
-
primary: ["sm", "lg"],
|
|
96
|
-
secondary: ["b0", "bx", "bx-simple", "sortable"],
|
|
97
|
-
// global: ["ta-center", "ta-left", "ta-justify", "ta-right", "va-bottom", "va-middle", "va-top"], // Removing these modifiers *for now* since they create so many test images and would slow testing
|
|
98
|
-
},
|
|
99
|
-
tag: "table",
|
|
100
|
-
children,
|
|
101
|
-
template,
|
|
102
|
-
// TODO resolve HC contrast issues with `.s-table.s-table__sortable thead th` sortable
|
|
103
|
-
skippedTestids: [
|
|
104
|
-
"s-table-highcontrast-light-lg-sortable",
|
|
105
|
-
"s-table-highcontrast-light-sm-sortable",
|
|
106
|
-
"s-table-highcontrast-light-sortable",
|
|
107
|
-
"s-table-highcontrast-light-stripes-lg-sortable",
|
|
108
|
-
"s-table-highcontrast-light-stripes-sm-sortable",
|
|
109
|
-
"s-table-highcontrast-light-stripes-sortable",
|
|
110
|
-
],
|
|
111
|
-
});
|
|
112
|
-
});
|