@stackoverflow/stacks 0.75.0 → 0.76.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 (87) hide show
  1. package/LICENSE.MD +9 -9
  2. package/README.md +47 -47
  3. package/dist/controllers/index.d.ts +7 -0
  4. package/dist/controllers/s-expandable-control.d.ts +17 -0
  5. package/dist/controllers/s-modal.d.ts +97 -0
  6. package/dist/controllers/s-navigation-tablist.d.ts +36 -0
  7. package/dist/controllers/s-popover.d.ts +155 -0
  8. package/dist/controllers/s-table.d.ts +8 -0
  9. package/dist/controllers/s-tooltip.d.ts +82 -0
  10. package/dist/controllers/s-uploader.d.ts +48 -0
  11. package/dist/css/stacks.css +86 -53
  12. package/dist/css/stacks.min.css +1 -1
  13. package/dist/index.d.ts +3 -0
  14. package/dist/js/stacks.js +6128 -5505
  15. package/dist/js/stacks.min.js +1 -1
  16. package/dist/stacks.d.ts +21 -0
  17. package/lib/css/atomic/_stacks-borders.less +378 -378
  18. package/lib/css/atomic/_stacks-colors.less +209 -209
  19. package/lib/css/atomic/_stacks-flex.less +374 -374
  20. package/lib/css/atomic/_stacks-grid.less +174 -173
  21. package/lib/css/atomic/_stacks-misc.less +343 -343
  22. package/lib/css/atomic/_stacks-spacing.less +168 -168
  23. package/lib/css/atomic/_stacks-typography.less +273 -273
  24. package/lib/css/atomic/_stacks-width-height.less +195 -195
  25. package/lib/css/base/_stacks-body.less +44 -46
  26. package/lib/css/base/_stacks-configuration-static.less +59 -59
  27. package/lib/css/base/_stacks-icons.less +20 -20
  28. package/lib/css/base/_stacks-internals.less +220 -230
  29. package/lib/css/base/_stacks-reset-meyer.less +64 -64
  30. package/lib/css/base/_stacks-reset-normalize.less +449 -449
  31. package/lib/css/base/_stacks-reset.less +20 -20
  32. package/lib/css/components/_stacks-activity-indicator.less +45 -45
  33. package/lib/css/components/_stacks-avatars.less +189 -189
  34. package/lib/css/components/_stacks-badges.less +209 -209
  35. package/lib/css/components/_stacks-banners.less +80 -81
  36. package/lib/css/components/_stacks-blank-states.less +26 -26
  37. package/lib/css/components/_stacks-breadcrumbs.less +44 -44
  38. package/lib/css/components/_stacks-button-groups.less +104 -104
  39. package/lib/css/components/_stacks-buttons.less +658 -660
  40. package/lib/css/components/_stacks-cards.less +44 -44
  41. package/lib/css/components/_stacks-code-blocks.less +130 -130
  42. package/lib/css/components/_stacks-collapsible.less +104 -104
  43. package/lib/css/components/_stacks-inputs.less +728 -728
  44. package/lib/css/components/_stacks-link-previews.less +136 -136
  45. package/lib/css/components/_stacks-links.less +218 -218
  46. package/lib/css/components/_stacks-menu.less +47 -47
  47. package/lib/css/components/_stacks-modals.less +133 -133
  48. package/lib/css/components/_stacks-navigation.less +146 -146
  49. package/lib/css/components/_stacks-notices.less +233 -233
  50. package/lib/css/components/_stacks-page-titles.less +60 -60
  51. package/lib/css/components/_stacks-pagination.less +55 -55
  52. package/lib/css/components/_stacks-popovers.less +197 -197
  53. package/lib/css/components/_stacks-post-summary.less +425 -425
  54. package/lib/css/components/_stacks-progress-bars.less +331 -331
  55. package/lib/css/components/_stacks-prose.less +503 -503
  56. package/lib/css/components/_stacks-spinner.less +107 -107
  57. package/lib/css/components/_stacks-tables.less +341 -341
  58. package/lib/css/components/_stacks-tags.less +236 -244
  59. package/lib/css/components/_stacks-toggle-switches.less +144 -144
  60. package/lib/css/components/_stacks-topbar.less +425 -440
  61. package/lib/css/components/_stacks-uploader.less +210 -210
  62. package/lib/css/components/_stacks-user-cards.less +169 -169
  63. package/lib/css/components/_stacks-widget-dynamic.less +33 -33
  64. package/lib/css/components/_stacks-widget-static.less +272 -272
  65. package/lib/css/exports/_stacks-constants-colors.less +1112 -1112
  66. package/lib/css/exports/_stacks-constants-helpers.less +139 -139
  67. package/lib/css/exports/_stacks-constants-type.less +152 -91
  68. package/lib/css/exports/_stacks-exports.less +15 -15
  69. package/lib/css/exports/_stacks-mixins.less +220 -220
  70. package/lib/css/stacks-dynamic.less +35 -36
  71. package/lib/css/stacks-static.less +86 -86
  72. package/lib/ts/controllers/index.ts +8 -0
  73. package/lib/ts/controllers/s-expandable-control.ts +189 -190
  74. package/lib/ts/controllers/s-modal.ts +321 -323
  75. package/lib/ts/controllers/s-navigation-tablist.ts +118 -119
  76. package/lib/ts/controllers/s-popover.ts +547 -549
  77. package/lib/ts/controllers/s-table.ts +220 -220
  78. package/lib/ts/controllers/s-tooltip.ts +246 -247
  79. package/lib/ts/controllers/s-uploader.ts +172 -174
  80. package/lib/ts/index.ts +20 -0
  81. package/lib/ts/stacks.ts +88 -83
  82. package/lib/tsconfig.json +13 -11
  83. package/package.json +87 -71
  84. package/dist/css/stacks-flexgrid-shim.min.css +0 -1
  85. package/lib/css/base/_stacks-configuration-dynamic.less +0 -106
  86. package/lib/ts/finalize.ts +0 -1
  87. package/lib/ts/stimulus.d.ts +0 -4
