@stackoverflow/stacks 2.5.3 → 2.5.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.
Files changed (101) hide show
  1. package/LICENSE.MD +9 -9
  2. package/README.md +180 -180
  3. package/dist/css/stacks.css +104 -122
  4. package/dist/css/stacks.min.css +1 -1
  5. package/lib/atomic/border.less +139 -139
  6. package/lib/atomic/color.less +36 -36
  7. package/lib/atomic/flex.less +426 -426
  8. package/lib/atomic/gap.less +44 -44
  9. package/lib/atomic/grid.less +139 -139
  10. package/lib/atomic/misc.less +374 -374
  11. package/lib/atomic/spacing.less +98 -98
  12. package/lib/atomic/typography.less +264 -264
  13. package/lib/atomic/width-height.less +194 -194
  14. package/lib/base/body.less +44 -44
  15. package/lib/base/configuration-static.less +61 -61
  16. package/lib/base/fieldset.less +5 -5
  17. package/lib/base/icon.less +11 -11
  18. package/lib/base/internal.less +220 -220
  19. package/lib/base/reset-meyer.less +64 -64
  20. package/lib/base/reset-normalize.less +449 -449
  21. package/lib/base/reset.less +20 -20
  22. package/lib/components/activity-indicator/activity-indicator.less +53 -53
  23. package/lib/components/anchor/anchor.less +78 -68
  24. package/lib/components/avatar/avatar.less +108 -108
  25. package/lib/components/award-bling/award-bling.less +31 -31
  26. package/lib/components/badge/badge.less +258 -258
  27. package/lib/components/banner/banner.less +44 -44
  28. package/lib/components/banner/banner.ts +149 -149
  29. package/lib/components/block-link/block-link.less +82 -82
  30. package/lib/components/breadcrumbs/breadcrumbs.less +41 -41
  31. package/lib/components/button/button.less +473 -473
  32. package/lib/components/button-group/button-group.less +82 -82
  33. package/lib/components/card/card.less +37 -37
  34. package/lib/components/check-control/check-control.less +17 -17
  35. package/lib/components/check-group/check-group.less +19 -19
  36. package/lib/components/checkbox_radio/checkbox_radio.less +159 -159
  37. package/lib/components/code-block/code-block.fixtures.ts +88 -88
  38. package/lib/components/code-block/code-block.less +116 -116
  39. package/lib/components/description/description.less +9 -9
  40. package/lib/components/empty-state/empty-state.less +16 -16
  41. package/lib/components/expandable/expandable.less +118 -118
  42. package/lib/components/expandable/expandable.ts +238 -238
  43. package/lib/components/input-fill/input-fill.less +35 -35
  44. package/lib/components/input-icon/input-icon.less +45 -45
  45. package/lib/components/input-message/input-message.less +49 -49
  46. package/lib/components/input_textarea/input_textarea.less +150 -150
  47. package/lib/components/label/label.less +110 -110
  48. package/lib/components/link/link.less +135 -120
  49. package/lib/components/link-preview/link-preview.less +148 -148
  50. package/lib/components/menu/menu.less +41 -41
  51. package/lib/components/modal/modal.less +118 -118
  52. package/lib/components/modal/modal.ts +383 -383
  53. package/lib/components/navigation/navigation.less +136 -136
  54. package/lib/components/navigation/navigation.ts +128 -128
  55. package/lib/components/notice/notice.less +195 -195
  56. package/lib/components/page-title/page-title.less +51 -51
  57. package/lib/components/pagination/pagination.less +65 -65
  58. package/lib/components/popover/popover.less +159 -157
  59. package/lib/components/popover/popover.ts +651 -651
  60. package/lib/components/popover/tooltip.ts +343 -343
  61. package/lib/components/post-summary/post-summary.less +457 -447
  62. package/lib/components/progress-bar/progress-bar.less +291 -291
  63. package/lib/components/prose/prose.less +452 -452
  64. package/lib/components/select/select.less +138 -138
  65. package/lib/components/sidebar-widget/sidebar-widget.less +257 -257
  66. package/lib/components/spinner/spinner.less +103 -103
  67. package/lib/components/table/table.less +307 -307
  68. package/lib/components/table/table.ts +296 -296
  69. package/lib/components/table-container/table-container.less +4 -4
  70. package/lib/components/tag/tag.less +186 -186
  71. package/lib/components/toast/toast.less +35 -35
  72. package/lib/components/toast/toast.ts +357 -357
  73. package/lib/components/toggle-switch/toggle-switch.less +104 -104
  74. package/lib/components/topbar/topbar.less +553 -553
  75. package/lib/components/uploader/uploader.less +205 -205
  76. package/lib/components/uploader/uploader.ts +207 -207
  77. package/lib/components/user-card/user-card.less +129 -129
  78. package/lib/controllers.ts +33 -33
  79. package/lib/exports/color-mixins.less +283 -283
  80. package/lib/exports/color-sets.less +711 -711
  81. package/lib/exports/color.less +65 -65
  82. package/lib/exports/constants-helpers.less +108 -108
  83. package/lib/exports/constants-type.less +155 -155
  84. package/lib/exports/exports.less +15 -15
  85. package/lib/exports/mixins.less +333 -333
  86. package/lib/exports/spacing-mixins.less +67 -67
  87. package/lib/index.ts +32 -32
  88. package/lib/input-utils.less +41 -41
  89. package/lib/stacks-dynamic.less +24 -24
  90. package/lib/stacks-static.less +93 -93
  91. package/lib/stacks.less +13 -13
  92. package/lib/stacks.ts +113 -113
  93. package/lib/test/a11y-test-utils.ts +94 -94
  94. package/lib/test/assertions.ts +36 -36
  95. package/lib/test/less-test-utils.ts +28 -28
  96. package/lib/test/open-wc-testing-patch.d.ts +26 -26
  97. package/lib/test/test-utils.ts +364 -364
  98. package/lib/test/visual-test-utils.ts +58 -58
  99. package/lib/tsconfig.build.json +4 -4
  100. package/lib/tsconfig.json +17 -17
  101. package/package.json +115 -115
