@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,61 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
p as activeBar,
|
|
33
|
-
l as areaPath,
|
|
34
|
-
n as axis,
|
|
35
|
-
a as axisLabel,
|
|
36
|
-
k as bar,
|
|
37
|
-
d as barLabelInside,
|
|
38
|
-
e as canvas,
|
|
39
|
-
r as cursorLine,
|
|
40
|
-
S as default,
|
|
41
|
-
R as empty,
|
|
42
|
-
c as gridLine,
|
|
43
|
-
g as interactionLayer,
|
|
44
|
-
L as legend,
|
|
45
|
-
h as legendIcon,
|
|
46
|
-
b as legendItem,
|
|
47
|
-
v as legendLabel,
|
|
48
|
-
w as legendSwatch,
|
|
49
|
-
i as linePath,
|
|
50
|
-
s as point,
|
|
51
|
-
t as root,
|
|
52
|
-
B as sparkline,
|
|
53
|
-
o as svg,
|
|
54
|
-
u as tooltip,
|
|
55
|
-
x as tooltipLabel,
|
|
56
|
-
P as tooltipRow,
|
|
57
|
-
m as tooltipRows,
|
|
58
|
-
I as tooltipTitle,
|
|
59
|
-
y as tooltipValue,
|
|
60
|
-
H as tradingHeader
|
|
1
|
+
// src/components/Chart/Chart.module.scss
|
|
2
|
+
var e = "crk-root-uMSq0", t = "crk-canvas-zhFr0", n = "crk-svg-waPLB", r = "crk-gridLine-K2Gx9", i = "crk-axis-Zum8-", a = "crk-axisLabel-Ilv3u", o = "crk-cursorLine-iNHim", s = "crk-linePath-E4eYA", c = "crk-areaPath-ZwMc6", l = "crk-point-DTAoa", u = "crk-bar-9sYbq", d = "crk-barLabelInside-dlQh5", f = "crk-activeBar-FJhPJ", p = "crk-interactionLayer-dHNAG", m = "crk-legend-JL6YI", h = "crk-legendItem-rcdvO", g = "crk-legendSwatch-eJBsF", _ = "crk-legendIcon-6gzcO", v = "crk-legendLabel-C-eu3", y = "crk-tooltip-m55-N", b = "crk-tooltipTitle-0EfoX", x = "crk-tooltipRows-MC0wM", S = "crk-tooltipRow-ZQomr", C = "crk-tooltipLabel-s4OKX", w = "crk-tooltipValue-iwj1s", T = "crk-empty-aa4vk", E = "crk-sparkline-3-eRc", D = "crk-tradingHeader-Pb9wS", O = {
|
|
3
|
+
root: e,
|
|
4
|
+
canvas: t,
|
|
5
|
+
svg: n,
|
|
6
|
+
gridLine: r,
|
|
7
|
+
axis: i,
|
|
8
|
+
axisLabel: a,
|
|
9
|
+
cursorLine: o,
|
|
10
|
+
linePath: s,
|
|
11
|
+
areaPath: c,
|
|
12
|
+
point: l,
|
|
13
|
+
bar: u,
|
|
14
|
+
barLabelInside: d,
|
|
15
|
+
activeBar: f,
|
|
16
|
+
interactionLayer: p,
|
|
17
|
+
legend: m,
|
|
18
|
+
legendItem: h,
|
|
19
|
+
legendSwatch: g,
|
|
20
|
+
legendIcon: _,
|
|
21
|
+
legendLabel: v,
|
|
22
|
+
tooltip: y,
|
|
23
|
+
tooltipTitle: b,
|
|
24
|
+
tooltipRows: x,
|
|
25
|
+
tooltipRow: S,
|
|
26
|
+
tooltipLabel: C,
|
|
27
|
+
tooltipValue: w,
|
|
28
|
+
empty: T,
|
|
29
|
+
sparkline: E,
|
|
30
|
+
tradingHeader: D
|
|
61
31
|
};
|
|
32
|
+
export { f as activeBar, c as areaPath, i as axis, a as axisLabel, u as bar, d as barLabelInside, t as canvas, o as cursorLine, O as default, T as empty, r as gridLine, p as interactionLayer, m as legend, _ as legendIcon, h as legendItem, v as legendLabel, g as legendSwatch, s as linePath, l as point, e as root, E as sparkline, n as svg, y as tooltip, C as tooltipLabel, S as tooltipRow, x as tooltipRows, b as tooltipTitle, w as tooltipValue, D as tradingHeader };
|
|
@@ -1,41 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import o from "
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
N.displayName = "ChartContainer";
|
|
39
|
-
export {
|
|
40
|
-
N as ChartContainer
|
|
41
|
-
};
|
|
1
|
+
import { forwardRef as e, useImperativeHandle as t, useRef as n } from "react";
|
|
2
|
+
import r from "clsx";
|
|
3
|
+
import { useChartDimensions as i } from "./useChartDimensions.js";
|
|
4
|
+
import a from "./Chart.module.scss.js";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
// src/components/Chart/ChartContainer.tsx
|
|
7
|
+
var c = e(({ aspectRatio: e = 16 / 9, height: c, className: l, style: u, classes: d, legend: f, overlay: p, children: m }, h) => {
|
|
8
|
+
let g = n(null);
|
|
9
|
+
t(h, () => g.current);
|
|
10
|
+
let { width: _ } = i(g), v = Math.max(0, _), y = c ?? Math.round(v / e);
|
|
11
|
+
return /* @__PURE__ */ s("div", {
|
|
12
|
+
ref: g,
|
|
13
|
+
className: r(a.root, d?.root, l),
|
|
14
|
+
style: u,
|
|
15
|
+
children: [/* @__PURE__ */ s("div", {
|
|
16
|
+
className: a.canvas,
|
|
17
|
+
style: { height: y || void 0 },
|
|
18
|
+
children: [v > 0 && y > 0 && /* @__PURE__ */ o("svg", {
|
|
19
|
+
className: r(a.svg, d?.svg),
|
|
20
|
+
width: v,
|
|
21
|
+
height: y,
|
|
22
|
+
viewBox: `0 0 ${v} ${y}`,
|
|
23
|
+
role: "img",
|
|
24
|
+
children: m({
|
|
25
|
+
width: v,
|
|
26
|
+
height: y
|
|
27
|
+
})
|
|
28
|
+
}), p]
|
|
29
|
+
}), f]
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
c.displayName = "ChartContainer";
|
|
33
|
+
export { c as ChartContainer };
|
|
@@ -6,4 +6,4 @@ export interface ChartLegendProps {
|
|
|
6
6
|
classes?: Partial<ChartClasses>;
|
|
7
7
|
}
|
|
8
8
|
/** Renders a horizontal swatch + label for each entry in `config`. */
|
|
9
|
-
export declare function ChartLegend({ config, order, classes }: ChartLegendProps): import("react
|
|
9
|
+
export declare function ChartLegend({ config, order, classes }: ChartLegendProps): import("react").JSX.Element;
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import e from "clsx";
|
|
2
|
+
import t from "./Chart.module.scss.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
// src/components/Chart/ChartLegend.tsx
|
|
5
|
+
function i({ config: i, order: a, classes: o }) {
|
|
6
|
+
let s = a ?? Object.keys(i);
|
|
7
|
+
return /* @__PURE__ */ n("div", {
|
|
8
|
+
className: e(t.legend, o?.legend),
|
|
9
|
+
role: "list",
|
|
10
|
+
children: s.map((a) => {
|
|
11
|
+
let s = i[a];
|
|
12
|
+
return s ? /* @__PURE__ */ r("div", {
|
|
13
|
+
className: e(t.legendItem, o?.legendItem),
|
|
14
|
+
role: "listitem",
|
|
15
|
+
children: [s.icon ? /* @__PURE__ */ n("span", {
|
|
16
|
+
className: t.legendIcon,
|
|
17
|
+
style: { color: s.color },
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
children: s.icon
|
|
20
|
+
}) : /* @__PURE__ */ n("span", {
|
|
21
|
+
className: t.legendSwatch,
|
|
22
|
+
style: { background: s.color },
|
|
23
|
+
"aria-hidden": "true"
|
|
24
|
+
}), /* @__PURE__ */ n("span", {
|
|
25
|
+
className: t.legendLabel,
|
|
26
|
+
children: s.label
|
|
27
|
+
})]
|
|
28
|
+
}, a) : null;
|
|
29
|
+
})
|
|
30
|
+
});
|
|
28
31
|
}
|
|
29
|
-
export {
|
|
30
|
-
h as ChartLegend
|
|
31
|
-
};
|
|
32
|
+
export { i as ChartLegend };
|
|
@@ -29,4 +29,4 @@ export interface ChartTooltipProps<T> {
|
|
|
29
29
|
* Floating HTML tooltip rendered as an overlay over the chart SVG.
|
|
30
30
|
* Positions itself near `(x, y)` and flips horizontally when close to the right edge.
|
|
31
31
|
*/
|
|
32
|
-
export declare function ChartTooltip<T extends Record<string, unknown>>({ row, x, y, containerWidth, config, render, valueFormat, titleKey, resolveColor, classes, }: ChartTooltipProps<T>): import("react
|
|
32
|
+
export declare function ChartTooltip<T extends Record<string, unknown>>({ row, x, y, containerWidth, config, render, valueFormat, titleKey, resolveColor, classes, }: ChartTooltipProps<T>): import("react").JSX.Element | null;
|
|
@@ -1,42 +1,47 @@
|
|
|
1
|
-
import
|
|
2
|
-
import x from "clsx";
|
|
1
|
+
import e from "clsx";
|
|
3
2
|
import t from "./Chart.module.scss.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
3
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
// src/components/Chart/ChartTooltip.tsx
|
|
5
|
+
function a({ row: a, x: o, y: s, containerWidth: c, config: l, render: u, valueFormat: d = String, titleKey: f, resolveColor: p, classes: m }) {
|
|
6
|
+
if (!a) return null;
|
|
7
|
+
let h = o + 180 + 16 > c ? o - 180 - 12 : o + 12, g = Math.max(8, s - 16);
|
|
8
|
+
return /* @__PURE__ */ r("div", {
|
|
9
|
+
className: e(t.tooltip, m?.tooltip),
|
|
10
|
+
style: {
|
|
11
|
+
left: h,
|
|
12
|
+
top: g,
|
|
13
|
+
width: 180
|
|
14
|
+
},
|
|
15
|
+
role: "tooltip",
|
|
16
|
+
children: u ? u(a) : /* @__PURE__ */ i(n, { children: [f && a[f] !== void 0 && /* @__PURE__ */ r("div", {
|
|
17
|
+
className: t.tooltipTitle,
|
|
18
|
+
children: String(a[f])
|
|
19
|
+
}), /* @__PURE__ */ r("div", {
|
|
20
|
+
className: t.tooltipRows,
|
|
21
|
+
children: Object.entries(l).map(([e, n]) => {
|
|
22
|
+
let o = a[e];
|
|
23
|
+
if (o == null) return null;
|
|
24
|
+
let s = typeof o == "number" ? d(o) : String(o), c = p?.(e) ?? n.color;
|
|
25
|
+
return /* @__PURE__ */ i("div", {
|
|
26
|
+
className: t.tooltipRow,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ r("span", {
|
|
29
|
+
className: t.legendSwatch,
|
|
30
|
+
style: { background: c },
|
|
31
|
+
"aria-hidden": "true"
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ r("span", {
|
|
34
|
+
className: t.tooltipLabel,
|
|
35
|
+
children: n.label
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ r("span", {
|
|
38
|
+
className: t.tooltipValue,
|
|
39
|
+
children: s
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
}, e);
|
|
43
|
+
})
|
|
44
|
+
})] })
|
|
45
|
+
});
|
|
39
46
|
}
|
|
40
|
-
export {
|
|
41
|
-
F as ChartTooltip
|
|
42
|
-
};
|
|
47
|
+
export { a as ChartTooltip };
|
|
@@ -109,4 +109,4 @@ export interface LineChartProps<T extends Record<string, unknown>> {
|
|
|
109
109
|
* }}
|
|
110
110
|
* />
|
|
111
111
|
*/
|
|
112
|
-
export declare function LineChart<T extends Record<string, unknown>>({ data, xKey, config, aspectRatio, height, curve, showPoints, dotColorKey, renderDot, showValues, valuePosition, renderLabel, activeIndex, onPointClick, showGrid, showLegend, showTooltip, yTickCount, yFormat, xFormat, valueFormat, renderTooltip, margin: marginOverride, emptyMessage, className, style, classes, }: LineChartProps<T>): import("react
|
|
112
|
+
export declare function LineChart<T extends Record<string, unknown>>({ data, xKey, config, aspectRatio, height, curve, showPoints, dotColorKey, renderDot, showValues, valuePosition, renderLabel, activeIndex, onPointClick, showGrid, showLegend, showTooltip, yTickCount, yFormat, xFormat, valueFormat, renderTooltip, margin: marginOverride, emptyMessage, className, style, classes, }: LineChartProps<T>): import("react").JSX.Element;
|