@stackoverflow/stacks 2.5.3 → 2.5.5

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 (101) hide show
  1. package/LICENSE.MD +9 -9
  2. package/README.md +180 -180
  3. package/dist/css/stacks.css +104 -122
  4. package/dist/css/stacks.min.css +1 -1
  5. package/lib/atomic/border.less +139 -139
  6. package/lib/atomic/color.less +36 -36
  7. package/lib/atomic/flex.less +426 -426
  8. package/lib/atomic/gap.less +44 -44
  9. package/lib/atomic/grid.less +139 -139
  10. package/lib/atomic/misc.less +374 -374
  11. package/lib/atomic/spacing.less +98 -98
  12. package/lib/atomic/typography.less +264 -264
  13. package/lib/atomic/width-height.less +194 -194
  14. package/lib/base/body.less +44 -44
  15. package/lib/base/configuration-static.less +61 -61
  16. package/lib/base/fieldset.less +5 -5
  17. package/lib/base/icon.less +11 -11
  18. package/lib/base/internal.less +220 -220
  19. package/lib/base/reset-meyer.less +64 -64
  20. package/lib/base/reset-normalize.less +449 -449
  21. package/lib/base/reset.less +20 -20
  22. package/lib/components/activity-indicator/activity-indicator.less +53 -53
  23. package/lib/components/anchor/anchor.less +78 -68
  24. package/lib/components/avatar/avatar.less +108 -108
  25. package/lib/components/award-bling/award-bling.less +31 -31
  26. package/lib/components/badge/badge.less +258 -258
  27. package/lib/components/banner/banner.less +44 -44
  28. package/lib/components/banner/banner.ts +149 -149
  29. package/lib/components/block-link/block-link.less +82 -82
  30. package/lib/components/breadcrumbs/breadcrumbs.less +41 -41
  31. package/lib/components/button/button.less +473 -473
  32. package/lib/components/button-group/button-group.less +82 -82
  33. package/lib/components/card/card.less +37 -37
  34. package/lib/components/check-control/check-control.less +17 -17
  35. package/lib/components/check-group/check-group.less +19 -19
  36. package/lib/components/checkbox_radio/checkbox_radio.less +159 -159
  37. package/lib/components/code-block/code-block.fixtures.ts +88 -88
  38. package/lib/components/code-block/code-block.less +116 -116
  39. package/lib/components/description/description.less +9 -9
  40. package/lib/components/empty-state/empty-state.less +16 -16
  41. package/lib/components/expandable/expandable.less +118 -118
  42. package/lib/components/expandable/expandable.ts +238 -238
  43. package/lib/components/input-fill/input-fill.less +35 -35
  44. package/lib/components/input-icon/input-icon.less +45 -45
  45. package/lib/components/input-message/input-message.less +49 -49
  46. package/lib/components/input_textarea/input_textarea.less +150 -150
  47. package/lib/components/label/label.less +110 -110
  48. package/lib/components/link/link.less +135 -120
  49. package/lib/components/link-preview/link-preview.less +148 -148
  50. package/lib/components/menu/menu.less +41 -41
  51. package/lib/components/modal/modal.less +118 -118
  52. package/lib/components/modal/modal.ts +383 -383
  53. package/lib/components/navigation/navigation.less +136 -136
  54. package/lib/components/navigation/navigation.ts +128 -128
  55. package/lib/components/notice/notice.less +195 -195
  56. package/lib/components/page-title/page-title.less +51 -51
  57. package/lib/components/pagination/pagination.less +65 -65
  58. package/lib/components/popover/popover.less +159 -157
  59. package/lib/components/popover/popover.ts +651 -651
  60. package/lib/components/popover/tooltip.ts +343 -343
  61. package/lib/components/post-summary/post-summary.less +457 -447
  62. package/lib/components/progress-bar/progress-bar.less +291 -291
  63. package/lib/components/prose/prose.less +452 -452
  64. package/lib/components/select/select.less +138 -138
  65. package/lib/components/sidebar-widget/sidebar-widget.less +257 -257
  66. package/lib/components/spinner/spinner.less +103 -103
  67. package/lib/components/table/table.less +307 -307
  68. package/lib/components/table/table.ts +296 -296
  69. package/lib/components/table-container/table-container.less +4 -4
  70. package/lib/components/tag/tag.less +186 -186
  71. package/lib/components/toast/toast.less +35 -35
  72. package/lib/components/toast/toast.ts +357 -357
  73. package/lib/components/toggle-switch/toggle-switch.less +104 -104
  74. package/lib/components/topbar/topbar.less +553 -553
  75. package/lib/components/uploader/uploader.less +205 -205
  76. package/lib/components/uploader/uploader.ts +207 -207
  77. package/lib/components/user-card/user-card.less +129 -129
  78. package/lib/controllers.ts +33 -33
  79. package/lib/exports/color-mixins.less +283 -283
  80. package/lib/exports/color-sets.less +711 -711
  81. package/lib/exports/color.less +65 -65
  82. package/lib/exports/constants-helpers.less +108 -108
  83. package/lib/exports/constants-type.less +155 -155
  84. package/lib/exports/exports.less +15 -15
  85. package/lib/exports/mixins.less +333 -333
  86. package/lib/exports/spacing-mixins.less +67 -67
  87. package/lib/index.ts +32 -32
  88. package/lib/input-utils.less +41 -41
  89. package/lib/stacks-dynamic.less +24 -24
  90. package/lib/stacks-static.less +93 -93
  91. package/lib/stacks.less +13 -13
  92. package/lib/stacks.ts +113 -113
  93. package/lib/test/a11y-test-utils.ts +94 -94
  94. package/lib/test/assertions.ts +36 -36
  95. package/lib/test/less-test-utils.ts +28 -28
  96. package/lib/test/open-wc-testing-patch.d.ts +26 -26
  97. package/lib/test/test-utils.ts +364 -364
  98. package/lib/test/visual-test-utils.ts +58 -58
  99. package/lib/tsconfig.build.json +4 -4
  100. package/lib/tsconfig.json +17 -17
  101. package/package.json +115 -115
