@overdoser/react-toolkit 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/AGENTS.md +6 -0
  2. package/CHANGELOG.md +84 -0
  3. package/components/Drawer/Drawer.js +88 -83
  4. package/components/Timeline/GanttTimeline.d.ts +144 -0
  5. package/components/Timeline/GanttTimeline.js +305 -0
  6. package/components/Timeline/GanttTimeline.module.scss.js +55 -0
  7. package/components/Timeline/HistoryTimeline.d.ts +184 -0
  8. package/components/Timeline/HistoryTimeline.js +445 -0
  9. package/components/Timeline/HistoryTimeline.module.scss.js +59 -0
  10. package/components/Timeline/Timeline.module.scss.js +111 -0
  11. package/components/Timeline/TimelineShared.d.ts +79 -0
  12. package/components/Timeline/TimelineShared.js +173 -0
  13. package/components/Timeline/TraceTimeline.d.ts +180 -0
  14. package/components/Timeline/TraceTimeline.js +511 -0
  15. package/components/Timeline/TraceTimeline.module.scss.js +105 -0
  16. package/components/Timeline/demoData.d.ts +42 -0
  17. package/components/Timeline/historyLayout.d.ts +82 -0
  18. package/components/Timeline/historyLayout.js +264 -0
  19. package/components/Timeline/index.d.ts +7 -0
  20. package/components/Timeline/timelineCore.d.ts +90 -0
  21. package/components/Timeline/timelineCore.js +135 -0
  22. package/components/Timeline/traceLayout.d.ts +72 -0
  23. package/components/Timeline/traceLayout.js +92 -0
  24. package/components/Timeline/useTimeline.d.ts +39 -0
  25. package/components/Timeline/useTimeline.js +81 -0
  26. package/components/inputs/Select/Select.js +158 -154
  27. package/index.css +1 -1
  28. package/index.d.ts +2 -0
  29. package/index.js +93 -87
  30. package/index.layered.css +1 -1
  31. package/llms.txt +113 -0
  32. package/manifest.json +323 -0
  33. package/package.json +1 -1
  34. package/recipes/live-timeline-feed.tsx +147 -0
