@parallelogram-js/dashboard 0.0.0-stage → 0.1.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/CHANGELOG.md +113 -0
- package/LICENSE +21 -0
- package/README.md +1390 -2
- package/dist/parallelogram-dashboard.css +9401 -0
- package/dist/parallelogram-dashboard.css.map +1 -0
- package/dist/parallelogram-dashboard.min.css +1 -0
- package/package.json +72 -4
- package/scss/_base.scss +403 -0
- package/scss/_datetime.scss +50 -0
- package/scss/_icon.scss +40 -0
- package/scss/_index.scss +60 -0
- package/scss/_mixins.scss +396 -0
- package/scss/_tokens.scss +340 -0
- package/scss/_utilities.scss +464 -0
- package/scss/_variables.scss +219 -0
- package/scss/components/_accordion.scss +297 -0
- package/scss/components/_actionbar.scss +333 -0
- package/scss/components/_alert.scss +183 -0
- package/scss/components/_avatar.scss +203 -0
- package/scss/components/_badge.scss +176 -0
- package/scss/components/_banner.scss +344 -0
- package/scss/components/_breadcrumb.scss +220 -0
- package/scss/components/_button.scss +264 -0
- package/scss/components/_card.scss +256 -0
- package/scss/components/_chart.scss +246 -0
- package/scss/components/_command.scss +267 -0
- package/scss/components/_dashboard.scss +681 -0
- package/scss/components/_data-list.scss +280 -0
- package/scss/components/_dropdown.scss +318 -0
- package/scss/components/_empty.scss +226 -0
- package/scss/components/_filebrowser.scss +906 -0
- package/scss/components/_form-layout.scss +332 -0
- package/scss/components/_input.scss +310 -0
- package/scss/components/_list.scss +130 -0
- package/scss/components/_media.scss +239 -0
- package/scss/components/_modal.scss +298 -0
- package/scss/components/_navbar.scss +312 -0
- package/scss/components/_notification.scss +59 -0
- package/scss/components/_pageheader.scss +99 -0
- package/scss/components/_pagination.scss +165 -0
- package/scss/components/_progress.scss +333 -0
- package/scss/components/_separator.scss +129 -0
- package/scss/components/_sheet.scss +286 -0
- package/scss/components/_sidebar.scss +324 -0
- package/scss/components/_skeleton.scss +246 -0
- package/scss/components/_stat.scss +218 -0
- package/scss/components/_table.scss +589 -0
- package/scss/components/_tabs.scss +266 -0
- package/scss/components/_timeline.scss +339 -0
- package/scss/components/_toast.scss +259 -0
- package/scss/components/_toolbar.scss +301 -0
- package/scss/components/_tooltip.scss +250 -0
- package/scss/main.scss +6 -0
- package/src/js/behaviours/accordion.js +58 -0
- package/src/js/behaviours/action-bar-list.js +406 -0
- package/src/js/behaviours/action-bar.js +29 -0
- package/src/js/behaviours/chart.js +339 -0
- package/src/js/behaviours/collapsible.js +34 -0
- package/src/js/behaviours/editable-table.js +91 -0
- package/src/js/behaviours/expandable.js +80 -0
- package/src/js/behaviours/overflow-actions.js +137 -0
- package/src/js/behaviours/publish-schedule.js +91 -0
- package/src/js/behaviours/search-clear.js +19 -0
- package/src/js/behaviours/segmented-control.js +43 -0
- package/src/js/behaviours/submenu.js +73 -0
- package/src/js/behaviours/table-columns.js +77 -0
- package/src/js/behaviours/table-paste.js +305 -0
- package/src/js/behaviours/table-reorder.js +252 -0
- package/src/js/behaviours/table-sort.js +101 -0
- package/src/js/behaviours/tabs.js +148 -0
- package/src/js/behaviours/toast-manager.js +106 -0
- package/src/js/behaviours/toggle.js +186 -0
- package/src/js/behaviours/unsaved-guard.js +88 -0
- package/src/js/core-loader.js +26 -0
- package/src/js/index.js +85 -0
- package/src/js/polyfills/dialog-commands.js +20 -0
- package/src/js/util/dom.js +39 -0
|
@@ -0,0 +1,906 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File browser
|
|
3
|
+
*
|
|
4
|
+
* Contenir's asset browser for a media field, with its dialog shell (.overlay) and upload list
|
|
5
|
+
* (.asset). Class names match Contenir's markup and the states its scripts set, so these styles
|
|
6
|
+
* drop onto it unchanged:
|
|
7
|
+
*
|
|
8
|
+
* - dialog.overlay > .overlay__wrap > .overlay__inner (the browser) + .overlay__inner (uploads).
|
|
9
|
+
* The browser panel stays put; the upload panel slides in over its right side with .show.
|
|
10
|
+
* - .overlay__body--dragover covers the body with a drop target while files are dragged over it.
|
|
11
|
+
* - .filebrowser__list--image is the grid view; without it the list shows rows under
|
|
12
|
+
* .filebrowser__banner headings. --single makes the selection a single choice.
|
|
13
|
+
* - .filebrowser__item--busy is an upload in progress (with .filebrowser__upload-progress),
|
|
14
|
+
* --leaving an item being removed.
|
|
15
|
+
* - .filebrowser__status sits in the footer, summarising uploads and opening the upload panel.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
@use "../variables" as *;
|
|
19
|
+
@use "../mixins" as *;
|
|
20
|
+
|
|
21
|
+
// --------------------------------------------------------------------------
|
|
22
|
+
// Dialog shell
|
|
23
|
+
// --------------------------------------------------------------------------
|
|
24
|
+
|
|
25
|
+
.overlay {
|
|
26
|
+
width: min(72rem, calc(100vw - 2rem));
|
|
27
|
+
max-width: none;
|
|
28
|
+
height: min(48rem, calc(100vh - 2rem));
|
|
29
|
+
max-height: none;
|
|
30
|
+
margin: auto;
|
|
31
|
+
padding: 0;
|
|
32
|
+
color: var(--card-fg);
|
|
33
|
+
background-color: var(--card);
|
|
34
|
+
border: 1px solid var(--border);
|
|
35
|
+
border-radius: $radius-lg;
|
|
36
|
+
box-shadow: $shadow-xl;
|
|
37
|
+
// Clip rather than hide: the parked upload panel must never make the dialog scrollable
|
|
38
|
+
overflow: clip;
|
|
39
|
+
opacity: 0;
|
|
40
|
+
transform: scale(0.98);
|
|
41
|
+
transition: opacity $transition-base $transition-easing, transform $transition-base $transition-easing;
|
|
42
|
+
|
|
43
|
+
&.show {
|
|
44
|
+
opacity: 1;
|
|
45
|
+
transform: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&::backdrop {
|
|
49
|
+
background-color: rgb(0 0 0 / 0.5);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&__wrap {
|
|
53
|
+
position: relative;
|
|
54
|
+
height: 100%;
|
|
55
|
+
overflow: clip;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// The browser fills the dialog; a second panel (uploads) slides over its right side
|
|
59
|
+
&__inner {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
height: 100%;
|
|
63
|
+
|
|
64
|
+
& + & {
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: 0;
|
|
67
|
+
right: 0;
|
|
68
|
+
bottom: 0;
|
|
69
|
+
z-index: 2;
|
|
70
|
+
width: min(26rem, 100%);
|
|
71
|
+
height: auto;
|
|
72
|
+
background-color: var(--card);
|
|
73
|
+
border-left: 1px solid var(--border);
|
|
74
|
+
box-shadow: $shadow-xl;
|
|
75
|
+
transform: translateX(100%);
|
|
76
|
+
visibility: hidden;
|
|
77
|
+
transition: transform $transition-base $transition-easing, visibility $transition-base;
|
|
78
|
+
|
|
79
|
+
&.show {
|
|
80
|
+
transform: none;
|
|
81
|
+
visibility: visible;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&__form {
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
height: 100%;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&__header {
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-shrink: 0;
|
|
95
|
+
align-items: center;
|
|
96
|
+
gap: $spacing-sm;
|
|
97
|
+
padding: $spacing-xs $spacing-sm;
|
|
98
|
+
border-bottom: 1px solid var(--border);
|
|
99
|
+
|
|
100
|
+
// The dialog clips anything above its top edge, so header tooltips open downwards
|
|
101
|
+
[data-tooltip]::after {
|
|
102
|
+
top: calc(100% + #{$spacing-2xs});
|
|
103
|
+
right: auto;
|
|
104
|
+
bottom: auto;
|
|
105
|
+
left: 50%;
|
|
106
|
+
transform: translateX(-50%);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-tooltip]::before {
|
|
110
|
+
top: calc(100% + #{$spacing-2xs} - 10px);
|
|
111
|
+
right: auto;
|
|
112
|
+
bottom: auto;
|
|
113
|
+
left: 50%;
|
|
114
|
+
transform: translateX(-50%);
|
|
115
|
+
border-color: transparent;
|
|
116
|
+
border-bottom-color: var(--primary);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// At the right edge, keep the tooltip inside the dialog
|
|
120
|
+
> [data-tooltip]:last-child::after {
|
|
121
|
+
left: auto;
|
|
122
|
+
right: 0;
|
|
123
|
+
transform: none;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&__title {
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
gap: $spacing-2xs;
|
|
131
|
+
margin: 0;
|
|
132
|
+
font-size: $font-size-base;
|
|
133
|
+
font-weight: $font-weight-semibold;
|
|
134
|
+
|
|
135
|
+
svg {
|
|
136
|
+
width: $icon-size-md;
|
|
137
|
+
height: $icon-size-md;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&__body {
|
|
142
|
+
position: relative;
|
|
143
|
+
flex: 1;
|
|
144
|
+
min-height: 0;
|
|
145
|
+
padding: $spacing-sm;
|
|
146
|
+
overflow-y: auto;
|
|
147
|
+
|
|
148
|
+
// Dropping files anywhere on the body uploads them into this set of assets
|
|
149
|
+
&--dragover::after {
|
|
150
|
+
content: var(--filebrowser-drop-label, "Drop files to upload");
|
|
151
|
+
position: absolute;
|
|
152
|
+
inset: $spacing-2xs;
|
|
153
|
+
z-index: 3;
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
font-size: $font-size-lg;
|
|
158
|
+
font-weight: $font-weight-medium;
|
|
159
|
+
color: var(--primary);
|
|
160
|
+
background-color: color-mix(in srgb, var(--card) 88%, transparent);
|
|
161
|
+
border: 2px dashed var(--primary);
|
|
162
|
+
border-radius: $radius-lg;
|
|
163
|
+
pointer-events: none;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&__footer {
|
|
168
|
+
flex-shrink: 0;
|
|
169
|
+
padding: $spacing-xs $spacing-sm;
|
|
170
|
+
background-color: var(--bg-muted);
|
|
171
|
+
border-top: 1px solid var(--border);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&__action {
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
gap: $spacing-sm;
|
|
178
|
+
|
|
179
|
+
> :last-child {
|
|
180
|
+
margin-left: auto;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Added by Contenir's script while an upload posts
|
|
185
|
+
&__upload-progress {
|
|
186
|
+
position: absolute;
|
|
187
|
+
top: 0;
|
|
188
|
+
left: 0;
|
|
189
|
+
right: 0;
|
|
190
|
+
height: 2px;
|
|
191
|
+
background-color: var(--primary);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// --------------------------------------------------------------------------
|
|
196
|
+
// Browser
|
|
197
|
+
// --------------------------------------------------------------------------
|
|
198
|
+
|
|
199
|
+
.filebrowser {
|
|
200
|
+
&__form {
|
|
201
|
+
margin: 0;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&__header {
|
|
205
|
+
display: flex;
|
|
206
|
+
flex: 1;
|
|
207
|
+
flex-wrap: wrap;
|
|
208
|
+
align-items: center;
|
|
209
|
+
justify-content: space-between;
|
|
210
|
+
gap: $spacing-xs;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
&__search {
|
|
214
|
+
flex: 1 1 14rem;
|
|
215
|
+
max-width: 24rem;
|
|
216
|
+
margin: 0;
|
|
217
|
+
|
|
218
|
+
.form__control {
|
|
219
|
+
width: 100%;
|
|
220
|
+
height: $btn-height-sm;
|
|
221
|
+
padding: 0 $spacing-xs;
|
|
222
|
+
font: inherit;
|
|
223
|
+
font-size: $font-size-sm;
|
|
224
|
+
color: var(--fg);
|
|
225
|
+
background-color: var(--bg);
|
|
226
|
+
border: 1px solid var(--input, var(--border));
|
|
227
|
+
border-radius: $radius-md;
|
|
228
|
+
|
|
229
|
+
&:focus {
|
|
230
|
+
@include focus-ring;
|
|
231
|
+
border-color: var(--ring);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
&__toolbar {
|
|
237
|
+
display: flex;
|
|
238
|
+
align-items: center;
|
|
239
|
+
gap: $spacing-2xs;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Contenir marks the current sort or view with .active on a plain .btn
|
|
243
|
+
&__sort .btn,
|
|
244
|
+
&__view-toggle .btn {
|
|
245
|
+
color: var(--fg-muted);
|
|
246
|
+
background-color: var(--card);
|
|
247
|
+
border: 1px solid var(--border);
|
|
248
|
+
|
|
249
|
+
&:hover {
|
|
250
|
+
color: var(--fg);
|
|
251
|
+
background-color: var(--accent);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
&.active {
|
|
255
|
+
color: var(--fg);
|
|
256
|
+
background-color: var(--accent);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
svg {
|
|
260
|
+
width: $icon-size-sm;
|
|
261
|
+
height: $icon-size-sm;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Column headings for the list view
|
|
266
|
+
&__banner {
|
|
267
|
+
display: grid;
|
|
268
|
+
grid-template-columns: var(--filebrowser-columns);
|
|
269
|
+
align-items: center;
|
|
270
|
+
gap: $spacing-xs;
|
|
271
|
+
padding: 0 $spacing-xs $spacing-2xs;
|
|
272
|
+
font-size: $font-size-xs;
|
|
273
|
+
font-weight: $font-weight-medium;
|
|
274
|
+
color: var(--fg-muted);
|
|
275
|
+
border-bottom: 1px solid var(--border);
|
|
276
|
+
|
|
277
|
+
a {
|
|
278
|
+
color: inherit;
|
|
279
|
+
text-decoration: none;
|
|
280
|
+
|
|
281
|
+
&:hover {
|
|
282
|
+
color: var(--fg);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
svg {
|
|
287
|
+
width: 0.875rem;
|
|
288
|
+
height: 0.875rem;
|
|
289
|
+
vertical-align: middle;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
&--hidden {
|
|
293
|
+
display: none;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
&--time,
|
|
297
|
+
&--name {
|
|
298
|
+
display: flex;
|
|
299
|
+
align-items: center;
|
|
300
|
+
gap: $spacing-3xs;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// ------------------------------------------------------------------------
|
|
305
|
+
// List view (default): one row per asset
|
|
306
|
+
// ------------------------------------------------------------------------
|
|
307
|
+
|
|
308
|
+
&__list,
|
|
309
|
+
&__banner {
|
|
310
|
+
--filebrowser-columns: 1.25rem 2.5rem minmax(0, 1fr) 7rem 3.5rem 6.5rem 4.5rem 7rem 1.75rem;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
&__list {
|
|
314
|
+
display: flex;
|
|
315
|
+
flex-direction: column;
|
|
316
|
+
margin: 0;
|
|
317
|
+
padding: 0;
|
|
318
|
+
list-style: none;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
&__item {
|
|
322
|
+
position: relative;
|
|
323
|
+
@include transition-default;
|
|
324
|
+
|
|
325
|
+
// Being removed
|
|
326
|
+
&--leaving {
|
|
327
|
+
opacity: 0;
|
|
328
|
+
transform: scale(0.96);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Uploading: the card shows a progress bar and can't be selected yet
|
|
332
|
+
&--busy {
|
|
333
|
+
pointer-events: none;
|
|
334
|
+
|
|
335
|
+
.filebrowser__image {
|
|
336
|
+
opacity: 0.5;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
&__checkbox {
|
|
342
|
+
@include sr-only;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
&__label {
|
|
346
|
+
display: grid;
|
|
347
|
+
grid-template-columns: var(--filebrowser-columns);
|
|
348
|
+
align-items: center;
|
|
349
|
+
gap: $spacing-xs;
|
|
350
|
+
padding: $spacing-2xs $spacing-xs;
|
|
351
|
+
font-size: $font-size-sm;
|
|
352
|
+
border-bottom: 1px solid var(--border);
|
|
353
|
+
border-radius: $radius-md;
|
|
354
|
+
cursor: pointer;
|
|
355
|
+
@include transition-colors;
|
|
356
|
+
|
|
357
|
+
&:hover {
|
|
358
|
+
background-color: var(--accent);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// The selection mark: a ring that fills with a tick when chosen
|
|
362
|
+
&--select {
|
|
363
|
+
position: relative;
|
|
364
|
+
width: 1.25rem;
|
|
365
|
+
height: 1.25rem;
|
|
366
|
+
background-color: var(--card);
|
|
367
|
+
border: 1.5px solid var(--fg-subtle);
|
|
368
|
+
border-radius: $radius-full;
|
|
369
|
+
@include transition-colors;
|
|
370
|
+
|
|
371
|
+
&::after {
|
|
372
|
+
content: "";
|
|
373
|
+
position: absolute;
|
|
374
|
+
inset: 3px;
|
|
375
|
+
background-color: var(--primary-fg);
|
|
376
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5l10 -10'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
377
|
+
opacity: 0;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
&--preview {
|
|
382
|
+
display: block;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
&--name {
|
|
386
|
+
margin: 0;
|
|
387
|
+
font-size: inherit;
|
|
388
|
+
font-weight: $font-weight-medium;
|
|
389
|
+
@include text-truncate;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
&--mime {
|
|
393
|
+
display: none;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
&--alt,
|
|
397
|
+
&--type,
|
|
398
|
+
&--dimensions,
|
|
399
|
+
&--size,
|
|
400
|
+
&--time {
|
|
401
|
+
font-size: $font-size-xs;
|
|
402
|
+
color: var(--fg-muted);
|
|
403
|
+
@include text-truncate;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
&--options {
|
|
407
|
+
display: flex;
|
|
408
|
+
justify-content: flex-end;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
&__checkbox:checked + &__label {
|
|
413
|
+
background-color: color-mix(in srgb, var(--primary) 8%, transparent);
|
|
414
|
+
|
|
415
|
+
.filebrowser__label--select {
|
|
416
|
+
background-color: var(--primary);
|
|
417
|
+
border-color: var(--primary);
|
|
418
|
+
|
|
419
|
+
&::after {
|
|
420
|
+
opacity: 1;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
&__checkbox:focus-visible + &__label {
|
|
426
|
+
@include focus-ring;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
&__asset {
|
|
430
|
+
position: relative;
|
|
431
|
+
margin: 0;
|
|
432
|
+
aspect-ratio: 1;
|
|
433
|
+
background-color: var(--bg-muted);
|
|
434
|
+
border-radius: $radius-sm;
|
|
435
|
+
overflow: hidden;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
&__media {
|
|
439
|
+
display: block;
|
|
440
|
+
width: 100%;
|
|
441
|
+
height: 100%;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
&__image {
|
|
445
|
+
display: block;
|
|
446
|
+
width: 100%;
|
|
447
|
+
height: 100%;
|
|
448
|
+
object-fit: contain;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// Lazy images wait as a soft placeholder rather than a broken-image icon
|
|
452
|
+
&__media > img[data-lazysrc]:not([src]) {
|
|
453
|
+
visibility: hidden;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// ------------------------------------------------------------------------
|
|
457
|
+
// Grid view
|
|
458
|
+
// ------------------------------------------------------------------------
|
|
459
|
+
|
|
460
|
+
&__list--image {
|
|
461
|
+
display: grid;
|
|
462
|
+
grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
|
|
463
|
+
gap: $spacing-xs;
|
|
464
|
+
|
|
465
|
+
// Cards stack their contents left-aligned (rows centre them vertically instead)
|
|
466
|
+
.filebrowser__label {
|
|
467
|
+
position: relative;
|
|
468
|
+
display: flex;
|
|
469
|
+
flex-direction: column;
|
|
470
|
+
align-items: stretch;
|
|
471
|
+
gap: 0;
|
|
472
|
+
height: 100%;
|
|
473
|
+
padding: $spacing-2xs;
|
|
474
|
+
background-color: var(--card);
|
|
475
|
+
border: 1px solid var(--border);
|
|
476
|
+
|
|
477
|
+
&:hover {
|
|
478
|
+
background-color: var(--card);
|
|
479
|
+
border-color: var(--fg-subtle);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.filebrowser__label--select {
|
|
484
|
+
position: absolute;
|
|
485
|
+
top: $spacing-xs;
|
|
486
|
+
left: $spacing-xs;
|
|
487
|
+
z-index: 1;
|
|
488
|
+
opacity: 0;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.filebrowser__label:hover .filebrowser__label--select {
|
|
492
|
+
opacity: 1;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.filebrowser__label--name {
|
|
496
|
+
margin-top: $spacing-2xs;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.filebrowser__label--mime {
|
|
500
|
+
display: block;
|
|
501
|
+
margin: 0;
|
|
502
|
+
font-size: $font-size-xs;
|
|
503
|
+
color: var(--fg-muted);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.filebrowser__label--type,
|
|
507
|
+
.filebrowser__label--dimensions,
|
|
508
|
+
.filebrowser__label--size,
|
|
509
|
+
.filebrowser__label--time {
|
|
510
|
+
display: none;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// A line under the file type for the alt text state, kept on every card so they line up;
|
|
514
|
+
// it only shows when something needs doing
|
|
515
|
+
.filebrowser__label--alt {
|
|
516
|
+
min-height: calc(#{$font-size-xs} * #{$line-height-normal});
|
|
517
|
+
margin-top: $spacing-3xs;
|
|
518
|
+
line-height: $line-height-normal;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.filebrowser__item:is([data-alt="set"], [data-alt="decorative"]) .filebrowser__label--alt {
|
|
522
|
+
visibility: hidden;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.filebrowser__label--options {
|
|
526
|
+
position: absolute;
|
|
527
|
+
top: $spacing-xs;
|
|
528
|
+
right: $spacing-xs;
|
|
529
|
+
z-index: 1;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.filebrowser__checkbox:checked + .filebrowser__label {
|
|
533
|
+
border-color: var(--primary);
|
|
534
|
+
box-shadow: 0 0 0 1px var(--primary);
|
|
535
|
+
|
|
536
|
+
.filebrowser__label--select {
|
|
537
|
+
opacity: 1;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// A single-choice field: the mark is a radio dot rather than a tick
|
|
543
|
+
&__list--single .filebrowser__label--select::after {
|
|
544
|
+
inset: 4px;
|
|
545
|
+
background-color: var(--primary-fg);
|
|
546
|
+
border-radius: $radius-full;
|
|
547
|
+
mask: none;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
// ------------------------------------------------------------------------
|
|
551
|
+
// Loading and uploading
|
|
552
|
+
// ------------------------------------------------------------------------
|
|
553
|
+
|
|
554
|
+
&__loading,
|
|
555
|
+
&__sentinel {
|
|
556
|
+
display: flex;
|
|
557
|
+
align-items: center;
|
|
558
|
+
justify-content: center;
|
|
559
|
+
gap: $spacing-2xs;
|
|
560
|
+
padding: $spacing-sm;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
&__loading-label {
|
|
564
|
+
font-size: $font-size-sm;
|
|
565
|
+
color: var(--fg-muted);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
&__overlay {
|
|
569
|
+
position: absolute;
|
|
570
|
+
inset: 0;
|
|
571
|
+
display: flex;
|
|
572
|
+
align-items: center;
|
|
573
|
+
justify-content: center;
|
|
574
|
+
background-color: color-mix(in srgb, var(--card) 60%, transparent);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
&__spinner {
|
|
578
|
+
width: 1.25rem;
|
|
579
|
+
height: 1.25rem;
|
|
580
|
+
border: 2px solid var(--border);
|
|
581
|
+
border-top-color: var(--fg-muted);
|
|
582
|
+
border-radius: $radius-full;
|
|
583
|
+
animation: spin 0.7s linear infinite;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
&__upload-progress {
|
|
587
|
+
position: absolute;
|
|
588
|
+
left: $spacing-2xs;
|
|
589
|
+
right: $spacing-2xs;
|
|
590
|
+
bottom: $spacing-2xs;
|
|
591
|
+
z-index: 1;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
&__upload-progress-bar {
|
|
595
|
+
height: 4px;
|
|
596
|
+
background-color: var(--bg-muted);
|
|
597
|
+
border-radius: $radius-full;
|
|
598
|
+
overflow: hidden;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
&__upload-progress-fill {
|
|
602
|
+
width: var(--progress, 0%);
|
|
603
|
+
height: 100%;
|
|
604
|
+
background-color: var(--primary);
|
|
605
|
+
border-radius: inherit;
|
|
606
|
+
transition: width $transition-base linear;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// An upload that failed: the bar turns red and the card can be retried
|
|
610
|
+
&__item--error {
|
|
611
|
+
.filebrowser__upload-progress-fill {
|
|
612
|
+
background-color: var(--destructive);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
.filebrowser__image {
|
|
616
|
+
opacity: 0.4;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
// ------------------------------------------------------------------------
|
|
621
|
+
// Upload status in the footer
|
|
622
|
+
// ------------------------------------------------------------------------
|
|
623
|
+
|
|
624
|
+
&__status {
|
|
625
|
+
display: flex;
|
|
626
|
+
align-items: center;
|
|
627
|
+
gap: $spacing-2xs;
|
|
628
|
+
min-width: 0;
|
|
629
|
+
font-size: $font-size-sm;
|
|
630
|
+
color: var(--fg-muted);
|
|
631
|
+
|
|
632
|
+
&[hidden] {
|
|
633
|
+
display: none;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
// While files are still uploading, a small spinner leads the summary
|
|
637
|
+
&[data-state="uploading"]::before {
|
|
638
|
+
content: "";
|
|
639
|
+
flex-shrink: 0;
|
|
640
|
+
width: 0.875rem;
|
|
641
|
+
height: 0.875rem;
|
|
642
|
+
border: 2px solid var(--border);
|
|
643
|
+
border-top-color: var(--fg-muted);
|
|
644
|
+
border-radius: $radius-full;
|
|
645
|
+
animation: spin 0.7s linear infinite;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
&[data-state="error"] {
|
|
649
|
+
color: var(--destructive);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// --------------------------------------------------------------------------
|
|
655
|
+
// Alt text
|
|
656
|
+
// --------------------------------------------------------------------------
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* Alt text state
|
|
660
|
+
*
|
|
661
|
+
* data-alt on a .filebrowser__item (or a .media tile in a field) is "missing", "suggested" (a
|
|
662
|
+
* suggestion waiting to be checked), "set" or "decorative" (deliberately empty). Nothing is
|
|
663
|
+
* drawn over the image: cards say so in their .filebrowser__label--alt line under the file type
|
|
664
|
+
* (grid cards only flag missing and suggested), and field tiles take the state's colour as
|
|
665
|
+
* their border.
|
|
666
|
+
*/
|
|
667
|
+
.filebrowser__item[data-alt="missing"] .filebrowser__label--alt {
|
|
668
|
+
color: var(--warning);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
.filebrowser__item[data-alt="suggested"] .filebrowser__label--alt {
|
|
672
|
+
color: var(--info);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
.filebrowser__item:is([data-alt="missing"], [data-alt="suggested"]) .filebrowser__label--alt {
|
|
676
|
+
font-weight: $font-weight-medium;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
.media[data-alt="missing"] {
|
|
680
|
+
border-color: var(--warning);
|
|
681
|
+
box-shadow: inset 0 0 0 1px var(--warning);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.media[data-alt="suggested"] {
|
|
685
|
+
border-color: var(--info);
|
|
686
|
+
box-shadow: inset 0 0 0 1px var(--info);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Image details panel
|
|
691
|
+
*
|
|
692
|
+
* .filebrowser__details is the slide-out panel for one image: its preview and alt text. While
|
|
693
|
+
* the alt text holds a suggestion nobody has checked yet, the panel carries data-alt="suggested"
|
|
694
|
+
* and the field is tinted until it is edited or saved.
|
|
695
|
+
*/
|
|
696
|
+
.filebrowser__details {
|
|
697
|
+
&-preview {
|
|
698
|
+
display: flex;
|
|
699
|
+
align-items: center;
|
|
700
|
+
justify-content: center;
|
|
701
|
+
height: 14rem;
|
|
702
|
+
margin: 0;
|
|
703
|
+
background-color: var(--bg-muted);
|
|
704
|
+
border-radius: $radius-md;
|
|
705
|
+
overflow: hidden;
|
|
706
|
+
|
|
707
|
+
img {
|
|
708
|
+
max-width: 100%;
|
|
709
|
+
max-height: 100%;
|
|
710
|
+
object-fit: contain;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
// Position and previous/next while stepping through images, at the header's far end
|
|
715
|
+
&-steps {
|
|
716
|
+
margin-left: auto;
|
|
717
|
+
|
|
718
|
+
&[hidden] {
|
|
719
|
+
display: none;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.btn__group > [data-tooltip]:last-child::after {
|
|
723
|
+
left: auto;
|
|
724
|
+
right: 0;
|
|
725
|
+
transform: none;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
&[data-alt="suggested"] .textarea {
|
|
730
|
+
border-color: var(--info);
|
|
731
|
+
background-color: var(--info-muted);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
&[data-alt="suggested"] [data-details-hint] {
|
|
735
|
+
color: var(--info);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// --------------------------------------------------------------------------
|
|
740
|
+
// Upload list (Contenir's AssetUploader), shown in the slide-out panel
|
|
741
|
+
// --------------------------------------------------------------------------
|
|
742
|
+
|
|
743
|
+
.asset {
|
|
744
|
+
display: flex;
|
|
745
|
+
flex-direction: column;
|
|
746
|
+
gap: $spacing-2xs;
|
|
747
|
+
|
|
748
|
+
&__fileinput {
|
|
749
|
+
@include sr-only;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
&__file {
|
|
753
|
+
position: relative;
|
|
754
|
+
display: grid;
|
|
755
|
+
grid-template-columns: 3rem minmax(0, 1fr);
|
|
756
|
+
align-items: center;
|
|
757
|
+
gap: $spacing-xs;
|
|
758
|
+
padding: $spacing-2xs;
|
|
759
|
+
background-color: var(--card);
|
|
760
|
+
border: 1px solid var(--border);
|
|
761
|
+
border-radius: $radius-md;
|
|
762
|
+
overflow: hidden;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
&__progress {
|
|
766
|
+
position: absolute;
|
|
767
|
+
left: 0;
|
|
768
|
+
right: 0;
|
|
769
|
+
bottom: 0;
|
|
770
|
+
width: 100%;
|
|
771
|
+
height: 3px;
|
|
772
|
+
appearance: none;
|
|
773
|
+
border: 0;
|
|
774
|
+
background-color: transparent;
|
|
775
|
+
visibility: hidden;
|
|
776
|
+
|
|
777
|
+
&.show {
|
|
778
|
+
visibility: visible;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
&::-webkit-progress-bar {
|
|
782
|
+
background-color: var(--bg-muted);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
&::-webkit-progress-value {
|
|
786
|
+
background-color: var(--primary);
|
|
787
|
+
transition: width $transition-base linear;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
&::-moz-progress-bar {
|
|
791
|
+
background-color: var(--primary);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
&__preview {
|
|
796
|
+
width: 3rem;
|
|
797
|
+
height: 3rem;
|
|
798
|
+
margin: 0;
|
|
799
|
+
background-color: var(--bg-muted);
|
|
800
|
+
border-radius: $radius-sm;
|
|
801
|
+
overflow: hidden;
|
|
802
|
+
|
|
803
|
+
&--media {
|
|
804
|
+
display: block;
|
|
805
|
+
width: 100%;
|
|
806
|
+
height: 100%;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
&--image {
|
|
810
|
+
display: block;
|
|
811
|
+
width: 100%;
|
|
812
|
+
height: 100%;
|
|
813
|
+
object-fit: cover;
|
|
814
|
+
opacity: 0;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
&.show &--image {
|
|
818
|
+
opacity: 1;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// One of info, error, rename or delete shows at a time
|
|
823
|
+
&__panel {
|
|
824
|
+
display: none;
|
|
825
|
+
flex-wrap: wrap;
|
|
826
|
+
align-items: center;
|
|
827
|
+
gap: $spacing-2xs;
|
|
828
|
+
min-width: 0;
|
|
829
|
+
|
|
830
|
+
&.show {
|
|
831
|
+
display: flex;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
&[data-panel="error"] .asset__title {
|
|
835
|
+
color: var(--destructive);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
&__body {
|
|
840
|
+
flex: 1 1 100%;
|
|
841
|
+
min-width: 0;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
&__title {
|
|
845
|
+
margin: 0;
|
|
846
|
+
font-size: $font-size-sm;
|
|
847
|
+
font-weight: $font-weight-medium;
|
|
848
|
+
@include text-truncate;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
&__filename,
|
|
852
|
+
&__info {
|
|
853
|
+
margin: 0;
|
|
854
|
+
font-size: $font-size-xs;
|
|
855
|
+
color: var(--fg-muted);
|
|
856
|
+
@include text-truncate;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
&__input {
|
|
860
|
+
width: 100%;
|
|
861
|
+
height: $btn-height-sm;
|
|
862
|
+
padding: 0 $spacing-2xs;
|
|
863
|
+
font: inherit;
|
|
864
|
+
font-size: $font-size-sm;
|
|
865
|
+
background-color: var(--bg);
|
|
866
|
+
border: 1px solid var(--border);
|
|
867
|
+
border-radius: $radius-md;
|
|
868
|
+
|
|
869
|
+
&:focus {
|
|
870
|
+
@include focus-ring;
|
|
871
|
+
border-color: var(--ring);
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
&__btn {
|
|
876
|
+
height: 1.75rem;
|
|
877
|
+
padding: 0 $spacing-2xs;
|
|
878
|
+
font: inherit;
|
|
879
|
+
font-size: $font-size-xs;
|
|
880
|
+
font-weight: $font-weight-medium;
|
|
881
|
+
color: var(--fg);
|
|
882
|
+
background-color: var(--card);
|
|
883
|
+
border: 1px solid var(--border);
|
|
884
|
+
border-radius: $radius-md;
|
|
885
|
+
cursor: pointer;
|
|
886
|
+
@include transition-colors;
|
|
887
|
+
|
|
888
|
+
&:hover {
|
|
889
|
+
background-color: var(--accent);
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
&--delete {
|
|
893
|
+
color: var(--destructive);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
&--confirm {
|
|
897
|
+
color: var(--primary-fg);
|
|
898
|
+
background-color: var(--primary);
|
|
899
|
+
border-color: var(--primary);
|
|
900
|
+
|
|
901
|
+
&:hover {
|
|
902
|
+
background-color: var(--primary-hover);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|