@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,450 +1,486 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
1
|
+
import e from "./Timeline.module.js";
|
|
2
|
+
import t from "./HistoryTimeline.module.js";
|
|
3
|
+
import { TIMELINE_PALETTE_VARS as n, eventMatches as r, fmtClock as i, fmtDate as a, fmtDateTime as o, fmtDur as s, ticks as c, tint as l } from "./timelineCore.js";
|
|
4
|
+
import { computeHistoryLayout as u } from "./historyLayout.js";
|
|
5
|
+
import { HighlightText as ee, TimelineLegend as d, TimelineSegmented as f, TimelineSummary as p, TimelineTooltip as te, TimelineZoomControls as ne } from "./TimelineShared.js";
|
|
6
|
+
import { animateScrollTo as re, useContainerWidth as ie, useNowTicker as ae, useTimelinePan as oe, useWheelZoom as se, wheelZoomAllowed as ce } from "./useTimeline.js";
|
|
7
|
+
import { forwardRef as le, useCallback as m, useEffect as ue, useLayoutEffect as de, useMemo as fe, useRef as h, useState as g } from "react";
|
|
8
|
+
import _ from "clsx";
|
|
9
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
10
|
+
// src/components/Timeline/HistoryTimeline.tsx
|
|
11
|
+
var pe = {
|
|
12
|
+
created: n[0],
|
|
13
|
+
done: n[0],
|
|
14
|
+
live: n[0],
|
|
15
|
+
payment: n[1],
|
|
16
|
+
people: n[1],
|
|
17
|
+
review: n[2],
|
|
18
|
+
action: n[2],
|
|
19
|
+
offer: n[2],
|
|
20
|
+
fulfilment: n[3],
|
|
21
|
+
analysis: n[3],
|
|
22
|
+
shipping: n[4],
|
|
23
|
+
interview: n[4],
|
|
24
|
+
exception: "var(--crk-timeline-danger, #b3372f)",
|
|
25
|
+
alert: "var(--crk-timeline-danger, #b3372f)"
|
|
26
|
+
}, me = le(function(le, me) {
|
|
27
|
+
let { events: he, subjectName: ge, orientation: _e, defaultOrientation: ve, onOrientationChange: ye, spacing: be, defaultSpacing: xe = "equal", onSpacingChange: Se, highlight: x, defaultHighlight: Ce, onHighlightChange: we, showSearch: Te = !0, renderSearch: Ee, tagColors: De, showControls: Oe = !0, wheelZoom: ke = "ctrl", showLegend: Ae = !0, showSummary: S = !1, summaryPlacement: C = "left", summaryDefaultPosition: je, maxHeight: Me, selectedEventId: w, defaultSelectedEventId: Ne = null, onEventSelect: Pe, renderCard: Fe, renderTooltip: T, renderDetails: E, classes: D, className: Ie, style: Le } = le, O = h(null), [Re, ze] = g(() => ve ?? (typeof window < "u" && window.innerWidth < 700 ? "vertical" : "horizontal")), k = _e ?? Re, A = k === "horizontal", [Be, Ve] = g(xe), j = be ?? Be, [He, Ue] = g(1), [We, Ge] = g(!0), [M, N] = g(null), [Ke, qe] = g(Ne), P = w === void 0 ? Ke : w, [F, Je] = g({
|
|
28
|
+
l: 0,
|
|
29
|
+
t: 0,
|
|
30
|
+
w: 0,
|
|
31
|
+
h: 0
|
|
32
|
+
}), Ye = h(S);
|
|
33
|
+
Ye.current = S;
|
|
34
|
+
let I = h(null), L = m(() => {
|
|
35
|
+
let e = O.current;
|
|
36
|
+
e && Je((t) => t.l === e.scrollLeft && t.t === e.scrollTop && t.w === e.clientWidth && t.h === e.clientHeight ? t : {
|
|
37
|
+
l: e.scrollLeft,
|
|
38
|
+
t: e.scrollTop,
|
|
39
|
+
w: e.clientWidth,
|
|
40
|
+
h: e.clientHeight
|
|
41
|
+
});
|
|
42
|
+
}, []), Xe = m(() => {
|
|
43
|
+
Ye.current && I.current == null && (I.current = requestAnimationFrame(() => {
|
|
44
|
+
I.current = null, L();
|
|
45
|
+
}));
|
|
46
|
+
}, [L]);
|
|
47
|
+
ue(() => {
|
|
48
|
+
S && L();
|
|
49
|
+
});
|
|
50
|
+
let [Ze, Qe] = g(Ce ?? ""), R = x === void 0 ? Ze : x, z = R.trim(), $e = (e) => {
|
|
51
|
+
x === void 0 && Qe(e), we?.(e);
|
|
52
|
+
}, et = Ee ? Ee({
|
|
53
|
+
value: R,
|
|
54
|
+
setValue: $e
|
|
55
|
+
}) : Te ? /* @__PURE__ */ y("input", {
|
|
56
|
+
className: _(e.searchInput, D?.search),
|
|
57
|
+
placeholder: "Highlight keyword in events…",
|
|
58
|
+
"aria-label": "Highlight keyword",
|
|
59
|
+
value: R,
|
|
60
|
+
onChange: (e) => $e(e.target.value)
|
|
61
|
+
}) : null, B = fe(() => he.map((e) => ({
|
|
62
|
+
...e,
|
|
63
|
+
end: e.end === void 0 ? e.ongoing ? null : e.start : e.end
|
|
64
|
+
})).sort((e, t) => e.start - t.start), [he]), tt = B.some((e) => e.end == null), V = ae(tt, 500), nt = ie(O), H = oe(O), U = m((e) => {
|
|
65
|
+
let t = e || "event", r = {
|
|
66
|
+
...pe,
|
|
67
|
+
...De
|
|
68
|
+
};
|
|
69
|
+
if (r[t]) return r[t];
|
|
70
|
+
let i = String(t).charCodeAt(0) || 0;
|
|
71
|
+
return n[(String(t).length + i) % n.length];
|
|
72
|
+
}, [De]), W = u(B.map((e) => ({
|
|
73
|
+
id: e.id,
|
|
74
|
+
title: String(e.title || ""),
|
|
75
|
+
detail: String(e.detail || ""),
|
|
76
|
+
start: e.start,
|
|
77
|
+
end: e.end ?? null
|
|
78
|
+
})), {
|
|
79
|
+
orientation: k,
|
|
80
|
+
spacing: j,
|
|
81
|
+
containerWidth: nt,
|
|
82
|
+
viewportHeight: typeof window < "u" && window.innerHeight || 800,
|
|
83
|
+
now: V,
|
|
84
|
+
k: We ? "fit" : He
|
|
85
|
+
}), G = new Map(W.items.map((e) => [e.id, e])), rt = h(W.kFit), it = h(W.kEff);
|
|
86
|
+
rt.current = W.kFit, it.current = W.kEff;
|
|
87
|
+
let K = h(null);
|
|
88
|
+
de(() => {
|
|
89
|
+
let e = O.current;
|
|
90
|
+
K.current && e && (K.current.left != null && (e.scrollLeft = K.current.left), K.current.top != null && (e.scrollTop = K.current.top), K.current = null);
|
|
91
|
+
});
|
|
92
|
+
let q = m((e, t) => {
|
|
93
|
+
let n = O.current;
|
|
94
|
+
if (!n) return;
|
|
95
|
+
let r = rt.current || 1, i = it.current || 1, a = Math.max(r * .3, Math.min(Math.max(r, 1) * 40, i * e)), o = A ? n.scrollLeft : n.scrollTop, s = a / i;
|
|
96
|
+
K.current = A ? { left: (o + t) * s - t } : { top: (o + t) * s - t }, Ge(!1), Ue(a);
|
|
97
|
+
}, [A]);
|
|
98
|
+
se(O, (e) => {
|
|
99
|
+
if (!ce(ke, e)) return;
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
let t = O.current;
|
|
102
|
+
if (!t) return;
|
|
103
|
+
let n = t.getBoundingClientRect(), r = A ? e.clientX - n.left : e.clientY - n.top;
|
|
104
|
+
q(Math.exp(-(e.deltaY || e.deltaX) * .0022), r);
|
|
105
|
+
}, k);
|
|
106
|
+
let at = () => {
|
|
107
|
+
let e = O.current;
|
|
108
|
+
return e ? A ? e.clientWidth / 2 : e.clientHeight / 2 : 300;
|
|
109
|
+
}, J = (e) => {
|
|
110
|
+
w === void 0 && qe(e ? e.id : null), Pe?.(e);
|
|
111
|
+
}, ot = (e) => {
|
|
112
|
+
_e === void 0 && ze(e), ye?.(e);
|
|
113
|
+
}, st = (e) => {
|
|
114
|
+
be === void 0 && Ve(e), Se?.(e);
|
|
115
|
+
}, ct = (e) => {
|
|
116
|
+
let t = window.innerWidth || 1200, n = window.innerHeight || 800;
|
|
117
|
+
return {
|
|
118
|
+
x: e.clientX < t * .55 ? Math.max(12, t - 340) : 16,
|
|
119
|
+
y: Math.max(130, Math.min(e.clientY, n - 130))
|
|
120
|
+
};
|
|
121
|
+
}, Y = B.length ? B[0].start : V, lt = B.length ? Math.max(Y + 1, ...B.map((e) => e.end == null ? V : Math.max(e.end, e.start))) : V + 1, X = Math.max(1, lt - Y), ut = (e, t) => {
|
|
122
|
+
let n = new Date(e);
|
|
123
|
+
return t === "y" ? String(n.getFullYear()) : t === "my" ? n.toLocaleString("en", { month: "short" }) + " " + n.getFullYear() : t === "d" ? a(e) : t === "cms" ? i(e, !0) : i(e);
|
|
124
|
+
}, Z = [];
|
|
125
|
+
if (j === "proportional" && W.mapT) {
|
|
126
|
+
let e = W.mapT, t = e(Y), n = A ? W.innerW : W.innerH, r = Y + (n - t) / Math.max(1, W.innerSpan) * X, i = c(Y, r, Math.max(200, n - t), 90), a = i.step >= 31104e6 ? "y" : i.step >= 24192e5 ? "my" : i.step >= 864e5 ? "d" : i.step < 1e3 ? "cms" : "c";
|
|
127
|
+
Z = i.list.map((t) => ({
|
|
128
|
+
pos: Math.round(e(t.t)),
|
|
129
|
+
label: ut(t.t, a)
|
|
130
|
+
}));
|
|
131
|
+
} else {
|
|
132
|
+
let e = X > 4752e7 ? "y" : X > 5184e6 ? "my" : X > 1728e5 ? "d" : "c", t = A ? 72 : 18, n = null, r = -1e9;
|
|
133
|
+
B.forEach((i, a) => {
|
|
134
|
+
let o = ut(i.start, e), s = Math.round(W.posArr[a]);
|
|
135
|
+
o !== n && s - r >= t && (Z.push({
|
|
136
|
+
pos: s,
|
|
137
|
+
label: o
|
|
138
|
+
}), n = o, r = s);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
let dt = fe(() => {
|
|
142
|
+
let e = [];
|
|
143
|
+
return B.forEach((t) => {
|
|
144
|
+
let n = t.tag || "event";
|
|
145
|
+
e.includes(n) || e.push(n);
|
|
146
|
+
}), e;
|
|
147
|
+
}, [B]), Q = P == null ? null : B.find((e) => e.id === P) || null, ft = Q ? Q.end == null : !1, $ = S ? /* @__PURE__ */ y(p, {
|
|
148
|
+
className: D?.summary,
|
|
149
|
+
placement: C,
|
|
150
|
+
floatingDefaultPosition: je,
|
|
151
|
+
items: B.map((e, t) => {
|
|
152
|
+
let n = G.get(e.id), r = !n || !F.w && !F.h || (!F.w || n.cardLeft < F.l + F.w && n.cardLeft + n.cardW > F.l) && (!F.h || n.cardTop < F.t + F.h && n.cardTop + n.cardH > F.t);
|
|
153
|
+
return {
|
|
154
|
+
id: e.id,
|
|
155
|
+
number: String(t + 1).padStart(2, "0"),
|
|
156
|
+
label: e.title,
|
|
157
|
+
color: U(e.tag),
|
|
158
|
+
time: o(e.start),
|
|
159
|
+
inView: r,
|
|
160
|
+
selected: P === e.id
|
|
161
|
+
};
|
|
162
|
+
}),
|
|
163
|
+
onPick: (e) => {
|
|
164
|
+
let t = G.get(e), n = O.current;
|
|
165
|
+
if (!t || !n) return;
|
|
166
|
+
let r = {};
|
|
167
|
+
(n.clientWidth || !n.clientHeight) && (r.left = Math.max(0, t.dotX - n.clientWidth / 2)), n.clientHeight && (r.top = Math.max(0, t.dotY - n.clientHeight / 2)), re(n, r);
|
|
168
|
+
}
|
|
169
|
+
}) : null;
|
|
170
|
+
return /* @__PURE__ */ b("div", {
|
|
171
|
+
ref: me,
|
|
172
|
+
className: _(e.root, D?.root, Ie),
|
|
173
|
+
style: Le,
|
|
174
|
+
children: [
|
|
175
|
+
(Oe || et) && /* @__PURE__ */ b("div", {
|
|
176
|
+
className: _(e.toolbar, D?.toolbar),
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ y("div", { className: e.toolbarText }),
|
|
179
|
+
et,
|
|
180
|
+
Oe && /* @__PURE__ */ b(v, { children: [
|
|
181
|
+
/* @__PURE__ */ y(f, {
|
|
182
|
+
value: k,
|
|
183
|
+
options: [{
|
|
184
|
+
value: "horizontal",
|
|
185
|
+
label: "Horizontal"
|
|
186
|
+
}, {
|
|
187
|
+
value: "vertical",
|
|
188
|
+
label: "Vertical"
|
|
189
|
+
}],
|
|
190
|
+
onChange: ot
|
|
191
|
+
}),
|
|
192
|
+
/* @__PURE__ */ y(f, {
|
|
193
|
+
value: j,
|
|
194
|
+
options: [
|
|
195
|
+
{
|
|
196
|
+
value: "equal",
|
|
197
|
+
label: "Equal"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
value: "log",
|
|
201
|
+
label: "Log",
|
|
202
|
+
title: "Logarithmic gaps — long waits compressed"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
value: "proportional",
|
|
206
|
+
label: "Proportional"
|
|
207
|
+
}
|
|
208
|
+
],
|
|
209
|
+
onChange: st
|
|
210
|
+
}),
|
|
211
|
+
/* @__PURE__ */ y(ne, {
|
|
212
|
+
zoomPct: `${Math.round(W.kEff / W.kFit * 100)}%`,
|
|
213
|
+
fitActive: We,
|
|
214
|
+
onZoomIn: () => q(1.5, at()),
|
|
215
|
+
onZoomOut: () => q(1 / 1.5, at()),
|
|
216
|
+
onFit: () => {
|
|
217
|
+
Ge(!0), Ue(1);
|
|
218
|
+
}
|
|
219
|
+
})
|
|
220
|
+
] })
|
|
221
|
+
]
|
|
222
|
+
}),
|
|
223
|
+
Ae && /* @__PURE__ */ y(d, {
|
|
224
|
+
className: D?.legend,
|
|
225
|
+
items: dt.map((e) => ({
|
|
226
|
+
name: e,
|
|
227
|
+
color: U(e)
|
|
228
|
+
}))
|
|
229
|
+
}),
|
|
230
|
+
C === "top" && $,
|
|
231
|
+
/* @__PURE__ */ b("div", {
|
|
232
|
+
className: e.layout,
|
|
233
|
+
children: [
|
|
234
|
+
C === "left" && $,
|
|
235
|
+
/* @__PURE__ */ b("div", {
|
|
236
|
+
className: e.main,
|
|
237
|
+
children: [/* @__PURE__ */ b("div", {
|
|
238
|
+
className: e.cardWrap,
|
|
239
|
+
children: [/* @__PURE__ */ y("div", {
|
|
240
|
+
className: _(e.card, D?.card),
|
|
241
|
+
children: /* @__PURE__ */ y("div", {
|
|
242
|
+
ref: O,
|
|
243
|
+
className: _(e.scroller, A ? t.scrollerH : t.scrollerV, D?.scroller),
|
|
244
|
+
style: Me == null ? void 0 : { maxHeight: Me },
|
|
245
|
+
onPointerDown: H.onPointerDown,
|
|
246
|
+
onPointerMove: H.onPointerMove,
|
|
247
|
+
onPointerUp: H.onPointerUp,
|
|
248
|
+
onPointerLeave: H.onPointerUp,
|
|
249
|
+
onScroll: Xe,
|
|
250
|
+
children: /* @__PURE__ */ b("div", {
|
|
251
|
+
className: t.inner,
|
|
252
|
+
style: {
|
|
253
|
+
width: W.innerW,
|
|
254
|
+
height: W.innerH
|
|
255
|
+
},
|
|
256
|
+
children: [
|
|
257
|
+
Z.map((e, n) => A ? /* @__PURE__ */ b("span", { children: [/* @__PURE__ */ y("span", {
|
|
258
|
+
className: t.gridlineH,
|
|
259
|
+
style: { left: e.pos }
|
|
260
|
+
}), /* @__PURE__ */ y("span", {
|
|
261
|
+
className: t.tickLabelH,
|
|
262
|
+
style: { left: e.pos },
|
|
263
|
+
children: e.label
|
|
264
|
+
})] }, n) : /* @__PURE__ */ b("span", { children: [/* @__PURE__ */ y("span", {
|
|
265
|
+
className: t.gridlineV,
|
|
266
|
+
style: { top: e.pos }
|
|
267
|
+
}), /* @__PURE__ */ y("span", {
|
|
268
|
+
className: t.tickLabelV,
|
|
269
|
+
style: { top: e.pos },
|
|
270
|
+
children: e.label
|
|
271
|
+
})] }, n)),
|
|
272
|
+
A ? /* @__PURE__ */ y("div", {
|
|
273
|
+
className: t.axisH,
|
|
274
|
+
style: { top: W.axisY }
|
|
275
|
+
}) : /* @__PURE__ */ y("div", {
|
|
276
|
+
className: t.axisV,
|
|
277
|
+
style: { left: W.axisX }
|
|
278
|
+
}),
|
|
279
|
+
B.map((n, i) => {
|
|
280
|
+
let a = G.get(n.id);
|
|
281
|
+
if (!a) return null;
|
|
282
|
+
let c = n.end == null, l = (c ? V : n.end) - n.start, u = c || l > 0, d = r(n, z), f = U(n.tag), p = {
|
|
283
|
+
index: i,
|
|
284
|
+
number: String(i + 1).padStart(2, "0"),
|
|
285
|
+
color: f,
|
|
286
|
+
ongoing: c,
|
|
287
|
+
condensed: a.condensed,
|
|
288
|
+
durationMs: l
|
|
289
|
+
};
|
|
290
|
+
return /* @__PURE__ */ b("span", { children: [
|
|
291
|
+
a.segs.map((e, n) => /* @__PURE__ */ y("span", {
|
|
292
|
+
className: t.seg,
|
|
293
|
+
style: {
|
|
294
|
+
left: e.l,
|
|
295
|
+
top: e.t,
|
|
296
|
+
width: e.w,
|
|
297
|
+
height: e.h,
|
|
298
|
+
background: f
|
|
299
|
+
}
|
|
300
|
+
}, n)),
|
|
301
|
+
/* @__PURE__ */ y("span", {
|
|
302
|
+
className: _(t.dot, D?.dot),
|
|
303
|
+
style: {
|
|
304
|
+
left: a.dotX,
|
|
305
|
+
top: a.dotY,
|
|
306
|
+
borderColor: f
|
|
307
|
+
}
|
|
308
|
+
}),
|
|
309
|
+
/* @__PURE__ */ y("div", {
|
|
310
|
+
className: _(t.eventCard, D?.eventCard),
|
|
311
|
+
style: {
|
|
312
|
+
left: a.cardLeft,
|
|
313
|
+
top: a.cardTop,
|
|
314
|
+
width: a.cardW,
|
|
315
|
+
height: a.cardH,
|
|
316
|
+
opacity: z && !d ? .3 : 1,
|
|
317
|
+
background: z && d ? "var(--crk-timeline-hl-wash-soft, #fff9e8)" : void 0,
|
|
318
|
+
borderColor: z && d ? "var(--crk-timeline-hl-border, #e8b931)" : void 0,
|
|
319
|
+
boxShadow: z && d ? "0 0 0 3px #f9e9b8" : "0 1px 3px rgba(35,32,28,.06)"
|
|
320
|
+
},
|
|
321
|
+
onClick: () => {
|
|
322
|
+
H.wasDragSuppressed() || (N(null), J(P === n.id ? null : n));
|
|
323
|
+
},
|
|
324
|
+
onMouseEnter: (e) => {
|
|
325
|
+
if (P === n.id) return;
|
|
326
|
+
let t = (n.detail || "").length > 80;
|
|
327
|
+
if (!T && !t && !c) return;
|
|
328
|
+
let r = ct(e);
|
|
329
|
+
N({
|
|
330
|
+
...r,
|
|
331
|
+
id: n.id,
|
|
332
|
+
title: n.title,
|
|
333
|
+
time: o(n.start),
|
|
334
|
+
durLine: c ? "ongoing · " + s(l) + " so far" : l > 0 ? "duration " + s(l) : "instant event",
|
|
335
|
+
detail: n.detail || ""
|
|
336
|
+
});
|
|
337
|
+
},
|
|
338
|
+
onMouseLeave: () => N(null),
|
|
339
|
+
children: Fe ? Fe(n, p) : /* @__PURE__ */ b(v, { children: [
|
|
340
|
+
/* @__PURE__ */ b("div", {
|
|
341
|
+
className: t.cardTitle,
|
|
342
|
+
children: [
|
|
343
|
+
/* @__PURE__ */ y("span", {
|
|
344
|
+
className: t.cardNum,
|
|
345
|
+
children: p.number
|
|
346
|
+
}),
|
|
347
|
+
" ",
|
|
348
|
+
/* @__PURE__ */ y("span", {
|
|
349
|
+
className: t.cardTagDot,
|
|
350
|
+
style: { background: f }
|
|
351
|
+
}),
|
|
352
|
+
/* @__PURE__ */ y(ee, {
|
|
353
|
+
text: n.title,
|
|
354
|
+
query: z
|
|
355
|
+
}),
|
|
356
|
+
c && /* @__PURE__ */ y("span", { className: _(e.pulseDot, t.cardOngoingDot) })
|
|
357
|
+
]
|
|
358
|
+
}),
|
|
359
|
+
/* @__PURE__ */ y("div", {
|
|
360
|
+
className: t.cardTime,
|
|
361
|
+
children: o(n.start)
|
|
362
|
+
}),
|
|
363
|
+
!a.condensed && !!n.detail && /* @__PURE__ */ y("div", {
|
|
364
|
+
className: t.cardDetail,
|
|
365
|
+
children: /* @__PURE__ */ y(ee, {
|
|
366
|
+
text: n.detail,
|
|
367
|
+
query: z
|
|
368
|
+
})
|
|
369
|
+
}),
|
|
370
|
+
u && /* @__PURE__ */ y("div", {
|
|
371
|
+
className: t.cardDur,
|
|
372
|
+
children: c ? "ongoing · " + s(l) : "took " + s(l)
|
|
373
|
+
})
|
|
374
|
+
] })
|
|
375
|
+
})
|
|
376
|
+
] }, n.id);
|
|
377
|
+
})
|
|
378
|
+
]
|
|
379
|
+
})
|
|
380
|
+
})
|
|
381
|
+
}), C === "bubble" && $]
|
|
382
|
+
}), /* @__PURE__ */ y("div", {
|
|
383
|
+
className: _(e.footnote, D?.footnote),
|
|
384
|
+
children: "Click a card to open details in the side panel · scroll zooms · drag pans · overlapping events stack around the axis with Z-shaped leads"
|
|
385
|
+
})]
|
|
386
|
+
}),
|
|
387
|
+
Q && E && /* @__PURE__ */ y("aside", {
|
|
388
|
+
className: _(e.aside, t.drawer, D?.drawer),
|
|
389
|
+
children: E(Q, {
|
|
390
|
+
close: () => J(null),
|
|
391
|
+
ongoing: ft
|
|
392
|
+
})
|
|
393
|
+
}),
|
|
394
|
+
Q && !E && /* @__PURE__ */ b("aside", {
|
|
395
|
+
className: _(e.aside, t.drawer, D?.drawer),
|
|
396
|
+
children: [
|
|
397
|
+
/* @__PURE__ */ b("div", {
|
|
398
|
+
className: t.drawerHead,
|
|
399
|
+
children: [
|
|
400
|
+
/* @__PURE__ */ y("span", {
|
|
401
|
+
className: t.drawerTag,
|
|
402
|
+
style: {
|
|
403
|
+
background: l(U(Q.tag), 12),
|
|
404
|
+
color: U(Q.tag)
|
|
405
|
+
},
|
|
406
|
+
children: Q.tag || "event"
|
|
407
|
+
}),
|
|
408
|
+
(ge ?? Q.subject) != null && /* @__PURE__ */ y("span", {
|
|
409
|
+
className: t.drawerSubject,
|
|
410
|
+
children: ge ?? Q.subject
|
|
411
|
+
}),
|
|
412
|
+
/* @__PURE__ */ y("div", { className: t.drawerSpacer }),
|
|
413
|
+
/* @__PURE__ */ y("button", {
|
|
414
|
+
type: "button",
|
|
415
|
+
className: e.asideClose,
|
|
416
|
+
"aria-label": "Close details",
|
|
417
|
+
onClick: () => J(null),
|
|
418
|
+
children: "✕"
|
|
419
|
+
})
|
|
420
|
+
]
|
|
421
|
+
}),
|
|
422
|
+
/* @__PURE__ */ y("div", {
|
|
423
|
+
className: t.drawerTitle,
|
|
424
|
+
children: Q.title
|
|
425
|
+
}),
|
|
426
|
+
/* @__PURE__ */ y("div", {
|
|
427
|
+
className: t.drawerTiming,
|
|
428
|
+
children: o(Q.start) + (ft ? " · ongoing, " + s(V - Q.start) + " so far" : Q.end > Q.start ? " → " + o(Q.end) + " · " + s(Q.end - Q.start) : "")
|
|
429
|
+
}),
|
|
430
|
+
/* @__PURE__ */ y("div", {
|
|
431
|
+
className: t.drawerDetail,
|
|
432
|
+
children: Q.detail || "—"
|
|
433
|
+
}),
|
|
434
|
+
/* @__PURE__ */ y("div", {
|
|
435
|
+
className: e.asideSection,
|
|
436
|
+
children: "Raw event"
|
|
437
|
+
}),
|
|
438
|
+
/* @__PURE__ */ y("pre", {
|
|
439
|
+
className: e.asideRaw,
|
|
440
|
+
children: JSON.stringify(Q, null, 2)
|
|
441
|
+
})
|
|
442
|
+
]
|
|
443
|
+
}),
|
|
444
|
+
(C === "right" || C === "floating") && $
|
|
445
|
+
]
|
|
446
|
+
}),
|
|
447
|
+
C === "bottom" && $,
|
|
448
|
+
M && (() => {
|
|
449
|
+
let t = B.find((e) => e.id === M.id), n = t ? B.indexOf(t) : -1, r = t && T ? T(t, {
|
|
450
|
+
index: n,
|
|
451
|
+
number: String(n + 1).padStart(2, "0"),
|
|
452
|
+
color: U(t.tag),
|
|
453
|
+
ongoing: t.end == null,
|
|
454
|
+
condensed: G.get(t.id)?.condensed ?? !1,
|
|
455
|
+
durationMs: (t.end == null ? V : t.end) - t.start
|
|
456
|
+
}) : void 0;
|
|
457
|
+
return T && r == null ? null : /* @__PURE__ */ y(te, {
|
|
458
|
+
x: M.x,
|
|
459
|
+
y: M.y,
|
|
460
|
+
className: D?.tooltip,
|
|
461
|
+
children: r === void 0 ? /* @__PURE__ */ b(v, { children: [
|
|
462
|
+
/* @__PURE__ */ y("div", {
|
|
463
|
+
className: e.tooltipTitle,
|
|
464
|
+
children: M.title
|
|
465
|
+
}),
|
|
466
|
+
/* @__PURE__ */ y("div", {
|
|
467
|
+
className: _(e.tooltipLine, e.tooltipMono),
|
|
468
|
+
style: { marginTop: 4 },
|
|
469
|
+
children: M.time
|
|
470
|
+
}),
|
|
471
|
+
/* @__PURE__ */ y("div", {
|
|
472
|
+
className: e.tooltipLine,
|
|
473
|
+
children: M.durLine
|
|
474
|
+
}),
|
|
475
|
+
M.detail && /* @__PURE__ */ y("div", {
|
|
476
|
+
className: e.tooltipDim,
|
|
477
|
+
style: { marginTop: 5 },
|
|
478
|
+
children: M.detail
|
|
479
|
+
})
|
|
480
|
+
] }) : r
|
|
481
|
+
});
|
|
482
|
+
})()
|
|
483
|
+
]
|
|
484
|
+
});
|
|
485
|
+
});
|
|
486
|
+
export { me as HistoryTimeline };
|