@cngx/common 0.1.0-rc.2 → 0.1.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/README.md +10 -3
- package/display/README.md +1 -0
- package/fesm2022/cngx-common-a11y.mjs +123 -3
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +8 -8
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +999 -54
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +320 -8
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +1603 -75
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +187 -3
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +63 -8
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/interactive/README.md +101 -0
- package/layout/README.md +39 -1
- package/package.json +1 -1
- package/theming/components/cngx-accordion.css +147 -0
- package/theming/components/cngx-badge.css +6 -0
- package/theming/components/cngx-bottom-sheet.css +8 -1
- package/theming/components/cngx-breadcrumb.css +108 -0
- package/theming/components/cngx-button-toggle.css +6 -0
- package/theming/components/cngx-data-grid.css +154 -0
- package/theming/components/cngx-dialog.css +4 -0
- package/theming/components/cngx-divider.css +4 -0
- package/theming/components/cngx-listbox.css +6 -0
- package/theming/components/cngx-menu.css +7 -0
- package/theming/components/cngx-slider.css +237 -0
- package/theming/components/cngx-tooltip.css +6 -0
- package/types/cngx-common-a11y.d.ts +67 -2
- package/types/cngx-common-data.d.ts +837 -23
- package/types/cngx-common-display.d.ts +189 -1
- package/types/cngx-common-interactive.d.ts +1014 -31
- package/types/cngx-common-layout.d.ts +88 -3
- package/types/cngx-common-popover.d.ts +25 -4
|
@@ -179,6 +179,55 @@ declare class CngxAvatar {
|
|
|
179
179
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxAvatar, "cngx-avatar", ["cngxAvatar"], { "src": { "alias": "src"; "required": false; "isSignal": true; }; "alt": { "alias": "alt"; "required": false; "isSignal": true; }; "initials": { "alias": "initials"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "shape": { "alias": "shape"; "required": false; "isSignal": true; }; "status": { "alias": "status"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
/**
|
|
183
|
+
* Stacked avatar group with an overflow pill. Project `<cngx-avatar>` children;
|
|
184
|
+
* with `[max]` set, the group shows the first `max` and renders a `+N` pill for
|
|
185
|
+
* the rest. The visible/hidden split is a `computed()` over the projected
|
|
186
|
+
* avatars and `max` - the overflow count is derived, never tracked by hand
|
|
187
|
+
* (Pillar 1) - and the group carries an `aria-label` summarising the total and
|
|
188
|
+
* hidden counts so assistive tech hears "7 teammates, 4 not shown".
|
|
189
|
+
*
|
|
190
|
+
* ```html
|
|
191
|
+
* <cngx-avatar-group [max]="3" label="teammates">
|
|
192
|
+
* <cngx-avatar initials="AK" />
|
|
193
|
+
* <cngx-avatar initials="JD" />
|
|
194
|
+
* <cngx-avatar initials="MR" />
|
|
195
|
+
* <cngx-avatar initials="PL" />
|
|
196
|
+
* <cngx-avatar initials="ST" />
|
|
197
|
+
* </cngx-avatar-group>
|
|
198
|
+
* ```
|
|
199
|
+
*
|
|
200
|
+
* @category common/display
|
|
201
|
+
* @docsKind primary
|
|
202
|
+
* @wcag AA
|
|
203
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/avatar-group/avatar-group.component.ts
|
|
204
|
+
* @since 0.1.0
|
|
205
|
+
* @relatedTo CngxAvatar
|
|
206
|
+
*/
|
|
207
|
+
declare class CngxAvatarGroup {
|
|
208
|
+
/** Maximum avatars to show before collapsing the rest into the pill. Unset = show all. */
|
|
209
|
+
readonly max: _angular_core.InputSignal<number | undefined>;
|
|
210
|
+
/** Size preset for the overflow pill and stacking overlap (mirrors `CngxAvatar`). */
|
|
211
|
+
readonly size: _angular_core.InputSignal<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
212
|
+
/** Pill shape (mirrors `CngxAvatar`). */
|
|
213
|
+
readonly shape: _angular_core.InputSignal<"circle" | "square">;
|
|
214
|
+
/** Entity noun used in the `aria-label` summary. EN default. */
|
|
215
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
216
|
+
private readonly el;
|
|
217
|
+
private readonly avatars;
|
|
218
|
+
/** Total number of projected avatars. */
|
|
219
|
+
protected readonly total: _angular_core.Signal<number>;
|
|
220
|
+
/** How many avatars are actually shown (capped by `max`). */
|
|
221
|
+
protected readonly visibleCount: _angular_core.Signal<number>;
|
|
222
|
+
/** How many avatars are collapsed into the `+N` pill. */
|
|
223
|
+
protected readonly hiddenCount: _angular_core.Signal<number>;
|
|
224
|
+
/** Accessible summary of total and hidden counts. */
|
|
225
|
+
protected readonly ariaLabel: _angular_core.Signal<string>;
|
|
226
|
+
constructor();
|
|
227
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxAvatarGroup, never>;
|
|
228
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxAvatarGroup, "cngx-avatar-group", ["cngxAvatarGroup"], { "max": { "alias": "max"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "shape": { "alias": "shape"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, ["avatars"], ["cngx-avatar"], true, never>;
|
|
229
|
+
}
|
|
230
|
+
|
|
182
231
|
/**
|
|
183
232
|
* Color palette options for the badge.
|
|
184
233
|
*
|
|
@@ -312,6 +361,51 @@ declare class CngxChip {
|
|
|
312
361
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxChip, "cngx-chip", ["cngxChip"], { "removable": { "alias": "removable"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "removeAriaLabel": { "alias": "removeAriaLabel"; "required": false; "isSignal": true; }; }, { "remove": "remove"; }, never, ["*", "[cngxChipClose]"], true, never>;
|
|
313
362
|
}
|
|
314
363
|
|
|
364
|
+
/**
|
|
365
|
+
* An inline, wrapping metadata line - a flex row of projected {@link CngxMeta}
|
|
366
|
+
* pairs separated by a consistent gap. It carries the shared muted colour + gap
|
|
367
|
+
* so a detail zone reads `trace 9f31c0d4 tenant north pod auth-7d9f4` without
|
|
368
|
+
* the consumer hand-rolling `display:flex` + `<b>` markup for every row.
|
|
369
|
+
*
|
|
370
|
+
* Presentational by design (see {@link CngxMeta}): it is not a semantic list.
|
|
371
|
+
* Tune the spacing / colour through the `--cngx-meta-list-*` custom properties.
|
|
372
|
+
*
|
|
373
|
+
* @category common/display
|
|
374
|
+
* @wcag AA
|
|
375
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/meta/meta-list.component.ts
|
|
376
|
+
* @since 0.1.0
|
|
377
|
+
* @relatedTo CngxMeta
|
|
378
|
+
* <example-url>http://localhost:4200/#/common/display/meta/metadata-line</example-url>
|
|
379
|
+
*/
|
|
380
|
+
declare class CngxMetaList {
|
|
381
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMetaList, never>;
|
|
382
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxMetaList, "cngx-meta-list", ["cngxMetaList"], {}, {}, never, ["*"], true, never>;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* A single metadata pair - a short bold `term` followed by its projected value -
|
|
387
|
+
* for the supplementary key/value lines that sit inside detail zones, cards, and
|
|
388
|
+
* popovers (e.g. `trace 9f31c0d4`). Compose several inside a {@link CngxMetaList}.
|
|
389
|
+
*
|
|
390
|
+
* This is the lightweight, presentational option: the term is a plain string
|
|
391
|
+
* input and the pair reads linearly to a screen reader (`term value`). When you
|
|
392
|
+
* need real term/description semantics for a longer or more structured block,
|
|
393
|
+
* reach for a definition list instead - `CngxMeta` deliberately stays flat.
|
|
394
|
+
*
|
|
395
|
+
* @category common/display
|
|
396
|
+
* @wcag AA
|
|
397
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/meta/meta.component.ts
|
|
398
|
+
* @since 0.1.0
|
|
399
|
+
* @relatedTo CngxMetaList
|
|
400
|
+
* <example-url>http://localhost:4200/#/common/display/meta/metadata-line</example-url>
|
|
401
|
+
*/
|
|
402
|
+
declare class CngxMeta {
|
|
403
|
+
/** The metadata key. Rendered bold before the value; omit for a value-only item. */
|
|
404
|
+
readonly term: _angular_core.InputSignal<string | undefined>;
|
|
405
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMeta, never>;
|
|
406
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxMeta, "cngx-meta", ["cngxMeta"], { "term": { "alias": "term"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
407
|
+
}
|
|
408
|
+
|
|
315
409
|
/**
|
|
316
410
|
* Presentational checkbox / checkmark indicator.
|
|
317
411
|
*
|
|
@@ -470,6 +564,100 @@ declare class CngxRadioIndicator {
|
|
|
470
564
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxRadioIndicator, "cngx-radio-indicator", ["cngxRadioIndicator"], { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "dotGlyph": { "alias": "dotGlyph"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
471
565
|
}
|
|
472
566
|
|
|
567
|
+
/**
|
|
568
|
+
* Locale-aware `<time>` display atom. Renders a machine-readable
|
|
569
|
+
* `datetime` attribute (ISO 8601) plus a human string in one of two modes:
|
|
570
|
+
* `absolute` (via `Intl.DateTimeFormat`) or `relative` (via
|
|
571
|
+
* `Intl.RelativeTimeFormat`, e.g. "3 days ago"). Formatting resolves against
|
|
572
|
+
* the injected `LOCALE_ID` - English out of the box, locale-driven when the app
|
|
573
|
+
* provides one; no hardcoded strings.
|
|
574
|
+
*
|
|
575
|
+
* Relative mode is render-time, not live-ticking: it recomputes when `[date]`
|
|
576
|
+
* changes, not on a timer, so "2 minutes ago" does not self-update. A consumer
|
|
577
|
+
* that needs a live clock re-binds `[date]`; a timer-driven variant is an
|
|
578
|
+
* explicit non-goal for the atom.
|
|
579
|
+
*
|
|
580
|
+
* ```html
|
|
581
|
+
* <cngx-time [date]="publishedAt()" mode="relative" />
|
|
582
|
+
* <cngx-time [date]="invoice.due" [format]="{ dateStyle: 'long' }" />
|
|
583
|
+
* ```
|
|
584
|
+
*
|
|
585
|
+
* @category common/display
|
|
586
|
+
* @docsKind primary
|
|
587
|
+
* @wcag AA
|
|
588
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/time/time.component.ts
|
|
589
|
+
* @since 0.1.0
|
|
590
|
+
* @relatedTo CngxCardTimestamp
|
|
591
|
+
*/
|
|
592
|
+
declare class CngxTime {
|
|
593
|
+
private readonly locale;
|
|
594
|
+
/** Instant to render. Accepts a `Date`, an ISO string, or an epoch-ms number. */
|
|
595
|
+
readonly date: _angular_core.InputSignal<string | number | Date>;
|
|
596
|
+
/**
|
|
597
|
+
* `absolute` formats a calendar date/time; `relative` formats the distance
|
|
598
|
+
* from now (past or future) with `Intl.RelativeTimeFormat`.
|
|
599
|
+
*/
|
|
600
|
+
readonly mode: _angular_core.InputSignal<"relative" | "absolute">;
|
|
601
|
+
/** `Intl.DateTimeFormatOptions` for `absolute` mode; ignored in `relative` mode. */
|
|
602
|
+
readonly format: _angular_core.InputSignal<Intl.DateTimeFormatOptions | undefined>;
|
|
603
|
+
/**
|
|
604
|
+
* Coerced instant. A `Date`; downstream reads its time value. The `equal` fn
|
|
605
|
+
* dedupes by time value so re-binding `[date]` to a fresh `Date` of the same
|
|
606
|
+
* instant (or the equivalent ISO string) does not cascade `iso`/`formatted` -
|
|
607
|
+
* the object-computed equality rule.
|
|
608
|
+
*/
|
|
609
|
+
protected readonly instant: _angular_core.Signal<Date>;
|
|
610
|
+
/** Machine-readable ISO 8601 for the `datetime` attribute. */
|
|
611
|
+
protected readonly iso: _angular_core.Signal<string>;
|
|
612
|
+
/**
|
|
613
|
+
* Human string. Reads `Date.now()` in `relative` mode as a render-time
|
|
614
|
+
* snapshot - untracked by design, so the value recomputes only when `[date]`
|
|
615
|
+
* (or `mode`/`format`) changes, never on a timer.
|
|
616
|
+
*/
|
|
617
|
+
protected readonly formatted: _angular_core.Signal<string>;
|
|
618
|
+
private formatRelative;
|
|
619
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxTime, never>;
|
|
620
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxTime, "cngx-time", ["cngxTime"], { "date": { "alias": "date"; "required": true; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Decorative password-strength meter - four segments that fill with the 0..4
|
|
625
|
+
* `score`. Pairs with `CngxPasswordStrength`, which owns the live
|
|
626
|
+
* announcement; the meter is `aria-hidden` so it never double-announces what
|
|
627
|
+
* the directive already says.
|
|
628
|
+
*
|
|
629
|
+
* Takes a `score`, not a password, so it carries no forms dependency and stays
|
|
630
|
+
* a Level-2 visual atom beside `CngxBadge`/`CngxCheckboxIndicator`. Render it
|
|
631
|
+
* from the directive's signal, or drive it from any 0..4 source. All colours
|
|
632
|
+
* and sizes are `--cngx-password-strength-meter-*` custom properties; the
|
|
633
|
+
* filled colour keys off the `data-strength` host attribute.
|
|
634
|
+
*
|
|
635
|
+
* ```html
|
|
636
|
+
* <input cngxPasswordStrength #pw="cngxPasswordStrength" type="password" />
|
|
637
|
+
* <cngx-password-strength-meter [score]="pw.score()" />
|
|
638
|
+
* ```
|
|
639
|
+
*
|
|
640
|
+
* @category common/display
|
|
641
|
+
* @docsKind primary
|
|
642
|
+
* @wcag AA
|
|
643
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/password-strength-meter/password-strength-meter.component.ts
|
|
644
|
+
* @since 0.2.0
|
|
645
|
+
* @relatedTo CngxSegmentedProgress, CngxBadge
|
|
646
|
+
* <example-url>http://localhost:4200/#/common/display/password-strength-meter/strength-levels</example-url>
|
|
647
|
+
*/
|
|
648
|
+
declare class CngxPasswordStrengthMeter {
|
|
649
|
+
/** Strength score, 0 (empty/trivial) to 4 (strong). */
|
|
650
|
+
readonly score: _angular_core.InputSignal<number>;
|
|
651
|
+
/** `score` clamped and integer-floored to the rendered 0..4 range. */
|
|
652
|
+
private readonly clampedScore;
|
|
653
|
+
/** Per-segment filled flags; the first `clampedScore` segments are filled. */
|
|
654
|
+
protected readonly segments: Signal<readonly boolean[]>;
|
|
655
|
+
/** Coarse strength word for the `data-strength` theming hook. */
|
|
656
|
+
protected readonly level: Signal<string>;
|
|
657
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPasswordStrengthMeter, never>;
|
|
658
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxPasswordStrengthMeter, "cngx-password-strength-meter", never, { "score": { "alias": "score"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
659
|
+
}
|
|
660
|
+
|
|
473
661
|
/**
|
|
474
662
|
* Context exposed by the `*cngxTagLabel` slot — the full reactive
|
|
475
663
|
* Tag state bundled so consumer templates can switch on variant /
|
|
@@ -1476,5 +1664,5 @@ declare function withTagColors(payload: NonNullable<CngxTagConfig['colors']>): C
|
|
|
1476
1664
|
*/
|
|
1477
1665
|
declare function withTagSlots(payload: NonNullable<CngxTagConfig['templates']>): CngxTagConfigFeature;
|
|
1478
1666
|
|
|
1479
|
-
export { CNGX_TAG_CONFIG, CNGX_TAG_GROUP, CngxAvatar, CngxBadge, CngxCheckboxIndicator, CngxChip, CngxDivider, CngxIcon, CngxRadioIndicator, CngxSegmentedProgress, CngxTag, CngxTagGroup, CngxTagGroupAccessory, CngxTagGroupHeader, CngxTagLabel, CngxTagPrefix, CngxTagSuffix, injectTagConfig, provideTagConfig, provideTagConfigAt, withTagColors, withTagDefaults, withTagGroupDefaults, withTagSlots };
|
|
1667
|
+
export { CNGX_TAG_CONFIG, CNGX_TAG_GROUP, CngxAvatar, CngxAvatarGroup, CngxBadge, CngxCheckboxIndicator, CngxChip, CngxDivider, CngxIcon, CngxMeta, CngxMetaList, CngxPasswordStrengthMeter, CngxRadioIndicator, CngxSegmentedProgress, CngxTag, CngxTagGroup, CngxTagGroupAccessory, CngxTagGroupHeader, CngxTagLabel, CngxTagPrefix, CngxTagSuffix, CngxTime, injectTagConfig, provideTagConfig, provideTagConfigAt, withTagColors, withTagDefaults, withTagGroupDefaults, withTagSlots };
|
|
1480
1668
|
export type { CngxBadgeColor, CngxBadgePosition, CngxTagColor, CngxTagConfig, CngxTagConfigFeature, CngxTagGroupAccessoryContext, CngxTagGroupAlign, CngxTagGroupGap, CngxTagGroupHeaderContext, CngxTagGroupHost, CngxTagLabelContext, CngxTagPrefixContext, CngxTagSize, CngxTagSuffixContext, CngxTagVariant, SegmentState };
|