@helpwave/hightide 0.1.7 → 0.1.8
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/components/branding/HelpwaveBadge.js +30 -8
- package/dist/components/branding/HelpwaveBadge.js.map +1 -1
- package/dist/components/branding/HelpwaveBadge.mjs +30 -8
- package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
- package/dist/components/date/DatePicker.js +18 -20
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +18 -20
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.d.mts +1 -1
- package/dist/components/date/DayPicker.d.ts +1 -1
- package/dist/components/date/DayPicker.js +23 -11
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs +23 -11
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js +106 -22
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +106 -22
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.js +2 -2
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +2 -2
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.js +2 -2
- package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.mjs +2 -2
- package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.d.mts +1 -1
- package/dist/components/layout-and-navigation/Carousel.d.ts +1 -1
- package/dist/components/layout-and-navigation/Carousel.js +86 -28
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.mjs +86 -28
- package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.d.mts +3 -0
- package/dist/components/layout-and-navigation/Expandable.d.ts +3 -0
- package/dist/components/layout-and-navigation/Expandable.js +4 -3
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +4 -3
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +4 -3
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs +4 -3
- package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.js +2 -2
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +2 -2
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.d.mts +7 -6
- package/dist/components/layout-and-navigation/SearchableList.d.ts +7 -6
- package/dist/components/layout-and-navigation/SearchableList.js +114 -21
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +114 -21
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.js +6 -6
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +6 -6
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Table.js +1 -1
- package/dist/components/layout-and-navigation/Table.js.map +1 -1
- package/dist/components/layout-and-navigation/Table.mjs +1 -1
- package/dist/components/layout-and-navigation/Table.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Tile.d.mts +10 -15
- package/dist/components/layout-and-navigation/Tile.d.ts +10 -15
- package/dist/components/layout-and-navigation/Tile.js +30 -8
- package/dist/components/layout-and-navigation/Tile.js.map +1 -1
- package/dist/components/layout-and-navigation/Tile.mjs +30 -8
- package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
- package/dist/components/loading-states/ProgressIndicator.js +2 -2
- package/dist/components/loading-states/ProgressIndicator.js.map +1 -1
- package/dist/components/loading-states/ProgressIndicator.mjs +2 -2
- package/dist/components/loading-states/ProgressIndicator.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.js +2 -2
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +2 -2
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.js +2 -2
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +2 -2
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
- package/dist/components/modals/InputModal.js +2 -2
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +2 -2
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +384 -150
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +383 -149
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +385 -154
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +382 -151
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js +1 -1
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +1 -1
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js +1 -1
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +1 -1
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +1 -0
- package/dist/components/properties/MultiSelectProperty.d.ts +1 -0
- package/dist/components/properties/MultiSelectProperty.js +482 -430
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +478 -426
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js +1 -1
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +1 -1
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js +1 -1
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +1 -1
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +3 -3
- package/dist/components/properties/SelectProperty.d.ts +3 -3
- package/dist/components/properties/SelectProperty.js +404 -263
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +404 -263
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js +1 -1
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +1 -1
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js +18 -20
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +18 -20
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Menu.d.mts +14 -8
- package/dist/components/user-action/Menu.d.ts +14 -8
- package/dist/components/user-action/Menu.js +32 -11
- package/dist/components/user-action/Menu.js.map +1 -1
- package/dist/components/user-action/Menu.mjs +32 -11
- package/dist/components/user-action/Menu.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +10 -16
- package/dist/components/user-action/MultiSelect.d.ts +10 -16
- package/dist/components/user-action/MultiSelect.js +485 -312
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +482 -310
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/Select.d.mts +5 -18
- package/dist/components/user-action/Select.d.ts +5 -18
- package/dist/components/user-action/Select.js +309 -113
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +304 -107
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Tooltip.js +2 -2
- package/dist/components/user-action/Tooltip.js.map +1 -1
- package/dist/components/user-action/Tooltip.mjs +2 -2
- package/dist/components/user-action/Tooltip.mjs.map +1 -1
- package/dist/css/globals.css +213 -205
- package/dist/css/uncompiled/globals.css +136 -72
- package/dist/hooks/useSearch.d.mts +17 -0
- package/dist/hooks/useSearch.d.ts +17 -0
- package/dist/hooks/useSearch.js +66 -0
- package/dist/hooks/useSearch.js.map +1 -0
- package/dist/hooks/useSearch.mjs +42 -0
- package/dist/hooks/useSearch.mjs.map +1 -0
- package/dist/index.d.mts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +555 -463
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +517 -427
- package/dist/index.mjs.map +1 -1
- package/dist/util/PropsWithFunctionChildren.d.mts +14 -0
- package/dist/util/PropsWithFunctionChildren.d.ts +14 -0
- package/dist/util/PropsWithFunctionChildren.js +38 -0
- package/dist/util/PropsWithFunctionChildren.js.map +1 -0
- package/dist/util/PropsWithFunctionChildren.mjs +14 -0
- package/dist/util/PropsWithFunctionChildren.mjs.map +1 -0
- package/dist/util/simpleSearch.d.mts +2 -2
- package/dist/util/simpleSearch.d.ts +2 -2
- package/dist/util/simpleSearch.js +4 -1
- package/dist/util/simpleSearch.js.map +1 -1
- package/dist/util/simpleSearch.mjs +4 -1
- package/dist/util/simpleSearch.mjs.map +1 -1
- package/package.json +1 -2
|
@@ -38,10 +38,9 @@ var useTranslation = (defaults, translationOverwrite = {}) => {
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
// src/components/user-action/Select.tsx
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import
|
|
44
|
-
import clsx3 from "clsx";
|
|
41
|
+
import { ChevronDown, ChevronUp } from "lucide-react";
|
|
42
|
+
import { useEffect as useEffect7, useRef as useRef2, useState as useState6 } from "react";
|
|
43
|
+
import clsx6 from "clsx";
|
|
45
44
|
|
|
46
45
|
// src/components/user-action/Label.tsx
|
|
47
46
|
import clsx from "clsx";
|
|
@@ -61,15 +60,119 @@ var Label = ({
|
|
|
61
60
|
return /* @__PURE__ */ jsx2("label", { ...props, className: clsx(styleMapping[labelType], className), children: children ? children : name });
|
|
62
61
|
};
|
|
63
62
|
|
|
63
|
+
// src/components/layout-and-navigation/SearchableList.tsx
|
|
64
|
+
import { Search } from "lucide-react";
|
|
65
|
+
import clsx4 from "clsx";
|
|
66
|
+
|
|
64
67
|
// src/components/user-action/Input.tsx
|
|
65
68
|
import { forwardRef, useEffect as useEffect4, useRef, useState as useState4 } from "react";
|
|
66
69
|
import clsx2 from "clsx";
|
|
67
70
|
|
|
68
71
|
// src/hooks/useSaveDelay.ts
|
|
69
72
|
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
73
|
+
function useSaveDelay(setNotificationStatus, delay) {
|
|
74
|
+
const [updateTimer, setUpdateTimer] = useState3(void 0);
|
|
75
|
+
const [notificationTimer, setNotificationTimer] = useState3(void 0);
|
|
76
|
+
const restartTimer = (onSave) => {
|
|
77
|
+
clearTimeout(updateTimer);
|
|
78
|
+
setUpdateTimer(setTimeout(() => {
|
|
79
|
+
onSave();
|
|
80
|
+
setNotificationStatus(true);
|
|
81
|
+
clearTimeout(notificationTimer);
|
|
82
|
+
setNotificationTimer(setTimeout(() => {
|
|
83
|
+
setNotificationStatus(false);
|
|
84
|
+
clearTimeout(notificationTimer);
|
|
85
|
+
}, delay));
|
|
86
|
+
clearTimeout(updateTimer);
|
|
87
|
+
}, delay));
|
|
88
|
+
};
|
|
89
|
+
const clearUpdateTimer = (hasSaved = true) => {
|
|
90
|
+
clearTimeout(updateTimer);
|
|
91
|
+
if (hasSaved) {
|
|
92
|
+
setNotificationStatus(true);
|
|
93
|
+
clearTimeout(notificationTimer);
|
|
94
|
+
setNotificationTimer(setTimeout(() => {
|
|
95
|
+
setNotificationStatus(false);
|
|
96
|
+
clearTimeout(notificationTimer);
|
|
97
|
+
}, delay));
|
|
98
|
+
} else {
|
|
99
|
+
setNotificationStatus(false);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
useEffect3(() => {
|
|
103
|
+
return () => {
|
|
104
|
+
clearTimeout(updateTimer);
|
|
105
|
+
clearTimeout(notificationTimer);
|
|
106
|
+
};
|
|
107
|
+
}, []);
|
|
108
|
+
return { restartTimer, clearUpdateTimer };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// src/util/noop.ts
|
|
112
|
+
var noop = () => void 0;
|
|
70
113
|
|
|
71
114
|
// src/components/user-action/Input.tsx
|
|
72
115
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
116
|
+
var Input = ({
|
|
117
|
+
id,
|
|
118
|
+
type = "text",
|
|
119
|
+
value,
|
|
120
|
+
label,
|
|
121
|
+
onChange = noop,
|
|
122
|
+
onChangeText = noop,
|
|
123
|
+
onEditCompleted,
|
|
124
|
+
className = "",
|
|
125
|
+
expanded = true,
|
|
126
|
+
autoFocus,
|
|
127
|
+
onBlur,
|
|
128
|
+
containerClassName,
|
|
129
|
+
...restProps
|
|
130
|
+
}) => {
|
|
131
|
+
const {
|
|
132
|
+
restartTimer,
|
|
133
|
+
clearUpdateTimer
|
|
134
|
+
} = useSaveDelay(() => void 0, 3e3);
|
|
135
|
+
const ref = useRef(null);
|
|
136
|
+
useEffect4(() => {
|
|
137
|
+
if (autoFocus) {
|
|
138
|
+
ref.current?.focus();
|
|
139
|
+
}
|
|
140
|
+
}, [autoFocus]);
|
|
141
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx2({ "w-full": expanded }, containerClassName), children: [
|
|
142
|
+
label && /* @__PURE__ */ jsx3(Label, { ...label, htmlFor: id, className: clsx2("mb-1", label.className) }),
|
|
143
|
+
/* @__PURE__ */ jsx3(
|
|
144
|
+
"input",
|
|
145
|
+
{
|
|
146
|
+
ref,
|
|
147
|
+
value,
|
|
148
|
+
id,
|
|
149
|
+
type,
|
|
150
|
+
className,
|
|
151
|
+
onBlur: (event) => {
|
|
152
|
+
if (onBlur) {
|
|
153
|
+
onBlur(event);
|
|
154
|
+
}
|
|
155
|
+
if (onEditCompleted) {
|
|
156
|
+
onEditCompleted(event.target.value);
|
|
157
|
+
clearUpdateTimer();
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
onChange: (e) => {
|
|
161
|
+
const value2 = e.target.value;
|
|
162
|
+
if (onEditCompleted) {
|
|
163
|
+
restartTimer(() => {
|
|
164
|
+
onEditCompleted(value2);
|
|
165
|
+
clearUpdateTimer();
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
onChange(e);
|
|
169
|
+
onChangeText(value2);
|
|
170
|
+
},
|
|
171
|
+
...restProps
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
] });
|
|
175
|
+
};
|
|
73
176
|
var FormInput = forwardRef(function FormInput2({
|
|
74
177
|
id,
|
|
75
178
|
labelText,
|
|
@@ -106,102 +209,9 @@ var FormInput = forwardRef(function FormInput2({
|
|
|
106
209
|
] });
|
|
107
210
|
});
|
|
108
211
|
|
|
109
|
-
// src/components/user-action/Select.tsx
|
|
110
|
-
import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
111
|
-
var Select = ({
|
|
112
|
-
value,
|
|
113
|
-
label,
|
|
114
|
-
options,
|
|
115
|
-
onChange,
|
|
116
|
-
isHidingCurrentValue = true,
|
|
117
|
-
hintText = "",
|
|
118
|
-
showDisabledOptions = true,
|
|
119
|
-
isDisabled,
|
|
120
|
-
className,
|
|
121
|
-
textColor = "text-menu-text",
|
|
122
|
-
additionalItems,
|
|
123
|
-
selectedDisplayOverwrite
|
|
124
|
-
}) => {
|
|
125
|
-
let filteredOptions = isHidingCurrentValue ? options.filter((option) => option.value !== value) : options;
|
|
126
|
-
if (!showDisabledOptions) {
|
|
127
|
-
filteredOptions = filteredOptions.filter((value2) => !value2.disabled);
|
|
128
|
-
}
|
|
129
|
-
const selectedOption = options.find((option) => option.value === value);
|
|
130
|
-
if (value !== void 0 && selectedOption === void 0 && selectedDisplayOverwrite === void 0) {
|
|
131
|
-
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");
|
|
132
|
-
}
|
|
133
|
-
const borderColor = "border-menu-border";
|
|
134
|
-
return /* @__PURE__ */ jsxs2("div", { className: clsx3(className), children: [
|
|
135
|
-
label && /* @__PURE__ */ jsx4(Label, { ...label, labelType: label.labelType ?? "labelBig", className: clsx3("mb-1", label.className) }),
|
|
136
|
-
/* @__PURE__ */ jsx4(Menu, { as: "div", className: "relative text-menu-text", children: ({ open }) => /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
137
|
-
/* @__PURE__ */ jsxs2(
|
|
138
|
-
Menu.Button,
|
|
139
|
-
{
|
|
140
|
-
className: clsx3(
|
|
141
|
-
"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",
|
|
142
|
-
textColor,
|
|
143
|
-
borderColor,
|
|
144
|
-
{
|
|
145
|
-
"rounded-b-lg": !open,
|
|
146
|
-
"hover:border-primary": !isDisabled,
|
|
147
|
-
"bg-disabled-background cursor-not-allowed text-disabled": isDisabled
|
|
148
|
-
}
|
|
149
|
-
),
|
|
150
|
-
disabled: isDisabled,
|
|
151
|
-
children: [
|
|
152
|
-
/* @__PURE__ */ jsx4("span", { children: selectedDisplayOverwrite ?? selectedOption?.label ?? hintText }),
|
|
153
|
-
open ? /* @__PURE__ */ jsx4(ChevronUp, {}) : /* @__PURE__ */ jsx4(ChevronDown, {})
|
|
154
|
-
]
|
|
155
|
-
}
|
|
156
|
-
),
|
|
157
|
-
/* @__PURE__ */ jsxs2(
|
|
158
|
-
Menu.Items,
|
|
159
|
-
{
|
|
160
|
-
className: "absolute w-full z-10 rounded-b-lg bg-menu-background text-menu-text shadow-lg max-h-[500px] overflow-y-auto",
|
|
161
|
-
children: [
|
|
162
|
-
(additionalItems ?? []).map((item, index) => /* @__PURE__ */ jsx4(
|
|
163
|
-
"div",
|
|
164
|
-
{
|
|
165
|
-
className: clsx3(borderColor, "px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0", {
|
|
166
|
-
"border-b-0 rounded-b-lg": filteredOptions.length === 0 && index === (additionalItems?.length ?? 1) - 1
|
|
167
|
-
}),
|
|
168
|
-
children: item
|
|
169
|
-
},
|
|
170
|
-
`additionalItems${index}`
|
|
171
|
-
)),
|
|
172
|
-
filteredOptions.map((option, index) => /* @__PURE__ */ jsx4(Menu.Item, { children: /* @__PURE__ */ jsx4(
|
|
173
|
-
"div",
|
|
174
|
-
{
|
|
175
|
-
className: clsx3(
|
|
176
|
-
"px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0 cursor-pointer",
|
|
177
|
-
option.className,
|
|
178
|
-
borderColor,
|
|
179
|
-
{
|
|
180
|
-
"brightness-90": option.value === value,
|
|
181
|
-
"brightness-95": index % 2 === 1,
|
|
182
|
-
"text-disabled bg-disabled-background cursor-not-allowed": !!option.disabled,
|
|
183
|
-
"bg-menu-background text-menu-text hover:brightness-90 cursor-pointer": !option.disabled,
|
|
184
|
-
"rounded-b-lg": index === filteredOptions.length - 1
|
|
185
|
-
}
|
|
186
|
-
),
|
|
187
|
-
onClick: () => {
|
|
188
|
-
if (!option.disabled) {
|
|
189
|
-
onChange(option.value);
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
children: option.label
|
|
193
|
-
}
|
|
194
|
-
) }, `item${index}`))
|
|
195
|
-
]
|
|
196
|
-
}
|
|
197
|
-
)
|
|
198
|
-
] }) })
|
|
199
|
-
] });
|
|
200
|
-
};
|
|
201
|
-
|
|
202
212
|
// src/components/user-action/Button.tsx
|
|
203
|
-
import
|
|
204
|
-
import { jsx as
|
|
213
|
+
import clsx3 from "clsx";
|
|
214
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
205
215
|
var paddingMapping = {
|
|
206
216
|
small: "btn-sm",
|
|
207
217
|
medium: "btn-md",
|
|
@@ -245,25 +255,25 @@ var SolidButton = ({
|
|
|
245
255
|
negative: "text-button-solid-negative-icon",
|
|
246
256
|
neutral: "text-button-solid-neutral-icon"
|
|
247
257
|
}[color];
|
|
248
|
-
return /* @__PURE__ */
|
|
258
|
+
return /* @__PURE__ */ jsxs2(
|
|
249
259
|
"button",
|
|
250
260
|
{
|
|
251
261
|
onClick: disabled ? void 0 : onClick,
|
|
252
262
|
disabled: disabled || onClick === void 0,
|
|
253
|
-
className:
|
|
263
|
+
className: clsx3(
|
|
254
264
|
{
|
|
255
265
|
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
256
|
-
[
|
|
266
|
+
[clsx3(colorClasses, "hover:brightness-90")]: !disabled
|
|
257
267
|
},
|
|
258
268
|
ButtonUtil.paddingMapping[size],
|
|
259
269
|
className
|
|
260
270
|
),
|
|
261
271
|
...restProps,
|
|
262
272
|
children: [
|
|
263
|
-
startIcon && /* @__PURE__ */
|
|
273
|
+
startIcon && /* @__PURE__ */ jsx4(
|
|
264
274
|
"span",
|
|
265
275
|
{
|
|
266
|
-
className:
|
|
276
|
+
className: clsx3({
|
|
267
277
|
[iconColorClasses]: !disabled,
|
|
268
278
|
[`text-disabled-icon`]: disabled
|
|
269
279
|
}),
|
|
@@ -271,10 +281,10 @@ var SolidButton = ({
|
|
|
271
281
|
}
|
|
272
282
|
),
|
|
273
283
|
children,
|
|
274
|
-
endIcon && /* @__PURE__ */
|
|
284
|
+
endIcon && /* @__PURE__ */ jsx4(
|
|
275
285
|
"span",
|
|
276
286
|
{
|
|
277
|
-
className:
|
|
287
|
+
className: clsx3({
|
|
278
288
|
[iconColorClasses]: !disabled,
|
|
279
289
|
[`text-disabled-icon`]: disabled
|
|
280
290
|
}),
|
|
@@ -303,15 +313,15 @@ var IconButton = ({
|
|
|
303
313
|
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
304
314
|
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
305
315
|
}[color];
|
|
306
|
-
return /* @__PURE__ */
|
|
316
|
+
return /* @__PURE__ */ jsx4(
|
|
307
317
|
"button",
|
|
308
318
|
{
|
|
309
319
|
onClick: disabled ? void 0 : onClick,
|
|
310
320
|
disabled: disabled || onClick === void 0,
|
|
311
|
-
className:
|
|
321
|
+
className: clsx3(
|
|
312
322
|
{
|
|
313
323
|
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
314
|
-
[
|
|
324
|
+
[clsx3(colorClasses, "hover:brightness-90")]: !disabled
|
|
315
325
|
},
|
|
316
326
|
ButtonUtil.iconPaddingMapping[size],
|
|
317
327
|
className
|
|
@@ -322,21 +332,245 @@ var IconButton = ({
|
|
|
322
332
|
);
|
|
323
333
|
};
|
|
324
334
|
|
|
335
|
+
// src/hooks/useSearch.ts
|
|
336
|
+
import { useEffect as useEffect5, useMemo, useState as useState5 } from "react";
|
|
337
|
+
|
|
338
|
+
// src/util/simpleSearch.ts
|
|
339
|
+
var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
340
|
+
return objects.filter((object) => {
|
|
341
|
+
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
342
|
+
if (!mappedSearchKeywords) {
|
|
343
|
+
return true;
|
|
344
|
+
}
|
|
345
|
+
return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
|
|
346
|
+
});
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
// src/hooks/useSearch.ts
|
|
350
|
+
var useSearch = ({
|
|
351
|
+
list,
|
|
352
|
+
initialSearch,
|
|
353
|
+
searchMapping
|
|
354
|
+
}) => {
|
|
355
|
+
const [items, setItems] = useState5(list);
|
|
356
|
+
const [search, setSearch] = useState5(initialSearch);
|
|
357
|
+
useEffect5(() => {
|
|
358
|
+
setItems(list);
|
|
359
|
+
}, [list]);
|
|
360
|
+
const result = useMemo(
|
|
361
|
+
() => MultiSearchWithMapping(search, items, searchMapping),
|
|
362
|
+
[search, items, searchMapping]
|
|
363
|
+
);
|
|
364
|
+
return {
|
|
365
|
+
result,
|
|
366
|
+
hasResult: result.length > 0,
|
|
367
|
+
allItems: items,
|
|
368
|
+
setItems,
|
|
369
|
+
search,
|
|
370
|
+
setSearch
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
// src/components/layout-and-navigation/SearchableList.tsx
|
|
375
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
376
|
+
var defaultSearchableListTranslation = {
|
|
377
|
+
en: {
|
|
378
|
+
search: "Search",
|
|
379
|
+
nothingFound: "Nothing found"
|
|
380
|
+
},
|
|
381
|
+
de: {
|
|
382
|
+
search: "Suche",
|
|
383
|
+
nothingFound: "Nichts gefunden"
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
var SearchableList = ({
|
|
387
|
+
overwriteTranslation,
|
|
388
|
+
list,
|
|
389
|
+
initialSearch = "",
|
|
390
|
+
searchMapping,
|
|
391
|
+
autoFocus,
|
|
392
|
+
minimumItemsForSearch = 6,
|
|
393
|
+
itemMapper,
|
|
394
|
+
className,
|
|
395
|
+
resultListClassName
|
|
396
|
+
}) => {
|
|
397
|
+
const translation = useTranslation(defaultSearchableListTranslation, overwriteTranslation);
|
|
398
|
+
const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
|
|
399
|
+
return /* @__PURE__ */ jsxs3("div", { className: clsx4("col gap-y-2", className), children: [
|
|
400
|
+
list.length > minimumItemsForSearch && /* @__PURE__ */ jsxs3("div", { className: "row justify-between gap-x-4 items-center", children: [
|
|
401
|
+
/* @__PURE__ */ jsx5(
|
|
402
|
+
Input,
|
|
403
|
+
{
|
|
404
|
+
value: search,
|
|
405
|
+
onChangeText: setSearch,
|
|
406
|
+
placeholder: translation.search,
|
|
407
|
+
autoFocus,
|
|
408
|
+
className: "w-full"
|
|
409
|
+
}
|
|
410
|
+
),
|
|
411
|
+
/* @__PURE__ */ jsx5(IconButton, { color: "neutral", disabled: search.length === 0, children: /* @__PURE__ */ jsx5(Search, { className: "w-full h-full" }) })
|
|
412
|
+
] }),
|
|
413
|
+
hasResult ? /* @__PURE__ */ jsx5("div", { className: clsx4("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ jsx5("div", { className: "row text-description py-2 px-2", children: translation.nothingFound })
|
|
414
|
+
] });
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
418
|
+
import clsx5 from "clsx";
|
|
419
|
+
import { Check } from "lucide-react";
|
|
420
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
421
|
+
var Tile = ({
|
|
422
|
+
title,
|
|
423
|
+
description,
|
|
424
|
+
onClick,
|
|
425
|
+
isSelected = false,
|
|
426
|
+
isDisabled = false,
|
|
427
|
+
prefix,
|
|
428
|
+
suffix,
|
|
429
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
430
|
+
selectedClassName = " bg-primary/20",
|
|
431
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
432
|
+
className
|
|
433
|
+
}) => {
|
|
434
|
+
return /* @__PURE__ */ jsxs4(
|
|
435
|
+
"div",
|
|
436
|
+
{
|
|
437
|
+
className: clsx5(
|
|
438
|
+
"row gap-x-2 w-full items-center",
|
|
439
|
+
{
|
|
440
|
+
[normalClassName]: !!onClick && !isDisabled,
|
|
441
|
+
[selectedClassName]: isSelected && !isDisabled,
|
|
442
|
+
[disabledClassName]: isDisabled
|
|
443
|
+
},
|
|
444
|
+
className
|
|
445
|
+
),
|
|
446
|
+
onClick: isDisabled ? void 0 : onClick,
|
|
447
|
+
children: [
|
|
448
|
+
prefix ?? (isSelected ? /* @__PURE__ */ jsx6(Check, { size: 24 }) : void 0),
|
|
449
|
+
/* @__PURE__ */ jsxs4("div", { className: "col gap-y-0 w-full", children: [
|
|
450
|
+
/* @__PURE__ */ jsx6("h4", { className: clsx5(title.className ?? "textstyle-title-normal"), children: title.value }),
|
|
451
|
+
!!description && /* @__PURE__ */ jsx6("span", { className: clsx5(description.className ?? "textstyle-description"), children: description.value })
|
|
452
|
+
] }),
|
|
453
|
+
suffix
|
|
454
|
+
]
|
|
455
|
+
}
|
|
456
|
+
);
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
// src/hooks/useOutsideClick.ts
|
|
460
|
+
import { useEffect as useEffect6 } from "react";
|
|
461
|
+
var useOutsideClick = (refs, handler) => {
|
|
462
|
+
useEffect6(() => {
|
|
463
|
+
const listener = (event) => {
|
|
464
|
+
if (event.target === null) return;
|
|
465
|
+
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
handler();
|
|
469
|
+
};
|
|
470
|
+
document.addEventListener("mousedown", listener);
|
|
471
|
+
document.addEventListener("touchstart", listener);
|
|
472
|
+
return () => {
|
|
473
|
+
document.removeEventListener("mousedown", listener);
|
|
474
|
+
document.removeEventListener("touchstart", listener);
|
|
475
|
+
};
|
|
476
|
+
}, [refs, handler]);
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
// src/components/user-action/Select.tsx
|
|
480
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
481
|
+
var Select = ({
|
|
482
|
+
value,
|
|
483
|
+
label,
|
|
484
|
+
options,
|
|
485
|
+
onChange,
|
|
486
|
+
hintText = "",
|
|
487
|
+
isDisabled,
|
|
488
|
+
isSearchEnabled = false,
|
|
489
|
+
className,
|
|
490
|
+
selectedDisplayOverwrite
|
|
491
|
+
}) => {
|
|
492
|
+
const triggerRef = useRef2(null);
|
|
493
|
+
const menuRef = useRef2(null);
|
|
494
|
+
const [isOpen, setIsOpen] = useState6(false);
|
|
495
|
+
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
496
|
+
const selectedOption = options.find((option) => option.value === value);
|
|
497
|
+
if (value !== void 0 && selectedOption === void 0 && selectedDisplayOverwrite === void 0) {
|
|
498
|
+
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");
|
|
499
|
+
}
|
|
500
|
+
const isShowingHint = !selectedDisplayOverwrite && !selectedOption?.label;
|
|
501
|
+
return /* @__PURE__ */ jsxs5("div", { className: clsx6(className), children: [
|
|
502
|
+
label && /* @__PURE__ */ jsx7(Label, { ...label, labelType: label.labelType ?? "labelBig", className: clsx6("mb-1", label.className) }),
|
|
503
|
+
/* @__PURE__ */ jsxs5("div", { className: "relative", children: [
|
|
504
|
+
/* @__PURE__ */ jsxs5(
|
|
505
|
+
"button",
|
|
506
|
+
{
|
|
507
|
+
ref: triggerRef,
|
|
508
|
+
className: clsx6(
|
|
509
|
+
"btn-md justify-between w-full border-2",
|
|
510
|
+
{
|
|
511
|
+
"rounded-b-lg": !open,
|
|
512
|
+
"bg-menu-background border-menu-border hover:border-primary": !isDisabled,
|
|
513
|
+
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": isDisabled
|
|
514
|
+
}
|
|
515
|
+
),
|
|
516
|
+
onClick: () => setIsOpen(!isOpen),
|
|
517
|
+
disabled: isDisabled,
|
|
518
|
+
children: [
|
|
519
|
+
!isShowingHint && /* @__PURE__ */ jsx7("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? selectedOption?.label }),
|
|
520
|
+
isShowingHint && /* @__PURE__ */ jsx7("span", { className: "textstyle-description", children: hintText }),
|
|
521
|
+
isOpen ? /* @__PURE__ */ jsx7(ChevronUp, {}) : /* @__PURE__ */ jsx7(ChevronDown, {})
|
|
522
|
+
]
|
|
523
|
+
}
|
|
524
|
+
),
|
|
525
|
+
isOpen && /* @__PURE__ */ jsx7(
|
|
526
|
+
"div",
|
|
527
|
+
{
|
|
528
|
+
ref: menuRef,
|
|
529
|
+
className: "absolute w-full z-10 rounded-lg mt-0.5 bg-menu-background text-menu-text shadow-around-md max-h-[500px] overflow-y-auto p-2",
|
|
530
|
+
children: /* @__PURE__ */ jsx7(
|
|
531
|
+
SearchableList,
|
|
532
|
+
{
|
|
533
|
+
list: options,
|
|
534
|
+
minimumItemsForSearch: isSearchEnabled ? void 0 : options.length,
|
|
535
|
+
searchMapping: (item) => item.searchTags,
|
|
536
|
+
itemMapper: (option, index) => /* @__PURE__ */ jsx7(
|
|
537
|
+
Tile,
|
|
538
|
+
{
|
|
539
|
+
isSelected: selectedOption?.value === option.value,
|
|
540
|
+
className: "px-2 py-1 rounded-md",
|
|
541
|
+
disabledClassName: "text-disabled-text cursor-not-allowed",
|
|
542
|
+
title: { value: option.label, className: "font-semibold" },
|
|
543
|
+
onClick: () => {
|
|
544
|
+
onChange(option.value);
|
|
545
|
+
setIsOpen(false);
|
|
546
|
+
},
|
|
547
|
+
isDisabled: option.disabled
|
|
548
|
+
},
|
|
549
|
+
index
|
|
550
|
+
)
|
|
551
|
+
}
|
|
552
|
+
)
|
|
553
|
+
}
|
|
554
|
+
)
|
|
555
|
+
] })
|
|
556
|
+
] });
|
|
557
|
+
};
|
|
558
|
+
|
|
325
559
|
// src/components/layout-and-navigation/Overlay.tsx
|
|
326
|
-
import { useEffect as
|
|
560
|
+
import { useEffect as useEffect9, useRef as useRef3, useState as useState8 } from "react";
|
|
327
561
|
import ReactDOM from "react-dom";
|
|
328
|
-
import
|
|
562
|
+
import clsx8 from "clsx";
|
|
329
563
|
|
|
330
564
|
// src/hooks/useHoverState.ts
|
|
331
|
-
import { useEffect as
|
|
565
|
+
import { useEffect as useEffect8, useState as useState7 } from "react";
|
|
332
566
|
var defaultUseHoverStateProps = {
|
|
333
567
|
closingDelay: 200,
|
|
334
568
|
isDisabled: false
|
|
335
569
|
};
|
|
336
570
|
var useHoverState = (props = void 0) => {
|
|
337
571
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
338
|
-
const [isHovered, setIsHovered] =
|
|
339
|
-
const [timer, setTimer] =
|
|
572
|
+
const [isHovered, setIsHovered] = useState7(false);
|
|
573
|
+
const [timer, setTimer] = useState7();
|
|
340
574
|
const onMouseEnter = () => {
|
|
341
575
|
if (isDisabled) {
|
|
342
576
|
return;
|
|
@@ -352,14 +586,14 @@ var useHoverState = (props = void 0) => {
|
|
|
352
586
|
setIsHovered(false);
|
|
353
587
|
}, closingDelay));
|
|
354
588
|
};
|
|
355
|
-
|
|
589
|
+
useEffect8(() => {
|
|
356
590
|
if (timer) {
|
|
357
591
|
return () => {
|
|
358
592
|
clearTimeout(timer);
|
|
359
593
|
};
|
|
360
594
|
}
|
|
361
595
|
});
|
|
362
|
-
|
|
596
|
+
useEffect8(() => {
|
|
363
597
|
if (timer) {
|
|
364
598
|
clearTimeout(timer);
|
|
365
599
|
}
|
|
@@ -372,8 +606,8 @@ var useHoverState = (props = void 0) => {
|
|
|
372
606
|
};
|
|
373
607
|
|
|
374
608
|
// src/components/user-action/Tooltip.tsx
|
|
375
|
-
import { clsx as
|
|
376
|
-
import { jsx as
|
|
609
|
+
import { clsx as clsx7 } from "clsx";
|
|
610
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
377
611
|
var Tooltip = ({
|
|
378
612
|
tooltip,
|
|
379
613
|
children,
|
|
@@ -403,30 +637,30 @@ var Tooltip = ({
|
|
|
403
637
|
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
404
638
|
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
405
639
|
};
|
|
406
|
-
return /* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ jsxs6(
|
|
407
641
|
"div",
|
|
408
642
|
{
|
|
409
|
-
className:
|
|
643
|
+
className: clsx7("relative inline-block", containerClassName),
|
|
410
644
|
...handlers,
|
|
411
645
|
children: [
|
|
412
646
|
children,
|
|
413
|
-
isHovered && /* @__PURE__ */
|
|
647
|
+
isHovered && /* @__PURE__ */ jsxs6(
|
|
414
648
|
"div",
|
|
415
649
|
{
|
|
416
|
-
className:
|
|
650
|
+
className: clsx7(
|
|
417
651
|
`opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
|
|
418
|
-
animate-tooltip-fade-in shadow-
|
|
652
|
+
animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,
|
|
419
653
|
positionClasses[position],
|
|
420
654
|
tooltipClassName
|
|
421
655
|
),
|
|
422
656
|
style: { zIndex, animationDelay: animationDelay + "ms" },
|
|
423
657
|
children: [
|
|
424
658
|
tooltip,
|
|
425
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ jsx8(
|
|
426
660
|
"div",
|
|
427
661
|
{
|
|
428
|
-
className:
|
|
429
|
-
style: { ...triangleStyle[position], zIndex }
|
|
662
|
+
className: clsx7(`absolute w-0 h-0`, triangleClasses[position]),
|
|
663
|
+
style: { ...triangleStyle[position], zIndex: zIndex + 1 }
|
|
430
664
|
}
|
|
431
665
|
)
|
|
432
666
|
]
|
|
@@ -439,24 +673,24 @@ var Tooltip = ({
|
|
|
439
673
|
|
|
440
674
|
// src/components/layout-and-navigation/Overlay.tsx
|
|
441
675
|
import { X } from "lucide-react";
|
|
442
|
-
import { jsx as
|
|
676
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
443
677
|
var Overlay = ({
|
|
444
678
|
children,
|
|
445
679
|
isOpen,
|
|
446
680
|
onBackgroundClick,
|
|
447
681
|
backgroundClassName
|
|
448
682
|
}) => {
|
|
449
|
-
const [root, setRoot] =
|
|
450
|
-
|
|
683
|
+
const [root, setRoot] = useState8();
|
|
684
|
+
useEffect9(() => {
|
|
451
685
|
setRoot(document.body);
|
|
452
686
|
}, []);
|
|
453
687
|
if (!root || !isOpen) return null;
|
|
454
688
|
return ReactDOM.createPortal(
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
/* @__PURE__ */
|
|
689
|
+
/* @__PURE__ */ jsxs7("div", { className: clsx8("fixed inset-0 z-[9999]"), children: [
|
|
690
|
+
/* @__PURE__ */ jsx9(
|
|
457
691
|
"div",
|
|
458
692
|
{
|
|
459
|
-
className:
|
|
693
|
+
className: clsx8("fixed inset-0 h-screen w-screen bg-black/30", backgroundClassName),
|
|
460
694
|
onClick: onBackgroundClick
|
|
461
695
|
}
|
|
462
696
|
),
|
|
@@ -484,21 +718,21 @@ var OverlayHeader = ({
|
|
|
484
718
|
}) => {
|
|
485
719
|
const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation);
|
|
486
720
|
const hasTitleRow = !!title || !!titleText || !!onClose;
|
|
487
|
-
const titleRow = /* @__PURE__ */
|
|
488
|
-
title ?? /* @__PURE__ */
|
|
721
|
+
const titleRow = /* @__PURE__ */ jsxs7("div", { className: "row justify-between items-start gap-x-8", children: [
|
|
722
|
+
title ?? /* @__PURE__ */ jsx9(
|
|
489
723
|
"h2",
|
|
490
724
|
{
|
|
491
|
-
className:
|
|
725
|
+
className: clsx8("textstyle-title-lg", {
|
|
492
726
|
"mb-1": description || descriptionText
|
|
493
727
|
}),
|
|
494
728
|
children: titleText
|
|
495
729
|
}
|
|
496
730
|
),
|
|
497
|
-
!!onClose && /* @__PURE__ */
|
|
731
|
+
!!onClose && /* @__PURE__ */ jsx9(Tooltip, { tooltip: translation.close, children: /* @__PURE__ */ jsx9(IconButton, { color: "neutral", size: "small", onClick: onClose, children: /* @__PURE__ */ jsx9(X, { className: "w-full h-full" }) }) })
|
|
498
732
|
] });
|
|
499
|
-
return /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ jsxs7("div", { className: "col", children: [
|
|
500
734
|
hasTitleRow && titleRow,
|
|
501
|
-
description ?? (descriptionText && /* @__PURE__ */
|
|
735
|
+
description ?? (descriptionText && /* @__PURE__ */ jsx9("span", { className: "textstyle-description", children: descriptionText }))
|
|
502
736
|
] });
|
|
503
737
|
};
|
|
504
738
|
var Modal = ({
|
|
@@ -509,8 +743,8 @@ var Modal = ({
|
|
|
509
743
|
backgroundClassName,
|
|
510
744
|
headerProps
|
|
511
745
|
}) => {
|
|
512
|
-
const ref =
|
|
513
|
-
|
|
746
|
+
const ref = useRef3(null);
|
|
747
|
+
useEffect9(() => {
|
|
514
748
|
if (!isOpen) return;
|
|
515
749
|
const modal = ref.current;
|
|
516
750
|
if (!modal) {
|
|
@@ -547,25 +781,25 @@ var Modal = ({
|
|
|
547
781
|
overlayStack = overlayStack.filter((m) => m !== modal);
|
|
548
782
|
};
|
|
549
783
|
}, [isOpen, onClose]);
|
|
550
|
-
return /* @__PURE__ */
|
|
784
|
+
return /* @__PURE__ */ jsx9(
|
|
551
785
|
Overlay,
|
|
552
786
|
{
|
|
553
787
|
isOpen,
|
|
554
788
|
onBackgroundClick: onClose,
|
|
555
789
|
backgroundClassName,
|
|
556
|
-
children: /* @__PURE__ */
|
|
790
|
+
children: /* @__PURE__ */ jsxs7(
|
|
557
791
|
"div",
|
|
558
792
|
{
|
|
559
793
|
ref,
|
|
560
794
|
tabIndex: -1,
|
|
561
|
-
className:
|
|
795
|
+
className: clsx8(
|
|
562
796
|
"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",
|
|
563
797
|
className
|
|
564
798
|
),
|
|
565
799
|
role: "dialog",
|
|
566
800
|
"aria-modal": true,
|
|
567
801
|
children: [
|
|
568
|
-
/* @__PURE__ */
|
|
802
|
+
/* @__PURE__ */ jsx9(OverlayHeader, { ...headerProps, onClose }),
|
|
569
803
|
children
|
|
570
804
|
]
|
|
571
805
|
}
|
|
@@ -575,7 +809,7 @@ var Modal = ({
|
|
|
575
809
|
};
|
|
576
810
|
|
|
577
811
|
// src/components/modals/LanguageModal.tsx
|
|
578
|
-
import { jsx as
|
|
812
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
579
813
|
var defaultLanguageModalTranslation = {
|
|
580
814
|
en: {
|
|
581
815
|
title: "Language",
|
|
@@ -598,7 +832,7 @@ var LanguageModal = ({
|
|
|
598
832
|
}) => {
|
|
599
833
|
const { language, setLanguage } = useLanguage();
|
|
600
834
|
const translation = useTranslation(defaultLanguageModalTranslation, overwriteTranslation);
|
|
601
|
-
return /* @__PURE__ */
|
|
835
|
+
return /* @__PURE__ */ jsx10(
|
|
602
836
|
Modal,
|
|
603
837
|
{
|
|
604
838
|
headerProps: {
|
|
@@ -608,8 +842,8 @@ var LanguageModal = ({
|
|
|
608
842
|
},
|
|
609
843
|
onClose,
|
|
610
844
|
...modalProps,
|
|
611
|
-
children: /* @__PURE__ */
|
|
612
|
-
/* @__PURE__ */
|
|
845
|
+
children: /* @__PURE__ */ jsxs8("div", { className: "w-64", children: [
|
|
846
|
+
/* @__PURE__ */ jsx10(
|
|
613
847
|
Select,
|
|
614
848
|
{
|
|
615
849
|
className: "mt-2",
|
|
@@ -618,7 +852,7 @@ var LanguageModal = ({
|
|
|
618
852
|
onChange: (language2) => setLanguage(language2)
|
|
619
853
|
}
|
|
620
854
|
),
|
|
621
|
-
/* @__PURE__ */
|
|
855
|
+
/* @__PURE__ */ jsx10("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ jsx10(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation.done }) })
|
|
622
856
|
] })
|
|
623
857
|
}
|
|
624
858
|
);
|