@cngx/common 0.1.0-rc.7 → 0.1.0-rc.9

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.
Files changed (69) hide show
  1. package/card/README.md +2 -1
  2. package/command/README.md +29 -0
  3. package/data/README.md +15 -3
  4. package/dialog/README.md +23 -1
  5. package/fesm2022/cngx-common-a11y.mjs +517 -184
  6. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  7. package/fesm2022/cngx-common-audio.mjs +62 -17
  8. package/fesm2022/cngx-common-audio.mjs.map +1 -1
  9. package/fesm2022/cngx-common-card.mjs +301 -46
  10. package/fesm2022/cngx-common-card.mjs.map +1 -1
  11. package/fesm2022/cngx-common-chart.mjs +1221 -479
  12. package/fesm2022/cngx-common-chart.mjs.map +1 -1
  13. package/fesm2022/cngx-common-command.mjs +97 -16
  14. package/fesm2022/cngx-common-command.mjs.map +1 -1
  15. package/fesm2022/cngx-common-data.mjs +1496 -499
  16. package/fesm2022/cngx-common-data.mjs.map +1 -1
  17. package/fesm2022/cngx-common-dialog.mjs +236 -61
  18. package/fesm2022/cngx-common-dialog.mjs.map +1 -1
  19. package/fesm2022/cngx-common-display.mjs +364 -93
  20. package/fesm2022/cngx-common-display.mjs.map +1 -1
  21. package/fesm2022/cngx-common-interactive.mjs +2040 -1046
  22. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  23. package/fesm2022/cngx-common-layout.mjs +955 -125
  24. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  25. package/fesm2022/cngx-common-popover.mjs +1293 -89
  26. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  27. package/fesm2022/cngx-common-stepper.mjs +997 -453
  28. package/fesm2022/cngx-common-stepper.mjs.map +1 -1
  29. package/fesm2022/cngx-common-tabs.mjs +1794 -1265
  30. package/fesm2022/cngx-common-tabs.mjs.map +1 -1
  31. package/fesm2022/cngx-common-timeline.mjs +151 -61
  32. package/fesm2022/cngx-common-timeline.mjs.map +1 -1
  33. package/fesm2022/cngx-common.mjs +1 -1
  34. package/interactive/README.md +15 -4
  35. package/layout/README.md +37 -1
  36. package/package.json +20 -7
  37. package/popover/README.md +58 -2
  38. package/schematics/collection.json +9 -0
  39. package/schematics/ng-add/index.js +9 -0
  40. package/schematics/ng-add/schema.json +91 -0
  41. package/schematics/package.json +3 -0
  42. package/stepper/README.md +11 -8
  43. package/theming/components/cngx-accordion.css +1 -1
  44. package/theming/components/cngx-backdrop.css +12 -0
  45. package/theming/components/cngx-button-toggle.css +29 -3
  46. package/theming/components/cngx-data-grid.css +168 -1
  47. package/theming/components/cngx-dialog.css +13 -0
  48. package/theming/components/cngx-listbox.css +21 -12
  49. package/theming/components/cngx-menu.css +56 -16
  50. package/theming/components/cngx-popover-sheet.css +402 -0
  51. package/theming/components/cngx-popover.css +28 -0
  52. package/theming/components/cngx-recycler-placeholder.css +196 -0
  53. package/theming/components/cngx-ripple.css +1 -1
  54. package/theming/components/cngx-slider.css +32 -1
  55. package/theming/components/cngx-tooltip.css +12 -0
  56. package/timeline/README.md +155 -0
  57. package/types/cngx-common-a11y.d.ts +205 -28
  58. package/types/cngx-common-card.d.ts +201 -17
  59. package/types/cngx-common-chart.d.ts +345 -48
  60. package/types/cngx-common-command.d.ts +50 -10
  61. package/types/cngx-common-data.d.ts +743 -92
  62. package/types/cngx-common-dialog.d.ts +161 -10
  63. package/types/cngx-common-display.d.ts +356 -142
  64. package/types/cngx-common-interactive.d.ts +910 -226
  65. package/types/cngx-common-layout.d.ts +603 -32
  66. package/types/cngx-common-popover.d.ts +612 -49
  67. package/types/cngx-common-stepper.d.ts +526 -237
  68. package/types/cngx-common-tabs.d.ts +358 -75
  69. package/types/cngx-common-timeline.d.ts +108 -22
