@krpkg/ui 0.3.1 → 0.4.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/dist/index.css +507 -4
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +66 -1
- package/dist/index.d.ts +66 -1
- package/dist/index.js +399 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +392 -44
- package/dist/index.mjs.map +1 -1
- package/dist/native.d.mts +13 -1
- package/dist/native.d.ts +13 -1
- package/dist/native.js +114 -0
- package/dist/native.js.map +1 -1
- package/dist/native.mjs +113 -0
- package/dist/native.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25,15 +25,19 @@ __export(src_exports, {
|
|
|
25
25
|
BracketCard: () => BracketCard,
|
|
26
26
|
Breadcrumbs: () => Breadcrumbs,
|
|
27
27
|
Button: () => Button,
|
|
28
|
+
ColorPicker: () => ColorPicker,
|
|
28
29
|
CornerFrame: () => CornerFrame,
|
|
29
30
|
CyberSwitch: () => CyberSwitch,
|
|
30
31
|
Dot: () => Dot,
|
|
32
|
+
DropdownMenu: () => DropdownMenu,
|
|
31
33
|
HudModal: () => HudModal,
|
|
32
34
|
HudToast: () => HudToast,
|
|
33
35
|
Input: () => Input,
|
|
34
36
|
KeyValGrid: () => KeyValGrid,
|
|
35
37
|
Logo: () => Logo,
|
|
38
|
+
Popover: () => Popover,
|
|
36
39
|
SegmentedControl: () => SegmentedControl,
|
|
40
|
+
Slider: () => Slider,
|
|
37
41
|
SpoilerGate: () => SpoilerGate,
|
|
38
42
|
StickyNote: () => StickyNote,
|
|
39
43
|
TacticalDrawer: () => TacticalDrawer,
|
|
@@ -873,57 +877,27 @@ var TerminalWindow = (0, import_react14.forwardRef)(
|
|
|
873
877
|
TerminalWindow.displayName = "TerminalWindow";
|
|
874
878
|
|
|
875
879
|
// src/components/Tooltip.tsx
|
|
876
|
-
var import_react15 = require("react");
|
|
877
880
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
878
881
|
var Tooltip = ({
|
|
879
882
|
content,
|
|
880
883
|
children,
|
|
881
884
|
position = "top",
|
|
882
885
|
coord,
|
|
886
|
+
shortcut,
|
|
883
887
|
className = ""
|
|
884
888
|
}) => {
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
}
|
|
895
|
-
};
|
|
896
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
897
|
-
"div",
|
|
898
|
-
{
|
|
899
|
-
className: "kz-tooltip-wrapper",
|
|
900
|
-
onMouseEnter: show,
|
|
901
|
-
onMouseLeave: hide,
|
|
902
|
-
onFocus: show,
|
|
903
|
-
onBlur: hide,
|
|
904
|
-
children: [
|
|
905
|
-
children,
|
|
906
|
-
isVisible && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
907
|
-
"div",
|
|
908
|
-
{
|
|
909
|
-
role: "tooltip",
|
|
910
|
-
className: `kz-tooltip-box kz-tooltip-${position} ${className}`,
|
|
911
|
-
children: [
|
|
912
|
-
coord && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "kz-tooltip-coord", children: [
|
|
913
|
-
"[",
|
|
914
|
-
coord,
|
|
915
|
-
"]"
|
|
916
|
-
] }),
|
|
917
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "kz-tooltip-content", children: content }),
|
|
918
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "kz-tooltip-arrow" })
|
|
919
|
-
]
|
|
920
|
-
}
|
|
921
|
-
)
|
|
922
|
-
]
|
|
923
|
-
}
|
|
924
|
-
);
|
|
889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: `kz-tooltip-wrapper ${className}`, children: [
|
|
890
|
+
children,
|
|
891
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: `kz-tooltip-bubble kz-tooltip-${position}`, children: [
|
|
892
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "kz-tooltip-content", children: [
|
|
893
|
+
coord && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "kz-tooltip-coord", children: coord }),
|
|
894
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "kz-tooltip-text", children: content }),
|
|
895
|
+
shortcut && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("kbd", { className: "kz-tooltip-shortcut", children: shortcut })
|
|
896
|
+
] }),
|
|
897
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "kz-tooltip-arrow" })
|
|
898
|
+
] })
|
|
899
|
+
] });
|
|
925
900
|
};
|
|
926
|
-
Tooltip.displayName = "Tooltip";
|
|
927
901
|
|
|
928
902
|
// src/components/SegmentedControl.tsx
|
|
929
903
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
@@ -1115,7 +1089,7 @@ function Breadcrumbs({
|
|
|
1115
1089
|
}
|
|
1116
1090
|
|
|
1117
1091
|
// src/components/TacticalDrawer.tsx
|
|
1118
|
-
var
|
|
1092
|
+
var import_react15 = require("react");
|
|
1119
1093
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1120
1094
|
function TacticalDrawer({
|
|
1121
1095
|
isOpen,
|
|
@@ -1127,7 +1101,7 @@ function TacticalDrawer({
|
|
|
1127
1101
|
position = "bottom",
|
|
1128
1102
|
className = ""
|
|
1129
1103
|
}) {
|
|
1130
|
-
(0,
|
|
1104
|
+
(0, import_react15.useEffect)(() => {
|
|
1131
1105
|
if (!isOpen) return;
|
|
1132
1106
|
const handleKeyDown = (e) => {
|
|
1133
1107
|
if (e.key === "Escape") onClose();
|
|
@@ -1177,7 +1151,7 @@ function TacticalDrawer({
|
|
|
1177
1151
|
}
|
|
1178
1152
|
|
|
1179
1153
|
// src/components/HudToast.tsx
|
|
1180
|
-
var
|
|
1154
|
+
var import_react16 = require("react");
|
|
1181
1155
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1182
1156
|
function HudToast({
|
|
1183
1157
|
isOpen,
|
|
@@ -1189,8 +1163,8 @@ function HudToast({
|
|
|
1189
1163
|
coord = "HUD // NOTIFY",
|
|
1190
1164
|
className = ""
|
|
1191
1165
|
}) {
|
|
1192
|
-
const [progress, setProgress] = (0,
|
|
1193
|
-
(0,
|
|
1166
|
+
const [progress, setProgress] = (0, import_react16.useState)(100);
|
|
1167
|
+
(0, import_react16.useEffect)(() => {
|
|
1194
1168
|
if (!isOpen || duration <= 0) return;
|
|
1195
1169
|
setProgress(100);
|
|
1196
1170
|
const startTime = Date.now();
|
|
@@ -1294,6 +1268,380 @@ function BottomBar({
|
|
|
1294
1268
|
}
|
|
1295
1269
|
);
|
|
1296
1270
|
}
|
|
1271
|
+
|
|
1272
|
+
// src/components/Slider.tsx
|
|
1273
|
+
var import_react17 = require("react");
|
|
1274
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1275
|
+
var Slider = (0, import_react17.forwardRef)(
|
|
1276
|
+
({
|
|
1277
|
+
className = "",
|
|
1278
|
+
label,
|
|
1279
|
+
sublabel,
|
|
1280
|
+
coord,
|
|
1281
|
+
showValue = true,
|
|
1282
|
+
valueFormatter,
|
|
1283
|
+
sliderSize = "md",
|
|
1284
|
+
variant = "accent",
|
|
1285
|
+
fullWidth = true,
|
|
1286
|
+
min = 0,
|
|
1287
|
+
max = 100,
|
|
1288
|
+
value,
|
|
1289
|
+
defaultValue,
|
|
1290
|
+
disabled,
|
|
1291
|
+
...props
|
|
1292
|
+
}, ref) => {
|
|
1293
|
+
const currentVal = Number(value !== void 0 ? value : defaultValue !== void 0 ? defaultValue : min);
|
|
1294
|
+
const minVal = Number(min);
|
|
1295
|
+
const maxVal = Number(max);
|
|
1296
|
+
const pct = Math.max(0, Math.min(100, (currentVal - minVal) / (maxVal - minVal || 1) * 100));
|
|
1297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1298
|
+
"div",
|
|
1299
|
+
{
|
|
1300
|
+
className: [
|
|
1301
|
+
"kz-slider-wrapper",
|
|
1302
|
+
`kz-slider-${sliderSize}`,
|
|
1303
|
+
`kz-slider-${variant}`,
|
|
1304
|
+
fullWidth ? "kz-slider-full" : "",
|
|
1305
|
+
disabled ? "kz-slider-disabled" : "",
|
|
1306
|
+
className
|
|
1307
|
+
].filter(Boolean).join(" "),
|
|
1308
|
+
children: [
|
|
1309
|
+
(label || sublabel || showValue || coord) && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "kz-slider-header", children: [
|
|
1310
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "kz-slider-label-group", children: [
|
|
1311
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("label", { className: "kz-slider-label", children: label }),
|
|
1312
|
+
sublabel && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "kz-slider-sublabel", children: sublabel }),
|
|
1313
|
+
coord && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "kz-slider-coord", children: coord })
|
|
1314
|
+
] }),
|
|
1315
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "kz-slider-value", children: valueFormatter ? valueFormatter(currentVal) : currentVal })
|
|
1316
|
+
] }),
|
|
1317
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "kz-slider-track-container", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1318
|
+
"input",
|
|
1319
|
+
{
|
|
1320
|
+
ref,
|
|
1321
|
+
type: "range",
|
|
1322
|
+
min,
|
|
1323
|
+
max,
|
|
1324
|
+
value,
|
|
1325
|
+
defaultValue,
|
|
1326
|
+
disabled,
|
|
1327
|
+
className: "kz-slider-input",
|
|
1328
|
+
style: { "--kz-slider-pct": `${pct}%` },
|
|
1329
|
+
...props
|
|
1330
|
+
}
|
|
1331
|
+
) })
|
|
1332
|
+
]
|
|
1333
|
+
}
|
|
1334
|
+
);
|
|
1335
|
+
}
|
|
1336
|
+
);
|
|
1337
|
+
Slider.displayName = "Slider";
|
|
1338
|
+
|
|
1339
|
+
// src/components/ColorPicker.tsx
|
|
1340
|
+
var import_react18 = require("react");
|
|
1341
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1342
|
+
var ColorPicker = (0, import_react18.forwardRef)(
|
|
1343
|
+
({
|
|
1344
|
+
value,
|
|
1345
|
+
onChange,
|
|
1346
|
+
presets = [
|
|
1347
|
+
"#000000",
|
|
1348
|
+
"#ffffff",
|
|
1349
|
+
"#c49368",
|
|
1350
|
+
"#6a9e9e",
|
|
1351
|
+
"#a855f7",
|
|
1352
|
+
"#3b82f6",
|
|
1353
|
+
"#22c55e",
|
|
1354
|
+
"#ef4444",
|
|
1355
|
+
"#eab308",
|
|
1356
|
+
"#ec4899",
|
|
1357
|
+
"#64748b",
|
|
1358
|
+
"#1e293b"
|
|
1359
|
+
],
|
|
1360
|
+
label,
|
|
1361
|
+
sublabel,
|
|
1362
|
+
coord,
|
|
1363
|
+
showHexInput = true,
|
|
1364
|
+
disabled = false,
|
|
1365
|
+
size = "md",
|
|
1366
|
+
className = ""
|
|
1367
|
+
}, ref) => {
|
|
1368
|
+
const [isOpen, setIsOpen] = (0, import_react18.useState)(false);
|
|
1369
|
+
const containerRef = (0, import_react18.useRef)(null);
|
|
1370
|
+
(0, import_react18.useEffect)(() => {
|
|
1371
|
+
const handleOutsideClick = (e) => {
|
|
1372
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
1373
|
+
setIsOpen(false);
|
|
1374
|
+
}
|
|
1375
|
+
};
|
|
1376
|
+
if (isOpen) {
|
|
1377
|
+
document.addEventListener("mousedown", handleOutsideClick);
|
|
1378
|
+
}
|
|
1379
|
+
return () => {
|
|
1380
|
+
document.removeEventListener("mousedown", handleOutsideClick);
|
|
1381
|
+
};
|
|
1382
|
+
}, [isOpen]);
|
|
1383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1384
|
+
"div",
|
|
1385
|
+
{
|
|
1386
|
+
ref: containerRef,
|
|
1387
|
+
className: [
|
|
1388
|
+
"kz-color-picker",
|
|
1389
|
+
`kz-color-picker-${size}`,
|
|
1390
|
+
disabled ? "kz-color-picker-disabled" : "",
|
|
1391
|
+
className
|
|
1392
|
+
].filter(Boolean).join(" "),
|
|
1393
|
+
children: [
|
|
1394
|
+
(label || sublabel || coord) && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "kz-color-picker-header", children: [
|
|
1395
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "kz-color-picker-label-group", children: [
|
|
1396
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { className: "kz-color-picker-label", children: label }),
|
|
1397
|
+
sublabel && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kz-color-picker-sublabel", children: sublabel }),
|
|
1398
|
+
coord && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kz-color-picker-coord", children: coord })
|
|
1399
|
+
] }),
|
|
1400
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kz-color-picker-hex", children: value.toUpperCase() })
|
|
1401
|
+
] }),
|
|
1402
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "kz-color-picker-trigger-row", ref, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1403
|
+
"button",
|
|
1404
|
+
{
|
|
1405
|
+
type: "button",
|
|
1406
|
+
disabled,
|
|
1407
|
+
className: "kz-color-picker-swatch-trigger",
|
|
1408
|
+
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
1409
|
+
"aria-label": label || "Select color",
|
|
1410
|
+
children: [
|
|
1411
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kz-color-picker-swatch-preview", style: { backgroundColor: value } }),
|
|
1412
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kz-color-picker-swatch-val", children: value }),
|
|
1413
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kz-color-picker-caret", children: "\u25BC" })
|
|
1414
|
+
]
|
|
1415
|
+
}
|
|
1416
|
+
) }),
|
|
1417
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "kz-color-picker-popover", children: [
|
|
1418
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "kz-color-picker-palette", children: presets.map((color) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1419
|
+
"button",
|
|
1420
|
+
{
|
|
1421
|
+
type: "button",
|
|
1422
|
+
className: [
|
|
1423
|
+
"kz-color-picker-palette-btn",
|
|
1424
|
+
value.toLowerCase() === color.toLowerCase() ? "active" : ""
|
|
1425
|
+
].filter(Boolean).join(" "),
|
|
1426
|
+
style: { backgroundColor: color },
|
|
1427
|
+
onClick: () => {
|
|
1428
|
+
onChange(color);
|
|
1429
|
+
},
|
|
1430
|
+
title: color
|
|
1431
|
+
},
|
|
1432
|
+
color
|
|
1433
|
+
)) }),
|
|
1434
|
+
showHexInput && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "kz-color-picker-custom-input", children: [
|
|
1435
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1436
|
+
"input",
|
|
1437
|
+
{
|
|
1438
|
+
type: "color",
|
|
1439
|
+
value: value.startsWith("#") && value.length === 7 ? value : "#000000",
|
|
1440
|
+
onChange: (e) => onChange(e.target.value),
|
|
1441
|
+
className: "kz-color-picker-native-input"
|
|
1442
|
+
}
|
|
1443
|
+
),
|
|
1444
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1445
|
+
"input",
|
|
1446
|
+
{
|
|
1447
|
+
type: "text",
|
|
1448
|
+
value,
|
|
1449
|
+
onChange: (e) => onChange(e.target.value),
|
|
1450
|
+
placeholder: "#000000",
|
|
1451
|
+
className: "kz-color-picker-text-input"
|
|
1452
|
+
}
|
|
1453
|
+
)
|
|
1454
|
+
] })
|
|
1455
|
+
] })
|
|
1456
|
+
]
|
|
1457
|
+
}
|
|
1458
|
+
);
|
|
1459
|
+
}
|
|
1460
|
+
);
|
|
1461
|
+
ColorPicker.displayName = "ColorPicker";
|
|
1462
|
+
|
|
1463
|
+
// src/components/DropdownMenu.tsx
|
|
1464
|
+
var import_react19 = require("react");
|
|
1465
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1466
|
+
var DropdownMenu = (0, import_react19.forwardRef)(
|
|
1467
|
+
({
|
|
1468
|
+
trigger,
|
|
1469
|
+
items,
|
|
1470
|
+
title,
|
|
1471
|
+
coord,
|
|
1472
|
+
align = "left",
|
|
1473
|
+
className = "",
|
|
1474
|
+
disabled = false
|
|
1475
|
+
}, ref) => {
|
|
1476
|
+
const [isOpen, setIsOpen] = (0, import_react19.useState)(false);
|
|
1477
|
+
const containerRef = (0, import_react19.useRef)(null);
|
|
1478
|
+
(0, import_react19.useEffect)(() => {
|
|
1479
|
+
const handleOutsideClick = (e) => {
|
|
1480
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
1481
|
+
setIsOpen(false);
|
|
1482
|
+
}
|
|
1483
|
+
};
|
|
1484
|
+
if (isOpen) {
|
|
1485
|
+
document.addEventListener("mousedown", handleOutsideClick);
|
|
1486
|
+
}
|
|
1487
|
+
return () => {
|
|
1488
|
+
document.removeEventListener("mousedown", handleOutsideClick);
|
|
1489
|
+
};
|
|
1490
|
+
}, [isOpen]);
|
|
1491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1492
|
+
"div",
|
|
1493
|
+
{
|
|
1494
|
+
ref: containerRef,
|
|
1495
|
+
className: ["kz-dropdown-container", className].filter(Boolean).join(" "),
|
|
1496
|
+
children: [
|
|
1497
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1498
|
+
"div",
|
|
1499
|
+
{
|
|
1500
|
+
ref,
|
|
1501
|
+
className: "kz-dropdown-trigger-wrapper",
|
|
1502
|
+
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
1503
|
+
children: trigger
|
|
1504
|
+
}
|
|
1505
|
+
),
|
|
1506
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1507
|
+
"div",
|
|
1508
|
+
{
|
|
1509
|
+
className: [
|
|
1510
|
+
"kz-dropdown-menu",
|
|
1511
|
+
`align-${align}`
|
|
1512
|
+
].filter(Boolean).join(" "),
|
|
1513
|
+
children: [
|
|
1514
|
+
(title || coord) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "kz-dropdown-header", children: [
|
|
1515
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "kz-dropdown-title", children: title }),
|
|
1516
|
+
coord && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "kz-dropdown-coord", children: coord })
|
|
1517
|
+
] }),
|
|
1518
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "kz-dropdown-list", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1519
|
+
"button",
|
|
1520
|
+
{
|
|
1521
|
+
type: "button",
|
|
1522
|
+
disabled: item.disabled,
|
|
1523
|
+
className: [
|
|
1524
|
+
"kz-dropdown-item",
|
|
1525
|
+
item.danger ? "danger" : "",
|
|
1526
|
+
item.disabled ? "disabled" : ""
|
|
1527
|
+
].filter(Boolean).join(" "),
|
|
1528
|
+
onClick: () => {
|
|
1529
|
+
if (item.disabled) return;
|
|
1530
|
+
item.onClick?.();
|
|
1531
|
+
setIsOpen(false);
|
|
1532
|
+
},
|
|
1533
|
+
children: [
|
|
1534
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "kz-dropdown-item-left", children: [
|
|
1535
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "kz-dropdown-item-icon", children: item.icon }),
|
|
1536
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "kz-dropdown-item-text", children: [
|
|
1537
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "kz-dropdown-item-label", children: item.label }),
|
|
1538
|
+
item.sublabel && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "kz-dropdown-item-sublabel", children: item.sublabel })
|
|
1539
|
+
] })
|
|
1540
|
+
] }),
|
|
1541
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "kz-dropdown-item-right", children: [
|
|
1542
|
+
item.shortcut && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "kz-dropdown-item-shortcut", children: item.shortcut }),
|
|
1543
|
+
item.badge !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "kz-dropdown-item-badge", children: item.badge })
|
|
1544
|
+
] })
|
|
1545
|
+
]
|
|
1546
|
+
},
|
|
1547
|
+
item.id
|
|
1548
|
+
)) })
|
|
1549
|
+
]
|
|
1550
|
+
}
|
|
1551
|
+
)
|
|
1552
|
+
]
|
|
1553
|
+
}
|
|
1554
|
+
);
|
|
1555
|
+
}
|
|
1556
|
+
);
|
|
1557
|
+
DropdownMenu.displayName = "DropdownMenu";
|
|
1558
|
+
|
|
1559
|
+
// src/components/Popover.tsx
|
|
1560
|
+
var import_react20 = require("react");
|
|
1561
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1562
|
+
var Popover = (0, import_react20.forwardRef)(
|
|
1563
|
+
({
|
|
1564
|
+
trigger,
|
|
1565
|
+
children,
|
|
1566
|
+
title,
|
|
1567
|
+
coord,
|
|
1568
|
+
align = "center",
|
|
1569
|
+
position = "bottom",
|
|
1570
|
+
className = "",
|
|
1571
|
+
isOpen: controlledOpen,
|
|
1572
|
+
defaultOpen = false,
|
|
1573
|
+
onOpenChange,
|
|
1574
|
+
disabled = false
|
|
1575
|
+
}, ref) => {
|
|
1576
|
+
const [internalOpen, setInternalOpen] = (0, import_react20.useState)(defaultOpen);
|
|
1577
|
+
const isControlled = controlledOpen !== void 0;
|
|
1578
|
+
const open = isControlled ? controlledOpen : internalOpen;
|
|
1579
|
+
const containerRef = (0, import_react20.useRef)(null);
|
|
1580
|
+
const toggleOpen = () => {
|
|
1581
|
+
if (disabled) return;
|
|
1582
|
+
const next = !open;
|
|
1583
|
+
if (!isControlled) {
|
|
1584
|
+
setInternalOpen(next);
|
|
1585
|
+
}
|
|
1586
|
+
onOpenChange?.(next);
|
|
1587
|
+
};
|
|
1588
|
+
const handleClose = () => {
|
|
1589
|
+
if (!isControlled) {
|
|
1590
|
+
setInternalOpen(false);
|
|
1591
|
+
}
|
|
1592
|
+
onOpenChange?.(false);
|
|
1593
|
+
};
|
|
1594
|
+
(0, import_react20.useEffect)(() => {
|
|
1595
|
+
const handleOutsideClick = (e) => {
|
|
1596
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
1597
|
+
handleClose();
|
|
1598
|
+
}
|
|
1599
|
+
};
|
|
1600
|
+
if (open) {
|
|
1601
|
+
document.addEventListener("mousedown", handleOutsideClick);
|
|
1602
|
+
}
|
|
1603
|
+
return () => {
|
|
1604
|
+
document.removeEventListener("mousedown", handleOutsideClick);
|
|
1605
|
+
};
|
|
1606
|
+
}, [open]);
|
|
1607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1608
|
+
"div",
|
|
1609
|
+
{
|
|
1610
|
+
ref: containerRef,
|
|
1611
|
+
className: ["kz-popover-container", className].filter(Boolean).join(" "),
|
|
1612
|
+
children: [
|
|
1613
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1614
|
+
"div",
|
|
1615
|
+
{
|
|
1616
|
+
ref,
|
|
1617
|
+
className: "kz-popover-trigger-wrapper",
|
|
1618
|
+
onClick: toggleOpen,
|
|
1619
|
+
children: trigger
|
|
1620
|
+
}
|
|
1621
|
+
),
|
|
1622
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1623
|
+
"div",
|
|
1624
|
+
{
|
|
1625
|
+
className: [
|
|
1626
|
+
"kz-popover-content",
|
|
1627
|
+
`pos-${position}`,
|
|
1628
|
+
`align-${align}`
|
|
1629
|
+
].filter(Boolean).join(" "),
|
|
1630
|
+
children: [
|
|
1631
|
+
(title || coord) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "kz-popover-header", children: [
|
|
1632
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "kz-popover-title", children: title }),
|
|
1633
|
+
coord && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "kz-popover-coord", children: coord })
|
|
1634
|
+
] }),
|
|
1635
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "kz-popover-body", children })
|
|
1636
|
+
]
|
|
1637
|
+
}
|
|
1638
|
+
)
|
|
1639
|
+
]
|
|
1640
|
+
}
|
|
1641
|
+
);
|
|
1642
|
+
}
|
|
1643
|
+
);
|
|
1644
|
+
Popover.displayName = "Popover";
|
|
1297
1645
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1298
1646
|
0 && (module.exports = {
|
|
1299
1647
|
Badge,
|
|
@@ -1301,15 +1649,19 @@ function BottomBar({
|
|
|
1301
1649
|
BracketCard,
|
|
1302
1650
|
Breadcrumbs,
|
|
1303
1651
|
Button,
|
|
1652
|
+
ColorPicker,
|
|
1304
1653
|
CornerFrame,
|
|
1305
1654
|
CyberSwitch,
|
|
1306
1655
|
Dot,
|
|
1656
|
+
DropdownMenu,
|
|
1307
1657
|
HudModal,
|
|
1308
1658
|
HudToast,
|
|
1309
1659
|
Input,
|
|
1310
1660
|
KeyValGrid,
|
|
1311
1661
|
Logo,
|
|
1662
|
+
Popover,
|
|
1312
1663
|
SegmentedControl,
|
|
1664
|
+
Slider,
|
|
1313
1665
|
SpoilerGate,
|
|
1314
1666
|
StickyNote,
|
|
1315
1667
|
TacticalDrawer,
|