@stackoverflow/stacks 2.3.3 → 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 (120) hide show
  1. package/dist/css/stacks.css +37 -4884
  2. package/dist/css/stacks.min.css +1 -1
  3. package/lib/components/button/button.less +0 -18
  4. package/lib/components/tag/tag.less +16 -68
  5. package/lib/components/topbar/topbar.less +33 -3
  6. package/lib/exports/color-mixins.less +0 -2
  7. package/lib/exports/exports.less +0 -1
  8. package/lib/stacks-static.less +0 -5
  9. package/package.json +12 -11
  10. package/lib/atomic/__snapshots__/color-new.less.test.ts.snap +0 -3015
  11. package/lib/atomic/__snapshots__/color.less.test.ts.snap +0 -3132
  12. package/lib/atomic/__snapshots__/misc.less.test.ts.snap +0 -893
  13. package/lib/atomic/__snapshots__/spacing.less.test.ts.snap +0 -1928
  14. package/lib/atomic/color.less.test.ts +0 -12
  15. package/lib/atomic/misc.less.test.ts +0 -12
  16. package/lib/atomic/spacing.less.test.ts +0 -12
  17. package/lib/atomic/v1/__snapshots__/border.less.test.ts.snap +0 -546
  18. package/lib/atomic/v1/__snapshots__/color.less.test.ts.snap +0 -6750
  19. package/lib/atomic/v1/__snapshots__/typography.less.test.ts.snap +0 -16
  20. package/lib/atomic/v1/border.less +0 -210
  21. package/lib/atomic/v1/border.less.test.ts +0 -14
  22. package/lib/atomic/v1/color.less +0 -183
  23. package/lib/atomic/v1/color.less.test.ts +0 -14
  24. package/lib/atomic/v1/typography.less +0 -8
  25. package/lib/atomic/v1/typography.less.test.ts +0 -14
  26. package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +0 -13
  27. package/lib/components/activity-indicator/activity-indicator.visual.test.ts +0 -22
  28. package/lib/components/anchor/anchor.a11y.test.ts +0 -35
  29. package/lib/components/anchor/anchor.visual.test.ts +0 -47
  30. package/lib/components/avatar/avatar.a11y.test.ts +0 -35
  31. package/lib/components/avatar/avatar.visual.test.ts +0 -50
  32. package/lib/components/award-bling/award-bling.a11y.test.ts +0 -15
  33. package/lib/components/award-bling/award-bling.visual.test.ts +0 -24
  34. package/lib/components/badge/badge.a11y.test.ts +0 -143
  35. package/lib/components/badge/badge.visual.test.ts +0 -165
  36. package/lib/components/banner/banner.a11y.test.ts +0 -36
  37. package/lib/components/banner/banner.test.ts +0 -73
  38. package/lib/components/banner/banner.visual.test.ts +0 -36
  39. package/lib/components/block-link/block-link.a11y.test.ts +0 -57
  40. package/lib/components/block-link/block-link.visual.test.ts +0 -57
  41. package/lib/components/breadcrumbs/breadcrumbs.a11y.test.ts +0 -36
  42. package/lib/components/breadcrumbs/breadcrumbs.visual.test.ts +0 -36
  43. package/lib/components/button/button.a11y.test.ts +0 -21
  44. package/lib/components/button/button.test.setup.ts +0 -36
  45. package/lib/components/button/button.visual.test.ts +0 -18
  46. package/lib/components/button-group/button-group.a11y.test.ts +0 -12
  47. package/lib/components/button-group/button-group.test.setup.ts +0 -77
  48. package/lib/components/button-group/button-group.visual.test.ts +0 -7
  49. package/lib/components/card/card.a11y.test.ts +0 -12
  50. package/lib/components/card/card.visual.test.ts +0 -52
  51. package/lib/components/check-control/check-control.a11y.test.ts +0 -33
  52. package/lib/components/check-control/check-control.visual.test.ts +0 -36
  53. package/lib/components/check-group/check-group.a11y.test.ts +0 -49
  54. package/lib/components/check-group/check-group.visual.test.ts +0 -56
  55. package/lib/components/checkbox_radio/checkbox_radio.a11y.test.ts +0 -37
  56. package/lib/components/checkbox_radio/checkbox_radio.visual.test.ts +0 -33
  57. package/lib/components/code-block/code-block.a11y.test.ts +0 -27
  58. package/lib/components/code-block/code-block.visual.test.ts +0 -18
  59. package/lib/components/description/description.a11y.test.ts +0 -28
  60. package/lib/components/description/description.visual.test.ts +0 -28
  61. package/lib/components/empty-state/empty-state.a11y.test.ts +0 -16
  62. package/lib/components/empty-state/empty-state.visual.test.ts +0 -16
  63. package/lib/components/expandable/expandable.a11y.test.ts +0 -26
  64. package/lib/components/expandable/expandable.test.ts +0 -51
  65. package/lib/components/expandable/expandable.visual.test.ts +0 -26
  66. package/lib/components/input-fill/input-fill.a11y.test.ts +0 -21
  67. package/lib/components/input-fill/input-fill.visual.test.ts +0 -21
  68. package/lib/components/input-icon/input-icon.a11y.test.ts +0 -81
  69. package/lib/components/input-icon/input-icon.visual.test.ts +0 -92
  70. package/lib/components/input-message/input-message.a11y.test.ts +0 -57
  71. package/lib/components/input-message/input-message.visual.test.ts +0 -58
  72. package/lib/components/input_textarea/input_textarea.a11y.test.ts +0 -109
  73. package/lib/components/input_textarea/input_textarea.visual.test.ts +0 -95
  74. package/lib/components/label/label.a11y.test.ts +0 -47
  75. package/lib/components/label/label.visual.test.ts +0 -65
  76. package/lib/components/link/link.a11y.test.ts +0 -27
  77. package/lib/components/link/link.visual.test.ts +0 -31
  78. package/lib/components/link-preview/link-preview.a11y.test.ts +0 -47
  79. package/lib/components/link-preview/link-preview.visual.test.ts +0 -52
  80. package/lib/components/menu/menu.a11y.test.ts +0 -39
  81. package/lib/components/menu/menu.visual.test.ts +0 -39
  82. package/lib/components/modal/modal.a11y.test.ts +0 -41
  83. package/lib/components/modal/modal.test.ts +0 -155
  84. package/lib/components/modal/modal.visual.test.ts +0 -41
  85. package/lib/components/navigation/navigation.a11y.test.ts +0 -81
  86. package/lib/components/navigation/navigation.visual.test.ts +0 -98
  87. package/lib/components/notice/notice.a11y.test.ts +0 -16
  88. package/lib/components/notice/notice.visual.test.ts +0 -25
  89. package/lib/components/page-title/page-title.a11y.test.ts +0 -28
  90. package/lib/components/page-title/page-title.visual.test.ts +0 -58
  91. package/lib/components/pagination/pagination.a11y.test.ts +0 -21
  92. package/lib/components/pagination/pagination.visual.test.ts +0 -25
  93. package/lib/components/popover/tooltip.test.ts +0 -62
  94. package/lib/components/post-summary/post-summary.a11y.test.ts +0 -25
  95. package/lib/components/post-summary/post-summary.test.setup.ts +0 -435
  96. package/lib/components/post-summary/post-summary.visual.test.ts +0 -17
  97. package/lib/components/progress-bar/progress-bar.a11y.test.ts +0 -189
  98. package/lib/components/progress-bar/progress-bar.visual.test.ts +0 -188
  99. package/lib/components/select/select.a11y.test.ts +0 -72
  100. package/lib/components/select/select.visual.test.ts +0 -72
  101. package/lib/components/spinner/spinner.a11y.test.ts +0 -14
  102. package/lib/components/spinner/spinner.visual.test.ts +0 -40
  103. package/lib/components/table/table.a11y.test.ts +0 -112
  104. package/lib/components/table/table.test.ts +0 -366
  105. package/lib/components/table/table.visual.test.ts +0 -104
  106. package/lib/components/tag/tag.a11y.test.ts +0 -28
  107. package/lib/components/tag/tag.visual.test.ts +0 -43
  108. package/lib/components/toast/toast.a11y.test.ts +0 -29
  109. package/lib/components/toast/toast.test.ts +0 -64
  110. package/lib/components/toast/toast.visual.test.ts +0 -30
  111. package/lib/components/toggle-switch/toggle-switch.a11y.test.ts +0 -66
  112. package/lib/components/toggle-switch/toggle-switch.visual.test.ts +0 -70
  113. package/lib/components/topbar/topbar.visual.test.ts +0 -216
  114. package/lib/exports/__snapshots__/color-mixins.less.test.ts.snap +0 -558
  115. package/lib/exports/__snapshots__/color.less.test.ts.snap +0 -819
  116. package/lib/exports/color-mixins.less.test.ts +0 -150
  117. package/lib/exports/color.less.test.ts +0 -12
  118. package/lib/exports/v1/__snapshots__/constants-colors.less.test.ts.snap +0 -902
  119. package/lib/exports/v1/constants-colors.less +0 -893
  120. package/lib/exports/v1/constants-colors.less.test.ts +0 -12
