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

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 (62) hide show
  1. package/chart/README.md +85 -0
  2. package/command/README.md +157 -0
  3. package/data/README.md +23 -0
  4. package/fesm2022/cngx-common-a11y.mjs +247 -85
  5. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  6. package/fesm2022/cngx-common-audio.mjs +37 -37
  7. package/fesm2022/cngx-common-audio.mjs.map +1 -1
  8. package/fesm2022/cngx-common-card.mjs +13 -9
  9. package/fesm2022/cngx-common-card.mjs.map +1 -1
  10. package/fesm2022/cngx-common-chart.mjs +3404 -1392
  11. package/fesm2022/cngx-common-chart.mjs.map +1 -1
  12. package/fesm2022/cngx-common-command.mjs +144 -0
  13. package/fesm2022/cngx-common-command.mjs.map +1 -0
  14. package/fesm2022/cngx-common-data.mjs +304 -213
  15. package/fesm2022/cngx-common-data.mjs.map +1 -1
  16. package/fesm2022/cngx-common-dialog.mjs +369 -100
  17. package/fesm2022/cngx-common-dialog.mjs.map +1 -1
  18. package/fesm2022/cngx-common-display.mjs +138 -24
  19. package/fesm2022/cngx-common-display.mjs.map +1 -1
  20. package/fesm2022/cngx-common-interactive.mjs +1089 -459
  21. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  22. package/fesm2022/cngx-common-layout.mjs +113 -61
  23. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  24. package/fesm2022/cngx-common-popover.mjs +430 -54
  25. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  26. package/fesm2022/cngx-common-stepper.mjs +107 -49
  27. package/fesm2022/cngx-common-stepper.mjs.map +1 -1
  28. package/fesm2022/cngx-common-tabs.mjs +1170 -752
  29. package/fesm2022/cngx-common-tabs.mjs.map +1 -1
  30. package/fesm2022/cngx-common-timeline.mjs +1086 -0
  31. package/fesm2022/cngx-common-timeline.mjs.map +1 -0
  32. package/fesm2022/cngx-common.mjs +2 -2
  33. package/fesm2022/cngx-common.mjs.map +1 -1
  34. package/package.json +11 -1
  35. package/stepper/README.md +1 -1
  36. package/theming/components/cngx-accordion.css +3 -0
  37. package/theming/components/cngx-badge.css +22 -0
  38. package/theming/components/cngx-bottom-sheet.css +14 -2
  39. package/theming/components/cngx-breadcrumb.css +8 -0
  40. package/theming/components/cngx-button-toggle.css +44 -2
  41. package/theming/components/cngx-data-grid.css +66 -0
  42. package/theming/components/cngx-dialog.css +12 -0
  43. package/theming/components/cngx-divider.css +12 -0
  44. package/theming/components/cngx-listbox.css +27 -0
  45. package/theming/components/cngx-menu.css +36 -0
  46. package/theming/components/cngx-ripple.css +1 -1
  47. package/theming/components/cngx-tooltip.css +11 -0
  48. package/types/cngx-common-a11y.d.ts +63 -17
  49. package/types/cngx-common-audio.d.ts +32 -32
  50. package/types/cngx-common-card.d.ts +10 -3
  51. package/types/cngx-common-chart.d.ts +1281 -141
  52. package/types/cngx-common-command.d.ts +167 -0
  53. package/types/cngx-common-data.d.ts +264 -98
  54. package/types/cngx-common-dialog.d.ts +214 -25
  55. package/types/cngx-common-display.d.ts +83 -13
  56. package/types/cngx-common-interactive.d.ts +708 -174
  57. package/types/cngx-common-layout.d.ts +48 -1
  58. package/types/cngx-common-popover.d.ts +120 -3
  59. package/types/cngx-common-stepper.d.ts +55 -5
  60. package/types/cngx-common-tabs.d.ts +386 -25
  61. package/types/cngx-common-timeline.d.ts +1059 -0
  62. package/types/cngx-common.d.ts +1 -1
