@stackoverflow/stacks 2.4.0 → 2.5.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.
Files changed (103) hide show
  1. package/dist/css/stacks.css +12 -58
  2. package/dist/css/stacks.min.css +1 -1
  3. package/lib/components/tag/tag.less +16 -68
  4. package/package.json +10 -9
  5. package/lib/atomic/__snapshots__/color-new.less.test.ts.snap +0 -3015
  6. package/lib/atomic/__snapshots__/color.less.test.ts.snap +0 -3132
  7. package/lib/atomic/__snapshots__/misc.less.test.ts.snap +0 -893
  8. package/lib/atomic/__snapshots__/spacing.less.test.ts.snap +0 -1928
  9. package/lib/atomic/color.less.test.ts +0 -12
  10. package/lib/atomic/misc.less.test.ts +0 -12
  11. package/lib/atomic/spacing.less.test.ts +0 -12
  12. package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +0 -13
  13. package/lib/components/activity-indicator/activity-indicator.visual.test.ts +0 -22
  14. package/lib/components/anchor/anchor.a11y.test.ts +0 -35
  15. package/lib/components/anchor/anchor.visual.test.ts +0 -47
  16. package/lib/components/avatar/avatar.a11y.test.ts +0 -35
  17. package/lib/components/avatar/avatar.visual.test.ts +0 -50
  18. package/lib/components/award-bling/award-bling.a11y.test.ts +0 -15
  19. package/lib/components/award-bling/award-bling.visual.test.ts +0 -24
  20. package/lib/components/badge/badge.a11y.test.ts +0 -143
  21. package/lib/components/badge/badge.visual.test.ts +0 -165
  22. package/lib/components/banner/banner.a11y.test.ts +0 -36
  23. package/lib/components/banner/banner.test.ts +0 -73
  24. package/lib/components/banner/banner.visual.test.ts +0 -36
  25. package/lib/components/block-link/block-link.a11y.test.ts +0 -57
  26. package/lib/components/block-link/block-link.visual.test.ts +0 -57
  27. package/lib/components/breadcrumbs/breadcrumbs.a11y.test.ts +0 -36
  28. package/lib/components/breadcrumbs/breadcrumbs.visual.test.ts +0 -36
  29. package/lib/components/button/button.a11y.test.ts +0 -21
  30. package/lib/components/button/button.test.setup.ts +0 -36
  31. package/lib/components/button/button.visual.test.ts +0 -18
  32. package/lib/components/button-group/button-group.a11y.test.ts +0 -12
  33. package/lib/components/button-group/button-group.test.setup.ts +0 -77
  34. package/lib/components/button-group/button-group.visual.test.ts +0 -7
  35. package/lib/components/card/card.a11y.test.ts +0 -12
  36. package/lib/components/card/card.visual.test.ts +0 -52
  37. package/lib/components/check-control/check-control.a11y.test.ts +0 -33
  38. package/lib/components/check-control/check-control.visual.test.ts +0 -36
  39. package/lib/components/check-group/check-group.a11y.test.ts +0 -49
  40. package/lib/components/check-group/check-group.visual.test.ts +0 -56
  41. package/lib/components/checkbox_radio/checkbox_radio.a11y.test.ts +0 -37
  42. package/lib/components/checkbox_radio/checkbox_radio.visual.test.ts +0 -33
  43. package/lib/components/code-block/code-block.a11y.test.ts +0 -27
  44. package/lib/components/code-block/code-block.visual.test.ts +0 -18
  45. package/lib/components/description/description.a11y.test.ts +0 -28
  46. package/lib/components/description/description.visual.test.ts +0 -28
  47. package/lib/components/empty-state/empty-state.a11y.test.ts +0 -16
  48. package/lib/components/empty-state/empty-state.visual.test.ts +0 -16
  49. package/lib/components/expandable/expandable.a11y.test.ts +0 -26
  50. package/lib/components/expandable/expandable.test.ts +0 -51
  51. package/lib/components/expandable/expandable.visual.test.ts +0 -26
  52. package/lib/components/input-fill/input-fill.a11y.test.ts +0 -21
  53. package/lib/components/input-fill/input-fill.visual.test.ts +0 -21
  54. package/lib/components/input-icon/input-icon.a11y.test.ts +0 -81
  55. package/lib/components/input-icon/input-icon.visual.test.ts +0 -92
  56. package/lib/components/input-message/input-message.a11y.test.ts +0 -57
  57. package/lib/components/input-message/input-message.visual.test.ts +0 -58
  58. package/lib/components/input_textarea/input_textarea.a11y.test.ts +0 -109
  59. package/lib/components/input_textarea/input_textarea.visual.test.ts +0 -95
  60. package/lib/components/label/label.a11y.test.ts +0 -47
  61. package/lib/components/label/label.visual.test.ts +0 -65
  62. package/lib/components/link/link.a11y.test.ts +0 -27
  63. package/lib/components/link/link.visual.test.ts +0 -31
  64. package/lib/components/link-preview/link-preview.a11y.test.ts +0 -47
  65. package/lib/components/link-preview/link-preview.visual.test.ts +0 -52
  66. package/lib/components/menu/menu.a11y.test.ts +0 -39
  67. package/lib/components/menu/menu.visual.test.ts +0 -39
  68. package/lib/components/modal/modal.a11y.test.ts +0 -41
  69. package/lib/components/modal/modal.test.ts +0 -155
  70. package/lib/components/modal/modal.visual.test.ts +0 -41
  71. package/lib/components/navigation/navigation.a11y.test.ts +0 -81
  72. package/lib/components/navigation/navigation.visual.test.ts +0 -98
  73. package/lib/components/notice/notice.a11y.test.ts +0 -16
  74. package/lib/components/notice/notice.visual.test.ts +0 -25
  75. package/lib/components/page-title/page-title.a11y.test.ts +0 -28
  76. package/lib/components/page-title/page-title.visual.test.ts +0 -58
  77. package/lib/components/pagination/pagination.a11y.test.ts +0 -21
  78. package/lib/components/pagination/pagination.visual.test.ts +0 -25
  79. package/lib/components/popover/tooltip.test.ts +0 -62
  80. package/lib/components/post-summary/post-summary.a11y.test.ts +0 -25
  81. package/lib/components/post-summary/post-summary.test.setup.ts +0 -435
  82. package/lib/components/post-summary/post-summary.visual.test.ts +0 -17
  83. package/lib/components/progress-bar/progress-bar.a11y.test.ts +0 -189
  84. package/lib/components/progress-bar/progress-bar.visual.test.ts +0 -188
  85. package/lib/components/select/select.a11y.test.ts +0 -72
  86. package/lib/components/select/select.visual.test.ts +0 -72
  87. package/lib/components/spinner/spinner.a11y.test.ts +0 -14
  88. package/lib/components/spinner/spinner.visual.test.ts +0 -40
  89. package/lib/components/table/table.a11y.test.ts +0 -112
  90. package/lib/components/table/table.test.ts +0 -366
  91. package/lib/components/table/table.visual.test.ts +0 -104
  92. package/lib/components/tag/tag.a11y.test.ts +0 -28
  93. package/lib/components/tag/tag.visual.test.ts +0 -43
  94. package/lib/components/toast/toast.a11y.test.ts +0 -29
  95. package/lib/components/toast/toast.test.ts +0 -64
  96. package/lib/components/toast/toast.visual.test.ts +0 -30
  97. package/lib/components/toggle-switch/toggle-switch.a11y.test.ts +0 -66
  98. package/lib/components/toggle-switch/toggle-switch.visual.test.ts +0 -70
  99. package/lib/components/topbar/topbar.visual.test.ts +0 -217
  100. package/lib/exports/__snapshots__/color-mixins.less.test.ts.snap +0 -558
  101. package/lib/exports/__snapshots__/color.less.test.ts.snap +0 -819
  102. package/lib/exports/color-mixins.less.test.ts +0 -150
  103. package/lib/exports/color.less.test.ts +0 -12
