@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.cjs
CHANGED
|
@@ -46,6 +46,7 @@ __export(index_exports, {
|
|
|
46
46
|
ChipList: () => ChipList,
|
|
47
47
|
Circle: () => Circle,
|
|
48
48
|
ConfirmDialog: () => ConfirmDialog,
|
|
49
|
+
ConfirmModal: () => ConfirmModal,
|
|
49
50
|
DatePicker: () => DatePicker,
|
|
50
51
|
DatePickerUncontrolled: () => DatePickerUncontrolled,
|
|
51
52
|
DateProperty: () => DateProperty,
|
|
@@ -80,7 +81,6 @@ __export(index_exports, {
|
|
|
80
81
|
Menu: () => Menu2,
|
|
81
82
|
MenuItem: () => MenuItem,
|
|
82
83
|
Modal: () => Modal,
|
|
83
|
-
ModalHeader: () => ModalHeader,
|
|
84
84
|
MultiSearchWithMapping: () => MultiSearchWithMapping,
|
|
85
85
|
MultiSelect: () => MultiSelect,
|
|
86
86
|
MultiSelectProperty: () => MultiSelectProperty,
|
|
@@ -88,6 +88,7 @@ __export(index_exports, {
|
|
|
88
88
|
NumberProperty: () => NumberProperty,
|
|
89
89
|
OutlineButton: () => OutlineButton,
|
|
90
90
|
Overlay: () => Overlay,
|
|
91
|
+
OverlayHeader: () => OverlayHeader,
|
|
91
92
|
Pagination: () => Pagination,
|
|
92
93
|
ProgressIndicator: () => ProgressIndicator,
|
|
93
94
|
PropertyBase: () => PropertyBase,
|
|
@@ -980,6 +981,7 @@ var Expandable = (0, import_react3.forwardRef)(({
|
|
|
980
981
|
icon,
|
|
981
982
|
initialExpansion = false,
|
|
982
983
|
clickOnlyOnHeader = true,
|
|
984
|
+
disabled = false,
|
|
983
985
|
className = "",
|
|
984
986
|
headerClassName = ""
|
|
985
987
|
}, ref) => {
|
|
@@ -989,21 +991,29 @@ var Expandable = (0, import_react3.forwardRef)(({
|
|
|
989
991
|
"div",
|
|
990
992
|
{
|
|
991
993
|
ref,
|
|
992
|
-
className: (0, import_clsx5.default)("col bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader }, className),
|
|
993
|
-
onClick: () => !clickOnlyOnHeader && setIsExpanded(!isExpanded),
|
|
994
|
+
className: (0, import_clsx5.default)("col gap-y-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
|
|
995
|
+
onClick: () => !clickOnlyOnHeader && !disabled && setIsExpanded(!isExpanded),
|
|
994
996
|
children: [
|
|
995
997
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
996
|
-
"
|
|
998
|
+
"div",
|
|
997
999
|
{
|
|
998
|
-
className: (0, import_clsx5.default)(
|
|
999
|
-
|
|
1000
|
+
className: (0, import_clsx5.default)(
|
|
1001
|
+
"row py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
|
|
1002
|
+
{
|
|
1003
|
+
"group-hover:brightness-95": !isExpanded,
|
|
1004
|
+
"hover:brightness-95": isExpanded && !disabled,
|
|
1005
|
+
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
1006
|
+
},
|
|
1007
|
+
headerClassName
|
|
1008
|
+
),
|
|
1009
|
+
onClick: () => clickOnlyOnHeader && !disabled && setIsExpanded(!isExpanded),
|
|
1000
1010
|
children: [
|
|
1001
1011
|
label,
|
|
1002
1012
|
icon(isExpanded)
|
|
1003
1013
|
]
|
|
1004
1014
|
}
|
|
1005
1015
|
),
|
|
1006
|
-
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "col", children })
|
|
1016
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "col px-4 pb-2", children })
|
|
1007
1017
|
]
|
|
1008
1018
|
}
|
|
1009
1019
|
);
|
|
@@ -1515,1504 +1525,1554 @@ var TimePickerUncontrolled = ({
|
|
|
1515
1525
|
);
|
|
1516
1526
|
};
|
|
1517
1527
|
|
|
1518
|
-
// src/components/
|
|
1519
|
-
var
|
|
1520
|
-
var import_clsx10 = __toESM(require("clsx"), 1);
|
|
1521
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1522
|
-
var avtarSizeList = ["tiny", "small", "medium", "large"];
|
|
1523
|
-
var avatarSizeMapping = {
|
|
1524
|
-
tiny: 24,
|
|
1525
|
-
small: 32,
|
|
1526
|
-
medium: 48,
|
|
1527
|
-
large: 64
|
|
1528
|
-
};
|
|
1529
|
-
var Avatar = ({ avatarUrl, alt, size = "medium", className = "" }) => {
|
|
1530
|
-
avatarUrl = "https://cdn.helpwave.de/boringavatar.svg";
|
|
1531
|
-
const avtarSize = {
|
|
1532
|
-
tiny: 24,
|
|
1533
|
-
small: 32,
|
|
1534
|
-
medium: 48,
|
|
1535
|
-
large: 64
|
|
1536
|
-
}[size];
|
|
1537
|
-
const style = {
|
|
1538
|
-
width: avtarSize + "px",
|
|
1539
|
-
height: avtarSize + "px",
|
|
1540
|
-
maxWidth: avtarSize + "px",
|
|
1541
|
-
maxHeight: avtarSize + "px",
|
|
1542
|
-
minWidth: avtarSize + "px",
|
|
1543
|
-
minHeight: avtarSize + "px"
|
|
1544
|
-
};
|
|
1545
|
-
return (
|
|
1546
|
-
// TODO transparent or white background later
|
|
1547
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: (0, import_clsx10.default)(`rounded-full bg-primary`, className), style, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1548
|
-
import_image2.default,
|
|
1549
|
-
{
|
|
1550
|
-
className: "rounded-full border border-gray-200",
|
|
1551
|
-
style,
|
|
1552
|
-
src: avatarUrl,
|
|
1553
|
-
alt,
|
|
1554
|
-
width: avtarSize,
|
|
1555
|
-
height: avtarSize
|
|
1556
|
-
}
|
|
1557
|
-
) })
|
|
1558
|
-
);
|
|
1559
|
-
};
|
|
1560
|
-
var AvatarGroup = ({
|
|
1561
|
-
avatars,
|
|
1562
|
-
maxShownProfiles = 5,
|
|
1563
|
-
size = "tiny"
|
|
1564
|
-
}) => {
|
|
1565
|
-
const displayedProfiles = avatars.length < maxShownProfiles ? avatars : avatars.slice(0, maxShownProfiles);
|
|
1566
|
-
const diameter = avatarSizeMapping[size];
|
|
1567
|
-
const stackingOverlap = 0.5;
|
|
1568
|
-
const notDisplayedProfiles = avatars.length - maxShownProfiles;
|
|
1569
|
-
const avatarGroupWidth = diameter * (stackingOverlap * (displayedProfiles.length - 1) + 1);
|
|
1570
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "row relative", style: { height: diameter + "px" }, children: [
|
|
1571
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { width: avatarGroupWidth + "px" }, children: displayedProfiles.map((avatar, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1572
|
-
"div",
|
|
1573
|
-
{
|
|
1574
|
-
className: "absolute",
|
|
1575
|
-
style: { left: index * diameter * stackingOverlap + "px", zIndex: maxShownProfiles - index },
|
|
1576
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Avatar, { avatarUrl: avatar.avatarUrl, alt: avatar.alt, size })
|
|
1577
|
-
},
|
|
1578
|
-
index
|
|
1579
|
-
)) }),
|
|
1580
|
-
notDisplayedProfiles > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1581
|
-
"div",
|
|
1582
|
-
{
|
|
1583
|
-
className: "truncate row items-center",
|
|
1584
|
-
style: { fontSize: diameter / 2 + "px", marginLeft: 1 + diameter / 16 + "px" },
|
|
1585
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
|
|
1586
|
-
"+ ",
|
|
1587
|
-
notDisplayedProfiles
|
|
1588
|
-
] })
|
|
1589
|
-
}
|
|
1590
|
-
)
|
|
1591
|
-
] });
|
|
1592
|
-
};
|
|
1528
|
+
// src/components/dialogs/ConfirmDialog.tsx
|
|
1529
|
+
var import_clsx12 = __toESM(require("clsx"), 1);
|
|
1593
1530
|
|
|
1594
|
-
// src/components/
|
|
1531
|
+
// src/components/layout-and-navigation/Overlay.tsx
|
|
1532
|
+
var import_react9 = require("react");
|
|
1533
|
+
var import_react_dom = __toESM(require("react-dom"), 1);
|
|
1595
1534
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
height: `${size}px`,
|
|
1611
|
-
...style
|
|
1612
|
-
},
|
|
1613
|
-
...restProps
|
|
1535
|
+
|
|
1536
|
+
// src/hooks/useHoverState.ts
|
|
1537
|
+
var import_react8 = require("react");
|
|
1538
|
+
var defaultUseHoverStateProps = {
|
|
1539
|
+
closingDelay: 200,
|
|
1540
|
+
isDisabled: false
|
|
1541
|
+
};
|
|
1542
|
+
var useHoverState = (props = void 0) => {
|
|
1543
|
+
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
1544
|
+
const [isHovered, setIsHovered] = (0, import_react8.useState)(false);
|
|
1545
|
+
const [timer, setTimer] = (0, import_react8.useState)();
|
|
1546
|
+
const onMouseEnter = () => {
|
|
1547
|
+
if (isDisabled) {
|
|
1548
|
+
return;
|
|
1614
1549
|
}
|
|
1615
|
-
|
|
1550
|
+
clearTimeout(timer);
|
|
1551
|
+
setIsHovered(true);
|
|
1552
|
+
};
|
|
1553
|
+
const onMouseLeave = () => {
|
|
1554
|
+
if (isDisabled) {
|
|
1555
|
+
return;
|
|
1556
|
+
}
|
|
1557
|
+
setTimer(setTimeout(() => {
|
|
1558
|
+
setIsHovered(false);
|
|
1559
|
+
}, closingDelay));
|
|
1560
|
+
};
|
|
1561
|
+
(0, import_react8.useEffect)(() => {
|
|
1562
|
+
if (timer) {
|
|
1563
|
+
return () => {
|
|
1564
|
+
clearTimeout(timer);
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
});
|
|
1568
|
+
(0, import_react8.useEffect)(() => {
|
|
1569
|
+
if (timer) {
|
|
1570
|
+
clearTimeout(timer);
|
|
1571
|
+
}
|
|
1572
|
+
}, [isDisabled]);
|
|
1573
|
+
return {
|
|
1574
|
+
isHovered,
|
|
1575
|
+
setIsHovered,
|
|
1576
|
+
handlers: { onMouseEnter, onMouseLeave }
|
|
1577
|
+
};
|
|
1616
1578
|
};
|
|
1617
1579
|
|
|
1618
|
-
// src/components/
|
|
1619
|
-
var
|
|
1620
|
-
var
|
|
1621
|
-
var
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1580
|
+
// src/components/user-action/Tooltip.tsx
|
|
1581
|
+
var import_clsx10 = require("clsx");
|
|
1582
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1583
|
+
var Tooltip = ({
|
|
1584
|
+
tooltip,
|
|
1585
|
+
children,
|
|
1586
|
+
animationDelay = 650,
|
|
1587
|
+
tooltipClassName = "",
|
|
1588
|
+
containerClassName = "",
|
|
1589
|
+
position = "bottom",
|
|
1590
|
+
zIndex = 10
|
|
1626
1591
|
}) => {
|
|
1627
|
-
|
|
1592
|
+
const { isHovered, handlers } = useHoverState();
|
|
1593
|
+
const positionClasses = {
|
|
1594
|
+
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
1595
|
+
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
1596
|
+
left: `right-full top-1/2 -translate-y-1/2 mr-[6px]`,
|
|
1597
|
+
right: `left-full top-1/2 -translate-y-1/2 ml-[6px]`
|
|
1598
|
+
};
|
|
1599
|
+
const triangleSize = 6;
|
|
1600
|
+
const triangleClasses = {
|
|
1601
|
+
top: `top-full left-1/2 -translate-x-1/2 border-t-tooltip-background border-l-transparent border-r-transparent`,
|
|
1602
|
+
bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-tooltip-background border-l-transparent border-r-transparent`,
|
|
1603
|
+
left: `left-full top-1/2 -translate-y-1/2 border-l-tooltip-background border-t-transparent border-b-transparent`,
|
|
1604
|
+
right: `right-full top-1/2 -translate-y-1/2 border-r-tooltip-background border-t-transparent border-b-transparent`
|
|
1605
|
+
};
|
|
1606
|
+
const triangleStyle = {
|
|
1607
|
+
top: { borderWidth: `${triangleSize}px ${triangleSize}px 0 ${triangleSize}px` },
|
|
1608
|
+
bottom: { borderWidth: `0 ${triangleSize}px ${triangleSize}px ${triangleSize}px` },
|
|
1609
|
+
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
1610
|
+
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
1611
|
+
};
|
|
1612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1628
1613
|
"div",
|
|
1629
1614
|
{
|
|
1630
|
-
className: (0,
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1615
|
+
className: (0, import_clsx10.clsx)("relative inline-block", containerClassName),
|
|
1616
|
+
...handlers,
|
|
1617
|
+
children: [
|
|
1618
|
+
children,
|
|
1619
|
+
isHovered && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1620
|
+
"div",
|
|
1621
|
+
{
|
|
1622
|
+
className: (0, import_clsx10.clsx)(
|
|
1623
|
+
`opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
|
|
1624
|
+
animate-tooltip-fade-in shadow-lg bg-tooltip-background`,
|
|
1625
|
+
positionClasses[position],
|
|
1626
|
+
tooltipClassName
|
|
1627
|
+
),
|
|
1628
|
+
style: { zIndex, animationDelay: animationDelay + "ms" },
|
|
1629
|
+
children: [
|
|
1630
|
+
tooltip,
|
|
1631
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1632
|
+
"div",
|
|
1633
|
+
{
|
|
1634
|
+
className: (0, import_clsx10.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
|
|
1635
|
+
style: { ...triangleStyle[position], zIndex }
|
|
1636
|
+
}
|
|
1637
|
+
)
|
|
1638
|
+
]
|
|
1639
|
+
}
|
|
1640
|
+
)
|
|
1641
|
+
]
|
|
1636
1642
|
}
|
|
1637
1643
|
);
|
|
1638
1644
|
};
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1645
|
+
|
|
1646
|
+
// src/components/layout-and-navigation/Overlay.tsx
|
|
1647
|
+
var import_lucide_react3 = require("lucide-react");
|
|
1648
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1649
|
+
var Overlay = ({
|
|
1650
|
+
children,
|
|
1651
|
+
isOpen,
|
|
1652
|
+
onBackgroundClick,
|
|
1653
|
+
backgroundClassName
|
|
1647
1654
|
}) => {
|
|
1648
|
-
const [
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
1652
|
-
const newWidth = Math.min(width * progress, width);
|
|
1653
|
-
setCurrentWidth(newWidth);
|
|
1654
|
-
if (progress < 1) {
|
|
1655
|
-
requestAnimationFrame((newTimestamp) => animate(newTimestamp, startTime));
|
|
1656
|
-
} else {
|
|
1657
|
-
onAnimationFinished();
|
|
1658
|
-
if (repeating) {
|
|
1659
|
-
setCurrentWidth(0);
|
|
1660
|
-
requestAnimationFrame((newTimestamp) => animate(newTimestamp, newTimestamp));
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
}, [milliseconds, onAnimationFinished, repeating, width]);
|
|
1664
|
-
(0, import_react8.useEffect)(() => {
|
|
1665
|
-
if (currentWidth < width) {
|
|
1666
|
-
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
1667
|
-
}
|
|
1655
|
+
const [root, setRoot] = (0, import_react9.useState)();
|
|
1656
|
+
(0, import_react9.useEffect)(() => {
|
|
1657
|
+
setRoot(document.body);
|
|
1668
1658
|
}, []);
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
{
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
width: `${innerSize + 2 * width}px`,
|
|
1675
|
-
height: `${innerSize + 2 * width}px`,
|
|
1676
|
-
...style
|
|
1677
|
-
},
|
|
1678
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1679
|
-
Ring,
|
|
1659
|
+
if (!root || !isOpen) return null;
|
|
1660
|
+
return import_react_dom.default.createPortal(
|
|
1661
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: (0, import_clsx11.default)("fixed inset-0 z-[9999]"), children: [
|
|
1662
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1663
|
+
"div",
|
|
1680
1664
|
{
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
className
|
|
1665
|
+
className: (0, import_clsx11.default)("fixed inset-0 h-screen w-screen bg-black/30", backgroundClassName),
|
|
1666
|
+
onClick: onBackgroundClick
|
|
1684
1667
|
}
|
|
1685
|
-
)
|
|
1686
|
-
|
|
1668
|
+
),
|
|
1669
|
+
children
|
|
1670
|
+
] }),
|
|
1671
|
+
root
|
|
1687
1672
|
);
|
|
1688
1673
|
};
|
|
1689
|
-
var
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1674
|
+
var overlayStack = [];
|
|
1675
|
+
var defaultModalHeaderTranslation = {
|
|
1676
|
+
en: {
|
|
1677
|
+
close: "Close"
|
|
1678
|
+
},
|
|
1679
|
+
de: {
|
|
1680
|
+
close: "Schlie\xDFen"
|
|
1681
|
+
}
|
|
1682
|
+
};
|
|
1683
|
+
var OverlayHeader = ({
|
|
1684
|
+
overwriteTranslation,
|
|
1685
|
+
onClose,
|
|
1686
|
+
title,
|
|
1687
|
+
titleText = "",
|
|
1688
|
+
description,
|
|
1689
|
+
descriptionText = ""
|
|
1690
|
+
}) => {
|
|
1691
|
+
const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation);
|
|
1692
|
+
const hasTitleRow = !!title || !!titleText || !!onClose;
|
|
1693
|
+
const titleRow = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "row justify-between items-start gap-x-8", children: [
|
|
1694
|
+
title ?? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1695
|
+
"h2",
|
|
1696
|
+
{
|
|
1697
|
+
className: (0, import_clsx11.default)("textstyle-title-lg", {
|
|
1698
|
+
"mb-1": description || descriptionText
|
|
1699
|
+
}),
|
|
1700
|
+
children: titleText
|
|
1701
|
+
}
|
|
1702
|
+
),
|
|
1703
|
+
!!onClose && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Tooltip, { tooltip: translation.close, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconButton, { color: "neutral", size: "small", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react3.X, { className: "w-full h-full" }) }) })
|
|
1704
|
+
] });
|
|
1705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "col", children: [
|
|
1706
|
+
hasTitleRow && titleRow,
|
|
1707
|
+
description ?? (descriptionText && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "textstyle-description", children: descriptionText }))
|
|
1708
|
+
] });
|
|
1709
|
+
};
|
|
1710
|
+
var Modal = ({
|
|
1711
|
+
children,
|
|
1712
|
+
isOpen,
|
|
1713
|
+
onClose,
|
|
1693
1714
|
className,
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
onAnimationFinished = noop,
|
|
1697
|
-
style
|
|
1715
|
+
backgroundClassName,
|
|
1716
|
+
headerProps
|
|
1698
1717
|
}) => {
|
|
1699
|
-
const
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1718
|
+
const ref = (0, import_react9.useRef)(null);
|
|
1719
|
+
(0, import_react9.useEffect)(() => {
|
|
1720
|
+
if (!isOpen) return;
|
|
1721
|
+
const modal = ref.current;
|
|
1722
|
+
if (!modal) {
|
|
1723
|
+
console.error("modal open, but no ref found");
|
|
1724
|
+
return;
|
|
1725
|
+
}
|
|
1726
|
+
overlayStack.push(modal);
|
|
1727
|
+
const focusable = modal?.querySelectorAll(
|
|
1728
|
+
'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])'
|
|
1707
1729
|
);
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
if (
|
|
1714
|
-
|
|
1715
|
-
|
|
1730
|
+
const first = focusable[0];
|
|
1731
|
+
const last = focusable[focusable.length - 1];
|
|
1732
|
+
const handleKeyDown = (e) => {
|
|
1733
|
+
const isTopmost = overlayStack[overlayStack.length - 1] === modal;
|
|
1734
|
+
if (!isTopmost) return;
|
|
1735
|
+
if (e.key === "Escape") {
|
|
1736
|
+
e.stopPropagation();
|
|
1737
|
+
onClose();
|
|
1738
|
+
} else if (e.key === "Tab") {
|
|
1739
|
+
if (focusable.length === 0) return;
|
|
1740
|
+
if (e.shiftKey && document.activeElement === first) {
|
|
1741
|
+
e.preventDefault();
|
|
1742
|
+
last.focus();
|
|
1743
|
+
} else if (!e.shiftKey && document.activeElement === last) {
|
|
1744
|
+
e.preventDefault();
|
|
1745
|
+
first.focus();
|
|
1746
|
+
}
|
|
1716
1747
|
}
|
|
1748
|
+
};
|
|
1749
|
+
modal.focus();
|
|
1750
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1751
|
+
return () => {
|
|
1752
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
1753
|
+
overlayStack = overlayStack.filter((m) => m !== modal);
|
|
1754
|
+
};
|
|
1755
|
+
}, [isOpen, onClose]);
|
|
1756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1757
|
+
Overlay,
|
|
1758
|
+
{
|
|
1759
|
+
isOpen,
|
|
1760
|
+
onBackgroundClick: onClose,
|
|
1761
|
+
backgroundClassName,
|
|
1762
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1763
|
+
"div",
|
|
1764
|
+
{
|
|
1765
|
+
ref,
|
|
1766
|
+
tabIndex: -1,
|
|
1767
|
+
className: (0, import_clsx11.default)(
|
|
1768
|
+
"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",
|
|
1769
|
+
className
|
|
1770
|
+
),
|
|
1771
|
+
role: "dialog",
|
|
1772
|
+
"aria-modal": true,
|
|
1773
|
+
children: [
|
|
1774
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OverlayHeader, { ...headerProps, onClose }),
|
|
1775
|
+
children
|
|
1776
|
+
]
|
|
1777
|
+
}
|
|
1778
|
+
)
|
|
1717
1779
|
}
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1780
|
+
);
|
|
1781
|
+
};
|
|
1782
|
+
var Dialog = ({
|
|
1783
|
+
children,
|
|
1784
|
+
isOpen,
|
|
1785
|
+
className,
|
|
1786
|
+
backgroundClassName,
|
|
1787
|
+
headerProps
|
|
1788
|
+
}) => {
|
|
1789
|
+
const ref = (0, import_react9.useRef)(null);
|
|
1790
|
+
(0, import_react9.useEffect)(() => {
|
|
1791
|
+
if (!isOpen) return;
|
|
1792
|
+
const dialog = ref.current;
|
|
1793
|
+
if (!dialog) {
|
|
1794
|
+
console.error("dialog open, but no ref found");
|
|
1795
|
+
return;
|
|
1722
1796
|
}
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1797
|
+
overlayStack.push(dialog);
|
|
1798
|
+
const focusable = dialog?.querySelectorAll(
|
|
1799
|
+
'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])'
|
|
1800
|
+
);
|
|
1801
|
+
const first = focusable[0];
|
|
1802
|
+
const last = focusable[focusable.length - 1];
|
|
1803
|
+
const handleKeyDown = (e) => {
|
|
1804
|
+
const isTopmost = overlayStack[overlayStack.length - 1] === dialog;
|
|
1805
|
+
if (!isTopmost) return;
|
|
1806
|
+
if (e.key === "Escape") {
|
|
1807
|
+
e.stopPropagation();
|
|
1808
|
+
} else if (e.key === "Tab") {
|
|
1809
|
+
if (focusable.length === 0) return;
|
|
1810
|
+
if (e.shiftKey && document.activeElement === first) {
|
|
1811
|
+
e.preventDefault();
|
|
1812
|
+
last.focus();
|
|
1813
|
+
} else if (!e.shiftKey && document.activeElement === last) {
|
|
1814
|
+
e.preventDefault();
|
|
1815
|
+
first.focus();
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
};
|
|
1819
|
+
dialog.focus();
|
|
1820
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1821
|
+
return () => {
|
|
1822
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
1823
|
+
overlayStack = overlayStack.filter((m) => m !== dialog);
|
|
1824
|
+
};
|
|
1825
|
+
}, [isOpen]);
|
|
1826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1827
|
+
Overlay,
|
|
1726
1828
|
{
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
...style
|
|
1732
|
-
},
|
|
1733
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1734
|
-
Ring,
|
|
1829
|
+
isOpen,
|
|
1830
|
+
backgroundClassName,
|
|
1831
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1832
|
+
"div",
|
|
1735
1833
|
{
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
className
|
|
1834
|
+
ref,
|
|
1835
|
+
tabIndex: -1,
|
|
1836
|
+
className: (0, import_clsx11.default)(
|
|
1837
|
+
"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",
|
|
1838
|
+
className
|
|
1839
|
+
),
|
|
1840
|
+
role: "dialog",
|
|
1841
|
+
"aria-modal": true,
|
|
1842
|
+
children: [
|
|
1843
|
+
!!headerProps && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OverlayHeader, { ...headerProps }),
|
|
1844
|
+
children
|
|
1845
|
+
]
|
|
1739
1846
|
}
|
|
1740
1847
|
)
|
|
1741
1848
|
}
|
|
1742
1849
|
);
|
|
1743
1850
|
};
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1851
|
+
|
|
1852
|
+
// src/components/dialogs/ConfirmDialog.tsx
|
|
1853
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1854
|
+
var defaultConfirmDialogTranslation = {
|
|
1855
|
+
en: {
|
|
1856
|
+
confirm: "Confirm",
|
|
1857
|
+
decline: "Decline"
|
|
1858
|
+
},
|
|
1859
|
+
de: {
|
|
1860
|
+
confirm: "Best\xE4tigen",
|
|
1861
|
+
decline: "Ablehnen"
|
|
1862
|
+
}
|
|
1863
|
+
};
|
|
1864
|
+
var ConfirmDialog = ({
|
|
1865
|
+
overwriteTranslation,
|
|
1866
|
+
children,
|
|
1867
|
+
onConfirm,
|
|
1868
|
+
onDecline,
|
|
1869
|
+
confirmType = "positive",
|
|
1870
|
+
buttonOverwrites,
|
|
1871
|
+
className,
|
|
1872
|
+
...restProps
|
|
1753
1873
|
}) => {
|
|
1754
|
-
const
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1757
|
-
"
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
{ "opacity-5": currentRing !== 0 }
|
|
1786
|
-
),
|
|
1787
|
-
style: {
|
|
1788
|
-
left: `${size / 2}px`,
|
|
1789
|
-
top: `${size / 2}px`,
|
|
1790
|
-
position: "absolute",
|
|
1791
|
-
translate: `-50% -50%`,
|
|
1792
|
-
zIndex: 9
|
|
1793
|
-
}
|
|
1794
|
-
}
|
|
1795
|
-
) : null,
|
|
1796
|
-
currentRing === 2 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1797
|
-
RingWave,
|
|
1798
|
-
{
|
|
1799
|
-
startInnerSize: sizeCircle1 - waveWidth,
|
|
1800
|
-
endInnerSize: sizeCircle2,
|
|
1801
|
-
width: waveWidth,
|
|
1802
|
-
repeating: true,
|
|
1803
|
-
className: (0, import_clsx12.default)(waveBaseColor, `opacity-5`),
|
|
1804
|
-
style: {
|
|
1805
|
-
left: `${size / 2}px`,
|
|
1806
|
-
top: `${size / 2}px`,
|
|
1807
|
-
position: "absolute",
|
|
1808
|
-
translate: `-50% -50%`,
|
|
1809
|
-
zIndex: 9
|
|
1810
|
-
}
|
|
1811
|
-
}
|
|
1812
|
-
) : null,
|
|
1813
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1814
|
-
Circle,
|
|
1815
|
-
{
|
|
1816
|
-
radius: sizeCircle2 / 2,
|
|
1817
|
-
className: (0, import_clsx12.default)(
|
|
1818
|
-
circle2ClassName,
|
|
1819
|
-
{ "opacity-20": currentRing < 1 },
|
|
1820
|
-
`absolute z-[8] -translate-y-1/2 -translate-x-1/2`
|
|
1821
|
-
),
|
|
1822
|
-
style: {
|
|
1823
|
-
left: `${size / 2}px`,
|
|
1824
|
-
top: `${size / 2}px`
|
|
1825
|
-
}
|
|
1826
|
-
}
|
|
1827
|
-
),
|
|
1828
|
-
currentRing === 1 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1829
|
-
AnimatedRing,
|
|
1830
|
-
{
|
|
1831
|
-
innerSize: sizeCircle2 - 1,
|
|
1832
|
-
width: (sizeCircle3 - sizeCircle2) / 2,
|
|
1833
|
-
onAnimationFinished: () => currentRing === 1 ? setCurrentRing(2) : null,
|
|
1834
|
-
repeating: true,
|
|
1835
|
-
className: (0, import_clsx12.default)(circle3ClassName),
|
|
1836
|
-
style: {
|
|
1837
|
-
left: `${size / 2}px`,
|
|
1838
|
-
top: `${size / 2}px`,
|
|
1839
|
-
position: "absolute",
|
|
1840
|
-
translate: `-50% -50%`,
|
|
1841
|
-
zIndex: 7
|
|
1842
|
-
}
|
|
1843
|
-
}
|
|
1844
|
-
) : null,
|
|
1845
|
-
currentRing === 2 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1846
|
-
RingWave,
|
|
1847
|
-
{
|
|
1848
|
-
startInnerSize: sizeCircle2,
|
|
1849
|
-
endInnerSize: sizeCircle3 - waveWidth,
|
|
1850
|
-
width: waveWidth,
|
|
1851
|
-
repeating: true,
|
|
1852
|
-
className: (0, import_clsx12.default)(waveBaseColor, `opacity-5`),
|
|
1853
|
-
style: {
|
|
1854
|
-
left: `${size / 2}px`,
|
|
1855
|
-
top: `${size / 2}px`,
|
|
1856
|
-
position: "absolute",
|
|
1857
|
-
translate: `-50% -50%`,
|
|
1858
|
-
zIndex: 7
|
|
1859
|
-
}
|
|
1860
|
-
}
|
|
1861
|
-
) : null,
|
|
1862
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1863
|
-
Circle,
|
|
1864
|
-
{
|
|
1865
|
-
radius: sizeCircle3 / 2,
|
|
1866
|
-
className: (0, import_clsx12.default)(
|
|
1867
|
-
circle3ClassName,
|
|
1868
|
-
{ "opacity-20": currentRing < 2 },
|
|
1869
|
-
`absolute z-[6] -translate-y-1/2 -translate-x-1/2`
|
|
1870
|
-
),
|
|
1871
|
-
style: {
|
|
1872
|
-
left: `${size / 2}px`,
|
|
1873
|
-
top: `${size / 2}px`
|
|
1874
|
-
}
|
|
1875
|
-
}
|
|
1876
|
-
)
|
|
1877
|
-
]
|
|
1878
|
-
}
|
|
1879
|
-
);
|
|
1874
|
+
const translation = useTranslation(defaultConfirmDialogTranslation, overwriteTranslation);
|
|
1875
|
+
const mapping = {
|
|
1876
|
+
neutral: "primary",
|
|
1877
|
+
negative: "negative",
|
|
1878
|
+
positive: "positive",
|
|
1879
|
+
primary: "primary"
|
|
1880
|
+
};
|
|
1881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Dialog, { ...restProps, className: (0, import_clsx12.default)("justify-between", className), children: [
|
|
1882
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "col grow", children }),
|
|
1883
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "row mt-3 gap-x-4 justify-end", children: [
|
|
1884
|
+
onDecline && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1885
|
+
SolidButton,
|
|
1886
|
+
{
|
|
1887
|
+
color: buttonOverwrites?.[0].color ?? "negative",
|
|
1888
|
+
onClick: onDecline,
|
|
1889
|
+
disabled: buttonOverwrites?.[0].disabled ?? false,
|
|
1890
|
+
children: buttonOverwrites?.[0].text ?? translation.decline
|
|
1891
|
+
}
|
|
1892
|
+
),
|
|
1893
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1894
|
+
SolidButton,
|
|
1895
|
+
{
|
|
1896
|
+
autoFocus: true,
|
|
1897
|
+
color: buttonOverwrites?.[1].color ?? mapping[confirmType],
|
|
1898
|
+
onClick: onConfirm,
|
|
1899
|
+
disabled: buttonOverwrites?.[1].disabled ?? false,
|
|
1900
|
+
children: buttonOverwrites?.[1].text ?? translation.confirm
|
|
1901
|
+
}
|
|
1902
|
+
)
|
|
1903
|
+
] })
|
|
1904
|
+
] });
|
|
1880
1905
|
};
|
|
1881
1906
|
|
|
1882
|
-
// src/components/icons-and-geometry/
|
|
1883
|
-
var
|
|
1907
|
+
// src/components/icons-and-geometry/Avatar.tsx
|
|
1908
|
+
var import_image2 = __toESM(require("next/image"), 1);
|
|
1909
|
+
var import_clsx13 = __toESM(require("clsx"), 1);
|
|
1884
1910
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1885
|
-
var
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1911
|
+
var avtarSizeList = ["tiny", "small", "medium", "large"];
|
|
1912
|
+
var avatarSizeMapping = {
|
|
1913
|
+
tiny: 24,
|
|
1914
|
+
small: 32,
|
|
1915
|
+
medium: 48,
|
|
1916
|
+
large: 64
|
|
1917
|
+
};
|
|
1918
|
+
var Avatar = ({ avatarUrl, alt, size = "medium", className = "" }) => {
|
|
1919
|
+
avatarUrl = "https://cdn.helpwave.de/boringavatar.svg";
|
|
1920
|
+
const avtarSize = {
|
|
1921
|
+
tiny: 24,
|
|
1922
|
+
small: 32,
|
|
1923
|
+
medium: 48,
|
|
1924
|
+
large: 64
|
|
1925
|
+
}[size];
|
|
1926
|
+
const style = {
|
|
1927
|
+
width: avtarSize + "px",
|
|
1928
|
+
height: avtarSize + "px",
|
|
1929
|
+
maxWidth: avtarSize + "px",
|
|
1930
|
+
maxHeight: avtarSize + "px",
|
|
1931
|
+
minWidth: avtarSize + "px",
|
|
1932
|
+
minHeight: avtarSize + "px"
|
|
1933
|
+
};
|
|
1934
|
+
return (
|
|
1935
|
+
// TODO transparent or white background later
|
|
1936
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_clsx13.default)(`rounded-full bg-primary`, className), style, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1937
|
+
import_image2.default,
|
|
1938
|
+
{
|
|
1939
|
+
className: "rounded-full border border-gray-200",
|
|
1940
|
+
style,
|
|
1941
|
+
src: avatarUrl,
|
|
1942
|
+
alt,
|
|
1943
|
+
width: avtarSize,
|
|
1944
|
+
height: avtarSize
|
|
1945
|
+
}
|
|
1946
|
+
) })
|
|
1901
1947
|
);
|
|
1902
1948
|
};
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
const
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1949
|
+
var AvatarGroup = ({
|
|
1950
|
+
avatars,
|
|
1951
|
+
maxShownProfiles = 5,
|
|
1952
|
+
size = "tiny"
|
|
1953
|
+
}) => {
|
|
1954
|
+
const displayedProfiles = avatars.length < maxShownProfiles ? avatars : avatars.slice(0, maxShownProfiles);
|
|
1955
|
+
const diameter = avatarSizeMapping[size];
|
|
1956
|
+
const stackingOverlap = 0.5;
|
|
1957
|
+
const notDisplayedProfiles = avatars.length - maxShownProfiles;
|
|
1958
|
+
const avatarGroupWidth = diameter * (stackingOverlap * (displayedProfiles.length - 1) + 1);
|
|
1959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "row relative", style: { height: diameter + "px" }, children: [
|
|
1960
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { width: avatarGroupWidth + "px" }, children: displayedProfiles.map((avatar, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1961
|
+
"div",
|
|
1913
1962
|
{
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
children:
|
|
1963
|
+
className: "absolute",
|
|
1964
|
+
style: { left: index * diameter * stackingOverlap + "px", zIndex: maxShownProfiles - index },
|
|
1965
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Avatar, { avatarUrl: avatar.avatarUrl, alt: avatar.alt, size })
|
|
1966
|
+
},
|
|
1967
|
+
index
|
|
1968
|
+
)) }),
|
|
1969
|
+
notDisplayedProfiles > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1970
|
+
"div",
|
|
1971
|
+
{
|
|
1972
|
+
className: "truncate row items-center",
|
|
1973
|
+
style: { fontSize: diameter / 2 + "px", marginLeft: 1 + diameter / 16 + "px" },
|
|
1974
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
|
|
1975
|
+
"+ ",
|
|
1976
|
+
notDisplayedProfiles
|
|
1977
|
+
] })
|
|
1917
1978
|
}
|
|
1918
|
-
)
|
|
1919
|
-
|
|
1920
|
-
] }, index)) });
|
|
1979
|
+
)
|
|
1980
|
+
] });
|
|
1921
1981
|
};
|
|
1922
1982
|
|
|
1923
|
-
// src/components/
|
|
1924
|
-
var import_react9 = require("react");
|
|
1983
|
+
// src/components/icons-and-geometry/Circle.tsx
|
|
1925
1984
|
var import_clsx14 = __toESM(require("clsx"), 1);
|
|
1926
|
-
var
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
y
|
|
1947
|
-
};
|
|
1948
|
-
}
|
|
1949
|
-
static cubicBezier(x1, y1, x2, y2) {
|
|
1950
|
-
const { y } = _EaseFunctions.cubicBezierGeneric(x1, y1, x2, y2);
|
|
1951
|
-
return (t) => {
|
|
1952
|
-
t = clamp(t);
|
|
1953
|
-
return y(t);
|
|
1954
|
-
};
|
|
1955
|
-
}
|
|
1956
|
-
static easeInEaseOut(t) {
|
|
1957
|
-
return _EaseFunctions.cubicBezier(0.65, 0, 0.35, 1)(t);
|
|
1958
|
-
}
|
|
1985
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1986
|
+
var Circle = ({
|
|
1987
|
+
radius = 20,
|
|
1988
|
+
className = "bg-primary",
|
|
1989
|
+
style,
|
|
1990
|
+
...restProps
|
|
1991
|
+
}) => {
|
|
1992
|
+
const size = radius * 2;
|
|
1993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1994
|
+
"div",
|
|
1995
|
+
{
|
|
1996
|
+
className: (0, import_clsx14.default)(`rounded-full`, className),
|
|
1997
|
+
style: {
|
|
1998
|
+
width: `${size}px`,
|
|
1999
|
+
height: `${size}px`,
|
|
2000
|
+
...style
|
|
2001
|
+
},
|
|
2002
|
+
...restProps
|
|
2003
|
+
}
|
|
2004
|
+
);
|
|
1959
2005
|
};
|
|
1960
2006
|
|
|
1961
|
-
// src/
|
|
1962
|
-
var
|
|
1963
|
-
|
|
1964
|
-
if (allowedOverScroll < 0 || length < 1) {
|
|
1965
|
-
throw new Error("Invalid parameters: allowedOverScroll >= 0 and length >= 1 must be true");
|
|
1966
|
-
}
|
|
1967
|
-
this.length = length;
|
|
1968
|
-
this.isLooping = isLooping;
|
|
1969
|
-
this.allowedOverScroll = allowedOverScroll;
|
|
1970
|
-
}
|
|
1971
|
-
getCorrectedPosition(position) {
|
|
1972
|
-
if (!this.isLooping) {
|
|
1973
|
-
return Math.max(-this.allowedOverScroll, Math.min(this.allowedOverScroll + this.length - 1, position));
|
|
1974
|
-
}
|
|
1975
|
-
if (position >= this.length) {
|
|
1976
|
-
return position % this.length;
|
|
1977
|
-
}
|
|
1978
|
-
if (position < 0) {
|
|
1979
|
-
return this.length - Math.abs(position) % this.length;
|
|
1980
|
-
}
|
|
1981
|
-
return position;
|
|
1982
|
-
}
|
|
1983
|
-
static withoutOffset(position) {
|
|
1984
|
-
return position + _LoopingArrayCalculator.getOffset(position);
|
|
1985
|
-
}
|
|
1986
|
-
static getOffset(position) {
|
|
1987
|
-
return Math.round(position) - position;
|
|
1988
|
-
}
|
|
1989
|
-
/**
|
|
1990
|
-
* @return absolute distance forwards or Infinity when the target cannot be reached (only possible when not isLooping)
|
|
1991
|
-
*/
|
|
1992
|
-
getDistanceDirectional(position, target, direction) {
|
|
1993
|
-
if (!this.isLooping && (position < -this.allowedOverScroll || position > this.allowedOverScroll + this.length - 1)) {
|
|
1994
|
-
throw new Error("Invalid parameters: position is out of bounds.");
|
|
1995
|
-
}
|
|
1996
|
-
const isForwardInvalid = direction === 1 && position > target;
|
|
1997
|
-
const isBackwardInvalid = direction === -1 && target < position;
|
|
1998
|
-
if (!this.isLooping && (isForwardInvalid || isBackwardInvalid)) {
|
|
1999
|
-
return Infinity;
|
|
2000
|
-
}
|
|
2001
|
-
if (direction === -1) {
|
|
2002
|
-
return this.getDistanceDirectional(target, position, 1);
|
|
2003
|
-
}
|
|
2004
|
-
position = this.getCorrectedPosition(position);
|
|
2005
|
-
target = this.getCorrectedPosition(target);
|
|
2006
|
-
let distance = (target - position) * direction;
|
|
2007
|
-
if (distance < 0) {
|
|
2008
|
-
distance = this.length - Math.abs(position) % this.length + target;
|
|
2009
|
-
}
|
|
2010
|
-
return distance;
|
|
2011
|
-
}
|
|
2012
|
-
getDistanceForward(position, target) {
|
|
2013
|
-
return this.getDistanceDirectional(position, target, 1);
|
|
2014
|
-
}
|
|
2015
|
-
getDistanceBackward(position, target) {
|
|
2016
|
-
return this.getDistanceDirectional(position, target, -1);
|
|
2017
|
-
}
|
|
2018
|
-
getDistance(position, target) {
|
|
2019
|
-
const forwardDistance = this.getDistanceForward(position, target);
|
|
2020
|
-
const backwardDistance = this.getDistanceBackward(position, target);
|
|
2021
|
-
return Math.min(forwardDistance, backwardDistance);
|
|
2022
|
-
}
|
|
2023
|
-
getBestDirection(position, target) {
|
|
2024
|
-
const forwardDistance = this.getDistanceForward(position, target);
|
|
2025
|
-
const backwardDistance = this.getDistanceBackward(position, target);
|
|
2026
|
-
return forwardDistance < backwardDistance ? 1 : -1;
|
|
2027
|
-
}
|
|
2028
|
-
};
|
|
2029
|
-
|
|
2030
|
-
// src/components/layout-and-navigation/Carousel.tsx
|
|
2007
|
+
// src/components/icons-and-geometry/Ring.tsx
|
|
2008
|
+
var import_react10 = require("react");
|
|
2009
|
+
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
2031
2010
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2032
|
-
var
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
isAutoLooping = false,
|
|
2037
|
-
autoLoopingTimeOut = 5e3,
|
|
2038
|
-
autoLoopAnimationTime = 500,
|
|
2039
|
-
hintNext = false,
|
|
2040
|
-
arrows = false,
|
|
2041
|
-
dots = true,
|
|
2042
|
-
overScrollThreshold = 0.1,
|
|
2043
|
-
blurColor = "from-white",
|
|
2044
|
-
className = "",
|
|
2045
|
-
heightClassName = "h-[24rem]",
|
|
2046
|
-
widthClassName = "w-[70%] desktop:w-1/2"
|
|
2011
|
+
var Ring = ({
|
|
2012
|
+
innerSize = 20,
|
|
2013
|
+
width = 7,
|
|
2014
|
+
className = "outline-primary"
|
|
2047
2015
|
}) => {
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
}, setCarouselInformation] = (0, import_react9.useState)({
|
|
2057
|
-
currentPosition: 0
|
|
2058
|
-
});
|
|
2059
|
-
const animationId = (0, import_react9.useRef)(void 0);
|
|
2060
|
-
const timeOut = (0, import_react9.useRef)(void 0);
|
|
2061
|
-
autoLoopingTimeOut = Math.max(0, autoLoopingTimeOut);
|
|
2062
|
-
const length = children.length;
|
|
2063
|
-
const paddingItemCount = 3;
|
|
2064
|
-
const util = (0, import_react9.useMemo)(() => new LoopingArrayCalculator(length, isLooping, overScrollThreshold), [length, isLooping, overScrollThreshold]);
|
|
2065
|
-
const currentIndex = util.getCorrectedPosition(LoopingArrayCalculator.withoutOffset(currentPosition));
|
|
2066
|
-
animationTime = Math.max(200, animationTime);
|
|
2067
|
-
autoLoopAnimationTime = Math.max(200, autoLoopAnimationTime);
|
|
2068
|
-
const getStyleOffset = (index) => {
|
|
2069
|
-
const baseOffset = -50 + (index - currentPosition) * 100;
|
|
2070
|
-
return `${baseOffset}%`;
|
|
2071
|
-
};
|
|
2072
|
-
const animation = (0, import_react9.useCallback)((time) => {
|
|
2073
|
-
let keepAnimating = true;
|
|
2074
|
-
setCarouselInformation((state) => {
|
|
2075
|
-
const {
|
|
2076
|
-
animationState: animationState2,
|
|
2077
|
-
dragState: dragState2
|
|
2078
|
-
} = state;
|
|
2079
|
-
if (animationState2 === void 0 || dragState2 !== void 0) {
|
|
2080
|
-
keepAnimating = false;
|
|
2081
|
-
return state;
|
|
2082
|
-
}
|
|
2083
|
-
if (!animationState2.startTime || !animationState2.lastUpdateTime) {
|
|
2084
|
-
return {
|
|
2085
|
-
...state,
|
|
2086
|
-
animationState: {
|
|
2087
|
-
...animationState2,
|
|
2088
|
-
startTime: time,
|
|
2089
|
-
lastUpdateTime: time
|
|
2090
|
-
}
|
|
2091
|
-
};
|
|
2016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2017
|
+
"div",
|
|
2018
|
+
{
|
|
2019
|
+
className: (0, import_clsx15.default)(`bg-transparent rounded-full outline`, className),
|
|
2020
|
+
style: {
|
|
2021
|
+
width: `${innerSize}px`,
|
|
2022
|
+
height: `${innerSize}px`,
|
|
2023
|
+
outlineWidth: `${width}px`
|
|
2092
2024
|
}
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2025
|
+
}
|
|
2026
|
+
);
|
|
2027
|
+
};
|
|
2028
|
+
var AnimatedRing = ({
|
|
2029
|
+
innerSize,
|
|
2030
|
+
width,
|
|
2031
|
+
className,
|
|
2032
|
+
fillAnimationDuration = 3,
|
|
2033
|
+
repeating = false,
|
|
2034
|
+
onAnimationFinished = noop,
|
|
2035
|
+
style
|
|
2036
|
+
}) => {
|
|
2037
|
+
const [currentWidth, setCurrentWidth] = (0, import_react10.useState)(0);
|
|
2038
|
+
const milliseconds = 1e3 * fillAnimationDuration;
|
|
2039
|
+
const animate = (0, import_react10.useCallback)((timestamp, startTime) => {
|
|
2040
|
+
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
2041
|
+
const newWidth = Math.min(width * progress, width);
|
|
2042
|
+
setCurrentWidth(newWidth);
|
|
2043
|
+
if (progress < 1) {
|
|
2044
|
+
requestAnimationFrame((newTimestamp) => animate(newTimestamp, startTime));
|
|
2045
|
+
} else {
|
|
2046
|
+
onAnimationFinished();
|
|
2047
|
+
if (repeating) {
|
|
2048
|
+
setCurrentWidth(0);
|
|
2049
|
+
requestAnimationFrame((newTimestamp) => animate(newTimestamp, newTimestamp));
|
|
2104
2050
|
}
|
|
2105
|
-
return {
|
|
2106
|
-
currentPosition: newPosition,
|
|
2107
|
-
animationState: {
|
|
2108
|
-
...animationState2,
|
|
2109
|
-
lastUpdateTime: time
|
|
2110
|
-
}
|
|
2111
|
-
};
|
|
2112
|
-
});
|
|
2113
|
-
if (keepAnimating) {
|
|
2114
|
-
animationId.current = requestAnimationFrame((time1) => animation(time1));
|
|
2115
2051
|
}
|
|
2116
|
-
}, [
|
|
2117
|
-
(0,
|
|
2118
|
-
if (
|
|
2119
|
-
|
|
2052
|
+
}, [milliseconds, onAnimationFinished, repeating, width]);
|
|
2053
|
+
(0, import_react10.useEffect)(() => {
|
|
2054
|
+
if (currentWidth < width) {
|
|
2055
|
+
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
2120
2056
|
}
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2057
|
+
}, []);
|
|
2058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2059
|
+
"div",
|
|
2060
|
+
{
|
|
2061
|
+
className: "row items-center justify-center",
|
|
2062
|
+
style: {
|
|
2063
|
+
width: `${innerSize + 2 * width}px`,
|
|
2064
|
+
height: `${innerSize + 2 * width}px`,
|
|
2065
|
+
...style
|
|
2066
|
+
},
|
|
2067
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2068
|
+
Ring,
|
|
2069
|
+
{
|
|
2070
|
+
innerSize,
|
|
2071
|
+
width: currentWidth,
|
|
2072
|
+
className
|
|
2073
|
+
}
|
|
2074
|
+
)
|
|
2137
2075
|
}
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2076
|
+
);
|
|
2077
|
+
};
|
|
2078
|
+
var RingWave = ({
|
|
2079
|
+
startInnerSize = 20,
|
|
2080
|
+
endInnerSize = 30,
|
|
2081
|
+
width,
|
|
2082
|
+
className,
|
|
2083
|
+
fillAnimationDuration = 3,
|
|
2084
|
+
repeating = false,
|
|
2085
|
+
onAnimationFinished = noop,
|
|
2086
|
+
style
|
|
2087
|
+
}) => {
|
|
2088
|
+
const [currentInnerSize, setCurrentInnerSize] = (0, import_react10.useState)(startInnerSize);
|
|
2089
|
+
const distance = endInnerSize - startInnerSize;
|
|
2090
|
+
const milliseconds = 1e3 * fillAnimationDuration;
|
|
2091
|
+
const animate = (0, import_react10.useCallback)((timestamp, startTime) => {
|
|
2092
|
+
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
2093
|
+
const newInnerSize = Math.min(
|
|
2094
|
+
startInnerSize + distance * progress,
|
|
2095
|
+
endInnerSize
|
|
2096
|
+
);
|
|
2097
|
+
setCurrentInnerSize(newInnerSize);
|
|
2098
|
+
if (progress < 1) {
|
|
2099
|
+
requestAnimationFrame((newTimestamp) => animate(newTimestamp, startTime));
|
|
2100
|
+
} else {
|
|
2101
|
+
onAnimationFinished();
|
|
2102
|
+
if (repeating) {
|
|
2103
|
+
setCurrentInnerSize(startInnerSize);
|
|
2104
|
+
requestAnimationFrame((newTimestamp) => animate(newTimestamp, newTimestamp));
|
|
2148
2105
|
}
|
|
2149
2106
|
}
|
|
2150
|
-
}, [
|
|
2151
|
-
|
|
2152
|
-
if (
|
|
2153
|
-
|
|
2154
|
-
}
|
|
2155
|
-
if (targetPosition === currentPosition) {
|
|
2156
|
-
return;
|
|
2107
|
+
}, [distance, endInnerSize, milliseconds, onAnimationFinished, repeating, startInnerSize]);
|
|
2108
|
+
(0, import_react10.useEffect)(() => {
|
|
2109
|
+
if (currentInnerSize < endInnerSize) {
|
|
2110
|
+
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
2157
2111
|
}
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
dragState: void 0,
|
|
2168
|
-
animationState: {
|
|
2169
|
-
targetPosition,
|
|
2170
|
-
direction,
|
|
2171
|
-
startPosition: currentPosition,
|
|
2172
|
-
isAutoLooping: false
|
|
2112
|
+
}, []);
|
|
2113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2114
|
+
"div",
|
|
2115
|
+
{
|
|
2116
|
+
className: "row items-center justify-center",
|
|
2117
|
+
style: {
|
|
2118
|
+
width: `${endInnerSize + 2 * width}px`,
|
|
2119
|
+
height: `${endInnerSize + 2 * width}px`,
|
|
2120
|
+
...style
|
|
2173
2121
|
},
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
};
|
|
2183
|
-
const left = () => {
|
|
2184
|
-
if (canGoLeft()) {
|
|
2185
|
-
startAnimation(currentPosition === 0 ? length - 1 : LoopingArrayCalculator.withoutOffset(currentPosition - 1));
|
|
2186
|
-
}
|
|
2187
|
-
};
|
|
2188
|
-
const right = () => {
|
|
2189
|
-
if (canGoRight()) {
|
|
2190
|
-
startAnimation(LoopingArrayCalculator.withoutOffset((currentPosition + 1) % length));
|
|
2191
|
-
}
|
|
2192
|
-
};
|
|
2193
|
-
let items = children.map((item, index) => ({
|
|
2194
|
-
index,
|
|
2195
|
-
item
|
|
2196
|
-
}));
|
|
2197
|
-
if (isLooping) {
|
|
2198
|
-
const before = createLoopingListWithIndex(children, length - 1, paddingItemCount, false).reverse().map(([index, item]) => ({
|
|
2199
|
-
index,
|
|
2200
|
-
item
|
|
2201
|
-
}));
|
|
2202
|
-
const after = createLoopingListWithIndex(children, 0, paddingItemCount).map(([index, item]) => ({
|
|
2203
|
-
index,
|
|
2204
|
-
item
|
|
2205
|
-
}));
|
|
2206
|
-
items = [
|
|
2207
|
-
...before,
|
|
2208
|
-
...items,
|
|
2209
|
-
...after
|
|
2210
|
-
];
|
|
2211
|
-
}
|
|
2212
|
-
const onDragStart = (x) => setCarouselInformation((prevState) => ({
|
|
2213
|
-
...prevState,
|
|
2214
|
-
dragState: {
|
|
2215
|
-
lastX: x,
|
|
2216
|
-
startX: x,
|
|
2217
|
-
startTime: Date.now(),
|
|
2218
|
-
startIndex: currentPosition
|
|
2219
|
-
},
|
|
2220
|
-
animationState: void 0
|
|
2221
|
-
// cancel animation
|
|
2222
|
-
}));
|
|
2223
|
-
const onDrag = (x, width) => {
|
|
2224
|
-
if (!dragState || x === 0) {
|
|
2225
|
-
return;
|
|
2226
|
-
}
|
|
2227
|
-
const offsetUpdate = (dragState.lastX - x) / width;
|
|
2228
|
-
const newPosition = util.getCorrectedPosition(currentPosition + offsetUpdate);
|
|
2229
|
-
setCarouselInformation((prevState) => ({
|
|
2230
|
-
...prevState,
|
|
2231
|
-
currentPosition: newPosition,
|
|
2232
|
-
dragState: {
|
|
2233
|
-
...dragState,
|
|
2234
|
-
lastX: x
|
|
2235
|
-
}
|
|
2236
|
-
}));
|
|
2237
|
-
};
|
|
2238
|
-
const onDragEnd = (x, width) => {
|
|
2239
|
-
if (!dragState) {
|
|
2240
|
-
return;
|
|
2241
|
-
}
|
|
2242
|
-
const distance = dragState.startX - x;
|
|
2243
|
-
const relativeDistance = distance / width;
|
|
2244
|
-
const duration = Date.now() - dragState.startTime;
|
|
2245
|
-
const velocity = distance / (Date.now() - dragState.startTime);
|
|
2246
|
-
const isSlide = Math.abs(velocity) > 2 || duration < 200 && (Math.abs(relativeDistance) > 0.2 || Math.abs(distance) > 50);
|
|
2247
|
-
if (isSlide) {
|
|
2248
|
-
if (distance > 0 && canGoRight()) {
|
|
2249
|
-
right();
|
|
2250
|
-
return;
|
|
2251
|
-
} else if (distance < 0 && canGoLeft()) {
|
|
2252
|
-
left();
|
|
2253
|
-
return;
|
|
2254
|
-
}
|
|
2122
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2123
|
+
Ring,
|
|
2124
|
+
{
|
|
2125
|
+
innerSize: currentInnerSize,
|
|
2126
|
+
width,
|
|
2127
|
+
className
|
|
2128
|
+
}
|
|
2129
|
+
)
|
|
2255
2130
|
}
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2131
|
+
);
|
|
2132
|
+
};
|
|
2133
|
+
var RadialRings = ({
|
|
2134
|
+
circle1ClassName = "bg-primary/90 outline-primary/90",
|
|
2135
|
+
circle2ClassName = "bg-primary/60 outline-primary/60",
|
|
2136
|
+
circle3ClassName = "bg-primary/40 outline-primary/40",
|
|
2137
|
+
waveWidth = 10,
|
|
2138
|
+
waveBaseColor = "outline-white/20",
|
|
2139
|
+
sizeCircle1 = 100,
|
|
2140
|
+
sizeCircle2 = 200,
|
|
2141
|
+
sizeCircle3 = 300
|
|
2142
|
+
}) => {
|
|
2143
|
+
const [currentRing, setCurrentRing] = (0, import_react10.useState)(0);
|
|
2144
|
+
const size = sizeCircle3;
|
|
2145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2146
|
+
"div",
|
|
2147
|
+
{
|
|
2148
|
+
className: "relative",
|
|
2149
|
+
style: {
|
|
2150
|
+
width: `${sizeCircle3}px`,
|
|
2151
|
+
height: `${sizeCircle3}px`
|
|
2152
|
+
},
|
|
2153
|
+
children: [
|
|
2274
2154
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2275
|
-
|
|
2155
|
+
Circle,
|
|
2276
2156
|
{
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2157
|
+
radius: sizeCircle1 / 2,
|
|
2158
|
+
className: (0, import_clsx15.default)(circle1ClassName, `absolute z-[10] -translate-y-1/2 -translate-x-1/2`),
|
|
2159
|
+
style: {
|
|
2160
|
+
left: `${size / 2}px`,
|
|
2161
|
+
top: `${size / 2}px`
|
|
2162
|
+
}
|
|
2280
2163
|
}
|
|
2281
2164
|
),
|
|
2282
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2283
|
-
|
|
2165
|
+
currentRing === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2166
|
+
AnimatedRing,
|
|
2284
2167
|
{
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2168
|
+
innerSize: sizeCircle1,
|
|
2169
|
+
width: (sizeCircle2 - sizeCircle1) / 2,
|
|
2170
|
+
onAnimationFinished: () => currentRing === 0 ? setCurrentRing(1) : null,
|
|
2171
|
+
repeating: true,
|
|
2172
|
+
className: (0, import_clsx15.default)(
|
|
2173
|
+
circle2ClassName,
|
|
2174
|
+
{ "opacity-5": currentRing !== 0 }
|
|
2175
|
+
),
|
|
2176
|
+
style: {
|
|
2177
|
+
left: `${size / 2}px`,
|
|
2178
|
+
top: `${size / 2}px`,
|
|
2179
|
+
position: "absolute",
|
|
2180
|
+
translate: `-50% -50%`,
|
|
2181
|
+
zIndex: 9
|
|
2182
|
+
}
|
|
2288
2183
|
}
|
|
2289
|
-
)
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "relative row h-full w-full px-2 overflow-hidden", children: items.map(({
|
|
2293
|
-
item,
|
|
2294
|
-
index
|
|
2295
|
-
}, listIndex) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2296
|
-
"div",
|
|
2184
|
+
) : null,
|
|
2185
|
+
currentRing === 2 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2186
|
+
RingWave,
|
|
2297
2187
|
{
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2188
|
+
startInnerSize: sizeCircle1 - waveWidth,
|
|
2189
|
+
endInnerSize: sizeCircle2,
|
|
2190
|
+
width: waveWidth,
|
|
2191
|
+
repeating: true,
|
|
2192
|
+
className: (0, import_clsx15.default)(waveBaseColor, `opacity-5`),
|
|
2193
|
+
style: {
|
|
2194
|
+
left: `${size / 2}px`,
|
|
2195
|
+
top: `${size / 2}px`,
|
|
2196
|
+
position: "absolute",
|
|
2197
|
+
translate: `-50% -50%`,
|
|
2198
|
+
zIndex: 9
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
) : null,
|
|
2306
2202
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2307
|
-
|
|
2203
|
+
Circle,
|
|
2308
2204
|
{
|
|
2309
|
-
|
|
2205
|
+
radius: sizeCircle2 / 2,
|
|
2206
|
+
className: (0, import_clsx15.default)(
|
|
2207
|
+
circle2ClassName,
|
|
2208
|
+
{ "opacity-20": currentRing < 1 },
|
|
2209
|
+
`absolute z-[8] -translate-y-1/2 -translate-x-1/2`
|
|
2210
|
+
),
|
|
2211
|
+
style: {
|
|
2212
|
+
left: `${size / 2}px`,
|
|
2213
|
+
top: `${size / 2}px`
|
|
2214
|
+
}
|
|
2310
2215
|
}
|
|
2311
2216
|
),
|
|
2217
|
+
currentRing === 1 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2218
|
+
AnimatedRing,
|
|
2219
|
+
{
|
|
2220
|
+
innerSize: sizeCircle2 - 1,
|
|
2221
|
+
width: (sizeCircle3 - sizeCircle2) / 2,
|
|
2222
|
+
onAnimationFinished: () => currentRing === 1 ? setCurrentRing(2) : null,
|
|
2223
|
+
repeating: true,
|
|
2224
|
+
className: (0, import_clsx15.default)(circle3ClassName),
|
|
2225
|
+
style: {
|
|
2226
|
+
left: `${size / 2}px`,
|
|
2227
|
+
top: `${size / 2}px`,
|
|
2228
|
+
position: "absolute",
|
|
2229
|
+
translate: `-50% -50%`,
|
|
2230
|
+
zIndex: 7
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
) : null,
|
|
2234
|
+
currentRing === 2 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2235
|
+
RingWave,
|
|
2236
|
+
{
|
|
2237
|
+
startInnerSize: sizeCircle2,
|
|
2238
|
+
endInnerSize: sizeCircle3 - waveWidth,
|
|
2239
|
+
width: waveWidth,
|
|
2240
|
+
repeating: true,
|
|
2241
|
+
className: (0, import_clsx15.default)(waveBaseColor, `opacity-5`),
|
|
2242
|
+
style: {
|
|
2243
|
+
left: `${size / 2}px`,
|
|
2244
|
+
top: `${size / 2}px`,
|
|
2245
|
+
position: "absolute",
|
|
2246
|
+
translate: `-50% -50%`,
|
|
2247
|
+
zIndex: 7
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2250
|
+
) : null,
|
|
2312
2251
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2313
|
-
|
|
2252
|
+
Circle,
|
|
2314
2253
|
{
|
|
2315
|
-
|
|
2254
|
+
radius: sizeCircle3 / 2,
|
|
2255
|
+
className: (0, import_clsx15.default)(
|
|
2256
|
+
circle3ClassName,
|
|
2257
|
+
{ "opacity-20": currentRing < 2 },
|
|
2258
|
+
`absolute z-[6] -translate-y-1/2 -translate-x-1/2`
|
|
2259
|
+
),
|
|
2260
|
+
style: {
|
|
2261
|
+
left: `${size / 2}px`,
|
|
2262
|
+
top: `${size / 2}px`
|
|
2263
|
+
}
|
|
2316
2264
|
}
|
|
2317
2265
|
)
|
|
2318
|
-
]
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
"div",
|
|
2322
|
-
{
|
|
2323
|
-
className: "row items-center justify-center w-full my-2",
|
|
2324
|
-
children: range(0, length - 1).map((index) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2325
|
-
"button",
|
|
2326
|
-
{
|
|
2327
|
-
className: (0, import_clsx14.default)("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", {
|
|
2328
|
-
"bg-gray-200": currentIndex !== index,
|
|
2329
|
-
"bg-primary": currentIndex === index
|
|
2330
|
-
}),
|
|
2331
|
-
onClick: () => startAnimation(index)
|
|
2332
|
-
},
|
|
2333
|
-
index
|
|
2334
|
-
))
|
|
2335
|
-
}
|
|
2336
|
-
)
|
|
2337
|
-
] });
|
|
2266
|
+
]
|
|
2267
|
+
}
|
|
2268
|
+
);
|
|
2338
2269
|
};
|
|
2339
2270
|
|
|
2340
|
-
// src/components/
|
|
2341
|
-
var
|
|
2271
|
+
// src/components/icons-and-geometry/Tag.tsx
|
|
2272
|
+
var import_image3 = __toESM(require("next/image"), 1);
|
|
2342
2273
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2343
|
-
var
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
className = "",
|
|
2349
|
-
...restProps
|
|
2274
|
+
var TagIcon = ({
|
|
2275
|
+
className,
|
|
2276
|
+
width = 16,
|
|
2277
|
+
height = 16,
|
|
2278
|
+
...props
|
|
2350
2279
|
}) => {
|
|
2351
|
-
|
|
2352
|
-
default
|
|
2353
|
-
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
2354
|
-
red: "text-tag-red-text bg-tag-red-background",
|
|
2355
|
-
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
2356
|
-
green: "text-tag-green-text bg-tag-green-background",
|
|
2357
|
-
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
2358
|
-
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
2359
|
-
}[color];
|
|
2360
|
-
const colorMappingIcon = {
|
|
2361
|
-
default: "text-tag-default-icon",
|
|
2362
|
-
dark: "text-tag-dark-icon",
|
|
2363
|
-
red: "text-tag-red-icon",
|
|
2364
|
-
yellow: "text-tag-yellow-icon",
|
|
2365
|
-
green: "text-tag-green-icon",
|
|
2366
|
-
blue: "text-tag-blue-icon",
|
|
2367
|
-
pink: "text-tag-pink-icon"
|
|
2368
|
-
}[color];
|
|
2369
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2370
|
-
"div",
|
|
2280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2281
|
+
import_image3.default,
|
|
2371
2282
|
{
|
|
2372
|
-
...
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
"rounded-full": variant === "fullyRounded"
|
|
2379
|
-
},
|
|
2380
|
-
className
|
|
2381
|
-
),
|
|
2382
|
-
children: [
|
|
2383
|
-
children,
|
|
2384
|
-
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
|
|
2385
|
-
]
|
|
2283
|
+
...props,
|
|
2284
|
+
width,
|
|
2285
|
+
height,
|
|
2286
|
+
alt: "",
|
|
2287
|
+
src: "https://cdn.helpwave.de/icons/label.png",
|
|
2288
|
+
className
|
|
2386
2289
|
}
|
|
2387
2290
|
);
|
|
2388
2291
|
};
|
|
2389
|
-
var ChipList = ({
|
|
2390
|
-
list,
|
|
2391
|
-
className = ""
|
|
2392
|
-
}) => {
|
|
2393
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: (0, import_clsx15.default)("flex flex-wrap gap-x-4 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2394
|
-
Chip,
|
|
2395
|
-
{
|
|
2396
|
-
...value,
|
|
2397
|
-
color: value.color ?? "dark",
|
|
2398
|
-
variant: value.variant ?? "normal",
|
|
2399
|
-
children: value.children
|
|
2400
|
-
},
|
|
2401
|
-
index
|
|
2402
|
-
)) });
|
|
2403
|
-
};
|
|
2404
2292
|
|
|
2405
|
-
// src/components/layout-and-navigation/
|
|
2293
|
+
// src/components/layout-and-navigation/BreadCrumb.tsx
|
|
2294
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
2406
2295
|
var import_clsx16 = __toESM(require("clsx"), 1);
|
|
2407
2296
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2408
|
-
var
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
if (element !== void 0) {
|
|
2418
|
-
nodes.push(element);
|
|
2419
|
-
if (index < children.length - 1) {
|
|
2420
|
-
nodes.push(divider(index));
|
|
2297
|
+
var BreadCrumb = ({ crumbs, linkClassName, containerClassName }) => {
|
|
2298
|
+
const color = "text-description";
|
|
2299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: (0, import_clsx16.default)("row", containerClassName), children: crumbs.map((crumb, index) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
2300
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2301
|
+
import_link.default,
|
|
2302
|
+
{
|
|
2303
|
+
href: crumb.link,
|
|
2304
|
+
className: (0, import_clsx16.default)(linkClassName, { [`${color} hover:brightness-60`]: index !== crumbs.length - 1 }),
|
|
2305
|
+
children: crumb.display
|
|
2421
2306
|
}
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2307
|
+
),
|
|
2308
|
+
index !== crumbs.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: (0, import_clsx16.default)(`px-1`, color), children: "/" })
|
|
2309
|
+
] }, index)) });
|
|
2425
2310
|
};
|
|
2426
2311
|
|
|
2427
|
-
// src/components/layout-and-navigation/
|
|
2312
|
+
// src/components/layout-and-navigation/Carousel.tsx
|
|
2313
|
+
var import_react11 = require("react");
|
|
2428
2314
|
var import_clsx17 = __toESM(require("clsx"), 1);
|
|
2429
2315
|
var import_lucide_react4 = require("lucide-react");
|
|
2430
2316
|
|
|
2431
|
-
// src/
|
|
2432
|
-
var
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "font-space", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2462
|
-
ASTNodeInterpreter,
|
|
2463
|
-
{
|
|
2464
|
-
node: value
|
|
2465
|
-
},
|
|
2466
|
-
index
|
|
2467
|
-
)) });
|
|
2468
|
-
case "primary":
|
|
2469
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-primary", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2470
|
-
ASTNodeInterpreter,
|
|
2471
|
-
{
|
|
2472
|
-
node: value
|
|
2473
|
-
},
|
|
2474
|
-
index
|
|
2475
|
-
)) });
|
|
2476
|
-
case "secondary":
|
|
2477
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-secondary", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2478
|
-
ASTNodeInterpreter,
|
|
2479
|
-
{
|
|
2480
|
-
node: value
|
|
2481
|
-
},
|
|
2482
|
-
index
|
|
2483
|
-
)) });
|
|
2484
|
-
case "warn":
|
|
2485
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-warning", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2486
|
-
ASTNodeInterpreter,
|
|
2487
|
-
{
|
|
2488
|
-
node: value
|
|
2489
|
-
},
|
|
2490
|
-
index
|
|
2491
|
-
)) });
|
|
2492
|
-
case "positive":
|
|
2493
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-positive", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2494
|
-
ASTNodeInterpreter,
|
|
2495
|
-
{
|
|
2496
|
-
node: value
|
|
2497
|
-
},
|
|
2498
|
-
index
|
|
2499
|
-
)) });
|
|
2500
|
-
case "negative":
|
|
2501
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-negative", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2502
|
-
ASTNodeInterpreter,
|
|
2503
|
-
{
|
|
2504
|
-
node: value
|
|
2505
|
-
},
|
|
2506
|
-
index
|
|
2507
|
-
)) });
|
|
2508
|
-
default:
|
|
2509
|
-
return null;
|
|
2317
|
+
// src/util/math.ts
|
|
2318
|
+
var clamp = (value, min = 0, max = 1) => {
|
|
2319
|
+
return Math.min(Math.max(value, min), max);
|
|
2320
|
+
};
|
|
2321
|
+
|
|
2322
|
+
// src/util/easeFunctions.ts
|
|
2323
|
+
var EaseFunctions = class _EaseFunctions {
|
|
2324
|
+
static cubicBezierGeneric(x1, y1, x2, y2) {
|
|
2325
|
+
const cx = 3 * x1;
|
|
2326
|
+
const bx = 3 * (x2 - x1) - cx;
|
|
2327
|
+
const ax = 1 - cx - bx;
|
|
2328
|
+
const cy = 3 * y1;
|
|
2329
|
+
const by = 3 * (y2 - y1) - cy;
|
|
2330
|
+
const ay = 1 - cy - by;
|
|
2331
|
+
const x = (t) => ((ax * t + bx) * t + cx) * t;
|
|
2332
|
+
const y = (t) => ((ay * t + by) * t + cy) * t;
|
|
2333
|
+
return {
|
|
2334
|
+
x,
|
|
2335
|
+
y
|
|
2336
|
+
};
|
|
2337
|
+
}
|
|
2338
|
+
static cubicBezier(x1, y1, x2, y2) {
|
|
2339
|
+
const { y } = _EaseFunctions.cubicBezierGeneric(x1, y1, x2, y2);
|
|
2340
|
+
return (t) => {
|
|
2341
|
+
t = clamp(t);
|
|
2342
|
+
return y(t);
|
|
2343
|
+
};
|
|
2344
|
+
}
|
|
2345
|
+
static easeInEaseOut(t) {
|
|
2346
|
+
return _EaseFunctions.cubicBezier(0.65, 0, 0.35, 1)(t);
|
|
2510
2347
|
}
|
|
2511
2348
|
};
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
{ id: "secondary", name: "secondary" },
|
|
2519
|
-
{ id: "warn", name: "warn" },
|
|
2520
|
-
{ id: "positive", name: "positive" },
|
|
2521
|
-
{ id: "negative", name: "negative" }
|
|
2522
|
-
];
|
|
2523
|
-
var inserterIdentifierMapping = [
|
|
2524
|
-
{ id: "helpwave", name: "helpwave" },
|
|
2525
|
-
{ id: "newline", name: "newline" }
|
|
2526
|
-
];
|
|
2527
|
-
var parseMarkdown = (text, commandStart = "\\", open = "{", close = "}") => {
|
|
2528
|
-
let start = text.indexOf(commandStart);
|
|
2529
|
-
const children = [];
|
|
2530
|
-
while (text !== "") {
|
|
2531
|
-
if (start === -1) {
|
|
2532
|
-
children.push({
|
|
2533
|
-
type: "text",
|
|
2534
|
-
text
|
|
2535
|
-
});
|
|
2536
|
-
break;
|
|
2349
|
+
|
|
2350
|
+
// src/util/loopingArray.ts
|
|
2351
|
+
var LoopingArrayCalculator = class _LoopingArrayCalculator {
|
|
2352
|
+
constructor(length, isLooping = true, allowedOverScroll = 0.1) {
|
|
2353
|
+
if (allowedOverScroll < 0 || length < 1) {
|
|
2354
|
+
throw new Error("Invalid parameters: allowedOverScroll >= 0 and length >= 1 must be true");
|
|
2537
2355
|
}
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
text = "";
|
|
2546
|
-
continue;
|
|
2356
|
+
this.length = length;
|
|
2357
|
+
this.isLooping = isLooping;
|
|
2358
|
+
this.allowedOverScroll = allowedOverScroll;
|
|
2359
|
+
}
|
|
2360
|
+
getCorrectedPosition(position) {
|
|
2361
|
+
if (!this.isLooping) {
|
|
2362
|
+
return Math.max(-this.allowedOverScroll, Math.min(this.allowedOverScroll + this.length - 1, position));
|
|
2547
2363
|
}
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
children.push({
|
|
2551
|
-
type: "text",
|
|
2552
|
-
text: simpleReplace.find((value) => text[1] === value)
|
|
2553
|
-
});
|
|
2554
|
-
text = text.substring(2);
|
|
2555
|
-
start = text.indexOf(commandStart);
|
|
2556
|
-
continue;
|
|
2557
|
-
}
|
|
2558
|
-
const inserter = inserterIdentifierMapping.find((value) => text.substring(1).startsWith(value.id));
|
|
2559
|
-
if (inserter) {
|
|
2560
|
-
children.push({
|
|
2561
|
-
type: inserter.name
|
|
2562
|
-
});
|
|
2563
|
-
text = text.substring(inserter.id.length + 1);
|
|
2564
|
-
start = text.indexOf(commandStart);
|
|
2565
|
-
continue;
|
|
2364
|
+
if (position >= this.length) {
|
|
2365
|
+
return position % this.length;
|
|
2566
2366
|
}
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
if (text[modifier.id.length + 1] !== open) {
|
|
2570
|
-
children.push({
|
|
2571
|
-
type: "text",
|
|
2572
|
-
text: text.substring(0, modifier.id.length + 1)
|
|
2573
|
-
});
|
|
2574
|
-
text = text.substring(modifier.id.length + 2);
|
|
2575
|
-
start = text.indexOf(commandStart);
|
|
2576
|
-
continue;
|
|
2577
|
-
}
|
|
2578
|
-
let closing = -1;
|
|
2579
|
-
let index = modifier.id.length + 2;
|
|
2580
|
-
let counter = 1;
|
|
2581
|
-
let escaping = false;
|
|
2582
|
-
while (index < text.length) {
|
|
2583
|
-
if (text[index] === open && !escaping) {
|
|
2584
|
-
counter++;
|
|
2585
|
-
}
|
|
2586
|
-
if (text[index] === close && !escaping) {
|
|
2587
|
-
counter--;
|
|
2588
|
-
if (counter === 0) {
|
|
2589
|
-
closing = index;
|
|
2590
|
-
break;
|
|
2591
|
-
}
|
|
2592
|
-
}
|
|
2593
|
-
escaping = text[index] === commandStart;
|
|
2594
|
-
index++;
|
|
2595
|
-
}
|
|
2596
|
-
if (closing !== -1) {
|
|
2597
|
-
children.push({
|
|
2598
|
-
type: modifier.name,
|
|
2599
|
-
children: [parseMarkdown(text.substring(modifier.id.length + 2, closing))]
|
|
2600
|
-
});
|
|
2601
|
-
text = text.substring(closing + 1);
|
|
2602
|
-
start = text.indexOf(commandStart);
|
|
2603
|
-
continue;
|
|
2604
|
-
}
|
|
2367
|
+
if (position < 0) {
|
|
2368
|
+
return this.length - Math.abs(position) % this.length;
|
|
2605
2369
|
}
|
|
2606
|
-
|
|
2607
|
-
type: "text",
|
|
2608
|
-
text: text[0]
|
|
2609
|
-
});
|
|
2610
|
-
text = text.substring(1);
|
|
2611
|
-
start = text.indexOf(commandStart);
|
|
2612
|
-
}
|
|
2613
|
-
return {
|
|
2614
|
-
type: "none",
|
|
2615
|
-
children
|
|
2616
|
-
};
|
|
2617
|
-
};
|
|
2618
|
-
var optimizeTree = (node) => {
|
|
2619
|
-
if (node.type === "text") {
|
|
2620
|
-
return !node.text ? void 0 : node;
|
|
2621
|
-
}
|
|
2622
|
-
if (astNodeInserterType.some((value) => value === node.type)) {
|
|
2623
|
-
return node;
|
|
2624
|
-
}
|
|
2625
|
-
const currentNode = node;
|
|
2626
|
-
if (currentNode.children.length === 0) {
|
|
2627
|
-
return void 0;
|
|
2370
|
+
return position;
|
|
2628
2371
|
}
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
const child = optimizeTree(currentNode.children[i]);
|
|
2632
|
-
if (!child) {
|
|
2633
|
-
continue;
|
|
2634
|
-
}
|
|
2635
|
-
if (child.type === "none") {
|
|
2636
|
-
children.push(...child.children);
|
|
2637
|
-
} else {
|
|
2638
|
-
children.push(child);
|
|
2639
|
-
}
|
|
2372
|
+
static withoutOffset(position) {
|
|
2373
|
+
return position + _LoopingArrayCalculator.getOffset(position);
|
|
2640
2374
|
}
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
for (let i = 0; i < currentNode.children.length; i++) {
|
|
2644
|
-
const child = currentNode.children[i];
|
|
2645
|
-
if (child) {
|
|
2646
|
-
if (child.type === "text" && children[children.length - 1]?.type === "text") {
|
|
2647
|
-
children[children.length - 1].text += child.text;
|
|
2648
|
-
} else {
|
|
2649
|
-
children.push(child);
|
|
2650
|
-
}
|
|
2651
|
-
}
|
|
2375
|
+
static getOffset(position) {
|
|
2376
|
+
return Math.round(position) - position;
|
|
2652
2377
|
}
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ASTNodeInterpreter, { node: optimizedTree, isRoot: true, className });
|
|
2660
|
-
};
|
|
2661
|
-
|
|
2662
|
-
// src/components/layout-and-navigation/FAQSection.tsx
|
|
2663
|
-
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2664
|
-
var FAQSection = ({
|
|
2665
|
-
entries,
|
|
2666
|
-
expandableClassName
|
|
2667
|
-
}) => {
|
|
2668
|
-
const chevronSize = 28;
|
|
2669
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "col gap-y-4", children: entries.map(({ id, title, content, ...restProps }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2670
|
-
Expandable,
|
|
2671
|
-
{
|
|
2672
|
-
...restProps,
|
|
2673
|
-
label: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h3", { id, className: "textstyle-title-md", children: title }),
|
|
2674
|
-
clickOnlyOnHeader: false,
|
|
2675
|
-
icon: (expanded) => expanded ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react4.ChevronUp, { size: chevronSize, className: "text-primary", style: { minWidth: `${chevronSize}px` } }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react4.ChevronDown, { size: chevronSize, className: "text-primary" }),
|
|
2676
|
-
className: (0, import_clsx17.default)("rounded-xl", expandableClassName),
|
|
2677
|
-
headerClassName: "px-6 py-4",
|
|
2678
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "mt-2 px-6 pb-4", children: content.type === "markdown" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MarkdownInterpreter, { text: content.value }) : content.value })
|
|
2679
|
-
},
|
|
2680
|
-
id
|
|
2681
|
-
)) });
|
|
2682
|
-
};
|
|
2683
|
-
|
|
2684
|
-
// src/components/layout-and-navigation/Overlay.tsx
|
|
2685
|
-
var import_react11 = require("react");
|
|
2686
|
-
var import_react_dom = __toESM(require("react-dom"), 1);
|
|
2687
|
-
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
2688
|
-
|
|
2689
|
-
// src/hooks/useHoverState.ts
|
|
2690
|
-
var import_react10 = require("react");
|
|
2691
|
-
var defaultUseHoverStateProps = {
|
|
2692
|
-
closingDelay: 200,
|
|
2693
|
-
isDisabled: false
|
|
2694
|
-
};
|
|
2695
|
-
var useHoverState = (props = void 0) => {
|
|
2696
|
-
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
2697
|
-
const [isHovered, setIsHovered] = (0, import_react10.useState)(false);
|
|
2698
|
-
const [timer, setTimer] = (0, import_react10.useState)();
|
|
2699
|
-
const onMouseEnter = () => {
|
|
2700
|
-
if (isDisabled) {
|
|
2701
|
-
return;
|
|
2378
|
+
/**
|
|
2379
|
+
* @return absolute distance forwards or Infinity when the target cannot be reached (only possible when not isLooping)
|
|
2380
|
+
*/
|
|
2381
|
+
getDistanceDirectional(position, target, direction) {
|
|
2382
|
+
if (!this.isLooping && (position < -this.allowedOverScroll || position > this.allowedOverScroll + this.length - 1)) {
|
|
2383
|
+
throw new Error("Invalid parameters: position is out of bounds.");
|
|
2702
2384
|
}
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
if (isDisabled) {
|
|
2708
|
-
return;
|
|
2385
|
+
const isForwardInvalid = direction === 1 && position > target;
|
|
2386
|
+
const isBackwardInvalid = direction === -1 && target < position;
|
|
2387
|
+
if (!this.isLooping && (isForwardInvalid || isBackwardInvalid)) {
|
|
2388
|
+
return Infinity;
|
|
2709
2389
|
}
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
}, closingDelay));
|
|
2713
|
-
};
|
|
2714
|
-
(0, import_react10.useEffect)(() => {
|
|
2715
|
-
if (timer) {
|
|
2716
|
-
return () => {
|
|
2717
|
-
clearTimeout(timer);
|
|
2718
|
-
};
|
|
2390
|
+
if (direction === -1) {
|
|
2391
|
+
return this.getDistanceDirectional(target, position, 1);
|
|
2719
2392
|
}
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2393
|
+
position = this.getCorrectedPosition(position);
|
|
2394
|
+
target = this.getCorrectedPosition(target);
|
|
2395
|
+
let distance = (target - position) * direction;
|
|
2396
|
+
if (distance < 0) {
|
|
2397
|
+
distance = this.length - Math.abs(position) % this.length + target;
|
|
2724
2398
|
}
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2399
|
+
return distance;
|
|
2400
|
+
}
|
|
2401
|
+
getDistanceForward(position, target) {
|
|
2402
|
+
return this.getDistanceDirectional(position, target, 1);
|
|
2403
|
+
}
|
|
2404
|
+
getDistanceBackward(position, target) {
|
|
2405
|
+
return this.getDistanceDirectional(position, target, -1);
|
|
2406
|
+
}
|
|
2407
|
+
getDistance(position, target) {
|
|
2408
|
+
const forwardDistance = this.getDistanceForward(position, target);
|
|
2409
|
+
const backwardDistance = this.getDistanceBackward(position, target);
|
|
2410
|
+
return Math.min(forwardDistance, backwardDistance);
|
|
2411
|
+
}
|
|
2412
|
+
getBestDirection(position, target) {
|
|
2413
|
+
const forwardDistance = this.getDistanceForward(position, target);
|
|
2414
|
+
const backwardDistance = this.getDistanceBackward(position, target);
|
|
2415
|
+
return forwardDistance < backwardDistance ? 1 : -1;
|
|
2416
|
+
}
|
|
2731
2417
|
};
|
|
2732
2418
|
|
|
2733
|
-
// src/components/
|
|
2734
|
-
var
|
|
2735
|
-
var
|
|
2736
|
-
var Tooltip = ({
|
|
2737
|
-
tooltip,
|
|
2419
|
+
// src/components/layout-and-navigation/Carousel.tsx
|
|
2420
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2421
|
+
var Carousel = ({
|
|
2738
2422
|
children,
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2423
|
+
animationTime = 200,
|
|
2424
|
+
isLooping = false,
|
|
2425
|
+
isAutoLooping = false,
|
|
2426
|
+
autoLoopingTimeOut = 5e3,
|
|
2427
|
+
autoLoopAnimationTime = 500,
|
|
2428
|
+
hintNext = false,
|
|
2429
|
+
arrows = false,
|
|
2430
|
+
dots = true,
|
|
2431
|
+
overScrollThreshold = 0.1,
|
|
2432
|
+
blurColor = "from-white",
|
|
2433
|
+
className = "",
|
|
2434
|
+
heightClassName = "h-[24rem]",
|
|
2435
|
+
widthClassName = "w-[70%] desktop:w-1/2"
|
|
2744
2436
|
}) => {
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2437
|
+
if (isAutoLooping && !isLooping) {
|
|
2438
|
+
console.error("When isAutoLooping is true, isLooping should also be true");
|
|
2439
|
+
isLooping = true;
|
|
2440
|
+
}
|
|
2441
|
+
const [{
|
|
2442
|
+
currentPosition,
|
|
2443
|
+
dragState,
|
|
2444
|
+
animationState
|
|
2445
|
+
}, setCarouselInformation] = (0, import_react11.useState)({
|
|
2446
|
+
currentPosition: 0
|
|
2447
|
+
});
|
|
2448
|
+
const animationId = (0, import_react11.useRef)(void 0);
|
|
2449
|
+
const timeOut = (0, import_react11.useRef)(void 0);
|
|
2450
|
+
autoLoopingTimeOut = Math.max(0, autoLoopingTimeOut);
|
|
2451
|
+
const length = children.length;
|
|
2452
|
+
const paddingItemCount = 3;
|
|
2453
|
+
const util = (0, import_react11.useMemo)(() => new LoopingArrayCalculator(length, isLooping, overScrollThreshold), [length, isLooping, overScrollThreshold]);
|
|
2454
|
+
const currentIndex = util.getCorrectedPosition(LoopingArrayCalculator.withoutOffset(currentPosition));
|
|
2455
|
+
animationTime = Math.max(200, animationTime);
|
|
2456
|
+
autoLoopAnimationTime = Math.max(200, autoLoopAnimationTime);
|
|
2457
|
+
const getStyleOffset = (index) => {
|
|
2458
|
+
const baseOffset = -50 + (index - currentPosition) * 100;
|
|
2459
|
+
return `${baseOffset}%`;
|
|
2751
2460
|
};
|
|
2752
|
-
const
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
children: [
|
|
2771
|
-
children,
|
|
2772
|
-
isHovered && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2773
|
-
"div",
|
|
2774
|
-
{
|
|
2775
|
-
className: (0, import_clsx18.clsx)(
|
|
2776
|
-
`opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
|
|
2777
|
-
animate-tooltip-fade-in shadow-lg bg-tooltip-background`,
|
|
2778
|
-
positionClasses[position],
|
|
2779
|
-
tooltipClassName
|
|
2780
|
-
),
|
|
2781
|
-
style: { zIndex, animationDelay: animationDelay + "ms" },
|
|
2782
|
-
children: [
|
|
2783
|
-
tooltip,
|
|
2784
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2785
|
-
"div",
|
|
2786
|
-
{
|
|
2787
|
-
className: (0, import_clsx18.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
|
|
2788
|
-
style: { ...triangleStyle[position], zIndex }
|
|
2789
|
-
}
|
|
2790
|
-
)
|
|
2791
|
-
]
|
|
2461
|
+
const animation = (0, import_react11.useCallback)((time) => {
|
|
2462
|
+
let keepAnimating = true;
|
|
2463
|
+
setCarouselInformation((state) => {
|
|
2464
|
+
const {
|
|
2465
|
+
animationState: animationState2,
|
|
2466
|
+
dragState: dragState2
|
|
2467
|
+
} = state;
|
|
2468
|
+
if (animationState2 === void 0 || dragState2 !== void 0) {
|
|
2469
|
+
keepAnimating = false;
|
|
2470
|
+
return state;
|
|
2471
|
+
}
|
|
2472
|
+
if (!animationState2.startTime || !animationState2.lastUpdateTime) {
|
|
2473
|
+
return {
|
|
2474
|
+
...state,
|
|
2475
|
+
animationState: {
|
|
2476
|
+
...animationState2,
|
|
2477
|
+
startTime: time,
|
|
2478
|
+
lastUpdateTime: time
|
|
2792
2479
|
}
|
|
2793
|
-
|
|
2794
|
-
|
|
2480
|
+
};
|
|
2481
|
+
}
|
|
2482
|
+
const useAnimationTime = animationState2.isAutoLooping ? autoLoopAnimationTime : animationTime;
|
|
2483
|
+
const progress = clamp((time - animationState2.startTime) / useAnimationTime);
|
|
2484
|
+
const easedProgress = EaseFunctions.easeInEaseOut(progress);
|
|
2485
|
+
const distance = util.getDistanceDirectional(animationState2.startPosition, animationState2.targetPosition, animationState2.direction);
|
|
2486
|
+
const newPosition = util.getCorrectedPosition(easedProgress * distance * animationState2.direction + animationState2.startPosition);
|
|
2487
|
+
if (animationState2.targetPosition === newPosition || progress === 1) {
|
|
2488
|
+
keepAnimating = false;
|
|
2489
|
+
return {
|
|
2490
|
+
currentPosition: LoopingArrayCalculator.withoutOffset(newPosition),
|
|
2491
|
+
animationState: void 0
|
|
2492
|
+
};
|
|
2493
|
+
}
|
|
2494
|
+
return {
|
|
2495
|
+
currentPosition: newPosition,
|
|
2496
|
+
animationState: {
|
|
2497
|
+
...animationState2,
|
|
2498
|
+
lastUpdateTime: time
|
|
2499
|
+
}
|
|
2500
|
+
};
|
|
2501
|
+
});
|
|
2502
|
+
if (keepAnimating) {
|
|
2503
|
+
animationId.current = requestAnimationFrame((time1) => animation(time1));
|
|
2795
2504
|
}
|
|
2796
|
-
);
|
|
2797
|
-
};
|
|
2798
|
-
|
|
2799
|
-
// src/components/layout-and-navigation/Overlay.tsx
|
|
2800
|
-
var import_lucide_react5 = require("lucide-react");
|
|
2801
|
-
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2802
|
-
var Overlay = ({
|
|
2803
|
-
children,
|
|
2804
|
-
isOpen,
|
|
2805
|
-
onBackgroundClick,
|
|
2806
|
-
backgroundClassName
|
|
2807
|
-
}) => {
|
|
2808
|
-
const [root, setRoot] = (0, import_react11.useState)();
|
|
2505
|
+
}, [animationTime, autoLoopAnimationTime, util]);
|
|
2809
2506
|
(0, import_react11.useEffect)(() => {
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
{
|
|
2818
|
-
className: (0, import_clsx19.default)("fixed inset-0 h-screen w-screen bg-black/30", backgroundClassName),
|
|
2819
|
-
onClick: onBackgroundClick
|
|
2820
|
-
}
|
|
2821
|
-
),
|
|
2822
|
-
children
|
|
2823
|
-
] }),
|
|
2824
|
-
root
|
|
2825
|
-
);
|
|
2826
|
-
};
|
|
2827
|
-
var overlayStack = [];
|
|
2828
|
-
var defaultModalHeaderTranslation = {
|
|
2829
|
-
en: {
|
|
2830
|
-
close: "Close"
|
|
2831
|
-
},
|
|
2832
|
-
de: {
|
|
2833
|
-
close: "Schlie\xDFen"
|
|
2834
|
-
}
|
|
2835
|
-
};
|
|
2836
|
-
var ModalHeader = ({
|
|
2837
|
-
overwriteTranslation,
|
|
2838
|
-
onCloseClick,
|
|
2839
|
-
title,
|
|
2840
|
-
titleText = "",
|
|
2841
|
-
description,
|
|
2842
|
-
descriptionText = ""
|
|
2843
|
-
}) => {
|
|
2844
|
-
const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation);
|
|
2845
|
-
const hasTitleRow = !!title || !!titleText || !!onCloseClick;
|
|
2846
|
-
const titleRow = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "row justify-between items-start gap-x-8", children: [
|
|
2847
|
-
title ?? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2848
|
-
"h2",
|
|
2849
|
-
{
|
|
2850
|
-
className: (0, import_clsx19.default)("textstyle-title-lg", {
|
|
2851
|
-
"mb-1": description || descriptionText
|
|
2852
|
-
}),
|
|
2853
|
-
children: titleText
|
|
2507
|
+
if (animationState) {
|
|
2508
|
+
animationId.current = requestAnimationFrame(animation);
|
|
2509
|
+
}
|
|
2510
|
+
return () => {
|
|
2511
|
+
if (animationId.current) {
|
|
2512
|
+
cancelAnimationFrame(animationId.current);
|
|
2513
|
+
animationId.current = 0;
|
|
2854
2514
|
}
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
backgroundClassName,
|
|
2869
|
-
headerProps
|
|
2870
|
-
}) => {
|
|
2871
|
-
const ref = (0, import_react11.useRef)(null);
|
|
2515
|
+
};
|
|
2516
|
+
}, [animationState]);
|
|
2517
|
+
const startAutoLoop = () => setCarouselInformation((prevState) => ({
|
|
2518
|
+
...prevState,
|
|
2519
|
+
dragState: prevState.dragState,
|
|
2520
|
+
animationState: prevState.animationState || prevState.dragState ? prevState.animationState : {
|
|
2521
|
+
startPosition: currentPosition,
|
|
2522
|
+
targetPosition: (currentPosition + 1) % length,
|
|
2523
|
+
direction: 1,
|
|
2524
|
+
// always move forward
|
|
2525
|
+
isAutoLooping: true
|
|
2526
|
+
}
|
|
2527
|
+
}));
|
|
2872
2528
|
(0, import_react11.useEffect)(() => {
|
|
2873
|
-
if (!
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2529
|
+
if (!animationId.current && !animationState && !dragState && !timeOut.current) {
|
|
2530
|
+
if (autoLoopingTimeOut > 0) {
|
|
2531
|
+
timeOut.current = setTimeout(() => {
|
|
2532
|
+
startAutoLoop();
|
|
2533
|
+
timeOut.current = void 0;
|
|
2534
|
+
}, autoLoopingTimeOut);
|
|
2535
|
+
} else {
|
|
2536
|
+
startAutoLoop();
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
}, [animationState, dragState, animationId.current, timeOut.current]);
|
|
2540
|
+
const startAnimation = (targetPosition) => {
|
|
2541
|
+
if (targetPosition === void 0) {
|
|
2542
|
+
targetPosition = LoopingArrayCalculator.withoutOffset(currentPosition);
|
|
2543
|
+
}
|
|
2544
|
+
if (targetPosition === currentPosition) {
|
|
2877
2545
|
return;
|
|
2878
2546
|
}
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
)
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
}
|
|
2908
|
-
}
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2547
|
+
const direction = util.getBestDirection(currentPosition, targetPosition);
|
|
2548
|
+
clearTimeout(timeOut.current);
|
|
2549
|
+
timeOut.current = void 0;
|
|
2550
|
+
if (animationId.current) {
|
|
2551
|
+
cancelAnimationFrame(animationId.current);
|
|
2552
|
+
animationId.current = void 0;
|
|
2553
|
+
}
|
|
2554
|
+
setCarouselInformation((prevState) => ({
|
|
2555
|
+
...prevState,
|
|
2556
|
+
dragState: void 0,
|
|
2557
|
+
animationState: {
|
|
2558
|
+
targetPosition,
|
|
2559
|
+
direction,
|
|
2560
|
+
startPosition: currentPosition,
|
|
2561
|
+
isAutoLooping: false
|
|
2562
|
+
},
|
|
2563
|
+
timeOut: void 0
|
|
2564
|
+
}));
|
|
2565
|
+
};
|
|
2566
|
+
const canGoLeft = () => {
|
|
2567
|
+
return isLooping || currentPosition !== 0;
|
|
2568
|
+
};
|
|
2569
|
+
const canGoRight = () => {
|
|
2570
|
+
return isLooping || currentPosition !== length - 1;
|
|
2571
|
+
};
|
|
2572
|
+
const left = () => {
|
|
2573
|
+
if (canGoLeft()) {
|
|
2574
|
+
startAnimation(currentPosition === 0 ? length - 1 : LoopingArrayCalculator.withoutOffset(currentPosition - 1));
|
|
2575
|
+
}
|
|
2576
|
+
};
|
|
2577
|
+
const right = () => {
|
|
2578
|
+
if (canGoRight()) {
|
|
2579
|
+
startAnimation(LoopingArrayCalculator.withoutOffset((currentPosition + 1) % length));
|
|
2580
|
+
}
|
|
2581
|
+
};
|
|
2582
|
+
let items = children.map((item, index) => ({
|
|
2583
|
+
index,
|
|
2584
|
+
item
|
|
2585
|
+
}));
|
|
2586
|
+
if (isLooping) {
|
|
2587
|
+
const before = createLoopingListWithIndex(children, length - 1, paddingItemCount, false).reverse().map(([index, item]) => ({
|
|
2588
|
+
index,
|
|
2589
|
+
item
|
|
2590
|
+
}));
|
|
2591
|
+
const after = createLoopingListWithIndex(children, 0, paddingItemCount).map(([index, item]) => ({
|
|
2592
|
+
index,
|
|
2593
|
+
item
|
|
2594
|
+
}));
|
|
2595
|
+
items = [
|
|
2596
|
+
...before,
|
|
2597
|
+
...items,
|
|
2598
|
+
...after
|
|
2599
|
+
];
|
|
2600
|
+
}
|
|
2601
|
+
const onDragStart = (x) => setCarouselInformation((prevState) => ({
|
|
2602
|
+
...prevState,
|
|
2603
|
+
dragState: {
|
|
2604
|
+
lastX: x,
|
|
2605
|
+
startX: x,
|
|
2606
|
+
startTime: Date.now(),
|
|
2607
|
+
startIndex: currentPosition
|
|
2608
|
+
},
|
|
2609
|
+
animationState: void 0
|
|
2610
|
+
// cancel animation
|
|
2611
|
+
}));
|
|
2612
|
+
const onDrag = (x, width) => {
|
|
2613
|
+
if (!dragState || x === 0) {
|
|
2614
|
+
return;
|
|
2615
|
+
}
|
|
2616
|
+
const offsetUpdate = (dragState.lastX - x) / width;
|
|
2617
|
+
const newPosition = util.getCorrectedPosition(currentPosition + offsetUpdate);
|
|
2618
|
+
setCarouselInformation((prevState) => ({
|
|
2619
|
+
...prevState,
|
|
2620
|
+
currentPosition: newPosition,
|
|
2621
|
+
dragState: {
|
|
2622
|
+
...dragState,
|
|
2623
|
+
lastX: x
|
|
2624
|
+
}
|
|
2625
|
+
}));
|
|
2626
|
+
};
|
|
2627
|
+
const onDragEnd = (x, width) => {
|
|
2628
|
+
if (!dragState) {
|
|
2629
|
+
return;
|
|
2630
|
+
}
|
|
2631
|
+
const distance = dragState.startX - x;
|
|
2632
|
+
const relativeDistance = distance / width;
|
|
2633
|
+
const duration = Date.now() - dragState.startTime;
|
|
2634
|
+
const velocity = distance / (Date.now() - dragState.startTime);
|
|
2635
|
+
const isSlide = Math.abs(velocity) > 2 || duration < 200 && (Math.abs(relativeDistance) > 0.2 || Math.abs(distance) > 50);
|
|
2636
|
+
if (isSlide) {
|
|
2637
|
+
if (distance > 0 && canGoRight()) {
|
|
2638
|
+
right();
|
|
2639
|
+
return;
|
|
2640
|
+
} else if (distance < 0 && canGoLeft()) {
|
|
2641
|
+
left();
|
|
2642
|
+
return;
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2645
|
+
startAnimation();
|
|
2646
|
+
};
|
|
2647
|
+
const dragHandlers = {
|
|
2648
|
+
draggable: true,
|
|
2649
|
+
onDragStart: (event) => {
|
|
2650
|
+
onDragStart(event.clientX);
|
|
2651
|
+
event.dataTransfer.setDragImage(document.createElement("div"), 0, 0);
|
|
2652
|
+
},
|
|
2653
|
+
onDrag: (event) => onDrag(event.clientX, event.target.getBoundingClientRect().width),
|
|
2654
|
+
onDragEnd: (event) => onDragEnd(event.clientX, event.target.getBoundingClientRect().width),
|
|
2655
|
+
onTouchStart: (event) => onDragStart(event.touches[0].clientX),
|
|
2656
|
+
onTouchMove: (event) => onDrag(event.touches[0].clientX, event.target.getBoundingClientRect().width),
|
|
2657
|
+
onTouchEnd: (event) => onDragEnd(event.changedTouches[0].clientX, event.target.getBoundingClientRect().width),
|
|
2658
|
+
onTouchCancel: (event) => onDragEnd(event.changedTouches[0].clientX, event.target.getBoundingClientRect().width)
|
|
2659
|
+
};
|
|
2660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "col items-center w-full gap-y-2", children: [
|
|
2661
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: (0, import_clsx17.default)(`relative w-full overflow-hidden`, heightClassName, className), children: [
|
|
2662
|
+
arrows && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2663
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2664
|
+
"div",
|
|
2665
|
+
{
|
|
2666
|
+
className: (0, import_clsx17.default)("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() }),
|
|
2667
|
+
onClick: () => left(),
|
|
2668
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react4.ChevronLeft, { size: 32 })
|
|
2669
|
+
}
|
|
2670
|
+
),
|
|
2671
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2672
|
+
"div",
|
|
2673
|
+
{
|
|
2674
|
+
className: (0, import_clsx17.default)("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() }),
|
|
2675
|
+
onClick: () => right(),
|
|
2676
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react4.ChevronRight, { size: 32 })
|
|
2677
|
+
}
|
|
2678
|
+
)
|
|
2679
|
+
] }),
|
|
2680
|
+
hintNext ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: (0, import_clsx17.default)(`relative row h-full`, heightClassName), children: [
|
|
2681
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "relative row h-full w-full px-2 overflow-hidden", children: items.map(({
|
|
2682
|
+
item,
|
|
2683
|
+
index
|
|
2684
|
+
}, listIndex) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2685
|
+
"div",
|
|
2686
|
+
{
|
|
2687
|
+
className: (0, import_clsx17.default)(`absolute left-[50%] h-full overflow-hidden`, widthClassName, { "!cursor-grabbing": !!dragState }),
|
|
2688
|
+
style: { translate: getStyleOffset(listIndex - (isLooping ? paddingItemCount : 0)) },
|
|
2689
|
+
...dragHandlers,
|
|
2690
|
+
onClick: () => startAnimation(index),
|
|
2691
|
+
children: item
|
|
2692
|
+
},
|
|
2693
|
+
listIndex
|
|
2694
|
+
)) }),
|
|
2695
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2696
|
+
"div",
|
|
2697
|
+
{
|
|
2698
|
+
className: (0, import_clsx17.default)(`hidden pointer-events-none desktop:block absolute left-0 h-full w-[20%] bg-gradient-to-r to-transparent`, blurColor)
|
|
2699
|
+
}
|
|
2700
|
+
),
|
|
2701
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2702
|
+
"div",
|
|
2703
|
+
{
|
|
2704
|
+
className: (0, import_clsx17.default)(`hidden pointer-events-none desktop:block absolute right-0 h-full w-[20%] bg-gradient-to-l to-transparent`, blurColor)
|
|
2705
|
+
}
|
|
2706
|
+
)
|
|
2707
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: (0, import_clsx17.default)("px-16 h-full", { "!cursor-grabbing": !!dragState }), ...dragHandlers, children: children[currentIndex] })
|
|
2708
|
+
] }),
|
|
2709
|
+
dots && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2710
|
+
"div",
|
|
2711
|
+
{
|
|
2712
|
+
className: "row items-center justify-center w-full my-2",
|
|
2713
|
+
children: range(0, length - 1).map((index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2714
|
+
"button",
|
|
2715
|
+
{
|
|
2716
|
+
className: (0, import_clsx17.default)("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", {
|
|
2717
|
+
"bg-gray-200": currentIndex !== index,
|
|
2718
|
+
"bg-primary": currentIndex === index
|
|
2719
|
+
}),
|
|
2720
|
+
onClick: () => startAnimation(index)
|
|
2721
|
+
},
|
|
2722
|
+
index
|
|
2723
|
+
))
|
|
2724
|
+
}
|
|
2725
|
+
)
|
|
2726
|
+
] });
|
|
2727
|
+
};
|
|
2728
|
+
|
|
2729
|
+
// src/components/layout-and-navigation/Chip.tsx
|
|
2730
|
+
var import_clsx18 = __toESM(require("clsx"), 1);
|
|
2731
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2732
|
+
var Chip = ({
|
|
2733
|
+
children,
|
|
2734
|
+
trailingIcon,
|
|
2735
|
+
color = "default",
|
|
2736
|
+
variant = "normal",
|
|
2737
|
+
className = "",
|
|
2738
|
+
...restProps
|
|
2739
|
+
}) => {
|
|
2740
|
+
const colorMapping = {
|
|
2741
|
+
default: "text-tag-default-text bg-tag-default-background",
|
|
2742
|
+
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
2743
|
+
red: "text-tag-red-text bg-tag-red-background",
|
|
2744
|
+
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
2745
|
+
green: "text-tag-green-text bg-tag-green-background",
|
|
2746
|
+
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
2747
|
+
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
2748
|
+
}[color];
|
|
2749
|
+
const colorMappingIcon = {
|
|
2750
|
+
default: "text-tag-default-icon",
|
|
2751
|
+
dark: "text-tag-dark-icon",
|
|
2752
|
+
red: "text-tag-red-icon",
|
|
2753
|
+
yellow: "text-tag-yellow-icon",
|
|
2754
|
+
green: "text-tag-green-icon",
|
|
2755
|
+
blue: "text-tag-blue-icon",
|
|
2756
|
+
pink: "text-tag-pink-icon"
|
|
2757
|
+
}[color];
|
|
2758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2759
|
+
"div",
|
|
2760
|
+
{
|
|
2761
|
+
...restProps,
|
|
2762
|
+
className: (0, import_clsx18.default)(
|
|
2763
|
+
`row w-fit px-2 py-1`,
|
|
2764
|
+
colorMapping,
|
|
2765
|
+
{
|
|
2766
|
+
"rounded-md": variant === "normal",
|
|
2767
|
+
"rounded-full": variant === "fullyRounded"
|
|
2768
|
+
},
|
|
2769
|
+
className
|
|
2770
|
+
),
|
|
2771
|
+
children: [
|
|
2772
|
+
children,
|
|
2773
|
+
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
|
|
2774
|
+
]
|
|
2775
|
+
}
|
|
2776
|
+
);
|
|
2777
|
+
};
|
|
2778
|
+
var ChipList = ({
|
|
2779
|
+
list,
|
|
2780
|
+
className = ""
|
|
2781
|
+
}) => {
|
|
2782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: (0, import_clsx18.default)("flex flex-wrap gap-x-4 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2783
|
+
Chip,
|
|
2784
|
+
{
|
|
2785
|
+
...value,
|
|
2786
|
+
color: value.color ?? "dark",
|
|
2787
|
+
variant: value.variant ?? "normal",
|
|
2788
|
+
children: value.children
|
|
2789
|
+
},
|
|
2790
|
+
index
|
|
2791
|
+
)) });
|
|
2792
|
+
};
|
|
2793
|
+
|
|
2794
|
+
// src/components/layout-and-navigation/DividerInserter.tsx
|
|
2795
|
+
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
2796
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2797
|
+
var DividerInserter = ({
|
|
2798
|
+
children,
|
|
2799
|
+
divider,
|
|
2800
|
+
className,
|
|
2801
|
+
...restProps
|
|
2802
|
+
}) => {
|
|
2803
|
+
const nodes = [];
|
|
2804
|
+
for (let index = 0; index < children.length; index++) {
|
|
2805
|
+
const element = children[index];
|
|
2806
|
+
if (element !== void 0) {
|
|
2807
|
+
nodes.push(element);
|
|
2808
|
+
if (index < children.length - 1) {
|
|
2809
|
+
nodes.push(divider(index));
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: (0, import_clsx19.default)(className), ...restProps, children: nodes });
|
|
2814
|
+
};
|
|
2815
|
+
|
|
2816
|
+
// src/components/layout-and-navigation/FAQSection.tsx
|
|
2817
|
+
var import_clsx20 = __toESM(require("clsx"), 1);
|
|
2818
|
+
var import_lucide_react5 = require("lucide-react");
|
|
2819
|
+
|
|
2820
|
+
// src/components/layout-and-navigation/MarkdownInterpreter.tsx
|
|
2821
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2822
|
+
var astNodeInserterType = ["helpwave", "newline"];
|
|
2823
|
+
var ASTNodeInterpreter = ({
|
|
2824
|
+
node,
|
|
2825
|
+
isRoot = false,
|
|
2826
|
+
className = ""
|
|
2827
|
+
}) => {
|
|
2828
|
+
switch (node.type) {
|
|
2829
|
+
case "newline":
|
|
2830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("br", {});
|
|
2831
|
+
case "text":
|
|
2832
|
+
return isRoot ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className, children: node.text }) : node.text;
|
|
2833
|
+
case "helpwave":
|
|
2834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "font-bold font-space no-underline", children: "helpwave" });
|
|
2835
|
+
case "none":
|
|
2836
|
+
return isRoot ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className, children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2837
|
+
ASTNodeInterpreter,
|
|
2838
|
+
{
|
|
2839
|
+
node: value
|
|
2840
|
+
},
|
|
2841
|
+
index
|
|
2842
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ASTNodeInterpreter, { node: value }, index)) });
|
|
2843
|
+
case "bold":
|
|
2844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("b", { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ASTNodeInterpreter, { node: value }, index)) });
|
|
2845
|
+
case "italic":
|
|
2846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("i", { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ASTNodeInterpreter, { node: value }, index)) });
|
|
2847
|
+
case "underline":
|
|
2848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("u", { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ASTNodeInterpreter, { node: value }, index)) });
|
|
2849
|
+
case "font-space":
|
|
2850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "font-space", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2851
|
+
ASTNodeInterpreter,
|
|
2852
|
+
{
|
|
2853
|
+
node: value
|
|
2854
|
+
},
|
|
2855
|
+
index
|
|
2856
|
+
)) });
|
|
2857
|
+
case "primary":
|
|
2858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-primary", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2859
|
+
ASTNodeInterpreter,
|
|
2860
|
+
{
|
|
2861
|
+
node: value
|
|
2862
|
+
},
|
|
2863
|
+
index
|
|
2864
|
+
)) });
|
|
2865
|
+
case "secondary":
|
|
2866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-secondary", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2867
|
+
ASTNodeInterpreter,
|
|
2868
|
+
{
|
|
2869
|
+
node: value
|
|
2870
|
+
},
|
|
2871
|
+
index
|
|
2872
|
+
)) });
|
|
2873
|
+
case "warn":
|
|
2874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-warning", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2875
|
+
ASTNodeInterpreter,
|
|
2876
|
+
{
|
|
2877
|
+
node: value
|
|
2878
|
+
},
|
|
2879
|
+
index
|
|
2880
|
+
)) });
|
|
2881
|
+
case "positive":
|
|
2882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-positive", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2883
|
+
ASTNodeInterpreter,
|
|
2884
|
+
{
|
|
2885
|
+
node: value
|
|
2886
|
+
},
|
|
2887
|
+
index
|
|
2888
|
+
)) });
|
|
2889
|
+
case "negative":
|
|
2890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-negative", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2891
|
+
ASTNodeInterpreter,
|
|
2892
|
+
{
|
|
2893
|
+
node: value
|
|
2894
|
+
},
|
|
2895
|
+
index
|
|
2896
|
+
)) });
|
|
2897
|
+
default:
|
|
2898
|
+
return null;
|
|
2899
|
+
}
|
|
2900
|
+
};
|
|
2901
|
+
var modifierIdentifierMapping = [
|
|
2902
|
+
{ id: "i", name: "italic" },
|
|
2903
|
+
{ id: "b", name: "bold" },
|
|
2904
|
+
{ id: "u", name: "underline" },
|
|
2905
|
+
{ id: "space", name: "font-space" },
|
|
2906
|
+
{ id: "primary", name: "primary" },
|
|
2907
|
+
{ id: "secondary", name: "secondary" },
|
|
2908
|
+
{ id: "warn", name: "warn" },
|
|
2909
|
+
{ id: "positive", name: "positive" },
|
|
2910
|
+
{ id: "negative", name: "negative" }
|
|
2911
|
+
];
|
|
2912
|
+
var inserterIdentifierMapping = [
|
|
2913
|
+
{ id: "helpwave", name: "helpwave" },
|
|
2914
|
+
{ id: "newline", name: "newline" }
|
|
2915
|
+
];
|
|
2916
|
+
var parseMarkdown = (text, commandStart = "\\", open = "{", close = "}") => {
|
|
2917
|
+
let start = text.indexOf(commandStart);
|
|
2918
|
+
const children = [];
|
|
2919
|
+
while (text !== "") {
|
|
2920
|
+
if (start === -1) {
|
|
2921
|
+
children.push({
|
|
2922
|
+
type: "text",
|
|
2923
|
+
text
|
|
2924
|
+
});
|
|
2925
|
+
break;
|
|
2926
|
+
}
|
|
2927
|
+
children.push(parseMarkdown(text.substring(0, start)));
|
|
2928
|
+
text = text.substring(start);
|
|
2929
|
+
if (text.length <= 1) {
|
|
2930
|
+
children.push({
|
|
2931
|
+
type: "text",
|
|
2932
|
+
text
|
|
2933
|
+
});
|
|
2934
|
+
text = "";
|
|
2935
|
+
continue;
|
|
2936
|
+
}
|
|
2937
|
+
const simpleReplace = [commandStart, open, close];
|
|
2938
|
+
if (simpleReplace.some((value) => text[1] === value)) {
|
|
2939
|
+
children.push({
|
|
2940
|
+
type: "text",
|
|
2941
|
+
text: simpleReplace.find((value) => text[1] === value)
|
|
2942
|
+
});
|
|
2943
|
+
text = text.substring(2);
|
|
2944
|
+
start = text.indexOf(commandStart);
|
|
2945
|
+
continue;
|
|
2946
|
+
}
|
|
2947
|
+
const inserter = inserterIdentifierMapping.find((value) => text.substring(1).startsWith(value.id));
|
|
2948
|
+
if (inserter) {
|
|
2949
|
+
children.push({
|
|
2950
|
+
type: inserter.name
|
|
2951
|
+
});
|
|
2952
|
+
text = text.substring(inserter.id.length + 1);
|
|
2953
|
+
start = text.indexOf(commandStart);
|
|
2954
|
+
continue;
|
|
2955
|
+
}
|
|
2956
|
+
const modifier = modifierIdentifierMapping.find((value) => text.substring(1).startsWith(value.id));
|
|
2957
|
+
if (modifier) {
|
|
2958
|
+
if (text[modifier.id.length + 1] !== open) {
|
|
2959
|
+
children.push({
|
|
2960
|
+
type: "text",
|
|
2961
|
+
text: text.substring(0, modifier.id.length + 1)
|
|
2962
|
+
});
|
|
2963
|
+
text = text.substring(modifier.id.length + 2);
|
|
2964
|
+
start = text.indexOf(commandStart);
|
|
2965
|
+
continue;
|
|
2966
|
+
}
|
|
2967
|
+
let closing = -1;
|
|
2968
|
+
let index = modifier.id.length + 2;
|
|
2969
|
+
let counter = 1;
|
|
2970
|
+
let escaping = false;
|
|
2971
|
+
while (index < text.length) {
|
|
2972
|
+
if (text[index] === open && !escaping) {
|
|
2973
|
+
counter++;
|
|
2974
|
+
}
|
|
2975
|
+
if (text[index] === close && !escaping) {
|
|
2976
|
+
counter--;
|
|
2977
|
+
if (counter === 0) {
|
|
2978
|
+
closing = index;
|
|
2979
|
+
break;
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
escaping = text[index] === commandStart;
|
|
2983
|
+
index++;
|
|
2984
|
+
}
|
|
2985
|
+
if (closing !== -1) {
|
|
2986
|
+
children.push({
|
|
2987
|
+
type: modifier.name,
|
|
2988
|
+
children: [parseMarkdown(text.substring(modifier.id.length + 2, closing))]
|
|
2989
|
+
});
|
|
2990
|
+
text = text.substring(closing + 1);
|
|
2991
|
+
start = text.indexOf(commandStart);
|
|
2992
|
+
continue;
|
|
2993
|
+
}
|
|
2994
|
+
}
|
|
2995
|
+
children.push({
|
|
2996
|
+
type: "text",
|
|
2997
|
+
text: text[0]
|
|
2998
|
+
});
|
|
2999
|
+
text = text.substring(1);
|
|
3000
|
+
start = text.indexOf(commandStart);
|
|
3001
|
+
}
|
|
3002
|
+
return {
|
|
3003
|
+
type: "none",
|
|
3004
|
+
children
|
|
3005
|
+
};
|
|
3006
|
+
};
|
|
3007
|
+
var optimizeTree = (node) => {
|
|
3008
|
+
if (node.type === "text") {
|
|
3009
|
+
return !node.text ? void 0 : node;
|
|
3010
|
+
}
|
|
3011
|
+
if (astNodeInserterType.some((value) => value === node.type)) {
|
|
3012
|
+
return node;
|
|
3013
|
+
}
|
|
3014
|
+
const currentNode = node;
|
|
3015
|
+
if (currentNode.children.length === 0) {
|
|
3016
|
+
return void 0;
|
|
3017
|
+
}
|
|
3018
|
+
let children = [];
|
|
3019
|
+
for (let i = 0; i < currentNode.children.length; i++) {
|
|
3020
|
+
const child = optimizeTree(currentNode.children[i]);
|
|
3021
|
+
if (!child) {
|
|
3022
|
+
continue;
|
|
2932
3023
|
}
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
isOpen,
|
|
2938
|
-
className,
|
|
2939
|
-
backgroundClassName,
|
|
2940
|
-
title,
|
|
2941
|
-
titleText
|
|
2942
|
-
}) => {
|
|
2943
|
-
const ref = (0, import_react11.useRef)(null);
|
|
2944
|
-
(0, import_react11.useEffect)(() => {
|
|
2945
|
-
if (!isOpen) return;
|
|
2946
|
-
const dialog = ref.current;
|
|
2947
|
-
if (!dialog) {
|
|
2948
|
-
console.error("dialog open, but no ref found");
|
|
2949
|
-
return;
|
|
3024
|
+
if (child.type === "none") {
|
|
3025
|
+
children.push(...child.children);
|
|
3026
|
+
} else {
|
|
3027
|
+
children.push(child);
|
|
2950
3028
|
}
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
const
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
e.stopPropagation();
|
|
2962
|
-
} else if (e.key === "Tab") {
|
|
2963
|
-
if (focusable.length === 0) return;
|
|
2964
|
-
if (e.shiftKey && document.activeElement === first) {
|
|
2965
|
-
e.preventDefault();
|
|
2966
|
-
last.focus();
|
|
2967
|
-
} else if (!e.shiftKey && document.activeElement === last) {
|
|
2968
|
-
e.preventDefault();
|
|
2969
|
-
first.focus();
|
|
2970
|
-
}
|
|
3029
|
+
}
|
|
3030
|
+
currentNode.children = children;
|
|
3031
|
+
children = [];
|
|
3032
|
+
for (let i = 0; i < currentNode.children.length; i++) {
|
|
3033
|
+
const child = currentNode.children[i];
|
|
3034
|
+
if (child) {
|
|
3035
|
+
if (child.type === "text" && children[children.length - 1]?.type === "text") {
|
|
3036
|
+
children[children.length - 1].text += child.text;
|
|
3037
|
+
} else {
|
|
3038
|
+
children.push(child);
|
|
2971
3039
|
}
|
|
2972
|
-
};
|
|
2973
|
-
dialog.focus();
|
|
2974
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
2975
|
-
return () => {
|
|
2976
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
2977
|
-
overlayStack = overlayStack.filter((m) => m !== dialog);
|
|
2978
|
-
};
|
|
2979
|
-
}, [isOpen]);
|
|
2980
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2981
|
-
Overlay,
|
|
2982
|
-
{
|
|
2983
|
-
isOpen,
|
|
2984
|
-
backgroundClassName,
|
|
2985
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2986
|
-
"div",
|
|
2987
|
-
{
|
|
2988
|
-
ref,
|
|
2989
|
-
tabIndex: -1,
|
|
2990
|
-
className: (0, import_clsx19.default)(
|
|
2991
|
-
"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",
|
|
2992
|
-
className
|
|
2993
|
-
),
|
|
2994
|
-
role: "dialog",
|
|
2995
|
-
"aria-modal": true,
|
|
2996
|
-
children: [
|
|
2997
|
-
title ?? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2998
|
-
"h2",
|
|
2999
|
-
{
|
|
3000
|
-
className: (0, import_clsx19.default)("textstyle-title-lg"),
|
|
3001
|
-
children: titleText
|
|
3002
|
-
}
|
|
3003
|
-
),
|
|
3004
|
-
children
|
|
3005
|
-
]
|
|
3006
|
-
}
|
|
3007
|
-
)
|
|
3008
3040
|
}
|
|
3009
|
-
|
|
3041
|
+
}
|
|
3042
|
+
currentNode.children = children;
|
|
3043
|
+
return currentNode;
|
|
3044
|
+
};
|
|
3045
|
+
var MarkdownInterpreter = ({ text, className }) => {
|
|
3046
|
+
const tree = parseMarkdown(text);
|
|
3047
|
+
const optimizedTree = optimizeTree(tree);
|
|
3048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ASTNodeInterpreter, { node: optimizedTree, isRoot: true, className });
|
|
3049
|
+
};
|
|
3050
|
+
|
|
3051
|
+
// src/components/layout-and-navigation/FAQSection.tsx
|
|
3052
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3053
|
+
var FAQSection = ({
|
|
3054
|
+
entries,
|
|
3055
|
+
expandableClassName
|
|
3056
|
+
}) => {
|
|
3057
|
+
const chevronSize = 28;
|
|
3058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "col gap-y-4", children: entries.map(({ id, title, content, ...restProps }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3059
|
+
Expandable,
|
|
3060
|
+
{
|
|
3061
|
+
...restProps,
|
|
3062
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h3", { id, className: "textstyle-title-md", children: title }),
|
|
3063
|
+
clickOnlyOnHeader: false,
|
|
3064
|
+
icon: (expanded) => expanded ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react5.ChevronUp, { size: chevronSize, className: "text-primary", style: { minWidth: `${chevronSize}px` } }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react5.ChevronDown, { size: chevronSize, className: "text-primary" }),
|
|
3065
|
+
className: (0, import_clsx20.default)("rounded-xl", expandableClassName),
|
|
3066
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mt-2", children: content.type === "markdown" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(MarkdownInterpreter, { text: content.value }) : content.value })
|
|
3067
|
+
},
|
|
3068
|
+
id
|
|
3069
|
+
)) });
|
|
3010
3070
|
};
|
|
3011
3071
|
|
|
3012
3072
|
// src/components/layout-and-navigation/Pagination.tsx
|
|
3013
3073
|
var import_lucide_react6 = require("lucide-react");
|
|
3014
|
-
var
|
|
3015
|
-
var
|
|
3074
|
+
var import_clsx21 = __toESM(require("clsx"), 1);
|
|
3075
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3016
3076
|
var defaultPaginationTranslations = {
|
|
3017
3077
|
en: {
|
|
3018
3078
|
of: "of"
|
|
@@ -3034,23 +3094,23 @@ var Pagination = ({
|
|
|
3034
3094
|
const noPages = numberOfPages === 0;
|
|
3035
3095
|
const onFirstPage = page === 0 && !noPages;
|
|
3036
3096
|
const onLastPage = page === numberOfPages - 1;
|
|
3037
|
-
return /* @__PURE__ */ (0,
|
|
3038
|
-
/* @__PURE__ */ (0,
|
|
3039
|
-
/* @__PURE__ */ (0,
|
|
3040
|
-
/* @__PURE__ */ (0,
|
|
3041
|
-
/* @__PURE__ */ (0,
|
|
3042
|
-
/* @__PURE__ */ (0,
|
|
3043
|
-
/* @__PURE__ */ (0,
|
|
3097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: (0, import_clsx21.default)("row", { "opacity-30": noPages }), children: [
|
|
3098
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { onClick: () => changePage(0), disabled: onFirstPage, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react6.ChevronFirst, { className: (0, import_clsx21.default)({ "opacity-30": onFirstPage }) }) }),
|
|
3099
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { onClick: () => changePage(page - 1), disabled: onFirstPage, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react6.ChevronLeft, { className: (0, import_clsx21.default)({ "opacity-30": onFirstPage }) }) }),
|
|
3100
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "min-w-[80px] justify-center mx-2", children: [
|
|
3101
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "select-none text-right flex-1", children: noPages ? 0 : page + 1 }),
|
|
3102
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "select-none mx-2", children: translation.of }),
|
|
3103
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "select-none text-left flex-1", children: numberOfPages })
|
|
3044
3104
|
] }),
|
|
3045
|
-
/* @__PURE__ */ (0,
|
|
3046
|
-
/* @__PURE__ */ (0,
|
|
3105
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { onClick: () => changePage(page + 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react6.ChevronRight, { className: (0, import_clsx21.default)({ "opacity-30": onLastPage }) }) }),
|
|
3106
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { onClick: () => changePage(numberOfPages - 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react6.ChevronLast, { className: (0, import_clsx21.default)({ "opacity-30": onLastPage }) }) })
|
|
3047
3107
|
] });
|
|
3048
3108
|
};
|
|
3049
3109
|
|
|
3050
3110
|
// src/components/layout-and-navigation/SearchableList.tsx
|
|
3051
3111
|
var import_react14 = require("react");
|
|
3052
3112
|
var import_lucide_react7 = require("lucide-react");
|
|
3053
|
-
var
|
|
3113
|
+
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
3054
3114
|
|
|
3055
3115
|
// src/util/simpleSearch.ts
|
|
3056
3116
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -3074,7 +3134,7 @@ var SimpleSearch = (search, objects) => {
|
|
|
3074
3134
|
|
|
3075
3135
|
// src/components/user-action/Input.tsx
|
|
3076
3136
|
var import_react13 = require("react");
|
|
3077
|
-
var
|
|
3137
|
+
var import_clsx23 = __toESM(require("clsx"), 1);
|
|
3078
3138
|
|
|
3079
3139
|
// src/hooks/useSaveDelay.ts
|
|
3080
3140
|
var import_react12 = require("react");
|
|
@@ -3117,8 +3177,8 @@ function useSaveDelay(setNotificationStatus, delay) {
|
|
|
3117
3177
|
}
|
|
3118
3178
|
|
|
3119
3179
|
// src/components/user-action/Label.tsx
|
|
3120
|
-
var
|
|
3121
|
-
var
|
|
3180
|
+
var import_clsx22 = __toESM(require("clsx"), 1);
|
|
3181
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3122
3182
|
var styleMapping = {
|
|
3123
3183
|
labelSmall: "textstyle-label-sm",
|
|
3124
3184
|
labelMedium: "textstyle-label-md",
|
|
@@ -3131,11 +3191,11 @@ var Label = ({
|
|
|
3131
3191
|
className,
|
|
3132
3192
|
...props
|
|
3133
3193
|
}) => {
|
|
3134
|
-
return /* @__PURE__ */ (0,
|
|
3194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { ...props, className: (0, import_clsx22.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
3135
3195
|
};
|
|
3136
3196
|
|
|
3137
3197
|
// src/components/user-action/Input.tsx
|
|
3138
|
-
var
|
|
3198
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3139
3199
|
var Input = ({
|
|
3140
3200
|
id,
|
|
3141
3201
|
type = "text",
|
|
@@ -3161,9 +3221,9 @@ var Input = ({
|
|
|
3161
3221
|
ref.current?.focus();
|
|
3162
3222
|
}
|
|
3163
3223
|
}, [autoFocus]);
|
|
3164
|
-
return /* @__PURE__ */ (0,
|
|
3165
|
-
label && /* @__PURE__ */ (0,
|
|
3166
|
-
/* @__PURE__ */ (0,
|
|
3224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: (0, import_clsx23.default)({ "w-full": expanded }, containerClassName), children: [
|
|
3225
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx23.default)("mb-1", label.className) }),
|
|
3226
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3167
3227
|
"input",
|
|
3168
3228
|
{
|
|
3169
3229
|
ref,
|
|
@@ -3202,7 +3262,7 @@ var InputUncontrolled = ({
|
|
|
3202
3262
|
...props
|
|
3203
3263
|
}) => {
|
|
3204
3264
|
const [value, setValue] = (0, import_react13.useState)(defaultValue);
|
|
3205
|
-
return /* @__PURE__ */ (0,
|
|
3265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3206
3266
|
Input,
|
|
3207
3267
|
{
|
|
3208
3268
|
...props,
|
|
@@ -3225,13 +3285,13 @@ var FormInput = (0, import_react13.forwardRef)(function FormInput2({
|
|
|
3225
3285
|
required,
|
|
3226
3286
|
...restProps
|
|
3227
3287
|
}, ref) {
|
|
3228
|
-
const input = /* @__PURE__ */ (0,
|
|
3288
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3229
3289
|
"input",
|
|
3230
3290
|
{
|
|
3231
3291
|
ref,
|
|
3232
3292
|
id,
|
|
3233
3293
|
...restProps,
|
|
3234
|
-
className: (0,
|
|
3294
|
+
className: (0, import_clsx23.default)(
|
|
3235
3295
|
{
|
|
3236
3296
|
"focus:border-primary focus:ring-primary": !errorText,
|
|
3237
3297
|
"focus:border-negative focus:ring-negative text-negative": !!errorText
|
|
@@ -3240,18 +3300,18 @@ var FormInput = (0, import_react13.forwardRef)(function FormInput2({
|
|
|
3240
3300
|
)
|
|
3241
3301
|
}
|
|
3242
3302
|
);
|
|
3243
|
-
return /* @__PURE__ */ (0,
|
|
3244
|
-
labelText && /* @__PURE__ */ (0,
|
|
3303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: (0, import_clsx23.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
3304
|
+
labelText && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { htmlFor: id, className: (0, import_clsx23.default)("textstyle-label-md", labelClassName), children: [
|
|
3245
3305
|
labelText,
|
|
3246
|
-
required && /* @__PURE__ */ (0,
|
|
3306
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
3247
3307
|
] }),
|
|
3248
3308
|
input,
|
|
3249
|
-
errorText && /* @__PURE__ */ (0,
|
|
3309
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("label", { htmlFor: id, className: (0, import_clsx23.default)("text-negative", errorClassName), children: errorText })
|
|
3250
3310
|
] });
|
|
3251
3311
|
});
|
|
3252
3312
|
|
|
3253
3313
|
// src/components/layout-and-navigation/SearchableList.tsx
|
|
3254
|
-
var
|
|
3314
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3255
3315
|
var defaultSearchableListTranslation = {
|
|
3256
3316
|
en: {
|
|
3257
3317
|
search: "Search",
|
|
@@ -3274,20 +3334,20 @@ var SearchableList = ({
|
|
|
3274
3334
|
const [search, setSearch] = (0, import_react14.useState)(initialSearch);
|
|
3275
3335
|
(0, import_react14.useEffect)(() => setSearch(initialSearch), [initialSearch]);
|
|
3276
3336
|
const filteredEntries = (0, import_react14.useMemo)(() => MultiSearchWithMapping(search, list, searchMapping), [search, list, searchMapping]);
|
|
3277
|
-
return /* @__PURE__ */ (0,
|
|
3278
|
-
/* @__PURE__ */ (0,
|
|
3279
|
-
/* @__PURE__ */ (0,
|
|
3280
|
-
/* @__PURE__ */ (0,
|
|
3337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: (0, import_clsx24.default)("col gap-y-2", className), children: [
|
|
3338
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "row justify-between gap-x-2 items-center", children: [
|
|
3339
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Input, { value: search, onChangeText: setSearch, placeholder: translation.search }) }),
|
|
3340
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react7.Search, { size: 20 })
|
|
3281
3341
|
] }),
|
|
3282
|
-
filteredEntries.length > 0 && /* @__PURE__ */ (0,
|
|
3283
|
-
!filteredEntries.length && /* @__PURE__ */ (0,
|
|
3342
|
+
filteredEntries.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "col gap-y-1", children: filteredEntries.map(itemMapper) }),
|
|
3343
|
+
!filteredEntries.length && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "row justify-center", children: translation.nothingFound })
|
|
3284
3344
|
] });
|
|
3285
3345
|
};
|
|
3286
3346
|
|
|
3287
3347
|
// src/components/layout-and-navigation/StepperBar.tsx
|
|
3288
3348
|
var import_lucide_react8 = require("lucide-react");
|
|
3289
|
-
var
|
|
3290
|
-
var
|
|
3349
|
+
var import_clsx25 = __toESM(require("clsx"), 1);
|
|
3350
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3291
3351
|
var defaultStepperBarTranslation = {
|
|
3292
3352
|
en: {
|
|
3293
3353
|
back: "Back",
|
|
@@ -3315,12 +3375,12 @@ var StepperBar = ({
|
|
|
3315
3375
|
seenSteps.add(newStep);
|
|
3316
3376
|
onChange({ step: newStep, seenSteps, lastStep });
|
|
3317
3377
|
};
|
|
3318
|
-
return /* @__PURE__ */ (0,
|
|
3378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3319
3379
|
"div",
|
|
3320
3380
|
{
|
|
3321
|
-
className: (0,
|
|
3381
|
+
className: (0, import_clsx25.default)("sticky row p-2 border-2 justify-between rounded-lg shadow-lg", className),
|
|
3322
3382
|
children: [
|
|
3323
|
-
/* @__PURE__ */ (0,
|
|
3383
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex-[2] justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3324
3384
|
SolidButton,
|
|
3325
3385
|
{
|
|
3326
3386
|
disabled: step === 0,
|
|
@@ -3329,18 +3389,18 @@ var StepperBar = ({
|
|
|
3329
3389
|
},
|
|
3330
3390
|
className: "row gap-x-1 items-center justify-center",
|
|
3331
3391
|
children: [
|
|
3332
|
-
/* @__PURE__ */ (0,
|
|
3392
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react8.ChevronLeft, { size: 14 }),
|
|
3333
3393
|
translation.back
|
|
3334
3394
|
]
|
|
3335
3395
|
}
|
|
3336
3396
|
) }),
|
|
3337
|
-
/* @__PURE__ */ (0,
|
|
3397
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "row flex-[5] gap-x-2 justify-center items-center", children: showDots && dots.map((value, index) => {
|
|
3338
3398
|
const seen = seenSteps.has(index);
|
|
3339
|
-
return /* @__PURE__ */ (0,
|
|
3399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3340
3400
|
"div",
|
|
3341
3401
|
{
|
|
3342
3402
|
onClick: () => seen && update(index),
|
|
3343
|
-
className: (0,
|
|
3403
|
+
className: (0, import_clsx25.default)(
|
|
3344
3404
|
"rounded-full w-4 h-4",
|
|
3345
3405
|
{
|
|
3346
3406
|
"bg-primary hover:brightness-75": index === step && seen,
|
|
@@ -3356,25 +3416,25 @@ var StepperBar = ({
|
|
|
3356
3416
|
index
|
|
3357
3417
|
);
|
|
3358
3418
|
}) }),
|
|
3359
|
-
step !== lastStep && /* @__PURE__ */ (0,
|
|
3419
|
+
step !== lastStep && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3360
3420
|
SolidButton,
|
|
3361
3421
|
{
|
|
3362
3422
|
onClick: () => update(step + 1),
|
|
3363
3423
|
className: "row gap-x-1 items-center justify-center",
|
|
3364
3424
|
children: [
|
|
3365
3425
|
translation.next,
|
|
3366
|
-
/* @__PURE__ */ (0,
|
|
3426
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react8.ChevronRight, { size: 14 })
|
|
3367
3427
|
]
|
|
3368
3428
|
}
|
|
3369
3429
|
) }),
|
|
3370
|
-
step === lastStep && /* @__PURE__ */ (0,
|
|
3430
|
+
step === lastStep && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3371
3431
|
SolidButton,
|
|
3372
3432
|
{
|
|
3373
3433
|
disabled: false,
|
|
3374
3434
|
onClick: onFinish,
|
|
3375
3435
|
className: "row gap-x-1 items-center justify-center",
|
|
3376
3436
|
children: [
|
|
3377
|
-
/* @__PURE__ */ (0,
|
|
3437
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react8.Check, { size: 14 }),
|
|
3378
3438
|
translation.confirm
|
|
3379
3439
|
]
|
|
3380
3440
|
}
|
|
@@ -3392,8 +3452,8 @@ var import_react_custom_scrollbars_23 = require("react-custom-scrollbars-2");
|
|
|
3392
3452
|
var import_react15 = require("react");
|
|
3393
3453
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"), 1);
|
|
3394
3454
|
var import_lucide_react9 = require("lucide-react");
|
|
3395
|
-
var
|
|
3396
|
-
var
|
|
3455
|
+
var import_clsx26 = __toESM(require("clsx"), 1);
|
|
3456
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3397
3457
|
var checkboxSizeMapping = {
|
|
3398
3458
|
small: "size-4",
|
|
3399
3459
|
medium: "size-6",
|
|
@@ -3429,31 +3489,31 @@ var Checkbox = ({
|
|
|
3429
3489
|
const newValue = checked === "indeterminate" ? false : !checked;
|
|
3430
3490
|
propagateChange(newValue);
|
|
3431
3491
|
};
|
|
3432
|
-
return /* @__PURE__ */ (0,
|
|
3433
|
-
/* @__PURE__ */ (0,
|
|
3492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: (0, import_clsx26.default)("row justify-center items-center", containerClassName), children: [
|
|
3493
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3434
3494
|
CheckboxPrimitive.Root,
|
|
3435
3495
|
{
|
|
3436
3496
|
onCheckedChange: propagateChange,
|
|
3437
3497
|
checked,
|
|
3438
3498
|
disabled,
|
|
3439
3499
|
id,
|
|
3440
|
-
className: (0,
|
|
3500
|
+
className: (0, import_clsx26.default)(usedSizeClass, `items-center border-2 rounded outline-none focus:border-primary`, {
|
|
3441
3501
|
"text-disabled-text border-disabled-text": disabled,
|
|
3442
3502
|
"border-on-background": !disabled,
|
|
3443
3503
|
"bg-primary/30 border-primary text-primary": checked === true || checked === "indeterminate",
|
|
3444
3504
|
"hover:border-gray-400 focus:hover:border-primary": !checked
|
|
3445
3505
|
}, className),
|
|
3446
|
-
children: /* @__PURE__ */ (0,
|
|
3447
|
-
checked === true && /* @__PURE__ */ (0,
|
|
3448
|
-
checked === "indeterminate" && /* @__PURE__ */ (0,
|
|
3506
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(CheckboxPrimitive.Indicator, { children: [
|
|
3507
|
+
checked === true && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react9.Check, { className: innerIconSize }),
|
|
3508
|
+
checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react9.Minus, { className: innerIconSize })
|
|
3449
3509
|
] })
|
|
3450
3510
|
}
|
|
3451
3511
|
),
|
|
3452
|
-
label && /* @__PURE__ */ (0,
|
|
3512
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3453
3513
|
Label,
|
|
3454
3514
|
{
|
|
3455
3515
|
...label,
|
|
3456
|
-
className: (0,
|
|
3516
|
+
className: (0, import_clsx26.default)("cursor-pointer", label.className),
|
|
3457
3517
|
htmlFor: id,
|
|
3458
3518
|
onClick: changeValue
|
|
3459
3519
|
}
|
|
@@ -3476,7 +3536,7 @@ var CheckboxUncontrolled = ({
|
|
|
3476
3536
|
}
|
|
3477
3537
|
setChecked(checked2);
|
|
3478
3538
|
};
|
|
3479
|
-
return /* @__PURE__ */ (0,
|
|
3539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3480
3540
|
Checkbox,
|
|
3481
3541
|
{
|
|
3482
3542
|
...props,
|
|
@@ -3487,9 +3547,9 @@ var CheckboxUncontrolled = ({
|
|
|
3487
3547
|
};
|
|
3488
3548
|
|
|
3489
3549
|
// src/components/layout-and-navigation/Table.tsx
|
|
3490
|
-
var
|
|
3550
|
+
var import_clsx27 = __toESM(require("clsx"), 1);
|
|
3491
3551
|
var import_lucide_react10 = require("lucide-react");
|
|
3492
|
-
var
|
|
3552
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3493
3553
|
var defaultTableStatePagination = {
|
|
3494
3554
|
currentPage: 0,
|
|
3495
3555
|
entriesPerPage: 5
|
|
@@ -3660,20 +3720,20 @@ var Table = ({
|
|
|
3660
3720
|
window.removeEventListener("resize", handleResize);
|
|
3661
3721
|
};
|
|
3662
3722
|
}, [data, currentPage]);
|
|
3663
|
-
return /* @__PURE__ */ (0,
|
|
3664
|
-
/* @__PURE__ */ (0,
|
|
3665
|
-
/* @__PURE__ */ (0,
|
|
3666
|
-
header && tableState.selection && /* @__PURE__ */ (0,
|
|
3723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: (0, import_clsx27.default)("col gap-y-4 overflow-hidden", className), children: [
|
|
3724
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_custom_scrollbars_23.Scrollbars, { autoHeight: true, autoHeightMin: scrollbarsAutoHeightMin, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("table", { ref: tableRef, className: "w-full mb-[12px]", children: [
|
|
3725
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("tr", { className: headerRow, children: [
|
|
3726
|
+
header && tableState.selection && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("th", { className: headerPaddingHead, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3667
3727
|
Checkbox,
|
|
3668
3728
|
{
|
|
3669
3729
|
checked: tableState.selection.hasSelectedSome ? "indeterminate" : tableState.selection.hasSelectedAll,
|
|
3670
3730
|
onChange: () => updateTableState(changeTableSelectionAll(tableState, data, identifierMapping))
|
|
3671
3731
|
}
|
|
3672
3732
|
) }),
|
|
3673
|
-
header && header.map((value, index) => /* @__PURE__ */ (0,
|
|
3733
|
+
header && header.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("th", { className: headerPaddingHead, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "row justify-start px-2", children: value }) }, `tableHeader${index}`))
|
|
3674
3734
|
] }) }),
|
|
3675
|
-
/* @__PURE__ */ (0,
|
|
3676
|
-
tableState.selection && /* @__PURE__ */ (0,
|
|
3735
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("tbody", { children: shownElements.map((value, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("tr", { children: [
|
|
3736
|
+
tableState.selection && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("td", { className: (0, import_clsx27.default)(cellPadding, { [headerPaddingBody]: rowIndex === 0 }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3677
3737
|
Checkbox,
|
|
3678
3738
|
{
|
|
3679
3739
|
checked: isDataObjectSelected(tableState, value, identifierMapping),
|
|
@@ -3682,17 +3742,17 @@ var Table = ({
|
|
|
3682
3742
|
}
|
|
3683
3743
|
}
|
|
3684
3744
|
) }),
|
|
3685
|
-
rowMappingToCells(value).map((value1, index) => /* @__PURE__ */ (0,
|
|
3745
|
+
rowMappingToCells(value).map((value1, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3686
3746
|
"td",
|
|
3687
3747
|
{
|
|
3688
|
-
className: (0,
|
|
3748
|
+
className: (0, import_clsx27.default)(cellPadding, { [headerPaddingBody]: rowIndex === 0 }),
|
|
3689
3749
|
children: value1
|
|
3690
3750
|
},
|
|
3691
3751
|
index
|
|
3692
3752
|
))
|
|
3693
3753
|
] }, identifierMapping(value))) })
|
|
3694
3754
|
] }) }) }),
|
|
3695
|
-
/* @__PURE__ */ (0,
|
|
3755
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "row justify-center", children: tableState.pagination && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Pagination, { page: currentPage, numberOfPages: pageCount, onPageChanged: (page) => updateTableState({
|
|
3696
3756
|
...tableState,
|
|
3697
3757
|
pagination: { entriesPerPage, currentPage: page }
|
|
3698
3758
|
}) }) })
|
|
@@ -3705,23 +3765,23 @@ var SortButton = ({
|
|
|
3705
3765
|
onClick,
|
|
3706
3766
|
...buttonProps
|
|
3707
3767
|
}) => {
|
|
3708
|
-
return /* @__PURE__ */ (0,
|
|
3768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3709
3769
|
TextButton,
|
|
3710
3770
|
{
|
|
3711
3771
|
color,
|
|
3712
3772
|
onClick: () => onClick(ascending === "descending" ? "ascending" : "descending"),
|
|
3713
3773
|
...buttonProps,
|
|
3714
|
-
children: /* @__PURE__ */ (0,
|
|
3774
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "row gap-x-2", children: [
|
|
3715
3775
|
children,
|
|
3716
|
-
ascending === "ascending" ? /* @__PURE__ */ (0,
|
|
3776
|
+
ascending === "ascending" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react10.ChevronUp, {}) : !ascending ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react10.ChevronsUpDown, {}) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react10.ChevronDown, {})
|
|
3717
3777
|
] })
|
|
3718
3778
|
}
|
|
3719
3779
|
);
|
|
3720
3780
|
};
|
|
3721
3781
|
|
|
3722
3782
|
// src/components/layout-and-navigation/TextImage.tsx
|
|
3723
|
-
var
|
|
3724
|
-
var
|
|
3783
|
+
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
3784
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3725
3785
|
var defaultTextImageTranslation = {
|
|
3726
3786
|
de: {
|
|
3727
3787
|
showMore: "Mehr anzeigen"
|
|
@@ -3752,25 +3812,25 @@ var TextImage = ({
|
|
|
3752
3812
|
secondary: "text-text-image-secondary-text bg-linear-to-r from-30% from-text-image-secondary-background to-text-image-secondary-background/55",
|
|
3753
3813
|
dark: "text-text-image-dark-text bg-linear-to-r from-30% from-text-image-dark-background to-text-image-dark-background/55"
|
|
3754
3814
|
};
|
|
3755
|
-
return /* @__PURE__ */ (0,
|
|
3815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3756
3816
|
"div",
|
|
3757
3817
|
{
|
|
3758
|
-
className: (0,
|
|
3818
|
+
className: (0, import_clsx28.default)("rounded-2xl w-full", className),
|
|
3759
3819
|
style: {
|
|
3760
3820
|
backgroundImage: `url(${imageUrl})`,
|
|
3761
3821
|
backgroundSize: "cover"
|
|
3762
3822
|
},
|
|
3763
|
-
children: /* @__PURE__ */ (0,
|
|
3823
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3764
3824
|
"div",
|
|
3765
3825
|
{
|
|
3766
|
-
className: (0,
|
|
3826
|
+
className: (0, import_clsx28.default)(`col px-6 py-12 rounded-2xl h-full`, colorMapping[color], contentClassName),
|
|
3767
3827
|
children: [
|
|
3768
|
-
badge && /* @__PURE__ */ (0,
|
|
3769
|
-
/* @__PURE__ */ (0,
|
|
3770
|
-
/* @__PURE__ */ (0,
|
|
3771
|
-
/* @__PURE__ */ (0,
|
|
3828
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: (0, import_clsx28.default)(`chip-full bg-white mb-2 py-2 px-4 w-fit`, chipColorMapping[color]), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-lg font-bold", children: badge }) }),
|
|
3829
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "col gap-y-1 text-white overflow-hidden", children: [
|
|
3830
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "textstyle-title-xl", children: title }),
|
|
3831
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-ellipsis overflow-hidden", children: description })
|
|
3772
3832
|
] }),
|
|
3773
|
-
onShowMoreClicked && /* @__PURE__ */ (0,
|
|
3833
|
+
onShowMoreClicked && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "row mt-2 text-white underline", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { onClick: onShowMoreClicked, children: translation.showMore }) })
|
|
3774
3834
|
]
|
|
3775
3835
|
}
|
|
3776
3836
|
)
|
|
@@ -3779,7 +3839,7 @@ var TextImage = ({
|
|
|
3779
3839
|
};
|
|
3780
3840
|
|
|
3781
3841
|
// src/components/layout-and-navigation/VerticalDivider.tsx
|
|
3782
|
-
var
|
|
3842
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3783
3843
|
var VerticalDivider = ({
|
|
3784
3844
|
width = 1,
|
|
3785
3845
|
height = 100,
|
|
@@ -3787,7 +3847,7 @@ var VerticalDivider = ({
|
|
|
3787
3847
|
dashGap = 4,
|
|
3788
3848
|
dashLength = 4
|
|
3789
3849
|
}) => {
|
|
3790
|
-
return /* @__PURE__ */ (0,
|
|
3850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { width: width + "px", height: height + "px" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3791
3851
|
"svg",
|
|
3792
3852
|
{
|
|
3793
3853
|
width,
|
|
@@ -3796,7 +3856,7 @@ var VerticalDivider = ({
|
|
|
3796
3856
|
fill: "none",
|
|
3797
3857
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3798
3858
|
children: [
|
|
3799
|
-
/* @__PURE__ */ (0,
|
|
3859
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3800
3860
|
"line",
|
|
3801
3861
|
{
|
|
3802
3862
|
opacity: "0.5",
|
|
@@ -3810,7 +3870,7 @@ var VerticalDivider = ({
|
|
|
3810
3870
|
strokeLinecap: "round"
|
|
3811
3871
|
}
|
|
3812
3872
|
),
|
|
3813
|
-
/* @__PURE__ */ (0,
|
|
3873
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3814
3874
|
"linearGradient",
|
|
3815
3875
|
{
|
|
3816
3876
|
id: "paint_linear",
|
|
@@ -3820,9 +3880,9 @@ var VerticalDivider = ({
|
|
|
3820
3880
|
y2: height,
|
|
3821
3881
|
gradientUnits: "userSpaceOnUse",
|
|
3822
3882
|
children: [
|
|
3823
|
-
/* @__PURE__ */ (0,
|
|
3824
|
-
/* @__PURE__ */ (0,
|
|
3825
|
-
/* @__PURE__ */ (0,
|
|
3883
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("stop", { stopOpacity: "0", stopColor: "currentColor" }),
|
|
3884
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("stop", { offset: "0.5", stopColor: "currentColor" }),
|
|
3885
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("stop", { offset: "1", stopColor: "currentColor", stopOpacity: "0" })
|
|
3826
3886
|
]
|
|
3827
3887
|
}
|
|
3828
3888
|
) })
|
|
@@ -3833,8 +3893,8 @@ var VerticalDivider = ({
|
|
|
3833
3893
|
|
|
3834
3894
|
// src/components/loading-states/ErrorComponent.tsx
|
|
3835
3895
|
var import_lucide_react11 = require("lucide-react");
|
|
3836
|
-
var
|
|
3837
|
-
var
|
|
3896
|
+
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
3897
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3838
3898
|
var defaultErrorComponentTranslation = {
|
|
3839
3899
|
en: {
|
|
3840
3900
|
errorOccurred: "An error occurred"
|
|
@@ -3849,8 +3909,8 @@ var ErrorComponent = ({
|
|
|
3849
3909
|
classname
|
|
3850
3910
|
}) => {
|
|
3851
3911
|
const translation = useTranslation(defaultErrorComponentTranslation, overwriteTranslation);
|
|
3852
|
-
return /* @__PURE__ */ (0,
|
|
3853
|
-
/* @__PURE__ */ (0,
|
|
3912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: (0, import_clsx29.default)("col items-center justify-center gap-y-4 w-full h-24", classname), children: [
|
|
3913
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react11.AlertOctagon, { size: 64, className: "text-warning" }),
|
|
3854
3914
|
errorText ?? `${translation.errorOccurred} :(`
|
|
3855
3915
|
] });
|
|
3856
3916
|
};
|
|
@@ -3859,8 +3919,8 @@ var ErrorComponent = ({
|
|
|
3859
3919
|
var import_react17 = require("react");
|
|
3860
3920
|
|
|
3861
3921
|
// src/components/loading-states/LoadingAnimation.tsx
|
|
3862
|
-
var
|
|
3863
|
-
var
|
|
3922
|
+
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
3923
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3864
3924
|
var defaultLoadingAnimationTranslation = {
|
|
3865
3925
|
en: {
|
|
3866
3926
|
loading: "Loading data"
|
|
@@ -3875,14 +3935,14 @@ var LoadingAnimation = ({
|
|
|
3875
3935
|
classname
|
|
3876
3936
|
}) => {
|
|
3877
3937
|
const translation = useTranslation(defaultLoadingAnimationTranslation, overwriteTranslation);
|
|
3878
|
-
return /* @__PURE__ */ (0,
|
|
3879
|
-
/* @__PURE__ */ (0,
|
|
3938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: (0, import_clsx30.default)("col items-center justify-center w-full h-24", classname), children: [
|
|
3939
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Helpwave, { animate: "loading" }),
|
|
3880
3940
|
loadingText ?? `${translation.loading}...`
|
|
3881
3941
|
] });
|
|
3882
3942
|
};
|
|
3883
3943
|
|
|
3884
3944
|
// src/components/loading-states/LoadingAndErrorComponent.tsx
|
|
3885
|
-
var
|
|
3945
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3886
3946
|
var LoadingAndErrorComponent = ({
|
|
3887
3947
|
children,
|
|
3888
3948
|
isLoading = false,
|
|
@@ -3901,27 +3961,27 @@ var LoadingAndErrorComponent = ({
|
|
|
3901
3961
|
}, minimumLoadingDuration);
|
|
3902
3962
|
}
|
|
3903
3963
|
if (isLoading || minimumLoadingDuration && isInMinimumLoading) {
|
|
3904
|
-
return /* @__PURE__ */ (0,
|
|
3964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LoadingAnimation, { ...loadingProps });
|
|
3905
3965
|
}
|
|
3906
3966
|
if (hasError) {
|
|
3907
|
-
return /* @__PURE__ */ (0,
|
|
3967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ErrorComponent, { ...errorProps });
|
|
3908
3968
|
}
|
|
3909
3969
|
return children;
|
|
3910
3970
|
};
|
|
3911
3971
|
|
|
3912
3972
|
// src/components/loading-states/LoadingButton.tsx
|
|
3913
|
-
var
|
|
3914
|
-
var
|
|
3973
|
+
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
3974
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3915
3975
|
var LoadingButton = ({ isLoading = false, size = "medium", onClick, ...rest }) => {
|
|
3916
3976
|
const paddingClass = ButtonUtil.paddingMapping[size];
|
|
3917
|
-
return /* @__PURE__ */ (0,
|
|
3918
|
-
isLoading && /* @__PURE__ */ (0,
|
|
3919
|
-
/* @__PURE__ */ (0,
|
|
3977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "inline-block relative", children: [
|
|
3978
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: (0, import_clsx31.default)("absolute inset-0 row items-center justify-center bg-white/40", paddingClass), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Helpwave, { animate: "loading", className: "text-white" }) }),
|
|
3979
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SolidButton, { ...rest, disabled: rest.disabled, onClick: isLoading ? noop : onClick })
|
|
3920
3980
|
] });
|
|
3921
3981
|
};
|
|
3922
3982
|
|
|
3923
3983
|
// src/components/loading-states/ProgressIndicator.tsx
|
|
3924
|
-
var
|
|
3984
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3925
3985
|
var sizeMapping = { small: 16, medium: 24, big: 48 };
|
|
3926
3986
|
var ProgressIndicator = ({
|
|
3927
3987
|
progress,
|
|
@@ -3938,7 +3998,7 @@ var ProgressIndicator = ({
|
|
|
3938
3998
|
if (direction === "clockwise") {
|
|
3939
3999
|
rotation += 360 * progress;
|
|
3940
4000
|
}
|
|
3941
|
-
return /* @__PURE__ */ (0,
|
|
4001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3942
4002
|
"svg",
|
|
3943
4003
|
{
|
|
3944
4004
|
style: {
|
|
@@ -3947,7 +4007,7 @@ var ProgressIndicator = ({
|
|
|
3947
4007
|
transform: `rotate(${rotation}deg)`
|
|
3948
4008
|
},
|
|
3949
4009
|
children: [
|
|
3950
|
-
/* @__PURE__ */ (0,
|
|
4010
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3951
4011
|
"circle",
|
|
3952
4012
|
{
|
|
3953
4013
|
cx: center,
|
|
@@ -3958,7 +4018,7 @@ var ProgressIndicator = ({
|
|
|
3958
4018
|
className: "stroke-primary"
|
|
3959
4019
|
}
|
|
3960
4020
|
),
|
|
3961
|
-
/* @__PURE__ */ (0,
|
|
4021
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3962
4022
|
"circle",
|
|
3963
4023
|
{
|
|
3964
4024
|
cx: center,
|
|
@@ -3976,10 +4036,10 @@ var ProgressIndicator = ({
|
|
|
3976
4036
|
);
|
|
3977
4037
|
};
|
|
3978
4038
|
|
|
3979
|
-
// src/components/modals/
|
|
3980
|
-
var
|
|
3981
|
-
var
|
|
3982
|
-
var
|
|
4039
|
+
// src/components/modals/ConfirmModal.tsx
|
|
4040
|
+
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
4041
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4042
|
+
var defaultConfirmDialogTranslation2 = {
|
|
3983
4043
|
en: {
|
|
3984
4044
|
confirm: "Confirm",
|
|
3985
4045
|
cancel: "Cancel",
|
|
@@ -3991,7 +4051,7 @@ var defaultConfirmDialogTranslation = {
|
|
|
3991
4051
|
decline: "Ablehnen"
|
|
3992
4052
|
}
|
|
3993
4053
|
};
|
|
3994
|
-
var
|
|
4054
|
+
var ConfirmModal = ({
|
|
3995
4055
|
overwriteTranslation,
|
|
3996
4056
|
children,
|
|
3997
4057
|
onCancel,
|
|
@@ -4002,25 +4062,26 @@ var ConfirmDialog = ({
|
|
|
4002
4062
|
className,
|
|
4003
4063
|
...restProps
|
|
4004
4064
|
}) => {
|
|
4005
|
-
const translation = useTranslation(
|
|
4065
|
+
const translation = useTranslation(defaultConfirmDialogTranslation2, overwriteTranslation);
|
|
4006
4066
|
const mapping = {
|
|
4007
|
-
neutral: "
|
|
4067
|
+
neutral: "neutral",
|
|
4008
4068
|
negative: "negative",
|
|
4009
|
-
positive: "positive"
|
|
4069
|
+
positive: "positive",
|
|
4070
|
+
primary: "primary"
|
|
4010
4071
|
};
|
|
4011
|
-
return /* @__PURE__ */ (0,
|
|
4012
|
-
/* @__PURE__ */ (0,
|
|
4013
|
-
/* @__PURE__ */ (0,
|
|
4014
|
-
onCancel && /* @__PURE__ */ (0,
|
|
4072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Modal, { ...restProps, onClose: onCancel, className: (0, import_clsx32.default)("justify-between", className), children: [
|
|
4073
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "col grow", children }),
|
|
4074
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "row mt-3 gap-x-4 justify-end", children: [
|
|
4075
|
+
onCancel && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4015
4076
|
SolidButton,
|
|
4016
4077
|
{
|
|
4017
|
-
color: buttonOverwrites?.[0].color ?? "
|
|
4078
|
+
color: buttonOverwrites?.[0].color ?? "neutral",
|
|
4018
4079
|
onClick: onCancel,
|
|
4019
4080
|
disabled: buttonOverwrites?.[0].disabled ?? false,
|
|
4020
4081
|
children: buttonOverwrites?.[0].text ?? translation.cancel
|
|
4021
4082
|
}
|
|
4022
4083
|
),
|
|
4023
|
-
onDecline && /* @__PURE__ */ (0,
|
|
4084
|
+
onDecline && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4024
4085
|
SolidButton,
|
|
4025
4086
|
{
|
|
4026
4087
|
color: buttonOverwrites?.[1].color ?? "negative",
|
|
@@ -4029,7 +4090,7 @@ var ConfirmDialog = ({
|
|
|
4029
4090
|
children: buttonOverwrites?.[1].text ?? translation.decline
|
|
4030
4091
|
}
|
|
4031
4092
|
),
|
|
4032
|
-
/* @__PURE__ */ (0,
|
|
4093
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4033
4094
|
SolidButton,
|
|
4034
4095
|
{
|
|
4035
4096
|
autoFocus: true,
|
|
@@ -4044,7 +4105,7 @@ var ConfirmDialog = ({
|
|
|
4044
4105
|
};
|
|
4045
4106
|
|
|
4046
4107
|
// src/components/modals/DiscardChangesModal.tsx
|
|
4047
|
-
var
|
|
4108
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4048
4109
|
var defaultDiscardChangesModalTranslation = {
|
|
4049
4110
|
en: {
|
|
4050
4111
|
save: "Save",
|
|
@@ -4071,40 +4132,37 @@ var DiscardChangesModal = ({
|
|
|
4071
4132
|
...modalProps
|
|
4072
4133
|
}) => {
|
|
4073
4134
|
const translation = useTranslation(defaultDiscardChangesModalTranslation, overwriteTranslation);
|
|
4074
|
-
return /* @__PURE__ */ (0,
|
|
4075
|
-
|
|
4135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4136
|
+
ConfirmModal,
|
|
4076
4137
|
{
|
|
4077
4138
|
headerProps: {
|
|
4078
4139
|
...headerProps,
|
|
4079
4140
|
titleText: headerProps?.titleText ?? translation.title,
|
|
4080
4141
|
descriptionText: headerProps?.descriptionText ?? translation.description
|
|
4081
4142
|
},
|
|
4143
|
+
onConfirm: onSave,
|
|
4144
|
+
onCancel,
|
|
4145
|
+
onDecline: onDontSave,
|
|
4146
|
+
buttonOverwrites: [{ text: translation.cancel }, { text: translation.dontSave }, { text: translation.save }],
|
|
4082
4147
|
...modalProps,
|
|
4083
|
-
children
|
|
4084
|
-
children,
|
|
4085
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "row mt-3 gap-x-4 justify-end", children: [
|
|
4086
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SolidButton, { color: "positive", onClick: onSave, children: translation.save }),
|
|
4087
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SolidButton, { color: "negative", onClick: onDontSave, children: translation.dontSave }),
|
|
4088
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SolidButton, { autoFocus: true, color: "primary", onClick: onCancel, children: translation.cancel })
|
|
4089
|
-
] })
|
|
4090
|
-
]
|
|
4148
|
+
children
|
|
4091
4149
|
}
|
|
4092
4150
|
);
|
|
4093
4151
|
};
|
|
4094
4152
|
|
|
4095
4153
|
// src/components/modals/InputModal.tsx
|
|
4096
|
-
var
|
|
4154
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4097
4155
|
var InputModal = ({
|
|
4098
4156
|
inputs,
|
|
4099
4157
|
buttonOverwrites,
|
|
4100
4158
|
...restProps
|
|
4101
4159
|
}) => {
|
|
4102
|
-
return /* @__PURE__ */ (0,
|
|
4160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4103
4161
|
ConfirmDialog,
|
|
4104
4162
|
{
|
|
4105
4163
|
buttonOverwrites,
|
|
4106
4164
|
...restProps,
|
|
4107
|
-
children: inputs.map((inputProps, index) => /* @__PURE__ */ (0,
|
|
4165
|
+
children: inputs.map((inputProps, index) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Input, { ...inputProps }, `input ${index}`))
|
|
4108
4166
|
}
|
|
4109
4167
|
);
|
|
4110
4168
|
};
|
|
@@ -4113,8 +4171,8 @@ var InputModal = ({
|
|
|
4113
4171
|
var import_react18 = require("@headlessui/react");
|
|
4114
4172
|
var import_lucide_react12 = require("lucide-react");
|
|
4115
4173
|
var import_react19 = require("react");
|
|
4116
|
-
var
|
|
4117
|
-
var
|
|
4174
|
+
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
4175
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4118
4176
|
var Select = ({
|
|
4119
4177
|
value,
|
|
4120
4178
|
label,
|
|
@@ -4139,13 +4197,13 @@ var Select = ({
|
|
|
4139
4197
|
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");
|
|
4140
4198
|
}
|
|
4141
4199
|
const borderColor = "border-menu-border";
|
|
4142
|
-
return /* @__PURE__ */ (0,
|
|
4143
|
-
label && /* @__PURE__ */ (0,
|
|
4144
|
-
/* @__PURE__ */ (0,
|
|
4145
|
-
/* @__PURE__ */ (0,
|
|
4200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: (0, import_clsx33.default)(className), children: [
|
|
4201
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Label, { ...label, labelType: label.labelType ?? "labelBig", className: (0, import_clsx33.default)("mb-1", label.className) }),
|
|
4202
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react18.Menu, { as: "div", className: "relative text-menu-text", children: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
4203
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4146
4204
|
import_react18.Menu.Button,
|
|
4147
4205
|
{
|
|
4148
|
-
className: (0,
|
|
4206
|
+
className: (0, import_clsx33.default)(
|
|
4149
4207
|
"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",
|
|
4150
4208
|
textColor,
|
|
4151
4209
|
borderColor,
|
|
@@ -4157,30 +4215,30 @@ var Select = ({
|
|
|
4157
4215
|
),
|
|
4158
4216
|
disabled: isDisabled,
|
|
4159
4217
|
children: [
|
|
4160
|
-
/* @__PURE__ */ (0,
|
|
4161
|
-
open ? /* @__PURE__ */ (0,
|
|
4218
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: selectedDisplayOverwrite ?? selectedOption?.label ?? hintText }),
|
|
4219
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react12.ChevronUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react12.ChevronDown, {})
|
|
4162
4220
|
]
|
|
4163
4221
|
}
|
|
4164
4222
|
),
|
|
4165
|
-
/* @__PURE__ */ (0,
|
|
4223
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4166
4224
|
import_react18.Menu.Items,
|
|
4167
4225
|
{
|
|
4168
4226
|
className: "absolute w-full z-10 rounded-b-lg bg-menu-background text-menu-text shadow-lg max-h-[500px] overflow-y-auto",
|
|
4169
4227
|
children: [
|
|
4170
|
-
(additionalItems ?? []).map((item, index) => /* @__PURE__ */ (0,
|
|
4228
|
+
(additionalItems ?? []).map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4171
4229
|
"div",
|
|
4172
4230
|
{
|
|
4173
|
-
className: (0,
|
|
4231
|
+
className: (0, import_clsx33.default)(borderColor, "px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0", {
|
|
4174
4232
|
"border-b-0 rounded-b-lg": filteredOptions.length === 0 && index === (additionalItems?.length ?? 1) - 1
|
|
4175
4233
|
}),
|
|
4176
4234
|
children: item
|
|
4177
4235
|
},
|
|
4178
4236
|
`additionalItems${index}`
|
|
4179
4237
|
)),
|
|
4180
|
-
filteredOptions.map((option, index) => /* @__PURE__ */ (0,
|
|
4238
|
+
filteredOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react18.Menu.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4181
4239
|
"div",
|
|
4182
4240
|
{
|
|
4183
|
-
className: (0,
|
|
4241
|
+
className: (0, import_clsx33.default)(
|
|
4184
4242
|
"px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0 cursor-pointer",
|
|
4185
4243
|
option.className,
|
|
4186
4244
|
borderColor,
|
|
@@ -4219,7 +4277,7 @@ var SelectUncontrolled = ({
|
|
|
4219
4277
|
setSelected(value);
|
|
4220
4278
|
}
|
|
4221
4279
|
}, [options, value]);
|
|
4222
|
-
return /* @__PURE__ */ (0,
|
|
4280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4223
4281
|
Select,
|
|
4224
4282
|
{
|
|
4225
4283
|
value: selected,
|
|
@@ -4241,14 +4299,14 @@ var SearchableSelect = ({
|
|
|
4241
4299
|
}) => {
|
|
4242
4300
|
const [search, setSearch] = (0, import_react19.useState)("");
|
|
4243
4301
|
const filteredOptions = MultiSearchWithMapping(search, options, searchMapping);
|
|
4244
|
-
return /* @__PURE__ */ (0,
|
|
4302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4245
4303
|
Select,
|
|
4246
4304
|
{
|
|
4247
4305
|
value,
|
|
4248
4306
|
options: filteredOptions,
|
|
4249
|
-
additionalItems: [/* @__PURE__ */ (0,
|
|
4250
|
-
/* @__PURE__ */ (0,
|
|
4251
|
-
/* @__PURE__ */ (0,
|
|
4307
|
+
additionalItems: [/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "row gap-x-2 items-center", children: [
|
|
4308
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Input, { autoFocus: true, value: search, onChangeText: setSearch }),
|
|
4309
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react12.Search, {})
|
|
4252
4310
|
] }, "selectSearch")],
|
|
4253
4311
|
...selectProps
|
|
4254
4312
|
}
|
|
@@ -4256,7 +4314,7 @@ var SearchableSelect = ({
|
|
|
4256
4314
|
};
|
|
4257
4315
|
|
|
4258
4316
|
// src/components/modals/LanguageModal.tsx
|
|
4259
|
-
var
|
|
4317
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4260
4318
|
var defaultLanguageModalTranslation = {
|
|
4261
4319
|
en: {
|
|
4262
4320
|
title: "Language",
|
|
@@ -4279,7 +4337,7 @@ var LanguageModal = ({
|
|
|
4279
4337
|
}) => {
|
|
4280
4338
|
const { language, setLanguage } = useLanguage();
|
|
4281
4339
|
const translation = useTranslation(defaultLanguageModalTranslation, overwriteTranslation);
|
|
4282
|
-
return /* @__PURE__ */ (0,
|
|
4340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4283
4341
|
Modal,
|
|
4284
4342
|
{
|
|
4285
4343
|
headerProps: {
|
|
@@ -4289,8 +4347,8 @@ var LanguageModal = ({
|
|
|
4289
4347
|
},
|
|
4290
4348
|
onClose,
|
|
4291
4349
|
...modalProps,
|
|
4292
|
-
children: /* @__PURE__ */ (0,
|
|
4293
|
-
/* @__PURE__ */ (0,
|
|
4350
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "w-64", children: [
|
|
4351
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4294
4352
|
Select,
|
|
4295
4353
|
{
|
|
4296
4354
|
className: "mt-2",
|
|
@@ -4299,7 +4357,7 @@ var LanguageModal = ({
|
|
|
4299
4357
|
onChange: (language2) => setLanguage(language2)
|
|
4300
4358
|
}
|
|
4301
4359
|
),
|
|
4302
|
-
/* @__PURE__ */ (0,
|
|
4360
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation.done }) })
|
|
4303
4361
|
] })
|
|
4304
4362
|
}
|
|
4305
4363
|
);
|
|
@@ -4307,7 +4365,7 @@ var LanguageModal = ({
|
|
|
4307
4365
|
|
|
4308
4366
|
// src/theming/useTheme.tsx
|
|
4309
4367
|
var import_react20 = require("react");
|
|
4310
|
-
var
|
|
4368
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4311
4369
|
var themes = ["light", "dark"];
|
|
4312
4370
|
var defaultThemeTypeTranslation = {
|
|
4313
4371
|
en: {
|
|
@@ -4338,13 +4396,13 @@ var ThemeProvider = ({ children, initialTheme = "light" }) => {
|
|
|
4338
4396
|
(0, import_react20.useEffect)(() => {
|
|
4339
4397
|
document.documentElement.setAttribute("data-theme", theme);
|
|
4340
4398
|
}, [theme]);
|
|
4341
|
-
return /* @__PURE__ */ (0,
|
|
4399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ThemeContext.Provider, { value: { theme, setTheme }, children });
|
|
4342
4400
|
};
|
|
4343
4401
|
var useTheme = () => (0, import_react20.useContext)(ThemeContext);
|
|
4344
4402
|
|
|
4345
4403
|
// src/components/modals/ThemeModal.tsx
|
|
4346
|
-
var
|
|
4347
|
-
var
|
|
4404
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4405
|
+
var defaultConfirmDialogTranslation3 = {
|
|
4348
4406
|
en: {
|
|
4349
4407
|
title: "Theme",
|
|
4350
4408
|
message: "Choose your preferred theme",
|
|
@@ -4365,8 +4423,8 @@ var ThemeModal = ({
|
|
|
4365
4423
|
...modalProps
|
|
4366
4424
|
}) => {
|
|
4367
4425
|
const { theme, setTheme } = useTheme();
|
|
4368
|
-
const translation = useTranslation(
|
|
4369
|
-
return /* @__PURE__ */ (0,
|
|
4426
|
+
const translation = useTranslation(defaultConfirmDialogTranslation3, overwriteTranslation);
|
|
4427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4370
4428
|
Modal,
|
|
4371
4429
|
{
|
|
4372
4430
|
headerProps: {
|
|
@@ -4376,8 +4434,8 @@ var ThemeModal = ({
|
|
|
4376
4434
|
},
|
|
4377
4435
|
onClose,
|
|
4378
4436
|
...modalProps,
|
|
4379
|
-
children: /* @__PURE__ */ (0,
|
|
4380
|
-
/* @__PURE__ */ (0,
|
|
4437
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "w-64", children: [
|
|
4438
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4381
4439
|
Select,
|
|
4382
4440
|
{
|
|
4383
4441
|
className: "mt-2",
|
|
@@ -4386,7 +4444,7 @@ var ThemeModal = ({
|
|
|
4386
4444
|
onChange: (theme2) => setTheme(theme2)
|
|
4387
4445
|
}
|
|
4388
4446
|
),
|
|
4389
|
-
/* @__PURE__ */ (0,
|
|
4447
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation.done }) })
|
|
4390
4448
|
] })
|
|
4391
4449
|
}
|
|
4392
4450
|
);
|
|
@@ -4397,8 +4455,8 @@ var import_lucide_react14 = require("lucide-react");
|
|
|
4397
4455
|
|
|
4398
4456
|
// src/components/properties/PropertyBase.tsx
|
|
4399
4457
|
var import_lucide_react13 = require("lucide-react");
|
|
4400
|
-
var
|
|
4401
|
-
var
|
|
4458
|
+
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
4459
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4402
4460
|
var defaultPropertyBaseTranslation = {
|
|
4403
4461
|
en: {
|
|
4404
4462
|
remove: "Remove"
|
|
@@ -4420,11 +4478,11 @@ var PropertyBase = ({
|
|
|
4420
4478
|
}) => {
|
|
4421
4479
|
const translation = useTranslation(defaultPropertyBaseTranslation, overwriteTranslation);
|
|
4422
4480
|
const requiredAndNoValue = softRequired && !hasValue;
|
|
4423
|
-
return /* @__PURE__ */ (0,
|
|
4424
|
-
/* @__PURE__ */ (0,
|
|
4481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: (0, import_clsx34.default)("row gap-x-0 group", className), children: [
|
|
4482
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
4425
4483
|
"div",
|
|
4426
4484
|
{
|
|
4427
|
-
className: (0,
|
|
4485
|
+
className: (0, import_clsx34.default)("row gap-x-2 !w-[200px] px-4 py-2 items-center rounded-l-xl border-2 border-r-0", {
|
|
4428
4486
|
"bg-gray-100 text-black group-hover:border-primary border-gray-400": !requiredAndNoValue,
|
|
4429
4487
|
"bg-warning text-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
4430
4488
|
}, className),
|
|
@@ -4434,22 +4492,22 @@ var PropertyBase = ({
|
|
|
4434
4492
|
]
|
|
4435
4493
|
}
|
|
4436
4494
|
),
|
|
4437
|
-
/* @__PURE__ */ (0,
|
|
4495
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
4438
4496
|
"div",
|
|
4439
4497
|
{
|
|
4440
|
-
className: (0,
|
|
4498
|
+
className: (0, import_clsx34.default)("row grow justify-between items-center rounded-r-xl border-2 border-l-0", {
|
|
4441
4499
|
"bg-white group-hover:border-primary border-gray-400": !requiredAndNoValue,
|
|
4442
4500
|
"bg-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
4443
4501
|
}, className),
|
|
4444
4502
|
children: [
|
|
4445
4503
|
input({ softRequired, hasValue }),
|
|
4446
|
-
requiredAndNoValue && /* @__PURE__ */ (0,
|
|
4447
|
-
onRemove && /* @__PURE__ */ (0,
|
|
4504
|
+
requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-warning pr-4", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react13.AlertTriangle, { size: 24 }) }),
|
|
4505
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4448
4506
|
TextButton,
|
|
4449
4507
|
{
|
|
4450
4508
|
onClick: onRemove,
|
|
4451
4509
|
color: "negative",
|
|
4452
|
-
className: (0,
|
|
4510
|
+
className: (0, import_clsx34.default)("pr-4 items-center", { "!text-transparent": !hasValue || readOnly }),
|
|
4453
4511
|
disabled: !hasValue || readOnly,
|
|
4454
4512
|
children: translation.remove
|
|
4455
4513
|
}
|
|
@@ -4461,7 +4519,7 @@ var PropertyBase = ({
|
|
|
4461
4519
|
};
|
|
4462
4520
|
|
|
4463
4521
|
// src/components/properties/CheckboxProperty.tsx
|
|
4464
|
-
var
|
|
4522
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4465
4523
|
var defaultCheckboxPropertyTranslation = {
|
|
4466
4524
|
en: {
|
|
4467
4525
|
yes: "Yes",
|
|
@@ -4480,14 +4538,14 @@ var CheckboxProperty = ({
|
|
|
4480
4538
|
...baseProps
|
|
4481
4539
|
}) => {
|
|
4482
4540
|
const translation = useTranslation(defaultCheckboxPropertyTranslation, overwriteTranslation);
|
|
4483
|
-
return /* @__PURE__ */ (0,
|
|
4541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4484
4542
|
PropertyBase,
|
|
4485
4543
|
{
|
|
4486
4544
|
...baseProps,
|
|
4487
4545
|
hasValue: true,
|
|
4488
4546
|
readOnly,
|
|
4489
|
-
icon: /* @__PURE__ */ (0,
|
|
4490
|
-
input: () => /* @__PURE__ */ (0,
|
|
4547
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react14.Check, { size: 16 }),
|
|
4548
|
+
input: () => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "row py-2 px-4 items-center", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4491
4549
|
Checkbox,
|
|
4492
4550
|
{
|
|
4493
4551
|
checked: value ?? true,
|
|
@@ -4502,8 +4560,8 @@ var CheckboxProperty = ({
|
|
|
4502
4560
|
|
|
4503
4561
|
// src/components/properties/DateProperty.tsx
|
|
4504
4562
|
var import_lucide_react15 = require("lucide-react");
|
|
4505
|
-
var
|
|
4506
|
-
var
|
|
4563
|
+
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
4564
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4507
4565
|
var DateProperty = ({
|
|
4508
4566
|
value,
|
|
4509
4567
|
onChange = noop,
|
|
@@ -4514,20 +4572,20 @@ var DateProperty = ({
|
|
|
4514
4572
|
}) => {
|
|
4515
4573
|
const hasValue = !!value;
|
|
4516
4574
|
const dateText = value ? type === "dateTime" ? formatDateTime(value) : formatDate(value) : "";
|
|
4517
|
-
return /* @__PURE__ */ (0,
|
|
4575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4518
4576
|
PropertyBase,
|
|
4519
4577
|
{
|
|
4520
4578
|
...baseProps,
|
|
4521
4579
|
hasValue,
|
|
4522
|
-
icon: /* @__PURE__ */ (0,
|
|
4523
|
-
input: ({ softRequired }) => /* @__PURE__ */ (0,
|
|
4580
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react15.CalendarDays, { size: 16 }),
|
|
4581
|
+
input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4524
4582
|
"div",
|
|
4525
4583
|
{
|
|
4526
|
-
className: (0,
|
|
4527
|
-
children: /* @__PURE__ */ (0,
|
|
4584
|
+
className: (0, import_clsx35.default)("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
|
|
4585
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4528
4586
|
Input,
|
|
4529
4587
|
{
|
|
4530
|
-
className: (0,
|
|
4588
|
+
className: (0, import_clsx35.default)("!ring-0 !border-0 !outline-0 !p-0 !m-0 !shadow-none !w-fit !rounded-none", { "bg-surface-warning": softRequired && !hasValue }),
|
|
4531
4589
|
value: dateText,
|
|
4532
4590
|
type: type === "dateTime" ? "datetime-local" : "date",
|
|
4533
4591
|
readOnly,
|
|
@@ -4551,16 +4609,16 @@ var DateProperty = ({
|
|
|
4551
4609
|
|
|
4552
4610
|
// src/components/properties/MultiSelectProperty.tsx
|
|
4553
4611
|
var import_lucide_react17 = require("lucide-react");
|
|
4554
|
-
var
|
|
4612
|
+
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
4555
4613
|
|
|
4556
4614
|
// src/components/user-action/MultiSelect.tsx
|
|
4557
4615
|
var import_react23 = require("react");
|
|
4558
4616
|
var import_lucide_react16 = require("lucide-react");
|
|
4559
|
-
var
|
|
4617
|
+
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
4560
4618
|
|
|
4561
4619
|
// src/components/user-action/Menu.tsx
|
|
4562
4620
|
var import_react22 = require("react");
|
|
4563
|
-
var
|
|
4621
|
+
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
4564
4622
|
|
|
4565
4623
|
// src/hooks/useOutsideClick.ts
|
|
4566
4624
|
var import_react21 = require("react");
|
|
@@ -4583,16 +4641,16 @@ var useOutsideClick = (refs, handler) => {
|
|
|
4583
4641
|
};
|
|
4584
4642
|
|
|
4585
4643
|
// src/components/user-action/Menu.tsx
|
|
4586
|
-
var
|
|
4644
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4587
4645
|
var MenuItem = ({
|
|
4588
4646
|
children,
|
|
4589
4647
|
onClick,
|
|
4590
4648
|
alignment = "left",
|
|
4591
4649
|
className
|
|
4592
|
-
}) => /* @__PURE__ */ (0,
|
|
4650
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4593
4651
|
"div",
|
|
4594
4652
|
{
|
|
4595
|
-
className: (0,
|
|
4653
|
+
className: (0, import_clsx36.default)("block px-3 py-1 bg-menu-background text-menu-text hover:brightness-90", {
|
|
4596
4654
|
"text-right": alignment === "right",
|
|
4597
4655
|
"text-left": alignment === "left"
|
|
4598
4656
|
}, className),
|
|
@@ -4611,19 +4669,19 @@ var Menu2 = ({
|
|
|
4611
4669
|
const triggerRef = (0, import_react22.useRef)(null);
|
|
4612
4670
|
const menuRef = (0, import_react22.useRef)(null);
|
|
4613
4671
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
4614
|
-
return /* @__PURE__ */ (0,
|
|
4672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
4615
4673
|
"div",
|
|
4616
4674
|
{
|
|
4617
4675
|
className: "relative",
|
|
4618
4676
|
...handlers,
|
|
4619
4677
|
children: [
|
|
4620
4678
|
trigger(() => setIsOpen(!isOpen), triggerRef),
|
|
4621
|
-
isOpen ? /* @__PURE__ */ (0,
|
|
4679
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4622
4680
|
"div",
|
|
4623
4681
|
{
|
|
4624
4682
|
ref: menuRef,
|
|
4625
4683
|
onClick: (e) => e.stopPropagation(),
|
|
4626
|
-
className: (0,
|
|
4684
|
+
className: (0, import_clsx36.default)("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]", {
|
|
4627
4685
|
" top-[8px]": alignment[0] === "t",
|
|
4628
4686
|
" bottom-[8px]": alignment[0] === "b",
|
|
4629
4687
|
" left-[-8px]": alignment[1] === "l",
|
|
@@ -4638,7 +4696,7 @@ var Menu2 = ({
|
|
|
4638
4696
|
};
|
|
4639
4697
|
|
|
4640
4698
|
// src/components/user-action/MultiSelect.tsx
|
|
4641
|
-
var
|
|
4699
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4642
4700
|
var defaultMultiSelectTranslation = {
|
|
4643
4701
|
en: {
|
|
4644
4702
|
select: "Select",
|
|
@@ -4679,28 +4737,28 @@ var MultiSelect = ({
|
|
|
4679
4737
|
filteredOptions = filteredOptions.filter((value) => !value.disabled);
|
|
4680
4738
|
}
|
|
4681
4739
|
const selectedItems = options.filter((value) => value.selected);
|
|
4682
|
-
const menuButtonText = selectedItems.length === 0 ? hintText ?? translation.select : /* @__PURE__ */ (0,
|
|
4740
|
+
const menuButtonText = selectedItems.length === 0 ? hintText ?? translation.select : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: `${selectedItems.length} ${translation.selected}` });
|
|
4683
4741
|
const borderColor = "border-menu-border";
|
|
4684
|
-
return /* @__PURE__ */ (0,
|
|
4685
|
-
label && /* @__PURE__ */ (0,
|
|
4742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: (0, import_clsx37.default)(className), children: [
|
|
4743
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4686
4744
|
Label,
|
|
4687
4745
|
{
|
|
4688
4746
|
...label,
|
|
4689
4747
|
htmlFor: label.name,
|
|
4690
|
-
className: (0,
|
|
4748
|
+
className: (0, import_clsx37.default)(" mb-1", label.className),
|
|
4691
4749
|
labelType: label.labelType ?? "labelBig"
|
|
4692
4750
|
}
|
|
4693
4751
|
),
|
|
4694
|
-
/* @__PURE__ */ (0,
|
|
4752
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
4695
4753
|
Menu2,
|
|
4696
4754
|
{
|
|
4697
4755
|
alignment: "t_",
|
|
4698
|
-
trigger: (onClick, ref) => /* @__PURE__ */ (0,
|
|
4756
|
+
trigger: (onClick, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4699
4757
|
"div",
|
|
4700
4758
|
{
|
|
4701
4759
|
ref,
|
|
4702
4760
|
onClick: disabled ? void 0 : onClick,
|
|
4703
|
-
className: (0,
|
|
4761
|
+
className: (0, import_clsx37.default)(
|
|
4704
4762
|
borderColor,
|
|
4705
4763
|
"bg-menu-background text-menu-text inline-w-full justify-between items-center rounded-lg border-2 px-4 py-2 font-medium",
|
|
4706
4764
|
{
|
|
@@ -4712,27 +4770,27 @@ var MultiSelect = ({
|
|
|
4712
4770
|
children: selectedDisplay ? selectedDisplay({ items: options, disabled }) : menuButtonText
|
|
4713
4771
|
}
|
|
4714
4772
|
),
|
|
4715
|
-
menuClassName: (0,
|
|
4773
|
+
menuClassName: (0, import_clsx37.default)(
|
|
4716
4774
|
"!rounded-lg !shadow-lg !max-h-[500px] !min-w-[400px] !max-w-[70vh] !overflow-y-auto !border !border-2",
|
|
4717
4775
|
borderColor,
|
|
4718
4776
|
{ "!py-0": !enableSearch, "!pb-0": enableSearch }
|
|
4719
4777
|
),
|
|
4720
4778
|
children: [
|
|
4721
|
-
enableSearch && /* @__PURE__ */ (0,
|
|
4722
|
-
/* @__PURE__ */ (0,
|
|
4723
|
-
/* @__PURE__ */ (0,
|
|
4779
|
+
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "row gap-x-2 items-center px-2 py-2", children: [
|
|
4780
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Input, { autoFocus: true, className: "w-full", value: searchText, onChangeText: setSearchText }),
|
|
4781
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react16.Search, {})
|
|
4724
4782
|
] }, "selectSearch"),
|
|
4725
|
-
filteredOptions.map((option, index) => /* @__PURE__ */ (0,
|
|
4783
|
+
filteredOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4726
4784
|
MenuItem,
|
|
4727
4785
|
{
|
|
4728
|
-
className: (0,
|
|
4786
|
+
className: (0, import_clsx37.default)({
|
|
4729
4787
|
"cursor-not-allowed !bg-disabled-background !text-disabled-text hover:brightness-100": !!option.disabled,
|
|
4730
4788
|
"cursor-pointer": !option.disabled
|
|
4731
4789
|
}),
|
|
4732
|
-
children: /* @__PURE__ */ (0,
|
|
4790
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
4733
4791
|
"div",
|
|
4734
4792
|
{
|
|
4735
|
-
className: (0,
|
|
4793
|
+
className: (0, import_clsx37.default)("overflow-hidden whitespace-nowrap text-ellipsis row items-center gap-x-2", option.className),
|
|
4736
4794
|
onClick: () => {
|
|
4737
4795
|
if (!option.disabled) {
|
|
4738
4796
|
onChange(options.map((value) => value.value === option.value ? {
|
|
@@ -4742,7 +4800,7 @@ var MultiSelect = ({
|
|
|
4742
4800
|
}
|
|
4743
4801
|
},
|
|
4744
4802
|
children: [
|
|
4745
|
-
/* @__PURE__ */ (0,
|
|
4803
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Checkbox, { checked: option.selected, disabled: option.disabled, size: "small" }),
|
|
4746
4804
|
option.label
|
|
4747
4805
|
]
|
|
4748
4806
|
}
|
|
@@ -4757,7 +4815,7 @@ var MultiSelect = ({
|
|
|
4757
4815
|
};
|
|
4758
4816
|
|
|
4759
4817
|
// src/components/properties/MultiSelectProperty.tsx
|
|
4760
|
-
var
|
|
4818
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4761
4819
|
var defaultMultiSelectPropertyTranslation = {
|
|
4762
4820
|
en: {
|
|
4763
4821
|
select: "Select"
|
|
@@ -4781,7 +4839,7 @@ var MultiSelectProperty = ({
|
|
|
4781
4839
|
if (softRequired && !hasValue) {
|
|
4782
4840
|
triggerClassName = "border-warning hover:brightness-90";
|
|
4783
4841
|
}
|
|
4784
|
-
return /* @__PURE__ */ (0,
|
|
4842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4785
4843
|
PropertyBase,
|
|
4786
4844
|
{
|
|
4787
4845
|
name,
|
|
@@ -4789,23 +4847,23 @@ var MultiSelectProperty = ({
|
|
|
4789
4847
|
readOnly,
|
|
4790
4848
|
softRequired,
|
|
4791
4849
|
hasValue,
|
|
4792
|
-
icon: /* @__PURE__ */ (0,
|
|
4793
|
-
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0,
|
|
4850
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react17.List, { size: 16 }),
|
|
4851
|
+
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4794
4852
|
"div",
|
|
4795
4853
|
{
|
|
4796
|
-
className: (0,
|
|
4797
|
-
children: /* @__PURE__ */ (0,
|
|
4854
|
+
className: (0, import_clsx38.default)("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired2 && !hasValue }),
|
|
4855
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4798
4856
|
MultiSelect,
|
|
4799
4857
|
{
|
|
4800
4858
|
...multiSelectProps,
|
|
4801
|
-
className: (0,
|
|
4859
|
+
className: (0, import_clsx38.default)("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
|
|
4802
4860
|
triggerClassName,
|
|
4803
4861
|
selectedDisplay: ({ items }) => {
|
|
4804
4862
|
const selected = items.filter((value) => value.selected);
|
|
4805
4863
|
if (selected.length === 0) {
|
|
4806
|
-
return /* @__PURE__ */ (0,
|
|
4864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { children: "Select" });
|
|
4807
4865
|
}
|
|
4808
|
-
return /* @__PURE__ */ (0,
|
|
4866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ChipList, { list: selected.map((value) => ({ children: value.label })) });
|
|
4809
4867
|
},
|
|
4810
4868
|
options,
|
|
4811
4869
|
disabled: readOnly,
|
|
@@ -4820,8 +4878,8 @@ var MultiSelectProperty = ({
|
|
|
4820
4878
|
|
|
4821
4879
|
// src/components/properties/NumberProperty.tsx
|
|
4822
4880
|
var import_lucide_react18 = require("lucide-react");
|
|
4823
|
-
var
|
|
4824
|
-
var
|
|
4881
|
+
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
4882
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4825
4883
|
var defaultNumberPropertyTranslation = {
|
|
4826
4884
|
en: {
|
|
4827
4885
|
value: "Value"
|
|
@@ -4842,23 +4900,23 @@ var NumberProperty = ({
|
|
|
4842
4900
|
}) => {
|
|
4843
4901
|
const translation = useTranslation(defaultNumberPropertyTranslation, overwriteTranslation);
|
|
4844
4902
|
const hasValue = value !== void 0;
|
|
4845
|
-
return /* @__PURE__ */ (0,
|
|
4903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4846
4904
|
PropertyBase,
|
|
4847
4905
|
{
|
|
4848
4906
|
...baseProps,
|
|
4849
4907
|
onRemove,
|
|
4850
4908
|
hasValue,
|
|
4851
|
-
icon: /* @__PURE__ */ (0,
|
|
4852
|
-
input: ({ softRequired }) => /* @__PURE__ */ (0,
|
|
4909
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react18.Binary, { size: 16 }),
|
|
4910
|
+
input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
4853
4911
|
"div",
|
|
4854
4912
|
{
|
|
4855
|
-
className: (0,
|
|
4913
|
+
className: (0, import_clsx39.default)("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
|
|
4856
4914
|
children: [
|
|
4857
|
-
/* @__PURE__ */ (0,
|
|
4915
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4858
4916
|
Input,
|
|
4859
4917
|
{
|
|
4860
4918
|
expanded: false,
|
|
4861
|
-
className: (0,
|
|
4919
|
+
className: (0, import_clsx39.default)("!ring-0 !border-0 !outline-0 !p-0 !m-0 !w-fit !shadow-none !rounded-none", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
|
|
4862
4920
|
value: value?.toString() ?? "",
|
|
4863
4921
|
type: "number",
|
|
4864
4922
|
readOnly,
|
|
@@ -4881,7 +4939,7 @@ var NumberProperty = ({
|
|
|
4881
4939
|
}
|
|
4882
4940
|
}
|
|
4883
4941
|
),
|
|
4884
|
-
suffix && /* @__PURE__ */ (0,
|
|
4942
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: (0, import_clsx39.default)("ml-1", { "bg-surface-warning": softRequired && !hasValue }), children: suffix })
|
|
4885
4943
|
]
|
|
4886
4944
|
}
|
|
4887
4945
|
)
|
|
@@ -4891,8 +4949,8 @@ var NumberProperty = ({
|
|
|
4891
4949
|
|
|
4892
4950
|
// src/components/properties/SelectProperty.tsx
|
|
4893
4951
|
var import_lucide_react19 = require("lucide-react");
|
|
4894
|
-
var
|
|
4895
|
-
var
|
|
4952
|
+
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
4953
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4896
4954
|
var defaultSingleSelectPropertyTranslation = {
|
|
4897
4955
|
en: {
|
|
4898
4956
|
select: "Select"
|
|
@@ -4913,7 +4971,7 @@ var SingleSelectProperty = ({
|
|
|
4913
4971
|
}) => {
|
|
4914
4972
|
const translation = useTranslation(defaultSingleSelectPropertyTranslation, overwriteTranslation);
|
|
4915
4973
|
const hasValue = value !== void 0;
|
|
4916
|
-
return /* @__PURE__ */ (0,
|
|
4974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4917
4975
|
PropertyBase,
|
|
4918
4976
|
{
|
|
4919
4977
|
name,
|
|
@@ -4921,19 +4979,19 @@ var SingleSelectProperty = ({
|
|
|
4921
4979
|
readOnly,
|
|
4922
4980
|
softRequired,
|
|
4923
4981
|
hasValue,
|
|
4924
|
-
icon: /* @__PURE__ */ (0,
|
|
4925
|
-
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0,
|
|
4982
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react19.List, { size: 16 }),
|
|
4983
|
+
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4926
4984
|
"div",
|
|
4927
4985
|
{
|
|
4928
|
-
className: (0,
|
|
4929
|
-
children: /* @__PURE__ */ (0,
|
|
4986
|
+
className: (0, import_clsx40.default)("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired2 && !hasValue }),
|
|
4987
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4930
4988
|
SearchableSelect,
|
|
4931
4989
|
{
|
|
4932
4990
|
...multiSelectProps,
|
|
4933
4991
|
value,
|
|
4934
4992
|
options,
|
|
4935
4993
|
isDisabled: readOnly,
|
|
4936
|
-
className: (0,
|
|
4994
|
+
className: (0, import_clsx40.default)("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
|
|
4937
4995
|
hintText: `${translation.select}...`
|
|
4938
4996
|
}
|
|
4939
4997
|
)
|
|
@@ -4945,12 +5003,12 @@ var SingleSelectProperty = ({
|
|
|
4945
5003
|
|
|
4946
5004
|
// src/components/properties/TextProperty.tsx
|
|
4947
5005
|
var import_lucide_react20 = require("lucide-react");
|
|
4948
|
-
var
|
|
5006
|
+
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
4949
5007
|
|
|
4950
5008
|
// src/components/user-action/Textarea.tsx
|
|
4951
5009
|
var import_react24 = require("react");
|
|
4952
|
-
var
|
|
4953
|
-
var
|
|
5010
|
+
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
5011
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4954
5012
|
var Textarea = ({
|
|
4955
5013
|
label,
|
|
4956
5014
|
headline,
|
|
@@ -4971,27 +5029,27 @@ var Textarea = ({
|
|
|
4971
5029
|
onEditCompleted(text);
|
|
4972
5030
|
clearUpdateTimer();
|
|
4973
5031
|
};
|
|
4974
|
-
return /* @__PURE__ */ (0,
|
|
4975
|
-
label && /* @__PURE__ */ (0,
|
|
5032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "w-full", children: [
|
|
5033
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4976
5034
|
Label,
|
|
4977
5035
|
{
|
|
4978
5036
|
...label,
|
|
4979
5037
|
htmlFor: id,
|
|
4980
|
-
className: (0,
|
|
5038
|
+
className: (0, import_clsx41.default)("mb-1", label.className),
|
|
4981
5039
|
labelType: label.labelType ?? "labelSmall"
|
|
4982
5040
|
}
|
|
4983
5041
|
),
|
|
4984
|
-
/* @__PURE__ */ (0,
|
|
5042
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
4985
5043
|
"div",
|
|
4986
5044
|
{
|
|
4987
|
-
className: `${(0,
|
|
5045
|
+
className: `${(0, import_clsx41.default)(" bg-surface text-on-surface focus-within:border-primary relative", { "shadow border-2 border-gray-300 hover:border-primary rounded-lg": defaultStyle })}`,
|
|
4988
5046
|
children: [
|
|
4989
|
-
headline && /* @__PURE__ */ (0,
|
|
4990
|
-
/* @__PURE__ */ (0,
|
|
5047
|
+
headline && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "mx-3 mt-3 block text-gray-700 font-bold", children: headline }),
|
|
5048
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4991
5049
|
"textarea",
|
|
4992
5050
|
{
|
|
4993
5051
|
id,
|
|
4994
|
-
className: (0,
|
|
5052
|
+
className: (0, import_clsx41.default)("pt-0 px-3 border-transparent focus:border-transparent focus:ring-0 appearance-none border w-full leading-tight focus:outline-none", {
|
|
4995
5053
|
"resize-none": !resizable,
|
|
4996
5054
|
"h-32": defaultStyle,
|
|
4997
5055
|
"mt-3": !headline
|
|
@@ -5018,7 +5076,7 @@ var Textarea = ({
|
|
|
5018
5076
|
]
|
|
5019
5077
|
}
|
|
5020
5078
|
),
|
|
5021
|
-
hasFocus && disclaimer && /* @__PURE__ */ (0,
|
|
5079
|
+
hasFocus && disclaimer && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("label", { className: "text-negative", children: disclaimer })
|
|
5022
5080
|
] });
|
|
5023
5081
|
};
|
|
5024
5082
|
var TextareaUncontrolled = ({
|
|
@@ -5030,7 +5088,7 @@ var TextareaUncontrolled = ({
|
|
|
5030
5088
|
(0, import_react24.useEffect)(() => {
|
|
5031
5089
|
setText(value);
|
|
5032
5090
|
}, [value]);
|
|
5033
|
-
return /* @__PURE__ */ (0,
|
|
5091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5034
5092
|
Textarea,
|
|
5035
5093
|
{
|
|
5036
5094
|
...props,
|
|
@@ -5044,7 +5102,7 @@ var TextareaUncontrolled = ({
|
|
|
5044
5102
|
};
|
|
5045
5103
|
|
|
5046
5104
|
// src/components/properties/TextProperty.tsx
|
|
5047
|
-
var
|
|
5105
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5048
5106
|
var defaultTextPropertyTranslation = {
|
|
5049
5107
|
en: {
|
|
5050
5108
|
value: "Text"
|
|
@@ -5064,21 +5122,21 @@ var TextProperty = ({
|
|
|
5064
5122
|
}) => {
|
|
5065
5123
|
const translation = useTranslation(defaultTextPropertyTranslation, overwriteTranslation);
|
|
5066
5124
|
const hasValue = value !== void 0;
|
|
5067
|
-
return /* @__PURE__ */ (0,
|
|
5125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5068
5126
|
PropertyBase,
|
|
5069
5127
|
{
|
|
5070
5128
|
...baseProps,
|
|
5071
5129
|
onRemove,
|
|
5072
5130
|
hasValue,
|
|
5073
|
-
icon: /* @__PURE__ */ (0,
|
|
5074
|
-
input: ({ softRequired }) => /* @__PURE__ */ (0,
|
|
5131
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react20.Text, { size: 16 }),
|
|
5132
|
+
input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5075
5133
|
"div",
|
|
5076
5134
|
{
|
|
5077
|
-
className: (0,
|
|
5078
|
-
children: /* @__PURE__ */ (0,
|
|
5135
|
+
className: (0, import_clsx42.default)("row grow pt-2 pb-1 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
|
|
5136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5079
5137
|
Textarea,
|
|
5080
5138
|
{
|
|
5081
|
-
className: (0,
|
|
5139
|
+
className: (0, import_clsx42.default)("ring-0 border-0 outline-0 p-0 m-0 shadow-none rounded-none", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
|
|
5082
5140
|
rows: 5,
|
|
5083
5141
|
defaultStyle: false,
|
|
5084
5142
|
value: value ?? "",
|
|
@@ -5107,8 +5165,8 @@ var TextProperty = ({
|
|
|
5107
5165
|
};
|
|
5108
5166
|
|
|
5109
5167
|
// src/components/user-action/DateAndTimePicker.tsx
|
|
5110
|
-
var
|
|
5111
|
-
var
|
|
5168
|
+
var import_clsx43 = __toESM(require("clsx"), 1);
|
|
5169
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5112
5170
|
var defaultTimeTranslation = {
|
|
5113
5171
|
en: {
|
|
5114
5172
|
clear: "Clear",
|
|
@@ -5167,7 +5225,7 @@ var DateTimePicker = ({
|
|
|
5167
5225
|
let dateDisplay;
|
|
5168
5226
|
let timeDisplay;
|
|
5169
5227
|
if (useDate) {
|
|
5170
|
-
dateDisplay = /* @__PURE__ */ (0,
|
|
5228
|
+
dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5171
5229
|
DatePicker,
|
|
5172
5230
|
{
|
|
5173
5231
|
...datePickerProps,
|
|
@@ -5181,25 +5239,25 @@ var DateTimePicker = ({
|
|
|
5181
5239
|
);
|
|
5182
5240
|
}
|
|
5183
5241
|
if (useTime) {
|
|
5184
|
-
timeDisplay = /* @__PURE__ */ (0,
|
|
5242
|
+
timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5185
5243
|
TimePicker,
|
|
5186
5244
|
{
|
|
5187
5245
|
...timePickerProps,
|
|
5188
|
-
className: (0,
|
|
5246
|
+
className: (0, import_clsx43.default)("h-full", { "justify-between w-full": mode === "time" }),
|
|
5189
5247
|
maxHeight: 250,
|
|
5190
5248
|
time: value,
|
|
5191
5249
|
onChange
|
|
5192
5250
|
}
|
|
5193
5251
|
);
|
|
5194
5252
|
}
|
|
5195
|
-
return /* @__PURE__ */ (0,
|
|
5196
|
-
/* @__PURE__ */ (0,
|
|
5253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "col w-fit", children: [
|
|
5254
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "row gap-x-4", children: [
|
|
5197
5255
|
dateDisplay,
|
|
5198
5256
|
timeDisplay
|
|
5199
5257
|
] }),
|
|
5200
|
-
/* @__PURE__ */ (0,
|
|
5201
|
-
/* @__PURE__ */ (0,
|
|
5202
|
-
/* @__PURE__ */ (0,
|
|
5258
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "row justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "row gap-x-2 mt-1", children: [
|
|
5259
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation.clear }),
|
|
5260
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5203
5261
|
SolidButton,
|
|
5204
5262
|
{
|
|
5205
5263
|
size: "medium",
|
|
@@ -5213,8 +5271,8 @@ var DateTimePicker = ({
|
|
|
5213
5271
|
|
|
5214
5272
|
// src/components/user-action/ScrollPicker.tsx
|
|
5215
5273
|
var import_react25 = require("react");
|
|
5216
|
-
var
|
|
5217
|
-
var
|
|
5274
|
+
var import_clsx44 = __toESM(require("clsx"), 1);
|
|
5275
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5218
5276
|
var up = 1;
|
|
5219
5277
|
var down = -1;
|
|
5220
5278
|
var ScrollPicker = ({
|
|
@@ -5353,7 +5411,7 @@ var ScrollPicker = ({
|
|
|
5353
5411
|
}
|
|
5354
5412
|
return clamp(1 - opacityValue / max);
|
|
5355
5413
|
};
|
|
5356
|
-
return /* @__PURE__ */ (0,
|
|
5414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5357
5415
|
"div",
|
|
5358
5416
|
{
|
|
5359
5417
|
className: "relative overflow-hidden",
|
|
@@ -5363,15 +5421,15 @@ var ScrollPicker = ({
|
|
|
5363
5421
|
setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + event.deltaY }));
|
|
5364
5422
|
}
|
|
5365
5423
|
},
|
|
5366
|
-
children: /* @__PURE__ */ (0,
|
|
5367
|
-
/* @__PURE__ */ (0,
|
|
5424
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
|
|
5425
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5368
5426
|
"div",
|
|
5369
5427
|
{
|
|
5370
5428
|
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]",
|
|
5371
5429
|
style: { height: `${itemHeight}px` }
|
|
5372
5430
|
}
|
|
5373
5431
|
),
|
|
5374
|
-
/* @__PURE__ */ (0,
|
|
5432
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5375
5433
|
"div",
|
|
5376
5434
|
{
|
|
5377
5435
|
className: "col select-none",
|
|
@@ -5379,10 +5437,10 @@ var ScrollPicker = ({
|
|
|
5379
5437
|
transform: `translateY(${-transition * (distance + itemHeight)}px)`,
|
|
5380
5438
|
columnGap: `${distance}px`
|
|
5381
5439
|
},
|
|
5382
|
-
children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ (0,
|
|
5440
|
+
children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5383
5441
|
"div",
|
|
5384
5442
|
{
|
|
5385
|
-
className: (0,
|
|
5443
|
+
className: (0, import_clsx44.default)(
|
|
5386
5444
|
`col items-center justify-center rounded-md`,
|
|
5387
5445
|
{
|
|
5388
5446
|
"text-primary font-bold": currentIndex === index,
|
|
@@ -5411,8 +5469,8 @@ var ScrollPicker = ({
|
|
|
5411
5469
|
// src/components/user-action/ToggleableInput.tsx
|
|
5412
5470
|
var import_react26 = require("react");
|
|
5413
5471
|
var import_lucide_react21 = require("lucide-react");
|
|
5414
|
-
var
|
|
5415
|
-
var
|
|
5472
|
+
var import_clsx45 = __toESM(require("clsx"), 1);
|
|
5473
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5416
5474
|
var ToggleableInput = ({
|
|
5417
5475
|
type = "text",
|
|
5418
5476
|
value,
|
|
@@ -5438,14 +5496,14 @@ var ToggleableInput = ({
|
|
|
5438
5496
|
ref.current?.focus();
|
|
5439
5497
|
}
|
|
5440
5498
|
}, [isEditing]);
|
|
5441
|
-
return /* @__PURE__ */ (0,
|
|
5442
|
-
/* @__PURE__ */ (0,
|
|
5499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
5500
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
5443
5501
|
"div",
|
|
5444
5502
|
{
|
|
5445
|
-
className: (0,
|
|
5503
|
+
className: (0, import_clsx45.default)("row items-center w-full gap-x-2 overflow-hidden", { "cursor-pointer": !isEditing }),
|
|
5446
5504
|
onClick: () => !isEditing ? setIsEditing(!isEditing) : void 0,
|
|
5447
5505
|
children: [
|
|
5448
|
-
/* @__PURE__ */ (0,
|
|
5506
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: (0, import_clsx45.default)("row overflow-hidden", { "flex-1": isEditing }), children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5449
5507
|
"input",
|
|
5450
5508
|
{
|
|
5451
5509
|
ref,
|
|
@@ -5473,16 +5531,16 @@ var ToggleableInput = ({
|
|
|
5473
5531
|
onEditCompletedWrapper(value);
|
|
5474
5532
|
}
|
|
5475
5533
|
},
|
|
5476
|
-
className: (0,
|
|
5534
|
+
className: (0, import_clsx45.default)(`w-full border-none rounded-none ring-0 outline-0 text-inherit bg-inherit shadow-transparent decoration-primary p-0 underline-offset-4`, {
|
|
5477
5535
|
underline: isEditing
|
|
5478
5536
|
}, labelClassName),
|
|
5479
5537
|
onFocus: (event) => event.target.select()
|
|
5480
5538
|
}
|
|
5481
|
-
) : /* @__PURE__ */ (0,
|
|
5482
|
-
/* @__PURE__ */ (0,
|
|
5539
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: (0, import_clsx45.default)("max-w-xs break-words overflow-hidden", labelClassName), children: value }) }),
|
|
5540
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5483
5541
|
import_lucide_react21.Pencil,
|
|
5484
5542
|
{
|
|
5485
|
-
className: (0,
|
|
5543
|
+
className: (0, import_clsx45.default)(`cursor-pointer`, { "text-transparent": isEditing }),
|
|
5486
5544
|
size,
|
|
5487
5545
|
style: { minWidth: `${size}px` }
|
|
5488
5546
|
}
|
|
@@ -5490,7 +5548,7 @@ var ToggleableInput = ({
|
|
|
5490
5548
|
]
|
|
5491
5549
|
}
|
|
5492
5550
|
),
|
|
5493
|
-
isEditing && disclaimer && /* @__PURE__ */ (0,
|
|
5551
|
+
isEditing && disclaimer && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { className: "text-negative", children: disclaimer })
|
|
5494
5552
|
] });
|
|
5495
5553
|
};
|
|
5496
5554
|
var ToggleableInputUncontrolled = ({
|
|
@@ -5502,7 +5560,7 @@ var ToggleableInputUncontrolled = ({
|
|
|
5502
5560
|
(0, import_react26.useEffect)(() => {
|
|
5503
5561
|
setValue(initialValue);
|
|
5504
5562
|
}, [initialValue]);
|
|
5505
|
-
return /* @__PURE__ */ (0,
|
|
5563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5506
5564
|
ToggleableInput,
|
|
5507
5565
|
{
|
|
5508
5566
|
value,
|
|
@@ -5571,6 +5629,7 @@ var filterNews = (localizedNews, requiredKeys) => {
|
|
|
5571
5629
|
ChipList,
|
|
5572
5630
|
Circle,
|
|
5573
5631
|
ConfirmDialog,
|
|
5632
|
+
ConfirmModal,
|
|
5574
5633
|
DatePicker,
|
|
5575
5634
|
DatePickerUncontrolled,
|
|
5576
5635
|
DateProperty,
|
|
@@ -5605,7 +5664,6 @@ var filterNews = (localizedNews, requiredKeys) => {
|
|
|
5605
5664
|
Menu,
|
|
5606
5665
|
MenuItem,
|
|
5607
5666
|
Modal,
|
|
5608
|
-
ModalHeader,
|
|
5609
5667
|
MultiSearchWithMapping,
|
|
5610
5668
|
MultiSelect,
|
|
5611
5669
|
MultiSelectProperty,
|
|
@@ -5613,6 +5671,7 @@ var filterNews = (localizedNews, requiredKeys) => {
|
|
|
5613
5671
|
NumberProperty,
|
|
5614
5672
|
OutlineButton,
|
|
5615
5673
|
Overlay,
|
|
5674
|
+
OverlayHeader,
|
|
5616
5675
|
Pagination,
|
|
5617
5676
|
ProgressIndicator,
|
|
5618
5677
|
PropertyBase,
|