@@ -1,205 +1,205 @@
1
- .s-uploader {
2
- // COMPONENT-SPECIFIC CONSTANTS
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
- // COMPONENT-SPECIFIC CUSTOM PROPERTIES
5
- --_up-bg: var(--black-100);
6
- --_up-bg-focus: var(--black-150);
7
- --_up-bg-bc: var(--black-250);
8
- --_up-focus-ring-color: var(--focus-ring);
9
-
10
- // CONTEXTUAL STYLES
11
- .highcontrast-mode({
12
- --_up-bg-bc-hc: var(--black-400);
13
- &.has-error {
14
- --_up-bg-bc-hc-state: var(--red-500);
15
- }
16
- &.has-success {
17
- --_up-bg-bc-hc-state: var(--green-400);
18
- }
19
- &.has-warning {
20
- --_up-bg-bc-hc-state: var(--yellow-500);
21
- }
22
- });
23
-
24
- // STATES
25
- &.has-error,
26
- &.has-success,
27
- &.has-warning {
28
- .s-link {
29
- color: var(--_up-link-fc);
30
- }
31
- }
32
-
33
- &.has-error {
34
- --_up-bg: var(--red-100);
35
- --_up-bg-focus: var(--red-200);
36
- --_up-bg-bc: var(--red-300);
37
- --_up-focus-ring-color: var(--focus-ring-error);
38
- --_up-link-fc: var(--red-500);
39
- }
40
-
41
- &.has-success {
42
- --_up-bg: var(--green-100);
43
- --_up-bg-focus: var(--green-200);
44
- --_up-bg-bc: var(--green-300);
45
- --_up-focus-ring-color: var(--focus-ring-success);
46
- --_up-link-fc: var(--green-400);
47
- }
48
-
49
- &.has-warning {
50
- --_up-bg: var(--yellow-100);
51
- --_up-bg-focus: var(--yellow-200);
52
- --_up-bg-bc: var(--yellow-300);
53
- --_up-focus-ring-color: var(--focus-ring-warning);
54
- --_up-link-fc: var(--yellow-500);
55
- }
56
-
57
- &.is-active {
58
- --_up-bg: var(--black-150);
59
- --_up-bg-bc: var(--black-300);
60
- }
61
-
62
- &.is-disabled {
63
- opacity: var(--_o-disabled-static);
64
- }
65
-
66
- // CHILD ELEMENTS
67
- & &--container {
68
- &:before { // Add the dashed border as an SVG background mask
69
- -webkit-mask-image: var(--_up-bg-b-image);
70
- mask-image: var(--_up-bg-b-image);
71
- background-color: var(--_up-bg-bc-hc-state, var(--_up-bg-bc-hc, var(--_up-bg-bc)));
72
- border-radius: var(--br-lg);
73
- content: '';
74
- display: block;
75
- inset: 0;
76
- position: absolute;
77
- }
78
-
79
- align-items: center;
80
- background-color: var(--_up-bg);
81
- border-radius: var(--br-lg);
82
- display: flex;
83
- flex-direction: column;
84
- justify-content: center;
85
- min-height: var(--su-static128);
86
- padding: var(--su8) var(--su16);
87
- position: relative;
88
- text-align: center;
89
- }
90
-
91
- & &--input {
92
- &:focus:focus-visible + .s-uploader--container {
93
- .focus-styles();
94
- }
95
-
96
- &:focus:focus-visible + .s-uploader--container,
97
- .s-uploader--container.focus {
98
- background-color: var(--_up-bg-focus);
99
- }
100
-
101
- cursor: pointer;
102
- height: 100%;
103
- inset: 0;
104
- opacity: 0;
105
- position: absolute;
106
- width: 100%;
107
- z-index: var(--zi-selected);
108
- }
109
-
110
- & &--preview {
111
- max-width: 100%;
112
- pointer-events: none;
113
- }
114
-
115
- & &--preview-thumbnail {
116
- .highcontrast-mode({
117
- border: var(--su-static1) solid var(--black);
118
- });
119
-
120
- &:is(img) {
121
- object-fit: scale-down;
122
- object-position: center;
123
- }
124
-
125
- &:not(img) {
126
- padding: var(--su16);
127
- }
128
-
129
- background-color: var(--white);
130
- border-radius: var(--br-sm);
131
- box-shadow: var(--bs-md);
132
- max-height: var(--su-static128);
133
- max-width: 100%;
134
- overflow: hidden;
135
- text-overflow: ellipsis;
136
- white-space: nowrap;
137
- }
138
-
139
- & &--previews {
140
- &.has-multiple {
141
- display: block;
142
- height: auto;
143
- padding: var(--su8) var(--su2);
144
- width: 100%;
145
-
146
- .s-uploader--preview {
147
- &:after {
148
- content: attr(data-filename);
149
- display: block;
150
- margin-left: var(--su12);
151
- max-width: 100%;
152
- overflow: hidden;
153
- text-overflow: ellipsis;
154
- white-space: nowrap;
155
- }
156
-
157
- align-items: center;
158
- display: flex;
159
- padding: var(--su6) 0;
160
- width: 100%;
161
- }
162
-
163
- .s-uploader--preview-thumbnail {
164
- &:is(img) {
165
- object-fit: cover;
166
- }
167
- &:not(img) {
168
- background-image: url("data:image/svg+xml;,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' fill='%23535A60' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M3 3a2 2 0 012-2h6l4 4v10a2 2 0 01-2 2H5a2 2 0 01-2-2V3zm7-1.5V6h4.5L10 1.5z'%3E%3C/path%3E%3C/svg%3E");
169
- background-position: center;
170
- background-repeat: no-repeat;
171
- }
172
-
173
- color: transparent;
174
- height: var(--su-static32);
175
- flex-shrink: 0;
176
- width: var(--su-static32);
177
- }
178
- }
179
-
180
- max-width: 100%;
181
- text-align: left;
182
- }
183
-
184
- & &--previews-heading {
185
- color: var(--black-600);
186
- font-size: var(--fs-body2);
187
- font-weight: 700;
188
- padding-bottom: var(--su8);
189
- }
190
-
191
- & &--reset {
192
- position: absolute;
193
- right: var(--su8);
194
- top: var(--su8);
195
- z-index: var(--zi-active);
196
- }
197
-
198
- // This is for safari shadow DOM
199
- // see https://github.com/StackExchange/Stacks/pull/690#issuecomment-861028193
200
- input[type="file"]::file-selector-button {
201
- cursor: pointer;
202
- }
203
-
204
- position: relative;
205
- }
1
+ .s-uploader {
2
+ // COMPONENT-SPECIFIC CONSTANTS
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
+ // COMPONENT-SPECIFIC CUSTOM PROPERTIES
5
+ --_up-bg: var(--black-100);
6
+ --_up-bg-focus: var(--black-150);
7
+ --_up-bg-bc: var(--black-250);
8
+ --_up-focus-ring-color: var(--focus-ring);
9
+
10
+ // CONTEXTUAL STYLES
11
+ .highcontrast-mode({
12
+ --_up-bg-bc-hc: var(--black-400);
13
+ &.has-error {
14
+ --_up-bg-bc-hc-state: var(--red-500);
15
+ }
16
+ &.has-success {
17
+ --_up-bg-bc-hc-state: var(--green-400);
18
+ }
19
+ &.has-warning {
20
+ --_up-bg-bc-hc-state: var(--yellow-500);
21
+ }
22
+ });
23
+
24
+ // STATES
25
+ &.has-error,
26
+ &.has-success,
27
+ &.has-warning {
28
+ .s-link {
29
+ color: var(--_up-link-fc);
30
+ }
31
+ }
32
+
33
+ &.has-error {
34
+ --_up-bg: var(--red-100);
35
+ --_up-bg-focus: var(--red-200);
36
+ --_up-bg-bc: var(--red-300);
37
+ --_up-focus-ring-color: var(--focus-ring-error);
38
+ --_up-link-fc: var(--red-500);
39
+ }
40
+
41
+ &.has-success {
42
+ --_up-bg: var(--green-100);
43
+ --_up-bg-focus: var(--green-200);
44
+ --_up-bg-bc: var(--green-300);
45
+ --_up-focus-ring-color: var(--focus-ring-success);
46
+ --_up-link-fc: var(--green-400);
47
+ }
48
+
49
+ &.has-warning {
50
+ --_up-bg: var(--yellow-100);
51
+ --_up-bg-focus: var(--yellow-200);
52
+ --_up-bg-bc: var(--yellow-300);
53
+ --_up-focus-ring-color: var(--focus-ring-warning);
54
+ --_up-link-fc: var(--yellow-500);
55
+ }
56
+
57
+ &.is-active {
58
+ --_up-bg: var(--black-150);
59
+ --_up-bg-bc: var(--black-300);
60
+ }
61
+
62
+ &.is-disabled {
63
+ opacity: var(--_o-disabled-static);
64
+ }
65
+
66
+ // CHILD ELEMENTS
67
+ & &--container {
68
+ &:before { // Add the dashed border as an SVG background mask
69
+ -webkit-mask-image: var(--_up-bg-b-image);
70
+ mask-image: var(--_up-bg-b-image);
71
+ background-color: var(--_up-bg-bc-hc-state, var(--_up-bg-bc-hc, var(--_up-bg-bc)));
72
+ border-radius: var(--br-lg);
73
+ content: '';
74
+ display: block;
75
+ inset: 0;
76
+ position: absolute;
77
+ }
78
+
79
+ align-items: center;
80
+ background-color: var(--_up-bg);
81
+ border-radius: var(--br-lg);
82
+ display: flex;
83
+ flex-direction: column;
84
+ justify-content: center;
85
+ min-height: var(--su-static128);
86
+ padding: var(--su8) var(--su16);
87
+ position: relative;
88
+ text-align: center;
89
+ }
90
+
91
+ & &--input {
92
+ &:focus:focus-visible + .s-uploader--container {
93
+ .focus-styles();
94
+ }
95
+
96
+ &:focus:focus-visible + .s-uploader--container,
97
+ .s-uploader--container.focus {
98
+ background-color: var(--_up-bg-focus);
99
+ }
100
+
101
+ cursor: pointer;
102
+ height: 100%;
103
+ inset: 0;
104
+ opacity: 0;
105
+ position: absolute;
106
+ width: 100%;
107
+ z-index: var(--zi-selected);
108
+ }
109
+
110
+ & &--preview {
111
+ max-width: 100%;
112
+ pointer-events: none;
113
+ }
114
+
115
+ & &--preview-thumbnail {
116
+ .highcontrast-mode({
117
+ border: var(--su-static1) solid var(--black);
118
+ });
119
+
120
+ &:is(img) {
121
+ object-fit: scale-down;
122
+ object-position: center;
123
+ }
124
+
125
+ &:not(img) {
126
+ padding: var(--su16);
127
+ }
128
+
129
+ background-color: var(--white);
130
+ border-radius: var(--br-sm);
131
+ box-shadow: var(--bs-md);
132
+ max-height: var(--su-static128);
133
+ max-width: 100%;
134
+ overflow: hidden;
135
+ text-overflow: ellipsis;
136
+ white-space: nowrap;
137
+ }
138
+
139
+ & &--previews {
140
+ &.has-multiple {
141
+ display: block;
142
+ height: auto;
143
+ padding: var(--su8) var(--su2);
144
+ width: 100%;
145
+
146
+ .s-uploader--preview {
147
+ &:after {
148
+ content: attr(data-filename);
149
+ display: block;
150
+ margin-left: var(--su12);
151
+ max-width: 100%;
152
+ overflow: hidden;
153
+ text-overflow: ellipsis;
154
+ white-space: nowrap;
155
+ }
156
+
157
+ align-items: center;
158
+ display: flex;
159
+ padding: var(--su6) 0;
160
+ width: 100%;
161
+ }
162
+
163
+ .s-uploader--preview-thumbnail {
164
+ &:is(img) {
165
+ object-fit: cover;
166
+ }
167
+ &:not(img) {
168
+ background-image: url("data:image/svg+xml;,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' fill='%23535A60' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M3 3a2 2 0 012-2h6l4 4v10a2 2 0 01-2 2H5a2 2 0 01-2-2V3zm7-1.5V6h4.5L10 1.5z'%3E%3C/path%3E%3C/svg%3E");
169
+ background-position: center;
170
+ background-repeat: no-repeat;
171
+ }
172
+
173
+ color: transparent;
174
+ height: var(--su-static32);
175
+ flex-shrink: 0;
176
+ width: var(--su-static32);
177
+ }
178
+ }
179
+
180
+ max-width: 100%;
181
+ text-align: left;
182
+ }
183
+
184
+ & &--previews-heading {
185
+ color: var(--black-600);
186
+ font-size: var(--fs-body2);
187
+ font-weight: 700;
188
+ padding-bottom: var(--su8);
189
+ }
190
+
191
+ & &--reset {
192
+ position: absolute;
193
+ right: var(--su8);
194
+ top: var(--su8);
195
+ z-index: var(--zi-active);
196
+ }
197
+
198
+ // This is for safari shadow DOM
199
+ // see https://github.com/StackExchange/Stacks/pull/690#issuecomment-861028193
200
+ input[type="file"]::file-selector-button {
201
+ cursor: pointer;
202
+ }
203
+
204
+ position: relative;
205
+ }