@@ -0,0 +1,305 @@
1
+ import { jsx as n, jsxs as h, Fragment as le } from "react/jsx-runtime";
2
+ import { forwardRef as Xe, useRef as k, useState as L, useCallback as ae, useEffect as Ye, useMemo as _e, useLayoutEffect as je } from "react";
3
+ import c from "clsx";
4
+ import r from "./Timeline.module.scss.js";
5
+ import l from "./GanttTimeline.module.scss.js";
6
+ import { ticks as qe, TIMELINE_PALETTE_VARS as b, fmtDate as re, fmtDur as V, eventMatches as Je, fmtDateTime as F, tint as Qe } from "./timelineCore.js";
7
+ import { TimelineSummary as en, TimelineZoomControls as nn, HighlightText as tn, TimelineTooltip as ln } from "./TimelineShared.js";
8
+ import { useNowTicker as an, useContainerWidth as rn, useTimelinePan as sn, useWheelZoom as on, animateScrollTo as cn } from "./useTimeline.js";
9
+ const v = 230, be = 24, dn = 26, Mn = Xe(
10
+ function(ye, Te) {
11
+ const {
12
+ tasks: Z,
13
+ title: z,
14
+ meta: B,
15
+ highlight: $,
16
+ defaultHighlight: Se,
17
+ onHighlightChange: ke,
18
+ showSearch: Le = !0,
19
+ renderSearch: se,
20
+ compactRows: Re = !1,
21
+ showGridlines: Pe = !0,
22
+ showControls: ie = !0,
23
+ showSummary: H = !1,
24
+ summaryPlacement: T = "left",
25
+ summaryDefaultPosition: De,
26
+ maxHeight: He = "74vh",
27
+ selectedTaskId: G,
28
+ defaultSelectedTaskId: Ce = null,
29
+ onTaskSelect: We,
30
+ renderRowLabel: oe,
31
+ renderBar: K,
32
+ renderTooltip: U,
33
+ renderDetails: X,
34
+ classes: d,
35
+ className: Ie,
36
+ style: Ee
37
+ } = ye, f = k(null), [ce, de] = L(null), [ue, me] = L(!0), [w, Y] = L(null), [Ae, Oe] = L(Ce), R = G !== void 0 ? G : Ae, [x, Ve] = L({ l: 0, t: 0, w: 0, h: 0 }), he = k(H);
38
+ he.current = H;
39
+ const _ = k(null), j = ae(() => {
40
+ const e = f.current;
41
+ e && Ve(
42
+ (t) => t.l === e.scrollLeft && t.t === e.scrollTop && t.w === e.clientWidth && t.h === e.clientHeight ? t : { l: e.scrollLeft, t: e.scrollTop, w: e.clientWidth, h: e.clientHeight }
43
+ );
44
+ }, []), Fe = ae(() => {
45
+ !he.current || _.current != null || (_.current = requestAnimationFrame(() => {
46
+ _.current = null, j();
47
+ }));
48
+ }, [j]);
49
+ Ye(() => {
50
+ H && j();
51
+ });
52
+ const fe = Z.some((e) => e.end == null), g = an(fe, 400), q = rn(f), P = sn(f), [Ze, ze] = L(Se ?? ""), J = $ !== void 0 ? $ : Ze, C = J.trim(), pe = (e) => {
53
+ $ === void 0 && ze(e), ke?.(e);
54
+ }, we = se ? se({ value: J, setValue: pe }) : Le ? /* @__PURE__ */ n(
55
+ "input",
56
+ {
57
+ className: c(r.searchInput, d?.search),
58
+ placeholder: "Highlight keyword in tasks…",
59
+ "aria-label": "Highlight keyword",
60
+ value: J,
61
+ onChange: (e) => pe(e.target.value)
62
+ }
63
+ ) : null, i = _e(() => Z.slice().sort((e, t) => e.start - t.start), [Z]);
64
+ let p = i.length ? Math.min(...i.map((e) => e.start)) : g - 1, W = i.length ? Math.max(p + 1, ...i.map((e) => e.end == null ? g : e.end)) : g;
65
+ const Q = (W - p) * 0.03;
66
+ p -= Q, W += Q;
67
+ const I = W - p, E = Math.max(240, q - v - be) / I, u = ue || !ce ? E : ce, ee = k(E), ge = k(u);
68
+ ee.current = E, ge.current = u;
69
+ const A = k(null);
70
+ je(() => {
71
+ A.current != null && f.current && (f.current.scrollLeft = A.current, A.current = null);
72
+ });
73
+ const ne = ae((e, t) => {
74
+ const a = f.current;
75
+ if (!a) return;
76
+ const o = ge.current || 1e-4, m = Math.max(ee.current ? ee.current * 0.2 : 1e-9, Math.min(1, o * e)), N = (a.scrollLeft + t - v) / o;
77
+ A.current = N * m + v - t, me(!1), de(m);
78
+ }, []);
79
+ on(f, (e) => {
80
+ e.preventDefault();
81
+ const t = f.current;
82
+ t && ne(Math.exp(-e.deltaY * 18e-4), e.clientX - t.getBoundingClientRect().left);
83
+ });
84
+ const te = (e) => {
85
+ G === void 0 && Oe(e ? e.id : null), We?.(e);
86
+ }, Be = (e) => {
87
+ const t = window.innerWidth || 1200, a = window.innerHeight || 800, o = e.clientX < t * 0.55 ? Math.max(12, t - 340) : 16, m = Math.max(130, Math.min(e.clientY, a - 130));
88
+ return { x: o, y: m };
89
+ }, S = Re ? 42 : 54, s = R != null && i.find((e) => e.id === R) || null, Ne = qe(p, W, I * u).list.map((e) => ({
90
+ left: Math.round(v + (e.t - p) * u),
91
+ label: e.label
92
+ })), $e = Math.ceil(v + I * u + be + 90), Ge = i.filter((e) => e.end == null).length, O = H ? /* @__PURE__ */ n(
93
+ en,
94
+ {
95
+ heading: "Tasks",
96
+ className: d?.summary,
97
+ placement: T,
98
+ floatingDefaultPosition: De,
99
+ items: i.map((e, t) => {
100
+ const a = e.end == null ? g : e.end, o = Math.round(v + (e.start - p) * u), m = Math.max(14, Math.round(Math.max(0, a - e.start) * u)), N = 34 + t * S, M = !x.w || o < x.l + x.w && o + m > x.l, y = !x.h || N < x.t + x.h && N + S > x.t;
101
+ return {
102
+ id: e.id,
103
+ number: String(t + 1).padStart(2, "0"),
104
+ label: e.name,
105
+ color: b[t % b.length],
106
+ time: re(e.start),
107
+ inView: M && y,
108
+ selected: R === e.id
109
+ };
110
+ }),
111
+ onPick: (e) => {
112
+ const t = i.findIndex((D) => D.id === e), a = f.current;
113
+ if (t < 0 || !a) return;
114
+ const o = i[t], m = o.end == null ? g : o.end, N = Math.round(v + (o.start - p) * u), M = Math.max(14, Math.round(Math.max(0, m - o.start) * u)), y = {
115
+ left: Math.max(0, N + M / 2 - a.clientWidth / 2)
116
+ };
117
+ a.clientHeight && (y.top = Math.max(0, 34 + t * S + S / 2 - a.clientHeight / 2)), cn(a, y);
118
+ }
119
+ }
120
+ ) : null;
121
+ return /* @__PURE__ */ h(
122
+ "div",
123
+ {
124
+ ref: Te,
125
+ className: c(r.root, d?.root, Ie),
126
+ style: Ee,
127
+ children: [
128
+ (ie || we || z != null || B != null) && /* @__PURE__ */ h("div", { className: c(r.toolbar, d?.toolbar), children: [
129
+ /* @__PURE__ */ h("div", { className: r.toolbarText, children: [
130
+ z != null && /* @__PURE__ */ n("span", { className: r.toolbarTitle, children: z }),
131
+ /* @__PURE__ */ n("span", { className: r.toolbarMeta, children: B ?? (i.length ? `${i.length} tasks · ${V(I - 2 * Q)} · ${Ge} running` : "No tasks") })
132
+ ] }),
133
+ we,
134
+ ie && /* @__PURE__ */ n(
135
+ nn,
136
+ {
137
+ zoomPct: `${Math.round(u / E * 100)}%`,
138
+ fitActive: ue,
139
+ onZoomIn: () => ne(1.5, q / 2),
140
+ onZoomOut: () => ne(1 / 1.5, q / 2),
141
+ onFit: () => {
142
+ me(!0), de(null);
143
+ },
144
+ hint: "scroll zooms · drag pans"
145
+ }
146
+ )
147
+ ] }),
148
+ T === "top" && O,
149
+ /* @__PURE__ */ h("div", { className: r.layout, children: [
150
+ T === "left" && O,
151
+ /* @__PURE__ */ h("div", { className: r.main, children: [
152
+ /* @__PURE__ */ n("div", { className: c(r.card, d?.card), children: /* @__PURE__ */ n(
153
+ "div",
154
+ {
155
+ ref: f,
156
+ className: c(r.scroller, l.scroller, d?.scroller),
157
+ style: { maxHeight: He },
158
+ onPointerDown: P.onPointerDown,
159
+ onPointerMove: P.onPointerMove,
160
+ onPointerUp: P.onPointerUp,
161
+ onPointerLeave: P.onPointerUp,
162
+ onScroll: Fe,
163
+ children: /* @__PURE__ */ h("div", { className: l.inner, style: { width: $e }, children: [
164
+ Pe && Ne.map((e, t) => /* @__PURE__ */ n("div", { className: l.gridline, style: { left: e.left } }, t)),
165
+ fe && /* @__PURE__ */ n(
166
+ "div",
167
+ {
168
+ className: l.nowLine,
169
+ style: { left: Math.round(v + (g - p) * u) }
170
+ }
171
+ ),
172
+ /* @__PURE__ */ n("div", { className: c(l.axis, d?.axis), children: Ne.map((e, t) => /* @__PURE__ */ n("div", { className: l.axisLabel, style: { left: e.left }, children: e.label }, t)) }),
173
+ i.map((e, t) => {
174
+ const a = e.end == null, o = a ? g : e.end, m = Math.max(0, o - e.start), N = Je(e, C), M = b[t % b.length], y = Math.round(v + (e.start - p) * u), D = Math.max(14, Math.round(m * u)), ve = V(m) + (a ? " · running" : ""), xe = D > 130, Me = { index: t, color: M, running: a, durationMs: m };
175
+ return /* @__PURE__ */ h(
176
+ "div",
177
+ {
178
+ className: c(l.row, d?.row),
179
+ style: { height: S, opacity: C && !N ? 0.3 : 1 },
180
+ children: [
181
+ /* @__PURE__ */ n("div", { className: c(l.rowLabel, d?.rowLabel), children: oe ? oe(e, Me) : /* @__PURE__ */ h(le, { children: [
182
+ /* @__PURE__ */ n("span", { className: l.rowName, children: /* @__PURE__ */ n(tn, { text: e.name, query: C }) }),
183
+ /* @__PURE__ */ n("span", { className: l.rowDates, children: re(e.start) + (a ? " → now" : " → " + re(o)) })
184
+ ] }) }),
185
+ /* @__PURE__ */ n(
186
+ "div",
187
+ {
188
+ className: c(l.bar, a && l.barRunning, d?.bar),
189
+ style: {
190
+ left: y,
191
+ top: Math.round((S - dn) / 2),
192
+ width: D,
193
+ borderColor: M,
194
+ background: a ? Qe(M, 72) : M,
195
+ boxShadow: C && N ? "0 0 0 3px var(--crk-timeline-hl-ring, #f3d98b)" : "none"
196
+ },
197
+ onClick: () => {
198
+ P.wasDragSuppressed() || (Y(null), te(R === e.id ? null : e));
199
+ },
200
+ onMouseEnter: (Ke) => {
201
+ if (R === e.id) return;
202
+ const Ue = Be(Ke);
203
+ Y({
204
+ ...Ue,
205
+ id: e.id,
206
+ title: e.name,
207
+ time: F(e.start) + (a ? "" : " → " + F(o)),
208
+ durLine: (a ? "running · " : "took ") + V(m) + (e.owner ? " · " + e.owner : ""),
209
+ detail: e.detail || ""
210
+ });
211
+ },
212
+ onMouseLeave: () => Y(null),
213
+ children: K ? K(e, Me) : /* @__PURE__ */ h(le, { children: [
214
+ a && /* @__PURE__ */ n("span", { className: c(r.pulseDot, l.barDot) }),
215
+ xe && /* @__PURE__ */ n("span", { className: l.barTextInside, children: ve })
216
+ ] })
217
+ }
218
+ ),
219
+ !K && !xe && /* @__PURE__ */ n("div", { className: l.barTextOutside, style: { left: y + D + 10 }, children: ve })
220
+ ]
221
+ },
222
+ e.id
223
+ );
224
+ })
225
+ ] })
226
+ }
227
+ ) }),
228
+ /* @__PURE__ */ n("div", { className: c(r.footnote, d?.footnote), children: "Click a bar to open details in the side panel · dashed bars are still running and keep growing" })
229
+ ] }),
230
+ s && X && /* @__PURE__ */ n("aside", { className: c(r.aside, l.drawer, d?.drawer), children: X(s, {
231
+ close: () => te(null),
232
+ running: s.end == null
233
+ }) }),
234
+ s && !X && /* @__PURE__ */ h("aside", { className: c(r.aside, l.drawer, d?.drawer), children: [
235
+ /* @__PURE__ */ h("div", { className: l.drawerHead, children: [
236
+ /* @__PURE__ */ n(
237
+ "span",
238
+ {
239
+ className: l.drawerSwatch,
240
+ style: {
241
+ background: b[i.indexOf(s) % b.length]
242
+ }
243
+ }
244
+ ),
245
+ /* @__PURE__ */ n("span", { className: l.drawerOwner, children: s.owner || "—" }),
246
+ /* @__PURE__ */ n(
247
+ "span",
248
+ {
249
+ className: c(
250
+ l.drawerState,
251
+ s.end == null && l.drawerStateRunning
252
+ ),
253
+ children: s.end == null ? "running" : "done"
254
+ }
255
+ ),
256
+ /* @__PURE__ */ n("div", { className: l.drawerSpacer }),
257
+ /* @__PURE__ */ n(
258
+ "button",
259
+ {
260
+ type: "button",
261
+ className: r.asideClose,
262
+ "aria-label": "Close details",
263
+ onClick: () => te(null),
264
+ children: "✕"
265
+ }
266
+ )
267
+ ] }),
268
+ /* @__PURE__ */ n("div", { className: l.drawerName, children: s.name }),
269
+ /* @__PURE__ */ n("div", { className: l.drawerTiming, children: F(s.start) + " → " + (s.end == null ? "now" : F(s.end)) + " · " + V((s.end == null ? g : s.end) - s.start) }),
270
+ /* @__PURE__ */ n("div", { className: l.drawerDetail, children: s.detail || "—" }),
271
+ /* @__PURE__ */ n("div", { className: r.asideSection, children: "Raw event" }),
272
+ /* @__PURE__ */ n("pre", { className: r.asideRaw, children: JSON.stringify(s, null, 2) })
273
+ ] }),
274
+ (T === "right" || T === "floating") && O
275
+ ] }),
276
+ T === "bottom" && O,
277
+ w && (() => {
278
+ const e = i.find((a) => a.id === w.id), t = e && U ? U(e, {
279
+ index: i.indexOf(e),
280
+ color: b[i.indexOf(e) % b.length],
281
+ running: e.end == null,
282
+ durationMs: (e.end == null ? g : e.end) - e.start
283
+ }) : void 0;
284
+ return U && t == null ? null : /* @__PURE__ */ n(ln, { x: w.x, y: w.y, className: d?.tooltip, children: t !== void 0 ? t : /* @__PURE__ */ h(le, { children: [
285
+ /* @__PURE__ */ n("div", { className: r.tooltipTitle, children: w.title }),
286
+ /* @__PURE__ */ n(
287
+ "div",
288
+ {
289
+ className: c(r.tooltipLine, r.tooltipMono),
290
+ style: { marginTop: 4 },
291
+ children: w.time
292
+ }
293
+ ),
294
+ /* @__PURE__ */ n("div", { className: r.tooltipLine, children: w.durLine }),
295
+ w.detail && /* @__PURE__ */ n("div", { className: r.tooltipDim, style: { marginTop: 5 }, children: w.detail })
296
+ ] }) });
297
+ })()
298
+ ]
299
+ }
300
+ );
301
+ }
302
+ );
303
+ export {
304
+ Mn as GanttTimeline
305
+ };
@@ -0,0 +1,55 @@
1
+ const r = "crk-scroller-y2AA7", e = "crk-inner--tSR-", a = "crk-gridline-a9CAe", n = "crk-nowLine-AtaNz", t = "crk-axis-r1FXP", c = "crk-axisLabel-yACMU", w = "crk-row-g4FCC", o = "crk-rowLabel-qOMvT", s = "crk-rowName-g7WMP", d = "crk-rowDates-tEtH6", i = "crk-bar-MKoAK", k = "crk-barRunning-2eR5o", b = "crk-barDot-kqgBw", l = "crk-barTextInside-j0xJc", g = "crk-barTextOutside-cOAGq", x = "crk-drawer-7II9B", S = "crk-drawerHead-VZyLW", T = "crk-drawerSwatch-YTo8T", L = "crk-drawerOwner-jUXtE", u = "crk-drawerState-PIrtX", m = "crk-drawerStateRunning-JYeCs", D = "crk-drawerSpacer-NxNLE", N = "crk-drawerName-VWwMl", R = "crk-drawerTiming-wPByH", O = "crk-drawerDetail-R0Gr2", A = {
2
+ scroller: r,
3
+ inner: e,
4
+ gridline: a,
5
+ nowLine: n,
6
+ axis: t,
7
+ axisLabel: c,
8
+ row: w,
9
+ rowLabel: o,
10
+ rowName: s,
11
+ rowDates: d,
12
+ bar: i,
13
+ barRunning: k,
14
+ barDot: b,
15
+ barTextInside: l,
16
+ barTextOutside: g,
17
+ drawer: x,
18
+ drawerHead: S,
19
+ drawerSwatch: T,
20
+ drawerOwner: L,
21
+ drawerState: u,
22
+ drawerStateRunning: m,
23
+ drawerSpacer: D,
24
+ drawerName: N,
25
+ drawerTiming: R,
26
+ drawerDetail: O
27
+ };
28
+ export {
29
+ t as axis,
30
+ c as axisLabel,
31
+ i as bar,
32
+ b as barDot,
33
+ k as barRunning,
34
+ l as barTextInside,
35
+ g as barTextOutside,
36
+ A as default,
37
+ x as drawer,
38
+ O as drawerDetail,
39
+ S as drawerHead,
40
+ N as drawerName,
41
+ L as drawerOwner,
42
+ D as drawerSpacer,
43
+ u as drawerState,
44
+ m as drawerStateRunning,
45
+ T as drawerSwatch,
46
+ R as drawerTiming,
47
+ a as gridline,
48
+ e as inner,
49
+ n as nowLine,
50
+ w as row,
51
+ d as rowDates,
52
+ o as rowLabel,
53
+ s as rowName,
54
+ r as scroller
55
+ };
@@ -0,0 +1,184 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { TimelineSummaryPlacement } from './TimelineShared';
3
+ import { DraggablePosition } from '../Draggable';
4
+ export type HistoryTimelineOrientation = 'horizontal' | 'vertical';
5
+ export type HistoryTimelineSpacing = 'equal' | 'log' | 'proportional';
6
+ /**
7
+ * One event in a subject's history. Instant events have `end === start` (or
8
+ * omit `end`); ongoing events set `end: null` (or `ongoing: true`) until a
9
+ * later update supplies the end time.
10
+ */
11
+ export interface HistoryTimelineEvent {
12
+ /** Stable identifier. */
13
+ id: string;
14
+ /** Card title (bold, keyword-highlightable). */
15
+ title: string;
16
+ /** Description, ≤2 lines on the card, full text in tooltip/panel. */
17
+ detail?: string;
18
+ /** Category tag — colors the dot/lead and appears in the legend. */
19
+ tag?: string;
20
+ /** Owning subject id (informational; shown in the detail panel). */
21
+ subject?: string;
22
+ /** Start time, epoch ms. */
23
+ start: number;
24
+ /** End time. Equal to `start` (or omitted) = instant; `null` = ongoing. */
25
+ end?: number | null;
26
+ /** Alternative way to mark an event ongoing when `end` is omitted. */
27
+ ongoing?: boolean;
28
+ [extra: string]: unknown;
29
+ }
30
+ export interface HistoryTimelineClasses {
31
+ root: string;
32
+ toolbar: string;
33
+ legend: string;
34
+ card: string;
35
+ scroller: string;
36
+ eventCard: string;
37
+ dot: string;
38
+ summary: string;
39
+ search: string;
40
+ drawer: string;
41
+ tooltip: string;
42
+ footnote: string;
43
+ }
44
+ /** Context handed to the HistoryTimeline render-prop slots. */
45
+ export interface HistoryTimelineItemContext {
46
+ /** Chronological index (0-based). */
47
+ index: number;
48
+ /** Zero-padded card number (`'01'`…). */
49
+ number: string;
50
+ /** Resolved tag color. */
51
+ color: string;
52
+ /** True while the event has no end. */
53
+ ongoing: boolean;
54
+ /** True for burst-group members (rendered condensed by default). */
55
+ condensed: boolean;
56
+ /** Duration so far, ms. */
57
+ durationMs: number;
58
+ }
59
+ export interface HistoryTimelineProps {
60
+ /**
61
+ * Events of one subject (an order, an incident, a candidate…). Provide the
62
+ * already filtered list — the component applies no subject filtering. Push
63
+ * updated arrays for live feeds; ongoing events (`end: null`) pulse and
64
+ * grow until completed.
65
+ */
66
+ events: HistoryTimelineEvent[];
67
+ /** Subject display name for the detail panel (e.g. `Order ORD-58291`). */
68
+ subjectName?: ReactNode;
69
+ /** Controlled orientation. */
70
+ orientation?: HistoryTimelineOrientation;
71
+ /**
72
+ * Initial orientation (uncontrolled). Defaults to `'horizontal'`, falling
73
+ * back to `'vertical'` on narrow (<700px) viewports.
74
+ */
75
+ defaultOrientation?: HistoryTimelineOrientation;
76
+ /** Fired when the built-in toggle switches orientation. */
77
+ onOrientationChange?: (o: HistoryTimelineOrientation) => void;
78
+ /** Controlled spacing mode. */
79
+ spacing?: HistoryTimelineSpacing;
80
+ /**
81
+ * Initial spacing (uncontrolled): `'equal'` index-based, `'log'`
82
+ * gap-compressed (dense bursts stay readable next to huge gaps),
83
+ * `'proportional'` linear time. @default 'equal'
84
+ */
85
+ defaultSpacing?: HistoryTimelineSpacing;
86
+ /** Fired when the built-in toggle switches spacing. */
87
+ onSpacingChange?: (s: HistoryTimelineSpacing) => void;
88
+ /**
89
+ * Controlled keyword highlight: case-insensitive AND over
90
+ * whitespace-separated tokens against each event's JSON. Matches get an
91
+ * amber wash; non-matches dim. When set, the built-in search box reflects
92
+ * it — pair with `onHighlightChange` (or use `defaultHighlight` for
93
+ * uncontrolled).
94
+ */
95
+ highlight?: string;
96
+ /** Initial keyword for the built-in search box (uncontrolled). */
97
+ defaultHighlight?: string;
98
+ /** Fired when the keyword changes via the built-in box or `renderSearch`. */
99
+ onHighlightChange?: (value: string) => void;
100
+ /** Built-in "Highlight keyword…" box in the toolbar. @default true */
101
+ showSearch?: boolean;
102
+ /** Replace the built-in search box with a custom element in the toolbar. */
103
+ renderSearch?: (api: {
104
+ value: string;
105
+ setValue: (value: string) => void;
106
+ }) => ReactNode;
107
+ /** Tag→color overrides (any CSS color). Unknown tags cycle the palette. */
108
+ tagColors?: Record<string, string>;
109
+ /** Toolbar with orientation/spacing toggles + zoom controls. @default true */
110
+ showControls?: boolean;
111
+ /** Colored bullet + tag name legend. @default true */
112
+ showLegend?: boolean;
113
+ /**
114
+ * Dense one-line-per-event summary panel beside the timeline: all events
115
+ * numbered chronologically from `01` (matching the card numbers), a
116
+ * highlight band over the events currently visible in the viewport
117
+ * (auto-follows drag-panning), and click-to-navigate — the timeline
118
+ * smooth-scrolls (~1s, decelerating) to center the picked event. The panel
119
+ * scrolls independently.
120
+ * @default false
121
+ */
122
+ showSummary?: boolean;
123
+ /**
124
+ * Where the summary panel sits: docked `'left'`/`'right'` of the timeline,
125
+ * full-width `'top'`/`'bottom'`, or `'floating'` — a draggable palette over
126
+ * the timeline, grabbed by its header. @default 'left'
127
+ */
128
+ summaryPlacement?: TimelineSummaryPlacement;
129
+ /** Floating summary: initial offset from the component's top-left corner. */
130
+ summaryDefaultPosition?: DraggablePosition;
131
+ /** Max height of the scrollable canvas. Defaults to 84vh (h) / 78vh (v). */
132
+ maxHeight?: number | string;
133
+ /** Controlled id of the event open in the detail panel (`null` = closed). */
134
+ selectedEventId?: string | null;
135
+ /** Initially open event (uncontrolled). */
136
+ defaultSelectedEventId?: string | null;
137
+ /** Fired when an event is opened (event) or closed (`null`). */
138
+ onEventSelect?: (event: HistoryTimelineEvent | null) => void;
139
+ /**
140
+ * Replace the card's inner content (default: number + tag dot + title,
141
+ * time, detail, duration badge). The card box geometry is still computed
142
+ * from the default content (title/detail lengths), so keep custom content
143
+ * roughly equivalent in size.
144
+ */
145
+ renderCard?: (event: HistoryTimelineEvent, ctx: HistoryTimelineItemContext) => ReactNode;
146
+ /**
147
+ * Replace the tooltip content. When set, the tooltip shows for every
148
+ * hovered card (not only when it adds information); return `null` to
149
+ * suppress it for that event.
150
+ */
151
+ renderTooltip?: (event: HistoryTimelineEvent, ctx: HistoryTimelineItemContext) => ReactNode;
152
+ /** Replace the detail side panel content; the sticky panel shell is kept. */
153
+ renderDetails?: (event: HistoryTimelineEvent, api: {
154
+ close: () => void;
155
+ ongoing: boolean;
156
+ }) => ReactNode;
157
+ /** Override class names on internal elements. */
158
+ classes?: Partial<HistoryTimelineClasses>;
159
+ className?: string;
160
+ style?: CSSProperties;
161
+ }
162
+ /**
163
+ * Subject history timeline: the life of one entity as numbered event cards
164
+ * alternating around a central axis (above/below horizontally, left/right
165
+ * vertically), with the handoff's collision-free reconciliation — clustered
166
+ * side split, outward-stepping circles, straight or Z-shaped leads, and
167
+ * burst groups whose members condense and stack on consecutive rows. Three
168
+ * spacing modes (equal / log-compressed / proportional), wheel-zoom with
169
+ * cross-axis fit, drag-pan, keyword highlighting, tooltips only when they
170
+ * add information, and a click-to-open detail side panel.
171
+ *
172
+ * @example
173
+ * ```tsx
174
+ * <HistoryTimeline
175
+ * subjectName="Order ORD-58291"
176
+ * events={[
177
+ * { id: '1', title: 'Order created', tag: 'created', start: t1 },
178
+ * { id: '2', title: 'Fraud review', tag: 'review', start: t2, end: t2 + 2 * HOUR },
179
+ * { id: '3', title: 'In transit', tag: 'shipping', start: t3, end: null }, // ongoing
180
+ * ]}
181
+ * />
182
+ * ```
183
+ */
184
+ export declare const HistoryTimeline: import('react').ForwardRefExoticComponent<HistoryTimelineProps & import('react').RefAttributes<HTMLDivElement>>;