@overdoser/react-toolkit 0.21.0 → 0.22.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.
Files changed (161) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +35 -0
  3. package/components/Accordion/Accordion.js +48 -48
  4. package/components/ActionButton/ActionButton.js +23 -23
  5. package/components/ActionButton/CopyButton.js +5 -5
  6. package/components/Alert/Alert.js +13 -13
  7. package/components/Avatar/Avatar.js +12 -12
  8. package/components/Badge/Badge.js +6 -6
  9. package/components/Breadcrumbs/Breadcrumbs.js +15 -15
  10. package/components/Button/Button.js +14 -14
  11. package/components/Card/Card.js +26 -26
  12. package/components/Chart/AreaChart.js +103 -103
  13. package/components/Chart/Axis.js +7 -7
  14. package/components/Chart/BarChart.js +62 -62
  15. package/components/Chart/ChartContainer.js +11 -11
  16. package/components/Chart/ChartLegend.js +7 -7
  17. package/components/Chart/ChartTooltip.js +13 -13
  18. package/components/Chart/LineChart.js +88 -88
  19. package/components/Chart/PieChart.js +25 -25
  20. package/components/Chart/RadarChart.js +42 -42
  21. package/components/Chart/Sparkline.js +11 -11
  22. package/components/Chart/TradingChart.js +126 -126
  23. package/components/Chart/trading/period.js +3 -3
  24. package/components/Chip/Chip.js +24 -24
  25. package/components/CodeBlock/CodeBlock.js +31 -31
  26. package/components/CommandPalette/CommandPalette.js +166 -166
  27. package/components/ConfirmDialog/ConfirmDialog.js +60 -60
  28. package/components/Divider/Divider.js +10 -10
  29. package/components/Draggable/Draggable.js +29 -29
  30. package/components/Drawer/Drawer.js +53 -53
  31. package/components/Dropdown/Dropdown.js +66 -66
  32. package/components/Dropdown/DropdownItem.js +13 -13
  33. package/components/Dropdown/DropdownLabel.js +5 -5
  34. package/components/Dropdown/DropdownSeparator.js +5 -5
  35. package/components/Dropzone/Dropzone.js +15 -15
  36. package/components/EmptyState/EmptyState.js +11 -11
  37. package/components/Form/Form.js +17 -17
  38. package/components/Form/FormField.js +21 -21
  39. package/components/Form/FormRow.js +3 -3
  40. package/components/ImageViewer/ImageViewer.js +118 -118
  41. package/components/Kbd/Kbd.js +11 -11
  42. package/components/KeyValueList/KeyValueList.js +32 -32
  43. package/components/Link/Link.js +7 -7
  44. package/components/List/List.js +7 -7
  45. package/components/Loader/Loader.js +39 -39
  46. package/components/Modal/Modal.js +48 -48
  47. package/components/PageHeader/PageHeader.js +18 -18
  48. package/components/Pagination/Pagination.js +23 -23
  49. package/components/Popover/Popover.js +25 -25
  50. package/components/ProgressBar/ProgressBar.js +17 -17
  51. package/components/RelativeTime/RelativeTime.js +10 -10
  52. package/components/SegmentedControl/SegmentedControl.js +38 -38
  53. package/components/Skeleton/Skeleton.js +10 -10
  54. package/components/Spinner/Spinner.js +7 -7
  55. package/components/SplitButton/SplitButton.js +63 -63
  56. package/components/SplitPane/SplitPane.js +50 -50
  57. package/components/StatCard/StatCard.js +32 -32
  58. package/components/StatusDot/StatusDot.js +7 -7
  59. package/components/Table/Table.js +174 -174
  60. package/components/Tabs/Tabs.js +47 -47
  61. package/components/ThemeToggle/ThemeToggle.js +31 -31
  62. package/components/Timeline/GanttTimeline.js +213 -213
  63. package/components/Timeline/HistoryTimeline.js +306 -306
  64. package/components/Timeline/TimelineShared.js +103 -103
  65. package/components/Timeline/TraceEventDetails.js +103 -103
  66. package/components/Timeline/TraceTimeline.js +546 -546
  67. package/components/Timeline/historyLayout.js +2 -2
  68. package/components/Timer/Timer.js +39 -39
  69. package/components/Toast/Toast.js +59 -59
  70. package/components/ToggleIconButton/ToggleIconButton.js +9 -9
  71. package/components/Tooltip/Tooltip.js +16 -16
  72. package/components/Typography/Typography.js +5 -5
  73. package/components/inputs/Checkbox/Checkbox.js +11 -11
  74. package/components/inputs/Checkbox/CheckboxGroup.js +21 -21
  75. package/components/inputs/DatePicker/CalendarPanel.js +113 -113
  76. package/components/inputs/DatePicker/DatePicker.js +39 -39
  77. package/components/inputs/DateTimePicker/DateTimePicker.js +119 -119
  78. package/components/inputs/DateTimePicker/DateTimeSegments.js +40 -40
  79. package/components/inputs/DateTimePicker/TimeField.js +34 -34
  80. package/components/inputs/Input/Input.js +13 -13
  81. package/components/inputs/NumberInput/NumberInput.js +16 -16
  82. package/components/inputs/Radio/Radio.js +17 -17
  83. package/components/inputs/SearchInput/SearchInput.js +25 -25
  84. package/components/inputs/Select/Select.d.ts +55 -3
  85. package/components/inputs/Select/Select.js +485 -344
  86. package/components/inputs/Select/{Select.module.js → Select.module.scss.js} +15 -3
  87. package/components/inputs/Slider/Slider.js +21 -21
  88. package/components/inputs/Switch/Switch.js +4 -4
  89. package/components/inputs/Textarea/Textarea.js +8 -8
  90. package/hooks/usePortalPosition.d.ts +2 -1
  91. package/hooks/usePortalPosition.js +6 -3
  92. package/hooks/useResizable.js +1 -1
  93. package/hooks/useTheme.js +7 -7
  94. package/index.css +1 -1
  95. package/index.js +1 -1
  96. package/index.layered.css +1 -1
  97. package/llms.txt +25 -4
  98. package/manifest.json +33 -4
  99. package/package.json +1 -1
  100. /package/components/Accordion/{Accordion.module.js → Accordion.module.scss.js} +0 -0
  101. /package/components/ActionButton/{ActionButton.module.js → ActionButton.module.scss.js} +0 -0
  102. /package/components/Alert/{Alert.module.js → Alert.module.scss.js} +0 -0
  103. /package/components/Avatar/{Avatar.module.js → Avatar.module.scss.js} +0 -0
  104. /package/components/Badge/{Badge.module.js → Badge.module.scss.js} +0 -0
  105. /package/components/Breadcrumbs/{Breadcrumbs.module.js → Breadcrumbs.module.scss.js} +0 -0
  106. /package/components/Button/{Button.module.js → Button.module.scss.js} +0 -0
  107. /package/components/Card/{Card.module.js → Card.module.scss.js} +0 -0
  108. /package/components/Chart/{Chart.module.js → Chart.module.scss.js} +0 -0
  109. /package/components/Chip/{Chip.module.js → Chip.module.scss.js} +0 -0
  110. /package/components/CodeBlock/{CodeBlock.module.js → CodeBlock.module.scss.js} +0 -0
  111. /package/components/CommandPalette/{CommandPalette.module.js → CommandPalette.module.scss.js} +0 -0
  112. /package/components/ConfirmDialog/{ConfirmDialog.module.js → ConfirmDialog.module.scss.js} +0 -0
  113. /package/components/Divider/{Divider.module.js → Divider.module.scss.js} +0 -0
  114. /package/components/Draggable/{Draggable.module.js → Draggable.module.scss.js} +0 -0
  115. /package/components/Drawer/{Drawer.module.js → Drawer.module.scss.js} +0 -0
  116. /package/components/Dropdown/{Dropdown.module.js → Dropdown.module.scss.js} +0 -0
  117. /package/components/Dropzone/{Dropzone.module.js → Dropzone.module.scss.js} +0 -0
  118. /package/components/EmptyState/{EmptyState.module.js → EmptyState.module.scss.js} +0 -0
  119. /package/components/Form/{Form.module.js → Form.module.scss.js} +0 -0
  120. /package/components/ImageViewer/{ImageViewer.module.js → ImageViewer.module.scss.js} +0 -0
  121. /package/components/Kbd/{Kbd.module.js → Kbd.module.scss.js} +0 -0
  122. /package/components/KeyValueList/{KeyValueList.module.js → KeyValueList.module.scss.js} +0 -0
  123. /package/components/Link/{Link.module.js → Link.module.scss.js} +0 -0
  124. /package/components/List/{List.module.js → List.module.scss.js} +0 -0
  125. /package/components/Loader/{Loader.module.js → Loader.module.scss.js} +0 -0
  126. /package/components/Modal/{Modal.module.js → Modal.module.scss.js} +0 -0
  127. /package/components/PageHeader/{PageHeader.module.js → PageHeader.module.scss.js} +0 -0
  128. /package/components/Pagination/{Pagination.module.js → Pagination.module.scss.js} +0 -0
  129. /package/components/Popover/{Popover.module.js → Popover.module.scss.js} +0 -0
  130. /package/components/ProgressBar/{ProgressBar.module.js → ProgressBar.module.scss.js} +0 -0
  131. /package/components/RelativeTime/{RelativeTime.module.js → RelativeTime.module.scss.js} +0 -0
  132. /package/components/SegmentedControl/{SegmentedControl.module.js → SegmentedControl.module.scss.js} +0 -0
  133. /package/components/Skeleton/{Skeleton.module.js → Skeleton.module.scss.js} +0 -0
  134. /package/components/Spinner/{Spinner.module.js → Spinner.module.scss.js} +0 -0
  135. /package/components/SplitButton/{SplitButton.module.js → SplitButton.module.scss.js} +0 -0
  136. /package/components/SplitPane/{SplitPane.module.js → SplitPane.module.scss.js} +0 -0
  137. /package/components/StatCard/{StatCard.module.js → StatCard.module.scss.js} +0 -0
  138. /package/components/StatusDot/{StatusDot.module.js → StatusDot.module.scss.js} +0 -0
  139. /package/components/Table/{Table.module.js → Table.module.scss.js} +0 -0
  140. /package/components/Tabs/{Tabs.module.js → Tabs.module.scss.js} +0 -0
  141. /package/components/ThemeToggle/{ThemeToggle.module.js → ThemeToggle.module.scss.js} +0 -0
  142. /package/components/Timeline/{GanttTimeline.module.js → GanttTimeline.module.scss.js} +0 -0
  143. /package/components/Timeline/{HistoryTimeline.module.js → HistoryTimeline.module.scss.js} +0 -0
  144. /package/components/Timeline/{Timeline.module.js → Timeline.module.scss.js} +0 -0
  145. /package/components/Timeline/{TraceTimeline.module.js → TraceTimeline.module.scss.js} +0 -0
  146. /package/components/Timer/{Timer.module.js → Timer.module.scss.js} +0 -0
  147. /package/components/Toast/{Toast.module.js → Toast.module.scss.js} +0 -0
  148. /package/components/ToggleIconButton/{ToggleIconButton.module.js → ToggleIconButton.module.scss.js} +0 -0
  149. /package/components/Tooltip/{Tooltip.module.js → Tooltip.module.scss.js} +0 -0
  150. /package/components/Typography/{Typography.module.js → Typography.module.scss.js} +0 -0
  151. /package/components/inputs/Checkbox/{Checkbox.module.js → Checkbox.module.scss.js} +0 -0
  152. /package/components/inputs/Checkbox/{CheckboxGroup.module.js → CheckboxGroup.module.scss.js} +0 -0
  153. /package/components/inputs/DatePicker/{CalendarPanel.module.js → CalendarPanel.module.scss.js} +0 -0
  154. /package/components/inputs/DatePicker/{DatePicker.module.js → DatePicker.module.scss.js} +0 -0
  155. /package/components/inputs/DateTimePicker/{DateTimePicker.module.js → DateTimePicker.module.scss.js} +0 -0
  156. /package/components/inputs/Input/{Input.module.js → Input.module.scss.js} +0 -0
  157. /package/components/inputs/NumberInput/{NumberInput.module.js → NumberInput.module.scss.js} +0 -0
  158. /package/components/inputs/Radio/{Radio.module.js → Radio.module.scss.js} +0 -0
  159. /package/components/inputs/SearchInput/{SearchInput.module.js → SearchInput.module.scss.js} +0 -0
  160. /package/components/inputs/Slider/{Slider.module.js → Slider.module.scss.js} +0 -0
  161. /package/components/inputs/Textarea/{Textarea.module.js → Textarea.module.scss.js} +0 -0