@@ -1,16 +1,12 @@
1
1
  .s-tag {
2
- // Border color (bg color used as fallback
2
+ // Base
3
3
  --_ta-bc: var(--theme-tag-border-color, var(--_ta-bg));
4
+ --_ta-bg: var(--theme-tag-background-color, var(--black-150));
5
+ --_ta-fc: var(--theme-tag-color, var(--black-500));
6
+ // Hover
4
7
  --_ta-bc-hover: var(--theme-tag-hover-border-color, var(--_ta-bg-hover));
5
- --_ta-bc-selected: var(--theme-tag-selected-border-color, var(--_ta-bg-selected));
6
- // Background color
7
- --_ta-bg: var(--theme-tag-background-color, var(--theme-secondary-100));
8
- --_ta-bg-hover: var(--theme-tag-hover-background-color, var(--theme-secondary-200));
9
- --_ta-bg-selected: var(--theme-tag-selected-background-color, var(--theme-secondary-300));
10
- // Color
11
- --_ta-fc: var(--theme-tag-color, var(--theme-secondary-500));
12
- --_ta-fc-hover: var(--theme-tag-hover-color, var(--theme-secondary-600));
13
- --_ta-fc-selected: var(--theme-tag-selected-color, var(--theme-secondary-600));
8
+ --_ta-bg-hover: var(--theme-tag-hover-background-color, var(--black-200));
9
+ --_ta-fc-hover: var(--theme-tag-hover-color, var(--black-600));
14
10
  // Other
15
11
  --_ta-br: var(--br-sm);
16
12
  --_ta-fs: var(--fs-caption);
@@ -22,27 +18,11 @@
22
18
 
23
19
  // CONTEXTUAL STYLES
24
20
  .highcontrast-mode({
25
- --_ta-bc: currentColor;
26
- --_ta-bg-selected: var(--theme-secondary-400);
27
-
28
- text-decoration: none;
29
- });
30
-
31
- // STATES
32
- &.is-selected {
33
- &,
34
- a&,
35
- a&:active,
36
- a&:hover {
37
- .highcontrast-mode({
38
- --_ta-fc-selected: var(--white);
39
- });
40
-
41
- background-color: var(--_ta-bg-selected);
42
- border-color: var(--_ta-bc-selected);
43
- color: var(--_ta-fc-selected);
21
+ &:not(&__moderator):not(&__required) {
22
+ --_ta-bc: var(--theme-tag-border-color, var(--black-300));
23
+ --_ta-bc-hover: var(--theme-tag-hover-border-color, var(--black-300));
44
24
  }
45
- }
25
+ });
46
26
 
