@helpwave/hightide 0.1.7-alpha.1 → 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 +20 -21
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +20 -21
- 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 +107 -23
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +107 -23
- 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.d.mts +1 -1
- package/dist/components/layout-and-navigation/StepperBar.d.ts +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 +4 -4
- package/dist/components/layout-and-navigation/Table.js.map +1 -1
- package/dist/components/layout-and-navigation/Table.mjs +4 -4
- 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 -151
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +383 -150
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +385 -155
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +382 -152
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js +6 -6
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +6 -6
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js +3 -3
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +3 -3
- 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 +484 -432
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +480 -428
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js +3 -3
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +3 -3
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js +3 -3
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +3 -3
- 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 -264
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +404 -264
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js +5 -5
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +5 -5
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/user-action/Checkbox.js +3 -3
- package/dist/components/user-action/Checkbox.js.map +1 -1
- package/dist/components/user-action/Checkbox.mjs +3 -3
- package/dist/components/user-action/Checkbox.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js +20 -21
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +20 -21
- 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/ScrollPicker.js +1 -1
- package/dist/components/user-action/ScrollPicker.js.map +1 -1
- package/dist/components/user-action/ScrollPicker.mjs +1 -1
- package/dist/components/user-action/ScrollPicker.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 -114
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +304 -108
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Textarea.js +2 -2
- package/dist/components/user-action/Textarea.js.map +1 -1
- package/dist/components/user-action/Textarea.mjs +2 -2
- package/dist/components/user-action/Textarea.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 +236 -219
- package/dist/css/uncompiled/globals.css +153 -77
- 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 +563 -471
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +525 -435
- 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
|
@@ -73,10 +73,9 @@ var useTranslation = (defaults, translationOverwrite = {}) => {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
// src/components/user-action/Select.tsx
|
|
76
|
-
var
|
|
77
|
-
var
|
|
78
|
-
var
|
|
79
|
-
var import_clsx3 = __toESM(require("clsx"));
|
|
76
|
+
var import_lucide_react3 = require("lucide-react");
|
|
77
|
+
var import_react7 = require("react");
|
|
78
|
+
var import_clsx6 = __toESM(require("clsx"));
|
|
80
79
|
|
|
81
80
|
// src/components/user-action/Label.tsx
|
|
82
81
|
var import_clsx = __toESM(require("clsx"));
|
|
@@ -96,15 +95,119 @@ var Label = ({
|
|
|
96
95
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
97
96
|
};
|
|
98
97
|
|
|
98
|
+
// src/components/layout-and-navigation/SearchableList.tsx
|
|
99
|
+
var import_lucide_react = require("lucide-react");
|
|
100
|
+
var import_clsx4 = __toESM(require("clsx"));
|
|
101
|
+
|
|
99
102
|
// src/components/user-action/Input.tsx
|
|
100
103
|
var import_react4 = require("react");
|
|
101
104
|
var import_clsx2 = __toESM(require("clsx"));
|
|
102
105
|
|
|
103
106
|
// src/hooks/useSaveDelay.ts
|
|
104
107
|
var import_react3 = require("react");
|
|
108
|
+
function useSaveDelay(setNotificationStatus, delay) {
|
|
109
|
+
const [updateTimer, setUpdateTimer] = (0, import_react3.useState)(void 0);
|
|
110
|
+
const [notificationTimer, setNotificationTimer] = (0, import_react3.useState)(void 0);
|
|
111
|
+
const restartTimer = (onSave) => {
|
|
112
|
+
clearTimeout(updateTimer);
|
|
113
|
+
setUpdateTimer(setTimeout(() => {
|
|
114
|
+
onSave();
|
|
115
|
+
setNotificationStatus(true);
|
|
116
|
+
clearTimeout(notificationTimer);
|
|
117
|
+
setNotificationTimer(setTimeout(() => {
|
|
118
|
+
setNotificationStatus(false);
|
|
119
|
+
clearTimeout(notificationTimer);
|
|
120
|
+
}, delay));
|
|
121
|
+
clearTimeout(updateTimer);
|
|
122
|
+
}, delay));
|
|
123
|
+
};
|
|
124
|
+
const clearUpdateTimer = (hasSaved = true) => {
|
|
125
|
+
clearTimeout(updateTimer);
|
|
126
|
+
if (hasSaved) {
|
|
127
|
+
setNotificationStatus(true);
|
|
128
|
+
clearTimeout(notificationTimer);
|
|
129
|
+
setNotificationTimer(setTimeout(() => {
|
|
130
|
+
setNotificationStatus(false);
|
|
131
|
+
clearTimeout(notificationTimer);
|
|
132
|
+
}, delay));
|
|
133
|
+
} else {
|
|
134
|
+
setNotificationStatus(false);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
(0, import_react3.useEffect)(() => {
|
|
138
|
+
return () => {
|
|
139
|
+
clearTimeout(updateTimer);
|
|
140
|
+
clearTimeout(notificationTimer);
|
|
141
|
+
};
|
|
142
|
+
}, []);
|
|
143
|
+
return { restartTimer, clearUpdateTimer };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// src/util/noop.ts
|
|
147
|
+
var noop = () => void 0;
|
|
105
148
|
|
|
106
149
|
// src/components/user-action/Input.tsx
|
|
107
150
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
151
|
+
var Input = ({
|
|
152
|
+
id,
|
|
153
|
+
type = "text",
|
|
154
|
+
value,
|
|
155
|
+
label,
|
|
156
|
+
onChange = noop,
|
|
157
|
+
onChangeText = noop,
|
|
158
|
+
onEditCompleted,
|
|
159
|
+
className = "",
|
|
160
|
+
expanded = true,
|
|
161
|
+
autoFocus,
|
|
162
|
+
onBlur,
|
|
163
|
+
containerClassName,
|
|
164
|
+
...restProps
|
|
165
|
+
}) => {
|
|
166
|
+
const {
|
|
167
|
+
restartTimer,
|
|
168
|
+
clearUpdateTimer
|
|
169
|
+
} = useSaveDelay(() => void 0, 3e3);
|
|
170
|
+
const ref = (0, import_react4.useRef)(null);
|
|
171
|
+
(0, import_react4.useEffect)(() => {
|
|
172
|
+
if (autoFocus) {
|
|
173
|
+
ref.current?.focus();
|
|
174
|
+
}
|
|
175
|
+
}, [autoFocus]);
|
|
176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)({ "w-full": expanded }, containerClassName), children: [
|
|
177
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx2.default)("mb-1", label.className) }),
|
|
178
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
179
|
+
"input",
|
|
180
|
+
{
|
|
181
|
+
ref,
|
|
182
|
+
value,
|
|
183
|
+
id,
|
|
184
|
+
type,
|
|
185
|
+
className,
|
|
186
|
+
onBlur: (event) => {
|
|
187
|
+
if (onBlur) {
|
|
188
|
+
onBlur(event);
|
|
189
|
+
}
|
|
190
|
+
if (onEditCompleted) {
|
|
191
|
+
onEditCompleted(event.target.value);
|
|
192
|
+
clearUpdateTimer();
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
onChange: (e) => {
|
|
196
|
+
const value2 = e.target.value;
|
|
197
|
+
if (onEditCompleted) {
|
|
198
|
+
restartTimer(() => {
|
|
199
|
+
onEditCompleted(value2);
|
|
200
|
+
clearUpdateTimer();
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
onChange(e);
|
|
204
|
+
onChangeText(value2);
|
|
205
|
+
},
|
|
206
|
+
...restProps
|
|
207
|
+
}
|
|
208
|
+
)
|
|
209
|
+
] });
|
|
210
|
+
};
|
|
108
211
|
var FormInput = (0, import_react4.forwardRef)(function FormInput2({
|
|
109
212
|
id,
|
|
110
213
|
labelText,
|
|
@@ -141,103 +244,9 @@ var FormInput = (0, import_react4.forwardRef)(function FormInput2({
|
|
|
141
244
|
] });
|
|
142
245
|
});
|
|
143
246
|
|
|
144
|
-
// src/components/user-action/Select.tsx
|
|
145
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
146
|
-
var Select = ({
|
|
147
|
-
value,
|
|
148
|
-
label,
|
|
149
|
-
options,
|
|
150
|
-
onChange,
|
|
151
|
-
isHidingCurrentValue = true,
|
|
152
|
-
hintText = "",
|
|
153
|
-
showDisabledOptions = true,
|
|
154
|
-
isDisabled,
|
|
155
|
-
className,
|
|
156
|
-
textColor = "text-menu-text",
|
|
157
|
-
hoverColor = "hover:brightness-90",
|
|
158
|
-
additionalItems,
|
|
159
|
-
selectedDisplayOverwrite
|
|
160
|
-
}) => {
|
|
161
|
-
let filteredOptions = isHidingCurrentValue ? options.filter((option) => option.value !== value) : options;
|
|
162
|
-
if (!showDisabledOptions) {
|
|
163
|
-
filteredOptions = filteredOptions.filter((value2) => !value2.disabled);
|
|
164
|
-
}
|
|
165
|
-
const selectedOption = options.find((option) => option.value === value);
|
|
166
|
-
if (value !== void 0 && selectedOption === void 0 && selectedDisplayOverwrite === void 0) {
|
|
167
|
-
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");
|
|
168
|
-
}
|
|
169
|
-
const borderColor = "border-menu-border";
|
|
170
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx3.default)(className), children: [
|
|
171
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Label, { ...label, labelType: label.labelType ?? "labelBig", className: (0, import_clsx3.default)("mb-1", label.className) }),
|
|
172
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react5.Menu, { as: "div", className: "relative text-menu-text", children: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
173
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
174
|
-
import_react5.Menu.Button,
|
|
175
|
-
{
|
|
176
|
-
className: (0, import_clsx3.default)(
|
|
177
|
-
"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",
|
|
178
|
-
textColor,
|
|
179
|
-
borderColor,
|
|
180
|
-
{
|
|
181
|
-
"rounded-b-lg": !open,
|
|
182
|
-
[hoverColor]: !isDisabled,
|
|
183
|
-
"bg-disabled-background cursor-not-allowed text-disabled": isDisabled
|
|
184
|
-
}
|
|
185
|
-
),
|
|
186
|
-
disabled: isDisabled,
|
|
187
|
-
children: [
|
|
188
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: selectedDisplayOverwrite ?? selectedOption?.label ?? hintText }),
|
|
189
|
-
open ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.ChevronUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.ChevronDown, {})
|
|
190
|
-
]
|
|
191
|
-
}
|
|
192
|
-
),
|
|
193
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
194
|
-
import_react5.Menu.Items,
|
|
195
|
-
{
|
|
196
|
-
className: "absolute w-full z-10 rounded-b-lg bg-menu-background text-menu-text shadow-lg max-h-[500px] overflow-y-auto",
|
|
197
|
-
children: [
|
|
198
|
-
(additionalItems ?? []).map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
199
|
-
"div",
|
|
200
|
-
{
|
|
201
|
-
className: (0, import_clsx3.default)(borderColor, "px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0", {
|
|
202
|
-
"border-b-0 rounded-b-lg": filteredOptions.length === 0 && index === (additionalItems?.length ?? 1) - 1
|
|
203
|
-
}),
|
|
204
|
-
children: item
|
|
205
|
-
},
|
|
206
|
-
`additionalItems${index}`
|
|
207
|
-
)),
|
|
208
|
-
filteredOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react5.Menu.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
209
|
-
"div",
|
|
210
|
-
{
|
|
211
|
-
className: (0, import_clsx3.default)(
|
|
212
|
-
"px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0 cursor-pointer",
|
|
213
|
-
option.className,
|
|
214
|
-
borderColor,
|
|
215
|
-
{
|
|
216
|
-
"brightness-90": option.value === value,
|
|
217
|
-
"brightness-95": index % 2 === 1,
|
|
218
|
-
"text-disabled bg-disabled-background cursor-not-allowed": !!option.disabled,
|
|
219
|
-
"bg-menu-background text-menu-text hover:brightness-90 cursor-pointer": !option.disabled,
|
|
220
|
-
"rounded-b-lg": index === filteredOptions.length - 1
|
|
221
|
-
}
|
|
222
|
-
),
|
|
223
|
-
onClick: () => {
|
|
224
|
-
if (!option.disabled) {
|
|
225
|
-
onChange(option.value);
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
children: option.label
|
|
229
|
-
}
|
|
230
|
-
) }, `item${index}`))
|
|
231
|
-
]
|
|
232
|
-
}
|
|
233
|
-
)
|
|
234
|
-
] }) })
|
|
235
|
-
] });
|
|
236
|
-
};
|
|
237
|
-
|
|
238
247
|
// src/components/user-action/Button.tsx
|
|
239
|
-
var
|
|
240
|
-
var
|
|
248
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
249
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
241
250
|
var paddingMapping = {
|
|
242
251
|
small: "btn-sm",
|
|
243
252
|
medium: "btn-md",
|
|
@@ -281,25 +290,25 @@ var SolidButton = ({
|
|
|
281
290
|
negative: "text-button-solid-negative-icon",
|
|
282
291
|
neutral: "text-button-solid-neutral-icon"
|
|
283
292
|
}[color];
|
|
284
|
-
return /* @__PURE__ */ (0,
|
|
293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
285
294
|
"button",
|
|
286
295
|
{
|
|
287
296
|
onClick: disabled ? void 0 : onClick,
|
|
288
297
|
disabled: disabled || onClick === void 0,
|
|
289
|
-
className: (0,
|
|
298
|
+
className: (0, import_clsx3.default)(
|
|
290
299
|
{
|
|
291
300
|
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
292
|
-
[(0,
|
|
301
|
+
[(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
293
302
|
},
|
|
294
303
|
ButtonUtil.paddingMapping[size],
|
|
295
304
|
className
|
|
296
305
|
),
|
|
297
306
|
...restProps,
|
|
298
307
|
children: [
|
|
299
|
-
startIcon && /* @__PURE__ */ (0,
|
|
308
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
300
309
|
"span",
|
|
301
310
|
{
|
|
302
|
-
className: (0,
|
|
311
|
+
className: (0, import_clsx3.default)({
|
|
303
312
|
[iconColorClasses]: !disabled,
|
|
304
313
|
[`text-disabled-icon`]: disabled
|
|
305
314
|
}),
|
|
@@ -307,10 +316,10 @@ var SolidButton = ({
|
|
|
307
316
|
}
|
|
308
317
|
),
|
|
309
318
|
children,
|
|
310
|
-
endIcon && /* @__PURE__ */ (0,
|
|
319
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
311
320
|
"span",
|
|
312
321
|
{
|
|
313
|
-
className: (0,
|
|
322
|
+
className: (0, import_clsx3.default)({
|
|
314
323
|
[iconColorClasses]: !disabled,
|
|
315
324
|
[`text-disabled-icon`]: disabled
|
|
316
325
|
}),
|
|
@@ -339,15 +348,15 @@ var IconButton = ({
|
|
|
339
348
|
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
340
349
|
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
341
350
|
}[color];
|
|
342
|
-
return /* @__PURE__ */ (0,
|
|
351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
343
352
|
"button",
|
|
344
353
|
{
|
|
345
354
|
onClick: disabled ? void 0 : onClick,
|
|
346
355
|
disabled: disabled || onClick === void 0,
|
|
347
|
-
className: (0,
|
|
356
|
+
className: (0, import_clsx3.default)(
|
|
348
357
|
{
|
|
349
358
|
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
350
|
-
[(0,
|
|
359
|
+
[(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
351
360
|
},
|
|
352
361
|
ButtonUtil.iconPaddingMapping[size],
|
|
353
362
|
className
|
|
@@ -358,21 +367,245 @@ var IconButton = ({
|
|
|
358
367
|
);
|
|
359
368
|
};
|
|
360
369
|
|
|
370
|
+
// src/hooks/useSearch.ts
|
|
371
|
+
var import_react5 = require("react");
|
|
372
|
+
|
|
373
|
+
// src/util/simpleSearch.ts
|
|
374
|
+
var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
375
|
+
return objects.filter((object) => {
|
|
376
|
+
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
377
|
+
if (!mappedSearchKeywords) {
|
|
378
|
+
return true;
|
|
379
|
+
}
|
|
380
|
+
return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
|
|
381
|
+
});
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
// src/hooks/useSearch.ts
|
|
385
|
+
var useSearch = ({
|
|
386
|
+
list,
|
|
387
|
+
initialSearch,
|
|
388
|
+
searchMapping
|
|
389
|
+
}) => {
|
|
390
|
+
const [items, setItems] = (0, import_react5.useState)(list);
|
|
391
|
+
const [search, setSearch] = (0, import_react5.useState)(initialSearch);
|
|
392
|
+
(0, import_react5.useEffect)(() => {
|
|
393
|
+
setItems(list);
|
|
394
|
+
}, [list]);
|
|
395
|
+
const result = (0, import_react5.useMemo)(
|
|
396
|
+
() => MultiSearchWithMapping(search, items, searchMapping),
|
|
397
|
+
[search, items, searchMapping]
|
|
398
|
+
);
|
|
399
|
+
return {
|
|
400
|
+
result,
|
|
401
|
+
hasResult: result.length > 0,
|
|
402
|
+
allItems: items,
|
|
403
|
+
setItems,
|
|
404
|
+
search,
|
|
405
|
+
setSearch
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
// src/components/layout-and-navigation/SearchableList.tsx
|
|
410
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
411
|
+
var defaultSearchableListTranslation = {
|
|
412
|
+
en: {
|
|
413
|
+
search: "Search",
|
|
414
|
+
nothingFound: "Nothing found"
|
|
415
|
+
},
|
|
416
|
+
de: {
|
|
417
|
+
search: "Suche",
|
|
418
|
+
nothingFound: "Nichts gefunden"
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
var SearchableList = ({
|
|
422
|
+
overwriteTranslation,
|
|
423
|
+
list,
|
|
424
|
+
initialSearch = "",
|
|
425
|
+
searchMapping,
|
|
426
|
+
autoFocus,
|
|
427
|
+
minimumItemsForSearch = 6,
|
|
428
|
+
itemMapper,
|
|
429
|
+
className,
|
|
430
|
+
resultListClassName
|
|
431
|
+
}) => {
|
|
432
|
+
const translation = useTranslation(defaultSearchableListTranslation, overwriteTranslation);
|
|
433
|
+
const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
|
|
434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("col gap-y-2", className), children: [
|
|
435
|
+
list.length > minimumItemsForSearch && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "row justify-between gap-x-4 items-center", children: [
|
|
436
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
437
|
+
Input,
|
|
438
|
+
{
|
|
439
|
+
value: search,
|
|
440
|
+
onChangeText: setSearch,
|
|
441
|
+
placeholder: translation.search,
|
|
442
|
+
autoFocus,
|
|
443
|
+
className: "w-full"
|
|
444
|
+
}
|
|
445
|
+
),
|
|
446
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconButton, { color: "neutral", disabled: search.length === 0, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Search, { className: "w-full h-full" }) })
|
|
447
|
+
] }),
|
|
448
|
+
hasResult ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_clsx4.default)("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "row text-description py-2 px-2", children: translation.nothingFound })
|
|
449
|
+
] });
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
453
|
+
var import_clsx5 = __toESM(require("clsx"));
|
|
454
|
+
var import_lucide_react2 = require("lucide-react");
|
|
455
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
456
|
+
var Tile = ({
|
|
457
|
+
title,
|
|
458
|
+
description,
|
|
459
|
+
onClick,
|
|
460
|
+
isSelected = false,
|
|
461
|
+
isDisabled = false,
|
|
462
|
+
prefix,
|
|
463
|
+
suffix,
|
|
464
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
465
|
+
selectedClassName = " bg-primary/20",
|
|
466
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
467
|
+
className
|
|
468
|
+
}) => {
|
|
469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
470
|
+
"div",
|
|
471
|
+
{
|
|
472
|
+
className: (0, import_clsx5.default)(
|
|
473
|
+
"row gap-x-2 w-full items-center",
|
|
474
|
+
{
|
|
475
|
+
[normalClassName]: !!onClick && !isDisabled,
|
|
476
|
+
[selectedClassName]: isSelected && !isDisabled,
|
|
477
|
+
[disabledClassName]: isDisabled
|
|
478
|
+
},
|
|
479
|
+
className
|
|
480
|
+
),
|
|
481
|
+
onClick: isDisabled ? void 0 : onClick,
|
|
482
|
+
children: [
|
|
483
|
+
prefix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Check, { size: 24 }) : void 0),
|
|
484
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "col gap-y-0 w-full", children: [
|
|
485
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h4", { className: (0, import_clsx5.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
|
|
486
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: (0, import_clsx5.default)(description.className ?? "textstyle-description"), children: description.value })
|
|
487
|
+
] }),
|
|
488
|
+
suffix
|
|
489
|
+
]
|
|
490
|
+
}
|
|
491
|
+
);
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
// src/hooks/useOutsideClick.ts
|
|
495
|
+
var import_react6 = require("react");
|
|
496
|
+
var useOutsideClick = (refs, handler) => {
|
|
497
|
+
(0, import_react6.useEffect)(() => {
|
|
498
|
+
const listener = (event) => {
|
|
499
|
+
if (event.target === null) return;
|
|
500
|
+
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
handler();
|
|
504
|
+
};
|
|
505
|
+
document.addEventListener("mousedown", listener);
|
|
506
|
+
document.addEventListener("touchstart", listener);
|
|
507
|
+
return () => {
|
|
508
|
+
document.removeEventListener("mousedown", listener);
|
|
509
|
+
document.removeEventListener("touchstart", listener);
|
|
510
|
+
};
|
|
511
|
+
}, [refs, handler]);
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
// src/components/user-action/Select.tsx
|
|
515
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
516
|
+
var Select = ({
|
|
517
|
+
value,
|
|
518
|
+
label,
|
|
519
|
+
options,
|
|
520
|
+
onChange,
|
|
521
|
+
hintText = "",
|
|
522
|
+
isDisabled,
|
|
523
|
+
isSearchEnabled = false,
|
|
524
|
+
className,
|
|
525
|
+
selectedDisplayOverwrite
|
|
526
|
+
}) => {
|
|
527
|
+
const triggerRef = (0, import_react7.useRef)(null);
|
|
528
|
+
const menuRef = (0, import_react7.useRef)(null);
|
|
529
|
+
const [isOpen, setIsOpen] = (0, import_react7.useState)(false);
|
|
530
|
+
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
531
|
+
const selectedOption = options.find((option) => option.value === value);
|
|
532
|
+
if (value !== void 0 && selectedOption === void 0 && selectedDisplayOverwrite === void 0) {
|
|
533
|
+
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");
|
|
534
|
+
}
|
|
535
|
+
const isShowingHint = !selectedDisplayOverwrite && !selectedOption?.label;
|
|
536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_clsx6.default)(className), children: [
|
|
537
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Label, { ...label, labelType: label.labelType ?? "labelBig", className: (0, import_clsx6.default)("mb-1", label.className) }),
|
|
538
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative", children: [
|
|
539
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
540
|
+
"button",
|
|
541
|
+
{
|
|
542
|
+
ref: triggerRef,
|
|
543
|
+
className: (0, import_clsx6.default)(
|
|
544
|
+
"btn-md justify-between w-full border-2",
|
|
545
|
+
{
|
|
546
|
+
"rounded-b-lg": !open,
|
|
547
|
+
"bg-menu-background border-menu-border hover:border-primary": !isDisabled,
|
|
548
|
+
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": isDisabled
|
|
549
|
+
}
|
|
550
|
+
),
|
|
551
|
+
onClick: () => setIsOpen(!isOpen),
|
|
552
|
+
disabled: isDisabled,
|
|
553
|
+
children: [
|
|
554
|
+
!isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? selectedOption?.label }),
|
|
555
|
+
isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "textstyle-description", children: hintText }),
|
|
556
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.ChevronUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.ChevronDown, {})
|
|
557
|
+
]
|
|
558
|
+
}
|
|
559
|
+
),
|
|
560
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
561
|
+
"div",
|
|
562
|
+
{
|
|
563
|
+
ref: menuRef,
|
|
564
|
+
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",
|
|
565
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
566
|
+
SearchableList,
|
|
567
|
+
{
|
|
568
|
+
list: options,
|
|
569
|
+
minimumItemsForSearch: isSearchEnabled ? void 0 : options.length,
|
|
570
|
+
searchMapping: (item) => item.searchTags,
|
|
571
|
+
itemMapper: (option, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
572
|
+
Tile,
|
|
573
|
+
{
|
|
574
|
+
isSelected: selectedOption?.value === option.value,
|
|
575
|
+
className: "px-2 py-1 rounded-md",
|
|
576
|
+
disabledClassName: "text-disabled-text cursor-not-allowed",
|
|
577
|
+
title: { value: option.label, className: "font-semibold" },
|
|
578
|
+
onClick: () => {
|
|
579
|
+
onChange(option.value);
|
|
580
|
+
setIsOpen(false);
|
|
581
|
+
},
|
|
582
|
+
isDisabled: option.disabled
|
|
583
|
+
},
|
|
584
|
+
index
|
|
585
|
+
)
|
|
586
|
+
}
|
|
587
|
+
)
|
|
588
|
+
}
|
|
589
|
+
)
|
|
590
|
+
] })
|
|
591
|
+
] });
|
|
592
|
+
};
|
|
593
|
+
|
|
361
594
|
// src/components/layout-and-navigation/Overlay.tsx
|
|
362
|
-
var
|
|
595
|
+
var import_react9 = require("react");
|
|
363
596
|
var import_react_dom = __toESM(require("react-dom"));
|
|
364
|
-
var
|
|
597
|
+
var import_clsx8 = __toESM(require("clsx"));
|
|
365
598
|
|
|
366
599
|
// src/hooks/useHoverState.ts
|
|
367
|
-
var
|
|
600
|
+
var import_react8 = require("react");
|
|
368
601
|
var defaultUseHoverStateProps = {
|
|
369
602
|
closingDelay: 200,
|
|
370
603
|
isDisabled: false
|
|
371
604
|
};
|
|
372
605
|
var useHoverState = (props = void 0) => {
|
|
373
606
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
374
|
-
const [isHovered, setIsHovered] = (0,
|
|
375
|
-
const [timer, setTimer] = (0,
|
|
607
|
+
const [isHovered, setIsHovered] = (0, import_react8.useState)(false);
|
|
608
|
+
const [timer, setTimer] = (0, import_react8.useState)();
|
|
376
609
|
const onMouseEnter = () => {
|
|
377
610
|
if (isDisabled) {
|
|
378
611
|
return;
|
|
@@ -388,14 +621,14 @@ var useHoverState = (props = void 0) => {
|
|
|
388
621
|
setIsHovered(false);
|
|
389
622
|
}, closingDelay));
|
|
390
623
|
};
|
|
391
|
-
(0,
|
|
624
|
+
(0, import_react8.useEffect)(() => {
|
|
392
625
|
if (timer) {
|
|
393
626
|
return () => {
|
|
394
627
|
clearTimeout(timer);
|
|
395
628
|
};
|
|
396
629
|
}
|
|
397
630
|
});
|
|
398
|
-
(0,
|
|
631
|
+
(0, import_react8.useEffect)(() => {
|
|
399
632
|
if (timer) {
|
|
400
633
|
clearTimeout(timer);
|
|
401
634
|
}
|
|
@@ -408,8 +641,8 @@ var useHoverState = (props = void 0) => {
|
|
|
408
641
|
};
|
|
409
642
|
|
|
410
643
|
// src/components/user-action/Tooltip.tsx
|
|
411
|
-
var
|
|
412
|
-
var
|
|
644
|
+
var import_clsx7 = require("clsx");
|
|
645
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
413
646
|
var Tooltip = ({
|
|
414
647
|
tooltip,
|
|
415
648
|
children,
|
|
@@ -439,30 +672,30 @@ var Tooltip = ({
|
|
|
439
672
|
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
440
673
|
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
441
674
|
};
|
|
442
|
-
return /* @__PURE__ */ (0,
|
|
675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
443
676
|
"div",
|
|
444
677
|
{
|
|
445
|
-
className: (0,
|
|
678
|
+
className: (0, import_clsx7.clsx)("relative inline-block", containerClassName),
|
|
446
679
|
...handlers,
|
|
447
680
|
children: [
|
|
448
681
|
children,
|
|
449
|
-
isHovered && /* @__PURE__ */ (0,
|
|
682
|
+
isHovered && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
450
683
|
"div",
|
|
451
684
|
{
|
|
452
|
-
className: (0,
|
|
685
|
+
className: (0, import_clsx7.clsx)(
|
|
453
686
|
`opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
|
|
454
|
-
animate-tooltip-fade-in shadow-
|
|
687
|
+
animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,
|
|
455
688
|
positionClasses[position],
|
|
456
689
|
tooltipClassName
|
|
457
690
|
),
|
|
458
691
|
style: { zIndex, animationDelay: animationDelay + "ms" },
|
|
459
692
|
children: [
|
|
460
693
|
tooltip,
|
|
461
|
-
/* @__PURE__ */ (0,
|
|
694
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
462
695
|
"div",
|
|
463
696
|
{
|
|
464
|
-
className: (0,
|
|
465
|
-
style: { ...triangleStyle[position], zIndex }
|
|
697
|
+
className: (0, import_clsx7.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
|
|
698
|
+
style: { ...triangleStyle[position], zIndex: zIndex + 1 }
|
|
466
699
|
}
|
|
467
700
|
)
|
|
468
701
|
]
|
|
@@ -474,25 +707,25 @@ var Tooltip = ({
|
|
|
474
707
|
};
|
|
475
708
|
|
|
476
709
|
// src/components/layout-and-navigation/Overlay.tsx
|
|
477
|
-
var
|
|
478
|
-
var
|
|
710
|
+
var import_lucide_react4 = require("lucide-react");
|
|
711
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
479
712
|
var Overlay = ({
|
|
480
713
|
children,
|
|
481
714
|
isOpen,
|
|
482
715
|
onBackgroundClick,
|
|
483
716
|
backgroundClassName
|
|
484
717
|
}) => {
|
|
485
|
-
const [root, setRoot] = (0,
|
|
486
|
-
(0,
|
|
718
|
+
const [root, setRoot] = (0, import_react9.useState)();
|
|
719
|
+
(0, import_react9.useEffect)(() => {
|
|
487
720
|
setRoot(document.body);
|
|
488
721
|
}, []);
|
|
489
722
|
if (!root || !isOpen) return null;
|
|
490
723
|
return import_react_dom.default.createPortal(
|
|
491
|
-
/* @__PURE__ */ (0,
|
|
492
|
-
/* @__PURE__ */ (0,
|
|
724
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_clsx8.default)("fixed inset-0 z-[9999]"), children: [
|
|
725
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
493
726
|
"div",
|
|
494
727
|
{
|
|
495
|
-
className: (0,
|
|
728
|
+
className: (0, import_clsx8.default)("fixed inset-0 h-screen w-screen bg-black/30", backgroundClassName),
|
|
496
729
|
onClick: onBackgroundClick
|
|
497
730
|
}
|
|
498
731
|
),
|
|
@@ -520,21 +753,21 @@ var OverlayHeader = ({
|
|
|
520
753
|
}) => {
|
|
521
754
|
const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation);
|
|
522
755
|
const hasTitleRow = !!title || !!titleText || !!onClose;
|
|
523
|
-
const titleRow = /* @__PURE__ */ (0,
|
|
524
|
-
title ?? /* @__PURE__ */ (0,
|
|
756
|
+
const titleRow = /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "row justify-between items-start gap-x-8", children: [
|
|
757
|
+
title ?? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
525
758
|
"h2",
|
|
526
759
|
{
|
|
527
|
-
className: (0,
|
|
760
|
+
className: (0, import_clsx8.default)("textstyle-title-lg", {
|
|
528
761
|
"mb-1": description || descriptionText
|
|
529
762
|
}),
|
|
530
763
|
children: titleText
|
|
531
764
|
}
|
|
532
765
|
),
|
|
533
|
-
!!onClose && /* @__PURE__ */ (0,
|
|
766
|
+
!!onClose && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Tooltip, { tooltip: translation.close, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconButton, { color: "neutral", size: "small", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.X, { className: "w-full h-full" }) }) })
|
|
534
767
|
] });
|
|
535
|
-
return /* @__PURE__ */ (0,
|
|
768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "col", children: [
|
|
536
769
|
hasTitleRow && titleRow,
|
|
537
|
-
description ?? (descriptionText && /* @__PURE__ */ (0,
|
|
770
|
+
description ?? (descriptionText && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "textstyle-description", children: descriptionText }))
|
|
538
771
|
] });
|
|
539
772
|
};
|
|
540
773
|
var Modal = ({
|
|
@@ -545,8 +778,8 @@ var Modal = ({
|
|
|
545
778
|
backgroundClassName,
|
|
546
779
|
headerProps
|
|
547
780
|
}) => {
|
|
548
|
-
const ref = (0,
|
|
549
|
-
(0,
|
|
781
|
+
const ref = (0, import_react9.useRef)(null);
|
|
782
|
+
(0, import_react9.useEffect)(() => {
|
|
550
783
|
if (!isOpen) return;
|
|
551
784
|
const modal = ref.current;
|
|
552
785
|
if (!modal) {
|
|
@@ -583,25 +816,25 @@ var Modal = ({
|
|
|
583
816
|
overlayStack = overlayStack.filter((m) => m !== modal);
|
|
584
817
|
};
|
|
585
818
|
}, [isOpen, onClose]);
|
|
586
|
-
return /* @__PURE__ */ (0,
|
|
819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
587
820
|
Overlay,
|
|
588
821
|
{
|
|
589
822
|
isOpen,
|
|
590
823
|
onBackgroundClick: onClose,
|
|
591
824
|
backgroundClassName,
|
|
592
|
-
children: /* @__PURE__ */ (0,
|
|
825
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
593
826
|
"div",
|
|
594
827
|
{
|
|
595
828
|
ref,
|
|
596
829
|
tabIndex: -1,
|
|
597
|
-
className: (0,
|
|
830
|
+
className: (0, import_clsx8.default)(
|
|
598
831
|
"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",
|
|
599
832
|
className
|
|
600
833
|
),
|
|
601
834
|
role: "dialog",
|
|
602
835
|
"aria-modal": true,
|
|
603
836
|
children: [
|
|
604
|
-
/* @__PURE__ */ (0,
|
|
837
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(OverlayHeader, { ...headerProps, onClose }),
|
|
605
838
|
children
|
|
606
839
|
]
|
|
607
840
|
}
|
|
@@ -611,7 +844,7 @@ var Modal = ({
|
|
|
611
844
|
};
|
|
612
845
|
|
|
613
846
|
// src/components/modals/LanguageModal.tsx
|
|
614
|
-
var
|
|
847
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
615
848
|
var defaultLanguageModalTranslation = {
|
|
616
849
|
en: {
|
|
617
850
|
title: "Language",
|
|
@@ -634,7 +867,7 @@ var LanguageModal = ({
|
|
|
634
867
|
}) => {
|
|
635
868
|
const { language, setLanguage } = useLanguage();
|
|
636
869
|
const translation = useTranslation(defaultLanguageModalTranslation, overwriteTranslation);
|
|
637
|
-
return /* @__PURE__ */ (0,
|
|
870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
638
871
|
Modal,
|
|
639
872
|
{
|
|
640
873
|
headerProps: {
|
|
@@ -644,8 +877,8 @@ var LanguageModal = ({
|
|
|
644
877
|
},
|
|
645
878
|
onClose,
|
|
646
879
|
...modalProps,
|
|
647
|
-
children: /* @__PURE__ */ (0,
|
|
648
|
-
/* @__PURE__ */ (0,
|
|
880
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w-64", children: [
|
|
881
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
649
882
|
Select,
|
|
650
883
|
{
|
|
651
884
|
className: "mt-2",
|
|
@@ -654,7 +887,7 @@ var LanguageModal = ({
|
|
|
654
887
|
onChange: (language2) => setLanguage(language2)
|
|
655
888
|
}
|
|
656
889
|
),
|
|
657
|
-
/* @__PURE__ */ (0,
|
|
890
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation.done }) })
|
|
658
891
|
] })
|
|
659
892
|
}
|
|
660
893
|
);
|