@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
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* chrome that a bare `<ul cngxMenu>…</ul>` renders as a usable
|
|
5
5
|
* popover menu: bullets stripped, items laid out in a flex row with
|
|
6
6
|
* icon / label / suffix / kbd slots, keyboard-cursor and checked-state
|
|
7
|
-
* signals painted in.
|
|
8
|
-
*
|
|
9
|
-
* `
|
|
7
|
+
* signals painted in. The container paints a default floating surface
|
|
8
|
+
* (background, border, radius, elevation) from the `--cngx-menu-bg`,
|
|
9
|
+
* `-border`, `-radius` and `-shadow` tokens; a host that paints its own
|
|
10
|
+
* surface around the menu sets those tokens on its menu.
|
|
10
11
|
*
|
|
11
12
|
* **Selectors**
|
|
12
13
|
*
|
|
@@ -14,6 +15,9 @@
|
|
|
14
15
|
* - `[cngxMenuItem]`, `[cngxMenuItemCheckbox]`, `[cngxMenuItemRadio]`,
|
|
15
16
|
* `[cngxMenuItemSubmenu]` - item hosts
|
|
16
17
|
* - `.cngx-menu-item__icon`, `__label`, `__suffix`, `__kbd` - slots
|
|
18
|
+
* - `.cngx-menu-item__indicator` - checked indicator the checkbox / radio
|
|
19
|
+
* item inserts; `__indicator-svg` is its icon, `--stroke` marks an
|
|
20
|
+
* outline
|
|
17
21
|
* - `.cngx-menu-item--highlighted`, `--disabled`, `--checked` - state
|
|
18
22
|
* - `[cngxMenuSeparator]` - hairline divider
|
|
19
23
|
*
|
|
@@ -24,11 +28,12 @@
|
|
|
24
28
|
* - `--disabled` - 38% text (the disabled field recipe), never opacity,
|
|
25
29
|
* shortcut and checked glyph included; `cursor: not-allowed`; GrayText
|
|
26
30
|
* under forced colors
|
|
27
|
-
* - `--checked` - bolder font-weight plus a leading
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* filled dot
|
|
31
|
-
*
|
|
31
|
+
* - `--checked` - bolder font-weight plus a leading
|
|
32
|
+
* `.cngx-menu-item__indicator` the item directive inserts, so the cue
|
|
33
|
+
* lands even without a projected icon: `[cngxMenuItemCheckbox]` -> a
|
|
34
|
+
* check, `[cngxMenuItemRadio]` -> a filled dot, both from the shared
|
|
35
|
+
* icon set. `:has(.cngx-menu-item__icon)` hides the indicator when a
|
|
36
|
+
* projected icon already occupies the slot.
|
|
32
37
|
*
|
|
33
38
|
* **Inheritance**
|
|
34
39
|
*
|
|
@@ -38,6 +43,10 @@
|
|
|
38
43
|
* - `--cngx-menu-item-highlight-bg` -> `color-mix(primary, transparent)`
|
|
39
44
|
* - `--cngx-menu-item-checked-color` -> `--cngx-color-primary`
|
|
40
45
|
* - `--cngx-menu-separator-color` -> `--cngx-color-border`
|
|
46
|
+
* - `--cngx-menu-bg` -> `--cngx-color-surface`
|
|
47
|
+
* - `--cngx-menu-border` -> 1px `--cngx-color-border`
|
|
48
|
+
* - `--cngx-menu-radius` -> `--cngx-radius-md`
|
|
49
|
+
* - `--cngx-menu-shadow` -> `--cngx-shadow-md`
|
|
41
50
|
*
|
|
42
51
|
* The highlight tint is a `color-mix()` so Material's `--mat-sys-primary`
|
|
43
52
|
* (or any other primary override) flows through without forking.
|
|
@@ -52,6 +61,8 @@
|
|
|
52
61
|
* **Pair with**
|
|
53
62
|
*
|
|
54
63
|
* - `@cngx/themes/material/interactive-controls-theme` - Material 3 surface
|
|
64
|
+
*
|
|
65
|
+
* @themes CngxMenu, CngxMenuItem, CngxMenuItemCheckbox, CngxMenuItemRadio, CngxMenuItemSubmenu, CngxMenuSeparator
|
|
55
66
|
*/
|
|
56
67
|
|
|
57
68
|
@layer cngx.tokens {
|
|
@@ -106,6 +117,48 @@
|
|
|
106
117
|
initial-value: oklch(0.66 0.19 50 / 0.1);
|
|
107
118
|
}
|
|
108
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Background of the menu container. Unset by default, so the container
|
|
122
|
+
* paints `--cngx-color-surface`. A host that paints its own surface around
|
|
123
|
+
* the menu sets it to `transparent` on its menu.
|
|
124
|
+
* @group Surface
|
|
125
|
+
* @see [[--cngx-color-surface]]
|
|
126
|
+
*/
|
|
127
|
+
@property --cngx-menu-bg {
|
|
128
|
+
syntax: '*';
|
|
129
|
+
inherits: false;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Border shorthand of the menu container. Unset by default, so the
|
|
134
|
+
* container draws a 1px `--cngx-color-border` line.
|
|
135
|
+
* @group Surface
|
|
136
|
+
*/
|
|
137
|
+
@property --cngx-menu-border {
|
|
138
|
+
syntax: '*';
|
|
139
|
+
inherits: false;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Corner radius of the menu container. Unset by default, so it follows
|
|
144
|
+
* `--cngx-radius-md`.
|
|
145
|
+
* @group Surface
|
|
146
|
+
*/
|
|
147
|
+
@property --cngx-menu-radius {
|
|
148
|
+
syntax: '*';
|
|
149
|
+
inherits: false;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Elevation of the menu container. Unset by default, so it follows
|
|
154
|
+
* `--cngx-shadow-md`.
|
|
155
|
+
* @group Surface
|
|
156
|
+
*/
|
|
157
|
+
@property --cngx-menu-shadow {
|
|
158
|
+
syntax: '*';
|
|
159
|
+
inherits: false;
|
|
160
|
+
}
|
|
161
|
+
|
|
109
162
|
/**
|
|
110
163
|
* Padding shorthand inside the menu container.
|
|
111
164
|
* @group Layout
|
|
@@ -159,7 +212,7 @@
|
|
|
159
212
|
}
|
|
160
213
|
|
|
161
214
|
/**
|
|
162
|
-
* Color of the leading
|
|
215
|
+
* Color of the leading check or dot indicator on a checked item.
|
|
163
216
|
* Tracks the foundation primary so the cue matches the highlight
|
|
164
217
|
* accent.
|
|
165
218
|
* @group State / Checked
|
|
@@ -270,8 +323,9 @@
|
|
|
270
323
|
outline: none;
|
|
271
324
|
/* Default floating surface so a bare menu (e.g. a headless context menu in
|
|
272
325
|
a raw [cngxPopover]) ships readable, not as the native popover UA box.
|
|
273
|
-
Delegates to the foundation so dark-mode swaps cascade
|
|
274
|
-
|
|
326
|
+
Delegates to the foundation so dark-mode swaps cascade. A host that
|
|
327
|
+
paints its own surface around the menu sets the --cngx-menu-* surface
|
|
328
|
+
tokens on its menu (or strips it on its own menu class). */
|
|
275
329
|
background: var(--cngx-menu-bg, var(--cngx-color-surface, oklch(1 0 0)));
|
|
276
330
|
color: var(--cngx-menu-color, var(--cngx-color-text, inherit));
|
|
277
331
|
border: var(--cngx-menu-border, 1px solid var(--cngx-color-border, oklch(0.85 0.01 250)));
|
|
@@ -279,15 +333,6 @@
|
|
|
279
333
|
box-shadow: var(--cngx-menu-shadow, var(--cngx-shadow-md, 0 4px 12px oklch(0 0 0 / 0.12)));
|
|
280
334
|
}
|
|
281
335
|
|
|
282
|
-
/* A menu placed inside a CngxPopoverPanel would double the surface; the panel
|
|
283
|
-
already paints one, so strip the menu's here. */
|
|
284
|
-
.cngx-popover-panel [cngxMenu] {
|
|
285
|
-
background: transparent;
|
|
286
|
-
border: 0;
|
|
287
|
-
border-radius: 0;
|
|
288
|
-
box-shadow: none;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
336
|
[cngxMenu]:focus-visible {
|
|
292
337
|
outline: var(--cngx-menu-focus-outline-width, 2px) solid
|
|
293
338
|
var(--cngx-menu-focus-outline-color, oklch(0.66 0.19 50));
|
|
@@ -327,53 +372,68 @@
|
|
|
327
372
|
}
|
|
328
373
|
|
|
329
374
|
.cngx-menu-item--highlighted {
|
|
330
|
-
background: var(--cngx-menu-item-highlight-bg
|
|
375
|
+
background: var(--cngx-menu-item-highlight-bg);
|
|
331
376
|
}
|
|
332
377
|
|
|
333
378
|
/* Disabled by colour, never opacity (the field recipe). The shortcut and
|
|
334
|
-
* the checked
|
|
335
|
-
*
|
|
336
|
-
* below (0,3,1). */
|
|
379
|
+
* the checked indicator carry their own colours, so they follow
|
|
380
|
+
* explicitly. */
|
|
337
381
|
.cngx-menu-item--disabled {
|
|
338
382
|
color: color-mix(in oklab, var(--cngx-color-text, oklch(0.2 0.01 250)) 38%, transparent);
|
|
339
383
|
cursor: not-allowed;
|
|
340
384
|
}
|
|
341
385
|
.cngx-menu-item--disabled .cngx-menu-item__kbd,
|
|
342
|
-
|
|
386
|
+
.cngx-menu-item--disabled > .cngx-menu-item__indicator {
|
|
343
387
|
color: inherit;
|
|
344
388
|
}
|
|
345
389
|
|
|
346
390
|
/*
|
|
347
|
-
* Checked menu item gets a bolder label PLUS a leading indicator
|
|
348
|
-
*
|
|
349
|
-
* even when the consumer hasn't projected an
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
* the pseudo when a projected icon is present. The empty alt text keeps
|
|
355
|
-
* the glyph out of the accessible name; `aria-checked` carries the state.
|
|
391
|
+
* Checked menu item gets a bolder label PLUS a leading indicator the
|
|
392
|
+
* checkbox / radio item directive inserts while checked, so the
|
|
393
|
+
* committed-state signal lands even when the consumer hasn't projected an
|
|
394
|
+
* explicit icon: a check on checkbox items, a filled dot on radio items, to
|
|
395
|
+
* mirror the standard form-control vocabulary. The indicator lives outside
|
|
396
|
+
* the slot grid, so `:has()` hides it when a projected icon is present. It
|
|
397
|
+
* is aria-hidden; `aria-checked` carries the state.
|
|
356
398
|
*/
|
|
357
399
|
.cngx-menu-item--checked {
|
|
358
400
|
font-weight: var(--cngx-menu-item-checked-font-weight, 600);
|
|
359
401
|
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
align-
|
|
364
|
-
|
|
365
|
-
min-width: var(--cngx-menu-item-icon-min-width, 1.25rem);
|
|
402
|
+
.cngx-menu-item__indicator {
|
|
403
|
+
position: relative;
|
|
404
|
+
flex: none;
|
|
405
|
+
align-self: stretch;
|
|
406
|
+
min-inline-size: var(--cngx-menu-item-icon-min-width, 1.25rem);
|
|
366
407
|
color: var(--cngx-menu-item-checked-color, oklch(0.66 0.19 50));
|
|
367
|
-
font-weight: 700;
|
|
368
408
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
409
|
+
:has(.cngx-menu-item__icon) > .cngx-menu-item__indicator {
|
|
410
|
+
display: none;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/* The svg is centred in the indicator out of flow, so its box never grows
|
|
414
|
+
the row. Physical left / top pair with the physical translate, so the
|
|
415
|
+
centring holds under RTL. The item directive paints it and sizes it from
|
|
416
|
+
`--cngx-icon-svg-size`. */
|
|
417
|
+
.cngx-menu-item__indicator-svg {
|
|
418
|
+
position: absolute;
|
|
419
|
+
left: 50%;
|
|
420
|
+
top: 50%;
|
|
421
|
+
translate: -50% -50%;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/* The check box lands on exactly 1rem (16px at a 16px root), in the 15 to 19px
|
|
425
|
+
band, where the hand-hinted 16-grid small check is drawn. It follows the root
|
|
426
|
+
text scale, not the item font, so it is 16px in the default theme and under
|
|
427
|
+
the Material bridge (0.875rem item font) alike - the bridge needs no edit for
|
|
428
|
+
this row. The trade: the check no longer tracks a retuned item font (Q2). */
|
|
429
|
+
[cngxMenuItemCheckbox] > .cngx-menu-item__indicator > .cngx-menu-item__indicator-svg {
|
|
430
|
+
--cngx-icon-svg-size: 1rem;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/* The dot is a fill glyph 8 grid units across; scaling the box by 24/8
|
|
434
|
+
inks it 0.7em across, level with the check. */
|
|
435
|
+
[cngxMenuItemRadio] > .cngx-menu-item__indicator > .cngx-menu-item__indicator-svg {
|
|
436
|
+
--cngx-icon-svg-size: calc(0.7em * 24 / 8);
|
|
377
437
|
}
|
|
378
438
|
|
|
379
439
|
.cngx-menu-item__icon {
|
|
@@ -414,11 +474,11 @@
|
|
|
414
474
|
* tint and the separator is a 1px background-color hairline - both flatten to
|
|
415
475
|
* Canvas, erasing the cursor and the dividers. Re-signal the active item with
|
|
416
476
|
* the Highlight pair and re-draw the separator with CanvasText ink. The checked
|
|
417
|
-
* item self-heals (its
|
|
477
|
+
* item self-heals (its indicator + bolder weight survive). Unlayered +
|
|
418
478
|
* direct selectors (outside @layer) to beat the layered component rule.
|
|
419
479
|
* The highlighted item opts out of forcing, so its children see the UNFORCED
|
|
420
480
|
* author colours: it declares `--_cngx-forced-ink` and the shortcut and the
|
|
421
|
-
* checked
|
|
481
|
+
* checked indicator (both carry their own colours) paint that ink. */
|
|
422
482
|
@media (forced-colors: active) {
|
|
423
483
|
.cngx-menu-item--highlighted {
|
|
424
484
|
/* Menu items are typically <button>s; the UA forces a form-control
|
|
@@ -432,7 +492,7 @@
|
|
|
432
492
|
--_cngx-forced-ink: HighlightText;
|
|
433
493
|
}
|
|
434
494
|
.cngx-menu-item--highlighted .cngx-menu-item__kbd,
|
|
435
|
-
|
|
495
|
+
.cngx-menu-item--highlighted > .cngx-menu-item__indicator {
|
|
436
496
|
color: var(--_cngx-forced-ink, currentColor);
|
|
437
497
|
}
|
|
438
498
|
[cngxMenuSeparator] {
|