@overdoser/react-toolkit 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +14 -0
  3. package/components/Accordion/Accordion.js +160 -177
  4. package/components/Accordion/Accordion.module.js +20 -0
  5. package/components/ActionButton/ActionButton.js +155 -209
  6. package/components/ActionButton/ActionButton.module.js +25 -0
  7. package/components/ActionButton/CopyButton.js +52 -64
  8. package/components/Alert/Alert.js +92 -95
  9. package/components/Alert/Alert.module.js +18 -0
  10. package/components/Avatar/Avatar.js +44 -55
  11. package/components/Avatar/Avatar.module.js +23 -0
  12. package/components/Badge/Badge.js +16 -38
  13. package/components/Badge/Badge.module.js +17 -0
  14. package/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  15. package/components/Breadcrumbs/Breadcrumbs.js +52 -48
  16. package/components/Breadcrumbs/Breadcrumbs.module.js +10 -0
  17. package/components/Button/Button.js +35 -57
  18. package/components/Button/Button.module.js +25 -0
  19. package/components/Card/Card.js +94 -131
  20. package/components/Card/Card.module.js +35 -0
  21. package/components/Chart/AreaChart.d.ts +1 -1
  22. package/components/Chart/AreaChart.js +248 -249
  23. package/components/Chart/Axis.d.ts +2 -2
  24. package/components/Chart/Axis.js +34 -43
  25. package/components/Chart/BarChart.d.ts +1 -1
  26. package/components/Chart/BarChart.js +307 -348
  27. package/components/Chart/Chart.module.js +32 -0
  28. package/components/Chart/ChartContainer.js +33 -41
  29. package/components/Chart/ChartLegend.d.ts +1 -1
  30. package/components/Chart/ChartLegend.js +31 -30
  31. package/components/Chart/ChartTooltip.d.ts +1 -1
  32. package/components/Chart/ChartTooltip.js +46 -41
  33. package/components/Chart/LineChart.d.ts +1 -1
  34. package/components/Chart/LineChart.js +220 -232
  35. package/components/Chart/PieChart.d.ts +1 -1
  36. package/components/Chart/PieChart.js +224 -240
  37. package/components/Chart/RadarChart.d.ts +1 -1
  38. package/components/Chart/RadarChart.js +166 -215
  39. package/components/Chart/Sparkline.js +73 -68
  40. package/components/Chart/TradingChart.d.ts +1 -1
  41. package/components/Chart/TradingChart.js +804 -701
  42. package/components/Chart/scales.js +28 -35
  43. package/components/Chart/trading/indicators.js +61 -62
  44. package/components/Chart/trading/period.js +46 -68
  45. package/components/Chart/useChartDimensions.js +30 -22
  46. package/components/Chip/Chip.js +98 -141
  47. package/components/Chip/Chip.module.js +32 -0
  48. package/components/CodeBlock/CodeBlock.js +111 -119
  49. package/components/CodeBlock/CodeBlock.module.js +23 -0
  50. package/components/CommandPalette/CommandPalette.js +387 -392
  51. package/components/CommandPalette/CommandPalette.module.js +28 -0
  52. package/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
  53. package/components/ConfirmDialog/ConfirmDialog.js +184 -199
  54. package/components/ConfirmDialog/ConfirmDialog.module.js +12 -0
  55. package/components/Divider/Divider.js +25 -36
  56. package/components/Divider/Divider.module.js +17 -0
  57. package/components/Draggable/Draggable.d.ts +1 -1
  58. package/components/Draggable/Draggable.js +157 -164
  59. package/components/Draggable/Draggable.module.js +10 -0
  60. package/components/Drawer/Drawer.js +104 -126
  61. package/components/Drawer/Drawer.module.js +66 -0
  62. package/components/Dropdown/Dropdown.js +175 -234
  63. package/components/Dropdown/Dropdown.module.js +29 -0
  64. package/components/Dropdown/DropdownItem.js +55 -58
  65. package/components/Dropdown/DropdownLabel.js +14 -11
  66. package/components/Dropdown/DropdownSeparator.js +12 -10
  67. package/components/Dropdown/dropdownContext.js +4 -5
  68. package/components/Dropdown/useContextMenu.js +27 -17
  69. package/components/Dropzone/Dropzone.js +99 -105
  70. package/components/Dropzone/Dropzone.module.js +12 -0
  71. package/components/EmptyState/EmptyState.js +58 -55
  72. package/components/EmptyState/EmptyState.module.js +14 -0
  73. package/components/Form/Form.d.ts +1 -1
  74. package/components/Form/Form.js +32 -35
  75. package/components/Form/Form.module.js +16 -0
  76. package/components/Form/FormField.d.ts +1 -1
  77. package/components/Form/FormField.js +71 -75
  78. package/components/Form/FormRow.d.ts +1 -1
  79. package/components/Form/FormRow.js +11 -8
  80. package/components/Form/formFieldDefaults.js +4 -5
  81. package/components/ImageViewer/ImageViewer.js +312 -201
  82. package/components/ImageViewer/ImageViewer.module.js +26 -0
  83. package/components/ImageViewer/useZoomPan.js +206 -137
  84. package/components/Kbd/Kbd.js +25 -22
  85. package/components/Kbd/Kbd.module.js +10 -0
  86. package/components/KeyValueList/KeyValueList.js +119 -123
  87. package/components/KeyValueList/KeyValueList.module.js +23 -0
  88. package/components/Link/Link.js +45 -59
  89. package/components/Link/Link.module.js +10 -0
  90. package/components/List/List.js +22 -46
  91. package/components/List/List.module.js +12 -0
  92. package/components/Loader/Loader.js +152 -182
  93. package/components/Loader/Loader.module.js +40 -0
  94. package/components/Modal/Modal.js +93 -105
  95. package/components/Modal/Modal.module.js +18 -0
  96. package/components/PageHeader/PageHeader.js +78 -72
  97. package/components/PageHeader/PageHeader.module.js +23 -0
  98. package/components/Pagination/Pagination.js +63 -84
  99. package/components/Pagination/Pagination.module.js +13 -0
  100. package/components/Pagination/paginationRange.js +15 -22
  101. package/components/Popover/Popover.js +110 -134
  102. package/components/Popover/Popover.module.js +12 -0
  103. package/components/ProgressBar/ProgressBar.d.ts +15 -1
  104. package/components/ProgressBar/ProgressBar.js +57 -90
  105. package/components/ProgressBar/ProgressBar.module.js +29 -0
  106. package/components/RelativeTime/RelativeTime.js +36 -43
  107. package/components/RelativeTime/RelativeTime.module.js +3 -0
  108. package/components/SegmentedControl/SegmentedControl.js +94 -130
  109. package/components/SegmentedControl/SegmentedControl.module.js +21 -0
  110. package/components/Skeleton/Skeleton.js +36 -50
  111. package/components/Skeleton/Skeleton.module.js +15 -0
  112. package/components/Spinner/Spinner.js +25 -25
  113. package/components/Spinner/Spinner.module.js +12 -0
  114. package/components/SplitButton/SplitButton.js +149 -196
  115. package/components/SplitButton/SplitButton.module.js +31 -0
  116. package/components/SplitPane/SplitPane.js +134 -170
  117. package/components/SplitPane/SplitPane.module.js +14 -0
  118. package/components/StatCard/StatCard.js +132 -125
  119. package/components/StatCard/StatCard.module.js +42 -0
  120. package/components/StatusDot/StatusDot.js +28 -39
  121. package/components/StatusDot/StatusDot.module.js +18 -0
  122. package/components/Table/Table.d.ts +1 -1
  123. package/components/Table/Table.js +381 -451
  124. package/components/Table/Table.module.js +42 -0
  125. package/components/Table/useTableSort.js +51 -42
  126. package/components/Tabs/Tabs.js +109 -161
  127. package/components/Tabs/Tabs.module.js +28 -0
  128. package/components/ThemeToggle/ThemeToggle.js +122 -98
  129. package/components/ThemeToggle/ThemeToggle.module.js +13 -0
  130. package/components/Timeline/GanttTimeline.js +357 -318
  131. package/components/Timeline/GanttTimeline.module.js +29 -0
  132. package/components/Timeline/HistoryTimeline.js +486 -450
  133. package/components/Timeline/HistoryTimeline.module.js +31 -0
  134. package/components/Timeline/Timeline.module.js +76 -0
  135. package/components/Timeline/TimelineShared.d.ts +7 -7
  136. package/components/Timeline/TimelineShared.js +288 -279
  137. package/components/Timeline/TraceEventDetails.d.ts +3 -3
  138. package/components/Timeline/TraceEventDetails.js +245 -178
  139. package/components/Timeline/TraceTimeline.js +823 -783
  140. package/components/Timeline/TraceTimeline.module.js +98 -0
  141. package/components/Timeline/historyLayout.js +336 -263
  142. package/components/Timeline/timelineCore.js +208 -183
  143. package/components/Timeline/traceEvent.js +59 -61
  144. package/components/Timeline/traceLayout.js +101 -90
  145. package/components/Timeline/useTimeline.js +76 -79
  146. package/components/Timer/Timer.js +190 -156
  147. package/components/Timer/Timer.module.js +29 -0
  148. package/components/Toast/Toast.d.ts +1 -1
  149. package/components/Toast/Toast.js +128 -128
  150. package/components/Toast/Toast.module.js +37 -0
  151. package/components/Toast/toastStore.js +58 -62
  152. package/components/ToggleIconButton/ToggleIconButton.js +35 -57
  153. package/components/ToggleIconButton/ToggleIconButton.module.js +15 -0
  154. package/components/Tooltip/Tooltip.d.ts +1 -1
  155. package/components/Tooltip/Tooltip.js +76 -85
  156. package/components/Tooltip/Tooltip.module.js +17 -0
  157. package/components/Typography/Typography.js +11 -36
  158. package/components/Typography/Typography.module.js +30 -0
  159. package/components/inputs/Checkbox/Checkbox.js +27 -51
  160. package/components/inputs/Checkbox/Checkbox.module.js +10 -0
  161. package/components/inputs/Checkbox/CheckboxGroup.js +53 -111
  162. package/components/inputs/Checkbox/CheckboxGroup.module.js +17 -0
  163. package/components/inputs/DatePicker/CalendarPanel.d.ts +1 -1
  164. package/components/inputs/DatePicker/CalendarPanel.js +263 -286
  165. package/components/inputs/DatePicker/CalendarPanel.module.js +23 -0
  166. package/components/inputs/DatePicker/DatePicker.js +115 -142
  167. package/components/inputs/DatePicker/DatePicker.module.js +14 -0
  168. package/components/inputs/DatePicker/dateUtils.js +32 -41
  169. package/components/inputs/DateTimePicker/DateTimePicker.js +226 -232
  170. package/components/inputs/DateTimePicker/DateTimePicker.module.js +20 -0
  171. package/components/inputs/DateTimePicker/DateTimeSegments.js +273 -252
  172. package/components/inputs/DateTimePicker/TimeField.d.ts +1 -1
  173. package/components/inputs/DateTimePicker/TimeField.js +131 -132
  174. package/components/inputs/DateTimePicker/timeZoneUtils.js +95 -92
  175. package/components/inputs/Input/Input.js +98 -109
  176. package/components/inputs/Input/Input.module.js +15 -0
  177. package/components/inputs/NumberInput/NumberInput.js +112 -132
  178. package/components/inputs/NumberInput/NumberInput.module.js +14 -0
  179. package/components/inputs/Radio/Radio.js +50 -73
  180. package/components/inputs/Radio/Radio.module.js +9 -0
  181. package/components/inputs/SearchInput/SearchInput.js +98 -115
  182. package/components/inputs/SearchInput/SearchInput.module.js +8 -0
  183. package/components/inputs/Select/Select.js +555 -682
  184. package/components/inputs/Select/Select.module.js +38 -0
  185. package/components/inputs/Slider/Slider.js +97 -128
  186. package/components/inputs/Slider/Slider.module.js +9 -0
  187. package/components/inputs/Switch/Switch.js +11 -8
  188. package/components/inputs/Textarea/Textarea.js +42 -58
  189. package/components/inputs/Textarea/Textarea.module.js +14 -0
  190. package/hooks/useClickOutside.js +17 -14
  191. package/hooks/useDebouncedValue.js +13 -14
  192. package/hooks/useElementSize.js +27 -22
  193. package/hooks/useEscapeLayer.js +28 -29
  194. package/hooks/useFocusTrap.js +27 -38
  195. package/hooks/useKeyboard.js +76 -64
  196. package/hooks/useMediaQuery.js +10 -15
  197. package/hooks/useNow.js +28 -33
  198. package/hooks/usePersistedState.js +98 -94
  199. package/hooks/usePortalPosition.js +25 -19
  200. package/hooks/useResizable.js +106 -104
  201. package/hooks/useTheme.js +28 -23
  202. package/index.css +2 -1
  203. package/index.js +97 -215
  204. package/index.layered.css +2 -3
  205. package/llms.txt +3 -0
  206. package/manifest.json +8 -0
  207. package/package.json +1 -1
  208. package/utils/formatBytes.js +29 -13
  209. package/utils/themeScript.js +6 -8
  210. package/utils/timeAgo.js +59 -32
  211. package/components/Accordion/Accordion.module.scss.js +0 -36
  212. package/components/ActionButton/ActionButton.module.scss.js +0 -47
  213. package/components/Alert/Alert.module.scss.js +0 -33
  214. package/components/Avatar/Avatar.module.scss.js +0 -43
  215. package/components/Badge/Badge.module.scss.js +0 -31
  216. package/components/Breadcrumbs/Breadcrumbs.module.scss.js +0 -17
  217. package/components/Button/Button.module.scss.js +0 -47
  218. package/components/Card/Card.module.scss.js +0 -60
  219. package/components/Chart/Chart.module.scss.js +0 -61
  220. package/components/Chip/Chip.module.scss.js +0 -59
  221. package/components/CodeBlock/CodeBlock.module.scss.js +0 -43
  222. package/components/CommandPalette/CommandPalette.module.scss.js +0 -49
  223. package/components/ConfirmDialog/ConfirmDialog.module.scss.js +0 -21
  224. package/components/Divider/Divider.module.scss.js +0 -31
  225. package/components/Draggable/Draggable.module.scss.js +0 -17
  226. package/components/Drawer/Drawer.module.scss.js +0 -119
  227. package/components/Dropdown/Dropdown.module.scss.js +0 -53
  228. package/components/Dropzone/Dropzone.module.scss.js +0 -21
  229. package/components/EmptyState/EmptyState.module.scss.js +0 -25
  230. package/components/Form/Form.module.scss.js +0 -29
  231. package/components/ImageViewer/ImageViewer.module.scss.js +0 -47
  232. package/components/Kbd/Kbd.module.scss.js +0 -17
  233. package/components/KeyValueList/KeyValueList.module.scss.js +0 -43
  234. package/components/Link/Link.module.scss.js +0 -16
  235. package/components/List/List.module.scss.js +0 -21
  236. package/components/Loader/Loader.module.scss.js +0 -70
  237. package/components/Modal/Modal.module.scss.js +0 -33
  238. package/components/PageHeader/PageHeader.module.scss.js +0 -43
  239. package/components/Pagination/Pagination.module.scss.js +0 -23
  240. package/components/Popover/Popover.module.scss.js +0 -21
  241. package/components/ProgressBar/ProgressBar.module.scss.js +0 -51
  242. package/components/RelativeTime/RelativeTime.module.scss.js +0 -7
  243. package/components/SegmentedControl/SegmentedControl.module.scss.js +0 -39
  244. package/components/Skeleton/Skeleton.module.scss.js +0 -25
  245. package/components/Spinner/Spinner.module.scss.js +0 -20
  246. package/components/SplitButton/SplitButton.module.scss.js +0 -57
  247. package/components/SplitPane/SplitPane.module.scss.js +0 -25
  248. package/components/StatCard/StatCard.module.scss.js +0 -72
  249. package/components/StatusDot/StatusDot.module.scss.js +0 -32
  250. package/components/Table/Table.module.scss.js +0 -81
  251. package/components/Tabs/Tabs.module.scss.js +0 -53
  252. package/components/ThemeToggle/ThemeToggle.module.scss.js +0 -23
  253. package/components/Timeline/GanttTimeline.module.scss.js +0 -55
  254. package/components/Timeline/HistoryTimeline.module.scss.js +0 -59
  255. package/components/Timeline/Timeline.module.scss.js +0 -141
  256. package/components/Timeline/TraceTimeline.module.scss.js +0 -189
  257. package/components/Timer/Timer.module.scss.js +0 -55
  258. package/components/Toast/Toast.module.scss.js +0 -62
  259. package/components/ToggleIconButton/ToggleIconButton.module.scss.js +0 -27
  260. package/components/Tooltip/Tooltip.module.scss.js +0 -30
  261. package/components/Typography/Typography.module.scss.js +0 -53
  262. package/components/inputs/Checkbox/Checkbox.module.scss.js +0 -17
  263. package/components/inputs/Checkbox/CheckboxGroup.module.scss.js +0 -31
  264. package/components/inputs/DatePicker/CalendarPanel.module.scss.js +0 -41
  265. package/components/inputs/DatePicker/DatePicker.module.scss.js +0 -25
  266. package/components/inputs/DateTimePicker/DateTimePicker.module.scss.js +0 -37
  267. package/components/inputs/Input/Input.module.scss.js +0 -27
  268. package/components/inputs/NumberInput/NumberInput.module.scss.js +0 -25
  269. package/components/inputs/Radio/Radio.module.scss.js +0 -15
  270. package/components/inputs/SearchInput/SearchInput.module.scss.js +0 -13
  271. package/components/inputs/Select/Select.module.scss.js +0 -73
  272. package/components/inputs/Slider/Slider.module.scss.js +0 -15
  273. package/components/inputs/Textarea/Textarea.module.scss.js +0 -25
