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