@@ -1,357 +1,357 @@
1
- import e from "./Timeline.module.js";
2
- import t from "./GanttTimeline.module.js";
3
- import { TIMELINE_PALETTE_VARS as n, eventMatches as r, fmtDate as i, fmtDateTime as a, fmtDur as o, ticks as s, tint as ee } from "./timelineCore.js";
4
- import { HighlightText as te, TimelineSummary as c, TimelineTooltip as l, TimelineZoomControls as u } from "./TimelineShared.js";
5
- import { animateScrollTo as d, useContainerWidth as ne, useNowTicker as f, useTimelinePan as p, useWheelZoom as m, wheelZoomAllowed as h } from "./useTimeline.js";
6
- import { forwardRef as g, useCallback as _, useEffect as re, useLayoutEffect as ie, useMemo as ae, useRef as v, useState as y } from "react";
7
- import b from "clsx";
8
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
1
+ import { forwardRef as e, useCallback as t, useEffect as n, useLayoutEffect as r, useMemo as i, useRef as a, useState as o } from "react";
2
+ import s from "clsx";
3
+ import c from "./Timeline.module.scss.js";
4
+ import l from "./GanttTimeline.module.scss.js";
5
+ import { TIMELINE_PALETTE_VARS as u, eventMatches as ee, fmtDate as te, fmtDateTime as d, fmtDur as f, ticks as ne, tint as re } from "./timelineCore.js";
6
+ import { HighlightText as ie, TimelineSummary as p, TimelineTooltip as m, TimelineZoomControls as h } from "./TimelineShared.js";
7
+ import { animateScrollTo as g, useContainerWidth as ae, useNowTicker as oe, useTimelinePan as se, useWheelZoom as ce, wheelZoomAllowed as le } from "./useTimeline.js";
8
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
9
9
  // src/components/Timeline/GanttTimeline.tsx