47
27
  // MODIFIERS
48
28
  // Sizes
@@ -102,49 +82,21 @@
102
82
  --_ta-before-icon: url("data:image/svg+xml;,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3.52 7.38 1.58 9.26A12.38 12.38 0 0 1 0 7s2.63-5.14 7.05-5.14c.66 0 1.28.12 1.86.32L7.44 3.6a3.48 3.48 0 0 0-3.92 3.78ZM5.3 9.99c.5.28 1.1.44 1.71.44 1.94 0 3.5-1.53 3.5-3.43 0-.62-.17-1.21-.47-1.72L8.7 6.6a1.73 1.73 0 0 1-2.08 2.07L5.29 10Zm6.23-6.19A12.7 12.7 0 0 1 14 7s-2.63 5.14-6.95 5.14A6.1 6.1 0 0 1 4 11.3L2.27 13l-1.4-1.36L11.9 1l1.23 1.2-1.6 1.6Z'/%3E%3C/svg%3E");
103
83
  }
104
84
 
105
- // moderator overrides other muted and required, required overrides muted
85
+ // moderator overrides other required
106
86
  &&__moderator {
107
- .highcontrast-mode({
108
- --_ta-bg-selected: var(--orange-500);
109
- });
110
-
111
87
  --_ta-bc: var(--orange-300);
112
88
  --_ta-bg: var(--orange-100);
113
- --_ta-fc: var(--orange-600);
89
+ --_ta-fc: var(--orange-500);
114
90
  --_ta-bc-hover: var(--orange-300);
115
91
  --_ta-bg-hover: var(--orange-200);
116
92
  --_ta-fc-hover: var(--orange-600);
117
- --_ta-bc-selected: var(--orange-400);
118
- --_ta-bg-selected: var(--orange-300);
119
- --_ta-fc-selected: var(--orange-600); // Currently APCA Lc 49 😔
120
- }
121
-
122
- &&__muted:not(&__moderator):not(&__required) {
123
- --_ta-bg: var(--black-150);
124
- --_ta-fc: var(--black-400);
125
- --_ta-bg-hover: var(--black-200);
126
- --_ta-fc-hover: var(--black-500);
127
- --_ta-bg-selected: var(--black-225);
128
- --_ta-fc-selected: var(--black-600);
129
-
130
- .highcontrast-mode({ --_ta-bc: currentColor; }); // Specificity has bit us, so we need this override
131
93
  }
132
94
 
133
95
  &&__required:not(&__moderator) {
134
- // TODO *eventually* remove the custom theme overrides once we can reconcile Meta theming needs
135
- // Border color
136
- --_ta-bc: var(--theme-tag-required-border-color, var(--_ta-bg));
137
- --_ta-bc-hover: var(--theme-tag-required-hover-border-color, var(--_ta-bg-hover));
138
- --_ta-bc-selected: var(--theme-tag-required-selected-border-color, var(--_ta-bg-selected));
139
- // Background color
140
- --_ta-bg: var(--theme-tag-required-background-color, var(--theme-secondary-500));
141
- --_ta-bg-hover: var(--theme-tag-required-hover-background-color, var(--theme-secondary-400));
142
- --_ta-bg-selected: var(--theme-tag-required-selected-background-color, var(--theme-secondary-600));
143
- // Color
144
- --_ta-fc: var(--theme-tag-required-color, var(--white));
145
- --_ta-fc-hover: var(--theme-tag-required-hover-color, var(--white));
146
- --_ta-fc-selected: var(--theme-tag-required-selected-color, var(--white));
96
+ --_ta-bc: var(--black-400);
97
+ --_ta-bc-hover: var(--black-600);
147
98
  }
