@stackoverflow/stacks 2.0.0-rc.1 → 2.0.0-rc.3

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 (55) hide show
  1. package/README.md +5 -0
  2. package/dist/css/stacks.css +631 -581
  3. package/dist/css/stacks.min.css +1 -1
  4. package/dist/js/stacks.js +265 -110
  5. package/dist/js/stacks.min.js +1 -1
  6. package/lib/atomic/typography.less +4 -0
  7. package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +1 -1
  8. package/lib/components/activity-indicator/activity-indicator.less +17 -4
  9. package/lib/components/anchor/anchor.visual.test.ts +1 -5
  10. package/lib/components/avatar/avatar.visual.test.ts +1 -4
  11. package/lib/components/badge/badge.a11y.test.ts +2 -2
  12. package/lib/components/badge/badge.less +21 -29
  13. package/lib/components/block-link/block-link.less +5 -4
  14. package/lib/components/button/button.a11y.test.ts +2 -5
  15. package/lib/components/button/button.less +28 -58
  16. package/lib/components/button/button.visual.test.ts +2 -5
  17. package/lib/components/card/card.less +8 -0
  18. package/lib/components/description/description.a11y.test.ts +1 -0
  19. package/lib/components/description/description.less +1 -1
  20. package/lib/components/expandable/expandable.a11y.test.ts +27 -0
  21. package/lib/components/expandable/expandable.visual.test.ts +27 -0
  22. package/lib/components/input-icon/input-icon.less +1 -1
  23. package/lib/components/input-message/input-message.less +4 -3
  24. package/lib/components/input_textarea/input_textarea.less +1 -1
  25. package/lib/components/label/label.less +4 -14
  26. package/lib/components/link-preview/link-preview.a11y.test.ts +48 -0
  27. package/lib/components/link-preview/link-preview.less +13 -4
  28. package/lib/components/link-preview/link-preview.visual.test.ts +52 -0
  29. package/lib/components/notice/notice.a11y.test.ts +17 -0
  30. package/lib/components/notice/notice.less +45 -82
  31. package/lib/components/notice/notice.visual.test.ts +26 -0
  32. package/lib/components/page-title/page-title.less +1 -1
  33. package/lib/components/pagination/pagination.a11y.test.ts +20 -0
  34. package/lib/components/pagination/pagination.less +2 -2
  35. package/lib/components/pagination/pagination.visual.test.ts +26 -0
  36. package/lib/components/post-summary/post-summary.less +7 -7
  37. package/lib/components/progress-bar/progress-bar.less +2 -2
  38. package/lib/components/prose/prose.less +1 -1
  39. package/lib/components/sidebar-widget/sidebar-widget.less +3 -3
  40. package/lib/components/spinner/spinner.a11y.test.ts +15 -0
  41. package/lib/components/spinner/spinner.visual.test.ts +43 -0
  42. package/lib/components/tag/tag.less +23 -23
  43. package/lib/components/toast/toast.a11y.test.ts +30 -0
  44. package/lib/components/toast/toast.visual.test.ts +10 -6
  45. package/lib/components/toggle-switch/toggle-switch.less +2 -5
  46. package/lib/components/uploader/uploader.less +19 -13
  47. package/lib/components/user-card/user-card.less +1 -1
  48. package/lib/exports/color-sets.less +127 -78
  49. package/lib/exports/theme.less +7 -7
  50. package/lib/input-utils.less +1 -1
  51. package/lib/test/axe-apca/README.md +19 -0
  52. package/lib/test/axe-apca/src/axe-apca.test.ts +77 -1
  53. package/lib/test/axe-apca/src/axe-apca.ts +16 -8
  54. package/lib/test/test-utils.ts +7 -3
  55. package/package.json +12 -12
