@stackoverflow/stacks 0.73.1 → 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.
- package/LICENSE.MD +9 -9
- package/README.md +47 -47
- package/dist/controllers/index.d.ts +7 -0
- package/dist/controllers/s-expandable-control.d.ts +17 -0
- package/dist/controllers/s-modal.d.ts +97 -0
- package/dist/controllers/s-navigation-tablist.d.ts +36 -0
- package/dist/controllers/s-popover.d.ts +155 -0
- package/dist/controllers/s-table.d.ts +8 -0
- package/dist/controllers/s-tooltip.d.ts +82 -0
- package/dist/controllers/s-uploader.d.ts +48 -0
- package/dist/css/stacks.css +441 -141
- package/dist/css/stacks.min.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/js/stacks.js +6130 -5488
- package/dist/js/stacks.min.js +1 -1
- package/dist/stacks.d.ts +21 -0
- package/lib/css/atomic/_stacks-borders.less +378 -378
- package/lib/css/atomic/_stacks-colors.less +209 -209
- package/lib/css/atomic/_stacks-flex.less +374 -374
- package/lib/css/atomic/_stacks-grid.less +174 -173
- package/lib/css/atomic/_stacks-misc.less +343 -342
- package/lib/css/atomic/_stacks-spacing.less +168 -162
- package/lib/css/atomic/_stacks-typography.less +273 -270
- package/lib/css/atomic/_stacks-width-height.less +195 -189
- package/lib/css/base/_stacks-body.less +44 -46
- package/lib/css/base/_stacks-configuration-static.less +59 -59
- package/lib/css/base/_stacks-icons.less +20 -20
- package/lib/css/base/_stacks-internals.less +220 -230
- package/lib/css/base/_stacks-reset-meyer.less +64 -64
- package/lib/css/base/_stacks-reset-normalize.less +449 -449
- package/lib/css/base/_stacks-reset.less +20 -20
- package/lib/css/components/_stacks-activity-indicator.less +45 -45
- package/lib/css/components/_stacks-avatars.less +189 -189
- package/lib/css/components/_stacks-badges.less +209 -209
- package/lib/css/components/_stacks-banners.less +80 -81
- package/lib/css/components/_stacks-blank-states.less +26 -26
- package/lib/css/components/_stacks-breadcrumbs.less +44 -44
- package/lib/css/components/_stacks-button-groups.less +104 -104
- package/lib/css/components/_stacks-buttons.less +658 -660
- package/lib/css/components/_stacks-cards.less +44 -44
- package/lib/css/components/_stacks-code-blocks.less +130 -130
- package/lib/css/components/_stacks-collapsible.less +104 -104
- package/lib/css/components/_stacks-inputs.less +728 -724
- package/lib/css/components/_stacks-link-previews.less +136 -136
- package/lib/css/components/_stacks-links.less +218 -218
- package/lib/css/components/_stacks-menu.less +47 -47
- package/lib/css/components/_stacks-modals.less +133 -133
- package/lib/css/components/_stacks-navigation.less +146 -146
- package/lib/css/components/_stacks-notices.less +233 -233
- package/lib/css/components/_stacks-page-titles.less +60 -60
- package/lib/css/components/_stacks-pagination.less +55 -55
- package/lib/css/components/_stacks-popovers.less +197 -197
- package/lib/css/components/_stacks-post-summary.less +425 -311
- package/lib/css/components/_stacks-progress-bars.less +331 -331
- package/lib/css/components/_stacks-prose.less +503 -503
- package/lib/css/components/_stacks-spinner.less +107 -107
- package/lib/css/components/_stacks-tables.less +341 -341
- package/lib/css/components/_stacks-tags.less +237 -209
- package/lib/css/components/_stacks-toggle-switches.less +144 -137
- package/lib/css/components/_stacks-topbar.less +425 -440
- package/lib/css/components/_stacks-uploader.less +210 -210
- package/lib/css/components/_stacks-user-cards.less +169 -193
- package/lib/css/components/_stacks-widget-dynamic.less +33 -33
- package/lib/css/components/_stacks-widget-static.less +272 -272
- package/lib/css/exports/_stacks-constants-colors.less +1112 -1098
- package/lib/css/exports/_stacks-constants-helpers.less +139 -139
- package/lib/css/exports/_stacks-constants-type.less +152 -91
- package/lib/css/exports/_stacks-exports.less +15 -15
- package/lib/css/exports/_stacks-mixins.less +220 -220
- package/lib/css/stacks-dynamic.less +35 -36
- package/lib/css/stacks-static.less +86 -86
- package/lib/ts/controllers/index.ts +8 -0
- package/lib/ts/controllers/s-expandable-control.ts +189 -190
- package/lib/ts/controllers/s-modal.ts +321 -323
- package/lib/ts/controllers/s-navigation-tablist.ts +118 -119
- package/lib/ts/controllers/s-popover.ts +547 -549
- package/lib/ts/controllers/s-table.ts +220 -220
- package/lib/ts/controllers/s-tooltip.ts +246 -247
- package/lib/ts/controllers/s-uploader.ts +172 -174
- package/lib/ts/index.ts +20 -0
- package/lib/ts/stacks.ts +88 -83
- package/lib/tsconfig.json +13 -11
- package/package.json +87 -71
- package/dist/css/stacks-flexgrid-shim.min.css +0 -1
- package/lib/css/base/_stacks-configuration-dynamic.less +0 -106
- package/lib/ts/finalize.ts +0 -1
- package/lib/ts/stimulus.d.ts +0 -4
|
@@ -1,137 +1,144 @@
|
|
|
1
|
-
//
|
|
2
|
-
// STACK OVERFLOW
|
|
3
|
-
// TOGGLE SWITCHES
|
|
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
|
-
// ============================================================================
|
|
10
|
-
// $ BASE STYLE
|
|
11
|
-
// ----------------------------------------------------------------------------
|
|
12
|
-
.s-toggle-switch {
|
|
13
|
-
position: relative;
|
|
14
|
-
|
|
15
|
-
input[type="checkbox"] {
|
|
16
|
-
// Hide the checkbox underneath the .s-toggle-switch--indicator.
|
|
17
|
-
margin: 0; // guard against production adding 5px of margin to these
|
|
18
|
-
opacity: 0;
|
|
19
|
-
position: absolute;
|
|
20
|
-
left: 0;
|
|
21
|
-
top: 0;
|
|
22
|
-
width: 44px;
|
|
23
|
-
height: 24px;
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
|
|
26
|
-
+ .s-toggle-switch--indicator {
|
|
27
|
-
pointer-events: none;
|
|
28
|
-
outline: 0;
|
|
29
|
-
display: block;
|
|
30
|
-
width: 44px;
|
|
31
|
-
height: 24px;
|
|
32
|
-
position: relative;
|
|
33
|
-
background: var(--black-300);
|
|
34
|
-
border-radius: 1000px;
|
|
35
|
-
padding: 3px;
|
|
36
|
-
transition: left 0.2s ease;
|
|
37
|
-
|
|
38
|
-
&:after,
|
|
39
|
-
&:before {
|
|
40
|
-
position: relative;
|
|
41
|
-
display: block;
|
|
42
|
-
content: "";
|
|
43
|
-
width: 50%;
|
|
44
|
-
height: 100%;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&:after {
|
|
48
|
-
left: 0;
|
|
49
|
-
border-radius: 50%;
|
|
50
|
-
background: @white;
|
|
51
|
-
transition: left 0.1s ease;
|
|
52
|
-
|
|
53
|
-
.highcontrast-mode({
|
|
54
|
-
background: var(--white);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&:before {
|
|
59
|
-
display: none;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&:checked + .s-toggle-switch--indicator {
|
|
64
|
-
background: var(--green-400);
|
|
65
|
-
|
|
66
|
-
&:after {
|
|
67
|
-
left: 50%;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
&:focus + .s-toggle-switch--indicator {
|
|
72
|
-
box-shadow: 0 0 0 @su4 var(--focus-ring-muted);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&:checked:focus + .s-toggle-switch--indicator {
|
|
76
|
-
box-shadow: 0 0 0 @su4 var(--focus-ring-success);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&.s-toggle-switch__multiple {
|
|
81
|
-
display: flex;
|
|
82
|
-
align-items: stretch;
|
|
83
|
-
|
|
84
|
-
// First hide the radio buttons
|
|
85
|
-
input[type="radio"] {
|
|
86
|
-
position: absolute;
|
|
87
|
-
left: -999em;
|
|
88
|
-
opacity: 0;
|
|
89
|
-
margin: 0;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Next modifications to option cells
|
|
93
|
-
label {
|
|
94
|
-
// Style the base label
|
|
95
|
-
width: 100%;
|
|
96
|
-
margin: 0;
|
|
97
|
-
padding: 0.5em 0.7em;
|
|
98
|
-
border-radius: 1000px;
|
|
99
|
-
color: var(--black-500);
|
|
100
|
-
font-size: @fs-body1;
|
|
101
|
-
font-weight: 400;
|
|
102
|
-
line-height: 1;
|
|
103
|
-
text-align: center;
|
|
104
|
-
white-space: nowrap;
|
|
105
|
-
cursor: pointer;
|
|
106
|
-
|
|
107
|
-
-webkit-touch-callout: none;
|
|
108
|
-
-webkit-user-select: none;
|
|
109
|
-
user-select: none;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// If the input is selected, style its label accordingly.
|
|
113
|
-
input[type="radio"]:checked {
|
|
114
|
-
+ label {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
1
|
+
//
|
|
2
|
+
// STACK OVERFLOW
|
|
3
|
+
// TOGGLE SWITCHES
|
|
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
|
+
// ============================================================================
|
|
10
|
+
// $ BASE STYLE
|
|
11
|
+
// ----------------------------------------------------------------------------
|
|
12
|
+
.s-toggle-switch {
|
|
13
|
+
position: relative;
|
|
14
|
+
|
|
15
|
+
input[type="checkbox"] {
|
|
16
|
+
// Hide the checkbox underneath the .s-toggle-switch--indicator.
|
|
17
|
+
margin: 0; // guard against production adding 5px of margin to these
|
|
18
|
+
opacity: 0;
|
|
19
|
+
position: absolute;
|
|
20
|
+
left: 0;
|
|
21
|
+
top: 0;
|
|
22
|
+
width: 44px;
|
|
23
|
+
height: 24px;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
|
|
26
|
+
+ .s-toggle-switch--indicator {
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
outline: 0;
|
|
29
|
+
display: block;
|
|
30
|
+
width: 44px;
|
|
31
|
+
height: 24px;
|
|
32
|
+
position: relative;
|
|
33
|
+
background: var(--black-300);
|
|
34
|
+
border-radius: 1000px;
|
|
35
|
+
padding: 3px;
|
|
36
|
+
transition: left 0.2s ease;
|
|
37
|
+
|
|
38
|
+
&:after,
|
|
39
|
+
&:before {
|
|
40
|
+
position: relative;
|
|
41
|
+
display: block;
|
|
42
|
+
content: "";
|
|
43
|
+
width: 50%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:after {
|
|
48
|
+
left: 0;
|
|
49
|
+
border-radius: 50%;
|
|
50
|
+
background: @white;
|
|
51
|
+
transition: left 0.1s ease;
|
|
52
|
+
|
|
53
|
+
.highcontrast-mode({
|
|
54
|
+
background: var(--white);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:before {
|
|
59
|
+
display: none;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:checked + .s-toggle-switch--indicator {
|
|
64
|
+
background: var(--green-400);
|
|
65
|
+
|
|
66
|
+
&:after {
|
|
67
|
+
left: 50%;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:focus + .s-toggle-switch--indicator {
|
|
72
|
+
box-shadow: 0 0 0 @su4 var(--focus-ring-muted);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:checked:focus + .s-toggle-switch--indicator {
|
|
76
|
+
box-shadow: 0 0 0 @su4 var(--focus-ring-success);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.s-toggle-switch__multiple {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: stretch;
|
|
83
|
+
|
|
84
|
+
// First hide the radio buttons
|
|
85
|
+
input[type="radio"] {
|
|
86
|
+
position: absolute;
|
|
87
|
+
left: -999em;
|
|
88
|
+
opacity: 0;
|
|
89
|
+
margin: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Next modifications to option cells
|
|
93
|
+
label {
|
|
94
|
+
// Style the base label
|
|
95
|
+
width: 100%;
|
|
96
|
+
margin: 0;
|
|
97
|
+
padding: 0.5em 0.7em;
|
|
98
|
+
border-radius: 1000px;
|
|
99
|
+
color: var(--black-500);
|
|
100
|
+
font-size: @fs-body1;
|
|
101
|
+
font-weight: 400;
|
|
102
|
+
line-height: 1;
|
|
103
|
+
text-align: center;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
|
|
107
|
+
-webkit-touch-callout: none;
|
|
108
|
+
-webkit-user-select: none;
|
|
109
|
+
user-select: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// If the input is selected, style its label accordingly.
|
|
113
|
+
input[type="radio"]:checked {
|
|
114
|
+
+ label {
|
|
115
|
+
&.s-toggle-switch--label-off {
|
|
116
|
+
background-color: var(--black-300);
|
|
117
|
+
color: @white;
|
|
118
|
+
|
|
119
|
+
.highcontrast-mode({
|
|
120
|
+
color: var(--white);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Color activated options green
|
|
125
|
+
&:not(.s-toggle-switch--label-off) {
|
|
126
|
+
background-color: var(--green-400);
|
|
127
|
+
color: @white;
|
|
128
|
+
|
|
129
|
+
.highcontrast-mode({
|
|
130
|
+
color: var(--white);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&:focus + label.s-toggle-switch--label-off {
|
|
136
|
+
box-shadow: 0 0 0 @su4 var(--focus-ring-muted);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&:focus + label:not(.s-toggle-switch--label-off) {
|
|
140
|
+
box-shadow: 0 0 0 @su4 var(--focus-ring-success);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|