@@ -0,0 +1,1059 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, Signal, TemplateRef, EnvironmentProviders, Provider } from '@angular/core';
3
+ import * as _cngx_common_timeline from '@cngx/common/timeline';
4
+ import { CngxAsyncState } from '@cngx/core/utils';
5
+ import { EmptyReason } from '@cngx/common/card';
6
+
7
+ /**
8
+ * One rendered band of a timeline - a calendar bucket plus the items that
9
+ * fall into it, already sorted.
10
+ *
11
+ * The group carries no label: formatting a date is a locale concern that
12
+ * belongs to the `*cngxTimelineDateHeader` slot (or the config's
13
+ * `groupLabel` fallback), not to the presenter. `key` is stable and
14
+ * collision-free across the built-in groupers, so it doubles as the
15
+ * `@for` track expression and as the `aria-labelledby` id seed.
16
+ *
17
+ * @category common/timeline
18
+ */
19
+ interface TimelineGroup<T> {
20
+ /** Stable bucket identity, e.g. `2026-07-27` for `day`. */
21
+ readonly key: string;
22
+ /**
23
+ * Local start-of-bucket instant - midnight for `day`, the Monday for
24
+ * `week`, the first of the month for `month`. For `'none'` it is the
25
+ * date of the first item in sort order.
26
+ */
27
+ readonly start: Date;
28
+ /** Items in this bucket, in the resolved sort direction. */
29
+ readonly items: readonly T[];
30
+ }
31
+ /**
32
+ * What a {@link TimelineGroupingFn} returns for a single item: the bucket
33
+ * it belongs to, and the instant that bucket starts at.
34
+ *
35
+ * @category common/timeline
36
+ */
37
+ interface TimelineGroupKey {
38
+ readonly key: string;
39
+ readonly start: Date;
40
+ }
41
+ /**
42
+ * Escape hatch for consumer-defined bucketing - UTC days, fiscal quarters,
43
+ * sprint windows, "today / this week / earlier". Receives the coerced date
44
+ * and the item it came from, so a grouper may key off payload fields
45
+ * (tenant, channel) as well as time.
46
+ *
47
+ * Called once per item per recomputation; keep it pure and cheap.
48
+ *
49
+ * @category common/timeline
50
+ */
51
+ type TimelineGroupingFn<T> = (date: Date, item: T) => TimelineGroupKey;
52
+ /**
53
+ * Built-in bucketing modes plus the {@link TimelineGroupingFn} escape
54
+ * hatch. The three calendar modes read **local** date fields, so they stay
55
+ * correct across DST transitions where a day is 23 or 25 hours long -
56
+ * epoch division would silently split or merge those days.
57
+ *
58
+ * `'none'` collapses everything into one synthetic group, which is how the
59
+ * organism renders an ungrouped `role="list"` without a second code path.
60
+ *
61
+ * @category common/timeline
62
+ */
63
+ type TimelineGroupBy<T> = 'day' | 'week' | 'month' | 'none' | TimelineGroupingFn<T>;
64
+ /**
65
+ * Sort direction for the whole timeline. `'desc'` (default) is
66
+ * newest-first, the activity-feed convention; `'asc'` is oldest-first,
67
+ * which reads better for narrative histories.
68
+ *
69
+ * @category common/timeline
70
+ */
71
+ type TimelineDirection = 'asc' | 'desc';
72
+ /**
73
+ * Pulls the timestamp out of a consumer item. Anything the `Date`
74
+ * constructor accepts works, so ISO strings straight off an API response
75
+ * need no pre-mapping.
76
+ *
77
+ * @category common/timeline
78
+ */
79
+ type TimelineDateAccessor<T> = (item: T) => Date | string | number;
80
+ /**
81
+ * Inputs to {@link createTimelineGrouping}. Every reactive knob is a
82
+ * zero-arg accessor, so a `Signal` (or an `input()`) can be passed
83
+ * directly and a constant is just `() => 'day'`.
84
+ *
85
+ * @category common/timeline
86
+ */
87
+ interface TimelineGroupingOptions<T> {
88
+ /** Source list. Read inside the `groups` computation, so it is tracked. */
89
+ readonly items: () => readonly T[];
90
+ /**
91
+ * Timestamp accessor. Not a signal itself, but it is called inside the
92
+ * `groups` computation, so a caller that closes over one - as the organism
93
+ * does over its `[dateAccessor]` input - has those reads tracked like any
94
+ * other and re-groups when the accessor is rebound.
95
+ */
96
+ readonly dateAccessor: TimelineDateAccessor<T>;
97
+ /** Bucketing mode. Defaults to `'day'`. */
98
+ readonly groupBy?: () => TimelineGroupBy<T>;
99
+ /** Sort direction. Defaults to `'desc'`. */
100
+ readonly direction?: () => TimelineDirection;
101
+ }
102
+ /**
103
+ * What {@link createTimelineGrouping} hands back. An object rather than a
104
+ * bare `Signal` because the v2 live cursor extends this surface - callers
105
+ * written against v1 keep compiling.
106
+ *
107
+ * @category common/timeline
108
+ */
109
+ interface TimelineGrouping<T> {
110
+ readonly groups: Signal<readonly TimelineGroup<T>[]>;
111
+ }
112
+ /**
113
+ * Derives grouped, sorted timeline bands from a flat item list.
114
+ *
115
+ * Pure derivation: bands come out of one `linkedSignal` over the `items`
116
+ * accessor. Nothing is synced, nothing is written back, and the presenter
117
+ * never mutates its input array. The previous bands are read through the
118
+ * `computation` callback rather than a closure cache, so the result depends
119
+ * on the inputs and the prior value alone - never on how many times it ran.
120
+ *
121
+ * Three properties make it usable as the organism's only data path:
122
+ *
123
+ * - **Defensive sort.** Consumer data does not have to arrive sorted. The
124
+ * presenter sorts by the accessor date on every run using a stable sort,
125
+ * so items sharing a timestamp keep their input order in both
126
+ * directions.
127
+ * - **Local-calendar bucketing.** `day` / `week` / `month` read local date
128
+ * fields rather than dividing the epoch, which is what keeps 23-hour and
129
+ * 25-hour DST days intact. Consumers who want UTC (or any other rule)
130
+ * pass a {@link TimelineGroupingFn}.
131
+ * - **Append-stability.** Groups whose items are *the same objects* hand
132
+ * back the same band reference, and the signal carries a structural
133
+ * `equal`. Reuse is deliberately keyed on reference identity rather than
134
+ * on an id: a refetch returns new objects at the same ids, and reusing
135
+ * there would pin the band to a stale payload. Appending therefore leaves
136
+ * every other band's
137
+ * `@for` block untouched instead of re-rendering the whole timeline.
138
+ *
139
+ * Reach for the DI token {@link CNGX_TIMELINE_GROUPING_FACTORY} rather
140
+ * than this function directly when the caller is a component - that is
141
+ * what makes the bucketing swappable per app or per component.
142
+ *
143
+ * ```ts
144
+ * const grouping = createTimelineGrouping({
145
+ * items: this.events,
146
+ * dateAccessor: (event) => event.occurredAt,
147
+ * groupBy: this.groupBy,
148
+ * });
149
+ * ```
150
+ *
151
+ * @category common/timeline
152
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/grouping.ts
153
+ * @since 0.1.0
154
+ */
155
+ declare function createTimelineGrouping<T>(options: TimelineGroupingOptions<T>): TimelineGrouping<T>;
156
+ /**
157
+ * Signature of {@link createTimelineGrouping}, carried as a named type so
158
+ * a DI override matches it exactly.
159
+ *
160
+ * @category common/timeline
161
+ */
162
+ type CngxTimelineGroupingFactory = <T>(options: TimelineGroupingOptions<T>) => TimelineGrouping<T>;
163
+ /**
164
+ * Resolves the presenter `<cngx-timeline>` builds its bands with.
165
+ * Defaults to {@link createTimelineGrouping}.
166
+ *
167
+ * Override app-wide via
168
+ * `providers: [{ provide: CNGX_TIMELINE_GROUPING_FACTORY, useValue: myFactory }]`
169
+ * to change bucketing everywhere (fiscal calendars, "today / earlier"
170
+ * relative bands, server-supplied grouping), or per component via
171
+ * `viewProviders` for a one-off. An override wraps rather than replaces
172
+ * in most cases - call `createTimelineGrouping` inside your factory and
173
+ * post-process its `groups`.
174
+ *
175
+ * Same shape as `CNGX_SELECTION_CONTROLLER_FACTORY`: the internals of a
176
+ * component are swappable without forking the component.
177
+ *
178
+ * @category common/timeline
179
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/grouping.ts
180
+ * @relatedTo createTimelineGrouping
181
+ * @since 0.1.0
182
+ */
183
+ declare const CNGX_TIMELINE_GROUPING_FACTORY: InjectionToken<CngxTimelineGroupingFactory>;
184
+
185
+ /**
186
+ * Process vocabulary shared by the timeline marker, the connector and
187
+ * `CngxTimelineItem`.
188
+ *
189
+ * Deliberately narrow: it describes where an event sits in a history, not
190
+ * what the user may do about it. A timeline that needed `disabled`,
191
+ * `editable` or `current` would be a stepper, and steppers live in
192
+ * `@cngx/common/stepper` with their own flow logic.
193
+ *
194
+ * @category common/timeline
195
+ */
196
+ type TimelineStatus = 'done' | 'active' | 'upcoming' | 'rejected';
197
+ /**
198
+ * The dot on the timeline rail - a status-coloured slot host for whatever
199
+ * the consumer projects into it (nothing, a glyph, an icon, an avatar).
200
+ *
201
+ * Purely decorative and marked `aria-hidden`: the status it paints is
202
+ * already carried semantically by the owning `CngxTimelineItem`, and
203
+ * announcing it twice is worse than not announcing it here at all. That
204
+ * also means colour is never this atom's only signal - the item's ARIA is.
205
+ *
206
+ * Usable standalone. It ships its own token SET rules, so a marker
207
+ * dropped into a hand-rolled layout renders at the right size and tracks
208
+ * `[data-density]` with no timeline organism above it.
209
+ *
210
+ * ### Bare dot
211
+ * ```html
212
+ * <cngx-timeline-marker status="done" />
213
+ * ```
214
+ *
215
+ * ### With a projected glyph
216
+ * ```html
217
+ * <cngx-timeline-marker status="rejected">!</cngx-timeline-marker>
218
+ * ```
219
+ *
220
+ * ### Pending
221
+ * ```html
222
+ * <cngx-timeline-marker status="active" busy />
223
+ * ```
224
+ *
225
+ * @category common/timeline
226
+ * @wcag AA
227
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/marker.component.ts
228
+ * @relatedTo CngxTimelineConnector
229
+ * @since 0.1.0
230
+ */
231
+ declare class CngxTimelineMarker {
232
+ /**
233
+ * Where the event sits in the history. Drives the dot colour and, for
234
+ * `upcoming`, its hollow fill. Left unset the marker paints in the
235
+ * neutral rail colour.
236
+ */
237
+ readonly status: i0.InputSignal<TimelineStatus | undefined>;
238
+ /**
239
+ * Whether the marker pulses to signal work in flight - typically bound
240
+ * from an item's own `[state]` being `pending`.
241
+ *
242
+ * The pulse is a `box-shadow` animation rather than a `transform` or a
243
+ * size change: the marker sits in a grid track the rail is aligned to,
244
+ * so anything that altered its box would drag the rail with it every
245
+ * frame. Suppressed under `prefers-reduced-motion`.
246
+ */
247
+ readonly busy: i0.InputSignalWithTransform<boolean, unknown>;
248
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineMarker, never>;
249
+ static ɵcmp: i0.ɵɵComponentDeclaration<CngxTimelineMarker, "cngx-timeline-marker", never, { "status": { "alias": "status"; "required": false; "isSignal": true; }; "busy": { "alias": "busy"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
250
+ }
251
+
252
+ /**
253
+ * Where a connector segment sits in its run, which decides which ends get
254
+ * clipped back to the adjacent marker's centre.
255
+ *
256
+ * `'only'` renders nothing at all - a single-item timeline has no rail to
257
+ * draw.
258
+ *
259
+ * @category common/timeline
260
+ */
261
+ type TimelineConnectorPosition = 'middle' | 'first' | 'last' | 'only';
262
+ /**
263
+ * The rail segment between two markers.
264
+ *
265
+ * Decorative and `aria-hidden`: it repeats a sequence the DOM order
266
+ * already carries, so announcing it would only add noise. It is
267
+ * status-capable all the same, because the *visual* run of a history is
268
+ * where a rejected step or a not-yet-reached tail reads fastest - a
269
+ * dashed segment for `upcoming` and a danger-toned one for `rejected`,
270
+ * so the distinction survives without colour.
271
+ *
272
+ * Drawn with `border-inline-start` and clipped with block-direction
273
+ * margins - logical properties throughout, so the rail lands on the
274
+ * correct side under `dir="rtl"` with no override.
275
+ *
276
+ * ### Between two items
277
+ * ```html
278
+ * <cngx-timeline-connector status="done" />
279
+ * ```
280
+ *
281
+ * ### Last item in the run
282
+ * ```html
283
+ * <cngx-timeline-connector position="last" />
284
+ * ```
285
+ *
286
+ * @category common/timeline
287
+ * @wcag AA
288
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/connector.component.ts
289
+ * @relatedTo CngxTimelineMarker
290
+ * @since 0.1.0
291
+ */
292
+ declare class CngxTimelineConnector {
293
+ /**
294
+ * Status of the segment. `upcoming` renders dashed, `rejected` in the
295
+ * danger tone, `done` and `active` solid in their own tones. Left unset
296
+ * the rail paints in the neutral border colour.
297
+ */
298
+ readonly status: i0.InputSignal<TimelineStatus | undefined>;
299
+ /**
300
+ * Position in the run. `'first'` clips the head back to the marker
301
+ * centre, `'last'` clips the tail, `'only'` hides the segment
302
+ * entirely. Defaults to `'middle'` - a full-height segment.
303
+ */
304
+ readonly position: i0.InputSignal<TimelineConnectorPosition>;
305
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineConnector, never>;
306
+ static ɵcmp: i0.ɵɵComponentDeclaration<CngxTimelineConnector, "cngx-timeline-connector", never, { "status": { "alias": "status"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
307
+ }
308
+
309
+ /**
310
+ * Marks the element that holds an item's timestamp, so the item can place
311
+ * it in the raster the active mode calls for - above the body in
312
+ * `narrative`, trailing it in `activity`.
313
+ *
314
+ * Pair it with `<cngx-time>` from `@cngx/common/display` for relative
315
+ * formatting; the timeline neither formats nor ticks.
316
+ *
317
+ * @category common/timeline
318
+ */
319
+ declare class CngxTimelineTime {
320
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineTime, never>;
321
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineTime, "[cngxTimelineTime]", never, {}, {}, never, never, true, never>;
322
+ }
323
+ /**
324
+ * Marks content that belongs on the far side of the rail from the row's
325
+ * body - the year label opposite a card, the timestamp across a centred
326
+ * rail.
327
+ *
328
+ * Per-row content, so it is a projection slot rather than a timeline-wide
329
+ * template: the row template already owns it, and the config cascade is
330
+ * for surfaces the whole timeline shares.
331
+ *
332
+ * The extra grid track only exists for rows that actually project into it
333
+ * (`:has(> [cngxTimelineOpposite])`), so markup that predates this slot
334
+ * keeps its raster to the pixel. Placement follows the row: opposite content
335
+ * sits across the rail from the body under `start`, `end` and `alternate`
336
+ * alike.
337
+ *
338
+ * ```html
339
+ * <cngx-timeline-item status="done">
340
+ * <span cngxTimelineOpposite>2019</span>
341
+ * <p>Founded</p>
342
+ * </cngx-timeline-item>
343
+ * ```
344
+ *
345
+ * **Keep the content non-interactive.** The slot projects ahead of the body,
346
+ * so it is read first in every layout. For a year or a short label that is
347
+ * the right reading order whichever side the rail is on. A link or a button
348
+ * would take focus before the row it belongs to, and no placement of the
349
+ * grid can fix that, because the paint follows `[data-row-side]` while the
350
+ * DOM order does not.
351
+ *
352
+ * @category common/timeline
353
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/timeline-item.component.ts
354
+ * @relatedTo CngxTimelineItem, CngxTimelineTime
355
+ * @since 0.1.0
356
+ */
357
+ declare class CngxTimelineOpposite {
358
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineOpposite, never>;
359
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineOpposite, "[cngxTimelineOpposite]", never, {}, {}, never, never, true, never>;
360
+ }
361
+ /**
362
+ * Marks content to render inside this row's marker dot - a glyph, an icon,
363
+ * an avatar.
364
+ *
365
+ * The per-row counterpart to the timeline-wide `*cngxTimelineMarkerTpl`, and
366
+ * the only route when the row stands on its own. It also *wins* over that
367
+ * template when both are present: most-local-wins, the same direction as
368
+ * every other slot in the family, so one row can carry a different glyph
369
+ * without the timeline's default being torn out for the rest.
370
+ *
371
+ * Whatever renders here is inside an `aria-hidden` element - decoration only.
372
+ *
373
+ * @category common/timeline
374
+ */
375
+ declare class CngxTimelineMarkerContent {
376
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineMarkerContent, never>;
377
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineMarkerContent, "[cngxTimelineMarkerContent]", never, {}, {}, never, never, true, never>;
378
+ }
379
+ /**
380
+ * Marks the element that holds an item's body. Optional - anything
381
+ * projected without a slot directive lands in the body too. Reach for it
382
+ * when the item also projects a timestamp and the source order would
383
+ * otherwise be ambiguous.
384
+ *
385
+ * @category common/timeline
386
+ */
387
+ declare class CngxTimelineContent {
388
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineContent, never>;
389
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineContent, "[cngxTimelineContent]", never, {}, {}, never, never, true, never>;
390
+ }
391
+ /**
392
+ * One event on the timeline: a marker, the rail segment below it, an
393
+ * optional timestamp, and the projected body.
394
+ *
395
+ * A terminal composable unit, not a fragment of the organism. It ships
396
+ * its own token SET rules and defaults to the `narrative` raster, so
397
+ * dropping one into a hand-rolled layout renders a complete, density-
398
+ * correct item with no `<cngx-timeline>` above it. Inside the organism it
399
+ * inherits `[data-mode]` and re-rasters itself.
400
+ *
401
+ * **Two independent state channels.** `status` is where the event sits in
402
+ * a history (`done` / `active` / `upcoming` / `rejected`) - editorial, set
403
+ * by the consumer. `state` is whether *this row's own* data is currently
404
+ * loading or failed. They compose: a `done` item whose `state` errored
405
+ * paints as rejected and announces the failure, without losing the
406
+ * editorial status once the retry succeeds.
407
+ *
408
+ * **What it announces.** The marker and rail are `aria-hidden`, so colour is
409
+ * never the only channel - the status reaches assistive tech through a
410
+ * screen-reader-only line fed from `CNGX_TIMELINE_CONFIG.labels.status`, and
411
+ * a failed row through a visible inline error. Both are read as the row's own
412
+ * content, in DOM order, rather than through `aria-describedby`: the host is
413
+ * a plain element with no role, so a description pointed at its own
414
+ * descendants would resolve nowhere and duplicate the text for anyone
415
+ * browsing it. Neither element is rendered while it has nothing to say.
416
+ *
417
+ * ### Standalone
418
+ * ```html
419
+ * <cngx-timeline-item status="done">
420
+ * <cngx-time cngxTimelineTime [date]="event.at" />
421
+ * <p>Deployment finished</p>
422
+ * </cngx-timeline-item>
423
+ * ```
424
+ *
425
+ * ### With its own async state
426
+ * ```html
427
+ * <cngx-timeline-item [state]="rowState" position="last">
428
+ * <p>{{ rowState.data()?.summary }}</p>
429
+ * </cngx-timeline-item>
430
+ * ```
431
+ *
432
+ * @category common/timeline
433
+ * @docsKind primary
434
+ * @wcag AA
435
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/timeline-item.component.ts
436
+ * @relatedTo CngxTimelineMarker, CngxTimelineConnector, CNGX_TIMELINE_CONFIG
437
+ * <example-url>http://localhost:4200/#/ui/timeline/basics/standalone-atoms</example-url>
438
+ * <example-url>http://localhost:4200/#/ui/timeline/basics/custom-date-header-and-marker</example-url>
439
+ * <example-url>http://localhost:4200/#/ui/timeline/basics/marker-precedence</example-url>
440
+ * <example-url>http://localhost:4200/#/ui/timeline/layout/media-markers</example-url>
441
+ * <example-url>http://localhost:4200/#/ui/timeline/layout/placement-end</example-url>
442
+ * @since 0.1.0
443
+ */
444
+ declare class CngxTimelineItem {
445
+ private readonly config;
446
+ private readonly host;
447
+ /**
448
+ * Where the event sits in the history. Drives the marker and rail
449
+ * colours and the screen-reader status line. Purely editorial - it
450
+ * carries no flow logic, because a timeline is a record and a guided
451
+ * process is a stepper.
452
+ */
453
+ readonly status: i0.InputSignal<TimelineStatus | undefined>;
454
+ /**
455
+ * This row's own async state, for a body that loads, mutates or fails
456
+ * independently of the list around it.
457
+ *
458
+ * Optional by construction and tolerant of a bare `state` attribute
459
+ * (the empty string coerces to `undefined`), so the item never forces a
460
+ * binding a consumer may not have.
461
+ */
462
+ readonly state: i0.InputSignalWithTransform<CngxAsyncState<unknown> | undefined, "" | CngxAsyncState<unknown> | undefined>;
463
+ /**
464
+ * Position in the run, forwarded to the rail. `'last'` and `'only'`
465
+ * stop the rail at this item so the timeline does not trail off into
466
+ * empty space. The organism sets it; standalone items default to
467
+ * `'middle'`.
468
+ */
469
+ readonly position: i0.InputSignal<TimelineConnectorPosition>;
470
+ /**
471
+ * The event this row stands for. Only ever read as the `$implicit` of an
472
+ * app-wide `*cngxTimelineMarkerTpl`, so bind it when the app sets one and
473
+ * that template needs the payload; leave it off otherwise.
474
+ */
475
+ readonly item: i0.InputSignal<unknown>;
476
+ /**
477
+ * @internal The timeline-wide marker template, when a `<cngx-timeline>` is
478
+ * above this row. Absent standalone.
479
+ */
480
+ private readonly hostMarkerTpl;
481
+ /** @internal Set when this row projects its own marker content. */
482
+ private readonly ownMarker;
483
+ /**
484
+ * @internal The timeline-wide template is the *default*, so a row that
485
+ * projects its own marker content overrides it - most-local-wins, the
486
+ * same direction as every other slot in the family. Resolving to `null`
487
+ * rather than branching on `<ng-content>` keeps the projection static:
488
+ * content lands in the DOM once and renders whatever it was given.
489
+ */
490
+ protected readonly markerTpl: i0.Signal<i0.TemplateRef<_cngx_common_timeline.CngxTimelineMarkerContext<unknown>> | null>;
491
+ /** @internal Work in flight on this row's own state. */
492
+ protected readonly busy: i0.Signal<boolean>;
493
+ /** @internal This row's own state failed. */
494
+ protected readonly failed: i0.Signal<boolean>;
495
+ /** @internal `aria-busy` reflects the row's own work, not the list's. */
496
+ protected readonly ariaBusy: i0.Signal<"true" | null>;
497
+ /**
498
+ * @internal A failed row paints as rejected regardless of its editorial
499
+ * status - a failure is the more urgent fact, and `status` is left
500
+ * untouched so the row returns to its own colour once a retry lands.
501
+ */
502
+ protected readonly markerStatus: i0.Signal<TimelineStatus | undefined>;
503
+ /**
504
+ * @internal Busy outranks everything: a row still loading has nothing
505
+ * settled to report. Otherwise this reads `markerStatus`, not `status`,
506
+ * so the announcement can never contradict the paint - a failed row
507
+ * announces the `rejected` it shows, not the editorial status it kept.
508
+ */
509
+ protected readonly statusText: i0.Signal<string>;
510
+ /** @internal Visible inline error, blank unless this row failed. */
511
+ protected readonly errorText: i0.Signal<string>;
512
+ constructor();
513
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineItem, never>;
514
+ static ɵcmp: i0.ɵɵComponentDeclaration<CngxTimelineItem, "cngx-timeline-item", never, { "status": { "alias": "status"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "item": { "alias": "item"; "required": false; "isSignal": true; }; }, {}, ["ownMarker"], ["[cngxTimelineMarkerContent]", "[cngxTimelineOpposite]", "[cngxTimelineTime]", "[cngxTimelineContent]", "*"], true, never>;
515
+ }
516
+
517
+ /**
518
+ * Context for `*cngxTimelineItem` - the item itself plus where it sits.
519
+ *
520
+ * `first` and `last` are positions **within the group**, not within the
521
+ * whole timeline, because that is what a consumer needs to decide whether
522
+ * to draw a trailing rail.
523
+ *
524
+ * @category common/timeline
525
+ */
526
+ interface CngxTimelineItemContext<T> {
527
+ readonly $implicit: T;
528
+ /** Index within the group. */
529
+ readonly index: number;
530
+ /** First item of its group. */
531
+ readonly first: boolean;
532
+ /** Last item of its group. */
533
+ readonly last: boolean;
534
+ /** The group this item was bucketed into. */
535
+ readonly group: TimelineGroup<T>;
536
+ }
537
+ /**
538
+ * The row template. The one slot with no built-in fallback: only the
539
+ * consumer knows what an event of theirs looks like.
540
+ *
541
+ * Bind the same array the timeline gets and the `let-` variables come out
542
+ * typed - `[cngxTimelineItem]` exists to pin `T`, nothing more:
543
+ *
544
+ * ```html
545
+ * <cngx-timeline [items]="events()" [dateAccessor]="at">
546
+ * <ng-template [cngxTimelineItem]="events()" let-event let-last="last">
547
+ * <cngx-timeline-item [position]="last ? 'last' : 'middle'">
548
+ * <cngx-time cngxTimelineTime [date]="event.at" />
549
+ * <p>{{ event.summary }}</p>
550
+ * </cngx-timeline-item>
551
+ * </ng-template>
552
+ * </cngx-timeline>
553
+ * ```
554
+ *
555
+ * Named `CngxTimelineItemTpl` so it does not collide with the
556
+ * `CngxTimelineItem` component; the selector stays `cngxTimelineItem`,
557
+ * which is what consumers write.
558
+ *
559
+ * @category common/timeline
560
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
561
+ * @relatedTo CngxTimelineItem, CngxTimelineDateHeader
562
+ * @since 0.1.0
563
+ */
564
+ declare class CngxTimelineItemTpl<T = unknown> {
565
+ /**
566
+ * Type carrier, never read at runtime. Angular cannot infer a structural
567
+ * directive's context generic from a sibling input on the host component,
568
+ * so `T` has to be pinned on the directive itself; binding the same array
569
+ * the timeline renders does that, and `ngTemplateContextGuard` below then
570
+ * types every `let-` variable. This is `NgForOf`'s `ngForOf` mechanism,
571
+ * not a cngx invention.
572
+ *
573
+ * Optional, and tolerant of the bare `cngxTimelineItem` attribute every
574
+ * v1 consumer writes: an unbound attribute binds the empty string, which
575
+ * `strictTemplates` would otherwise reject against an array type. The
576
+ * empty string coerces to `undefined` and `T` falls back to `unknown` -
577
+ * the Bridge-Input shape the library uses wherever an attribute doubles
578
+ * as an opt-in.
579
+ *
580
+ * Nothing enforces that the array bound here is the array bound to
581
+ * `[items]`; a mismatch only mistypes the `let-` variables, which the
582
+ * template type-checker then rejects at the use site.
583
+ */
584
+ readonly cngxTimelineItem: i0.InputSignalWithTransform<readonly T[] | undefined, "" | readonly T[] | undefined>;
585
+ readonly templateRef: TemplateRef<CngxTimelineItemContext<T>>;
586
+ static ngTemplateContextGuard<T>(_dir: CngxTimelineItemTpl<T>, ctx: unknown): ctx is CngxTimelineItemContext<T>;
587
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineItemTpl<any>, never>;
588
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineItemTpl<any>, "ng-template[cngxTimelineItem]", ["cngxTimelineItem"], { "cngxTimelineItem": { "alias": "cngxTimelineItem"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
589
+ }
590
+ /**
591
+ * Context for `*cngxTimelineDateHeader` - the whole group, so a header can
592
+ * show its item count alongside the date.
593
+ *
594
+ * @category common/timeline
595
+ */
596
+ interface CngxTimelineDateHeaderContext<T> {
597
+ readonly $implicit: TimelineGroup<T>;
598
+ }
599
+ /**
600
+ * The per-group header. Falls back to
601
+ * `CNGX_TIMELINE_CONFIG.labels.groupLabel`, which formats the group's
602
+ * start date in the browser locale.
603
+ *
604
+ * The element this renders into is what the group's `aria-labelledby`
605
+ * points at, so a header that renders nothing leaves the group unnamed.
606
+ *
607
+ * ```html
608
+ * <ng-template [cngxTimelineDateHeader]="events()" let-group>
609
+ * <h3>{{ format(group.start) }} ({{ group.items.length }})</h3>
610
+ * </ng-template>
611
+ * ```
612
+ *
613
+ * @category common/timeline
614
+ * @wcag AA
615
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
616
+ * @relatedTo CngxTimelineItemTpl
617
+ * @since 0.1.0
618
+ */
619
+ declare class CngxTimelineDateHeader<T = unknown> {
620
+ /**
621
+ * Type carrier for the group's item type, never read at runtime. Bind the
622
+ * same array the timeline gets and `let-group` types as
623
+ * `TimelineGroup<T>`. See {@link CngxTimelineItemTpl.cngxTimelineItem}.
624
+ */
625
+ readonly cngxTimelineDateHeader: i0.InputSignalWithTransform<readonly T[] | undefined, "" | readonly T[] | undefined>;
626
+ readonly templateRef: TemplateRef<CngxTimelineDateHeaderContext<T>>;
627
+ static ngTemplateContextGuard<T>(_dir: CngxTimelineDateHeader<T>, ctx: unknown): ctx is CngxTimelineDateHeaderContext<T>;
628
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineDateHeader<any>, never>;
629
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineDateHeader<any>, "ng-template[cngxTimelineDateHeader]", ["cngxTimelineDateHeader"], { "cngxTimelineDateHeader": { "alias": "cngxTimelineDateHeader"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
630
+ }
631
+ /**
632
+ * Context for `*cngxTimelineMarkerTpl` - the item and the status the
633
+ * organism resolved for it.
634
+ *
635
+ * @category common/timeline
636
+ */
637
+ interface CngxTimelineMarkerContext<T> {
638
+ readonly $implicit: T;
639
+ readonly status: TimelineStatus | undefined;
640
+ }
641
+ /**
642
+ * What goes inside the marker dot - an icon, an avatar, a type glyph.
643
+ * Falls back to a bare coloured dot.
644
+ *
645
+ * Applies to every row. A single row overrides it by projecting its own
646
+ * `[cngxTimelineMarkerContent]`, which wins over this template.
647
+ *
648
+ * Whatever renders here is inside an `aria-hidden` element, so it must
649
+ * not be the only carrier of anything: the status reaches assistive tech
650
+ * through `CNGX_TIMELINE_CONFIG.labels.status`.
651
+ *
652
+ * Keeps `Tpl` in class *and* selector to stay clear of
653
+ * `CngxTimelineMarker`, the component it renders into.
654
+ *
655
+ * @category common/timeline
656
+ * @wcag AA
657
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
658
+ * @relatedTo CngxTimelineMarker
659
+ * @since 0.1.0
660
+ */
661
+ declare class CngxTimelineMarkerTpl<T = unknown> {
662
+ /**
663
+ * Type carrier for the item type, never read at runtime. Bind the same
664
+ * array the timeline gets and `let-event` types as `T`. See
665
+ * {@link CngxTimelineItemTpl.cngxTimelineItem}.
666
+ */
667
+ readonly cngxTimelineMarkerTpl: i0.InputSignalWithTransform<readonly T[] | undefined, "" | readonly T[] | undefined>;
668
+ readonly templateRef: TemplateRef<CngxTimelineMarkerContext<T>>;
669
+ static ngTemplateContextGuard<T>(_dir: CngxTimelineMarkerTpl<T>, ctx: unknown): ctx is CngxTimelineMarkerContext<T>;
670
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineMarkerTpl<any>, never>;
671
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineMarkerTpl<any>, "ng-template[cngxTimelineMarkerTpl]", ["cngxTimelineMarkerTpl"], { "cngxTimelineMarkerTpl": { "alias": "cngxTimelineMarkerTpl"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
672
+ }
673
+ /**
674
+ * Context for `*cngxTimelineEmpty` - why the timeline is empty.
675
+ *
676
+ * The distinction is the point: "nothing has happened yet" and "your
677
+ * filter matched nothing" call for different copy and different actions.
678
+ * Vocabulary shared with `CngxCardGrid` so an app writes one empty-state
679
+ * component and reuses it.
680
+ *
681
+ * @category common/timeline
682
+ */
683
+ interface CngxTimelineEmptyContext {
684
+ readonly $implicit: EmptyReason;
685
+ }
686
+ /**
687
+ * The empty surface. Falls back to
688
+ * `CNGX_TIMELINE_CONFIG.labels.emptyFallback`.
689
+ *
690
+ * ```html
691
+ * <ng-template cngxTimelineEmpty let-reason>
692
+ * @if (reason === 'no-results') { <p>No events match this filter.</p> }
693
+ * @else { <p>Nothing has happened yet.</p> }
694
+ * </ng-template>
695
+ * ```
696
+ *
697
+ * @category common/timeline
698
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
699
+ * @relatedTo CngxTimelineError
700
+ * @since 0.1.0
701
+ */
702
+ declare class CngxTimelineEmpty {
703
+ readonly templateRef: TemplateRef<CngxTimelineEmptyContext>;
704
+ static ngTemplateContextGuard(_dir: CngxTimelineEmpty, ctx: unknown): ctx is CngxTimelineEmptyContext;
705
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineEmpty, never>;
706
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineEmpty, "ng-template[cngxTimelineEmpty]", ["cngxTimelineEmpty"], {}, {}, never, never, true, never>;
707
+ }
708
+ /**
709
+ * Context for `*cngxTimelineError` - the raw error plus the retry the
710
+ * organism owns.
711
+ *
712
+ * @category common/timeline
713
+ */
714
+ interface CngxTimelineErrorContext {
715
+ readonly $implicit: unknown;
716
+ /** Re-drives the consumer's source; emits the organism's `retry` output. */
717
+ readonly retry: () => void;
718
+ }
719
+ /**
720
+ * The whole error surface, replacing message and retry control together.
721
+ * Reach for `*cngxTimelineRetryButton` instead when only the button needs
722
+ * restyling. Falls back to
723
+ * `CNGX_TIMELINE_CONFIG.labels.errorFallback` plus a plain retry button.
724
+ *
725
+ * @category common/timeline
726
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
727
+ * @relatedTo CngxTimelineRetryButton, CngxTimelineEmpty
728
+ * @since 0.1.0
729
+ */
730
+ declare class CngxTimelineError {
731
+ readonly templateRef: TemplateRef<CngxTimelineErrorContext>;
732
+ static ngTemplateContextGuard(_dir: CngxTimelineError, ctx: unknown): ctx is CngxTimelineErrorContext;
733
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineError, never>;
734
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineError, "ng-template[cngxTimelineError]", ["cngxTimelineError"], {}, {}, never, never, true, never>;
735
+ }
736
+ /**
737
+ * Context for `*cngxTimelineRetryButton` - the retry callback.
738
+ *
739
+ * @category common/timeline
740
+ */
741
+ interface CngxTimelineRetryButtonContext {
742
+ readonly $implicit: () => void;
743
+ }
744
+ /**
745
+ * Just the retry control inside the default error surface, for apps that
746
+ * want their own button component without rewriting the error copy.
747
+ *
748
+ * Whatever renders here has to be operable: the library ships no button
749
+ * component, so a consumer template is responsible for its own `type`,
750
+ * accessible name and click wiring.
751
+ *
752
+ * ```html
753
+ * <ng-template cngxTimelineRetryButton let-retry>
754
+ * <button type="button" (click)="retry()">Try again</button>
755
+ * </ng-template>
756
+ * ```
757
+ *
758
+ * @category common/timeline
759
+ * @wcag AA
760
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
761
+ * @relatedTo CngxTimelineError
762
+ * @since 0.1.0
763
+ */
764
+ declare class CngxTimelineRetryButton {
765
+ readonly templateRef: TemplateRef<CngxTimelineRetryButtonContext>;
766
+ static ngTemplateContextGuard(_dir: CngxTimelineRetryButton, ctx: unknown): ctx is CngxTimelineRetryButtonContext;
767
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineRetryButton, never>;
768
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineRetryButton, "ng-template[cngxTimelineRetryButton]", ["cngxTimelineRetryButton"], {}, {}, never, never, true, never>;
769
+ }
770
+ /**
771
+ * The tail appended below the list while a background refresh runs, with
772
+ * the already-loaded items still on screen. Falls back to
773
+ * `CNGX_TIMELINE_CONFIG.labels.refreshing`.
774
+ *
775
+ * Contextless on purpose - a refresh has nothing to say beyond the fact
776
+ * that it is happening.
777
+ *
778
+ * @category common/timeline
779
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
780
+ * @relatedTo CngxTimelineError
781
+ * @since 0.1.0
782
+ */
783
+ declare class CngxTimelineLoadingTail {
784
+ readonly templateRef: TemplateRef<void>;
785
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineLoadingTail, never>;
786
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineLoadingTail, "ng-template[cngxTimelineLoadingTail]", ["cngxTimelineLoadingTail"], {}, {}, never, never, true, never>;
787
+ }
788
+ /**
789
+ * One placeholder row in the first-load body, replacing the built-in
790
+ * marker-rail-and-two-bars shape. Rendered `[skeletonRowCount]` times.
791
+ *
792
+ * Contextless, and deliberately so: a placeholder stands in for a row whose
793
+ * data has not arrived, so there is nothing to hand it. Bind this when the
794
+ * real rows are taller or busier than the default shape and the swap to
795
+ * content would otherwise reflow the page.
796
+ *
797
+ * Whatever renders here sits inside an `aria-hidden` wrapper - the load is
798
+ * announced through the timeline's live region, not through the placeholder.
799
+ *
800
+ * @category common/timeline
801
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
802
+ * @relatedTo CngxTimelineLoadingTail
803
+ * @since 0.1.0
804
+ */
805
+ declare class CngxTimelineSkeleton {
806
+ readonly templateRef: TemplateRef<void>;
807
+ static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineSkeleton, never>;
808
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineSkeleton, "ng-template[cngxTimelineSkeleton]", ["cngxTimelineSkeleton"], {}, {}, never, never, true, never>;
809
+ }
810
+
811
+ /**
812
+ * The contract a timeline exposes to the rows beneath it, so an app-wide
813
+ * marker template can reach a dot the organism does not itself render.
814
+ *
815
+ * `<cngx-timeline>` is data-driven in v1: the consumer owns the whole row
816
+ * template and writes `<cngx-timeline-item>` themselves, which means the
817
+ * organism has no handle on the marker inside it. Passing the resolved
818
+ * template through DI is what closes that gap without the row having to
819
+ * thread it down by hand.
820
+ *
821
+ * @category common/timeline
822
+ */
823
+ interface CngxTimelineMarkerHost {
824
+ /** Resolved `*cngxTimelineMarkerTpl`, already through the config cascade. */
825
+ readonly markerTpl: Signal<TemplateRef<CngxTimelineMarkerContext<unknown>> | null>;
826
+ }
827
+ /**
828
+ * DI token for {@link CngxTimelineMarkerHost}. Provided by `<cngx-timeline>`;
829
+ * injected optionally by `CngxTimelineItem`, which falls back to its own
830
+ * `[cngxTimelineMarkerContent]` projection when no timeline is above it.
831
+ *
832
+ * A token rather than an injected parent class: the row must stay usable
833
+ * standalone, and a concrete parent type would make the two mutually
834
+ * dependent and block the decompose schematic.
835
+ *
836
+ * @category common/timeline
837
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/marker-host.token.ts
838
+ * @relatedTo CngxTimelineMarkerTpl, CngxTimelineItem
839
+ * @since 0.1.0
840
+ */
841
+ declare const CNGX_TIMELINE_MARKER_HOST: InjectionToken<CngxTimelineMarkerHost>;
842
+
843
+ /**
844
+ * Every user-visible string the timeline can render without a consumer
845
+ * slot, plus the group-header formatter.
846
+ *
847
+ * Library defaults are English. Localise by passing
848
+ * {@link withTimelineLabels} to {@link provideTimelineConfig} once at
849
+ * bootstrap - the timeline itself hardcodes nothing, so a missing
850
+ * translation shows up as English text rather than as a blank surface.
851
+ *
852
+ * Each of these is a *fallback*: the matching template slot
853
+ * (`*cngxTimelineError`, `*cngxTimelineEmpty`, ...) wins whenever it is
854
+ * present.
855
+ *
856
+ * @category common/timeline
857
+ */
858
+ interface CngxTimelineLabels {
859
+ /**
860
+ * Accessible name for the timeline list itself, read when focus or a
861
+ * screen-reader cursor enters the region. Default `'Timeline'`. A
862
+ * per-instance `[aria-label]` / `[aria-labelledby]` wins.
863
+ */
864
+ readonly timelineRegion?: string;
865
+ /**
866
+ * Label on the built-in retry control rendered in the error surface.
867
+ * Default `'Retry'`. Superseded by `*cngxTimelineRetryButton`.
868
+ */
869
+ readonly retry?: string;
870
+ /**
871
+ * Body text for the error surface when no `*cngxTimelineError` slot is
872
+ * bound. Default `'Could not load the timeline.'`
873
+ */
874
+ readonly errorFallback?: string;
875
+ /**
876
+ * Body text for the empty surface when no `*cngxTimelineEmpty` slot is
877
+ * bound. Default `'No events yet.'`
878
+ */
879
+ readonly emptyFallback?: string;
880
+ /**
881
+ * Accessible name for the loading body, so the skeleton is announced
882
+ * as something other than silence. Default `'Loading timeline'`.
883
+ */
884
+ readonly loading?: string;
885
+ /**
886
+ * Text for the refreshing tail appended below the list while a
887
+ * background reload is in flight. Default `'Updating…'`. Superseded by
888
+ * `*cngxTimelineLoadingTail`.
889
+ */
890
+ readonly refreshing?: string;
891
+ /**
892
+ * Screen-reader text for a single item whose own `[state]` is pending.
893
+ * Paired with `aria-busy` on that item. Default `'Updating'`.
894
+ */
895
+ readonly itemBusy?: string;
896
+ /**
897
+ * Inline error text for a single item whose own `[state]` failed, used
898
+ * when the consumer renders no per-item error content. Default
899
+ * `'Could not load this event.'`
900
+ */
901
+ readonly itemErrorFallback?: string;
902
+ /**
903
+ * Screen-reader wording for each process status. The marker paints the
904
+ * status visually and the dot is `aria-hidden`, so this map is the only
905
+ * channel that carries it to assistive tech - leaving a key blank
906
+ * silences that status rather than merely restyling it.
907
+ *
908
+ * Defaults: `Completed` / `In progress` / `Upcoming` / `Rejected`.
909
+ * Partial - {@link withTimelineLabels} merges it key by key, so
910
+ * renaming one status leaves the other three at their defaults.
911
+ */
912
+ readonly status?: Readonly<Partial<Record<TimelineStatus, string>>>;
913
+ /**
914
+ * Formats a group's header when no `*cngxTimelineDateHeader` slot is
915
+ * bound. Receives the whole group so a consumer can fold the item
916
+ * count into the header. Defaults to the group's start date in the
917
+ * browser locale - a date, unlike the strings above, has no sensible
918
+ * English-only default.
919
+ */
920
+ readonly groupLabel?: (group: TimelineGroup<unknown>) => string;
921
+ }
922
+ /**
923
+ * App-wide template defaults for the timeline's slot regions - the middle
924
+ * tier of the family-standard 3-stage cascade
925
+ * (per-instance directive > this field > built-in markup).
926
+ *
927
+ * Set them with {@link withTimelineTemplates}. Keys are typed against
928
+ * `unknown` items because the config is app-wide while the slots are
929
+ * generic; a `TemplateRef` for a concrete item type assigns in fine.
930
+ *
931
+ * @category common/timeline
932
+ */
933
+ interface CngxTimelineTemplates {
934
+ /** Default row template (`*cngxTimelineItem`). */
935
+ readonly item?: TemplateRef<CngxTimelineItemContext<unknown>>;
936
+ /** Default per-group date header (`*cngxTimelineDateHeader`). */
937
+ readonly dateHeader?: TemplateRef<CngxTimelineDateHeaderContext<unknown>>;
938
+ /** Default marker content (`*cngxTimelineMarkerTpl`). */
939
+ readonly marker?: TemplateRef<CngxTimelineMarkerContext<unknown>>;
940
+ /** Default empty surface (`*cngxTimelineEmpty`). */
941
+ readonly empty?: TemplateRef<CngxTimelineEmptyContext>;
942
+ /** Default error surface (`*cngxTimelineError`). */
943
+ readonly error?: TemplateRef<CngxTimelineErrorContext>;
944
+ /** Default retry control (`*cngxTimelineRetryButton`). */
945
+ readonly retryButton?: TemplateRef<CngxTimelineRetryButtonContext>;
946
+ /** Default refreshing tail (`*cngxTimelineLoadingTail`). */
947
+ readonly loadingTail?: TemplateRef<void>;
948
+ /** Default placeholder row for the first-load body (`*cngxTimelineSkeleton`). */
949
+ readonly skeleton?: TemplateRef<void>;
950
+ }
951
+ /**
952
+ * Timeline config surface. Resolution priority: \
953
+ * per-instance Input → `provideTimelineConfigAt` (viewProviders) →
954
+ * `provideTimelineConfig` (root) → library default.
955
+ *
956
+ * Deliberately small: the timeline has no behavioural switches to
957
+ * configure, so this carries text and templates only. Bucketing is
958
+ * swapped through {@link CNGX_TIMELINE_GROUPING_FACTORY} instead, and
959
+ * everything visual through the slot directives.
960
+ *
961
+ * @category common/timeline
962
+ */
963
+ interface CngxTimelineConfig {
964
+ readonly labels?: CngxTimelineLabels;
965
+ readonly templates?: CngxTimelineTemplates;
966
+ }
967
+ /**
968
+ * DI token for the resolved timeline config. \
969
+ * `providedIn: 'root'` with the library defaults; override via
970
+ * {@link provideTimelineConfig} (root) or {@link provideTimelineConfigAt}
971
+ * (component scope).
972
+ *
973
+ * @category common/timeline
974
+ * @wcag AA
975
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/timeline-config.ts
976
+ * @relatedTo provideTimelineConfig
977
+ * @relatedTo withTimelineLabels
978
+ * @since 0.1.0
979
+ */
980
+ declare const CNGX_TIMELINE_CONFIG: InjectionToken<CngxTimelineConfig>;
981
+ /**
982
+ * Signature of every `with*` timeline config builder - a pure
983
+ * config-to-config mutator, folded left over the library defaults.
984
+ *
985
+ * @category common/timeline
986
+ */
987
+ type CngxTimelineConfigFeature = (config: CngxTimelineConfig) => CngxTimelineConfig;
988
+ /**
989
+ * Merge label overrides into the cascade. Keys left out keep their
990
+ * English library default, so a consumer translates what they need and
991
+ * nothing more.
992
+ *
993
+ * ```ts
994
+ * provideTimelineConfig(
995
+ * withTimelineLabels({
996
+ * retry: 'Erneut versuchen',
997
+ * emptyFallback: 'Noch keine Ereignisse.',
998
+ * groupLabel: (group) => group.start.toLocaleDateString('de-AT'),
999
+ * }),
1000
+ * )
1001
+ * ```
1002
+ *
1003
+ * @category common/timeline
1004
+ */
1005
+ declare function withTimelineLabels(labels: CngxTimelineLabels): CngxTimelineConfigFeature;
1006
+ /**
1007
+ * Merge app-wide slot template defaults into the cascade. Keys left out
1008
+ * keep whatever an earlier feature set, and a per-instance slot directive
1009
+ * still wins over anything set here.
1010
+ *
1011
+ * One bag rather than a `with*Template` builder per slot, matching how the
1012
+ * select family carries its own slot defaults - the timeline has eight
1013
+ * slots and near-identical builders would only add surface.
1014
+ *
1015
+ * ```ts
1016
+ * readonly emptyTpl = viewChild.required<TemplateRef<CngxTimelineEmptyContext>>('emptyTpl', {
1017
+ * read: TemplateRef,
1018
+ * });
1019
+ *
1020
+ * providers: [provideTimelineConfig(withTimelineTemplates({ empty: this.emptyTpl() }))]
1021
+ * ```
1022
+ *
1023
+ * @category common/timeline
1024
+ */
1025
+ declare function withTimelineTemplates(templates: CngxTimelineTemplates): CngxTimelineConfigFeature;
1026
+ /**
1027
+ * Root-level provider. Apply once in `bootstrapApplication` /
1028
+ * `appConfig.providers`.
1029
+ *
1030
+ * @category common/timeline
1031
+ */
1032
+ declare function provideTimelineConfig(...features: readonly CngxTimelineConfigFeature[]): EnvironmentProviders;
1033
+ /**
1034
+ * Component-scoped override. Returns `Provider[]` rather than
1035
+ * {@link EnvironmentProviders} because `viewProviders` rejects opaque
1036
+ * environment providers.
1037
+ *
1038
+ * Features merge onto the parent config - an enclosing scope, or the root
1039
+ * provider, or the library defaults when neither is present - so a region
1040
+ * can re-phrase one label without resetting every other one the app set.
1041
+ *
1042
+ * ```ts
1043
+ * @Component({
1044
+ * viewProviders: [...provideTimelineConfigAt(withTimelineLabels({ retry: 'Again' }))],
1045
+ * })
1046
+ * ```
1047
+ *
1048
+ * @category common/timeline
1049
+ */
1050
+ declare function provideTimelineConfigAt(...features: readonly CngxTimelineConfigFeature[]): Provider[];
1051
+ /**
1052
+ * Read the resolved timeline config. Runs in an injection context.
1053
+ *
1054
+ * @category common/timeline
1055
+ */
1056
+ declare function injectTimelineConfig(): CngxTimelineConfig;
1057
+
1058
+ export { CNGX_TIMELINE_CONFIG, CNGX_TIMELINE_GROUPING_FACTORY, CNGX_TIMELINE_MARKER_HOST, CngxTimelineConnector, CngxTimelineContent, CngxTimelineDateHeader, CngxTimelineEmpty, CngxTimelineError, CngxTimelineItem, CngxTimelineItemTpl, CngxTimelineLoadingTail, CngxTimelineMarker, CngxTimelineMarkerContent, CngxTimelineMarkerTpl, CngxTimelineOpposite, CngxTimelineRetryButton, CngxTimelineSkeleton, CngxTimelineTime, createTimelineGrouping, injectTimelineConfig, provideTimelineConfig, provideTimelineConfigAt, withTimelineLabels, withTimelineTemplates };
1059
+ export type { CngxTimelineConfig, CngxTimelineConfigFeature, CngxTimelineDateHeaderContext, CngxTimelineEmptyContext, CngxTimelineErrorContext, CngxTimelineGroupingFactory, CngxTimelineItemContext, CngxTimelineLabels, CngxTimelineMarkerContext, CngxTimelineMarkerHost, CngxTimelineRetryButtonContext, CngxTimelineTemplates, TimelineConnectorPosition, TimelineDateAccessor, TimelineDirection, TimelineGroup, TimelineGroupBy, TimelineGroupKey, TimelineGrouping, TimelineGroupingFn, TimelineGroupingOptions, TimelineStatus };