@cngx/ui 0.0.1-rc.0 → 0.1.0-rc.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 +22 -48
- package/action-button/README.md +9 -11
- package/empty-state/README.md +11 -26
- package/feedback/README.md +3 -3
- package/fesm2022/cngx-ui-action-button.mjs +30 -26
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +26 -21
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +498 -261
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-layout.mjs +32 -5
- package/fesm2022/cngx-ui-layout.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +79 -104
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +111 -83
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-material.mjs +14 -3
- package/fesm2022/cngx-ui-material.mjs.map +1 -1
- package/fesm2022/cngx-ui-overlay.mjs +22 -3
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +107 -28
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +61 -20
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +14 -5
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +484 -161
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +75 -39
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +2 -1
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/layout/README.md +9 -44
- package/mat-stepper/README.md +7 -10
- package/mat-tabs/README.md +13 -13
- package/mat-tabs/styles/mat-tabs.css +339 -213
- package/material/README.md +19 -19
- package/overlay/README.md +11 -11
- package/package.json +5 -4
- package/sidenav/README.md +4 -19
- package/skeleton/README.md +3 -17
- package/speak/README.md +15 -15
- package/stepper/README.md +139 -5
- package/tabs/README.md +4 -4
- package/theming/system-tokens.css +29 -0
- package/types/cngx-ui-action-button.d.ts +28 -13
- package/types/cngx-ui-empty-state.d.ts +21 -9
- package/types/cngx-ui-feedback.d.ts +437 -121
- package/types/cngx-ui-layout.d.ts +38 -8
- package/types/cngx-ui-mat-stepper.d.ts +58 -43
- package/types/cngx-ui-mat-tabs.d.ts +122 -72
- package/types/cngx-ui-material.d.ts +12 -1
- package/types/cngx-ui-overlay.d.ts +25 -4
- package/types/cngx-ui-sidenav.d.ts +106 -12
- package/types/cngx-ui-skeleton.d.ts +62 -8
- package/types/cngx-ui-speak.d.ts +10 -2
- package/types/cngx-ui-stepper.d.ts +280 -56
- package/types/cngx-ui-tabs.d.ts +38 -10
- package/types/cngx-ui.d.ts +1 -0
- package/speak/speak-button-theme.scss +0 -78
|
@@ -1,233 +1,359 @@
|
|
|
1
|
-
|
|
2
|
-
* @
|
|
1
|
+
/**
|
|
2
|
+
* @overview
|
|
3
|
+
* Material-themed sticky-error skin for `[cngxMatTabs]`. The
|
|
4
|
+
* directive applies modifier classes onto Material's
|
|
5
|
+
* `<button>.mat-mdc-tab` elements and the trailing-edge molecule
|
|
6
|
+
* wrapper; this stylesheet paints them. Tokens stay under the
|
|
7
|
+
* Material-bridge namespace (`--cngx-mat-tab-*` / `--cngx-mat-tabs-
|
|
8
|
+
* more-*`) - no `--cngx-color-*` fallbacks because the Material
|
|
9
|
+
* design system owns the canonical theme. Shipped as a standalone
|
|
10
|
+
* stylesheet asset (consumer imports once in their global
|
|
11
|
+
* stylesheet) because Angular only allows `styleUrl` on
|
|
12
|
+
* `@Component`, not on `@Directive`.
|
|
3
13
|
*
|
|
4
|
-
*
|
|
5
|
-
* `<button>.mat-mdc-tab` element whose index matches
|
|
6
|
-
* `presenter.lastFailedIndex()`. The class persists until the user
|
|
7
|
-
* successfully re-picks the failed target OR programmatically
|
|
8
|
-
* dismisses via `clearLastFailed()`.
|
|
14
|
+
* **State modifiers**
|
|
9
15
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
16
|
+
* - `.cngx-mat-tab--error` - rejected commit; tinted color, outline
|
|
17
|
+
* ring, font-weight bump. Specificity bump `.mat-mdc-tab.cngx-
|
|
18
|
+
* mat-tab--error` is load-bearing - Material 21's `.mdc-tab` sets
|
|
19
|
+
* `outline: none` at (0,1,0)
|
|
20
|
+
* - `.cngx-mat-tab--error` + `.mat-mdc-tab-disabled` - fades the
|
|
21
|
+
* rejection signal so it does not pass for a healthy disabled tab
|
|
22
|
+
* - `.cngx-mat-tab--has-errors` - form-validation errors present;
|
|
23
|
+
* renders a `::before` red disc with an `!` glyph at the trailing
|
|
24
|
+
* corner. Distinct semantic from `--error` and the two coexist
|
|
25
|
+
* - `.cngx-mat-tab--error.cngx-mat-tab--has-errors` - co-occurrence;
|
|
26
|
+
* shifts the has-errors glyph inward via
|
|
27
|
+
* `--cngx-mat-tab-has-errors-glyph-offset-stacked` so the two
|
|
28
|
+
* signals do not merge
|
|
13
29
|
*
|
|
14
|
-
*
|
|
15
|
-
* keyframe limitation; the Material variant ships no pulse for the
|
|
16
|
-
* same architectural reason (avoids competing with Material's
|
|
17
|
-
* existing ink-bar transition + ripple). Re-evaluate when ≥1 consumer
|
|
18
|
-
* issue requests a pulse OR a sibling cngx feature adopts a shared
|
|
19
|
-
* `createPulseOnEdge` factory the Material variant can compose
|
|
20
|
-
* against.
|
|
30
|
+
* **Trailing-edge overflow**
|
|
21
31
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
32
|
+
* `.cngx-mat-tabs-more` wraps the dynamically-mounted
|
|
33
|
+
* `<cngx-tab-overflow>` molecule that `[cngxMatTabs]` appends into
|
|
34
|
+
* `.mat-mdc-tab-header`. The wrapper:
|
|
35
|
+
*
|
|
36
|
+
* - drives the molecule's component-API cascade vars
|
|
37
|
+
* (`--cngx-tab-overflow-bg`, `--cngx-tab-overflow-button-bg`) so
|
|
38
|
+
* the trigger fades into the page surface
|
|
39
|
+
* - collapses to zero layout space when the inner trigger button is
|
|
40
|
+
* hidden (= no clipped tabs) via `:has()`
|
|
41
|
+
*
|
|
42
|
+
* **Inheritance**
|
|
43
|
+
*
|
|
44
|
+
* - `--cngx-mat-tab-error-color` -> `--mat-sys-error`
|
|
45
|
+
* - `--cngx-mat-tab-has-errors-color` -> `--mat-sys-error`
|
|
46
|
+
* - `--cngx-mat-tab-has-errors-glyph-color` -> `--mat-sys-on-error`
|
|
47
|
+
* - `--cngx-mat-tabs-more-bg` -> `--mat-app-background-color`
|
|
48
|
+
*
|
|
49
|
+
* **Dark mode**
|
|
50
|
+
*
|
|
51
|
+
* Three hooks deepen the trailing-edge wrapper background and its
|
|
52
|
+
* gradient-fade shadow so the molecule blends into a dark page
|
|
53
|
+
* surface rather than into a white-on-dark seam:
|
|
54
|
+
*
|
|
55
|
+
* - `prefers-color-scheme: dark`
|
|
56
|
+
* - `[data-color-scheme="dark"]`
|
|
57
|
+
* - `.dark` class
|
|
26
58
|
*/
|
|
27
59
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
60
|
+
@layer cngx.tokens {
|
|
61
|
+
/**
|
|
62
|
+
* Text + outline color of a rejected tab. Falls back to
|
|
63
|
+
* `--mat-sys-error`.
|
|
64
|
+
* @group State / Error
|
|
65
|
+
*/
|
|
66
|
+
@property --cngx-mat-tab-error-color {
|
|
67
|
+
syntax: '<color>';
|
|
68
|
+
inherits: true;
|
|
69
|
+
initial-value: oklch(0.45 0.15 25);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Outline shorthand of a rejected tab.
|
|
74
|
+
* @group State / Error
|
|
75
|
+
*/
|
|
76
|
+
@property --cngx-mat-tab-error-outline {
|
|
77
|
+
syntax: '*';
|
|
78
|
+
inherits: false;
|
|
79
|
+
initial-value: 2px solid currentColor;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Outline offset of the rejected-tab outline.
|
|
84
|
+
* @group State / Error
|
|
85
|
+
*/
|
|
86
|
+
@property --cngx-mat-tab-error-outline-offset {
|
|
87
|
+
syntax: '<length>';
|
|
88
|
+
inherits: false;
|
|
89
|
+
initial-value: 1px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Font-weight bump of a rejected tab.
|
|
94
|
+
* @group State / Error
|
|
95
|
+
*/
|
|
96
|
+
@property --cngx-mat-tab-error-font-weight {
|
|
97
|
+
syntax: '<number>';
|
|
98
|
+
inherits: false;
|
|
99
|
+
initial-value: 600;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Inset of the `has-errors` glyph from the tab edges.
|
|
104
|
+
* @group State / HasErrors
|
|
105
|
+
*/
|
|
106
|
+
@property --cngx-mat-tab-has-errors-glyph-offset {
|
|
107
|
+
syntax: '<length>';
|
|
108
|
+
inherits: false;
|
|
109
|
+
initial-value: 4px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Larger inset when the tab is BOTH rejected and carries form
|
|
114
|
+
* errors - keeps the two signals visually distinct.
|
|
115
|
+
* @group State / HasErrors
|
|
116
|
+
*/
|
|
117
|
+
@property --cngx-mat-tab-has-errors-glyph-offset-stacked {
|
|
118
|
+
syntax: '<length>';
|
|
119
|
+
inherits: false;
|
|
120
|
+
initial-value: 6px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Diameter of the `has-errors` glyph disc.
|
|
125
|
+
* @group State / HasErrors
|
|
126
|
+
*/
|
|
127
|
+
@property --cngx-mat-tab-has-errors-glyph-size {
|
|
128
|
+
syntax: '<length>';
|
|
129
|
+
inherits: false;
|
|
130
|
+
initial-value: 16px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Background of the `has-errors` glyph disc. Falls back to
|
|
135
|
+
* `--mat-sys-error`.
|
|
136
|
+
* @group State / HasErrors
|
|
137
|
+
*/
|
|
138
|
+
@property --cngx-mat-tab-has-errors-color {
|
|
139
|
+
syntax: '<color>';
|
|
140
|
+
inherits: false;
|
|
141
|
+
initial-value: oklch(0.45 0.15 25);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Glyph color inside the `has-errors` disc. Falls back to
|
|
146
|
+
* `--mat-sys-on-error`.
|
|
147
|
+
* @group State / HasErrors
|
|
148
|
+
*/
|
|
149
|
+
@property --cngx-mat-tab-has-errors-glyph-color {
|
|
150
|
+
syntax: '<color>';
|
|
151
|
+
inherits: true;
|
|
152
|
+
initial-value: oklch(1 0 0);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Font-weight of the `has-errors` glyph (`!`).
|
|
157
|
+
* @group State / HasErrors
|
|
158
|
+
*/
|
|
159
|
+
@property --cngx-mat-tab-has-errors-font-weight {
|
|
160
|
+
syntax: '<number>';
|
|
161
|
+
inherits: false;
|
|
162
|
+
initial-value: 700;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Stacking-context order of the trailing-edge overflow wrapper.
|
|
167
|
+
* @group Layout
|
|
168
|
+
*/
|
|
169
|
+
@property --cngx-mat-tabs-more-z {
|
|
170
|
+
syntax: '<number>';
|
|
171
|
+
inherits: false;
|
|
172
|
+
initial-value: 2;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Background of the trailing-edge overflow wrapper. Falls back to
|
|
177
|
+
* `--mat-app-background-color`.
|
|
178
|
+
* @group Surface
|
|
179
|
+
*/
|
|
180
|
+
@property --cngx-mat-tabs-more-bg {
|
|
181
|
+
syntax: '<color>';
|
|
182
|
+
inherits: true;
|
|
183
|
+
initial-value: oklch(1 0 0);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Drop-shadow of the trailing-edge overflow wrapper.
|
|
188
|
+
* @group Surface
|
|
189
|
+
*/
|
|
190
|
+
@property --cngx-mat-tabs-more-shadow {
|
|
191
|
+
syntax: '*';
|
|
192
|
+
inherits: true;
|
|
193
|
+
initial-value: -8px 0 8px -4px oklch(0 0 0 / 0.1);
|
|
194
|
+
}
|
|
46
195
|
|
|
47
|
-
.mat-mdc-tab-disabled.cngx-mat-tab--error {
|
|
48
196
|
/*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
197
|
+
* Default-theme palette pass. The `cngx-mat-tabs-more` molecule
|
|
198
|
+
* sits over the Material tab header - its background needs to
|
|
199
|
+
* match the page surface so the gradient fades into "nothing"
|
|
200
|
+
* rather than into white-on-dark. Stays under the Material-bridge
|
|
201
|
+
* namespace (no `--cngx-color-*` delegation) per the file-header
|
|
202
|
+
* contract; consumers can still override `--cngx-mat-tabs-more-bg`
|
|
203
|
+
* to point at `--mat-app-background-color` once Material's M3
|
|
204
|
+
* tokens are wired.
|
|
53
205
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
206
|
+
:root {
|
|
207
|
+
--cngx-mat-tabs-more-bg: oklch(1 0 0);
|
|
208
|
+
--cngx-mat-tabs-more-shadow: -8px 0 8px -4px oklch(0 0 0 / 0.1);
|
|
209
|
+
}
|
|
56
210
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
* simultaneously.
|
|
64
|
-
*
|
|
65
|
-
* Three-tier fallback per CSS var: consumer override → Material
|
|
66
|
-
* design token → hard-coded value. The badge glyph is a `::before`
|
|
67
|
-
* pseudo-element so it stacks cleanly with Material's own focus
|
|
68
|
-
* ring and ripple — Material's button uses neither `::before` nor
|
|
69
|
-
* `::after` for its core visuals.
|
|
70
|
-
*
|
|
71
|
-
* No animation: same `tabs-accepted-debt §3` rationale as
|
|
72
|
-
* `--error` — pulse-on-edge is deferred to a future shared
|
|
73
|
-
* `createPulseOnEdge` factory.
|
|
74
|
-
*/
|
|
75
|
-
.cngx-mat-tab--has-errors {
|
|
76
|
-
position: relative;
|
|
77
|
-
}
|
|
211
|
+
@media (prefers-color-scheme: dark) {
|
|
212
|
+
:root:not([data-color-scheme='light']):not(.light) {
|
|
213
|
+
--cngx-mat-tabs-more-bg: oklch(0.2 0.01 250);
|
|
214
|
+
--cngx-mat-tabs-more-shadow: -8px 0 8px -4px oklch(0 0 0 / 0.45);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
78
217
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
* to 0 by Material's later-cascade rule and the badge sits dead-
|
|
85
|
-
* centred under the focus ring instead of at the trailing-top
|
|
86
|
-
* corner. Right + transform fall back for older inset-inline-end
|
|
87
|
-
* support.
|
|
88
|
-
*/
|
|
89
|
-
.mat-mdc-tab.cngx-mat-tab--has-errors::before {
|
|
90
|
-
content: '!';
|
|
91
|
-
position: absolute;
|
|
92
|
-
top: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
93
|
-
right: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
94
|
-
inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
95
|
-
inset-inline-start: auto;
|
|
96
|
-
bottom: auto;
|
|
97
|
-
display: inline-flex;
|
|
98
|
-
align-items: center;
|
|
99
|
-
justify-content: center;
|
|
100
|
-
width: var(--cngx-mat-tab-has-errors-glyph-size, 16px);
|
|
101
|
-
height: var(--cngx-mat-tab-has-errors-glyph-size, 16px);
|
|
102
|
-
margin: 0;
|
|
103
|
-
border: 0;
|
|
104
|
-
border-radius: 50%;
|
|
105
|
-
background: var(
|
|
106
|
-
--cngx-mat-tab-has-errors-color,
|
|
107
|
-
var(--mat-sys-error, #c62828)
|
|
108
|
-
);
|
|
109
|
-
color: var(
|
|
110
|
-
--cngx-mat-tab-has-errors-glyph-color,
|
|
111
|
-
var(--mat-sys-on-error, #ffffff)
|
|
112
|
-
);
|
|
113
|
-
font-size: calc(var(--cngx-mat-tab-has-errors-glyph-size, 16px) * 0.75);
|
|
114
|
-
font-weight: var(--cngx-mat-tab-has-errors-font-weight, 700);
|
|
115
|
-
line-height: 1;
|
|
116
|
-
pointer-events: none;
|
|
117
|
-
z-index: 1;
|
|
118
|
-
}
|
|
218
|
+
:root[data-color-scheme='dark'],
|
|
219
|
+
:root.dark {
|
|
220
|
+
--cngx-mat-tabs-more-bg: oklch(0.2 0.01 250);
|
|
221
|
+
--cngx-mat-tabs-more-shadow: -8px 0 8px -4px oklch(0 0 0 / 0.45);
|
|
222
|
+
}
|
|
119
223
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
*/
|
|
126
|
-
.mat-mdc-tab.cngx-mat-tab--error.cngx-mat-tab--has-errors::before {
|
|
127
|
-
top: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
|
|
128
|
-
right: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
|
|
129
|
-
inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
|
|
224
|
+
:root[data-color-scheme='light'],
|
|
225
|
+
:root.light {
|
|
226
|
+
--cngx-mat-tabs-more-bg: oklch(1 0 0);
|
|
227
|
+
--cngx-mat-tabs-more-shadow: -8px 0 8px -4px oklch(0 0 0 / 0.1);
|
|
228
|
+
}
|
|
130
229
|
}
|
|
131
230
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
align-items: center;
|
|
157
|
-
z-index: var(--cngx-mat-tabs-more-z, 2);
|
|
231
|
+
@layer cngx.components {
|
|
232
|
+
/*
|
|
233
|
+
* Specificity bump to `.mat-mdc-tab.cngx-mat-tab--error` (0,2,0) is
|
|
234
|
+
* load-bearing - Material 21's `.mdc-tab` rule (0,1,0) sets
|
|
235
|
+
* `outline: none` to suppress the browser's default focus outline,
|
|
236
|
+
* and ships those styles inline via the component decorator. Since
|
|
237
|
+
* the component-scoped CSS is injected into `<head>` AFTER the
|
|
238
|
+
* `angular.json` global styles when the component first renders,
|
|
239
|
+
* a same-specificity rule loses the cascade.
|
|
240
|
+
*/
|
|
241
|
+
.mat-mdc-tab.cngx-mat-tab--error {
|
|
242
|
+
color: var(--cngx-mat-tab-error-color, var(--mat-sys-error, oklch(0.45 0.15 25)));
|
|
243
|
+
outline: var(--cngx-mat-tab-error-outline, 2px solid currentColor);
|
|
244
|
+
outline-offset: var(--cngx-mat-tab-error-outline-offset, 1px);
|
|
245
|
+
font-weight: var(--cngx-mat-tab-error-font-weight, 600);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.mat-mdc-tab-disabled.cngx-mat-tab--error {
|
|
249
|
+
/*
|
|
250
|
+
* A disabled-and-rejected tab keeps the rejection signal but
|
|
251
|
+
* fades to disambiguate it from a healthy disabled tab.
|
|
252
|
+
*/
|
|
253
|
+
opacity: 0.7;
|
|
254
|
+
}
|
|
158
255
|
|
|
159
256
|
/*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
*/
|
|
170
|
-
--cngx-tab-overflow-bg: var(
|
|
171
|
-
--cngx-mat-tabs-more-bg,
|
|
172
|
-
var(--mat-app-background-color, #ffffff)
|
|
173
|
-
);
|
|
174
|
-
--cngx-tab-overflow-button-bg: var(
|
|
175
|
-
--cngx-mat-tabs-more-bg,
|
|
176
|
-
var(--mat-app-background-color, #ffffff)
|
|
177
|
-
);
|
|
178
|
-
|
|
179
|
-
box-shadow: var(
|
|
180
|
-
--cngx-mat-tabs-more-shadow,
|
|
181
|
-
-8px 0 8px -4px rgba(0, 0, 0, 0.1)
|
|
182
|
-
);
|
|
183
|
-
}
|
|
257
|
+
* Per-tab form-error aggregation badge. Distinct semantic from
|
|
258
|
+
* `--error` - `--error` means "your last commit was refused";
|
|
259
|
+
* `--has-errors` means "this tab contains form-validation errors
|
|
260
|
+
* right now". The two coexist and a tab can carry both
|
|
261
|
+
* simultaneously.
|
|
262
|
+
*/
|
|
263
|
+
.cngx-mat-tab--has-errors {
|
|
264
|
+
position: relative;
|
|
265
|
+
}
|
|
184
266
|
|
|
185
|
-
/*
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
267
|
+
/*
|
|
268
|
+
* Specificity is `.mat-mdc-tab.cngx-mat-tab--has-errors` (0,2,1)
|
|
269
|
+
* to beat Material's own `.mat-focus-indicator::before` (0,1,1)
|
|
270
|
+
* which sets `inset: 0` on the same pseudo-element.
|
|
271
|
+
*/
|
|
272
|
+
.mat-mdc-tab.cngx-mat-tab--has-errors::before {
|
|
273
|
+
content: '!';
|
|
274
|
+
position: absolute;
|
|
275
|
+
top: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
276
|
+
right: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
277
|
+
inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
278
|
+
inset-inline-start: auto;
|
|
279
|
+
bottom: auto;
|
|
280
|
+
display: inline-flex;
|
|
281
|
+
align-items: center;
|
|
282
|
+
justify-content: center;
|
|
283
|
+
width: var(--cngx-mat-tab-has-errors-glyph-size, 16px);
|
|
284
|
+
height: var(--cngx-mat-tab-has-errors-glyph-size, 16px);
|
|
285
|
+
margin: 0;
|
|
286
|
+
border: 0;
|
|
287
|
+
border-radius: 50%;
|
|
288
|
+
background: var(--cngx-mat-tab-has-errors-color, var(--mat-sys-error, oklch(0.45 0.15 25)));
|
|
289
|
+
color: var(--cngx-mat-tab-has-errors-glyph-color, var(--mat-sys-on-error, oklch(1 0 0)));
|
|
290
|
+
font-size: calc(var(--cngx-mat-tab-has-errors-glyph-size, 16px) * 0.75);
|
|
291
|
+
font-weight: var(--cngx-mat-tab-has-errors-font-weight, 700);
|
|
292
|
+
line-height: 1;
|
|
293
|
+
pointer-events: none;
|
|
294
|
+
z-index: 1;
|
|
295
|
+
}
|
|
195
296
|
|
|
196
|
-
/*
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
* display: none;
|
|
208
|
-
* }
|
|
209
|
-
*/
|
|
297
|
+
/*
|
|
298
|
+
* Co-occurrence: when a tab is BOTH rejected and carries form
|
|
299
|
+
* errors, the rejection outline already draws focus to the edges;
|
|
300
|
+
* shift the has-errors badge slightly inward so the two signals
|
|
301
|
+
* read as distinct rather than visually merging.
|
|
302
|
+
*/
|
|
303
|
+
.mat-mdc-tab.cngx-mat-tab--error.cngx-mat-tab--has-errors::before {
|
|
304
|
+
top: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
|
|
305
|
+
right: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
|
|
306
|
+
inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
|
|
307
|
+
}
|
|
210
308
|
|
|
211
|
-
/*
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
309
|
+
/*
|
|
310
|
+
* Trailing-edge skin for the dynamically-mounted `<cngx-tab-overflow>`
|
|
311
|
+
* molecule. `[cngxMatTabs]` programmatically appends the molecule
|
|
312
|
+
* into `.mat-mdc-tab-header` and adds the `cngx-mat-tabs-more` class.
|
|
313
|
+
*/
|
|
314
|
+
.cngx-mat-tabs-more {
|
|
315
|
+
flex: 0 0 auto;
|
|
316
|
+
align-self: stretch;
|
|
317
|
+
display: flex;
|
|
318
|
+
align-items: center;
|
|
319
|
+
z-index: var(--cngx-mat-tabs-more-z, 2);
|
|
320
|
+
|
|
321
|
+
/*
|
|
322
|
+
* Drive the molecule's own component-API cascade variables.
|
|
323
|
+
*/
|
|
324
|
+
--cngx-tab-overflow-bg: var(
|
|
325
|
+
--cngx-mat-tabs-more-bg,
|
|
326
|
+
var(--mat-app-background-color, oklch(1 0 0))
|
|
327
|
+
);
|
|
328
|
+
--cngx-tab-overflow-button-bg: var(
|
|
329
|
+
--cngx-mat-tabs-more-bg,
|
|
330
|
+
var(--mat-app-background-color, oklch(1 0 0))
|
|
331
|
+
);
|
|
332
|
+
|
|
333
|
+
box-shadow: var(--cngx-mat-tabs-more-shadow, -8px 0 8px -4px oklch(0 0 0 / 0.1));
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/*
|
|
337
|
+
* Collapse the wrapper to zero layout space when the inner trigger
|
|
338
|
+
* button is hidden (= no clipped tabs).
|
|
339
|
+
*/
|
|
340
|
+
.cngx-mat-tabs-more:has(.cngx-tab-overflow__trigger[hidden]) {
|
|
341
|
+
display: none;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/*
|
|
345
|
+
* SR-only utility for the per-tab error descriptor span mounted by
|
|
346
|
+
* the aggregator-decoration effect.
|
|
347
|
+
*/
|
|
348
|
+
.cngx-sr-only {
|
|
349
|
+
position: absolute;
|
|
350
|
+
width: 1px;
|
|
351
|
+
height: 1px;
|
|
352
|
+
margin: -1px;
|
|
353
|
+
padding: 0;
|
|
354
|
+
overflow: hidden;
|
|
355
|
+
clip: rect(0, 0, 0, 0);
|
|
356
|
+
white-space: nowrap;
|
|
357
|
+
border: 0;
|
|
358
|
+
}
|
|
233
359
|
}
|
package/material/README.md
CHANGED
|
@@ -42,42 +42,42 @@ export class ExampleComponent {
|
|
|
42
42
|
|
|
43
43
|
`CngxMatPaginator` is a Material Design paginator component that wraps the Material `mat-paginator` element and wires it to a `CngxPaginate` directive. It provides:
|
|
44
44
|
|
|
45
|
-
- **Type-safe integration**
|
|
46
|
-
- **Automatic state sync**
|
|
47
|
-
- **Page size selector**
|
|
48
|
-
- **Disabled state**
|
|
45
|
+
- **Type-safe integration** - Explicit `[cngxPaginateRef]` input (no ancestor injection)
|
|
46
|
+
- **Automatic state sync** - Page index, page size, and total count are automatically synchronized
|
|
47
|
+
- **Page size selector** - Customizable page size options via `[pageSizeOptions]`
|
|
48
|
+
- **Disabled state** - Paginator disables when `CngxPaginate.isBusy()` is true
|
|
49
49
|
|
|
50
|
-
The component requires an explicit reference to the `CngxPaginate` directive instance
|
|
50
|
+
The component requires an explicit reference to the `CngxPaginate` directive instance - no hidden ancestor injection, no implicit wiring.
|
|
51
51
|
|
|
52
52
|
## Accessibility
|
|
53
53
|
|
|
54
54
|
`CngxMatPaginator` delegates accessibility to Material's `mat-paginator` component. The Material paginator is fully accessible with:
|
|
55
55
|
|
|
56
|
-
- **ARIA labels**
|
|
57
|
-
- **Keyboard navigation**
|
|
58
|
-
- **Disabled state**
|
|
56
|
+
- **ARIA labels** - Paginator navigation and page size controls are properly labeled
|
|
57
|
+
- **Keyboard navigation** - Tab order and keyboard shortcuts for page navigation
|
|
58
|
+
- **Disabled state** - When `isBusy()` is true, controls are disabled and announced to screen readers
|
|
59
59
|
|
|
60
60
|
## Composition
|
|
61
61
|
|
|
62
62
|
`CngxMatPaginator` composes:
|
|
63
63
|
|
|
64
|
-
- **Material paginator**
|
|
65
|
-
- **CngxPaginate directive**
|
|
66
|
-
- **Event handling**
|
|
64
|
+
- **Material paginator** - `mat-paginator` component from `@angular/material/paginator`
|
|
65
|
+
- **CngxPaginate directive** - Manages pagination state (page index, page size, total)
|
|
66
|
+
- **Event handling** - Subscribes to Material paginator's `page` event and updates directive state
|
|
67
67
|
|
|
68
68
|
## How It Works
|
|
69
69
|
|
|
70
|
-
1. **Setup**
|
|
71
|
-
2. **Data binding**
|
|
72
|
-
3. **Component wire-up**
|
|
73
|
-
4. **State sync**
|
|
74
|
-
5. **User interaction**
|
|
75
|
-
6. **State update**
|
|
76
|
-
7. **Data refresh**
|
|
70
|
+
1. **Setup** - Consumer applies `cngxPaginate` on a container element and assigns a template reference
|
|
71
|
+
2. **Data binding** - Consumer passes `[total]="items.length"` to the directive
|
|
72
|
+
3. **Component wire-up** - `CngxMatPaginator` binds to the directive via `[cngxPaginateRef]`
|
|
73
|
+
4. **State sync** - Component reads `ref.pageIndex()`, `ref.pageSize()`, `ref.total()` and binds to Material's `mat-paginator`
|
|
74
|
+
5. **User interaction** - When user changes page or page size, Material's `page` event fires
|
|
75
|
+
6. **State update** - `CngxMatPaginator.handlePage()` calls `ref.setPageSize()` and `ref.setPage()` to update directive state
|
|
76
|
+
7. **Data refresh** - Consumer reactively filters/slices data based on directive signals
|
|
77
77
|
|
|
78
78
|
## Material Theming
|
|
79
79
|
|
|
80
|
-
`CngxMatPaginator` uses the standard Material `mat-paginator` component, which inherits theming from your Material theme automatically. No additional theme configuration needed
|
|
80
|
+
`CngxMatPaginator` uses the standard Material `mat-paginator` component, which inherits theming from your Material theme automatically. No additional theme configuration needed - include the Material theme in your global stylesheet.
|
|
81
81
|
|
|
82
82
|
```scss
|
|
83
83
|
@use '@angular/material' as mat;
|