@arsedizioni/ars-utils 22.5.2 → 22.5.4
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/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +4 -2
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs +79 -13
- package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/ui.colors.scss +118 -88
- package/types/arsedizioni-ars-utils-ui.shell.d.ts +56 -6
package/styles/ui.colors.scss
CHANGED
|
@@ -1,100 +1,130 @@
|
|
|
1
|
-
|
|
1
|
+
// Palette ARS.
|
|
2
|
+
//
|
|
3
|
+
// I token vivono in tre posti e non in due, e l'ordine conta:
|
|
4
|
+
//
|
|
5
|
+
// :root i valori chiari, sempre
|
|
6
|
+
// @media (prefers-color-scheme: dark) il sistema operativo, finche' nessuno ha scelto
|
|
7
|
+
// body.light / body.dark la scelta dell'utente, che batte il sistema
|
|
8
|
+
//
|
|
9
|
+
// L'ultima riga e' quella che serve: `ThemeService` scrive `light` o `dark` su <body>, anche
|
|
10
|
+
// quando la preferenza e' 'auto' (in quel caso risolve lui contro il sistema). Senza quei due
|
|
11
|
+
// blocchi, un utente che forza il tema scuro su una macchina chiara si ritrova i componenti
|
|
12
|
+
// Material scuri e tutto cio' che dipende da questi token ancora chiaro.
|
|
13
|
+
|
|
14
|
+
@mixin ars-light-tokens {
|
|
15
|
+
|
|
16
|
+
// Colors
|
|
17
|
+
--ars-color-link: #03A9F4;
|
|
18
|
+
--ars-color-link-low: #0288D1;
|
|
19
|
+
--ars-color-accent: #7894ae;
|
|
20
|
+
--ars-color-accent-low: #456179;
|
|
21
|
+
--ars-color-primary: #00a293;
|
|
22
|
+
--ars-color-primary-low: #006a60;
|
|
23
|
+
--ars-color-primary-hi: #12c0ae;
|
|
24
|
+
--ars-color-secondary: #4a635f;
|
|
25
|
+
--ars-color-secondary-low: #27403c;
|
|
26
|
+
--ars-color-error: #ff5449;
|
|
27
|
+
--ars-color-error-low: #a80710;
|
|
28
|
+
--ars-color-ok: #388E3C;
|
|
29
|
+
--ars-color-ok-low: #29692c;
|
|
30
|
+
--ars-color-warning: #FFC107;
|
|
31
|
+
--ars-color-warning-low: #FFA000;
|
|
32
|
+
--ars-color-text: #191c1b;
|
|
33
|
+
--ars-color-text-low: #e0e2e5;
|
|
34
|
+
--ars-color-divider: #757d87;
|
|
35
|
+
--ars-color-overlay: rgba(255, 255, 255, 0.75);
|
|
36
|
+
--ars-color-background: #f7faf8;
|
|
37
|
+
// Dialog surface: shared by the Material dialogs and by ui.shell, which reproduces
|
|
38
|
+
// their look without Material. Each one resolves to the app Material theme when there is
|
|
39
|
+
// one, and to a literal when there is not.
|
|
40
|
+
--ars-dialog-background-color: var(--mat-sys-surface-container-high, #e6eae8);
|
|
41
|
+
--ars-color-on-primary: var(--mat-sys-on-primary, #ffffff);
|
|
42
|
+
--ars-scrim-color: rgba(0, 0, 0, 0.32);
|
|
43
|
+
--ars-dialog-radius: 28px;
|
|
44
|
+
--ars-dialog-elevation: 0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px 0 rgba(0, 0, 0, 0.3);
|
|
45
|
+
// Busy overlay and progress indicators (ui.shell reproduces them without Material)
|
|
46
|
+
--ars-busy-scrim-color: rgba(0, 0, 0, 0.42);
|
|
47
|
+
--ars-progress-track-color: var(--mat-sys-surface-container-highest, #d5dbd8);
|
|
48
|
+
--ars-busy-bare-color: #ffffff;
|
|
49
|
+
// Stacking: cdk-overlay-container sits at 1000, so the shell overlays go above it and the
|
|
50
|
+
// busy one below the message, which is the order the CDK stack used to give for free.
|
|
51
|
+
--ars-shell-z-index: 1100;
|
|
52
|
+
--ars-busy-z-index: 1090;
|
|
53
|
+
// Drawer
|
|
54
|
+
--ars-drawer-background-color: #eff1ef;
|
|
55
|
+
--ars-drawer-divider-color: #6f7977;
|
|
56
|
+
// Item
|
|
57
|
+
--ars-item-hover-background-color: var(--mat-icon-button-ripple-color);
|
|
58
|
+
--ars-item-selected-background-color: #EAEEED;
|
|
59
|
+
--ars-dialog-item-selected-background-color: rgba(206, 209, 210, 0.9) !important;
|
|
60
|
+
--ars-dialog-item-hover-background-color: rgba(234, 236, 239, 0.9) !important;
|
|
61
|
+
// Filter Box
|
|
62
|
+
--ars-filterbox-filtered-background-color: #f9fbe7;
|
|
63
|
+
// File Preview
|
|
64
|
+
--ars-filepreview-content-background-color: #f7faf8;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@mixin ars-dark-tokens {
|
|
68
|
+
|
|
2
69
|
// Colors
|
|
3
70
|
--ars-color-link: #03A9F4;
|
|
4
71
|
--ars-color-link-low: #0288D1;
|
|
5
|
-
--ars-color-accent: #
|
|
6
|
-
--ars-color-accent-low: #
|
|
7
|
-
--ars-color-primary: #
|
|
8
|
-
--ars-color-primary-low: #
|
|
9
|
-
--ars-color-primary-hi: #
|
|
10
|
-
--ars-color-secondary: #
|
|
11
|
-
--ars-color-secondary-low: #
|
|
72
|
+
--ars-color-accent: #adcae6;
|
|
73
|
+
--ars-color-accent-low: #5e7a93;
|
|
74
|
+
--ars-color-primary: #53dbc9;
|
|
75
|
+
--ars-color-primary-low: #008679;
|
|
76
|
+
--ars-color-primary-hi: #74f8e5;
|
|
77
|
+
--ars-color-secondary: #b1ccc6;
|
|
78
|
+
--ars-color-secondary-low: #627c77;
|
|
12
79
|
--ars-color-error: #ff5449;
|
|
13
80
|
--ars-color-error-low: #a80710;
|
|
14
|
-
--ars-color-
|
|
15
|
-
--ars-color-ok
|
|
81
|
+
--ars-color-error-text: #191c1b;
|
|
82
|
+
--ars-color-ok: #4CAF50;
|
|
83
|
+
--ars-color-ok-low: #3f8f41;
|
|
16
84
|
--ars-color-warning: #FFC107;
|
|
17
85
|
--ars-color-warning-low: #FFA000;
|
|
18
|
-
--ars-color-text: #191c1b;
|
|
19
|
-
--ars-color-text
|
|
86
|
+
--ars-color-warning-text: #191c1b;
|
|
87
|
+
--ars-color-text: #e0e2e5;
|
|
88
|
+
--ars-color-text-low: #191c1b;
|
|
20
89
|
--ars-color-divider: #757d87;
|
|
21
|
-
--ars-color-overlay: rgba(
|
|
22
|
-
--ars-color-background: #
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
--ars-
|
|
27
|
-
--ars-color
|
|
28
|
-
|
|
29
|
-
--ars-
|
|
30
|
-
--ars-
|
|
31
|
-
//
|
|
32
|
-
--ars-
|
|
33
|
-
--ars-
|
|
34
|
-
--ars-busy-bare-color: #ffffff;
|
|
35
|
-
// Stacking: cdk-overlay-container sits at 1000, so the shell overlays go above it and the
|
|
36
|
-
// busy one below the message, which is the order the CDK stack used to give for free.
|
|
37
|
-
--ars-shell-z-index: 1100;
|
|
38
|
-
--ars-busy-z-index: 1090;
|
|
39
|
-
// Drawer
|
|
40
|
-
--ars-drawer-background-color: #eff1ef;
|
|
41
|
-
--ars-drawer-divider-color: #6f7977;
|
|
90
|
+
--ars-color-overlay: rgba(0, 0, 0, 0.65);
|
|
91
|
+
--ars-color-background: #101413;
|
|
92
|
+
|
|
93
|
+
// Dialog surface
|
|
94
|
+
--ars-dialog-background-color: var(--mat-sys-surface-container-high, #282a29);
|
|
95
|
+
--ars-color-on-primary: var(--mat-sys-on-primary, #00382f);
|
|
96
|
+
--ars-scrim-color: rgba(0, 0, 0, 0.6);
|
|
97
|
+
// Busy overlay and progress indicators
|
|
98
|
+
--ars-busy-scrim-color: rgba(0, 0, 0, 0.6);
|
|
99
|
+
--ars-progress-track-color: var(--mat-sys-surface-container-highest, #3a3d3c);
|
|
100
|
+
// Drawer
|
|
101
|
+
--ars-drawer-background-color: #212223;
|
|
102
|
+
--ars-drawer-divider-color: #899390;
|
|
42
103
|
// Item
|
|
43
104
|
--ars-item-hover-background-color: var(--mat-icon-button-ripple-color);
|
|
44
|
-
--ars-item-selected-background-color: #
|
|
45
|
-
--ars-dialog-item-selected-background-color: rgba(
|
|
46
|
-
--ars-dialog-item-hover-background-color: rgba(
|
|
105
|
+
--ars-item-selected-background-color: #1B1F1E;
|
|
106
|
+
--ars-dialog-item-selected-background-color: rgba(63, 67, 66, 0.9) !important;
|
|
107
|
+
--ars-dialog-item-hover-background-color: rgba(38, 42, 41, 0.9) !important;
|
|
47
108
|
// Filter Box
|
|
48
|
-
--ars-filterbox-filtered-background-color: #
|
|
109
|
+
--ars-filterbox-filtered-background-color: #c6c7b8;
|
|
49
110
|
// File Preview
|
|
50
|
-
--ars-filepreview-content-background-color: #
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
--ars-color-ok-low: #3f8f41;
|
|
71
|
-
--ars-color-warning: #FFC107;
|
|
72
|
-
--ars-color-warning-low: #FFA000;
|
|
73
|
-
--ars-color-warning-text: #191c1b;
|
|
74
|
-
--ars-color-text: #e0e2e5;
|
|
75
|
-
--ars-color-text-low: #191c1b;
|
|
76
|
-
--ars-color-divider: #757d87;
|
|
77
|
-
--ars-color-overlay: rgba(0, 0, 0, 0.65);
|
|
78
|
-
--ars-color-background: #101413;
|
|
79
|
-
|
|
80
|
-
// Dialog surface
|
|
81
|
-
--ars-dialog-background-color: var(--mat-sys-surface-container-high, #282a29);
|
|
82
|
-
--ars-color-on-primary: var(--mat-sys-on-primary, #00382f);
|
|
83
|
-
--ars-scrim-color: rgba(0, 0, 0, 0.6);
|
|
84
|
-
// Busy overlay and progress indicators
|
|
85
|
-
--ars-busy-scrim-color: rgba(0, 0, 0, 0.6);
|
|
86
|
-
--ars-progress-track-color: var(--mat-sys-surface-container-highest, #3a3d3c);
|
|
87
|
-
// Drawer
|
|
88
|
-
--ars-drawer-background-color: #212223;
|
|
89
|
-
--ars-drawer-divider-color: #899390;
|
|
90
|
-
// Item
|
|
91
|
-
--ars-item-hover-background-color: var(--mat-icon-button-ripple-color);
|
|
92
|
-
--ars-item-selected-background-color: #1B1F1E;
|
|
93
|
-
--ars-dialog-item-selected-background-color: rgba(63, 67, 66, 0.9) !important;
|
|
94
|
-
--ars-dialog-item-hover-background-color: rgba(38, 42, 41, 0.9) !important;
|
|
95
|
-
// Filter Box
|
|
96
|
-
--ars-filterbox-filtered-background-color: #c6c7b8;
|
|
97
|
-
// File Preview
|
|
98
|
-
--ars-filepreview-content-background-color: #101413;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
111
|
+
--ars-filepreview-content-background-color: #101413;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:root {
|
|
115
|
+
@include ars-light-tokens;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@media (prefers-color-scheme: dark) {
|
|
119
|
+
:root {
|
|
120
|
+
@include ars-dark-tokens;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
body.light {
|
|
125
|
+
@include ars-light-tokens;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
body.dark {
|
|
129
|
+
@include ars-dark-tokens;
|
|
130
|
+
}
|
|
@@ -24,8 +24,9 @@ interface ShellMessageData {
|
|
|
24
24
|
/**
|
|
25
25
|
* Handle over an open shell message.
|
|
26
26
|
*
|
|
27
|
-
* Not a `MatDialogRef
|
|
28
|
-
*
|
|
27
|
+
* Not a `MatDialogRef` — there is no Material here — but the two members a caller actually
|
|
28
|
+
* uses of one are the same, and mean the same thing, so moving a call site between
|
|
29
|
+
* `DialogService` and `ShellService` does not change how its result is awaited.
|
|
29
30
|
*/
|
|
30
31
|
interface ShellMessageRef {
|
|
31
32
|
/**
|
|
@@ -33,8 +34,16 @@ interface ShellMessageRef {
|
|
|
33
34
|
* @returns void
|
|
34
35
|
*/
|
|
35
36
|
close(): void;
|
|
36
|
-
/**
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Emits once and completes when the message has been taken off the screen, whichever way it
|
|
39
|
+
* was dismissed — the button, Escape, the backdrop, the auto-dismiss timer, or a `close()`.
|
|
40
|
+
*
|
|
41
|
+
* Like `MatDialogRef.afterClosed()`, and like it in the corner case too: subscribing after
|
|
42
|
+
* the message is already gone completes without emitting, so it is not a way to ask whether
|
|
43
|
+
* it was closed.
|
|
44
|
+
* @returns An observable of the dismissal.
|
|
45
|
+
*/
|
|
46
|
+
afterClosed(): Observable<void>;
|
|
38
47
|
}
|
|
39
48
|
|
|
40
49
|
/** Visual style of the busy indicator. */
|
|
@@ -53,6 +62,24 @@ type ShellBusyMode = 'determinate' | 'indeterminate';
|
|
|
53
62
|
* class on the host, never a `createComponent`, so the 40-odd calls a screen costs nothing.
|
|
54
63
|
*/
|
|
55
64
|
declare class ShellBusyComponent {
|
|
65
|
+
private readonly themeService;
|
|
66
|
+
/**
|
|
67
|
+
* True when the panel must paint itself dark.
|
|
68
|
+
*
|
|
69
|
+
* Read from {@link ThemeService} and not from `prefers-color-scheme`, because the two do not
|
|
70
|
+
* always agree: the service is what the user chose, and it may be forcing dark on a machine
|
|
71
|
+
* that is on light. Following the OS instead would leave this panel the only light thing on a
|
|
72
|
+
* dark screen.
|
|
73
|
+
*/
|
|
74
|
+
protected readonly dark: _angular_core.WritableSignal<boolean>;
|
|
75
|
+
/**
|
|
76
|
+
* Keeps {@link dark} in step with the service, now and at every later change.
|
|
77
|
+
*
|
|
78
|
+
* `'auto'` is resolved through `getTheme()`, which is the only thing that knows what the
|
|
79
|
+
* operating system is currently on.
|
|
80
|
+
* @returns void
|
|
81
|
+
*/
|
|
82
|
+
private followTheme;
|
|
56
83
|
/** Whether the overlay is on screen. Hidden with `display: none`, so it costs no layout. */
|
|
57
84
|
readonly visible: _angular_core.WritableSignal<boolean>;
|
|
58
85
|
/** Visual style of the indicator. */
|
|
@@ -65,6 +92,7 @@ declare class ShellBusyComponent {
|
|
|
65
92
|
readonly message: _angular_core.WritableSignal<string>;
|
|
66
93
|
/** Circumference of the spinner circle, bound to `stroke-dasharray`. */
|
|
67
94
|
protected readonly circumference: number;
|
|
95
|
+
constructor();
|
|
68
96
|
/** Length of the spinner arc still to be drawn, derived from {@link progress}. */
|
|
69
97
|
protected readonly dashOffset: _angular_core.Signal<number>;
|
|
70
98
|
/**
|
|
@@ -110,7 +138,7 @@ declare class ShellService {
|
|
|
110
138
|
private readonly environmentInjector;
|
|
111
139
|
private messageRef?;
|
|
112
140
|
private messageKind?;
|
|
113
|
-
private
|
|
141
|
+
private messageClosed?;
|
|
114
142
|
private previousOverflow?;
|
|
115
143
|
private previouslyFocused?;
|
|
116
144
|
private busyRef?;
|
|
@@ -154,7 +182,11 @@ declare class ShellService {
|
|
|
154
182
|
*/
|
|
155
183
|
private showMessage;
|
|
156
184
|
/**
|
|
157
|
-
* Builds the handle returned to callers
|
|
185
|
+
* Builds the handle returned to callers.
|
|
186
|
+
*
|
|
187
|
+
* The subject is captured now rather than read at call time, so `afterClosed()` keeps
|
|
188
|
+
* answering about the message this handle was given for, even once another one has taken
|
|
189
|
+
* its place on screen.
|
|
158
190
|
* @returns The handle over the message currently on screen.
|
|
159
191
|
*/
|
|
160
192
|
private messageHandle;
|
|
@@ -281,6 +313,7 @@ declare class BusyTimer {
|
|
|
281
313
|
declare class ShellMessageComponent {
|
|
282
314
|
/** Emitted when the user dismisses the message, whichever way they did it. */
|
|
283
315
|
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
316
|
+
private readonly themeService;
|
|
284
317
|
private readonly panel;
|
|
285
318
|
private readonly okButton;
|
|
286
319
|
/** Unique id tying the panel to its heading for assistive technology. */
|
|
@@ -292,6 +325,23 @@ declare class ShellMessageComponent {
|
|
|
292
325
|
private dismissTimer?;
|
|
293
326
|
private copiedTimer?;
|
|
294
327
|
private closing;
|
|
328
|
+
/**
|
|
329
|
+
* True when the panel must paint itself dark.
|
|
330
|
+
*
|
|
331
|
+
* Read from {@link ThemeService} and not from `prefers-color-scheme`, because the two do not
|
|
332
|
+
* always agree: the service is what the user chose, and it may be forcing dark on a machine
|
|
333
|
+
* that is on light. Following the OS instead would leave this panel the only light thing on a
|
|
334
|
+
* dark screen.
|
|
335
|
+
*/
|
|
336
|
+
protected readonly dark: _angular_core.WritableSignal<boolean>;
|
|
337
|
+
/**
|
|
338
|
+
* Keeps {@link dark} in step with the service, now and at every later change.
|
|
339
|
+
*
|
|
340
|
+
* `'auto'` is resolved through `getTheme()`, which is the only thing that knows what the
|
|
341
|
+
* operating system is currently on.
|
|
342
|
+
* @returns void
|
|
343
|
+
*/
|
|
344
|
+
private followTheme;
|
|
295
345
|
constructor();
|
|
296
346
|
/**
|
|
297
347
|
* Replaces the content shown by the panel and restarts the auto-dismiss timer.
|