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

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 (78) hide show
  1. package/README.md +5 -0
  2. package/dist/components/code-block/code-block.fixtures.d.ts +2 -0
  3. package/dist/css/stacks.css +792 -765
  4. package/dist/css/stacks.min.css +1 -1
  5. package/dist/js/stacks.js +265 -110
  6. package/dist/js/stacks.min.js +1 -1
  7. package/lib/atomic/__snapshots__/color.less.test.ts.snap +246 -0
  8. package/lib/atomic/typography.less +4 -0
  9. package/lib/base/body.less +2 -2
  10. package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +1 -1
  11. package/lib/components/activity-indicator/activity-indicator.less +17 -4
  12. package/lib/components/anchor/anchor.less +10 -6
  13. package/lib/components/anchor/anchor.visual.test.ts +0 -4
  14. package/lib/components/avatar/avatar.visual.test.ts +0 -3
  15. package/lib/components/badge/badge.a11y.test.ts +2 -2
  16. package/lib/components/badge/badge.less +21 -29
  17. package/lib/components/banner/banner.less +2 -2
  18. package/lib/components/block-link/block-link.less +5 -4
  19. package/lib/components/button/button.a11y.test.ts +1 -4
  20. package/lib/components/button/button.less +48 -78
  21. package/lib/components/button/button.visual.test.ts +1 -4
  22. package/lib/components/card/card.less +8 -0
  23. package/lib/components/code-block/code-block.a11y.test.ts +30 -0
  24. package/lib/components/code-block/code-block.fixtures.ts +88 -0
  25. package/lib/components/code-block/code-block.visual.test.ts +20 -0
  26. package/lib/components/description/description.a11y.test.ts +1 -0
  27. package/lib/components/description/description.less +1 -1
  28. package/lib/components/expandable/expandable.a11y.test.ts +27 -0
  29. package/lib/components/expandable/expandable.visual.test.ts +27 -0
  30. package/lib/components/input-icon/input-icon.less +1 -1
  31. package/lib/components/input-message/input-message.less +4 -3
  32. package/lib/components/input_textarea/input_textarea.less +1 -1
  33. package/lib/components/label/label.less +4 -14
  34. package/lib/components/link/link.less +12 -12
  35. package/lib/components/link-preview/link-preview.a11y.test.ts +48 -0
  36. package/lib/components/link-preview/link-preview.less +16 -7
  37. package/lib/components/link-preview/link-preview.visual.test.ts +52 -0
  38. package/lib/components/navigation/navigation.a11y.test.ts +80 -0
  39. package/lib/components/navigation/navigation.visual.test.ts +101 -0
  40. package/lib/components/notice/notice.a11y.test.ts +17 -0
  41. package/lib/components/notice/notice.less +45 -82
  42. package/lib/components/notice/notice.visual.test.ts +26 -0
  43. package/lib/components/page-title/page-title.a11y.test.ts +29 -0
  44. package/lib/components/page-title/page-title.less +1 -1
  45. package/lib/components/page-title/page-title.visual.test.ts +59 -0
  46. package/lib/components/pagination/pagination.a11y.test.ts +20 -0
  47. package/lib/components/pagination/pagination.less +2 -2
  48. package/lib/components/pagination/pagination.visual.test.ts +26 -0
  49. package/lib/components/post-summary/post-summary.less +15 -15
  50. package/lib/components/progress-bar/progress-bar.less +2 -2
  51. package/lib/components/prose/prose.less +2 -2
  52. package/lib/components/select/select.less +1 -1
  53. package/lib/components/sidebar-widget/sidebar-widget.less +3 -3
  54. package/lib/components/spinner/spinner.a11y.test.ts +15 -0
  55. package/lib/components/spinner/spinner.visual.test.ts +43 -0
  56. package/lib/components/tag/tag.a11y.test.ts +23 -0
  57. package/lib/components/tag/tag.less +29 -29
  58. package/lib/components/tag/tag.visual.test.ts +46 -0
  59. package/lib/components/toast/toast.a11y.test.ts +30 -0
  60. package/lib/components/toast/toast.visual.test.ts +10 -6
  61. package/lib/components/toggle-switch/toggle-switch.less +2 -5
  62. package/lib/components/topbar/topbar.less +44 -44
  63. package/lib/components/uploader/uploader.less +19 -13
  64. package/lib/components/user-card/user-card.less +1 -1
  65. package/lib/exports/__snapshots__/color-mixins.less.test.ts.snap +17 -10
  66. package/lib/exports/__snapshots__/color.less.test.ts.snap +197 -185
  67. package/lib/exports/color-mixins.less +1 -1
  68. package/lib/exports/color-sets.less +130 -81
  69. package/lib/exports/color.less +14 -6
  70. package/lib/exports/v1/__snapshots__/constants-colors.less.test.ts.snap +3 -3
  71. package/lib/exports/v1/constants-colors.less +2 -2
  72. package/lib/input-utils.less +1 -1
  73. package/lib/test/axe-apca/README.md +19 -0
  74. package/lib/test/axe-apca/src/axe-apca.test.ts +77 -1
  75. package/lib/test/axe-apca/src/axe-apca.ts +16 -8
  76. package/lib/test/test-utils.ts +7 -3
  77. package/package.json +14 -14
  78. package/lib/exports/theme.less +0 -85
