@stackoverflow/stacks 2.0.4 → 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 +25 -17
- package/dist/css/stacks.min.css +1 -1
- 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 -4
- package/lib/components/modal/modal.visual.test.ts +42 -0
- package/package.json +2 -2
|
@@ -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 {
|
|
@@ -60,10 +68,6 @@
|
|
|
60
68
|
}
|
|
61
69
|
|
|
62
70
|
& &--dialog {
|
|
63
|
-
.dark-mode({
|
|
64
|
-
--_mo-dialog-bg: var(--black-225);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
71
|
padding: var(--_mo-dialog-pt) var(--su24) var(--su24);
|
|
68
72
|
|
|
69
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
|
+
});
|
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"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@highlightjs/cdn-assets": "^11.9.0",
|
|
48
48
|
"@open-wc/testing": "^3.2.0",
|
|
49
49
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
50
|
-
"@rollup/plugin-replace": "^5.0.
|
|
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",
|