@@ -0,0 +1,52 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ const getChild = (child?: string): string => {
6
+ return `
7
+ <div class="s-link-preview--header">
8
+ <div class="s-link-preview--icon">👋</div>
9
+ <div>
10
+ <a href="#" class="s-link-preview--title">
11
+ Using hooks for a simple fetch request and breaking the rules of hooks, unsure how?
12
+ </a>
13
+ <div class="s-link-preview--details">
14
+ Issue submitted by Ricky Otero on <relative-time datetime="2019-08-12T04:05:22Z" title="Aug 12, 2019, 12:05 AM EDT">Aug 12, 2019</relative-time> • <strong>RESOLVED</strong>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ ${
19
+ child
20
+ ? child
21
+ : `
22
+ <div class="s-link-preview--body">
23
+ <p>I'm trying to create a simple fetch with hooks from an AWS database. At the moment it errors out and the only reason I can see is because it breaks the rules of hooks but I'm not sure how. It's at the top level of this functional component and it's not called inside an event handler.</p>
24
+ <p>The result of this call (an array of user data), needs to be exported as a function and called in another file.</p>
25
+ <p>If anyone can spot something I have missed and can highlighted how I'm breaking the rules of hooks I'd be grateful!</p>
26
+ <p>Thanks!</p>
27
+ </div>
28
+ `
29
+ }
30
+ <div class="s-link-preview--footer">
31
+ <a href="#" class="s-link-preview--url">https://stackoverflow.atlassian.net/projects/SREREQ/queues/custom/1</a>
32
+ <a href="#" class="s-link-preview--misc">Privacy notice</a>
33
+ </div>
34
+ `;
35
+ };
36
+ describe("link preview", () => {
37
+ runComponentTests({
38
+ type: "visual",
39
+ baseClass: "s-link-preview",
40
+ children: {
41
+ default: getChild(),
42
+ code: getChild(`
43
+ <div class="s-link-preview--code">
44
+ <pre class="language-js s-code-block" tabindex="0"><code class="language-js s-code-block"><span class="hljs-meta">'use strict'</span>;</code></pre>
45
+ </div>
46
+ `),
47
+ },
48
+ template: ({ component, testid }) => html`
49
+ <div class="ws8 p8" data-testid="${testid}">${component}</div>
50
+ `,
51
+ });
52
+ });
@@ -0,0 +1,17 @@
1
+ import { runComponentTests } from "../../test/test-utils";
2
+ import "../../index";
3
+
4
+ describe("notice", () => {
5
+ runComponentTests({
6
+ type: "a11y",
7
+ baseClass: "s-notice",
8
+ variants: ["info", "success", "warning", "danger"],
9
+ modifiers: {
10
+ primary: ["important"],
11
+ },
12
+ children: {
13
+ default: `Test notice`,
14
+ },
15
+ tag: "aside"
16
+ });
17
+ });
@@ -1,9 +1,10 @@
1
1
  .construct-notice-component(@baseClass) {
2
- --_no-bc: var(--bc-medium);
3
- --_no-bg: var(--black-150);
4
- --_no-fc: var(--fc-medium);
2
+ --_no-bc: var(--black-225);
3
+ --_no-bg: var(--black-100);
4
+ --_no-fc: var(--black-500);
5
5
  --_no-btn-bg-focus: var(--black-225);
6
6
  --_no-btn-bg-active: var(--black-250);
7
+ --_no-btn-fc: var(--_no-fc);
7
8
 
8
9
  // MODIFIERS
9
10
  &:not(&__important) {
@@ -26,137 +27,99 @@
26
27
  --_no-fc: var(--white);
27
28
  --_no-btn-bg-focus: var(--black-600);
28
29
  --_no-btn-bg-active: var(--black-600);
29
-
30
- .highcontrast-mode({
31
- --_no-bc: var(--_no-bg);
32
- });
30
+ --_no-btn-fc: var(--_no-fc);
31
+ --_no-code-bg: var(--black-300);
33
32
  }
34
33
 
35
34
  // VARIANTS
36
35
  &__danger {
37
36
  --_no-bc: var(--red-300);
38
- --_no-bg: var(--red-200);
39
- --_no-btn-bg-active: var(--red-300);
40
- --_no-btn-bg-focus: var(--red-300);
41
-
42
- &:not(.@{baseClass}__important) {
43
- .highcontrast-mode({
44
- --_no-bg: var(--red-300);
45
- });
46
- }
37
+ --_no-bg: var(--red-100);
38
+ --_no-btn-bg-active: var(--red-200);
39
+ --_no-btn-bg-focus: var(--red-200);
40
+ --_no-btn-fc: var(--red-500);
41
+ --_no-code-bg: var(--red-300);
47
42
 
48
43
  &.@{baseClass}__important {
49
44
  --_no-bc: var(--_no-bg);
50
45
  --_no-bg: var(--red-400);
51
46
  --_no-btn-bg-active: var(--red-500);
52
47
  --_no-btn-bg-focus: var(--red-500);
48
+ --_no-btn-fc: var(--red-100);
53
49
 
54
- .dark-mode({
55
- --_no-bg: var(--red-400);
56
- --_no-fc: var(--black-600);
57
- });
58
-
59
- .highcontrast-dark-mode({
60
- --_no-bg: var(--red-400);
61
- --_no-fc: var(--white);
50
+ .highcontrast-mode({
51
+ --_no-bg: var(--red-500);
62
52
  });
63
53
  }
64
54
  }
65
55
 
66
56
  &__info {
67
57
  --_no-bc: var(--theme-secondary-300);
68
- --_no-bg: var(--theme-secondary-200);
69
- --_no-btn-bg-focus: var(--theme-secondary-300);
70
- --_no-btn-bg-active: var(--theme-secondary-300);
58
+ --_no-bg: var(--theme-secondary-100);
59
+ --_no-btn-bg-focus: var(--theme-secondary-200);
60
+ --_no-btn-bg-active: var(--theme-secondary-200);
61
+ --_no-btn-fc: var(--theme-secondary-500);
71
62
  --_no-code-bg: var(--theme-secondary-300);
72
63
 
73
- &:not(.@{baseClass}__important) {
74
- .highcontrast-mode({
75
- --_no-bg: var(--theme-secondary-300);
76
- });
77
-
78
- .highcontrast-dark-mode({
79
- --_no-bg: var(--theme-secondary-300);
80
- });
81
- }
82
-
83
64
  &.@{baseClass}__important {
84
65
  --_no-bc: var(--_no-bg);
85
66
  --_no-bg: var(--theme-secondary-400);
86
67
  --_no-btn-bg-active: var(--theme-secondary-500);
87
- --_no-btn-bg-focus: var(--theme-secondary-400);
68
+ --_no-btn-bg-focus: var(--theme-secondary-500);
69
+ --_no-btn-fc: var(--theme-secondary-100);
88
70
 
89
- .dark-mode({
90
- --_no-bg: var(--theme-secondary-400);
91
- --_no-fc: var(--black-600);
92
- });
93
-
94
- .highcontrast-dark-mode({
95
- --_no-bg: var(--theme-secondary-400);
96
- --_no-fc: var(--white);
71
+ .highcontrast-mode({
72
+ --_no-bg: var(--theme-secondary-500);
97
73
  });
98
74
  }
99
75
  }
100
76
 
101
77
  &__success {
102
78
  --_no-bc: var(--green-300);
103
- --_no-bg: var(--green-200);
104
- --_no-btn-bg-active: var(--green-300);
105
- --_no-btn-bg-focus: var(--green-300);
106
-
107
- &:not(.@{baseClass}__important) {
108
- .highcontrast-mode({
109
- --_no-bg: var(--green-300);
110
- });
111
- }
79
+ --_no-bg: var(--green-100);
80
+ --_no-btn-bg-active: var(--green-200);
81
+ --_no-btn-bg-focus: var(--green-200);
82
+ --_no-btn-fc: var(--green-500);
83
+ --_no-code-bg: var(--green-300);
112
84
 
113
85
  &.@{baseClass}__important {
114
86
  --_no-bc: var(--_no-bg);
115
87
  --_no-bg: var(--green-400);
116
- --_no-fc: var(--black-600);
117
88
  --_no-btn-bg-active: var(--green-500);
118
- --_no-btn-bg-focus: var(--green-400);
119
-
120
- .dark-mode({
121
- --_no-bg: var(--green-400);
122
- --_no-fc: var(--white);
123
- });
89
+ --_no-btn-bg-focus: var(--green-500);
90
+ --_no-btn-fc: var(--green-100);
124
91
 
125
92
  .highcontrast-mode({
126
- --_no-bg: var(--green-400);
127
- --_no-fc: var(--white);
93
+ --_no-bg: var(--green-500);
128
94
  });
129
95
  }
130
96
  }
131
97
 
132
98
  &__warning {
133
- --_no-bc: var(--yellow-400);
134
- --_no-bg: var(--yellow-200);
135
- --_no-btn-bg-active: var(--yellow-400);
136
- --_no-btn-bg-focus: var(--yellow-300);
99
+ --_no-bc: var(--yellow-300);
100
+ --_no-bg: var(--yellow-100);
101
+ --_no-btn-bg-active: var(--yellow-200);
102
+ --_no-btn-bg-focus: var(--yellow-200);
103
+ --_no-btn-fc: var(--yellow-600);
137
104
  --_no-code-bg: var(--yellow-300);
138
105
 
139
- &:not(.@{baseClass}__important) {
140
- .highcontrast-mode({
141
- --_no-bg: var(--yellow-300);
142
- });
143
- }
144
-
145
106
  &.@{baseClass}__important {
146
107
  --_no-bc: var(--_no-bg);
147
108
  --_no-bg: var(--yellow-400);
148
- --_no-fc: var(--black-600);
149
- --_no-btn-bg-active: var(--yellow-500);
150
- --_no-btn-bg-focus: var(--yellow-400);
109
+ --_no-fc: var(--black);
110
+ --_no-btn-fc: var(--_no-fc);
111
+ --_no-btn-bg-active: var(--yellow-300);
112
+ --_no-btn-bg-focus: var(--yellow-300);
151
113
 
152
114
  .dark-mode({
153
- --_no-bg: var(--yellow-500);
154
- --_no-fc: var(--white);
115
+ --_no-fc: var(--yellow-200);
155
116
  });
156
117
 
157
118
  .highcontrast-mode({
158
119
  --_no-bg: var(--yellow-500);
159
120
  --_no-fc: var(--white);
121
+ --_no-btn-bg-active: transparent;
122
+ --_no-btn-bg-focus: transparent;
160
123
  });
161
124
  }
162
125
  }
@@ -173,15 +136,15 @@
173
136
  }
174
137
 
175
138
  &:active {
176
- background: var(--_no-btn-bg-active);
139
+ background-color: var(--_no-btn-bg-active, inherit) !important;
177
140
  }
178
141
 
179
142
  &:focus,
180
143
  &:hover {
181
- background: var(--_no-btn-bg-focus);
144
+ background-color: var(--_no-btn-bg-focus, inherit) !important;
182
145
  }
183
146
 
184
- color: inherit;
147
+ color: var(--_no-btn-fc, inherit) !important;
185
148
  padding: var(--su8);
186
149
  }
187
150
 
@@ -0,0 +1,26 @@
1
+ import { runComponentTests } from "../../test/test-utils";
2
+ import { html } from "@open-wc/testing";
3
+ import "../../index";
4
+
5
+ describe("notice", () => {
6
+ runComponentTests({
7
+ type: "visual",
8
+ baseClass: "s-notice",
9
+ variants: ["info", "success", "warning", "danger"],
10
+ modifiers: {
11
+ primary: ["important"],
12
+ },
13
+ attributes: {
14
+ ariaHidden: "false",
15
+ },
16
+ children: {
17
+ default: `Test notice`,
18
+ },
19
+ tag: "aside",
20
+ template: ({ component, testid }) => html`
21
+ <div class="d-inline-block p8" data-testid="${testid}">
22
+ ${component}
23
+ </div>
24
+ `,
25
+ });
26
+ });
@@ -31,7 +31,7 @@
31
31
  & &--header {
32
32
  color: var(--fc-dark);
33
33
  font-size: var(--fs-headline1);
34
- font-weight: normal;
34
+ font-weight: bold;
35
35
  line-height: var(--lh-sm);
36
36
  margin: 0;
37
37
  margin-bottom: 0; // TODO: investigate why this exists. I assume it's so margin-bottom isn't overridden, but 🤷‍♂️
@@ -0,0 +1,20 @@
1
+ import { runComponentTests } from "../../test/test-utils";
2
+ import "../../index";
3
+
4
+ describe("pagination", () => {
5
+ runComponentTests({
6
+ type: "a11y",
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
+ });
20
+ });
@@ -1,10 +1,10 @@
1
1
  .s-pagination {
2
2
  & &--item {
3
3
  --_pa-item-bg: transparent;
4
- --_pa-item-bc: var(--bc-medium);
4
+ --_pa-item-bc: var(--bc-darker);
5
5
  --_pa-item-fc: var(--fc-medium);
6
6
  --_pa-item-bg-hover: var(--black-225);
7
- --_pa-item-bc-hover: var(--bc-dark);
7
+ --_pa-item-bc-hover: var(--bc-darker);
8
8
  --_pa-item-fc-hover: var(--fc-dark);
9
9
 
10
10
  // CONTEXTUAL STYLES
@@ -0,0 +1,26 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ describe("pagination", () => {
6
+ runComponentTests({
7
+ type: "visual",
8
+ baseClass: "s-pagination",
9
+ children: {
10
+ default: `
11
+ <a class="s-pagination--item" href="#">Prev</a>
12
+ <a class="s-pagination--item" href="#">1</a>
13
+ <span class="s-pagination--item is-selected" aria-current="page">2</span>
14
+ <a class="s-pagination--item" href="#">3</a>
15
+ <span class="s-pagination--item s-pagination--item__clear">…</span>
16
+ <a class="s-pagination--item" href="#">100</a>
17
+ <a class="s-pagination--item" href="#">Next</a>
18
+ `,
19
+ },
20
+ template: ({ component, testid }) => html`
21
+ <div class="d-inline-block p8" data-testid="${testid}">
22
+ ${component}
23
+ </div>
24
+ `,
25
+ });
26
+ });
@@ -13,11 +13,11 @@
13
13
  --_ps-stats-fd: column;
14
14
  --_ps-stats-w: calc(var(--su96) + var(--su12));
15
15
  // Stats item modifiers
16
- --_ps-has-answers-bc: var(--green-500);
16
+ --_ps-has-answers-bc: var(--green-400);
17
17
  --_ps-has-answers-bg: unset;
18
- --_ps-has-answers-fc: var(--green-500);
19
- --_ps-has-accepted-answers-bc: var(--green-500);
20
- --_ps-has-accepted-answers-bg: var(--green-500);
18
+ --_ps-has-answers-fc: var(--green-400);
19
+ --_ps-has-accepted-answers-bc: var(--green-400);
20
+ --_ps-has-accepted-answers-bg: var(--green-400);
21
21
  --_ps-has-accepted-answers-fc: var(--white);
22
22
  --_ps-stats-item-emphasized-fc: var(--_ps-state-fc, var(--fc-dark));
23
23
 
@@ -380,15 +380,15 @@
380
380
 
381
381
  // Hotness
382
382
  &.is-warm {
383
- color: var(--_ps-state-fc, var(--yellow-600));
383
+ color: var(--_ps-state-fc, var(--yellow-500));
384
384
  }
385
385
 
386
386
  &.is-hot {
387
- color: var(--_ps-state-fc, var(--orange-600));
387
+ color: var(--_ps-state-fc, var(--orange-500));
388
388
  }
389
389
 
390
390
  &.is-supernova {
391
- color: var(--_ps-state-fc, var(--red-600));
391
+ color: var(--_ps-state-fc, var(--red-500));
392
392
  }
393
393
 
394
394
  // Status
@@ -135,7 +135,7 @@
135
135
  }
136
136
  }
137
137
 
138
- background: var(--black-350);
138
+ background: var(--black-250);
139
139
  border-radius: 0;
140
140
  height: var(--su-static6);
141
141
  position: absolute;
@@ -203,7 +203,7 @@
203
203
  });
204
204
 
205
205
  align-items: center;
206
- background: var(--black-350);
206
+ background: var(--black-250);
207
207
  border-radius: 100%;
208
208
  color: var(--_white-static);
209
209
  display: flex;
@@ -18,7 +18,7 @@
18
18
  --_pr-h6-fs: var(--fs-body1);
19
19
  --_pr-hr-bg: var(--black-225); // used for both background-color and color properties
20
20
  --_pr-img-mb: @pr-spacing;
21
- --_pr-kbd-bc: var(--black-350);
21
+ --_pr-kbd-bc: var(--black-300);
22
22
  --_pr-kbd-bs: 0 var(--su-static1) var(--su-static1) hsla(210, 8%, 5%, 0.15), inset 0 1px 0 0 var(--_white-static);
23
23
  --_pr-spoiler-cursor: pointer;
24
24
  --_pr-spoiler-after-t: 1em;
@@ -69,7 +69,7 @@
69
69
  &__expanding-control {
70
70
  &:before {
71
71
  border: calc(var(--su-static4) + var(--su-static1)) solid transparent;
72
- border-left-color: var(--bc-dark);
72
+ border-left-color: var(--black-400);
73
73
  border-right-width: 0;
74
74
  content: '';
75
75
  float: left;
@@ -228,11 +228,11 @@
228
228
  }
229
229
 
230
230
  .s-sidebarwidget--header {
231
- background-color: var(~"--@{name}-300");
231
+ background-color: var(~"--@{name}-200");
232
232
  color: var(--fc-medium);
233
233
  }
234
234
 
235
- background-color: var(~"--@{name}-200");
235
+ background-color: var(~"--@{name}-100");
236
236
  border-color: var(--_sw-bc);
237
237
  }
238
238
  }
@@ -0,0 +1,15 @@
1
+ import { runComponentTests } from "../../test/test-utils";
2
+ import "../../index";
3
+
4
+ describe("spinner", () => {
5
+ runComponentTests({
6
+ type: "a11y",
7
+ baseClass: "s-spinner",
8
+ modifiers: {
9
+ primary: ["xs", "sm", "md", "lg"],
10
+ },
11
+ children: {
12
+ default: `<div class="v-visible-sr">Loading…</div>`,
13
+ },
14
+ });
15
+ });
@@ -0,0 +1,43 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ const template = ({ component, testid }: any) => html`
7
+ <div class="d-inline-block p8" data-testid="${testid}">${component}</div>
8
+ `;
9
+ describe("spinner", () => {
10
+ // default, sizes
11
+ runComponentTests({
12
+ type: "visual",
13
+ baseClass: "s-spinner",
14
+ modifiers: {
15
+ primary: ["xs", "sm", "md", "lg"],
16
+ },
17
+ children: {
18
+ default: `<div class="v-visible-sr">Loading…</div>`,
19
+ },
20
+ template,
21
+ });
22
+ // applied font color
23
+ runComponentTests({
24
+ type: "visual",
25
+ baseClass: "s-spinner",
26
+ modifiers: {
27
+ global: ["fc-theme-primary"],
28
+ },
29
+ children: {
30
+ default: `<div class="v-visible-sr">Loading…</div>`,
31
+ },
32
+ template,
33
+ });
34
+ // .is-loading
35
+ runComponentTests({
36
+ type: "visual",
37
+ baseClass: "is-loading",
38
+ children: {
39
+ default: `Loading…`,
40
+ },
41
+ template,
42
+ });
43
+ });
@@ -99,41 +99,41 @@
99
99
 
100
100
  // moderator overrides other muted and required, required overrides muted
101
101
  &&__moderator {
102
- --_ta-bc: var(--red-300);
103
- --_ta-bg: var(--red-200);
104
- --_ta-fc: var(--red-600);
105
- --_ta-bc-hover: var(--red-400);
106
- --_ta-bg-hover: var(--red-300);
107
- --_ta-fc-hover: var(--red-600);
108
- --_ta-bc-selected: var(--red-400);
109
- --_ta-bg-selected: var(--red-300);
110
- --_ta-fc-selected: var(--red-600);
102
+ --_ta-bc: transparent;
103
+ --_ta-bg: var(--orange-100);
104
+ --_ta-fc: var(--orange-500);
105
+ --_ta-bc-hover: transparent;
106
+ --_ta-bg-hover: var(--orange-200);
107
+ --_ta-fc-hover: var(--orange-600);
108
+ --_ta-bc-selected: transparent;
109
+ --_ta-bg-selected: var(--orange-300);
110
+ --_ta-fc-selected: var(--orange-600); // Currently APCA Lc 49 😔
111
111
  }
112
112
 
113
113
  &&__muted:not(&__moderator):not(&__required) {
114
114
  --_ta-bc: transparent;
115
- --_ta-bg: var(--black-200);
116
- --_ta-fc: var(--black-500);
115
+ --_ta-bg: var(--black-150);
116
+ --_ta-fc: var(--black-400);
117
117
  --_ta-bc-hover: transparent;
118
- --_ta-bg-hover: var(--black-225);
119
- --_ta-fc-hover: var(--black-600);
118
+ --_ta-bg-hover: var(--black-200);
119
+ --_ta-fc-hover: var(--black-500);
120
120
  --_ta-bc-selected: transparent;
121
- --_ta-bg-selected: var(--black-300);
121
+ --_ta-bg-selected: var(--black-225);
122
122
  --_ta-fc-selected: var(--black-600);
123
123
 
124
124
  .highcontrast-mode({ --_ta-bc: currentColor; }); // Specificity has bit us, so we need this override
125
125
  }
126
126
 
127
127
  &&__required:not(&__moderator) {
128
- --_ta-bc: var(--bc-dark);
129
- --_ta-bg: var(--black-200);
130
- --_ta-fc: var(--black-500);
131
- --_ta-bc-hover: var(--black-350);
132
- --_ta-bg-hover: var(--black-225);
133
- --_ta-fc-hover: var(--black-600);
134
- --_ta-bc-selected: var(--black-400);
135
- --_ta-bg-selected: var(--black-300);
136
- --_ta-fc-selected: var(--black-600);
128
+ --_ta-bc: transparent;
129
+ --_ta-bg: var(--theme-secondary-500);
130
+ --_ta-fc: var(--white);
131
+ --_ta-bc-hover: transparent;
132
+ --_ta-bg-hover: var(--theme-secondary-400);
133
+ --_ta-fc-hover: var(--white);
134
+ --_ta-bc-selected: transparent;
135
+ --_ta-bg-selected: var(--theme-secondary-600);
136
+ --_ta-fc-selected: var(--white);
137
137
  }
138
138
  &__watched, // TODO: remove all single `&` watched styles once core no longer requires them
139
139
  &&__watched {
@@ -0,0 +1,30 @@
1
+ import { runComponentTests } from "../../test/test-utils";
2
+ import { html } from "@open-wc/testing";
3
+ import "../../index";
4
+
5
+ describe("toast > notice", () => {
6
+ // This is a test of notice component wrapped in a toast component
7
+ runComponentTests({
8
+ type: "a11y",
9
+ baseClass: "s-notice", // s-toast is a wrapper around s-notice
10
+ variants: ["info", "success", "warning", "danger"],
11
+ modifiers: {
12
+ primary: ["important"],
13
+ },
14
+ children: {
15
+ toast: `<span id="message">Test toast</span>`,
16
+ },
17
+ tag: "aside",
18
+ template: ({ component, testid }) => html`
19
+ <div
20
+ class="s-toast ps-static t0 l0"
21
+ role="alertdialog"
22
+ aria-hidden="false"
23
+ aria-labelledby="message"
24
+ data-testid="${testid}"
25
+ >
26
+ ${component}
27
+ </div>
28
+ `
29
+ });
30
+ });
@@ -11,16 +11,20 @@ describe("toast > notice", () => {
11
11
  modifiers: {
12
12
  primary: ["important"],
13
13
  },
14
- attributes: {
15
- ariaHidden: "false",
16
- },
17
14
  children: {
18
- toast: "Test toast",
15
+ toast: `<span id="message">Test toast</span>`,
19
16
  },
20
17
  tag: "aside",
21
18
  template: ({ component, testid }) => html`
22
- <div data-testid="${testid}" class="s-toast" aria-hidden="false">
23
- ${component}
19
+ <div class="d-inline-block p8" data-testid="${testid}">
20
+ <div
21
+ class="s-toast ps-static t0 l0"
22
+ role="alertdialog"
23
+ aria-hidden="false"
24
+ aria-labelledby="message"
25
+ >
26
+ ${component}
27
+ </div>
24
28
  </div>
25
29
  `,
26
30
  });