@stackoverflow/stacks 2.0.9 → 2.1.0-rc.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 (98) hide show
  1. package/LICENSE.MD +1 -1
  2. package/README.md +7 -9
  3. package/dist/css/stacks.css +193 -206
  4. package/dist/css/stacks.min.css +1 -1
  5. package/dist/js/stacks.js +1 -1
  6. package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +2 -3
  7. package/lib/components/activity-indicator/activity-indicator.visual.test.ts +2 -3
  8. package/lib/components/anchor/anchor.a11y.test.ts +2 -4
  9. package/lib/components/anchor/anchor.visual.test.ts +2 -4
  10. package/lib/components/avatar/avatar.a11y.test.ts +2 -3
  11. package/lib/components/avatar/avatar.visual.test.ts +2 -3
  12. package/lib/components/award-bling/award-bling.a11y.test.ts +2 -4
  13. package/lib/components/award-bling/award-bling.visual.test.ts +2 -4
  14. package/lib/components/badge/badge.a11y.test.ts +7 -16
  15. package/lib/components/badge/badge.visual.test.ts +8 -21
  16. package/lib/components/banner/banner.a11y.test.ts +2 -3
  17. package/lib/components/banner/banner.visual.test.ts +2 -3
  18. package/lib/components/block-link/block-link.a11y.test.ts +4 -9
  19. package/lib/components/block-link/block-link.less +7 -10
  20. package/lib/components/block-link/block-link.visual.test.ts +4 -9
  21. package/lib/components/breadcrumbs/breadcrumbs.a11y.test.ts +2 -3
  22. package/lib/components/breadcrumbs/breadcrumbs.visual.test.ts +2 -3
  23. package/lib/components/button/button.a11y.test.ts +2 -3
  24. package/lib/components/button/button.less +70 -35
  25. package/lib/components/button/button.visual.test.ts +2 -3
  26. package/lib/components/card/card.a11y.test.ts +2 -3
  27. package/lib/components/card/card.visual.test.ts +3 -6
  28. package/lib/components/check-control/check-control.a11y.test.ts +2 -4
  29. package/lib/components/check-control/check-control.visual.test.ts +2 -4
  30. package/lib/components/check-group/check-group.a11y.test.ts +2 -4
  31. package/lib/components/check-group/check-group.visual.test.ts +2 -4
  32. package/lib/components/checkbox_radio/checkbox_radio.a11y.test.ts +2 -4
  33. package/lib/components/checkbox_radio/checkbox_radio.less +1 -13
  34. package/lib/components/checkbox_radio/checkbox_radio.visual.test.ts +2 -4
  35. package/lib/components/code-block/code-block.a11y.test.ts +2 -4
  36. package/lib/components/code-block/code-block.visual.test.ts +2 -4
  37. package/lib/components/description/description.a11y.test.ts +2 -4
  38. package/lib/components/description/description.visual.test.ts +2 -4
  39. package/lib/components/empty-state/empty-state.a11y.test.ts +2 -3
  40. package/lib/components/empty-state/empty-state.visual.test.ts +2 -3
  41. package/lib/components/expandable/expandable.a11y.test.ts +2 -3
  42. package/lib/components/expandable/expandable.visual.test.ts +2 -3
  43. package/lib/components/input-fill/input-fill.a11y.test.ts +2 -3
  44. package/lib/components/input-fill/input-fill.visual.test.ts +2 -3
  45. package/lib/components/input-message/input-message.a11y.test.ts +2 -3
  46. package/lib/components/input-message/input-message.visual.test.ts +2 -3
  47. package/lib/components/input_textarea/input_textarea.a11y.test.ts +4 -7
  48. package/lib/components/input_textarea/input_textarea.less +2 -20
  49. package/lib/components/input_textarea/input_textarea.visual.test.ts +4 -7
  50. package/lib/components/label/label.a11y.test.ts +2 -3
  51. package/lib/components/label/label.visual.test.ts +2 -3
  52. package/lib/components/link/link.a11y.test.ts +2 -3
  53. package/lib/components/link/link.visual.test.ts +2 -3
  54. package/lib/components/link-preview/link-preview.a11y.test.ts +2 -3
  55. package/lib/components/link-preview/link-preview.visual.test.ts +3 -3
  56. package/lib/components/menu/menu.a11y.test.ts +2 -3
  57. package/lib/components/menu/menu.visual.test.ts +2 -3
  58. package/lib/components/modal/modal.a11y.test.ts +2 -3
  59. package/lib/components/modal/modal.visual.test.ts +2 -3
  60. package/lib/components/navigation/navigation.a11y.test.ts +2 -3
  61. package/lib/components/navigation/navigation.less +3 -1
  62. package/lib/components/navigation/navigation.visual.test.ts +3 -6
  63. package/lib/components/notice/notice.a11y.test.ts +2 -3
  64. package/lib/components/notice/notice.visual.test.ts +2 -3
  65. package/lib/components/page-title/page-title.a11y.test.ts +2 -3
  66. package/lib/components/page-title/page-title.visual.test.ts +2 -3
  67. package/lib/components/pagination/pagination.a11y.test.ts +2 -3
  68. package/lib/components/pagination/pagination.less +9 -0
  69. package/lib/components/pagination/pagination.visual.test.ts +2 -3
  70. package/lib/components/progress-bar/progress-bar.a11y.test.ts +7 -18
  71. package/lib/components/progress-bar/progress-bar.visual.test.ts +7 -18
  72. package/lib/components/select/select.less +1 -15
  73. package/lib/components/spinner/spinner.a11y.test.ts +2 -3
  74. package/lib/components/spinner/spinner.visual.test.ts +4 -7
  75. package/lib/components/table/table.a11y.test.ts +3 -4
  76. package/lib/components/table/table.visual.test.ts +2 -3
  77. package/lib/components/tag/tag.a11y.test.ts +2 -3
  78. package/lib/components/tag/tag.less +27 -21
  79. package/lib/components/tag/tag.visual.test.ts +3 -6
  80. package/lib/components/toast/toast.a11y.test.ts +2 -3
  81. package/lib/components/toast/toast.visual.test.ts +2 -3
  82. package/lib/components/toggle-switch/toggle-switch.a11y.test.ts +3 -6
  83. package/lib/components/toggle-switch/toggle-switch.less +5 -16
  84. package/lib/components/toggle-switch/toggle-switch.visual.test.ts +3 -7
  85. package/lib/components/topbar/topbar.less +61 -39
  86. package/lib/components/topbar/topbar.visual.test.ts +188 -0
  87. package/lib/components/uploader/uploader.less +1 -1
  88. package/lib/exports/__snapshots__/color-mixins.less.test.ts.snap +2 -0
  89. package/lib/exports/__snapshots__/color.less.test.ts.snap +12 -0
  90. package/lib/exports/color-sets.less +17 -7
  91. package/lib/exports/mixins.less +33 -0
  92. package/lib/input-utils.less +0 -3
  93. package/lib/test/a11y-test-utils.ts +94 -0
  94. package/lib/test/assertions.ts +10 -3
  95. package/lib/test/test-utils.ts +152 -300
  96. package/lib/test/visual-test-utils.ts +58 -0
  97. package/package.json +7 -8
  98. package/lib/components/popover/tooltip.visual.test.ts +0 -31
