@expcat/tigercat-react 2.0.19 → 2.1.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/README.md +25 -16
- package/dist/chunk-246DAUEF.mjs +181 -0
- package/dist/{chunk-PU3JY6RE.mjs → chunk-2JMI7TCM.mjs} +1 -1
- package/dist/chunk-2YBLMVDT.mjs +428 -0
- package/dist/chunk-2YOP55OF.mjs +639 -0
- package/dist/{chunk-25D5TXZH.mjs → chunk-32MCQMBJ.mjs} +8 -6
- package/dist/chunk-3HHEVMHE.mjs +180 -0
- package/dist/{chunk-HSBN5MLS.mjs → chunk-3LACOSJQ.mjs} +1 -1
- package/dist/{chunk-F6WV53BS.mjs → chunk-3LDDXHW2.mjs} +28 -11
- package/dist/{chunk-IXQAECFP.mjs → chunk-3QNIFKVF.mjs} +12 -14
- package/dist/{chunk-UD4DTVJZ.mjs → chunk-4C2X5PZO.mjs} +57 -25
- package/dist/chunk-5JETWHLJ.mjs +28 -0
- package/dist/{chunk-VA6PZWOH.mjs → chunk-5SEMRHBD.mjs} +14 -6
- package/dist/{chunk-EKILTLUO.mjs → chunk-72CJNKDY.mjs} +1 -1
- package/dist/{chunk-XE4YFBOZ.mjs → chunk-AUD3VOLO.mjs} +1 -1
- package/dist/{chunk-UT5BV2VO.mjs → chunk-AYFKHWJS.mjs} +16 -10
- package/dist/{chunk-RPSHILHD.mjs → chunk-BXAH2GH3.mjs} +8 -2
- package/dist/{chunk-EW5EO7VE.mjs → chunk-BYD7EAWK.mjs} +1 -1
- package/dist/{chunk-BOGOQ44C.mjs → chunk-CQOLQAB5.mjs} +105 -90
- package/dist/{chunk-L55UK45A.mjs → chunk-CRIEUKMD.mjs} +5 -2
- package/dist/{chunk-DKNVSQSV.mjs → chunk-CUAXRBKO.mjs} +12 -0
- package/dist/{chunk-E7OTDBI6.mjs → chunk-DECUASRW.mjs} +17 -19
- package/dist/{chunk-XMTEMBQV.mjs → chunk-EAAWB3CK.mjs} +16 -13
- package/dist/{chunk-D33BIMGK.mjs → chunk-EG7EMDKK.mjs} +12 -2
- package/dist/chunk-EW43YBPV.mjs +457 -0
- package/dist/{chunk-HOYBHB7B.mjs → chunk-FNK2VWPP.mjs} +1 -1
- package/dist/{chunk-RJPNBYK5.mjs → chunk-FQS24AUH.mjs} +12 -3
- package/dist/{chunk-LADKKOJT.mjs → chunk-GBEDWXLL.mjs} +16 -10
- package/dist/chunk-GR3Y3XWP.mjs +47 -0
- package/dist/{chunk-2ENQZECC.mjs → chunk-HAXRHSCN.mjs} +4 -3
- package/dist/{chunk-K4GIKSZE.mjs → chunk-I2BENK5X.mjs} +2 -1
- package/dist/chunk-IGBQGR6G.mjs +234 -0
- package/dist/chunk-J76R2S62.mjs +161 -0
- package/dist/{chunk-DNOPEJ5I.mjs → chunk-JZZPLKTW.mjs} +7 -4
- package/dist/{chunk-7KCQMXJA.mjs → chunk-KDURW5AS.mjs} +4 -3
- package/dist/{chunk-TFMEHUVZ.mjs → chunk-KKN7KLTB.mjs} +0 -1
- package/dist/{chunk-6MGQAJ62.mjs → chunk-KL6YJIZ3.mjs} +24 -7
- package/dist/chunk-KRDHM5KB.mjs +259 -0
- package/dist/{chunk-HHIW7V7B.mjs → chunk-M6ZPTGBV.mjs} +2 -10
- package/dist/chunk-MFPVVGNA.mjs +248 -0
- package/dist/{chunk-PXRZ6CKY.mjs → chunk-MJVSZ2UJ.mjs} +46 -16
- package/dist/{chunk-LZKBDQE4.mjs → chunk-MYI3FPG4.mjs} +23 -4
- package/dist/{chunk-OIGEBCAS.mjs → chunk-NADODEZX.mjs} +69 -1
- package/dist/{chunk-KMP5CVNK.mjs → chunk-NJWTZ5MO.mjs} +57 -45
- package/dist/chunk-NLGLBTSM.mjs +138 -0
- package/dist/chunk-NT7GW2FD.mjs +40 -0
- package/dist/{chunk-773LH7BK.mjs → chunk-O6VYD4E4.mjs} +24 -2
- package/dist/{chunk-G7D4QV7A.mjs → chunk-O7TV5OKS.mjs} +33 -6
- package/dist/{chunk-DPWRXXXW.mjs → chunk-OJ6SHHOZ.mjs} +3 -3
- package/dist/chunk-OKYMTHFQ.mjs +279 -0
- package/dist/{chunk-UYJJLHVA.mjs → chunk-PMQJ6AYT.mjs} +23 -21
- package/dist/chunk-PY2VUNEJ.mjs +494 -0
- package/dist/{chunk-BEJZPJIK.mjs → chunk-QOAOOD53.mjs} +10 -4
- package/dist/{chunk-2WGEHH5A.mjs → chunk-QU3QXUTC.mjs} +49 -23
- package/dist/{chunk-V6P7ZK6O.mjs → chunk-QXSUG7SN.mjs} +3 -3
- package/dist/{chunk-FYINJRYN.mjs → chunk-R7YZ6FKP.mjs} +27 -16
- package/dist/{chunk-YI6YWH66.mjs → chunk-RE5ZLA5D.mjs} +6 -6
- package/dist/{chunk-UCBW5RJN.mjs → chunk-RGVU4EMA.mjs} +11 -6
- package/dist/{chunk-IBSOUQGB.mjs → chunk-RRGPDFDI.mjs} +7 -4
- package/dist/{chunk-ZH5ZBLAN.mjs → chunk-RUQ3F3MV.mjs} +34 -7
- package/dist/chunk-SEOG5AGS.mjs +72 -0
- package/dist/{chunk-PGD5RPKF.mjs → chunk-SVIJ2UZA.mjs} +2 -1
- package/dist/chunk-SXWEFZOF.mjs +766 -0
- package/dist/{chunk-NCHUEGUW.mjs → chunk-TEVEXDY2.mjs} +27 -16
- package/dist/{chunk-DJOFM2VO.mjs → chunk-TO6MZFNQ.mjs} +52 -40
- package/dist/chunk-TQ6RIFWR.mjs +135 -0
- package/dist/chunk-U4M3DC2P.mjs +48 -0
- package/dist/{chunk-ZCGIZOMT.mjs → chunk-V7HJ5HLC.mjs} +6 -10
- package/dist/{chunk-SIDDYP3O.mjs → chunk-VJWSKJLJ.mjs} +1 -1
- package/dist/{chunk-ZG56T75O.mjs → chunk-WTHWLCRL.mjs} +51 -11
- package/dist/{chunk-KP6DEYWB.mjs → chunk-X4L3W7RQ.mjs} +1 -1
- package/dist/{chunk-ZMRTETN2.mjs → chunk-X6C6MNG5.mjs} +4 -3
- package/dist/chunk-XT43B7ZI.mjs +58 -0
- package/dist/{chunk-OGG2TQDG.mjs → chunk-XVHTJQ4T.mjs} +12 -1
- package/dist/{chunk-QJE3MZBO.mjs → chunk-Y6UH3EKE.mjs} +1 -1
- package/dist/chunk-YJ5T4XZN.mjs +81 -0
- package/dist/{chunk-VVNFXJMN.mjs → chunk-YNDPQVEK.mjs} +8 -1
- package/dist/{chunk-QGZ32NFQ.mjs → chunk-Z23KOLNU.mjs} +4 -3
- package/dist/{chunk-5CKMYMTS.mjs → chunk-ZATZRXMW.mjs} +27 -8
- package/dist/components/ActivityFeed.mjs +3 -3
- package/dist/components/Affix.mjs +1 -1
- package/dist/components/Anchor.mjs +1 -1
- package/dist/components/AreaChart.mjs +5 -4
- package/dist/components/AspectRatio.d.mts +10 -0
- package/dist/components/AspectRatio.mjs +8 -0
- package/dist/components/AutoComplete.mjs +1 -1
- package/dist/components/BarChart.mjs +5 -4
- package/dist/components/Calendar.mjs +1 -1
- package/dist/components/Cascader.mjs +1 -1
- package/dist/components/ChartCanvas.mjs +1 -1
- package/dist/components/ChatWindow.mjs +4 -4
- package/dist/components/Code.mjs +3 -1
- package/dist/components/CollapsePanel.mjs +1 -1
- package/dist/components/ColorPicker.mjs +1 -1
- package/dist/components/CommentThread.mjs +2 -2
- package/dist/components/ContextMenu.d.mts +36 -0
- package/dist/components/ContextMenu.mjs +17 -0
- package/dist/components/DataExport.mjs +2 -2
- package/dist/components/DataTableWithToolbar.mjs +7 -7
- package/dist/components/DonutChart.mjs +4 -4
- package/dist/components/Dropdown.mjs +1 -1
- package/dist/components/FileManager.mjs +2 -1
- package/dist/components/FloatButton.mjs +1 -1
- package/dist/components/FormItem.mjs +1 -1
- package/dist/components/FormWizard.mjs +1 -1
- package/dist/components/FunnelChart.mjs +3 -3
- package/dist/components/Gantt.d.mts +3 -1
- package/dist/components/Gantt.mjs +2 -2
- package/dist/components/GaugeChart.mjs +2 -2
- package/dist/components/HeatmapChart.mjs +3 -3
- package/dist/components/Highlight.d.mts +11 -0
- package/dist/components/Highlight.mjs +8 -0
- package/dist/components/Image.mjs +4 -4
- package/dist/components/ImageCompare.d.mts +15 -0
- package/dist/components/ImageCompare.mjs +8 -0
- package/dist/components/ImageGroup.mjs +2 -2
- package/dist/components/ImagePreview.mjs +1 -1
- package/dist/components/Input.mjs +1 -1
- package/dist/components/InputNumber.d.mts +1 -1
- package/dist/components/InputNumber.mjs +1 -1
- package/dist/components/InputOTP.d.mts +33 -0
- package/dist/components/InputOTP.mjs +12 -0
- package/dist/components/Kanban.mjs +2 -2
- package/dist/components/Kbd.d.mts +10 -0
- package/dist/components/Kbd.mjs +8 -0
- package/dist/components/LineChart.mjs +5 -4
- package/dist/components/List.mjs +2 -2
- package/dist/components/Loading.mjs +1 -1
- package/dist/components/LoadingBar.d.mts +8 -0
- package/dist/components/LoadingBar.mjs +138 -0
- package/dist/components/LoadingBarContainer.d.mts +8 -0
- package/dist/components/LoadingBarContainer.mjs +8 -0
- package/dist/components/LoadingBarRoot.d.mts +6 -0
- package/dist/components/LoadingBarRoot.mjs +6 -0
- package/dist/components/Marquee.d.mts +10 -0
- package/dist/components/Marquee.mjs +8 -0
- package/dist/components/MaskInput.d.mts +37 -0
- package/dist/components/MaskInput.mjs +10 -0
- package/dist/components/Masonry.d.mts +10 -0
- package/dist/components/Masonry.mjs +8 -0
- package/dist/components/NavigationMenu.d.mts +84 -0
- package/dist/components/NavigationMenu.mjs +23 -0
- package/dist/components/NotificationCenter.mjs +4 -4
- package/dist/components/OrgChart.mjs +2 -2
- package/dist/components/PageHeader.d.mts +34 -0
- package/dist/components/PageHeader.mjs +11 -0
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/PieChart.mjs +3 -3
- package/dist/components/Popconfirm.mjs +2 -2
- package/dist/components/Popover.mjs +2 -2
- package/dist/components/QRCode.d.mts +2 -2
- package/dist/components/QRCode.mjs +1 -1
- package/dist/components/RadarChart.mjs +4 -4
- package/dist/components/Rate.mjs +1 -1
- package/dist/components/ScatterChart.mjs +5 -4
- package/dist/components/ScrollArea.d.mts +10 -0
- package/dist/components/ScrollArea.mjs +8 -0
- package/dist/components/ScrollSpy.mjs +1 -1
- package/dist/components/Signature.mjs +1 -1
- package/dist/components/SplitButton.d.mts +38 -0
- package/dist/components/SplitButton.mjs +12 -0
- package/dist/components/Splitter.mjs +1 -1
- package/dist/components/Stepper.d.mts +2 -0
- package/dist/components/Stepper.mjs +2 -1
- package/dist/components/SunburstChart.mjs +3 -3
- package/dist/components/Switch.d.mts +5 -1
- package/dist/components/Switch.mjs +2 -1
- package/dist/components/Table.mjs +2 -2
- package/dist/components/TagsInput.d.mts +41 -0
- package/dist/components/TagsInput.mjs +13 -0
- package/dist/components/TaskBoard.mjs +1 -1
- package/dist/components/Textarea.mjs +1 -1
- package/dist/components/Tooltip.mjs +2 -2
- package/dist/components/Tour.mjs +1 -1
- package/dist/components/TreeMapChart.mjs +3 -3
- package/dist/components/TreeSelect.mjs +2 -1
- package/dist/components/Upload.mjs +1 -1
- package/dist/hooks/useChartInteraction.d.mts +5 -0
- package/dist/hooks/useChartInteraction.mjs +1 -1
- package/dist/index.d.mts +17 -1
- package/dist/index.mjs +406 -0
- package/package.json +117 -2
- package/dist/chunk-7AFRHC7P.mjs +0 -312
- package/dist/chunk-CB4SK5AU.mjs +0 -235
- package/dist/chunk-KPACLRQH.mjs +0 -55
- package/dist/chunk-YIB6ZXZF.mjs +0 -386
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImageGroupContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3LACOSJQ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ImagePreview
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-V7HJ5HLC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
usePopup
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WTHWLCRL.mjs";
|
|
10
10
|
import {
|
|
11
11
|
renderOverlayPortal
|
|
12
12
|
} from "./chunk-HKAZXG74.mjs";
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
// src/components/ImageCompare.tsx
|
|
2
|
+
import { forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import {
|
|
4
|
+
getImageCompareAfterClasses,
|
|
5
|
+
getImageCompareBeforeClasses,
|
|
6
|
+
getImageCompareClipStyle,
|
|
7
|
+
getImageCompareHandleClasses,
|
|
8
|
+
getImageCompareHandleStyle,
|
|
9
|
+
getImageCompareImgClasses,
|
|
10
|
+
getImageCompareKeyboardPosition,
|
|
11
|
+
getImageCompareKnobClasses,
|
|
12
|
+
getImageCompareLineClasses,
|
|
13
|
+
getImageComparePointerClientPoint,
|
|
14
|
+
getImageComparePositionFromPointer,
|
|
15
|
+
getImageCompareRootClasses,
|
|
16
|
+
getImageCompareRootStyle,
|
|
17
|
+
isImageCompareInteractiveTarget,
|
|
18
|
+
isImageCompareVertical,
|
|
19
|
+
resolveImageCompareAriaLabel,
|
|
20
|
+
resolveImageCompareFit,
|
|
21
|
+
resolveImageCompareOrientation,
|
|
22
|
+
resolveImageComparePosition,
|
|
23
|
+
resolveImageCompareStep
|
|
24
|
+
} from "@expcat/tigercat-core";
|
|
25
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
function renderPaneContent(slot, src, alt, fit) {
|
|
27
|
+
if (slot != null) return slot;
|
|
28
|
+
if (!src) return null;
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
"img",
|
|
31
|
+
{
|
|
32
|
+
src,
|
|
33
|
+
alt,
|
|
34
|
+
className: getImageCompareImgClasses(resolveImageCompareFit(fit)),
|
|
35
|
+
draggable: false
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
var ImageCompare = forwardRef(
|
|
40
|
+
({
|
|
41
|
+
beforeSrc,
|
|
42
|
+
afterSrc,
|
|
43
|
+
beforeAlt = "",
|
|
44
|
+
afterAlt = "",
|
|
45
|
+
fit,
|
|
46
|
+
position: controlledPosition,
|
|
47
|
+
defaultPosition,
|
|
48
|
+
orientation,
|
|
49
|
+
step,
|
|
50
|
+
disabled = false,
|
|
51
|
+
width,
|
|
52
|
+
height,
|
|
53
|
+
ariaLabel,
|
|
54
|
+
className,
|
|
55
|
+
style,
|
|
56
|
+
before,
|
|
57
|
+
after,
|
|
58
|
+
onChange,
|
|
59
|
+
onMouseDown,
|
|
60
|
+
onTouchStart,
|
|
61
|
+
onKeyDown,
|
|
62
|
+
...rest
|
|
63
|
+
}, ref) => {
|
|
64
|
+
const {
|
|
65
|
+
"aria-label": ariaLabelAttr,
|
|
66
|
+
"aria-labelledby": ariaLabelledby,
|
|
67
|
+
"aria-describedby": ariaDescribedby,
|
|
68
|
+
...domProps
|
|
69
|
+
} = rest;
|
|
70
|
+
const resolvedOrientation = resolveImageCompareOrientation(orientation);
|
|
71
|
+
const resolvedStep = resolveImageCompareStep(step);
|
|
72
|
+
const [uncontrolledPosition, setUncontrolledPosition] = useState(
|
|
73
|
+
() => resolveImageComparePosition(controlledPosition ?? defaultPosition, step)
|
|
74
|
+
);
|
|
75
|
+
const [dragging, setDragging] = useState(false);
|
|
76
|
+
const rootRef = useRef(null);
|
|
77
|
+
const handleRef = useRef(null);
|
|
78
|
+
const draggingRef = useRef(false);
|
|
79
|
+
const isControlled = controlledPosition !== void 0;
|
|
80
|
+
const current = resolveImageComparePosition(
|
|
81
|
+
isControlled ? controlledPosition : uncontrolledPosition,
|
|
82
|
+
step
|
|
83
|
+
);
|
|
84
|
+
const vertical = isImageCompareVertical(resolvedOrientation);
|
|
85
|
+
const resolvedAriaLabel = resolveImageCompareAriaLabel(
|
|
86
|
+
typeof ariaLabelAttr === "string" ? ariaLabelAttr : ariaLabel
|
|
87
|
+
);
|
|
88
|
+
const setRootRef = useCallback(
|
|
89
|
+
(node) => {
|
|
90
|
+
rootRef.current = node;
|
|
91
|
+
if (typeof ref === "function") ref(node);
|
|
92
|
+
else if (ref) ref.current = node;
|
|
93
|
+
},
|
|
94
|
+
[ref]
|
|
95
|
+
);
|
|
96
|
+
const commit = useCallback(
|
|
97
|
+
(next) => {
|
|
98
|
+
const resolved = resolveImageComparePosition(next, step);
|
|
99
|
+
if (!isControlled) setUncontrolledPosition(resolved);
|
|
100
|
+
onChange?.(resolved);
|
|
101
|
+
},
|
|
102
|
+
[isControlled, onChange, step]
|
|
103
|
+
);
|
|
104
|
+
const positionFromEvent = useCallback(
|
|
105
|
+
(event) => {
|
|
106
|
+
const root = rootRef.current;
|
|
107
|
+
const source = "nativeEvent" in event ? event.nativeEvent : event;
|
|
108
|
+
const point = getImageComparePointerClientPoint(source);
|
|
109
|
+
if (!root || !point) return null;
|
|
110
|
+
return getImageComparePositionFromPointer({
|
|
111
|
+
clientX: point.clientX,
|
|
112
|
+
clientY: point.clientY,
|
|
113
|
+
rect: root.getBoundingClientRect(),
|
|
114
|
+
orientation: resolvedOrientation,
|
|
115
|
+
step: resolvedStep
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
[resolvedOrientation, resolvedStep]
|
|
119
|
+
);
|
|
120
|
+
const handleMove = useCallback(
|
|
121
|
+
(event) => {
|
|
122
|
+
if (disabled || !draggingRef.current) return;
|
|
123
|
+
const next = positionFromEvent(event);
|
|
124
|
+
if (next === null) return;
|
|
125
|
+
commit(next);
|
|
126
|
+
},
|
|
127
|
+
[commit, disabled, positionFromEvent]
|
|
128
|
+
);
|
|
129
|
+
const handleEnd = useCallback(() => {
|
|
130
|
+
draggingRef.current = false;
|
|
131
|
+
setDragging(false);
|
|
132
|
+
}, []);
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
if (!dragging) return;
|
|
135
|
+
document.addEventListener("mousemove", handleMove);
|
|
136
|
+
document.addEventListener("mouseup", handleEnd);
|
|
137
|
+
document.addEventListener("touchmove", handleMove);
|
|
138
|
+
document.addEventListener("touchend", handleEnd);
|
|
139
|
+
return () => {
|
|
140
|
+
document.removeEventListener("mousemove", handleMove);
|
|
141
|
+
document.removeEventListener("mouseup", handleEnd);
|
|
142
|
+
document.removeEventListener("touchmove", handleMove);
|
|
143
|
+
document.removeEventListener("touchend", handleEnd);
|
|
144
|
+
};
|
|
145
|
+
}, [dragging, handleEnd, handleMove]);
|
|
146
|
+
const startDrag = useCallback(
|
|
147
|
+
(event) => {
|
|
148
|
+
if (disabled) return;
|
|
149
|
+
if ("button" in event && event.button !== 0) return;
|
|
150
|
+
if (isImageCompareInteractiveTarget(event.target, handleRef.current)) return;
|
|
151
|
+
event.preventDefault();
|
|
152
|
+
draggingRef.current = true;
|
|
153
|
+
setDragging(true);
|
|
154
|
+
const next = positionFromEvent(event);
|
|
155
|
+
if (next !== null) commit(next);
|
|
156
|
+
handleRef.current?.focus();
|
|
157
|
+
},
|
|
158
|
+
[commit, disabled, positionFromEvent]
|
|
159
|
+
);
|
|
160
|
+
const handleMouseDown = useCallback(
|
|
161
|
+
(event) => {
|
|
162
|
+
startDrag(event);
|
|
163
|
+
onMouseDown?.(event);
|
|
164
|
+
},
|
|
165
|
+
[onMouseDown, startDrag]
|
|
166
|
+
);
|
|
167
|
+
const handleTouchStart = useCallback(
|
|
168
|
+
(event) => {
|
|
169
|
+
startDrag(event);
|
|
170
|
+
onTouchStart?.(event);
|
|
171
|
+
},
|
|
172
|
+
[onTouchStart, startDrag]
|
|
173
|
+
);
|
|
174
|
+
const handleKeyDown = useCallback(
|
|
175
|
+
(event) => {
|
|
176
|
+
if (disabled) {
|
|
177
|
+
onKeyDown?.(event);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
const next = getImageCompareKeyboardPosition(event.key, current, resolvedStep);
|
|
181
|
+
if (next !== null) {
|
|
182
|
+
event.preventDefault();
|
|
183
|
+
commit(next);
|
|
184
|
+
}
|
|
185
|
+
onKeyDown?.(event);
|
|
186
|
+
},
|
|
187
|
+
[commit, current, disabled, onKeyDown, resolvedStep]
|
|
188
|
+
);
|
|
189
|
+
return /* @__PURE__ */ jsxs(
|
|
190
|
+
"div",
|
|
191
|
+
{
|
|
192
|
+
...domProps,
|
|
193
|
+
ref: setRootRef,
|
|
194
|
+
"data-image-compare": "",
|
|
195
|
+
"data-image-compare-orientation": resolvedOrientation,
|
|
196
|
+
"data-image-compare-position": String(current),
|
|
197
|
+
"data-image-compare-disabled": disabled ? "true" : "false",
|
|
198
|
+
"data-image-compare-dragging": dragging ? "true" : "false",
|
|
199
|
+
className: getImageCompareRootClasses({
|
|
200
|
+
orientation: resolvedOrientation,
|
|
201
|
+
disabled,
|
|
202
|
+
className
|
|
203
|
+
}),
|
|
204
|
+
style: {
|
|
205
|
+
...getImageCompareRootStyle({
|
|
206
|
+
position: current,
|
|
207
|
+
step: resolvedStep,
|
|
208
|
+
width,
|
|
209
|
+
height
|
|
210
|
+
}),
|
|
211
|
+
...style
|
|
212
|
+
},
|
|
213
|
+
onMouseDown: handleMouseDown,
|
|
214
|
+
onTouchStart: handleTouchStart,
|
|
215
|
+
children: [
|
|
216
|
+
/* @__PURE__ */ jsx("div", { className: getImageCompareAfterClasses(), "data-image-compare-after": "", children: renderPaneContent(after, afterSrc, afterAlt, fit) }),
|
|
217
|
+
/* @__PURE__ */ jsx(
|
|
218
|
+
"div",
|
|
219
|
+
{
|
|
220
|
+
className: getImageCompareBeforeClasses(),
|
|
221
|
+
style: getImageCompareClipStyle(current, resolvedOrientation, resolvedStep),
|
|
222
|
+
"data-image-compare-before": "",
|
|
223
|
+
children: renderPaneContent(before, beforeSrc, beforeAlt, fit)
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
/* @__PURE__ */ jsxs(
|
|
227
|
+
"div",
|
|
228
|
+
{
|
|
229
|
+
ref: handleRef,
|
|
230
|
+
className: getImageCompareHandleClasses({
|
|
231
|
+
orientation: resolvedOrientation,
|
|
232
|
+
disabled
|
|
233
|
+
}),
|
|
234
|
+
style: getImageCompareHandleStyle(current, resolvedOrientation, resolvedStep),
|
|
235
|
+
"data-image-compare-handle": "",
|
|
236
|
+
role: "slider",
|
|
237
|
+
tabIndex: disabled ? -1 : 0,
|
|
238
|
+
"aria-label": resolvedAriaLabel,
|
|
239
|
+
"aria-labelledby": ariaLabelledby,
|
|
240
|
+
"aria-describedby": ariaDescribedby,
|
|
241
|
+
"aria-valuemin": 0,
|
|
242
|
+
"aria-valuemax": 100,
|
|
243
|
+
"aria-valuenow": current,
|
|
244
|
+
"aria-valuetext": `${current}%`,
|
|
245
|
+
"aria-orientation": vertical ? "vertical" : "horizontal",
|
|
246
|
+
"aria-disabled": disabled,
|
|
247
|
+
onKeyDown: handleKeyDown,
|
|
248
|
+
children: [
|
|
249
|
+
/* @__PURE__ */ jsx(
|
|
250
|
+
"div",
|
|
251
|
+
{
|
|
252
|
+
className: getImageCompareLineClasses(resolvedOrientation),
|
|
253
|
+
"data-image-compare-line": "",
|
|
254
|
+
"aria-hidden": "true"
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
/* @__PURE__ */ jsx(
|
|
258
|
+
"div",
|
|
259
|
+
{
|
|
260
|
+
className: getImageCompareKnobClasses(),
|
|
261
|
+
"data-image-compare-knob": "",
|
|
262
|
+
"aria-hidden": "true"
|
|
263
|
+
}
|
|
264
|
+
)
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
);
|
|
273
|
+
ImageCompare.displayName = "ImageCompare";
|
|
274
|
+
var ImageCompare_default = ImageCompare;
|
|
275
|
+
|
|
276
|
+
export {
|
|
277
|
+
ImageCompare,
|
|
278
|
+
ImageCompare_default
|
|
279
|
+
};
|
|
@@ -66,28 +66,30 @@ var Textarea = forwardRef(
|
|
|
66
66
|
onChange?.(event);
|
|
67
67
|
};
|
|
68
68
|
const currentLength = currentValue?.length ?? 0;
|
|
69
|
+
const textarea = /* @__PURE__ */ jsx(
|
|
70
|
+
"textarea",
|
|
71
|
+
{
|
|
72
|
+
ref: setRefs,
|
|
73
|
+
className: textareaClasses,
|
|
74
|
+
value: currentValue,
|
|
75
|
+
disabled,
|
|
76
|
+
readOnly: readonly,
|
|
77
|
+
required,
|
|
78
|
+
placeholder,
|
|
79
|
+
rows,
|
|
80
|
+
maxLength,
|
|
81
|
+
minLength,
|
|
82
|
+
onInput: handleInput,
|
|
83
|
+
onChange: handleChange,
|
|
84
|
+
onFocus,
|
|
85
|
+
onBlur,
|
|
86
|
+
...props
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
if (!showCount) return textarea;
|
|
69
90
|
return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
{
|
|
73
|
-
ref: setRefs,
|
|
74
|
-
className: textareaClasses,
|
|
75
|
-
value: currentValue,
|
|
76
|
-
disabled,
|
|
77
|
-
readOnly: readonly,
|
|
78
|
-
required,
|
|
79
|
-
placeholder,
|
|
80
|
-
rows,
|
|
81
|
-
maxLength,
|
|
82
|
-
minLength,
|
|
83
|
-
onInput: handleInput,
|
|
84
|
-
onChange: handleChange,
|
|
85
|
-
onFocus,
|
|
86
|
-
onBlur,
|
|
87
|
-
...props
|
|
88
|
-
}
|
|
89
|
-
),
|
|
90
|
-
showCount && /* @__PURE__ */ jsx("div", { className: "mt-1 text-sm text-gray-500 text-right", children: maxLength ? `${currentLength}/${maxLength}` : currentLength })
|
|
91
|
+
textarea,
|
|
92
|
+
/* @__PURE__ */ jsx("div", { className: "mt-1 text-sm text-gray-500 text-right", children: maxLength ? `${currentLength}/${maxLength}` : currentLength })
|
|
91
93
|
] });
|
|
92
94
|
}
|
|
93
95
|
);
|