99
+
148
100
  &__watched, // TODO: remove all single `&` watched styles once core no longer requires them
149
101
  &&__watched {
150
102
  --_ta-before-icon: url("data:image/svg+xml;,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M7.05 1C2.63 1 0 6.5 0 6.5S2.63 12 7.05 12C11.38 12 14 6.5 14 6.5S11.37 1 7.05 1ZM7 10.17A3.59 3.59 0 0 1 3.5 6.5 3.6 3.6 0 0 1 7 2.83c1.94 0 3.5 1.65 3.5 3.67A3.57 3.57 0 0 1 7 10.17Zm0-1.84c.97 0 1.75-.81 1.75-1.83S7.97 4.67 7 4.67s-1.75.81-1.75 1.83S6.03 8.33 7 8.33Z'/%3E%3C/svg%3E");
@@ -197,13 +149,9 @@
197
149
  }
198
150
 
199
151
  // INTERACTION
200
- a&:not(.is-selected) {
152
+ a& {
201
153
  &:hover,
202
154
  &:active {
203
- .highcontrast-mode({
204
- border-color: currentColor;
205
- });
206
-
207
155
  background-color: var(--_ta-bg-hover);
208
156
  border-color: var(--_ta-bc-hover);
209
157
  color: var(--_ta-fc-hover);
package/package.json CHANGED
@@ -5,10 +5,11 @@
5
5
  "type": "git",
6
6
  "url": "https://github.com/StackExchange/Stacks.git"
7
7
  },
8
- "version": "2.4.0",
8
+ "version": "2.5.0",
9
9
  "files": [
10
10
  "dist",
11
- "lib"
11
+ "lib",
12
+ "!lib/**/*.test.*"
12
13
  ],
13
14
  "main": "./dist/js/stacks.js",
14
15
  "types": "./dist/index.d.ts",
@@ -47,15 +48,15 @@
47
48
  "@open-wc/testing": "^4.0.0",
48
49
  "@rollup/plugin-commonjs": "^25.0.7",
49
50
  "@rollup/plugin-replace": "^5.0.5",
50
- "@stackoverflow/stacks-editor": "^0.10.5",
51
+ "@stackoverflow/stacks-editor": "^0.10.6",
51
52
  "@stackoverflow/stacks-icons": "^6.0.2",
52
- "@testing-library/dom": "^9.3.4",
53
+ "@testing-library/dom": "^10.0.0",
53
54
  "@testing-library/user-event": "^14.5.2",
54
55
  "@types/cssbeautify": "^0.3.5",
55
56
  "@types/less": "^3.0.6",
56
57
  "@types/mocha": "^10.0.6",
57
- "@typescript-eslint/eslint-plugin": "^7.6.0",
58
- "@typescript-eslint/parser": "^7.6.0",
58
+ "@typescript-eslint/eslint-plugin": "^7.7.1",
59
+ "@typescript-eslint/parser": "^7.7.1",
59
60
  "@web/dev-server-esbuild": "^1.0.2",
60
61
  "@web/dev-server-rollup": "^0.6.1",
61
62
  "@web/test-runner": "^0.18.1",
@@ -64,7 +65,7 @@
64
65
  "apca-check": "^0.1.0",
65
66
  "colorjs.io": "^0.5.0",
66
67
  "concurrently": "^8.2.2",
67
- "css-loader": "^6.10.0",
68
+ "css-loader": "^7.1.1",
68
69
  "cssbeautify": "^0.3.1",
69
70
  "cssnano": "^6.1.2",
70
71
  "docsearch.js": "^2.6.3",
@@ -77,7 +78,7 @@
77
78
  "less-loader": "^12.2.0",
78
79
  "list.js": "^2.3.1",
79
80
  "markdown-it": "^14.1.0",
80
- "mini-css-extract-plugin": "^2.8.1",
81
+ "mini-css-extract-plugin": "^2.9.0",
81
82
  "postcss-less": "^6.0.0",
82
83
  "postcss-loader": "^8.1.1",
83
84
  "prettier": "^3.2.5",
@@ -88,7 +89,7 @@
88
89
  "terser-webpack-plugin": "^5.3.10",
89
90
  "ts-loader": "^9.5.1",
90
91
  "typescript": "^5.4.5",
91
- "vitest": "^1.5.0",
92
+ "vitest": "^1.5.2",
92
93
  "webpack": "^5.91.0",
93
94
  "webpack-cli": "^5.1.4",
94
95
  "webpack-merge": "^5.10.0"