@@ -3,7 +3,7 @@ import {
3
3
  IconAchievementsSm,
4
4
  IconCheckmarkSm,
5
5
  } from "@stackoverflow/stacks-icons/icons";
6
- import { defaultOptions, runComponentTests } from "../../test/test-utils";
6
+ import { runVisualTests } from "../../test/visual-test-utils";
7
7
  import "../../index";
8
8
 
9
9
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -97,8 +97,7 @@ const getChildren = (type: string) => {
97
97
  };
98
98
  describe("progress-bar", () => {
99
99
  // Base
100
- runComponentTests({
101
- type: "visual",
100
+ runVisualTests({
102
101
  baseClass: "s-progress",
103
102
  variants: ["brand", "info"],
104
103
  children: {
@@ -108,8 +107,7 @@ describe("progress-bar", () => {
108
107
  });
109
108
 
110
109
  // Badge
111
- runComponentTests({
112
- type: "visual",
110
+ runVisualTests({
113
111
  baseClass: "s-progress",
114
112
  variants: ["badge"],
115
113
  modifiers: {
@@ -120,15 +118,13 @@ describe("progress-bar", () => {
120
118
  },
121
119
  template,
122
120
  options: {
123
- ...defaultOptions,
124
121
  includeNullVariant: false,
125
122
  includeNullModifier: false,
126
123
  },
127
124
  });
128
125
 
129
126
  // Circular
130
- runComponentTests({
131
- type: "visual",
127
+ runVisualTests({
132
128
  baseClass: "s-progress",
133
129
  variants: ["circular"],
134
130
  modifiers: {
@@ -142,15 +138,13 @@ describe("progress-bar", () => {
142
138
  style: "--s-progress-value: .75",
143
139
  },
144
140
  options: {
145
- ...defaultOptions,
146
141
  includeNullVariant: false,
147
142
  includeNullModifier: false,
148
143
  },
149
144
  });
150
145
 
151
146
  // Privilege
152
- runComponentTests({
153
- type: "visual",
147
+ runVisualTests({
154
148
  baseClass: "s-progress",
155
149
  variants: ["privilege"],
156
150
  children: {
@@ -158,14 +152,12 @@ describe("progress-bar", () => {
158
152
  },
159
153
  template,
160
154
  options: {
161
- ...defaultOptions,
162
155
  includeNullVariant: false,
163
156
  },
164
157
  });
165
158
 
166
159
  // Segmented
167
- runComponentTests({
168
- type: "visual",
160
+ runVisualTests({
169
161
  baseClass: "s-progress",
170
162
  variants: ["segmented"],
171
163
  children: {
@@ -173,14 +165,12 @@ describe("progress-bar", () => {
173
165
  },
174
166
  template,
175
167
  options: {
176
- ...defaultOptions,
177
168
  includeNullVariant: false,
178
169
  },
179
170
  });
180
171
 
181
172
  // Stepped
182
- runComponentTests({
183
- type: "visual",
173
+ runVisualTests({
184
174
  baseClass: "s-progress",
185
175
  variants: ["stepped"],
186
176
  children: {
@@ -192,7 +182,6 @@ describe("progress-bar", () => {
192
182
  </div>
193
183
  `,
194
184
  options: {
195
- ...defaultOptions,
196
185
  includeNullVariant: false,
197
186
  },
198
187
  });
@@ -2,8 +2,6 @@
2
2
  --_se-arrow-bc: currentColor transparent;
3
3
  --_se-arrow-size: var(--su-static4); // Constant
4
4
  --_se-select-bc: var(--bc-darker);
5
- --_se-select-bc-focus: var(--theme-secondary-400);
6
- --_se-select-bs-focus: 0 0 0 var(--su-static4) var(--focus-ring);
7
5
  --_se-select-bg: var(--white);
8
6
  --_se-select-br: var(--br-md);
9
7
  --_se-select-fc: var(--black);
@@ -100,22 +98,10 @@
100
98
  cursor: not-allowed;
101
99
  }
102
100
 
103
- // CHILD ELEMENTS
104
- &::-moz-focus-inner {
105
- outline: none !important;
106
- }
107
-
108
101
  // INTERACTION
109
102
  &:focus {
110
- .highcontrast-mode({
111
- --_se-select-bc-focus: var(--black);
112
- });
113
-
114
- border-color: var(--_se-select-bc-focus);
115
- box-shadow: var(--_se-select-bs-focus);
116
-
117
103
  color: var(--black);
118
- outline: 0;
104
+ .focus-styles();
119
105
  }
120
106
 
121
107
  background-color: var(--_se-select-bg);
@@ -1,9 +1,8 @@
1
- import { runComponentTests } from "../../test/test-utils";
1
+ import { runA11yTests } from "../../test/a11y-test-utils";
2
2
  import "../../index";
3
3
 
4
4
  describe("spinner", () => {
5
- runComponentTests({
6
- type: "a11y",
5
+ runA11yTests({
7
6
  baseClass: "s-spinner",
8
7
  modifiers: {
9
8
  primary: ["xs", "sm", "md", "lg"],
@@ -1,5 +1,5 @@
1
1
  import { html } from "@open-wc/testing";
2
- import { runComponentTests } from "../../test/test-utils";
2
+ import { runVisualTests } from "../../test/visual-test-utils";
3
3
  import "../../index";
4
4
 
5
5
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -8,8 +8,7 @@ const template = ({ component, testid }: any) => html`
8
8
  `;
9
9
  describe("spinner", () => {
10
10
  // default, sizes
11
- runComponentTests({
12
- type: "visual",
11
+ runVisualTests({
13
12
  baseClass: "s-spinner",
14
13
  modifiers: {
15
14
  primary: ["xs", "sm", "md", "lg"],
@@ -20,8 +19,7 @@ describe("spinner", () => {
20
19
  template,
21
20
  });
22
21
  // applied font color
23
- runComponentTests({
24
- type: "visual",
22
+ runVisualTests({
25
23
  baseClass: "s-spinner",
26
24
  modifiers: {
27
25
  global: ["fc-theme-primary"],
@@ -32,8 +30,7 @@ describe("spinner", () => {
32
30
  template,
33
31
  });
34
32
  // .is-loading
35
- runComponentTests({
36
- type: "visual",
33
+ runVisualTests({
37
34
  baseClass: "is-loading",
38
35
  children: {
39
36
  default: `Loading…`,
@@ -1,5 +1,5 @@
1
1
  import { html } from "@open-wc/testing";
2
- import { runComponentTests } from "../../test/test-utils";
2
+ import { runA11yTests } from "../../test/a11y-test-utils";
3
3
  import "../../index";
4
4
 
5
5
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -76,7 +76,7 @@ const children = {
76
76
  </tbody>
77
77
  <tfoot class="s-table--totals">
78
78
  <tr>
79
- <td scope="row"><span class="v-visible-sr">Empty</span></td>
79
+ <td><span class="v-visible-sr">Empty</span></td>
80
80
  <th scope="row" class="ta-left">Totals</th>
81
81
  <td><span class="v-visible-sr">Empty</span></td>
82
82
  <td colspan="2">160</td>
@@ -88,8 +88,7 @@ const children = {
88
88
 
89
89
  describe("table", () => {
90
90
  // default, sizes
91
- runComponentTests({
92
- type: "a11y",
91
+ runA11yTests({
93
92
  baseClass: "s-table",
94
93
  variants: ["stripes"],
95
94
  modifiers: {
@@ -1,5 +1,5 @@
1
1
  import { html } from "@open-wc/testing";
2
- import { runComponentTests } from "../../test/test-utils";
2
+ import { runVisualTests } from "../../test/visual-test-utils";
3
3
  import "../../index";
4
4
 
5
5
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -89,8 +89,7 @@ const children = {
89
89
 
90
90
  describe("table", () => {
91
91
  // default, sizes
92
- runComponentTests({
93
- type: "visual",
92
+ runVisualTests({
94
93
  baseClass: "s-table",
95
94
  variants: ["stripes"],
96
95
  modifiers: {
@@ -1,5 +1,5 @@
1
1
  import { IconClearSm } from "@stackoverflow/stacks-icons";
2
- import { runComponentTests } from "../../test/test-utils";
2
+ import { runA11yTests } from "../../test/a11y-test-utils";
3
3
  import "../../index";
4
4
 
5
5
  const children = {
@@ -9,8 +9,7 @@ const children = {
9
9
  };
10
10
 
11
11
  describe("tag", () => {
12
- runComponentTests({
13
- type: "a11y",
12
+ runA11yTests({
14
13
  baseClass: "s-tag",
15
14
  variants: ["ignored", "watched", "moderator", "muted", "required"],
16
15
  modifiers: {
@@ -1,8 +1,8 @@
1
1
  .s-tag {
2
- // Border color
3
- --_ta-bc: var(--theme-tag-border-color, transparent);
4
- --_ta-bc-hover: var(--theme-tag-hover-border-color, transparent);
5
- --_ta-bc-selected: var(--theme-tag-selected-border-color, transparent);
2
+ // Border color (bg color used as fallback
3
+ --_ta-bc: var(--theme-tag-border-color, var(--_ta-bg));
4
+ --_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
6
  // Background color
7
7
  --_ta-bg: var(--theme-tag-background-color, var(--theme-secondary-100));
8
8
  --_ta-bg-hover: var(--theme-tag-hover-background-color, var(--theme-secondary-200));
@@ -18,6 +18,7 @@
18
18
  --_ta-pl: var(--_ta-px);
19
19
  --_ta-pr: var(--_ta-px);
20
20
  --_ta-px: var(--su4);
21
+ --_ta-dismiss-padding: calc(var(--_ta-px) - var(--su-static1));
21
22
 
22
23
  // CONTEXTUAL STYLES
23
24
  .highcontrast-mode({
@@ -32,10 +33,8 @@
32
33
  &,
33
34
  a&,
34
35
  a&:active,
35
- a&:hover,
36
- a&:focus {
36
+ a&:hover {
37
37
  .highcontrast-mode({
38
- --_ta-bc-selected: transparent;
39
38
  --_ta-fc-selected: var(--white);
40
39
  });
41
40
 
@@ -121,13 +120,10 @@
121
120
  }
122
121
 
123
122
  &&__muted:not(&__moderator):not(&__required) {
124
- --_ta-bc: transparent;
125
123
  --_ta-bg: var(--black-150);
126
124
  --_ta-fc: var(--black-400);
127
- --_ta-bc-hover: transparent;
128
125
  --_ta-bg-hover: var(--black-200);
129
126
  --_ta-fc-hover: var(--black-500);
130
- --_ta-bc-selected: transparent;
131
127
  --_ta-bg-selected: var(--black-225);
132
128
  --_ta-fc-selected: var(--black-600);
133
129
 
@@ -137,9 +133,9 @@
137
133
  &&__required:not(&__moderator) {
138
134
  // TODO *eventually* remove the custom theme overrides once we can reconcile Meta theming needs
139
135
  // Border color
140
- --_ta-bc: var(--theme-tag-required-border-color, transparent);
141
- --_ta-bc-hover: var(--theme-tag-required-hover-border-color, transparent);
142
- --_ta-bc-selected: var(--theme-tag-required-selected-border-color, transparent);
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));
143
139
  // Background color
144
140
  --_ta-bg: var(--theme-tag-required-background-color, var(--theme-secondary-500));
145
141
  --_ta-bg-hover: var(--theme-tag-required-hover-background-color, var(--theme-secondary-400));
@@ -155,7 +151,16 @@
155
151
  }
156
152
 
157
153
  // CHILD ELEMENTS
158
- & &--dismiss { // Style adjustment to @Svg.ClearSm
154
+ & button&--dismiss:not(.s-btn) {
155
+ all: unset;
156
+ }
157
+
158
+ & &--dismiss,
159
+ & button&--dismiss:not(.s-btn) { // Style adjustment to @Svg.ClearSm
160
+ &:focus-visible {
161
+ .focus-styles();
162
+ }
163
+
159
164
  &:hover {
160
165
  .highcontrast-mode({
161
166
  color: var(--white);
@@ -165,18 +170,16 @@
165
170
  color: var(--_ta-bg);
166
171
  }
167
172
 
168
- align-content: center;
169
- align-self: center;
173
+ align-items: center;
174
+ align-self: stretch;
170
175
  background-color: transparent;
171
176
  border-radius: var(--br-sm);
172
177
  color: inherit;
173
178
  cursor: pointer;
174
179
  display: flex;
175
- height: var(--su-static16);
176
180
  justify-content: center;
177
- margin-left: var(--su4);
178
- padding: var(--su1);
179
- width: var(--su-static16);
181
+ margin: var(--su-static1) calc(var(--_ta-dismiss-padding) * -1) var(--su-static1) var(--_ta-dismiss-padding);
182
+ padding: var(--_ta-dismiss-padding);
180
183
  }
181
184
 
182
185
  & &--sponsor { // The small sponsor favicon displayed within a tag
@@ -196,7 +199,6 @@
196
199
  // INTERACTION
197
200
  a&:not(.is-selected) {
198
201
  &:hover,
199
- &:focus,
200
202
  &:active {
201
203
  .highcontrast-mode({
202
204
  border-color: currentColor;
@@ -208,6 +210,10 @@
208
210
  }
209
211
  }
210
212
 
213
+ &:focus-visible {
214
+ .focus-styles(false, true);
215
+ }
216
+
211
217
  background-color: var(--_ta-bg);
212
218
  border: var(--su-static1) solid var(--_ta-bc);
213
219
  border-radius: var(--_ta-br);
@@ -1,6 +1,6 @@
1
1
  import { html } from "@open-wc/testing";
2
2
  import { IconClearSm } from "@stackoverflow/stacks-icons";
3
- import { defaultOptions, runComponentTests } from "../../test/test-utils";
3
+ import { runVisualTests } from "../../test/visual-test-utils";
4
4
  import "../../index";
5
5
 
6
6
  const children = {
@@ -15,8 +15,7 @@ const template = ({ component, testid }: any) => html`
15
15
  `;
16
16
 
17
17
  describe("tag", () => {
18
- runComponentTests({
19
- type: "visual",
18
+ runVisualTests({
20
19
  baseClass: "s-tag",
21
20
  variants: ["ignored", "watched", "moderator", "muted", "required"],
22
21
  modifiers: {
@@ -27,8 +26,7 @@ describe("tag", () => {
27
26
  });
28
27
 
29
28
  // Size modifiers
30
- runComponentTests({
31
- type: "visual",
29
+ runVisualTests({
32
30
  baseClass: "s-tag",
33
31
  modifiers: {
34
32
  primary: ["xs", "sm", "md", "lg"],
@@ -39,7 +37,6 @@ describe("tag", () => {
39
37
  },
40
38
  template,
41
39
  options: {
42
- ...defaultOptions,
43
40
  includeNullModifier: false,
44
41
  },
45
42
  });
@@ -1,11 +1,10 @@
1
- import { runComponentTests } from "../../test/test-utils";
1
+ import { runA11yTests } from "../../test/a11y-test-utils";
2
2
  import { html } from "@open-wc/testing";
3
3
  import "../../index";
4
4
 
5
5
  describe("toast > notice", () => {
6
6
  // This is a test of notice component wrapped in a toast component
7
- runComponentTests({
8
- type: "a11y",
7
+ runA11yTests({
9
8
  baseClass: "s-notice", // s-toast is a wrapper around s-notice
10
9
  variants: ["info", "success", "warning", "danger"],
11
10
  modifiers: {
@@ -1,11 +1,10 @@
1
- import { runComponentTests } from "../../test/test-utils";
1
+ import { runVisualTests } from "../../test/visual-test-utils";
2
2
  import { html } from "@open-wc/testing";
3
3
  import "../../index";
4
4
 
5
5
  describe("toast > notice", () => {
6
6
  // This is a test of notice component wrapped in a toast component
7
- runComponentTests({
8
- type: "visual",
7
+ runVisualTests({
9
8
  baseClass: "s-notice", // s-toast is a wrapper around s-notice
10
9
  variants: ["info", "success", "warning", "danger"],
11
10
  modifiers: {
@@ -1,5 +1,5 @@
1
1
  import { html } from "@open-wc/testing";
2
- import { defaultOptions, runComponentTests } from "../../test/test-utils";
2
+ import { runA11yTests } from "../../test/a11y-test-utils";
3
3
  import "../../index";
4
4
 
5
5
  describe("toggle-switch", () => {
@@ -11,8 +11,7 @@ describe("toggle-switch", () => {
11
11
  }`;
12
12
  const id = `toggle-switch${idSuffix}`;
13
13
 
14
- runComponentTests({
15
- type: "a11y",
14
+ runA11yTests({
16
15
  baseClass: "s-toggle-switch",
17
16
  modifiers: {
18
17
  global: idSuffix ? [idSuffix.substring(1)] : [], // for proper testid generation
@@ -36,8 +35,7 @@ describe("toggle-switch", () => {
36
35
 
37
36
  // Multiple toggle switch variant
38
37
  [true, false].forEach((offChecked) => {
39
- runComponentTests({
40
- type: "a11y",
38
+ runA11yTests({
41
39
  baseClass: "s-toggle-switch",
42
40
  variants: ["multiple"],
43
41
  modifiers: {
@@ -58,7 +56,6 @@ describe("toggle-switch", () => {
58
56
  `,
59
57
  },
60
58
  options: {
61
- ...defaultOptions,
62
59
  includeNullVariant: false,
63
60
  },
64
61
  template: ({ component, testid }) => html`
@@ -4,7 +4,6 @@
4
4
  --_ts-bg: var(--black-350);
5
5
  --_ts-bg-image: url("data:image/svg+xml;,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='@{ts-bg-image-fill}'/%3e%3c/svg%3e");
6
6
  --_ts-bg-ps: left center;
7
- --_ts-bs-color: transparent;
8
7
  --_ts-multiple-bg: unset;
9
8
  --_ts-multiple-fc: var(--black-400);
10
9
 
@@ -36,13 +35,10 @@
36
35
  }
37
36
  }
38
37
 
39
- &:focus + label {
40
- --_ts-bs-color: var(--focus-ring-success);
38
+ }
41
39
 
42
- &.s-toggle-switch--label-off {
43
- --_ts-bs-color: var(--focus-ring-muted);
44
- }
45
- }
40
+ &:focus-visible + label {
41
+ .focus-styles(true);
46
42
  }
47
43
 
48
44
  left: -999em;
@@ -53,7 +49,6 @@
53
49
 
54
50
  label {
55
51
  background-color: var(--_ts-multiple-bg);
56
- box-shadow: 0 0 0 var(--su-static4) var(--_ts-bs-color);
57
52
  color: var(--_ts-multiple-fc);
58
53
 
59
54
  border-radius: 1000px;
@@ -80,15 +75,10 @@
80
75
  &:checked {
81
76
  --_ts-bg: var(--green-400);
82
77
  --_ts-bg-ps: right center;
83
-
84
- &:focus {
85
- --_ts-bs-color: var(--focus-ring-success);
86
- }
87
78
  }
88
79
 
89
- &:focus {
90
- --_ts-bs-color: var(--focus-ring-muted);
91
- outline: none;
80
+ &:focus-visible {
81
+ .focus-styles();
92
82
  }
93
83
 
94
84
  &[disabled] {
@@ -97,7 +87,6 @@
97
87
 
98
88
  background-color: var(--_ts-bg);
99
89
  background-position: var(--_ts-bg-ps);
100
- box-shadow: 0 0 0 var(--su-static4) var(--_ts-bs-color);
101
90
 
102
91
  appearance: none;
103
92
  background-image: var(--_ts-bg-image);
@@ -1,5 +1,5 @@
1
1
  import { html } from "@open-wc/testing";
2
- import { defaultOptions, runComponentTests } from "../../test/test-utils";
2
+ import { runVisualTests } from "../../test/visual-test-utils";
3
3
  import "../../index";
4
4
 
5
5
  describe("toggle-switch", () => {
@@ -11,8 +11,7 @@ describe("toggle-switch", () => {
11
11
  }`;
12
12
  const id = `toggle-switch-${testidSuffix}`;
13
13
 
14
- runComponentTests({
15
- type: "visual",
14
+ runVisualTests({
16
15
  baseClass: "s-toggle-switch",
17
16
  tag: "input",
18
17
  attributes: {
@@ -22,7 +21,6 @@ describe("toggle-switch", () => {
22
21
  ...(disabled ? { disabled: "" } : {}),
23
22
  },
24
23
  options: {
25
- ...defaultOptions,
26
24
  includeNullModifier: false,
27
25
  testidSuffix,
28
26
  },
@@ -38,8 +36,7 @@ describe("toggle-switch", () => {
38
36
 
39
37
  // Multiple toggle switch variant
40
38
  [true, false].forEach((offChecked) => {
41
- runComponentTests({
42
- type: "visual",
39
+ runVisualTests({
43
40
  baseClass: "s-toggle-switch",
44
41
  variants: ["multiple"],
45
42
  children: {
@@ -59,7 +56,6 @@ describe("toggle-switch", () => {
59
56
  `,
60
57
  },
61
58
  options: {
62
- ...defaultOptions,
63
59
  includeNullModifier: false,
64
60
  includeNullVariant: false,
65
61
  testidSuffix: offChecked ? "unchecked" : "checked",