@cngx/common 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/a11y/README.md +15 -2
- package/button/README.md +258 -0
- package/command/README.md +19 -8
- package/data/README.md +10 -10
- package/fesm2022/cngx-common-a11y.mjs +701 -263
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +83 -64
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-button.mjs +1084 -0
- package/fesm2022/cngx-common-button.mjs.map +1 -0
- package/fesm2022/cngx-common-card.mjs +135 -76
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +749 -296
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +51 -29
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +695 -405
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +112 -112
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +668 -308
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +7066 -2739
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +2121 -492
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-menu-button.mjs +557 -0
- package/fesm2022/cngx-common-menu-button.mjs.map +1 -0
- package/fesm2022/cngx-common-popover.mjs +1207 -569
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +256 -261
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +202 -262
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +28 -61
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +10 -10
- package/fesm2022/cngx-common.mjs.map +1 -1
- package/interactive/README.md +30 -19
- package/layout/README.md +1 -1
- package/menu-button/README.md +234 -0
- package/package.json +14 -4
- package/popover/README.md +42 -5
- package/popover/tooltip-indicator.scss +52 -0
- package/schematics/ng-add/index.js +7 -7
- package/schematics/ng-add/schema.json +5 -0
- package/stepper/README.md +0 -1
- package/theming/components/cngx-accordion.css +36 -7
- package/theming/components/cngx-async.css +185 -37
- package/theming/components/cngx-backdrop.css +3 -1
- package/theming/components/cngx-badge.css +20 -5
- package/theming/components/cngx-bottom-sheet.css +2 -0
- package/theming/components/cngx-breadcrumb.css +3 -1
- package/theming/components/cngx-button-group.css +325 -0
- package/theming/components/cngx-button-toggle.css +55 -23
- package/theming/components/cngx-button.css +975 -0
- package/theming/components/cngx-data-grid.css +2 -0
- package/theming/components/cngx-dialog.css +3 -1
- package/theming/components/cngx-divider.css +24 -9
- package/theming/components/cngx-drawer.css +153 -0
- package/theming/components/cngx-icon-glyph.css +76 -0
- package/theming/components/cngx-listbox.css +79 -25
- package/theming/components/cngx-menu.css +112 -52
- package/theming/components/cngx-nav.css +1220 -0
- package/theming/components/cngx-popover-sheet.css +43 -11
- package/theming/components/cngx-popover.css +37 -13
- package/theming/components/cngx-recycler-placeholder.css +2 -0
- package/theming/components/cngx-ripple.css +74 -16
- package/theming/components/cngx-sidebar.css +71 -0
- package/theming/components/cngx-slider.css +3 -1
- package/theming/components/cngx-tooltip.css +2 -0
- package/timeline/README.md +2 -2
- package/types/cngx-common-a11y.d.ts +343 -120
- package/types/cngx-common-audio.d.ts +60 -88
- package/types/cngx-common-button.d.ts +698 -0
- package/types/cngx-common-card.d.ts +104 -78
- package/types/cngx-common-chart.d.ts +671 -384
- package/types/cngx-common-command.d.ts +44 -47
- package/types/cngx-common-data.d.ts +350 -342
- package/types/cngx-common-dialog.d.ts +91 -120
- package/types/cngx-common-display.d.ts +475 -300
- package/types/cngx-common-interactive.d.ts +4350 -1723
- package/types/cngx-common-layout.d.ts +1365 -286
- package/types/cngx-common-menu-button.d.ts +382 -0
- package/types/cngx-common-popover.d.ts +671 -289
- package/types/cngx-common-stepper.d.ts +217 -347
- package/types/cngx-common-tabs.d.ts +173 -386
- package/types/cngx-common-timeline.d.ts +25 -104
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
* the panel opens, and the region its padding. Without it the accordion renders
|
|
8
8
|
* as bare stacked buttons.
|
|
9
9
|
*
|
|
10
|
+
* Opt-in: the classes `.cngx-accordion`, `.cngx-accordion__header` and
|
|
11
|
+
* `.cngx-accordion__region` switch the skin on, not the directive attributes,
|
|
12
|
+
* so organisms that compose the directives (`CngxAccordionItem`, the data-grid
|
|
13
|
+
* accordion rows) keep their own look.
|
|
14
|
+
*
|
|
10
15
|
* Markup the default skin expects (header buttons are direct children of the
|
|
11
16
|
* `cngxAccordion` element so the roving host can find them):
|
|
12
17
|
*
|
|
@@ -25,12 +30,14 @@
|
|
|
25
30
|
* - hover tint -> `--cngx-color-primary` (low alpha)
|
|
26
31
|
* - dividers -> `--cngx-color-border`
|
|
27
32
|
* - focus ring -> `--cngx-color-primary` (contrast >= 3:1)
|
|
33
|
+
*
|
|
34
|
+
* @themes CngxAccordion, CngxAccordionPanel
|
|
28
35
|
*/
|
|
29
36
|
|
|
30
37
|
@layer cngx.tokens {
|
|
31
38
|
/**
|
|
32
39
|
* Header button padding. The pixel `initial-value` is only the un-set
|
|
33
|
-
* fallback; the standalone `
|
|
40
|
+
* fallback; the standalone `.cngx-accordion` host SETs this from
|
|
34
41
|
* `--cngx-space-*` (below) so a global `[data-density]` re-scales a bare
|
|
35
42
|
* `@cngx/common` accordion, and the `@cngx/ui/accordion` organism SETs the
|
|
36
43
|
* same tokens at its group default. Never put `var()` in the `initial-value`
|
|
@@ -86,7 +93,7 @@
|
|
|
86
93
|
}
|
|
87
94
|
|
|
88
95
|
@layer cngx.components {
|
|
89
|
-
|
|
96
|
+
.cngx-accordion {
|
|
90
97
|
/* Derive header + region padding from the scale so a bare @cngx/common
|
|
91
98
|
accordion densifies at its own default host - standalone use must not
|
|
92
99
|
depend on the @cngx/ui/accordion organism (which SETs the same tokens at
|
|
@@ -100,10 +107,12 @@
|
|
|
100
107
|
display: block;
|
|
101
108
|
border: 1px solid var(--cngx-accordion-border-color, oklch(0.88 0.005 250));
|
|
102
109
|
border-radius: var(--cngx-radius-md, 0.375rem);
|
|
110
|
+
/* Radius inside the 1px border, for the headers that touch a rounded edge. */
|
|
111
|
+
--_cngx-accordion-inner-radius: calc(var(--cngx-radius-md, 0.375rem) - 1px);
|
|
103
112
|
overflow: hidden;
|
|
104
113
|
}
|
|
105
114
|
|
|
106
|
-
|
|
115
|
+
.cngx-accordion__header {
|
|
107
116
|
display: flex;
|
|
108
117
|
align-items: center;
|
|
109
118
|
justify-content: space-between;
|
|
@@ -122,7 +131,22 @@
|
|
|
122
131
|
cursor: pointer;
|
|
123
132
|
}
|
|
124
133
|
|
|
125
|
-
|
|
134
|
+
/* A header on a rounded edge takes the inner radius, so its focus outline
|
|
135
|
+
follows the curve instead of being clipped by the host's overflow. The last
|
|
136
|
+
header only sits on the edge while its region is closed; there the host
|
|
137
|
+
border is its bottom line, so it drops its own. */
|
|
138
|
+
.cngx-accordion__header:first-of-type {
|
|
139
|
+
border-start-start-radius: var(--_cngx-accordion-inner-radius, 0);
|
|
140
|
+
border-start-end-radius: var(--_cngx-accordion-inner-radius, 0);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.cngx-accordion__header:last-of-type:not([aria-expanded='true']) {
|
|
144
|
+
border-end-start-radius: var(--_cngx-accordion-inner-radius, 0);
|
|
145
|
+
border-end-end-radius: var(--_cngx-accordion-inner-radius, 0);
|
|
146
|
+
border-block-end: 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.cngx-accordion__header:hover {
|
|
126
150
|
background: color-mix(
|
|
127
151
|
in oklch,
|
|
128
152
|
var(--cngx-color-primary, oklch(0.66 0.19 50)) 6%,
|
|
@@ -130,7 +154,7 @@
|
|
|
130
154
|
);
|
|
131
155
|
}
|
|
132
156
|
|
|
133
|
-
|
|
157
|
+
.cngx-accordion__header:focus-visible {
|
|
134
158
|
outline: 2px solid var(--cngx-color-primary, oklch(0.66 0.19 50));
|
|
135
159
|
outline-offset: -2px;
|
|
136
160
|
}
|
|
@@ -138,7 +162,7 @@
|
|
|
138
162
|
/* Twisty: a CSS-drawn chevron after the label that rotates when the panel
|
|
139
163
|
* opens. A skin projecting its own icon hides it via
|
|
140
164
|
* `--cngx-accordion-twisty-display: none` on the header. */
|
|
141
|
-
|
|
165
|
+
.cngx-accordion__header::after {
|
|
142
166
|
content: '';
|
|
143
167
|
display: var(--cngx-accordion-twisty-display, block);
|
|
144
168
|
flex: 0 0 auto;
|
|
@@ -150,7 +174,7 @@
|
|
|
150
174
|
transition: rotate var(--cngx-duration-fast, 150ms) ease;
|
|
151
175
|
}
|
|
152
176
|
|
|
153
|
-
[
|
|
177
|
+
.cngx-accordion__header[aria-expanded='true']::after {
|
|
154
178
|
rotate: 225deg;
|
|
155
179
|
}
|
|
156
180
|
|
|
@@ -158,4 +182,9 @@
|
|
|
158
182
|
padding: var(--cngx-accordion-region-padding, 0.75rem 1rem);
|
|
159
183
|
border-block-end: 1px solid var(--cngx-accordion-border-color, oklch(0.88 0.005 250));
|
|
160
184
|
}
|
|
185
|
+
|
|
186
|
+
/* The open last region sits on the host's bottom border. */
|
|
187
|
+
.cngx-accordion__region:last-child {
|
|
188
|
+
border-block-end: 0;
|
|
189
|
+
}
|
|
161
190
|
}
|
|
@@ -4,71 +4,219 @@
|
|
|
4
4
|
* (`@cngx/common/interactive`). The directive toggles
|
|
5
5
|
* `cngx-async--pending`, `cngx-async--success`, `cngx-async--error`
|
|
6
6
|
* on its host as the async action progresses; this stylesheet
|
|
7
|
-
* paints the three phases
|
|
7
|
+
* paints the three phases on hosts without their own paint, such as a bare
|
|
8
|
+
* `<button cngxAsyncClick>` or an anchor.
|
|
9
|
+
*
|
|
10
|
+
* Every host also carries the stable `cngx-async` class, whatever its
|
|
11
|
+
* phase: `[cngxAsyncClick]` is a property binding and leaves no attribute to
|
|
12
|
+
* select on. The colour tokens inherit, so a theme sets them on an ancestor;
|
|
13
|
+
* the Material bridge sets them on its theme host, not per host.
|
|
14
|
+
* `--cngx-async-pending-opacity` belongs to
|
|
15
|
+
* the host: a theme rule on `.cngx-async` would outrank a host that turns the
|
|
16
|
+
* dim off on itself.
|
|
17
|
+
*
|
|
18
|
+
* **Scope**
|
|
19
|
+
*
|
|
20
|
+
* The state rules sit at zero specificity (`:where()`), so a host with its own
|
|
21
|
+
* paint wins by specificity and keeps it through every phase. Such a host
|
|
22
|
+
* sets `--cngx-async-pending-opacity: 1` on itself and reverts the
|
|
23
|
+
* forced-colors outline in its own unlayered rule; the button family does,
|
|
24
|
+
* and shows its own busy treatment and settle result instead.
|
|
8
25
|
*
|
|
9
26
|
* **State modifiers**
|
|
10
27
|
*
|
|
11
|
-
* - `--pending` - dimmed opacity + `cursor: wait
|
|
12
|
-
*
|
|
13
|
-
*
|
|
28
|
+
* - `--pending` - dimmed opacity + `cursor: wait`. Follows the directive's
|
|
29
|
+
* `busyVisible` gate (`CNGX_LOADING_CONFIG` show delay and min-dwell,
|
|
30
|
+
* `[showDelay]` / `[minDwell]` per instance), so a fast run never gets
|
|
31
|
+
* it; `aria-busy` is immediate. `--success` / `--error` wait until the
|
|
32
|
+
* gate releases, so a host never wears two modifiers
|
|
33
|
+
* - `--success` - success-tinted surface, border, text; under forced colors
|
|
34
|
+
* a 2px solid outline
|
|
35
|
+
* - `--error` - danger-tinted surface, border, text; under forced colors a
|
|
36
|
+
* 2px dashed outline
|
|
14
37
|
*
|
|
15
38
|
* **Inheritance**
|
|
16
39
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
40
|
+
* The colour tokens are registered without an initial value, so until a
|
|
41
|
+
* theme sets them each one falls through to the semantic palette and
|
|
42
|
+
* follows the colour scheme:
|
|
20
43
|
*
|
|
21
|
-
* - `--cngx-
|
|
22
|
-
* - `--cngx-
|
|
23
|
-
*
|
|
24
|
-
* - `--cngx-
|
|
44
|
+
* - `--cngx-async-success-bg` -> 12% `--cngx-color-success`
|
|
45
|
+
* - `--cngx-async-success-color` -> `--cngx-color-success` mixed toward
|
|
46
|
+
* `--cngx-color-text`
|
|
47
|
+
* - `--cngx-async-success-border` -> `--cngx-color-success`
|
|
48
|
+
* - `--cngx-async-error-bg` -> 12% `--cngx-color-danger`
|
|
49
|
+
* - `--cngx-async-error-color` -> `--cngx-color-danger-text`
|
|
50
|
+
* - `--cngx-async-error-border` -> `--cngx-color-danger`
|
|
25
51
|
*
|
|
26
52
|
* **Notes**
|
|
27
53
|
*
|
|
28
54
|
* - Lives under `theming/components` because `styleUrl` is
|
|
29
55
|
* `@Component`-only; the directive's state classes must remain
|
|
30
56
|
* globally available.
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* Tracked as a separate fix.
|
|
57
|
+
*
|
|
58
|
+
* @themes CngxAsyncClick
|
|
34
59
|
*/
|
|
35
60
|
|
|
61
|
+
@layer cngx.tokens {
|
|
62
|
+
/**
|
|
63
|
+
* Transition shorthand for the background-color / color / border-color /
|
|
64
|
+
* opacity changes between async states.
|
|
65
|
+
*
|
|
66
|
+
* Derives from the `--cngx-duration-base` rung of the motion scale; a
|
|
67
|
+
* `--cngx-duration-*` brand override re-times it library-wide.
|
|
68
|
+
* @group Motion
|
|
69
|
+
* @relatedTo provideMotion, CngxMotionScope, injectMotion
|
|
70
|
+
*/
|
|
71
|
+
@property --cngx-async-transition {
|
|
72
|
+
syntax: '*';
|
|
73
|
+
inherits: true;
|
|
74
|
+
initial-value: 0.2s ease;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Derive the duration segment from the motion scale; easing stays literal.
|
|
78
|
+
* SET on the state hosts, which read the transition. Layer cngx.tokens keeps
|
|
79
|
+
* a Material bridge winning for the Material path. 0.2s -> base. */
|
|
80
|
+
:where(.cngx-async--pending, .cngx-async--success, .cngx-async--error) {
|
|
81
|
+
--cngx-async-transition: var(--cngx-duration-base) ease;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Opacity applied while `cngxAsyncClick` reports `pending`. Combined
|
|
86
|
+
* with `cursor: wait` on the same state. A host with its own busy
|
|
87
|
+
* treatment sets it to `1`.
|
|
88
|
+
* @group State / Pending
|
|
89
|
+
*/
|
|
90
|
+
@property --cngx-async-pending-opacity {
|
|
91
|
+
syntax: '<number>';
|
|
92
|
+
inherits: true;
|
|
93
|
+
initial-value: 0.7;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Background tint after a successful async commit. Unset by default:
|
|
98
|
+
* 12% `--cngx-color-success`.
|
|
99
|
+
* @group State / Success
|
|
100
|
+
*/
|
|
101
|
+
@property --cngx-async-success-bg {
|
|
102
|
+
syntax: '*';
|
|
103
|
+
inherits: true;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Text color after a successful async commit. Unset by default:
|
|
108
|
+
* `--cngx-color-success` mixed 75% toward `--cngx-color-text`, so it
|
|
109
|
+
* reads as text in both schemes.
|
|
110
|
+
* @group State / Success
|
|
111
|
+
*/
|
|
112
|
+
@property --cngx-async-success-color {
|
|
113
|
+
syntax: '*';
|
|
114
|
+
inherits: true;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Border color after a successful async commit. Unset by default:
|
|
119
|
+
* `--cngx-color-success`.
|
|
120
|
+
* @group State / Success
|
|
121
|
+
*/
|
|
122
|
+
@property --cngx-async-success-border {
|
|
123
|
+
syntax: '*';
|
|
124
|
+
inherits: true;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Background tint after a failed async commit. Unset by default:
|
|
129
|
+
* 12% `--cngx-color-danger`.
|
|
130
|
+
* @group State / Error
|
|
131
|
+
*/
|
|
132
|
+
@property --cngx-async-error-bg {
|
|
133
|
+
syntax: '*';
|
|
134
|
+
inherits: true;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Text color after a failed async commit. Unset by default:
|
|
139
|
+
* `--cngx-color-danger-text`.
|
|
140
|
+
* @group State / Error
|
|
141
|
+
*/
|
|
142
|
+
@property --cngx-async-error-color {
|
|
143
|
+
syntax: '*';
|
|
144
|
+
inherits: true;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Border color after a failed async commit. Unset by default:
|
|
149
|
+
* `--cngx-color-danger`.
|
|
150
|
+
* @group State / Error
|
|
151
|
+
*/
|
|
152
|
+
@property --cngx-async-error-border {
|
|
153
|
+
syntax: '*';
|
|
154
|
+
inherits: true;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
36
158
|
@layer cngx.components {
|
|
37
|
-
.cngx-async--pending {
|
|
38
|
-
opacity: var(--cngx-
|
|
159
|
+
:where(.cngx-async--pending) {
|
|
160
|
+
opacity: var(--cngx-async-pending-opacity, 0.7);
|
|
39
161
|
cursor: wait;
|
|
40
|
-
transition: opacity var(--cngx-
|
|
162
|
+
transition: opacity var(--cngx-async-transition, 0.2s ease);
|
|
41
163
|
}
|
|
42
164
|
|
|
43
|
-
.cngx-async--
|
|
165
|
+
:where(.cngx-async--success) {
|
|
44
166
|
background-color: var(
|
|
45
|
-
--cngx-
|
|
46
|
-
var(--cngx-color-success, oklch(0.
|
|
167
|
+
--cngx-async-success-bg,
|
|
168
|
+
color-mix(in oklab, var(--cngx-color-success, oklch(0.6 0.15 145)) 12%, transparent)
|
|
47
169
|
);
|
|
48
|
-
color: var(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
170
|
+
color: var(
|
|
171
|
+
--cngx-async-success-color,
|
|
172
|
+
color-mix(
|
|
173
|
+
in oklab,
|
|
174
|
+
var(--cngx-color-success, oklch(0.6 0.15 145)) 75%,
|
|
175
|
+
var(--cngx-color-text, oklch(0.2 0.01 250))
|
|
176
|
+
)
|
|
52
177
|
);
|
|
178
|
+
border-color: var(--cngx-async-success-border, var(--cngx-color-success, oklch(0.6 0.15 145)));
|
|
53
179
|
transition:
|
|
54
|
-
background-color var(--cngx-
|
|
55
|
-
color var(--cngx-
|
|
56
|
-
border-color var(--cngx-
|
|
180
|
+
background-color var(--cngx-async-transition, 0.2s ease),
|
|
181
|
+
color var(--cngx-async-transition, 0.2s ease),
|
|
182
|
+
border-color var(--cngx-async-transition, 0.2s ease),
|
|
183
|
+
opacity var(--cngx-async-transition, 0.2s ease);
|
|
57
184
|
}
|
|
58
185
|
|
|
59
|
-
.cngx-async--
|
|
186
|
+
:where(.cngx-async--error) {
|
|
60
187
|
background-color: var(
|
|
61
|
-
--cngx-
|
|
62
|
-
var(--cngx-color-danger, oklch(0.
|
|
188
|
+
--cngx-async-error-bg,
|
|
189
|
+
color-mix(in oklab, var(--cngx-color-danger, oklch(0.6 0.18 25)) 12%, transparent)
|
|
63
190
|
);
|
|
64
|
-
color: var(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
191
|
+
color: var(
|
|
192
|
+
--cngx-async-error-color,
|
|
193
|
+
var(
|
|
194
|
+
--cngx-color-danger-text,
|
|
195
|
+
oklch(from var(--cngx-color-danger, oklch(0.6 0.18 25)) 0.46 c h)
|
|
196
|
+
)
|
|
68
197
|
);
|
|
198
|
+
border-color: var(--cngx-async-error-border, var(--cngx-color-danger, oklch(0.6 0.18 25)));
|
|
69
199
|
transition:
|
|
70
|
-
background-color var(--cngx-
|
|
71
|
-
color var(--cngx-
|
|
72
|
-
border-color var(--cngx-
|
|
200
|
+
background-color var(--cngx-async-transition, 0.2s ease),
|
|
201
|
+
color var(--cngx-async-transition, 0.2s ease),
|
|
202
|
+
border-color var(--cngx-async-transition, 0.2s ease),
|
|
203
|
+
opacity var(--cngx-async-transition, 0.2s ease);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* Forced colors drop the tints, so success and error differ by an outline's
|
|
208
|
+
* style; its colour is left to the UA's system colour. An outline takes no
|
|
209
|
+
* layout space, so the host keeps its box size when the cue appears.
|
|
210
|
+
* Unlayered, so a consumer outline reset does not hide the cue on a bare host;
|
|
211
|
+
* a host with its own cue reverts it in a more specific unlayered rule. A
|
|
212
|
+
* focused host keeps its focus ring. */
|
|
213
|
+
@media (forced-colors: active) {
|
|
214
|
+
:where(.cngx-async--success):not(:focus-visible) {
|
|
215
|
+
outline: 2px solid;
|
|
216
|
+
outline-offset: -2px;
|
|
217
|
+
}
|
|
218
|
+
:where(.cngx-async--error):not(:focus-visible) {
|
|
219
|
+
outline: 2px dashed;
|
|
220
|
+
outline-offset: -2px;
|
|
73
221
|
}
|
|
74
222
|
}
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
* **Pair with**
|
|
21
21
|
*
|
|
22
22
|
* - `@cngx/themes/material/backdrop-theme` - Material 3 scrim surface
|
|
23
|
+
*
|
|
24
|
+
* @themes CngxBackdrop
|
|
23
25
|
*/
|
|
24
26
|
|
|
25
27
|
@layer cngx.tokens {
|
|
@@ -70,7 +72,7 @@
|
|
|
70
72
|
|
|
71
73
|
/* Themable - token-driven, three-tier overridable */
|
|
72
74
|
background: var(--cngx-backdrop-bg, oklch(0 0 0 / 0.5));
|
|
73
|
-
transition: opacity var(--cngx-backdrop-transition-duration
|
|
75
|
+
transition: opacity var(--cngx-backdrop-transition-duration);
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
/* Visible state - class is toggled by the directive. `:scope` form
|
|
@@ -45,6 +45,8 @@
|
|
|
45
45
|
* cut-out ring via `--cngx-badge-border-dark` / `-light`. Default
|
|
46
46
|
* border is `0` (no ring), so the dark-mode block is a no-op until
|
|
47
47
|
* a consumer sets the ring tokens.
|
|
48
|
+
*
|
|
49
|
+
* @themes CngxBadge
|
|
48
50
|
*/
|
|
49
51
|
|
|
50
52
|
@layer cngx.tokens {
|
|
@@ -144,11 +146,11 @@
|
|
|
144
146
|
* `--cngx-color-primary`.
|
|
145
147
|
* @group Variant / Primary
|
|
146
148
|
* @see [[--cngx-color-primary]]
|
|
149
|
+
* @default var(--cngx-color-primary)
|
|
147
150
|
*/
|
|
148
151
|
@property --cngx-badge-primary-bg {
|
|
149
|
-
syntax: '
|
|
152
|
+
syntax: '*';
|
|
150
153
|
inherits: true;
|
|
151
|
-
initial-value: oklch(0.66 0.19 50);
|
|
152
154
|
}
|
|
153
155
|
|
|
154
156
|
/**
|
|
@@ -246,6 +248,19 @@
|
|
|
246
248
|
.light {
|
|
247
249
|
--cngx-badge-border: var(--cngx-badge-border-light, var(--cngx-badge-border, 0));
|
|
248
250
|
}
|
|
251
|
+
|
|
252
|
+
/* Derive the radius and the error and warning fills from the theme: the
|
|
253
|
+
* registered initial defeats a use-site fallback, so the default lives in a
|
|
254
|
+
* SET. The fills inherit and SET on the badge host; the radius does not and
|
|
255
|
+
* SETs on the indicator. Kept in this layer so a Material bridge and a
|
|
256
|
+
* consumer override still win. */
|
|
257
|
+
.cngx-badge-host {
|
|
258
|
+
--cngx-badge-error-bg: var(--cngx-color-danger);
|
|
259
|
+
--cngx-badge-warning-bg: var(--cngx-color-warning);
|
|
260
|
+
}
|
|
261
|
+
.cngx-badge-indicator {
|
|
262
|
+
--cngx-badge-radius: var(--cngx-radius-pill);
|
|
263
|
+
}
|
|
249
264
|
}
|
|
250
265
|
|
|
251
266
|
@layer cngx.components {
|
|
@@ -273,7 +288,7 @@
|
|
|
273
288
|
min-width: var(--cngx-badge-size, 16px);
|
|
274
289
|
height: var(--cngx-badge-size, 16px);
|
|
275
290
|
padding: 0 var(--cngx-badge-padding-inline, 3px);
|
|
276
|
-
border-radius: var(--cngx-badge-radius
|
|
291
|
+
border-radius: var(--cngx-badge-radius);
|
|
277
292
|
font-size: var(--cngx-badge-font-size, 0.6875rem);
|
|
278
293
|
font-weight: var(--cngx-badge-font-weight, 600);
|
|
279
294
|
line-height: 1;
|
|
@@ -301,11 +316,11 @@
|
|
|
301
316
|
color: var(--cngx-badge-primary-color, oklch(1 0 0));
|
|
302
317
|
}
|
|
303
318
|
:scope.cngx-badge-indicator--error {
|
|
304
|
-
background: var(--cngx-badge-error-bg
|
|
319
|
+
background: var(--cngx-badge-error-bg);
|
|
305
320
|
color: var(--cngx-badge-error-color, oklch(1 0 0));
|
|
306
321
|
}
|
|
307
322
|
:scope.cngx-badge-indicator--warning {
|
|
308
|
-
background: var(--cngx-badge-warning-bg
|
|
323
|
+
background: var(--cngx-badge-warning-bg);
|
|
309
324
|
color: var(--cngx-badge-warning-color, oklch(0.2 0.01 250));
|
|
310
325
|
}
|
|
311
326
|
:scope.cngx-badge-indicator--neutral {
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
* - link colour -> `--cngx-color-primary`
|
|
25
25
|
* - terminal crumb -> `--cngx-color-text`
|
|
26
26
|
* - separator -> `--cngx-color-text-muted`
|
|
27
|
+
*
|
|
28
|
+
* @themes CngxBreadcrumb, CngxBreadcrumbItem, CngxBreadcrumbSeparator
|
|
27
29
|
*/
|
|
28
30
|
|
|
29
31
|
@layer cngx.tokens {
|
|
@@ -67,7 +69,7 @@
|
|
|
67
69
|
display: flex;
|
|
68
70
|
flex-wrap: wrap;
|
|
69
71
|
align-items: center;
|
|
70
|
-
gap: var(--cngx-breadcrumb-gap
|
|
72
|
+
gap: var(--cngx-breadcrumb-gap);
|
|
71
73
|
margin: 0;
|
|
72
74
|
padding: 0;
|
|
73
75
|
list-style: none;
|