@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,15 +0,0 @@
1
- import { runA11yTests } from "../../test/a11y-test-utils";
2
- import "../../index";
3
-
4
- describe("award-bling", () => {
5
- runA11yTests({
6
- baseClass: "s-award-bling",
7
- variants: ["gold", "silver", "bronze"],
8
- children: {
9
- default: `100 <div class="v-visible-sr">award</div>`,
10
- },
11
- options: {
12
- includeNullVariant: false,
13
- },
14
- });
15
- });
@@ -1,24 +0,0 @@
1
- import { runVisualTests } from "../../test/visual-test-utils";
2
- import { html } from "@open-wc/testing";
3
- import "../../index";
4
-
5
- describe("anchors", () => {
6
- runVisualTests({
7
- baseClass: "s-award-bling",
8
- variants: ["gold", "silver", "bronze"],
9
- children: {
10
- default: `100 <div class="v-visible-sr">award</div>`,
11
- },
12
- options: {
13
- includeNullVariant: false,
14
- },
15
- template: ({ component, testid }) => html`
16
- <div
17
- class="d-inline-flex ai-center jc-center hs1 ws1 p8"
18
- data-testid="${testid}"
19
- >
20
- ${component}
21
- </div>
22
- `,
23
- });
24
- });
@@ -1,143 +0,0 @@
1
- import { runA11yTests } from "../../test/a11y-test-utils";
2
- import { IconEyeSm } from "@stackoverflow/stacks-icons/icons";
3
- import "../../index";
4
-
5
- const variants = {
6
- blings: ["gold", "silver", "bronze"],
7
- numbers: ["answered", "bounty", "important", "rep", "rep-down", "votes"],
8
- filled: ["danger", "muted"],
9
- states: ["danger", "muted", "info", "new", "warning"],
10
- users: ["admin", "moderator", "staff"],
11
- };
12
-
13
- describe("badge", () => {
14
- // Base badge
15
- runA11yTests({
16
- baseClass: "s-badge",
17
- children: {
18
- default: `base badge`,
19
- },
20
- tag: "span",
21
- });
22
-
23
- // Award badges
24
- variants.blings.map((bling) => {
25
- runA11yTests({
26
- baseClass: "s-badge",
27
- variants: [bling],
28
- children: {
29
- default: `<span class="s-award-bling s-award-bling__${bling}">
30
- with bling
31
- </span>`,
32
- },
33
- options: {
34
- includeNullVariant: false,
35
- },
36
- tag: "span",
37
- });
38
- });
39
-
40
- // Number counts
41
- runA11yTests({
42
- baseClass: "s-badge",
43
- variants: variants.numbers,
44
- children: {
45
- default: "123",
46
- },
47
- options: {
48
- includeNullVariant: false,
49
- },
50
- tag: "span",
51
- });
52
-
53
- // State badges
54
- runA11yTests({
55
- baseClass: "s-badge",
56
- variants: variants.states,
57
- children: {
58
- default: `badge`,
59
- },
60
- tag: "span",
61
- skippedTestids: ["s-badge-dark-new"],
62
- });
63
-
64
- // State badges w/ filled modifier
65
- runA11yTests({
66
- baseClass: "s-badge",
67
- variants: variants.filled,
68
- modifiers: {
69
- primary: ["filled"],
70
- },
71
- children: {
72
- default: `filled badge`,
73
- },
74
- options: {
75
- includeNullModifier: false,
76
- },
77
- tag: "span",
78
- });
79
-
80
- // State badges w/ filled modifier and icon
81
- runA11yTests({
82
- baseClass: "s-badge",
83
- variants: variants.filled,
84
- modifiers: {
85
- primary: ["filled"],
86
- secondary: ["icon"],
87
- },
88
- children: {
89
- default: `${IconEyeSm} icon badge`,
90
- },
91
- options: {
92
- includeNullModifier: false,
93
- },
94
- tag: "span",
95
- });
96
-
97
- // State badges w/ icon
98
- runA11yTests({
99
- baseClass: "s-badge",
100
- variants: variants.states.filter((state) => state !== "new"),
101
- modifiers: {
102
- primary: ["icon"],
103
- },
104
- children: {
105
- default: `${IconEyeSm} icon badge`,
106
- },
107
- options: {
108
- includeNullModifier: false,
109
- },
110
- tag: "span",
111
- });
112
-
113
- // User badges
114
- runA11yTests({
115
- baseClass: "s-badge",
116
- variants: variants.users,
117
- modifiers: {
118
- primary: ["xs", "sm"],
119
- },
120
- children: {
121
- default: "user badge",
122
- },
123
- options: {
124
- includeNullVariant: false,
125
- },
126
- tag: "span",
127
- });
128
-
129
- // Sizes
130
- runA11yTests({
131
- baseClass: "s-badge",
132
- modifiers: {
133
- primary: ["xs", "sm"],
134
- },
135
- children: {
136
- default: "size badge",
137
- },
138
- options: {
139
- includeNullModifier: false,
140
- },
141
- tag: "span",
142
- });
143
- });
@@ -1,165 +0,0 @@
1
- import { runVisualTests } from "../../test/visual-test-utils";
2
- import { IconEyeSm } from "@stackoverflow/stacks-icons/icons";
3
- import "../../index";
4
- import { html } from "@open-wc/testing";
5
-
6
- const variants = {
7
- blings: ["gold", "silver", "bronze"],
8
- numbers: ["answered", "bounty", "important", "rep", "rep-down", "votes"],
9
- filled: ["danger", "muted"],
10
- states: ["danger", "muted", "info", "new", "warning"],
11
- users: ["admin", "moderator", "staff"],
12
- };
13
-
14
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
- const template = ({ component, testid }: any) => html`
16
- <div
17
- class="d-inline-flex ai-center jc-center hs1 ws1 p8"
18
- data-testid="${testid}"
19
- >
20
- ${component}
21
- </div>
22
- `;
23
-
24
- describe("badge", () => {
25
- // Base badge
26
- runVisualTests({
27
- baseClass: "s-badge",
28
- children: {
29
- default: `base badge`,
30
- },
31
- tag: "span",
32
- template,
33
- });
34
-
35
- // Award badges
36
- variants.blings.map((bling) => {
37
- runVisualTests({
38
- baseClass: "s-badge",
39
- variants: [bling],
40
- children: {
41
- default: `<span class="s-award-bling s-award-bling__${bling}">
42
- with bling
43
- </span>`,
44
- },
45
- options: {
46
- includeNullVariant: false,
47
- },
48
- tag: "span",
49
- template,
50
- });
51
- });
52
-
53
- // Number counts
54
- runVisualTests({
55
- baseClass: "s-badge",
56
- variants: variants.numbers,
57
- children: {
58
- default: "123",
59
- },
60
- options: {
61
- includeNullVariant: false,
62
- },
63
- tag: "span",
64
- template,
65
- });
66
-
67
- // State badges
68
- runVisualTests({
69
- baseClass: "s-badge",
70
- variants: variants.states,
71
- children: {
72
- default: `state badge`,
73
- },
74
- tag: "span",
75
- options: {
76
- includeNullVariant: false,
77
- },
78
- template,
79
- });
80
-
81
- // State badges w/ filled modifier
82
- runVisualTests({
83
- baseClass: "s-badge",
84
- variants: variants.filled,
85
- modifiers: {
86
- primary: ["filled"],
87
- },
88
- children: {
89
- default: `filled badge`,
90
- },
91
- options: {
92
- includeNullModifier: false,
93
- },
94
- tag: "span",
95
- template,
96
- });
97
-
98
- // State badges w/ filled modifier and icon
99
- runVisualTests({
100
- baseClass: "s-badge",
101
- variants: variants.filled,
102
- modifiers: {
103
- primary: ["filled"],
104
- secondary: ["icon"],
105
- },
106
- children: {
107
- default: `${IconEyeSm} icon badge`,
108
- },
109
- options: {
110
- includeNullModifier: false,
111
- },
112
- tag: "span",
113
- template,
114
- });
115
-
116
- // State badges w/ icon
117
- runVisualTests({
118
- baseClass: "s-badge",
119
- variants: variants.states.filter((state) => state !== "new"),
120
- modifiers: {
121
- primary: ["icon"],
122
- },
123
- children: {
124
- default: `${IconEyeSm} icon badge`,
125
- },
126
- options: {
127
- includeNullModifier: false,
128
- },
129
- tag: "span",
130
- template,
131
- });
132
-
133
- // User badges
134
- runVisualTests({
135
- baseClass: "s-badge",
136
- variants: variants.users,
137
- modifiers: {
138
- primary: ["xs", "sm"],
139
- },
140
- children: {
141
- default: "user badge",
142
- },
143
- options: {
144
- includeNullVariant: false,
145
- },
146
- tag: "span",
147
- template,
148
- });
149
-
150
- // Sizes
151
- runVisualTests({
152
- baseClass: "s-badge",
153
- modifiers: {
154
- primary: ["xs", "sm"],
155
- },
156
- children: {
157
- default: "size badge",
158
- },
159
- options: {
160
- includeNullModifier: false,
161
- },
162
- tag: "span",
163
- template,
164
- });
165
- });
@@ -1,36 +0,0 @@
1
- import { runA11yTests } from "../../test/a11y-test-utils";
2
- import "../../index";
3
-
4
- const bannerChild = `
5
- <div
6
- class="d-flex flex__center jc-space-between s-banner--container"
7
- role="alertdialog"
8
- aria-labelledby="banner-title"
9
- aria-describedby="banner-description"
10
- >
11
- <div aria-label="banner message">
12
- <h2 id="banner-title">Banner heading</h2>
13
- <p id="banner-description">Banner description</p>
14
- </div>
15
- <div class="ml-auto myn8">
16
- <span class="s-btn s-banner--btn">Close</span>
17
- </div>
18
- </div>
19
- `;
20
-
21
- describe("banner", () => {
22
- runA11yTests({
23
- baseClass: "s-banner",
24
- variants: ["info", "success", "warning", "danger"],
25
- modifiers: {
26
- primary: ["important"],
27
- },
28
- attributes: {
29
- role: "alert",
30
- ariaHidden: "false",
31
- },
32
- children: {
33
- default: bannerChild,
34
- },
35
- });
36
- });
@@ -1,73 +0,0 @@
1
- import { html, fixture, expect } from "@open-wc/testing";
2
- import { screen } from "@testing-library/dom";
3
- import userEvent from "@testing-library/user-event";
4
- import "../../index";
5
- import { showBanner, hideBanner } from "../../controllers";
6
-
7
- const user = userEvent.setup();
8
-
9
- describe("banner", () => {
10
- it("trigger should make banner visible", async () => {
11
- await fixture(html`
12
- <button data-toggle="s-banner" data-target="#test-banner">
13
- Show test banner
14
- </button>
15
- <aside
16
- role="alert"
17
- id="test-banner"
18
- class="s-banner"
19
- aria-labelledby="banner-message"
20
- aria-hidden="true"
21
- data-controller="s-banner"
22
- data-s-banner-target="banner"
23
- data-testid="test-banner"
24
- >
25
- Test banner
26
- </aside>
27
- `);
28
-
29
- const button = screen.getByRole("button");
30
- const banner = screen.getByTestId("test-banner");
31
-
32
- expect(banner).to.have.attribute("aria-hidden", "true");
33
- button.addEventListener("click", () => showBanner(banner));
34
-
35
- await user.click(button);
36
- expect(banner).to.have.attribute("aria-hidden", "false");
37
- });
38
-
39
- it("trigger should hide banner", async () => {
40
- await fixture(html`
41
- <aside
42
- role="alert"
43
- id="test-banner"
44
- class="s-banner"
45
- aria-labelledby="banner-message"
46
- aria-hidden="false"
47
- data-controller="s-banner"
48
- data-s-banner-target="banner"
49
- data-testid="test-banner"
50
- >
51
- Test banner
52
- <button
53
- type="button"
54
- class="s-btn s-banner--btn"
55
- aria-label="Dismiss"
56
- data-toggle="s-banner"
57
- data-target="#test-banner"
58
- >
59
- Close banner
60
- </button>
61
- </aside>
62
- `);
63
-
64
- const button = screen.getByRole("button");
65
- const banner = screen.getByTestId("test-banner");
66
-
67
- expect(banner).to.have.attribute("aria-hidden", "false");
68
- button.addEventListener("click", () => hideBanner(banner));
69
-
70
- await user.click(button);
71
- expect(banner).to.have.attribute("aria-hidden", "true");
72
- });
73
- });
@@ -1,36 +0,0 @@
1
- import { runVisualTests } from "../../test/visual-test-utils";
2
- import "../../index";
3
-
4
- const bannerChild = `
5
- <div
6
- class="d-flex flex__center jc-space-between s-banner--container"
7
- role="alertdialog"
8
- aria-labelledby="banner-title"
9
- aria-describedby="banner-description"
10
- >
11
- <div aria-label="banner message">
12
- <h2 id="banner-title">Banner heading</h2>
13
- <p id="banner-description">Banner description</p>
14
- </div>
15
- <div class="ml-auto myn8">
16
- <span class="s-btn s-banner--btn">Close</span>
17
- </div>
18
- </div>
19
- `;
20
-
21
- describe("banner", () => {
22
- runVisualTests({
23
- baseClass: "s-banner",
24
- variants: ["info", "success", "warning", "danger"],
25
- modifiers: {
26
- primary: ["important"],
27
- },
28
- attributes: {
29
- role: "alert",
30
- ariaHidden: "false",
31
- },
32
- children: {
33
- default: bannerChild,
34
- },
35
- });
36
- });
@@ -1,57 +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 blockLinkTemplate = ({ component, testid }: any) =>
7
- html`<div
8
- class="d-inline-flex ai-center jc-center hs1 ws2 p8"
9
- data-testid="${testid}"
10
- >
11
- ${component}
12
- </div>`;
13
-
14
- describe("block-link", () => {
15
- // Base block link
16
- runA11yTests({
17
- baseClass: "s-block-link",
18
- modifiers: {
19
- global: ["is-selected"],
20
- },
21
- children: {
22
- default: `block link`,
23
- },
24
- template: blockLinkTemplate,
25
- });
26
-
27
- // Base + danger
28
- runA11yTests({
29
- baseClass: "s-block-link",
30
- modifiers: {
31
- primary: ["danger"],
32
- },
33
- children: {
34
- default: `block link`,
35
- },
36
- options: {
37
- includeNullModifier: false,
38
- },
39
- template: blockLinkTemplate,
40
- });
41
-
42
- // All left and rignt variants
43
- runA11yTests({
44
- baseClass: "s-block-link",
45
- variants: ["left is-selected", "right is-selected"],
46
- modifiers: {
47
- primary: ["danger"],
48
- },
49
- children: {
50
- default: `block link`,
51
- },
52
- options: {
53
- includeNullVariant: false,
54
- },
55
- template: blockLinkTemplate,
56
- });
57
- });
@@ -1,57 +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 blockLinkTemplate = ({ component, testid }: any) =>
7
- html`<div
8
- class="d-inline-flex ai-center jc-center hs1 ws2 p8"
9
- data-testid="${testid}"
10
- >
11
- ${component}
12
- </div>`;
13
-
14
- describe("block-link", () => {
15
- // Base block link
16
- runVisualTests({
17
- baseClass: "s-block-link",
18
- modifiers: {
19
- global: ["is-selected"],
20
- },
21
- children: {
22
- default: `block link`,
23
- },
24
- template: blockLinkTemplate,
25
- });
26
-
27
- // Base + danger
28
- runVisualTests({
29
- baseClass: "s-block-link",
30
- modifiers: {
31
- primary: ["danger"],
32
- },
33
- children: {
34
- default: `block link`,
35
- },
36
- options: {
37
- includeNullModifier: false,
38
- },
39
- template: blockLinkTemplate,
40
- });
41
-
42
- // All left and rignt variants
43
- runVisualTests({
44
- baseClass: "s-block-link",
45
- variants: ["left is-selected", "right is-selected"],
46
- modifiers: {
47
- primary: ["danger"],
48
- },
49
- children: {
50
- default: `block link`,
51
- },
52
- options: {
53
- includeNullVariant: false,
54
- },
55
- template: blockLinkTemplate,
56
- });
57
- });
@@ -1,36 +0,0 @@
1
- import { runA11yTests } from "../../test/a11y-test-utils";
2
- import { html } from "@open-wc/testing";
3
- import "../../index";
4
-
5
- describe("breadcrumbs", () => {
6
- runA11yTests({
7
- baseClass: "s-breadcrumbs",
8
- children: {
9
- default: `
10
- <div class="s-breadcrumbs--item">
11
- <a class="s-breadcrumbs--link" href="#">Stacks</a>
12
- <span class="s-breadcrumbs--divider" aria-hidden="true">|</span>
13
- </div>
14
- <div class="s-breadcrumbs--item">
15
- <a class="s-breadcrumbs--link" href="#">Help center</a>
16
- <span class="s-breadcrumbs--divider" aria-hidden="true">|</span>
17
- </div>
18
- <div class="s-breadcrumbs--item">
19
- <a class="s-breadcrumbs--link" href="#">Icons</a>
20
- </div>
21
- `,
22
- },
23
- attributes: {
24
- "aria-label": "Breadcrumb navigation",
25
- },
26
- tag: "nav",
27
- template: ({ component, testid }) => html`
28
- <div
29
- class="d-inline-flex ai-center jc-center hs1 ws2 p8"
30
- data-testid="${testid}"
31
- >
32
- ${component}
33
- </div>
34
- `,
35
- });
36
- });
@@ -1,36 +0,0 @@
1
- import { runVisualTests } from "../../test/visual-test-utils";
2
- import { html } from "@open-wc/testing";
3
- import "../../index";
4
-
5
- describe("breadcrumbs", () => {
6
- runVisualTests({
7
- baseClass: "s-breadcrumbs",
8
- children: {
9
- default: `
10
- <div class="s-breadcrumbs--item">
11
- <a class="s-breadcrumbs--link" href="#">Stacks</a>
12
- <span class="s-breadcrumbs--divider" aria-hidden="true">|</span>
13
- </div>
14
- <div class="s-breadcrumbs--item">
15
- <a class="s-breadcrumbs--link" href="#">Help center</a>
16
- <span class="s-breadcrumbs--divider" aria-hidden="true">|</span>
17
- </div>
18
- <div class="s-breadcrumbs--item">
19
- <a class="s-breadcrumbs--link" href="#">Icons</a>
20
- </div>
21
- `,
22
- },
23
- attributes: {
24
- "aria-label": "Breadcrumb navigation",
25
- },
26
- tag: "nav",
27
- template: ({ component, testid }) => html`
28
- <div
29
- class="d-inline-flex ai-center jc-center hs1 ws2 p8"
30
- data-testid="${testid}"
31
- >
32
- ${component}
33
- </div>
34
- `,
35
- });
36
- });