@overdoser/react-toolkit 0.9.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,59 @@ All notable changes to `@overdoser/react-toolkit` are documented here.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/), and this
5
5
  project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [0.10.1]
8
+
9
+ Metadata-only release. No code changes.
10
+
11
+ ### Added
12
+
13
+ - `homepage` in package.json and a live-demo link in the readme — the
14
+ Storybook demo at <https://react-toolkit.overdoser.org> now appears on
15
+ the npm package page.
16
+
17
+ ## [0.10.0]
18
+
19
+ Timeline axis overhaul (sub-second zoom, tiered rails, deep-zoom
20
+ performance) plus a Modal focus-ring fix. No breaking API changes.
21
+
22
+ ### Added
23
+
24
+ - **Sub-second axis ticks.** The tick table now reaches down to 1ms (was
25
+ 1s), so a short event — e.g. a single 1.1s trace — gets a real axis with
26
+ millisecond labels instead of one gridline. Applies to all three Timeline
27
+ views.
28
+ - **Tiered axis rails in `TraceTimeline`**, coarse to fine: UTC badge,
29
+ date, time, and a milliseconds rail that appears at sub-second zooms.
30
+ Date and second labels render only at true day/second boundaries; sticky
31
+ date and (at sub-second zoom) sticky time boxes at the left edge always
32
+ name the current position, even when no boundary is in view.
33
+ - **Ruler-pattern minor ticks.** Minors sit on the step's natural units via
34
+ a per-step subdivision table: 5-unit steps read big/4-small/big, 10-unit
35
+ steps get a medium mark at the halfway unit, and clock/calendar steps
36
+ subdivide on their own units (quarter-hours, days into weeks, quarters
37
+ into years…).
38
+ - `--crk-modal-ring-guard` token (default `4px`) — see the Modal fix below.
39
+
40
+ ### Changed
41
+
42
+ - **Axis ticks span the whole scrollable canvas**, not just the interval
43
+ covered by events/tasks (TraceTimeline, GanttTimeline, and
44
+ HistoryTimeline's proportional mode).
45
+
46
+ ### Fixed
47
+
48
+ - **Deep zoom no longer freezes the page.** TraceTimeline and
49
+ GanttTimeline virtualize the axis: only ticks inside the scroll window
50
+ are materialized. Extreme zoom used to build tens of thousands of tick
51
+ nodes and re-render them on every mousemove, pegging the CPU.
52
+ - **`Modal.Body` no longer clips the top of focus rings.** The body scrolls
53
+ and had zero top padding, so the outward 3px focus ring of a form field
54
+ flush at the top lost its upper edge. The body now reserves
55
+ `--crk-modal-ring-guard` of top padding, and `Modal.Header` cedes the
56
+ same amount from its bottom padding — the header→body gap is
57
+ pixel-identical for existing consumers. Raise the token if you theme
58
+ `--crk-shadow-ring` thicker than 3px.
59
+
7
60
  ## [0.9.0]
8
61
 
9
62
  Introduces the Timeline family: three timeline views built from the
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A modern, themeable React component library with SCSS modules.
4
4
 
5
+ **Live demo (Storybook):** <https://react-toolkit.overdoser.org>
6
+
5
7
  ## Installation
6
8
 
7
9
  ```bash
@@ -1,222 +1,229 @@
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";
1
+ import { jsx as t, jsxs as f, Fragment as oe } from "react/jsx-runtime";
2
+ import { forwardRef as nn, useRef as y, useState as S, useCallback as V, useEffect as tn, useMemo as ln, useLayoutEffect as an } from "react";
3
+ import d from "clsx";
4
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) {
5
+ import a from "./GanttTimeline.module.scss.js";
6
+ import { ticks as rn, TIMELINE_PALETTE_VARS as b, fmtDate as ce, fmtDur as F, eventMatches as sn, fmtDateTime as Z, tint as on } from "./timelineCore.js";
7
+ import { TimelineSummary as cn, TimelineZoomControls as dn, HighlightText as un, TimelineTooltip as mn } from "./TimelineShared.js";
8
+ import { useNowTicker as hn, useContainerWidth as fn, useTimelinePan as wn, useWheelZoom as pn, animateScrollTo as gn } from "./useTimeline.js";
9
+ const w = 230, Pe = 24, R = 400, Nn = 26, Pn = nn(
10
+ function(We, De) {
11
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,
12
+ tasks: z,
13
+ title: B,
14
+ meta: K,
15
+ highlight: U,
16
+ defaultHighlight: He,
17
+ onHighlightChange: Ce,
18
+ showSearch: Ie = !0,
19
+ renderSearch: de,
20
+ compactRows: Ee = !1,
21
+ showGridlines: Ae = !0,
22
+ showControls: ue = !0,
23
+ showSummary: C = !1,
24
+ summaryPlacement: k = "left",
25
+ summaryDefaultPosition: Oe,
26
+ maxHeight: Ve = "74vh",
27
+ selectedTaskId: _,
28
+ defaultSelectedTaskId: Fe = null,
29
+ onTaskSelect: Ze,
30
+ renderRowLabel: me,
31
+ renderBar: $,
32
+ renderTooltip: G,
33
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 }
34
+ classes: u,
35
+ className: ze,
36
+ style: Be
37
+ } = We, p = y(null), [he, fe] = S(null), [we, pe] = S(!0), [g, Y] = S(null), [Ke, Ue] = S(Fe), P = _ !== void 0 ? _ : Ke, [x, _e] = S({ l: 0, t: 0, w: 0, h: 0 }), ge = y(C);
38
+ ge.current = C;
39
+ const j = y(null), q = V(() => {
40
+ const e = p.current;
41
+ e && _e(
42
+ (n) => n.l === e.scrollLeft && n.t === e.scrollTop && n.w === e.clientWidth && n.h === e.clientHeight ? n : { l: e.scrollLeft, t: e.scrollTop, w: e.clientWidth, h: e.clientHeight }
43
43
  );
44
- }, []), Fe = ae(() => {
45
- !he.current || _.current != null || (_.current = requestAnimationFrame(() => {
46
- _.current = null, j();
44
+ }, []), [W, $e] = S({ l: 0, w: 2e3 }), J = y(W);
45
+ J.current = W;
46
+ const Q = V(() => {
47
+ const e = p.current;
48
+ if (!e) return;
49
+ const n = Math.floor(e.scrollLeft / R) * R, l = (Math.ceil((e.clientWidth || 1600) / R) + 1) * R;
50
+ (n !== J.current.l || l !== J.current.w) && $e({ l: n, w: l });
51
+ }, []), Ge = V(() => {
52
+ j.current == null && (j.current = requestAnimationFrame(() => {
53
+ j.current = null, Q(), ge.current && q();
47
54
  }));
48
- }, [j]);
49
- Ye(() => {
50
- H && j();
55
+ }, [q, Q]);
56
+ tn(() => {
57
+ C && q();
51
58
  });
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(
59
+ const Ne = z.some((e) => e.end == null), N = hn(Ne, 400), ee = fn(p), D = wn(p), [Xe, Ye] = S(He ?? ""), ne = U !== void 0 ? U : Xe, I = ne.trim(), ve = (e) => {
60
+ U === void 0 && Ye(e), Ce?.(e);
61
+ }, xe = de ? de({ value: ne, setValue: ve }) : Ie ? /* @__PURE__ */ t(
55
62
  "input",
56
63
  {
57
- className: c(r.searchInput, d?.search),
64
+ className: d(r.searchInput, u?.search),
58
65
  placeholder: "Highlight keyword in tasks…",
59
66
  "aria-label": "Highlight keyword",
60
- value: J,
61
- onChange: (e) => pe(e.target.value)
67
+ value: ne,
68
+ onChange: (e) => ve(e.target.value)
62
69
  }
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);
70
+ ) : null, i = ln(() => z.slice().sort((e, n) => e.start - n.start), [z]);
71
+ let m = i.length ? Math.min(...i.map((e) => e.start)) : N - 1, te = i.length ? Math.max(m + 1, ...i.map((e) => e.end == null ? N : e.end)) : N;
72
+ const le = (te - m) * 0.03;
73
+ m -= le, te += le;
74
+ const ae = te - m, E = Math.max(240, ee - w - Pe) / ae, o = we || !he ? E : he, re = y(E), Me = y(o);
75
+ re.current = E, Me.current = o;
76
+ const A = y(null);
77
+ an(() => {
78
+ A.current != null && p.current && (p.current.scrollLeft = A.current, A.current = null), Q();
72
79
  });
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);
80
+ const se = V((e, n) => {
81
+ const l = p.current;
82
+ if (!l) return;
83
+ const c = Me.current || 1e-4, h = Math.max(re.current ? re.current * 0.2 : 1e-9, Math.min(1, c * e)), v = (l.scrollLeft + n - w) / c;
84
+ A.current = v * h + w - n, pe(!1), fe(h);
78
85
  }, []);
79
- on(f, (e) => {
86
+ pn(p, (e) => {
80
87
  e.preventDefault();
81
- const t = f.current;
82
- t && ne(Math.exp(-e.deltaY * 18e-4), e.clientX - t.getBoundingClientRect().left);
88
+ const n = p.current;
89
+ n && se(Math.exp(-e.deltaY * 18e-4), e.clientX - n.getBoundingClientRect().left);
83
90
  });
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
+ const ie = (e) => {
92
+ _ === void 0 && Ue(e ? e.id : null), Ze?.(e);
93
+ }, je = (e) => {
94
+ const n = window.innerWidth || 1200, l = window.innerHeight || 800, c = e.clientX < n * 0.55 ? Math.max(12, n - 340) : 16, h = Math.max(130, Math.min(e.clientY, l - 130));
95
+ return { x: c, y: h };
96
+ }, L = Ee ? 42 : 54, s = P != null && i.find((e) => e.id === P) || null, be = Math.ceil(w + ae * o + Pe + 90), qe = m + (be - w) / o, Te = Math.max(m, m + (W.l - R - w) / o), ye = Math.min(qe, m + (W.l + W.w + R - w) / o), Se = rn(Te, ye, Math.max(1, (ye - Te) * o)).list.map((e) => ({
97
+ left: Math.round(w + (e.t - m) * o),
91
98
  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,
99
+ })), Je = i.filter((e) => e.end == null).length, O = C ? /* @__PURE__ */ t(
100
+ cn,
94
101
  {
95
102
  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;
103
+ className: u?.summary,
104
+ placement: k,
105
+ floatingDefaultPosition: Oe,
106
+ items: i.map((e, n) => {
107
+ const l = e.end == null ? N : e.end, c = Math.round(w + (e.start - m) * o), h = Math.max(14, Math.round(Math.max(0, l - e.start) * o)), v = 34 + n * L, M = !x.w || c < x.l + x.w && c + h > x.l, T = !x.h || v < x.t + x.h && v + L > x.t;
101
108
  return {
102
109
  id: e.id,
103
- number: String(t + 1).padStart(2, "0"),
110
+ number: String(n + 1).padStart(2, "0"),
104
111
  label: e.name,
105
- color: b[t % b.length],
106
- time: re(e.start),
107
- inView: M && y,
108
- selected: R === e.id
112
+ color: b[n % b.length],
113
+ time: ce(e.start),
114
+ inView: M && T,
115
+ selected: P === e.id
109
116
  };
110
117
  }),
111
118
  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)
119
+ const n = i.findIndex((H) => H.id === e), l = p.current;
120
+ if (n < 0 || !l) return;
121
+ const c = i[n], h = c.end == null ? N : c.end, v = Math.round(w + (c.start - m) * o), M = Math.max(14, Math.round(Math.max(0, h - c.start) * o)), T = {
122
+ left: Math.max(0, v + M / 2 - l.clientWidth / 2)
116
123
  };
117
- a.clientHeight && (y.top = Math.max(0, 34 + t * S + S / 2 - a.clientHeight / 2)), cn(a, y);
124
+ l.clientHeight && (T.top = Math.max(0, 34 + n * L + L / 2 - l.clientHeight / 2)), gn(l, T);
118
125
  }
119
126
  }
120
127
  ) : null;
121
- return /* @__PURE__ */ h(
128
+ return /* @__PURE__ */ f(
122
129
  "div",
123
130
  {
124
- ref: Te,
125
- className: c(r.root, d?.root, Ie),
126
- style: Ee,
131
+ ref: De,
132
+ className: d(r.root, u?.root, ze),
133
+ style: Be,
127
134
  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") })
135
+ (ue || xe || B != null || K != null) && /* @__PURE__ */ f("div", { className: d(r.toolbar, u?.toolbar), children: [
136
+ /* @__PURE__ */ f("div", { className: r.toolbarText, children: [
137
+ B != null && /* @__PURE__ */ t("span", { className: r.toolbarTitle, children: B }),
138
+ /* @__PURE__ */ t("span", { className: r.toolbarMeta, children: K ?? (i.length ? `${i.length} tasks · ${F(ae - 2 * le)} · ${Je} running` : "No tasks") })
132
139
  ] }),
133
- we,
134
- ie && /* @__PURE__ */ n(
135
- nn,
140
+ xe,
141
+ ue && /* @__PURE__ */ t(
142
+ dn,
136
143
  {
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),
144
+ zoomPct: `${Math.round(o / E * 100)}%`,
145
+ fitActive: we,
146
+ onZoomIn: () => se(1.5, ee / 2),
147
+ onZoomOut: () => se(1 / 1.5, ee / 2),
141
148
  onFit: () => {
142
- me(!0), de(null);
149
+ pe(!0), fe(null);
143
150
  },
144
151
  hint: "scroll zooms · drag pans"
145
152
  }
146
153
  )
147
154
  ] }),
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(
155
+ k === "top" && O,
156
+ /* @__PURE__ */ f("div", { className: r.layout, children: [
157
+ k === "left" && O,
158
+ /* @__PURE__ */ f("div", { className: r.main, children: [
159
+ /* @__PURE__ */ t("div", { className: d(r.card, u?.card), children: /* @__PURE__ */ t(
153
160
  "div",
154
161
  {
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(
162
+ ref: p,
163
+ className: d(r.scroller, a.scroller, u?.scroller),
164
+ style: { maxHeight: Ve },
165
+ onPointerDown: D.onPointerDown,
166
+ onPointerMove: D.onPointerMove,
167
+ onPointerUp: D.onPointerUp,
168
+ onPointerLeave: D.onPointerUp,
169
+ onScroll: Ge,
170
+ children: /* @__PURE__ */ f("div", { className: a.inner, style: { width: be }, children: [
171
+ Ae && Se.map((e, n) => /* @__PURE__ */ t("div", { className: a.gridline, style: { left: e.left } }, n)),
172
+ Ne && /* @__PURE__ */ t(
166
173
  "div",
167
174
  {
168
- className: l.nowLine,
169
- style: { left: Math.round(v + (g - p) * u) }
175
+ className: a.nowLine,
176
+ style: { left: Math.round(w + (N - m) * o) }
170
177
  }
171
178
  ),
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(
179
+ /* @__PURE__ */ t("div", { className: d(a.axis, u?.axis), children: Se.map((e, n) => /* @__PURE__ */ t("div", { className: a.axisLabel, style: { left: e.left }, children: e.label }, n)) }),
180
+ i.map((e, n) => {
181
+ const l = e.end == null, c = l ? N : e.end, h = Math.max(0, c - e.start), v = sn(e, I), M = b[n % b.length], T = Math.round(w + (e.start - m) * o), H = Math.max(14, Math.round(h * o)), ke = F(h) + (l ? " · running" : ""), Le = H > 130, Re = { index: n, color: M, running: l, durationMs: h };
182
+ return /* @__PURE__ */ f(
176
183
  "div",
177
184
  {
178
- className: c(l.row, d?.row),
179
- style: { height: S, opacity: C && !N ? 0.3 : 1 },
185
+ className: d(a.row, u?.row),
186
+ style: { height: L, opacity: I && !v ? 0.3 : 1 },
180
187
  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)) })
188
+ /* @__PURE__ */ t("div", { className: d(a.rowLabel, u?.rowLabel), children: me ? me(e, Re) : /* @__PURE__ */ f(oe, { children: [
189
+ /* @__PURE__ */ t("span", { className: a.rowName, children: /* @__PURE__ */ t(un, { text: e.name, query: I }) }),
190
+ /* @__PURE__ */ t("span", { className: a.rowDates, children: ce(e.start) + (l ? " → now" : " → " + ce(c)) })
184
191
  ] }) }),
185
- /* @__PURE__ */ n(
192
+ /* @__PURE__ */ t(
186
193
  "div",
187
194
  {
188
- className: c(l.bar, a && l.barRunning, d?.bar),
195
+ className: d(a.bar, l && a.barRunning, u?.bar),
189
196
  style: {
190
- left: y,
191
- top: Math.round((S - dn) / 2),
192
- width: D,
197
+ left: T,
198
+ top: Math.round((L - Nn) / 2),
199
+ width: H,
193
200
  borderColor: M,
194
- background: a ? Qe(M, 72) : M,
195
- boxShadow: C && N ? "0 0 0 3px var(--crk-timeline-hl-ring, #f3d98b)" : "none"
201
+ background: l ? on(M, 72) : M,
202
+ boxShadow: I && v ? "0 0 0 3px var(--crk-timeline-hl-ring, #f3d98b)" : "none"
196
203
  },
197
204
  onClick: () => {
198
- P.wasDragSuppressed() || (Y(null), te(R === e.id ? null : e));
205
+ D.wasDragSuppressed() || (Y(null), ie(P === e.id ? null : e));
199
206
  },
200
- onMouseEnter: (Ke) => {
201
- if (R === e.id) return;
202
- const Ue = Be(Ke);
207
+ onMouseEnter: (Qe) => {
208
+ if (P === e.id) return;
209
+ const en = je(Qe);
203
210
  Y({
204
- ...Ue,
211
+ ...en,
205
212
  id: e.id,
206
213
  title: e.name,
207
- time: F(e.start) + (a ? "" : " → " + F(o)),
208
- durLine: (a ? "running · " : "took ") + V(m) + (e.owner ? " · " + e.owner : ""),
214
+ time: Z(e.start) + (l ? "" : " → " + Z(c)),
215
+ durLine: (l ? "running · " : "took ") + F(h) + (e.owner ? " · " + e.owner : ""),
209
216
  detail: e.detail || ""
210
217
  });
211
218
  },
212
219
  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 })
220
+ children: $ ? $(e, Re) : /* @__PURE__ */ f(oe, { children: [
221
+ l && /* @__PURE__ */ t("span", { className: d(r.pulseDot, a.barDot) }),
222
+ Le && /* @__PURE__ */ t("span", { className: a.barTextInside, children: ke })
216
223
  ] })
217
224
  }
218
225
  ),
219
- !K && !xe && /* @__PURE__ */ n("div", { className: l.barTextOutside, style: { left: y + D + 10 }, children: ve })
226
+ !$ && !Le && /* @__PURE__ */ t("div", { className: a.barTextOutside, style: { left: T + H + 10 }, children: ke })
220
227
  ]
221
228
  },
222
229
  e.id
@@ -225,74 +232,74 @@ const v = 230, be = 24, dn = 26, Mn = Xe(
225
232
  ] })
226
233
  }
227
234
  ) }),
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" })
235
+ /* @__PURE__ */ t("div", { className: d(r.footnote, u?.footnote), children: "Click a bar to open details in the side panel · dashed bars are still running and keep growing" })
229
236
  ] }),
230
- s && X && /* @__PURE__ */ n("aside", { className: c(r.aside, l.drawer, d?.drawer), children: X(s, {
231
- close: () => te(null),
237
+ s && X && /* @__PURE__ */ t("aside", { className: d(r.aside, a.drawer, u?.drawer), children: X(s, {
238
+ close: () => ie(null),
232
239
  running: s.end == null
233
240
  }) }),
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(
241
+ s && !X && /* @__PURE__ */ f("aside", { className: d(r.aside, a.drawer, u?.drawer), children: [
242
+ /* @__PURE__ */ f("div", { className: a.drawerHead, children: [
243
+ /* @__PURE__ */ t(
237
244
  "span",
238
245
  {
239
- className: l.drawerSwatch,
246
+ className: a.drawerSwatch,
240
247
  style: {
241
248
  background: b[i.indexOf(s) % b.length]
242
249
  }
243
250
  }
244
251
  ),
245
- /* @__PURE__ */ n("span", { className: l.drawerOwner, children: s.owner || "—" }),
246
- /* @__PURE__ */ n(
252
+ /* @__PURE__ */ t("span", { className: a.drawerOwner, children: s.owner || "—" }),
253
+ /* @__PURE__ */ t(
247
254
  "span",
248
255
  {
249
- className: c(
250
- l.drawerState,
251
- s.end == null && l.drawerStateRunning
256
+ className: d(
257
+ a.drawerState,
258
+ s.end == null && a.drawerStateRunning
252
259
  ),
253
260
  children: s.end == null ? "running" : "done"
254
261
  }
255
262
  ),
256
- /* @__PURE__ */ n("div", { className: l.drawerSpacer }),
257
- /* @__PURE__ */ n(
263
+ /* @__PURE__ */ t("div", { className: a.drawerSpacer }),
264
+ /* @__PURE__ */ t(
258
265
  "button",
259
266
  {
260
267
  type: "button",
261
268
  className: r.asideClose,
262
269
  "aria-label": "Close details",
263
- onClick: () => te(null),
270
+ onClick: () => ie(null),
264
271
  children: "✕"
265
272
  }
266
273
  )
267
274
  ] }),
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) })
275
+ /* @__PURE__ */ t("div", { className: a.drawerName, children: s.name }),
276
+ /* @__PURE__ */ t("div", { className: a.drawerTiming, children: Z(s.start) + " → " + (s.end == null ? "now" : Z(s.end)) + " · " + F((s.end == null ? N : s.end) - s.start) }),
277
+ /* @__PURE__ */ t("div", { className: a.drawerDetail, children: s.detail || "—" }),
278
+ /* @__PURE__ */ t("div", { className: r.asideSection, children: "Raw event" }),
279
+ /* @__PURE__ */ t("pre", { className: r.asideRaw, children: JSON.stringify(s, null, 2) })
273
280
  ] }),
274
- (T === "right" || T === "floating") && O
281
+ (k === "right" || k === "floating") && O
275
282
  ] }),
276
- T === "bottom" && O,
277
- w && (() => {
278
- const e = i.find((a) => a.id === w.id), t = e && U ? U(e, {
283
+ k === "bottom" && O,
284
+ g && (() => {
285
+ const e = i.find((l) => l.id === g.id), n = e && G ? G(e, {
279
286
  index: i.indexOf(e),
280
287
  color: b[i.indexOf(e) % b.length],
281
288
  running: e.end == null,
282
- durationMs: (e.end == null ? g : e.end) - e.start
289
+ durationMs: (e.end == null ? N : e.end) - e.start
283
290
  }) : 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(
291
+ return G && n == null ? null : /* @__PURE__ */ t(mn, { x: g.x, y: g.y, className: u?.tooltip, children: n !== void 0 ? n : /* @__PURE__ */ f(oe, { children: [
292
+ /* @__PURE__ */ t("div", { className: r.tooltipTitle, children: g.title }),
293
+ /* @__PURE__ */ t(
287
294
  "div",
288
295
  {
289
- className: c(r.tooltipLine, r.tooltipMono),
296
+ className: d(r.tooltipLine, r.tooltipMono),
290
297
  style: { marginTop: 4 },
291
- children: w.time
298
+ children: g.time
292
299
  }
293
300
  ),
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 })
301
+ /* @__PURE__ */ t("div", { className: r.tooltipLine, children: g.durLine }),
302
+ g.detail && /* @__PURE__ */ t("div", { className: r.tooltipDim, style: { marginTop: 5 }, children: g.detail })
296
303
  ] }) });
297
304
  })()
298
305
  ]
@@ -301,5 +308,5 @@ const v = 230, be = 24, dn = 26, Mn = Xe(
301
308
  }
302
309
  );
303
310
  export {
304
- Mn as GanttTimeline
311
+ Pn as GanttTimeline
305
312
  };