@overdoser/react-toolkit 0.21.0 → 0.22.1
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 +1 -0
- package/CHANGELOG.md +35 -0
- package/components/Accordion/Accordion.js +48 -48
- package/components/ActionButton/ActionButton.js +23 -23
- package/components/ActionButton/CopyButton.js +5 -5
- package/components/Alert/Alert.js +13 -13
- package/components/Avatar/Avatar.js +12 -12
- package/components/Badge/Badge.js +6 -6
- package/components/Breadcrumbs/Breadcrumbs.js +15 -15
- package/components/Button/Button.js +14 -14
- package/components/Card/Card.js +26 -26
- package/components/Chart/AreaChart.js +103 -103
- package/components/Chart/Axis.js +7 -7
- package/components/Chart/BarChart.js +62 -62
- package/components/Chart/ChartContainer.js +11 -11
- package/components/Chart/ChartLegend.js +7 -7
- package/components/Chart/ChartTooltip.js +13 -13
- package/components/Chart/LineChart.js +88 -88
- package/components/Chart/PieChart.js +25 -25
- package/components/Chart/RadarChart.js +42 -42
- package/components/Chart/Sparkline.js +11 -11
- package/components/Chart/TradingChart.js +126 -126
- package/components/Chart/trading/period.js +3 -3
- package/components/Chip/Chip.js +24 -24
- package/components/CodeBlock/CodeBlock.js +31 -31
- package/components/CommandPalette/CommandPalette.js +166 -166
- package/components/ConfirmDialog/ConfirmDialog.js +60 -60
- package/components/Divider/Divider.js +10 -10
- package/components/Draggable/Draggable.js +29 -29
- package/components/Drawer/Drawer.js +53 -53
- package/components/Dropdown/Dropdown.js +66 -66
- package/components/Dropdown/DropdownItem.js +13 -13
- package/components/Dropdown/DropdownLabel.js +5 -5
- package/components/Dropdown/DropdownSeparator.js +5 -5
- package/components/Dropzone/Dropzone.js +15 -15
- package/components/EmptyState/EmptyState.js +11 -11
- package/components/Form/Form.js +17 -17
- package/components/Form/FormField.js +21 -21
- package/components/Form/FormRow.js +3 -3
- package/components/ImageViewer/ImageViewer.js +118 -118
- package/components/Kbd/Kbd.js +11 -11
- package/components/KeyValueList/KeyValueList.js +32 -32
- package/components/Link/Link.js +7 -7
- package/components/List/List.js +7 -7
- package/components/Loader/Loader.js +39 -39
- package/components/Modal/Modal.js +48 -48
- package/components/PageHeader/PageHeader.js +18 -18
- package/components/Pagination/Pagination.js +23 -23
- package/components/Popover/Popover.js +25 -25
- package/components/ProgressBar/ProgressBar.js +17 -17
- package/components/RelativeTime/RelativeTime.js +10 -10
- package/components/SegmentedControl/SegmentedControl.js +38 -38
- package/components/Skeleton/Skeleton.js +10 -10
- package/components/Spinner/Spinner.js +7 -7
- package/components/SplitButton/SplitButton.js +63 -63
- package/components/SplitPane/SplitPane.js +50 -50
- package/components/StatCard/StatCard.js +32 -32
- package/components/StatusDot/StatusDot.js +7 -7
- package/components/Table/Table.js +174 -174
- package/components/Tabs/Tabs.js +47 -47
- package/components/ThemeToggle/ThemeToggle.js +31 -31
- package/components/Timeline/GanttTimeline.js +213 -213
- package/components/Timeline/HistoryTimeline.js +306 -306
- package/components/Timeline/TimelineShared.js +103 -103
- package/components/Timeline/TraceEventDetails.js +103 -103
- package/components/Timeline/TraceTimeline.js +546 -546
- package/components/Timeline/historyLayout.js +2 -2
- package/components/Timer/Timer.js +39 -39
- package/components/Toast/Toast.js +59 -59
- package/components/ToggleIconButton/ToggleIconButton.js +9 -9
- package/components/Tooltip/Tooltip.js +16 -16
- package/components/Typography/Typography.js +5 -5
- package/components/inputs/Checkbox/Checkbox.js +11 -11
- package/components/inputs/Checkbox/CheckboxGroup.js +21 -21
- package/components/inputs/DatePicker/CalendarPanel.js +113 -113
- package/components/inputs/DatePicker/DatePicker.js +39 -39
- package/components/inputs/DateTimePicker/DateTimePicker.js +119 -119
- package/components/inputs/DateTimePicker/DateTimeSegments.js +40 -40
- package/components/inputs/DateTimePicker/TimeField.js +34 -34
- package/components/inputs/Input/Input.js +13 -13
- package/components/inputs/NumberInput/NumberInput.js +16 -16
- package/components/inputs/Radio/Radio.js +17 -17
- package/components/inputs/SearchInput/SearchInput.js +25 -25
- package/components/inputs/Select/Select.d.ts +55 -3
- package/components/inputs/Select/Select.js +485 -344
- package/components/inputs/Select/{Select.module.js → Select.module.scss.js} +15 -3
- package/components/inputs/Slider/Slider.js +21 -21
- package/components/inputs/Switch/Switch.js +4 -4
- package/components/inputs/Textarea/Textarea.js +8 -8
- package/hooks/usePortalPosition.d.ts +2 -1
- package/hooks/usePortalPosition.js +6 -3
- package/hooks/useResizable.js +1 -1
- package/hooks/useTheme.js +7 -7
- package/index.css +1 -1
- package/index.js +1 -1
- package/index.layered.css +1 -1
- package/llms.txt +25 -4
- package/manifest.json +33 -4
- package/package.json +1 -1
- /package/components/Accordion/{Accordion.module.js → Accordion.module.scss.js} +0 -0
- /package/components/ActionButton/{ActionButton.module.js → ActionButton.module.scss.js} +0 -0
- /package/components/Alert/{Alert.module.js → Alert.module.scss.js} +0 -0
- /package/components/Avatar/{Avatar.module.js → Avatar.module.scss.js} +0 -0
- /package/components/Badge/{Badge.module.js → Badge.module.scss.js} +0 -0
- /package/components/Breadcrumbs/{Breadcrumbs.module.js → Breadcrumbs.module.scss.js} +0 -0
- /package/components/Button/{Button.module.js → Button.module.scss.js} +0 -0
- /package/components/Card/{Card.module.js → Card.module.scss.js} +0 -0
- /package/components/Chart/{Chart.module.js → Chart.module.scss.js} +0 -0
- /package/components/Chip/{Chip.module.js → Chip.module.scss.js} +0 -0
- /package/components/CodeBlock/{CodeBlock.module.js → CodeBlock.module.scss.js} +0 -0
- /package/components/CommandPalette/{CommandPalette.module.js → CommandPalette.module.scss.js} +0 -0
- /package/components/ConfirmDialog/{ConfirmDialog.module.js → ConfirmDialog.module.scss.js} +0 -0
- /package/components/Divider/{Divider.module.js → Divider.module.scss.js} +0 -0
- /package/components/Draggable/{Draggable.module.js → Draggable.module.scss.js} +0 -0
- /package/components/Drawer/{Drawer.module.js → Drawer.module.scss.js} +0 -0
- /package/components/Dropdown/{Dropdown.module.js → Dropdown.module.scss.js} +0 -0
- /package/components/Dropzone/{Dropzone.module.js → Dropzone.module.scss.js} +0 -0
- /package/components/EmptyState/{EmptyState.module.js → EmptyState.module.scss.js} +0 -0
- /package/components/Form/{Form.module.js → Form.module.scss.js} +0 -0
- /package/components/ImageViewer/{ImageViewer.module.js → ImageViewer.module.scss.js} +0 -0
- /package/components/Kbd/{Kbd.module.js → Kbd.module.scss.js} +0 -0
- /package/components/KeyValueList/{KeyValueList.module.js → KeyValueList.module.scss.js} +0 -0
- /package/components/Link/{Link.module.js → Link.module.scss.js} +0 -0
- /package/components/List/{List.module.js → List.module.scss.js} +0 -0
- /package/components/Loader/{Loader.module.js → Loader.module.scss.js} +0 -0
- /package/components/Modal/{Modal.module.js → Modal.module.scss.js} +0 -0
- /package/components/PageHeader/{PageHeader.module.js → PageHeader.module.scss.js} +0 -0
- /package/components/Pagination/{Pagination.module.js → Pagination.module.scss.js} +0 -0
- /package/components/Popover/{Popover.module.js → Popover.module.scss.js} +0 -0
- /package/components/ProgressBar/{ProgressBar.module.js → ProgressBar.module.scss.js} +0 -0
- /package/components/RelativeTime/{RelativeTime.module.js → RelativeTime.module.scss.js} +0 -0
- /package/components/SegmentedControl/{SegmentedControl.module.js → SegmentedControl.module.scss.js} +0 -0
- /package/components/Skeleton/{Skeleton.module.js → Skeleton.module.scss.js} +0 -0
- /package/components/Spinner/{Spinner.module.js → Spinner.module.scss.js} +0 -0
- /package/components/SplitButton/{SplitButton.module.js → SplitButton.module.scss.js} +0 -0
- /package/components/SplitPane/{SplitPane.module.js → SplitPane.module.scss.js} +0 -0
- /package/components/StatCard/{StatCard.module.js → StatCard.module.scss.js} +0 -0
- /package/components/StatusDot/{StatusDot.module.js → StatusDot.module.scss.js} +0 -0
- /package/components/Table/{Table.module.js → Table.module.scss.js} +0 -0
- /package/components/Tabs/{Tabs.module.js → Tabs.module.scss.js} +0 -0
- /package/components/ThemeToggle/{ThemeToggle.module.js → ThemeToggle.module.scss.js} +0 -0
- /package/components/Timeline/{GanttTimeline.module.js → GanttTimeline.module.scss.js} +0 -0
- /package/components/Timeline/{HistoryTimeline.module.js → HistoryTimeline.module.scss.js} +0 -0
- /package/components/Timeline/{Timeline.module.js → Timeline.module.scss.js} +0 -0
- /package/components/Timeline/{TraceTimeline.module.js → TraceTimeline.module.scss.js} +0 -0
- /package/components/Timer/{Timer.module.js → Timer.module.scss.js} +0 -0
- /package/components/Toast/{Toast.module.js → Toast.module.scss.js} +0 -0
- /package/components/ToggleIconButton/{ToggleIconButton.module.js → ToggleIconButton.module.scss.js} +0 -0
- /package/components/Tooltip/{Tooltip.module.js → Tooltip.module.scss.js} +0 -0
- /package/components/Typography/{Typography.module.js → Typography.module.scss.js} +0 -0
- /package/components/inputs/Checkbox/{Checkbox.module.js → Checkbox.module.scss.js} +0 -0
- /package/components/inputs/Checkbox/{CheckboxGroup.module.js → CheckboxGroup.module.scss.js} +0 -0
- /package/components/inputs/DatePicker/{CalendarPanel.module.js → CalendarPanel.module.scss.js} +0 -0
- /package/components/inputs/DatePicker/{DatePicker.module.js → DatePicker.module.scss.js} +0 -0
- /package/components/inputs/DateTimePicker/{DateTimePicker.module.js → DateTimePicker.module.scss.js} +0 -0
- /package/components/inputs/Input/{Input.module.js → Input.module.scss.js} +0 -0
- /package/components/inputs/NumberInput/{NumberInput.module.js → NumberInput.module.scss.js} +0 -0
- /package/components/inputs/Radio/{Radio.module.js → Radio.module.scss.js} +0 -0
- /package/components/inputs/SearchInput/{SearchInput.module.js → SearchInput.module.scss.js} +0 -0
- /package/components/inputs/Slider/{Slider.module.js → Slider.module.scss.js} +0 -0
- /package/components/inputs/Textarea/{Textarea.module.js → Textarea.module.scss.js} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import { useFocusTrap as t } from "../../hooks/useFocusTrap.js";
|
|
3
|
-
import { EscapeLayerProvider as n, useEscapeLayer as r } from "../../hooks/useEscapeLayer.js";
|
|
4
|
-
import { useKeyboard as i } from "../../hooks/useKeyboard.js";
|
|
5
|
-
import { Spinner as a } from "../Spinner/Spinner.js";
|
|
6
|
-
import { useZoomPan as o } from "./useZoomPan.js";
|
|
7
|
-
import { forwardRef as s, useCallback as c, useEffect as l, useId as u, useRef as d, useState as f } from "react";
|
|
8
|
-
import p from "clsx";
|
|
9
|
-
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
1
|
+
import { forwardRef as e, useCallback as t, useEffect as n, useId as r, useRef as i, useState as a } from "react";
|
|
10
2
|
import { createPortal as ee } from "react-dom";
|
|
3
|
+
import o from "clsx";
|
|
4
|
+
import s from "./ImageViewer.module.scss.js";
|
|
5
|
+
import { useFocusTrap as te } from "../../hooks/useFocusTrap.js";
|
|
6
|
+
import { EscapeLayerProvider as c, useEscapeLayer as l } from "../../hooks/useEscapeLayer.js";
|
|
7
|
+
import { useKeyboard as u } from "../../hooks/useKeyboard.js";
|
|
8
|
+
import { Spinner as d } from "../Spinner/Spinner.js";
|
|
9
|
+
import { useZoomPan as ne } from "./useZoomPan.js";
|
|
10
|
+
import { Fragment as re, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
11
|
// src/components/ImageViewer/ImageViewer.tsx
|
|
12
|
-
var
|
|
12
|
+
var m = {
|
|
13
13
|
viewer: "Image viewer",
|
|
14
14
|
close: "Close",
|
|
15
15
|
previous: "Previous image",
|
|
@@ -20,15 +20,15 @@ var te = {
|
|
|
20
20
|
fit: "Fit to screen",
|
|
21
21
|
download: "Download",
|
|
22
22
|
loading: "Loading image"
|
|
23
|
-
},
|
|
23
|
+
}, h = 60, g = () => /* @__PURE__ */ f("svg", {
|
|
24
24
|
viewBox: "0 0 20 20",
|
|
25
25
|
fill: "none",
|
|
26
26
|
stroke: "currentColor",
|
|
27
27
|
strokeWidth: "2",
|
|
28
28
|
strokeLinecap: "round",
|
|
29
29
|
"aria-hidden": "true",
|
|
30
|
-
children: /* @__PURE__ */
|
|
31
|
-
}),
|
|
30
|
+
children: /* @__PURE__ */ f("path", { d: "M5 5l10 10M15 5L5 15" })
|
|
31
|
+
}), _ = ({ dir: e }) => /* @__PURE__ */ f("svg", {
|
|
32
32
|
viewBox: "0 0 20 20",
|
|
33
33
|
fill: "none",
|
|
34
34
|
stroke: "currentColor",
|
|
@@ -36,8 +36,8 @@ var te = {
|
|
|
36
36
|
strokeLinecap: "round",
|
|
37
37
|
strokeLinejoin: "round",
|
|
38
38
|
"aria-hidden": "true",
|
|
39
|
-
children: e === "left" ? /* @__PURE__ */
|
|
40
|
-
}),
|
|
39
|
+
children: e === "left" ? /* @__PURE__ */ f("path", { d: "M12.5 4.5L7 10l5.5 5.5" }) : /* @__PURE__ */ f("path", { d: "M7.5 4.5L13 10l-5.5 5.5" })
|
|
40
|
+
}), v = () => /* @__PURE__ */ f("svg", {
|
|
41
41
|
viewBox: "0 0 20 20",
|
|
42
42
|
fill: "none",
|
|
43
43
|
stroke: "currentColor",
|
|
@@ -45,8 +45,8 @@ var te = {
|
|
|
45
45
|
strokeLinecap: "round",
|
|
46
46
|
strokeLinejoin: "round",
|
|
47
47
|
"aria-hidden": "true",
|
|
48
|
-
children: /* @__PURE__ */
|
|
49
|
-
}),
|
|
48
|
+
children: /* @__PURE__ */ f("path", { d: "M10 3v10m0 0l-4-4m4 4l4-4M4 16h12" })
|
|
49
|
+
}), y = () => /* @__PURE__ */ f("svg", {
|
|
50
50
|
viewBox: "0 0 20 20",
|
|
51
51
|
fill: "none",
|
|
52
52
|
stroke: "currentColor",
|
|
@@ -54,8 +54,8 @@ var te = {
|
|
|
54
54
|
strokeLinecap: "round",
|
|
55
55
|
strokeLinejoin: "round",
|
|
56
56
|
"aria-hidden": "true",
|
|
57
|
-
children: /* @__PURE__ */
|
|
58
|
-
}),
|
|
57
|
+
children: /* @__PURE__ */ f("path", { d: "M4 10a6 6 0 1 1 1.8 4.3M4 15v-4h4" })
|
|
58
|
+
}), b = () => /* @__PURE__ */ f("svg", {
|
|
59
59
|
viewBox: "0 0 20 20",
|
|
60
60
|
fill: "none",
|
|
61
61
|
stroke: "currentColor",
|
|
@@ -63,60 +63,60 @@ var te = {
|
|
|
63
63
|
strokeLinecap: "round",
|
|
64
64
|
strokeLinejoin: "round",
|
|
65
65
|
"aria-hidden": "true",
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
-
}),
|
|
66
|
+
children: /* @__PURE__ */ f("path", { d: "M3 8V3h5M12 3h5v5M17 12v5h-5M8 17H3v-5" })
|
|
67
|
+
}), x = e(({ open: e, onClose: x, items: S, index: C, defaultIndex: ie = 0, onIndexChange: w, loop: T = !0, showCounter: ae = !0, showThumbnails: oe = !1, showZoomControls: se = !0, showDownload: ce, renderSlide: E, closeOnBackdrop: le = !0, zoom: ue, labels: de, classes: D, className: O, style: k }, A) => {
|
|
68
68
|
let j = {
|
|
69
|
-
...
|
|
70
|
-
...
|
|
71
|
-
}, M =
|
|
69
|
+
...m,
|
|
70
|
+
...de
|
|
71
|
+
}, M = S.length, N = C !== void 0, [P, F] = a(ie), I = M === 0 ? 0 : Math.min(Math.max(0, N ? C : P), M - 1), L = S[I], R = i(null), z = (e) => {
|
|
72
72
|
R.current = e, typeof A == "function" ? A(e) : A && (A.current = e);
|
|
73
|
-
}, B =
|
|
73
|
+
}, B = ne(ue), { reset: V, scale: H, isPanning: fe } = B, U = t((e) => {
|
|
74
74
|
if (M === 0) return;
|
|
75
75
|
let t = e;
|
|
76
|
-
t =
|
|
76
|
+
t = T ? (e % M + M) % M : Math.min(Math.max(0, e), M - 1), t !== I && (N || F(t), w?.(t));
|
|
77
77
|
}, [
|
|
78
78
|
M,
|
|
79
|
-
|
|
79
|
+
T,
|
|
80
80
|
I,
|
|
81
81
|
N,
|
|
82
|
-
|
|
83
|
-
]), W =
|
|
82
|
+
w
|
|
83
|
+
]), W = T ? M > 1 : I > 0, G = T ? M > 1 : I < M - 1, K = t(() => W && U(I - 1), [
|
|
84
84
|
W,
|
|
85
85
|
U,
|
|
86
86
|
I
|
|
87
|
-
]), q =
|
|
87
|
+
]), q = t(() => G && U(I + 1), [
|
|
88
88
|
G,
|
|
89
89
|
U,
|
|
90
90
|
I
|
|
91
|
-
]), [J, Y] =
|
|
92
|
-
|
|
91
|
+
]), [J, Y] = a(!1);
|
|
92
|
+
n(() => {
|
|
93
93
|
Y(!1), V();
|
|
94
94
|
}, [
|
|
95
95
|
I,
|
|
96
96
|
L?.src,
|
|
97
97
|
V
|
|
98
|
-
]),
|
|
99
|
-
if (!
|
|
100
|
-
let
|
|
101
|
-
for (let
|
|
102
|
-
if (!
|
|
103
|
-
let
|
|
104
|
-
|
|
98
|
+
]), n(() => {
|
|
99
|
+
if (!e || M < 2 || typeof Image > "u") return;
|
|
100
|
+
let t = [S[(I + 1) % M], S[(I - 1 + M) % M]];
|
|
101
|
+
for (let e of t) {
|
|
102
|
+
if (!e) continue;
|
|
103
|
+
let t = new Image();
|
|
104
|
+
t.src = e.src;
|
|
105
105
|
}
|
|
106
106
|
}, [
|
|
107
|
-
|
|
107
|
+
e,
|
|
108
108
|
I,
|
|
109
|
-
|
|
109
|
+
S,
|
|
110
110
|
M
|
|
111
|
-
]),
|
|
112
|
-
let pe =
|
|
113
|
-
|
|
114
|
-
if (!
|
|
115
|
-
let
|
|
111
|
+
]), te(R, e);
|
|
112
|
+
let pe = l(() => x(), e);
|
|
113
|
+
n(() => {
|
|
114
|
+
if (!e) return;
|
|
115
|
+
let t = document.body.style.overflow;
|
|
116
116
|
return document.body.style.overflow = "hidden", () => {
|
|
117
|
-
document.body.style.overflow =
|
|
117
|
+
document.body.style.overflow = t;
|
|
118
118
|
};
|
|
119
|
-
}, [
|
|
119
|
+
}, [e]), u({
|
|
120
120
|
ArrowLeft: K,
|
|
121
121
|
ArrowRight: q,
|
|
122
122
|
"+": B.zoomIn,
|
|
@@ -124,10 +124,10 @@ var te = {
|
|
|
124
124
|
"-": B.zoomOut,
|
|
125
125
|
0: B.reset
|
|
126
126
|
}, {
|
|
127
|
-
active:
|
|
127
|
+
active: e,
|
|
128
128
|
ignoreEditable: !0
|
|
129
129
|
});
|
|
130
|
-
let X =
|
|
130
|
+
let X = i(null), Z = i(!1), me = (e) => {
|
|
131
131
|
X.current = {
|
|
132
132
|
x: e.clientX ?? 0,
|
|
133
133
|
y: e.clientY ?? 0
|
|
@@ -137,36 +137,36 @@ var te = {
|
|
|
137
137
|
let t = X.current;
|
|
138
138
|
if (X.current = null, !t) return;
|
|
139
139
|
let n = (e.clientX ?? 0) - t.x, r = (e.clientY ?? 0) - t.y;
|
|
140
|
-
Math.hypot(n, r) >= 5 && (Z.current = !0), H === 1 && Math.abs(n) >
|
|
140
|
+
Math.hypot(n, r) >= 5 && (Z.current = !0), H === 1 && Math.abs(n) > h && Math.abs(n) > Math.abs(r) && (n < 0 ? q() : K());
|
|
141
141
|
}, he = (e) => {
|
|
142
142
|
let t = Z.current;
|
|
143
|
-
Z.current = !1,
|
|
144
|
-
}, ge =
|
|
145
|
-
if (!
|
|
146
|
-
let _e =
|
|
143
|
+
Z.current = !1, le && !t && e.target === e.currentTarget && x();
|
|
144
|
+
}, ge = r();
|
|
145
|
+
if (!e || M === 0 || !L) return null;
|
|
146
|
+
let _e = ce ?? !!L.download, ve = typeof L.download == "string" ? L.download : L.src, $ = E ? E(L, {
|
|
147
147
|
index: I,
|
|
148
148
|
active: !0
|
|
149
149
|
}) : null, ye = `${Math.round(H * 100)}%`;
|
|
150
|
-
return ee(/* @__PURE__ */
|
|
150
|
+
return ee(/* @__PURE__ */ f("div", {
|
|
151
151
|
ref: z,
|
|
152
|
-
className:
|
|
153
|
-
style:
|
|
152
|
+
className: o(s.root, D?.root, O),
|
|
153
|
+
style: k,
|
|
154
154
|
role: "dialog",
|
|
155
155
|
"aria-modal": "true",
|
|
156
156
|
"aria-label": L.alt || j.viewer,
|
|
157
157
|
"data-index": I,
|
|
158
|
-
children: /* @__PURE__ */
|
|
158
|
+
children: /* @__PURE__ */ p(c, {
|
|
159
159
|
value: pe,
|
|
160
160
|
children: [
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
className:
|
|
161
|
+
/* @__PURE__ */ f("div", {
|
|
162
|
+
className: o(s.backdrop, D?.backdrop),
|
|
163
163
|
"aria-hidden": "true"
|
|
164
164
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
className:
|
|
165
|
+
/* @__PURE__ */ p("div", {
|
|
166
|
+
className: o(s.toolbar, D?.toolbar),
|
|
167
167
|
children: [
|
|
168
|
-
|
|
169
|
-
className:
|
|
168
|
+
ae && M > 1 && /* @__PURE__ */ p("span", {
|
|
169
|
+
className: o(s.counter, D?.counter),
|
|
170
170
|
"aria-live": "polite",
|
|
171
171
|
children: [
|
|
172
172
|
I + 1,
|
|
@@ -174,139 +174,139 @@ var te = {
|
|
|
174
174
|
M
|
|
175
175
|
]
|
|
176
176
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
|
|
179
|
-
className:
|
|
177
|
+
/* @__PURE__ */ f("span", { className: s.spacer }),
|
|
178
|
+
se && /* @__PURE__ */ p("div", {
|
|
179
|
+
className: o(s.zoomControls, D?.zoomControls),
|
|
180
180
|
role: "group",
|
|
181
181
|
"aria-label": "Zoom",
|
|
182
182
|
children: [
|
|
183
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ f("button", {
|
|
184
184
|
type: "button",
|
|
185
|
-
className:
|
|
185
|
+
className: s.control,
|
|
186
186
|
onClick: B.zoomOut,
|
|
187
187
|
"aria-label": j.zoomOut,
|
|
188
188
|
children: "−"
|
|
189
189
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
className:
|
|
190
|
+
/* @__PURE__ */ f("span", {
|
|
191
|
+
className: s.zoomValue,
|
|
192
192
|
"data-testid": "zoom-value",
|
|
193
193
|
children: ye
|
|
194
194
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ f("button", {
|
|
196
196
|
type: "button",
|
|
197
|
-
className:
|
|
197
|
+
className: s.control,
|
|
198
198
|
onClick: B.zoomIn,
|
|
199
199
|
"aria-label": j.zoomIn,
|
|
200
200
|
children: "+"
|
|
201
201
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ f("button", {
|
|
203
203
|
type: "button",
|
|
204
|
-
className:
|
|
204
|
+
className: s.control,
|
|
205
205
|
onClick: B.reset,
|
|
206
206
|
"aria-label": j.reset,
|
|
207
|
-
children: /* @__PURE__ */
|
|
207
|
+
children: /* @__PURE__ */ f(y, {})
|
|
208
208
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ f("button", {
|
|
210
210
|
type: "button",
|
|
211
|
-
className:
|
|
211
|
+
className: s.control,
|
|
212
212
|
onClick: B.fit,
|
|
213
213
|
"aria-label": j.fit,
|
|
214
|
-
children: /* @__PURE__ */
|
|
214
|
+
children: /* @__PURE__ */ f(b, {})
|
|
215
215
|
})
|
|
216
216
|
]
|
|
217
217
|
}),
|
|
218
|
-
_e && /* @__PURE__ */
|
|
219
|
-
className:
|
|
218
|
+
_e && /* @__PURE__ */ f("a", {
|
|
219
|
+
className: s.control,
|
|
220
220
|
href: ve,
|
|
221
221
|
download: !0,
|
|
222
222
|
"aria-label": j.download,
|
|
223
223
|
target: "_blank",
|
|
224
224
|
rel: "noreferrer",
|
|
225
|
-
children: /* @__PURE__ */
|
|
225
|
+
children: /* @__PURE__ */ f(v, {})
|
|
226
226
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ f("button", {
|
|
228
228
|
type: "button",
|
|
229
|
-
className:
|
|
230
|
-
onClick:
|
|
229
|
+
className: s.control,
|
|
230
|
+
onClick: x,
|
|
231
231
|
"aria-label": j.close,
|
|
232
|
-
children: /* @__PURE__ */
|
|
232
|
+
children: /* @__PURE__ */ f(g, {})
|
|
233
233
|
})
|
|
234
234
|
]
|
|
235
235
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
className:
|
|
236
|
+
/* @__PURE__ */ p("div", {
|
|
237
|
+
className: s.body,
|
|
238
238
|
children: [
|
|
239
|
-
M > 1 && W && /* @__PURE__ */
|
|
239
|
+
M > 1 && W && /* @__PURE__ */ f("button", {
|
|
240
240
|
type: "button",
|
|
241
|
-
className:
|
|
241
|
+
className: o(s.nav, s.navPrev, D?.nav, D?.navPrev),
|
|
242
242
|
onClick: K,
|
|
243
243
|
"aria-label": j.previous,
|
|
244
|
-
children: /* @__PURE__ */
|
|
244
|
+
children: /* @__PURE__ */ f(_, { dir: "left" })
|
|
245
245
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
className:
|
|
246
|
+
/* @__PURE__ */ f("div", {
|
|
247
|
+
className: o(s.stage, fe && s.panning, D?.stage),
|
|
248
248
|
...B.stageProps,
|
|
249
249
|
onPointerDown: me,
|
|
250
250
|
onPointerUp: Q,
|
|
251
251
|
onClick: he,
|
|
252
252
|
style: B.stageProps.style,
|
|
253
253
|
"data-testid": "image-viewer-stage",
|
|
254
|
-
children: $ ? /* @__PURE__ */
|
|
254
|
+
children: $ ? /* @__PURE__ */ f("div", {
|
|
255
255
|
ref: B.contentRef,
|
|
256
|
-
className:
|
|
256
|
+
className: o(s.image, D?.image),
|
|
257
257
|
style: B.contentStyle,
|
|
258
258
|
children: $
|
|
259
|
-
}) : /* @__PURE__ */
|
|
259
|
+
}) : /* @__PURE__ */ p(re, { children: [/* @__PURE__ */ f("img", {
|
|
260
260
|
ref: B.contentRef,
|
|
261
|
-
className:
|
|
261
|
+
className: o(s.image, !J && s.imageLoading, D?.image),
|
|
262
262
|
style: B.contentStyle,
|
|
263
263
|
src: L.src,
|
|
264
264
|
alt: L.alt ?? "",
|
|
265
265
|
draggable: !1,
|
|
266
266
|
onLoad: () => Y(!0),
|
|
267
267
|
onError: () => Y(!0)
|
|
268
|
-
}, L.src), !J && /* @__PURE__ */
|
|
269
|
-
className:
|
|
270
|
-
children: /* @__PURE__ */
|
|
268
|
+
}, L.src), !J && /* @__PURE__ */ f("span", {
|
|
269
|
+
className: s.spinner,
|
|
270
|
+
children: /* @__PURE__ */ f(d, {
|
|
271
271
|
size: "lg",
|
|
272
272
|
label: j.loading
|
|
273
273
|
})
|
|
274
274
|
})] })
|
|
275
275
|
}),
|
|
276
|
-
M > 1 && G && /* @__PURE__ */
|
|
276
|
+
M > 1 && G && /* @__PURE__ */ f("button", {
|
|
277
277
|
type: "button",
|
|
278
|
-
className:
|
|
278
|
+
className: o(s.nav, s.navNext, D?.nav, D?.navNext),
|
|
279
279
|
onClick: q,
|
|
280
280
|
"aria-label": j.next,
|
|
281
|
-
children: /* @__PURE__ */
|
|
281
|
+
children: /* @__PURE__ */ f(_, { dir: "right" })
|
|
282
282
|
})
|
|
283
283
|
]
|
|
284
284
|
}),
|
|
285
|
-
L.caption && /* @__PURE__ */
|
|
285
|
+
L.caption && /* @__PURE__ */ f("div", {
|
|
286
286
|
id: ge,
|
|
287
|
-
className:
|
|
287
|
+
className: o(s.caption, D?.caption),
|
|
288
288
|
children: L.caption
|
|
289
289
|
}),
|
|
290
|
-
|
|
291
|
-
className:
|
|
290
|
+
oe && M > 1 && /* @__PURE__ */ f("div", {
|
|
291
|
+
className: o(s.thumbnails, D?.thumbnails),
|
|
292
292
|
role: "list",
|
|
293
|
-
children:
|
|
293
|
+
children: S.map((e, t) => /* @__PURE__ */ f("button", {
|
|
294
294
|
type: "button",
|
|
295
295
|
role: "listitem",
|
|
296
|
-
className:
|
|
297
|
-
onClick: () => U(
|
|
298
|
-
"aria-label":
|
|
299
|
-
"aria-current":
|
|
300
|
-
children: /* @__PURE__ */
|
|
301
|
-
src:
|
|
296
|
+
className: o(s.thumbnail, t === I && s.thumbnailActive, D?.thumbnail, t === I && D?.thumbnailActive),
|
|
297
|
+
onClick: () => U(t),
|
|
298
|
+
"aria-label": e.alt || `${t + 1}`,
|
|
299
|
+
"aria-current": t === I ? "true" : void 0,
|
|
300
|
+
children: /* @__PURE__ */ f("img", {
|
|
301
|
+
src: e.thumbnail ?? e.src,
|
|
302
302
|
alt: "",
|
|
303
303
|
draggable: !1
|
|
304
304
|
})
|
|
305
|
-
}, `${
|
|
305
|
+
}, `${e.src}-${t}`))
|
|
306
306
|
})
|
|
307
307
|
]
|
|
308
308
|
})
|
|
309
309
|
}), document.body);
|
|
310
310
|
});
|
|
311
|
-
|
|
312
|
-
export {
|
|
311
|
+
x.displayName = "ImageViewer";
|
|
312
|
+
export { x as ImageViewer };
|
package/components/Kbd/Kbd.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import r from "
|
|
1
|
+
import { Fragment as e, forwardRef as t } from "react";
|
|
2
|
+
import n from "clsx";
|
|
3
|
+
import r from "./Kbd.module.scss.js";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
// src/components/Kbd/Kbd.tsx
|
|
6
|
-
var o =
|
|
6
|
+
var o = t(({ size: t = "md", keys: o, classes: s, className: c, children: l, ...u }, d) => o && o.length > 0 ? /* @__PURE__ */ i("kbd", {
|
|
7
7
|
ref: d,
|
|
8
|
-
className: r
|
|
8
|
+
className: n(r.group, r[t], s?.root, c),
|
|
9
9
|
...u,
|
|
10
|
-
children: o.map((
|
|
11
|
-
className: r
|
|
10
|
+
children: o.map((t, o) => /* @__PURE__ */ a(e, { children: [o > 0 && /* @__PURE__ */ i("span", {
|
|
11
|
+
className: n(r.separator, s?.separator),
|
|
12
12
|
"aria-hidden": "true",
|
|
13
13
|
children: "+"
|
|
14
14
|
}), /* @__PURE__ */ i("kbd", {
|
|
15
|
-
className: r
|
|
16
|
-
children:
|
|
17
|
-
})] }, `${
|
|
15
|
+
className: n(r.root, r.key, s?.key),
|
|
16
|
+
children: t
|
|
17
|
+
})] }, `${t}-${o}`))
|
|
18
18
|
}) : /* @__PURE__ */ i("kbd", {
|
|
19
19
|
ref: d,
|
|
20
|
-
className: r
|
|
20
|
+
className: n(r.root, r[t], s?.root, c),
|
|
21
21
|
...u,
|
|
22
22
|
children: l
|
|
23
23
|
}));
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import i from "
|
|
1
|
+
import { forwardRef as e, useState as t } from "react";
|
|
2
|
+
import n from "clsx";
|
|
3
|
+
import r from "./KeyValueList.module.scss.js";
|
|
4
|
+
import { CopyButton as i } from "../ActionButton/CopyButton.js";
|
|
5
5
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
6
|
// src/components/KeyValueList/KeyValueList.tsx
|
|
7
7
|
var s = (e) => e == null || e === "", c = (e) => typeof e == "number" ? `${e}px` : e;
|
|
8
8
|
function l(e) {
|
|
9
9
|
return typeof e.copyable == "string" ? e.copyable : e.copyable && (typeof e.value == "string" || typeof e.value == "number") ? String(e.value) : null;
|
|
10
10
|
}
|
|
11
|
-
function u({ item:
|
|
12
|
-
let [h, g] =
|
|
13
|
-
b = _ ?
|
|
14
|
-
className:
|
|
11
|
+
function u({ item: e, emptyValue: c, copyLabel: u, revealLabels: p, classes: m }) {
|
|
12
|
+
let [h, g] = t(!1), _ = s(e.value), v = _ ? null : l(e), y = e.masked && !h, b;
|
|
13
|
+
b = _ ? e.empty ?? c : y ? /* @__PURE__ */ a("span", {
|
|
14
|
+
className: n(r.maskedText, m?.masked),
|
|
15
15
|
"aria-hidden": "true",
|
|
16
16
|
children: "••••••••"
|
|
17
|
-
}) :
|
|
18
|
-
className:
|
|
19
|
-
href:
|
|
20
|
-
children:
|
|
21
|
-
}) :
|
|
22
|
-
let x =
|
|
17
|
+
}) : e.href ? /* @__PURE__ */ a("a", {
|
|
18
|
+
className: r.link,
|
|
19
|
+
href: e.href,
|
|
20
|
+
children: e.value
|
|
21
|
+
}) : e.value;
|
|
22
|
+
let x = e.masked && !_ || v !== null;
|
|
23
23
|
return /* @__PURE__ */ o("div", {
|
|
24
|
-
className:
|
|
24
|
+
className: n(r.item, m?.item),
|
|
25
25
|
children: [/* @__PURE__ */ a("dt", {
|
|
26
|
-
className:
|
|
27
|
-
children:
|
|
26
|
+
className: n(r.label, m?.label),
|
|
27
|
+
children: e.label
|
|
28
28
|
}), /* @__PURE__ */ o("dd", {
|
|
29
|
-
className:
|
|
29
|
+
className: n(r.value, e.mono && r.mono, e.mono && m?.mono, _ && r.empty, m?.value),
|
|
30
30
|
children: [/* @__PURE__ */ o("span", {
|
|
31
|
-
className:
|
|
31
|
+
className: r.valueMain,
|
|
32
32
|
children: [/* @__PURE__ */ a("span", {
|
|
33
|
-
className:
|
|
33
|
+
className: r.valueText,
|
|
34
34
|
children: b
|
|
35
35
|
}), x && /* @__PURE__ */ o("span", {
|
|
36
|
-
className:
|
|
37
|
-
children: [
|
|
36
|
+
className: n(r.actions, m?.actions),
|
|
37
|
+
children: [e.masked && !_ && /* @__PURE__ */ a("button", {
|
|
38
38
|
type: "button",
|
|
39
|
-
className:
|
|
39
|
+
className: n(r.reveal, m?.reveal),
|
|
40
40
|
"aria-label": h ? p.hide : p.show,
|
|
41
41
|
"aria-pressed": h,
|
|
42
42
|
onClick: () => g((e) => !e),
|
|
43
43
|
children: a(h ? f : d, {})
|
|
44
|
-
}), v !== null && /* @__PURE__ */ a(
|
|
44
|
+
}), v !== null && /* @__PURE__ */ a(i, {
|
|
45
45
|
value: v,
|
|
46
46
|
iconOnly: !0,
|
|
47
47
|
size: "sm",
|
|
48
48
|
variant: "ghost",
|
|
49
49
|
"aria-label": u,
|
|
50
|
-
className:
|
|
50
|
+
className: n(r.copy, m?.copy)
|
|
51
51
|
})]
|
|
52
52
|
})]
|
|
53
|
-
}),
|
|
54
|
-
className:
|
|
55
|
-
children:
|
|
53
|
+
}), e.hint && /* @__PURE__ */ a("span", {
|
|
54
|
+
className: n(r.hint, m?.hint),
|
|
55
|
+
children: e.hint
|
|
56
56
|
})]
|
|
57
57
|
})]
|
|
58
58
|
});
|
|
@@ -94,23 +94,23 @@ function f() {
|
|
|
94
94
|
]
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
var p =
|
|
97
|
+
var p = e(({ items: e, layout: t = "rows", columns: i = 2, labelWidth: o = "10rem", size: s = "md", dividers: l = !0, emptyValue: d = "—", copyLabel: f = "Copy", revealLabels: p = {
|
|
98
98
|
show: "Show",
|
|
99
99
|
hide: "Hide"
|
|
100
100
|
}, classes: m, className: h, style: g, ..._ }, v) => {
|
|
101
101
|
let y = {
|
|
102
102
|
"--crk-kv-label-width": c(o),
|
|
103
|
-
"--crk-kv-columns":
|
|
103
|
+
"--crk-kv-columns": t === "grid" ? String(Math.max(1, i)) : void 0
|
|
104
104
|
};
|
|
105
105
|
return /* @__PURE__ */ a("dl", {
|
|
106
106
|
ref: v,
|
|
107
|
-
className:
|
|
107
|
+
className: n(r.root, r[t], r[s], t === "rows" && l && r.dividers, m?.root, h),
|
|
108
108
|
style: {
|
|
109
109
|
...y,
|
|
110
110
|
...g
|
|
111
111
|
},
|
|
112
112
|
..._,
|
|
113
|
-
children:
|
|
113
|
+
children: e.map((e, t) => /* @__PURE__ */ a(u, {
|
|
114
114
|
item: e,
|
|
115
115
|
emptyValue: d,
|
|
116
116
|
copyLabel: f,
|
package/components/Link/Link.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import n from "./Link.module.scss.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
// src/components/Link/Link.tsx
|
|
6
|
-
var a =
|
|
6
|
+
var a = e(({ variant: e = "default", external: a = !1, hideExternalIcon: o = !1, className: s, style: c, children: l, ...u }, d) => {
|
|
7
7
|
let f = a || u.target === "_blank";
|
|
8
8
|
return /* @__PURE__ */ i("a", {
|
|
9
9
|
ref: d,
|
|
10
|
-
className: n
|
|
10
|
+
className: t(n.root, n[e], s),
|
|
11
11
|
style: c,
|
|
12
12
|
...a && {
|
|
13
13
|
target: "_blank",
|
|
@@ -17,7 +17,7 @@ var a = t(({ variant: t = "default", external: a = !1, hideExternalIcon: o = !1,
|
|
|
17
17
|
children: [
|
|
18
18
|
l,
|
|
19
19
|
f && !o && /* @__PURE__ */ i("svg", {
|
|
20
|
-
className:
|
|
20
|
+
className: n.externalIcon,
|
|
21
21
|
viewBox: "0 0 24 24",
|
|
22
22
|
width: "1em",
|
|
23
23
|
height: "1em",
|
|
@@ -35,7 +35,7 @@ var a = t(({ variant: t = "default", external: a = !1, hideExternalIcon: o = !1,
|
|
|
35
35
|
]
|
|
36
36
|
}),
|
|
37
37
|
f && /* @__PURE__ */ r("span", {
|
|
38
|
-
className:
|
|
38
|
+
className: n.srOnly,
|
|
39
39
|
children: " (opens in a new tab)"
|
|
40
40
|
})
|
|
41
41
|
]
|
package/components/List/List.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import n from "./List.module.scss.js";
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
5
|
// src/components/List/List.tsx
|
|
6
|
-
var i =
|
|
6
|
+
var i = e(({ variant: e = "unordered", spacing: i = "md", className: a, style: o, children: s, ...c }, l) => /* @__PURE__ */ r(e === "ordered" ? "ol" : "ul", {
|
|
7
7
|
ref: l,
|
|
8
|
-
className: n
|
|
8
|
+
className: t(n.root, n[e], n[i], a),
|
|
9
9
|
style: o,
|
|
10
10
|
...c,
|
|
11
11
|
children: s
|
|
12
12
|
}));
|
|
13
13
|
i.displayName = "List";
|
|
14
|
-
var a =
|
|
14
|
+
var a = e(({ className: e, style: i, children: a, ...o }, s) => /* @__PURE__ */ r("li", {
|
|
15
15
|
ref: s,
|
|
16
|
-
className: n
|
|
16
|
+
className: t(n.item, e),
|
|
17
17
|
style: i,
|
|
18
18
|
...o,
|
|
19
19
|
children: a
|