@stackoverflow/stacks 1.10.2 → 2.0.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 (95) hide show
  1. package/README.md +15 -0
  2. package/dist/css/stacks.css +7428 -4429
  3. package/dist/css/stacks.min.css +1 -1
  4. package/lib/atomic/__snapshots__/color-new.less.test.ts.snap +3015 -0
  5. package/lib/atomic/__snapshots__/color.less.test.ts.snap +2886 -0
  6. package/lib/atomic/border.less +0 -258
  7. package/lib/atomic/color.less +26 -200
  8. package/lib/atomic/color.less.test.ts +12 -0
  9. package/lib/atomic/misc.less +7 -6
  10. package/lib/atomic/typography.less +0 -7
  11. package/lib/atomic/v1/__snapshots__/border.less.test.ts.snap +552 -0
  12. package/lib/atomic/v1/__snapshots__/color.less.test.ts.snap +6756 -0
  13. package/lib/atomic/v1/__snapshots__/typography.less.test.ts.snap +22 -0
  14. package/lib/atomic/v1/border.less +210 -0
  15. package/lib/atomic/v1/border.less.test.ts +14 -0
  16. package/lib/atomic/v1/color.less +183 -0
  17. package/lib/atomic/v1/color.less.test.ts +14 -0
  18. package/lib/atomic/v1/typography.less +8 -0
  19. package/lib/atomic/v1/typography.less.test.ts +14 -0
  20. package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +1 -8
  21. package/lib/components/activity-indicator/activity-indicator.less +4 -4
  22. package/lib/components/anchor/anchor.a11y.test.ts +0 -5
  23. package/lib/components/anchor/anchor.less +4 -4
  24. package/lib/components/anchor/anchor.visual.test.ts +1 -1
  25. package/lib/components/avatar/avatar.less +2 -2
  26. package/lib/components/award-bling/award-bling.less +3 -3
  27. package/lib/components/badge/badge.a11y.test.ts +2 -12
  28. package/lib/components/badge/badge.less +40 -40
  29. package/lib/components/badge/badge.visual.test.ts +27 -5
  30. package/lib/components/block-link/block-link.a11y.test.ts +0 -7
  31. package/lib/components/block-link/block-link.less +8 -8
  32. package/lib/components/breadcrumbs/breadcrumbs.less +1 -1
  33. package/lib/components/button/button.a11y.test.ts +0 -3
  34. package/lib/components/button/button.less +40 -40
  35. package/lib/components/button/button.visual.test.ts +1 -1
  36. package/lib/components/check-control/check-control.a11y.test.ts +0 -5
  37. package/lib/components/check-control/check-control.visual.test.ts +1 -1
  38. package/lib/components/checkbox_radio/checkbox_radio.less +5 -5
  39. package/lib/components/checkbox_radio/checkbox_radio.visual.test.ts +1 -1
  40. package/lib/components/code-block/code-block.less +3 -3
  41. package/lib/components/description/description.a11y.test.ts +0 -1
  42. package/lib/components/description/description.visual.test.ts +1 -1
  43. package/lib/components/input-fill/input-fill.less +2 -2
  44. package/lib/components/input-icon/input-icon.less +2 -2
  45. package/lib/components/input-message/input-message.less +8 -8
  46. package/lib/components/input_textarea/input_textarea.less +6 -6
  47. package/lib/components/label/label.less +11 -11
  48. package/lib/components/link/link.a11y.test.ts +0 -8
  49. package/lib/components/link/link.less +8 -8
  50. package/lib/components/link-preview/link-preview.less +9 -9
  51. package/lib/components/menu/menu.less +3 -3
  52. package/lib/components/modal/modal.less +5 -4
  53. package/lib/components/navigation/navigation.less +11 -11
  54. package/lib/components/notice/notice.less +48 -48
  55. package/lib/components/pagination/pagination.less +3 -3
  56. package/lib/components/popover/popover.less +2 -2
  57. package/lib/components/popover/tooltip.test.ts +1 -1
  58. package/lib/components/post-summary/post-summary.less +40 -40
  59. package/lib/components/progress-bar/progress-bar.less +15 -15
  60. package/lib/components/prose/prose.less +15 -15
  61. package/lib/components/select/select.less +5 -5
  62. package/lib/components/sidebar-widget/sidebar-widget.less +12 -12
  63. package/lib/components/table/table.less +7 -7
  64. package/lib/components/tag/tag.less +25 -25
  65. package/lib/components/toggle-switch/toggle-switch.a11y.test.ts +0 -4
  66. package/lib/components/toggle-switch/toggle-switch.less +4 -4
  67. package/lib/components/toggle-switch/toggle-switch.visual.test.ts +12 -11
  68. package/lib/components/topbar/topbar.less +34 -34
  69. package/lib/components/uploader/uploader.less +15 -15
  70. package/lib/components/user-card/user-card.less +7 -7
  71. package/lib/exports/__snapshots__/color-mixins.less.test.ts.snap +539 -0
  72. package/lib/exports/__snapshots__/color.less.test.ts.snap +762 -0
  73. package/lib/exports/color-mixins.less +280 -0
  74. package/lib/exports/color-mixins.less.test.ts +150 -0
  75. package/lib/exports/color-sets.less +620 -0
  76. package/lib/exports/color.less +57 -0
  77. package/lib/exports/color.less.test.ts +12 -0
  78. package/lib/exports/exports.less +2 -1
  79. package/lib/exports/mixins.less +17 -5
  80. package/lib/exports/theme.less +85 -0
  81. package/lib/exports/v1/__snapshots__/constants-colors.less.test.ts.snap +902 -0
  82. package/lib/exports/v1/constants-colors.less +893 -0
  83. package/lib/exports/v1/constants-colors.less.test.ts +12 -0
  84. package/lib/stacks-static.less +5 -0
  85. package/lib/test/axe-apca/README.md +34 -0
  86. package/lib/test/axe-apca/index.ts +3 -0
  87. package/lib/test/axe-apca/package.wip.json +30 -0
  88. package/lib/test/axe-apca/src/apca-w3.d.ts +3 -0
  89. package/lib/test/axe-apca/src/axe-apca.test.ts +155 -0
  90. package/lib/test/axe-apca/src/axe-apca.ts +212 -0
  91. package/lib/test/less-test-utils.ts +28 -0
  92. package/lib/test/test-utils.ts +18 -1
  93. package/lib/tsconfig.json +1 -0
  94. package/package.json +14 -7
  95. package/lib/exports/constants-colors.less +0 -1100
