@overdoser/react-toolkit 0.19.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.
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +47 -0
- package/components/Accordion/Accordion.js +160 -177
- package/components/Accordion/Accordion.module.js +20 -0
- package/components/ActionButton/ActionButton.js +155 -209
- package/components/ActionButton/ActionButton.module.js +25 -0
- package/components/ActionButton/CopyButton.js +52 -64
- package/components/Alert/Alert.js +92 -95
- package/components/Alert/Alert.module.js +18 -0
- package/components/Avatar/Avatar.js +44 -55
- package/components/Avatar/Avatar.module.js +23 -0
- package/components/Badge/Badge.js +16 -38
- package/components/Badge/Badge.module.js +17 -0
- package/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/components/Breadcrumbs/Breadcrumbs.js +52 -48
- package/components/Breadcrumbs/Breadcrumbs.module.js +10 -0
- package/components/Button/Button.js +35 -57
- package/components/Button/Button.module.js +25 -0
- package/components/Card/Card.js +94 -131
- package/components/Card/Card.module.js +35 -0
- 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.js +32 -0
- 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 +46 -41
- 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.js +32 -0
- package/components/CodeBlock/CodeBlock.js +111 -119
- package/components/CodeBlock/CodeBlock.module.js +23 -0
- package/components/CommandPalette/CommandPalette.js +387 -392
- package/components/CommandPalette/CommandPalette.module.js +28 -0
- package/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
- package/components/ConfirmDialog/ConfirmDialog.js +184 -199
- package/components/ConfirmDialog/ConfirmDialog.module.js +12 -0
- package/components/Divider/Divider.js +25 -36
- package/components/Divider/Divider.module.js +17 -0
- package/components/Draggable/Draggable.d.ts +1 -1
- package/components/Draggable/Draggable.js +157 -164
- package/components/Draggable/Draggable.module.js +10 -0
- package/components/Drawer/Drawer.js +104 -126
- package/components/Drawer/Drawer.module.js +66 -0
- package/components/Dropdown/Dropdown.js +175 -234
- package/components/Dropdown/Dropdown.module.js +29 -0
- package/components/Dropdown/DropdownItem.js +55 -58
- package/components/Dropdown/DropdownLabel.js +14 -11
- package/components/Dropdown/DropdownSeparator.js +12 -10
- 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.js +12 -0
- package/components/EmptyState/EmptyState.js +58 -55
- package/components/EmptyState/EmptyState.module.js +14 -0
- package/components/Form/Form.d.ts +1 -1
- package/components/Form/Form.js +32 -35
- package/components/Form/Form.module.js +16 -0
- 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.js +26 -0
- package/components/ImageViewer/useZoomPan.js +206 -137
- package/components/Kbd/Kbd.js +25 -22
- package/components/Kbd/Kbd.module.js +10 -0
- package/components/KeyValueList/KeyValueList.js +119 -123
- package/components/KeyValueList/KeyValueList.module.js +23 -0
- package/components/Link/Link.js +45 -59
- package/components/Link/Link.module.js +10 -0
- package/components/List/List.js +22 -46
- package/components/List/List.module.js +12 -0
- package/components/Loader/Loader.js +152 -182
- package/components/Loader/Loader.module.js +40 -0
- package/components/Modal/Modal.js +93 -105
- package/components/Modal/Modal.module.js +18 -0
- package/components/PageHeader/PageHeader.js +78 -72
- package/components/PageHeader/PageHeader.module.js +23 -0
- package/components/Pagination/Pagination.js +63 -84
- package/components/Pagination/Pagination.module.js +13 -0
- package/components/Pagination/paginationRange.js +15 -22
- package/components/Popover/Popover.js +110 -134
- package/components/Popover/Popover.module.js +12 -0
- package/components/ProgressBar/ProgressBar.d.ts +15 -1
- package/components/ProgressBar/ProgressBar.js +57 -90
- package/components/ProgressBar/ProgressBar.module.js +29 -0
- package/components/RelativeTime/RelativeTime.js +36 -43
- package/components/RelativeTime/RelativeTime.module.js +3 -0
- package/components/SegmentedControl/SegmentedControl.js +94 -130
- package/components/SegmentedControl/SegmentedControl.module.js +21 -0
- package/components/Skeleton/Skeleton.js +36 -50
- package/components/Skeleton/Skeleton.module.js +15 -0
- package/components/Spinner/Spinner.js +25 -25
- package/components/Spinner/Spinner.module.js +12 -0
- package/components/SplitButton/SplitButton.js +149 -196
- package/components/SplitButton/SplitButton.module.js +31 -0
- package/components/SplitPane/SplitPane.js +134 -170
- package/components/SplitPane/SplitPane.module.js +14 -0
- package/components/StatCard/StatCard.js +132 -125
- package/components/StatCard/StatCard.module.js +42 -0
- package/components/StatusDot/StatusDot.js +28 -39
- package/components/StatusDot/StatusDot.module.js +18 -0
- package/components/Table/Table.d.ts +41 -16
- package/components/Table/Table.js +383 -442
- package/components/Table/Table.module.js +42 -0
- package/components/Table/index.d.ts +1 -1
- package/components/Table/useTableSort.d.ts +1 -1
- package/components/Table/useTableSort.js +51 -42
- package/components/Tabs/Tabs.js +109 -161
- package/components/Tabs/Tabs.module.js +28 -0
- package/components/ThemeToggle/ThemeToggle.d.ts +2 -0
- package/components/ThemeToggle/ThemeToggle.js +122 -97
- package/components/ThemeToggle/ThemeToggle.module.js +13 -0
- package/components/Timeline/GanttTimeline.js +357 -318
- package/components/Timeline/GanttTimeline.module.js +29 -0
- package/components/Timeline/HistoryTimeline.js +486 -450
- package/components/Timeline/HistoryTimeline.module.js +31 -0
- package/components/Timeline/Timeline.module.js +76 -0
- 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 +245 -178
- package/components/Timeline/TraceTimeline.js +823 -783
- package/components/Timeline/TraceTimeline.module.js +98 -0
- 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.js +29 -0
- package/components/Toast/Toast.d.ts +1 -1
- package/components/Toast/Toast.js +128 -128
- package/components/Toast/Toast.module.js +37 -0
- package/components/Toast/toastStore.js +58 -62
- package/components/ToggleIconButton/ToggleIconButton.js +35 -57
- package/components/ToggleIconButton/ToggleIconButton.module.js +15 -0
- package/components/Tooltip/Tooltip.d.ts +1 -1
- package/components/Tooltip/Tooltip.js +76 -85
- package/components/Tooltip/Tooltip.module.js +17 -0
- package/components/Typography/Typography.js +11 -36
- package/components/Typography/Typography.module.js +30 -0
- package/components/inputs/Checkbox/Checkbox.js +27 -51
- package/components/inputs/Checkbox/Checkbox.module.js +10 -0
- package/components/inputs/Checkbox/CheckboxGroup.js +53 -111
- package/components/inputs/Checkbox/CheckboxGroup.module.js +17 -0
- package/components/inputs/DatePicker/CalendarPanel.d.ts +1 -1
- package/components/inputs/DatePicker/CalendarPanel.js +263 -286
- package/components/inputs/DatePicker/CalendarPanel.module.js +23 -0
- package/components/inputs/DatePicker/DatePicker.js +115 -142
- package/components/inputs/DatePicker/DatePicker.module.js +14 -0
- package/components/inputs/DatePicker/dateUtils.js +32 -41
- package/components/inputs/DateTimePicker/DateTimePicker.js +226 -232
- package/components/inputs/DateTimePicker/DateTimePicker.module.js +20 -0
- 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.js +15 -0
- package/components/inputs/NumberInput/NumberInput.js +112 -132
- package/components/inputs/NumberInput/NumberInput.module.js +14 -0
- package/components/inputs/Radio/Radio.js +50 -73
- package/components/inputs/Radio/Radio.module.js +9 -0
- package/components/inputs/SearchInput/SearchInput.js +98 -115
- package/components/inputs/SearchInput/SearchInput.module.js +8 -0
- package/components/inputs/Select/Select.js +555 -682
- package/components/inputs/Select/Select.module.js +38 -0
- package/components/inputs/Slider/Slider.js +97 -128
- package/components/inputs/Slider/Slider.module.js +9 -0
- package/components/inputs/Switch/Switch.js +11 -8
- package/components/inputs/Textarea/Textarea.js +42 -58
- package/components/inputs/Textarea/Textarea.module.js +14 -0
- 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 -91
- package/hooks/usePortalPosition.js +25 -19
- package/hooks/useResizable.js +106 -104
- package/hooks/useTheme.d.ts +2 -2
- package/hooks/useTheme.js +28 -25
- package/index.css +2 -1
- package/index.d.ts +1 -1
- package/index.js +97 -215
- package/index.layered.css +2 -3
- package/llms.txt +9 -6
- package/manifest.json +66 -10
- package/package.json +1 -1
- package/utils/formatBytes.js +29 -13
- package/utils/themeScript.d.ts +2 -0
- package/utils/themeScript.js +6 -8
- package/utils/timeAgo.js +59 -32
- package/components/Accordion/Accordion.module.scss.js +0 -36
- package/components/ActionButton/ActionButton.module.scss.js +0 -47
- package/components/Alert/Alert.module.scss.js +0 -33
- package/components/Avatar/Avatar.module.scss.js +0 -43
- package/components/Badge/Badge.module.scss.js +0 -31
- package/components/Breadcrumbs/Breadcrumbs.module.scss.js +0 -17
- package/components/Button/Button.module.scss.js +0 -47
- package/components/Card/Card.module.scss.js +0 -60
- package/components/Chart/Chart.module.scss.js +0 -61
- package/components/Chip/Chip.module.scss.js +0 -59
- package/components/CodeBlock/CodeBlock.module.scss.js +0 -43
- package/components/CommandPalette/CommandPalette.module.scss.js +0 -49
- package/components/ConfirmDialog/ConfirmDialog.module.scss.js +0 -21
- package/components/Divider/Divider.module.scss.js +0 -31
- package/components/Draggable/Draggable.module.scss.js +0 -17
- package/components/Drawer/Drawer.module.scss.js +0 -119
- package/components/Dropdown/Dropdown.module.scss.js +0 -53
- package/components/Dropzone/Dropzone.module.scss.js +0 -21
- package/components/EmptyState/EmptyState.module.scss.js +0 -25
- package/components/Form/Form.module.scss.js +0 -29
- package/components/ImageViewer/ImageViewer.module.scss.js +0 -47
- package/components/Kbd/Kbd.module.scss.js +0 -17
- package/components/KeyValueList/KeyValueList.module.scss.js +0 -43
- package/components/Link/Link.module.scss.js +0 -16
- package/components/List/List.module.scss.js +0 -21
- package/components/Loader/Loader.module.scss.js +0 -70
- package/components/Modal/Modal.module.scss.js +0 -33
- package/components/PageHeader/PageHeader.module.scss.js +0 -43
- package/components/Pagination/Pagination.module.scss.js +0 -23
- package/components/Popover/Popover.module.scss.js +0 -21
- package/components/ProgressBar/ProgressBar.module.scss.js +0 -51
- package/components/RelativeTime/RelativeTime.module.scss.js +0 -7
- package/components/SegmentedControl/SegmentedControl.module.scss.js +0 -39
- package/components/Skeleton/Skeleton.module.scss.js +0 -25
- package/components/Spinner/Spinner.module.scss.js +0 -20
- package/components/SplitButton/SplitButton.module.scss.js +0 -57
- package/components/SplitPane/SplitPane.module.scss.js +0 -25
- package/components/StatCard/StatCard.module.scss.js +0 -72
- package/components/StatusDot/StatusDot.module.scss.js +0 -32
- package/components/Table/Table.module.scss.js +0 -81
- package/components/Tabs/Tabs.module.scss.js +0 -53
- package/components/ThemeToggle/ThemeToggle.module.scss.js +0 -23
- package/components/Timeline/GanttTimeline.module.scss.js +0 -55
- package/components/Timeline/HistoryTimeline.module.scss.js +0 -59
- package/components/Timeline/Timeline.module.scss.js +0 -141
- package/components/Timeline/TraceTimeline.module.scss.js +0 -189
- package/components/Timer/Timer.module.scss.js +0 -55
- package/components/Toast/Toast.module.scss.js +0 -62
- package/components/ToggleIconButton/ToggleIconButton.module.scss.js +0 -27
- package/components/Tooltip/Tooltip.module.scss.js +0 -30
- package/components/Typography/Typography.module.scss.js +0 -53
- package/components/inputs/Checkbox/Checkbox.module.scss.js +0 -17
- package/components/inputs/Checkbox/CheckboxGroup.module.scss.js +0 -31
- package/components/inputs/DatePicker/CalendarPanel.module.scss.js +0 -41
- package/components/inputs/DatePicker/DatePicker.module.scss.js +0 -25
- package/components/inputs/DateTimePicker/DateTimePicker.module.scss.js +0 -37
- package/components/inputs/Input/Input.module.scss.js +0 -27
- package/components/inputs/NumberInput/NumberInput.module.scss.js +0 -25
- package/components/inputs/Radio/Radio.module.scss.js +0 -15
- package/components/inputs/SearchInput/SearchInput.module.scss.js +0 -13
- package/components/inputs/Select/Select.module.scss.js +0 -73
- package/components/inputs/Slider/Slider.module.scss.js +0 -15
- package/components/inputs/Textarea/Textarea.module.scss.js +0 -25
|
@@ -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 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
|
|
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: 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
|
|
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: 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
|
|
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: 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
|
|
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: 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
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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
|
|
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;
|