@@ -1,58 +1,58 @@
1
- import { html, fixture } from "@open-wc/testing";
2
- import { visualDiff } from "@web/test-runner-visual-regression";
3
- import { screen } from "@testing-library/dom";
4
- import { generateTestVariations, type TestVariationArgs } from "./test-utils";
5
-
6
- type VisualTestArgs = TestVariationArgs;
7
-
8
- const scheduleVisualTest = ({
9
- element,
10
- testid,
11
- theme,
12
- }: {
13
- element: ReturnType<typeof html>;
14
- testid: string;
15
- theme: string[];
16
- }) => {
17
- it(`visual: ${testid} should not introduce visual regressions`, async () => {
18
- document.body.className = "";
19
-
20
- if (theme?.length) {
21
- const prefixedThemes = theme.map((t) => `theme-${t}`);
22
- document.body.classList.add(...prefixedThemes);
23
- }
24
-
25
- let retryAttempts = 3;
26
-
27
- do {
28
- await fixture(element);
29
- const el = screen.getByTestId(testid);
30
- try {
31
- await visualDiff(el, testid);
32
- return;
33
- } catch (error) {
34
- const e = error as Error;
35
- // if the error is not a visual diff failure, retry
36
- // this is to prevent flaky tests due to snapshot capturing
37
- if (
38
- retryAttempts > 0 &&
39
- !e.message.includes("Visual diff failed.")
40
- ) {
41
- retryAttempts--;
42
- continue;
43
- } else {
44
- throw e;
45
- }
46
- } finally {
47
- el.remove();
48
- }
49
- } while (retryAttempts > 0);
50
- });
51
- };
52
-
53
- const runVisualTests = (args: VisualTestArgs) => {
54
- const testVariations = generateTestVariations(args);
55
- testVariations.forEach(scheduleVisualTest);
56
- };
57
-
58
- export { runVisualTests };
1
+ import { html, fixture } from "@open-wc/testing";
2
+ import { visualDiff } from "@web/test-runner-visual-regression";
3
+ import { screen } from "@testing-library/dom";
4
+ import { generateTestVariations, type TestVariationArgs } from "./test-utils";
5
+
6
+ type VisualTestArgs = TestVariationArgs;
7
+
8
+ const scheduleVisualTest = ({
9
+ element,
10
+ testid,
11
+ theme,
12
+ }: {
13
+ element: ReturnType<typeof html>;
14
+ testid: string;
15
+ theme: string[];
16
+ }) => {
17
+ it(`visual: ${testid} should not introduce visual regressions`, async () => {
18
+ document.body.className = "";
19
+
20
+ if (theme?.length) {
21
+ const prefixedThemes = theme.map((t) => `theme-${t}`);
22
+ document.body.classList.add(...prefixedThemes);
23
+ }
24
+
25
+ let retryAttempts = 3;
26
+
27
+ do {
28
+ await fixture(element);
29
+ const el = screen.getByTestId(testid);
30
+ try {
31
+ await visualDiff(el, testid);
32
+ return;
33
+ } catch (error) {
34
+ const e = error as Error;
35
+ // if the error is not a visual diff failure, retry
36
+ // this is to prevent flaky tests due to snapshot capturing
37
+ if (
38
+ retryAttempts > 0 &&
39
+ !e.message.includes("Visual diff failed.")
40
+ ) {
41
+ retryAttempts--;
42
+ continue;
43
+ } else {
44
+ throw e;
45
+ }
46
+ } finally {
47
+ el.remove();
48
+ }
49
+ } while (retryAttempts > 0);
50
+ });
51
+ };
52
+
53
+ const runVisualTests = (args: VisualTestArgs) => {
54
+ const testVariations = generateTestVariations(args);
55
+ testVariations.forEach(scheduleVisualTest);
56
+ };
57
+
58
+ export { runVisualTests };
@@ -1,4 +1,4 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "exclude": ["test/**/*.ts", "**/*.test.ts", "**/*.setup.ts"]
4
- }
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "exclude": ["test/**/*.ts", "**/*.test.ts", "**/*.setup.ts"]
4
+ }
package/lib/tsconfig.json CHANGED
@@ -1,17 +1,17 @@
1
- {
2
- "compilerOptions": {
3
- "strict": true,
4
- "target": "es6",
5
- "lib": ["dom", "es6", "dom.iterable", "scripthost"],
6
- "outDir": "../dist",
7
- "sourceMap": true,
8
- "moduleResolution": "node",
9
- "skipLibCheck": true,
10
- "declaration": true,
11
- "allowSyntheticDefaultImports": true,
12
- "paths": {
13
- "@open-wc/testing": ["./test/open-wc-testing-patch.d.ts"]
14
- }
15
- },
16
- "include": ["**/*.ts"]
17
- }
1
+ {
2
+ "compilerOptions": {
3
+ "strict": true,
4
+ "target": "es6",
5
+ "lib": ["dom", "es6", "dom.iterable", "scripthost"],
6
+ "outDir": "../dist",
7
+ "sourceMap": true,
8
+ "moduleResolution": "node",
9
+ "skipLibCheck": true,
10
+ "declaration": true,
11
+ "allowSyntheticDefaultImports": true,
12
+ "paths": {
13
+ "@open-wc/testing": ["./test/open-wc-testing-patch.d.ts"]
14
+ }
15
+ },
16
+ "include": ["**/*.ts"]
17
+ }
package/package.json CHANGED
@@ -1,115 +1,115 @@
1
- {
2
- "name": "@stackoverflow/stacks",
3
- "description": "Stack Overflow’s CSS and Design Pattern Library. Stacks is an atomic CSS library with classes and components for rapidly building Stack Overflow.",
4
- "repository": {
5
- "type": "git",
6
- "url": "https://github.com/StackExchange/Stacks.git"
7
- },
8
- "version": "2.5.3",
9
- "files": [
10
- "dist",
11
- "lib",
12
- "!lib/**/*.test.*"
13
- ],
14
- "main": "./dist/js/stacks.js",
15
- "types": "./dist/index.d.ts",
16
- "style": "./dist/css/stacks.css",
17
- "less": "./lib/stacks.less",
18
- "unpkg": "dist/css/stacks.min.css",
19
- "scripts": {
20
- "start": "concurrently -n w: npm:start:*",
21
- "build": "concurrently -n w: npm:build:*",
22
- "build:bundle": "webpack --mode=production",
23
- "build:docs": "webpack --mode=production --config ./docs/webpack.config.js && cd ./docs && eleventy",
24
- "start:webpack": "webpack --watch --config ./docs/webpack.config.js",
25
- "start:eleventy": "cd ./docs && eleventy --serve",
26
- "test": "npm run test:less && npm run test:unit && npm run test:a11y && npm run test:visual",
27
- "test:a11y": "web-test-runner --group=a11y",
28
- "test:unit": "web-test-runner --group=unit",
29
- "test:unit:watch": "web-test-runner --group=unit --watch",
30
- "test:visual": "pwsh run-test-visual.ps1 npx web-test-runner --group=visual",
31
- "test:less": "vitest run .less.test.ts",
32
- "test:less:update": "npm run test:less -- -u",
33
- "prepublishOnly": "npm run build",
34
- "format": "prettier --write ./lib",
35
- "lint": "concurrently -n w: npm:lint:*",
36
- "lint:ts": "eslint ./lib",
37
- "lint:css": "stylelint ./lib",
38
- "lint:format": "prettier --check ./lib"
39
- },
40
- "license": "MIT",
41
- "dependencies": {
42
- "@hotwired/stimulus": "^3.2.2",
43
- "@popperjs/core": "^2.11.8"
44
- },
45
- "devDependencies": {
46
- "@11ty/eleventy": "^2.0.1",
47
- "@highlightjs/cdn-assets": "^11.9.0",
48
- "@open-wc/testing": "^4.0.0",
49
- "@rollup/plugin-commonjs": "^25.0.8",
50
- "@rollup/plugin-replace": "^5.0.5",
51
- "@stackoverflow/stacks-editor": "^0.10.6",
52
- "@stackoverflow/stacks-icons": "^6.0.2",
53
- "@testing-library/dom": "^10.1.0",
54
- "@testing-library/user-event": "^14.5.2",
55
- "@types/cssbeautify": "^0.3.5",
56
- "@types/less": "^3.0.6",
57
- "@types/mocha": "^10.0.6",
58
- "@typescript-eslint/eslint-plugin": "^7.11.0",
59
- "@typescript-eslint/parser": "^7.11.0",
60
- "@web/dev-server-esbuild": "^1.0.2",
61
- "@web/dev-server-rollup": "^0.6.3",
62
- "@web/test-runner": "^0.18.2",
63
- "@web/test-runner-playwright": "^0.11.0",
64
- "@web/test-runner-visual-regression": "^0.9.0",
65
- "apca-check": "^0.1.0",
66
- "colorjs.io": "^0.5.0",
67
- "concurrently": "^8.2.2",
68
- "css-loader": "^7.1.2",
69
- "cssbeautify": "^0.3.1",
70
- "cssnano": "^7.0.1",
71
- "docsearch.js": "^2.6.3",
72
- "eleventy-plugin-highlightjs": "^1.1.0",
73
- "eleventy-plugin-nesting-toc": "^1.3.0",
74
- "eslint": "^8.57.0",
75
- "eslint-config-prettier": "^9.1.0",
76
- "eslint-plugin-no-unsanitized": "^4.0.2",
77
- "jquery": "^3.7.1",
78
- "less-loader": "^12.2.0",
79
- "list.js": "^2.3.1",
80
- "markdown-it": "^14.1.0",
81
- "mini-css-extract-plugin": "^2.9.0",
82
- "postcss-less": "^6.0.0",
83
- "postcss-loader": "^8.1.1",
84
- "prettier": "^3.3.0",
85
- "rollup-plugin-postcss": "^4.0.2",
86
- "stylelint": "^16.6.1",
87
- "stylelint-config-recommended": "^14.0.0",
88
- "stylelint-config-standard": "^36.0.0",
89
- "terser-webpack-plugin": "^5.3.10",
90
- "ts-loader": "^9.5.1",
91
- "typescript": "^5.4.5",
92
- "vitest": "^1.6.0",
93
- "webpack": "^5.91.0",
94
- "webpack-cli": "^5.1.4",
95
- "webpack-merge": "^5.10.0"
96
- },
97
- "browserslist": [
98
- "last 2 versions",
99
- "not dead",
100
- "not ie > 0",
101
- "not op_mini all",
102
- "not baidu > 0",
103
- "not and_ff > 0",
104
- "not and_qq > 0",
105
- "not kaios > 0",
106
- "not op_mob > 0",
107
- "not ie_mob > 0",
108
- "not and_uc > 0",
109
- "not Samsung > 0",
110
- "not Android > 0"
111
- ],
112
- "overrides": {
113
- "aria-query": "~5.0.0"
114
- }
115
- }
1
+ {
2
+ "name": "@stackoverflow/stacks",
3
+ "description": "Stack Overflow’s CSS and Design Pattern Library. Stacks is an atomic CSS library with classes and components for rapidly building Stack Overflow.",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/StackExchange/Stacks.git"
7
+ },
8
+ "version": "2.5.5",
9
+ "files": [
10
+ "dist",
11
+ "lib",
12
+ "!lib/**/*.test.*"
13
+ ],
14
+ "main": "./dist/js/stacks.js",
15
+ "types": "./dist/index.d.ts",
16
+ "style": "./dist/css/stacks.css",
17
+ "less": "./lib/stacks.less",
18
+ "unpkg": "dist/css/stacks.min.css",
19
+ "scripts": {
20
+ "start": "concurrently -n w: npm:start:*",
21
+ "build": "concurrently -n w: npm:build:*",
22
+ "build:bundle": "webpack --mode=production",
23
+ "build:docs": "webpack --mode=production --config ./docs/webpack.config.js && cd ./docs && eleventy",
24
+ "start:webpack": "webpack --watch --config ./docs/webpack.config.js",
25
+ "start:eleventy": "cd ./docs && eleventy --serve",
26
+ "test": "npm run test:less && npm run test:unit && npm run test:a11y && npm run test:visual",
27
+ "test:a11y": "web-test-runner --group=a11y",
28
+ "test:unit": "web-test-runner --group=unit",
29
+ "test:unit:watch": "web-test-runner --group=unit --watch",
30
+ "test:visual": "pwsh run-test-visual.ps1 npx web-test-runner --group=visual",
31
+ "test:less": "vitest run .less.test.ts",
32
+ "test:less:update": "npm run test:less -- -u",
33
+ "prepublishOnly": "npm run build",
34
+ "format": "prettier --write ./lib",
35
+ "lint": "concurrently -n w: npm:lint:*",
36
+ "lint:ts": "eslint ./lib",
37
+ "lint:css": "stylelint ./lib",
38
+ "lint:format": "prettier --check ./lib"
39
+ },
40
+ "license": "MIT",
41
+ "dependencies": {
42
+ "@hotwired/stimulus": "^3.2.2",
43
+ "@popperjs/core": "^2.11.8"
44
+ },
45
+ "devDependencies": {
46
+ "@11ty/eleventy": "^2.0.1",
47
+ "@highlightjs/cdn-assets": "^11.10.0",
48
+ "@open-wc/testing": "^4.0.0",
49
+ "@rollup/plugin-commonjs": "^26.0.1",
50
+ "@rollup/plugin-replace": "^5.0.7",
51
+ "@stackoverflow/stacks-editor": "^0.10.6",
52
+ "@stackoverflow/stacks-icons": "^6.0.2",
53
+ "@testing-library/dom": "^10.4.0",
54
+ "@testing-library/user-event": "^14.5.2",
55
+ "@types/cssbeautify": "^0.3.5",
56
+ "@types/less": "^3.0.6",
57
+ "@types/mocha": "^10.0.7",
58
+ "@typescript-eslint/eslint-plugin": "^7.17.0",
59
+ "@typescript-eslint/parser": "^7.17.0",
60
+ "@web/dev-server-esbuild": "^1.0.2",
61
+ "@web/dev-server-rollup": "^0.6.4",
62
+ "@web/test-runner": "^0.18.2",
63
+ "@web/test-runner-playwright": "^0.11.0",
64
+ "@web/test-runner-visual-regression": "^0.9.0",
65
+ "apca-check": "^0.1.0",
66
+ "colorjs.io": "^0.5.2",
67
+ "concurrently": "^8.2.2",
68
+ "css-loader": "^7.1.2",
69
+ "cssbeautify": "^0.3.1",
70
+ "cssnano": "^7.0.4",
71
+ "docsearch.js": "^2.6.3",
72
+ "eleventy-plugin-highlightjs": "^1.1.0",
73
+ "eleventy-plugin-nesting-toc": "^1.3.0",
74
+ "eslint": "^8.57.0",
75
+ "eslint-config-prettier": "^9.1.0",
76
+ "eslint-plugin-no-unsanitized": "^4.0.2",
77
+ "jquery": "^3.7.1",
78
+ "less-loader": "^12.2.0",
79
+ "list.js": "^2.3.1",
80
+ "markdown-it": "^14.1.0",
81
+ "mini-css-extract-plugin": "^2.9.0",
82
+ "postcss-less": "^6.0.0",
83
+ "postcss-loader": "^8.1.1",
84
+ "prettier": "^3.3.3",
85
+ "rollup-plugin-postcss": "^4.0.2",
86
+ "stylelint": "^16.7.0",
87
+ "stylelint-config-recommended": "^14.0.1",
88
+ "stylelint-config-standard": "^36.0.1",
89
+ "terser-webpack-plugin": "^5.3.10",
90
+ "ts-loader": "^9.5.1",
91
+ "typescript": "^5.5.4",
92
+ "vitest": "^2.0.4",
93
+ "webpack": "^5.93.0",
94
+ "webpack-cli": "^5.1.4",
95
+ "webpack-merge": "^6.0.1"
96
+ },
97
+ "browserslist": [
98
+ "last 2 versions",
99
+ "not dead",
100
+ "not ie > 0",
101
+ "not op_mini all",
102
+ "not baidu > 0",
103
+ "not and_ff > 0",
104
+ "not and_qq > 0",
105
+ "not kaios > 0",
106
+ "not op_mob > 0",
107
+ "not ie_mob > 0",
108
+ "not and_uc > 0",
109
+ "not Samsung > 0",
110
+ "not Android > 0"
111
+ ],
112
+ "overrides": {
113
+ "aria-query": "~5.0.0"
114
+ }
115
+ }