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