@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,171 +1,135 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import e from "./SplitPane.module.js";
|
|
2
|
+
import { useResizable as t } from "../../hooks/useResizable.js";
|
|
3
|
+
import { usePersistedState as n } from "../../hooks/usePersistedState.js";
|
|
4
|
+
import { forwardRef as r, useCallback as i, useEffect as ee, useImperativeHandle as te, useLayoutEffect as a, useMemo as ne, useRef as o, useState as s } from "react";
|
|
5
|
+
import c from "clsx";
|
|
6
|
+
import { jsx as l, jsxs as re } from "react/jsx-runtime";
|
|
7
|
+
// src/components/SplitPane/SplitPane.tsx
|
|
8
|
+
function u(e, t) {
|
|
9
|
+
if (e === void 0) return {
|
|
10
|
+
px: null,
|
|
11
|
+
ratio: null
|
|
12
|
+
};
|
|
13
|
+
if (typeof e == "number") return {
|
|
14
|
+
px: e,
|
|
15
|
+
ratio: null
|
|
16
|
+
};
|
|
17
|
+
let n = e.trim();
|
|
18
|
+
if (n.endsWith("%")) {
|
|
19
|
+
let e = parseFloat(n) / 100;
|
|
20
|
+
return {
|
|
21
|
+
px: t > 0 ? e * t : null,
|
|
22
|
+
ratio: Number.isFinite(e) ? e : null
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
let r = parseFloat(n);
|
|
26
|
+
return {
|
|
27
|
+
px: Number.isFinite(r) ? r : null,
|
|
28
|
+
ratio: null
|
|
29
|
+
};
|
|
17
30
|
}
|
|
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
|
-
r ? e.secondary : e.primary,
|
|
124
|
-
!r && a && e.collapsed,
|
|
125
|
-
o?.pane,
|
|
126
|
-
r ? o?.secondary : o?.primary,
|
|
127
|
-
!r && a && o?.collapsed
|
|
128
|
-
),
|
|
129
|
-
style: r ? void 0 : W,
|
|
130
|
-
"data-pane": r ? "secondary" : "primary",
|
|
131
|
-
children: dt
|
|
132
|
-
}
|
|
133
|
-
), { onDoubleClick: bt, ...Y } = w.handleProps;
|
|
134
|
-
return /* @__PURE__ */ ft(
|
|
135
|
-
"div",
|
|
136
|
-
{
|
|
137
|
-
ref: I,
|
|
138
|
-
className: _(e.root, v ? e.horizontal : e.vertical, o?.root, K),
|
|
139
|
-
style: { ...tt, "--crk-splitpane-handle-size": `${F}px` },
|
|
140
|
-
"data-direction": p,
|
|
141
|
-
...et,
|
|
142
|
-
children: [
|
|
143
|
-
ut,
|
|
144
|
-
/* @__PURE__ */ O(
|
|
145
|
-
"div",
|
|
146
|
-
{
|
|
147
|
-
...Y,
|
|
148
|
-
onDoubleClick: st,
|
|
149
|
-
"aria-label": S,
|
|
150
|
-
"aria-valuenow": a ? 0 : Y["aria-valuenow"],
|
|
151
|
-
tabIndex: x ? -1 : 0,
|
|
152
|
-
className: _(
|
|
153
|
-
e.handle,
|
|
154
|
-
w.isResizing && e.handleActive,
|
|
155
|
-
x && e.handleDisabled,
|
|
156
|
-
o?.handle,
|
|
157
|
-
w.isResizing && o?.handleActive
|
|
158
|
-
),
|
|
159
|
-
"data-collapsed": a || void 0
|
|
160
|
-
}
|
|
161
|
-
),
|
|
162
|
-
pt
|
|
163
|
-
]
|
|
164
|
-
}
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
zt.displayName = "SplitPane";
|
|
169
|
-
export {
|
|
170
|
-
zt as SplitPane
|
|
171
|
-
};
|
|
31
|
+
var d = "__crk-splitpane-unpersisted__", f = r(({ children: r, direction: f = "horizontal", primary: p = "first", size: m, defaultSize: h = "50%", onSizeChange: g, minSize: _ = 100, maxSize: v, minSecondarySize: y = 100, collapsible: b = !1, collapsed: x, defaultCollapsed: ie = !1, onCollapsedChange: S, persistKey: C, handleSize: w = 6, handleLabel: ae = "Resize", disabled: T = !1, classes: E, className: D, style: O, ...oe }, se) => {
|
|
32
|
+
let k = o(null);
|
|
33
|
+
te(se, () => k.current);
|
|
34
|
+
let A = f === "horizontal", [j, M] = s(0);
|
|
35
|
+
a(() => {
|
|
36
|
+
let e = k.current;
|
|
37
|
+
if (!e) return;
|
|
38
|
+
let t = () => {
|
|
39
|
+
let t = e.getBoundingClientRect(), n = A ? t.width : t.height;
|
|
40
|
+
M((e) => e === n ? e : n);
|
|
41
|
+
};
|
|
42
|
+
if (t(), typeof ResizeObserver > "u") return;
|
|
43
|
+
let n = new ResizeObserver(t);
|
|
44
|
+
return n.observe(e), () => n.disconnect();
|
|
45
|
+
}, [A]);
|
|
46
|
+
let [N, P] = n(C ?? d, {}, { sync: !!C }), F = i((e) => {
|
|
47
|
+
C && P((t) => ({
|
|
48
|
+
...t,
|
|
49
|
+
...e
|
|
50
|
+
}));
|
|
51
|
+
}, [C, P]), I = ne(() => u(h, 0), [h]), [L, R] = s(() => C && N.px !== void 0 ? null : I.ratio), [z, B] = s(() => C && N.px !== void 0 ? N.px : I.px ?? 0);
|
|
52
|
+
a(() => {
|
|
53
|
+
L !== null && j > 0 && B(L * j);
|
|
54
|
+
}, [L, j]);
|
|
55
|
+
let V = m === void 0 ? null : u(m, j), H = V ? V.px ?? 0 : z, [U, W] = s(() => C && N.collapsed !== void 0 ? N.collapsed : ie), G = b && (x ?? U), K = i((e) => {
|
|
56
|
+
x === void 0 && W(e), S?.(e), F({ collapsed: e });
|
|
57
|
+
}, [
|
|
58
|
+
x,
|
|
59
|
+
S,
|
|
60
|
+
F
|
|
61
|
+
]), q = i(() => v === void 0 ? j > 0 ? Math.max(_, j - y - w) : Infinity : v, [
|
|
62
|
+
v,
|
|
63
|
+
j,
|
|
64
|
+
_,
|
|
65
|
+
y,
|
|
66
|
+
w
|
|
67
|
+
]), J = j > 0 ? Math.min(Math.max(H, _), q()) : H, Y = o(J), X = t({
|
|
68
|
+
size: J,
|
|
69
|
+
defaultSize: I.px ?? (I.ratio !== null && j > 0 ? I.ratio * j : J),
|
|
70
|
+
min: _,
|
|
71
|
+
max: q,
|
|
72
|
+
axis: A ? "x" : "y",
|
|
73
|
+
invert: p === "second",
|
|
74
|
+
disabled: T,
|
|
75
|
+
onResizeStart: () => {
|
|
76
|
+
G && K(!1);
|
|
77
|
+
},
|
|
78
|
+
onResize: (e, t) => {
|
|
79
|
+
Y.current = t, V || (R(null), B(e)), g?.(e);
|
|
80
|
+
},
|
|
81
|
+
onResizeEnd: (e) => {
|
|
82
|
+
b && Y.current < _ / 2 ? (K(!0), Y.current = e) : F({ px: e });
|
|
83
|
+
}
|
|
84
|
+
}), ce = i(() => {
|
|
85
|
+
T || (b ? K(!G) : X.reset());
|
|
86
|
+
}, [
|
|
87
|
+
T,
|
|
88
|
+
b,
|
|
89
|
+
G,
|
|
90
|
+
K,
|
|
91
|
+
X
|
|
92
|
+
]);
|
|
93
|
+
ee(() => {
|
|
94
|
+
V?.ratio !== null && V?.ratio !== void 0 && R(V.ratio);
|
|
95
|
+
}, [V?.ratio]);
|
|
96
|
+
let le = G ? 0 : V && V.px === null && V.ratio !== null ? `${V.ratio * 100}%` : !V && L !== null && j === 0 ? `${L * 100}%` : J, Z = {
|
|
97
|
+
[A ? "width" : "height"]: le,
|
|
98
|
+
flex: "0 0 auto"
|
|
99
|
+
}, ue = r[0], de = r[1], Q = p === "first", fe = /* @__PURE__ */ l("div", {
|
|
100
|
+
className: c(e.pane, Q ? e.primary : e.secondary, Q && G && e.collapsed, E?.pane, Q ? E?.primary : E?.secondary, Q && G && E?.collapsed),
|
|
101
|
+
style: Q ? Z : void 0,
|
|
102
|
+
"data-pane": Q ? "primary" : "secondary",
|
|
103
|
+
children: ue
|
|
104
|
+
}), pe = /* @__PURE__ */ l("div", {
|
|
105
|
+
className: c(e.pane, Q ? e.secondary : e.primary, !Q && G && e.collapsed, E?.pane, Q ? E?.secondary : E?.primary, !Q && G && E?.collapsed),
|
|
106
|
+
style: Q ? void 0 : Z,
|
|
107
|
+
"data-pane": Q ? "secondary" : "primary",
|
|
108
|
+
children: de
|
|
109
|
+
}), { onDoubleClick: me, ...$ } = X.handleProps;
|
|
110
|
+
return /* @__PURE__ */ re("div", {
|
|
111
|
+
ref: k,
|
|
112
|
+
className: c(e.root, A ? e.horizontal : e.vertical, E?.root, D),
|
|
113
|
+
style: {
|
|
114
|
+
...O,
|
|
115
|
+
"--crk-splitpane-handle-size": `${w}px`
|
|
116
|
+
},
|
|
117
|
+
"data-direction": f,
|
|
118
|
+
...oe,
|
|
119
|
+
children: [
|
|
120
|
+
fe,
|
|
121
|
+
/* @__PURE__ */ l("div", {
|
|
122
|
+
...$,
|
|
123
|
+
onDoubleClick: ce,
|
|
124
|
+
"aria-label": ae,
|
|
125
|
+
"aria-valuenow": G ? 0 : $["aria-valuenow"],
|
|
126
|
+
tabIndex: T ? -1 : 0,
|
|
127
|
+
className: c(e.handle, X.isResizing && e.handleActive, T && e.handleDisabled, E?.handle, X.isResizing && E?.handleActive),
|
|
128
|
+
"data-collapsed": G || void 0
|
|
129
|
+
}),
|
|
130
|
+
pe
|
|
131
|
+
]
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
f.displayName = "SplitPane";
|
|
135
|
+
export { f as SplitPane };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/components/SplitPane/SplitPane.module.scss
|
|
2
|
+
var e = "crk-root-4-LwZ", t = "crk-horizontal-zy9XG", n = "crk-vertical-K4r-5", r = "crk-pane-2kL-G", i = "crk-primary-uXbxW", a = "crk-secondary-Fq-4C", o = "crk-collapsed-DBz98", s = "crk-handle-dFfxM", c = "crk-handleActive-jc42L", l = "crk-handleDisabled-CEtI-", u = {
|
|
3
|
+
root: e,
|
|
4
|
+
horizontal: t,
|
|
5
|
+
vertical: n,
|
|
6
|
+
pane: r,
|
|
7
|
+
primary: i,
|
|
8
|
+
secondary: a,
|
|
9
|
+
collapsed: o,
|
|
10
|
+
handle: s,
|
|
11
|
+
handleActive: c,
|
|
12
|
+
handleDisabled: l
|
|
13
|
+
};
|
|
14
|
+
export { o as collapsed, u as default, s as handle, c as handleActive, l as handleDisabled, t as horizontal, r as pane, i as primary, e as root, a as secondary, n as vertical };
|
|
@@ -1,127 +1,134 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import n from "
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import e from "./StatCard.module.js";
|
|
2
|
+
import { Skeleton as t } from "../Skeleton/Skeleton.js";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import r from "clsx";
|
|
5
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
// src/components/StatCard/StatCard.tsx
|
|
7
|
+
var s = (e) => `${new Intl.NumberFormat(void 0, { maximumFractionDigits: 1 }).format(Math.abs(e))}%`;
|
|
8
|
+
function c(e, t) {
|
|
9
|
+
return e == null ? null : typeof e == "number" ? Number.isFinite(e) ? {
|
|
10
|
+
text: t(e),
|
|
11
|
+
trend: e > 0 ? "up" : e < 0 ? "down" : "flat"
|
|
12
|
+
} : null : {
|
|
13
|
+
text: e.value,
|
|
14
|
+
trend: e.trend ?? "flat"
|
|
15
|
+
};
|
|
9
16
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
17
|
+
function l(e, t) {
|
|
18
|
+
return t === "none" || e === "flat" ? "neutral" : e === "up" == (t !== "positive-down") ? "positive" : "negative";
|
|
12
19
|
}
|
|
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
|
-
};
|
|
20
|
+
var u = n(({ label: n, value: u, unit: d, delta: f, deltaFormat: p = s, trendColor: m = "auto", deltaLabel: h, icon: g, chart: _, footer: v, href: y, loading: b = !1, variant: x = "outlined", size: S = "md", accent: C, classes: w, className: T, style: E, onClick: D, onKeyDown: O, ...k }, A) => {
|
|
21
|
+
let j = b ? null : c(f, p), M = j ? l(j.trend, m) : "neutral", N = !y && !!D, P = !!y || N, F = (e) => {
|
|
22
|
+
O?.(e), N && !e.defaultPrevented && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
|
|
23
|
+
}, I = r(e.root, e[x], e[`size-${S}`], P && e.interactive, C && e.accented, b && e.loading, w?.root, T), L = {
|
|
24
|
+
...C ? { "--crk-stat-accent": C } : null,
|
|
25
|
+
...E
|
|
26
|
+
}, R = /* @__PURE__ */ o(i, { children: [
|
|
27
|
+
/* @__PURE__ */ o("div", {
|
|
28
|
+
className: r(e.header, w?.header),
|
|
29
|
+
children: [/* @__PURE__ */ a("span", {
|
|
30
|
+
className: r(e.label, w?.label),
|
|
31
|
+
children: n
|
|
32
|
+
}), g && /* @__PURE__ */ a("span", {
|
|
33
|
+
className: r(e.icon, w?.icon),
|
|
34
|
+
"aria-hidden": "true",
|
|
35
|
+
children: g
|
|
36
|
+
})]
|
|
37
|
+
}),
|
|
38
|
+
b ? /* @__PURE__ */ o("div", {
|
|
39
|
+
className: e.skeletons,
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
children: [/* @__PURE__ */ a(t, {
|
|
42
|
+
variant: "text",
|
|
43
|
+
width: "55%",
|
|
44
|
+
height: "1.6em"
|
|
45
|
+
}), /* @__PURE__ */ a(t, {
|
|
46
|
+
variant: "text",
|
|
47
|
+
width: "35%",
|
|
48
|
+
height: "0.9em"
|
|
49
|
+
})]
|
|
50
|
+
}) : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("div", {
|
|
51
|
+
className: r(e.value, w?.value),
|
|
52
|
+
children: [u, d != null && /* @__PURE__ */ a("span", {
|
|
53
|
+
className: r(e.unit, w?.unit),
|
|
54
|
+
children: d
|
|
55
|
+
})]
|
|
56
|
+
}), (j || h) && /* @__PURE__ */ o("div", {
|
|
57
|
+
className: e.deltaRow,
|
|
58
|
+
children: [j && /* @__PURE__ */ o("span", {
|
|
59
|
+
className: r(e.delta, e[`tone-${M}`], w?.delta),
|
|
60
|
+
children: [j.trend !== "flat" && /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("span", {
|
|
61
|
+
"aria-hidden": "true",
|
|
62
|
+
className: e.arrow,
|
|
63
|
+
children: j.trend === "up" ? "▲" : "▼"
|
|
64
|
+
}), /* @__PURE__ */ a("span", {
|
|
65
|
+
className: e.srOnly,
|
|
66
|
+
children: j.trend
|
|
67
|
+
})] }), j.text]
|
|
68
|
+
}), h && /* @__PURE__ */ a("span", {
|
|
69
|
+
className: r(e.deltaLabel, w?.deltaLabel),
|
|
70
|
+
children: h
|
|
71
|
+
})]
|
|
72
|
+
})] }),
|
|
73
|
+
_ && /* @__PURE__ */ a("div", {
|
|
74
|
+
className: r(e.chart, w?.chart),
|
|
75
|
+
children: _
|
|
76
|
+
}),
|
|
77
|
+
v && /* @__PURE__ */ a("div", {
|
|
78
|
+
className: r(e.footer, w?.footer),
|
|
79
|
+
children: v
|
|
80
|
+
})
|
|
81
|
+
] });
|
|
82
|
+
return y ? /* @__PURE__ */ a("a", {
|
|
83
|
+
ref: A,
|
|
84
|
+
href: y,
|
|
85
|
+
className: I,
|
|
86
|
+
style: L,
|
|
87
|
+
"aria-busy": b || void 0,
|
|
88
|
+
...k,
|
|
89
|
+
children: R
|
|
90
|
+
}) : /* @__PURE__ */ a("div", {
|
|
91
|
+
ref: A,
|
|
92
|
+
className: I,
|
|
93
|
+
style: L,
|
|
94
|
+
role: N ? "button" : void 0,
|
|
95
|
+
tabIndex: N ? 0 : void 0,
|
|
96
|
+
onClick: D,
|
|
97
|
+
onKeyDown: N || O ? F : void 0,
|
|
98
|
+
"aria-busy": b || void 0,
|
|
99
|
+
...k,
|
|
100
|
+
children: R
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
u.displayName = "StatCard";
|
|
104
|
+
var d = n(({ columns: t = {
|
|
105
|
+
sm: 1,
|
|
106
|
+
md: 2,
|
|
107
|
+
lg: 4
|
|
108
|
+
}, gap: n = "md", classes: i, className: o, style: s, children: c, ...l }, u) => {
|
|
109
|
+
let d = typeof t == "number" ? {
|
|
110
|
+
sm: t,
|
|
111
|
+
md: t,
|
|
112
|
+
lg: t
|
|
113
|
+
} : {
|
|
114
|
+
sm: t.sm ?? 1,
|
|
115
|
+
md: t.md ?? 2,
|
|
116
|
+
lg: t.lg ?? 4
|
|
117
|
+
}, f = {
|
|
118
|
+
"--crk-stat-grid-columns-sm": String(d.sm),
|
|
119
|
+
"--crk-stat-grid-columns-md": String(d.md),
|
|
120
|
+
"--crk-stat-grid-columns-lg": String(d.lg)
|
|
121
|
+
};
|
|
122
|
+
return /* @__PURE__ */ a("div", {
|
|
123
|
+
ref: u,
|
|
124
|
+
className: r(e.grid, e[`gap-${n}`], i?.root, o),
|
|
125
|
+
style: {
|
|
126
|
+
...f,
|
|
127
|
+
...s
|
|
128
|
+
},
|
|
129
|
+
...l,
|
|
130
|
+
children: c
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
d.displayName = "StatGrid";
|
|
134
|
+
export { u as StatCard, d as StatGrid };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// src/components/StatCard/StatCard.module.scss
|
|
2
|
+
var e = "crk-root-zKEt2", t = "crk-outlined-XHAHG", n = "crk-elevated-VHDgT", r = "crk-filled-w9awn", i = "crk-size-sm-dy5Z-", a = "crk-size-md-Q1vXC", o = "crk-size-lg-RHsB3", s = "crk-interactive-w53Nd", c = "crk-accented-aEY4-", l = "crk-header-ZLeFH", u = "crk-label-E4Rgi", d = "crk-icon-XvPJv", f = "crk-value-0r3GP", p = "crk-unit-00NPF", m = "crk-deltaRow-AaiEx", h = "crk-delta-xCWjx", g = "crk-arrow-OdpoI", _ = "crk-tone-positive-H-7co", v = "crk-tone-negative-kbhSv", y = "crk-tone-neutral-SAt38", b = "crk-deltaLabel-CzgUN", x = "crk-chart-GYQ0q", S = "crk-footer-K76y3", C = "crk-skeletons-uy-lT", w = "crk-srOnly-KSjm6", T = "crk-grid-bPuJo", E = "crk-gap-sm-60yMv", D = "crk-gap-md-peh45", O = "crk-gap-lg-7gGgN", k = {
|
|
3
|
+
root: e,
|
|
4
|
+
outlined: t,
|
|
5
|
+
elevated: n,
|
|
6
|
+
filled: r,
|
|
7
|
+
"size-sm": "crk-size-sm-dy5Z-",
|
|
8
|
+
sizeSm: i,
|
|
9
|
+
"size-md": "crk-size-md-Q1vXC",
|
|
10
|
+
sizeMd: a,
|
|
11
|
+
"size-lg": "crk-size-lg-RHsB3",
|
|
12
|
+
sizeLg: o,
|
|
13
|
+
interactive: s,
|
|
14
|
+
accented: c,
|
|
15
|
+
header: l,
|
|
16
|
+
label: u,
|
|
17
|
+
icon: d,
|
|
18
|
+
value: f,
|
|
19
|
+
unit: p,
|
|
20
|
+
deltaRow: m,
|
|
21
|
+
delta: h,
|
|
22
|
+
arrow: g,
|
|
23
|
+
"tone-positive": "crk-tone-positive-H-7co",
|
|
24
|
+
tonePositive: _,
|
|
25
|
+
"tone-negative": "crk-tone-negative-kbhSv",
|
|
26
|
+
toneNegative: v,
|
|
27
|
+
"tone-neutral": "crk-tone-neutral-SAt38",
|
|
28
|
+
toneNeutral: y,
|
|
29
|
+
deltaLabel: b,
|
|
30
|
+
chart: x,
|
|
31
|
+
footer: S,
|
|
32
|
+
skeletons: C,
|
|
33
|
+
srOnly: w,
|
|
34
|
+
grid: T,
|
|
35
|
+
"gap-sm": "crk-gap-sm-60yMv",
|
|
36
|
+
gapSm: E,
|
|
37
|
+
"gap-md": "crk-gap-md-peh45",
|
|
38
|
+
gapMd: D,
|
|
39
|
+
"gap-lg": "crk-gap-lg-7gGgN",
|
|
40
|
+
gapLg: O
|
|
41
|
+
};
|
|
42
|
+
export { c as accented, g as arrow, x as chart, k as default, h as delta, b as deltaLabel, m as deltaRow, n as elevated, r as filled, S as footer, O as gapLg, D as gapMd, E as gapSm, T as grid, l as header, d as icon, s as interactive, u as label, t as outlined, e as root, o as sizeLg, a as sizeMd, i as sizeSm, C as skeletons, w as srOnly, v as toneNegative, y as toneNeutral, _ as tonePositive, p as unit, f as value };
|