@stackoverflow/stacks 1.8.0 → 1.9.1
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/README.md +161 -153
- package/dist/{controllers/s-banner.d.ts → components/banner/banner.d.ts} +1 -1
- package/dist/{controllers/s-expandable-control.d.ts → components/expandable/expandable.d.ts} +1 -1
- package/dist/{controllers/s-modal.d.ts → components/modal/modal.d.ts} +1 -1
- package/dist/{controllers/s-navigation-tablist.d.ts → components/navigation/navigation.d.ts} +1 -1
- package/dist/{controllers/s-popover.d.ts → components/popover/popover.d.ts} +1 -1
- package/dist/{controllers/s-tooltip.d.ts → components/popover/tooltip.d.ts} +1 -1
- package/dist/components/table/table.d.ts +30 -0
- package/dist/{controllers/s-toast.d.ts → components/toast/toast.d.ts} +1 -1
- package/dist/{controllers/s-uploader.d.ts → components/uploader/uploader.d.ts} +1 -1
- package/dist/controllers.d.ts +9 -0
- package/dist/css/stacks.css +2063 -1994
- package/dist/css/stacks.min.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/js/stacks.js +1465 -1436
- package/dist/js/stacks.min.js +1 -1
- package/lib/{css/atomic/borders.less → atomic/border.less} +397 -379
- package/lib/{css/atomic/colors.less → atomic/color.less} +210 -210
- package/lib/{css/atomic → atomic}/flex.less +426 -426
- package/lib/{css/atomic → atomic}/gap.less +44 -44
- package/lib/{css/atomic → atomic}/grid.less +139 -139
- package/lib/{css/atomic → atomic}/misc.less +343 -343
- package/lib/{css/atomic → atomic}/spacing.less +342 -342
- package/lib/{css/atomic → atomic}/typography.less +267 -267
- package/lib/{css/atomic → atomic}/width-height.less +194 -194
- package/lib/{css/base → base}/body.less +44 -44
- package/lib/{css/base → base}/configuration-static.less +61 -61
- package/lib/{css/base → base}/fieldset.less +5 -5
- package/lib/{css/base/icons.less → base/icon.less} +11 -20
- package/lib/{css/base/internals.less → base/internal.less} +220 -220
- package/lib/{css/base → base}/reset-meyer.less +64 -64
- package/lib/{css/base → base}/reset-normalize.less +449 -449
- package/lib/{css/base → base}/reset.less +20 -20
- package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +21 -0
- package/lib/{css/components → components/activity-indicator}/activity-indicator.less +40 -40
- package/lib/components/activity-indicator/activity-indicator.visual.test.ts +23 -0
- package/lib/{css/components/anchors.less → components/anchor/anchor.less} +61 -61
- package/lib/components/avatar/avatar.a11y.test.ts +36 -0
- package/lib/{css/components/avatars.less → components/avatar/avatar.less} +108 -108
- package/lib/components/avatar/avatar.visual.test.ts +54 -0
- package/lib/components/award-bling/award-bling.a11y.test.ts +17 -0
- package/lib/{css/components → components/award-bling}/award-bling.less +31 -31
- package/lib/components/award-bling/award-bling.visual.test.ts +26 -0
- package/lib/{css/components/badges.less → components/badge/badge.less} +251 -251
- package/lib/components/banner/banner.a11y.test.ts +37 -0
- package/lib/components/banner/banner.less +51 -0
- package/lib/{test/s-banner.test.ts → components/banner/banner.test.ts} +73 -73
- package/lib/{ts/controllers/s-banner.ts → components/banner/banner.ts} +149 -149
- package/lib/components/banner/banner.visual.test.ts +37 -0
- package/lib/components/block-link/block-link.a11y.test.ts +68 -0
- package/lib/{css/components → components/block-link}/block-link.less +80 -80
- package/lib/components/block-link/block-link.visual.test.ts +61 -0
- package/lib/components/breadcrumbs/breadcrumbs.a11y.test.ts +37 -0
- package/lib/{css/components → components/breadcrumbs}/breadcrumbs.less +41 -41
- package/lib/components/breadcrumbs/breadcrumbs.visual.test.ts +37 -0
- package/lib/components/button/button.a11y.test.ts +32 -0
- package/lib/{css/components/buttons.less → components/button/button.less} +502 -501
- package/lib/components/button/button.visual.test.ts +52 -0
- package/lib/{css/components/button-groups.less → components/button-group/button-group.less} +83 -83
- package/lib/components/card/card.a11y.test.ts +13 -0
- package/lib/{css/components/cards.less → components/card/card.less} +29 -29
- package/lib/components/card/card.visual.test.ts +54 -0
- package/lib/components/check-control/check-control.less +17 -0
- package/lib/components/check-group/check-group.less +19 -0
- package/lib/{css/components/checkboxes-radios.less → components/checkbox_radio/checkbox_radio.less} +158 -158
- package/lib/{css/components/code-blocks.less → components/code-block/code-block.less} +116 -116
- package/lib/{css/components → components/description}/description.less +9 -9
- package/lib/{css/components/empty-states.less → components/empty-state/empty-state.less} +16 -16
- package/lib/{css/components → components/expandable}/expandable.less +118 -115
- package/lib/components/expandable/expandable.test.ts +51 -0
- package/lib/{ts/controllers/s-expandable-control.ts → components/expandable/expandable.ts} +238 -238
- package/lib/components/input-fill/input-fill.less +35 -0
- package/lib/components/input-icon/input-icon.less +45 -0
- package/lib/components/input-message/input-message.less +48 -0
- package/lib/{css/components/inputs.less → components/input_textarea/input_textarea.less} +166 -297
- package/lib/{css/components/labels.less → components/label/label.less} +111 -111
- package/lib/{css/components → components/link}/link.less +119 -119
- package/lib/{css/components/link-previews.less → components/link-preview/link-preview.less} +139 -139
- package/lib/{css/components → components/menu}/menu.less +41 -41
- package/lib/{css/components/modals.less → components/modal/modal.less} +113 -113
- package/lib/{ts/controllers/s-modal.ts → components/modal/modal.ts} +379 -379
- package/lib/{css/components → components/navigation}/navigation.less +134 -134
- package/lib/{ts/controllers/s-navigation-tablist.ts → components/navigation/navigation.ts} +128 -128
- package/lib/{css/components/notices.less → components/notice/notice.less} +203 -292
- package/lib/{css/components/page-titles.less → components/page-title/page-title.less} +51 -51
- package/lib/{css/components → components/pagination}/pagination.less +52 -52
- package/lib/{css/components/popovers.less → components/popover/popover.less} +148 -147
- package/lib/{ts/controllers/s-popover.ts → components/popover/popover.ts} +651 -651
- package/lib/{test/s-tooltip.test.ts → components/popover/tooltip.test.ts} +62 -62
- package/lib/{ts/controllers/s-tooltip.ts → components/popover/tooltip.ts} +343 -343
- package/lib/{test/s-tooltip.visual.test.ts → components/popover/tooltip.visual.test.ts} +31 -31
- package/lib/{css/components → components/post-summary}/post-summary.less +415 -415
- package/lib/{css/components/progress-bars.less → components/progress-bar/progress-bar.less} +291 -291
- package/lib/{css/components → components/prose}/prose.less +452 -452
- package/lib/{css/components → components/select}/select.less +148 -148
- package/lib/{css/components/sidebar-widgets.less → components/sidebar-widget/sidebar-widget.less} +257 -259
- package/lib/{css/components → components/spinner}/spinner.less +103 -103
- package/lib/{css/components → components/table}/table.less +307 -297
- package/lib/components/table/table.test.ts +366 -0
- package/lib/{ts/controllers/s-table.ts → components/table/table.ts} +296 -263
- package/lib/components/table-container/table-container.less +4 -0
- package/lib/{css/components/tags.less → components/tag/tag.less} +213 -213
- package/lib/components/toast/toast.less +35 -0
- package/lib/{test/s-toast.test.ts → components/toast/toast.test.ts} +63 -63
- package/lib/{ts/controllers/s-toast.ts → components/toast/toast.ts} +357 -357
- package/lib/components/toast/toast.visual.test.ts +27 -0
- package/lib/{css/components/toggle-switches.less → components/toggle-switch/toggle-switch.less} +110 -110
- package/lib/{css/components → components/topbar}/topbar.less +436 -435
- package/lib/{css/components → components/uploader}/uploader.less +195 -195
- package/lib/{ts/controllers/s-uploader.ts → components/uploader/uploader.ts} +205 -205
- package/lib/{css/components/user-cards.less → components/user-card/user-card.less} +129 -129
- package/lib/controllers.ts +33 -0
- package/lib/{css/exports → exports}/constants-colors.less +1112 -1111
- package/lib/{css/exports → exports}/constants-helpers.less +108 -108
- package/lib/{css/exports → exports}/constants-type.less +153 -153
- package/lib/{css/exports → exports}/exports.less +15 -15
- package/lib/{css/exports → exports}/mixins.less +299 -299
- package/lib/{ts/index.ts → index.ts} +32 -32
- package/lib/{css/input-utils.less → input-utils.less} +44 -44
- package/lib/{css/stacks-dynamic.less → stacks-dynamic.less} +24 -25
- package/lib/stacks-static.less +93 -0
- package/lib/{css/stacks.less → stacks.less} +13 -13
- package/lib/{ts/stacks.ts → stacks.ts} +113 -113
- package/lib/test/open-wc-testing-patch.d.ts +26 -0
- package/lib/test/test-utils.ts +466 -0
- package/lib/tsconfig.build.json +4 -0
- package/lib/tsconfig.json +16 -13
- package/package.json +106 -105
- package/dist/controllers/index.d.ts +0 -9
- package/dist/controllers/s-table.d.ts +0 -8
- package/lib/css/stacks-static.less +0 -87
- package/lib/test/s-avatar.a11y.test.ts +0 -77
- package/lib/test/s-banner.visual.test.ts +0 -61
- package/lib/test/s-btn.a11y.test.ts +0 -123
- package/lib/test/s-btn.visual.test.ts +0 -16
- package/lib/test/s-toast.visual.test.ts +0 -48
- package/lib/ts/controllers/index.ts +0 -17
|
@@ -1,291 +1,291 @@
|
|
|
1
|
-
.s-progress {
|
|
2
|
-
// COMPONENT-SPECIFIC CONSTANTS
|
|
3
|
-
@pr-circle-circumference: (2 * pi() * 14); // 2πr, r = 14.
|
|
4
|
-
// COMPONENT-SPECIFIC CUSTOM PROPERTIES
|
|
5
|
-
--_pr-bar: var(--br-sm);
|
|
6
|
-
--_pr-bg: var(--black-200);
|
|
7
|
-
--_pr-h: unset;
|
|
8
|
-
--_pr-size: unset;
|
|
9
|
-
--_pr-w: 100%;
|
|
10
|
-
--_pr-hmn: var(--su-static4);
|
|
11
|
-
--_pr-bar-bar: var(--br-sm);
|
|
12
|
-
--_pr-bar-bg: var(--green-400);
|
|
13
|
-
--_pr-bar-hmn: var(--su-static4);
|
|
14
|
-
--_pr-label-ai: unset;
|
|
15
|
-
--_pr-label-bc: transparent;
|
|
16
|
-
--_pr-label-d: unset;
|
|
17
|
-
--_pr-label-g: unset;
|
|
18
|
-
--_pr-label-jc: unset;
|
|
19
|
-
--_pr-label-px: unset;
|
|
20
|
-
|
|
21
|
-
// MODIFIERS
|
|
22
|
-
&&__brand {
|
|
23
|
-
--_pr-bar-bg: var(--orange-500);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&&__bronze {
|
|
27
|
-
--_pr-bar-bg: var(--bronze-lighter);
|
|
28
|
-
--_pr-label-bc: var(--bronze-darker);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&&__gold {
|
|
32
|
-
--_pr-bar-bg: var(--gold-lighter);
|
|
33
|
-
--_pr-label-bc: var(--gold-darker);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&&__info {
|
|
37
|
-
--_pr-bar-bg: var(--blue-500);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&&__silver {
|
|
41
|
-
--_pr-bar-bg: var(--silver-lighter);
|
|
42
|
-
--_pr-label-bc: var(--silver-darker);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// VARIANTS
|
|
46
|
-
&&__badge,
|
|
47
|
-
&&__privilege {
|
|
48
|
-
--_pr-bar: var(--br-md);
|
|
49
|
-
--_pr-bg: transparent;
|
|
50
|
-
--_pr-hmn: 2em;
|
|
51
|
-
--_pr-bar-bar: var(--br-md);
|
|
52
|
-
--_pr-bar-hmn: 2em;
|
|
53
|
-
--_pr-label-d: flex;
|
|
54
|
-
--_pr-label-g: var(--su4);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&&__badge {
|
|
58
|
-
--_pr-label-ai: center;
|
|
59
|
-
--_pr-label-px: 1em;
|
|
60
|
-
|
|
61
|
-
.s-progress--label {
|
|
62
|
-
.s-badge--label {
|
|
63
|
-
flex-grow: 1;
|
|
64
|
-
text-align: center;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
&&__circular {
|
|
70
|
-
--_pr-bg: transparent;
|
|
71
|
-
--_pr-size: var(--su-static32);
|
|
72
|
-
--s-progress-value: 0;
|
|
73
|
-
|
|
74
|
-
&.s-progress {
|
|
75
|
-
&__sm {
|
|
76
|
-
--_pr-size: var(--su-static24);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&__md {
|
|
80
|
-
--_pr-size: var(--su-static48);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
&__lg {
|
|
84
|
-
--_pr-size: var(--su-static64);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// TODO: consider renaming to `.s-progress--bar`
|
|
89
|
-
.s-progress-bar { // It may necessitate wrapping element in a `&:not(&__circular)`
|
|
90
|
-
circle {
|
|
91
|
-
&:nth-of-type(1) {
|
|
92
|
-
opacity: 0.4;
|
|
93
|
-
stroke: currentColor;
|
|
94
|
-
}
|
|
95
|
-
&:nth-of-type(2) {
|
|
96
|
-
stroke: currentColor;
|
|
97
|
-
stroke-dasharray: @pr-circle-circumference; // [1]
|
|
98
|
-
stroke-dashoffset: calc(((1 - var(--s-progress-value)) * @pr-circle-circumference) * 1px); // Multiply everything by 1px since Safari and Firefox require these to be in pixels
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
fill: none;
|
|
102
|
-
stroke-linecap: round;
|
|
103
|
-
stroke-width: var(--su-static4);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
transform: rotate(270deg); // Make everything originate from the top of the circle
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&&__privilege {
|
|
111
|
-
--_pr-bar-bg: var(--green-050);
|
|
112
|
-
--_pr-label-ai: center;
|
|
113
|
-
--_pr-label-bc: var(--green-400);
|
|
114
|
-
--_pr-label-jc: center;
|
|
115
|
-
|
|
116
|
-
.highcontrast-mode({ --_pr-bar-bg: var(--green-200); });
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// TODO move `.s-progress__stepped` to entirely separate component (or consider deprecating)
|
|
120
|
-
&&__stepped { // There's so little overlap with the base .s-progress that it doesn't make sense as a variant
|
|
121
|
-
background: transparent;
|
|
122
|
-
display: flex;
|
|
123
|
-
|
|
124
|
-
.s-progress {
|
|
125
|
-
&--bar {
|
|
126
|
-
&.s-progress--bar {
|
|
127
|
-
&__left {
|
|
128
|
-
left: 0;
|
|
129
|
-
right: 50%;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
&__right {
|
|
133
|
-
left: 50%;
|
|
134
|
-
right: 0;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
background: var(--black-300);
|
|
139
|
-
border-radius: 0;
|
|
140
|
-
height: var(--su-static6);
|
|
141
|
-
position: absolute;
|
|
142
|
-
top: calc(var(--su-static8) + var(--su-static1));
|
|
143
|
-
z-index: var(--zi-base);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
&--label { // Override a ton of properties
|
|
147
|
-
border: 0;
|
|
148
|
-
border-radius: 0;
|
|
149
|
-
color: var(--black-500);
|
|
150
|
-
display: block;
|
|
151
|
-
font-size: var(--fs-body1);
|
|
152
|
-
height: auto;
|
|
153
|
-
padding: var(--su12) var(--su6) 0 var(--su6);
|
|
154
|
-
position: static;
|
|
155
|
-
text-align: center;
|
|
156
|
-
width: auto;
|
|
157
|
-
z-index: var(--zi-base);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
&--step {
|
|
161
|
-
&.is-active {
|
|
162
|
-
.s-progress {
|
|
163
|
-
&--bar.s-progress--bar__left {
|
|
164
|
-
background: var(--theme-secondary-400);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
&--label {
|
|
168
|
-
color: var(--fc-dark);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
&--stop {
|
|
172
|
-
background: var(--theme-secondary-400);
|
|
173
|
-
box-shadow: 0 0 0 var(--su-static6) var(--focus-ring);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
&.is-complete {
|
|
179
|
-
.s-progress {
|
|
180
|
-
&--bar,
|
|
181
|
-
&--stop {
|
|
182
|
-
background: var(--theme-secondary-400);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
&--label {
|
|
186
|
-
color: var(--fc-dark);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
align-items: center;
|
|
192
|
-
display: flex;
|
|
193
|
-
flex-basis: 0;
|
|
194
|
-
flex-direction: column;
|
|
195
|
-
flex-grow: 1;
|
|
196
|
-
flex-shrink: 1;
|
|
197
|
-
position: relative;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
&--stop {
|
|
201
|
-
.highcontrast-mode({
|
|
202
|
-
color: var(--white);
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
align-items: center;
|
|
206
|
-
background: var(--black-300);
|
|
207
|
-
border-radius: 100%;
|
|
208
|
-
color: @white;
|
|
209
|
-
display: flex;
|
|
210
|
-
height: var(--su-static24);
|
|
211
|
-
justify-content: center;
|
|
212
|
-
position: relative;
|
|
213
|
-
width: var(--su-static24);
|
|
214
|
-
z-index: var(--zi-selected);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// CHILD ELEMENTS
|
|
220
|
-
& &--bar {
|
|
221
|
-
background-color: var(--_pr-bar-bg);
|
|
222
|
-
border-radius: var(--_pr-bar);
|
|
223
|
-
min-height: var(--_pr-hmn);
|
|
224
|
-
|
|
225
|
-
height: 100%;
|
|
226
|
-
min-width: var(--su-static6);
|
|
227
|
-
position: relative;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
& &--label {
|
|
231
|
-
align-items: var(--_pr-label-ai);
|
|
232
|
-
border: var(--su-static1) solid var(--_pr-label-bc);
|
|
233
|
-
display: var(--_pr-label-d);
|
|
234
|
-
gap: var(--_pr-label-g);
|
|
235
|
-
justify-content: var(--_pr-label-jc);
|
|
236
|
-
padding-left: var(--_pr-label-px);
|
|
237
|
-
padding-right: var(--_pr-label-px);
|
|
238
|
-
|
|
239
|
-
border-radius: var(--br-md);
|
|
240
|
-
color: var(--fc-dark);
|
|
241
|
-
font-size: var(--fs-caption);
|
|
242
|
-
height: 100%;
|
|
243
|
-
line-height: var(--lh-xs);
|
|
244
|
-
position: absolute;
|
|
245
|
-
width: 100%;
|
|
246
|
-
z-index: calc(var(--zi-base) + 2);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
& &--segments { // DEPRECATED: AFAICT, this is unused in core (as well as it's intended parent variant class `.s-progress__segmented`)
|
|
250
|
-
li {
|
|
251
|
-
&:not(:first-child):not(:last-child):before {
|
|
252
|
-
background-color: var(--white);
|
|
253
|
-
content: "";
|
|
254
|
-
display: block;
|
|
255
|
-
height: 100%;
|
|
256
|
-
left: calc(var(--su-static1) * -1); // -1px
|
|
257
|
-
position: absolute;
|
|
258
|
-
top: 0;
|
|
259
|
-
width: var(--su-static4);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
display: block;
|
|
263
|
-
padding-top: var(--su-static4);
|
|
264
|
-
position: relative;
|
|
265
|
-
text-align: center;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
display: flex;
|
|
269
|
-
height: 100%;
|
|
270
|
-
justify-content: space-between;
|
|
271
|
-
list-style: none;
|
|
272
|
-
margin: 0;
|
|
273
|
-
padding: 0;
|
|
274
|
-
position: absolute;
|
|
275
|
-
top: 0;
|
|
276
|
-
width: 100%;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
background-color: var(--_pr-bg);
|
|
280
|
-
border-radius: var(--_pr-bar);
|
|
281
|
-
height: var(--_pr-size, var(--_pr-h));
|
|
282
|
-
min-height: var(--_pr-hmn);
|
|
283
|
-
|
|
284
|
-
min-width: var(--su-static6);
|
|
285
|
-
position: relative;
|
|
286
|
-
width: var(--_pr-size, var(--_pr-w));
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// [1] Multiply the circle circumference by an the opposite percentage of what we want to display
|
|
290
|
-
// For example 70%, represented as a decimal is 0.7
|
|
291
|
-
// The opposite of that is 0.3 so ( 1 - 0.7 )
|
|
1
|
+
.s-progress {
|
|
2
|
+
// COMPONENT-SPECIFIC CONSTANTS
|
|
3
|
+
@pr-circle-circumference: (2 * pi() * 14); // 2πr, r = 14.
|
|
4
|
+
// COMPONENT-SPECIFIC CUSTOM PROPERTIES
|
|
5
|
+
--_pr-bar: var(--br-sm);
|
|
6
|
+
--_pr-bg: var(--black-200);
|
|
7
|
+
--_pr-h: unset;
|
|
8
|
+
--_pr-size: unset;
|
|
9
|
+
--_pr-w: 100%;
|
|
10
|
+
--_pr-hmn: var(--su-static4);
|
|
11
|
+
--_pr-bar-bar: var(--br-sm);
|
|
12
|
+
--_pr-bar-bg: var(--green-400);
|
|
13
|
+
--_pr-bar-hmn: var(--su-static4);
|
|
14
|
+
--_pr-label-ai: unset;
|
|
15
|
+
--_pr-label-bc: transparent;
|
|
16
|
+
--_pr-label-d: unset;
|
|
17
|
+
--_pr-label-g: unset;
|
|
18
|
+
--_pr-label-jc: unset;
|
|
19
|
+
--_pr-label-px: unset;
|
|
20
|
+
|
|
21
|
+
// MODIFIERS
|
|
22
|
+
&&__brand {
|
|
23
|
+
--_pr-bar-bg: var(--orange-500);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&&__bronze {
|
|
27
|
+
--_pr-bar-bg: var(--bronze-lighter);
|
|
28
|
+
--_pr-label-bc: var(--bronze-darker);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&&__gold {
|
|
32
|
+
--_pr-bar-bg: var(--gold-lighter);
|
|
33
|
+
--_pr-label-bc: var(--gold-darker);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&&__info {
|
|
37
|
+
--_pr-bar-bg: var(--blue-500);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&&__silver {
|
|
41
|
+
--_pr-bar-bg: var(--silver-lighter);
|
|
42
|
+
--_pr-label-bc: var(--silver-darker);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// VARIANTS
|
|
46
|
+
&&__badge,
|
|
47
|
+
&&__privilege {
|
|
48
|
+
--_pr-bar: var(--br-md);
|
|
49
|
+
--_pr-bg: transparent;
|
|
50
|
+
--_pr-hmn: 2em;
|
|
51
|
+
--_pr-bar-bar: var(--br-md);
|
|
52
|
+
--_pr-bar-hmn: 2em;
|
|
53
|
+
--_pr-label-d: flex;
|
|
54
|
+
--_pr-label-g: var(--su4);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&&__badge {
|
|
58
|
+
--_pr-label-ai: center;
|
|
59
|
+
--_pr-label-px: 1em;
|
|
60
|
+
|
|
61
|
+
.s-progress--label {
|
|
62
|
+
.s-badge--label {
|
|
63
|
+
flex-grow: 1;
|
|
64
|
+
text-align: center;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&&__circular {
|
|
70
|
+
--_pr-bg: transparent;
|
|
71
|
+
--_pr-size: var(--su-static32);
|
|
72
|
+
--s-progress-value: 0;
|
|
73
|
+
|
|
74
|
+
&.s-progress {
|
|
75
|
+
&__sm {
|
|
76
|
+
--_pr-size: var(--su-static24);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&__md {
|
|
80
|
+
--_pr-size: var(--su-static48);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&__lg {
|
|
84
|
+
--_pr-size: var(--su-static64);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// TODO: consider renaming to `.s-progress--bar`
|
|
89
|
+
.s-progress-bar { // It may necessitate wrapping element in a `&:not(&__circular)`
|
|
90
|
+
circle {
|
|
91
|
+
&:nth-of-type(1) {
|
|
92
|
+
opacity: 0.4;
|
|
93
|
+
stroke: currentColor;
|
|
94
|
+
}
|
|
95
|
+
&:nth-of-type(2) {
|
|
96
|
+
stroke: currentColor;
|
|
97
|
+
stroke-dasharray: @pr-circle-circumference; // [1]
|
|
98
|
+
stroke-dashoffset: calc(((1 - var(--s-progress-value)) * @pr-circle-circumference) * 1px); // Multiply everything by 1px since Safari and Firefox require these to be in pixels
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
fill: none;
|
|
102
|
+
stroke-linecap: round;
|
|
103
|
+
stroke-width: var(--su-static4);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
transform: rotate(270deg); // Make everything originate from the top of the circle
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&&__privilege {
|
|
111
|
+
--_pr-bar-bg: var(--green-050);
|
|
112
|
+
--_pr-label-ai: center;
|
|
113
|
+
--_pr-label-bc: var(--green-400);
|
|
114
|
+
--_pr-label-jc: center;
|
|
115
|
+
|
|
116
|
+
.highcontrast-mode({ --_pr-bar-bg: var(--green-200); });
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// TODO move `.s-progress__stepped` to entirely separate component (or consider deprecating)
|
|
120
|
+
&&__stepped { // There's so little overlap with the base .s-progress that it doesn't make sense as a variant
|
|
121
|
+
background: transparent;
|
|
122
|
+
display: flex;
|
|
123
|
+
|
|
124
|
+
.s-progress {
|
|
125
|
+
&--bar {
|
|
126
|
+
&.s-progress--bar {
|
|
127
|
+
&__left {
|
|
128
|
+
left: 0;
|
|
129
|
+
right: 50%;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&__right {
|
|
133
|
+
left: 50%;
|
|
134
|
+
right: 0;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
background: var(--black-300);
|
|
139
|
+
border-radius: 0;
|
|
140
|
+
height: var(--su-static6);
|
|
141
|
+
position: absolute;
|
|
142
|
+
top: calc(var(--su-static8) + var(--su-static1));
|
|
143
|
+
z-index: var(--zi-base);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&--label { // Override a ton of properties
|
|
147
|
+
border: 0;
|
|
148
|
+
border-radius: 0;
|
|
149
|
+
color: var(--black-500);
|
|
150
|
+
display: block;
|
|
151
|
+
font-size: var(--fs-body1);
|
|
152
|
+
height: auto;
|
|
153
|
+
padding: var(--su12) var(--su6) 0 var(--su6);
|
|
154
|
+
position: static;
|
|
155
|
+
text-align: center;
|
|
156
|
+
width: auto;
|
|
157
|
+
z-index: var(--zi-base);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&--step {
|
|
161
|
+
&.is-active {
|
|
162
|
+
.s-progress {
|
|
163
|
+
&--bar.s-progress--bar__left {
|
|
164
|
+
background: var(--theme-secondary-400);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&--label {
|
|
168
|
+
color: var(--fc-dark);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&--stop {
|
|
172
|
+
background: var(--theme-secondary-400);
|
|
173
|
+
box-shadow: 0 0 0 var(--su-static6) var(--focus-ring);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&.is-complete {
|
|
179
|
+
.s-progress {
|
|
180
|
+
&--bar,
|
|
181
|
+
&--stop {
|
|
182
|
+
background: var(--theme-secondary-400);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&--label {
|
|
186
|
+
color: var(--fc-dark);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
align-items: center;
|
|
192
|
+
display: flex;
|
|
193
|
+
flex-basis: 0;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
flex-grow: 1;
|
|
196
|
+
flex-shrink: 1;
|
|
197
|
+
position: relative;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&--stop {
|
|
201
|
+
.highcontrast-mode({
|
|
202
|
+
color: var(--white);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
align-items: center;
|
|
206
|
+
background: var(--black-300);
|
|
207
|
+
border-radius: 100%;
|
|
208
|
+
color: @white;
|
|
209
|
+
display: flex;
|
|
210
|
+
height: var(--su-static24);
|
|
211
|
+
justify-content: center;
|
|
212
|
+
position: relative;
|
|
213
|
+
width: var(--su-static24);
|
|
214
|
+
z-index: var(--zi-selected);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// CHILD ELEMENTS
|
|
220
|
+
& &--bar {
|
|
221
|
+
background-color: var(--_pr-bar-bg);
|
|
222
|
+
border-radius: var(--_pr-bar);
|
|
223
|
+
min-height: var(--_pr-hmn);
|
|
224
|
+
|
|
225
|
+
height: 100%;
|
|
226
|
+
min-width: var(--su-static6);
|
|
227
|
+
position: relative;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
& &--label {
|
|
231
|
+
align-items: var(--_pr-label-ai);
|
|
232
|
+
border: var(--su-static1) solid var(--_pr-label-bc);
|
|
233
|
+
display: var(--_pr-label-d);
|
|
234
|
+
gap: var(--_pr-label-g);
|
|
235
|
+
justify-content: var(--_pr-label-jc);
|
|
236
|
+
padding-left: var(--_pr-label-px);
|
|
237
|
+
padding-right: var(--_pr-label-px);
|
|
238
|
+
|
|
239
|
+
border-radius: var(--br-md);
|
|
240
|
+
color: var(--fc-dark);
|
|
241
|
+
font-size: var(--fs-caption);
|
|
242
|
+
height: 100%;
|
|
243
|
+
line-height: var(--lh-xs);
|
|
244
|
+
position: absolute;
|
|
245
|
+
width: 100%;
|
|
246
|
+
z-index: calc(var(--zi-base) + 2);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
& &--segments { // DEPRECATED: AFAICT, this is unused in core (as well as it's intended parent variant class `.s-progress__segmented`)
|
|
250
|
+
li {
|
|
251
|
+
&:not(:first-child):not(:last-child):before {
|
|
252
|
+
background-color: var(--white);
|
|
253
|
+
content: "";
|
|
254
|
+
display: block;
|
|
255
|
+
height: 100%;
|
|
256
|
+
left: calc(var(--su-static1) * -1); // -1px
|
|
257
|
+
position: absolute;
|
|
258
|
+
top: 0;
|
|
259
|
+
width: var(--su-static4);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
display: block;
|
|
263
|
+
padding-top: var(--su-static4);
|
|
264
|
+
position: relative;
|
|
265
|
+
text-align: center;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
display: flex;
|
|
269
|
+
height: 100%;
|
|
270
|
+
justify-content: space-between;
|
|
271
|
+
list-style: none;
|
|
272
|
+
margin: 0;
|
|
273
|
+
padding: 0;
|
|
274
|
+
position: absolute;
|
|
275
|
+
top: 0;
|
|
276
|
+
width: 100%;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
background-color: var(--_pr-bg);
|
|
280
|
+
border-radius: var(--_pr-bar);
|
|
281
|
+
height: var(--_pr-size, var(--_pr-h));
|
|
282
|
+
min-height: var(--_pr-hmn);
|
|
283
|
+
|
|
284
|
+
min-width: var(--su-static6);
|
|
285
|
+
position: relative;
|
|
286
|
+
width: var(--_pr-size, var(--_pr-w));
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// [1] Multiply the circle circumference by an the opposite percentage of what we want to display
|
|
290
|
+
// For example 70%, represented as a decimal is 0.7
|
|
291
|
+
// The opposite of that is 0.3 so ( 1 - 0.7 )
|