@overdoser/react-toolkit 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -1
- package/CHANGELOG.md +41 -0
- package/components/Accordion/Accordion.js +160 -177
- package/components/Accordion/Accordion.module.scss.js +19 -35
- package/components/ActionButton/ActionButton.js +155 -209
- package/components/ActionButton/ActionButton.module.scss.js +24 -46
- package/components/ActionButton/CopyButton.js +52 -64
- package/components/Alert/Alert.js +93 -96
- package/components/Alert/Alert.module.scss.js +17 -32
- package/components/Avatar/Avatar.js +44 -55
- package/components/Avatar/Avatar.module.scss.js +22 -42
- package/components/Badge/Badge.js +15 -37
- package/components/Badge/Badge.module.scss.js +16 -30
- package/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/components/Breadcrumbs/Breadcrumbs.js +52 -48
- package/components/Breadcrumbs/Breadcrumbs.module.scss.js +9 -16
- package/components/Button/Button.js +35 -57
- package/components/Button/Button.module.scss.js +24 -46
- package/components/Card/Card.js +94 -131
- package/components/Card/Card.module.scss.js +34 -59
- package/components/Chart/AreaChart.d.ts +1 -1
- package/components/Chart/AreaChart.js +248 -249
- package/components/Chart/Axis.d.ts +2 -2
- package/components/Chart/Axis.js +34 -43
- package/components/Chart/BarChart.d.ts +1 -1
- package/components/Chart/BarChart.js +307 -348
- package/components/Chart/Chart.module.scss.js +31 -60
- package/components/Chart/ChartContainer.js +33 -41
- package/components/Chart/ChartLegend.d.ts +1 -1
- package/components/Chart/ChartLegend.js +31 -30
- package/components/Chart/ChartTooltip.d.ts +1 -1
- package/components/Chart/ChartTooltip.js +45 -40
- package/components/Chart/LineChart.d.ts +1 -1
- package/components/Chart/LineChart.js +220 -232
- package/components/Chart/PieChart.d.ts +1 -1
- package/components/Chart/PieChart.js +224 -240
- package/components/Chart/RadarChart.d.ts +1 -1
- package/components/Chart/RadarChart.js +166 -215
- package/components/Chart/Sparkline.js +73 -68
- package/components/Chart/TradingChart.d.ts +1 -1
- package/components/Chart/TradingChart.js +804 -701
- package/components/Chart/scales.js +28 -35
- package/components/Chart/trading/indicators.js +61 -62
- package/components/Chart/trading/period.js +46 -68
- package/components/Chart/useChartDimensions.js +30 -22
- package/components/Chip/Chip.js +98 -141
- package/components/Chip/Chip.module.scss.js +31 -58
- package/components/CodeBlock/CodeBlock.js +111 -119
- package/components/CodeBlock/CodeBlock.module.scss.js +22 -42
- package/components/CommandPalette/CommandPalette.js +387 -392
- package/components/CommandPalette/CommandPalette.module.scss.js +27 -48
- package/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
- package/components/ConfirmDialog/ConfirmDialog.js +184 -199
- package/components/ConfirmDialog/ConfirmDialog.module.scss.js +11 -20
- package/components/Divider/Divider.js +25 -36
- package/components/Divider/Divider.module.scss.js +16 -30
- package/components/Draggable/Draggable.d.ts +1 -1
- package/components/Draggable/Draggable.js +157 -164
- package/components/Draggable/Draggable.module.scss.js +9 -16
- package/components/Drawer/Drawer.js +104 -126
- package/components/Drawer/Drawer.module.scss.js +65 -118
- package/components/Dropdown/Dropdown.js +175 -234
- package/components/Dropdown/Dropdown.module.scss.js +28 -52
- package/components/Dropdown/DropdownItem.js +55 -58
- package/components/Dropdown/DropdownLabel.js +14 -11
- package/components/Dropdown/DropdownSeparator.js +13 -11
- package/components/Dropdown/dropdownContext.js +4 -5
- package/components/Dropdown/useContextMenu.js +27 -17
- package/components/Dropzone/Dropzone.js +99 -105
- package/components/Dropzone/Dropzone.module.scss.js +11 -20
- package/components/EmptyState/EmptyState.js +57 -54
- package/components/EmptyState/EmptyState.module.scss.js +13 -24
- package/components/Form/Form.d.ts +1 -1
- package/components/Form/Form.js +31 -34
- package/components/Form/Form.module.scss.js +15 -28
- package/components/Form/FormField.d.ts +1 -1
- package/components/Form/FormField.js +71 -75
- package/components/Form/FormRow.d.ts +1 -1
- package/components/Form/FormRow.js +11 -8
- package/components/Form/formFieldDefaults.js +4 -5
- package/components/ImageViewer/ImageViewer.js +312 -201
- package/components/ImageViewer/ImageViewer.module.scss.js +25 -46
- package/components/ImageViewer/useZoomPan.js +206 -137
- package/components/Kbd/Kbd.js +24 -21
- package/components/Kbd/Kbd.module.scss.js +9 -16
- package/components/KeyValueList/KeyValueList.js +119 -123
- package/components/KeyValueList/KeyValueList.module.scss.js +22 -42
- package/components/Link/Link.js +45 -59
- package/components/Link/Link.module.scss.js +9 -15
- package/components/List/List.js +22 -46
- package/components/List/List.module.scss.js +11 -20
- package/components/Loader/Loader.js +152 -182
- package/components/Loader/Loader.module.scss.js +39 -69
- package/components/Modal/Modal.js +93 -105
- package/components/Modal/Modal.module.scss.js +17 -32
- package/components/PageHeader/PageHeader.js +79 -73
- package/components/PageHeader/PageHeader.module.scss.js +22 -42
- package/components/Pagination/Pagination.js +62 -83
- package/components/Pagination/Pagination.module.scss.js +12 -22
- package/components/Pagination/paginationRange.js +15 -22
- package/components/Popover/Popover.js +110 -134
- package/components/Popover/Popover.module.scss.js +11 -20
- package/components/ProgressBar/ProgressBar.d.ts +15 -1
- package/components/ProgressBar/ProgressBar.js +56 -89
- package/components/ProgressBar/ProgressBar.module.scss.js +28 -50
- package/components/RelativeTime/RelativeTime.js +36 -43
- package/components/RelativeTime/RelativeTime.module.scss.js +3 -7
- package/components/SegmentedControl/SegmentedControl.js +93 -129
- package/components/SegmentedControl/SegmentedControl.module.scss.js +20 -38
- package/components/Skeleton/Skeleton.js +36 -50
- package/components/Skeleton/Skeleton.module.scss.js +14 -24
- package/components/Spinner/Spinner.js +25 -25
- package/components/Spinner/Spinner.module.scss.js +11 -19
- package/components/SplitButton/SplitButton.js +149 -196
- package/components/SplitButton/SplitButton.module.scss.js +30 -56
- package/components/SplitPane/SplitPane.js +134 -170
- package/components/SplitPane/SplitPane.module.scss.js +13 -24
- package/components/StatCard/StatCard.js +132 -125
- package/components/StatCard/StatCard.module.scss.js +41 -71
- package/components/StatusDot/StatusDot.js +28 -39
- package/components/StatusDot/StatusDot.module.scss.js +17 -31
- package/components/Table/Table.d.ts +1 -1
- package/components/Table/Table.js +381 -451
- package/components/Table/Table.module.scss.js +41 -80
- package/components/Table/useTableSort.js +51 -42
- package/components/Tabs/Tabs.js +109 -161
- package/components/Tabs/Tabs.module.scss.js +27 -52
- package/components/ThemeToggle/ThemeToggle.js +122 -98
- package/components/ThemeToggle/ThemeToggle.module.scss.js +12 -22
- package/components/Timeline/GanttTimeline.js +357 -318
- package/components/Timeline/GanttTimeline.module.scss.js +28 -54
- package/components/Timeline/HistoryTimeline.js +486 -450
- package/components/Timeline/HistoryTimeline.module.scss.js +30 -58
- package/components/Timeline/Timeline.module.scss.js +75 -140
- package/components/Timeline/TimelineShared.d.ts +7 -7
- package/components/Timeline/TimelineShared.js +288 -279
- package/components/Timeline/TraceEventDetails.d.ts +3 -3
- package/components/Timeline/TraceEventDetails.js +244 -177
- package/components/Timeline/TraceTimeline.js +823 -783
- package/components/Timeline/TraceTimeline.module.scss.js +97 -188
- package/components/Timeline/historyLayout.js +336 -263
- package/components/Timeline/timelineCore.js +208 -183
- package/components/Timeline/traceEvent.js +59 -61
- package/components/Timeline/traceLayout.js +101 -90
- package/components/Timeline/useTimeline.js +76 -79
- package/components/Timer/Timer.js +190 -156
- package/components/Timer/Timer.module.scss.js +28 -54
- package/components/Toast/Toast.d.ts +1 -1
- package/components/Toast/Toast.js +128 -128
- package/components/Toast/Toast.module.scss.js +36 -61
- package/components/Toast/toastStore.js +58 -62
- package/components/ToggleIconButton/ToggleIconButton.js +36 -58
- package/components/ToggleIconButton/ToggleIconButton.module.scss.js +14 -26
- package/components/Tooltip/Tooltip.d.ts +1 -1
- package/components/Tooltip/Tooltip.js +76 -85
- package/components/Tooltip/Tooltip.module.scss.js +16 -29
- package/components/Typography/Typography.js +10 -35
- package/components/Typography/Typography.module.scss.js +29 -52
- package/components/inputs/Checkbox/Checkbox.js +27 -51
- package/components/inputs/Checkbox/Checkbox.module.scss.js +9 -16
- package/components/inputs/Checkbox/CheckboxGroup.js +53 -111
- package/components/inputs/Checkbox/CheckboxGroup.module.scss.js +16 -30
- package/components/inputs/DatePicker/CalendarPanel.d.ts +1 -1
- package/components/inputs/DatePicker/CalendarPanel.js +263 -286
- package/components/inputs/DatePicker/CalendarPanel.module.scss.js +22 -40
- package/components/inputs/DatePicker/DatePicker.js +115 -142
- package/components/inputs/DatePicker/DatePicker.module.scss.js +13 -24
- package/components/inputs/DatePicker/dateUtils.js +32 -41
- package/components/inputs/DateTimePicker/DateTimePicker.js +226 -232
- package/components/inputs/DateTimePicker/DateTimePicker.module.scss.js +19 -36
- package/components/inputs/DateTimePicker/DateTimeSegments.js +273 -252
- package/components/inputs/DateTimePicker/TimeField.d.ts +1 -1
- package/components/inputs/DateTimePicker/TimeField.js +131 -132
- package/components/inputs/DateTimePicker/timeZoneUtils.js +95 -92
- package/components/inputs/Input/Input.js +98 -109
- package/components/inputs/Input/Input.module.scss.js +14 -26
- package/components/inputs/NumberInput/NumberInput.js +112 -132
- package/components/inputs/NumberInput/NumberInput.module.scss.js +13 -24
- package/components/inputs/Radio/Radio.js +50 -73
- package/components/inputs/Radio/Radio.module.scss.js +8 -14
- package/components/inputs/SearchInput/SearchInput.js +98 -115
- package/components/inputs/SearchInput/SearchInput.module.scss.js +7 -12
- package/components/inputs/Select/Select.d.ts +55 -3
- package/components/inputs/Select/Select.js +696 -682
- package/components/inputs/Select/Select.module.scss.js +49 -72
- package/components/inputs/Slider/Slider.js +97 -128
- package/components/inputs/Slider/Slider.module.scss.js +8 -14
- package/components/inputs/Switch/Switch.js +11 -8
- package/components/inputs/Textarea/Textarea.js +42 -58
- package/components/inputs/Textarea/Textarea.module.scss.js +13 -24
- package/hooks/useClickOutside.js +17 -14
- package/hooks/useDebouncedValue.js +13 -14
- package/hooks/useElementSize.js +27 -22
- package/hooks/useEscapeLayer.js +28 -29
- package/hooks/useFocusTrap.js +27 -38
- package/hooks/useKeyboard.js +76 -64
- package/hooks/useMediaQuery.js +10 -15
- package/hooks/useNow.js +28 -33
- package/hooks/usePersistedState.js +98 -94
- package/hooks/usePortalPosition.d.ts +2 -1
- package/hooks/usePortalPosition.js +28 -19
- package/hooks/useResizable.js +106 -104
- package/hooks/useTheme.js +28 -23
- package/index.css +2 -1
- package/index.js +96 -214
- package/index.layered.css +2 -3
- package/llms.txt +28 -4
- package/manifest.json +41 -4
- package/package.json +1 -1
- package/utils/formatBytes.js +29 -13
- package/utils/themeScript.js +6 -8
- package/utils/timeAgo.js +59 -32
|
@@ -1,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 { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useLayoutEffect as i, useMemo as ee, useRef as a, useState as o } from "react";
|
|
2
|
+
import s from "clsx";
|
|
3
|
+
import c from "./SplitPane.module.scss.js";
|
|
4
|
+
import { useResizable as l } from "../../hooks/useResizable.js";
|
|
5
|
+
import { usePersistedState as u } from "../../hooks/usePersistedState.js";
|
|
6
|
+
import { jsx as d, jsxs as te } from "react/jsx-runtime";
|
|
7
|
+
// src/components/SplitPane/SplitPane.tsx
|
|
8
|
+
function f(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 p = "__crk-splitpane-unpersisted__", m = e(({ children: e, direction: m = "horizontal", primary: h = "first", size: g, defaultSize: _ = "50%", onSizeChange: ne, minSize: v = 100, maxSize: y, minSecondarySize: b = 100, collapsible: x = !1, collapsed: S, defaultCollapsed: re = !1, onCollapsedChange: C, persistKey: w, handleSize: T = 6, handleLabel: ie = "Resize", disabled: E = !1, classes: D, className: O, style: ae, ...oe }, se) => {
|
|
32
|
+
let k = a(null);
|
|
33
|
+
r(se, () => k.current);
|
|
34
|
+
let A = m === "horizontal", [j, M] = o(0);
|
|
35
|
+
i(() => {
|
|
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] = u(w ?? p, {}, { sync: !!w }), F = t((e) => {
|
|
47
|
+
w && P((t) => ({
|
|
48
|
+
...t,
|
|
49
|
+
...e
|
|
50
|
+
}));
|
|
51
|
+
}, [w, P]), I = ee(() => f(_, 0), [_]), [L, R] = o(() => w && N.px !== void 0 ? null : I.ratio), [z, B] = o(() => w && N.px !== void 0 ? N.px : I.px ?? 0);
|
|
52
|
+
i(() => {
|
|
53
|
+
L !== null && j > 0 && B(L * j);
|
|
54
|
+
}, [L, j]);
|
|
55
|
+
let V = g === void 0 ? null : f(g, j), H = V ? V.px ?? 0 : z, [U, W] = o(() => w && N.collapsed !== void 0 ? N.collapsed : re), G = x && (S ?? U), K = t((e) => {
|
|
56
|
+
S === void 0 && W(e), C?.(e), F({ collapsed: e });
|
|
57
|
+
}, [
|
|
58
|
+
S,
|
|
59
|
+
C,
|
|
60
|
+
F
|
|
61
|
+
]), q = t(() => y === void 0 ? j > 0 ? Math.max(v, j - b - T) : 1e400 : y, [
|
|
62
|
+
y,
|
|
63
|
+
j,
|
|
64
|
+
v,
|
|
65
|
+
b,
|
|
66
|
+
T
|
|
67
|
+
]), J = j > 0 ? Math.min(Math.max(H, v), q()) : H, Y = a(J), X = l({
|
|
68
|
+
size: J,
|
|
69
|
+
defaultSize: I.px ?? (I.ratio !== null && j > 0 ? I.ratio * j : J),
|
|
70
|
+
min: v,
|
|
71
|
+
max: q,
|
|
72
|
+
axis: A ? "x" : "y",
|
|
73
|
+
invert: h === "second",
|
|
74
|
+
disabled: E,
|
|
75
|
+
onResizeStart: () => {
|
|
76
|
+
G && K(!1);
|
|
77
|
+
},
|
|
78
|
+
onResize: (e, t) => {
|
|
79
|
+
Y.current = t, V || (R(null), B(e)), ne?.(e);
|
|
80
|
+
},
|
|
81
|
+
onResizeEnd: (e) => {
|
|
82
|
+
x && Y.current < v / 2 ? (K(!0), Y.current = e) : F({ px: e });
|
|
83
|
+
}
|
|
84
|
+
}), ce = t(() => {
|
|
85
|
+
E || (x ? K(!G) : X.reset());
|
|
86
|
+
}, [
|
|
87
|
+
E,
|
|
88
|
+
x,
|
|
89
|
+
G,
|
|
90
|
+
K,
|
|
91
|
+
X
|
|
92
|
+
]);
|
|
93
|
+
n(() => {
|
|
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 = e[0], de = e[1], Q = h === "first", fe = /* @__PURE__ */ d("div", {
|
|
100
|
+
className: s(c.pane, Q ? c.primary : c.secondary, Q && G && c.collapsed, D?.pane, Q ? D?.primary : D?.secondary, Q && G && D?.collapsed),
|
|
101
|
+
style: Q ? Z : void 0,
|
|
102
|
+
"data-pane": Q ? "primary" : "secondary",
|
|
103
|
+
children: ue
|
|
104
|
+
}), pe = /* @__PURE__ */ d("div", {
|
|
105
|
+
className: s(c.pane, Q ? c.secondary : c.primary, !Q && G && c.collapsed, D?.pane, Q ? D?.secondary : D?.primary, !Q && G && D?.collapsed),
|
|
106
|
+
style: Q ? void 0 : Z,
|
|
107
|
+
"data-pane": Q ? "secondary" : "primary",
|
|
108
|
+
children: de
|
|
109
|
+
}), { onDoubleClick: me, ...$ } = X.handleProps;
|
|
110
|
+
return /* @__PURE__ */ te("div", {
|
|
111
|
+
ref: k,
|
|
112
|
+
className: s(c.root, A ? c.horizontal : c.vertical, D?.root, O),
|
|
113
|
+
style: {
|
|
114
|
+
...ae,
|
|
115
|
+
"--crk-splitpane-handle-size": `${T}px`
|
|
116
|
+
},
|
|
117
|
+
"data-direction": m,
|
|
118
|
+
...oe,
|
|
119
|
+
children: [
|
|
120
|
+
fe,
|
|
121
|
+
/* @__PURE__ */ d("div", {
|
|
122
|
+
...$,
|
|
123
|
+
onDoubleClick: ce,
|
|
124
|
+
"aria-label": ie,
|
|
125
|
+
"aria-valuenow": G ? 0 : $["aria-valuenow"],
|
|
126
|
+
tabIndex: E ? -1 : 0,
|
|
127
|
+
className: s(c.handle, X.isResizing && c.handleActive, E && c.handleDisabled, D?.handle, X.isResizing && D?.handleActive),
|
|
128
|
+
"data-collapsed": G || void 0
|
|
129
|
+
}),
|
|
130
|
+
pe
|
|
131
|
+
]
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
m.displayName = "SplitPane";
|
|
135
|
+
export { m as SplitPane };
|
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
t as collapsed,
|
|
15
|
-
i as default,
|
|
16
|
-
l as handle,
|
|
17
|
-
s as handleActive,
|
|
18
|
-
d as handleDisabled,
|
|
19
|
-
a as horizontal,
|
|
20
|
-
o as pane,
|
|
21
|
-
r as primary,
|
|
22
|
-
c as root,
|
|
23
|
-
n as secondary,
|
|
24
|
-
e as vertical
|
|
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
|
|
25
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 { forwardRef as e } from "react";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import n from "./StatCard.module.scss.js";
|
|
4
|
+
import { Skeleton as r } from "../Skeleton/Skeleton.js";
|
|
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 = e(({ label: e, 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 = t(n.root, n[x], n[`size-${S}`], P && n.interactive, C && n.accented, b && n.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: t(n.header, w?.header),
|
|
29
|
+
children: [/* @__PURE__ */ a("span", {
|
|
30
|
+
className: t(n.label, w?.label),
|
|
31
|
+
children: e
|
|
32
|
+
}), g && /* @__PURE__ */ a("span", {
|
|
33
|
+
className: t(n.icon, w?.icon),
|
|
34
|
+
"aria-hidden": "true",
|
|
35
|
+
children: g
|
|
36
|
+
})]
|
|
37
|
+
}),
|
|
38
|
+
b ? /* @__PURE__ */ o("div", {
|
|
39
|
+
className: n.skeletons,
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
children: [/* @__PURE__ */ a(r, {
|
|
42
|
+
variant: "text",
|
|
43
|
+
width: "55%",
|
|
44
|
+
height: "1.6em"
|
|
45
|
+
}), /* @__PURE__ */ a(r, {
|
|
46
|
+
variant: "text",
|
|
47
|
+
width: "35%",
|
|
48
|
+
height: "0.9em"
|
|
49
|
+
})]
|
|
50
|
+
}) : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("div", {
|
|
51
|
+
className: t(n.value, w?.value),
|
|
52
|
+
children: [u, d != null && /* @__PURE__ */ a("span", {
|
|
53
|
+
className: t(n.unit, w?.unit),
|
|
54
|
+
children: d
|
|
55
|
+
})]
|
|
56
|
+
}), (j || h) && /* @__PURE__ */ o("div", {
|
|
57
|
+
className: n.deltaRow,
|
|
58
|
+
children: [j && /* @__PURE__ */ o("span", {
|
|
59
|
+
className: t(n.delta, n[`tone-${M}`], w?.delta),
|
|
60
|
+
children: [j.trend !== "flat" && /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("span", {
|
|
61
|
+
"aria-hidden": "true",
|
|
62
|
+
className: n.arrow,
|
|
63
|
+
children: j.trend === "up" ? "▲" : "▼"
|
|
64
|
+
}), /* @__PURE__ */ a("span", {
|
|
65
|
+
className: n.srOnly,
|
|
66
|
+
children: j.trend
|
|
67
|
+
})] }), j.text]
|
|
68
|
+
}), h && /* @__PURE__ */ a("span", {
|
|
69
|
+
className: t(n.deltaLabel, w?.deltaLabel),
|
|
70
|
+
children: h
|
|
71
|
+
})]
|
|
72
|
+
})] }),
|
|
73
|
+
_ && /* @__PURE__ */ a("div", {
|
|
74
|
+
className: t(n.chart, w?.chart),
|
|
75
|
+
children: _
|
|
76
|
+
}),
|
|
77
|
+
v && /* @__PURE__ */ a("div", {
|
|
78
|
+
className: t(n.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 = e(({ columns: e = {
|
|
105
|
+
sm: 1,
|
|
106
|
+
md: 2,
|
|
107
|
+
lg: 4
|
|
108
|
+
}, gap: r = "md", classes: i, className: o, style: s, children: c, ...l }, u) => {
|
|
109
|
+
let d = typeof e == "number" ? {
|
|
110
|
+
sm: e,
|
|
111
|
+
md: e,
|
|
112
|
+
lg: e
|
|
113
|
+
} : {
|
|
114
|
+
sm: e.sm ?? 1,
|
|
115
|
+
md: e.md ?? 2,
|
|
116
|
+
lg: e.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: t(n.grid, n[`gap-${r}`], 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 };
|