@overdoser/react-toolkit 0.20.0 → 0.21.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 (273) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +14 -0
  3. package/components/Accordion/Accordion.js +160 -177
  4. package/components/Accordion/Accordion.module.js +20 -0
  5. package/components/ActionButton/ActionButton.js +155 -209
  6. package/components/ActionButton/ActionButton.module.js +25 -0
  7. package/components/ActionButton/CopyButton.js +52 -64
  8. package/components/Alert/Alert.js +92 -95
  9. package/components/Alert/Alert.module.js +18 -0
  10. package/components/Avatar/Avatar.js +44 -55
  11. package/components/Avatar/Avatar.module.js +23 -0
  12. package/components/Badge/Badge.js +16 -38
  13. package/components/Badge/Badge.module.js +17 -0
  14. package/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  15. package/components/Breadcrumbs/Breadcrumbs.js +52 -48
  16. package/components/Breadcrumbs/Breadcrumbs.module.js +10 -0
  17. package/components/Button/Button.js +35 -57
  18. package/components/Button/Button.module.js +25 -0
  19. package/components/Card/Card.js +94 -131
  20. package/components/Card/Card.module.js +35 -0
  21. package/components/Chart/AreaChart.d.ts +1 -1
  22. package/components/Chart/AreaChart.js +248 -249
  23. package/components/Chart/Axis.d.ts +2 -2
  24. package/components/Chart/Axis.js +34 -43
  25. package/components/Chart/BarChart.d.ts +1 -1
  26. package/components/Chart/BarChart.js +307 -348
  27. package/components/Chart/Chart.module.js +32 -0
  28. package/components/Chart/ChartContainer.js +33 -41
  29. package/components/Chart/ChartLegend.d.ts +1 -1
  30. package/components/Chart/ChartLegend.js +31 -30
  31. package/components/Chart/ChartTooltip.d.ts +1 -1
  32. package/components/Chart/ChartTooltip.js +46 -41
  33. package/components/Chart/LineChart.d.ts +1 -1
  34. package/components/Chart/LineChart.js +220 -232
  35. package/components/Chart/PieChart.d.ts +1 -1
  36. package/components/Chart/PieChart.js +224 -240
  37. package/components/Chart/RadarChart.d.ts +1 -1
  38. package/components/Chart/RadarChart.js +166 -215
  39. package/components/Chart/Sparkline.js +73 -68
  40. package/components/Chart/TradingChart.d.ts +1 -1
  41. package/components/Chart/TradingChart.js +804 -701
  42. package/components/Chart/scales.js +28 -35
  43. package/components/Chart/trading/indicators.js +61 -62
  44. package/components/Chart/trading/period.js +46 -68
  45. package/components/Chart/useChartDimensions.js +30 -22
  46. package/components/Chip/Chip.js +98 -141
  47. package/components/Chip/Chip.module.js +32 -0
  48. package/components/CodeBlock/CodeBlock.js +111 -119
  49. package/components/CodeBlock/CodeBlock.module.js +23 -0
  50. package/components/CommandPalette/CommandPalette.js +387 -392
  51. package/components/CommandPalette/CommandPalette.module.js +28 -0
  52. package/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
  53. package/components/ConfirmDialog/ConfirmDialog.js +184 -199
  54. package/components/ConfirmDialog/ConfirmDialog.module.js +12 -0
  55. package/components/Divider/Divider.js +25 -36
  56. package/components/Divider/Divider.module.js +17 -0
  57. package/components/Draggable/Draggable.d.ts +1 -1
  58. package/components/Draggable/Draggable.js +157 -164
  59. package/components/Draggable/Draggable.module.js +10 -0
  60. package/components/Drawer/Drawer.js +104 -126
  61. package/components/Drawer/Drawer.module.js +66 -0
  62. package/components/Dropdown/Dropdown.js +175 -234
  63. package/components/Dropdown/Dropdown.module.js +29 -0
  64. package/components/Dropdown/DropdownItem.js +55 -58
  65. package/components/Dropdown/DropdownLabel.js +14 -11
  66. package/components/Dropdown/DropdownSeparator.js +12 -10
  67. package/components/Dropdown/dropdownContext.js +4 -5
  68. package/components/Dropdown/useContextMenu.js +27 -17
  69. package/components/Dropzone/Dropzone.js +99 -105
  70. package/components/Dropzone/Dropzone.module.js +12 -0
  71. package/components/EmptyState/EmptyState.js +58 -55
  72. package/components/EmptyState/EmptyState.module.js +14 -0
  73. package/components/Form/Form.d.ts +1 -1
  74. package/components/Form/Form.js +32 -35
  75. package/components/Form/Form.module.js +16 -0
  76. package/components/Form/FormField.d.ts +1 -1
  77. package/components/Form/FormField.js +71 -75
  78. package/components/Form/FormRow.d.ts +1 -1
  79. package/components/Form/FormRow.js +11 -8
  80. package/components/Form/formFieldDefaults.js +4 -5
  81. package/components/ImageViewer/ImageViewer.js +312 -201
  82. package/components/ImageViewer/ImageViewer.module.js +26 -0
  83. package/components/ImageViewer/useZoomPan.js +206 -137
  84. package/components/Kbd/Kbd.js +25 -22
  85. package/components/Kbd/Kbd.module.js +10 -0
  86. package/components/KeyValueList/KeyValueList.js +119 -123
  87. package/components/KeyValueList/KeyValueList.module.js +23 -0
  88. package/components/Link/Link.js +45 -59
  89. package/components/Link/Link.module.js +10 -0
  90. package/components/List/List.js +22 -46
  91. package/components/List/List.module.js +12 -0
  92. package/components/Loader/Loader.js +152 -182
  93. package/components/Loader/Loader.module.js +40 -0
  94. package/components/Modal/Modal.js +93 -105
  95. package/components/Modal/Modal.module.js +18 -0
  96. package/components/PageHeader/PageHeader.js +78 -72
  97. package/components/PageHeader/PageHeader.module.js +23 -0
  98. package/components/Pagination/Pagination.js +63 -84
  99. package/components/Pagination/Pagination.module.js +13 -0
  100. package/components/Pagination/paginationRange.js +15 -22
  101. package/components/Popover/Popover.js +110 -134
  102. package/components/Popover/Popover.module.js +12 -0
  103. package/components/ProgressBar/ProgressBar.d.ts +15 -1
  104. package/components/ProgressBar/ProgressBar.js +57 -90
  105. package/components/ProgressBar/ProgressBar.module.js +29 -0
  106. package/components/RelativeTime/RelativeTime.js +36 -43
  107. package/components/RelativeTime/RelativeTime.module.js +3 -0
  108. package/components/SegmentedControl/SegmentedControl.js +94 -130
  109. package/components/SegmentedControl/SegmentedControl.module.js +21 -0
  110. package/components/Skeleton/Skeleton.js +36 -50
  111. package/components/Skeleton/Skeleton.module.js +15 -0
  112. package/components/Spinner/Spinner.js +25 -25
  113. package/components/Spinner/Spinner.module.js +12 -0
  114. package/components/SplitButton/SplitButton.js +149 -196
  115. package/components/SplitButton/SplitButton.module.js +31 -0
  116. package/components/SplitPane/SplitPane.js +134 -170
  117. package/components/SplitPane/SplitPane.module.js +14 -0
  118. package/components/StatCard/StatCard.js +132 -125
  119. package/components/StatCard/StatCard.module.js +42 -0
  120. package/components/StatusDot/StatusDot.js +28 -39
  121. package/components/StatusDot/StatusDot.module.js +18 -0
  122. package/components/Table/Table.d.ts +1 -1
  123. package/components/Table/Table.js +381 -451
  124. package/components/Table/Table.module.js +42 -0
  125. package/components/Table/useTableSort.js +51 -42
  126. package/components/Tabs/Tabs.js +109 -161
  127. package/components/Tabs/Tabs.module.js +28 -0
  128. package/components/ThemeToggle/ThemeToggle.js +122 -98
  129. package/components/ThemeToggle/ThemeToggle.module.js +13 -0
  130. package/components/Timeline/GanttTimeline.js +357 -318
  131. package/components/Timeline/GanttTimeline.module.js +29 -0
  132. package/components/Timeline/HistoryTimeline.js +486 -450
  133. package/components/Timeline/HistoryTimeline.module.js +31 -0
  134. package/components/Timeline/Timeline.module.js +76 -0
  135. package/components/Timeline/TimelineShared.d.ts +7 -7
  136. package/components/Timeline/TimelineShared.js +288 -279
  137. package/components/Timeline/TraceEventDetails.d.ts +3 -3
  138. package/components/Timeline/TraceEventDetails.js +245 -178
  139. package/components/Timeline/TraceTimeline.js +823 -783
  140. package/components/Timeline/TraceTimeline.module.js +98 -0
  141. package/components/Timeline/historyLayout.js +336 -263
  142. package/components/Timeline/timelineCore.js +208 -183
  143. package/components/Timeline/traceEvent.js +59 -61
  144. package/components/Timeline/traceLayout.js +101 -90
  145. package/components/Timeline/useTimeline.js +76 -79
  146. package/components/Timer/Timer.js +190 -156
  147. package/components/Timer/Timer.module.js +29 -0
  148. package/components/Toast/Toast.d.ts +1 -1
  149. package/components/Toast/Toast.js +128 -128
  150. package/components/Toast/Toast.module.js +37 -0
  151. package/components/Toast/toastStore.js +58 -62
  152. package/components/ToggleIconButton/ToggleIconButton.js +35 -57
  153. package/components/ToggleIconButton/ToggleIconButton.module.js +15 -0
  154. package/components/Tooltip/Tooltip.d.ts +1 -1
  155. package/components/Tooltip/Tooltip.js +76 -85
  156. package/components/Tooltip/Tooltip.module.js +17 -0
  157. package/components/Typography/Typography.js +11 -36
  158. package/components/Typography/Typography.module.js +30 -0
  159. package/components/inputs/Checkbox/Checkbox.js +27 -51
  160. package/components/inputs/Checkbox/Checkbox.module.js +10 -0
  161. package/components/inputs/Checkbox/CheckboxGroup.js +53 -111
  162. package/components/inputs/Checkbox/CheckboxGroup.module.js +17 -0
  163. package/components/inputs/DatePicker/CalendarPanel.d.ts +1 -1
  164. package/components/inputs/DatePicker/CalendarPanel.js +263 -286
  165. package/components/inputs/DatePicker/CalendarPanel.module.js +23 -0
  166. package/components/inputs/DatePicker/DatePicker.js +115 -142
  167. package/components/inputs/DatePicker/DatePicker.module.js +14 -0
  168. package/components/inputs/DatePicker/dateUtils.js +32 -41
  169. package/components/inputs/DateTimePicker/DateTimePicker.js +226 -232
  170. package/components/inputs/DateTimePicker/DateTimePicker.module.js +20 -0
  171. package/components/inputs/DateTimePicker/DateTimeSegments.js +273 -252
  172. package/components/inputs/DateTimePicker/TimeField.d.ts +1 -1
  173. package/components/inputs/DateTimePicker/TimeField.js +131 -132
  174. package/components/inputs/DateTimePicker/timeZoneUtils.js +95 -92
  175. package/components/inputs/Input/Input.js +98 -109
  176. package/components/inputs/Input/Input.module.js +15 -0
  177. package/components/inputs/NumberInput/NumberInput.js +112 -132
  178. package/components/inputs/NumberInput/NumberInput.module.js +14 -0
  179. package/components/inputs/Radio/Radio.js +50 -73
  180. package/components/inputs/Radio/Radio.module.js +9 -0
  181. package/components/inputs/SearchInput/SearchInput.js +98 -115
  182. package/components/inputs/SearchInput/SearchInput.module.js +8 -0
  183. package/components/inputs/Select/Select.js +555 -682
  184. package/components/inputs/Select/Select.module.js +38 -0
  185. package/components/inputs/Slider/Slider.js +97 -128
  186. package/components/inputs/Slider/Slider.module.js +9 -0
  187. package/components/inputs/Switch/Switch.js +11 -8
  188. package/components/inputs/Textarea/Textarea.js +42 -58
  189. package/components/inputs/Textarea/Textarea.module.js +14 -0
  190. package/hooks/useClickOutside.js +17 -14
  191. package/hooks/useDebouncedValue.js +13 -14
  192. package/hooks/useElementSize.js +27 -22
  193. package/hooks/useEscapeLayer.js +28 -29
  194. package/hooks/useFocusTrap.js +27 -38
  195. package/hooks/useKeyboard.js +76 -64
  196. package/hooks/useMediaQuery.js +10 -15
  197. package/hooks/useNow.js +28 -33
  198. package/hooks/usePersistedState.js +98 -94
  199. package/hooks/usePortalPosition.js +25 -19
  200. package/hooks/useResizable.js +106 -104
  201. package/hooks/useTheme.js +28 -23
  202. package/index.css +2 -1
  203. package/index.js +97 -215
  204. package/index.layered.css +2 -3
  205. package/llms.txt +3 -0
  206. package/manifest.json +8 -0
  207. package/package.json +1 -1
  208. package/utils/formatBytes.js +29 -13
  209. package/utils/themeScript.js +6 -8
  210. package/utils/timeAgo.js +59 -32
  211. package/components/Accordion/Accordion.module.scss.js +0 -36
  212. package/components/ActionButton/ActionButton.module.scss.js +0 -47
  213. package/components/Alert/Alert.module.scss.js +0 -33
  214. package/components/Avatar/Avatar.module.scss.js +0 -43
  215. package/components/Badge/Badge.module.scss.js +0 -31
  216. package/components/Breadcrumbs/Breadcrumbs.module.scss.js +0 -17
  217. package/components/Button/Button.module.scss.js +0 -47
  218. package/components/Card/Card.module.scss.js +0 -60
  219. package/components/Chart/Chart.module.scss.js +0 -61
  220. package/components/Chip/Chip.module.scss.js +0 -59
  221. package/components/CodeBlock/CodeBlock.module.scss.js +0 -43
  222. package/components/CommandPalette/CommandPalette.module.scss.js +0 -49
  223. package/components/ConfirmDialog/ConfirmDialog.module.scss.js +0 -21
  224. package/components/Divider/Divider.module.scss.js +0 -31
  225. package/components/Draggable/Draggable.module.scss.js +0 -17
  226. package/components/Drawer/Drawer.module.scss.js +0 -119
  227. package/components/Dropdown/Dropdown.module.scss.js +0 -53
  228. package/components/Dropzone/Dropzone.module.scss.js +0 -21
  229. package/components/EmptyState/EmptyState.module.scss.js +0 -25
  230. package/components/Form/Form.module.scss.js +0 -29
  231. package/components/ImageViewer/ImageViewer.module.scss.js +0 -47
  232. package/components/Kbd/Kbd.module.scss.js +0 -17
  233. package/components/KeyValueList/KeyValueList.module.scss.js +0 -43
  234. package/components/Link/Link.module.scss.js +0 -16
  235. package/components/List/List.module.scss.js +0 -21
  236. package/components/Loader/Loader.module.scss.js +0 -70
  237. package/components/Modal/Modal.module.scss.js +0 -33
  238. package/components/PageHeader/PageHeader.module.scss.js +0 -43
  239. package/components/Pagination/Pagination.module.scss.js +0 -23
  240. package/components/Popover/Popover.module.scss.js +0 -21
  241. package/components/ProgressBar/ProgressBar.module.scss.js +0 -51
  242. package/components/RelativeTime/RelativeTime.module.scss.js +0 -7
  243. package/components/SegmentedControl/SegmentedControl.module.scss.js +0 -39
  244. package/components/Skeleton/Skeleton.module.scss.js +0 -25
  245. package/components/Spinner/Spinner.module.scss.js +0 -20
  246. package/components/SplitButton/SplitButton.module.scss.js +0 -57
  247. package/components/SplitPane/SplitPane.module.scss.js +0 -25
  248. package/components/StatCard/StatCard.module.scss.js +0 -72
  249. package/components/StatusDot/StatusDot.module.scss.js +0 -32
  250. package/components/Table/Table.module.scss.js +0 -81
  251. package/components/Tabs/Tabs.module.scss.js +0 -53
  252. package/components/ThemeToggle/ThemeToggle.module.scss.js +0 -23
  253. package/components/Timeline/GanttTimeline.module.scss.js +0 -55
  254. package/components/Timeline/HistoryTimeline.module.scss.js +0 -59
  255. package/components/Timeline/Timeline.module.scss.js +0 -141
  256. package/components/Timeline/TraceTimeline.module.scss.js +0 -189
  257. package/components/Timer/Timer.module.scss.js +0 -55
  258. package/components/Toast/Toast.module.scss.js +0 -62
  259. package/components/ToggleIconButton/ToggleIconButton.module.scss.js +0 -27
  260. package/components/Tooltip/Tooltip.module.scss.js +0 -30
  261. package/components/Typography/Typography.module.scss.js +0 -53
  262. package/components/inputs/Checkbox/Checkbox.module.scss.js +0 -17
  263. package/components/inputs/Checkbox/CheckboxGroup.module.scss.js +0 -31
  264. package/components/inputs/DatePicker/CalendarPanel.module.scss.js +0 -41
  265. package/components/inputs/DatePicker/DatePicker.module.scss.js +0 -25
  266. package/components/inputs/DateTimePicker/DateTimePicker.module.scss.js +0 -37
  267. package/components/inputs/Input/Input.module.scss.js +0 -27
  268. package/components/inputs/NumberInput/NumberInput.module.scss.js +0 -25
  269. package/components/inputs/Radio/Radio.module.scss.js +0 -15
  270. package/components/inputs/SearchInput/SearchInput.module.scss.js +0 -13
  271. package/components/inputs/Select/Select.module.scss.js +0 -73
  272. package/components/inputs/Slider/Slider.module.scss.js +0 -15
  273. package/components/inputs/Textarea/Textarea.module.scss.js +0 -25