@@ -1,6 +1,9 @@
1
1
  .s-link-preview {
2
+ --_lp-details-fc: var(--black-400);
2
3
  --_lp-details-mt: var(--su2);
4
+ --_lp-footer-bg: var(--black-100);
3
5
  --_lp-footer-fd: unset;
6
+ --_lp-header-bg: var(--black-100);
4
7
  --_lp-misc-pl: var(--su4);
5
8
  --_lp-misc-pt: unset;
6
9
 
@@ -12,6 +15,12 @@
12
15
  --_lp-misc-pt: var(--su2);
13
16
  });
14
17
 
18
+ .highcontrast-mode({
19
+ --_lp-details-fc: var(--black-600);
20
+ --_lp-footer-bg: var(--black-050);
21
+ --_lp-header-bg: var(--black-050);
22
+ });
23
+
15
24
  // CHILD ELEMENTS
16
25
  & &--details,
17
26
  & &--footer {
@@ -25,7 +34,7 @@
25
34
  color: var(--black-500);
26
35
  }
27
36
 
28
- color: var(--black-400);
37
+ color: var(--black-600);
29
38
  cursor: pointer;
30
39
  text-decoration: none;
31
40
  }
@@ -49,16 +58,16 @@
49
58
  }
50
59
 
51
60
  & &--details {
61
+ color: var(--_lp-details-fc);
52
62
  margin-top: var(--_lp-details-mt);
53
63
 
54
- color: var(--black-400);
55
64
  font-size: var(--fs-caption);
56
65
  }
57
66
 
58
67
  & &--footer {
68
+ background: var(--_lp-footer-bg);
59
69
  flex-direction: var(--_lp-footer-fd);
60
70
 
61
- background: var(--black-100);
62
71
  border-bottom-left-radius: var(--br-sm);
63
72
  border-bottom-right-radius: var(--br-sm);
64
73
  border-top: var(--su-static1) solid var(--bc-medium);
@@ -69,7 +78,7 @@
69
78
  }
70
79
 
71
80
  & &--header {
72
- background: var(--black-100);
81
+ background: var(--_lp-header-bg);
73
82
  border-bottom: var(--su-static1) solid var(--bc-medium);
74
83
  border-top-left-radius: var(--br-sm);
75
84
  border-top-right-radius: var(--br-sm);
@@ -100,7 +109,7 @@
100
109
  &:hover{
101
110
  &,
102
111
  &.s-link__visited {
103
- color: var(--theme-link-color-hover);
112
+ color: var(--theme-link-color-hover, var(--theme-secondary-500));
104
113
  }
105
114
  }
106
115
 
@@ -117,10 +126,10 @@
117
126
  }