@@ -1,210 +1,210 @@
1
- //
2
- // STACK OVERFLOW
3
- // FILE UPLOAD -- DYNAMIC PARTS
4
- //
5
- // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
- // Stack Overflow. For documentation of all these classes and how to contribute,
7
- // visit https://stackoverflow.design/
8
-
9
- .s-uploader {
10
- align-items: center;
11
- background-color: var(--black-025);
12
- border-radius: @br-lg;
13
- display: flex;
14
- min-height: @su128;
15
- justify-content: center;
16
- padding: @su8 @su16;
17
- position: relative;
18
- text-align: center;
19
-
20
- // Add the dashed border as an SVG background mask
21
- &:before {
22
- --s-uploader-background-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");
23
- content: '';
24
- display: block;
25
- position: absolute;
26
- top: 0;
27
- left: 0;
28
- right: 0;
29
- bottom: 0;
30
- background-color: var(--black-150);
31
- -webkit-mask-image: var(--s-uploader-background-image);
32
- mask-image: var(--s-uploader-background-image);
33
- border-radius: @br-lg;
34
-
35
- .highcontrast-mode({
36
- background-color: var(--black-400);
37
- });
38
- }
39
-
40
- &.has-error {
41
- background-color: var(--red-050);
42
-
43
- &:before {
44
- background-color: var(--red-400);
45
-
46
- .highcontrast-mode({
47
- background-color: var(--red-400);
48
- });
49
- }
50
-
51
- .s-link {
52
- color: var(--red-900);
53
- }
54
- }
55
-
56
- &.has-success {
57
- background-color: var(--green-025);
58
-
59
- &:before {
60
- background-color: var(--green-400);
61
-
62
- .highcontrast-mode({
63
- background-color: var(--green-400);
64
- });
65
- }
66
-
67
- .s-link {
68
- color: var(--green-900);
69
- }
70
- }
71
-
72
- &.has-warning {
73
- background-color: var(--yellow-050);
74
-
75
- &:before {
76
- background-color: var(--yellow-400);
77
-
78
- .highcontrast-mode({
79
- background-color: var(--yellow-400);
80
- });
81
- }
82
-
83
- .s-link {
84
- color: var(--yellow-900);
85
- }
86
- }
87
-
88
- &.is-active {
89
- background-color: var(--black-050);
90
-
91
- &:before {
92
- background-color: var(--black-200);
93
-
94
- .highcontrast-mode({
95
- background-color: var(--black);
96
- });
97
- }
98
- }
99
-
100
- &.is-disabled {
101
- opacity: 0.5;
102
- }
103
-
104
- // This is to for safari shadow DOM
105
- // see https://github.com/StackExchange/Stacks/pull/690#issuecomment-861028193
106
- input[type="file"]::file-selector-button {
107
- cursor: pointer;
108
- }
109
-
110
- .s-uploader--input {
111
- cursor: pointer;
112
- height: 100%;
113
- inset: 0;
114
- opacity: 0;
115
- position: absolute;
116
- width: 100%;
117
-
118
- &:focus:focus-visible + .s-uploader--container {
119
- background-color: var(--black-050);
120
- box-shadow: 0 0 0 @su4 var(--focus-ring);
121
- }
122
- }
123
-
124
- .s-uploader--preview {
125
- max-width: 100%;
126
- pointer-events: none;
127
- }
128
-
129
- .s-uploader--preview-thumbnail {
130
- background-color: var(--white);
131
- border-radius: @br-sm;
132
- box-shadow: var(--bs-md);
133
- max-height: @su128;
134
- max-width: 100%;
135
- overflow: hidden;
136
- text-overflow: ellipsis;
137
- white-space: nowrap;
138
-
139
- .highcontrast-mode({ border: 1px solid var(--black); });
140
-
141
- &:is(img) {
142
- object-fit: scale-down;
143
- object-position: center;
144
- }
145
-
146
- &:not(img) {
147
- padding: @su16;
148
- }
149
- }
150
-
151
- .s-uploader--previews {
152
- max-width: 100%;
153
- text-align: left;
154
-
155
- &.has-multiple {
156
- display: block;
157
- height: auto;
158
- padding: @su8 @su2;
159
- width: 100%;
160
-
161
- .s-uploader--preview {
162
- align-items: center;
163
- display: flex;
164
- padding: @su6 0;
165
- width: 100%;
166
-
167
- &:after {
168
- content: attr(data-filename);
169
- display: block;
170
- margin-left: @su12;
171
- max-width: 100%;
172
- overflow: hidden;
173
- text-overflow: ellipsis;
174
- white-space: nowrap;
175
- }
176
- }
177
-
178
- .s-uploader--preview-thumbnail {
179
- color: transparent;
180
- height: @su32;
181
- flex-shrink: 0;
182
- width: @su32;
183
-
184
- &:is(img) {
185
- object-fit: cover;
186
- }
187
- &:not(img) {
188
- --s-uploader--preview-document-icon: 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");
189
- background-image: var(--s-uploader--preview-document-icon);
190
- background-position: center;
191
- background-repeat: no-repeat;
192
- }
193
- }
194
- }
195
- }
196
-
197
- .s-uploader--previews-heading {
198
- color: var(--black-900);
199
- font-size: @fs-body2;
200
- font-weight: 600;
201
- padding-bottom: @su8;
202
- }
203
-
204
- .s-uploader--reset {
205
- position: absolute;
206
- right: @su8;
207
- top: @su8;
208
- z-index: @zi-active;
209
- }
210
- }
1
+ //
2
+ // STACK OVERFLOW
3
+ // FILE UPLOAD -- DYNAMIC PARTS
4
+ //
5
+ // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
+ // Stack Overflow. For documentation of all these classes and how to contribute,
7
+ // visit https://stackoverflow.design/
8
+
9
+ .s-uploader {
10
+ align-items: center;
11
+ background-color: var(--black-025);
12
+ border-radius: @br-lg;
13
+ display: flex;
14
+ min-height: @su128;
15
+ justify-content: center;
16
+ padding: @su8 @su16;
17
+ position: relative;
18
+ text-align: center;
19
+
20
+ // Add the dashed border as an SVG background mask
21
+ &:before {
22
+ --s-uploader-background-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");
23
+ content: '';
24
+ display: block;
25
+ position: absolute;
26
+ top: 0;
27
+ left: 0;
28
+ right: 0;
29
+ bottom: 0;
30
+ background-color: var(--black-150);
31
+ -webkit-mask-image: var(--s-uploader-background-image);
32
+ mask-image: var(--s-uploader-background-image);
33
+ border-radius: @br-lg;
34
+
35
+ .highcontrast-mode({
36
+ background-color: var(--black-400);
37
+ });
38
+ }
39
+
40
+ &.has-error {
41
+ background-color: var(--red-050);
42
+
43
+ &:before {
44
+ background-color: var(--red-400);
45
+
46
+ .highcontrast-mode({
47
+ background-color: var(--red-400);
48
+ });
49
+ }
50
+
51
+ .s-link {
52
+ color: var(--red-900);
53
+ }
54
+ }
55
+
56
+ &.has-success {
57
+ background-color: var(--green-025);
58
+
59
+ &:before {
60
+ background-color: var(--green-400);
61
+
62
+ .highcontrast-mode({
63
+ background-color: var(--green-400);
64
+ });
65
+ }
66
+
67
+ .s-link {
68
+ color: var(--green-900);
69
+ }
70
+ }
71
+
72
+ &.has-warning {
73
+ background-color: var(--yellow-050);
74
+
75
+ &:before {
76
+ background-color: var(--yellow-400);
77
+
78
+ .highcontrast-mode({
79
+ background-color: var(--yellow-400);
80
+ });
81
+ }
82
+
83
+ .s-link {
84
+ color: var(--yellow-900);
85
+ }
86
+ }
87
+
88
+ &.is-active {
89
+ background-color: var(--black-050);
90
+
91
+ &:before {
92
+ background-color: var(--black-200);
93
+
94
+ .highcontrast-mode({
95
+ background-color: var(--black);
96
+ });
97
+ }
98
+ }
99
+
100
+ &.is-disabled {
101
+ opacity: 0.5;
102
+ }
103
+
104
+ // This is to for safari shadow DOM
105
+ // see https://github.com/StackExchange/Stacks/pull/690#issuecomment-861028193
106
+ input[type="file"]::file-selector-button {
107
+ cursor: pointer;
108
+ }
109
+
110
+ .s-uploader--input {
111
+ cursor: pointer;
112
+ height: 100%;
113
+ inset: 0;
114
+ opacity: 0;
115
+ position: absolute;
116
+ width: 100%;
117
+
118
+ &:focus:focus-visible + .s-uploader--container {
119
+ background-color: var(--black-050);
120
+ box-shadow: 0 0 0 @su4 var(--focus-ring);
121
+ }
122
+ }
123
+
124
+ .s-uploader--preview {
125
+ max-width: 100%;
126
+ pointer-events: none;
127
+ }
128
+
129
+ .s-uploader--preview-thumbnail {
130
+ background-color: var(--white);
131
+ border-radius: @br-sm;
132
+ box-shadow: var(--bs-md);
133
+ max-height: @su128;
134
+ max-width: 100%;
135
+ overflow: hidden;
136
+ text-overflow: ellipsis;
137
+ white-space: nowrap;
138
+
139
+ .highcontrast-mode({ border: 1px solid var(--black); });
140
+
141
+ &:is(img) {
142
+ object-fit: scale-down;
143
+ object-position: center;
144
+ }
145
+
146
+ &:not(img) {
147
+ padding: @su16;
148
+ }
149
+ }
150
+
151
+ .s-uploader--previews {
152
+ max-width: 100%;
153
+ text-align: left;
154
+
155
+ &.has-multiple {
156
+ display: block;
157
+ height: auto;
158
+ padding: @su8 @su2;
159
+ width: 100%;
160
+
161
+ .s-uploader--preview {
162
+ align-items: center;
163
+ display: flex;
164
+ padding: @su6 0;
165
+ width: 100%;
166
+
167
+ &:after {
168
+ content: attr(data-filename);
169
+ display: block;
170
+ margin-left: @su12;
171
+ max-width: 100%;
172
+ overflow: hidden;
173
+ text-overflow: ellipsis;
174
+ white-space: nowrap;
175
+ }
176
+ }
177
+
178
+ .s-uploader--preview-thumbnail {
179
+ color: transparent;
180
+ height: @su32;
181
+ flex-shrink: 0;
182
+ width: @su32;
183
+
184
+ &:is(img) {
185
+ object-fit: cover;
186
+ }
187
+ &:not(img) {
188
+ --s-uploader--preview-document-icon: 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");
189
+ background-image: var(--s-uploader--preview-document-icon);
190
+ background-position: center;
191
+ background-repeat: no-repeat;
192
+ }
193
+ }
194
+ }
195
+ }
196
+
197
+ .s-uploader--previews-heading {
198
+ color: var(--black-900);
199
+ font-size: @fs-body2;
200
+ font-weight: 600;
201
+ padding-bottom: @su8;
202
+ }
203
+
204
+ .s-uploader--reset {
205
+ position: absolute;
206
+ right: @su8;
207
+ top: @su8;
208
+ z-index: @zi-active;
209
+ }
210
+ }