@@ -1,286 +1,295 @@
1
- import { jsxs as h, Fragment as L, jsx as t } from "react/jsx-runtime";
2
- import { useRef as T, useState as D, useEffect as S } from "react";
3
- import c from "clsx";
4
- import e from "./Timeline.module.scss.js";
5
- import { highlightParts as Z } from "./timelineCore.js";
6
- import { Draggable as E } from "../Draggable/Draggable.js";
7
- function G({
8
- items: o,
9
- className: s
10
- }) {
11
- return o.length ? /* @__PURE__ */ t("div", { className: c(e.legend, s), children: o.map((a) => /* @__PURE__ */ h("span", { className: e.legendItem, children: [
12
- /* @__PURE__ */ t("span", { className: e.legendDot, style: { background: a.color } }),
13
- a.name
14
- ] }, a.name)) }) : null;
1
+ import e from "./Timeline.module.js";
2
+ import { highlightParts as t } from "./timelineCore.js";
3
+ import { Draggable as n } from "../Draggable/Draggable.js";
4
+ import { useEffect as r, useRef as i, useState as a } from "react";
5
+ import o from "clsx";
6
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
7
+ // src/components/Timeline/TimelineShared.tsx
8
+ function u({ items: t, className: n }) {
9
+ return t.length ? /* @__PURE__ */ c("div", {
10
+ className: o(e.legend, n),
11
+ children: t.map((t) => /* @__PURE__ */ l("span", {
12
+ className: e.legendItem,
13
+ children: [/* @__PURE__ */ c("span", {
14
+ className: e.legendDot,
15
+ style: { background: t.color }
16
+ }), t.name]
17
+ }, t.name))
18
+ }) : null;
15
19
  }
16
- function J({
17
- zoomPct: o,
18
- fitActive: s,
19
- onZoomIn: a,
20
- onZoomOut: r,
21
- onFit: i,
22
- hint: p,
23
- children: b,
24
- className: f
25
- }) {
26
- return /* @__PURE__ */ h("div", { className: c(e.controls, f), children: [
27
- b,
28
- /* @__PURE__ */ t("button", { type: "button", className: e.zoomBtn, title: "Zoom out", onClick: r, children: "−" }),
29
- /* @__PURE__ */ t("span", { className: e.zoomPct, children: o }),
30
- /* @__PURE__ */ t("button", { type: "button", className: e.zoomBtn, title: "Zoom in", onClick: a, children: "+" }),
31
- /* @__PURE__ */ t(
32
- "button",
33
- {
34
- type: "button",
35
- className: c(e.fitBtn, s && e.fitBtnActive),
36
- onClick: i,
37
- children: "Fit"
38
- }
39
- ),
40
- p ? /* @__PURE__ */ t("span", { className: e.controlsHint, children: p }) : null
41
- ] });
20
+ function d({ zoomPct: t, fitActive: n, onZoomIn: r, onZoomOut: i, onFit: a, hint: s, children: u, className: d }) {
21
+ return /* @__PURE__ */ l("div", {
22
+ className: o(e.controls, d),
23
+ children: [
24
+ u,
25
+ /* @__PURE__ */ c("button", {
26
+ type: "button",
27
+ className: e.zoomBtn,
28
+ title: "Zoom out",
29
+ onClick: i,
30
+ children: "−"
31
+ }),
32
+ /* @__PURE__ */ c("span", {
33
+ className: e.zoomPct,
34
+ children: t
35
+ }),
36
+ /* @__PURE__ */ c("button", {
37
+ type: "button",
38
+ className: e.zoomBtn,
39
+ title: "Zoom in",
40
+ onClick: r,
41
+ children: "+"
42
+ }),
43
+ /* @__PURE__ */ c("button", {
44
+ type: "button",
45
+ className: o(e.fitBtn, n && e.fitBtnActive),
46
+ onClick: a,
47
+ children: "Fit"
48
+ }),
49
+ s ? /* @__PURE__ */ c("span", {
50
+ className: e.controlsHint,
51
+ children: s
52
+ }) : null
53
+ ]
54
+ });
42
55
  }
43
- function Q({
44
- value: o,
45
- options: s,
46
- onChange: a
47
- }) {
48
- return /* @__PURE__ */ t("div", { className: e.segmented, children: s.map((r) => /* @__PURE__ */ t(
49
- "button",
50
- {
51
- type: "button",
52
- title: r.title,
53
- className: c(e.segmentedBtn, r.value === o && e.segmentedBtnActive),
54
- onClick: () => a(r.value),
55
- children: r.label
56
- },
57
- r.value
58
- )) });
56
+ function f({ value: t, options: n, onChange: r }) {
57
+ return /* @__PURE__ */ c("div", {
58
+ className: e.segmented,
59
+ children: n.map((n) => /* @__PURE__ */ c("button", {
60
+ type: "button",
61
+ title: n.title,
62
+ className: o(e.segmentedBtn, n.value === t && e.segmentedBtnActive),
63
+ onClick: () => r(n.value),
64
+ children: n.label
65
+ }, n.value))
66
+ });
59
67
  }
60
- function j({
61
- panel: o,
62
- width: s,
63
- min: a,
64
- max: r,
65
- onResize: i,
66
- label: p,
67
- className: b
68
- }) {
69
- const f = T(null), [y, B] = D(!1), g = T(s);
70
- g.current = s;
71
- const u = (l) => Math.min(r, Math.max(a, l));
72
- return S(() => {
73
- if (!y) return;
74
- const l = (P) => {
75
- const k = f.current;
76
- if (!k) return;
77
- const v = P.clientX - k.x;
78
- i(Math.min(r, Math.max(a, k.w + (o === "left" ? v : -v))));
79
- }, d = () => {
80
- f.current = null, B(!1);
81
- };
82
- return window.addEventListener("pointermove", l), window.addEventListener("pointerup", d), () => {
83
- window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", d);
84
- };
85
- }, [y, o, a, r, i]), /* @__PURE__ */ t(
86
- "div",
87
- {
88
- className: c(e.dockResizer, y && e.dockResizerActive, b),
89
- role: "separator",
90
- "aria-orientation": "vertical",
91
- "aria-label": p,
92
- tabIndex: 0,
93
- onPointerDown: (l) => {
94
- l.button > 0 || (l.preventDefault(), f.current = { x: l.clientX, w: g.current }, B(!0));
95
- },
96
- onKeyDown: (l) => {
97
- const d = l.key === "ArrowLeft" ? -16 : l.key === "ArrowRight" ? 16 : 0;
98
- d && (l.preventDefault(), i(u(g.current + (o === "left" ? d : -d))));
99
- }
100
- }
101
- );
68
+ function p({ panel: t, width: n, min: s, max: l, onResize: u, label: d, className: f }) {
69
+ let p = i(null), [m, h] = a(!1), g = i(n);
70
+ g.current = n;
71
+ let _ = (e) => Math.min(l, Math.max(s, e));
72
+ return r(() => {
73
+ if (!m) return;
74
+ let e = (e) => {
75
+ let n = p.current;
76
+ if (!n) return;
77
+ let r = e.clientX - n.x;
78
+ u(Math.min(l, Math.max(s, n.w + (t === "left" ? r : -r))));
79
+ }, n = () => {
80
+ p.current = null, h(!1);
81
+ };
82
+ return window.addEventListener("pointermove", e), window.addEventListener("pointerup", n), () => {
83
+ window.removeEventListener("pointermove", e), window.removeEventListener("pointerup", n);
84
+ };
85
+ }, [
86
+ m,
87
+ t,
88
+ s,
89
+ l,
90
+ u
91
+ ]), /* @__PURE__ */ c("div", {
92
+ className: o(e.dockResizer, m && e.dockResizerActive, f),
93
+ role: "separator",
94
+ "aria-orientation": "vertical",
95
+ "aria-label": d,
96
+ tabIndex: 0,
97
+ onPointerDown: (e) => {
98
+ e.button > 0 || (e.preventDefault(), p.current = {
99
+ x: e.clientX,
100
+ w: g.current
101
+ }, h(!0));
102
+ },
103
+ onKeyDown: (e) => {
104
+ let n = e.key === "ArrowLeft" ? -16 : e.key === "ArrowRight" ? 16 : 0;
105
+ n && (e.preventDefault(), u(_(g.current + (t === "left" ? n : -n))));
106
+ }
107
+ });
102
108
  }
103
- function Y({
104
- heading: o = "Events",
105
- items: s,
106
- onPick: a,
107
- placement: r = "left",
108
- floatingDefaultPosition: i,
109
- bubbleGlyphColors: p,
110
- className: b
111
- }) {
112
- const f = T(null), y = T(!1), [B, g] = D(!1), [u, l] = D(!1), [d, P] = D(262), [k, v] = D({ x: 0, y: 0 }), N = r === "bubble", H = r === "floating", z = H || N && !u, A = r === "top" || r === "bottom";
113
- let w = -1, C = -1;
114
- s.forEach((n, m) => {
115
- n.inView && (w < 0 && (w = m), C = m);
116
- });
117
- const M = w === 0 && C === s.length - 1;
118
- S(() => {
119
- const n = f.current;
120
- if (!n || y.current || w < 0 || M) return;
121
- const m = n.querySelectorAll("[data-timeline-summary-row]"), I = m[w], R = m[C];
122
- if (!I || !R) return;
123
- const V = (I.offsetTop + R.offsetTop + R.offsetHeight) / 2;
124
- n.scrollTop = Math.max(0, V - n.clientHeight / 2);
125
- }, [w, C, M]);
126
- const F = /* @__PURE__ */ h(L, { children: [
127
- /* @__PURE__ */ h("span", { children: [
128
- z && /* @__PURE__ */ t("span", { className: e.summaryGrip, "aria-hidden": !0, children: "⠿" }),
129
- o
130
- ] }),
131
- N ? /* @__PURE__ */ h("span", { className: e.summaryHeadTools, children: [
132
- /* @__PURE__ */ t("span", { className: e.summaryCount, children: s.length }),
133
- /* @__PURE__ */ t(
134
- "button",
135
- {
136
- type: "button",
137
- className: e.summaryDockBtn,
138
- "aria-label": u ? "Undock event summary" : "Dock event summary",
139
- title: u ? "Float the panel" : "Dock to the left edge",
140
- onClick: (n) => {
141
- n.stopPropagation(), l(!u), v({ x: 0, y: 0 });
142
- },
143
- onPointerDown: (n) => n.stopPropagation(),
144
- children: u ? "⇱" : "⇤"
145
- }
146
- ),
147
- /* @__PURE__ */ t(
148
- "button",
149
- {
150
- type: "button",
151
- className: e.summaryCollapse,
152
- "aria-label": "Collapse event summary",
153
- onClick: (n) => {
154
- n.stopPropagation(), g(!1), v({ x: 0, y: 0 });
155
- },
156
- onPointerDown: (n) => n.stopPropagation(),
157
- children: "×"
158
- }
159
- )
160
- ] }) : /* @__PURE__ */ t("span", { className: e.summaryCount, children: s.length })
161
- ] }), x = /* @__PURE__ */ h(
162
- "div",
163
- {
164
- className: c(
165
- e.summary,
166
- A && e.summaryHorizontal,
167
- r === "top" && e.summaryTop,
168
- r === "bottom" && e.summaryBottom,
169
- H && e.summaryFloatingCard,
170
- N && e.summaryBubbleCard,
171
- N && u && e.summaryDockCard,
172
- b
173
- ),
174
- onMouseEnter: () => {
175
- y.current = !0;
176
- },
177
- onMouseLeave: () => {
178
- y.current = !1;
179
- },
180
- children: [
181
- z ? /* @__PURE__ */ t(E.Handle, { className: c(e.summaryHeader, e.summaryHandle), children: F }) : /* @__PURE__ */ t("div", { className: e.summaryHeader, children: F }),
182
- /* @__PURE__ */ t(
183
- "div",
184
- {
185
- ref: f,
186
- className: c(e.summaryList, A && e.summaryListGrid),
187
- children: s.map((n) => /* @__PURE__ */ h(
188
- "div",
189
- {
190
- "data-timeline-summary-row": !0,
191
- role: "button",
192
- tabIndex: 0,
193
- className: c(
194
- e.summaryRow,
195
- n.inView && e.summaryRowInView,
196
- n.selected && e.summaryRowSelected
197
- ),
198
- onClick: () => a(n.id),
199
- onKeyDown: (m) => {
200
- (m.key === "Enter" || m.key === " ") && (m.preventDefault(), a(n.id));
201
- },
202
- children: [
203
- /* @__PURE__ */ t("span", { className: e.summaryNum, children: n.number }),
204
- /* @__PURE__ */ t("span", { className: e.summaryDot, style: { background: n.color } }),
205
- /* @__PURE__ */ t("span", { className: e.summaryLabel, children: n.label }),
206
- n.time && /* @__PURE__ */ t("span", { className: e.summaryTime, children: n.time })
207
- ]
208
- },
209
- n.id
210
- ))
211
- }
212
- ),
213
- N && /* @__PURE__ */ t("div", { className: e.summaryFootnote, children: "Tinted rows are in the viewport" })
214
- ]
215
- }
216
- );
217
- return N ? B ? u ? /* @__PURE__ */ h("div", { className: e.summaryDock, style: { flexBasis: d }, children: [
218
- x,
219
- /* @__PURE__ */ t(
220
- j,
221
- {
222
- panel: "left",
223
- width: d,
224
- min: 200,
225
- max: 520,
226
- onResize: P,
227
- label: "Resize event summary",
228
- className: e.summaryDockResizer
229
- }
230
- )
231
- ] }) : /* @__PURE__ */ t("div", { className: e.summaryBubbleAnchor, children: /* @__PURE__ */ t(
232
- E,
233
- {
234
- className: e.summaryBubblePanel,
235
- bounds: "viewport",
236
- position: k,
237
- onDrag: v,
238
- children: x
239
- }
240
- ) }) : /* @__PURE__ */ t("div", { className: e.summaryBubbleAnchor, children: /* @__PURE__ */ h(
241
- "button",
242
- {
243
- type: "button",
244
- className: c(e.summaryBubble, b),
245
- title: "Event summary",
246
- onClick: () => g(!0),
247
- children: [
248
- /* @__PURE__ */ t("span", { className: e.summaryBubbleGlyph, "aria-hidden": !0, children: (p && p.length ? p : ["var(--crk-timeline-accent)"]).slice(0, 3).map((n, m) => /* @__PURE__ */ t("span", { style: { background: n } }, m)) }),
249
- o,
250
- /* @__PURE__ */ t("span", { className: e.summaryCount, children: s.length })
251
- ]
252
- }
253
- ) }) : H ? /* @__PURE__ */ t(
254
- E,
255
- {
256
- className: e.summaryFloating,
257
- bounds: "viewport",
258
- defaultPosition: i ?? { x: 0, y: 0 },
259
- children: x
260
- }
261
- ) : x;
109
+ function m({ heading: t = "Events", items: u, onPick: d, placement: f = "left", floatingDefaultPosition: m, bubbleGlyphColors: h, className: g }) {
110
+ let _ = i(null), v = i(!1), [y, b] = a(!1), [x, S] = a(!1), [C, w] = a(262), [T, E] = a({
111
+ x: 0,
112
+ y: 0
113
+ }), D = f === "bubble", O = f === "floating", k = O || D && !x, A = f === "top" || f === "bottom", j = -1, M = -1;
114
+ u.forEach((e, t) => {
115
+ e.inView && (j < 0 && (j = t), M = t);
116
+ });
117
+ let N = j === 0 && M === u.length - 1;
118
+ r(() => {
119
+ let e = _.current;
120
+ if (!e || v.current || j < 0 || N) return;
121
+ let t = e.querySelectorAll("[data-timeline-summary-row]"), n = t[j], r = t[M];
122
+ if (!n || !r) return;
123
+ let i = (n.offsetTop + r.offsetTop + r.offsetHeight) / 2;
124
+ e.scrollTop = Math.max(0, i - e.clientHeight / 2);
125
+ }, [
126
+ j,
127
+ M,
128
+ N
129
+ ]);
130
+ let P = /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("span", { children: [k && /* @__PURE__ */ c("span", {
131
+ className: e.summaryGrip,
132
+ "aria-hidden": !0,
133
+ children: "⠿"
134
+ }), t] }), D ? /* @__PURE__ */ l("span", {
135
+ className: e.summaryHeadTools,
136
+ children: [
137
+ /* @__PURE__ */ c("span", {
138
+ className: e.summaryCount,
139
+ children: u.length
140
+ }),
141
+ /* @__PURE__ */ c("button", {
142
+ type: "button",
143
+ className: e.summaryDockBtn,
144
+ "aria-label": x ? "Undock event summary" : "Dock event summary",
145
+ title: x ? "Float the panel" : "Dock to the left edge",
146
+ onClick: (e) => {
147
+ e.stopPropagation(), S(!x), E({
148
+ x: 0,
149
+ y: 0
150
+ });
151
+ },
152
+ onPointerDown: (e) => e.stopPropagation(),
153
+ children: x ? "⇱" : "⇤"
154
+ }),
155
+ /* @__PURE__ */ c("button", {
156
+ type: "button",
157
+ className: e.summaryCollapse,
158
+ "aria-label": "Collapse event summary",
159
+ onClick: (e) => {
160
+ e.stopPropagation(), b(!1), E({
161
+ x: 0,
162
+ y: 0
163
+ });
164
+ },
165
+ onPointerDown: (e) => e.stopPropagation(),
166
+ children: "×"
167
+ })
168
+ ]
169
+ }) : /* @__PURE__ */ c("span", {
170
+ className: e.summaryCount,
171
+ children: u.length
172
+ })] }), F = /* @__PURE__ */ l("div", {
173
+ className: o(e.summary, A && e.summaryHorizontal, f === "top" && e.summaryTop, f === "bottom" && e.summaryBottom, O && e.summaryFloatingCard, D && e.summaryBubbleCard, D && x && e.summaryDockCard, g),
174
+ onMouseEnter: () => {
175
+ v.current = !0;
176
+ },
177
+ onMouseLeave: () => {
178
+ v.current = !1;
179
+ },
180
+ children: [
181
+ k ? /* @__PURE__ */ c(n.Handle, {
182
+ className: o(e.summaryHeader, e.summaryHandle),
183
+ children: P
184
+ }) : /* @__PURE__ */ c("div", {
185
+ className: e.summaryHeader,
186
+ children: P
187
+ }),
188
+ /* @__PURE__ */ c("div", {
189
+ ref: _,
190
+ className: o(e.summaryList, A && e.summaryListGrid),
191
+ children: u.map((t) => /* @__PURE__ */ l("div", {
192
+ "data-timeline-summary-row": !0,
193
+ role: "button",
194
+ tabIndex: 0,
195
+ className: o(e.summaryRow, t.inView && e.summaryRowInView, t.selected && e.summaryRowSelected),
196
+ onClick: () => d(t.id),
197
+ onKeyDown: (e) => {
198
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), d(t.id));
199
+ },
200
+ children: [
201
+ /* @__PURE__ */ c("span", {
202
+ className: e.summaryNum,
203
+ children: t.number
204
+ }),
205
+ /* @__PURE__ */ c("span", {
206
+ className: e.summaryDot,
207
+ style: { background: t.color }
208
+ }),
209
+ /* @__PURE__ */ c("span", {
210
+ className: e.summaryLabel,
211
+ children: t.label
212
+ }),
213
+ t.time && /* @__PURE__ */ c("span", {
214
+ className: e.summaryTime,
215
+ children: t.time
216
+ })
217
+ ]
218
+ }, t.id))
219
+ }),
220
+ D && /* @__PURE__ */ c("div", {
221
+ className: e.summaryFootnote,
222
+ children: "Tinted rows are in the viewport"
223
+ })
224
+ ]
225
+ });
226
+ return D ? y ? x ? /* @__PURE__ */ l("div", {
227
+ className: e.summaryDock,
228
+ style: { flexBasis: C },
229
+ children: [F, /* @__PURE__ */ c(p, {
230
+ panel: "left",
231
+ width: C,
232
+ min: 200,
233
+ max: 520,
234
+ onResize: w,
235
+ label: "Resize event summary",
236
+ className: e.summaryDockResizer
237
+ })]
238
+ }) : /* @__PURE__ */ c("div", {
239
+ className: e.summaryBubbleAnchor,
240
+ children: /* @__PURE__ */ c(n, {
241
+ className: e.summaryBubblePanel,
242
+ bounds: "viewport",
243
+ position: T,
244
+ onDrag: E,
245
+ children: F
246
+ })
247
+ }) : /* @__PURE__ */ c("div", {
248
+ className: e.summaryBubbleAnchor,
249
+ children: /* @__PURE__ */ l("button", {
250
+ type: "button",
251
+ className: o(e.summaryBubble, g),
252
+ title: "Event summary",
253
+ onClick: () => b(!0),
254
+ children: [
255
+ /* @__PURE__ */ c("span", {
256
+ className: e.summaryBubbleGlyph,
257
+ "aria-hidden": !0,
258
+ children: (h && h.length ? h : ["var(--crk-timeline-accent)"]).slice(0, 3).map((e, t) => /* @__PURE__ */ c("span", { style: { background: e } }, t))
259
+ }),
260
+ t,
261
+ /* @__PURE__ */ c("span", {
262
+ className: e.summaryCount,
263
+ children: u.length
264
+ })
265
+ ]
266
+ })
267
+ }) : O ? /* @__PURE__ */ c(n, {
268
+ className: e.summaryFloating,
269
+ bounds: "viewport",
270
+ defaultPosition: m ?? {
271
+ x: 0,
272
+ y: 0
273
+ },
274
+ children: F
275
+ }) : F;
262
276
  }
