@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,21 +0,0 @@
1
- import testArgs from "./button.test.setup";
2
- import { runA11yTests } from "../../test/a11y-test-utils";
3
- import "../../index";
4
-
5
- describe("button", () => {
6
- runA11yTests({
7
- ...testArgs,
8
- excludedTestids: [
9
- /^s-btn-(?=.*unset).*badge$/, // s-btn with badge and unset variant not supported
10
- ],
11
- skippedTestids: [
12
- // TODO resolve btn badge contrast issues
13
- // matches tests with a badge in light and dark modes
14
- /s-btn-(light|dark).*?badge/,
15
- // matches tests with a badge in highcontrast-light modes, excluding filled, danger, github, facebook, sm, or xs
16
- /s-btn-highcontrast-light-(?!.*(filled|danger|github|facebook|sm|xs)).*?badge/,
17
- // matches tests with a badge in highcontrast-light modes, are muted and/or outlined, and are sm or xs
18
- /s-btn-highcontrast-light-(?:muted-outlined-|muted-|outlined-)?(?:sm|xs).*?badge/,
19
- ],
20
- });
21
- });
@@ -1,36 +0,0 @@
1
- import type { TestVariationArgs } from "../../test/test-utils";
2
- import "../../index";
3
-
4
- const getChild = (child?: string): string => {
5
- switch (child) {
6
- case "badge":
7
- return `Ask question
8
- <span class="s-btn--badge">
9
- <span class="s-btn--number">198</span>
10
- </span>`;
11
- default:
12
- return "Ask question";
13
- }
14
- };
15
-
16
- // TODO test disabled states, interaction pseudo-classes
17
- const testArgs: TestVariationArgs = {
18
- baseClass: "s-btn",
19
- variants: ["danger", "muted"],
20
- modifiers: {
21
- primary: ["filled", "outlined"],
22
- secondary: [...["xs", "sm", "md"], ...["dropdown", "icon"]],
23
- global: ["is-loading"],
24
- standalone: [...["link", "unset"], ...["facebook", "github", "google"]],
25
- },
26
- attributes: {
27
- type: "button",
28
- },
29
- children: {
30
- default: getChild(),
31
- badge: getChild("badge"),
32
- },
33
- tag: "button",
34
- };
35
-
36
- export default testArgs;
@@ -1,18 +0,0 @@
1
- import testArgs from "./button.test.setup";
2
- import { runVisualTests } from "../../test/visual-test-utils";
3
- import "../../index";
4
- import { html } from "@open-wc/testing";
5
-
6
- describe("button", () => {
7
- runVisualTests({
8
- ...testArgs,
9
- template: ({ component, testid }) => html`
10
- <div
11
- class="bg-black-225 d-inline-flex ai-center jc-center hs1 ws2 p8"
12
- data-testid="${testid}"
13
- >
14
- ${component}
15
- </div>
16
- `,
17
- });
18
- });
@@ -1,12 +0,0 @@
1
- import { testArgs } from "./button-group.test.setup";
2
- import { runA11yTests } from "../../test/a11y-test-utils";
3
- import "../../index";
4
-
5
- describe("button group", () => {
6
- runA11yTests({
7
- ...testArgs,
8
- // TODO remove skipped tests once btn badge contrast issues are resolved
9
- // see also https://github.com/StackExchange/Stacks/pull/1663
10
- skippedTestids: [/s-btn-group-(light|dark|highcontrast-light)-badge/],
11
- });
12
- });
@@ -1,77 +0,0 @@
1
- import { html } from "@open-wc/testing";
2
- import type { TestVariationArgs } from "../../test/test-utils";
3
-
4
- const btns = [
5
- { name: "Newest", isSelected: true },
6
- { name: "Frequent" },
7
- { name: "Active" },
8
- ];
9
-
10
- const getBtn = ({
11
- name = "",
12
- isRadio,
13
- isSelected,
14
- hasBadge,
15
- }: {
16
- name: string;
17
- isRadio?: boolean;
18
- isSelected?: boolean;
19
- hasBadge?: boolean;
20
- }): string => {
21
- const baseClasses = "s-btn s-btn__muted";
22
- const btnChildren = `
23
- <span class="s-btn--text" data-text="${name}">${name}</span>
24
- ${
25
- hasBadge
26
- ? `<span class="s-btn--badge"><span class="s-btn--number">123</span></span>`
27
- : ""
28
- }
29
- `;
30
-
31
- return isRadio
32
- ? `<input
33
- class="s-btn--radio"
34
- type="radio"
35
- name="test-btn-radio-group"
36
- id="btn-${name}"
37
- ${isSelected ? "checked" : ""}/>
38
- <label class="${baseClasses}" for="btn-${name}">
39
- ${btnChildren}
40
- </label>`
41
- : `<button
42
- class="${baseClasses}${isSelected ? " is-selected" : ""}"
43
- ${isSelected ? `aria-current="true"` : ""}
44
- type="button">
45
- ${btnChildren}
46
- </button>`;
47
- };
48
-
49
- const getBtns = (ids: number[]): string => {
50
- return ids.map((id) => getBtn(btns[id])).join("");
51
- };
52
-
53
- const testArgs: TestVariationArgs = {
54
- baseClass: "s-btn-group",
55
- children: {
56
- default: getBtns([0, 1, 2]),
57
- single: getBtns([0]),
58
- form: `
59
- ${getBtns([0])}
60
- <form class="mb0 p0">
61
- ${getBtn(btns[1])}
62
- </form>
63
- ${getBtns([2])}
64
- `,
65
- badge: btns.map((btn) => getBtn({ ...btn, hasBadge: true })).join(""),
66
- radio: btns.map((btn) => getBtn({ ...btn, isRadio: true })).join(""),
67
- },
68
- template: ({ component, testid }) =>
69
- html`<div
70
- class="d-inline-flex ai-center jc-center p8"
71
- data-testid="${testid}"
72
- >
73
- ${component}
74
- </div>`,
75
- };
76
-
77
- export { testArgs };
@@ -1,7 +0,0 @@
1
- import { testArgs } from "./button-group.test.setup";
2
- import { runVisualTests } from "../../test/visual-test-utils";
3
- import "../../index";
4
-
5
- describe("button group", () => {
6
- runVisualTests(testArgs);
7
- });
@@ -1,12 +0,0 @@
1
- import { runA11yTests } from "../../test/a11y-test-utils";
2
- import "../../index";
3
-
4
- describe("card", () => {
5
- runA11yTests({
6
- baseClass: "s-card",
7
- variants: ["muted"],
8
- children: {
9
- default: `<p>This is a description of the card’s content.</p>`,
10
- },
11
- });
12
- });
@@ -1,52 +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 cardTemplate = ({ component, testid }: any) =>
7
- html`<div
8
- class="d-inline-flex ai-center jc-center hs2 ws3 p8"
9
- data-testid="${testid}"
10
- >
11
- ${component}
12
- </div>`;
13
-
14
- const baseChild = `
15
- <h2 class="fs-body3 lh-sm fc-dark">Base card title</h2>
16
- <p class="fs-body1 fc-medium">
17
- This is a description of the card’s content.
18
- </p>
19
- <div class="d-flex gx4">
20
- <button class="flex--item s-btn s-btn__primary s-btn__sm">
21
- Call to action
22
- </button>
23
- <button class="flex--item s-btn s-btn__sm">Cancel</button>
24
- </div>
25
- `;
26
-
27
- describe("card", () => {
28
- runVisualTests({
29
- baseClass: "s-card",
30
- variants: ["muted"],
31
- children: {
32
- default: baseChild,
33
- },
34
- template: cardTemplate,
35
- });
36
-
37
- // Stacked
38
- runVisualTests({
39
- baseClass: "s-card",
40
- variants: ["stacked"], // dummy variant for testid differentiation
41
- children: {
42
- default: `<div class="s-card ps-relative b4 l4">${baseChild}</div>`,
43
- },
44
- attributes: {
45
- class: "p0",
46
- },
47
- template: cardTemplate,
48
- options: {
49
- includeNullVariant: false,
50
- },
51
- });
52
- });
@@ -1,33 +0,0 @@
1
- import { runA11yTests } from "../../test/a11y-test-utils";
2
- import "../../index";
3
-
4
- ["checkbox", "radio"].forEach((type) => {
5
- describe("s-check-control", () => {
6
- // TODO include indeterminate
7
- ["checked", "unchecked"].forEach((state) => {
8
- runA11yTests({
9
- baseClass: "s-check-control",
10
- modifiers: {
11
- global: ["has-warning", "has-error", "has-success"],
12
- },
13
- children: {
14
- default: `
15
- <input
16
- class="s-${type}"
17
- type="${type}"
18
- id="test-input"
19
- name=""
20
- ${state === "checked" ? "checked" : ""}/>
21
- <label class="s-label" for="test-input">
22
- Label ${type}
23
- <p class="s-input-message">Description</p>
24
- </label>
25
- `,
26
- },
27
- options: {
28
- testidSuffix: `${state}-${type}`,
29
- },
30
- });
31
- });
32
- });
33
- });
@@ -1,36 +0,0 @@
1
- import { runVisualTests } from "../../test/visual-test-utils";
2
- import "../../index";
3
-
4
- ["checkbox", "radio"].forEach((type) => {
5
- describe("s-check-control", () => {
6
- // TODO include indeterminate
7
- ["checked", "unchecked"].forEach((state) => {
8
- runVisualTests({
9
- baseClass: "s-check-control",
10
- modifiers: {
11
- global: ["has-warning", "has-error", "has-success"],
12
- },
13
- attributes: {
14
- class: "bg-black-225 hs1 ws2 p8",
15
- },
16
- children: {
17
- default: `
18
- <input
19
- class="s-${type}"
20
- type="${type}"
21
- id="test-input"
22
- name=""
23
- ${state === "checked" ? "checked" : ""}/>
24
- <label class="s-label" for="test-input">
25
- Label ${type}
26
- <p class="s-input-message">Description</p>
27
- </label>
28
- `,
29
- },
30
- options: {
31
- testidSuffix: `${state}-${type}`,
32
- },
33
- });
34
- });
35
- });
36
- });
@@ -1,49 +0,0 @@
1
- import { runA11yTests } from "../../test/a11y-test-utils";
2
- import "../../index";
3
-
4
- type CheckGroup = "checkbox" | "radio";
5
- const checkTypes: CheckGroup[] = ["checkbox", "radio"];
6
-
7
- checkTypes.forEach((type) => {
8
- describe("s-check-group", () => {
9
- const checkEls: {
10
- type: CheckGroup;
11
- id: string;
12
- state?: "checked" | "unchecked" | "indeterminate";
13
- }[] = [
14
- { type, id: `test-${type}1`, state: "checked" },
15
- { type, id: `test-${type}2` },
16
- ];
17
- runA11yTests({
18
- tag: "fieldset",
19
- baseClass: "s-check-group",
20
- variants: ["horizontal"],
21
- children: {
22
- default: `
23
- <legend class="s-label">${type} group</legend>
24
- ${checkEls
25
- .map(
26
- ({ type, state, id }, index) => `
27
- <div class="s-check-control">
28
- <input
29
- class="s-${type}"
30
- type="${type}"
31
- id="${id}-${index}"
32
- name=""
33
- ${state === "checked" ? "checked" : ""}/>
34
- <label class="s-label" for="${id}-${index}">
35
- ${type} label ${index}
36
- <p class="s-input-message">Description</p>
37
- </label>
38
- </div>
39
- `
40
- )
41
- .join("")}
42
- `,
43
- },
44
- options: {
45
- testidSuffix: type,
46
- },
47
- });
48
- });
49
- });
@@ -1,56 +0,0 @@
1
- import { runVisualTests } from "../../test/visual-test-utils";
2
- import "../../index";
3
-
4
- type CheckGroup = "checkbox" | "radio";
5
- const checkTypes: CheckGroup[] = ["checkbox", "radio"];
6
-
7
- // Account for horizontal variant
8
- [true, false].forEach((isHorizontal) => {
9
- checkTypes.forEach((type) => {
10
- describe("s-check-group", () => {
11
- const checkEls: {
12
- type: CheckGroup;
13
- id: string;
14
- state?: "checked" | "unchecked" | "indeterminate";
15
- }[] = [
16
- { type, id: `test-${type}1`, state: "checked" },
17
- { type, id: `test-${type}2` },
18
- ];
19
- runVisualTests({
20
- tag: "fieldset",
21
- baseClass: "s-check-group",
22
- attributes: {
23
- class: isHorizontal ? "hs1 ws3 p8" : "hs2 ws2 p8",
24
- },
25
- variants: isHorizontal ? ["horizontal"] : [],
26
- children: {
27
- default: `
28
- <legend class="s-label">${type} group</legend>
29
- ${checkEls
30
- .map(
31
- ({ type, state, id }, index) => `
32
- <div class="s-check-control">
33
- <input
34
- class="s-${type}"
35
- type="${type}"
36
- id="${id}-${index}"
37
- name=""
38
- ${state === "checked" ? "checked" : ""}/>
39
- <label class="s-label" for="${id}-${index}">
40
- ${type} label ${index}
41
- <p class="s-input-message">Description</p>
42
- </label>
43
- </div>
44
- `
45
- )
46
- .join("")}
47
- `,
48
- },
49
- options: {
50
- includeNullVariant: !isHorizontal,
51
- testidSuffix: type,
52
- },
53
- });
54
- });
55
- });
56
- });
@@ -1,37 +0,0 @@
1
- import { html } from "@open-wc/testing";
2
- import { runA11yTests } from "../../test/a11y-test-utils";
3
- import "../../index";
4
-
5
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
- const checkboxTemplate = ({ component, testid, id }: any) =>
7
- html` <div class="s-check-control" data-testid="${testid}">
8
- ${component}
9
- <label class="s-label" for="${id}">Label</label>
10
- </div>`;
11
-
12
- ["checkbox", "radio"].forEach((type) => {
13
- describe(type, () => {
14
- // TODO include indeterminate
15
- ["checked", "unchecked"].forEach((state) => {
16
- runA11yTests({
17
- tag: "input",
18
- baseClass: `s-${type}`,
19
- attributes: {
20
- name: "test-name",
21
- id: "test-id",
22
- type,
23
- ...(state === "checked" ? { checked: "checked" } : {}),
24
- },
25
- template: ({ component, testid }) =>
26
- checkboxTemplate({
27
- component,
28
- testid,
29
- id: "test-id",
30
- }),
31
- options: {
32
- testidSuffix: state,
33
- },
34
- });
35
- });
36
- });
37
- });
@@ -1,33 +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 checkboxTemplate = ({ component, testid }: any) =>
7
- html`<div
8
- class="d-inline-flex ai-center jc-center bg-black-225 hs1 ws1 p8"
9
- data-testid="${testid}"
10
- >
11
- ${component}
12
- </div>`;
13
-
14
- ["checkbox", "radio"].forEach((type) => {
15
- describe(type, () => {
16
- // TODO include indeterminate
17
- ["checked", "unchecked"].forEach((state) => {
18
- runVisualTests({
19
- tag: "input",
20
- baseClass: `s-${type}`,
21
- attributes: {
22
- type,
23
- ...(state === "checked" ? { checked: "checked" } : {}),
24
- },
25
- template: ({ component, testid }) =>
26
- checkboxTemplate({ component, testid }),
27
- options: {
28
- testidSuffix: state,
29
- },
30
- });
31
- });
32
- });
33
- });
@@ -1,27 +0,0 @@
1
- import { runA11yTests } from "../../test/a11y-test-utils";
2
- import highlightedFixtures from "./code-block.fixtures";
3
- import "../../index";
4
-
5
- describe("code block", () => {
6
- Object.keys(highlightedFixtures).forEach((language) => {
7
- runA11yTests({
8
- tag: "pre",
9
- baseClass: `s-code-block language-${language}`,
10
- children: {
11
- default: highlightedFixtures[language],
12
- },
13
- options: {
14
- includeNullModifier: false,
15
- },
16
- attributes: {
17
- tabindex: "0",
18
- },
19
- // TODO revisit these skipped test ids
20
- skippedTestids: [
21
- /s-code-block-language-(html|css|javascript)-dark/,
22
- /s-code-block-language-html-highcontrast-(light|dark)/,
23
- "s-code-block-language-javascript-highcontrast-light",
24
- ],
25
- });
26
- });
27
- });
@@ -1,18 +0,0 @@
1
- import { runVisualTests } from "../../test/visual-test-utils";
2
- import highlightedFixtures from "./code-block.fixtures";
3
- import "../../index";
4
-
5
- describe("code block", () => {
6
- Object.keys(highlightedFixtures).forEach((language) => {
7
- runVisualTests({
8
- tag: "pre",
9
- baseClass: `s-code-block language-${language}`,
10
- children: {
11
- default: highlightedFixtures[language],
12
- },
13
- options: {
14
- includeNullModifier: false,
15
- },
16
- });
17
- });
18
- });
@@ -1,28 +0,0 @@
1
- import { html } from "@open-wc/testing";
2
- import { runA11yTests } from "../../test/a11y-test-utils";
3
- import "../../index";
4
-
5
- // account for parent with `.is-disabled` class
6
- [true, false].forEach((isDisabled) => {
7
- describe("description", () => {
8
- runA11yTests({
9
- tag: "p",
10
- baseClass: "s-description",
11
- children: {
12
- default: `Describes the site in the product, emails, integrations, and logs.`,
13
- },
14
- options: {
15
- testidSuffix: isDisabled ? "is-disabled" : "",
16
- },
17
- template: ({ component, testid }) => html`
18
- <div
19
- class="${isDisabled ? "is-disabled" : ""}"
20
- data-testid="${testid}"
21
- >
22
- ${component}
23
- </div>
24
- `,
25
- skippedTestids: [/is-disabled/],
26
- });
27
- });
28
- });
@@ -1,28 +0,0 @@
1
- import { html } from "@open-wc/testing";
2
- import { runVisualTests } from "../../test/visual-test-utils";
3
- import "../../index";
4
-
5
- // account for parent with `.is-disabled` class
6
- [true, false].forEach((isDisabled) => {
7
- describe("description", () => {
8
- runVisualTests({
9
- tag: "p",
10
- baseClass: "s-description",
11
- children: {
12
- default: `Describes the site in the product, emails, integrations, and logs.`,
13
- },
14
- options: {
15
- testidSuffix: isDisabled ? "is-disabled" : "",
16
- },
17
- template: ({ component, testid }) => html`
18
- <div
19
- class="bg-black-225 d-inline-flex ai-center jc-center hs1 ws2 p8
20
- ${isDisabled ? "is-disabled" : ""}"
21
- data-testid="${testid}"
22
- >
23
- ${component}
24
- </div>
25
- `,
26
- });
27
- });
28
- });
@@ -1,16 +0,0 @@
1
- import { html } from "@open-wc/testing";
2
- import { SpotEmptyXL } from "@stackoverflow/stacks-icons";
3
- import { runA11yTests } from "../../test/a11y-test-utils";
4
- import "../../index";
5
-
6
- describe("empty-state", () => {
7
- runA11yTests({
8
- baseClass: "s-empty-state",
9
- children: {
10
- default: `${SpotEmptyXL}<p class="mt24"><strong>Hello!</strong> This is a wonderful empty state component.</p>`,
11
- },
12
- template: ({ component, testid }) => html`
13
- <div class="ws3 p16" data-testid="${testid}">${component}</div>
14
- `,
15
- });
16
- });
@@ -1,16 +0,0 @@
1
- import { html } from "@open-wc/testing";
2
- import { SpotEmptyXL } from "@stackoverflow/stacks-icons";
3
- import { runVisualTests } from "../../test/visual-test-utils";
4
- import "../../index";
5
-
6
- describe("empty-state", () => {
7
- runVisualTests({
8
- baseClass: "s-empty-state",
9
- children: {
10
- default: `${SpotEmptyXL}<p class="mt24"><strong>Hello!</strong> This is a wonderful empty state component.</p>`,
11
- },
12
- template: ({ component, testid }) => html`
13
- <div class="ws3 p16" data-testid="${testid}">${component}</div>
14
- `,
15
- });
16
- });
@@ -1,26 +0,0 @@
1
- import { html } from "@open-wc/testing";
2
- import { runA11yTests } from "../../test/a11y-test-utils";
3
- import "../../index";
4
-
5
- describe("expandable", () => {
6
- runA11yTests({
7
- baseClass: "s-expandable",
8
- modifiers: {
9
- global: ["is-expanded"],
10
- },
11
- children: {
12
- default: `
13
- <div class="s-expandable--content">
14
- <p class="mb8">Expandable: Lorem ipsum dolor sit amet, ex iudicabit necessitatibus usu, cetero laboramus concludaturque mel no, facilisis posidonium cu cum. Pro ex senserit dissentiunt, imperdiet intellegam at sed, ex pri dicit eruditi convenire. Est harum movet gubergren ei, errem dictas evertitur ea sit, at mei oratio eligendi. Ad vis legere possit, vis ne ipsum democritum appellantur. Nullam ancillae iudicabit his ad.</p>
15
- </div>
16
- `,
17
- },
18
- template: ({ component, testid }) => html`
19
- <div class="ws2 p8" data-testid="${testid}">
20
- <div><p>Before expandable content</p></div>
21
- ${component}
22
- <div><p>After expandable content</p></div>
23
- </div>
24
- `,
25
- });
26
- });