@krpkg/ui 0.4.1 → 0.4.2
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/index.js +67 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -27
- package/dist/index.mjs.map +1 -1
- package/dist/native.d.mts +2 -2
- package/dist/native.d.ts +2 -2
- package/dist/native.js +4 -4
- package/dist/native.js.map +1 -1
- package/dist/native.mjs +4 -4
- package/dist/native.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -877,6 +877,7 @@ var TerminalWindow = (0, import_react14.forwardRef)(
|
|
|
877
877
|
TerminalWindow.displayName = "TerminalWindow";
|
|
878
878
|
|
|
879
879
|
// src/components/Tooltip.tsx
|
|
880
|
+
var import_react15 = require("react");
|
|
880
881
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
881
882
|
var Tooltip = ({
|
|
882
883
|
content,
|
|
@@ -886,18 +887,51 @@ var Tooltip = ({
|
|
|
886
887
|
shortcut,
|
|
887
888
|
className = ""
|
|
888
889
|
}) => {
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
890
|
+
const [isVisible, setIsVisible] = (0, import_react15.useState)(false);
|
|
891
|
+
const timeoutRef = (0, import_react15.useRef)(null);
|
|
892
|
+
const show = () => {
|
|
893
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
894
|
+
setIsVisible(true);
|
|
895
|
+
};
|
|
896
|
+
const hide = () => {
|
|
897
|
+
timeoutRef.current = setTimeout(() => {
|
|
898
|
+
setIsVisible(false);
|
|
899
|
+
}, 100);
|
|
900
|
+
};
|
|
901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
902
|
+
"div",
|
|
903
|
+
{
|
|
904
|
+
className: `kz-tooltip-wrapper ${className}`,
|
|
905
|
+
onMouseEnter: show,
|
|
906
|
+
onMouseLeave: hide,
|
|
907
|
+
onFocus: show,
|
|
908
|
+
onBlur: hide,
|
|
909
|
+
children: [
|
|
910
|
+
children,
|
|
911
|
+
isVisible && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
912
|
+
"div",
|
|
913
|
+
{
|
|
914
|
+
role: "tooltip",
|
|
915
|
+
className: `kz-tooltip-box kz-tooltip-${position}`,
|
|
916
|
+
children: [
|
|
917
|
+
coord && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "kz-tooltip-coord", children: [
|
|
918
|
+
"[",
|
|
919
|
+
coord,
|
|
920
|
+
"]"
|
|
921
|
+
] }),
|
|
922
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "kz-tooltip-content", children: [
|
|
923
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "kz-tooltip-text", children: content }),
|
|
924
|
+
shortcut && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("kbd", { className: "kz-tooltip-shortcut", children: shortcut })
|
|
925
|
+
] }),
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "kz-tooltip-arrow" })
|
|
927
|
+
]
|
|
928
|
+
}
|
|
929
|
+
)
|
|
930
|
+
]
|
|
931
|
+
}
|
|
932
|
+
);
|
|
900
933
|
};
|
|
934
|
+
Tooltip.displayName = "Tooltip";
|
|
901
935
|
|
|
902
936
|
// src/components/SegmentedControl.tsx
|
|
903
937
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
@@ -1089,7 +1123,7 @@ function Breadcrumbs({
|
|
|
1089
1123
|
}
|
|
1090
1124
|
|
|
1091
1125
|
// src/components/TacticalDrawer.tsx
|
|
1092
|
-
var
|
|
1126
|
+
var import_react16 = require("react");
|
|
1093
1127
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1094
1128
|
function TacticalDrawer({
|
|
1095
1129
|
isOpen,
|
|
@@ -1101,7 +1135,7 @@ function TacticalDrawer({
|
|
|
1101
1135
|
position = "bottom",
|
|
1102
1136
|
className = ""
|
|
1103
1137
|
}) {
|
|
1104
|
-
(0,
|
|
1138
|
+
(0, import_react16.useEffect)(() => {
|
|
1105
1139
|
if (!isOpen) return;
|
|
1106
1140
|
const handleKeyDown = (e) => {
|
|
1107
1141
|
if (e.key === "Escape") onClose();
|
|
@@ -1151,7 +1185,7 @@ function TacticalDrawer({
|
|
|
1151
1185
|
}
|
|
1152
1186
|
|
|
1153
1187
|
// src/components/HudToast.tsx
|
|
1154
|
-
var
|
|
1188
|
+
var import_react17 = require("react");
|
|
1155
1189
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1156
1190
|
function HudToast({
|
|
1157
1191
|
isOpen,
|
|
@@ -1163,8 +1197,8 @@ function HudToast({
|
|
|
1163
1197
|
coord = "HUD // NOTIFY",
|
|
1164
1198
|
className = ""
|
|
1165
1199
|
}) {
|
|
1166
|
-
const [progress, setProgress] = (0,
|
|
1167
|
-
(0,
|
|
1200
|
+
const [progress, setProgress] = (0, import_react17.useState)(100);
|
|
1201
|
+
(0, import_react17.useEffect)(() => {
|
|
1168
1202
|
if (!isOpen || duration <= 0) return;
|
|
1169
1203
|
setProgress(100);
|
|
1170
1204
|
const startTime = Date.now();
|
|
@@ -1270,9 +1304,9 @@ function BottomBar({
|
|
|
1270
1304
|
}
|
|
1271
1305
|
|
|
1272
1306
|
// src/components/Slider.tsx
|
|
1273
|
-
var
|
|
1307
|
+
var import_react18 = require("react");
|
|
1274
1308
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1275
|
-
var Slider = (0,
|
|
1309
|
+
var Slider = (0, import_react18.forwardRef)(
|
|
1276
1310
|
({
|
|
1277
1311
|
className = "",
|
|
1278
1312
|
label,
|
|
@@ -1337,9 +1371,9 @@ var Slider = (0, import_react17.forwardRef)(
|
|
|
1337
1371
|
Slider.displayName = "Slider";
|
|
1338
1372
|
|
|
1339
1373
|
// src/components/ColorPicker.tsx
|
|
1340
|
-
var
|
|
1374
|
+
var import_react19 = require("react");
|
|
1341
1375
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1342
|
-
var ColorPicker = (0,
|
|
1376
|
+
var ColorPicker = (0, import_react19.forwardRef)(
|
|
1343
1377
|
({
|
|
1344
1378
|
value,
|
|
1345
1379
|
onChange,
|
|
@@ -1365,9 +1399,9 @@ var ColorPicker = (0, import_react18.forwardRef)(
|
|
|
1365
1399
|
size = "md",
|
|
1366
1400
|
className = ""
|
|
1367
1401
|
}, ref) => {
|
|
1368
|
-
const [isOpen, setIsOpen] = (0,
|
|
1369
|
-
const containerRef = (0,
|
|
1370
|
-
(0,
|
|
1402
|
+
const [isOpen, setIsOpen] = (0, import_react19.useState)(false);
|
|
1403
|
+
const containerRef = (0, import_react19.useRef)(null);
|
|
1404
|
+
(0, import_react19.useEffect)(() => {
|
|
1371
1405
|
const handleOutsideClick = (e) => {
|
|
1372
1406
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
1373
1407
|
setIsOpen(false);
|
|
@@ -1461,9 +1495,9 @@ var ColorPicker = (0, import_react18.forwardRef)(
|
|
|
1461
1495
|
ColorPicker.displayName = "ColorPicker";
|
|
1462
1496
|
|
|
1463
1497
|
// src/components/DropdownMenu.tsx
|
|
1464
|
-
var
|
|
1498
|
+
var import_react20 = require("react");
|
|
1465
1499
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1466
|
-
var DropdownMenu = (0,
|
|
1500
|
+
var DropdownMenu = (0, import_react20.forwardRef)(
|
|
1467
1501
|
({
|
|
1468
1502
|
trigger,
|
|
1469
1503
|
items,
|
|
@@ -1473,9 +1507,9 @@ var DropdownMenu = (0, import_react19.forwardRef)(
|
|
|
1473
1507
|
className = "",
|
|
1474
1508
|
disabled = false
|
|
1475
1509
|
}, ref) => {
|
|
1476
|
-
const [isOpen, setIsOpen] = (0,
|
|
1477
|
-
const containerRef = (0,
|
|
1478
|
-
(0,
|
|
1510
|
+
const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
|
|
1511
|
+
const containerRef = (0, import_react20.useRef)(null);
|
|
1512
|
+
(0, import_react20.useEffect)(() => {
|
|
1479
1513
|
const handleOutsideClick = (e) => {
|
|
1480
1514
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
1481
1515
|
setIsOpen(false);
|
|
@@ -1557,9 +1591,9 @@ var DropdownMenu = (0, import_react19.forwardRef)(
|
|
|
1557
1591
|
DropdownMenu.displayName = "DropdownMenu";
|
|
1558
1592
|
|
|
1559
1593
|
// src/components/Popover.tsx
|
|
1560
|
-
var
|
|
1594
|
+
var import_react21 = require("react");
|
|
1561
1595
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1562
|
-
var Popover = (0,
|
|
1596
|
+
var Popover = (0, import_react21.forwardRef)(
|
|
1563
1597
|
({
|
|
1564
1598
|
trigger,
|
|
1565
1599
|
children,
|
|
@@ -1573,10 +1607,10 @@ var Popover = (0, import_react20.forwardRef)(
|
|
|
1573
1607
|
onOpenChange,
|
|
1574
1608
|
disabled = false
|
|
1575
1609
|
}, ref) => {
|
|
1576
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
1610
|
+
const [internalOpen, setInternalOpen] = (0, import_react21.useState)(defaultOpen);
|
|
1577
1611
|
const isControlled = controlledOpen !== void 0;
|
|
1578
1612
|
const open = isControlled ? controlledOpen : internalOpen;
|
|
1579
|
-
const containerRef = (0,
|
|
1613
|
+
const containerRef = (0, import_react21.useRef)(null);
|
|
1580
1614
|
const toggleOpen = () => {
|
|
1581
1615
|
if (disabled) return;
|
|
1582
1616
|
const next = !open;
|
|
@@ -1591,7 +1625,7 @@ var Popover = (0, import_react20.forwardRef)(
|
|
|
1591
1625
|
}
|
|
1592
1626
|
onOpenChange?.(false);
|
|
1593
1627
|
};
|
|
1594
|
-
(0,
|
|
1628
|
+
(0, import_react21.useEffect)(() => {
|
|
1595
1629
|
const handleOutsideClick = (e) => {
|
|
1596
1630
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
1597
1631
|
handleClose();
|