10
- var w = 230, oe = 24, T = 400, se = 26, ce = g(function(g, ce) {
11
- let { tasks: le, title: ue, meta: de, highlight: E, defaultHighlight: fe, onHighlightChange: pe, showSearch: me = !0, renderSearch: he, compactRows: ge = !1, showGridlines: _e = !0, showControls: ve = !0, wheelZoom: D = "ctrl", showSummary: O = !1, summaryPlacement: k = "left", summaryDefaultPosition: ye, maxHeight: be = "74vh", selectedTaskId: A, defaultSelectedTaskId: xe = null, onTaskSelect: Se, renderRowLabel: Ce, renderBar: j, renderTooltip: M, renderDetails: N, classes: P, className: we, style: Te } = g, F = v(null), [Ee, De] = y(null), [Oe, ke] = y(!0), [I, L] = y(null), [Ae, je] = y(xe), R = A === void 0 ? Ae : A, [z, Me] = y({
10
+ var b = 230, ue = 24, x = 400, de = 26, fe = e(function(e, fe) {
11
+ let { tasks: pe, title: S, meta: me, highlight: C, defaultHighlight: he, onHighlightChange: ge, showSearch: _e = !0, renderSearch: ve, compactRows: ye = !1, showGridlines: be = !0, showControls: xe = !0, wheelZoom: w = "ctrl", showSummary: T = !1, summaryPlacement: E = "left", summaryDefaultPosition: Se, maxHeight: Ce = "74vh", selectedTaskId: D, defaultSelectedTaskId: we = null, onTaskSelect: Te, renderRowLabel: Ee, renderBar: O, renderTooltip: k, renderDetails: A, classes: j, className: De, style: Oe } = e, M = a(null), [ke, Ae] = o(null), [je, Me] = o(!0), [N, P] = o(null), [Ne, Pe] = o(we), F = D === void 0 ? Ne : D, [I, Fe] = o({
12
12
  l: 0,
13
13
  t: 0,
14
14
  w: 0,
15
15
  h: 0
16
- }), Ne = v(O);
17
- Ne.current = O;
18
- let Pe = v(null), B = _(() => {
19
- let e = F.current;
20
- e && Me((t) => t.l === e.scrollLeft && t.t === e.scrollTop && t.w === e.clientWidth && t.h === e.clientHeight ? t : {
16
+ }), Ie = a(T);
17
+ Ie.current = T;
18
+ let Le = a(null), L = t(() => {
19
+ let e = M.current;
20
+ e && Fe((t) => t.l === e.scrollLeft && t.t === e.scrollTop && t.w === e.clientWidth && t.h === e.clientHeight ? t : {
21
21
  l: e.scrollLeft,
22
22
  t: e.scrollTop,
23
23
  w: e.clientWidth,
24
24
  h: e.clientHeight
25
25
  });
26
- }, []), [V, Fe] = y({
26
+ }, []), [R, Re] = o({
27
27
  l: 0,
28
28
  w: 2e3
29
- }), Ie = v(V);
30
- Ie.current = V;
31
- let Le = _(() => {
32
- let e = F.current;
29
+ }), z = a(R);
30
+ z.current = R;
31
+ let B = t(() => {
32
+ let e = M.current;
33
33
  if (!e) return;
34
- let t = Math.floor(e.scrollLeft / T) * T, n = (Math.ceil((e.clientWidth || 1600) / T) + 1) * T;
35
- (t !== Ie.current.l || n !== Ie.current.w) && Fe({
34
+ let t = Math.floor(e.scrollLeft / x) * x, n = (Math.ceil((e.clientWidth || 1600) / x) + 1) * x;
35
+ (t !== z.current.l || n !== z.current.w) && Re({
36
36
  l: t,
37
37
  w: n
38
38
  });
39
- }, []), Re = _(() => {
40
- Pe.current ??= requestAnimationFrame(() => {
41
- Pe.current = null, Le(), Ne.current && B();
39
+ }, []), ze = t(() => {
40
+ Le.current ??= requestAnimationFrame(() => {
41
+ Le.current = null, B(), Ie.current && L();
42
42
  });
43
- }, [B, Le]);
44
- re(() => {
45
- O && B();
43
+ }, [L, B]);
44
+ n(() => {
45
+ T && L();
46
46
  });
47
- let ze = le.some((e) => e.end == null), H = f(ze, 400), Be = ne(F), U = p(F), [Ve, He] = y(fe ?? ""), Ue = E === void 0 ? Ve : E, W = Ue.trim(), We = (e) => {
48
- E === void 0 && He(e), pe?.(e);
49
- }, Ge = he ? he({
47
+ let Be = pe.some((e) => e.end == null), V = oe(Be, 400), H = ae(M), U = se(M), [Ve, He] = o(he ?? ""), Ue = C === void 0 ? Ve : C, W = Ue.trim(), We = (e) => {
48
+ C === void 0 && He(e), ge?.(e);
49
+ }, Ge = ve ? ve({
50
50
  value: Ue,
51
51
  setValue: We
52
- }) : me ? /* @__PURE__ */ S("input", {
53
- className: b(e.searchInput, P?.search),
52
+ }) : _e ? /* @__PURE__ */ v("input", {
53
+ className: s(c.searchInput, j?.search),
54
54
  placeholder: "Highlight keyword in tasks…",
55
55
  "aria-label": "Highlight keyword",
56
56
  value: Ue,
57
57
  onChange: (e) => We(e.target.value)
58
- }) : null, G = ae(() => le.slice().sort((e, t) => e.start - t.start), [le]), K = G.length ? Math.min(...G.map((e) => e.start)) : H - 1, Ke = G.length ? Math.max(K + 1, ...G.map((e) => e.end == null ? H : e.end)) : H, qe = (Ke - K) * .03;
58
+ }) : null, G = i(() => pe.slice().sort((e, t) => e.start - t.start), [pe]), K = G.length ? Math.min(...G.map((e) => e.start)) : V - 1, Ke = G.length ? Math.max(K + 1, ...G.map((e) => e.end == null ? V : e.end)) : V, qe = (Ke - K) * .03;
59
59
  K -= qe, Ke += qe;
60
- let Je = Ke - K, q = Math.max(240, Be - w - oe) / Je, J = Oe || !Ee ? q : Ee, Ye = v(q), Xe = v(J);
60
+ let Je = Ke - K, q = Math.max(240, H - b - ue) / Je, J = je || !ke ? q : ke, Ye = a(q), Xe = a(J);
61
61
  Ye.current = q, Xe.current = J;
62
- let Y = v(null);
63
- ie(() => {
64
- Y.current != null && F.current && (F.current.scrollLeft = Y.current, Y.current = null), Le();
62
+ let Y = a(null);
63
+ r(() => {
64
+ Y.current != null && M.current && (M.current.scrollLeft = Y.current, Y.current = null), B();
65
65
  });
66
- let Ze = _((e, t) => {
67
- let n = F.current;
66
+ let Ze = t((e, t) => {
67
+ let n = M.current;
68
68
  if (!n) return;
69
- let r = Xe.current || 1e-4, i = Math.max(Ye.current ? Ye.current * .2 : 1e-9, Math.min(1, r * e)), a = (n.scrollLeft + t - w) / r;
70
- Y.current = a * i + w - t, ke(!1), De(i);
69
+ let r = Xe.current || 1e-4, i = Math.max(Ye.current ? Ye.current * .2 : 1e-9, Math.min(1, r * e)), a = (n.scrollLeft + t - b) / r;
70
+ Y.current = a * i + b - t, Me(!1), Ae(i);
71
71
  }, []);
72
- m(F, (e) => {
73
- if (!h(D, e)) return;
72
+ ce(M, (e) => {
73
+ if (!le(w, e)) return;
74
74
  e.preventDefault();
75
- let t = F.current;
75
+ let t = M.current;
76
76
  t && Ze(Math.exp(-e.deltaY * .0018), e.clientX - t.getBoundingClientRect().left);
77
77
  });
78
78
  let X = (e) => {
79
- A === void 0 && je(e ? e.id : null), Se?.(e);
79
+ D === void 0 && Pe(e ? e.id : null), Te?.(e);
80
80
  }, Qe = (e) => {
81
81
  let t = window.innerWidth || 1200, n = window.innerHeight || 800;
82
82
  return {
83
83
  x: e.clientX < t * .55 ? Math.max(12, t - 340) : 16,
84
84
  y: Math.max(130, Math.min(e.clientY, n - 130))
85
85
  };
86
- }, Z = ge ? 42 : 54, Q = R == null ? null : G.find((e) => e.id === R) || null, $e = Math.ceil(w + Je * J + oe + 90), et = K + ($e - w) / J, tt = Math.max(K, K + (V.l - T - w) / J), nt = Math.min(et, K + (V.l + V.w + T - w) / J), rt = s(tt, nt, Math.max(1, (nt - tt) * J)).list.map((e) => ({
87
- left: Math.round(w + (e.t - K) * J),
86
+ }, Z = ye ? 42 : 54, Q = F == null ? null : G.find((e) => e.id === F) || null, $e = Math.ceil(b + Je * J + ue + 90), et = K + ($e - b) / J, tt = Math.max(K, K + (R.l - x - b) / J), nt = Math.min(et, K + (R.l + R.w + x - b) / J), rt = ne(tt, nt, Math.max(1, (nt - tt) * J)).list.map((e) => ({
87
+ left: Math.round(b + (e.t - K) * J),
88
88
  label: e.label
89
- })), it = G.filter((e) => e.end == null).length, $ = O ? /* @__PURE__ */ S(c, {
89
+ })), it = G.filter((e) => e.end == null).length, $ = T ? /* @__PURE__ */ v(p, {
90
90
  heading: "Tasks",
91
- className: P?.summary,
92
- placement: k,
93
- floatingDefaultPosition: ye,
94
- bubbleGlyphColors: n.slice(0, 3),
91
+ className: j?.summary,
92
+ placement: E,
93
+ floatingDefaultPosition: Se,
94
+ bubbleGlyphColors: u.slice(0, 3),
95
95
  items: G.map((e, t) => {
96
- let r = e.end == null ? H : e.end, a = Math.round(w + (e.start - K) * J), o = Math.max(14, Math.round(Math.max(0, r - e.start) * J)), s = 34 + t * Z, ee = !z.w || a < z.l + z.w && a + o > z.l, te = !z.h || s < z.t + z.h && s + Z > z.t;
96
+ let n = e.end == null ? V : e.end, r = Math.round(b + (e.start - K) * J), i = Math.max(14, Math.round(Math.max(0, n - e.start) * J)), a = 34 + t * Z, o = !I.w || r < I.l + I.w && r + i > I.l, s = !I.h || a < I.t + I.h && a + Z > I.t;
97
97
  return {
98
98
  id: e.id,
99
99
  number: String(t + 1).padStart(2, "0"),
100
100
  label: e.name,
101
- color: n[t % n.length],
102
- time: i(e.start),
103
- inView: ee && te,
104
- selected: R === e.id
101
+ color: u[t % u.length],
102
+ time: te(e.start),
103
+ inView: o && s,
104
+ selected: F === e.id
105
105
  };
106
106
  }),
107
107
  onPick: (e) => {
108
- let t = G.findIndex((t) => t.id === e), n = F.current;
108
+ let t = G.findIndex((t) => t.id === e), n = M.current;
109
109
  if (t < 0 || !n) return;
110
- let r = G[t], i = r.end == null ? H : r.end, a = Math.round(w + (r.start - K) * J), o = Math.max(14, Math.round(Math.max(0, i - r.start) * J)), s = { left: Math.max(0, a + o / 2 - n.clientWidth / 2) };
111
- n.clientHeight && (s.top = Math.max(0, 34 + t * Z + Z / 2 - n.clientHeight / 2)), d(n, s);
110
+ let r = G[t], i = r.end == null ? V : r.end, a = Math.round(b + (r.start - K) * J), o = Math.max(14, Math.round(Math.max(0, i - r.start) * J)), s = { left: Math.max(0, a + o / 2 - n.clientWidth / 2) };
111
+ n.clientHeight && (s.top = Math.max(0, 34 + t * Z + Z / 2 - n.clientHeight / 2)), g(n, s);
112
112
  }
113
113
  }) : null;
114
- return /* @__PURE__ */ C("div", {
115
- ref: ce,
116
- className: b(e.root, P?.root, we),
117
- style: Te,
114
+ return /* @__PURE__ */ y("div", {
115
+ ref: fe,
116
+ className: s(c.root, j?.root, De),
117
+ style: Oe,
118
118
  children: [
119
- (ve || Ge || ue != null || de != null) && /* @__PURE__ */ C("div", {
120
- className: b(e.toolbar, P?.toolbar),
119
+ (xe || Ge || S != null || me != null) && /* @__PURE__ */ y("div", {
120
+ className: s(c.toolbar, j?.toolbar),
121
121
  children: [
122
- /* @__PURE__ */ C("div", {
123
- className: e.toolbarText,
124
- children: [ue != null && /* @__PURE__ */ S("span", {
125
- className: e.toolbarTitle,
126
- children: ue
127
- }), /* @__PURE__ */ S("span", {
128
- className: e.toolbarMeta,
129
- children: de ?? (G.length ? `${G.length} tasks · ${o(Je - 2 * qe)} · ${it} running` : "No tasks")
122
+ /* @__PURE__ */ y("div", {
123
+ className: c.toolbarText,
124
+ children: [S != null && /* @__PURE__ */ v("span", {
125
+ className: c.toolbarTitle,
126
+ children: S
127
+ }), /* @__PURE__ */ v("span", {
128
+ className: c.toolbarMeta,
129
+ children: me ?? (G.length ? `${G.length} tasks · ${f(Je - 2 * qe)} · ${it} running` : "No tasks")
130
130
  })]
131
131
  }),
132
132
  Ge,
133
- ve && /* @__PURE__ */ S(u, {
133
+ xe && /* @__PURE__ */ v(h, {
134
134
  zoomPct: `${Math.round(J / q * 100)}%`,
135
- fitActive: Oe,
136
- onZoomIn: () => Ze(1.5, Be / 2),
137
- onZoomOut: () => Ze(1 / 1.5, Be / 2),
135
+ fitActive: je,
136
+ onZoomIn: () => Ze(1.5, H / 2),
137
+ onZoomOut: () => Ze(1 / 1.5, H / 2),
138
138
  onFit: () => {
139
- ke(!0), De(null);
139
+ Me(!0), Ae(null);
140
140
  },
141
- hint: D === "none" ? "drag pans" : (D === "ctrl" ? "Ctrl+scroll zooms" : "scroll zooms") + " · drag pans"
141
+ hint: w === "none" ? "drag pans" : (w === "ctrl" ? "Ctrl+scroll zooms" : "scroll zooms") + " · drag pans"
142
142
  })
143
143
  ]
144
144
  }),
145
- k === "top" && $,
146
- /* @__PURE__ */ C("div", {
147
- className: e.layout,
145
+ E === "top" && $,
146
+ /* @__PURE__ */ y("div", {
147
+ className: c.layout,
148
148
  children: [
149
- k === "left" && $,
150
- /* @__PURE__ */ C("div", {
151
- className: e.main,
152
- children: [/* @__PURE__ */ C("div", {
153
- className: e.cardWrap,
154
- children: [/* @__PURE__ */ S("div", {
155
- className: b(e.card, P?.card),
156
- children: /* @__PURE__ */ S("div", {
157
- ref: F,
158
- className: b(e.scroller, t.scroller, P?.scroller),
159
- style: { maxHeight: be },
149
+ E === "left" && $,
150
+ /* @__PURE__ */ y("div", {
151
+ className: c.main,
152
+ children: [/* @__PURE__ */ y("div", {
153
+ className: c.cardWrap,
154
+ children: [/* @__PURE__ */ v("div", {
155
+ className: s(c.card, j?.card),
156
+ children: /* @__PURE__ */ v("div", {
157
+ ref: M,
158
+ className: s(c.scroller, l.scroller, j?.scroller),
159
+ style: { maxHeight: Ce },
160
160
  onPointerDown: U.onPointerDown,
161
161
  onPointerMove: U.onPointerMove,
162
162
  onPointerUp: U.onPointerUp,
163
163
  onPointerLeave: U.onPointerUp,
164
- onScroll: Re,
165
- children: /* @__PURE__ */ C("div", {
166
- className: t.inner,
164
+ onScroll: ze,
165
+ children: /* @__PURE__ */ y("div", {
166
+ className: l.inner,
167
167
  style: { width: $e },
168
168
  children: [
169
- _e && rt.map((e, n) => /* @__PURE__ */ S("div", {
170
- className: t.gridline,
169
+ be && rt.map((e, t) => /* @__PURE__ */ v("div", {
170
+ className: l.gridline,
171
171
  style: { left: e.left }
172
- }, n)),
173
- ze && /* @__PURE__ */ S("div", {
174
- className: t.nowLine,
175
- style: { left: Math.round(w + (H - K) * J) }
172
+ }, t)),
173
+ Be && /* @__PURE__ */ v("div", {
174
+ className: l.nowLine,
175
+ style: { left: Math.round(b + (V - K) * J) }
176
176
  }),
177
- /* @__PURE__ */ S("div", {
178
- className: b(t.axis, P?.axis),
179
- children: rt.map((e, n) => /* @__PURE__ */ S("div", {
180
- className: t.axisLabel,
177
+ /* @__PURE__ */ v("div", {
178
+ className: s(l.axis, j?.axis),
179
+ children: rt.map((e, t) => /* @__PURE__ */ v("div", {
180
+ className: l.axisLabel,
181
181
  style: { left: e.left },
182
182
  children: e.label
183
- }, n))
183
+ }, t))
184
184
  }),
185
- G.map((s, c) => {
186
- let l = s.end == null, u = l ? H : s.end, d = Math.max(0, u - s.start), ne = r(s, W), f = n[c % n.length], p = Math.round(w + (s.start - K) * J), m = Math.max(14, Math.round(d * J)), h = o(d) + (l ? " · running" : ""), g = m > 130, _ = {
187
- index: c,
188
- color: f,
189
- running: l,
190
- durationMs: d
185
+ G.map((e, t) => {
186
+ let n = e.end == null, r = n ? V : e.end, i = Math.max(0, r - e.start), a = ee(e, W), o = u[t % u.length], ne = Math.round(b + (e.start - K) * J), p = Math.max(14, Math.round(i * J)), m = f(i) + (n ? " · running" : ""), h = p > 130, g = {
187
+ index: t,
188
+ color: o,
189
+ running: n,
190
+ durationMs: i
191
191
  };
192
- return /* @__PURE__ */ C("div", {
193
- className: b(t.row, P?.row),
192
+ return /* @__PURE__ */ y("div", {
193
+ className: s(l.row, j?.row),
194
194
  style: {
195
195
  height: Z,
196
- opacity: W && !ne ? .3 : 1
196
+ opacity: W && !a ? .3 : 1
197
197
  },
198
198
  children: [
199
- /* @__PURE__ */ S("div", {
200
- className: b(t.rowLabel, P?.rowLabel),
201
- children: Ce ? Ce(s, _) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("span", {
202
- className: t.rowName,
203
- children: /* @__PURE__ */ S(te, {
204
- text: s.name,
199
+ /* @__PURE__ */ v("div", {
200
+ className: s(l.rowLabel, j?.rowLabel),
201
+ children: Ee ? Ee(e, g) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("span", {
202
+ className: l.rowName,
203
+ children: /* @__PURE__ */ v(ie, {
204
+ text: e.name,
205
205
  query: W
206
206
  })
207
- }), /* @__PURE__ */ S("span", {
208
- className: t.rowDates,
209
- children: i(s.start) + (l ? " → now" : " → " + i(u))
207
+ }), /* @__PURE__ */ v("span", {
208
+ className: l.rowDates,
209
+ children: te(e.start) + (n ? " → now" : " → " + te(r))
210
210
  })] })
211
211
  }),
212
- /* @__PURE__ */ S("div", {
213
- className: b(t.bar, l && t.barRunning, P?.bar),
212
+ /* @__PURE__ */ v("div", {
213
+ className: s(l.bar, n && l.barRunning, j?.bar),
214
214
  style: {
215
- left: p,
216
- top: Math.round((Z - se) / 2),
217
- width: m,
218
- borderColor: f,
219
- background: l ? ee(f, 72) : f,
220
- boxShadow: W && ne ? "0 0 0 3px var(--crk-timeline-hl-ring, #f3d98b)" : "none"
215
+ left: ne,
216
+ top: Math.round((Z - de) / 2),
217
+ width: p,
218
+ borderColor: o,
219
+ background: n ? re(o, 72) : o,
220
+ boxShadow: W && a ? "0 0 0 3px var(--crk-timeline-hl-ring, #f3d98b)" : "none"
221
221
  },
222
222
  onClick: () => {
223
- U.wasDragSuppressed() || (L(null), X(R === s.id ? null : s));
223
+ U.wasDragSuppressed() || (P(null), X(F === e.id ? null : e));
224
224
  },
225
- onMouseEnter: (e) => {
226
- if (R === s.id) return;
227
- let t = Qe(e);
228
- L({
229
- ...t,
230
- id: s.id,
231
- title: s.name,
232
- time: a(s.start) + (l ? "" : " → " + a(u)),
233
- durLine: (l ? "running · " : "took ") + o(d) + (s.owner ? " · " + s.owner : ""),
234
- detail: s.detail || ""
225
+ onMouseEnter: (t) => {
226
+ if (F === e.id) return;
227
+ let a = Qe(t);
228
+ P({
229
+ ...a,
230
+ id: e.id,
231
+ title: e.name,
232
+ time: d(e.start) + (n ? "" : " → " + d(r)),
233
+ durLine: (n ? "running · " : "took ") + f(i) + (e.owner ? " · " + e.owner : ""),
234
+ detail: e.detail || ""
235
235
  });
236
236
  },
237
- onMouseLeave: () => L(null),
238
- children: j ? j(s, _) : /* @__PURE__ */ C(x, { children: [l && /* @__PURE__ */ S("span", { className: b(e.pulseDot, t.barDot) }), g && /* @__PURE__ */ S("span", {
239
- className: t.barTextInside,
240
- children: h
237
+ onMouseLeave: () => P(null),
238
+ children: O ? O(e, g) : /* @__PURE__ */ y(_, { children: [n && /* @__PURE__ */ v("span", { className: s(c.pulseDot, l.barDot) }), h && /* @__PURE__ */ v("span", {
239
+ className: l.barTextInside,
240
+ children: m
241
241
  })] })
242
242
  }),
243
- !j && !g && /* @__PURE__ */ S("div", {
244
- className: t.barTextOutside,
245
- style: { left: p + m + 10 },
246
- children: h
243
+ !O && !h && /* @__PURE__ */ v("div", {
244
+ className: l.barTextOutside,
245
+ style: { left: ne + p + 10 },
246
+ children: m
247
247
  })
248
248
  ]
249
- }, s.id);
249
+ }, e.id);
250
250
  })
251
251
  ]
252
252
  })
253
253
  })
254
- }), k === "bubble" && $]
255
- }), /* @__PURE__ */ S("div", {
256
- className: b(e.footnote, P?.footnote),
254
+ }), E === "bubble" && $]
255
+ }), /* @__PURE__ */ v("div", {
256
+ className: s(c.footnote, j?.footnote),
257
257
  children: "Click a bar to open details in the side panel · dashed bars are still running and keep growing"
258
258
  })]
259
259
  }),
260
- Q && N && /* @__PURE__ */ S("aside", {
261
- className: b(e.aside, t.drawer, P?.drawer),
262
- children: N(Q, {
260
+ Q && A && /* @__PURE__ */ v("aside", {
261
+ className: s(c.aside, l.drawer, j?.drawer),
262
+ children: A(Q, {
263
263
  close: () => X(null),
264
264
  running: Q.end == null
265
265
  })
266
266
  }),
267
- Q && !N && /* @__PURE__ */ C("aside", {
268
- className: b(e.aside, t.drawer, P?.drawer),
267
+ Q && !A && /* @__PURE__ */ y("aside", {
268
+ className: s(c.aside, l.drawer, j?.drawer),
269
269
  children: [
270
- /* @__PURE__ */ C("div", {
271
- className: t.drawerHead,
270
+ /* @__PURE__ */ y("div", {
271
+ className: l.drawerHead,
272
272
  children: [
273
- /* @__PURE__ */ S("span", {
274
- className: t.drawerSwatch,
275
- style: { background: n[G.indexOf(Q) % n.length] }
273
+ /* @__PURE__ */ v("span", {
274
+ className: l.drawerSwatch,
275
+ style: { background: u[G.indexOf(Q) % u.length] }
276
276
  }),
277
- /* @__PURE__ */ S("span", {
278
- className: t.drawerOwner,
277
+ /* @__PURE__ */ v("span", {
278
+ className: l.drawerOwner,
279
279
  children: Q.owner || "—"
280
280
  }),
281
- /* @__PURE__ */ S("span", {
282
- className: b(t.drawerState, Q.end == null && t.drawerStateRunning),
281
+ /* @__PURE__ */ v("span", {
282
+ className: s(l.drawerState, Q.end == null && l.drawerStateRunning),
283
283
  children: Q.end == null ? "running" : "done"
284
284
  }),
285
- /* @__PURE__ */ S("div", { className: t.drawerSpacer }),
286
- /* @__PURE__ */ S("button", {
285
+ /* @__PURE__ */ v("div", { className: l.drawerSpacer }),
286
+ /* @__PURE__ */ v("button", {
287
287
  type: "button",
288
- className: e.asideClose,
288
+ className: c.asideClose,
289
289
  "aria-label": "Close details",
290
290
  onClick: () => X(null),
291
291
  children: "✕"
292
292
  })
293
293
  ]
294
294
  }),
295
- /* @__PURE__ */ S("div", {
296
- className: t.drawerName,
295
+ /* @__PURE__ */ v("div", {
296
+ className: l.drawerName,
297
297
  children: Q.name
298
298
  }),
299
- /* @__PURE__ */ S("div", {
300
- className: t.drawerTiming,
301
- children: a(Q.start) + " → " + (Q.end == null ? "now" : a(Q.end)) + " · " + o((Q.end == null ? H : Q.end) - Q.start)
299
+ /* @__PURE__ */ v("div", {
300
+ className: l.drawerTiming,
301
+ children: d(Q.start) + " → " + (Q.end == null ? "now" : d(Q.end)) + " · " + f((Q.end == null ? V : Q.end) - Q.start)
302
302
  }),
303
- /* @__PURE__ */ S("div", {
304
- className: t.drawerDetail,
303
+ /* @__PURE__ */ v("div", {
304
+ className: l.drawerDetail,
305
305
  children: Q.detail || "—"
306
306
  }),
307
- /* @__PURE__ */ S("div", {
308
- className: e.asideSection,
307
+ /* @__PURE__ */ v("div", {
308
+ className: c.asideSection,
309
309
  children: "Raw event"
310
310
  }),
311
- /* @__PURE__ */ S("pre", {
312
- className: e.asideRaw,
311
+ /* @__PURE__ */ v("pre", {
312
+ className: c.asideRaw,
313
313
  children: JSON.stringify(Q, null, 2)
314
314
  })
315
315
  ]
316
316
  }),
317
- (k === "right" || k === "floating") && $
317
+ (E === "right" || E === "floating") && $
318
318
  ]
319
319
  }),
320
- k === "bottom" && $,
321
- I && (() => {
322
- let t = G.find((e) => e.id === I.id), r = t && M ? M(t, {
323
- index: G.indexOf(t),
324
- color: n[G.indexOf(t) % n.length],
325
- running: t.end == null,
326
- durationMs: (t.end == null ? H : t.end) - t.start
320
+ E === "bottom" && $,
321
+ N && (() => {
322
+ let e = G.find((e) => e.id === N.id), t = e && k ? k(e, {
323
+ index: G.indexOf(e),
324
+ color: u[G.indexOf(e) % u.length],
325
+ running: e.end == null,
326
+ durationMs: (e.end == null ? V : e.end) - e.start
327
327
  }) : void 0;
328
- return M && r == null ? null : /* @__PURE__ */ S(l, {
329
- x: I.x,
330
- y: I.y,
331
- className: P?.tooltip,
332
- children: r === void 0 ? /* @__PURE__ */ C(x, { children: [
333
- /* @__PURE__ */ S("div", {
334
- className: e.tooltipTitle,
335
- children: I.title
328
+ return k && t == null ? null : /* @__PURE__ */ v(m, {
329
+ x: N.x,
330
+ y: N.y,
331
+ className: j?.tooltip,
332
+ children: t === void 0 ? /* @__PURE__ */ y(_, { children: [
333
+ /* @__PURE__ */ v("div", {
334
+ className: c.tooltipTitle,
335
+ children: N.title
336
336
  }),
337
- /* @__PURE__ */ S("div", {
338
- className: b(e.tooltipLine, e.tooltipMono),
337
+ /* @__PURE__ */ v("div", {
338
+ className: s(c.tooltipLine, c.tooltipMono),
339
339
  style: { marginTop: 4 },
340
- children: I.time
340
+ children: N.time
341
341
  }),
342
- /* @__PURE__ */ S("div", {
343
- className: e.tooltipLine,
344
- children: I.durLine
342
+ /* @__PURE__ */ v("div", {
343
+ className: c.tooltipLine,
344
+ children: N.durLine
345
345
  }),
346
- I.detail && /* @__PURE__ */ S("div", {
347
- className: e.tooltipDim,
346
+ N.detail && /* @__PURE__ */ v("div", {
347
+ className: c.tooltipDim,
348
348
  style: { marginTop: 5 },
349
- children: I.detail
349
+ children: N.detail
350
350
  })
351
- ] }) : r
351
+ ] }) : t
352
352
  });
353
353
  })()
354
354
  ]
355
355
  });
356
356
  });
357
- export { ce as GanttTimeline };
357
+ export { fe as GanttTimeline };