@stackoverflow/stacks 2.0.0-rc.1 → 2.0.0-rc.11
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/README.md +5 -0
- package/dist/components/code-block/code-block.fixtures.d.ts +2 -0
- package/dist/css/stacks.css +816 -778
- package/dist/css/stacks.min.css +1 -1
- package/dist/js/stacks.js +265 -110
- package/dist/js/stacks.min.js +1 -1
- package/lib/atomic/__snapshots__/color.less.test.ts.snap +246 -0
- package/lib/atomic/typography.less +4 -0
- package/lib/base/body.less +2 -2
- package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +1 -1
- package/lib/components/activity-indicator/activity-indicator.less +17 -4
- package/lib/components/anchor/anchor.less +10 -6
- package/lib/components/anchor/anchor.visual.test.ts +0 -4
- package/lib/components/avatar/avatar.visual.test.ts +0 -3
- package/lib/components/badge/badge.a11y.test.ts +2 -2
- package/lib/components/badge/badge.less +31 -39
- package/lib/components/banner/banner.less +2 -2
- package/lib/components/block-link/block-link.less +5 -4
- package/lib/components/button/button.a11y.test.ts +1 -4
- package/lib/components/button/button.less +48 -78
- package/lib/components/button/button.visual.test.ts +1 -4
- package/lib/components/card/card.less +8 -0
- package/lib/components/code-block/code-block.a11y.test.ts +30 -0
- package/lib/components/code-block/code-block.fixtures.ts +88 -0
- package/lib/components/code-block/code-block.visual.test.ts +20 -0
- package/lib/components/description/description.a11y.test.ts +1 -0
- package/lib/components/description/description.less +1 -1
- package/lib/components/expandable/expandable.a11y.test.ts +27 -0
- package/lib/components/expandable/expandable.visual.test.ts +27 -0
- package/lib/components/input-icon/input-icon.less +1 -1
- package/lib/components/input-message/input-message.less +4 -3
- package/lib/components/input_textarea/input_textarea.a11y.test.ts +112 -0
- package/lib/components/input_textarea/input_textarea.less +1 -1
- package/lib/components/input_textarea/input_textarea.visual.test.ts +98 -0
- package/lib/components/label/label.less +4 -14
- package/lib/components/link/link.less +12 -12
- package/lib/components/link-preview/link-preview.a11y.test.ts +48 -0
- package/lib/components/link-preview/link-preview.less +16 -7
- package/lib/components/link-preview/link-preview.visual.test.ts +52 -0
- package/lib/components/modal/modal.less +1 -0
- package/lib/components/navigation/navigation.a11y.test.ts +78 -0
- package/lib/components/navigation/navigation.visual.test.ts +101 -0
- package/lib/components/notice/notice.a11y.test.ts +17 -0
- package/lib/components/notice/notice.less +45 -82
- package/lib/components/notice/notice.visual.test.ts +26 -0
- package/lib/components/page-title/page-title.a11y.test.ts +29 -0
- package/lib/components/page-title/page-title.less +1 -1
- package/lib/components/page-title/page-title.visual.test.ts +59 -0
- package/lib/components/pagination/pagination.a11y.test.ts +20 -0
- package/lib/components/pagination/pagination.less +2 -2
- package/lib/components/pagination/pagination.visual.test.ts +26 -0
- package/lib/components/post-summary/post-summary.less +16 -16
- package/lib/components/progress-bar/progress-bar.less +2 -2
- package/lib/components/prose/prose.less +2 -2
- package/lib/components/select/select.less +1 -1
- package/lib/components/sidebar-widget/sidebar-widget.less +3 -3
- package/lib/components/spinner/spinner.a11y.test.ts +15 -0
- package/lib/components/spinner/spinner.visual.test.ts +43 -0
- package/lib/components/tag/tag.a11y.test.ts +29 -0
- package/lib/components/tag/tag.less +29 -29
- package/lib/components/tag/tag.visual.test.ts +46 -0
- package/lib/components/toast/toast.a11y.test.ts +30 -0
- package/lib/components/toast/toast.visual.test.ts +10 -6
- package/lib/components/toggle-switch/toggle-switch.less +2 -5
- package/lib/components/topbar/topbar.less +60 -44
- package/lib/components/uploader/uploader.less +19 -13
- package/lib/components/user-card/user-card.less +3 -3
- package/lib/exports/__snapshots__/color-mixins.less.test.ts.snap +17 -10
- package/lib/exports/__snapshots__/color.less.test.ts.snap +197 -185
- package/lib/exports/color-mixins.less +1 -1
- package/lib/exports/color-sets.less +130 -81
- package/lib/exports/color.less +14 -6
- package/lib/exports/v1/__snapshots__/constants-colors.less.test.ts.snap +3 -3
- package/lib/exports/v1/constants-colors.less +2 -2
- package/lib/input-utils.less +1 -1
- package/lib/test/axe-apca/README.md +19 -0
- package/lib/test/axe-apca/src/axe-apca.test.ts +77 -1
- package/lib/test/axe-apca/src/axe-apca.ts +16 -8
- package/lib/test/test-utils.ts +8 -6
- package/package.json +14 -14
- package/lib/exports/theme.less +0 -85
package/lib/test/test-utils.ts
CHANGED
|
@@ -5,7 +5,11 @@ import type { TemplateResult } from "lit-html";
|
|
|
5
5
|
import axe from "axe-core";
|
|
6
6
|
import registerAxeAPCA from "./axe-apca";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const customConformanceThresholdFn = (fontSize: string): number | null => {
|
|
9
|
+
return parseFloat(fontSize) >= 32 ? 45 : 60;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
registerAxeAPCA("custom", customConformanceThresholdFn);
|
|
9
13
|
|
|
10
14
|
const colorThemes = ["dark", "light"];
|
|
11
15
|
const baseThemes = ["", "highcontrast"];
|
|
@@ -201,9 +205,7 @@ const buildTestElement = ({
|
|
|
201
205
|
<${unsafe.tag}
|
|
202
206
|
${unsafe.attributes}
|
|
203
207
|
data-testid="${testid}"
|
|
204
|
-
>
|
|
205
|
-
${unsafe.children}
|
|
206
|
-
</${unsafe.tag}>
|
|
208
|
+
>${unsafe.children}</${unsafe.tag}>
|
|
207
209
|
`;
|
|
208
210
|
};
|
|
209
211
|
|
|
@@ -325,10 +327,10 @@ const runComponentTest = ({
|
|
|
325
327
|
axe.configure({
|
|
326
328
|
rules: [
|
|
327
329
|
// for non-high contrast, we disable WCAG 2.1 AA (4.5:1)
|
|
328
|
-
// and use APCA
|
|
330
|
+
// and use a Stacks-specific APCA custom level instead
|
|
329
331
|
{ id: "color-contrast", enabled: false },
|
|
330
332
|
{
|
|
331
|
-
id: "color-contrast-apca-
|
|
333
|
+
id: "color-contrast-apca-custom",
|
|
332
334
|
enabled: !highcontrast,
|
|
333
335
|
},
|
|
334
336
|
// for high contrast, we check against WCAG 2.1 AAA (7:1)
|
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.0-rc.
|
|
8
|
+
"version": "2.0.0-rc.11",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
11
11
|
"lib"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@hotwired/stimulus": "^3.2.
|
|
42
|
+
"@hotwired/stimulus": "^3.2.2",
|
|
43
43
|
"@popperjs/core": "^2.11.8"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
@@ -50,43 +50,43 @@
|
|
|
50
50
|
"@rollup/plugin-replace": "^5.0.2",
|
|
51
51
|
"@stackoverflow/stacks-editor": "^0.8.8",
|
|
52
52
|
"@stackoverflow/stacks-icons": "^5.5.0",
|
|
53
|
-
"@testing-library/dom": "^9.3.
|
|
54
|
-
"@testing-library/user-event": "^14.
|
|
53
|
+
"@testing-library/dom": "^9.3.3",
|
|
54
|
+
"@testing-library/user-event": "^14.5.1",
|
|
55
55
|
"@types/cssbeautify": "^0.3.2",
|
|
56
56
|
"@types/less": "^3.0.3",
|
|
57
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
58
|
-
"@typescript-eslint/parser": "^6.
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
|
58
|
+
"@typescript-eslint/parser": "^6.7.2",
|
|
59
59
|
"@web/dev-server-esbuild": "^0.4.1",
|
|
60
60
|
"@web/dev-server-rollup": "^0.5.2",
|
|
61
|
-
"@web/test-runner": "^0.17.
|
|
61
|
+
"@web/test-runner": "^0.17.1",
|
|
62
62
|
"@web/test-runner-playwright": "^0.10.1",
|
|
63
63
|
"@web/test-runner-visual-regression": "^0.8.2",
|
|
64
64
|
"apca-w3": "^0.1.9",
|
|
65
|
-
"concurrently": "^8.2.
|
|
65
|
+
"concurrently": "^8.2.1",
|
|
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.
|
|
73
|
-
"eslint-config-prettier": "^
|
|
72
|
+
"eslint": "^8.49.0",
|
|
73
|
+
"eslint-config-prettier": "^9.0.0",
|
|
74
74
|
"eslint-plugin-no-unsanitized": "^4.0.2",
|
|
75
|
-
"jquery": "^3.7.
|
|
75
|
+
"jquery": "^3.7.1",
|
|
76
76
|
"less-loader": "^11.1.3",
|
|
77
77
|
"list.js": "^2.3.1",
|
|
78
78
|
"markdown-it": "^13.0.1",
|
|
79
79
|
"mini-css-extract-plugin": "^2.7.6",
|
|
80
80
|
"postcss-less": "^6.0.0",
|
|
81
81
|
"postcss-loader": "^7.3.3",
|
|
82
|
-
"prettier": "^3.0.
|
|
82
|
+
"prettier": "^3.0.3",
|
|
83
83
|
"rollup-plugin-postcss": "^4.0.2",
|
|
84
|
-
"stylelint": "^15.10.
|
|
84
|
+
"stylelint": "^15.10.3",
|
|
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.4.4",
|
|
89
|
-
"typescript": "^5.
|
|
89
|
+
"typescript": "^5.2.2",
|
|
90
90
|
"vitest": "^0.33.0",
|
|
91
91
|
"webpack": "^5.88.2",
|
|
92
92
|
"webpack-cli": "^5.1.4",
|
package/lib/exports/theme.less
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
.theme-variables() {
|
|
2
|
-
--theme-body-font-color: var(--black-600);
|
|
3
|
-
--theme-background-color: var(--white);
|
|
4
|
-
// Links
|
|
5
|
-
--theme-link-color: var(--theme-secondary-400);
|
|
6
|
-
--theme-link-color-hover: var(--theme-secondary-400); // TODO was 350, now same as base link color
|
|
7
|
-
--theme-link-color-visited: var(--theme-secondary-500);
|
|
8
|
-
|
|
9
|
-
// Button Default (Secondary)
|
|
10
|
-
--theme-button-color: var(--theme-secondary-400);
|
|
11
|
-
--theme-button-background-color: transparent;
|
|
12
|
-
--theme-button-hover-color: var(--theme-secondary-400); // TODO was 500, now same as base button color
|
|
13
|
-
--theme-button-hover-background-color: var(--theme-secondary-200);
|
|
14
|
-
--theme-button-active-background-color: var(--theme-secondary-300);
|
|
15
|
-
--theme-button-selected-color: var(--theme-secondary-600);
|
|
16
|
-
--theme-button-selected-background-color: var(--theme-secondary-300);
|
|
17
|
-
|
|
18
|
-
// Button Primary
|
|
19
|
-
--theme-button-primary-color: var(--white);
|
|
20
|
-
--theme-button-primary-background-color: var(--theme-secondary-400);
|
|
21
|
-
--theme-button-primary-hover-color: var(--white);
|
|
22
|
-
--theme-button-primary-hover-background-color: var(--theme-secondary-400); // TODO was 500, now same as primary button color
|
|
23
|
-
--theme-button-primary-active-background-color: var(--theme-secondary-500);
|
|
24
|
-
--theme-button-primary-selected-color: var(--white);
|
|
25
|
-
--theme-button-primary-selected-background-color: var(--theme-secondary-500);
|
|
26
|
-
--theme-button-primary-number-color: var(--theme-secondary-600);
|
|
27
|
-
|
|
28
|
-
// Button Filled
|
|
29
|
-
--theme-button-filled-color: var(--theme-secondary-500);
|
|
30
|
-
--theme-button-filled-background-color: var(--theme-secondary-200);
|
|
31
|
-
--theme-button-filled-border-color: var(--theme-secondary-400);
|
|
32
|
-
--theme-button-filled-hover-color: var(--theme-secondary-600);
|
|
33
|
-
--theme-button-filled-hover-background-color: var(--theme-secondary-300);
|
|
34
|
-
--theme-button-filled-active-background-color: var(--theme-secondary-300); // TODO was 150, now same as hover bg color
|
|
35
|
-
--theme-button-filled-active-border-color: var(--theme-secondary-400);
|
|
36
|
-
--theme-button-filled-selected-color: var(--theme-secondary-600);
|
|
37
|
-
--theme-button-filled-selected-background-color: var(--theme-secondary-400);
|
|
38
|
-
--theme-button-filled-selected-border-color: var(--theme-secondary-400); // TODO was 500, now same as selected bg color
|
|
39
|
-
|
|
40
|
-
// Button Outline
|
|
41
|
-
--theme-button-outlined-border-color: var(--theme-secondary-400);
|
|
42
|
-
--theme-button-outlined-selected-border-color: var(--theme-secondary-400); // TODO now same as unselected border-color above (above was 350)
|
|
43
|
-
|
|
44
|
-
// Tags
|
|
45
|
-
--theme-tag-color: var(--theme-secondary-600);
|
|
46
|
-
--theme-tag-background-color: var(--theme-secondary-200);
|
|
47
|
-
--theme-tag-border-color: transparent;
|
|
48
|
-
--theme-tag-hover-color: var(--theme-secondary-600); // TODO was 900, now same as base tag color
|
|
49
|
-
--theme-tag-hover-background-color: var(--theme-secondary-300);
|
|
50
|
-
--theme-tag-hover-border-color: transparent;
|
|
51
|
-
|
|
52
|
-
// Topbar
|
|
53
|
-
--theme-topbar-height: calc(var(--su-static48) + var(--su-static8)); // 56px
|
|
54
|
-
--theme-topbar-background-color: var(--white);
|
|
55
|
-
|
|
56
|
-
// Topbar Search input
|
|
57
|
-
--theme-topbar-search-color: var(--black-500);
|
|
58
|
-
--theme-topbar-search-background: var(--white);
|
|
59
|
-
--theme-topbar-search-placeholder: var(--black-400);
|
|
60
|
-
--theme-topbar-search-border: var(--black-300);
|
|
61
|
-
--theme-topbar-search-border-focus: var(--blue-400);
|
|
62
|
-
--theme-topbar-search-shadow-focus: 0 0 0 var(--su-static4) var(--focus-ring);
|
|
63
|
-
|
|
64
|
-
// Topbar Search switcher
|
|
65
|
-
--theme-topbar-select-color: var(--black-500);
|
|
66
|
-
--theme-topbar-select-background: var(--black-200);
|
|
67
|
-
|
|
68
|
-
// Topbar items
|
|
69
|
-
--theme-topbar-item-color: var(--black-500);
|
|
70
|
-
--theme-topbar-item-color-hover: var(--black-600);
|
|
71
|
-
--theme-topbar-item-background-hover: var(--black-200);
|
|
72
|
-
--theme-topbar-item-color-current: var(--black);
|
|
73
|
-
--theme-topbar-item-border-current: var(--theme-primary);
|
|
74
|
-
|
|
75
|
-
// Topbar themed border accent
|
|
76
|
-
--theme-topbar-accent-border: 3px solid var(--theme-primary);
|
|
77
|
-
--theme-topbar-bottom-border: 1px solid var(--black-225);
|
|
78
|
-
|
|
79
|
-
// Post summary
|
|
80
|
-
--theme-post-title-color: var(--theme-link-color);
|
|
81
|
-
--theme-post-title-color-hover: var(--theme-link-color-hover);
|
|
82
|
-
--theme-post-title-color-visited: var(--theme-link-color-visited);
|
|
83
|
-
--theme-post-title-font-family: var(--theme-body-font-family);
|
|
84
|
-
--theme-post-body-font-family: var(--theme-body-font-family);
|
|
85
|
-
}
|