@@ -6,17 +6,14 @@ describe("toggle-switch", () => {
6
6
  // Single toggle switch
7
7
  [true, false].forEach((checked) => {
8
8
  [true, false].forEach((disabled) => {
9
- const idSuffix = `${checked ? "-checked" : ""}${
10
- disabled ? "-disabled" : ""
9
+ const testidSuffix = `${checked ? "checked" : "unchecked"}${
10
+ disabled ? "-disabled" : "-enabled"
11
11
  }`;
12
- const id = `toggle-switch${idSuffix}`;
12
+ const id = `toggle-switch-${testidSuffix}`;
13
13
 
14
14
  runComponentTests({
15
15
  type: "visual",
16
16
  baseClass: "s-toggle-switch",
17
- modifiers: {
18
- global: idSuffix ? [idSuffix.substring(1)] : [], // for proper testid generation
19
- },
20
17
  tag: "input",
21
18
  attributes: {
22
19
  id,
@@ -24,6 +21,11 @@ describe("toggle-switch", () => {
24
21
  ...(checked ? { checked: "" } : {}),
25
22
  ...(disabled ? { disabled: "" } : {}),
26
23
  },
24
+ options: {
25
+ ...defaultOptions,
26
+ includeNullModifier: false,
27
+ testidSuffix,
28
+ },
27
29
  template: ({ component, testid }) => html`
28
30
  <div data-testid="${testid}" class="p4 ws1">
29
31
  <label class="v-visible-sr" for="${id}">toggle</label>
@@ -40,15 +42,12 @@ describe("toggle-switch", () => {
40
42
  type: "visual",
41
43
  baseClass: "s-toggle-switch",
42
44
  variants: ["multiple"],
43
- modifiers: {
44
- global: offChecked ? ["off"] : [], // for proper testid generation
45
- },
46
45
  children: {
47
46
  default: `
48
- <input type="radio" name="group" id="four" ${
47
+ <input type="radio" name="group" id="off" ${
49
48
  offChecked ? 'checked=""' : ""
50
49
  }>
51
- <label for="four" class="s-toggle-switch--label-off">Off</label>
50
+ <label for="off" class="s-toggle-switch--label-off">Off</label>
52
51
  <input type="radio" name="group" id="one" ${
53
52
  !offChecked ? 'checked=""' : ""
54
53
  }>
@@ -61,7 +60,9 @@ describe("toggle-switch", () => {
61
60
  },
62
61
  options: {
63
62
  ...defaultOptions,
63
+ includeNullModifier: false,
64
64
  includeNullVariant: false,
65
+ testidSuffix: offChecked ? "unchecked" : "checked",
65
66
  },
66
67
  template: ({ component, testid }) => html`
67
68
  <div data-testid="${testid}" class="d-flex ai-center g8 p4 ws2">
@@ -30,9 +30,9 @@
30
30
  --theme-topbar-select-background: var(--theme-topbar-background-color);
31
31
 
32
32
  // Topbar items
33
- --theme-topbar-item-color: var(--black-800);
34
- --theme-topbar-item-color-hover: var(--black-900);
35
- --theme-topbar-item-background-hover: var(--black-200);
33
+ --theme-topbar-item-color: var(--black-600);
34
+ --theme-topbar-item-color-hover: var(--black-600);
35
+ --theme-topbar-item-background-hover: var(--black-300);
36
36
  --theme-topbar-item-color-current: var(--black);
37
37
  });
38
38
 
@@ -146,36 +146,36 @@
146
146
  // TODO this only works 100% perfectly in light mode, due to child elements inheriting current theme colors
147
147
  // TODO extend forced light mode instead of overriding
148
148
 
149
- --theme-topbar-background-color: @white;
150
- --theme-topbar-bottom-border: 1px solid @black-100;
149
+ --theme-topbar-background-color: var(--_white-static);
150
+ --theme-topbar-bottom-border: 1px solid .set-black()[225];
151
151
 
152
152
  // Search input
153
- --theme-topbar-search-color: @black-700;
154
- --theme-topbar-search-background: @white;
155
- --theme-topbar-search-placeholder: @black-400;
156
- --theme-topbar-search-border: @black-200;
157
- --theme-topbar-search-border-focus: @blue-300;
153
+ --theme-topbar-search-color: .set-black()[500];
154
+ --theme-topbar-search-background: var(--_white-static);
155
+ --theme-topbar-search-placeholder: .set-black()[400];
156
+ --theme-topbar-search-border: .set-black()[300];
157
+ --theme-topbar-search-border-focus: .set-blue()[400];
158
158
  --theme-topbar-search-shadow-focus: 0 0 0 var(--su-static4) var(--focus-ring);
159
159
 
160
160
  // Search switcher
161
- --theme-topbar-select-color: @black-700;
162
- --theme-topbar-select-background: @black-050;
161
+ --theme-topbar-select-color: .set-black()[500];
162
+ --theme-topbar-select-background: .set-black()[150];
163
163
 
164
164
  // Items
165
- --theme-topbar-item-color: @black-600;
166
- --theme-topbar-item-color-hover: @black-800;
167
- --theme-topbar-item-background-hover: @black-075;
168
- --theme-topbar-item-color-current: @black;
169
- --theme-topbar-item-border-current: var(--theme-primary-color);
165
+ --theme-topbar-item-color: .set-black()[500];
166
+ --theme-topbar-item-color-hover: .set-black()[600];
167
+ --theme-topbar-item-background-hover: .set-black()[200];
168
+ --theme-topbar-item-color-current: var(--_black-static);
169
+ --theme-topbar-item-border-current: var(--theme-primary);
170
170
 
171
171
  // TODO HACK remove everything below once light/dark topbars are inheriting forced themes correctly
172
172
  // redefine the variables for extra contrast in high-contrast mode
173
173
  .highcontrast-mode({
174
174
  // Topbar items
175
- --theme-topbar-item-color: @black-800;
176
- --theme-topbar-item-color-hover: @black-900;
177
- --theme-topbar-item-background-hover: @black-075;
178
- --theme-topbar-item-color-current: @black;
175
+ --theme-topbar-item-color: .set-black()[600];
176
+ --theme-topbar-item-color-hover: .set-black()[600]; // TODO hover is now identical color to base color
177
+ --theme-topbar-item-background-hover: .set-black()[200];
178
+ --theme-topbar-item-color-current: var(--_black-static);
179
179
  });
180
180
 
181
181
  --scrollbar: hsla(0, 0%, 0%, 0.2);
@@ -188,7 +188,7 @@
188
188
  // TODO this only works 100% perfectly in dark mode, due to child elements inheriting current theme colors
189
189
  // TODO extend forced dark mode instead of overriding
190
190
 
191
- @topbar-actual-background: @black-800;
191
+ @topbar-actual-background: .set-black()[600];
192
192
  // TODO
193
193
  #calc-topbar-lightness-increase() when (lightness(@topbar-actual-background) < 15%) {
194
194
  @topbar-search-lightness-increase: 20%;
@@ -207,18 +207,18 @@
207
207
  --theme-topbar-search-placeholder: lighten(@topbar-actual-background, 60% + @topbar-search-lightness-increase);
208
208
  --theme-topbar-search-border: lighten(@topbar-actual-background, 20% + @topbar-search-lightness-increase);
209
209
  --theme-topbar-search-border-focus: lighten(@topbar-actual-background, 45% + @topbar-search-lightness-increase);
210
- --theme-topbar-search-shadow-focus: 0 0 0 var(--su-static4) fade(@white, 30%);
210
+ --theme-topbar-search-shadow-focus: 0 0 0 var(--su-static4) fade(.set-white()[default], 30%);
211
211
 
212
212
  // Search switcher
213
213
  --theme-topbar-select-color: lighten(@topbar-actual-background, 60% + @topbar-search-lightness-increase);
214
214
  --theme-topbar-select-background: lighten(@topbar-actual-background, 10% + @topbar-search-lightness-increase);
215
215
 
216
216
  // Items
217
- --theme-topbar-item-color: @black-100;
218
- --theme-topbar-item-color-hover: @white;
219
- --theme-topbar-item-background-hover: @black-700;
220
- --theme-topbar-item-color-current: @white;
221
- --theme-topbar-item-border-current: var(--theme-primary-color);
217
+ --theme-topbar-item-color: .set-black()[225];
218
+ --theme-topbar-item-color-hover: var(--_white-static);
219
+ --theme-topbar-item-background-hover: .set-black()[500];
220
+ --theme-topbar-item-color-current: var(--_white-static);
221
+ --theme-topbar-item-border-current: var(--theme-primary);
222
222
 
223
223
  // Themed border accent
224
224
  --theme-topbar-accent-border: none;
@@ -227,10 +227,10 @@
227
227
  // redefine the variables for extra contrast in high-contrast mode
228
228
  .highcontrast-mode({
229
229
  // Topbar items
230
- --theme-topbar-item-color: @white;
231
- --theme-topbar-item-color-hover: @white;
232
- --theme-topbar-item-background-hover: @black-700;
233
- --theme-topbar-item-color-current: @white;
230
+ --theme-topbar-item-color: var(--_white-static);
231
+ --theme-topbar-item-color-hover: var(--_white-static);
232
+ --theme-topbar-item-background-hover: .set-black()[500];
233
+ --theme-topbar-item-color-current: var(--_white-static);
234
234
 
235
235
  .s-badge {
236
236
  border-color: currentColor;
@@ -333,11 +333,11 @@
333
333
  }
334
334
 
335
335
  &.is-unread {
336
- .topbar-notice-styles(var(--theme-primary-color), var(--theme-primary-color), var(--white));
336
+ .topbar-notice-styles(var(--theme-primary), var(--theme-primary), var(--white));
337
337
 
338
338
  &:hover,
339
339
  &:focus {
340
- .topbar-notice-styles(var(--theme-primary-600), var(--theme-primary-600), var(--white));
340
+ .topbar-notice-styles(var(--theme-primary-500), var(--theme-primary-500), var(--white));
341
341
  }
342
342
  }
343
343
  }
@@ -2,9 +2,9 @@
2
2
  // COMPONENT-SPECIFIC CONSTANTS
3
3
  --_up-bg-b-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='5' ry='5' stroke='%23000000' stroke-width='8' stroke-dasharray='7%2c 22' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e"); // Keeping this a custom property to save a few bytes
4
4
  // COMPONENT-SPECIFIC CUSTOM PROPERTIES
5
- --_up-bg: var(--black-025);
6
- --_up-bg-focus: var(--black-050);
7
- --_up-bg-bc: var(--black-150);
5
+ --_up-bg: var(--black-100);
6
+ --_up-bg-focus: var(--black-150);
7
+ --_up-bg-bc: var(--black-250);
8
8
  --_up-focus-ring-color: var(--focus-ring);
9
9
 
10
10
  // CONTEXTUAL STYLES
@@ -22,35 +22,35 @@
22
22
  }
23
23
 
24
24
  &.has-error {
25
- --_up-bg: var(--red-050);
26
- --_up-bg-focus: var(--red-100);
25
+ --_up-bg: var(--red-200);
26
+ --_up-bg-focus: var(--red-300);
27
27
  --_up-bg-bc: var(--red-400);
28
28
  --_up-bg-bc-hc-state: var(--red-400);
29
29
  --_up-focus-ring-color: var(--focus-ring-error);
30
- --_up-link-fc: var(--red-900);
30
+ --_up-link-fc: var(--red-600);
31
31
  }
32
32
 
33
33
  &.has-success {
34
- --_up-bg: var(--green-025);
35
- --_up-bg-focus: var(--green-050);
34
+ --_up-bg: var(--green-100);
35
+ --_up-bg-focus: var(--green-200);
36
36
  --_up-bg-bc: var(--green-400);
37
37
  --_up-bg-bc-hc-state: var(--green-400);
38
38
  --_up-focus-ring-color: var(--focus-ring-success);
39
- --_up-link-fc: var(--green-900);
39
+ --_up-link-fc: var(--green-600);
40
40
  }
41
41
 
42
42
  &.has-warning {
43
- --_up-bg: var(--yellow-050);
44
- --_up-bg-focus: var(--yellow-100);
43
+ --_up-bg: var(--yellow-200);
44
+ --_up-bg-focus: var(--yellow-300);
45
45
  --_up-bg-bc: var(--yellow-400);
46
46
  --_up-bg-bc-hc-state: var(--yellow-400);
47
47
  --_up-focus-ring-color: var(--focus-ring-warning);
48
- --_up-link-fc: var(--yellow-900);
48
+ --_up-link-fc: var(--yellow-600);
49
49
  }
50
50
 
51
51
  &.is-active {
52
- --_up-bg: var(--black-050);
53
- --_up-bg-bc: var(--black-200);
52
+ --_up-bg: var(--black-150);
53
+ --_up-bg-bc: var(--black-300);
54
54
  }
55
55
 
56
56
  &.is-disabled {
@@ -172,7 +172,7 @@
172
172
  }
173
173
 
174
174
  & &--previews-heading {
175
- color: var(--black-900);
175
+ color: var(--black-600);
176
176
  font-size: var(--fs-body2);
177
177
  font-weight: 600;
178
178
  padding-bottom: var(--su8);
@@ -11,20 +11,20 @@
11
11
  --_uc-link-fs: var(--fs-caption);
12
12
  --_uc-link-ws: unset;
13
13
  --_uc-rep-fc: unset;
14
- --_uc-time-fc: var(--black-500);
14
+ --_uc-time-fc: var(--black-400);
15
15
  --_uc-time-ws: unset;
16
16
  --_uc-type-fc: var(--theme-primary-400);
17
17
 
18
18
  // MODIFIERS
19
19
  &&__deleted {
20
- --_uc-fc: var(--black-500);
20
+ --_uc-fc: var(--black-400);
21
21
  }
22
22
 
23
23
  &&__highlighted {
24
- --_uc-bg: var(--theme-secondary-050);
24
+ --_uc-bg: var(--theme-secondary-200);
25
25
  --_uc-bar: var(--br-md);
26
- --_uc-time-fc: var(--black-600);
27
- --_uc-type-fc: var(--black-700);
26
+ --_uc-time-fc: var(--black-500);
27
+ --_uc-type-fc: var(--black-500);
28
28
  }
29
29
 
30
30
  // VARIANTS
@@ -44,7 +44,7 @@
44
44
 
45
45
  &&__minimal {
46
46
  --_uc-link-ws: nowrap;
47
- --_uc-rep-fc: var(--black-600);
47
+ --_uc-rep-fc: var(--black-500);
48
48
  --_uc-time-ws: nowrap;
49
49
  }
50
50
 
@@ -52,7 +52,7 @@
52
52
  & &--location,
53
53
  & &--role {
54
54
  font-size: var(--fs-caption);
55
- color: var(--black-500);
55
+ color: var(--black-400);
56
56
  }
57
57
 
58
58
  & &--awards {