263
- function _({
264
- x: o,
265
- y: s,
266
- children: a,
267
- className: r,
268
- style: i
269
- }) {
270
- return /* @__PURE__ */ t("div", { className: c(e.tooltip, r), style: { left: o, top: s, ...i }, children: a });
277
+ function h({ x: t, y: n, children: r, className: i, style: a }) {
278
+ return /* @__PURE__ */ c("div", {
279
+ className: o(e.tooltip, i),
280
+ style: {
281
+ left: t,
282
+ top: n,
283
+ ...a
284
+ },
285
+ children: r
286
+ });
271
287
  }
272
- function $({ text: o, query: s }) {
273
- const a = Z(o, s);
274
- return a.length === 1 && !a[0].hit ? /* @__PURE__ */ t(L, { children: a[0].t }) : /* @__PURE__ */ t(L, { children: a.map(
275
- (r, i) => r.hit ? /* @__PURE__ */ t("span", { className: e.mark, children: r.t }, i) : /* @__PURE__ */ t("span", { children: r.t }, i)
276
- ) });
288
+ function g({ text: n, query: r }) {
289
+ let i = t(n, r);
290
+ return i.length === 1 && !i[0].hit ? /* @__PURE__ */ c(s, { children: i[0].t }) : /* @__PURE__ */ c(s, { children: i.map((t, n) => t.hit ? /* @__PURE__ */ c("span", {
291
+ className: e.mark,
292
+ children: t.t
293
+ }, n) : /* @__PURE__ */ c("span", { children: t.t }, n)) });
277
294
  }
278
- export {
279
- $ as HighlightText,
280
- G as TimelineLegend,
281
- j as TimelineResizer,
282
- Q as TimelineSegmented,
283
- Y as TimelineSummary,
284
- _ as TimelineTooltip,
285
- J as TimelineZoomControls
286
- };
295
+ export { g as HighlightText, u as TimelineLegend, p as TimelineResizer, f as TimelineSegmented, m as TimelineSummary, h as TimelineTooltip, d as TimelineZoomControls };
@@ -5,7 +5,7 @@ export declare function EventBadge({ event, pending, small, }: {
5
5
  event: TraceTimelineEvent;
6
6
  pending: boolean;
7
7
  small?: boolean;
8
- }): import("react/jsx-runtime").JSX.Element | null;
8
+ }): import("react").JSX.Element | null;
9
9
  /**
10
10
  * One labeled value: the label always sits above its value, and fields stack
11
11
  * vertically. Non-inline values (objects, arrays) become copyable JSON blocks.
@@ -14,7 +14,7 @@ export declare function FieldRow({ field, query, className, }: {
14
14
  field: TraceTimelineField;
15
15
  query?: string;
16
16
  className?: string;
17
- }): import("react/jsx-runtime").JSX.Element;
17
+ }): import("react").JSX.Element;
18
18
  /** A JSON payload block: uppercase heading + copy button + pretty-printed body. */
19
19
  export declare function PayloadBlock({ label, value, copyLabel, section, }: {
20
20
  label: string;
@@ -22,7 +22,7 @@ export declare function PayloadBlock({ label, value, copyLabel, section, }: {
22
22
  copyLabel: string;
23
23
  /** Render the heading as a panel section title instead of a micro-label. */
24
24
  section?: boolean;
25
- }): import("react/jsx-runtime").JSX.Element;
25
+ }): import("react").JSX.Element;
26
26
  export interface TraceEventDetailsClasses {
27
27
  root: string;
28
28
  head: string;