118
127
 
119
128
  &.s-link__visited:visited {
120
- color: var(--theme-link-color);
129
+ color: var(--theme-link-color, var(--theme-secondary-600));
121
130
  }
122
131
 
123
- color: var(--theme-link-color);
132
+ color: var(--theme-link-color, var(--theme-secondary-400));
124
133
  cursor: pointer;
125
134
  text-decoration: none;
126
135
  }
@@ -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,80 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ const items = [
6
+ {
7
+ label: "Group 1",
8
+ title: true,
9
+ },
10
+ {
11
+ label: "Product",
12
+ selected: true,
13
+ },
14
+ {
15
+ label: "Email",
16
+ },
17
+ {
18
+ label: "Group 2",
19
+ title: true,
20
+ },
21
+ {
22
+ label: "Content",
23
+ },
24
+ {
25
+ label: "Brand",
26
+ },
27
+ {
28
+ label: "Marketing",
29
+ },
30
+ {
31
+ label: "More selected",
32
+ dropdown: true,
33
+ selected: true,
34
+ },
35
+ {
36
+ label: "More",
37
+ dropdown: true,
38
+ },
39
+ ];
40
+
41
+ const getChildren = (includeTitles = false): string =>
42
+ items
43
+ .map((item) => {
44
+ if (item.title) {
45
+ return includeTitles
46
+ ? `<li class="s-navigation--title">${item.label}</li>`
47
+ : "";
48
+ }
49
+ const classes = `s-navigation--item${
50
+ item.selected ? " is-selected" : ""
51
+ }${item.dropdown ? " s-navigation--item__dropdown" : ""}`;
52
+ return `<li><a href="#" class="${classes}">${item.label}</a></li>`;
53
+ })
54
+ .join("");
55
+
56
+ describe("navigation", () => {
57
+ runComponentTests({
58
+ type: "a11y",
59
+ baseClass: "s-navigation",
60
+ variants: ["vertical", "muted"],
61
+ modifiers: {
62
+ primary: ["scroll", "sm"],
63
+ },
64
+ tag: "ul",
65
+ children: {
66
+ default: getChildren(true),
67
+ },
68
+ template: ({ component, testid }) => html`
69
+ <nav
70
+ class="d-inline-block p8 wmx3"
71
+ aria-label="example-navigation"
72
+ data-testid="${testid}"
73
+ >
74
+ ${component}
75
+ </nav>
76
+ `,
77
+ // TODO new colors should resolve the `.is-selected` failures
78
+ skippedTestids: [/s-navigation/],
79
+ });
80
+ });
@@ -0,0 +1,101 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { defaultOptions, runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ const items = [
6
+ {
7
+ label: "Group 1",
8
+ title: true,
9
+ },
10
+ {
11
+ label: "Product",
12
+ selected: true,
13
+ },
14
+ {
15
+ label: "Email",
16
+ },
17
+ {
18
+ label: "Group 2",
19
+ title: true,
20
+ },
21
+ {
22
+ label: "Content",
23
+ },
24
+ {
25
+ label: "Brand",
26
+ },
27
+ {
28
+ label: "Marketing",
29
+ },
30
+ {
31
+ label: "More selected",
32
+ dropdown: true,
33
+ selected: true,
34
+ },
35
+ {
36
+ label: "More",
37
+ dropdown: true,
38
+ },
39
+ ];
40
+
41
+ const getChildren = (includeTitles = false): string =>
42
+ items
43
+ .map((item) => {
44
+ if (item.title) {
45
+ return includeTitles
46
+ ? `<li class="s-navigation--title">${item.label}</li>`
47
+ : "";
48
+ }
49
+ const classes = `s-navigation--item${
50
+ item.selected ? " is-selected" : ""
51
+ }${item.dropdown ? " s-navigation--item__dropdown" : ""}`;
52
+ return `<li><a href="#" class="${classes}">${item.label}</a></li>`;
53
+ })
54
+ .join("");
55
+
56
+ describe("navigation", () => {
57
+ runComponentTests({
58
+ type: "visual",
59
+ baseClass: "s-navigation",
60
+ variants: ["muted"],
61
+ modifiers: {
62
+ primary: ["scroll", "sm"],
63
+ },
64
+ tag: "ul",
65
+ children: {
66
+ default: getChildren(),
67
+ },
68
+ template: ({ component, testid }) => html`
69
+ <nav
70
+ class="d-inline-block p8 wmx3"
71
+ aria-label="example-navigation"
72
+ data-testid="${testid}"
73
+ >
74
+ ${component}
75
+ </nav>
76
+ `,
77
+ });
78
+
79
+ runComponentTests({
80
+ type: "visual",
81
+ baseClass: "s-navigation",
82
+ variants: ["vertical"],
83
+ tag: "ul",
84
+ children: {
85
+ default: getChildren(true),
86
+ },
87
+ template: ({ component, testid }) => html`
88
+ <nav
89
+ class="d-inline-block p8 ws2"
90
+ aria-label="example-navigation"
91
+ data-testid="${testid}"
92
+ >
93
+ ${component}
94
+ </nav>
95
+ `,
96
+ options: {
97
+ ...defaultOptions,
98
+ includeNullVariant: false,
99
+ },
100
+ });
101
+ });
@@ -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
+ });
@@ -0,0 +1,29 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ describe("page title", () => {
6
+ runComponentTests({
7
+ type: "a11y",
8
+ baseClass: "s-page-title",
9
+ children: {
10
+ default: `
11
+ <div class="s-page-title--text">
12
+ <nav class="s-breadcrumbs" aria-label="example-breadcrumbs">…</nav>
13
+ <h1 class="s-page-title--header">Page title</h1>
14
+ <p class="s-page-title--description">
15
+ Optional description de Finibus Bonorum et Malorum
16
+ </p>
17
+ </div>
18
+ <div class="s-page-title--actions">
19
+ <button class="s-btn s-btn__filled" type="button">Action</button>
20
+ </div>
21
+ `,
22
+ },
23
+ template: ({ component, testid }) => html`
24
+ <div class="d-block p8 ws6" data-testid="${testid}">
25
+ ${component}
26
+ </div>
27
+ `,
28
+ });
29
+ });
@@ -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,59 @@
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 postTitleTemplate = ({ component, testid }: any) => html`
7
+ <div class="d-block p8 ws6" data-testid="${testid}">${component}</div>
8
+ `;
9
+
10
+ const getChildren = ({
11
+ showEverything = false,
12
+ }: {
13
+ showEverything: boolean;
14
+ }) => `
15
+ <div class="s-page-title--text">
16
+ ${
17
+ showEverything
18
+ ? `
19
+ <nav class="s-breadcrumbs" aria-label="example-breadcrumbs">
20
+ <div class="s-breadcrumbs--item">
21
+ <a class="s-breadcrumbs--link">Stack Overflow</a>
22
+ </div>
23
+ </nav>
24
+ `
25
+ : ""
26
+ }
27
+ <h1 class="s-page-title--header">Page title</h1>
28
+ ${
29
+ showEverything
30
+ ? `
31
+ <p class="s-page-title--description">
32
+ Optional description de Finibus Bonorum et Malorum
33
+ </p>
34
+ `
35
+ : ""
36
+ }
37
+ </div>
38
+ ${
39
+ showEverything
40
+ ? `
41
+ <div class="s-page-title--actions">
42
+ <button class="s-btn s-btn__filled" type="button">Action</button>
43
+ </div>
44
+ `
45
+ : ""
46
+ }
47
+ `;
48
+
49
+ describe("page title", () => {
50
+ runComponentTests({
51
+ type: "visual",
52
+ baseClass: "s-page-title",
53
+ children: {
54
+ default: getChildren({ showEverything: false }),
55
+ complete: getChildren({ showEverything: true }),
56
+ },
57
+ template: postTitleTemplate,
58
+ });
59
+ });
@@ -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
+ });