@helpwave/hightide 0.1.0 → 0.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/dist/coloring/shading.cjs +106 -100
- package/dist/coloring/shading.cjs.map +1 -1
- package/dist/coloring/shading.js +108 -102
- package/dist/coloring/shading.js.map +1 -1
- package/dist/components/{modals → dialogs}/ConfirmDialog.cjs +187 -31
- package/dist/components/dialogs/ConfirmDialog.cjs.map +1 -0
- package/dist/components/{modals → dialogs}/ConfirmDialog.d.cts +7 -8
- package/dist/components/{modals → dialogs}/ConfirmDialog.d.ts +7 -8
- package/dist/components/{modals → dialogs}/ConfirmDialog.js +186 -30
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -0
- package/dist/components/layout-and-navigation/Overlay.cjs +11 -18
- package/dist/components/layout-and-navigation/Overlay.cjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.d.cts +14 -9
- package/dist/components/layout-and-navigation/Overlay.d.ts +14 -9
- package/dist/components/layout-and-navigation/Overlay.js +9 -16
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/modals/ConfirmModal.cjs +524 -0
- package/dist/components/modals/ConfirmModal.cjs.map +1 -0
- package/dist/components/modals/ConfirmModal.d.cts +36 -0
- package/dist/components/modals/ConfirmModal.d.ts +36 -0
- package/dist/components/modals/ConfirmModal.js +487 -0
- package/dist/components/modals/ConfirmModal.js.map +1 -0
- package/dist/components/modals/DiscardChangesModal.cjs +126 -59
- package/dist/components/modals/DiscardChangesModal.cjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.d.cts +4 -2
- package/dist/components/modals/DiscardChangesModal.d.ts +4 -2
- package/dist/components/modals/DiscardChangesModal.js +125 -58
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/InputModal.cjs +186 -30
- package/dist/components/modals/InputModal.cjs.map +1 -1
- package/dist/components/modals/InputModal.d.cts +1 -1
- package/dist/components/modals/InputModal.d.ts +1 -1
- package/dist/components/modals/InputModal.js +186 -30
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.cjs +5 -5
- package/dist/components/modals/LanguageModal.cjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +5 -5
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.cjs +5 -5
- package/dist/components/modals/ThemeModal.cjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +5 -5
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/css/globals.css +8 -4
- package/dist/css/uncompiled/globals.css +8 -5
- package/dist/index.cjs +1726 -1675
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1693 -1643
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/dist/components/modals/ConfirmDialog.cjs.map +0 -1
- package/dist/components/modals/ConfirmDialog.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1336,1504 +1336,1555 @@ var TimePickerUncontrolled = ({
|
|
|
1336
1336
|
);
|
|
1337
1337
|
};
|
|
1338
1338
|
|
|
1339
|
-
// src/components/
|
|
1340
|
-
import
|
|
1341
|
-
import clsx10 from "clsx";
|
|
1342
|
-
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1343
|
-
var avtarSizeList = ["tiny", "small", "medium", "large"];
|
|
1344
|
-
var avatarSizeMapping = {
|
|
1345
|
-
tiny: 24,
|
|
1346
|
-
small: 32,
|
|
1347
|
-
medium: 48,
|
|
1348
|
-
large: 64
|
|
1349
|
-
};
|
|
1350
|
-
var Avatar = ({ avatarUrl, alt, size = "medium", className = "" }) => {
|
|
1351
|
-
avatarUrl = "https://cdn.helpwave.de/boringavatar.svg";
|
|
1352
|
-
const avtarSize = {
|
|
1353
|
-
tiny: 24,
|
|
1354
|
-
small: 32,
|
|
1355
|
-
medium: 48,
|
|
1356
|
-
large: 64
|
|
1357
|
-
}[size];
|
|
1358
|
-
const style = {
|
|
1359
|
-
width: avtarSize + "px",
|
|
1360
|
-
height: avtarSize + "px",
|
|
1361
|
-
maxWidth: avtarSize + "px",
|
|
1362
|
-
maxHeight: avtarSize + "px",
|
|
1363
|
-
minWidth: avtarSize + "px",
|
|
1364
|
-
minHeight: avtarSize + "px"
|
|
1365
|
-
};
|
|
1366
|
-
return (
|
|
1367
|
-
// TODO transparent or white background later
|
|
1368
|
-
/* @__PURE__ */ jsx12("div", { className: clsx10(`rounded-full bg-primary`, className), style, children: /* @__PURE__ */ jsx12(
|
|
1369
|
-
Image2,
|
|
1370
|
-
{
|
|
1371
|
-
className: "rounded-full border border-gray-200",
|
|
1372
|
-
style,
|
|
1373
|
-
src: avatarUrl,
|
|
1374
|
-
alt,
|
|
1375
|
-
width: avtarSize,
|
|
1376
|
-
height: avtarSize
|
|
1377
|
-
}
|
|
1378
|
-
) })
|
|
1379
|
-
);
|
|
1380
|
-
};
|
|
1381
|
-
var AvatarGroup = ({
|
|
1382
|
-
avatars,
|
|
1383
|
-
maxShownProfiles = 5,
|
|
1384
|
-
size = "tiny"
|
|
1385
|
-
}) => {
|
|
1386
|
-
const displayedProfiles = avatars.length < maxShownProfiles ? avatars : avatars.slice(0, maxShownProfiles);
|
|
1387
|
-
const diameter = avatarSizeMapping[size];
|
|
1388
|
-
const stackingOverlap = 0.5;
|
|
1389
|
-
const notDisplayedProfiles = avatars.length - maxShownProfiles;
|
|
1390
|
-
const avatarGroupWidth = diameter * (stackingOverlap * (displayedProfiles.length - 1) + 1);
|
|
1391
|
-
return /* @__PURE__ */ jsxs8("div", { className: "row relative", style: { height: diameter + "px" }, children: [
|
|
1392
|
-
/* @__PURE__ */ jsx12("div", { style: { width: avatarGroupWidth + "px" }, children: displayedProfiles.map((avatar, index) => /* @__PURE__ */ jsx12(
|
|
1393
|
-
"div",
|
|
1394
|
-
{
|
|
1395
|
-
className: "absolute",
|
|
1396
|
-
style: { left: index * diameter * stackingOverlap + "px", zIndex: maxShownProfiles - index },
|
|
1397
|
-
children: /* @__PURE__ */ jsx12(Avatar, { avatarUrl: avatar.avatarUrl, alt: avatar.alt, size })
|
|
1398
|
-
},
|
|
1399
|
-
index
|
|
1400
|
-
)) }),
|
|
1401
|
-
notDisplayedProfiles > 0 && /* @__PURE__ */ jsx12(
|
|
1402
|
-
"div",
|
|
1403
|
-
{
|
|
1404
|
-
className: "truncate row items-center",
|
|
1405
|
-
style: { fontSize: diameter / 2 + "px", marginLeft: 1 + diameter / 16 + "px" },
|
|
1406
|
-
children: /* @__PURE__ */ jsxs8("span", { children: [
|
|
1407
|
-
"+ ",
|
|
1408
|
-
notDisplayedProfiles
|
|
1409
|
-
] })
|
|
1410
|
-
}
|
|
1411
|
-
)
|
|
1412
|
-
] });
|
|
1413
|
-
};
|
|
1339
|
+
// src/components/dialogs/ConfirmDialog.tsx
|
|
1340
|
+
import clsx12 from "clsx";
|
|
1414
1341
|
|
|
1415
|
-
// src/components/
|
|
1342
|
+
// src/components/layout-and-navigation/Overlay.tsx
|
|
1343
|
+
import { useEffect as useEffect8, useRef as useRef3, useState as useState9 } from "react";
|
|
1344
|
+
import ReactDOM from "react-dom";
|
|
1416
1345
|
import clsx11 from "clsx";
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
}
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
height: `${size}px`,
|
|
1432
|
-
...style
|
|
1433
|
-
},
|
|
1434
|
-
...restProps
|
|
1346
|
+
|
|
1347
|
+
// src/hooks/useHoverState.ts
|
|
1348
|
+
import { useEffect as useEffect7, useState as useState8 } from "react";
|
|
1349
|
+
var defaultUseHoverStateProps = {
|
|
1350
|
+
closingDelay: 200,
|
|
1351
|
+
isDisabled: false
|
|
1352
|
+
};
|
|
1353
|
+
var useHoverState = (props = void 0) => {
|
|
1354
|
+
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
1355
|
+
const [isHovered, setIsHovered] = useState8(false);
|
|
1356
|
+
const [timer, setTimer] = useState8();
|
|
1357
|
+
const onMouseEnter = () => {
|
|
1358
|
+
if (isDisabled) {
|
|
1359
|
+
return;
|
|
1435
1360
|
}
|
|
1436
|
-
|
|
1361
|
+
clearTimeout(timer);
|
|
1362
|
+
setIsHovered(true);
|
|
1363
|
+
};
|
|
1364
|
+
const onMouseLeave = () => {
|
|
1365
|
+
if (isDisabled) {
|
|
1366
|
+
return;
|
|
1367
|
+
}
|
|
1368
|
+
setTimer(setTimeout(() => {
|
|
1369
|
+
setIsHovered(false);
|
|
1370
|
+
}, closingDelay));
|
|
1371
|
+
};
|
|
1372
|
+
useEffect7(() => {
|
|
1373
|
+
if (timer) {
|
|
1374
|
+
return () => {
|
|
1375
|
+
clearTimeout(timer);
|
|
1376
|
+
};
|
|
1377
|
+
}
|
|
1378
|
+
});
|
|
1379
|
+
useEffect7(() => {
|
|
1380
|
+
if (timer) {
|
|
1381
|
+
clearTimeout(timer);
|
|
1382
|
+
}
|
|
1383
|
+
}, [isDisabled]);
|
|
1384
|
+
return {
|
|
1385
|
+
isHovered,
|
|
1386
|
+
setIsHovered,
|
|
1387
|
+
handlers: { onMouseEnter, onMouseLeave }
|
|
1388
|
+
};
|
|
1437
1389
|
};
|
|
1438
1390
|
|
|
1439
|
-
// src/components/
|
|
1440
|
-
import {
|
|
1441
|
-
import
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1391
|
+
// src/components/user-action/Tooltip.tsx
|
|
1392
|
+
import { clsx as clsx10 } from "clsx";
|
|
1393
|
+
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1394
|
+
var Tooltip = ({
|
|
1395
|
+
tooltip,
|
|
1396
|
+
children,
|
|
1397
|
+
animationDelay = 650,
|
|
1398
|
+
tooltipClassName = "",
|
|
1399
|
+
containerClassName = "",
|
|
1400
|
+
position = "bottom",
|
|
1401
|
+
zIndex = 10
|
|
1447
1402
|
}) => {
|
|
1448
|
-
|
|
1403
|
+
const { isHovered, handlers } = useHoverState();
|
|
1404
|
+
const positionClasses = {
|
|
1405
|
+
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
1406
|
+
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
1407
|
+
left: `right-full top-1/2 -translate-y-1/2 mr-[6px]`,
|
|
1408
|
+
right: `left-full top-1/2 -translate-y-1/2 ml-[6px]`
|
|
1409
|
+
};
|
|
1410
|
+
const triangleSize = 6;
|
|
1411
|
+
const triangleClasses = {
|
|
1412
|
+
top: `top-full left-1/2 -translate-x-1/2 border-t-tooltip-background border-l-transparent border-r-transparent`,
|
|
1413
|
+
bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-tooltip-background border-l-transparent border-r-transparent`,
|
|
1414
|
+
left: `left-full top-1/2 -translate-y-1/2 border-l-tooltip-background border-t-transparent border-b-transparent`,
|
|
1415
|
+
right: `right-full top-1/2 -translate-y-1/2 border-r-tooltip-background border-t-transparent border-b-transparent`
|
|
1416
|
+
};
|
|
1417
|
+
const triangleStyle = {
|
|
1418
|
+
top: { borderWidth: `${triangleSize}px ${triangleSize}px 0 ${triangleSize}px` },
|
|
1419
|
+
bottom: { borderWidth: `0 ${triangleSize}px ${triangleSize}px ${triangleSize}px` },
|
|
1420
|
+
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
1421
|
+
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
1422
|
+
};
|
|
1423
|
+
return /* @__PURE__ */ jsxs8(
|
|
1449
1424
|
"div",
|
|
1450
1425
|
{
|
|
1451
|
-
className:
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1426
|
+
className: clsx10("relative inline-block", containerClassName),
|
|
1427
|
+
...handlers,
|
|
1428
|
+
children: [
|
|
1429
|
+
children,
|
|
1430
|
+
isHovered && /* @__PURE__ */ jsxs8(
|
|
1431
|
+
"div",
|
|
1432
|
+
{
|
|
1433
|
+
className: clsx10(
|
|
1434
|
+
`opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
|
|
1435
|
+
animate-tooltip-fade-in shadow-lg bg-tooltip-background`,
|
|
1436
|
+
positionClasses[position],
|
|
1437
|
+
tooltipClassName
|
|
1438
|
+
),
|
|
1439
|
+
style: { zIndex, animationDelay: animationDelay + "ms" },
|
|
1440
|
+
children: [
|
|
1441
|
+
tooltip,
|
|
1442
|
+
/* @__PURE__ */ jsx12(
|
|
1443
|
+
"div",
|
|
1444
|
+
{
|
|
1445
|
+
className: clsx10(`absolute w-0 h-0`, triangleClasses[position]),
|
|
1446
|
+
style: { ...triangleStyle[position], zIndex }
|
|
1447
|
+
}
|
|
1448
|
+
)
|
|
1449
|
+
]
|
|
1450
|
+
}
|
|
1451
|
+
)
|
|
1452
|
+
]
|
|
1457
1453
|
}
|
|
1458
1454
|
);
|
|
1459
1455
|
};
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1456
|
+
|
|
1457
|
+
// src/components/layout-and-navigation/Overlay.tsx
|
|
1458
|
+
import { X } from "lucide-react";
|
|
1459
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1460
|
+
var Overlay = ({
|
|
1461
|
+
children,
|
|
1462
|
+
isOpen,
|
|
1463
|
+
onBackgroundClick,
|
|
1464
|
+
backgroundClassName
|
|
1468
1465
|
}) => {
|
|
1469
|
-
const [
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
1473
|
-
const newWidth = Math.min(width * progress, width);
|
|
1474
|
-
setCurrentWidth(newWidth);
|
|
1475
|
-
if (progress < 1) {
|
|
1476
|
-
requestAnimationFrame((newTimestamp) => animate(newTimestamp, startTime));
|
|
1477
|
-
} else {
|
|
1478
|
-
onAnimationFinished();
|
|
1479
|
-
if (repeating) {
|
|
1480
|
-
setCurrentWidth(0);
|
|
1481
|
-
requestAnimationFrame((newTimestamp) => animate(newTimestamp, newTimestamp));
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
}, [milliseconds, onAnimationFinished, repeating, width]);
|
|
1485
|
-
useEffect7(() => {
|
|
1486
|
-
if (currentWidth < width) {
|
|
1487
|
-
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
1488
|
-
}
|
|
1466
|
+
const [root, setRoot] = useState9();
|
|
1467
|
+
useEffect8(() => {
|
|
1468
|
+
setRoot(document.body);
|
|
1489
1469
|
}, []);
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
{
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
width: `${innerSize + 2 * width}px`,
|
|
1496
|
-
height: `${innerSize + 2 * width}px`,
|
|
1497
|
-
...style
|
|
1498
|
-
},
|
|
1499
|
-
children: /* @__PURE__ */ jsx14(
|
|
1500
|
-
Ring,
|
|
1470
|
+
if (!root || !isOpen) return null;
|
|
1471
|
+
return ReactDOM.createPortal(
|
|
1472
|
+
/* @__PURE__ */ jsxs9("div", { className: clsx11("fixed inset-0 z-[9999]"), children: [
|
|
1473
|
+
/* @__PURE__ */ jsx13(
|
|
1474
|
+
"div",
|
|
1501
1475
|
{
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
className
|
|
1476
|
+
className: clsx11("fixed inset-0 h-screen w-screen bg-black/30", backgroundClassName),
|
|
1477
|
+
onClick: onBackgroundClick
|
|
1505
1478
|
}
|
|
1506
|
-
)
|
|
1507
|
-
|
|
1479
|
+
),
|
|
1480
|
+
children
|
|
1481
|
+
] }),
|
|
1482
|
+
root
|
|
1508
1483
|
);
|
|
1509
1484
|
};
|
|
1510
|
-
var
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1485
|
+
var overlayStack = [];
|
|
1486
|
+
var defaultModalHeaderTranslation = {
|
|
1487
|
+
en: {
|
|
1488
|
+
close: "Close"
|
|
1489
|
+
},
|
|
1490
|
+
de: {
|
|
1491
|
+
close: "Schlie\xDFen"
|
|
1492
|
+
}
|
|
1493
|
+
};
|
|
1494
|
+
var OverlayHeader = ({
|
|
1495
|
+
overwriteTranslation,
|
|
1496
|
+
onClose,
|
|
1497
|
+
title,
|
|
1498
|
+
titleText = "",
|
|
1499
|
+
description,
|
|
1500
|
+
descriptionText = ""
|
|
1519
1501
|
}) => {
|
|
1520
|
-
const
|
|
1521
|
-
const
|
|
1522
|
-
const
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1502
|
+
const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation);
|
|
1503
|
+
const hasTitleRow = !!title || !!titleText || !!onClose;
|
|
1504
|
+
const titleRow = /* @__PURE__ */ jsxs9("div", { className: "row justify-between items-start gap-x-8", children: [
|
|
1505
|
+
title ?? /* @__PURE__ */ jsx13(
|
|
1506
|
+
"h2",
|
|
1507
|
+
{
|
|
1508
|
+
className: clsx11("textstyle-title-lg", {
|
|
1509
|
+
"mb-1": description || descriptionText
|
|
1510
|
+
}),
|
|
1511
|
+
children: titleText
|
|
1512
|
+
}
|
|
1513
|
+
),
|
|
1514
|
+
!!onClose && /* @__PURE__ */ jsx13(Tooltip, { tooltip: translation.close, children: /* @__PURE__ */ jsx13(IconButton, { color: "neutral", size: "small", onClick: onClose, children: /* @__PURE__ */ jsx13(X, { className: "w-full h-full" }) }) })
|
|
1515
|
+
] });
|
|
1516
|
+
return /* @__PURE__ */ jsxs9("div", { className: "col", children: [
|
|
1517
|
+
hasTitleRow && titleRow,
|
|
1518
|
+
description ?? (descriptionText && /* @__PURE__ */ jsx13("span", { className: "textstyle-description", children: descriptionText }))
|
|
1519
|
+
] });
|
|
1520
|
+
};
|
|
1521
|
+
var Modal = ({
|
|
1522
|
+
children,
|
|
1523
|
+
isOpen,
|
|
1524
|
+
onClose,
|
|
1525
|
+
className,
|
|
1526
|
+
backgroundClassName,
|
|
1527
|
+
headerProps
|
|
1528
|
+
}) => {
|
|
1529
|
+
const ref = useRef3(null);
|
|
1530
|
+
useEffect8(() => {
|
|
1531
|
+
if (!isOpen) return;
|
|
1532
|
+
const modal = ref.current;
|
|
1533
|
+
if (!modal) {
|
|
1534
|
+
console.error("modal open, but no ref found");
|
|
1535
|
+
return;
|
|
1536
|
+
}
|
|
1537
|
+
overlayStack.push(modal);
|
|
1538
|
+
const focusable = modal?.querySelectorAll(
|
|
1539
|
+
'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])'
|
|
1528
1540
|
);
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
if (
|
|
1535
|
-
|
|
1536
|
-
|
|
1541
|
+
const first = focusable[0];
|
|
1542
|
+
const last = focusable[focusable.length - 1];
|
|
1543
|
+
const handleKeyDown = (e) => {
|
|
1544
|
+
const isTopmost = overlayStack[overlayStack.length - 1] === modal;
|
|
1545
|
+
if (!isTopmost) return;
|
|
1546
|
+
if (e.key === "Escape") {
|
|
1547
|
+
e.stopPropagation();
|
|
1548
|
+
onClose();
|
|
1549
|
+
} else if (e.key === "Tab") {
|
|
1550
|
+
if (focusable.length === 0) return;
|
|
1551
|
+
if (e.shiftKey && document.activeElement === first) {
|
|
1552
|
+
e.preventDefault();
|
|
1553
|
+
last.focus();
|
|
1554
|
+
} else if (!e.shiftKey && document.activeElement === last) {
|
|
1555
|
+
e.preventDefault();
|
|
1556
|
+
first.focus();
|
|
1557
|
+
}
|
|
1537
1558
|
}
|
|
1559
|
+
};
|
|
1560
|
+
modal.focus();
|
|
1561
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1562
|
+
return () => {
|
|
1563
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
1564
|
+
overlayStack = overlayStack.filter((m) => m !== modal);
|
|
1565
|
+
};
|
|
1566
|
+
}, [isOpen, onClose]);
|
|
1567
|
+
return /* @__PURE__ */ jsx13(
|
|
1568
|
+
Overlay,
|
|
1569
|
+
{
|
|
1570
|
+
isOpen,
|
|
1571
|
+
onBackgroundClick: onClose,
|
|
1572
|
+
backgroundClassName,
|
|
1573
|
+
children: /* @__PURE__ */ jsxs9(
|
|
1574
|
+
"div",
|
|
1575
|
+
{
|
|
1576
|
+
ref,
|
|
1577
|
+
tabIndex: -1,
|
|
1578
|
+
className: clsx11(
|
|
1579
|
+
"fixed left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 col p-4 bg-overlay-background text-overlay-text rounded-xl shadow-xl",
|
|
1580
|
+
className
|
|
1581
|
+
),
|
|
1582
|
+
role: "dialog",
|
|
1583
|
+
"aria-modal": true,
|
|
1584
|
+
children: [
|
|
1585
|
+
/* @__PURE__ */ jsx13(OverlayHeader, { ...headerProps, onClose }),
|
|
1586
|
+
children
|
|
1587
|
+
]
|
|
1588
|
+
}
|
|
1589
|
+
)
|
|
1538
1590
|
}
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1591
|
+
);
|
|
1592
|
+
};
|
|
1593
|
+
var Dialog = ({
|
|
1594
|
+
children,
|
|
1595
|
+
isOpen,
|
|
1596
|
+
className,
|
|
1597
|
+
backgroundClassName,
|
|
1598
|
+
headerProps
|
|
1599
|
+
}) => {
|
|
1600
|
+
const ref = useRef3(null);
|
|
1601
|
+
useEffect8(() => {
|
|
1602
|
+
if (!isOpen) return;
|
|
1603
|
+
const dialog = ref.current;
|
|
1604
|
+
if (!dialog) {
|
|
1605
|
+
console.error("dialog open, but no ref found");
|
|
1606
|
+
return;
|
|
1543
1607
|
}
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1608
|
+
overlayStack.push(dialog);
|
|
1609
|
+
const focusable = dialog?.querySelectorAll(
|
|
1610
|
+
'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])'
|
|
1611
|
+
);
|
|
1612
|
+
const first = focusable[0];
|
|
1613
|
+
const last = focusable[focusable.length - 1];
|
|
1614
|
+
const handleKeyDown = (e) => {
|
|
1615
|
+
const isTopmost = overlayStack[overlayStack.length - 1] === dialog;
|
|
1616
|
+
if (!isTopmost) return;
|
|
1617
|
+
if (e.key === "Escape") {
|
|
1618
|
+
e.stopPropagation();
|
|
1619
|
+
} else if (e.key === "Tab") {
|
|
1620
|
+
if (focusable.length === 0) return;
|
|
1621
|
+
if (e.shiftKey && document.activeElement === first) {
|
|
1622
|
+
e.preventDefault();
|
|
1623
|
+
last.focus();
|
|
1624
|
+
} else if (!e.shiftKey && document.activeElement === last) {
|
|
1625
|
+
e.preventDefault();
|
|
1626
|
+
first.focus();
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
};
|
|
1630
|
+
dialog.focus();
|
|
1631
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1632
|
+
return () => {
|
|
1633
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
1634
|
+
overlayStack = overlayStack.filter((m) => m !== dialog);
|
|
1635
|
+
};
|
|
1636
|
+
}, [isOpen]);
|
|
1637
|
+
return /* @__PURE__ */ jsx13(
|
|
1638
|
+
Overlay,
|
|
1547
1639
|
{
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
...style
|
|
1553
|
-
},
|
|
1554
|
-
children: /* @__PURE__ */ jsx14(
|
|
1555
|
-
Ring,
|
|
1640
|
+
isOpen,
|
|
1641
|
+
backgroundClassName,
|
|
1642
|
+
children: /* @__PURE__ */ jsxs9(
|
|
1643
|
+
"div",
|
|
1556
1644
|
{
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
className
|
|
1645
|
+
ref,
|
|
1646
|
+
tabIndex: -1,
|
|
1647
|
+
className: clsx11(
|
|
1648
|
+
"fixed left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 col p-4 bg-overlay-background text-overlay-text rounded-xl shadow-xl",
|
|
1649
|
+
className
|
|
1650
|
+
),
|
|
1651
|
+
role: "dialog",
|
|
1652
|
+
"aria-modal": true,
|
|
1653
|
+
children: [
|
|
1654
|
+
!!headerProps && /* @__PURE__ */ jsx13(OverlayHeader, { ...headerProps }),
|
|
1655
|
+
children
|
|
1656
|
+
]
|
|
1560
1657
|
}
|
|
1561
1658
|
)
|
|
1562
1659
|
}
|
|
1563
1660
|
);
|
|
1564
1661
|
};
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1662
|
+
|
|
1663
|
+
// src/components/dialogs/ConfirmDialog.tsx
|
|
1664
|
+
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1665
|
+
var defaultConfirmDialogTranslation = {
|
|
1666
|
+
en: {
|
|
1667
|
+
confirm: "Confirm",
|
|
1668
|
+
decline: "Decline"
|
|
1669
|
+
},
|
|
1670
|
+
de: {
|
|
1671
|
+
confirm: "Best\xE4tigen",
|
|
1672
|
+
decline: "Ablehnen"
|
|
1673
|
+
}
|
|
1674
|
+
};
|
|
1675
|
+
var ConfirmDialog = ({
|
|
1676
|
+
overwriteTranslation,
|
|
1677
|
+
children,
|
|
1678
|
+
onConfirm,
|
|
1679
|
+
onDecline,
|
|
1680
|
+
confirmType = "positive",
|
|
1681
|
+
buttonOverwrites,
|
|
1682
|
+
className,
|
|
1683
|
+
...restProps
|
|
1574
1684
|
}) => {
|
|
1575
|
-
const
|
|
1576
|
-
const
|
|
1577
|
-
|
|
1578
|
-
"
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
{ "opacity-5": currentRing !== 0 }
|
|
1607
|
-
),
|
|
1608
|
-
style: {
|
|
1609
|
-
left: `${size / 2}px`,
|
|
1610
|
-
top: `${size / 2}px`,
|
|
1611
|
-
position: "absolute",
|
|
1612
|
-
translate: `-50% -50%`,
|
|
1613
|
-
zIndex: 9
|
|
1614
|
-
}
|
|
1615
|
-
}
|
|
1616
|
-
) : null,
|
|
1617
|
-
currentRing === 2 ? /* @__PURE__ */ jsx14(
|
|
1618
|
-
RingWave,
|
|
1619
|
-
{
|
|
1620
|
-
startInnerSize: sizeCircle1 - waveWidth,
|
|
1621
|
-
endInnerSize: sizeCircle2,
|
|
1622
|
-
width: waveWidth,
|
|
1623
|
-
repeating: true,
|
|
1624
|
-
className: clsx12(waveBaseColor, `opacity-5`),
|
|
1625
|
-
style: {
|
|
1626
|
-
left: `${size / 2}px`,
|
|
1627
|
-
top: `${size / 2}px`,
|
|
1628
|
-
position: "absolute",
|
|
1629
|
-
translate: `-50% -50%`,
|
|
1630
|
-
zIndex: 9
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
) : null,
|
|
1634
|
-
/* @__PURE__ */ jsx14(
|
|
1635
|
-
Circle,
|
|
1636
|
-
{
|
|
1637
|
-
radius: sizeCircle2 / 2,
|
|
1638
|
-
className: clsx12(
|
|
1639
|
-
circle2ClassName,
|
|
1640
|
-
{ "opacity-20": currentRing < 1 },
|
|
1641
|
-
`absolute z-[8] -translate-y-1/2 -translate-x-1/2`
|
|
1642
|
-
),
|
|
1643
|
-
style: {
|
|
1644
|
-
left: `${size / 2}px`,
|
|
1645
|
-
top: `${size / 2}px`
|
|
1646
|
-
}
|
|
1647
|
-
}
|
|
1648
|
-
),
|
|
1649
|
-
currentRing === 1 ? /* @__PURE__ */ jsx14(
|
|
1650
|
-
AnimatedRing,
|
|
1651
|
-
{
|
|
1652
|
-
innerSize: sizeCircle2 - 1,
|
|
1653
|
-
width: (sizeCircle3 - sizeCircle2) / 2,
|
|
1654
|
-
onAnimationFinished: () => currentRing === 1 ? setCurrentRing(2) : null,
|
|
1655
|
-
repeating: true,
|
|
1656
|
-
className: clsx12(circle3ClassName),
|
|
1657
|
-
style: {
|
|
1658
|
-
left: `${size / 2}px`,
|
|
1659
|
-
top: `${size / 2}px`,
|
|
1660
|
-
position: "absolute",
|
|
1661
|
-
translate: `-50% -50%`,
|
|
1662
|
-
zIndex: 7
|
|
1663
|
-
}
|
|
1664
|
-
}
|
|
1665
|
-
) : null,
|
|
1666
|
-
currentRing === 2 ? /* @__PURE__ */ jsx14(
|
|
1667
|
-
RingWave,
|
|
1668
|
-
{
|
|
1669
|
-
startInnerSize: sizeCircle2,
|
|
1670
|
-
endInnerSize: sizeCircle3 - waveWidth,
|
|
1671
|
-
width: waveWidth,
|
|
1672
|
-
repeating: true,
|
|
1673
|
-
className: clsx12(waveBaseColor, `opacity-5`),
|
|
1674
|
-
style: {
|
|
1675
|
-
left: `${size / 2}px`,
|
|
1676
|
-
top: `${size / 2}px`,
|
|
1677
|
-
position: "absolute",
|
|
1678
|
-
translate: `-50% -50%`,
|
|
1679
|
-
zIndex: 7
|
|
1680
|
-
}
|
|
1681
|
-
}
|
|
1682
|
-
) : null,
|
|
1683
|
-
/* @__PURE__ */ jsx14(
|
|
1684
|
-
Circle,
|
|
1685
|
-
{
|
|
1686
|
-
radius: sizeCircle3 / 2,
|
|
1687
|
-
className: clsx12(
|
|
1688
|
-
circle3ClassName,
|
|
1689
|
-
{ "opacity-20": currentRing < 2 },
|
|
1690
|
-
`absolute z-[6] -translate-y-1/2 -translate-x-1/2`
|
|
1691
|
-
),
|
|
1692
|
-
style: {
|
|
1693
|
-
left: `${size / 2}px`,
|
|
1694
|
-
top: `${size / 2}px`
|
|
1695
|
-
}
|
|
1696
|
-
}
|
|
1697
|
-
)
|
|
1698
|
-
]
|
|
1699
|
-
}
|
|
1700
|
-
);
|
|
1685
|
+
const translation = useTranslation(defaultConfirmDialogTranslation, overwriteTranslation);
|
|
1686
|
+
const mapping = {
|
|
1687
|
+
neutral: "primary",
|
|
1688
|
+
negative: "negative",
|
|
1689
|
+
positive: "positive",
|
|
1690
|
+
primary: "primary"
|
|
1691
|
+
};
|
|
1692
|
+
return /* @__PURE__ */ jsxs10(Dialog, { ...restProps, className: clsx12("justify-between", className), children: [
|
|
1693
|
+
/* @__PURE__ */ jsx14("div", { className: "col grow", children }),
|
|
1694
|
+
/* @__PURE__ */ jsxs10("div", { className: "row mt-3 gap-x-4 justify-end", children: [
|
|
1695
|
+
onDecline && /* @__PURE__ */ jsx14(
|
|
1696
|
+
SolidButton,
|
|
1697
|
+
{
|
|
1698
|
+
color: buttonOverwrites?.[0].color ?? "negative",
|
|
1699
|
+
onClick: onDecline,
|
|
1700
|
+
disabled: buttonOverwrites?.[0].disabled ?? false,
|
|
1701
|
+
children: buttonOverwrites?.[0].text ?? translation.decline
|
|
1702
|
+
}
|
|
1703
|
+
),
|
|
1704
|
+
/* @__PURE__ */ jsx14(
|
|
1705
|
+
SolidButton,
|
|
1706
|
+
{
|
|
1707
|
+
autoFocus: true,
|
|
1708
|
+
color: buttonOverwrites?.[1].color ?? mapping[confirmType],
|
|
1709
|
+
onClick: onConfirm,
|
|
1710
|
+
disabled: buttonOverwrites?.[1].disabled ?? false,
|
|
1711
|
+
children: buttonOverwrites?.[1].text ?? translation.confirm
|
|
1712
|
+
}
|
|
1713
|
+
)
|
|
1714
|
+
] })
|
|
1715
|
+
] });
|
|
1701
1716
|
};
|
|
1702
1717
|
|
|
1703
|
-
// src/components/icons-and-geometry/
|
|
1704
|
-
import
|
|
1705
|
-
import
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1718
|
+
// src/components/icons-and-geometry/Avatar.tsx
|
|
1719
|
+
import Image2 from "next/image";
|
|
1720
|
+
import clsx13 from "clsx";
|
|
1721
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1722
|
+
var avtarSizeList = ["tiny", "small", "medium", "large"];
|
|
1723
|
+
var avatarSizeMapping = {
|
|
1724
|
+
tiny: 24,
|
|
1725
|
+
small: 32,
|
|
1726
|
+
medium: 48,
|
|
1727
|
+
large: 64
|
|
1728
|
+
};
|
|
1729
|
+
var Avatar = ({ avatarUrl, alt, size = "medium", className = "" }) => {
|
|
1730
|
+
avatarUrl = "https://cdn.helpwave.de/boringavatar.svg";
|
|
1731
|
+
const avtarSize = {
|
|
1732
|
+
tiny: 24,
|
|
1733
|
+
small: 32,
|
|
1734
|
+
medium: 48,
|
|
1735
|
+
large: 64
|
|
1736
|
+
}[size];
|
|
1737
|
+
const style = {
|
|
1738
|
+
width: avtarSize + "px",
|
|
1739
|
+
height: avtarSize + "px",
|
|
1740
|
+
maxWidth: avtarSize + "px",
|
|
1741
|
+
maxHeight: avtarSize + "px",
|
|
1742
|
+
minWidth: avtarSize + "px",
|
|
1743
|
+
minHeight: avtarSize + "px"
|
|
1744
|
+
};
|
|
1745
|
+
return (
|
|
1746
|
+
// TODO transparent or white background later
|
|
1747
|
+
/* @__PURE__ */ jsx15("div", { className: clsx13(`rounded-full bg-primary`, className), style, children: /* @__PURE__ */ jsx15(
|
|
1748
|
+
Image2,
|
|
1749
|
+
{
|
|
1750
|
+
className: "rounded-full border border-gray-200",
|
|
1751
|
+
style,
|
|
1752
|
+
src: avatarUrl,
|
|
1753
|
+
alt,
|
|
1754
|
+
width: avtarSize,
|
|
1755
|
+
height: avtarSize
|
|
1756
|
+
}
|
|
1757
|
+
) })
|
|
1722
1758
|
);
|
|
1723
1759
|
};
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
const
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1760
|
+
var AvatarGroup = ({
|
|
1761
|
+
avatars,
|
|
1762
|
+
maxShownProfiles = 5,
|
|
1763
|
+
size = "tiny"
|
|
1764
|
+
}) => {
|
|
1765
|
+
const displayedProfiles = avatars.length < maxShownProfiles ? avatars : avatars.slice(0, maxShownProfiles);
|
|
1766
|
+
const diameter = avatarSizeMapping[size];
|
|
1767
|
+
const stackingOverlap = 0.5;
|
|
1768
|
+
const notDisplayedProfiles = avatars.length - maxShownProfiles;
|
|
1769
|
+
const avatarGroupWidth = diameter * (stackingOverlap * (displayedProfiles.length - 1) + 1);
|
|
1770
|
+
return /* @__PURE__ */ jsxs11("div", { className: "row relative", style: { height: diameter + "px" }, children: [
|
|
1771
|
+
/* @__PURE__ */ jsx15("div", { style: { width: avatarGroupWidth + "px" }, children: displayedProfiles.map((avatar, index) => /* @__PURE__ */ jsx15(
|
|
1772
|
+
"div",
|
|
1734
1773
|
{
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
children:
|
|
1774
|
+
className: "absolute",
|
|
1775
|
+
style: { left: index * diameter * stackingOverlap + "px", zIndex: maxShownProfiles - index },
|
|
1776
|
+
children: /* @__PURE__ */ jsx15(Avatar, { avatarUrl: avatar.avatarUrl, alt: avatar.alt, size })
|
|
1777
|
+
},
|
|
1778
|
+
index
|
|
1779
|
+
)) }),
|
|
1780
|
+
notDisplayedProfiles > 0 && /* @__PURE__ */ jsx15(
|
|
1781
|
+
"div",
|
|
1782
|
+
{
|
|
1783
|
+
className: "truncate row items-center",
|
|
1784
|
+
style: { fontSize: diameter / 2 + "px", marginLeft: 1 + diameter / 16 + "px" },
|
|
1785
|
+
children: /* @__PURE__ */ jsxs11("span", { children: [
|
|
1786
|
+
"+ ",
|
|
1787
|
+
notDisplayedProfiles
|
|
1788
|
+
] })
|
|
1738
1789
|
}
|
|
1739
|
-
)
|
|
1740
|
-
|
|
1741
|
-
] }, index)) });
|
|
1790
|
+
)
|
|
1791
|
+
] });
|
|
1742
1792
|
};
|
|
1743
1793
|
|
|
1744
|
-
// src/components/
|
|
1745
|
-
import { useCallback as useCallback3, useEffect as useEffect8, useMemo, useRef as useRef3, useState as useState9 } from "react";
|
|
1794
|
+
// src/components/icons-and-geometry/Circle.tsx
|
|
1746
1795
|
import clsx14 from "clsx";
|
|
1747
|
-
import {
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
y
|
|
1768
|
-
};
|
|
1769
|
-
}
|
|
1770
|
-
static cubicBezier(x1, y1, x2, y2) {
|
|
1771
|
-
const { y } = _EaseFunctions.cubicBezierGeneric(x1, y1, x2, y2);
|
|
1772
|
-
return (t) => {
|
|
1773
|
-
t = clamp(t);
|
|
1774
|
-
return y(t);
|
|
1775
|
-
};
|
|
1776
|
-
}
|
|
1777
|
-
static easeInEaseOut(t) {
|
|
1778
|
-
return _EaseFunctions.cubicBezier(0.65, 0, 0.35, 1)(t);
|
|
1779
|
-
}
|
|
1796
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1797
|
+
var Circle = ({
|
|
1798
|
+
radius = 20,
|
|
1799
|
+
className = "bg-primary",
|
|
1800
|
+
style,
|
|
1801
|
+
...restProps
|
|
1802
|
+
}) => {
|
|
1803
|
+
const size = radius * 2;
|
|
1804
|
+
return /* @__PURE__ */ jsx16(
|
|
1805
|
+
"div",
|
|
1806
|
+
{
|
|
1807
|
+
className: clsx14(`rounded-full`, className),
|
|
1808
|
+
style: {
|
|
1809
|
+
width: `${size}px`,
|
|
1810
|
+
height: `${size}px`,
|
|
1811
|
+
...style
|
|
1812
|
+
},
|
|
1813
|
+
...restProps
|
|
1814
|
+
}
|
|
1815
|
+
);
|
|
1780
1816
|
};
|
|
1781
1817
|
|
|
1782
|
-
// src/
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1818
|
+
// src/components/icons-and-geometry/Ring.tsx
|
|
1819
|
+
import { useCallback as useCallback2, useEffect as useEffect9, useState as useState10 } from "react";
|
|
1820
|
+
import clsx15 from "clsx";
|
|
1821
|
+
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1822
|
+
var Ring = ({
|
|
1823
|
+
innerSize = 20,
|
|
1824
|
+
width = 7,
|
|
1825
|
+
className = "outline-primary"
|
|
1826
|
+
}) => {
|
|
1827
|
+
return /* @__PURE__ */ jsx17(
|
|
1828
|
+
"div",
|
|
1829
|
+
{
|
|
1830
|
+
className: clsx15(`bg-transparent rounded-full outline`, className),
|
|
1831
|
+
style: {
|
|
1832
|
+
width: `${innerSize}px`,
|
|
1833
|
+
height: `${innerSize}px`,
|
|
1834
|
+
outlineWidth: `${width}px`
|
|
1835
|
+
}
|
|
1795
1836
|
}
|
|
1796
|
-
|
|
1797
|
-
return position % this.length;
|
|
1798
|
-
}
|
|
1799
|
-
if (position < 0) {
|
|
1800
|
-
return this.length - Math.abs(position) % this.length;
|
|
1801
|
-
}
|
|
1802
|
-
return position;
|
|
1803
|
-
}
|
|
1804
|
-
static withoutOffset(position) {
|
|
1805
|
-
return position + _LoopingArrayCalculator.getOffset(position);
|
|
1806
|
-
}
|
|
1807
|
-
static getOffset(position) {
|
|
1808
|
-
return Math.round(position) - position;
|
|
1809
|
-
}
|
|
1810
|
-
/**
|
|
1811
|
-
* @return absolute distance forwards or Infinity when the target cannot be reached (only possible when not isLooping)
|
|
1812
|
-
*/
|
|
1813
|
-
getDistanceDirectional(position, target, direction) {
|
|
1814
|
-
if (!this.isLooping && (position < -this.allowedOverScroll || position > this.allowedOverScroll + this.length - 1)) {
|
|
1815
|
-
throw new Error("Invalid parameters: position is out of bounds.");
|
|
1816
|
-
}
|
|
1817
|
-
const isForwardInvalid = direction === 1 && position > target;
|
|
1818
|
-
const isBackwardInvalid = direction === -1 && target < position;
|
|
1819
|
-
if (!this.isLooping && (isForwardInvalid || isBackwardInvalid)) {
|
|
1820
|
-
return Infinity;
|
|
1821
|
-
}
|
|
1822
|
-
if (direction === -1) {
|
|
1823
|
-
return this.getDistanceDirectional(target, position, 1);
|
|
1824
|
-
}
|
|
1825
|
-
position = this.getCorrectedPosition(position);
|
|
1826
|
-
target = this.getCorrectedPosition(target);
|
|
1827
|
-
let distance = (target - position) * direction;
|
|
1828
|
-
if (distance < 0) {
|
|
1829
|
-
distance = this.length - Math.abs(position) % this.length + target;
|
|
1830
|
-
}
|
|
1831
|
-
return distance;
|
|
1832
|
-
}
|
|
1833
|
-
getDistanceForward(position, target) {
|
|
1834
|
-
return this.getDistanceDirectional(position, target, 1);
|
|
1835
|
-
}
|
|
1836
|
-
getDistanceBackward(position, target) {
|
|
1837
|
-
return this.getDistanceDirectional(position, target, -1);
|
|
1838
|
-
}
|
|
1839
|
-
getDistance(position, target) {
|
|
1840
|
-
const forwardDistance = this.getDistanceForward(position, target);
|
|
1841
|
-
const backwardDistance = this.getDistanceBackward(position, target);
|
|
1842
|
-
return Math.min(forwardDistance, backwardDistance);
|
|
1843
|
-
}
|
|
1844
|
-
getBestDirection(position, target) {
|
|
1845
|
-
const forwardDistance = this.getDistanceForward(position, target);
|
|
1846
|
-
const backwardDistance = this.getDistanceBackward(position, target);
|
|
1847
|
-
return forwardDistance < backwardDistance ? 1 : -1;
|
|
1848
|
-
}
|
|
1837
|
+
);
|
|
1849
1838
|
};
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
autoLoopingTimeOut = 5e3,
|
|
1859
|
-
autoLoopAnimationTime = 500,
|
|
1860
|
-
hintNext = false,
|
|
1861
|
-
arrows = false,
|
|
1862
|
-
dots = true,
|
|
1863
|
-
overScrollThreshold = 0.1,
|
|
1864
|
-
blurColor = "from-white",
|
|
1865
|
-
className = "",
|
|
1866
|
-
heightClassName = "h-[24rem]",
|
|
1867
|
-
widthClassName = "w-[70%] desktop:w-1/2"
|
|
1839
|
+
var AnimatedRing = ({
|
|
1840
|
+
innerSize,
|
|
1841
|
+
width,
|
|
1842
|
+
className,
|
|
1843
|
+
fillAnimationDuration = 3,
|
|
1844
|
+
repeating = false,
|
|
1845
|
+
onAnimationFinished = noop,
|
|
1846
|
+
style
|
|
1868
1847
|
}) => {
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
autoLoopingTimeOut = Math.max(0, autoLoopingTimeOut);
|
|
1883
|
-
const length = children.length;
|
|
1884
|
-
const paddingItemCount = 3;
|
|
1885
|
-
const util = useMemo(() => new LoopingArrayCalculator(length, isLooping, overScrollThreshold), [length, isLooping, overScrollThreshold]);
|
|
1886
|
-
const currentIndex = util.getCorrectedPosition(LoopingArrayCalculator.withoutOffset(currentPosition));
|
|
1887
|
-
animationTime = Math.max(200, animationTime);
|
|
1888
|
-
autoLoopAnimationTime = Math.max(200, autoLoopAnimationTime);
|
|
1889
|
-
const getStyleOffset = (index) => {
|
|
1890
|
-
const baseOffset = -50 + (index - currentPosition) * 100;
|
|
1891
|
-
return `${baseOffset}%`;
|
|
1892
|
-
};
|
|
1893
|
-
const animation = useCallback3((time) => {
|
|
1894
|
-
let keepAnimating = true;
|
|
1895
|
-
setCarouselInformation((state) => {
|
|
1896
|
-
const {
|
|
1897
|
-
animationState: animationState2,
|
|
1898
|
-
dragState: dragState2
|
|
1899
|
-
} = state;
|
|
1900
|
-
if (animationState2 === void 0 || dragState2 !== void 0) {
|
|
1901
|
-
keepAnimating = false;
|
|
1902
|
-
return state;
|
|
1903
|
-
}
|
|
1904
|
-
if (!animationState2.startTime || !animationState2.lastUpdateTime) {
|
|
1905
|
-
return {
|
|
1906
|
-
...state,
|
|
1907
|
-
animationState: {
|
|
1908
|
-
...animationState2,
|
|
1909
|
-
startTime: time,
|
|
1910
|
-
lastUpdateTime: time
|
|
1911
|
-
}
|
|
1912
|
-
};
|
|
1913
|
-
}
|
|
1914
|
-
const useAnimationTime = animationState2.isAutoLooping ? autoLoopAnimationTime : animationTime;
|
|
1915
|
-
const progress = clamp((time - animationState2.startTime) / useAnimationTime);
|
|
1916
|
-
const easedProgress = EaseFunctions.easeInEaseOut(progress);
|
|
1917
|
-
const distance = util.getDistanceDirectional(animationState2.startPosition, animationState2.targetPosition, animationState2.direction);
|
|
1918
|
-
const newPosition = util.getCorrectedPosition(easedProgress * distance * animationState2.direction + animationState2.startPosition);
|
|
1919
|
-
if (animationState2.targetPosition === newPosition || progress === 1) {
|
|
1920
|
-
keepAnimating = false;
|
|
1921
|
-
return {
|
|
1922
|
-
currentPosition: LoopingArrayCalculator.withoutOffset(newPosition),
|
|
1923
|
-
animationState: void 0
|
|
1924
|
-
};
|
|
1925
|
-
}
|
|
1926
|
-
return {
|
|
1927
|
-
currentPosition: newPosition,
|
|
1928
|
-
animationState: {
|
|
1929
|
-
...animationState2,
|
|
1930
|
-
lastUpdateTime: time
|
|
1931
|
-
}
|
|
1932
|
-
};
|
|
1933
|
-
});
|
|
1934
|
-
if (keepAnimating) {
|
|
1935
|
-
animationId.current = requestAnimationFrame((time1) => animation(time1));
|
|
1936
|
-
}
|
|
1937
|
-
}, [animationTime, autoLoopAnimationTime, util]);
|
|
1938
|
-
useEffect8(() => {
|
|
1939
|
-
if (animationState) {
|
|
1940
|
-
animationId.current = requestAnimationFrame(animation);
|
|
1941
|
-
}
|
|
1942
|
-
return () => {
|
|
1943
|
-
if (animationId.current) {
|
|
1944
|
-
cancelAnimationFrame(animationId.current);
|
|
1945
|
-
animationId.current = 0;
|
|
1946
|
-
}
|
|
1947
|
-
};
|
|
1948
|
-
}, [animationState]);
|
|
1949
|
-
const startAutoLoop = () => setCarouselInformation((prevState) => ({
|
|
1950
|
-
...prevState,
|
|
1951
|
-
dragState: prevState.dragState,
|
|
1952
|
-
animationState: prevState.animationState || prevState.dragState ? prevState.animationState : {
|
|
1953
|
-
startPosition: currentPosition,
|
|
1954
|
-
targetPosition: (currentPosition + 1) % length,
|
|
1955
|
-
direction: 1,
|
|
1956
|
-
// always move forward
|
|
1957
|
-
isAutoLooping: true
|
|
1958
|
-
}
|
|
1959
|
-
}));
|
|
1960
|
-
useEffect8(() => {
|
|
1961
|
-
if (!animationId.current && !animationState && !dragState && !timeOut.current) {
|
|
1962
|
-
if (autoLoopingTimeOut > 0) {
|
|
1963
|
-
timeOut.current = setTimeout(() => {
|
|
1964
|
-
startAutoLoop();
|
|
1965
|
-
timeOut.current = void 0;
|
|
1966
|
-
}, autoLoopingTimeOut);
|
|
1967
|
-
} else {
|
|
1968
|
-
startAutoLoop();
|
|
1848
|
+
const [currentWidth, setCurrentWidth] = useState10(0);
|
|
1849
|
+
const milliseconds = 1e3 * fillAnimationDuration;
|
|
1850
|
+
const animate = useCallback2((timestamp, startTime) => {
|
|
1851
|
+
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
1852
|
+
const newWidth = Math.min(width * progress, width);
|
|
1853
|
+
setCurrentWidth(newWidth);
|
|
1854
|
+
if (progress < 1) {
|
|
1855
|
+
requestAnimationFrame((newTimestamp) => animate(newTimestamp, startTime));
|
|
1856
|
+
} else {
|
|
1857
|
+
onAnimationFinished();
|
|
1858
|
+
if (repeating) {
|
|
1859
|
+
setCurrentWidth(0);
|
|
1860
|
+
requestAnimationFrame((newTimestamp) => animate(newTimestamp, newTimestamp));
|
|
1969
1861
|
}
|
|
1970
1862
|
}
|
|
1971
|
-
}, [
|
|
1972
|
-
|
|
1973
|
-
if (
|
|
1974
|
-
|
|
1975
|
-
}
|
|
1976
|
-
if (targetPosition === currentPosition) {
|
|
1977
|
-
return;
|
|
1978
|
-
}
|
|
1979
|
-
const direction = util.getBestDirection(currentPosition, targetPosition);
|
|
1980
|
-
clearTimeout(timeOut.current);
|
|
1981
|
-
timeOut.current = void 0;
|
|
1982
|
-
if (animationId.current) {
|
|
1983
|
-
cancelAnimationFrame(animationId.current);
|
|
1984
|
-
animationId.current = void 0;
|
|
1863
|
+
}, [milliseconds, onAnimationFinished, repeating, width]);
|
|
1864
|
+
useEffect9(() => {
|
|
1865
|
+
if (currentWidth < width) {
|
|
1866
|
+
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
1985
1867
|
}
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1868
|
+
}, []);
|
|
1869
|
+
return /* @__PURE__ */ jsx17(
|
|
1870
|
+
"div",
|
|
1871
|
+
{
|
|
1872
|
+
className: "row items-center justify-center",
|
|
1873
|
+
style: {
|
|
1874
|
+
width: `${innerSize + 2 * width}px`,
|
|
1875
|
+
height: `${innerSize + 2 * width}px`,
|
|
1876
|
+
...style
|
|
1994
1877
|
},
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
};
|
|
2004
|
-
const left = () => {
|
|
2005
|
-
if (canGoLeft()) {
|
|
2006
|
-
startAnimation(currentPosition === 0 ? length - 1 : LoopingArrayCalculator.withoutOffset(currentPosition - 1));
|
|
2007
|
-
}
|
|
2008
|
-
};
|
|
2009
|
-
const right = () => {
|
|
2010
|
-
if (canGoRight()) {
|
|
2011
|
-
startAnimation(LoopingArrayCalculator.withoutOffset((currentPosition + 1) % length));
|
|
2012
|
-
}
|
|
2013
|
-
};
|
|
2014
|
-
let items = children.map((item, index) => ({
|
|
2015
|
-
index,
|
|
2016
|
-
item
|
|
2017
|
-
}));
|
|
2018
|
-
if (isLooping) {
|
|
2019
|
-
const before = createLoopingListWithIndex(children, length - 1, paddingItemCount, false).reverse().map(([index, item]) => ({
|
|
2020
|
-
index,
|
|
2021
|
-
item
|
|
2022
|
-
}));
|
|
2023
|
-
const after = createLoopingListWithIndex(children, 0, paddingItemCount).map(([index, item]) => ({
|
|
2024
|
-
index,
|
|
2025
|
-
item
|
|
2026
|
-
}));
|
|
2027
|
-
items = [
|
|
2028
|
-
...before,
|
|
2029
|
-
...items,
|
|
2030
|
-
...after
|
|
2031
|
-
];
|
|
2032
|
-
}
|
|
2033
|
-
const onDragStart = (x) => setCarouselInformation((prevState) => ({
|
|
2034
|
-
...prevState,
|
|
2035
|
-
dragState: {
|
|
2036
|
-
lastX: x,
|
|
2037
|
-
startX: x,
|
|
2038
|
-
startTime: Date.now(),
|
|
2039
|
-
startIndex: currentPosition
|
|
2040
|
-
},
|
|
2041
|
-
animationState: void 0
|
|
2042
|
-
// cancel animation
|
|
2043
|
-
}));
|
|
2044
|
-
const onDrag = (x, width) => {
|
|
2045
|
-
if (!dragState || x === 0) {
|
|
2046
|
-
return;
|
|
1878
|
+
children: /* @__PURE__ */ jsx17(
|
|
1879
|
+
Ring,
|
|
1880
|
+
{
|
|
1881
|
+
innerSize,
|
|
1882
|
+
width: currentWidth,
|
|
1883
|
+
className
|
|
1884
|
+
}
|
|
1885
|
+
)
|
|
2047
1886
|
}
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
1887
|
+
);
|
|
1888
|
+
};
|
|
1889
|
+
var RingWave = ({
|
|
1890
|
+
startInnerSize = 20,
|
|
1891
|
+
endInnerSize = 30,
|
|
1892
|
+
width,
|
|
1893
|
+
className,
|
|
1894
|
+
fillAnimationDuration = 3,
|
|
1895
|
+
repeating = false,
|
|
1896
|
+
onAnimationFinished = noop,
|
|
1897
|
+
style
|
|
1898
|
+
}) => {
|
|
1899
|
+
const [currentInnerSize, setCurrentInnerSize] = useState10(startInnerSize);
|
|
1900
|
+
const distance = endInnerSize - startInnerSize;
|
|
1901
|
+
const milliseconds = 1e3 * fillAnimationDuration;
|
|
1902
|
+
const animate = useCallback2((timestamp, startTime) => {
|
|
1903
|
+
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
1904
|
+
const newInnerSize = Math.min(
|
|
1905
|
+
startInnerSize + distance * progress,
|
|
1906
|
+
endInnerSize
|
|
1907
|
+
);
|
|
1908
|
+
setCurrentInnerSize(newInnerSize);
|
|
1909
|
+
if (progress < 1) {
|
|
1910
|
+
requestAnimationFrame((newTimestamp) => animate(newTimestamp, startTime));
|
|
1911
|
+
} else {
|
|
1912
|
+
onAnimationFinished();
|
|
1913
|
+
if (repeating) {
|
|
1914
|
+
setCurrentInnerSize(startInnerSize);
|
|
1915
|
+
requestAnimationFrame((newTimestamp) => animate(newTimestamp, newTimestamp));
|
|
2056
1916
|
}
|
|
2057
|
-
}));
|
|
2058
|
-
};
|
|
2059
|
-
const onDragEnd = (x, width) => {
|
|
2060
|
-
if (!dragState) {
|
|
2061
|
-
return;
|
|
2062
1917
|
}
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
const isSlide = Math.abs(velocity) > 2 || duration < 200 && (Math.abs(relativeDistance) > 0.2 || Math.abs(distance) > 50);
|
|
2068
|
-
if (isSlide) {
|
|
2069
|
-
if (distance > 0 && canGoRight()) {
|
|
2070
|
-
right();
|
|
2071
|
-
return;
|
|
2072
|
-
} else if (distance < 0 && canGoLeft()) {
|
|
2073
|
-
left();
|
|
2074
|
-
return;
|
|
2075
|
-
}
|
|
1918
|
+
}, [distance, endInnerSize, milliseconds, onAnimationFinished, repeating, startInnerSize]);
|
|
1919
|
+
useEffect9(() => {
|
|
1920
|
+
if (currentInnerSize < endInnerSize) {
|
|
1921
|
+
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
2076
1922
|
}
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
1923
|
+
}, []);
|
|
1924
|
+
return /* @__PURE__ */ jsx17(
|
|
1925
|
+
"div",
|
|
1926
|
+
{
|
|
1927
|
+
className: "row items-center justify-center",
|
|
1928
|
+
style: {
|
|
1929
|
+
width: `${endInnerSize + 2 * width}px`,
|
|
1930
|
+
height: `${endInnerSize + 2 * width}px`,
|
|
1931
|
+
...style
|
|
1932
|
+
},
|
|
1933
|
+
children: /* @__PURE__ */ jsx17(
|
|
1934
|
+
Ring,
|
|
1935
|
+
{
|
|
1936
|
+
innerSize: currentInnerSize,
|
|
1937
|
+
width,
|
|
1938
|
+
className
|
|
1939
|
+
}
|
|
1940
|
+
)
|
|
1941
|
+
}
|
|
1942
|
+
);
|
|
1943
|
+
};
|
|
1944
|
+
var RadialRings = ({
|
|
1945
|
+
circle1ClassName = "bg-primary/90 outline-primary/90",
|
|
1946
|
+
circle2ClassName = "bg-primary/60 outline-primary/60",
|
|
1947
|
+
circle3ClassName = "bg-primary/40 outline-primary/40",
|
|
1948
|
+
waveWidth = 10,
|
|
1949
|
+
waveBaseColor = "outline-white/20",
|
|
1950
|
+
sizeCircle1 = 100,
|
|
1951
|
+
sizeCircle2 = 200,
|
|
1952
|
+
sizeCircle3 = 300
|
|
1953
|
+
}) => {
|
|
1954
|
+
const [currentRing, setCurrentRing] = useState10(0);
|
|
1955
|
+
const size = sizeCircle3;
|
|
1956
|
+
return /* @__PURE__ */ jsxs12(
|
|
1957
|
+
"div",
|
|
1958
|
+
{
|
|
1959
|
+
className: "relative",
|
|
1960
|
+
style: {
|
|
1961
|
+
width: `${sizeCircle3}px`,
|
|
1962
|
+
height: `${sizeCircle3}px`
|
|
1963
|
+
},
|
|
1964
|
+
children: [
|
|
2095
1965
|
/* @__PURE__ */ jsx17(
|
|
2096
|
-
|
|
1966
|
+
Circle,
|
|
2097
1967
|
{
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
1968
|
+
radius: sizeCircle1 / 2,
|
|
1969
|
+
className: clsx15(circle1ClassName, `absolute z-[10] -translate-y-1/2 -translate-x-1/2`),
|
|
1970
|
+
style: {
|
|
1971
|
+
left: `${size / 2}px`,
|
|
1972
|
+
top: `${size / 2}px`
|
|
1973
|
+
}
|
|
2101
1974
|
}
|
|
2102
1975
|
),
|
|
2103
|
-
/* @__PURE__ */ jsx17(
|
|
2104
|
-
|
|
1976
|
+
currentRing === 0 ? /* @__PURE__ */ jsx17(
|
|
1977
|
+
AnimatedRing,
|
|
2105
1978
|
{
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
1979
|
+
innerSize: sizeCircle1,
|
|
1980
|
+
width: (sizeCircle2 - sizeCircle1) / 2,
|
|
1981
|
+
onAnimationFinished: () => currentRing === 0 ? setCurrentRing(1) : null,
|
|
1982
|
+
repeating: true,
|
|
1983
|
+
className: clsx15(
|
|
1984
|
+
circle2ClassName,
|
|
1985
|
+
{ "opacity-5": currentRing !== 0 }
|
|
1986
|
+
),
|
|
1987
|
+
style: {
|
|
1988
|
+
left: `${size / 2}px`,
|
|
1989
|
+
top: `${size / 2}px`,
|
|
1990
|
+
position: "absolute",
|
|
1991
|
+
translate: `-50% -50%`,
|
|
1992
|
+
zIndex: 9
|
|
1993
|
+
}
|
|
2109
1994
|
}
|
|
2110
|
-
)
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
/* @__PURE__ */ jsx17("div", { className: "relative row h-full w-full px-2 overflow-hidden", children: items.map(({
|
|
2114
|
-
item,
|
|
2115
|
-
index
|
|
2116
|
-
}, listIndex) => /* @__PURE__ */ jsx17(
|
|
2117
|
-
"div",
|
|
1995
|
+
) : null,
|
|
1996
|
+
currentRing === 2 ? /* @__PURE__ */ jsx17(
|
|
1997
|
+
RingWave,
|
|
2118
1998
|
{
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
1999
|
+
startInnerSize: sizeCircle1 - waveWidth,
|
|
2000
|
+
endInnerSize: sizeCircle2,
|
|
2001
|
+
width: waveWidth,
|
|
2002
|
+
repeating: true,
|
|
2003
|
+
className: clsx15(waveBaseColor, `opacity-5`),
|
|
2004
|
+
style: {
|
|
2005
|
+
left: `${size / 2}px`,
|
|
2006
|
+
top: `${size / 2}px`,
|
|
2007
|
+
position: "absolute",
|
|
2008
|
+
translate: `-50% -50%`,
|
|
2009
|
+
zIndex: 9
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
) : null,
|
|
2127
2013
|
/* @__PURE__ */ jsx17(
|
|
2128
|
-
|
|
2014
|
+
Circle,
|
|
2129
2015
|
{
|
|
2130
|
-
|
|
2016
|
+
radius: sizeCircle2 / 2,
|
|
2017
|
+
className: clsx15(
|
|
2018
|
+
circle2ClassName,
|
|
2019
|
+
{ "opacity-20": currentRing < 1 },
|
|
2020
|
+
`absolute z-[8] -translate-y-1/2 -translate-x-1/2`
|
|
2021
|
+
),
|
|
2022
|
+
style: {
|
|
2023
|
+
left: `${size / 2}px`,
|
|
2024
|
+
top: `${size / 2}px`
|
|
2025
|
+
}
|
|
2131
2026
|
}
|
|
2132
2027
|
),
|
|
2028
|
+
currentRing === 1 ? /* @__PURE__ */ jsx17(
|
|
2029
|
+
AnimatedRing,
|
|
2030
|
+
{
|
|
2031
|
+
innerSize: sizeCircle2 - 1,
|
|
2032
|
+
width: (sizeCircle3 - sizeCircle2) / 2,
|
|
2033
|
+
onAnimationFinished: () => currentRing === 1 ? setCurrentRing(2) : null,
|
|
2034
|
+
repeating: true,
|
|
2035
|
+
className: clsx15(circle3ClassName),
|
|
2036
|
+
style: {
|
|
2037
|
+
left: `${size / 2}px`,
|
|
2038
|
+
top: `${size / 2}px`,
|
|
2039
|
+
position: "absolute",
|
|
2040
|
+
translate: `-50% -50%`,
|
|
2041
|
+
zIndex: 7
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
) : null,
|
|
2045
|
+
currentRing === 2 ? /* @__PURE__ */ jsx17(
|
|
2046
|
+
RingWave,
|
|
2047
|
+
{
|
|
2048
|
+
startInnerSize: sizeCircle2,
|
|
2049
|
+
endInnerSize: sizeCircle3 - waveWidth,
|
|
2050
|
+
width: waveWidth,
|
|
2051
|
+
repeating: true,
|
|
2052
|
+
className: clsx15(waveBaseColor, `opacity-5`),
|
|
2053
|
+
style: {
|
|
2054
|
+
left: `${size / 2}px`,
|
|
2055
|
+
top: `${size / 2}px`,
|
|
2056
|
+
position: "absolute",
|
|
2057
|
+
translate: `-50% -50%`,
|
|
2058
|
+
zIndex: 7
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
) : null,
|
|
2133
2062
|
/* @__PURE__ */ jsx17(
|
|
2134
|
-
|
|
2063
|
+
Circle,
|
|
2135
2064
|
{
|
|
2136
|
-
|
|
2065
|
+
radius: sizeCircle3 / 2,
|
|
2066
|
+
className: clsx15(
|
|
2067
|
+
circle3ClassName,
|
|
2068
|
+
{ "opacity-20": currentRing < 2 },
|
|
2069
|
+
`absolute z-[6] -translate-y-1/2 -translate-x-1/2`
|
|
2070
|
+
),
|
|
2071
|
+
style: {
|
|
2072
|
+
left: `${size / 2}px`,
|
|
2073
|
+
top: `${size / 2}px`
|
|
2074
|
+
}
|
|
2137
2075
|
}
|
|
2138
2076
|
)
|
|
2139
|
-
]
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
"div",
|
|
2143
|
-
{
|
|
2144
|
-
className: "row items-center justify-center w-full my-2",
|
|
2145
|
-
children: range(0, length - 1).map((index) => /* @__PURE__ */ jsx17(
|
|
2146
|
-
"button",
|
|
2147
|
-
{
|
|
2148
|
-
className: clsx14("w-[2rem] min-w-[2rem] h-[0.75rem] min-h-[0.75rem] hover:bg-primary hover:brightness-90 first:rounded-l-md last:rounded-r-md", {
|
|
2149
|
-
"bg-gray-200": currentIndex !== index,
|
|
2150
|
-
"bg-primary": currentIndex === index
|
|
2151
|
-
}),
|
|
2152
|
-
onClick: () => startAnimation(index)
|
|
2153
|
-
},
|
|
2154
|
-
index
|
|
2155
|
-
))
|
|
2156
|
-
}
|
|
2157
|
-
)
|
|
2158
|
-
] });
|
|
2077
|
+
]
|
|
2078
|
+
}
|
|
2079
|
+
);
|
|
2159
2080
|
};
|
|
2160
2081
|
|
|
2161
|
-
// src/components/
|
|
2162
|
-
import
|
|
2163
|
-
import { jsx as jsx18
|
|
2164
|
-
var
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
className = "",
|
|
2170
|
-
...restProps
|
|
2082
|
+
// src/components/icons-and-geometry/Tag.tsx
|
|
2083
|
+
import Image3 from "next/image";
|
|
2084
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2085
|
+
var TagIcon = ({
|
|
2086
|
+
className,
|
|
2087
|
+
width = 16,
|
|
2088
|
+
height = 16,
|
|
2089
|
+
...props
|
|
2171
2090
|
}) => {
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
2175
|
-
red: "text-tag-red-text bg-tag-red-background",
|
|
2176
|
-
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
2177
|
-
green: "text-tag-green-text bg-tag-green-background",
|
|
2178
|
-
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
2179
|
-
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
2180
|
-
}[color];
|
|
2181
|
-
const colorMappingIcon = {
|
|
2182
|
-
default: "text-tag-default-icon",
|
|
2183
|
-
dark: "text-tag-dark-icon",
|
|
2184
|
-
red: "text-tag-red-icon",
|
|
2185
|
-
yellow: "text-tag-yellow-icon",
|
|
2186
|
-
green: "text-tag-green-icon",
|
|
2187
|
-
blue: "text-tag-blue-icon",
|
|
2188
|
-
pink: "text-tag-pink-icon"
|
|
2189
|
-
}[color];
|
|
2190
|
-
return /* @__PURE__ */ jsxs12(
|
|
2191
|
-
"div",
|
|
2091
|
+
return /* @__PURE__ */ jsx18(
|
|
2092
|
+
Image3,
|
|
2192
2093
|
{
|
|
2193
|
-
...
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
"rounded-full": variant === "fullyRounded"
|
|
2200
|
-
},
|
|
2201
|
-
className
|
|
2202
|
-
),
|
|
2203
|
-
children: [
|
|
2204
|
-
children,
|
|
2205
|
-
trailingIcon && /* @__PURE__ */ jsx18("span", { className: colorMappingIcon, children: trailingIcon })
|
|
2206
|
-
]
|
|
2094
|
+
...props,
|
|
2095
|
+
width,
|
|
2096
|
+
height,
|
|
2097
|
+
alt: "",
|
|
2098
|
+
src: "https://cdn.helpwave.de/icons/label.png",
|
|
2099
|
+
className
|
|
2207
2100
|
}
|
|
2208
2101
|
);
|
|
2209
2102
|
};
|
|
2210
|
-
var ChipList = ({
|
|
2211
|
-
list,
|
|
2212
|
-
className = ""
|
|
2213
|
-
}) => {
|
|
2214
|
-
return /* @__PURE__ */ jsx18("div", { className: clsx15("flex flex-wrap gap-x-4 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ jsx18(
|
|
2215
|
-
Chip,
|
|
2216
|
-
{
|
|
2217
|
-
...value,
|
|
2218
|
-
color: value.color ?? "dark",
|
|
2219
|
-
variant: value.variant ?? "normal",
|
|
2220
|
-
children: value.children
|
|
2221
|
-
},
|
|
2222
|
-
index
|
|
2223
|
-
)) });
|
|
2224
|
-
};
|
|
2225
2103
|
|
|
2226
|
-
// src/components/layout-and-navigation/
|
|
2104
|
+
// src/components/layout-and-navigation/BreadCrumb.tsx
|
|
2105
|
+
import Link from "next/link";
|
|
2227
2106
|
import clsx16 from "clsx";
|
|
2228
|
-
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2229
|
-
var
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
if (element !== void 0) {
|
|
2239
|
-
nodes.push(element);
|
|
2240
|
-
if (index < children.length - 1) {
|
|
2241
|
-
nodes.push(divider(index));
|
|
2107
|
+
import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2108
|
+
var BreadCrumb = ({ crumbs, linkClassName, containerClassName }) => {
|
|
2109
|
+
const color = "text-description";
|
|
2110
|
+
return /* @__PURE__ */ jsx19("div", { className: clsx16("row", containerClassName), children: crumbs.map((crumb, index) => /* @__PURE__ */ jsxs13("div", { children: [
|
|
2111
|
+
/* @__PURE__ */ jsx19(
|
|
2112
|
+
Link,
|
|
2113
|
+
{
|
|
2114
|
+
href: crumb.link,
|
|
2115
|
+
className: clsx16(linkClassName, { [`${color} hover:brightness-60`]: index !== crumbs.length - 1 }),
|
|
2116
|
+
children: crumb.display
|
|
2242
2117
|
}
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2118
|
+
),
|
|
2119
|
+
index !== crumbs.length - 1 && /* @__PURE__ */ jsx19("span", { className: clsx16(`px-1`, color), children: "/" })
|
|
2120
|
+
] }, index)) });
|
|
2246
2121
|
};
|
|
2247
2122
|
|
|
2248
|
-
// src/components/layout-and-navigation/
|
|
2123
|
+
// src/components/layout-and-navigation/Carousel.tsx
|
|
2124
|
+
import { useCallback as useCallback3, useEffect as useEffect10, useMemo, useRef as useRef4, useState as useState11 } from "react";
|
|
2249
2125
|
import clsx17 from "clsx";
|
|
2250
|
-
import {
|
|
2126
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
2251
2127
|
|
|
2252
|
-
// src/
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
return /* @__PURE__ */ jsx20("span", { className: "font-space", children: node.children.map((value, index) => /* @__PURE__ */ jsx20(
|
|
2283
|
-
ASTNodeInterpreter,
|
|
2284
|
-
{
|
|
2285
|
-
node: value
|
|
2286
|
-
},
|
|
2287
|
-
index
|
|
2288
|
-
)) });
|
|
2289
|
-
case "primary":
|
|
2290
|
-
return /* @__PURE__ */ jsx20("span", { className: "text-primary", children: node.children.map((value, index) => /* @__PURE__ */ jsx20(
|
|
2291
|
-
ASTNodeInterpreter,
|
|
2292
|
-
{
|
|
2293
|
-
node: value
|
|
2294
|
-
},
|
|
2295
|
-
index
|
|
2296
|
-
)) });
|
|
2297
|
-
case "secondary":
|
|
2298
|
-
return /* @__PURE__ */ jsx20("span", { className: "text-secondary", children: node.children.map((value, index) => /* @__PURE__ */ jsx20(
|
|
2299
|
-
ASTNodeInterpreter,
|
|
2300
|
-
{
|
|
2301
|
-
node: value
|
|
2302
|
-
},
|
|
2303
|
-
index
|
|
2304
|
-
)) });
|
|
2305
|
-
case "warn":
|
|
2306
|
-
return /* @__PURE__ */ jsx20("span", { className: "text-warning", children: node.children.map((value, index) => /* @__PURE__ */ jsx20(
|
|
2307
|
-
ASTNodeInterpreter,
|
|
2308
|
-
{
|
|
2309
|
-
node: value
|
|
2310
|
-
},
|
|
2311
|
-
index
|
|
2312
|
-
)) });
|
|
2313
|
-
case "positive":
|
|
2314
|
-
return /* @__PURE__ */ jsx20("span", { className: "text-positive", children: node.children.map((value, index) => /* @__PURE__ */ jsx20(
|
|
2315
|
-
ASTNodeInterpreter,
|
|
2316
|
-
{
|
|
2317
|
-
node: value
|
|
2318
|
-
},
|
|
2319
|
-
index
|
|
2320
|
-
)) });
|
|
2321
|
-
case "negative":
|
|
2322
|
-
return /* @__PURE__ */ jsx20("span", { className: "text-negative", children: node.children.map((value, index) => /* @__PURE__ */ jsx20(
|
|
2323
|
-
ASTNodeInterpreter,
|
|
2324
|
-
{
|
|
2325
|
-
node: value
|
|
2326
|
-
},
|
|
2327
|
-
index
|
|
2328
|
-
)) });
|
|
2329
|
-
default:
|
|
2330
|
-
return null;
|
|
2128
|
+
// src/util/math.ts
|
|
2129
|
+
var clamp = (value, min = 0, max = 1) => {
|
|
2130
|
+
return Math.min(Math.max(value, min), max);
|
|
2131
|
+
};
|
|
2132
|
+
|
|
2133
|
+
// src/util/easeFunctions.ts
|
|
2134
|
+
var EaseFunctions = class _EaseFunctions {
|
|
2135
|
+
static cubicBezierGeneric(x1, y1, x2, y2) {
|
|
2136
|
+
const cx = 3 * x1;
|
|
2137
|
+
const bx = 3 * (x2 - x1) - cx;
|
|
2138
|
+
const ax = 1 - cx - bx;
|
|
2139
|
+
const cy = 3 * y1;
|
|
2140
|
+
const by = 3 * (y2 - y1) - cy;
|
|
2141
|
+
const ay = 1 - cy - by;
|
|
2142
|
+
const x = (t) => ((ax * t + bx) * t + cx) * t;
|
|
2143
|
+
const y = (t) => ((ay * t + by) * t + cy) * t;
|
|
2144
|
+
return {
|
|
2145
|
+
x,
|
|
2146
|
+
y
|
|
2147
|
+
};
|
|
2148
|
+
}
|
|
2149
|
+
static cubicBezier(x1, y1, x2, y2) {
|
|
2150
|
+
const { y } = _EaseFunctions.cubicBezierGeneric(x1, y1, x2, y2);
|
|
2151
|
+
return (t) => {
|
|
2152
|
+
t = clamp(t);
|
|
2153
|
+
return y(t);
|
|
2154
|
+
};
|
|
2155
|
+
}
|
|
2156
|
+
static easeInEaseOut(t) {
|
|
2157
|
+
return _EaseFunctions.cubicBezier(0.65, 0, 0.35, 1)(t);
|
|
2331
2158
|
}
|
|
2332
2159
|
};
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
{ id: "secondary", name: "secondary" },
|
|
2340
|
-
{ id: "warn", name: "warn" },
|
|
2341
|
-
{ id: "positive", name: "positive" },
|
|
2342
|
-
{ id: "negative", name: "negative" }
|
|
2343
|
-
];
|
|
2344
|
-
var inserterIdentifierMapping = [
|
|
2345
|
-
{ id: "helpwave", name: "helpwave" },
|
|
2346
|
-
{ id: "newline", name: "newline" }
|
|
2347
|
-
];
|
|
2348
|
-
var parseMarkdown = (text, commandStart = "\\", open = "{", close = "}") => {
|
|
2349
|
-
let start = text.indexOf(commandStart);
|
|
2350
|
-
const children = [];
|
|
2351
|
-
while (text !== "") {
|
|
2352
|
-
if (start === -1) {
|
|
2353
|
-
children.push({
|
|
2354
|
-
type: "text",
|
|
2355
|
-
text
|
|
2356
|
-
});
|
|
2357
|
-
break;
|
|
2358
|
-
}
|
|
2359
|
-
children.push(parseMarkdown(text.substring(0, start)));
|
|
2360
|
-
text = text.substring(start);
|
|
2361
|
-
if (text.length <= 1) {
|
|
2362
|
-
children.push({
|
|
2363
|
-
type: "text",
|
|
2364
|
-
text
|
|
2365
|
-
});
|
|
2366
|
-
text = "";
|
|
2367
|
-
continue;
|
|
2368
|
-
}
|
|
2369
|
-
const simpleReplace = [commandStart, open, close];
|
|
2370
|
-
if (simpleReplace.some((value) => text[1] === value)) {
|
|
2371
|
-
children.push({
|
|
2372
|
-
type: "text",
|
|
2373
|
-
text: simpleReplace.find((value) => text[1] === value)
|
|
2374
|
-
});
|
|
2375
|
-
text = text.substring(2);
|
|
2376
|
-
start = text.indexOf(commandStart);
|
|
2377
|
-
continue;
|
|
2378
|
-
}
|
|
2379
|
-
const inserter = inserterIdentifierMapping.find((value) => text.substring(1).startsWith(value.id));
|
|
2380
|
-
if (inserter) {
|
|
2381
|
-
children.push({
|
|
2382
|
-
type: inserter.name
|
|
2383
|
-
});
|
|
2384
|
-
text = text.substring(inserter.id.length + 1);
|
|
2385
|
-
start = text.indexOf(commandStart);
|
|
2386
|
-
continue;
|
|
2387
|
-
}
|
|
2388
|
-
const modifier = modifierIdentifierMapping.find((value) => text.substring(1).startsWith(value.id));
|
|
2389
|
-
if (modifier) {
|
|
2390
|
-
if (text[modifier.id.length + 1] !== open) {
|
|
2391
|
-
children.push({
|
|
2392
|
-
type: "text",
|
|
2393
|
-
text: text.substring(0, modifier.id.length + 1)
|
|
2394
|
-
});
|
|
2395
|
-
text = text.substring(modifier.id.length + 2);
|
|
2396
|
-
start = text.indexOf(commandStart);
|
|
2397
|
-
continue;
|
|
2398
|
-
}
|
|
2399
|
-
let closing = -1;
|
|
2400
|
-
let index = modifier.id.length + 2;
|
|
2401
|
-
let counter = 1;
|
|
2402
|
-
let escaping = false;
|
|
2403
|
-
while (index < text.length) {
|
|
2404
|
-
if (text[index] === open && !escaping) {
|
|
2405
|
-
counter++;
|
|
2406
|
-
}
|
|
2407
|
-
if (text[index] === close && !escaping) {
|
|
2408
|
-
counter--;
|
|
2409
|
-
if (counter === 0) {
|
|
2410
|
-
closing = index;
|
|
2411
|
-
break;
|
|
2412
|
-
}
|
|
2413
|
-
}
|
|
2414
|
-
escaping = text[index] === commandStart;
|
|
2415
|
-
index++;
|
|
2416
|
-
}
|
|
2417
|
-
if (closing !== -1) {
|
|
2418
|
-
children.push({
|
|
2419
|
-
type: modifier.name,
|
|
2420
|
-
children: [parseMarkdown(text.substring(modifier.id.length + 2, closing))]
|
|
2421
|
-
});
|
|
2422
|
-
text = text.substring(closing + 1);
|
|
2423
|
-
start = text.indexOf(commandStart);
|
|
2424
|
-
continue;
|
|
2425
|
-
}
|
|
2160
|
+
|
|
2161
|
+
// src/util/loopingArray.ts
|
|
2162
|
+
var LoopingArrayCalculator = class _LoopingArrayCalculator {
|
|
2163
|
+
constructor(length, isLooping = true, allowedOverScroll = 0.1) {
|
|
2164
|
+
if (allowedOverScroll < 0 || length < 1) {
|
|
2165
|
+
throw new Error("Invalid parameters: allowedOverScroll >= 0 and length >= 1 must be true");
|
|
2426
2166
|
}
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
});
|
|
2431
|
-
text = text.substring(1);
|
|
2432
|
-
start = text.indexOf(commandStart);
|
|
2167
|
+
this.length = length;
|
|
2168
|
+
this.isLooping = isLooping;
|
|
2169
|
+
this.allowedOverScroll = allowedOverScroll;
|
|
2433
2170
|
}
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2171
|
+
getCorrectedPosition(position) {
|
|
2172
|
+
if (!this.isLooping) {
|
|
2173
|
+
return Math.max(-this.allowedOverScroll, Math.min(this.allowedOverScroll + this.length - 1, position));
|
|
2174
|
+
}
|
|
2175
|
+
if (position >= this.length) {
|
|
2176
|
+
return position % this.length;
|
|
2177
|
+
}
|
|
2178
|
+
if (position < 0) {
|
|
2179
|
+
return this.length - Math.abs(position) % this.length;
|
|
2180
|
+
}
|
|
2181
|
+
return position;
|
|
2442
2182
|
}
|
|
2443
|
-
|
|
2444
|
-
return
|
|
2183
|
+
static withoutOffset(position) {
|
|
2184
|
+
return position + _LoopingArrayCalculator.getOffset(position);
|
|
2445
2185
|
}
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
return void 0;
|
|
2186
|
+
static getOffset(position) {
|
|
2187
|
+
return Math.round(position) - position;
|
|
2449
2188
|
}
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2189
|
+
/**
|
|
2190
|
+
* @return absolute distance forwards or Infinity when the target cannot be reached (only possible when not isLooping)
|
|
2191
|
+
*/
|
|
2192
|
+
getDistanceDirectional(position, target, direction) {
|
|
2193
|
+
if (!this.isLooping && (position < -this.allowedOverScroll || position > this.allowedOverScroll + this.length - 1)) {
|
|
2194
|
+
throw new Error("Invalid parameters: position is out of bounds.");
|
|
2455
2195
|
}
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2196
|
+
const isForwardInvalid = direction === 1 && position > target;
|
|
2197
|
+
const isBackwardInvalid = direction === -1 && target < position;
|
|
2198
|
+
if (!this.isLooping && (isForwardInvalid || isBackwardInvalid)) {
|
|
2199
|
+
return Infinity;
|
|
2460
2200
|
}
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
} else {
|
|
2470
|
-
children.push(child);
|
|
2471
|
-
}
|
|
2201
|
+
if (direction === -1) {
|
|
2202
|
+
return this.getDistanceDirectional(target, position, 1);
|
|
2203
|
+
}
|
|
2204
|
+
position = this.getCorrectedPosition(position);
|
|
2205
|
+
target = this.getCorrectedPosition(target);
|
|
2206
|
+
let distance = (target - position) * direction;
|
|
2207
|
+
if (distance < 0) {
|
|
2208
|
+
distance = this.length - Math.abs(position) % this.length + target;
|
|
2472
2209
|
}
|
|
2210
|
+
return distance;
|
|
2211
|
+
}
|
|
2212
|
+
getDistanceForward(position, target) {
|
|
2213
|
+
return this.getDistanceDirectional(position, target, 1);
|
|
2214
|
+
}
|
|
2215
|
+
getDistanceBackward(position, target) {
|
|
2216
|
+
return this.getDistanceDirectional(position, target, -1);
|
|
2217
|
+
}
|
|
2218
|
+
getDistance(position, target) {
|
|
2219
|
+
const forwardDistance = this.getDistanceForward(position, target);
|
|
2220
|
+
const backwardDistance = this.getDistanceBackward(position, target);
|
|
2221
|
+
return Math.min(forwardDistance, backwardDistance);
|
|
2222
|
+
}
|
|
2223
|
+
getBestDirection(position, target) {
|
|
2224
|
+
const forwardDistance = this.getDistanceForward(position, target);
|
|
2225
|
+
const backwardDistance = this.getDistanceBackward(position, target);
|
|
2226
|
+
return forwardDistance < backwardDistance ? 1 : -1;
|
|
2473
2227
|
}
|
|
2474
|
-
currentNode.children = children;
|
|
2475
|
-
return currentNode;
|
|
2476
|
-
};
|
|
2477
|
-
var MarkdownInterpreter = ({ text, className }) => {
|
|
2478
|
-
const tree = parseMarkdown(text);
|
|
2479
|
-
const optimizedTree = optimizeTree(tree);
|
|
2480
|
-
return /* @__PURE__ */ jsx20(ASTNodeInterpreter, { node: optimizedTree, isRoot: true, className });
|
|
2481
2228
|
};
|
|
2482
2229
|
|
|
2483
|
-
// src/components/layout-and-navigation/
|
|
2484
|
-
import { jsx as
|
|
2485
|
-
var
|
|
2486
|
-
|
|
2487
|
-
|
|
2230
|
+
// src/components/layout-and-navigation/Carousel.tsx
|
|
2231
|
+
import { Fragment, jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2232
|
+
var Carousel = ({
|
|
2233
|
+
children,
|
|
2234
|
+
animationTime = 200,
|
|
2235
|
+
isLooping = false,
|
|
2236
|
+
isAutoLooping = false,
|
|
2237
|
+
autoLoopingTimeOut = 5e3,
|
|
2238
|
+
autoLoopAnimationTime = 500,
|
|
2239
|
+
hintNext = false,
|
|
2240
|
+
arrows = false,
|
|
2241
|
+
dots = true,
|
|
2242
|
+
overScrollThreshold = 0.1,
|
|
2243
|
+
blurColor = "from-white",
|
|
2244
|
+
className = "",
|
|
2245
|
+
heightClassName = "h-[24rem]",
|
|
2246
|
+
widthClassName = "w-[70%] desktop:w-1/2"
|
|
2488
2247
|
}) => {
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2248
|
+
if (isAutoLooping && !isLooping) {
|
|
2249
|
+
console.error("When isAutoLooping is true, isLooping should also be true");
|
|
2250
|
+
isLooping = true;
|
|
2251
|
+
}
|
|
2252
|
+
const [{
|
|
2253
|
+
currentPosition,
|
|
2254
|
+
dragState,
|
|
2255
|
+
animationState
|
|
2256
|
+
}, setCarouselInformation] = useState11({
|
|
2257
|
+
currentPosition: 0
|
|
2258
|
+
});
|
|
2259
|
+
const animationId = useRef4(void 0);
|
|
2260
|
+
const timeOut = useRef4(void 0);
|
|
2261
|
+
autoLoopingTimeOut = Math.max(0, autoLoopingTimeOut);
|
|
2262
|
+
const length = children.length;
|
|
2263
|
+
const paddingItemCount = 3;
|
|
2264
|
+
const util = useMemo(() => new LoopingArrayCalculator(length, isLooping, overScrollThreshold), [length, isLooping, overScrollThreshold]);
|
|
2265
|
+
const currentIndex = util.getCorrectedPosition(LoopingArrayCalculator.withoutOffset(currentPosition));
|
|
2266
|
+
animationTime = Math.max(200, animationTime);
|
|
2267
|
+
autoLoopAnimationTime = Math.max(200, autoLoopAnimationTime);
|
|
2268
|
+
const getStyleOffset = (index) => {
|
|
2269
|
+
const baseOffset = -50 + (index - currentPosition) * 100;
|
|
2270
|
+
return `${baseOffset}%`;
|
|
2271
|
+
};
|
|
2272
|
+
const animation = useCallback3((time) => {
|
|
2273
|
+
let keepAnimating = true;
|
|
2274
|
+
setCarouselInformation((state) => {
|
|
2275
|
+
const {
|
|
2276
|
+
animationState: animationState2,
|
|
2277
|
+
dragState: dragState2
|
|
2278
|
+
} = state;
|
|
2279
|
+
if (animationState2 === void 0 || dragState2 !== void 0) {
|
|
2280
|
+
keepAnimating = false;
|
|
2281
|
+
return state;
|
|
2282
|
+
}
|
|
2283
|
+
if (!animationState2.startTime || !animationState2.lastUpdateTime) {
|
|
2284
|
+
return {
|
|
2285
|
+
...state,
|
|
2286
|
+
animationState: {
|
|
2287
|
+
...animationState2,
|
|
2288
|
+
startTime: time,
|
|
2289
|
+
lastUpdateTime: time
|
|
2290
|
+
}
|
|
2291
|
+
};
|
|
2292
|
+
}
|
|
2293
|
+
const useAnimationTime = animationState2.isAutoLooping ? autoLoopAnimationTime : animationTime;
|
|
2294
|
+
const progress = clamp((time - animationState2.startTime) / useAnimationTime);
|
|
2295
|
+
const easedProgress = EaseFunctions.easeInEaseOut(progress);
|
|
2296
|
+
const distance = util.getDistanceDirectional(animationState2.startPosition, animationState2.targetPosition, animationState2.direction);
|
|
2297
|
+
const newPosition = util.getCorrectedPosition(easedProgress * distance * animationState2.direction + animationState2.startPosition);
|
|
2298
|
+
if (animationState2.targetPosition === newPosition || progress === 1) {
|
|
2299
|
+
keepAnimating = false;
|
|
2300
|
+
return {
|
|
2301
|
+
currentPosition: LoopingArrayCalculator.withoutOffset(newPosition),
|
|
2302
|
+
animationState: void 0
|
|
2303
|
+
};
|
|
2304
|
+
}
|
|
2305
|
+
return {
|
|
2306
|
+
currentPosition: newPosition,
|
|
2307
|
+
animationState: {
|
|
2308
|
+
...animationState2,
|
|
2309
|
+
lastUpdateTime: time
|
|
2310
|
+
}
|
|
2311
|
+
};
|
|
2312
|
+
});
|
|
2313
|
+
if (keepAnimating) {
|
|
2314
|
+
animationId.current = requestAnimationFrame((time1) => animation(time1));
|
|
2315
|
+
}
|
|
2316
|
+
}, [animationTime, autoLoopAnimationTime, util]);
|
|
2317
|
+
useEffect10(() => {
|
|
2318
|
+
if (animationState) {
|
|
2319
|
+
animationId.current = requestAnimationFrame(animation);
|
|
2320
|
+
}
|
|
2321
|
+
return () => {
|
|
2322
|
+
if (animationId.current) {
|
|
2323
|
+
cancelAnimationFrame(animationId.current);
|
|
2324
|
+
animationId.current = 0;
|
|
2325
|
+
}
|
|
2326
|
+
};
|
|
2327
|
+
}, [animationState]);
|
|
2328
|
+
const startAutoLoop = () => setCarouselInformation((prevState) => ({
|
|
2329
|
+
...prevState,
|
|
2330
|
+
dragState: prevState.dragState,
|
|
2331
|
+
animationState: prevState.animationState || prevState.dragState ? prevState.animationState : {
|
|
2332
|
+
startPosition: currentPosition,
|
|
2333
|
+
targetPosition: (currentPosition + 1) % length,
|
|
2334
|
+
direction: 1,
|
|
2335
|
+
// always move forward
|
|
2336
|
+
isAutoLooping: true
|
|
2337
|
+
}
|
|
2338
|
+
}));
|
|
2339
|
+
useEffect10(() => {
|
|
2340
|
+
if (!animationId.current && !animationState && !dragState && !timeOut.current) {
|
|
2341
|
+
if (autoLoopingTimeOut > 0) {
|
|
2342
|
+
timeOut.current = setTimeout(() => {
|
|
2343
|
+
startAutoLoop();
|
|
2344
|
+
timeOut.current = void 0;
|
|
2345
|
+
}, autoLoopingTimeOut);
|
|
2346
|
+
} else {
|
|
2347
|
+
startAutoLoop();
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
}, [animationState, dragState, animationId.current, timeOut.current]);
|
|
2351
|
+
const startAnimation = (targetPosition) => {
|
|
2352
|
+
if (targetPosition === void 0) {
|
|
2353
|
+
targetPosition = LoopingArrayCalculator.withoutOffset(currentPosition);
|
|
2354
|
+
}
|
|
2355
|
+
if (targetPosition === currentPosition) {
|
|
2522
2356
|
return;
|
|
2523
2357
|
}
|
|
2524
|
-
|
|
2525
|
-
|
|
2358
|
+
const direction = util.getBestDirection(currentPosition, targetPosition);
|
|
2359
|
+
clearTimeout(timeOut.current);
|
|
2360
|
+
timeOut.current = void 0;
|
|
2361
|
+
if (animationId.current) {
|
|
2362
|
+
cancelAnimationFrame(animationId.current);
|
|
2363
|
+
animationId.current = void 0;
|
|
2364
|
+
}
|
|
2365
|
+
setCarouselInformation((prevState) => ({
|
|
2366
|
+
...prevState,
|
|
2367
|
+
dragState: void 0,
|
|
2368
|
+
animationState: {
|
|
2369
|
+
targetPosition,
|
|
2370
|
+
direction,
|
|
2371
|
+
startPosition: currentPosition,
|
|
2372
|
+
isAutoLooping: false
|
|
2373
|
+
},
|
|
2374
|
+
timeOut: void 0
|
|
2375
|
+
}));
|
|
2376
|
+
};
|
|
2377
|
+
const canGoLeft = () => {
|
|
2378
|
+
return isLooping || currentPosition !== 0;
|
|
2379
|
+
};
|
|
2380
|
+
const canGoRight = () => {
|
|
2381
|
+
return isLooping || currentPosition !== length - 1;
|
|
2382
|
+
};
|
|
2383
|
+
const left = () => {
|
|
2384
|
+
if (canGoLeft()) {
|
|
2385
|
+
startAnimation(currentPosition === 0 ? length - 1 : LoopingArrayCalculator.withoutOffset(currentPosition - 1));
|
|
2386
|
+
}
|
|
2526
2387
|
};
|
|
2527
|
-
const
|
|
2528
|
-
if (
|
|
2388
|
+
const right = () => {
|
|
2389
|
+
if (canGoRight()) {
|
|
2390
|
+
startAnimation(LoopingArrayCalculator.withoutOffset((currentPosition + 1) % length));
|
|
2391
|
+
}
|
|
2392
|
+
};
|
|
2393
|
+
let items = children.map((item, index) => ({
|
|
2394
|
+
index,
|
|
2395
|
+
item
|
|
2396
|
+
}));
|
|
2397
|
+
if (isLooping) {
|
|
2398
|
+
const before = createLoopingListWithIndex(children, length - 1, paddingItemCount, false).reverse().map(([index, item]) => ({
|
|
2399
|
+
index,
|
|
2400
|
+
item
|
|
2401
|
+
}));
|
|
2402
|
+
const after = createLoopingListWithIndex(children, 0, paddingItemCount).map(([index, item]) => ({
|
|
2403
|
+
index,
|
|
2404
|
+
item
|
|
2405
|
+
}));
|
|
2406
|
+
items = [
|
|
2407
|
+
...before,
|
|
2408
|
+
...items,
|
|
2409
|
+
...after
|
|
2410
|
+
];
|
|
2411
|
+
}
|
|
2412
|
+
const onDragStart = (x) => setCarouselInformation((prevState) => ({
|
|
2413
|
+
...prevState,
|
|
2414
|
+
dragState: {
|
|
2415
|
+
lastX: x,
|
|
2416
|
+
startX: x,
|
|
2417
|
+
startTime: Date.now(),
|
|
2418
|
+
startIndex: currentPosition
|
|
2419
|
+
},
|
|
2420
|
+
animationState: void 0
|
|
2421
|
+
// cancel animation
|
|
2422
|
+
}));
|
|
2423
|
+
const onDrag = (x, width) => {
|
|
2424
|
+
if (!dragState || x === 0) {
|
|
2529
2425
|
return;
|
|
2530
2426
|
}
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2427
|
+
const offsetUpdate = (dragState.lastX - x) / width;
|
|
2428
|
+
const newPosition = util.getCorrectedPosition(currentPosition + offsetUpdate);
|
|
2429
|
+
setCarouselInformation((prevState) => ({
|
|
2430
|
+
...prevState,
|
|
2431
|
+
currentPosition: newPosition,
|
|
2432
|
+
dragState: {
|
|
2433
|
+
...dragState,
|
|
2434
|
+
lastX: x
|
|
2435
|
+
}
|
|
2436
|
+
}));
|
|
2534
2437
|
};
|
|
2535
|
-
|
|
2536
|
-
if (
|
|
2537
|
-
return
|
|
2538
|
-
clearTimeout(timer);
|
|
2539
|
-
};
|
|
2438
|
+
const onDragEnd = (x, width) => {
|
|
2439
|
+
if (!dragState) {
|
|
2440
|
+
return;
|
|
2540
2441
|
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2442
|
+
const distance = dragState.startX - x;
|
|
2443
|
+
const relativeDistance = distance / width;
|
|
2444
|
+
const duration = Date.now() - dragState.startTime;
|
|
2445
|
+
const velocity = distance / (Date.now() - dragState.startTime);
|
|
2446
|
+
const isSlide = Math.abs(velocity) > 2 || duration < 200 && (Math.abs(relativeDistance) > 0.2 || Math.abs(distance) > 50);
|
|
2447
|
+
if (isSlide) {
|
|
2448
|
+
if (distance > 0 && canGoRight()) {
|
|
2449
|
+
right();
|
|
2450
|
+
return;
|
|
2451
|
+
} else if (distance < 0 && canGoLeft()) {
|
|
2452
|
+
left();
|
|
2453
|
+
return;
|
|
2454
|
+
}
|
|
2545
2455
|
}
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2456
|
+
startAnimation();
|
|
2457
|
+
};
|
|
2458
|
+
const dragHandlers = {
|
|
2459
|
+
draggable: true,
|
|
2460
|
+
onDragStart: (event) => {
|
|
2461
|
+
onDragStart(event.clientX);
|
|
2462
|
+
event.dataTransfer.setDragImage(document.createElement("div"), 0, 0);
|
|
2463
|
+
},
|
|
2464
|
+
onDrag: (event) => onDrag(event.clientX, event.target.getBoundingClientRect().width),
|
|
2465
|
+
onDragEnd: (event) => onDragEnd(event.clientX, event.target.getBoundingClientRect().width),
|
|
2466
|
+
onTouchStart: (event) => onDragStart(event.touches[0].clientX),
|
|
2467
|
+
onTouchMove: (event) => onDrag(event.touches[0].clientX, event.target.getBoundingClientRect().width),
|
|
2468
|
+
onTouchEnd: (event) => onDragEnd(event.changedTouches[0].clientX, event.target.getBoundingClientRect().width),
|
|
2469
|
+
onTouchCancel: (event) => onDragEnd(event.changedTouches[0].clientX, event.target.getBoundingClientRect().width)
|
|
2551
2470
|
};
|
|
2471
|
+
return /* @__PURE__ */ jsxs14("div", { className: "col items-center w-full gap-y-2", children: [
|
|
2472
|
+
/* @__PURE__ */ jsxs14("div", { className: clsx17(`relative w-full overflow-hidden`, heightClassName, className), children: [
|
|
2473
|
+
arrows && /* @__PURE__ */ jsxs14(Fragment, { children: [
|
|
2474
|
+
/* @__PURE__ */ jsx20(
|
|
2475
|
+
"div",
|
|
2476
|
+
{
|
|
2477
|
+
className: clsx17("absolute z-10 left-0 top-1/2 -translate-y-1/2 bg-gray-200 hover:bg-gray-300 rounded-lg cursor-pointer border-black border-2", { hidden: !canGoLeft() }),
|
|
2478
|
+
onClick: () => left(),
|
|
2479
|
+
children: /* @__PURE__ */ jsx20(ChevronLeft, { size: 32 })
|
|
2480
|
+
}
|
|
2481
|
+
),
|
|
2482
|
+
/* @__PURE__ */ jsx20(
|
|
2483
|
+
"div",
|
|
2484
|
+
{
|
|
2485
|
+
className: clsx17("absolute z-10 right-0 top-1/2 -translate-y-1/2 bg-gray-200 hover:bg-gray-300 rounded-lg cursor-pointer border-black border-2", { hidden: !canGoRight() }),
|
|
2486
|
+
onClick: () => right(),
|
|
2487
|
+
children: /* @__PURE__ */ jsx20(ChevronRight, { size: 32 })
|
|
2488
|
+
}
|
|
2489
|
+
)
|
|
2490
|
+
] }),
|
|
2491
|
+
hintNext ? /* @__PURE__ */ jsxs14("div", { className: clsx17(`relative row h-full`, heightClassName), children: [
|
|
2492
|
+
/* @__PURE__ */ jsx20("div", { className: "relative row h-full w-full px-2 overflow-hidden", children: items.map(({
|
|
2493
|
+
item,
|
|
2494
|
+
index
|
|
2495
|
+
}, listIndex) => /* @__PURE__ */ jsx20(
|
|
2496
|
+
"div",
|
|
2497
|
+
{
|
|
2498
|
+
className: clsx17(`absolute left-[50%] h-full overflow-hidden`, widthClassName, { "!cursor-grabbing": !!dragState }),
|
|
2499
|
+
style: { translate: getStyleOffset(listIndex - (isLooping ? paddingItemCount : 0)) },
|
|
2500
|
+
...dragHandlers,
|
|
2501
|
+
onClick: () => startAnimation(index),
|
|
2502
|
+
children: item
|
|
2503
|
+
},
|
|
2504
|
+
listIndex
|
|
2505
|
+
)) }),
|
|
2506
|
+
/* @__PURE__ */ jsx20(
|
|
2507
|
+
"div",
|
|
2508
|
+
{
|
|
2509
|
+
className: clsx17(`hidden pointer-events-none desktop:block absolute left-0 h-full w-[20%] bg-gradient-to-r to-transparent`, blurColor)
|
|
2510
|
+
}
|
|
2511
|
+
),
|
|
2512
|
+
/* @__PURE__ */ jsx20(
|
|
2513
|
+
"div",
|
|
2514
|
+
{
|
|
2515
|
+
className: clsx17(`hidden pointer-events-none desktop:block absolute right-0 h-full w-[20%] bg-gradient-to-l to-transparent`, blurColor)
|
|
2516
|
+
}
|
|
2517
|
+
)
|
|
2518
|
+
] }) : /* @__PURE__ */ jsx20("div", { className: clsx17("px-16 h-full", { "!cursor-grabbing": !!dragState }), ...dragHandlers, children: children[currentIndex] })
|
|
2519
|
+
] }),
|
|
2520
|
+
dots && /* @__PURE__ */ jsx20(
|
|
2521
|
+
"div",
|
|
2522
|
+
{
|
|
2523
|
+
className: "row items-center justify-center w-full my-2",
|
|
2524
|
+
children: range(0, length - 1).map((index) => /* @__PURE__ */ jsx20(
|
|
2525
|
+
"button",
|
|
2526
|
+
{
|
|
2527
|
+
className: clsx17("w-[2rem] min-w-[2rem] h-[0.75rem] min-h-[0.75rem] hover:bg-primary hover:brightness-90 first:rounded-l-md last:rounded-r-md", {
|
|
2528
|
+
"bg-gray-200": currentIndex !== index,
|
|
2529
|
+
"bg-primary": currentIndex === index
|
|
2530
|
+
}),
|
|
2531
|
+
onClick: () => startAnimation(index)
|
|
2532
|
+
},
|
|
2533
|
+
index
|
|
2534
|
+
))
|
|
2535
|
+
}
|
|
2536
|
+
)
|
|
2537
|
+
] });
|
|
2552
2538
|
};
|
|
2553
2539
|
|
|
2554
|
-
// src/components/
|
|
2555
|
-
import
|
|
2556
|
-
import { jsx as
|
|
2557
|
-
var
|
|
2558
|
-
tooltip,
|
|
2540
|
+
// src/components/layout-and-navigation/Chip.tsx
|
|
2541
|
+
import clsx18 from "clsx";
|
|
2542
|
+
import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2543
|
+
var Chip = ({
|
|
2559
2544
|
children,
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2545
|
+
trailingIcon,
|
|
2546
|
+
color = "default",
|
|
2547
|
+
variant = "normal",
|
|
2548
|
+
className = "",
|
|
2549
|
+
...restProps
|
|
2565
2550
|
}) => {
|
|
2566
|
-
const
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
};
|
|
2586
|
-
return /* @__PURE__ */ jsxs13(
|
|
2551
|
+
const colorMapping = {
|
|
2552
|
+
default: "text-tag-default-text bg-tag-default-background",
|
|
2553
|
+
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
2554
|
+
red: "text-tag-red-text bg-tag-red-background",
|
|
2555
|
+
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
2556
|
+
green: "text-tag-green-text bg-tag-green-background",
|
|
2557
|
+
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
2558
|
+
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
2559
|
+
}[color];
|
|
2560
|
+
const colorMappingIcon = {
|
|
2561
|
+
default: "text-tag-default-icon",
|
|
2562
|
+
dark: "text-tag-dark-icon",
|
|
2563
|
+
red: "text-tag-red-icon",
|
|
2564
|
+
yellow: "text-tag-yellow-icon",
|
|
2565
|
+
green: "text-tag-green-icon",
|
|
2566
|
+
blue: "text-tag-blue-icon",
|
|
2567
|
+
pink: "text-tag-pink-icon"
|
|
2568
|
+
}[color];
|
|
2569
|
+
return /* @__PURE__ */ jsxs15(
|
|
2587
2570
|
"div",
|
|
2588
2571
|
{
|
|
2589
|
-
|
|
2590
|
-
|
|
2572
|
+
...restProps,
|
|
2573
|
+
className: clsx18(
|
|
2574
|
+
`row w-fit px-2 py-1`,
|
|
2575
|
+
colorMapping,
|
|
2576
|
+
{
|
|
2577
|
+
"rounded-md": variant === "normal",
|
|
2578
|
+
"rounded-full": variant === "fullyRounded"
|
|
2579
|
+
},
|
|
2580
|
+
className
|
|
2581
|
+
),
|
|
2591
2582
|
children: [
|
|
2592
2583
|
children,
|
|
2593
|
-
|
|
2594
|
-
"div",
|
|
2595
|
-
{
|
|
2596
|
-
className: clsx18(
|
|
2597
|
-
`opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
|
|
2598
|
-
animate-tooltip-fade-in shadow-lg bg-tooltip-background`,
|
|
2599
|
-
positionClasses[position],
|
|
2600
|
-
tooltipClassName
|
|
2601
|
-
),
|
|
2602
|
-
style: { zIndex, animationDelay: animationDelay + "ms" },
|
|
2603
|
-
children: [
|
|
2604
|
-
tooltip,
|
|
2605
|
-
/* @__PURE__ */ jsx22(
|
|
2606
|
-
"div",
|
|
2607
|
-
{
|
|
2608
|
-
className: clsx18(`absolute w-0 h-0`, triangleClasses[position]),
|
|
2609
|
-
style: { ...triangleStyle[position], zIndex }
|
|
2610
|
-
}
|
|
2611
|
-
)
|
|
2612
|
-
]
|
|
2613
|
-
}
|
|
2614
|
-
)
|
|
2584
|
+
trailingIcon && /* @__PURE__ */ jsx21("span", { className: colorMappingIcon, children: trailingIcon })
|
|
2615
2585
|
]
|
|
2616
2586
|
}
|
|
2617
|
-
);
|
|
2587
|
+
);
|
|
2588
|
+
};
|
|
2589
|
+
var ChipList = ({
|
|
2590
|
+
list,
|
|
2591
|
+
className = ""
|
|
2592
|
+
}) => {
|
|
2593
|
+
return /* @__PURE__ */ jsx21("div", { className: clsx18("flex flex-wrap gap-x-4 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ jsx21(
|
|
2594
|
+
Chip,
|
|
2595
|
+
{
|
|
2596
|
+
...value,
|
|
2597
|
+
color: value.color ?? "dark",
|
|
2598
|
+
variant: value.variant ?? "normal",
|
|
2599
|
+
children: value.children
|
|
2600
|
+
},
|
|
2601
|
+
index
|
|
2602
|
+
)) });
|
|
2603
|
+
};
|
|
2604
|
+
|
|
2605
|
+
// src/components/layout-and-navigation/DividerInserter.tsx
|
|
2606
|
+
import clsx19 from "clsx";
|
|
2607
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2608
|
+
var DividerInserter = ({
|
|
2609
|
+
children,
|
|
2610
|
+
divider,
|
|
2611
|
+
className,
|
|
2612
|
+
...restProps
|
|
2613
|
+
}) => {
|
|
2614
|
+
const nodes = [];
|
|
2615
|
+
for (let index = 0; index < children.length; index++) {
|
|
2616
|
+
const element = children[index];
|
|
2617
|
+
if (element !== void 0) {
|
|
2618
|
+
nodes.push(element);
|
|
2619
|
+
if (index < children.length - 1) {
|
|
2620
|
+
nodes.push(divider(index));
|
|
2621
|
+
}
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
return /* @__PURE__ */ jsx22("div", { className: clsx19(className), ...restProps, children: nodes });
|
|
2618
2625
|
};
|
|
2619
2626
|
|
|
2620
|
-
// src/components/layout-and-navigation/
|
|
2621
|
-
import
|
|
2622
|
-
import {
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2627
|
+
// src/components/layout-and-navigation/FAQSection.tsx
|
|
2628
|
+
import clsx20 from "clsx";
|
|
2629
|
+
import { ChevronDown as ChevronDown3, ChevronUp as ChevronUp2 } from "lucide-react";
|
|
2630
|
+
|
|
2631
|
+
// src/components/layout-and-navigation/MarkdownInterpreter.tsx
|
|
2632
|
+
import { Fragment as Fragment2, jsx as jsx23 } from "react/jsx-runtime";
|
|
2633
|
+
var astNodeInserterType = ["helpwave", "newline"];
|
|
2634
|
+
var ASTNodeInterpreter = ({
|
|
2635
|
+
node,
|
|
2636
|
+
isRoot = false,
|
|
2637
|
+
className = ""
|
|
2628
2638
|
}) => {
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2639
|
+
switch (node.type) {
|
|
2640
|
+
case "newline":
|
|
2641
|
+
return /* @__PURE__ */ jsx23("br", {});
|
|
2642
|
+
case "text":
|
|
2643
|
+
return isRoot ? /* @__PURE__ */ jsx23("span", { className, children: node.text }) : node.text;
|
|
2644
|
+
case "helpwave":
|
|
2645
|
+
return /* @__PURE__ */ jsx23("span", { className: "font-bold font-space no-underline", children: "helpwave" });
|
|
2646
|
+
case "none":
|
|
2647
|
+
return isRoot ? /* @__PURE__ */ jsx23("span", { className, children: node.children.map((value, index) => /* @__PURE__ */ jsx23(
|
|
2648
|
+
ASTNodeInterpreter,
|
|
2638
2649
|
{
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
),
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2650
|
+
node: value
|
|
2651
|
+
},
|
|
2652
|
+
index
|
|
2653
|
+
)) }) : /* @__PURE__ */ jsx23(Fragment2, { children: node.children.map((value, index) => /* @__PURE__ */ jsx23(ASTNodeInterpreter, { node: value }, index)) });
|
|
2654
|
+
case "bold":
|
|
2655
|
+
return /* @__PURE__ */ jsx23("b", { children: node.children.map((value, index) => /* @__PURE__ */ jsx23(ASTNodeInterpreter, { node: value }, index)) });
|
|
2656
|
+
case "italic":
|
|
2657
|
+
return /* @__PURE__ */ jsx23("i", { children: node.children.map((value, index) => /* @__PURE__ */ jsx23(ASTNodeInterpreter, { node: value }, index)) });
|
|
2658
|
+
case "underline":
|
|
2659
|
+
return /* @__PURE__ */ jsx23("u", { children: node.children.map((value, index) => /* @__PURE__ */ jsx23(ASTNodeInterpreter, { node: value }, index)) });
|
|
2660
|
+
case "font-space":
|
|
2661
|
+
return /* @__PURE__ */ jsx23("span", { className: "font-space", children: node.children.map((value, index) => /* @__PURE__ */ jsx23(
|
|
2662
|
+
ASTNodeInterpreter,
|
|
2663
|
+
{
|
|
2664
|
+
node: value
|
|
2665
|
+
},
|
|
2666
|
+
index
|
|
2667
|
+
)) });
|
|
2668
|
+
case "primary":
|
|
2669
|
+
return /* @__PURE__ */ jsx23("span", { className: "text-primary", children: node.children.map((value, index) => /* @__PURE__ */ jsx23(
|
|
2670
|
+
ASTNodeInterpreter,
|
|
2671
|
+
{
|
|
2672
|
+
node: value
|
|
2673
|
+
},
|
|
2674
|
+
index
|
|
2675
|
+
)) });
|
|
2676
|
+
case "secondary":
|
|
2677
|
+
return /* @__PURE__ */ jsx23("span", { className: "text-secondary", children: node.children.map((value, index) => /* @__PURE__ */ jsx23(
|
|
2678
|
+
ASTNodeInterpreter,
|
|
2679
|
+
{
|
|
2680
|
+
node: value
|
|
2681
|
+
},
|
|
2682
|
+
index
|
|
2683
|
+
)) });
|
|
2684
|
+
case "warn":
|
|
2685
|
+
return /* @__PURE__ */ jsx23("span", { className: "text-warning", children: node.children.map((value, index) => /* @__PURE__ */ jsx23(
|
|
2686
|
+
ASTNodeInterpreter,
|
|
2687
|
+
{
|
|
2688
|
+
node: value
|
|
2689
|
+
},
|
|
2690
|
+
index
|
|
2691
|
+
)) });
|
|
2692
|
+
case "positive":
|
|
2693
|
+
return /* @__PURE__ */ jsx23("span", { className: "text-positive", children: node.children.map((value, index) => /* @__PURE__ */ jsx23(
|
|
2694
|
+
ASTNodeInterpreter,
|
|
2695
|
+
{
|
|
2696
|
+
node: value
|
|
2697
|
+
},
|
|
2698
|
+
index
|
|
2699
|
+
)) });
|
|
2700
|
+
case "negative":
|
|
2701
|
+
return /* @__PURE__ */ jsx23("span", { className: "text-negative", children: node.children.map((value, index) => /* @__PURE__ */ jsx23(
|
|
2702
|
+
ASTNodeInterpreter,
|
|
2703
|
+
{
|
|
2704
|
+
node: value
|
|
2705
|
+
},
|
|
2706
|
+
index
|
|
2707
|
+
)) });
|
|
2708
|
+
default:
|
|
2709
|
+
return null;
|
|
2655
2710
|
}
|
|
2656
2711
|
};
|
|
2657
|
-
var
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
)
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
] });
|
|
2683
|
-
};
|
|
2684
|
-
var Modal = ({
|
|
2685
|
-
children,
|
|
2686
|
-
isOpen,
|
|
2687
|
-
onClose,
|
|
2688
|
-
className,
|
|
2689
|
-
backgroundClassName,
|
|
2690
|
-
headerProps
|
|
2691
|
-
}) => {
|
|
2692
|
-
const ref = useRef4(null);
|
|
2693
|
-
useEffect10(() => {
|
|
2694
|
-
if (!isOpen) return;
|
|
2695
|
-
const modal = ref.current;
|
|
2696
|
-
if (!modal) {
|
|
2697
|
-
console.error("modal open, but no ref found");
|
|
2698
|
-
return;
|
|
2712
|
+
var modifierIdentifierMapping = [
|
|
2713
|
+
{ id: "i", name: "italic" },
|
|
2714
|
+
{ id: "b", name: "bold" },
|
|
2715
|
+
{ id: "u", name: "underline" },
|
|
2716
|
+
{ id: "space", name: "font-space" },
|
|
2717
|
+
{ id: "primary", name: "primary" },
|
|
2718
|
+
{ id: "secondary", name: "secondary" },
|
|
2719
|
+
{ id: "warn", name: "warn" },
|
|
2720
|
+
{ id: "positive", name: "positive" },
|
|
2721
|
+
{ id: "negative", name: "negative" }
|
|
2722
|
+
];
|
|
2723
|
+
var inserterIdentifierMapping = [
|
|
2724
|
+
{ id: "helpwave", name: "helpwave" },
|
|
2725
|
+
{ id: "newline", name: "newline" }
|
|
2726
|
+
];
|
|
2727
|
+
var parseMarkdown = (text, commandStart = "\\", open = "{", close = "}") => {
|
|
2728
|
+
let start = text.indexOf(commandStart);
|
|
2729
|
+
const children = [];
|
|
2730
|
+
while (text !== "") {
|
|
2731
|
+
if (start === -1) {
|
|
2732
|
+
children.push({
|
|
2733
|
+
type: "text",
|
|
2734
|
+
text
|
|
2735
|
+
});
|
|
2736
|
+
break;
|
|
2699
2737
|
}
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2738
|
+
children.push(parseMarkdown(text.substring(0, start)));
|
|
2739
|
+
text = text.substring(start);
|
|
2740
|
+
if (text.length <= 1) {
|
|
2741
|
+
children.push({
|
|
2742
|
+
type: "text",
|
|
2743
|
+
text
|
|
2744
|
+
});
|
|
2745
|
+
text = "";
|
|
2746
|
+
continue;
|
|
2747
|
+
}
|
|
2748
|
+
const simpleReplace = [commandStart, open, close];
|
|
2749
|
+
if (simpleReplace.some((value) => text[1] === value)) {
|
|
2750
|
+
children.push({
|
|
2751
|
+
type: "text",
|
|
2752
|
+
text: simpleReplace.find((value) => text[1] === value)
|
|
2753
|
+
});
|
|
2754
|
+
text = text.substring(2);
|
|
2755
|
+
start = text.indexOf(commandStart);
|
|
2756
|
+
continue;
|
|
2757
|
+
}
|
|
2758
|
+
const inserter = inserterIdentifierMapping.find((value) => text.substring(1).startsWith(value.id));
|
|
2759
|
+
if (inserter) {
|
|
2760
|
+
children.push({
|
|
2761
|
+
type: inserter.name
|
|
2762
|
+
});
|
|
2763
|
+
text = text.substring(inserter.id.length + 1);
|
|
2764
|
+
start = text.indexOf(commandStart);
|
|
2765
|
+
continue;
|
|
2766
|
+
}
|
|
2767
|
+
const modifier = modifierIdentifierMapping.find((value) => text.substring(1).startsWith(value.id));
|
|
2768
|
+
if (modifier) {
|
|
2769
|
+
if (text[modifier.id.length + 1] !== open) {
|
|
2770
|
+
children.push({
|
|
2771
|
+
type: "text",
|
|
2772
|
+
text: text.substring(0, modifier.id.length + 1)
|
|
2773
|
+
});
|
|
2774
|
+
text = text.substring(modifier.id.length + 2);
|
|
2775
|
+
start = text.indexOf(commandStart);
|
|
2776
|
+
continue;
|
|
2721
2777
|
}
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
children: /* @__PURE__ */ jsxs14(
|
|
2737
|
-
"div",
|
|
2738
|
-
{
|
|
2739
|
-
ref,
|
|
2740
|
-
tabIndex: -1,
|
|
2741
|
-
className: clsx19(
|
|
2742
|
-
"fixed left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 col p-4 bg-overlay-background text-overlay-text rounded-xl shadow-xl",
|
|
2743
|
-
className
|
|
2744
|
-
),
|
|
2745
|
-
role: "dialog",
|
|
2746
|
-
"aria-modal": true,
|
|
2747
|
-
children: [
|
|
2748
|
-
/* @__PURE__ */ jsx23(ModalHeader, { ...headerProps, onCloseClick: onClose }),
|
|
2749
|
-
children
|
|
2750
|
-
]
|
|
2778
|
+
let closing = -1;
|
|
2779
|
+
let index = modifier.id.length + 2;
|
|
2780
|
+
let counter = 1;
|
|
2781
|
+
let escaping = false;
|
|
2782
|
+
while (index < text.length) {
|
|
2783
|
+
if (text[index] === open && !escaping) {
|
|
2784
|
+
counter++;
|
|
2785
|
+
}
|
|
2786
|
+
if (text[index] === close && !escaping) {
|
|
2787
|
+
counter--;
|
|
2788
|
+
if (counter === 0) {
|
|
2789
|
+
closing = index;
|
|
2790
|
+
break;
|
|
2791
|
+
}
|
|
2751
2792
|
}
|
|
2752
|
-
|
|
2793
|
+
escaping = text[index] === commandStart;
|
|
2794
|
+
index++;
|
|
2795
|
+
}
|
|
2796
|
+
if (closing !== -1) {
|
|
2797
|
+
children.push({
|
|
2798
|
+
type: modifier.name,
|
|
2799
|
+
children: [parseMarkdown(text.substring(modifier.id.length + 2, closing))]
|
|
2800
|
+
});
|
|
2801
|
+
text = text.substring(closing + 1);
|
|
2802
|
+
start = text.indexOf(commandStart);
|
|
2803
|
+
continue;
|
|
2804
|
+
}
|
|
2753
2805
|
}
|
|
2754
|
-
|
|
2806
|
+
children.push({
|
|
2807
|
+
type: "text",
|
|
2808
|
+
text: text[0]
|
|
2809
|
+
});
|
|
2810
|
+
text = text.substring(1);
|
|
2811
|
+
start = text.indexOf(commandStart);
|
|
2812
|
+
}
|
|
2813
|
+
return {
|
|
2814
|
+
type: "none",
|
|
2815
|
+
children
|
|
2816
|
+
};
|
|
2755
2817
|
};
|
|
2756
|
-
var
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2818
|
+
var optimizeTree = (node) => {
|
|
2819
|
+
if (node.type === "text") {
|
|
2820
|
+
return !node.text ? void 0 : node;
|
|
2821
|
+
}
|
|
2822
|
+
if (astNodeInserterType.some((value) => value === node.type)) {
|
|
2823
|
+
return node;
|
|
2824
|
+
}
|
|
2825
|
+
const currentNode = node;
|
|
2826
|
+
if (currentNode.children.length === 0) {
|
|
2827
|
+
return void 0;
|
|
2828
|
+
}
|
|
2829
|
+
let children = [];
|
|
2830
|
+
for (let i = 0; i < currentNode.children.length; i++) {
|
|
2831
|
+
const child = optimizeTree(currentNode.children[i]);
|
|
2832
|
+
if (!child) {
|
|
2833
|
+
continue;
|
|
2771
2834
|
}
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
last.focus();
|
|
2788
|
-
} else if (!e.shiftKey && document.activeElement === last) {
|
|
2789
|
-
e.preventDefault();
|
|
2790
|
-
first.focus();
|
|
2791
|
-
}
|
|
2835
|
+
if (child.type === "none") {
|
|
2836
|
+
children.push(...child.children);
|
|
2837
|
+
} else {
|
|
2838
|
+
children.push(child);
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
currentNode.children = children;
|
|
2842
|
+
children = [];
|
|
2843
|
+
for (let i = 0; i < currentNode.children.length; i++) {
|
|
2844
|
+
const child = currentNode.children[i];
|
|
2845
|
+
if (child) {
|
|
2846
|
+
if (child.type === "text" && children[children.length - 1]?.type === "text") {
|
|
2847
|
+
children[children.length - 1].text += child.text;
|
|
2848
|
+
} else {
|
|
2849
|
+
children.push(child);
|
|
2792
2850
|
}
|
|
2793
|
-
};
|
|
2794
|
-
dialog.focus();
|
|
2795
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
2796
|
-
return () => {
|
|
2797
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
2798
|
-
overlayStack = overlayStack.filter((m) => m !== dialog);
|
|
2799
|
-
};
|
|
2800
|
-
}, [isOpen]);
|
|
2801
|
-
return /* @__PURE__ */ jsx23(
|
|
2802
|
-
Overlay,
|
|
2803
|
-
{
|
|
2804
|
-
isOpen,
|
|
2805
|
-
backgroundClassName,
|
|
2806
|
-
children: /* @__PURE__ */ jsxs14(
|
|
2807
|
-
"div",
|
|
2808
|
-
{
|
|
2809
|
-
ref,
|
|
2810
|
-
tabIndex: -1,
|
|
2811
|
-
className: clsx19(
|
|
2812
|
-
"fixed left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 col p-4 bg-overlay-background text-overlay-text rounded-xl shadow-xl",
|
|
2813
|
-
className
|
|
2814
|
-
),
|
|
2815
|
-
role: "dialog",
|
|
2816
|
-
"aria-modal": true,
|
|
2817
|
-
children: [
|
|
2818
|
-
title ?? /* @__PURE__ */ jsx23(
|
|
2819
|
-
"h2",
|
|
2820
|
-
{
|
|
2821
|
-
className: clsx19("textstyle-title-lg"),
|
|
2822
|
-
children: titleText
|
|
2823
|
-
}
|
|
2824
|
-
),
|
|
2825
|
-
children
|
|
2826
|
-
]
|
|
2827
|
-
}
|
|
2828
|
-
)
|
|
2829
2851
|
}
|
|
2830
|
-
|
|
2852
|
+
}
|
|
2853
|
+
currentNode.children = children;
|
|
2854
|
+
return currentNode;
|
|
2855
|
+
};
|
|
2856
|
+
var MarkdownInterpreter = ({ text, className }) => {
|
|
2857
|
+
const tree = parseMarkdown(text);
|
|
2858
|
+
const optimizedTree = optimizeTree(tree);
|
|
2859
|
+
return /* @__PURE__ */ jsx23(ASTNodeInterpreter, { node: optimizedTree, isRoot: true, className });
|
|
2860
|
+
};
|
|
2861
|
+
|
|
2862
|
+
// src/components/layout-and-navigation/FAQSection.tsx
|
|
2863
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2864
|
+
var FAQSection = ({
|
|
2865
|
+
entries,
|
|
2866
|
+
expandableClassName
|
|
2867
|
+
}) => {
|
|
2868
|
+
const chevronSize = 28;
|
|
2869
|
+
return /* @__PURE__ */ jsx24("div", { className: "col gap-y-4", children: entries.map(({ id, title, content, ...restProps }) => /* @__PURE__ */ jsx24(
|
|
2870
|
+
Expandable,
|
|
2871
|
+
{
|
|
2872
|
+
...restProps,
|
|
2873
|
+
label: /* @__PURE__ */ jsx24("h3", { id, className: "textstyle-title-md", children: title }),
|
|
2874
|
+
clickOnlyOnHeader: false,
|
|
2875
|
+
icon: (expanded) => expanded ? /* @__PURE__ */ jsx24(ChevronUp2, { size: chevronSize, className: "text-primary", style: { minWidth: `${chevronSize}px` } }) : /* @__PURE__ */ jsx24(ChevronDown3, { size: chevronSize, className: "text-primary" }),
|
|
2876
|
+
className: clsx20("rounded-xl", expandableClassName),
|
|
2877
|
+
headerClassName: "px-6 py-4",
|
|
2878
|
+
children: /* @__PURE__ */ jsx24("div", { className: "mt-2 px-6 pb-4", children: content.type === "markdown" ? /* @__PURE__ */ jsx24(MarkdownInterpreter, { text: content.value }) : content.value })
|
|
2879
|
+
},
|
|
2880
|
+
id
|
|
2881
|
+
)) });
|
|
2831
2882
|
};
|
|
2832
2883
|
|
|
2833
2884
|
// src/components/layout-and-navigation/Pagination.tsx
|
|
2834
2885
|
import { ChevronFirst, ChevronLast, ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
2835
|
-
import
|
|
2836
|
-
import { jsx as
|
|
2886
|
+
import clsx21 from "clsx";
|
|
2887
|
+
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2837
2888
|
var defaultPaginationTranslations = {
|
|
2838
2889
|
en: {
|
|
2839
2890
|
of: "of"
|
|
@@ -2855,23 +2906,23 @@ var Pagination = ({
|
|
|
2855
2906
|
const noPages = numberOfPages === 0;
|
|
2856
2907
|
const onFirstPage = page === 0 && !noPages;
|
|
2857
2908
|
const onLastPage = page === numberOfPages - 1;
|
|
2858
|
-
return /* @__PURE__ */
|
|
2859
|
-
/* @__PURE__ */
|
|
2860
|
-
/* @__PURE__ */
|
|
2861
|
-
/* @__PURE__ */
|
|
2862
|
-
/* @__PURE__ */
|
|
2863
|
-
/* @__PURE__ */
|
|
2864
|
-
/* @__PURE__ */
|
|
2909
|
+
return /* @__PURE__ */ jsxs16("div", { className: clsx21("row", { "opacity-30": noPages }), children: [
|
|
2910
|
+
/* @__PURE__ */ jsx25("button", { onClick: () => changePage(0), disabled: onFirstPage, children: /* @__PURE__ */ jsx25(ChevronFirst, { className: clsx21({ "opacity-30": onFirstPage }) }) }),
|
|
2911
|
+
/* @__PURE__ */ jsx25("button", { onClick: () => changePage(page - 1), disabled: onFirstPage, children: /* @__PURE__ */ jsx25(ChevronLeft2, { className: clsx21({ "opacity-30": onFirstPage }) }) }),
|
|
2912
|
+
/* @__PURE__ */ jsxs16("div", { className: "min-w-[80px] justify-center mx-2", children: [
|
|
2913
|
+
/* @__PURE__ */ jsx25("span", { className: "select-none text-right flex-1", children: noPages ? 0 : page + 1 }),
|
|
2914
|
+
/* @__PURE__ */ jsx25("span", { className: "select-none mx-2", children: translation.of }),
|
|
2915
|
+
/* @__PURE__ */ jsx25("span", { className: "select-none text-left flex-1", children: numberOfPages })
|
|
2865
2916
|
] }),
|
|
2866
|
-
/* @__PURE__ */
|
|
2867
|
-
/* @__PURE__ */
|
|
2917
|
+
/* @__PURE__ */ jsx25("button", { onClick: () => changePage(page + 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ jsx25(ChevronRight2, { className: clsx21({ "opacity-30": onLastPage }) }) }),
|
|
2918
|
+
/* @__PURE__ */ jsx25("button", { onClick: () => changePage(numberOfPages - 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ jsx25(ChevronLast, { className: clsx21({ "opacity-30": onLastPage }) }) })
|
|
2868
2919
|
] });
|
|
2869
2920
|
};
|
|
2870
2921
|
|
|
2871
2922
|
// src/components/layout-and-navigation/SearchableList.tsx
|
|
2872
2923
|
import { useEffect as useEffect13, useMemo as useMemo2, useState as useState14 } from "react";
|
|
2873
2924
|
import { Search } from "lucide-react";
|
|
2874
|
-
import
|
|
2925
|
+
import clsx24 from "clsx";
|
|
2875
2926
|
|
|
2876
2927
|
// src/util/simpleSearch.ts
|
|
2877
2928
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -2895,7 +2946,7 @@ var SimpleSearch = (search, objects) => {
|
|
|
2895
2946
|
|
|
2896
2947
|
// src/components/user-action/Input.tsx
|
|
2897
2948
|
import { forwardRef as forwardRef2, useEffect as useEffect12, useRef as useRef5, useState as useState13 } from "react";
|
|
2898
|
-
import
|
|
2949
|
+
import clsx23 from "clsx";
|
|
2899
2950
|
|
|
2900
2951
|
// src/hooks/useSaveDelay.ts
|
|
2901
2952
|
import { useEffect as useEffect11, useState as useState12 } from "react";
|
|
@@ -2938,8 +2989,8 @@ function useSaveDelay(setNotificationStatus, delay) {
|
|
|
2938
2989
|
}
|
|
2939
2990
|
|
|
2940
2991
|
// src/components/user-action/Label.tsx
|
|
2941
|
-
import
|
|
2942
|
-
import { jsx as
|
|
2992
|
+
import clsx22 from "clsx";
|
|
2993
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2943
2994
|
var styleMapping = {
|
|
2944
2995
|
labelSmall: "textstyle-label-sm",
|
|
2945
2996
|
labelMedium: "textstyle-label-md",
|
|
@@ -2952,11 +3003,11 @@ var Label = ({
|
|
|
2952
3003
|
className,
|
|
2953
3004
|
...props
|
|
2954
3005
|
}) => {
|
|
2955
|
-
return /* @__PURE__ */
|
|
3006
|
+
return /* @__PURE__ */ jsx26("label", { ...props, className: clsx22(styleMapping[labelType], className), children: children ? children : name });
|
|
2956
3007
|
};
|
|
2957
3008
|
|
|
2958
3009
|
// src/components/user-action/Input.tsx
|
|
2959
|
-
import { jsx as
|
|
3010
|
+
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2960
3011
|
var Input = ({
|
|
2961
3012
|
id,
|
|
2962
3013
|
type = "text",
|
|
@@ -2982,9 +3033,9 @@ var Input = ({
|
|
|
2982
3033
|
ref.current?.focus();
|
|
2983
3034
|
}
|
|
2984
3035
|
}, [autoFocus]);
|
|
2985
|
-
return /* @__PURE__ */
|
|
2986
|
-
label && /* @__PURE__ */
|
|
2987
|
-
/* @__PURE__ */
|
|
3036
|
+
return /* @__PURE__ */ jsxs17("div", { className: clsx23({ "w-full": expanded }, containerClassName), children: [
|
|
3037
|
+
label && /* @__PURE__ */ jsx27(Label, { ...label, htmlFor: id, className: clsx23("mb-1", label.className) }),
|
|
3038
|
+
/* @__PURE__ */ jsx27(
|
|
2988
3039
|
"input",
|
|
2989
3040
|
{
|
|
2990
3041
|
ref,
|
|
@@ -3023,7 +3074,7 @@ var InputUncontrolled = ({
|
|
|
3023
3074
|
...props
|
|
3024
3075
|
}) => {
|
|
3025
3076
|
const [value, setValue] = useState13(defaultValue);
|
|
3026
|
-
return /* @__PURE__ */
|
|
3077
|
+
return /* @__PURE__ */ jsx27(
|
|
3027
3078
|
Input,
|
|
3028
3079
|
{
|
|
3029
3080
|
...props,
|
|
@@ -3046,13 +3097,13 @@ var FormInput = forwardRef2(function FormInput2({
|
|
|
3046
3097
|
required,
|
|
3047
3098
|
...restProps
|
|
3048
3099
|
}, ref) {
|
|
3049
|
-
const input = /* @__PURE__ */
|
|
3100
|
+
const input = /* @__PURE__ */ jsx27(
|
|
3050
3101
|
"input",
|
|
3051
3102
|
{
|
|
3052
3103
|
ref,
|
|
3053
3104
|
id,
|
|
3054
3105
|
...restProps,
|
|
3055
|
-
className:
|
|
3106
|
+
className: clsx23(
|
|
3056
3107
|
{
|
|
3057
3108
|
"focus:border-primary focus:ring-primary": !errorText,
|
|
3058
3109
|
"focus:border-negative focus:ring-negative text-negative": !!errorText
|
|
@@ -3061,18 +3112,18 @@ var FormInput = forwardRef2(function FormInput2({
|
|
|
3061
3112
|
)
|
|
3062
3113
|
}
|
|
3063
3114
|
);
|
|
3064
|
-
return /* @__PURE__ */
|
|
3065
|
-
labelText && /* @__PURE__ */
|
|
3115
|
+
return /* @__PURE__ */ jsxs17("div", { className: clsx23("flex flex-col gap-y-1", containerClassName), children: [
|
|
3116
|
+
labelText && /* @__PURE__ */ jsxs17("label", { htmlFor: id, className: clsx23("textstyle-label-md", labelClassName), children: [
|
|
3066
3117
|
labelText,
|
|
3067
|
-
required && /* @__PURE__ */
|
|
3118
|
+
required && /* @__PURE__ */ jsx27("span", { className: "text-primary font-bold", children: "*" })
|
|
3068
3119
|
] }),
|
|
3069
3120
|
input,
|
|
3070
|
-
errorText && /* @__PURE__ */
|
|
3121
|
+
errorText && /* @__PURE__ */ jsx27("label", { htmlFor: id, className: clsx23("text-negative", errorClassName), children: errorText })
|
|
3071
3122
|
] });
|
|
3072
3123
|
});
|
|
3073
3124
|
|
|
3074
3125
|
// src/components/layout-and-navigation/SearchableList.tsx
|
|
3075
|
-
import { jsx as
|
|
3126
|
+
import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3076
3127
|
var defaultSearchableListTranslation = {
|
|
3077
3128
|
en: {
|
|
3078
3129
|
search: "Search",
|
|
@@ -3095,20 +3146,20 @@ var SearchableList = ({
|
|
|
3095
3146
|
const [search, setSearch] = useState14(initialSearch);
|
|
3096
3147
|
useEffect13(() => setSearch(initialSearch), [initialSearch]);
|
|
3097
3148
|
const filteredEntries = useMemo2(() => MultiSearchWithMapping(search, list, searchMapping), [search, list, searchMapping]);
|
|
3098
|
-
return /* @__PURE__ */
|
|
3099
|
-
/* @__PURE__ */
|
|
3100
|
-
/* @__PURE__ */
|
|
3101
|
-
/* @__PURE__ */
|
|
3149
|
+
return /* @__PURE__ */ jsxs18("div", { className: clsx24("col gap-y-2", className), children: [
|
|
3150
|
+
/* @__PURE__ */ jsxs18("div", { className: "row justify-between gap-x-2 items-center", children: [
|
|
3151
|
+
/* @__PURE__ */ jsx28("div", { className: "flex-1", children: /* @__PURE__ */ jsx28(Input, { value: search, onChangeText: setSearch, placeholder: translation.search }) }),
|
|
3152
|
+
/* @__PURE__ */ jsx28(Search, { size: 20 })
|
|
3102
3153
|
] }),
|
|
3103
|
-
filteredEntries.length > 0 && /* @__PURE__ */
|
|
3104
|
-
!filteredEntries.length && /* @__PURE__ */
|
|
3154
|
+
filteredEntries.length > 0 && /* @__PURE__ */ jsx28("div", { className: "col gap-y-1", children: filteredEntries.map(itemMapper) }),
|
|
3155
|
+
!filteredEntries.length && /* @__PURE__ */ jsx28("div", { className: "row justify-center", children: translation.nothingFound })
|
|
3105
3156
|
] });
|
|
3106
3157
|
};
|
|
3107
3158
|
|
|
3108
3159
|
// src/components/layout-and-navigation/StepperBar.tsx
|
|
3109
3160
|
import { Check, ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight3 } from "lucide-react";
|
|
3110
|
-
import
|
|
3111
|
-
import { jsx as
|
|
3161
|
+
import clsx25 from "clsx";
|
|
3162
|
+
import { jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3112
3163
|
var defaultStepperBarTranslation = {
|
|
3113
3164
|
en: {
|
|
3114
3165
|
back: "Back",
|
|
@@ -3136,12 +3187,12 @@ var StepperBar = ({
|
|
|
3136
3187
|
seenSteps.add(newStep);
|
|
3137
3188
|
onChange({ step: newStep, seenSteps, lastStep });
|
|
3138
3189
|
};
|
|
3139
|
-
return /* @__PURE__ */
|
|
3190
|
+
return /* @__PURE__ */ jsxs19(
|
|
3140
3191
|
"div",
|
|
3141
3192
|
{
|
|
3142
|
-
className:
|
|
3193
|
+
className: clsx25("sticky row p-2 border-2 justify-between rounded-lg shadow-lg", className),
|
|
3143
3194
|
children: [
|
|
3144
|
-
/* @__PURE__ */
|
|
3195
|
+
/* @__PURE__ */ jsx29("div", { className: "flex-[2] justify-start", children: /* @__PURE__ */ jsxs19(
|
|
3145
3196
|
SolidButton,
|
|
3146
3197
|
{
|
|
3147
3198
|
disabled: step === 0,
|
|
@@ -3150,18 +3201,18 @@ var StepperBar = ({
|
|
|
3150
3201
|
},
|
|
3151
3202
|
className: "row gap-x-1 items-center justify-center",
|
|
3152
3203
|
children: [
|
|
3153
|
-
/* @__PURE__ */
|
|
3204
|
+
/* @__PURE__ */ jsx29(ChevronLeft3, { size: 14 }),
|
|
3154
3205
|
translation.back
|
|
3155
3206
|
]
|
|
3156
3207
|
}
|
|
3157
3208
|
) }),
|
|
3158
|
-
/* @__PURE__ */
|
|
3209
|
+
/* @__PURE__ */ jsx29("div", { className: "row flex-[5] gap-x-2 justify-center items-center", children: showDots && dots.map((value, index) => {
|
|
3159
3210
|
const seen = seenSteps.has(index);
|
|
3160
|
-
return /* @__PURE__ */
|
|
3211
|
+
return /* @__PURE__ */ jsx29(
|
|
3161
3212
|
"div",
|
|
3162
3213
|
{
|
|
3163
3214
|
onClick: () => seen && update(index),
|
|
3164
|
-
className:
|
|
3215
|
+
className: clsx25(
|
|
3165
3216
|
"rounded-full w-4 h-4",
|
|
3166
3217
|
{
|
|
3167
3218
|
"bg-primary hover:brightness-75": index === step && seen,
|
|
@@ -3177,25 +3228,25 @@ var StepperBar = ({
|
|
|
3177
3228
|
index
|
|
3178
3229
|
);
|
|
3179
3230
|
}) }),
|
|
3180
|
-
step !== lastStep && /* @__PURE__ */
|
|
3231
|
+
step !== lastStep && /* @__PURE__ */ jsx29("div", { className: "flex-[2] justify-end", children: /* @__PURE__ */ jsxs19(
|
|
3181
3232
|
SolidButton,
|
|
3182
3233
|
{
|
|
3183
3234
|
onClick: () => update(step + 1),
|
|
3184
3235
|
className: "row gap-x-1 items-center justify-center",
|
|
3185
3236
|
children: [
|
|
3186
3237
|
translation.next,
|
|
3187
|
-
/* @__PURE__ */
|
|
3238
|
+
/* @__PURE__ */ jsx29(ChevronRight3, { size: 14 })
|
|
3188
3239
|
]
|
|
3189
3240
|
}
|
|
3190
3241
|
) }),
|
|
3191
|
-
step === lastStep && /* @__PURE__ */
|
|
3242
|
+
step === lastStep && /* @__PURE__ */ jsx29("div", { className: "flex-[2] justify-end", children: /* @__PURE__ */ jsxs19(
|
|
3192
3243
|
SolidButton,
|
|
3193
3244
|
{
|
|
3194
3245
|
disabled: false,
|
|
3195
3246
|
onClick: onFinish,
|
|
3196
3247
|
className: "row gap-x-1 items-center justify-center",
|
|
3197
3248
|
children: [
|
|
3198
|
-
/* @__PURE__ */
|
|
3249
|
+
/* @__PURE__ */ jsx29(Check, { size: 14 }),
|
|
3199
3250
|
translation.confirm
|
|
3200
3251
|
]
|
|
3201
3252
|
}
|
|
@@ -3213,8 +3264,8 @@ import { Scrollbars as Scrollbars3 } from "react-custom-scrollbars-2";
|
|
|
3213
3264
|
import { useState as useState15 } from "react";
|
|
3214
3265
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3215
3266
|
import { Check as Check2, Minus } from "lucide-react";
|
|
3216
|
-
import
|
|
3217
|
-
import { jsx as
|
|
3267
|
+
import clsx26 from "clsx";
|
|
3268
|
+
import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3218
3269
|
var checkboxSizeMapping = {
|
|
3219
3270
|
small: "size-4",
|
|
3220
3271
|
medium: "size-6",
|
|
@@ -3250,31 +3301,31 @@ var Checkbox = ({
|
|
|
3250
3301
|
const newValue = checked === "indeterminate" ? false : !checked;
|
|
3251
3302
|
propagateChange(newValue);
|
|
3252
3303
|
};
|
|
3253
|
-
return /* @__PURE__ */
|
|
3254
|
-
/* @__PURE__ */
|
|
3304
|
+
return /* @__PURE__ */ jsxs20("div", { className: clsx26("row justify-center items-center", containerClassName), children: [
|
|
3305
|
+
/* @__PURE__ */ jsx30(
|
|
3255
3306
|
CheckboxPrimitive.Root,
|
|
3256
3307
|
{
|
|
3257
3308
|
onCheckedChange: propagateChange,
|
|
3258
3309
|
checked,
|
|
3259
3310
|
disabled,
|
|
3260
3311
|
id,
|
|
3261
|
-
className:
|
|
3312
|
+
className: clsx26(usedSizeClass, `items-center border-2 rounded outline-none focus:border-primary`, {
|
|
3262
3313
|
"text-disabled-text border-disabled-text": disabled,
|
|
3263
3314
|
"border-on-background": !disabled,
|
|
3264
3315
|
"bg-primary/30 border-primary text-primary": checked === true || checked === "indeterminate",
|
|
3265
3316
|
"hover:border-gray-400 focus:hover:border-primary": !checked
|
|
3266
3317
|
}, className),
|
|
3267
|
-
children: /* @__PURE__ */
|
|
3268
|
-
checked === true && /* @__PURE__ */
|
|
3269
|
-
checked === "indeterminate" && /* @__PURE__ */
|
|
3318
|
+
children: /* @__PURE__ */ jsxs20(CheckboxPrimitive.Indicator, { children: [
|
|
3319
|
+
checked === true && /* @__PURE__ */ jsx30(Check2, { className: innerIconSize }),
|
|
3320
|
+
checked === "indeterminate" && /* @__PURE__ */ jsx30(Minus, { className: innerIconSize })
|
|
3270
3321
|
] })
|
|
3271
3322
|
}
|
|
3272
3323
|
),
|
|
3273
|
-
label && /* @__PURE__ */
|
|
3324
|
+
label && /* @__PURE__ */ jsx30(
|
|
3274
3325
|
Label,
|
|
3275
3326
|
{
|
|
3276
3327
|
...label,
|
|
3277
|
-
className:
|
|
3328
|
+
className: clsx26("cursor-pointer", label.className),
|
|
3278
3329
|
htmlFor: id,
|
|
3279
3330
|
onClick: changeValue
|
|
3280
3331
|
}
|
|
@@ -3297,7 +3348,7 @@ var CheckboxUncontrolled = ({
|
|
|
3297
3348
|
}
|
|
3298
3349
|
setChecked(checked2);
|
|
3299
3350
|
};
|
|
3300
|
-
return /* @__PURE__ */
|
|
3351
|
+
return /* @__PURE__ */ jsx30(
|
|
3301
3352
|
Checkbox,
|
|
3302
3353
|
{
|
|
3303
3354
|
...props,
|
|
@@ -3308,9 +3359,9 @@ var CheckboxUncontrolled = ({
|
|
|
3308
3359
|
};
|
|
3309
3360
|
|
|
3310
3361
|
// src/components/layout-and-navigation/Table.tsx
|
|
3311
|
-
import
|
|
3362
|
+
import clsx27 from "clsx";
|
|
3312
3363
|
import { ChevronDown as ChevronDown4, ChevronsUpDown, ChevronUp as ChevronUp3 } from "lucide-react";
|
|
3313
|
-
import { jsx as
|
|
3364
|
+
import { jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3314
3365
|
var defaultTableStatePagination = {
|
|
3315
3366
|
currentPage: 0,
|
|
3316
3367
|
entriesPerPage: 5
|
|
@@ -3481,20 +3532,20 @@ var Table = ({
|
|
|
3481
3532
|
window.removeEventListener("resize", handleResize);
|
|
3482
3533
|
};
|
|
3483
3534
|
}, [data, currentPage]);
|
|
3484
|
-
return /* @__PURE__ */
|
|
3485
|
-
/* @__PURE__ */
|
|
3486
|
-
/* @__PURE__ */
|
|
3487
|
-
header && tableState.selection && /* @__PURE__ */
|
|
3535
|
+
return /* @__PURE__ */ jsxs21("div", { className: clsx27("col gap-y-4 overflow-hidden", className), children: [
|
|
3536
|
+
/* @__PURE__ */ jsx31("div", { children: /* @__PURE__ */ jsx31(Scrollbars3, { autoHeight: true, autoHeightMin: scrollbarsAutoHeightMin, children: /* @__PURE__ */ jsxs21("table", { ref: tableRef, className: "w-full mb-[12px]", children: [
|
|
3537
|
+
/* @__PURE__ */ jsx31("thead", { children: /* @__PURE__ */ jsxs21("tr", { className: headerRow, children: [
|
|
3538
|
+
header && tableState.selection && /* @__PURE__ */ jsx31("th", { className: headerPaddingHead, children: /* @__PURE__ */ jsx31(
|
|
3488
3539
|
Checkbox,
|
|
3489
3540
|
{
|
|
3490
3541
|
checked: tableState.selection.hasSelectedSome ? "indeterminate" : tableState.selection.hasSelectedAll,
|
|
3491
3542
|
onChange: () => updateTableState(changeTableSelectionAll(tableState, data, identifierMapping))
|
|
3492
3543
|
}
|
|
3493
3544
|
) }),
|
|
3494
|
-
header && header.map((value, index) => /* @__PURE__ */
|
|
3545
|
+
header && header.map((value, index) => /* @__PURE__ */ jsx31("th", { className: headerPaddingHead, children: /* @__PURE__ */ jsx31("div", { className: "row justify-start px-2", children: value }) }, `tableHeader${index}`))
|
|
3495
3546
|
] }) }),
|
|
3496
|
-
/* @__PURE__ */
|
|
3497
|
-
tableState.selection && /* @__PURE__ */
|
|
3547
|
+
/* @__PURE__ */ jsx31("tbody", { children: shownElements.map((value, rowIndex) => /* @__PURE__ */ jsxs21("tr", { children: [
|
|
3548
|
+
tableState.selection && /* @__PURE__ */ jsx31("td", { className: clsx27(cellPadding, { [headerPaddingBody]: rowIndex === 0 }), children: /* @__PURE__ */ jsx31(
|
|
3498
3549
|
Checkbox,
|
|
3499
3550
|
{
|
|
3500
3551
|
checked: isDataObjectSelected(tableState, value, identifierMapping),
|
|
@@ -3503,17 +3554,17 @@ var Table = ({
|
|
|
3503
3554
|
}
|
|
3504
3555
|
}
|
|
3505
3556
|
) }),
|
|
3506
|
-
rowMappingToCells(value).map((value1, index) => /* @__PURE__ */
|
|
3557
|
+
rowMappingToCells(value).map((value1, index) => /* @__PURE__ */ jsx31(
|
|
3507
3558
|
"td",
|
|
3508
3559
|
{
|
|
3509
|
-
className:
|
|
3560
|
+
className: clsx27(cellPadding, { [headerPaddingBody]: rowIndex === 0 }),
|
|
3510
3561
|
children: value1
|
|
3511
3562
|
},
|
|
3512
3563
|
index
|
|
3513
3564
|
))
|
|
3514
3565
|
] }, identifierMapping(value))) })
|
|
3515
3566
|
] }) }) }),
|
|
3516
|
-
/* @__PURE__ */
|
|
3567
|
+
/* @__PURE__ */ jsx31("div", { className: "row justify-center", children: tableState.pagination && /* @__PURE__ */ jsx31(Pagination, { page: currentPage, numberOfPages: pageCount, onPageChanged: (page) => updateTableState({
|
|
3517
3568
|
...tableState,
|
|
3518
3569
|
pagination: { entriesPerPage, currentPage: page }
|
|
3519
3570
|
}) }) })
|
|
@@ -3526,23 +3577,23 @@ var SortButton = ({
|
|
|
3526
3577
|
onClick,
|
|
3527
3578
|
...buttonProps
|
|
3528
3579
|
}) => {
|
|
3529
|
-
return /* @__PURE__ */
|
|
3580
|
+
return /* @__PURE__ */ jsx31(
|
|
3530
3581
|
TextButton,
|
|
3531
3582
|
{
|
|
3532
3583
|
color,
|
|
3533
3584
|
onClick: () => onClick(ascending === "descending" ? "ascending" : "descending"),
|
|
3534
3585
|
...buttonProps,
|
|
3535
|
-
children: /* @__PURE__ */
|
|
3586
|
+
children: /* @__PURE__ */ jsxs21("div", { className: "row gap-x-2", children: [
|
|
3536
3587
|
children,
|
|
3537
|
-
ascending === "ascending" ? /* @__PURE__ */
|
|
3588
|
+
ascending === "ascending" ? /* @__PURE__ */ jsx31(ChevronUp3, {}) : !ascending ? /* @__PURE__ */ jsx31(ChevronsUpDown, {}) : /* @__PURE__ */ jsx31(ChevronDown4, {})
|
|
3538
3589
|
] })
|
|
3539
3590
|
}
|
|
3540
3591
|
);
|
|
3541
3592
|
};
|
|
3542
3593
|
|
|
3543
3594
|
// src/components/layout-and-navigation/TextImage.tsx
|
|
3544
|
-
import
|
|
3545
|
-
import { jsx as
|
|
3595
|
+
import clsx28 from "clsx";
|
|
3596
|
+
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3546
3597
|
var defaultTextImageTranslation = {
|
|
3547
3598
|
de: {
|
|
3548
3599
|
showMore: "Mehr anzeigen"
|
|
@@ -3573,25 +3624,25 @@ var TextImage = ({
|
|
|
3573
3624
|
secondary: "text-text-image-secondary-text bg-linear-to-r from-30% from-text-image-secondary-background to-text-image-secondary-background/55",
|
|
3574
3625
|
dark: "text-text-image-dark-text bg-linear-to-r from-30% from-text-image-dark-background to-text-image-dark-background/55"
|
|
3575
3626
|
};
|
|
3576
|
-
return /* @__PURE__ */
|
|
3627
|
+
return /* @__PURE__ */ jsx32(
|
|
3577
3628
|
"div",
|
|
3578
3629
|
{
|
|
3579
|
-
className:
|
|
3630
|
+
className: clsx28("rounded-2xl w-full", className),
|
|
3580
3631
|
style: {
|
|
3581
3632
|
backgroundImage: `url(${imageUrl})`,
|
|
3582
3633
|
backgroundSize: "cover"
|
|
3583
3634
|
},
|
|
3584
|
-
children: /* @__PURE__ */
|
|
3635
|
+
children: /* @__PURE__ */ jsxs22(
|
|
3585
3636
|
"div",
|
|
3586
3637
|
{
|
|
3587
|
-
className:
|
|
3638
|
+
className: clsx28(`col px-6 py-12 rounded-2xl h-full`, colorMapping[color], contentClassName),
|
|
3588
3639
|
children: [
|
|
3589
|
-
badge && /* @__PURE__ */
|
|
3590
|
-
/* @__PURE__ */
|
|
3591
|
-
/* @__PURE__ */
|
|
3592
|
-
/* @__PURE__ */
|
|
3640
|
+
badge && /* @__PURE__ */ jsx32("div", { className: clsx28(`chip-full bg-white mb-2 py-2 px-4 w-fit`, chipColorMapping[color]), children: /* @__PURE__ */ jsx32("span", { className: "text-lg font-bold", children: badge }) }),
|
|
3641
|
+
/* @__PURE__ */ jsxs22("div", { className: "col gap-y-1 text-white overflow-hidden", children: [
|
|
3642
|
+
/* @__PURE__ */ jsx32("span", { className: "textstyle-title-xl", children: title }),
|
|
3643
|
+
/* @__PURE__ */ jsx32("span", { className: "text-ellipsis overflow-hidden", children: description })
|
|
3593
3644
|
] }),
|
|
3594
|
-
onShowMoreClicked && /* @__PURE__ */
|
|
3645
|
+
onShowMoreClicked && /* @__PURE__ */ jsx32("div", { className: "row mt-2 text-white underline", children: /* @__PURE__ */ jsx32("button", { onClick: onShowMoreClicked, children: translation.showMore }) })
|
|
3595
3646
|
]
|
|
3596
3647
|
}
|
|
3597
3648
|
)
|
|
@@ -3600,7 +3651,7 @@ var TextImage = ({
|
|
|
3600
3651
|
};
|
|
3601
3652
|
|
|
3602
3653
|
// src/components/layout-and-navigation/VerticalDivider.tsx
|
|
3603
|
-
import { jsx as
|
|
3654
|
+
import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3604
3655
|
var VerticalDivider = ({
|
|
3605
3656
|
width = 1,
|
|
3606
3657
|
height = 100,
|
|
@@ -3608,7 +3659,7 @@ var VerticalDivider = ({
|
|
|
3608
3659
|
dashGap = 4,
|
|
3609
3660
|
dashLength = 4
|
|
3610
3661
|
}) => {
|
|
3611
|
-
return /* @__PURE__ */
|
|
3662
|
+
return /* @__PURE__ */ jsx33("div", { style: { width: width + "px", height: height + "px" }, children: /* @__PURE__ */ jsxs23(
|
|
3612
3663
|
"svg",
|
|
3613
3664
|
{
|
|
3614
3665
|
width,
|
|
@@ -3617,7 +3668,7 @@ var VerticalDivider = ({
|
|
|
3617
3668
|
fill: "none",
|
|
3618
3669
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3619
3670
|
children: [
|
|
3620
|
-
/* @__PURE__ */
|
|
3671
|
+
/* @__PURE__ */ jsx33(
|
|
3621
3672
|
"line",
|
|
3622
3673
|
{
|
|
3623
3674
|
opacity: "0.5",
|
|
@@ -3631,7 +3682,7 @@ var VerticalDivider = ({
|
|
|
3631
3682
|
strokeLinecap: "round"
|
|
3632
3683
|
}
|
|
3633
3684
|
),
|
|
3634
|
-
/* @__PURE__ */
|
|
3685
|
+
/* @__PURE__ */ jsx33("defs", { children: /* @__PURE__ */ jsxs23(
|
|
3635
3686
|
"linearGradient",
|
|
3636
3687
|
{
|
|
3637
3688
|
id: "paint_linear",
|
|
@@ -3641,9 +3692,9 @@ var VerticalDivider = ({
|
|
|
3641
3692
|
y2: height,
|
|
3642
3693
|
gradientUnits: "userSpaceOnUse",
|
|
3643
3694
|
children: [
|
|
3644
|
-
/* @__PURE__ */
|
|
3645
|
-
/* @__PURE__ */
|
|
3646
|
-
/* @__PURE__ */
|
|
3695
|
+
/* @__PURE__ */ jsx33("stop", { stopOpacity: "0", stopColor: "currentColor" }),
|
|
3696
|
+
/* @__PURE__ */ jsx33("stop", { offset: "0.5", stopColor: "currentColor" }),
|
|
3697
|
+
/* @__PURE__ */ jsx33("stop", { offset: "1", stopColor: "currentColor", stopOpacity: "0" })
|
|
3647
3698
|
]
|
|
3648
3699
|
}
|
|
3649
3700
|
) })
|
|
@@ -3654,8 +3705,8 @@ var VerticalDivider = ({
|
|
|
3654
3705
|
|
|
3655
3706
|
// src/components/loading-states/ErrorComponent.tsx
|
|
3656
3707
|
import { AlertOctagon } from "lucide-react";
|
|
3657
|
-
import
|
|
3658
|
-
import { jsx as
|
|
3708
|
+
import clsx29 from "clsx";
|
|
3709
|
+
import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3659
3710
|
var defaultErrorComponentTranslation = {
|
|
3660
3711
|
en: {
|
|
3661
3712
|
errorOccurred: "An error occurred"
|
|
@@ -3670,8 +3721,8 @@ var ErrorComponent = ({
|
|
|
3670
3721
|
classname
|
|
3671
3722
|
}) => {
|
|
3672
3723
|
const translation = useTranslation(defaultErrorComponentTranslation, overwriteTranslation);
|
|
3673
|
-
return /* @__PURE__ */
|
|
3674
|
-
/* @__PURE__ */
|
|
3724
|
+
return /* @__PURE__ */ jsxs24("div", { className: clsx29("col items-center justify-center gap-y-4 w-full h-24", classname), children: [
|
|
3725
|
+
/* @__PURE__ */ jsx34(AlertOctagon, { size: 64, className: "text-warning" }),
|
|
3675
3726
|
errorText ?? `${translation.errorOccurred} :(`
|
|
3676
3727
|
] });
|
|
3677
3728
|
};
|
|
@@ -3680,8 +3731,8 @@ var ErrorComponent = ({
|
|
|
3680
3731
|
import { useState as useState17 } from "react";
|
|
3681
3732
|
|
|
3682
3733
|
// src/components/loading-states/LoadingAnimation.tsx
|
|
3683
|
-
import
|
|
3684
|
-
import { jsx as
|
|
3734
|
+
import clsx30 from "clsx";
|
|
3735
|
+
import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3685
3736
|
var defaultLoadingAnimationTranslation = {
|
|
3686
3737
|
en: {
|
|
3687
3738
|
loading: "Loading data"
|
|
@@ -3696,14 +3747,14 @@ var LoadingAnimation = ({
|
|
|
3696
3747
|
classname
|
|
3697
3748
|
}) => {
|
|
3698
3749
|
const translation = useTranslation(defaultLoadingAnimationTranslation, overwriteTranslation);
|
|
3699
|
-
return /* @__PURE__ */
|
|
3700
|
-
/* @__PURE__ */
|
|
3750
|
+
return /* @__PURE__ */ jsxs25("div", { className: clsx30("col items-center justify-center w-full h-24", classname), children: [
|
|
3751
|
+
/* @__PURE__ */ jsx35(Helpwave, { animate: "loading" }),
|
|
3701
3752
|
loadingText ?? `${translation.loading}...`
|
|
3702
3753
|
] });
|
|
3703
3754
|
};
|
|
3704
3755
|
|
|
3705
3756
|
// src/components/loading-states/LoadingAndErrorComponent.tsx
|
|
3706
|
-
import { jsx as
|
|
3757
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3707
3758
|
var LoadingAndErrorComponent = ({
|
|
3708
3759
|
children,
|
|
3709
3760
|
isLoading = false,
|
|
@@ -3722,27 +3773,27 @@ var LoadingAndErrorComponent = ({
|
|
|
3722
3773
|
}, minimumLoadingDuration);
|
|
3723
3774
|
}
|
|
3724
3775
|
if (isLoading || minimumLoadingDuration && isInMinimumLoading) {
|
|
3725
|
-
return /* @__PURE__ */
|
|
3776
|
+
return /* @__PURE__ */ jsx36(LoadingAnimation, { ...loadingProps });
|
|
3726
3777
|
}
|
|
3727
3778
|
if (hasError) {
|
|
3728
|
-
return /* @__PURE__ */
|
|
3779
|
+
return /* @__PURE__ */ jsx36(ErrorComponent, { ...errorProps });
|
|
3729
3780
|
}
|
|
3730
3781
|
return children;
|
|
3731
3782
|
};
|
|
3732
3783
|
|
|
3733
3784
|
// src/components/loading-states/LoadingButton.tsx
|
|
3734
|
-
import
|
|
3735
|
-
import { jsx as
|
|
3785
|
+
import clsx31 from "clsx";
|
|
3786
|
+
import { jsx as jsx37, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3736
3787
|
var LoadingButton = ({ isLoading = false, size = "medium", onClick, ...rest }) => {
|
|
3737
3788
|
const paddingClass = ButtonUtil.paddingMapping[size];
|
|
3738
|
-
return /* @__PURE__ */
|
|
3739
|
-
isLoading && /* @__PURE__ */
|
|
3740
|
-
/* @__PURE__ */
|
|
3789
|
+
return /* @__PURE__ */ jsxs26("div", { className: "inline-block relative", children: [
|
|
3790
|
+
isLoading && /* @__PURE__ */ jsx37("div", { className: clsx31("absolute inset-0 row items-center justify-center bg-white/40", paddingClass), children: /* @__PURE__ */ jsx37(Helpwave, { animate: "loading", className: "text-white" }) }),
|
|
3791
|
+
/* @__PURE__ */ jsx37(SolidButton, { ...rest, disabled: rest.disabled, onClick: isLoading ? noop : onClick })
|
|
3741
3792
|
] });
|
|
3742
3793
|
};
|
|
3743
3794
|
|
|
3744
3795
|
// src/components/loading-states/ProgressIndicator.tsx
|
|
3745
|
-
import { jsx as
|
|
3796
|
+
import { jsx as jsx38, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3746
3797
|
var sizeMapping = { small: 16, medium: 24, big: 48 };
|
|
3747
3798
|
var ProgressIndicator = ({
|
|
3748
3799
|
progress,
|
|
@@ -3759,7 +3810,7 @@ var ProgressIndicator = ({
|
|
|
3759
3810
|
if (direction === "clockwise") {
|
|
3760
3811
|
rotation += 360 * progress;
|
|
3761
3812
|
}
|
|
3762
|
-
return /* @__PURE__ */
|
|
3813
|
+
return /* @__PURE__ */ jsxs27(
|
|
3763
3814
|
"svg",
|
|
3764
3815
|
{
|
|
3765
3816
|
style: {
|
|
@@ -3768,7 +3819,7 @@ var ProgressIndicator = ({
|
|
|
3768
3819
|
transform: `rotate(${rotation}deg)`
|
|
3769
3820
|
},
|
|
3770
3821
|
children: [
|
|
3771
|
-
/* @__PURE__ */
|
|
3822
|
+
/* @__PURE__ */ jsx38(
|
|
3772
3823
|
"circle",
|
|
3773
3824
|
{
|
|
3774
3825
|
cx: center,
|
|
@@ -3779,7 +3830,7 @@ var ProgressIndicator = ({
|
|
|
3779
3830
|
className: "stroke-primary"
|
|
3780
3831
|
}
|
|
3781
3832
|
),
|
|
3782
|
-
/* @__PURE__ */
|
|
3833
|
+
/* @__PURE__ */ jsx38(
|
|
3783
3834
|
"circle",
|
|
3784
3835
|
{
|
|
3785
3836
|
cx: center,
|
|
@@ -3797,10 +3848,10 @@ var ProgressIndicator = ({
|
|
|
3797
3848
|
);
|
|
3798
3849
|
};
|
|
3799
3850
|
|
|
3800
|
-
// src/components/modals/
|
|
3801
|
-
import
|
|
3802
|
-
import { jsx as
|
|
3803
|
-
var
|
|
3851
|
+
// src/components/modals/ConfirmModal.tsx
|
|
3852
|
+
import clsx32 from "clsx";
|
|
3853
|
+
import { jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3854
|
+
var defaultConfirmDialogTranslation2 = {
|
|
3804
3855
|
en: {
|
|
3805
3856
|
confirm: "Confirm",
|
|
3806
3857
|
cancel: "Cancel",
|
|
@@ -3812,7 +3863,7 @@ var defaultConfirmDialogTranslation = {
|
|
|
3812
3863
|
decline: "Ablehnen"
|
|
3813
3864
|
}
|
|
3814
3865
|
};
|
|
3815
|
-
var
|
|
3866
|
+
var ConfirmModal = ({
|
|
3816
3867
|
overwriteTranslation,
|
|
3817
3868
|
children,
|
|
3818
3869
|
onCancel,
|
|
@@ -3823,25 +3874,26 @@ var ConfirmDialog = ({
|
|
|
3823
3874
|
className,
|
|
3824
3875
|
...restProps
|
|
3825
3876
|
}) => {
|
|
3826
|
-
const translation = useTranslation(
|
|
3877
|
+
const translation = useTranslation(defaultConfirmDialogTranslation2, overwriteTranslation);
|
|
3827
3878
|
const mapping = {
|
|
3828
|
-
neutral: "
|
|
3879
|
+
neutral: "neutral",
|
|
3829
3880
|
negative: "negative",
|
|
3830
|
-
positive: "positive"
|
|
3881
|
+
positive: "positive",
|
|
3882
|
+
primary: "primary"
|
|
3831
3883
|
};
|
|
3832
|
-
return /* @__PURE__ */
|
|
3833
|
-
/* @__PURE__ */
|
|
3834
|
-
/* @__PURE__ */
|
|
3835
|
-
onCancel && /* @__PURE__ */
|
|
3884
|
+
return /* @__PURE__ */ jsxs28(Modal, { ...restProps, onClose: onCancel, className: clsx32("justify-between", className), children: [
|
|
3885
|
+
/* @__PURE__ */ jsx39("div", { className: "col grow", children }),
|
|
3886
|
+
/* @__PURE__ */ jsxs28("div", { className: "row mt-3 gap-x-4 justify-end", children: [
|
|
3887
|
+
onCancel && /* @__PURE__ */ jsx39(
|
|
3836
3888
|
SolidButton,
|
|
3837
3889
|
{
|
|
3838
|
-
color: buttonOverwrites?.[0].color ?? "
|
|
3890
|
+
color: buttonOverwrites?.[0].color ?? "neutral",
|
|
3839
3891
|
onClick: onCancel,
|
|
3840
3892
|
disabled: buttonOverwrites?.[0].disabled ?? false,
|
|
3841
3893
|
children: buttonOverwrites?.[0].text ?? translation.cancel
|
|
3842
3894
|
}
|
|
3843
3895
|
),
|
|
3844
|
-
onDecline && /* @__PURE__ */
|
|
3896
|
+
onDecline && /* @__PURE__ */ jsx39(
|
|
3845
3897
|
SolidButton,
|
|
3846
3898
|
{
|
|
3847
3899
|
color: buttonOverwrites?.[1].color ?? "negative",
|
|
@@ -3850,7 +3902,7 @@ var ConfirmDialog = ({
|
|
|
3850
3902
|
children: buttonOverwrites?.[1].text ?? translation.decline
|
|
3851
3903
|
}
|
|
3852
3904
|
),
|
|
3853
|
-
/* @__PURE__ */
|
|
3905
|
+
/* @__PURE__ */ jsx39(
|
|
3854
3906
|
SolidButton,
|
|
3855
3907
|
{
|
|
3856
3908
|
autoFocus: true,
|
|
@@ -3865,7 +3917,7 @@ var ConfirmDialog = ({
|
|
|
3865
3917
|
};
|
|
3866
3918
|
|
|
3867
3919
|
// src/components/modals/DiscardChangesModal.tsx
|
|
3868
|
-
import { jsx as
|
|
3920
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3869
3921
|
var defaultDiscardChangesModalTranslation = {
|
|
3870
3922
|
en: {
|
|
3871
3923
|
save: "Save",
|
|
@@ -3892,40 +3944,37 @@ var DiscardChangesModal = ({
|
|
|
3892
3944
|
...modalProps
|
|
3893
3945
|
}) => {
|
|
3894
3946
|
const translation = useTranslation(defaultDiscardChangesModalTranslation, overwriteTranslation);
|
|
3895
|
-
return /* @__PURE__ */
|
|
3896
|
-
|
|
3947
|
+
return /* @__PURE__ */ jsx40(
|
|
3948
|
+
ConfirmModal,
|
|
3897
3949
|
{
|
|
3898
3950
|
headerProps: {
|
|
3899
3951
|
...headerProps,
|
|
3900
3952
|
titleText: headerProps?.titleText ?? translation.title,
|
|
3901
3953
|
descriptionText: headerProps?.descriptionText ?? translation.description
|
|
3902
3954
|
},
|
|
3955
|
+
onConfirm: onSave,
|
|
3956
|
+
onCancel,
|
|
3957
|
+
onDecline: onDontSave,
|
|
3958
|
+
buttonOverwrites: [{ text: translation.cancel }, { text: translation.dontSave }, { text: translation.save }],
|
|
3903
3959
|
...modalProps,
|
|
3904
|
-
children
|
|
3905
|
-
children,
|
|
3906
|
-
/* @__PURE__ */ jsxs28("div", { className: "row mt-3 gap-x-4 justify-end", children: [
|
|
3907
|
-
/* @__PURE__ */ jsx39(SolidButton, { color: "positive", onClick: onSave, children: translation.save }),
|
|
3908
|
-
/* @__PURE__ */ jsx39(SolidButton, { color: "negative", onClick: onDontSave, children: translation.dontSave }),
|
|
3909
|
-
/* @__PURE__ */ jsx39(SolidButton, { autoFocus: true, color: "primary", onClick: onCancel, children: translation.cancel })
|
|
3910
|
-
] })
|
|
3911
|
-
]
|
|
3960
|
+
children
|
|
3912
3961
|
}
|
|
3913
3962
|
);
|
|
3914
3963
|
};
|
|
3915
3964
|
|
|
3916
3965
|
// src/components/modals/InputModal.tsx
|
|
3917
|
-
import { jsx as
|
|
3966
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3918
3967
|
var InputModal = ({
|
|
3919
3968
|
inputs,
|
|
3920
3969
|
buttonOverwrites,
|
|
3921
3970
|
...restProps
|
|
3922
3971
|
}) => {
|
|
3923
|
-
return /* @__PURE__ */
|
|
3972
|
+
return /* @__PURE__ */ jsx41(
|
|
3924
3973
|
ConfirmDialog,
|
|
3925
3974
|
{
|
|
3926
3975
|
buttonOverwrites,
|
|
3927
3976
|
...restProps,
|
|
3928
|
-
children: inputs.map((inputProps, index) => /* @__PURE__ */
|
|
3977
|
+
children: inputs.map((inputProps, index) => /* @__PURE__ */ jsx41(Input, { ...inputProps }, `input ${index}`))
|
|
3929
3978
|
}
|
|
3930
3979
|
);
|
|
3931
3980
|
};
|
|
@@ -3934,8 +3983,8 @@ var InputModal = ({
|
|
|
3934
3983
|
import { Menu } from "@headlessui/react";
|
|
3935
3984
|
import { ChevronDown as ChevronDown5, ChevronUp as ChevronUp4, Search as Search2 } from "lucide-react";
|
|
3936
3985
|
import { useEffect as useEffect15, useState as useState18 } from "react";
|
|
3937
|
-
import
|
|
3938
|
-
import { Fragment as Fragment3, jsx as
|
|
3986
|
+
import clsx33 from "clsx";
|
|
3987
|
+
import { Fragment as Fragment3, jsx as jsx42, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3939
3988
|
var Select = ({
|
|
3940
3989
|
value,
|
|
3941
3990
|
label,
|
|
@@ -3960,13 +4009,13 @@ var Select = ({
|
|
|
3960
4009
|
console.warn("The selected value is not found in the options list. This might be an error on your part or default behavior if it is complex data type on which === does not work. In case of the latter use selectedDisplayOverwrite to set your selected text or component");
|
|
3961
4010
|
}
|
|
3962
4011
|
const borderColor = "border-menu-border";
|
|
3963
|
-
return /* @__PURE__ */ jsxs29("div", { className:
|
|
3964
|
-
label && /* @__PURE__ */
|
|
3965
|
-
/* @__PURE__ */
|
|
4012
|
+
return /* @__PURE__ */ jsxs29("div", { className: clsx33(className), children: [
|
|
4013
|
+
label && /* @__PURE__ */ jsx42(Label, { ...label, labelType: label.labelType ?? "labelBig", className: clsx33("mb-1", label.className) }),
|
|
4014
|
+
/* @__PURE__ */ jsx42(Menu, { as: "div", className: "relative text-menu-text", children: ({ open }) => /* @__PURE__ */ jsxs29(Fragment3, { children: [
|
|
3966
4015
|
/* @__PURE__ */ jsxs29(
|
|
3967
4016
|
Menu.Button,
|
|
3968
4017
|
{
|
|
3969
|
-
className:
|
|
4018
|
+
className: clsx33(
|
|
3970
4019
|
"inline-flex w-full justify-between items-center rounded-t-lg border-2 px-4 py-2 font-medium bg-menu-background text-menu-text",
|
|
3971
4020
|
textColor,
|
|
3972
4021
|
borderColor,
|
|
@@ -3978,8 +4027,8 @@ var Select = ({
|
|
|
3978
4027
|
),
|
|
3979
4028
|
disabled: isDisabled,
|
|
3980
4029
|
children: [
|
|
3981
|
-
/* @__PURE__ */
|
|
3982
|
-
open ? /* @__PURE__ */
|
|
4030
|
+
/* @__PURE__ */ jsx42("span", { children: selectedDisplayOverwrite ?? selectedOption?.label ?? hintText }),
|
|
4031
|
+
open ? /* @__PURE__ */ jsx42(ChevronUp4, {}) : /* @__PURE__ */ jsx42(ChevronDown5, {})
|
|
3983
4032
|
]
|
|
3984
4033
|
}
|
|
3985
4034
|
),
|
|
@@ -3988,20 +4037,20 @@ var Select = ({
|
|
|
3988
4037
|
{
|
|
3989
4038
|
className: "absolute w-full z-10 rounded-b-lg bg-menu-background text-menu-text shadow-lg max-h-[500px] overflow-y-auto",
|
|
3990
4039
|
children: [
|
|
3991
|
-
(additionalItems ?? []).map((item, index) => /* @__PURE__ */
|
|
4040
|
+
(additionalItems ?? []).map((item, index) => /* @__PURE__ */ jsx42(
|
|
3992
4041
|
"div",
|
|
3993
4042
|
{
|
|
3994
|
-
className:
|
|
4043
|
+
className: clsx33(borderColor, "px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0", {
|
|
3995
4044
|
"border-b-0 rounded-b-lg": filteredOptions.length === 0 && index === (additionalItems?.length ?? 1) - 1
|
|
3996
4045
|
}),
|
|
3997
4046
|
children: item
|
|
3998
4047
|
},
|
|
3999
4048
|
`additionalItems${index}`
|
|
4000
4049
|
)),
|
|
4001
|
-
filteredOptions.map((option, index) => /* @__PURE__ */
|
|
4050
|
+
filteredOptions.map((option, index) => /* @__PURE__ */ jsx42(Menu.Item, { children: /* @__PURE__ */ jsx42(
|
|
4002
4051
|
"div",
|
|
4003
4052
|
{
|
|
4004
|
-
className:
|
|
4053
|
+
className: clsx33(
|
|
4005
4054
|
"px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0 cursor-pointer",
|
|
4006
4055
|
option.className,
|
|
4007
4056
|
borderColor,
|
|
@@ -4040,7 +4089,7 @@ var SelectUncontrolled = ({
|
|
|
4040
4089
|
setSelected(value);
|
|
4041
4090
|
}
|
|
4042
4091
|
}, [options, value]);
|
|
4043
|
-
return /* @__PURE__ */
|
|
4092
|
+
return /* @__PURE__ */ jsx42(
|
|
4044
4093
|
Select,
|
|
4045
4094
|
{
|
|
4046
4095
|
value: selected,
|
|
@@ -4062,14 +4111,14 @@ var SearchableSelect = ({
|
|
|
4062
4111
|
}) => {
|
|
4063
4112
|
const [search, setSearch] = useState18("");
|
|
4064
4113
|
const filteredOptions = MultiSearchWithMapping(search, options, searchMapping);
|
|
4065
|
-
return /* @__PURE__ */
|
|
4114
|
+
return /* @__PURE__ */ jsx42(
|
|
4066
4115
|
Select,
|
|
4067
4116
|
{
|
|
4068
4117
|
value,
|
|
4069
4118
|
options: filteredOptions,
|
|
4070
4119
|
additionalItems: [/* @__PURE__ */ jsxs29("div", { className: "row gap-x-2 items-center", children: [
|
|
4071
|
-
/* @__PURE__ */
|
|
4072
|
-
/* @__PURE__ */
|
|
4120
|
+
/* @__PURE__ */ jsx42(Input, { autoFocus: true, value: search, onChangeText: setSearch }),
|
|
4121
|
+
/* @__PURE__ */ jsx42(Search2, {})
|
|
4073
4122
|
] }, "selectSearch")],
|
|
4074
4123
|
...selectProps
|
|
4075
4124
|
}
|
|
@@ -4077,7 +4126,7 @@ var SearchableSelect = ({
|
|
|
4077
4126
|
};
|
|
4078
4127
|
|
|
4079
4128
|
// src/components/modals/LanguageModal.tsx
|
|
4080
|
-
import { jsx as
|
|
4129
|
+
import { jsx as jsx43, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
4081
4130
|
var defaultLanguageModalTranslation = {
|
|
4082
4131
|
en: {
|
|
4083
4132
|
title: "Language",
|
|
@@ -4100,7 +4149,7 @@ var LanguageModal = ({
|
|
|
4100
4149
|
}) => {
|
|
4101
4150
|
const { language, setLanguage } = useLanguage();
|
|
4102
4151
|
const translation = useTranslation(defaultLanguageModalTranslation, overwriteTranslation);
|
|
4103
|
-
return /* @__PURE__ */
|
|
4152
|
+
return /* @__PURE__ */ jsx43(
|
|
4104
4153
|
Modal,
|
|
4105
4154
|
{
|
|
4106
4155
|
headerProps: {
|
|
@@ -4111,7 +4160,7 @@ var LanguageModal = ({
|
|
|
4111
4160
|
onClose,
|
|
4112
4161
|
...modalProps,
|
|
4113
4162
|
children: /* @__PURE__ */ jsxs30("div", { className: "w-64", children: [
|
|
4114
|
-
/* @__PURE__ */
|
|
4163
|
+
/* @__PURE__ */ jsx43(
|
|
4115
4164
|
Select,
|
|
4116
4165
|
{
|
|
4117
4166
|
className: "mt-2",
|
|
@@ -4120,7 +4169,7 @@ var LanguageModal = ({
|
|
|
4120
4169
|
onChange: (language2) => setLanguage(language2)
|
|
4121
4170
|
}
|
|
4122
4171
|
),
|
|
4123
|
-
/* @__PURE__ */
|
|
4172
|
+
/* @__PURE__ */ jsx43("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ jsx43(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation.done }) })
|
|
4124
4173
|
] })
|
|
4125
4174
|
}
|
|
4126
4175
|
);
|
|
@@ -4128,7 +4177,7 @@ var LanguageModal = ({
|
|
|
4128
4177
|
|
|
4129
4178
|
// src/theming/useTheme.tsx
|
|
4130
4179
|
import { createContext as createContext2, useContext as useContext2, useEffect as useEffect16, useState as useState19 } from "react";
|
|
4131
|
-
import { jsx as
|
|
4180
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
4132
4181
|
var themes = ["light", "dark"];
|
|
4133
4182
|
var defaultThemeTypeTranslation = {
|
|
4134
4183
|
en: {
|
|
@@ -4159,13 +4208,13 @@ var ThemeProvider = ({ children, initialTheme = "light" }) => {
|
|
|
4159
4208
|
useEffect16(() => {
|
|
4160
4209
|
document.documentElement.setAttribute("data-theme", theme);
|
|
4161
4210
|
}, [theme]);
|
|
4162
|
-
return /* @__PURE__ */
|
|
4211
|
+
return /* @__PURE__ */ jsx44(ThemeContext.Provider, { value: { theme, setTheme }, children });
|
|
4163
4212
|
};
|
|
4164
4213
|
var useTheme = () => useContext2(ThemeContext);
|
|
4165
4214
|
|
|
4166
4215
|
// src/components/modals/ThemeModal.tsx
|
|
4167
|
-
import { jsx as
|
|
4168
|
-
var
|
|
4216
|
+
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4217
|
+
var defaultConfirmDialogTranslation3 = {
|
|
4169
4218
|
en: {
|
|
4170
4219
|
title: "Theme",
|
|
4171
4220
|
message: "Choose your preferred theme",
|
|
@@ -4186,8 +4235,8 @@ var ThemeModal = ({
|
|
|
4186
4235
|
...modalProps
|
|
4187
4236
|
}) => {
|
|
4188
4237
|
const { theme, setTheme } = useTheme();
|
|
4189
|
-
const translation = useTranslation(
|
|
4190
|
-
return /* @__PURE__ */
|
|
4238
|
+
const translation = useTranslation(defaultConfirmDialogTranslation3, overwriteTranslation);
|
|
4239
|
+
return /* @__PURE__ */ jsx45(
|
|
4191
4240
|
Modal,
|
|
4192
4241
|
{
|
|
4193
4242
|
headerProps: {
|
|
@@ -4198,7 +4247,7 @@ var ThemeModal = ({
|
|
|
4198
4247
|
onClose,
|
|
4199
4248
|
...modalProps,
|
|
4200
4249
|
children: /* @__PURE__ */ jsxs31("div", { className: "w-64", children: [
|
|
4201
|
-
/* @__PURE__ */
|
|
4250
|
+
/* @__PURE__ */ jsx45(
|
|
4202
4251
|
Select,
|
|
4203
4252
|
{
|
|
4204
4253
|
className: "mt-2",
|
|
@@ -4207,7 +4256,7 @@ var ThemeModal = ({
|
|
|
4207
4256
|
onChange: (theme2) => setTheme(theme2)
|
|
4208
4257
|
}
|
|
4209
4258
|
),
|
|
4210
|
-
/* @__PURE__ */
|
|
4259
|
+
/* @__PURE__ */ jsx45("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ jsx45(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation.done }) })
|
|
4211
4260
|
] })
|
|
4212
4261
|
}
|
|
4213
4262
|
);
|
|
@@ -4218,8 +4267,8 @@ import { Check as Check3 } from "lucide-react";
|
|
|
4218
4267
|
|
|
4219
4268
|
// src/components/properties/PropertyBase.tsx
|
|
4220
4269
|
import { AlertTriangle } from "lucide-react";
|
|
4221
|
-
import
|
|
4222
|
-
import { jsx as
|
|
4270
|
+
import clsx34 from "clsx";
|
|
4271
|
+
import { jsx as jsx46, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4223
4272
|
var defaultPropertyBaseTranslation = {
|
|
4224
4273
|
en: {
|
|
4225
4274
|
remove: "Remove"
|
|
@@ -4241,11 +4290,11 @@ var PropertyBase = ({
|
|
|
4241
4290
|
}) => {
|
|
4242
4291
|
const translation = useTranslation(defaultPropertyBaseTranslation, overwriteTranslation);
|
|
4243
4292
|
const requiredAndNoValue = softRequired && !hasValue;
|
|
4244
|
-
return /* @__PURE__ */ jsxs32("div", { className:
|
|
4293
|
+
return /* @__PURE__ */ jsxs32("div", { className: clsx34("row gap-x-0 group", className), children: [
|
|
4245
4294
|
/* @__PURE__ */ jsxs32(
|
|
4246
4295
|
"div",
|
|
4247
4296
|
{
|
|
4248
|
-
className:
|
|
4297
|
+
className: clsx34("row gap-x-2 !w-[200px] px-4 py-2 items-center rounded-l-xl border-2 border-r-0", {
|
|
4249
4298
|
"bg-gray-100 text-black group-hover:border-primary border-gray-400": !requiredAndNoValue,
|
|
4250
4299
|
"bg-warning text-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
4251
4300
|
}, className),
|
|
@@ -4258,19 +4307,19 @@ var PropertyBase = ({
|
|
|
4258
4307
|
/* @__PURE__ */ jsxs32(
|
|
4259
4308
|
"div",
|
|
4260
4309
|
{
|
|
4261
|
-
className:
|
|
4310
|
+
className: clsx34("row grow justify-between items-center rounded-r-xl border-2 border-l-0", {
|
|
4262
4311
|
"bg-white group-hover:border-primary border-gray-400": !requiredAndNoValue,
|
|
4263
4312
|
"bg-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
4264
4313
|
}, className),
|
|
4265
4314
|
children: [
|
|
4266
4315
|
input({ softRequired, hasValue }),
|
|
4267
|
-
requiredAndNoValue && /* @__PURE__ */
|
|
4268
|
-
onRemove && /* @__PURE__ */
|
|
4316
|
+
requiredAndNoValue && /* @__PURE__ */ jsx46("div", { className: "text-warning pr-4", children: /* @__PURE__ */ jsx46(AlertTriangle, { size: 24 }) }),
|
|
4317
|
+
onRemove && /* @__PURE__ */ jsx46(
|
|
4269
4318
|
TextButton,
|
|
4270
4319
|
{
|
|
4271
4320
|
onClick: onRemove,
|
|
4272
4321
|
color: "negative",
|
|
4273
|
-
className:
|
|
4322
|
+
className: clsx34("pr-4 items-center", { "!text-transparent": !hasValue || readOnly }),
|
|
4274
4323
|
disabled: !hasValue || readOnly,
|
|
4275
4324
|
children: translation.remove
|
|
4276
4325
|
}
|
|
@@ -4282,7 +4331,7 @@ var PropertyBase = ({
|
|
|
4282
4331
|
};
|
|
4283
4332
|
|
|
4284
4333
|
// src/components/properties/CheckboxProperty.tsx
|
|
4285
|
-
import { jsx as
|
|
4334
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
4286
4335
|
var defaultCheckboxPropertyTranslation = {
|
|
4287
4336
|
en: {
|
|
4288
4337
|
yes: "Yes",
|
|
@@ -4301,14 +4350,14 @@ var CheckboxProperty = ({
|
|
|
4301
4350
|
...baseProps
|
|
4302
4351
|
}) => {
|
|
4303
4352
|
const translation = useTranslation(defaultCheckboxPropertyTranslation, overwriteTranslation);
|
|
4304
|
-
return /* @__PURE__ */
|
|
4353
|
+
return /* @__PURE__ */ jsx47(
|
|
4305
4354
|
PropertyBase,
|
|
4306
4355
|
{
|
|
4307
4356
|
...baseProps,
|
|
4308
4357
|
hasValue: true,
|
|
4309
4358
|
readOnly,
|
|
4310
|
-
icon: /* @__PURE__ */
|
|
4311
|
-
input: () => /* @__PURE__ */
|
|
4359
|
+
icon: /* @__PURE__ */ jsx47(Check3, { size: 16 }),
|
|
4360
|
+
input: () => /* @__PURE__ */ jsx47("div", { className: "row py-2 px-4 items-center", children: /* @__PURE__ */ jsx47(
|
|
4312
4361
|
Checkbox,
|
|
4313
4362
|
{
|
|
4314
4363
|
checked: value ?? true,
|
|
@@ -4323,8 +4372,8 @@ var CheckboxProperty = ({
|
|
|
4323
4372
|
|
|
4324
4373
|
// src/components/properties/DateProperty.tsx
|
|
4325
4374
|
import { CalendarDays } from "lucide-react";
|
|
4326
|
-
import
|
|
4327
|
-
import { jsx as
|
|
4375
|
+
import clsx35 from "clsx";
|
|
4376
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
4328
4377
|
var DateProperty = ({
|
|
4329
4378
|
value,
|
|
4330
4379
|
onChange = noop,
|
|
@@ -4335,20 +4384,20 @@ var DateProperty = ({
|
|
|
4335
4384
|
}) => {
|
|
4336
4385
|
const hasValue = !!value;
|
|
4337
4386
|
const dateText = value ? type === "dateTime" ? formatDateTime(value) : formatDate(value) : "";
|
|
4338
|
-
return /* @__PURE__ */
|
|
4387
|
+
return /* @__PURE__ */ jsx48(
|
|
4339
4388
|
PropertyBase,
|
|
4340
4389
|
{
|
|
4341
4390
|
...baseProps,
|
|
4342
4391
|
hasValue,
|
|
4343
|
-
icon: /* @__PURE__ */
|
|
4344
|
-
input: ({ softRequired }) => /* @__PURE__ */
|
|
4392
|
+
icon: /* @__PURE__ */ jsx48(CalendarDays, { size: 16 }),
|
|
4393
|
+
input: ({ softRequired }) => /* @__PURE__ */ jsx48(
|
|
4345
4394
|
"div",
|
|
4346
4395
|
{
|
|
4347
|
-
className:
|
|
4348
|
-
children: /* @__PURE__ */
|
|
4396
|
+
className: clsx35("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
|
|
4397
|
+
children: /* @__PURE__ */ jsx48(
|
|
4349
4398
|
Input,
|
|
4350
4399
|
{
|
|
4351
|
-
className:
|
|
4400
|
+
className: clsx35("!ring-0 !border-0 !outline-0 !p-0 !m-0 !shadow-none !w-fit !rounded-none", { "bg-surface-warning": softRequired && !hasValue }),
|
|
4352
4401
|
value: dateText,
|
|
4353
4402
|
type: type === "dateTime" ? "datetime-local" : "date",
|
|
4354
4403
|
readOnly,
|
|
@@ -4372,16 +4421,16 @@ var DateProperty = ({
|
|
|
4372
4421
|
|
|
4373
4422
|
// src/components/properties/MultiSelectProperty.tsx
|
|
4374
4423
|
import { List } from "lucide-react";
|
|
4375
|
-
import
|
|
4424
|
+
import clsx38 from "clsx";
|
|
4376
4425
|
|
|
4377
4426
|
// src/components/user-action/MultiSelect.tsx
|
|
4378
4427
|
import { useState as useState20 } from "react";
|
|
4379
4428
|
import { Search as Search3 } from "lucide-react";
|
|
4380
|
-
import
|
|
4429
|
+
import clsx37 from "clsx";
|
|
4381
4430
|
|
|
4382
4431
|
// src/components/user-action/Menu.tsx
|
|
4383
4432
|
import { useRef as useRef7 } from "react";
|
|
4384
|
-
import
|
|
4433
|
+
import clsx36 from "clsx";
|
|
4385
4434
|
|
|
4386
4435
|
// src/hooks/useOutsideClick.ts
|
|
4387
4436
|
import { useEffect as useEffect17 } from "react";
|
|
@@ -4404,16 +4453,16 @@ var useOutsideClick = (refs, handler) => {
|
|
|
4404
4453
|
};
|
|
4405
4454
|
|
|
4406
4455
|
// src/components/user-action/Menu.tsx
|
|
4407
|
-
import { jsx as
|
|
4456
|
+
import { jsx as jsx49, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4408
4457
|
var MenuItem = ({
|
|
4409
4458
|
children,
|
|
4410
4459
|
onClick,
|
|
4411
4460
|
alignment = "left",
|
|
4412
4461
|
className
|
|
4413
|
-
}) => /* @__PURE__ */
|
|
4462
|
+
}) => /* @__PURE__ */ jsx49(
|
|
4414
4463
|
"div",
|
|
4415
4464
|
{
|
|
4416
|
-
className:
|
|
4465
|
+
className: clsx36("block px-3 py-1 bg-menu-background text-menu-text hover:brightness-90", {
|
|
4417
4466
|
"text-right": alignment === "right",
|
|
4418
4467
|
"text-left": alignment === "left"
|
|
4419
4468
|
}, className),
|
|
@@ -4439,12 +4488,12 @@ var Menu2 = ({
|
|
|
4439
4488
|
...handlers,
|
|
4440
4489
|
children: [
|
|
4441
4490
|
trigger(() => setIsOpen(!isOpen), triggerRef),
|
|
4442
|
-
isOpen ? /* @__PURE__ */
|
|
4491
|
+
isOpen ? /* @__PURE__ */ jsx49(
|
|
4443
4492
|
"div",
|
|
4444
4493
|
{
|
|
4445
4494
|
ref: menuRef,
|
|
4446
4495
|
onClick: (e) => e.stopPropagation(),
|
|
4447
|
-
className:
|
|
4496
|
+
className: clsx36("absolute top-full mt-1 py-2 w-60 rounded-lg bg-menu-background text-menu-text ring-1 ring-slate-900/5 text-sm leading-6 font-semibold shadow-md z-[1]", {
|
|
4448
4497
|
" top-[8px]": alignment[0] === "t",
|
|
4449
4498
|
" bottom-[8px]": alignment[0] === "b",
|
|
4450
4499
|
" left-[-8px]": alignment[1] === "l",
|
|
@@ -4459,7 +4508,7 @@ var Menu2 = ({
|
|
|
4459
4508
|
};
|
|
4460
4509
|
|
|
4461
4510
|
// src/components/user-action/MultiSelect.tsx
|
|
4462
|
-
import { jsx as
|
|
4511
|
+
import { jsx as jsx50, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4463
4512
|
var defaultMultiSelectTranslation = {
|
|
4464
4513
|
en: {
|
|
4465
4514
|
select: "Select",
|
|
@@ -4500,15 +4549,15 @@ var MultiSelect = ({
|
|
|
4500
4549
|
filteredOptions = filteredOptions.filter((value) => !value.disabled);
|
|
4501
4550
|
}
|
|
4502
4551
|
const selectedItems = options.filter((value) => value.selected);
|
|
4503
|
-
const menuButtonText = selectedItems.length === 0 ? hintText ?? translation.select : /* @__PURE__ */
|
|
4552
|
+
const menuButtonText = selectedItems.length === 0 ? hintText ?? translation.select : /* @__PURE__ */ jsx50("span", { children: `${selectedItems.length} ${translation.selected}` });
|
|
4504
4553
|
const borderColor = "border-menu-border";
|
|
4505
|
-
return /* @__PURE__ */ jsxs34("div", { className:
|
|
4506
|
-
label && /* @__PURE__ */
|
|
4554
|
+
return /* @__PURE__ */ jsxs34("div", { className: clsx37(className), children: [
|
|
4555
|
+
label && /* @__PURE__ */ jsx50(
|
|
4507
4556
|
Label,
|
|
4508
4557
|
{
|
|
4509
4558
|
...label,
|
|
4510
4559
|
htmlFor: label.name,
|
|
4511
|
-
className:
|
|
4560
|
+
className: clsx37(" mb-1", label.className),
|
|
4512
4561
|
labelType: label.labelType ?? "labelBig"
|
|
4513
4562
|
}
|
|
4514
4563
|
),
|
|
@@ -4516,12 +4565,12 @@ var MultiSelect = ({
|
|
|
4516
4565
|
Menu2,
|
|
4517
4566
|
{
|
|
4518
4567
|
alignment: "t_",
|
|
4519
|
-
trigger: (onClick, ref) => /* @__PURE__ */
|
|
4568
|
+
trigger: (onClick, ref) => /* @__PURE__ */ jsx50(
|
|
4520
4569
|
"div",
|
|
4521
4570
|
{
|
|
4522
4571
|
ref,
|
|
4523
4572
|
onClick: disabled ? void 0 : onClick,
|
|
4524
|
-
className:
|
|
4573
|
+
className: clsx37(
|
|
4525
4574
|
borderColor,
|
|
4526
4575
|
"bg-menu-background text-menu-text inline-w-full justify-between items-center rounded-lg border-2 px-4 py-2 font-medium",
|
|
4527
4576
|
{
|
|
@@ -4533,27 +4582,27 @@ var MultiSelect = ({
|
|
|
4533
4582
|
children: selectedDisplay ? selectedDisplay({ items: options, disabled }) : menuButtonText
|
|
4534
4583
|
}
|
|
4535
4584
|
),
|
|
4536
|
-
menuClassName:
|
|
4585
|
+
menuClassName: clsx37(
|
|
4537
4586
|
"!rounded-lg !shadow-lg !max-h-[500px] !min-w-[400px] !max-w-[70vh] !overflow-y-auto !border !border-2",
|
|
4538
4587
|
borderColor,
|
|
4539
4588
|
{ "!py-0": !enableSearch, "!pb-0": enableSearch }
|
|
4540
4589
|
),
|
|
4541
4590
|
children: [
|
|
4542
4591
|
enableSearch && /* @__PURE__ */ jsxs34("div", { className: "row gap-x-2 items-center px-2 py-2", children: [
|
|
4543
|
-
/* @__PURE__ */
|
|
4544
|
-
/* @__PURE__ */
|
|
4592
|
+
/* @__PURE__ */ jsx50(Input, { autoFocus: true, className: "w-full", value: searchText, onChangeText: setSearchText }),
|
|
4593
|
+
/* @__PURE__ */ jsx50(Search3, {})
|
|
4545
4594
|
] }, "selectSearch"),
|
|
4546
|
-
filteredOptions.map((option, index) => /* @__PURE__ */
|
|
4595
|
+
filteredOptions.map((option, index) => /* @__PURE__ */ jsx50(
|
|
4547
4596
|
MenuItem,
|
|
4548
4597
|
{
|
|
4549
|
-
className:
|
|
4598
|
+
className: clsx37({
|
|
4550
4599
|
"cursor-not-allowed !bg-disabled-background !text-disabled-text hover:brightness-100": !!option.disabled,
|
|
4551
4600
|
"cursor-pointer": !option.disabled
|
|
4552
4601
|
}),
|
|
4553
4602
|
children: /* @__PURE__ */ jsxs34(
|
|
4554
4603
|
"div",
|
|
4555
4604
|
{
|
|
4556
|
-
className:
|
|
4605
|
+
className: clsx37("overflow-hidden whitespace-nowrap text-ellipsis row items-center gap-x-2", option.className),
|
|
4557
4606
|
onClick: () => {
|
|
4558
4607
|
if (!option.disabled) {
|
|
4559
4608
|
onChange(options.map((value) => value.value === option.value ? {
|
|
@@ -4563,7 +4612,7 @@ var MultiSelect = ({
|
|
|
4563
4612
|
}
|
|
4564
4613
|
},
|
|
4565
4614
|
children: [
|
|
4566
|
-
/* @__PURE__ */
|
|
4615
|
+
/* @__PURE__ */ jsx50(Checkbox, { checked: option.selected, disabled: option.disabled, size: "small" }),
|
|
4567
4616
|
option.label
|
|
4568
4617
|
]
|
|
4569
4618
|
}
|
|
@@ -4578,7 +4627,7 @@ var MultiSelect = ({
|
|
|
4578
4627
|
};
|
|
4579
4628
|
|
|
4580
4629
|
// src/components/properties/MultiSelectProperty.tsx
|
|
4581
|
-
import { jsx as
|
|
4630
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
4582
4631
|
var defaultMultiSelectPropertyTranslation = {
|
|
4583
4632
|
en: {
|
|
4584
4633
|
select: "Select"
|
|
@@ -4602,7 +4651,7 @@ var MultiSelectProperty = ({
|
|
|
4602
4651
|
if (softRequired && !hasValue) {
|
|
4603
4652
|
triggerClassName = "border-warning hover:brightness-90";
|
|
4604
4653
|
}
|
|
4605
|
-
return /* @__PURE__ */
|
|
4654
|
+
return /* @__PURE__ */ jsx51(
|
|
4606
4655
|
PropertyBase,
|
|
4607
4656
|
{
|
|
4608
4657
|
name,
|
|
@@ -4610,23 +4659,23 @@ var MultiSelectProperty = ({
|
|
|
4610
4659
|
readOnly,
|
|
4611
4660
|
softRequired,
|
|
4612
4661
|
hasValue,
|
|
4613
|
-
icon: /* @__PURE__ */
|
|
4614
|
-
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */
|
|
4662
|
+
icon: /* @__PURE__ */ jsx51(List, { size: 16 }),
|
|
4663
|
+
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ jsx51(
|
|
4615
4664
|
"div",
|
|
4616
4665
|
{
|
|
4617
|
-
className:
|
|
4618
|
-
children: /* @__PURE__ */
|
|
4666
|
+
className: clsx38("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired2 && !hasValue }),
|
|
4667
|
+
children: /* @__PURE__ */ jsx51(
|
|
4619
4668
|
MultiSelect,
|
|
4620
4669
|
{
|
|
4621
4670
|
...multiSelectProps,
|
|
4622
|
-
className:
|
|
4671
|
+
className: clsx38("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
|
|
4623
4672
|
triggerClassName,
|
|
4624
4673
|
selectedDisplay: ({ items }) => {
|
|
4625
4674
|
const selected = items.filter((value) => value.selected);
|
|
4626
4675
|
if (selected.length === 0) {
|
|
4627
|
-
return /* @__PURE__ */
|
|
4676
|
+
return /* @__PURE__ */ jsx51("span", { children: "Select" });
|
|
4628
4677
|
}
|
|
4629
|
-
return /* @__PURE__ */
|
|
4678
|
+
return /* @__PURE__ */ jsx51(ChipList, { list: selected.map((value) => ({ children: value.label })) });
|
|
4630
4679
|
},
|
|
4631
4680
|
options,
|
|
4632
4681
|
disabled: readOnly,
|
|
@@ -4641,8 +4690,8 @@ var MultiSelectProperty = ({
|
|
|
4641
4690
|
|
|
4642
4691
|
// src/components/properties/NumberProperty.tsx
|
|
4643
4692
|
import { Binary } from "lucide-react";
|
|
4644
|
-
import
|
|
4645
|
-
import { jsx as
|
|
4693
|
+
import clsx39 from "clsx";
|
|
4694
|
+
import { jsx as jsx52, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4646
4695
|
var defaultNumberPropertyTranslation = {
|
|
4647
4696
|
en: {
|
|
4648
4697
|
value: "Value"
|
|
@@ -4663,23 +4712,23 @@ var NumberProperty = ({
|
|
|
4663
4712
|
}) => {
|
|
4664
4713
|
const translation = useTranslation(defaultNumberPropertyTranslation, overwriteTranslation);
|
|
4665
4714
|
const hasValue = value !== void 0;
|
|
4666
|
-
return /* @__PURE__ */
|
|
4715
|
+
return /* @__PURE__ */ jsx52(
|
|
4667
4716
|
PropertyBase,
|
|
4668
4717
|
{
|
|
4669
4718
|
...baseProps,
|
|
4670
4719
|
onRemove,
|
|
4671
4720
|
hasValue,
|
|
4672
|
-
icon: /* @__PURE__ */
|
|
4721
|
+
icon: /* @__PURE__ */ jsx52(Binary, { size: 16 }),
|
|
4673
4722
|
input: ({ softRequired }) => /* @__PURE__ */ jsxs35(
|
|
4674
4723
|
"div",
|
|
4675
4724
|
{
|
|
4676
|
-
className:
|
|
4725
|
+
className: clsx39("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
|
|
4677
4726
|
children: [
|
|
4678
|
-
/* @__PURE__ */
|
|
4727
|
+
/* @__PURE__ */ jsx52(
|
|
4679
4728
|
Input,
|
|
4680
4729
|
{
|
|
4681
4730
|
expanded: false,
|
|
4682
|
-
className:
|
|
4731
|
+
className: clsx39("!ring-0 !border-0 !outline-0 !p-0 !m-0 !w-fit !shadow-none !rounded-none", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
|
|
4683
4732
|
value: value?.toString() ?? "",
|
|
4684
4733
|
type: "number",
|
|
4685
4734
|
readOnly,
|
|
@@ -4702,7 +4751,7 @@ var NumberProperty = ({
|
|
|
4702
4751
|
}
|
|
4703
4752
|
}
|
|
4704
4753
|
),
|
|
4705
|
-
suffix && /* @__PURE__ */
|
|
4754
|
+
suffix && /* @__PURE__ */ jsx52("span", { className: clsx39("ml-1", { "bg-surface-warning": softRequired && !hasValue }), children: suffix })
|
|
4706
4755
|
]
|
|
4707
4756
|
}
|
|
4708
4757
|
)
|
|
@@ -4712,8 +4761,8 @@ var NumberProperty = ({
|
|
|
4712
4761
|
|
|
4713
4762
|
// src/components/properties/SelectProperty.tsx
|
|
4714
4763
|
import { List as List2 } from "lucide-react";
|
|
4715
|
-
import
|
|
4716
|
-
import { jsx as
|
|
4764
|
+
import clsx40 from "clsx";
|
|
4765
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
4717
4766
|
var defaultSingleSelectPropertyTranslation = {
|
|
4718
4767
|
en: {
|
|
4719
4768
|
select: "Select"
|
|
@@ -4734,7 +4783,7 @@ var SingleSelectProperty = ({
|
|
|
4734
4783
|
}) => {
|
|
4735
4784
|
const translation = useTranslation(defaultSingleSelectPropertyTranslation, overwriteTranslation);
|
|
4736
4785
|
const hasValue = value !== void 0;
|
|
4737
|
-
return /* @__PURE__ */
|
|
4786
|
+
return /* @__PURE__ */ jsx53(
|
|
4738
4787
|
PropertyBase,
|
|
4739
4788
|
{
|
|
4740
4789
|
name,
|
|
@@ -4742,19 +4791,19 @@ var SingleSelectProperty = ({
|
|
|
4742
4791
|
readOnly,
|
|
4743
4792
|
softRequired,
|
|
4744
4793
|
hasValue,
|
|
4745
|
-
icon: /* @__PURE__ */
|
|
4746
|
-
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */
|
|
4794
|
+
icon: /* @__PURE__ */ jsx53(List2, { size: 16 }),
|
|
4795
|
+
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ jsx53(
|
|
4747
4796
|
"div",
|
|
4748
4797
|
{
|
|
4749
|
-
className:
|
|
4750
|
-
children: /* @__PURE__ */
|
|
4798
|
+
className: clsx40("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired2 && !hasValue }),
|
|
4799
|
+
children: /* @__PURE__ */ jsx53(
|
|
4751
4800
|
SearchableSelect,
|
|
4752
4801
|
{
|
|
4753
4802
|
...multiSelectProps,
|
|
4754
4803
|
value,
|
|
4755
4804
|
options,
|
|
4756
4805
|
isDisabled: readOnly,
|
|
4757
|
-
className:
|
|
4806
|
+
className: clsx40("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
|
|
4758
4807
|
hintText: `${translation.select}...`
|
|
4759
4808
|
}
|
|
4760
4809
|
)
|
|
@@ -4766,12 +4815,12 @@ var SingleSelectProperty = ({
|
|
|
4766
4815
|
|
|
4767
4816
|
// src/components/properties/TextProperty.tsx
|
|
4768
4817
|
import { Text } from "lucide-react";
|
|
4769
|
-
import
|
|
4818
|
+
import clsx42 from "clsx";
|
|
4770
4819
|
|
|
4771
4820
|
// src/components/user-action/Textarea.tsx
|
|
4772
4821
|
import { useEffect as useEffect18, useState as useState21 } from "react";
|
|
4773
|
-
import
|
|
4774
|
-
import { jsx as
|
|
4822
|
+
import clsx41 from "clsx";
|
|
4823
|
+
import { jsx as jsx54, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4775
4824
|
var Textarea = ({
|
|
4776
4825
|
label,
|
|
4777
4826
|
headline,
|
|
@@ -4793,26 +4842,26 @@ var Textarea = ({
|
|
|
4793
4842
|
clearUpdateTimer();
|
|
4794
4843
|
};
|
|
4795
4844
|
return /* @__PURE__ */ jsxs36("div", { className: "w-full", children: [
|
|
4796
|
-
label && /* @__PURE__ */
|
|
4845
|
+
label && /* @__PURE__ */ jsx54(
|
|
4797
4846
|
Label,
|
|
4798
4847
|
{
|
|
4799
4848
|
...label,
|
|
4800
4849
|
htmlFor: id,
|
|
4801
|
-
className:
|
|
4850
|
+
className: clsx41("mb-1", label.className),
|
|
4802
4851
|
labelType: label.labelType ?? "labelSmall"
|
|
4803
4852
|
}
|
|
4804
4853
|
),
|
|
4805
4854
|
/* @__PURE__ */ jsxs36(
|
|
4806
4855
|
"div",
|
|
4807
4856
|
{
|
|
4808
|
-
className: `${
|
|
4857
|
+
className: `${clsx41(" bg-surface text-on-surface focus-within:border-primary relative", { "shadow border-2 border-gray-300 hover:border-primary rounded-lg": defaultStyle })}`,
|
|
4809
4858
|
children: [
|
|
4810
|
-
headline && /* @__PURE__ */
|
|
4811
|
-
/* @__PURE__ */
|
|
4859
|
+
headline && /* @__PURE__ */ jsx54("span", { className: "mx-3 mt-3 block text-gray-700 font-bold", children: headline }),
|
|
4860
|
+
/* @__PURE__ */ jsx54(
|
|
4812
4861
|
"textarea",
|
|
4813
4862
|
{
|
|
4814
4863
|
id,
|
|
4815
|
-
className:
|
|
4864
|
+
className: clsx41("pt-0 px-3 border-transparent focus:border-transparent focus:ring-0 appearance-none border w-full leading-tight focus:outline-none", {
|
|
4816
4865
|
"resize-none": !resizable,
|
|
4817
4866
|
"h-32": defaultStyle,
|
|
4818
4867
|
"mt-3": !headline
|
|
@@ -4839,7 +4888,7 @@ var Textarea = ({
|
|
|
4839
4888
|
]
|
|
4840
4889
|
}
|
|
4841
4890
|
),
|
|
4842
|
-
hasFocus && disclaimer && /* @__PURE__ */
|
|
4891
|
+
hasFocus && disclaimer && /* @__PURE__ */ jsx54("label", { className: "text-negative", children: disclaimer })
|
|
4843
4892
|
] });
|
|
4844
4893
|
};
|
|
4845
4894
|
var TextareaUncontrolled = ({
|
|
@@ -4851,7 +4900,7 @@ var TextareaUncontrolled = ({
|
|
|
4851
4900
|
useEffect18(() => {
|
|
4852
4901
|
setText(value);
|
|
4853
4902
|
}, [value]);
|
|
4854
|
-
return /* @__PURE__ */
|
|
4903
|
+
return /* @__PURE__ */ jsx54(
|
|
4855
4904
|
Textarea,
|
|
4856
4905
|
{
|
|
4857
4906
|
...props,
|
|
@@ -4865,7 +4914,7 @@ var TextareaUncontrolled = ({
|
|
|
4865
4914
|
};
|
|
4866
4915
|
|
|
4867
4916
|
// src/components/properties/TextProperty.tsx
|
|
4868
|
-
import { jsx as
|
|
4917
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
4869
4918
|
var defaultTextPropertyTranslation = {
|
|
4870
4919
|
en: {
|
|
4871
4920
|
value: "Text"
|
|
@@ -4885,21 +4934,21 @@ var TextProperty = ({
|
|
|
4885
4934
|
}) => {
|
|
4886
4935
|
const translation = useTranslation(defaultTextPropertyTranslation, overwriteTranslation);
|
|
4887
4936
|
const hasValue = value !== void 0;
|
|
4888
|
-
return /* @__PURE__ */
|
|
4937
|
+
return /* @__PURE__ */ jsx55(
|
|
4889
4938
|
PropertyBase,
|
|
4890
4939
|
{
|
|
4891
4940
|
...baseProps,
|
|
4892
4941
|
onRemove,
|
|
4893
4942
|
hasValue,
|
|
4894
|
-
icon: /* @__PURE__ */
|
|
4895
|
-
input: ({ softRequired }) => /* @__PURE__ */
|
|
4943
|
+
icon: /* @__PURE__ */ jsx55(Text, { size: 16 }),
|
|
4944
|
+
input: ({ softRequired }) => /* @__PURE__ */ jsx55(
|
|
4896
4945
|
"div",
|
|
4897
4946
|
{
|
|
4898
|
-
className:
|
|
4899
|
-
children: /* @__PURE__ */
|
|
4947
|
+
className: clsx42("row grow pt-2 pb-1 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
|
|
4948
|
+
children: /* @__PURE__ */ jsx55(
|
|
4900
4949
|
Textarea,
|
|
4901
4950
|
{
|
|
4902
|
-
className:
|
|
4951
|
+
className: clsx42("ring-0 border-0 outline-0 p-0 m-0 shadow-none rounded-none", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
|
|
4903
4952
|
rows: 5,
|
|
4904
4953
|
defaultStyle: false,
|
|
4905
4954
|
value: value ?? "",
|
|
@@ -4928,8 +4977,8 @@ var TextProperty = ({
|
|
|
4928
4977
|
};
|
|
4929
4978
|
|
|
4930
4979
|
// src/components/user-action/DateAndTimePicker.tsx
|
|
4931
|
-
import
|
|
4932
|
-
import { jsx as
|
|
4980
|
+
import clsx43 from "clsx";
|
|
4981
|
+
import { jsx as jsx56, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4933
4982
|
var defaultTimeTranslation = {
|
|
4934
4983
|
en: {
|
|
4935
4984
|
clear: "Clear",
|
|
@@ -4988,7 +5037,7 @@ var DateTimePicker = ({
|
|
|
4988
5037
|
let dateDisplay;
|
|
4989
5038
|
let timeDisplay;
|
|
4990
5039
|
if (useDate) {
|
|
4991
|
-
dateDisplay = /* @__PURE__ */
|
|
5040
|
+
dateDisplay = /* @__PURE__ */ jsx56(
|
|
4992
5041
|
DatePicker,
|
|
4993
5042
|
{
|
|
4994
5043
|
...datePickerProps,
|
|
@@ -5002,11 +5051,11 @@ var DateTimePicker = ({
|
|
|
5002
5051
|
);
|
|
5003
5052
|
}
|
|
5004
5053
|
if (useTime) {
|
|
5005
|
-
timeDisplay = /* @__PURE__ */
|
|
5054
|
+
timeDisplay = /* @__PURE__ */ jsx56(
|
|
5006
5055
|
TimePicker,
|
|
5007
5056
|
{
|
|
5008
5057
|
...timePickerProps,
|
|
5009
|
-
className:
|
|
5058
|
+
className: clsx43("h-full", { "justify-between w-full": mode === "time" }),
|
|
5010
5059
|
maxHeight: 250,
|
|
5011
5060
|
time: value,
|
|
5012
5061
|
onChange
|
|
@@ -5018,9 +5067,9 @@ var DateTimePicker = ({
|
|
|
5018
5067
|
dateDisplay,
|
|
5019
5068
|
timeDisplay
|
|
5020
5069
|
] }),
|
|
5021
|
-
/* @__PURE__ */
|
|
5022
|
-
/* @__PURE__ */
|
|
5023
|
-
/* @__PURE__ */
|
|
5070
|
+
/* @__PURE__ */ jsx56("div", { className: "row justify-end", children: /* @__PURE__ */ jsxs37("div", { className: "row gap-x-2 mt-1", children: [
|
|
5071
|
+
/* @__PURE__ */ jsx56(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation.clear }),
|
|
5072
|
+
/* @__PURE__ */ jsx56(
|
|
5024
5073
|
SolidButton,
|
|
5025
5074
|
{
|
|
5026
5075
|
size: "medium",
|
|
@@ -5034,8 +5083,8 @@ var DateTimePicker = ({
|
|
|
5034
5083
|
|
|
5035
5084
|
// src/components/user-action/ScrollPicker.tsx
|
|
5036
5085
|
import { useCallback as useCallback4, useEffect as useEffect19, useState as useState22 } from "react";
|
|
5037
|
-
import
|
|
5038
|
-
import { jsx as
|
|
5086
|
+
import clsx44 from "clsx";
|
|
5087
|
+
import { jsx as jsx57, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
5039
5088
|
var up = 1;
|
|
5040
5089
|
var down = -1;
|
|
5041
5090
|
var ScrollPicker = ({
|
|
@@ -5174,7 +5223,7 @@ var ScrollPicker = ({
|
|
|
5174
5223
|
}
|
|
5175
5224
|
return clamp(1 - opacityValue / max);
|
|
5176
5225
|
};
|
|
5177
|
-
return /* @__PURE__ */
|
|
5226
|
+
return /* @__PURE__ */ jsx57(
|
|
5178
5227
|
"div",
|
|
5179
5228
|
{
|
|
5180
5229
|
className: "relative overflow-hidden",
|
|
@@ -5185,14 +5234,14 @@ var ScrollPicker = ({
|
|
|
5185
5234
|
}
|
|
5186
5235
|
},
|
|
5187
5236
|
children: /* @__PURE__ */ jsxs38("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
|
|
5188
|
-
/* @__PURE__ */
|
|
5237
|
+
/* @__PURE__ */ jsx57(
|
|
5189
5238
|
"div",
|
|
5190
5239
|
{
|
|
5191
5240
|
className: "absolute z-[1] top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-full min-w-[40px] border border-y-2 border-x-0 border-[#00000033]",
|
|
5192
5241
|
style: { height: `${itemHeight}px` }
|
|
5193
5242
|
}
|
|
5194
5243
|
),
|
|
5195
|
-
/* @__PURE__ */
|
|
5244
|
+
/* @__PURE__ */ jsx57(
|
|
5196
5245
|
"div",
|
|
5197
5246
|
{
|
|
5198
5247
|
className: "col select-none",
|
|
@@ -5200,10 +5249,10 @@ var ScrollPicker = ({
|
|
|
5200
5249
|
transform: `translateY(${-transition * (distance + itemHeight)}px)`,
|
|
5201
5250
|
columnGap: `${distance}px`
|
|
5202
5251
|
},
|
|
5203
|
-
children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */
|
|
5252
|
+
children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ jsx57(
|
|
5204
5253
|
"div",
|
|
5205
5254
|
{
|
|
5206
|
-
className:
|
|
5255
|
+
className: clsx44(
|
|
5207
5256
|
`col items-center justify-center rounded-md`,
|
|
5208
5257
|
{
|
|
5209
5258
|
"text-primary font-bold": currentIndex === index,
|
|
@@ -5232,8 +5281,8 @@ var ScrollPicker = ({
|
|
|
5232
5281
|
// src/components/user-action/ToggleableInput.tsx
|
|
5233
5282
|
import { useEffect as useEffect20, useRef as useRef8, useState as useState23 } from "react";
|
|
5234
5283
|
import { Pencil } from "lucide-react";
|
|
5235
|
-
import
|
|
5236
|
-
import { jsx as
|
|
5284
|
+
import clsx45 from "clsx";
|
|
5285
|
+
import { jsx as jsx58, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
5237
5286
|
var ToggleableInput = ({
|
|
5238
5287
|
type = "text",
|
|
5239
5288
|
value,
|
|
@@ -5263,10 +5312,10 @@ var ToggleableInput = ({
|
|
|
5263
5312
|
/* @__PURE__ */ jsxs39(
|
|
5264
5313
|
"div",
|
|
5265
5314
|
{
|
|
5266
|
-
className:
|
|
5315
|
+
className: clsx45("row items-center w-full gap-x-2 overflow-hidden", { "cursor-pointer": !isEditing }),
|
|
5267
5316
|
onClick: () => !isEditing ? setIsEditing(!isEditing) : void 0,
|
|
5268
5317
|
children: [
|
|
5269
|
-
/* @__PURE__ */
|
|
5318
|
+
/* @__PURE__ */ jsx58("div", { className: clsx45("row overflow-hidden", { "flex-1": isEditing }), children: isEditing ? /* @__PURE__ */ jsx58(
|
|
5270
5319
|
"input",
|
|
5271
5320
|
{
|
|
5272
5321
|
ref,
|
|
@@ -5294,16 +5343,16 @@ var ToggleableInput = ({
|
|
|
5294
5343
|
onEditCompletedWrapper(value);
|
|
5295
5344
|
}
|
|
5296
5345
|
},
|
|
5297
|
-
className:
|
|
5346
|
+
className: clsx45(`w-full border-none rounded-none ring-0 outline-0 text-inherit bg-inherit shadow-transparent decoration-primary p-0 underline-offset-4`, {
|
|
5298
5347
|
underline: isEditing
|
|
5299
5348
|
}, labelClassName),
|
|
5300
5349
|
onFocus: (event) => event.target.select()
|
|
5301
5350
|
}
|
|
5302
|
-
) : /* @__PURE__ */
|
|
5303
|
-
/* @__PURE__ */
|
|
5351
|
+
) : /* @__PURE__ */ jsx58("span", { className: clsx45("max-w-xs break-words overflow-hidden", labelClassName), children: value }) }),
|
|
5352
|
+
/* @__PURE__ */ jsx58(
|
|
5304
5353
|
Pencil,
|
|
5305
5354
|
{
|
|
5306
|
-
className:
|
|
5355
|
+
className: clsx45(`cursor-pointer`, { "text-transparent": isEditing }),
|
|
5307
5356
|
size,
|
|
5308
5357
|
style: { minWidth: `${size}px` }
|
|
5309
5358
|
}
|
|
@@ -5311,7 +5360,7 @@ var ToggleableInput = ({
|
|
|
5311
5360
|
]
|
|
5312
5361
|
}
|
|
5313
5362
|
),
|
|
5314
|
-
isEditing && disclaimer && /* @__PURE__ */
|
|
5363
|
+
isEditing && disclaimer && /* @__PURE__ */ jsx58("label", { className: "text-negative", children: disclaimer })
|
|
5315
5364
|
] });
|
|
5316
5365
|
};
|
|
5317
5366
|
var ToggleableInputUncontrolled = ({
|
|
@@ -5323,7 +5372,7 @@ var ToggleableInputUncontrolled = ({
|
|
|
5323
5372
|
useEffect20(() => {
|
|
5324
5373
|
setValue(initialValue);
|
|
5325
5374
|
}, [initialValue]);
|
|
5326
|
-
return /* @__PURE__ */
|
|
5375
|
+
return /* @__PURE__ */ jsx58(
|
|
5327
5376
|
ToggleableInput,
|
|
5328
5377
|
{
|
|
5329
5378
|
value,
|
|
@@ -5391,6 +5440,7 @@ export {
|
|
|
5391
5440
|
ChipList,
|
|
5392
5441
|
Circle,
|
|
5393
5442
|
ConfirmDialog,
|
|
5443
|
+
ConfirmModal,
|
|
5394
5444
|
DatePicker,
|
|
5395
5445
|
DatePickerUncontrolled,
|
|
5396
5446
|
DateProperty,
|
|
@@ -5425,7 +5475,6 @@ export {
|
|
|
5425
5475
|
Menu2 as Menu,
|
|
5426
5476
|
MenuItem,
|
|
5427
5477
|
Modal,
|
|
5428
|
-
ModalHeader,
|
|
5429
5478
|
MultiSearchWithMapping,
|
|
5430
5479
|
MultiSelect,
|
|
5431
5480
|
MultiSelectProperty,
|
|
@@ -5433,6 +5482,7 @@ export {
|
|
|
5433
5482
|
NumberProperty,
|
|
5434
5483
|
OutlineButton,
|
|
5435
5484
|
Overlay,
|
|
5485
|
+
OverlayHeader,
|
|
5436
5486
|
Pagination,
|
|
5437
5487
|
ProgressIndicator,
|
|
5438
5488
|
PropertyBase,
|