@@ -1,98 +0,0 @@
1
- import { html } from "@open-wc/testing";
2
- import { runVisualTests } from "../../test/visual-test-utils";
3
- import "../../index";
4
-
5
- const items = [
6
- {
7
- label: "Group 1",
8
- title: true,
9
- },
10
- {
11
- label: "Product",
12
- selected: true,
13
- },
14
- {
15
- label: "Email",
16
- },
17
- {
18
- label: "Group 2",
19
- title: true,
20
- },
21
- {
22
- label: "Content",
23
- },
24
- {
25
- label: "Brand",
26
- },
27
- {
28
- label: "Marketing",
29
- },
30
- {
31
- label: "More selected",
32
- dropdown: true,
33
- selected: true,
34
- },
35
- {
36
- label: "More",
37
- dropdown: true,
38
- },
39
- ];
40
-
41
- const getChildren = (includeTitles = false): string =>
42
- items
43
- .map((item) => {
44
- if (item.title) {
45
- return includeTitles
46
- ? `<li class="s-navigation--title">${item.label}</li>`
47
- : "";
48
- }
49
- const classes = `s-navigation--item${
50
- item.selected ? " is-selected" : ""
51
- }${item.dropdown ? " s-navigation--item__dropdown" : ""}`;
52
- return `<li><a href="#" class="${classes}">${item.label}</a></li>`;
53
- })
54
- .join("");
55
-
56
- describe("navigation", () => {
57
- runVisualTests({
58
- baseClass: "s-navigation",
59
- variants: ["muted"],
60
- modifiers: {
61
- primary: ["scroll", "sm"],
62
- },
63
- tag: "ul",
64
- children: {
65
- default: getChildren(),
66
- },
67
- template: ({ component, testid }) => html`
68
- <nav
69
- class="d-inline-block p8 wmx3"
70
- aria-label="example-navigation"
71
- data-testid="${testid}"
72
- >
73
- ${component}
74
- </nav>
75
- `,
76
- });
77
-
78
- runVisualTests({
79
- baseClass: "s-navigation",
80
- variants: ["vertical"],
81
- tag: "ul",
82
- children: {
83
- default: getChildren(true),
84
- },
85
- template: ({ component, testid }) => html`
86
- <nav
87
- class="d-inline-block p8 ws2"
88
- aria-label="example-navigation"
89
- data-testid="${testid}"
90
- >
91
- ${component}
92
- </nav>
93
- `,
94
- options: {
95
- includeNullVariant: false,
96
- },
97
- });
98
- });
@@ -1,16 +0,0 @@
1
- import { runA11yTests } from "../../test/a11y-test-utils";
2
- import "../../index";
3
-
4
- describe("notice", () => {
5
- runA11yTests({
6
- baseClass: "s-notice",
7
- variants: ["info", "success", "warning", "danger"],
8
- modifiers: {
9
- primary: ["important"],
10
- },
11
- children: {
12
- default: `Test notice <code>some code</code> <a class="s-link s-link__inherit s-link__underlined" href="#">Link</a>`,
13
- },
14
- tag: "aside",
15
- });
16
- });
@@ -1,25 +0,0 @@
1
- import { runVisualTests } from "../../test/visual-test-utils";
2
- import { html } from "@open-wc/testing";
3
- import "../../index";
4
-
5
- describe("notice", () => {
6
- runVisualTests({
7
- baseClass: "s-notice",
8
- variants: ["info", "success", "warning", "danger"],
9
- modifiers: {
10
- primary: ["important"],
11
- },
12
- attributes: {
13
- ariaHidden: "false",
14
- },
15
- children: {
16
- default: `Test notice <code>some code</code> <a class="s-link s-link__inherit s-link__underlined" href="#">Link</a>`,
17
- },
18
- tag: "aside",
19
- template: ({ component, testid }) => html`
20
- <div class="d-inline-block p8 wmx5" data-testid="${testid}">
21
- ${component}
22
- </div>
23
- `,
24
- });
25
- });
@@ -1,28 +0,0 @@
1
- import { html } from "@open-wc/testing";
2
- import { runA11yTests } from "../../test/a11y-test-utils";
3
- import "../../index";
4
-
5
- describe("page title", () => {
6
- runA11yTests({
7
- baseClass: "s-page-title",
8
- children: {
9
- default: `
10
- <div class="s-page-title--text">
11
- <nav class="s-breadcrumbs" aria-label="example-breadcrumbs">…</nav>
12
- <h1 class="s-page-title--header">Page title</h1>
13
- <p class="s-page-title--description">
14
- Optional description de Finibus Bonorum et Malorum
15
- </p>
16
- </div>
17
- <div class="s-page-title--actions">
18
- <button class="s-btn s-btn__filled" type="button">Action</button>
19
- </div>
20
- `,
21
- },
22
- template: ({ component, testid }) => html`
23
- <div class="d-block p8 ws6" data-testid="${testid}">
24
- ${component}
25
- </div>
26
- `,
27
- });
28
- });
@@ -1,58 +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 postTitleTemplate = ({ component, testid }: any) => html`
7
- <div class="d-block p8 ws6" data-testid="${testid}">${component}</div>
8
- `;
9
-
10
- const getChildren = ({
11
- showEverything = false,
12
- }: {
13
- showEverything: boolean;
14
- }) => `
15
- <div class="s-page-title--text">
16
- ${
17
- showEverything
18
- ? `
19
- <nav class="s-breadcrumbs" aria-label="example-breadcrumbs">
20
- <div class="s-breadcrumbs--item">
21
- <a class="s-breadcrumbs--link">Stack Overflow</a>
22
- </div>
23
- </nav>
24
- `
25
- : ""
26
- }
27
- <h1 class="s-page-title--header">Page title</h1>
28
- ${
29
- showEverything
30
- ? `
31
- <p class="s-page-title--description">
32
- Optional description de Finibus Bonorum et Malorum
33
- </p>
34
- `
35
- : ""
36
- }
37
- </div>
38
- ${
39
- showEverything
40
- ? `
41
- <div class="s-page-title--actions">
42
- <button class="s-btn s-btn__filled" type="button">Action</button>
43
- </div>
44
- `
45
- : ""
46
- }
47
- `;
48
-
49
- describe("page title", () => {
50
- runVisualTests({
51
- baseClass: "s-page-title",
52
- children: {
53
- default: getChildren({ showEverything: false }),
54
- complete: getChildren({ showEverything: true }),
55
- },
56
- template: postTitleTemplate,
57
- });
58
- });
@@ -1,21 +0,0 @@
1
- import { runA11yTests } from "../../test/a11y-test-utils";
2
- import { WCAGNonTextContrast } from "../../test/assertions";
3
- import "../../index";
4
-
5
- describe("pagination", () => {
6
- runA11yTests({
7
- baseClass: "s-pagination",
8
- children: {
9
- default: `
10
- <a class="s-pagination--item" href="#">Prev</a>
11
- <a class="s-pagination--item" href="#">1</a>
12
- <span class="s-pagination--item is-selected" aria-current="page">2</span>
13
- <a class="s-pagination--item" href="#">3</a>
14
- <span class="s-pagination--item s-pagination--item__clear">…</span>
15
- <a class="s-pagination--item" href="#">100</a>
16
- <a class="s-pagination--item" href="#">Next</a>
17
- `,
18
- },
19
- additionalAssertions: [WCAGNonTextContrast],
20
- });
21
- });
@@ -1,25 +0,0 @@
1
- import { html } from "@open-wc/testing";
2
- import { runVisualTests } from "../../test/visual-test-utils";
3
- import "../../index";
4
-
5
- describe("pagination", () => {
6
- runVisualTests({
7
- baseClass: "s-pagination",
8
- children: {
9
- default: `
10
- <a class="s-pagination--item" href="#">Prev</a>
11
- <a class="s-pagination--item" href="#">1</a>
12
- <span class="s-pagination--item is-selected" aria-current="page">2</span>
13
- <a class="s-pagination--item" href="#">3</a>
14
- <span class="s-pagination--item s-pagination--item__clear">…</span>
15
- <a class="s-pagination--item" href="#">100</a>
16
- <a class="s-pagination--item" href="#">Next</a>
17
- `,
18
- },
19
- template: ({ component, testid }) => html`
20
- <div class="d-inline-block p8" data-testid="${testid}">
21
- ${component}
22
- </div>
23
- `,
24
- });
25
- });
@@ -1,62 +0,0 @@
1
- import { html, fixture, expect } from "@open-wc/testing";
2
- import { screen, waitForElementToBeRemoved } from "@testing-library/dom";
3
- import userEvent from "@testing-library/user-event";
4
- import "../../index";
5
-
6
- const user = userEvent.setup();
7
-
8
- describe("tooltip", () => {
9
- it("should make the tooltip element visible on hover (after a delay)", async () => {
10
- const trigger = await fixture(html`
11
- <button
12
- class="s-btn s-btn__filled"
13
- role="button"
14
- data-controller="s-tooltip"
15
- title="tooltip content"
16
- data-s-tooltip-placement="bottom-start"
17
- >
18
- Hover tooltip popover
19
- </button>
20
- `);
21
-
22
- expect(screen.queryByRole("tooltip")).to.be.null;
23
-
24
- await user.hover(trigger);
25
- const tooltip = await screen.findByRole("tooltip");
26
- expect(tooltip).to.be.visible;
27
-
28
- await user.unhover(trigger);
29
- await waitForElementToBeRemoved(() => screen.queryByRole("tooltip"));
30
- });
31
-
32
- it("should not flicker when the host contains an SVG and the user hover on it", async () => {
33
- await fixture(html`
34
- <button
35
- class="s-btn"
36
- role="button"
37
- title="tooltip content"
38
- data-controller="s-tooltip"
39
- data-s-tooltip-placement="bottom-start"
40
- >
41
- <svg
42
- data-testid="svg"
43
- aria-hidden="true"
44
- class="bg-red-400"
45
- width="18"
46
- height="18"
47
- viewBox="0 0 18 18"
48
- ></svg>
49
- 👈 Shouldn't flicker 🤷‍
50
- </button>
51
- `);
52
- const button = screen.getByRole("button");
53
- const svg = screen.getByTestId("svg");
54
-
55
- await user.hover(button);
56
- const tooltip = await screen.findByRole("tooltip");
57
- expect(tooltip).to.be.visible;
58
-
59
- await user.hover(svg);
60
- expect(tooltip).to.be.visible;
61
- });
62
- });
@@ -1,25 +0,0 @@
1
- import { runA11yTests } from "../../test/a11y-test-utils";
2
- import testArgs from "./post-summary.test.setup";
3
- import "../../index";
4
-
5
- describe("post-summary", () => {
6
- // Base, sparce
7
- runA11yTests({
8
- ...testArgs.base,
9
- // TODO resolve test failures
10
- skippedTestids: [
11
- /-deleted/,
12
- /-ignored/,
13
- /-highcontrast-(light|dark)-watched/,
14
- ],
15
- });
16
-
17
- // Truncated description sizes
18
- runA11yTests(testArgs.sizes);
19
-
20
- // Stats - answers, view hotness
21
- runA11yTests(testArgs.stats);
22
-
23
- // Badges
24
- runA11yTests(testArgs.badges);
25
- });