@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,1086 @@
1
+ import * as i0 from '@angular/core';
2
+ import { linkedSignal, InjectionToken, input, ViewEncapsulation, ChangeDetectionStrategy, Component, makeEnvironmentProviders, SkipSelf, Optional, inject, Directive, ElementRef, contentChild, computed, isDevMode, afterNextRender, TemplateRef } from '@angular/core';
3
+ import { coerceBooleanProperty } from '@cngx/core/utils';
4
+ import { NgTemplateOutlet } from '@angular/common';
5
+
6
+ function pad2(value) {
7
+ return value < 10 ? `0${value}` : `${value}`;
8
+ }
9
+ function groupByDay(date) {
10
+ const year = date.getFullYear();
11
+ const month = date.getMonth();
12
+ const day = date.getDate();
13
+ return {
14
+ key: `${year}-${pad2(month + 1)}-${pad2(day)}`,
15
+ start: new Date(year, month, day),
16
+ };
17
+ }
18
+ function groupByWeek(date) {
19
+ // ISO weeks start on Monday; `getDay()` starts on Sunday.
20
+ const offset = (date.getDay() + 6) % 7;
21
+ const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - offset);
22
+ return {
23
+ key: `W${start.getFullYear()}-${pad2(start.getMonth() + 1)}-${pad2(start.getDate())}`,
24
+ start,
25
+ };
26
+ }
27
+ function groupByMonth(date) {
28
+ const year = date.getFullYear();
29
+ const month = date.getMonth();
30
+ return { key: `${year}-${pad2(month + 1)}`, start: new Date(year, month, 1) };
31
+ }
32
+ function groupByNone(date) {
33
+ return { key: 'all', start: date };
34
+ }
35
+ function resolveGrouper(mode) {
36
+ if (typeof mode === 'function') {
37
+ return mode;
38
+ }
39
+ switch (mode) {
40
+ case 'week':
41
+ return groupByWeek;
42
+ case 'month':
43
+ return groupByMonth;
44
+ case 'none':
45
+ return groupByNone;
46
+ default:
47
+ return groupByDay;
48
+ }
49
+ }
50
+ function toDate(value) {
51
+ return value instanceof Date ? value : new Date(value);
52
+ }
53
+ function sameItems(previous, next) {
54
+ return previous.length === next.length && previous.every((item, i) => item === next[i]);
55
+ }
56
+ function groupsEqual(a, b) {
57
+ return a.length === b.length && a.every((group, index) => group === b[index]);
58
+ }
59
+ /**
60
+ * Derives grouped, sorted timeline bands from a flat item list.
61
+ *
62
+ * Pure derivation: bands come out of one `linkedSignal` over the `items`
63
+ * accessor. Nothing is synced, nothing is written back, and the presenter
64
+ * never mutates its input array. The previous bands are read through the
65
+ * `computation` callback rather than a closure cache, so the result depends
66
+ * on the inputs and the prior value alone - never on how many times it ran.
67
+ *
68
+ * Three properties make it usable as the organism's only data path:
69
+ *
70
+ * - **Defensive sort.** Consumer data does not have to arrive sorted. The
71
+ * presenter sorts by the accessor date on every run using a stable sort,
72
+ * so items sharing a timestamp keep their input order in both
73
+ * directions.
74
+ * - **Local-calendar bucketing.** `day` / `week` / `month` read local date
75
+ * fields rather than dividing the epoch, which is what keeps 23-hour and
76
+ * 25-hour DST days intact. Consumers who want UTC (or any other rule)
77
+ * pass a {@link TimelineGroupingFn}.
78
+ * - **Append-stability.** Groups whose items are *the same objects* hand
79
+ * back the same band reference, and the signal carries a structural
80
+ * `equal`. Reuse is deliberately keyed on reference identity rather than
81
+ * on an id: a refetch returns new objects at the same ids, and reusing
82
+ * there would pin the band to a stale payload. Appending therefore leaves
83
+ * every other band's
84
+ * `@for` block untouched instead of re-rendering the whole timeline.
85
+ *
86
+ * Reach for the DI token {@link CNGX_TIMELINE_GROUPING_FACTORY} rather
87
+ * than this function directly when the caller is a component - that is
88
+ * what makes the bucketing swappable per app or per component.
89
+ *
90
+ * ```ts
91
+ * const grouping = createTimelineGrouping({
92
+ * items: this.events,
93
+ * dateAccessor: (event) => event.occurredAt,
94
+ * groupBy: this.groupBy,
95
+ * });
96
+ * ```
97
+ *
98
+ * @category common/timeline
99
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/grouping.ts
100
+ * @since 0.1.0
101
+ */
102
+ function createTimelineGrouping(options) {
103
+ const { items, dateAccessor, groupBy, direction } = options;
104
+ // `linkedSignal` rather than `computed`: append-stability needs the
105
+ // previous bands to hand their references back, and this is the sanctioned
106
+ // way to read them. A closure cache mutated inside a `computed` would make
107
+ // the computation impure - its output would depend on how many times it had
108
+ // run, not only on its inputs.
109
+ const groups = linkedSignal({ ...(ngDevMode ? { debugName: "groups" } : /* istanbul ignore next */ {}), source: () => {
110
+ const source = items();
111
+ const grouper = resolveGrouper(groupBy?.() ?? 'day');
112
+ const sign = (direction?.() ?? 'desc') === 'asc' ? 1 : -1;
113
+ const dated = source.map((item) => ({ item, date: toDate(dateAccessor(item)) }));
114
+ dated.sort((a, b) => sign * (a.date.getTime() - b.date.getTime()));
115
+ // Map preserves insertion order, so buckets come out already sorted.
116
+ const buckets = new Map();
117
+ for (const entry of dated) {
118
+ const { key, start } = grouper(entry.date, entry.item);
119
+ const bucket = buckets.get(key);
120
+ if (bucket) {
121
+ bucket.items.push(entry.item);
122
+ }
123
+ else {
124
+ buckets.set(key, { start, items: [entry.item] });
125
+ }
126
+ }
127
+ return Array.from(buckets, ([key, bucket]) => ({
128
+ key,
129
+ start: bucket.start,
130
+ items: bucket.items,
131
+ }));
132
+ },
133
+ computation: (fresh, previous) => {
134
+ const previousByKey = new Map((previous?.value ?? []).map((group) => [group.key, group]));
135
+ return fresh.map((group) => {
136
+ const prior = previousByKey.get(group.key);
137
+ // Reference identity only. Matching ids are NOT enough: a refetch
138
+ // returns fresh objects at the same ids with changed content, and
139
+ // handing back the prior band there would render the old payload
140
+ // forever. Reference equality is the only signal that says "these
141
+ // are literally the same items", which is what reuse requires.
142
+ const reusable = prior?.start.getTime() === group.start.getTime() &&
143
+ sameItems(prior.items, group.items);
144
+ return reusable ? prior : group;
145
+ });
146
+ },
147
+ equal: groupsEqual });
148
+ return { groups };
149
+ }
150
+ /**
151
+ * Resolves the presenter `<cngx-timeline>` builds its bands with.
152
+ * Defaults to {@link createTimelineGrouping}.
153
+ *
154
+ * Override app-wide via
155
+ * `providers: [{ provide: CNGX_TIMELINE_GROUPING_FACTORY, useValue: myFactory }]`
156
+ * to change bucketing everywhere (fiscal calendars, "today / earlier"
157
+ * relative bands, server-supplied grouping), or per component via
158
+ * `viewProviders` for a one-off. An override wraps rather than replaces
159
+ * in most cases - call `createTimelineGrouping` inside your factory and
160
+ * post-process its `groups`.
161
+ *
162
+ * Same shape as `CNGX_SELECTION_CONTROLLER_FACTORY`: the internals of a
163
+ * component are swappable without forking the component.
164
+ *
165
+ * @category common/timeline
166
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/grouping.ts
167
+ * @relatedTo createTimelineGrouping
168
+ * @since 0.1.0
169
+ */
170
+ const CNGX_TIMELINE_GROUPING_FACTORY = new InjectionToken('CngxTimelineGroupingFactory', {
171
+ providedIn: 'root',
172
+ factory: () => createTimelineGrouping,
173
+ });
174
+
175
+ /**
176
+ * The dot on the timeline rail - a status-coloured slot host for whatever
177
+ * the consumer projects into it (nothing, a glyph, an icon, an avatar).
178
+ *
179
+ * Purely decorative and marked `aria-hidden`: the status it paints is
180
+ * already carried semantically by the owning `CngxTimelineItem`, and
181
+ * announcing it twice is worse than not announcing it here at all. That
182
+ * also means colour is never this atom's only signal - the item's ARIA is.
183
+ *
184
+ * Usable standalone. It ships its own token SET rules, so a marker
185
+ * dropped into a hand-rolled layout renders at the right size and tracks
186
+ * `[data-density]` with no timeline organism above it.
187
+ *
188
+ * ### Bare dot
189
+ * ```html
190
+ * <cngx-timeline-marker status="done" />
191
+ * ```
192
+ *
193
+ * ### With a projected glyph
194
+ * ```html
195
+ * <cngx-timeline-marker status="rejected">!</cngx-timeline-marker>
196
+ * ```
197
+ *
198
+ * ### Pending
199
+ * ```html
200
+ * <cngx-timeline-marker status="active" busy />
201
+ * ```
202
+ *
203
+ * @category common/timeline
204
+ * @wcag AA
205
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/marker.component.ts
206
+ * @relatedTo CngxTimelineConnector
207
+ * @since 0.1.0
208
+ */
209
+ class CngxTimelineMarker {
210
+ /**
211
+ * Where the event sits in the history. Drives the dot colour and, for
212
+ * `upcoming`, its hollow fill. Left unset the marker paints in the
213
+ * neutral rail colour.
214
+ */
215
+ status = input(undefined, ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
216
+ /**
217
+ * Whether the marker pulses to signal work in flight - typically bound
218
+ * from an item's own `[state]` being `pending`.
219
+ *
220
+ * The pulse is a `box-shadow` animation rather than a `transform` or a
221
+ * size change: the marker sits in a grid track the rail is aligned to,
222
+ * so anything that altered its box would drag the rail with it every
223
+ * frame. Suppressed under `prefers-reduced-motion`.
224
+ */
225
+ busy = input(false, { ...(ngDevMode ? { debugName: "busy" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
226
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineMarker, deps: [], target: i0.ɵɵFactoryTarget.Component });
227
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.4", type: CngxTimelineMarker, isStandalone: true, selector: "cngx-timeline-marker", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, busy: { classPropertyName: "busy", publicName: "busy", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "attr.data-status": "status()", "class.cngx-timeline-marker--busy": "busy()" }, classAttribute: "cngx-timeline-marker" }, ngImport: i0, template: `<ng-content />`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-timeline-rail-inset{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-timeline-marker-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --cngx-timeline-marker-glyph-size{syntax: \"<percentage>\"; inherits: true; initial-value: 60%;}@property --cngx-timeline-item-inline-size{syntax: \"<length>\"; inherits: true; initial-value: 192px;}@property --cngx-timeline-connector-width{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-timeline-marker-ring-width{syntax: \"<length>\"; inherits: true; initial-value: 3px;}@property --cngx-timeline-connector-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-timeline-surface{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-timeline-marker-fg{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-timeline-meta-size{syntax: \"*\"; inherits: true; initial-value: .8125rem;}@property --cngx-timeline-text-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.2 .01 250);}@property --cngx-timeline-muted-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-timeline-done-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .15 145);}@property --cngx-timeline-active-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-timeline-upcoming-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-timeline-rejected-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .18 25);}@property --cngx-timeline-pulse-duration{syntax: \"<time>\"; inherits: true; initial-value: 1.6s;}}:root{--cngx-timeline-connector-color: var(--cngx-color-border, oklch(.88 .005 250));--cngx-timeline-surface: var(--cngx-color-surface, oklch(1 0 0));--cngx-timeline-text-color: var(--cngx-color-text, oklch(.2 .01 250));--cngx-timeline-muted-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-timeline-done-color: var(--cngx-color-success, oklch(.6 .15 145));--cngx-timeline-active-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-timeline-upcoming-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-timeline-rejected-color: var(--cngx-color-danger, oklch(.6 .18 25))}\n", "@layer cngx.components{@scope(.cngx-timeline-marker){:scope{display:inline-flex;align-items:center;justify-content:center;flex:none;inline-size:var(--cngx-timeline-marker-size, 12px);block-size:var(--cngx-timeline-marker-size, 12px);border-radius:50%;overflow:hidden;background:var(--cngx-timeline-connector-color, oklch(.88 .005 250));box-shadow:0 0 0 var(--cngx-timeline-connector-width, 2px) var(--cngx-timeline-surface, oklch(1 0 0));color:var(--cngx-timeline-marker-fg, oklch(1 0 0));font-size:.625em;line-height:1}:scope>img,:scope>picture{inline-size:100%;block-size:100%;object-fit:cover;border-radius:inherit}:scope>svg{inline-size:var(--cngx-timeline-marker-glyph-size, 60%);block-size:var(--cngx-timeline-marker-glyph-size, 60%)}:scope[data-status=done]{background:var(--cngx-timeline-done-color, oklch(.6 .15 145))}:scope[data-status=active]{background:var(--cngx-timeline-active-color, oklch(.66 .19 50))}:scope[data-status=rejected]{background:var(--cngx-timeline-rejected-color, oklch(.6 .18 25))}:scope[data-status=upcoming]{background:var(--cngx-timeline-surface, oklch(1 0 0));border:var(--cngx-timeline-connector-width, 2px) dashed var(--cngx-timeline-upcoming-color, oklch(.5 .01 250));color:var(--cngx-timeline-upcoming-color, oklch(.5 .01 250))}}}@layer cngx.components{@scope(.cngx-timeline-marker--busy){:scope{animation:cngx-timeline-marker-pulse var(--cngx-timeline-pulse-duration, 1.6s) ease-in-out infinite}}}@keyframes cngx-timeline-marker-pulse{0%,to{box-shadow:0 0 0 var(--cngx-timeline-connector-width, 2px) var(--cngx-timeline-surface, oklch(1 0 0)),0 0 0 var(--cngx-timeline-connector-width, 2px) transparent}50%{box-shadow:0 0 0 var(--cngx-timeline-connector-width, 2px) var(--cngx-timeline-surface, oklch(1 0 0)),0 0 0 calc(var(--cngx-timeline-connector-width, 2px) + var(--cngx-timeline-marker-ring-width, 3px)) color-mix(in oklch,currentColor 35%,transparent)}}@media(prefers-reduced-motion:reduce){.cngx-timeline-marker--busy{animation:none}}@media(forced-colors:active){.cngx-timeline-marker:not([data-status=upcoming]){box-sizing:border-box;border:var(--cngx-timeline-connector-width, 2px) solid CanvasText}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
228
+ }
229
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineMarker, decorators: [{
230
+ type: Component,
231
+ args: [{ selector: 'cngx-timeline-marker', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
232
+ class: 'cngx-timeline-marker',
233
+ 'aria-hidden': 'true',
234
+ '[attr.data-status]': 'status()',
235
+ '[class.cngx-timeline-marker--busy]': 'busy()',
236
+ }, template: `<ng-content />`, styles: ["@layer cngx.tokens{@property --cngx-timeline-rail-inset{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-timeline-marker-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --cngx-timeline-marker-glyph-size{syntax: \"<percentage>\"; inherits: true; initial-value: 60%;}@property --cngx-timeline-item-inline-size{syntax: \"<length>\"; inherits: true; initial-value: 192px;}@property --cngx-timeline-connector-width{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-timeline-marker-ring-width{syntax: \"<length>\"; inherits: true; initial-value: 3px;}@property --cngx-timeline-connector-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-timeline-surface{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-timeline-marker-fg{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-timeline-meta-size{syntax: \"*\"; inherits: true; initial-value: .8125rem;}@property --cngx-timeline-text-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.2 .01 250);}@property --cngx-timeline-muted-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-timeline-done-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .15 145);}@property --cngx-timeline-active-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-timeline-upcoming-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-timeline-rejected-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .18 25);}@property --cngx-timeline-pulse-duration{syntax: \"<time>\"; inherits: true; initial-value: 1.6s;}}:root{--cngx-timeline-connector-color: var(--cngx-color-border, oklch(.88 .005 250));--cngx-timeline-surface: var(--cngx-color-surface, oklch(1 0 0));--cngx-timeline-text-color: var(--cngx-color-text, oklch(.2 .01 250));--cngx-timeline-muted-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-timeline-done-color: var(--cngx-color-success, oklch(.6 .15 145));--cngx-timeline-active-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-timeline-upcoming-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-timeline-rejected-color: var(--cngx-color-danger, oklch(.6 .18 25))}\n", "@layer cngx.components{@scope(.cngx-timeline-marker){:scope{display:inline-flex;align-items:center;justify-content:center;flex:none;inline-size:var(--cngx-timeline-marker-size, 12px);block-size:var(--cngx-timeline-marker-size, 12px);border-radius:50%;overflow:hidden;background:var(--cngx-timeline-connector-color, oklch(.88 .005 250));box-shadow:0 0 0 var(--cngx-timeline-connector-width, 2px) var(--cngx-timeline-surface, oklch(1 0 0));color:var(--cngx-timeline-marker-fg, oklch(1 0 0));font-size:.625em;line-height:1}:scope>img,:scope>picture{inline-size:100%;block-size:100%;object-fit:cover;border-radius:inherit}:scope>svg{inline-size:var(--cngx-timeline-marker-glyph-size, 60%);block-size:var(--cngx-timeline-marker-glyph-size, 60%)}:scope[data-status=done]{background:var(--cngx-timeline-done-color, oklch(.6 .15 145))}:scope[data-status=active]{background:var(--cngx-timeline-active-color, oklch(.66 .19 50))}:scope[data-status=rejected]{background:var(--cngx-timeline-rejected-color, oklch(.6 .18 25))}:scope[data-status=upcoming]{background:var(--cngx-timeline-surface, oklch(1 0 0));border:var(--cngx-timeline-connector-width, 2px) dashed var(--cngx-timeline-upcoming-color, oklch(.5 .01 250));color:var(--cngx-timeline-upcoming-color, oklch(.5 .01 250))}}}@layer cngx.components{@scope(.cngx-timeline-marker--busy){:scope{animation:cngx-timeline-marker-pulse var(--cngx-timeline-pulse-duration, 1.6s) ease-in-out infinite}}}@keyframes cngx-timeline-marker-pulse{0%,to{box-shadow:0 0 0 var(--cngx-timeline-connector-width, 2px) var(--cngx-timeline-surface, oklch(1 0 0)),0 0 0 var(--cngx-timeline-connector-width, 2px) transparent}50%{box-shadow:0 0 0 var(--cngx-timeline-connector-width, 2px) var(--cngx-timeline-surface, oklch(1 0 0)),0 0 0 calc(var(--cngx-timeline-connector-width, 2px) + var(--cngx-timeline-marker-ring-width, 3px)) color-mix(in oklch,currentColor 35%,transparent)}}@media(prefers-reduced-motion:reduce){.cngx-timeline-marker--busy{animation:none}}@media(forced-colors:active){.cngx-timeline-marker:not([data-status=upcoming]){box-sizing:border-box;border:var(--cngx-timeline-connector-width, 2px) solid CanvasText}}\n"] }]
237
+ }], propDecorators: { status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], busy: [{ type: i0.Input, args: [{ isSignal: true, alias: "busy", required: false }] }] } });
238
+
239
+ /**
240
+ * The rail segment between two markers.
241
+ *
242
+ * Decorative and `aria-hidden`: it repeats a sequence the DOM order
243
+ * already carries, so announcing it would only add noise. It is
244
+ * status-capable all the same, because the *visual* run of a history is
245
+ * where a rejected step or a not-yet-reached tail reads fastest - a
246
+ * dashed segment for `upcoming` and a danger-toned one for `rejected`,
247
+ * so the distinction survives without colour.
248
+ *
249
+ * Drawn with `border-inline-start` and clipped with block-direction
250
+ * margins - logical properties throughout, so the rail lands on the
251
+ * correct side under `dir="rtl"` with no override.
252
+ *
253
+ * ### Between two items
254
+ * ```html
255
+ * <cngx-timeline-connector status="done" />
256
+ * ```
257
+ *
258
+ * ### Last item in the run
259
+ * ```html
260
+ * <cngx-timeline-connector position="last" />
261
+ * ```
262
+ *
263
+ * @category common/timeline
264
+ * @wcag AA
265
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/connector.component.ts
266
+ * @relatedTo CngxTimelineMarker
267
+ * @since 0.1.0
268
+ */
269
+ class CngxTimelineConnector {
270
+ /**
271
+ * Status of the segment. `upcoming` renders dashed, `rejected` in the
272
+ * danger tone, `done` and `active` solid in their own tones. Left unset
273
+ * the rail paints in the neutral border colour.
274
+ */
275
+ status = input(undefined, ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
276
+ /**
277
+ * Position in the run. `'first'` clips the head back to the marker
278
+ * centre, `'last'` clips the tail, `'only'` hides the segment
279
+ * entirely. Defaults to `'middle'` - a full-height segment.
280
+ */
281
+ position = input('middle', ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
282
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineConnector, deps: [], target: i0.ɵɵFactoryTarget.Component });
283
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.4", type: CngxTimelineConnector, isStandalone: true, selector: "cngx-timeline-connector", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "attr.data-status": "status()", "attr.data-position": "position()" }, classAttribute: "cngx-timeline-connector" }, ngImport: i0, template: '', isInline: true, styles: ["@layer cngx.tokens{@property --cngx-timeline-rail-inset{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-timeline-marker-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --cngx-timeline-marker-glyph-size{syntax: \"<percentage>\"; inherits: true; initial-value: 60%;}@property --cngx-timeline-item-inline-size{syntax: \"<length>\"; inherits: true; initial-value: 192px;}@property --cngx-timeline-connector-width{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-timeline-marker-ring-width{syntax: \"<length>\"; inherits: true; initial-value: 3px;}@property --cngx-timeline-connector-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-timeline-surface{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-timeline-marker-fg{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-timeline-meta-size{syntax: \"*\"; inherits: true; initial-value: .8125rem;}@property --cngx-timeline-text-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.2 .01 250);}@property --cngx-timeline-muted-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-timeline-done-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .15 145);}@property --cngx-timeline-active-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-timeline-upcoming-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-timeline-rejected-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .18 25);}@property --cngx-timeline-pulse-duration{syntax: \"<time>\"; inherits: true; initial-value: 1.6s;}}:root{--cngx-timeline-connector-color: var(--cngx-color-border, oklch(.88 .005 250));--cngx-timeline-surface: var(--cngx-color-surface, oklch(1 0 0));--cngx-timeline-text-color: var(--cngx-color-text, oklch(.2 .01 250));--cngx-timeline-muted-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-timeline-done-color: var(--cngx-color-success, oklch(.6 .15 145));--cngx-timeline-active-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-timeline-upcoming-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-timeline-rejected-color: var(--cngx-color-danger, oklch(.6 .18 25))}\n", "@layer cngx.components{@scope(.cngx-timeline-connector){:scope{display:block;inline-size:0;block-size:100%;justify-self:center;border-inline-start:var(--cngx-timeline-connector-width, 2px) solid var(--cngx-timeline-connector-color, oklch(.88 .005 250))}:scope[data-position=first]{margin-block-start:var(--cngx-timeline-rail-inset, 6px)}:scope[data-position=last]{margin-block-end:var(--cngx-timeline-rail-inset, 6px)}:scope[data-position=only]{display:none}:scope[data-status=done]{border-inline-start-color:var(--cngx-timeline-done-color, oklch(.6 .15 145))}:scope[data-status=active]{border-inline-start-color:var(--cngx-timeline-active-color, oklch(.66 .19 50))}:scope[data-status=rejected]{border-inline-start-color:var(--cngx-timeline-rejected-color, oklch(.6 .18 25))}:scope[data-status=upcoming]{border-inline-start-style:dashed;border-inline-start-color:var(--cngx-timeline-upcoming-color, oklch(.5 .01 250))}}}@layer cngx.components{@scope(.cngx-timeline-connector){:scope:is([data-orientation=horizontal] *){inline-size:100%;block-size:0;justify-self:stretch;align-self:center;border-inline-start:none;border-block-start:var(--cngx-timeline-connector-width, 2px) solid var(--cngx-timeline-connector-color, oklch(.88 .005 250))}:scope[data-position=first]:is([data-orientation=horizontal] *){margin-block-start:0;margin-inline-start:var(--cngx-timeline-rail-inset, 6px)}:scope[data-position=last]:is([data-orientation=horizontal] *){margin-block-end:0;margin-inline-end:var(--cngx-timeline-rail-inset, 6px)}:scope[data-status=done]:is([data-orientation=horizontal] *){border-block-start-color:var(--cngx-timeline-done-color, oklch(.6 .15 145))}:scope[data-status=active]:is([data-orientation=horizontal] *){border-block-start-color:var(--cngx-timeline-active-color, oklch(.66 .19 50))}:scope[data-status=rejected]:is([data-orientation=horizontal] *){border-block-start-color:var(--cngx-timeline-rejected-color, oklch(.6 .18 25))}:scope[data-status=upcoming]:is([data-orientation=horizontal] *){border-block-start-style:dashed;border-block-start-color:var(--cngx-timeline-upcoming-color, oklch(.5 .01 250))}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
284
+ }
285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineConnector, decorators: [{
286
+ type: Component,
287
+ args: [{ selector: 'cngx-timeline-connector', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
288
+ class: 'cngx-timeline-connector',
289
+ 'aria-hidden': 'true',
290
+ '[attr.data-status]': 'status()',
291
+ '[attr.data-position]': 'position()',
292
+ }, template: '', styles: ["@layer cngx.tokens{@property --cngx-timeline-rail-inset{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-timeline-marker-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --cngx-timeline-marker-glyph-size{syntax: \"<percentage>\"; inherits: true; initial-value: 60%;}@property --cngx-timeline-item-inline-size{syntax: \"<length>\"; inherits: true; initial-value: 192px;}@property --cngx-timeline-connector-width{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-timeline-marker-ring-width{syntax: \"<length>\"; inherits: true; initial-value: 3px;}@property --cngx-timeline-connector-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-timeline-surface{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-timeline-marker-fg{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-timeline-meta-size{syntax: \"*\"; inherits: true; initial-value: .8125rem;}@property --cngx-timeline-text-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.2 .01 250);}@property --cngx-timeline-muted-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-timeline-done-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .15 145);}@property --cngx-timeline-active-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-timeline-upcoming-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-timeline-rejected-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .18 25);}@property --cngx-timeline-pulse-duration{syntax: \"<time>\"; inherits: true; initial-value: 1.6s;}}:root{--cngx-timeline-connector-color: var(--cngx-color-border, oklch(.88 .005 250));--cngx-timeline-surface: var(--cngx-color-surface, oklch(1 0 0));--cngx-timeline-text-color: var(--cngx-color-text, oklch(.2 .01 250));--cngx-timeline-muted-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-timeline-done-color: var(--cngx-color-success, oklch(.6 .15 145));--cngx-timeline-active-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-timeline-upcoming-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-timeline-rejected-color: var(--cngx-color-danger, oklch(.6 .18 25))}\n", "@layer cngx.components{@scope(.cngx-timeline-connector){:scope{display:block;inline-size:0;block-size:100%;justify-self:center;border-inline-start:var(--cngx-timeline-connector-width, 2px) solid var(--cngx-timeline-connector-color, oklch(.88 .005 250))}:scope[data-position=first]{margin-block-start:var(--cngx-timeline-rail-inset, 6px)}:scope[data-position=last]{margin-block-end:var(--cngx-timeline-rail-inset, 6px)}:scope[data-position=only]{display:none}:scope[data-status=done]{border-inline-start-color:var(--cngx-timeline-done-color, oklch(.6 .15 145))}:scope[data-status=active]{border-inline-start-color:var(--cngx-timeline-active-color, oklch(.66 .19 50))}:scope[data-status=rejected]{border-inline-start-color:var(--cngx-timeline-rejected-color, oklch(.6 .18 25))}:scope[data-status=upcoming]{border-inline-start-style:dashed;border-inline-start-color:var(--cngx-timeline-upcoming-color, oklch(.5 .01 250))}}}@layer cngx.components{@scope(.cngx-timeline-connector){:scope:is([data-orientation=horizontal] *){inline-size:100%;block-size:0;justify-self:stretch;align-self:center;border-inline-start:none;border-block-start:var(--cngx-timeline-connector-width, 2px) solid var(--cngx-timeline-connector-color, oklch(.88 .005 250))}:scope[data-position=first]:is([data-orientation=horizontal] *){margin-block-start:0;margin-inline-start:var(--cngx-timeline-rail-inset, 6px)}:scope[data-position=last]:is([data-orientation=horizontal] *){margin-block-end:0;margin-inline-end:var(--cngx-timeline-rail-inset, 6px)}:scope[data-status=done]:is([data-orientation=horizontal] *){border-block-start-color:var(--cngx-timeline-done-color, oklch(.6 .15 145))}:scope[data-status=active]:is([data-orientation=horizontal] *){border-block-start-color:var(--cngx-timeline-active-color, oklch(.66 .19 50))}:scope[data-status=rejected]:is([data-orientation=horizontal] *){border-block-start-color:var(--cngx-timeline-rejected-color, oklch(.6 .18 25))}:scope[data-status=upcoming]:is([data-orientation=horizontal] *){border-block-start-style:dashed;border-block-start-color:var(--cngx-timeline-upcoming-color, oklch(.5 .01 250))}}}\n"] }]
293
+ }], propDecorators: { status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }] } });
294
+
295
+ /**
296
+ * DI token for {@link CngxTimelineMarkerHost}. Provided by `<cngx-timeline>`;
297
+ * injected optionally by `CngxTimelineItem`, which falls back to its own
298
+ * `[cngxTimelineMarkerContent]` projection when no timeline is above it.
299
+ *
300
+ * A token rather than an injected parent class: the row must stay usable
301
+ * standalone, and a concrete parent type would make the two mutually
302
+ * dependent and block the decompose schematic.
303
+ *
304
+ * @category common/timeline
305
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/marker-host.token.ts
306
+ * @relatedTo CngxTimelineMarkerTpl, CngxTimelineItem
307
+ * @since 0.1.0
308
+ */
309
+ const CNGX_TIMELINE_MARKER_HOST = new InjectionToken('CngxTimelineMarkerHost');
310
+
311
+ const TIMELINE_CONFIG_DEFAULTS = {
312
+ labels: {
313
+ timelineRegion: 'Timeline',
314
+ retry: 'Retry',
315
+ errorFallback: 'Could not load the timeline.',
316
+ emptyFallback: 'No events yet.',
317
+ loading: 'Loading timeline',
318
+ refreshing: 'Updating…',
319
+ itemBusy: 'Updating',
320
+ itemErrorFallback: 'Could not load this event.',
321
+ status: {
322
+ done: 'Completed',
323
+ active: 'In progress',
324
+ upcoming: 'Upcoming',
325
+ rejected: 'Rejected',
326
+ },
327
+ groupLabel: (group) => group.start.toLocaleDateString(),
328
+ },
329
+ templates: {},
330
+ };
331
+ /**
332
+ * DI token for the resolved timeline config. \
333
+ * `providedIn: 'root'` with the library defaults; override via
334
+ * {@link provideTimelineConfig} (root) or {@link provideTimelineConfigAt}
335
+ * (component scope).
336
+ *
337
+ * @category common/timeline
338
+ * @wcag AA
339
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/timeline-config.ts
340
+ * @relatedTo provideTimelineConfig
341
+ * @relatedTo withTimelineLabels
342
+ * @since 0.1.0
343
+ */
344
+ const CNGX_TIMELINE_CONFIG = new InjectionToken('CngxTimelineConfig', {
345
+ providedIn: 'root',
346
+ factory: () => TIMELINE_CONFIG_DEFAULTS,
347
+ });
348
+ /**
349
+ * Merge label overrides into the cascade. Keys left out keep their
350
+ * English library default, so a consumer translates what they need and
351
+ * nothing more.
352
+ *
353
+ * ```ts
354
+ * provideTimelineConfig(
355
+ * withTimelineLabels({
356
+ * retry: 'Erneut versuchen',
357
+ * emptyFallback: 'Noch keine Ereignisse.',
358
+ * groupLabel: (group) => group.start.toLocaleDateString('de-AT'),
359
+ * }),
360
+ * )
361
+ * ```
362
+ *
363
+ * @category common/timeline
364
+ */
365
+ function withTimelineLabels(labels) {
366
+ return (config) => ({
367
+ ...config,
368
+ labels: {
369
+ ...config.labels,
370
+ ...labels,
371
+ // One level deeper than the rest: `status` is a map, and a shallow
372
+ // spread would let a consumer who renames one status silently
373
+ // silence the other three.
374
+ status: { ...config.labels?.status, ...labels.status },
375
+ },
376
+ });
377
+ }
378
+ /**
379
+ * Merge app-wide slot template defaults into the cascade. Keys left out
380
+ * keep whatever an earlier feature set, and a per-instance slot directive
381
+ * still wins over anything set here.
382
+ *
383
+ * One bag rather than a `with*Template` builder per slot, matching how the
384
+ * select family carries its own slot defaults - the timeline has eight
385
+ * slots and near-identical builders would only add surface.
386
+ *
387
+ * ```ts
388
+ * readonly emptyTpl = viewChild.required<TemplateRef<CngxTimelineEmptyContext>>('emptyTpl', {
389
+ * read: TemplateRef,
390
+ * });
391
+ *
392
+ * providers: [provideTimelineConfig(withTimelineTemplates({ empty: this.emptyTpl() }))]
393
+ * ```
394
+ *
395
+ * @category common/timeline
396
+ */
397
+ function withTimelineTemplates(templates) {
398
+ return (config) => ({ ...config, templates: { ...config.templates, ...templates } });
399
+ }
400
+ function applyFeatures(base, features) {
401
+ return features.reduce((config, feature) => feature(config), base);
402
+ }
403
+ /**
404
+ * Root-level provider. Apply once in `bootstrapApplication` /
405
+ * `appConfig.providers`.
406
+ *
407
+ * @category common/timeline
408
+ */
409
+ function provideTimelineConfig(...features) {
410
+ return makeEnvironmentProviders([
411
+ {
412
+ provide: CNGX_TIMELINE_CONFIG,
413
+ useValue: applyFeatures(TIMELINE_CONFIG_DEFAULTS, features),
414
+ },
415
+ ]);
416
+ }
417
+ /**
418
+ * Component-scoped override. Returns `Provider[]` rather than
419
+ * {@link EnvironmentProviders} because `viewProviders` rejects opaque
420
+ * environment providers.
421
+ *
422
+ * Features merge onto the parent config - an enclosing scope, or the root
423
+ * provider, or the library defaults when neither is present - so a region
424
+ * can re-phrase one label without resetting every other one the app set.
425
+ *
426
+ * ```ts
427
+ * @Component({
428
+ * viewProviders: [...provideTimelineConfigAt(withTimelineLabels({ retry: 'Again' }))],
429
+ * })
430
+ * ```
431
+ *
432
+ * @category common/timeline
433
+ */
434
+ function provideTimelineConfigAt(...features) {
435
+ return [
436
+ {
437
+ provide: CNGX_TIMELINE_CONFIG,
438
+ useFactory: (parent) => applyFeatures(parent ?? TIMELINE_CONFIG_DEFAULTS, features),
439
+ deps: [[new SkipSelf(), new Optional(), CNGX_TIMELINE_CONFIG]],
440
+ },
441
+ ];
442
+ }
443
+ /**
444
+ * Read the resolved timeline config. Runs in an injection context.
445
+ *
446
+ * @category common/timeline
447
+ */
448
+ function injectTimelineConfig() {
449
+ return inject(CNGX_TIMELINE_CONFIG);
450
+ }
451
+
452
+ /**
453
+ * Marks the element that holds an item's timestamp, so the item can place
454
+ * it in the raster the active mode calls for - above the body in
455
+ * `narrative`, trailing it in `activity`.
456
+ *
457
+ * Pair it with `<cngx-time>` from `@cngx/common/display` for relative
458
+ * formatting; the timeline neither formats nor ticks.
459
+ *
460
+ * @category common/timeline
461
+ */
462
+ class CngxTimelineTime {
463
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineTime, deps: [], target: i0.ɵɵFactoryTarget.Directive });
464
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxTimelineTime, isStandalone: true, selector: "[cngxTimelineTime]", host: { classAttribute: "cngx-timeline-item__time" }, ngImport: i0 });
465
+ }
466
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineTime, decorators: [{
467
+ type: Directive,
468
+ args: [{
469
+ selector: '[cngxTimelineTime]',
470
+ standalone: true,
471
+ host: { class: 'cngx-timeline-item__time' },
472
+ }]
473
+ }] });
474
+ /**
475
+ * Marks content that belongs on the far side of the rail from the row's
476
+ * body - the year label opposite a card, the timestamp across a centred
477
+ * rail.
478
+ *
479
+ * Per-row content, so it is a projection slot rather than a timeline-wide
480
+ * template: the row template already owns it, and the config cascade is
481
+ * for surfaces the whole timeline shares.
482
+ *
483
+ * The extra grid track only exists for rows that actually project into it
484
+ * (`:has(> [cngxTimelineOpposite])`), so markup that predates this slot
485
+ * keeps its raster to the pixel. Placement follows the row: opposite content
486
+ * sits across the rail from the body under `start`, `end` and `alternate`
487
+ * alike.
488
+ *
489
+ * ```html
490
+ * <cngx-timeline-item status="done">
491
+ * <span cngxTimelineOpposite>2019</span>
492
+ * <p>Founded</p>
493
+ * </cngx-timeline-item>
494
+ * ```
495
+ *
496
+ * **Keep the content non-interactive.** The slot projects ahead of the body,
497
+ * so it is read first in every layout. For a year or a short label that is
498
+ * the right reading order whichever side the rail is on. A link or a button
499
+ * would take focus before the row it belongs to, and no placement of the
500
+ * grid can fix that, because the paint follows `[data-row-side]` while the
501
+ * DOM order does not.
502
+ *
503
+ * @category common/timeline
504
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/timeline-item.component.ts
505
+ * @relatedTo CngxTimelineItem, CngxTimelineTime
506
+ * @since 0.1.0
507
+ */
508
+ class CngxTimelineOpposite {
509
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineOpposite, deps: [], target: i0.ɵɵFactoryTarget.Directive });
510
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxTimelineOpposite, isStandalone: true, selector: "[cngxTimelineOpposite]", host: { classAttribute: "cngx-timeline-item__opposite" }, ngImport: i0 });
511
+ }
512
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineOpposite, decorators: [{
513
+ type: Directive,
514
+ args: [{
515
+ selector: '[cngxTimelineOpposite]',
516
+ standalone: true,
517
+ host: { class: 'cngx-timeline-item__opposite' },
518
+ }]
519
+ }] });
520
+ /**
521
+ * Marks content to render inside this row's marker dot - a glyph, an icon,
522
+ * an avatar.
523
+ *
524
+ * The per-row counterpart to the timeline-wide `*cngxTimelineMarkerTpl`, and
525
+ * the only route when the row stands on its own. It also *wins* over that
526
+ * template when both are present: most-local-wins, the same direction as
527
+ * every other slot in the family, so one row can carry a different glyph
528
+ * without the timeline's default being torn out for the rest.
529
+ *
530
+ * Whatever renders here is inside an `aria-hidden` element - decoration only.
531
+ *
532
+ * @category common/timeline
533
+ */
534
+ class CngxTimelineMarkerContent {
535
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineMarkerContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
536
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxTimelineMarkerContent, isStandalone: true, selector: "[cngxTimelineMarkerContent]", ngImport: i0 });
537
+ }
538
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineMarkerContent, decorators: [{
539
+ type: Directive,
540
+ args: [{
541
+ selector: '[cngxTimelineMarkerContent]',
542
+ standalone: true,
543
+ }]
544
+ }] });
545
+ /**
546
+ * Marks the element that holds an item's body. Optional - anything
547
+ * projected without a slot directive lands in the body too. Reach for it
548
+ * when the item also projects a timestamp and the source order would
549
+ * otherwise be ambiguous.
550
+ *
551
+ * @category common/timeline
552
+ */
553
+ class CngxTimelineContent {
554
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
555
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxTimelineContent, isStandalone: true, selector: "[cngxTimelineContent]", host: { classAttribute: "cngx-timeline-item__content" }, ngImport: i0 });
556
+ }
557
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineContent, decorators: [{
558
+ type: Directive,
559
+ args: [{
560
+ selector: '[cngxTimelineContent]',
561
+ standalone: true,
562
+ host: { class: 'cngx-timeline-item__content' },
563
+ }]
564
+ }] });
565
+ /**
566
+ * @internal Enough of the tabbable surface to catch the mistake this warns
567
+ * about. Not a general focus-order utility - `[tabindex]` matches a negative
568
+ * value too, which is deliberately over-eager for a dev-only check.
569
+ */
570
+ const FOCUSABLE = 'a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]';
571
+ /**
572
+ * One event on the timeline: a marker, the rail segment below it, an
573
+ * optional timestamp, and the projected body.
574
+ *
575
+ * A terminal composable unit, not a fragment of the organism. It ships
576
+ * its own token SET rules and defaults to the `narrative` raster, so
577
+ * dropping one into a hand-rolled layout renders a complete, density-
578
+ * correct item with no `<cngx-timeline>` above it. Inside the organism it
579
+ * inherits `[data-mode]` and re-rasters itself.
580
+ *
581
+ * **Two independent state channels.** `status` is where the event sits in
582
+ * a history (`done` / `active` / `upcoming` / `rejected`) - editorial, set
583
+ * by the consumer. `state` is whether *this row's own* data is currently
584
+ * loading or failed. They compose: a `done` item whose `state` errored
585
+ * paints as rejected and announces the failure, without losing the
586
+ * editorial status once the retry succeeds.
587
+ *
588
+ * **What it announces.** The marker and rail are `aria-hidden`, so colour is
589
+ * never the only channel - the status reaches assistive tech through a
590
+ * screen-reader-only line fed from `CNGX_TIMELINE_CONFIG.labels.status`, and
591
+ * a failed row through a visible inline error. Both are read as the row's own
592
+ * content, in DOM order, rather than through `aria-describedby`: the host is
593
+ * a plain element with no role, so a description pointed at its own
594
+ * descendants would resolve nowhere and duplicate the text for anyone
595
+ * browsing it. Neither element is rendered while it has nothing to say.
596
+ *
597
+ * ### Standalone
598
+ * ```html
599
+ * <cngx-timeline-item status="done">
600
+ * <cngx-time cngxTimelineTime [date]="event.at" />
601
+ * <p>Deployment finished</p>
602
+ * </cngx-timeline-item>
603
+ * ```
604
+ *
605
+ * ### With its own async state
606
+ * ```html
607
+ * <cngx-timeline-item [state]="rowState" position="last">
608
+ * <p>{{ rowState.data()?.summary }}</p>
609
+ * </cngx-timeline-item>
610
+ * ```
611
+ *
612
+ * @category common/timeline
613
+ * @docsKind primary
614
+ * @wcag AA
615
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/timeline-item.component.ts
616
+ * @relatedTo CngxTimelineMarker, CngxTimelineConnector, CNGX_TIMELINE_CONFIG
617
+ * <example-url>http://localhost:4200/#/ui/timeline/basics/standalone-atoms</example-url>
618
+ * <example-url>http://localhost:4200/#/ui/timeline/basics/custom-date-header-and-marker</example-url>
619
+ * <example-url>http://localhost:4200/#/ui/timeline/basics/marker-precedence</example-url>
620
+ * <example-url>http://localhost:4200/#/ui/timeline/layout/media-markers</example-url>
621
+ * <example-url>http://localhost:4200/#/ui/timeline/layout/placement-end</example-url>
622
+ * @since 0.1.0
623
+ */
624
+ class CngxTimelineItem {
625
+ config = injectTimelineConfig();
626
+ host = inject(ElementRef);
627
+ /**
628
+ * Where the event sits in the history. Drives the marker and rail
629
+ * colours and the screen-reader status line. Purely editorial - it
630
+ * carries no flow logic, because a timeline is a record and a guided
631
+ * process is a stepper.
632
+ */
633
+ status = input(undefined, ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
634
+ /**
635
+ * This row's own async state, for a body that loads, mutates or fails
636
+ * independently of the list around it.
637
+ *
638
+ * Optional by construction and tolerant of a bare `state` attribute
639
+ * (the empty string coerces to `undefined`), so the item never forces a
640
+ * binding a consumer may not have.
641
+ */
642
+ state = input(undefined, { ...(ngDevMode ? { debugName: "state" } : /* istanbul ignore next */ {}), transform: (value) => (typeof value === 'string' ? undefined : value) });
643
+ /**
644
+ * Position in the run, forwarded to the rail. `'last'` and `'only'`
645
+ * stop the rail at this item so the timeline does not trail off into
646
+ * empty space. The organism sets it; standalone items default to
647
+ * `'middle'`.
648
+ */
649
+ position = input('middle', ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
650
+ /**
651
+ * The event this row stands for. Only ever read as the `$implicit` of an
652
+ * app-wide `*cngxTimelineMarkerTpl`, so bind it when the app sets one and
653
+ * that template needs the payload; leave it off otherwise.
654
+ */
655
+ item = input(undefined, ...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
656
+ /**
657
+ * @internal The timeline-wide marker template, when a `<cngx-timeline>` is
658
+ * above this row. Absent standalone.
659
+ */
660
+ hostMarkerTpl = inject(CNGX_TIMELINE_MARKER_HOST, { optional: true })?.markerTpl ?? (() => null);
661
+ /** @internal Set when this row projects its own marker content. */
662
+ ownMarker = contentChild(CngxTimelineMarkerContent, ...(ngDevMode ? [{ debugName: "ownMarker" }] : /* istanbul ignore next */ []));
663
+ /**
664
+ * @internal The timeline-wide template is the *default*, so a row that
665
+ * projects its own marker content overrides it - most-local-wins, the
666
+ * same direction as every other slot in the family. Resolving to `null`
667
+ * rather than branching on `<ng-content>` keeps the projection static:
668
+ * content lands in the DOM once and renders whatever it was given.
669
+ */
670
+ markerTpl = computed(() => (this.ownMarker() ? null : this.hostMarkerTpl()), ...(ngDevMode ? [{ debugName: "markerTpl" }] : /* istanbul ignore next */ []));
671
+ /** @internal Work in flight on this row's own state. */
672
+ busy = computed(() => {
673
+ const status = this.state()?.status();
674
+ return status === 'loading' || status === 'pending';
675
+ }, ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
676
+ /** @internal This row's own state failed. */
677
+ failed = computed(() => this.state()?.status() === 'error', ...(ngDevMode ? [{ debugName: "failed" }] : /* istanbul ignore next */ []));
678
+ /** @internal `aria-busy` reflects the row's own work, not the list's. */
679
+ ariaBusy = computed(() => (this.busy() ? 'true' : null), ...(ngDevMode ? [{ debugName: "ariaBusy" }] : /* istanbul ignore next */ []));
680
+ /**
681
+ * @internal A failed row paints as rejected regardless of its editorial
682
+ * status - a failure is the more urgent fact, and `status` is left
683
+ * untouched so the row returns to its own colour once a retry lands.
684
+ */
685
+ markerStatus = computed(() => this.failed() ? 'rejected' : this.status(), ...(ngDevMode ? [{ debugName: "markerStatus" }] : /* istanbul ignore next */ []));
686
+ /**
687
+ * @internal Busy outranks everything: a row still loading has nothing
688
+ * settled to report. Otherwise this reads `markerStatus`, not `status`,
689
+ * so the announcement can never contradict the paint - a failed row
690
+ * announces the `rejected` it shows, not the editorial status it kept.
691
+ */
692
+ statusText = computed(() => {
693
+ const labels = this.config.labels;
694
+ if (this.busy()) {
695
+ return labels?.itemBusy ?? '';
696
+ }
697
+ const status = this.markerStatus();
698
+ return status ? (labels?.status?.[status] ?? '') : '';
699
+ }, ...(ngDevMode ? [{ debugName: "statusText" }] : /* istanbul ignore next */ []));
700
+ /** @internal Visible inline error, blank unless this row failed. */
701
+ errorText = computed(() => this.failed() ? (this.config.labels?.itemErrorFallback ?? '') : '', ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
702
+ constructor() {
703
+ if (isDevMode()) {
704
+ // afterNextRender, not an effect: this is a one-shot authoring check
705
+ // on projected content, and the reactive graph has no business
706
+ // carrying it. Runs once per row, after its content exists.
707
+ afterNextRender(() => {
708
+ const opposite = this.host.nativeElement.querySelector(':scope > [cngxTimelineOpposite]');
709
+ if (opposite?.querySelector(FOCUSABLE)) {
710
+ console.warn('[cngx-timeline-item] focusable content inside [cngxTimelineOpposite]. ' +
711
+ 'The slot projects ahead of the row body, so under placement="end" or ' +
712
+ '"alternate" it takes focus before the row it belongs to while painting ' +
713
+ 'on the far side of the rail. Keep opposite content non-interactive and ' +
714
+ 'put controls in the body.', this.host.nativeElement);
715
+ }
716
+ });
717
+ }
718
+ }
719
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
720
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxTimelineItem, isStandalone: true, selector: "cngx-timeline-item", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-status": "status()", "attr.data-failed": "failed() ? \"\" : null", "attr.aria-busy": "ariaBusy()" }, classAttribute: "cngx-timeline-item" }, queries: [{ propertyName: "ownMarker", first: true, predicate: CngxTimelineMarkerContent, descendants: true, isSignal: true }], ngImport: i0, template: `
721
+ <cngx-timeline-marker [status]="markerStatus()" [busy]="busy()">
722
+ @if (markerTpl(); as tpl) {
723
+ <ng-container
724
+ *ngTemplateOutlet="tpl; context: { $implicit: item(), status: markerStatus() }"
725
+ />
726
+ } @else {
727
+ <ng-content select="[cngxTimelineMarkerContent]" />
728
+ }
729
+ </cngx-timeline-marker>
730
+ <cngx-timeline-connector [status]="markerStatus()" [position]="position()" />
731
+ <ng-content select="[cngxTimelineOpposite]" />
732
+ <ng-content select="[cngxTimelineTime]" />
733
+ <div class="cngx-timeline-item__body">
734
+ <ng-content select="[cngxTimelineContent]" />
735
+ <ng-content />
736
+ @if (errorText(); as text) {
737
+ <p class="cngx-timeline-item__error">{{ text }}</p>
738
+ }
739
+ </div>
740
+ @if (statusText(); as text) {
741
+ <span class="cngx-timeline-item__sr">{{ text }}</span>
742
+ }
743
+ `, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-timeline-rail-inset{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-timeline-marker-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --cngx-timeline-marker-glyph-size{syntax: \"<percentage>\"; inherits: true; initial-value: 60%;}@property --cngx-timeline-item-inline-size{syntax: \"<length>\"; inherits: true; initial-value: 192px;}@property --cngx-timeline-connector-width{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-timeline-marker-ring-width{syntax: \"<length>\"; inherits: true; initial-value: 3px;}@property --cngx-timeline-connector-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-timeline-surface{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-timeline-marker-fg{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-timeline-meta-size{syntax: \"*\"; inherits: true; initial-value: .8125rem;}@property --cngx-timeline-text-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.2 .01 250);}@property --cngx-timeline-muted-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-timeline-done-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .15 145);}@property --cngx-timeline-active-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-timeline-upcoming-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-timeline-rejected-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .18 25);}@property --cngx-timeline-pulse-duration{syntax: \"<time>\"; inherits: true; initial-value: 1.6s;}}:root{--cngx-timeline-connector-color: var(--cngx-color-border, oklch(.88 .005 250));--cngx-timeline-surface: var(--cngx-color-surface, oklch(1 0 0));--cngx-timeline-text-color: var(--cngx-color-text, oklch(.2 .01 250));--cngx-timeline-muted-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-timeline-done-color: var(--cngx-color-success, oklch(.6 .15 145));--cngx-timeline-active-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-timeline-upcoming-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-timeline-rejected-color: var(--cngx-color-danger, oklch(.6 .18 25))}\n", "@layer cngx.tokens{@property --cngx-timeline-gap{syntax: \"<length>\"; inherits: true; initial-value: 8px;}@property --cngx-timeline-row-gap{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --cngx-timeline-content-padding{syntax: \"<length>\"; inherits: true; initial-value: 4px;}}@layer cngx.components{@scope(.cngx-timeline-item){:scope{--cngx-timeline-gap: var(--cngx-space-sm, 8px);--cngx-timeline-row-gap: var(--cngx-space-xs, 4px);--cngx-timeline-content-padding: var(--cngx-space-xs, 4px);--cngx-timeline-rail-inset: calc(var(--cngx-timeline-marker-size, 12px) / 2);display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);grid-template-areas:\"marker time\" \"rail body\";column-gap:var(--cngx-timeline-gap, 8px);row-gap:var(--cngx-timeline-row-gap, 4px);color:var(--cngx-timeline-text-color, oklch(.2 .01 250))}.cngx-timeline-marker{grid-area:marker}.cngx-timeline-connector{grid-area:rail}.cngx-timeline-item__time{grid-area:time;color:var(--cngx-timeline-muted-color, oklch(.5 .01 250));font-size:var(--cngx-timeline-meta-size, .8125rem);line-height:1.4}.cngx-timeline-item__opposite{grid-area:opposite;align-self:start;color:var(--cngx-timeline-muted-color, oklch(.5 .01 250));font-size:var(--cngx-timeline-meta-size, .8125rem);line-height:1.4;text-align:end}.cngx-timeline-item__body{grid-area:body;padding:var(--cngx-timeline-content-padding, 4px);padding-block-end:var(--cngx-timeline-row-gap, 4px);min-inline-size:0}.cngx-timeline-item__error{margin:0;color:var(--cngx-timeline-rejected-color, oklch(.6 .18 25));font-size:var(--cngx-timeline-meta-size, .8125rem);line-height:1.4}.cngx-timeline-item__sr{position:absolute;inline-size:1px;block-size:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:scope[data-failed] .cngx-timeline-item__time{color:var(--cngx-timeline-rejected-color, oklch(.6 .18 25))}}[data-mode=activity] .cngx-timeline-item:not([data-orientation=horizontal] *){grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:\"marker body time\" \"rail body time\"}[data-mode=activity] .cngx-timeline-item .cngx-timeline-item__time{align-self:start;text-align:end;white-space:nowrap}[data-row-side=end] .cngx-timeline-item:not([data-mode=activity] *):not([data-orientation=horizontal] *){grid-template-columns:minmax(0,1fr) auto;grid-template-areas:\"time marker\" \"body rail\"}[data-row-side=end] .cngx-timeline-item:is([data-mode=activity] *):not([data-orientation=horizontal] *){grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:\"time body marker\" \"time body rail\"}[data-row-side=end] .cngx-timeline-item:not([data-mode=activity] *) .cngx-timeline-item__time{text-align:end}[data-row-side=end] .cngx-timeline-item:is([data-mode=activity] *) .cngx-timeline-item__time{text-align:start}[data-row-side=end] .cngx-timeline-item .cngx-timeline-item__opposite{text-align:start}.cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *):not([data-orientation=horizontal] *){grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);grid-template-areas:\"opposite marker body\" \"time rail body\"}[data-row-side=end] .cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *):not([data-orientation=horizontal] *){grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);grid-template-areas:\"body marker opposite\" \"body rail time\"}@container cngx-timeline (max-inline-size: 32rem){.cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *):not([data-orientation=horizontal] *),[data-row-side=end] .cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *):not([data-orientation=horizontal] *){grid-template-columns:auto minmax(0,1fr);grid-template-areas:\"marker time\" \"rail body\"}.cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *):not([data-orientation=horizontal] *):has(>[cngxTimelineOpposite]),[data-row-side=end] .cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *):not([data-orientation=horizontal] *):has(>[cngxTimelineOpposite]){grid-template-columns:auto auto minmax(0,1fr);grid-template-areas:\"opposite marker body\" \"time rail body\"}[data-row-side=end] .cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *) .cngx-timeline-item__time{text-align:start}[data-row-side=end] .cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *) .cngx-timeline-item__opposite{text-align:end}}.cngx-timeline-item:not([data-placement=alternate] *):not([data-orientation=horizontal] *):has(>[cngxTimelineOpposite]){grid-template-columns:auto auto minmax(0,1fr);grid-template-areas:\"opposite marker time\" \"opposite rail body\"}.cngx-timeline-item:is([data-mode=activity] *):not([data-placement=alternate] *):not([data-orientation=horizontal] *):has(>[cngxTimelineOpposite]){grid-template-columns:auto auto minmax(0,1fr) auto;grid-template-areas:\"opposite marker body time\" \"opposite rail body time\"}[data-row-side=end] .cngx-timeline-item:not([data-mode=activity] *):not([data-placement=alternate] *):not([data-orientation=horizontal] *):has(>[cngxTimelineOpposite]){grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:\"time marker opposite\" \"body rail opposite\"}[data-row-side=end] .cngx-timeline-item:is([data-mode=activity] *):not([data-placement=alternate] *):not([data-orientation=horizontal] *):has(>[cngxTimelineOpposite]){grid-template-columns:auto minmax(0,1fr) auto auto;grid-template-areas:\"time body marker opposite\" \"time body rail opposite\"}[data-rail=continuous] .cngx-timeline-item .cngx-timeline-connector:not([data-position=last]):not([data-position=only]):not([data-orientation=horizontal] *){block-size:calc(100% + var(--cngx-timeline-item-gap, 16px))}[data-rail=continuous] .cngx-timeline-item .cngx-timeline-connector:not([data-position=last]):not([data-position=only]):is([data-orientation=horizontal] *){inline-size:calc(100% + var(--cngx-timeline-item-gap, 16px))}.cngx-timeline-item:is([data-orientation=horizontal] *){flex:none;inline-size:var(--cngx-timeline-item-inline-size, 12rem);grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr);grid-template-areas:\"marker rail\" \"time time\" \"body body\"}.cngx-timeline-item:is([data-orientation=horizontal] *) .cngx-timeline-item__time{text-align:start;white-space:normal}.cngx-timeline-item:is([data-orientation=horizontal] *) .cngx-timeline-item__opposite{text-align:start}[data-row-side=end] .cngx-timeline-item:is([data-orientation=horizontal] *){grid-template-rows:minmax(0,1fr) auto auto;grid-template-areas:\"body body\" \"time time\" \"marker rail\"}.cngx-timeline-item:is([data-orientation=horizontal] *):is([data-placement=alternate] *){grid-template-rows:minmax(0,1fr) auto minmax(0,1fr);grid-template-areas:\"opposite time\" \"marker rail\" \"body body\"}[data-row-side=end] .cngx-timeline-item:is([data-orientation=horizontal] *):is([data-placement=alternate] *){grid-template-rows:minmax(0,1fr) auto minmax(0,1fr);grid-template-areas:\"body body\" \"marker rail\" \"opposite time\"}.cngx-timeline-item:is([data-orientation=horizontal] *):not([data-placement=alternate] *):has(>[cngxTimelineOpposite]){grid-template-rows:auto auto auto minmax(0,1fr);grid-template-areas:\"opposite opposite\" \"marker rail\" \"time time\" \"body body\"}[data-row-side=end] .cngx-timeline-item:is([data-orientation=horizontal] *):not([data-placement=alternate] *):has(>[cngxTimelineOpposite]){grid-template-rows:minmax(0,1fr) auto auto auto;grid-template-areas:\"body body\" \"time time\" \"marker rail\" \"opposite opposite\"}}\n"], dependencies: [{ kind: "component", type: CngxTimelineMarker, selector: "cngx-timeline-marker", inputs: ["status", "busy"] }, { kind: "component", type: CngxTimelineConnector, selector: "cngx-timeline-connector", inputs: ["status", "position"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
744
+ }
745
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineItem, decorators: [{
746
+ type: Component,
747
+ args: [{ selector: 'cngx-timeline-item', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CngxTimelineMarker, CngxTimelineConnector, NgTemplateOutlet], host: {
748
+ class: 'cngx-timeline-item',
749
+ '[attr.data-status]': 'status()',
750
+ '[attr.data-failed]': 'failed() ? "" : null',
751
+ '[attr.aria-busy]': 'ariaBusy()',
752
+ }, template: `
753
+ <cngx-timeline-marker [status]="markerStatus()" [busy]="busy()">
754
+ @if (markerTpl(); as tpl) {
755
+ <ng-container
756
+ *ngTemplateOutlet="tpl; context: { $implicit: item(), status: markerStatus() }"
757
+ />
758
+ } @else {
759
+ <ng-content select="[cngxTimelineMarkerContent]" />
760
+ }
761
+ </cngx-timeline-marker>
762
+ <cngx-timeline-connector [status]="markerStatus()" [position]="position()" />
763
+ <ng-content select="[cngxTimelineOpposite]" />
764
+ <ng-content select="[cngxTimelineTime]" />
765
+ <div class="cngx-timeline-item__body">
766
+ <ng-content select="[cngxTimelineContent]" />
767
+ <ng-content />
768
+ @if (errorText(); as text) {
769
+ <p class="cngx-timeline-item__error">{{ text }}</p>
770
+ }
771
+ </div>
772
+ @if (statusText(); as text) {
773
+ <span class="cngx-timeline-item__sr">{{ text }}</span>
774
+ }
775
+ `, styles: ["@layer cngx.tokens{@property --cngx-timeline-rail-inset{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-timeline-marker-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --cngx-timeline-marker-glyph-size{syntax: \"<percentage>\"; inherits: true; initial-value: 60%;}@property --cngx-timeline-item-inline-size{syntax: \"<length>\"; inherits: true; initial-value: 192px;}@property --cngx-timeline-connector-width{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-timeline-marker-ring-width{syntax: \"<length>\"; inherits: true; initial-value: 3px;}@property --cngx-timeline-connector-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-timeline-surface{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-timeline-marker-fg{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-timeline-meta-size{syntax: \"*\"; inherits: true; initial-value: .8125rem;}@property --cngx-timeline-text-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.2 .01 250);}@property --cngx-timeline-muted-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-timeline-done-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .15 145);}@property --cngx-timeline-active-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-timeline-upcoming-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-timeline-rejected-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .18 25);}@property --cngx-timeline-pulse-duration{syntax: \"<time>\"; inherits: true; initial-value: 1.6s;}}:root{--cngx-timeline-connector-color: var(--cngx-color-border, oklch(.88 .005 250));--cngx-timeline-surface: var(--cngx-color-surface, oklch(1 0 0));--cngx-timeline-text-color: var(--cngx-color-text, oklch(.2 .01 250));--cngx-timeline-muted-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-timeline-done-color: var(--cngx-color-success, oklch(.6 .15 145));--cngx-timeline-active-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-timeline-upcoming-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-timeline-rejected-color: var(--cngx-color-danger, oklch(.6 .18 25))}\n", "@layer cngx.tokens{@property --cngx-timeline-gap{syntax: \"<length>\"; inherits: true; initial-value: 8px;}@property --cngx-timeline-row-gap{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --cngx-timeline-content-padding{syntax: \"<length>\"; inherits: true; initial-value: 4px;}}@layer cngx.components{@scope(.cngx-timeline-item){:scope{--cngx-timeline-gap: var(--cngx-space-sm, 8px);--cngx-timeline-row-gap: var(--cngx-space-xs, 4px);--cngx-timeline-content-padding: var(--cngx-space-xs, 4px);--cngx-timeline-rail-inset: calc(var(--cngx-timeline-marker-size, 12px) / 2);display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);grid-template-areas:\"marker time\" \"rail body\";column-gap:var(--cngx-timeline-gap, 8px);row-gap:var(--cngx-timeline-row-gap, 4px);color:var(--cngx-timeline-text-color, oklch(.2 .01 250))}.cngx-timeline-marker{grid-area:marker}.cngx-timeline-connector{grid-area:rail}.cngx-timeline-item__time{grid-area:time;color:var(--cngx-timeline-muted-color, oklch(.5 .01 250));font-size:var(--cngx-timeline-meta-size, .8125rem);line-height:1.4}.cngx-timeline-item__opposite{grid-area:opposite;align-self:start;color:var(--cngx-timeline-muted-color, oklch(.5 .01 250));font-size:var(--cngx-timeline-meta-size, .8125rem);line-height:1.4;text-align:end}.cngx-timeline-item__body{grid-area:body;padding:var(--cngx-timeline-content-padding, 4px);padding-block-end:var(--cngx-timeline-row-gap, 4px);min-inline-size:0}.cngx-timeline-item__error{margin:0;color:var(--cngx-timeline-rejected-color, oklch(.6 .18 25));font-size:var(--cngx-timeline-meta-size, .8125rem);line-height:1.4}.cngx-timeline-item__sr{position:absolute;inline-size:1px;block-size:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:scope[data-failed] .cngx-timeline-item__time{color:var(--cngx-timeline-rejected-color, oklch(.6 .18 25))}}[data-mode=activity] .cngx-timeline-item:not([data-orientation=horizontal] *){grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:\"marker body time\" \"rail body time\"}[data-mode=activity] .cngx-timeline-item .cngx-timeline-item__time{align-self:start;text-align:end;white-space:nowrap}[data-row-side=end] .cngx-timeline-item:not([data-mode=activity] *):not([data-orientation=horizontal] *){grid-template-columns:minmax(0,1fr) auto;grid-template-areas:\"time marker\" \"body rail\"}[data-row-side=end] .cngx-timeline-item:is([data-mode=activity] *):not([data-orientation=horizontal] *){grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:\"time body marker\" \"time body rail\"}[data-row-side=end] .cngx-timeline-item:not([data-mode=activity] *) .cngx-timeline-item__time{text-align:end}[data-row-side=end] .cngx-timeline-item:is([data-mode=activity] *) .cngx-timeline-item__time{text-align:start}[data-row-side=end] .cngx-timeline-item .cngx-timeline-item__opposite{text-align:start}.cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *):not([data-orientation=horizontal] *){grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);grid-template-areas:\"opposite marker body\" \"time rail body\"}[data-row-side=end] .cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *):not([data-orientation=horizontal] *){grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);grid-template-areas:\"body marker opposite\" \"body rail time\"}@container cngx-timeline (max-inline-size: 32rem){.cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *):not([data-orientation=horizontal] *),[data-row-side=end] .cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *):not([data-orientation=horizontal] *){grid-template-columns:auto minmax(0,1fr);grid-template-areas:\"marker time\" \"rail body\"}.cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *):not([data-orientation=horizontal] *):has(>[cngxTimelineOpposite]),[data-row-side=end] .cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *):not([data-orientation=horizontal] *):has(>[cngxTimelineOpposite]){grid-template-columns:auto auto minmax(0,1fr);grid-template-areas:\"opposite marker body\" \"time rail body\"}[data-row-side=end] .cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *) .cngx-timeline-item__time{text-align:start}[data-row-side=end] .cngx-timeline-item:is([data-placement=alternate] *):not([data-mode=activity] *) .cngx-timeline-item__opposite{text-align:end}}.cngx-timeline-item:not([data-placement=alternate] *):not([data-orientation=horizontal] *):has(>[cngxTimelineOpposite]){grid-template-columns:auto auto minmax(0,1fr);grid-template-areas:\"opposite marker time\" \"opposite rail body\"}.cngx-timeline-item:is([data-mode=activity] *):not([data-placement=alternate] *):not([data-orientation=horizontal] *):has(>[cngxTimelineOpposite]){grid-template-columns:auto auto minmax(0,1fr) auto;grid-template-areas:\"opposite marker body time\" \"opposite rail body time\"}[data-row-side=end] .cngx-timeline-item:not([data-mode=activity] *):not([data-placement=alternate] *):not([data-orientation=horizontal] *):has(>[cngxTimelineOpposite]){grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:\"time marker opposite\" \"body rail opposite\"}[data-row-side=end] .cngx-timeline-item:is([data-mode=activity] *):not([data-placement=alternate] *):not([data-orientation=horizontal] *):has(>[cngxTimelineOpposite]){grid-template-columns:auto minmax(0,1fr) auto auto;grid-template-areas:\"time body marker opposite\" \"time body rail opposite\"}[data-rail=continuous] .cngx-timeline-item .cngx-timeline-connector:not([data-position=last]):not([data-position=only]):not([data-orientation=horizontal] *){block-size:calc(100% + var(--cngx-timeline-item-gap, 16px))}[data-rail=continuous] .cngx-timeline-item .cngx-timeline-connector:not([data-position=last]):not([data-position=only]):is([data-orientation=horizontal] *){inline-size:calc(100% + var(--cngx-timeline-item-gap, 16px))}.cngx-timeline-item:is([data-orientation=horizontal] *){flex:none;inline-size:var(--cngx-timeline-item-inline-size, 12rem);grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr);grid-template-areas:\"marker rail\" \"time time\" \"body body\"}.cngx-timeline-item:is([data-orientation=horizontal] *) .cngx-timeline-item__time{text-align:start;white-space:normal}.cngx-timeline-item:is([data-orientation=horizontal] *) .cngx-timeline-item__opposite{text-align:start}[data-row-side=end] .cngx-timeline-item:is([data-orientation=horizontal] *){grid-template-rows:minmax(0,1fr) auto auto;grid-template-areas:\"body body\" \"time time\" \"marker rail\"}.cngx-timeline-item:is([data-orientation=horizontal] *):is([data-placement=alternate] *){grid-template-rows:minmax(0,1fr) auto minmax(0,1fr);grid-template-areas:\"opposite time\" \"marker rail\" \"body body\"}[data-row-side=end] .cngx-timeline-item:is([data-orientation=horizontal] *):is([data-placement=alternate] *){grid-template-rows:minmax(0,1fr) auto minmax(0,1fr);grid-template-areas:\"body body\" \"marker rail\" \"opposite time\"}.cngx-timeline-item:is([data-orientation=horizontal] *):not([data-placement=alternate] *):has(>[cngxTimelineOpposite]){grid-template-rows:auto auto auto minmax(0,1fr);grid-template-areas:\"opposite opposite\" \"marker rail\" \"time time\" \"body body\"}[data-row-side=end] .cngx-timeline-item:is([data-orientation=horizontal] *):not([data-placement=alternate] *):has(>[cngxTimelineOpposite]){grid-template-rows:minmax(0,1fr) auto auto auto;grid-template-areas:\"body body\" \"time time\" \"marker rail\" \"opposite opposite\"}}\n"] }]
776
+ }], ctorParameters: () => [], propDecorators: { status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: false }] }], ownMarker: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxTimelineMarkerContent), { isSignal: true }] }] } });
777
+
778
+ /**
779
+ * The row template. The one slot with no built-in fallback: only the
780
+ * consumer knows what an event of theirs looks like.
781
+ *
782
+ * Bind the same array the timeline gets and the `let-` variables come out
783
+ * typed - `[cngxTimelineItem]` exists to pin `T`, nothing more:
784
+ *
785
+ * ```html
786
+ * <cngx-timeline [items]="events()" [dateAccessor]="at">
787
+ * <ng-template [cngxTimelineItem]="events()" let-event let-last="last">
788
+ * <cngx-timeline-item [position]="last ? 'last' : 'middle'">
789
+ * <cngx-time cngxTimelineTime [date]="event.at" />
790
+ * <p>{{ event.summary }}</p>
791
+ * </cngx-timeline-item>
792
+ * </ng-template>
793
+ * </cngx-timeline>
794
+ * ```
795
+ *
796
+ * Named `CngxTimelineItemTpl` so it does not collide with the
797
+ * `CngxTimelineItem` component; the selector stays `cngxTimelineItem`,
798
+ * which is what consumers write.
799
+ *
800
+ * @category common/timeline
801
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
802
+ * @relatedTo CngxTimelineItem, CngxTimelineDateHeader
803
+ * @since 0.1.0
804
+ */
805
+ class CngxTimelineItemTpl {
806
+ /**
807
+ * Type carrier, never read at runtime. Angular cannot infer a structural
808
+ * directive's context generic from a sibling input on the host component,
809
+ * so `T` has to be pinned on the directive itself; binding the same array
810
+ * the timeline renders does that, and `ngTemplateContextGuard` below then
811
+ * types every `let-` variable. This is `NgForOf`'s `ngForOf` mechanism,
812
+ * not a cngx invention.
813
+ *
814
+ * Optional, and tolerant of the bare `cngxTimelineItem` attribute every
815
+ * v1 consumer writes: an unbound attribute binds the empty string, which
816
+ * `strictTemplates` would otherwise reject against an array type. The
817
+ * empty string coerces to `undefined` and `T` falls back to `unknown` -
818
+ * the Bridge-Input shape the library uses wherever an attribute doubles
819
+ * as an opt-in.
820
+ *
821
+ * Nothing enforces that the array bound here is the array bound to
822
+ * `[items]`; a mismatch only mistypes the `let-` variables, which the
823
+ * template type-checker then rejects at the use site.
824
+ */
825
+ cngxTimelineItem = input(undefined, { ...(ngDevMode ? { debugName: "cngxTimelineItem" } : /* istanbul ignore next */ {}), transform: (value) => (typeof value === 'string' ? undefined : value) });
826
+ templateRef = inject(TemplateRef);
827
+ static ngTemplateContextGuard(_dir, ctx) {
828
+ return true;
829
+ }
830
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineItemTpl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
831
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.4", type: CngxTimelineItemTpl, isStandalone: true, selector: "ng-template[cngxTimelineItem]", inputs: { cngxTimelineItem: { classPropertyName: "cngxTimelineItem", publicName: "cngxTimelineItem", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["cngxTimelineItem"], ngImport: i0 });
832
+ }
833
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineItemTpl, decorators: [{
834
+ type: Directive,
835
+ args: [{
836
+ selector: 'ng-template[cngxTimelineItem]',
837
+ standalone: true,
838
+ exportAs: 'cngxTimelineItem',
839
+ }]
840
+ }], propDecorators: { cngxTimelineItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "cngxTimelineItem", required: false }] }] } });
841
+ /**
842
+ * The per-group header. Falls back to
843
+ * `CNGX_TIMELINE_CONFIG.labels.groupLabel`, which formats the group's
844
+ * start date in the browser locale.
845
+ *
846
+ * The element this renders into is what the group's `aria-labelledby`
847
+ * points at, so a header that renders nothing leaves the group unnamed.
848
+ *
849
+ * ```html
850
+ * <ng-template [cngxTimelineDateHeader]="events()" let-group>
851
+ * <h3>{{ format(group.start) }} ({{ group.items.length }})</h3>
852
+ * </ng-template>
853
+ * ```
854
+ *
855
+ * @category common/timeline
856
+ * @wcag AA
857
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
858
+ * @relatedTo CngxTimelineItemTpl
859
+ * @since 0.1.0
860
+ */
861
+ class CngxTimelineDateHeader {
862
+ /**
863
+ * Type carrier for the group's item type, never read at runtime. Bind the
864
+ * same array the timeline gets and `let-group` types as
865
+ * `TimelineGroup<T>`. See {@link CngxTimelineItemTpl.cngxTimelineItem}.
866
+ */
867
+ cngxTimelineDateHeader = input(undefined, { ...(ngDevMode ? { debugName: "cngxTimelineDateHeader" } : /* istanbul ignore next */ {}), transform: (value) => (typeof value === 'string' ? undefined : value) });
868
+ templateRef = inject(TemplateRef);
869
+ static ngTemplateContextGuard(_dir, ctx) {
870
+ return true;
871
+ }
872
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineDateHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive });
873
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.4", type: CngxTimelineDateHeader, isStandalone: true, selector: "ng-template[cngxTimelineDateHeader]", inputs: { cngxTimelineDateHeader: { classPropertyName: "cngxTimelineDateHeader", publicName: "cngxTimelineDateHeader", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["cngxTimelineDateHeader"], ngImport: i0 });
874
+ }
875
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineDateHeader, decorators: [{
876
+ type: Directive,
877
+ args: [{
878
+ selector: 'ng-template[cngxTimelineDateHeader]',
879
+ standalone: true,
880
+ exportAs: 'cngxTimelineDateHeader',
881
+ }]
882
+ }], propDecorators: { cngxTimelineDateHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "cngxTimelineDateHeader", required: false }] }] } });
883
+ /**
884
+ * What goes inside the marker dot - an icon, an avatar, a type glyph.
885
+ * Falls back to a bare coloured dot.
886
+ *
887
+ * Applies to every row. A single row overrides it by projecting its own
888
+ * `[cngxTimelineMarkerContent]`, which wins over this template.
889
+ *
890
+ * Whatever renders here is inside an `aria-hidden` element, so it must
891
+ * not be the only carrier of anything: the status reaches assistive tech
892
+ * through `CNGX_TIMELINE_CONFIG.labels.status`.
893
+ *
894
+ * Keeps `Tpl` in class *and* selector to stay clear of
895
+ * `CngxTimelineMarker`, the component it renders into.
896
+ *
897
+ * @category common/timeline
898
+ * @wcag AA
899
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
900
+ * @relatedTo CngxTimelineMarker
901
+ * @since 0.1.0
902
+ */
903
+ class CngxTimelineMarkerTpl {
904
+ /**
905
+ * Type carrier for the item type, never read at runtime. Bind the same
906
+ * array the timeline gets and `let-event` types as `T`. See
907
+ * {@link CngxTimelineItemTpl.cngxTimelineItem}.
908
+ */
909
+ cngxTimelineMarkerTpl = input(undefined, { ...(ngDevMode ? { debugName: "cngxTimelineMarkerTpl" } : /* istanbul ignore next */ {}), transform: (value) => (typeof value === 'string' ? undefined : value) });
910
+ templateRef = inject(TemplateRef);
911
+ static ngTemplateContextGuard(_dir, ctx) {
912
+ return true;
913
+ }
914
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineMarkerTpl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
915
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.4", type: CngxTimelineMarkerTpl, isStandalone: true, selector: "ng-template[cngxTimelineMarkerTpl]", inputs: { cngxTimelineMarkerTpl: { classPropertyName: "cngxTimelineMarkerTpl", publicName: "cngxTimelineMarkerTpl", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["cngxTimelineMarkerTpl"], ngImport: i0 });
916
+ }
917
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineMarkerTpl, decorators: [{
918
+ type: Directive,
919
+ args: [{
920
+ selector: 'ng-template[cngxTimelineMarkerTpl]',
921
+ standalone: true,
922
+ exportAs: 'cngxTimelineMarkerTpl',
923
+ }]
924
+ }], propDecorators: { cngxTimelineMarkerTpl: [{ type: i0.Input, args: [{ isSignal: true, alias: "cngxTimelineMarkerTpl", required: false }] }] } });
925
+ /**
926
+ * The empty surface. Falls back to
927
+ * `CNGX_TIMELINE_CONFIG.labels.emptyFallback`.
928
+ *
929
+ * ```html
930
+ * <ng-template cngxTimelineEmpty let-reason>
931
+ * @if (reason === 'no-results') { <p>No events match this filter.</p> }
932
+ * @else { <p>Nothing has happened yet.</p> }
933
+ * </ng-template>
934
+ * ```
935
+ *
936
+ * @category common/timeline
937
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
938
+ * @relatedTo CngxTimelineError
939
+ * @since 0.1.0
940
+ */
941
+ class CngxTimelineEmpty {
942
+ templateRef = inject(TemplateRef);
943
+ static ngTemplateContextGuard(_dir, ctx) {
944
+ return true;
945
+ }
946
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineEmpty, deps: [], target: i0.ɵɵFactoryTarget.Directive });
947
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxTimelineEmpty, isStandalone: true, selector: "ng-template[cngxTimelineEmpty]", exportAs: ["cngxTimelineEmpty"], ngImport: i0 });
948
+ }
949
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineEmpty, decorators: [{
950
+ type: Directive,
951
+ args: [{
952
+ selector: 'ng-template[cngxTimelineEmpty]',
953
+ standalone: true,
954
+ exportAs: 'cngxTimelineEmpty',
955
+ }]
956
+ }] });
957
+ /**
958
+ * The whole error surface, replacing message and retry control together.
959
+ * Reach for `*cngxTimelineRetryButton` instead when only the button needs
960
+ * restyling. Falls back to
961
+ * `CNGX_TIMELINE_CONFIG.labels.errorFallback` plus a plain retry button.
962
+ *
963
+ * @category common/timeline
964
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
965
+ * @relatedTo CngxTimelineRetryButton, CngxTimelineEmpty
966
+ * @since 0.1.0
967
+ */
968
+ class CngxTimelineError {
969
+ templateRef = inject(TemplateRef);
970
+ static ngTemplateContextGuard(_dir, ctx) {
971
+ return true;
972
+ }
973
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineError, deps: [], target: i0.ɵɵFactoryTarget.Directive });
974
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxTimelineError, isStandalone: true, selector: "ng-template[cngxTimelineError]", exportAs: ["cngxTimelineError"], ngImport: i0 });
975
+ }
976
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineError, decorators: [{
977
+ type: Directive,
978
+ args: [{
979
+ selector: 'ng-template[cngxTimelineError]',
980
+ standalone: true,
981
+ exportAs: 'cngxTimelineError',
982
+ }]
983
+ }] });
984
+ /**
985
+ * Just the retry control inside the default error surface, for apps that
986
+ * want their own button component without rewriting the error copy.
987
+ *
988
+ * Whatever renders here has to be operable: the library ships no button
989
+ * component, so a consumer template is responsible for its own `type`,
990
+ * accessible name and click wiring.
991
+ *
992
+ * ```html
993
+ * <ng-template cngxTimelineRetryButton let-retry>
994
+ * <button type="button" (click)="retry()">Try again</button>
995
+ * </ng-template>
996
+ * ```
997
+ *
998
+ * @category common/timeline
999
+ * @wcag AA
1000
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
1001
+ * @relatedTo CngxTimelineError
1002
+ * @since 0.1.0
1003
+ */
1004
+ class CngxTimelineRetryButton {
1005
+ templateRef = inject(TemplateRef);
1006
+ static ngTemplateContextGuard(_dir, ctx) {
1007
+ return true;
1008
+ }
1009
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineRetryButton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1010
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxTimelineRetryButton, isStandalone: true, selector: "ng-template[cngxTimelineRetryButton]", exportAs: ["cngxTimelineRetryButton"], ngImport: i0 });
1011
+ }
1012
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineRetryButton, decorators: [{
1013
+ type: Directive,
1014
+ args: [{
1015
+ selector: 'ng-template[cngxTimelineRetryButton]',
1016
+ standalone: true,
1017
+ exportAs: 'cngxTimelineRetryButton',
1018
+ }]
1019
+ }] });
1020
+ /**
1021
+ * The tail appended below the list while a background refresh runs, with
1022
+ * the already-loaded items still on screen. Falls back to
1023
+ * `CNGX_TIMELINE_CONFIG.labels.refreshing`.
1024
+ *
1025
+ * Contextless on purpose - a refresh has nothing to say beyond the fact
1026
+ * that it is happening.
1027
+ *
1028
+ * @category common/timeline
1029
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
1030
+ * @relatedTo CngxTimelineError
1031
+ * @since 0.1.0
1032
+ */
1033
+ class CngxTimelineLoadingTail {
1034
+ templateRef = inject(TemplateRef);
1035
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineLoadingTail, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1036
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxTimelineLoadingTail, isStandalone: true, selector: "ng-template[cngxTimelineLoadingTail]", exportAs: ["cngxTimelineLoadingTail"], ngImport: i0 });
1037
+ }
1038
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineLoadingTail, decorators: [{
1039
+ type: Directive,
1040
+ args: [{
1041
+ selector: 'ng-template[cngxTimelineLoadingTail]',
1042
+ standalone: true,
1043
+ exportAs: 'cngxTimelineLoadingTail',
1044
+ }]
1045
+ }] });
1046
+ /**
1047
+ * One placeholder row in the first-load body, replacing the built-in
1048
+ * marker-rail-and-two-bars shape. Rendered `[skeletonRowCount]` times.
1049
+ *
1050
+ * Contextless, and deliberately so: a placeholder stands in for a row whose
1051
+ * data has not arrived, so there is nothing to hand it. Bind this when the
1052
+ * real rows are taller or busier than the default shape and the swap to
1053
+ * content would otherwise reflow the page.
1054
+ *
1055
+ * Whatever renders here sits inside an `aria-hidden` wrapper - the load is
1056
+ * announced through the timeline's live region, not through the placeholder.
1057
+ *
1058
+ * @category common/timeline
1059
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
1060
+ * @relatedTo CngxTimelineLoadingTail
1061
+ * @since 0.1.0
1062
+ */
1063
+ class CngxTimelineSkeleton {
1064
+ templateRef = inject(TemplateRef);
1065
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineSkeleton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1066
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxTimelineSkeleton, isStandalone: true, selector: "ng-template[cngxTimelineSkeleton]", exportAs: ["cngxTimelineSkeleton"], ngImport: i0 });
1067
+ }
1068
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTimelineSkeleton, decorators: [{
1069
+ type: Directive,
1070
+ args: [{
1071
+ selector: 'ng-template[cngxTimelineSkeleton]',
1072
+ standalone: true,
1073
+ exportAs: 'cngxTimelineSkeleton',
1074
+ }]
1075
+ }] });
1076
+
1077
+ /**
1078
+ * @module @cngx/common/timeline
1079
+ */
1080
+
1081
+ /**
1082
+ * Generated bundle index. Do not edit.
1083
+ */
1084
+
1085
+ 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 };
1086
+ //# sourceMappingURL=cngx-common-timeline.mjs.map