package/card/README.md CHANGED
@@ -45,11 +45,12 @@ export class ExampleComponent {
45
45
  ## Accessibility
46
46
 
47
47
  - **ARIA roles:** `role="article"` (default), `role="button"`, or `role="link"` based on `as` input
48
+ - **Link navigation:** `as="link"` + `[href]` navigates on activation - internal URLs through the app `Router` when provided, otherwise `window.location.assign`. The host is not a native anchor, so modifier-click/new-tab affordances do not apply
48
49
  - **Keyboard interaction:**
49
50
  - `Enter` / `Space`: Activate interactive cards (button/link)
50
51
  - `Arrow Left/Right`: Navigate cards in grid (CngxRovingTabindex)
51
52
  - `Home` / `End`: Jump to first/last card in grid
52
- - **Screen reader:** `aria-busy` when loading; live region announces "Loading", "Selected", "Deselected" state changes; `aria-describedby` points to disabled reason explanation
53
+ - **Screen reader:** `aria-busy` when loading; live region announces "Loading", "Selected", "Deselected" state changes (English defaults, translated by the `card` section of the language pack, `provideCngxI18n` from `@cngx/core/i18n`, and overridable per key via `provideCardI18n(withCardI18nLabels({ ... }))`); `aria-describedby` points to disabled reason explanation
53
54
  - **Focus management:** Interactive cards get `tabindex="0"` when standalone; CngxCardGrid's roving tabindex manages focus among cards
54
55
 
55
56
  ## Composition
package/command/README.md CHANGED
@@ -42,6 +42,35 @@ bootstrapApplication(AppComponent, {
42
42
  export class EditorView {}
43
43
  ```
44
44
 
45
+ A scoped call adds to the commands above it and never hides them. That holds
46
+ across both injector trees: a lazy route's `providers` and a shell component's
47
+ `viewProviders` around the `<router-outlet>` both reach the routed page, on top
48
+ of the root set.
49
+
50
+ ```typescript
51
+ // root: FILE_COMMANDS; route: REPORT_COMMANDS; shell: NAV_COMMANDS
52
+ { path: 'reports', providers: [provideCommands(REPORT_COMMANDS)], component: Reports }
53
+ // injectCommands() inside Reports -> FILE, REPORT, NAV
54
+ ```
55
+
56
+ Order is root and route scopes first (outer to inner), then component scopes
57
+ outer to inner, each in registration order. Registering the same source
58
+ reference at two levels lists it once. A `viewProviders` set stays invisible to
59
+ projected content, as for any `viewProviders` entry; use `providers` when
60
+ content children need it.
61
+
62
+ Command ids are unique in the merged list. A command whose `id` is already
63
+ registered further out replaces that command in place: the innermost scope (or,
64
+ on one level, the later registration) wins, and the entry keeps the position of
65
+ the first occurrence. Reuse an id on purpose to swap a global command for a
66
+ scoped version; give unrelated commands distinct ids.
67
+
68
+ Register through `provideCommands`. A raw `CNGX_COMMAND_SOURCE` multi-provider
69
+ is carried into deeper scopes only from a level that also calls
70
+ `provideCommands`. On any other level it is read only when that level is the
71
+ nearest one `injectCommands()` resolves, and a nested `provideCommands` scope
72
+ does not see it.
73
+
45
74
  A source is either a static list or a reactive `Signal` - a signal source lets a
46
75
  contributor add, remove, or disable commands live:
47
76
 
package/data/README.md CHANGED
@@ -531,14 +531,17 @@ readonly items = fromResource(this.res);
531
531
 
532
532
  ## 5. fromHttpResource - Angular httpResource() Bridge
533
533
 
534
- Like `fromResource` but maps HTTP progress (0-1 float) to
535
- `CngxAsyncState.progress` (0-100 integer).
534
+ Like `fromResource` but maps the latest `HttpProgressEvent` to
535
+ `CngxAsyncState.progress` (0-100 integer, `loaded / total` rounded and
536
+ clamped; `undefined` while the total is unknown or zero). Angular only
537
+ emits progress events when the request sets `reportProgress: true`.
536
538
 
537
539
  ```typescript
538
540
  private readonly res = httpResource<Report>(() => ({
539
541
  url: '/api/reports/generate',
540
542
  method: 'POST',
541
543
  body: { params: this.reportParams() },
544
+ reportProgress: true,
542
545
  }));
543
546
 
544
547
  readonly report = fromHttpResource(this.res);
@@ -593,6 +596,13 @@ export class ResidentApi {
593
596
  ### Component
594
597
 
595
598
  ```typescript
599
+ import { CngxAsyncContainer, CngxAsyncSkeletonTpl, CngxAsyncContentTpl,
600
+ CngxAsyncEmptyTpl, CngxAsyncErrorTpl, CngxAlert, CngxToast } from '@cngx/ui/feedback';
601
+ import { CngxCardGrid, CngxCard, CngxCardHeader, CngxCardBody,
602
+ CngxCardFooter, CngxCardSkeleton } from '@cngx/common/card';
603
+ import { CngxActionButton } from '@cngx/ui/action-button';
604
+ import { CngxEmptyState } from '@cngx/ui/empty-state';
605
+
596
606
  @Component({
597
607
  selector: 'app-resident-list',
598
608
  template: `
@@ -834,7 +844,9 @@ The paginator accepts `[state]` and blocks navigation while busy:
834
844
 
835
845
  ## CngxFileDrop - Upload State
836
846
 
837
- The file drop accepts `[state]` for upload lifecycle feedback:
847
+ The file drop accepts `[state]` for upload lifecycle feedback
848
+ (`CngxFileDrop` ships in `@cngx/forms/input`; `cngx-progress` and
849
+ `cngx-alert` in `@cngx/ui/feedback`):
838
850
 
839
851
  ```html
840
852
  <div cngxFileDrop #drop="cngxFileDrop"
package/dialog/README.md CHANGED
@@ -68,11 +68,33 @@ The dialog system is built around the native `<dialog>` element, which is the on
68
68
 
69
69
  - **`aria-labelledby` and `aria-describedby` are wired automatically** from `[cngxDialogTitle]` and `[cngxDialogDescription]` content children. Place them in the template; the linkage is reactive.
70
70
  - **Title announcement.** When a modal dialog transitions to `'open'`, the title text is announced through a polite live region. Screen-reader users hear the dialog purpose without an explicit `aria-live` element.
71
- - **Icon-only close buttons** need an explicit `aria-label`. The library does not invent labels.
71
+ - **Icon-only close buttons** fall back to a library-supplied name. `CngxDialogClose` sets `aria-label` only when the trigger carries no text of its own and no `aria-label` from the consumer - an explicit label always wins.
72
72
  - **Multi-step content** - wizards, tabbed dialogs, paginated forms - is the consumer's responsibility. The dialog moves focus once on open. After that, calling `.focus()` on the first element of the new step is on you.
73
73
  - **Error state.** Bind `[error]` to apply `aria-invalid="true"` and the `cngx-dialog--error` class. Pair with a `cngx-form-errors` block (or any `role="alert"` region) inside the dialog for WCAG-compliant form-error announcements.
74
74
  - **Reduced motion.** The theme honors `prefers-reduced-motion: reduce` - open and close transitions disable themselves automatically.
75
75
 
76
+ ### Localising the built-in strings
77
+
78
+ To translate the whole app, set a language pack with `provideCngxI18n(withPack(...))` from `@cngx/core/i18n` (see the localisation guide); `provideDialogConfig` overrides single keys on top of the `dialog` section.
79
+
80
+ Five strings the dialog family renders on its own behalf are English by
81
+ default and overridable as one bundle:
82
+
83
+ ```ts
84
+ provideDialogConfig(
85
+ withDialogLabels({
86
+ close: 'Dialog schließen',
87
+ errorFallback: 'Ein Fehler ist aufgetreten',
88
+ dragHandle: 'Dialog verschieben',
89
+ dragHandleRoleDescription: 'verschiebbar',
90
+ dragInstructions: 'Pfeiltasten bewegen den Dialog, Shift für größere Schritte',
91
+ }),
92
+ )
93
+ ```
94
+
95
+ Unset keys keep their English default. `provideDialogConfigAt(...)` in a
96
+ component's `viewProviders` scopes the override to that subtree.
97
+
76
98
  ## See also
77
99
 
78
100
  - Directive selectors, signals, methods, inputs, and CSS custom properties in the **API** tab of the generated docs.