@expcat/tigercat-react 2.0.0 → 2.0.4
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/dist/{chunk-JTFNGXOC.mjs → chunk-2ENQZECC.mjs} +53 -31
- package/dist/{chunk-O5RAMCBV.mjs → chunk-2JYJPNW3.mjs} +1 -1
- package/dist/{chunk-NBQ3Q6DD.mjs → chunk-2WGEHH5A.mjs} +1 -1
- package/dist/{chunk-K7MYQISG.mjs → chunk-54HN5BXW.mjs} +10 -4
- package/dist/{chunk-C6QK5MJT.mjs → chunk-5CKMYMTS.mjs} +1 -1
- package/dist/{chunk-Y7K27DVV.mjs → chunk-6H5Y7Y6E.mjs} +42 -28
- package/dist/chunk-6MGQAJ62.mjs +203 -0
- package/dist/{chunk-TO2URY7X.mjs → chunk-7AFRHC7P.mjs} +90 -61
- package/dist/{chunk-MGQWVJHX.mjs → chunk-ALSOPYM5.mjs} +69 -62
- package/dist/{chunk-YCKY72BW.mjs → chunk-BOGOQ44C.mjs} +1 -1
- package/dist/{chunk-Q327ESD2.mjs → chunk-BUXHI6UK.mjs} +17 -38
- package/dist/{chunk-TORX7SG4.mjs → chunk-CC7IOSNI.mjs} +10 -4
- package/dist/{chunk-OVE2ZUJJ.mjs → chunk-D33BIMGK.mjs} +1 -1
- package/dist/{chunk-PYDWF4ED.mjs → chunk-D3KP72UC.mjs} +34 -9
- package/dist/{chunk-ZEP7I6WB.mjs → chunk-DPWRXXXW.mjs} +16 -8
- package/dist/chunk-HKAZXG74.mjs +308 -0
- package/dist/{chunk-QWUDJC6K.mjs → chunk-HOYBHB7B.mjs} +38 -17
- package/dist/{chunk-3RY6M4AK.mjs → chunk-HS6KUPTI.mjs} +1 -1
- package/dist/{chunk-EKESN747.mjs → chunk-HSBN5MLS.mjs} +1 -1
- package/dist/{chunk-AJJJ6HWC.mjs → chunk-K4GIKSZE.mjs} +1 -1
- package/dist/{chunk-2UOGBS3C.mjs → chunk-KP6DEYWB.mjs} +27 -6
- package/dist/{chunk-PAN256RW.mjs → chunk-KVCI2346.mjs} +59 -55
- package/dist/{chunk-5RVLBNLI.mjs → chunk-RJPNBYK5.mjs} +4 -4
- package/dist/{chunk-HELLYIX2.mjs → chunk-V6P7ZK6O.mjs} +3 -3
- package/dist/{chunk-4XGO3OSE.mjs → chunk-XE4YFBOZ.mjs} +12 -17
- package/dist/{chunk-YI7NQWUV.mjs → chunk-YI6YWH66.mjs} +14 -30
- package/dist/{chunk-SHCBCM2W.mjs → chunk-YIB6ZXZF.mjs} +142 -105
- package/dist/{chunk-SZBYEGKU.mjs → chunk-ZCGIZOMT.mjs} +1 -1
- package/dist/{chunk-S7IB6YST.mjs → chunk-ZG56T75O.mjs} +25 -40
- package/dist/{chunk-44BPUG24.mjs → chunk-ZH5ZBLAN.mjs} +38 -16
- package/dist/components/ActivityFeed.mjs +3 -3
- package/dist/components/AutoComplete.mjs +2 -1
- package/dist/components/Cascader.mjs +2 -1
- package/dist/components/ColorPicker.mjs +2 -1
- package/dist/components/CropUpload.mjs +3 -3
- package/dist/components/DataExport.mjs +3 -3
- package/dist/components/DataTableWithToolbar.mjs +6 -6
- package/dist/components/DatePicker.mjs +2 -1
- package/dist/components/Drawer.mjs +2 -2
- package/dist/components/Dropdown.mjs +2 -2
- package/dist/components/FormItem.mjs +2 -1
- package/dist/components/Image.mjs +5 -5
- package/dist/components/ImageGroup.mjs +3 -3
- package/dist/components/ImagePreview.mjs +2 -2
- package/dist/components/Loading.mjs +2 -2
- package/dist/components/Mentions.mjs +2 -1
- package/dist/components/Menu.mjs +2 -2
- package/dist/components/Modal.mjs +2 -2
- package/dist/components/NotificationCenter.mjs +3 -3
- package/dist/components/Popconfirm.mjs +3 -3
- package/dist/components/Popover.mjs +3 -3
- package/dist/components/Select.mjs +2 -1
- package/dist/components/Spotlight.mjs +2 -2
- package/dist/components/Table.mjs +3 -2
- package/dist/components/TimePicker.mjs +2 -1
- package/dist/components/Tooltip.mjs +3 -3
- package/dist/components/Tour.mjs +2 -2
- package/dist/components/TreeSelect.mjs +2 -1
- package/dist/index.mjs +4 -2
- package/package.json +2 -2
- package/dist/chunk-KVARQQAG.mjs +0 -181
- package/dist/chunk-SEWNVIHH.mjs +0 -153
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CropUpload
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-HS6KUPTI.mjs";
|
|
4
|
+
import "../chunk-54HN5BXW.mjs";
|
|
5
5
|
import "../chunk-PD6Q36OO.mjs";
|
|
6
6
|
import "../chunk-5TE7KLE5.mjs";
|
|
7
7
|
import "../chunk-ZJWUBR2X.mjs";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-HKAZXG74.mjs";
|
|
9
9
|
import "../chunk-YSIXURBW.mjs";
|
|
10
10
|
import "../chunk-TGXBCKOU.mjs";
|
|
11
11
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataExport
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-D33BIMGK.mjs";
|
|
4
|
+
import "../chunk-YI6YWH66.mjs";
|
|
5
|
+
import "../chunk-HKAZXG74.mjs";
|
|
6
6
|
import "../chunk-YSIXURBW.mjs";
|
|
7
7
|
import "../chunk-TGXBCKOU.mjs";
|
|
8
8
|
export {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataTableWithToolbar,
|
|
3
3
|
DataTableWithToolbar_default
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-V6P7ZK6O.mjs";
|
|
5
|
+
import "../chunk-BOGOQ44C.mjs";
|
|
6
|
+
import "../chunk-KVCI2346.mjs";
|
|
7
|
+
import "../chunk-HOYBHB7B.mjs";
|
|
8
8
|
import "../chunk-IIWUQK2P.mjs";
|
|
9
9
|
import "../chunk-AKNWUI7K.mjs";
|
|
10
10
|
import "../chunk-HHIW7V7B.mjs";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-ZG56T75O.mjs";
|
|
12
12
|
import "../chunk-F6WV53BS.mjs";
|
|
13
13
|
import "../chunk-W7BC4I2Y.mjs";
|
|
14
14
|
import "../chunk-F6T3OLTQ.mjs";
|
|
@@ -18,7 +18,7 @@ import "../chunk-OL3RXYMG.mjs";
|
|
|
18
18
|
import "../chunk-MEFARVQI.mjs";
|
|
19
19
|
import "../chunk-5TE7KLE5.mjs";
|
|
20
20
|
import "../chunk-ZJWUBR2X.mjs";
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-HKAZXG74.mjs";
|
|
22
22
|
import "../chunk-YSIXURBW.mjs";
|
|
23
23
|
import "../chunk-TGXBCKOU.mjs";
|
|
24
24
|
export {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FormItem
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-ZH5ZBLAN.mjs";
|
|
4
4
|
import "../chunk-OQLP452R.mjs";
|
|
5
5
|
import "../chunk-F6T3OLTQ.mjs";
|
|
6
|
+
import "../chunk-HKAZXG74.mjs";
|
|
6
7
|
import "../chunk-YSIXURBW.mjs";
|
|
7
8
|
import "../chunk-TGXBCKOU.mjs";
|
|
8
9
|
export {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Image
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-DPWRXXXW.mjs";
|
|
4
|
+
import "../chunk-HSBN5MLS.mjs";
|
|
5
|
+
import "../chunk-ZCGIZOMT.mjs";
|
|
6
|
+
import "../chunk-ZG56T75O.mjs";
|
|
7
|
+
import "../chunk-HKAZXG74.mjs";
|
|
8
8
|
import "../chunk-YSIXURBW.mjs";
|
|
9
9
|
import "../chunk-TGXBCKOU.mjs";
|
|
10
10
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImageGroup,
|
|
3
3
|
ImageGroupContext
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-HSBN5MLS.mjs";
|
|
5
|
+
import "../chunk-ZCGIZOMT.mjs";
|
|
6
|
+
import "../chunk-HKAZXG74.mjs";
|
|
7
7
|
import "../chunk-YSIXURBW.mjs";
|
|
8
8
|
import "../chunk-TGXBCKOU.mjs";
|
|
9
9
|
export {
|
package/dist/components/Menu.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Modal
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-54HN5BXW.mjs";
|
|
4
4
|
import "../chunk-5TE7KLE5.mjs";
|
|
5
5
|
import "../chunk-ZJWUBR2X.mjs";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-HKAZXG74.mjs";
|
|
7
7
|
import "../chunk-YSIXURBW.mjs";
|
|
8
8
|
import "../chunk-TGXBCKOU.mjs";
|
|
9
9
|
export {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NotificationCenter,
|
|
3
3
|
NotificationCenter_default
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-2WGEHH5A.mjs";
|
|
5
5
|
import "../chunk-Z3CRHC5F.mjs";
|
|
6
6
|
import "../chunk-QJE3MZBO.mjs";
|
|
7
7
|
import "../chunk-HHIW7V7B.mjs";
|
|
8
8
|
import "../chunk-Y5X3G2LD.mjs";
|
|
9
9
|
import "../chunk-5TE7KLE5.mjs";
|
|
10
10
|
import "../chunk-ZJWUBR2X.mjs";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-SEWNVIHH.mjs";
|
|
11
|
+
import "../chunk-K4GIKSZE.mjs";
|
|
13
12
|
import "../chunk-HLS4CHWX.mjs";
|
|
14
13
|
import "../chunk-IXV5YBCZ.mjs";
|
|
14
|
+
import "../chunk-HKAZXG74.mjs";
|
|
15
15
|
import "../chunk-YSIXURBW.mjs";
|
|
16
16
|
import "../chunk-TGXBCKOU.mjs";
|
|
17
17
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Spotlight,
|
|
3
3
|
Spotlight_default
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-2JYJPNW3.mjs";
|
|
5
5
|
import "../chunk-MEFARVQI.mjs";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-HKAZXG74.mjs";
|
|
7
7
|
import "../chunk-YSIXURBW.mjs";
|
|
8
8
|
import "../chunk-TGXBCKOU.mjs";
|
|
9
9
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Table
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-BOGOQ44C.mjs";
|
|
4
|
+
import "../chunk-KVCI2346.mjs";
|
|
5
5
|
import "../chunk-IIWUQK2P.mjs";
|
|
6
6
|
import "../chunk-AKNWUI7K.mjs";
|
|
7
7
|
import "../chunk-HHIW7V7B.mjs";
|
|
@@ -9,6 +9,7 @@ import "../chunk-W7BC4I2Y.mjs";
|
|
|
9
9
|
import "../chunk-EPWAROC2.mjs";
|
|
10
10
|
import "../chunk-OL3RXYMG.mjs";
|
|
11
11
|
import "../chunk-MEFARVQI.mjs";
|
|
12
|
+
import "../chunk-HKAZXG74.mjs";
|
|
12
13
|
import "../chunk-YSIXURBW.mjs";
|
|
13
14
|
import "../chunk-TGXBCKOU.mjs";
|
|
14
15
|
export {
|
package/dist/components/Tour.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Tour
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-SEWNVIHH.mjs";
|
|
3
|
+
} from "../chunk-RJPNBYK5.mjs";
|
|
5
4
|
import "../chunk-FLYJVZED.mjs";
|
|
5
|
+
import "../chunk-HKAZXG74.mjs";
|
|
6
6
|
import "../chunk-YSIXURBW.mjs";
|
|
7
7
|
import "../chunk-TGXBCKOU.mjs";
|
|
8
8
|
export {
|
package/dist/index.mjs
CHANGED
|
@@ -693,6 +693,8 @@ export {
|
|
|
693
693
|
getAnchorLinkListClasses,
|
|
694
694
|
getAnchorTargetElement,
|
|
695
695
|
getAnchorWrapperClasses,
|
|
696
|
+
getAnchoredOverlayLayoutClasses,
|
|
697
|
+
getAnchoredOverlayTabTarget,
|
|
696
698
|
getAreaGradientPrefix,
|
|
697
699
|
getArrowStyles,
|
|
698
700
|
getAutoCompleteInputClasses,
|
|
@@ -1109,7 +1111,6 @@ export {
|
|
|
1109
1111
|
getStepsContainerClasses,
|
|
1110
1112
|
getSubMenuExpandIconClasses,
|
|
1111
1113
|
getSubMenuTitleClasses,
|
|
1112
|
-
getSubmenuPopupZIndex,
|
|
1113
1114
|
getSunburstGradientPrefix,
|
|
1114
1115
|
getSvgDefaultAttrs,
|
|
1115
1116
|
getSwitchClasses,
|
|
@@ -1553,7 +1554,6 @@ export {
|
|
|
1553
1554
|
popconfirmQuestionIconPath,
|
|
1554
1555
|
popconfirmSuccessIconPath,
|
|
1555
1556
|
popconfirmWarningIconPath,
|
|
1556
|
-
positionMentionsDropdown,
|
|
1557
1557
|
prefersReducedMotion,
|
|
1558
1558
|
prepareUploadFiles,
|
|
1559
1559
|
prevIconPath,
|
|
@@ -1606,6 +1606,7 @@ export {
|
|
|
1606
1606
|
rateInactiveColor,
|
|
1607
1607
|
readFileAsDataUrl,
|
|
1608
1608
|
redoFormHistory,
|
|
1609
|
+
registerEscapeDismiss,
|
|
1609
1610
|
registerImageGroupItem,
|
|
1610
1611
|
removeCssVarsCached,
|
|
1611
1612
|
renderMarkdownInline,
|
|
@@ -1637,6 +1638,7 @@ export {
|
|
|
1637
1638
|
resizeCropRect,
|
|
1638
1639
|
resizePanes,
|
|
1639
1640
|
resolveAffixTarget,
|
|
1641
|
+
resolveAnchoredOverlayTarget,
|
|
1640
1642
|
resolveCardPadding,
|
|
1641
1643
|
resolveCarouselSwipeDirection,
|
|
1642
1644
|
resolveChartPalette,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expcat/tigercat-react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "React components for Tigercat UI library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Yizhe Wang",
|
|
@@ -782,7 +782,7 @@
|
|
|
782
782
|
"access": "public"
|
|
783
783
|
},
|
|
784
784
|
"dependencies": {
|
|
785
|
-
"@expcat/tigercat-core": "2.0.
|
|
785
|
+
"@expcat/tigercat-core": "2.0.4"
|
|
786
786
|
},
|
|
787
787
|
"devDependencies": {
|
|
788
788
|
"@types/node": "^26.1.1",
|
package/dist/chunk-KVARQQAG.mjs
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
// src/components/ColorPicker.tsx
|
|
2
|
-
import { useState, useMemo, useRef, useEffect } from "react";
|
|
3
|
-
import {
|
|
4
|
-
colorPickerBaseClasses,
|
|
5
|
-
getColorPickerTriggerClasses,
|
|
6
|
-
colorPickerPanelClasses,
|
|
7
|
-
colorPickerInputClasses,
|
|
8
|
-
colorPickerPresetClasses,
|
|
9
|
-
hexToRgb,
|
|
10
|
-
rgbToHex,
|
|
11
|
-
rgbToHsv,
|
|
12
|
-
hsvToRgb,
|
|
13
|
-
formatColorString,
|
|
14
|
-
parseColorInput,
|
|
15
|
-
classNames
|
|
16
|
-
} from "@expcat/tigercat-core";
|
|
17
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
-
var ColorPicker = ({
|
|
19
|
-
value = "#2563eb",
|
|
20
|
-
disabled = false,
|
|
21
|
-
size = "md",
|
|
22
|
-
showAlpha = false,
|
|
23
|
-
format = "hex",
|
|
24
|
-
presets,
|
|
25
|
-
className,
|
|
26
|
-
onChange
|
|
27
|
-
}) => {
|
|
28
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
29
|
-
const [alpha, setAlpha] = useState(1);
|
|
30
|
-
const containerRef = useRef(null);
|
|
31
|
-
const rgb = useMemo(() => hexToRgb(value), [value]);
|
|
32
|
-
const hsv = useMemo(() => rgbToHsv(rgb.r, rgb.g, rgb.b), [rgb]);
|
|
33
|
-
const displayValue = useMemo(
|
|
34
|
-
() => formatColorString(rgb.r, rgb.g, rgb.b, format, showAlpha ? alpha : void 0),
|
|
35
|
-
[rgb, format, showAlpha, alpha]
|
|
36
|
-
);
|
|
37
|
-
const swatchColor = showAlpha ? `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha})` : value;
|
|
38
|
-
const [inputValue, setInputValue] = useState(displayValue);
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
setInputValue(displayValue);
|
|
41
|
-
}, [displayValue]);
|
|
42
|
-
function togglePanel() {
|
|
43
|
-
if (disabled) return;
|
|
44
|
-
setIsOpen((v) => !v);
|
|
45
|
-
}
|
|
46
|
-
function handleTriggerKeyDown(e) {
|
|
47
|
-
if (disabled) return;
|
|
48
|
-
if (e.key === "Enter" || e.key === " " || e.key === "Spacebar") {
|
|
49
|
-
e.preventDefault();
|
|
50
|
-
setIsOpen((v) => !v);
|
|
51
|
-
} else if (e.key === "Escape" && isOpen) {
|
|
52
|
-
setIsOpen(false);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function handleHueChange(e) {
|
|
56
|
-
const hue = Number(e.target.value);
|
|
57
|
-
const { r, g, b } = hsvToRgb(hue, hsv.s, hsv.v);
|
|
58
|
-
const hex = rgbToHex(r, g, b);
|
|
59
|
-
onChange?.(hex);
|
|
60
|
-
}
|
|
61
|
-
function handleInputChange(e) {
|
|
62
|
-
const val = e.target.value;
|
|
63
|
-
setInputValue(val);
|
|
64
|
-
const hex = parseColorInput(val);
|
|
65
|
-
if (hex) {
|
|
66
|
-
onChange?.(hex);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function handleAlphaChange(e) {
|
|
70
|
-
setAlpha(Number(e.target.value) / 100);
|
|
71
|
-
}
|
|
72
|
-
function handlePresetClick(color) {
|
|
73
|
-
onChange?.(color);
|
|
74
|
-
}
|
|
75
|
-
function handlePresetKeyDown(e, color) {
|
|
76
|
-
if (e.key === "Enter" || e.key === " " || e.key === "Spacebar") {
|
|
77
|
-
e.preventDefault();
|
|
78
|
-
handlePresetClick(color);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
if (!isOpen) return;
|
|
83
|
-
function handleClickOutside(e) {
|
|
84
|
-
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
85
|
-
setIsOpen(false);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
document.addEventListener("click", handleClickOutside);
|
|
89
|
-
return () => document.removeEventListener("click", handleClickOutside);
|
|
90
|
-
}, [isOpen]);
|
|
91
|
-
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: classNames(colorPickerBaseClasses, className), children: [
|
|
92
|
-
/* @__PURE__ */ jsx(
|
|
93
|
-
"div",
|
|
94
|
-
{
|
|
95
|
-
className: getColorPickerTriggerClasses(size, disabled),
|
|
96
|
-
style: { backgroundColor: swatchColor },
|
|
97
|
-
role: "button",
|
|
98
|
-
"aria-label": "Pick color",
|
|
99
|
-
"aria-haspopup": "dialog",
|
|
100
|
-
"aria-expanded": isOpen,
|
|
101
|
-
"aria-disabled": disabled || void 0,
|
|
102
|
-
tabIndex: disabled ? -1 : 0,
|
|
103
|
-
onClick: togglePanel,
|
|
104
|
-
onKeyDown: handleTriggerKeyDown
|
|
105
|
-
}
|
|
106
|
-
),
|
|
107
|
-
isOpen && /* @__PURE__ */ jsxs("div", { className: colorPickerPanelClasses, children: [
|
|
108
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-2", children: [
|
|
109
|
-
/* @__PURE__ */ jsx("label", { className: "block text-xs text-[var(--tiger-text-muted,#6b7280)] mb-1", children: "Hue" }),
|
|
110
|
-
/* @__PURE__ */ jsx(
|
|
111
|
-
"input",
|
|
112
|
-
{
|
|
113
|
-
type: "range",
|
|
114
|
-
min: 0,
|
|
115
|
-
max: 360,
|
|
116
|
-
value: hsv.h,
|
|
117
|
-
className: "w-full h-2 rounded-full cursor-pointer accent-[var(--tiger-primary,#2563eb)]",
|
|
118
|
-
"aria-label": "Hue",
|
|
119
|
-
onChange: handleHueChange
|
|
120
|
-
}
|
|
121
|
-
)
|
|
122
|
-
] }),
|
|
123
|
-
showAlpha && /* @__PURE__ */ jsxs("div", { className: "mb-2", children: [
|
|
124
|
-
/* @__PURE__ */ jsx("label", { className: "block text-xs text-[var(--tiger-text-muted,#6b7280)] mb-1", children: "Alpha" }),
|
|
125
|
-
/* @__PURE__ */ jsx(
|
|
126
|
-
"input",
|
|
127
|
-
{
|
|
128
|
-
type: "range",
|
|
129
|
-
min: 0,
|
|
130
|
-
max: 100,
|
|
131
|
-
value: Math.round(alpha * 100),
|
|
132
|
-
className: "w-full h-2 rounded-full cursor-pointer accent-[var(--tiger-primary,#2563eb)]",
|
|
133
|
-
"aria-label": "Alpha",
|
|
134
|
-
onChange: handleAlphaChange
|
|
135
|
-
}
|
|
136
|
-
)
|
|
137
|
-
] }),
|
|
138
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-2", children: [
|
|
139
|
-
/* @__PURE__ */ jsx("label", { className: "block text-xs text-[var(--tiger-text-muted,#6b7280)] mb-1 uppercase", children: format }),
|
|
140
|
-
/* @__PURE__ */ jsx(
|
|
141
|
-
"input",
|
|
142
|
-
{
|
|
143
|
-
type: "text",
|
|
144
|
-
className: colorPickerInputClasses,
|
|
145
|
-
value: inputValue,
|
|
146
|
-
"aria-label": "Color value",
|
|
147
|
-
onChange: handleInputChange
|
|
148
|
-
}
|
|
149
|
-
)
|
|
150
|
-
] }),
|
|
151
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
152
|
-
/* @__PURE__ */ jsx(
|
|
153
|
-
"div",
|
|
154
|
-
{
|
|
155
|
-
className: "w-8 h-8 rounded border border-[var(--tiger-border,#d1d5db)]",
|
|
156
|
-
style: { backgroundColor: swatchColor },
|
|
157
|
-
"aria-label": "Color preview"
|
|
158
|
-
}
|
|
159
|
-
),
|
|
160
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs font-mono text-[var(--tiger-text,#111827)]", children: displayValue })
|
|
161
|
-
] }),
|
|
162
|
-
presets && presets.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: presets.map((color) => /* @__PURE__ */ jsx(
|
|
163
|
-
"div",
|
|
164
|
-
{
|
|
165
|
-
className: colorPickerPresetClasses,
|
|
166
|
-
style: { backgroundColor: color },
|
|
167
|
-
role: "button",
|
|
168
|
-
tabIndex: 0,
|
|
169
|
-
"aria-label": `Select ${color}`,
|
|
170
|
-
onClick: () => handlePresetClick(color),
|
|
171
|
-
onKeyDown: (e) => handlePresetKeyDown(e, color)
|
|
172
|
-
},
|
|
173
|
-
color
|
|
174
|
-
)) })
|
|
175
|
-
] })
|
|
176
|
-
] });
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
export {
|
|
180
|
-
ColorPicker
|
|
181
|
-
};
|