@cngx/ui 0.1.0-rc.9 → 0.3.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/README.md +118 -59
- package/action-button/README.md +170 -53
- package/breadcrumb/README.md +5 -6
- package/collection/README.md +1 -1
- package/command-palette/README.md +4 -3
- package/data-grid-accordion/README.md +1 -1
- package/empty-state/README.md +2 -3
- package/feedback/README.md +1 -1
- package/fesm2022/cngx-ui-a11y.mjs +13 -23
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +44 -66
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +213 -335
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +60 -80
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +18 -31
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +28 -44
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +29 -51
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +78 -83
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +52 -74
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +17 -44
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +589 -467
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-layout.mjs +17 -13
- package/fesm2022/cngx-ui-layout.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +3 -5
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +5 -9
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +6 -9
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +71 -68
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-nav-rail.mjs +440 -0
- package/fesm2022/cngx-ui-nav-rail.mjs.map +1 -0
- package/fesm2022/cngx-ui-overlay.mjs +9 -10
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +149 -171
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +858 -721
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +17 -19
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +21 -74
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +39 -62
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +207 -90
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +71 -32
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +21 -27
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +27 -40
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +5 -5
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-tabs/README.md +28 -14
- package/mat-tabs/styles/mat-tabs.css +233 -258
- package/nav-rail/README.md +325 -0
- package/package.json +10 -5
- package/paginator/README.md +10 -0
- package/schematics/ng-add/index.js +7 -7
- package/schematics/ng-add/schema.json +5 -0
- package/sidenav/README.md +150 -55
- package/skeleton/README.md +1 -1
- package/speak/README.md +1 -2
- package/stepper/README.md +20 -5
- package/tabs/README.md +13 -0
- package/timeline/README.md +1 -1
- package/toc/README.md +1 -1
- package/types/cngx-ui-a11y.d.ts +20 -38
- package/types/cngx-ui-accordion.d.ts +45 -77
- package/types/cngx-ui-action-button.d.ts +113 -151
- package/types/cngx-ui-breadcrumb.d.ts +58 -94
- package/types/cngx-ui-chart-panel.d.ts +22 -40
- package/types/cngx-ui-collection.d.ts +30 -53
- package/types/cngx-ui-command-palette.d.ts +40 -64
- package/types/cngx-ui-context-menu.d.ts +67 -44
- package/types/cngx-ui-data-grid-accordion.d.ts +49 -77
- package/types/cngx-ui-empty-state.d.ts +18 -8
- package/types/cngx-ui-feedback.d.ts +264 -289
- package/types/cngx-ui-layout.d.ts +4 -12
- package/types/cngx-ui-mat-accordion.d.ts +2 -3
- package/types/cngx-ui-mat-paginator.d.ts +4 -10
- package/types/cngx-ui-mat-stepper.d.ts +5 -10
- package/types/cngx-ui-mat-tabs.d.ts +43 -69
- package/types/cngx-ui-nav-rail.d.ts +416 -0
- package/types/cngx-ui-overlay.d.ts +4 -13
- package/types/cngx-ui-paginator.d.ts +164 -154
- package/types/cngx-ui-sidenav.d.ts +557 -437
- package/types/cngx-ui-skeleton.d.ts +7 -13
- package/types/cngx-ui-speak.d.ts +40 -24
- package/types/cngx-ui-stat-card.d.ts +45 -36
- package/types/cngx-ui-stepper.d.ts +183 -62
- package/types/cngx-ui-tabs.d.ts +101 -27
- package/types/cngx-ui-timeline.d.ts +20 -48
- package/types/cngx-ui-toc.d.ts +30 -51
- package/types/cngx-ui.d.ts +1 -1
|
@@ -6,36 +6,36 @@
|
|
|
6
6
|
* `<a>.mat-mdc-tab-link` elements (nav bar) and the trailing-edge
|
|
7
7
|
* molecule wrapper; this stylesheet paints them. Tokens stay under the
|
|
8
8
|
* Material-bridge namespace (`--cngx-mat-tab-*` / `--cngx-mat-tabs-
|
|
9
|
-
* more-*`)
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* stylesheet) because Angular only allows `styleUrl` on
|
|
13
|
-
* `@Component`, not on `@Directive`.
|
|
9
|
+
* more-*`). Shipped as a standalone stylesheet asset (consumer imports
|
|
10
|
+
* once in their global stylesheet) because Angular only allows
|
|
11
|
+
* `styleUrl` on `@Component`, not on `@Directive`.
|
|
14
12
|
*
|
|
15
13
|
* **State modifiers**
|
|
16
14
|
*
|
|
17
|
-
* - `.cngx-mat-tab--error` - rejected commit
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* error red; `[data-reason="refused"]`
|
|
22
|
-
* `false`)
|
|
23
|
-
* - `.cngx-mat-tab__rejection-icon` - `aria-hidden`
|
|
24
|
-
* decoration appends to the rejected tab
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* of the has-errors badge; when the tab also carries that badge it drops
|
|
28
|
-
* back inline after the label, so the two discs never overlap
|
|
15
|
+
* - `.cngx-mat-tab--error` - rejected commit, marked by colour only: the
|
|
16
|
+
* label takes the reason colour plus a font-weight bump, no outline and
|
|
17
|
+
* no surface. Specificity bump `.mat-mdc-tab.cngx-mat-tab--error` is
|
|
18
|
+
* load-bearing against Material's unlayered (0,1,0) tab rules.
|
|
19
|
+
* `[data-reason="failed"]` takes the error red; `[data-reason="refused"]`
|
|
20
|
+
* (the commit action answered `false`) the refused amber, label included
|
|
21
|
+
* - `.cngx-mat-tab__rejection-icon` - `aria-hidden` standalone icon the
|
|
22
|
+
* decoration appends to the rejected tab, after the label: an alert
|
|
23
|
+
* triangle on a failed commit, a slashed circle on a refused one, so the
|
|
24
|
+
* two never differ by colour alone
|
|
29
25
|
* - `.cngx-mat-tab--error` + `.mat-mdc-tab-disabled` - no extra rule:
|
|
30
|
-
* Material paints the disabled label colour and the
|
|
26
|
+
* Material paints the disabled label colour and the rejection icon
|
|
31
27
|
* stays, so it does not pass for a healthy disabled tab
|
|
32
|
-
* - `.cngx-mat-tab--has-errors` - form-validation errors present;
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
28
|
+
* - `.cngx-mat-tab--has-errors` - form-validation errors present; the
|
|
29
|
+
* decoration appends an `aria-hidden` alert icon
|
|
30
|
+
* (`.cngx-mat-tab__error-badge`) after the label. Distinct semantic from
|
|
31
|
+
* `--error` and the two coexist: the badge comes first, the rejection
|
|
32
|
+
* icon after it
|
|
33
|
+
* - `.cngx-mat-tab__icon-svg` - the `<svg>` inside both icons, built from
|
|
34
|
+
* the shared `@cngx/utils` icon data; `--stroke` marks an outline icon
|
|
35
|
+
*
|
|
36
|
+
* Under forced colors the icons paint CanvasText and a rejected tab gets
|
|
37
|
+
* an inset CanvasText outline, the one cue that survives the system
|
|
38
|
+
* palette.
|
|
39
39
|
*
|
|
40
40
|
* **Trailing-edge overflow**
|
|
41
41
|
*
|
|
@@ -51,31 +51,29 @@
|
|
|
51
51
|
*
|
|
52
52
|
* **Material wiring**
|
|
53
53
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* refused tokens register without an initial value, so their amber and
|
|
59
|
-
* resting-text fallbacks apply until a theme sets them. The size exception,
|
|
60
|
-
* `--cngx-mat-tab-has-errors-glyph-size`, is deliberately left unregistered so
|
|
61
|
-
* its `rem` fallback scales with text-only zoom (see its note below). The
|
|
62
|
-
* Material alignment is delivered by the
|
|
63
|
-
* `@cngx/themes/material/tabs-theme` bridge (`@include tabs.theme($theme)`),
|
|
64
|
-
* which sets the colour tokens on `.mat-mdc-tab-group`:
|
|
54
|
+
* The colour tokens are `@property`-registered without an initial value
|
|
55
|
+
* and set per colour scheme below, so the bridge's value on the
|
|
56
|
+
* tab group wins by inheritance. The `@cngx/themes/material/tabs-theme`
|
|
57
|
+
* bridge (`@include tabs.theme($theme)`) sets them on `.mat-mdc-tab-group`:
|
|
65
58
|
*
|
|
66
59
|
* - `--cngx-mat-tab-error-color` <- `--mat-sys-error`
|
|
67
60
|
* - `--cngx-mat-tab-refused-color` <- `--mat-sys-tertiary`
|
|
61
|
+
* - `--cngx-mat-tab-refused-text-color` <- `--mat-sys-tertiary`
|
|
68
62
|
* - `--cngx-mat-tab-has-errors-color` <- `--mat-sys-error`
|
|
69
|
-
* - `--cngx-mat-tab-has-errors-glyph-color` <- `--mat-sys-on-error`
|
|
70
63
|
* - `--cngx-mat-tabs-more-bg` <- `--mat-sys-surface`
|
|
71
64
|
*
|
|
72
|
-
* Imported standalone (no bridge), the
|
|
73
|
-
*
|
|
65
|
+
* Imported standalone (no bridge), the colours derive from the cngx
|
|
66
|
+
* foundation danger / warning / text tokens when they are present and
|
|
67
|
+
* from the same literal values otherwise, with a light and a dark set:
|
|
68
|
+
* the failed colour reads --cngx-color-danger-text, falling back to danger
|
|
69
|
+
* at the core text-rung lightness (4.5:1 as label text), the refused amber
|
|
70
|
+
* is warning mixed 70% (icon) and 55% (label) toward it.
|
|
74
71
|
*
|
|
75
72
|
* **Dark mode**
|
|
76
73
|
*
|
|
77
|
-
* Three hooks
|
|
78
|
-
*
|
|
74
|
+
* Three hooks switch the error, refused and has-errors colours to their
|
|
75
|
+
* dark-scheme values, and deepen the trailing-edge wrapper background and
|
|
76
|
+
* its gradient-fade shadow so the molecule blends into a dark page
|
|
79
77
|
* surface rather than into a white-on-dark seam:
|
|
80
78
|
*
|
|
81
79
|
* - `prefers-color-scheme: dark`
|
|
@@ -85,24 +83,23 @@
|
|
|
85
83
|
|
|
86
84
|
@layer cngx.tokens {
|
|
87
85
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
86
|
+
* Label and icon colour of a failed tab (the commit action threw).
|
|
87
|
+
* Registered without an initial value and set per colour scheme
|
|
88
|
+
* below. Wired to `--mat-sys-error` by the
|
|
89
|
+
* `@cngx/themes/material/tabs-theme` bridge.
|
|
91
90
|
* @group State / Error
|
|
92
91
|
*/
|
|
93
92
|
@property --cngx-mat-tab-error-color {
|
|
94
|
-
syntax: '
|
|
93
|
+
syntax: '*';
|
|
95
94
|
inherits: true;
|
|
96
|
-
initial-value: oklch(0.45 0.15 25);
|
|
97
95
|
}
|
|
98
96
|
|
|
99
97
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* `@cngx/themes/material/tabs-theme` bridge.
|
|
98
|
+
* Icon colour of a refused tab (the commit action answered `false`). A
|
|
99
|
+
* refusal is no error, so it wears amber; a failed commit keeps
|
|
100
|
+
* `--cngx-mat-tab-error-color`. Registered without an initial value and
|
|
101
|
+
* set per colour scheme below. Wired to `--mat-sys-tertiary`
|
|
102
|
+
* by the `@cngx/themes/material/tabs-theme` bridge.
|
|
106
103
|
* @group State / Refused
|
|
107
104
|
*/
|
|
108
105
|
@property --cngx-mat-tab-refused-color {
|
|
@@ -111,8 +108,9 @@
|
|
|
111
108
|
}
|
|
112
109
|
|
|
113
110
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
111
|
+
* Label colour of a refused tab: a darker amber than the icon, so the
|
|
112
|
+
* text clears 4.5:1. Registered without an initial value and set per
|
|
113
|
+
* colour scheme below.
|
|
116
114
|
* @group State / Refused
|
|
117
115
|
*/
|
|
118
116
|
@property --cngx-mat-tab-refused-text-color {
|
|
@@ -121,43 +119,33 @@
|
|
|
121
119
|
}
|
|
122
120
|
|
|
123
121
|
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* below. The disc itself shares `--cngx-mat-tab-has-errors-glyph-size`.
|
|
122
|
+
* Rendered size of the rejection icon after the label, in `em` of the
|
|
123
|
+
* tab label font. The universal syntax keeps the `em` unresolved until
|
|
124
|
+
* the icon reads it.
|
|
128
125
|
* @group State / Error
|
|
129
126
|
*/
|
|
130
|
-
@property --cngx-mat-tab-rejection-icon-
|
|
127
|
+
@property --cngx-mat-tab-rejection-icon-size {
|
|
131
128
|
syntax: '*';
|
|
132
|
-
inherits:
|
|
133
|
-
initial-value:
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/* Read on the glyph itself (inherits: false), so the scale SET lands there. */
|
|
137
|
-
.cngx-mat-tab__rejection-icon {
|
|
138
|
-
--cngx-mat-tab-rejection-icon-gap: var(--cngx-space-xs, 0.25rem);
|
|
129
|
+
inherits: true;
|
|
130
|
+
initial-value: 1.15em;
|
|
139
131
|
}
|
|
140
132
|
|
|
141
133
|
/**
|
|
142
|
-
*
|
|
134
|
+
* Gap between a tab's label and the icons after it (the has-errors
|
|
135
|
+
* badge and the rejection icon), derived from the spacing scale
|
|
136
|
+
* (`--cngx-space-xs`) below.
|
|
143
137
|
* @group State / Error
|
|
144
138
|
*/
|
|
145
|
-
@property --cngx-mat-tab-
|
|
139
|
+
@property --cngx-mat-tab-icon-gap {
|
|
146
140
|
syntax: '*';
|
|
147
141
|
inherits: false;
|
|
148
|
-
initial-value:
|
|
142
|
+
initial-value: 0.25rem;
|
|
149
143
|
}
|
|
150
144
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
* @group State / Error
|
|
156
|
-
*/
|
|
157
|
-
@property --cngx-mat-tab-error-outline-offset {
|
|
158
|
-
syntax: '<length>';
|
|
159
|
-
inherits: false;
|
|
160
|
-
initial-value: -2px;
|
|
145
|
+
/* Read on the icons themselves (inherits: false), so the scale SET lands there. */
|
|
146
|
+
.cngx-mat-tab__rejection-icon,
|
|
147
|
+
.cngx-mat-tab__error-badge {
|
|
148
|
+
--cngx-mat-tab-icon-gap: var(--cngx-space-xs, 0.25rem);
|
|
161
149
|
}
|
|
162
150
|
|
|
163
151
|
/**
|
|
@@ -171,71 +159,26 @@
|
|
|
171
159
|
}
|
|
172
160
|
|
|
173
161
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
syntax: '<length>';
|
|
179
|
-
inherits: false;
|
|
180
|
-
initial-value: 4px;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Larger inset when the tab is BOTH rejected and carries form
|
|
185
|
-
* errors - keeps the two signals visually distinct.
|
|
186
|
-
* @group State / HasErrors
|
|
187
|
-
*/
|
|
188
|
-
@property --cngx-mat-tab-has-errors-glyph-offset-stacked {
|
|
189
|
-
syntax: '<length>';
|
|
190
|
-
inherits: false;
|
|
191
|
-
initial-value: 6px;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/*
|
|
195
|
-
* Diameter of the `has-errors` glyph disc. Intentionally NOT
|
|
196
|
-
* @property-registered - the one exception to the all-tokens-registered
|
|
197
|
-
* note above. A registered `<length>` computes a `rem` value to an absolute
|
|
198
|
-
* px once, pinning the badge to a fixed size and defeating text-only zoom.
|
|
199
|
-
* Left unregistered so the `var(--..., 1rem)` fallbacks at the glyph rule
|
|
200
|
-
* scale the disc and glyph together with the root font-size. Still
|
|
201
|
-
* consumer-overridable - set `--cngx-mat-tab-has-errors-glyph-size` on any
|
|
202
|
-
* ancestor and the `var()` use-sites pick it up; it just no longer appears on
|
|
203
|
-
* the compodoc Theming tab (unregistered tokens carry no typed metadata).
|
|
204
|
-
*/
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Background of the `has-errors` glyph disc. Wired to `--mat-sys-error`
|
|
208
|
-
* by the `@cngx/themes/material/tabs-theme` bridge; standalone it keeps
|
|
209
|
-
* the literal default below. Inherits so a host-level override reaches
|
|
210
|
-
* the `::after` glyph.
|
|
162
|
+
* Colour of the `has-errors` alert icon after the label. Registered
|
|
163
|
+
* without an initial value and set per colour scheme below.
|
|
164
|
+
* Wired to `--mat-sys-error` by the `@cngx/themes/material/tabs-theme`
|
|
165
|
+
* bridge.
|
|
211
166
|
* @group State / HasErrors
|
|
212
167
|
*/
|
|
213
168
|
@property --cngx-mat-tab-has-errors-color {
|
|
214
|
-
syntax: '
|
|
169
|
+
syntax: '*';
|
|
215
170
|
inherits: true;
|
|
216
|
-
initial-value: oklch(0.45 0.15 25);
|
|
217
171
|
}
|
|
218
172
|
|
|
219
173
|
/**
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
* the literal default below.
|
|
174
|
+
* Rendered size of the `has-errors` alert icon, in `em` of the tab
|
|
175
|
+
* label font.
|
|
223
176
|
* @group State / HasErrors
|
|
224
177
|
*/
|
|
225
|
-
@property --cngx-mat-tab-has-errors-
|
|
226
|
-
syntax: '
|
|
178
|
+
@property --cngx-mat-tab-has-errors-icon-size {
|
|
179
|
+
syntax: '*';
|
|
227
180
|
inherits: true;
|
|
228
|
-
initial-value:
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Font-weight of the `has-errors` glyph (`!`).
|
|
233
|
-
* @group State / HasErrors
|
|
234
|
-
*/
|
|
235
|
-
@property --cngx-mat-tab-has-errors-font-weight {
|
|
236
|
-
syntax: '<number>';
|
|
237
|
-
inherits: false;
|
|
238
|
-
initial-value: 700;
|
|
181
|
+
initial-value: 1.15em;
|
|
239
182
|
}
|
|
240
183
|
|
|
241
184
|
/**
|
|
@@ -278,8 +221,6 @@
|
|
|
278
221
|
* its own; the `@cngx/themes/material/tabs-theme` bridge supersedes them
|
|
279
222
|
* by setting `--cngx-mat-tabs-more-bg` to `--mat-sys-surface` on the tab
|
|
280
223
|
* group, a nearer ancestor of the wrapper, so it wins by inheritance.
|
|
281
|
-
* Stays under the Material-bridge namespace (no `--cngx-color-*`
|
|
282
|
-
* delegation) per the file-header contract.
|
|
283
224
|
*/
|
|
284
225
|
:root {
|
|
285
226
|
--cngx-mat-tabs-more-bg: oklch(1 0 0);
|
|
@@ -304,118 +245,144 @@
|
|
|
304
245
|
--cngx-mat-tabs-more-bg: oklch(1 0 0);
|
|
305
246
|
--cngx-mat-tabs-more-shadow: -8px 0 8px -4px oklch(0 0 0 / 0.1);
|
|
306
247
|
}
|
|
248
|
+
|
|
249
|
+
/*
|
|
250
|
+
* Error, refused and has-errors colours per scheme. The selectors mirror
|
|
251
|
+
* the foundation scheme blocks in `@cngx/core/theming/system-tokens.css`
|
|
252
|
+
* (OS auto-follow on `:root`, explicit dark / light on any element), so a
|
|
253
|
+
* `[data-color-scheme]` / `.dark` island switches them too.
|
|
254
|
+
*/
|
|
255
|
+
:root {
|
|
256
|
+
--cngx-mat-tab-error-color: var(
|
|
257
|
+
--cngx-color-danger-text,
|
|
258
|
+
oklch(from var(--cngx-color-danger, oklch(0.6 0.18 25)) 0.46 c h)
|
|
259
|
+
);
|
|
260
|
+
--cngx-mat-tab-has-errors-color: var(--cngx-color-danger, oklch(0.6 0.18 25));
|
|
261
|
+
--cngx-mat-tab-refused-color: color-mix(
|
|
262
|
+
in oklab,
|
|
263
|
+
var(--cngx-color-warning, oklch(0.72 0.15 75)) 70%,
|
|
264
|
+
var(--cngx-color-text, oklch(0.2 0.01 250))
|
|
265
|
+
);
|
|
266
|
+
--cngx-mat-tab-refused-text-color: color-mix(
|
|
267
|
+
in oklab,
|
|
268
|
+
var(--cngx-color-warning, oklch(0.72 0.15 75)) 55%,
|
|
269
|
+
var(--cngx-color-text, oklch(0.2 0.01 250))
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
@media (prefers-color-scheme: dark) {
|
|
274
|
+
:root:not([data-color-scheme='light']):not(.light) {
|
|
275
|
+
--cngx-mat-tab-error-color: var(
|
|
276
|
+
--cngx-color-danger-text,
|
|
277
|
+
oklch(from var(--cngx-color-danger, oklch(0.68 0.17 25)) 0.74 c h)
|
|
278
|
+
);
|
|
279
|
+
--cngx-mat-tab-has-errors-color: var(--cngx-color-danger, oklch(0.68 0.17 25));
|
|
280
|
+
--cngx-mat-tab-refused-color: color-mix(
|
|
281
|
+
in oklab,
|
|
282
|
+
var(--cngx-color-warning, oklch(0.78 0.14 75)) 70%,
|
|
283
|
+
var(--cngx-color-text, oklch(0.95 0.01 250))
|
|
284
|
+
);
|
|
285
|
+
--cngx-mat-tab-refused-text-color: color-mix(
|
|
286
|
+
in oklab,
|
|
287
|
+
var(--cngx-color-warning, oklch(0.78 0.14 75)) 55%,
|
|
288
|
+
var(--cngx-color-text, oklch(0.95 0.01 250))
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
[data-color-scheme='dark'],
|
|
294
|
+
.dark {
|
|
295
|
+
--cngx-mat-tab-error-color: var(
|
|
296
|
+
--cngx-color-danger-text,
|
|
297
|
+
oklch(from var(--cngx-color-danger, oklch(0.68 0.17 25)) 0.74 c h)
|
|
298
|
+
);
|
|
299
|
+
--cngx-mat-tab-has-errors-color: var(--cngx-color-danger, oklch(0.68 0.17 25));
|
|
300
|
+
--cngx-mat-tab-refused-color: color-mix(
|
|
301
|
+
in oklab,
|
|
302
|
+
var(--cngx-color-warning, oklch(0.78 0.14 75)) 70%,
|
|
303
|
+
var(--cngx-color-text, oklch(0.95 0.01 250))
|
|
304
|
+
);
|
|
305
|
+
--cngx-mat-tab-refused-text-color: color-mix(
|
|
306
|
+
in oklab,
|
|
307
|
+
var(--cngx-color-warning, oklch(0.78 0.14 75)) 55%,
|
|
308
|
+
var(--cngx-color-text, oklch(0.95 0.01 250))
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
[data-color-scheme='light'],
|
|
313
|
+
.light {
|
|
314
|
+
--cngx-mat-tab-error-color: var(
|
|
315
|
+
--cngx-color-danger-text,
|
|
316
|
+
oklch(from var(--cngx-color-danger, oklch(0.6 0.18 25)) 0.46 c h)
|
|
317
|
+
);
|
|
318
|
+
--cngx-mat-tab-has-errors-color: var(--cngx-color-danger, oklch(0.6 0.18 25));
|
|
319
|
+
--cngx-mat-tab-refused-color: color-mix(
|
|
320
|
+
in oklab,
|
|
321
|
+
var(--cngx-color-warning, oklch(0.72 0.15 75)) 70%,
|
|
322
|
+
var(--cngx-color-text, oklch(0.2 0.01 250))
|
|
323
|
+
);
|
|
324
|
+
--cngx-mat-tab-refused-text-color: color-mix(
|
|
325
|
+
in oklab,
|
|
326
|
+
var(--cngx-color-warning, oklch(0.72 0.15 75)) 55%,
|
|
327
|
+
var(--cngx-color-text, oklch(0.2 0.01 250))
|
|
328
|
+
);
|
|
329
|
+
}
|
|
307
330
|
}
|
|
308
331
|
|
|
309
332
|
@layer cngx.components {
|
|
310
333
|
/*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
334
|
+
* The has-errors badge and the rejection icon. `::before` is Material's
|
|
335
|
+
* focus indicator, so the decorations append these `aria-hidden` spans
|
|
336
|
+
* to the tab element itself, next to their screen-reader descriptors.
|
|
337
|
+
* Material's `.mdc-tab` is a centred flex row, so both follow
|
|
338
|
+
* `.mdc-tab__content` (the label) and centre with it; `order` keeps the
|
|
339
|
+
* badge before the rejection icon whichever decoration mounts first.
|
|
340
|
+
* Standalone stroke glyphs, no disc.
|
|
316
341
|
*/
|
|
342
|
+
.cngx-mat-tab__error-badge,
|
|
317
343
|
.cngx-mat-tab__rejection-icon {
|
|
318
344
|
display: inline-flex;
|
|
319
345
|
align-items: center;
|
|
320
|
-
justify-content: center;
|
|
321
346
|
flex: 0 0 auto;
|
|
322
347
|
align-self: center;
|
|
323
|
-
|
|
324
|
-
height: var(--cngx-mat-tab-has-errors-glyph-size, 1rem);
|
|
325
|
-
margin-inline-start: var(--cngx-mat-tab-rejection-icon-gap, 0.25rem);
|
|
326
|
-
border-radius: 50%;
|
|
327
|
-
background: var(--cngx-mat-tab-error-color, oklch(0.45 0.15 25));
|
|
328
|
-
color: var(--cngx-mat-tab-has-errors-glyph-color, oklch(1 0 0));
|
|
329
|
-
font-size: calc(var(--cngx-mat-tab-has-errors-glyph-size, 1rem) * 0.75);
|
|
330
|
-
font-weight: var(--cngx-mat-tab-has-errors-font-weight, 700);
|
|
331
|
-
line-height: 1;
|
|
348
|
+
margin-inline-start: var(--cngx-mat-tab-icon-gap, 0.25rem);
|
|
332
349
|
pointer-events: none;
|
|
333
350
|
}
|
|
334
351
|
|
|
335
|
-
.cngx-mat-
|
|
336
|
-
|
|
352
|
+
.cngx-mat-tab__error-badge {
|
|
353
|
+
order: 1;
|
|
354
|
+
color: var(--cngx-mat-tab-has-errors-color, oklch(0.6 0.18 25));
|
|
337
355
|
}
|
|
338
356
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
* `position: relative`; set here too for a bare tab link), which is why
|
|
343
|
-
* the decoration never mounts it inside `.mdc-tab__content`, itself a
|
|
344
|
-
* positioning context.
|
|
345
|
-
*/
|
|
346
|
-
.mat-mdc-tab.cngx-mat-tab--error:not(.cngx-mat-tab--has-errors),
|
|
347
|
-
.mat-mdc-tab-link.cngx-mat-tab--error:not(.cngx-mat-tab--has-errors) {
|
|
348
|
-
position: relative;
|
|
357
|
+
.cngx-mat-tab__rejection-icon {
|
|
358
|
+
order: 2;
|
|
359
|
+
color: var(--cngx-mat-tab-error-color, oklch(0.5 0.14 25));
|
|
349
360
|
}
|
|
350
361
|
|
|
351
|
-
.cngx-mat-
|
|
352
|
-
|
|
353
|
-
top: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
354
|
-
inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
355
|
-
margin: 0;
|
|
356
|
-
z-index: 1;
|
|
362
|
+
.cngx-mat-tab__rejection-icon[data-reason='refused'] {
|
|
363
|
+
color: var(--cngx-mat-tab-refused-color, oklch(0.56 0.11 74));
|
|
357
364
|
}
|
|
358
365
|
|
|
359
366
|
/*
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
*
|
|
367
|
+
* The icons' `<svg>`, built and painted by the decorations from the shared
|
|
368
|
+
* icon data. Both draw on the 24-unit grid at stroke width 2, sized in em
|
|
369
|
+
* of the tab label font.
|
|
363
370
|
*/
|
|
371
|
+
.cngx-mat-tab__icon-svg {
|
|
372
|
+
--cngx-icon-svg-size: 1.15em;
|
|
373
|
+
--cngx-icon-svg-stroke-width: 2;
|
|
364
374
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
* `--has-errors` means "this tab contains form-validation errors
|
|
369
|
-
* right now". The two coexist and a tab can carry both
|
|
370
|
-
* simultaneously.
|
|
371
|
-
*/
|
|
372
|
-
.cngx-mat-tab--has-errors {
|
|
373
|
-
position: relative;
|
|
375
|
+
/* Functional - hardcoded */
|
|
376
|
+
display: block;
|
|
377
|
+
flex: none;
|
|
374
378
|
}
|
|
375
379
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
* `.mat-focus-indicator` tab: with `mat.strong-focus-indicators()` its
|
|
379
|
-
* unlayered rule (`display`, `inset`, `border`, and `content: ''` on
|
|
380
|
-
* focus) beats any rule in this layer regardless of specificity, which
|
|
381
|
-
* hid the badge entirely and stole the focus ring's pseudo-element.
|
|
382
|
-
*/
|
|
383
|
-
.mat-mdc-tab.cngx-mat-tab--has-errors::after,
|
|
384
|
-
.mat-mdc-tab-link.cngx-mat-tab--has-errors::after {
|
|
385
|
-
content: '!' / '';
|
|
386
|
-
position: absolute;
|
|
387
|
-
top: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
388
|
-
inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
389
|
-
inset-inline-start: auto;
|
|
390
|
-
bottom: auto;
|
|
391
|
-
display: inline-flex;
|
|
392
|
-
align-items: center;
|
|
393
|
-
justify-content: center;
|
|
394
|
-
width: var(--cngx-mat-tab-has-errors-glyph-size, 1rem);
|
|
395
|
-
height: var(--cngx-mat-tab-has-errors-glyph-size, 1rem);
|
|
396
|
-
margin: 0;
|
|
397
|
-
border: 0;
|
|
398
|
-
border-radius: 50%;
|
|
399
|
-
background: var(--cngx-mat-tab-has-errors-color, oklch(0.45 0.15 25));
|
|
400
|
-
color: var(--cngx-mat-tab-has-errors-glyph-color, oklch(1 0 0));
|
|
401
|
-
font-size: calc(var(--cngx-mat-tab-has-errors-glyph-size, 1rem) * 0.75);
|
|
402
|
-
font-weight: var(--cngx-mat-tab-has-errors-font-weight, 700);
|
|
403
|
-
line-height: 1;
|
|
404
|
-
pointer-events: none;
|
|
405
|
-
z-index: 1;
|
|
380
|
+
.cngx-mat-tab__error-badge > .cngx-mat-tab__icon-svg {
|
|
381
|
+
--cngx-icon-svg-size: var(--cngx-mat-tab-has-errors-icon-size, 1.15em);
|
|
406
382
|
}
|
|
407
383
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
* errors, the rejection outline already draws focus to the edges;
|
|
411
|
-
* shift the has-errors badge slightly inward so the two signals
|
|
412
|
-
* read as distinct rather than visually merging. The rejection disc
|
|
413
|
-
* leaves the corner to the badge and sits inline after the label.
|
|
414
|
-
*/
|
|
415
|
-
.mat-mdc-tab.cngx-mat-tab--error.cngx-mat-tab--has-errors::after,
|
|
416
|
-
.mat-mdc-tab-link.cngx-mat-tab--error.cngx-mat-tab--has-errors::after {
|
|
417
|
-
top: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
|
|
418
|
-
inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
|
|
384
|
+
.cngx-mat-tab__rejection-icon > .cngx-mat-tab__icon-svg {
|
|
385
|
+
--cngx-icon-svg-size: var(--cngx-mat-tab-rejection-icon-size, 1.15em);
|
|
419
386
|
}
|
|
420
387
|
|
|
421
388
|
/*
|
|
@@ -465,13 +432,14 @@
|
|
|
465
432
|
}
|
|
466
433
|
|
|
467
434
|
/*
|
|
468
|
-
* Rejected-tab paint
|
|
469
|
-
*
|
|
470
|
-
* the font-weight on `.mat-mdc-tab`), and an unlayered rule beats
|
|
471
|
-
* layered one whatever its specificity, so inside
|
|
472
|
-
*
|
|
473
|
-
* `.mat-mdc-tab.cngx-mat-tab--error` (0,2,0) decides
|
|
474
|
-
* (0,1,0) rules, which are injected after the global
|
|
435
|
+
* Rejected-tab paint: colour only, no outline and no surface. Unlayered on
|
|
436
|
+
* purpose: Material ships its tab styles unlayered through the component
|
|
437
|
+
* decorator (the font-weight on `.mat-mdc-tab`), and an unlayered rule beats
|
|
438
|
+
* every layered one whatever its specificity, so inside
|
|
439
|
+
* `@layer cngx.components` the weight never painted. Out here the
|
|
440
|
+
* specificity bump to `.mat-mdc-tab.cngx-mat-tab--error` (0,2,0) decides
|
|
441
|
+
* against Material's (0,1,0) rules, which are injected after the global
|
|
442
|
+
* styles.
|
|
475
443
|
*
|
|
476
444
|
* `.mat-mdc-tab-link` carries the same decoration for the native
|
|
477
445
|
* `[cngxMatTabNav]` bridge - the link element is also (0,1,0), so the
|
|
@@ -479,48 +447,55 @@
|
|
|
479
447
|
*
|
|
480
448
|
* The label text is painted by Material on `.mdc-tab__text-label` from its
|
|
481
449
|
* own `--mat-tab-*-label-text-color` tokens, up to (0,4,0) for the active
|
|
482
|
-
* hovered tab, so a colour on the tab never reached it. A
|
|
483
|
-
* those tokens instead; the label inherits them
|
|
484
|
-
* selector, and the disabled colour stays
|
|
450
|
+
* hovered tab, so a colour on the tab never reached it. A rejected tab sets
|
|
451
|
+
* those tokens instead, from the reason colour; the label inherits them
|
|
452
|
+
* past every Material state selector, and the disabled colour stays
|
|
453
|
+
* Material's.
|
|
485
454
|
*/
|
|
486
455
|
.mat-mdc-tab.cngx-mat-tab--error,
|
|
487
456
|
.mat-mdc-tab-link.cngx-mat-tab--error {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
457
|
+
--_cngx-mat-tab-rejection-text: var(--cngx-mat-tab-error-color, oklch(0.5 0.14 25));
|
|
458
|
+
--mat-tab-inactive-label-text-color: var(--_cngx-mat-tab-rejection-text, oklch(0.5 0.14 25));
|
|
459
|
+
--mat-tab-inactive-focus-label-text-color: var(
|
|
460
|
+
--_cngx-mat-tab-rejection-text,
|
|
461
|
+
oklch(0.5 0.14 25)
|
|
462
|
+
);
|
|
463
|
+
--mat-tab-inactive-hover-label-text-color: var(
|
|
464
|
+
--_cngx-mat-tab-rejection-text,
|
|
465
|
+
oklch(0.5 0.14 25)
|
|
466
|
+
);
|
|
467
|
+
--mat-tab-active-label-text-color: var(--_cngx-mat-tab-rejection-text, oklch(0.5 0.14 25));
|
|
468
|
+
--mat-tab-active-focus-label-text-color: var(--_cngx-mat-tab-rejection-text, oklch(0.5 0.14 25));
|
|
469
|
+
--mat-tab-active-hover-label-text-color: var(--_cngx-mat-tab-rejection-text, oklch(0.5 0.14 25));
|
|
470
|
+
color: var(--_cngx-mat-tab-rejection-text, oklch(0.5 0.14 25));
|
|
491
471
|
font-weight: var(--cngx-mat-tab-error-font-weight, 600);
|
|
492
472
|
}
|
|
493
473
|
|
|
494
|
-
.mat-mdc-tab.cngx-mat-tab--error:not([data-reason='refused']),
|
|
495
|
-
.mat-mdc-tab-link.cngx-mat-tab--error:not([data-reason='refused']) {
|
|
496
|
-
--mat-tab-inactive-label-text-color: var(--cngx-mat-tab-error-color, oklch(0.45 0.15 25));
|
|
497
|
-
--mat-tab-inactive-focus-label-text-color: var(--cngx-mat-tab-error-color, oklch(0.45 0.15 25));
|
|
498
|
-
--mat-tab-inactive-hover-label-text-color: var(--cngx-mat-tab-error-color, oklch(0.45 0.15 25));
|
|
499
|
-
--mat-tab-active-label-text-color: var(--cngx-mat-tab-error-color, oklch(0.45 0.15 25));
|
|
500
|
-
--mat-tab-active-focus-label-text-color: var(--cngx-mat-tab-error-color, oklch(0.45 0.15 25));
|
|
501
|
-
--mat-tab-active-hover-label-text-color: var(--cngx-mat-tab-error-color, oklch(0.45 0.15 25));
|
|
502
|
-
}
|
|
503
|
-
|
|
504
474
|
/*
|
|
505
|
-
* A refused commit is no error: the
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
* tokens. A failed one stays red above.
|
|
475
|
+
* A refused commit is no error: the label takes the refused amber (the
|
|
476
|
+
* darker text step, 4.5:1), the icon the brighter one. A failed one stays
|
|
477
|
+
* red above.
|
|
509
478
|
*/
|
|
510
479
|
.mat-mdc-tab.cngx-mat-tab--error[data-reason='refused'],
|
|
511
480
|
.mat-mdc-tab-link.cngx-mat-tab--error[data-reason='refused'] {
|
|
512
|
-
|
|
513
|
-
outline-color: var(--cngx-mat-tab-refused-color, oklch(0.62 0.15 60));
|
|
481
|
+
--_cngx-mat-tab-rejection-text: var(--cngx-mat-tab-refused-text-color, oklch(0.49 0.07 75));
|
|
514
482
|
}
|
|
515
483
|
|
|
516
|
-
/* forced-colors (WHCM): the
|
|
517
|
-
*
|
|
518
|
-
*
|
|
519
|
-
*
|
|
484
|
+
/* forced-colors (WHCM): the icons are bare stroke glyphs painting in
|
|
485
|
+
* currentColor; pin them to CanvasText so they never leave the system
|
|
486
|
+
* palette. The label colour is forced away, so an inset CanvasText outline
|
|
487
|
+
* (no layout shift) keeps a rejected tab distinguishable; the focus ring
|
|
488
|
+
* keeps its own indicator. Unlayered to beat the layered component rule and
|
|
489
|
+
* Material's unlayered `.mdc-tab { outline: none }`. */
|
|
520
490
|
@media (forced-colors: active) {
|
|
491
|
+
.cngx-mat-tab__error-badge,
|
|
521
492
|
.cngx-mat-tab__rejection-icon {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
493
|
+
color: CanvasText;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.mat-mdc-tab.cngx-mat-tab--error:not(:focus-visible),
|
|
497
|
+
.mat-mdc-tab-link.cngx-mat-tab--error:not(:focus-visible) {
|
|
498
|
+
outline: 2px solid CanvasText;
|
|
499
|
+
outline-offset: -2px;
|
|
525
500
|
}
|
|
526
501
|
}
|