@@ -1,198 +1,223 @@
1
- const O = 1e3, U = 6e4, N = 36e5, S = 864e5, l = (t) => String(t).padStart(2, "0"), A = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
2
- function u(t, e) {
3
- const n = new Date(t);
4
- return l(n.getHours()) + ":" + l(n.getMinutes()) + ":" + l(n.getSeconds()) + (e ? "." + String(n.getMilliseconds()).padStart(3, "0") : "");
1
+ // src/components/Timeline/timelineCore.ts
2
+ var e = 1e3, t = 60 * e, n = 60 * t, r = 24 * n, i = (e) => String(e).padStart(2, "0"), a = [
3
+ "Jan",
4
+ "Feb",
5
+ "Mar",
6
+ "Apr",
7
+ "May",
8
+ "Jun",
9
+ "Jul",
10
+ "Aug",
11
+ "Sep",
12
+ "Oct",
13
+ "Nov",
14
+ "Dec"
15
+ ];
16
+ function o(e, t) {
17
+ let n = new Date(e);
18
+ return i(n.getHours()) + ":" + i(n.getMinutes()) + ":" + i(n.getSeconds()) + (t ? "." + String(n.getMilliseconds()).padStart(3, "0") : "");
5
19
  }
6
- function s(t) {
7
- const e = new Date(t);
8
- return A[e.getMonth()] + " " + e.getDate();
20
+ function s(e) {
21
+ let t = new Date(e);
22
+ return a[t.getMonth()] + " " + t.getDate();
9
23
  }
10
- function d(t) {
11
- const e = new Date(t).getFullYear(), n = e !== (/* @__PURE__ */ new Date()).getFullYear();
12
- return n && Date.now() - t > 2 * 365 * 864e5 ? s(t) + " " + e : s(t) + (n ? " " + e : "") + " · " + u(t);
24
+ function c(e) {
25
+ let t = new Date(e).getFullYear(), n = t !== (/* @__PURE__ */ new Date()).getFullYear();
26
+ return n && Date.now() - e > 63072e6 ? s(e) + " " + t : s(e) + (n ? " " + t : "") + " · " + o(e);
13
27
  }
14
- function h(t, e) {
15
- const n = new Date(t);
16
- return l(n.getUTCHours()) + ":" + l(n.getUTCMinutes()) + ":" + l(n.getUTCSeconds()) + (e ? "." + String(n.getUTCMilliseconds()).padStart(3, "0") : "");
28
+ function l(e, t) {
29
+ let n = new Date(e);
30
+ return i(n.getUTCHours()) + ":" + i(n.getUTCMinutes()) + ":" + i(n.getUTCSeconds()) + (t ? "." + String(n.getUTCMilliseconds()).padStart(3, "0") : "");
17
31
  }
18
- function Y(t) {
19
- const e = new Date(t);
20
- return e.getUTCFullYear() + "-" + l(e.getUTCMonth() + 1) + "-" + l(e.getUTCDate());
32
+ function u(e) {
33
+ let t = new Date(e);
34
+ return t.getUTCFullYear() + "-" + i(t.getUTCMonth() + 1) + "-" + i(t.getUTCDate());
21
35
  }
22
- function g(t, e) {
23
- return Y(t) + "T" + h(t, e) + "Z";
36
+ function d(e, t) {
37
+ return u(e) + "T" + l(e, t) + "Z";
24
38
  }
25
- function C(t) {
26
- return t == null ? "" : t < 1e3 ? Math.round(t) + "ms" : t < 6e4 ? (t / 1e3).toFixed(t < 10 * 1e3 ? 1 : 0) + "s" : t < 36e5 ? Math.floor(t / 6e4) + "m " + Math.round(t % 6e4 / 1e3) + "s" : t < 2 * 864e5 ? Math.floor(t / 36e5) + "h " + Math.round(t % 36e5 / 6e4) + "m" : t < 365 * 864e5 ? (t / 864e5).toFixed(1) + "d" : (t / (365.25 * 864e5)).toFixed(t < 3650 * 864e5 ? 1 : 0) + "y";
39
+ function f(i) {
40
+ return i == null ? "" : i < 1e3 ? Math.round(i) + "ms" : i < 6e4 ? (i / e).toFixed(+(i < 1e4)) + "s" : i < 36e5 ? Math.floor(i / t) + "m " + Math.round(i % t / e) + "s" : i < 1728e5 ? Math.floor(i / n) + "h " + Math.round(i % n / t) + "m" : i < 31536e6 ? (i / r).toFixed(1) + "d" : (i / (365.25 * r)).toFixed(+(i < 31536e7)) + "y";
27
41
  }
28
- const D = [
29
- 1,
30
- 2,
31
- 5,
32
- 10,
33
- 25,
34
- 50,
35
- 100,
36
- 250,
37
- 500,
38
- 1e3,
39
- 2 * 1e3,
40
- 5 * 1e3,
41
- 10 * 1e3,
42
- 15 * 1e3,
43
- 30 * 1e3,
44
- 6e4,
45
- 2 * 6e4,
46
- 5 * 6e4,
47
- 10 * 6e4,
48
- 15 * 6e4,
49
- 30 * 6e4,
50
- 36e5,
51
- 2 * 36e5,
52
- 3 * 36e5,
53
- 6 * 36e5,
54
- 12 * 36e5,
55
- 864e5,
56
- 2 * 864e5,
57
- 7 * 864e5,
58
- 14 * 864e5,
59
- 30 * 864e5,
60
- 90 * 864e5,
61
- 180 * 864e5,
62
- 365 * 864e5,
63
- 730 * 864e5,
64
- 1825 * 864e5,
65
- 3650 * 864e5,
66
- 9131 * 864e5,
67
- 18262 * 864e5,
68
- 36525 * 864e5,
69
- 91311 * 864e5,
70
- 182625 * 864e5
71
- ], E = /* @__PURE__ */ new Map([
72
- [1, [0, 0]],
73
- [2, [2, 0]],
74
- [5, [5, 0]],
75
- [10, [10, 5]],
76
- [25, [5, 0]],
77
- [50, [10, 5]],
78
- [100, [10, 5]],
79
- [250, [5, 0]],
80
- [500, [10, 5]],
81
- [1e3, [10, 5]],
82
- [2 * 1e3, [4, 2]],
83
- [5 * 1e3, [5, 0]],
84
- [10 * 1e3, [10, 5]],
85
- [15 * 1e3, [3, 0]],
86
- [30 * 1e3, [6, 3]],
87
- [6e4, [6, 3]],
88
- [2 * 6e4, [4, 2]],
89
- [5 * 6e4, [5, 0]],
90
- [10 * 6e4, [10, 5]],
91
- [15 * 6e4, [3, 0]],
92
- [30 * 6e4, [6, 3]],
93
- [36e5, [6, 3]],
94
- [2 * 36e5, [4, 2]],
95
- [3 * 36e5, [3, 0]],
96
- [6 * 36e5, [6, 3]],
97
- [12 * 36e5, [4, 2]],
98
- [864e5, [4, 2]],
99
- [2 * 864e5, [4, 2]],
100
- [7 * 864e5, [7, 0]],
101
- [14 * 864e5, [14, 7]],
102
- [30 * 864e5, [6, 3]],
103
- [90 * 864e5, [3, 0]],
104
- [180 * 864e5, [6, 3]],
105
- [365 * 864e5, [4, 2]],
106
- [730 * 864e5, [4, 2]],
107
- [1825 * 864e5, [5, 0]],
108
- [3650 * 864e5, [10, 5]],
109
- [9131 * 864e5, [5, 0]],
110
- [18262 * 864e5, [10, 5]],
111
- [36525 * 864e5, [10, 5]],
112
- [91311 * 864e5, [5, 0]],
113
- [182625 * 864e5, [5, 0]]
42
+ var p = [
43
+ 1,
44
+ 2,
45
+ 5,
46
+ 10,
47
+ 25,
48
+ 50,
49
+ 100,
50
+ 250,
51
+ 500,
52
+ e,
53
+ 2 * e,
54
+ 5 * e,
55
+ 10 * e,
56
+ 15 * e,
57
+ 30 * e,
58
+ t,
59
+ 2 * t,
60
+ 5 * t,
61
+ 10 * t,
62
+ 15 * t,
63
+ 30 * t,
64
+ n,
65
+ 2 * n,
66
+ 3 * n,
67
+ 6 * n,
68
+ 12 * n,
69
+ r,
70
+ 2 * r,
71
+ 7 * r,
72
+ 14 * r,
73
+ 30 * r,
74
+ 90 * r,
75
+ 180 * r,
76
+ 365 * r,
77
+ 730 * r,
78
+ 1825 * r,
79
+ 3650 * r,
80
+ 9131 * r,
81
+ 18262 * r,
82
+ 36525 * r,
83
+ 91311 * r,
84
+ 182625 * r
85
+ ], m = /* @__PURE__ */ new Map([
86
+ [1, [0, 0]],
87
+ [2, [2, 0]],
88
+ [5, [5, 0]],
89
+ [10, [10, 5]],
90
+ [25, [5, 0]],
91
+ [50, [10, 5]],
92
+ [100, [10, 5]],
93
+ [250, [5, 0]],
94
+ [500, [10, 5]],
95
+ [e, [10, 5]],
96
+ [2 * e, [4, 2]],
97
+ [5 * e, [5, 0]],
98
+ [10 * e, [10, 5]],
99
+ [15 * e, [3, 0]],
100
+ [30 * e, [6, 3]],
101
+ [t, [6, 3]],
102
+ [2 * t, [4, 2]],
103
+ [5 * t, [5, 0]],
104
+ [10 * t, [10, 5]],
105
+ [15 * t, [3, 0]],
106
+ [30 * t, [6, 3]],
107
+ [n, [6, 3]],
108
+ [2 * n, [4, 2]],
109
+ [3 * n, [3, 0]],
110
+ [6 * n, [6, 3]],
111
+ [12 * n, [4, 2]],
112
+ [r, [4, 2]],
113
+ [2 * r, [4, 2]],
114
+ [7 * r, [7, 0]],
115
+ [14 * r, [14, 7]],
116
+ [30 * r, [6, 3]],
117
+ [90 * r, [3, 0]],
118
+ [180 * r, [6, 3]],
119
+ [365 * r, [4, 2]],
120
+ [730 * r, [4, 2]],
121
+ [1825 * r, [5, 0]],
122
+ [3650 * r, [10, 5]],
123
+ [9131 * r, [5, 0]],
124
+ [18262 * r, [10, 5]],
125
+ [36525 * r, [10, 5]],
126
+ [91311 * r, [5, 0]],
127
+ [182625 * r, [5, 0]]
114
128
  ]);
115
- function M(t) {
116
- const e = E.get(t) || [4, 0];
117
- return { parts: e[0], medium: e[1] };
129
+ function h(e) {
130
+ let t = m.get(e) || [4, 0];
131
+ return {
132
+ parts: t[0],
133
+ medium: t[1]
134
+ };
118
135
  }
119
- function T(t, e, n, o) {
120
- o = o || 88;
121
- const a = Math.max(1, e - t), r = D.find((f) => f / a * n >= o) || D[D.length - 1], c = [];
122
- let i = Math.ceil(t / r) * r;
123
- for (; i <= e; i += r)
124
- c.push({ t: i, label: r >= 864e5 ? s(i) : u(i, r < 1e3) });
125
- return { step: r, list: c };
136
+ function g(t, n, r, i) {
137
+ i ||= 88;
138
+ let a = Math.max(1, n - t), c = p.find((e) => e / a * r >= i) || p[p.length - 1], l = [], u = Math.ceil(t / c) * c;
139
+ for (; u <= n; u += c) l.push({
140
+ t: u,
141
+ label: c >= 864e5 ? s(u) : o(u, c < e)
142
+ });
143
+ return {
144
+ step: c,
145
+ list: l
146
+ };
126
147
  }
127
- function I(t, e) {
128
- const n = String(t ?? "");
129
- if (e = (e || "").trim(), !e) return [{ t: n, hit: !1 }];
130
- const o = e.toLowerCase(), a = n.toLowerCase(), r = [];
131
- let c = 0;
132
- for (; ; ) {
133
- const i = a.indexOf(o, c);
134
- if (i < 0) {
135
- c < n.length && r.push({ t: n.slice(c), hit: !1 });
136
- break;
137
- }
138
- i > c && r.push({ t: n.slice(c, i), hit: !1 }), r.push({ t: n.slice(i, i + e.length), hit: !0 }), c = i + e.length;
139
- }
140
- return r.length ? r : [{ t: n, hit: !1 }];
148
+ function _(e, t) {
149
+ let n = String(e ?? "");
150
+ if (t = (t || "").trim(), !t) return [{
151
+ t: n,
152
+ hit: !1
153
+ }];
154
+ let r = t.toLowerCase(), i = n.toLowerCase(), a = [], o = 0;
155
+ for (;;) {
156
+ let e = i.indexOf(r, o);
157
+ if (e < 0) {
158
+ o < n.length && a.push({
159
+ t: n.slice(o),
160
+ hit: !1
161
+ });
162
+ break;
163
+ }
164
+ e > o && a.push({
165
+ t: n.slice(o, e),
166
+ hit: !1
167
+ }), a.push({
168
+ t: n.slice(e, e + t.length),
169
+ hit: !0
170
+ }), o = e + t.length;
171
+ }
172
+ return a.length ? a : [{
173
+ t: n,
174
+ hit: !1
175
+ }];
141
176
  }
142
- function k(t, e, n) {
143
- if (e = (e || "").trim(), !e) return !0;
144
- if (n?.length && t !== null && typeof t == "object" && !Array.isArray(t)) {
145
- const a = { ...t };
146
- for (const r of n) delete a[r];
147
- t = a;
148
- }
149
- let o;
150
- try {
151
- o = JSON.stringify(t).toLowerCase();
152
- } catch {
153
- o = String(t).toLowerCase();
154
- }
155
- return e.toLowerCase().split(/\s+/).filter(Boolean).every((a) => o.includes(a));
177
+ function v(e, t, n) {
178
+ if (t = (t || "").trim(), !t) return !0;
179
+ if (n?.length && typeof e == "object" && e && !Array.isArray(e)) {
180
+ let t = { ...e };
181
+ for (let e of n) delete t[e];
182
+ e = t;
183
+ }
184
+ let r;
185
+ try {
186
+ r = JSON.stringify(e).toLowerCase();
187
+ } catch {
188
+ r = String(e).toLowerCase();
189
+ }
190
+ return t.toLowerCase().split(/\s+/).filter(Boolean).every((e) => r.includes(e));
156
191
  }
157
- const H = [
158
- "var(--crk-timeline-1, #0e7568)",
159
- "var(--crk-timeline-2, #4c5bd4)",
160
- "var(--crk-timeline-3, #c05f2c)",
161
- "var(--crk-timeline-4, #96488a)",
162
- "var(--crk-timeline-5, #3e6b8f)",
163
- "var(--crk-timeline-6, #b03a48)"
192
+ var y = [
193
+ "var(--crk-timeline-1, #0e7568)",
194
+ "var(--crk-timeline-2, #4c5bd4)",
195
+ "var(--crk-timeline-3, #c05f2c)",
196
+ "var(--crk-timeline-4, #96488a)",
197
+ "var(--crk-timeline-5, #3e6b8f)",
198
+ "var(--crk-timeline-6, #b03a48)"
164
199
  ];
165
- function R(t, e) {
166
- return `color-mix(in srgb, ${t} ${e}%, white)`;
200
+ function b(e, t) {
201
+ return `color-mix(in srgb, ${e} ${t}%, white)`;
167
202
  }
168
- const b = {
169
- body: "var(--crk-timeline-body, #3b352f)",
170
- stem: "var(--crk-timeline-stem, #c9c1b5)",
171
- stemHot: "var(--crk-timeline-stem-hot, #8a8175)",
172
- hlWashSoft: "var(--crk-timeline-hl-wash-soft, #fff9e8)",
173
- hlRing: "var(--crk-timeline-hl-ring, #f3d98b)",
174
- hlBorder: "var(--crk-timeline-hl-border, #e8b931)",
175
- hlBarBg: "var(--crk-timeline-hl-bar, #ffe9ae)",
176
- selectedRing: "var(--crk-timeline-selected-ring, #b8ddd6)"
177
- };
178
- export {
179
- S as DAY,
180
- N as HOUR,
181
- U as MINUTE,
182
- O as SECOND,
183
- D as TICK_STEPS,
184
- H as TIMELINE_PALETTE_VARS,
185
- b as TL_COLORS,
186
- k as eventMatches,
187
- u as fmtClock,
188
- h as fmtClockUTC,
189
- s as fmtDate,
190
- Y as fmtDateISO,
191
- d as fmtDateTime,
192
- C as fmtDur,
193
- g as fmtISO,
194
- I as highlightParts,
195
- M as tickSubdiv,
196
- T as ticks,
197
- R as tint
203
+ var x = {
204
+ ink: "var(--crk-timeline-ink, #23201c)",
205
+ body: "var(--crk-timeline-body, #3b352f)",
206
+ secondary: "var(--crk-timeline-secondary, #57504a)",
207
+ muted: "var(--crk-timeline-muted, #857d73)",
208
+ faint: "var(--crk-timeline-faint, #b0a79b)",
209
+ hairline: "var(--crk-timeline-hairline, #e8e2d9)",
210
+ stem: "var(--crk-timeline-stem, #c9c1b5)",
211
+ stemHot: "var(--crk-timeline-stem-hot, #8a8175)",
212
+ accent: "var(--crk-timeline-accent, #0e7568)",
213
+ accentDark: "var(--crk-timeline-accent-dark, #0b5a50)",
214
+ accentTint: "var(--crk-timeline-accent-tint, #e4f1ee)",
215
+ hlWash: "var(--crk-timeline-hl-wash, #fff3d1)",
216
+ hlWashSoft: "var(--crk-timeline-hl-wash-soft, #fff9e8)",
217
+ hlMark: "var(--crk-timeline-hl-mark, #ffdf7e)",
218
+ hlRing: "var(--crk-timeline-hl-ring, #f3d98b)",
219
+ hlBorder: "var(--crk-timeline-hl-border, #e8b931)",
220
+ hlBarBg: "var(--crk-timeline-hl-bar, #ffe9ae)",
221
+ selectedRing: "var(--crk-timeline-selected-ring, #b8ddd6)"
198
222
  };
223
+ export { r as DAY, n as HOUR, t as MINUTE, e as SECOND, p as TICK_STEPS, y as TIMELINE_PALETTE_VARS, x as TL_COLORS, v as eventMatches, o as fmtClock, l as fmtClockUTC, s as fmtDate, u as fmtDateISO, c as fmtDateTime, f as fmtDur, d as fmtISO, _ as highlightParts, h as tickSubdiv, g as ticks, b as tint };
@@ -1,64 +1,62 @@
1
- const s = /* @__PURE__ */ new Set([
2
- "id",
3
- "service",
4
- "source",
5
- "op",
6
- "kind",
7
- "level",
8
- "message",
9
- "payload",
10
- "details",
11
- "requestId",
12
- "method",
13
- "url",
14
- "label",
15
- "query",
16
- "reqHeaders",
17
- "reqBody",
18
- "status",
19
- "resHeaders",
20
- "resBody",
21
- "start",
22
- "end"
23
- ]), o = [
24
- "method",
25
- "url",
26
- "status",
27
- "query",
28
- "reqHeaders",
29
- "reqBody",
30
- "resHeaders",
31
- "resBody"
32
- ], n = (e) => e.kind ? e.kind === "request" : o.some((r) => e[r] != null), u = (e) => e.op || e.requestId || e.reqHeaders && e.reqHeaders["x-request-id"] || e.id, i = (e) => e.source || (n(e) ? "client" : ""), l = (e) => {
33
- const r = i(e);
34
- return r ? r + " → " + e.service : e.service;
35
- }, d = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean", a = (e) => {
36
- if (typeof e == "string") return e;
37
- try {
38
- return JSON.stringify(e, null, 2) ?? String(e);
39
- } catch {
40
- return String(e);
41
- }
1
+ // src/components/Timeline/traceEvent.ts
2
+ var e = /* @__PURE__ */ new Set([
3
+ "id",
4
+ "service",
5
+ "source",
6
+ "op",
7
+ "kind",
8
+ "level",
9
+ "message",
10
+ "payload",
11
+ "details",
12
+ "requestId",
13
+ "method",
14
+ "url",
15
+ "label",
16
+ "query",
17
+ "reqHeaders",
18
+ "reqBody",
19
+ "status",
20
+ "resHeaders",
21
+ "resBody",
22
+ "start",
23
+ "end"
24
+ ]), t = [
25
+ "method",
26
+ "url",
27
+ "status",
28
+ "query",
29
+ "reqHeaders",
30
+ "reqBody",
31
+ "resHeaders",
32
+ "resBody"
33
+ ], n = (e) => e.kind ? e.kind === "request" : t.some((t) => e[t] != null), r = (e) => e.op || e.requestId || e.reqHeaders && e.reqHeaders["x-request-id"] || e.id, i = (e) => e.source || (n(e) ? "client" : ""), a = (e) => {
34
+ let t = i(e);
35
+ return t ? t + " → " + e.service : e.service;
36
+ }, o = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean", s = (e) => {
37
+ if (typeof e == "string") return e;
38
+ try {
39
+ return JSON.stringify(e, null, 2) ?? String(e);
40
+ } catch {
41
+ return String(e);
42
+ }
42
43
  };
43
- function c(e, r) {
44
- return r ? { text: n(e) ? "pending" : "ongoing", tone: "pending" } : typeof e.status == "number" ? { text: String(e.status), tone: e.status >= 400 ? "error" : "ok" } : e.level ? {
45
- text: e.level,
46
- tone: e.level === "error" ? "error" : e.level === "warning" ? "warn" : e.level === "success" ? "ok" : "pending"
47
- } : null;
44
+ function c(e, t) {
45
+ return t ? {
46
+ text: n(e) ? "pending" : "ongoing",
47
+ tone: "pending"
48
+ } : typeof e.status == "number" ? {
49
+ text: String(e.status),
50
+ tone: e.status >= 400 ? "error" : "ok"
51
+ } : e.level ? {
52
+ text: e.level,
53
+ tone: e.level === "error" ? "error" : e.level === "warning" ? "warn" : e.level === "success" ? "ok" : "pending"
54
+ } : null;
48
55
  }
49
- function f(e, r) {
50
- return Object.keys(e).filter(
51
- (t) => !s.has(t) && !r?.includes(t) && e[t] !== void 0 && typeof e[t] != "function"
52
- ).map((t) => ({ label: t, value: e[t] }));
56
+ function l(t, n) {
57
+ return Object.keys(t).filter((r) => !e.has(r) && !n?.includes(r) && t[r] !== void 0 && typeof t[r] != "function").map((e) => ({
58
+ label: e,
59
+ value: t[e]
60
+ }));
53
61
  }
54
- export {
55
- s as KNOWN_KEYS,
56
- c as badgeOf,
57
- f as extraFieldsOf,
58
- d as isInline,
59
- n as isRequestEvent,
60
- u as ridOf,
61
- l as routeOf,
62
- i as srcOf,
63
- a as toText
64
- };
62
+ export { e as KNOWN_KEYS, c as badgeOf, l as extraFieldsOf, o as isInline, n as isRequestEvent, r as ridOf, a as routeOf, i as srcOf, s as toText };