@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
|
@@ -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,18 +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
|
+
}
|
|
70
110
|
|
|
71
111
|
// src/util/noop.ts
|
|
72
112
|
var noop = () => void 0;
|
|
73
113
|
|
|
74
114
|
// src/components/user-action/Input.tsx
|
|
75
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
|
+
};
|
|
76
176
|
var FormInput = forwardRef(function FormInput2({
|
|
77
177
|
id,
|
|
78
178
|
labelText,
|
|
@@ -109,103 +209,9 @@ var FormInput = forwardRef(function FormInput2({
|
|
|
109
209
|
] });
|
|
110
210
|
});
|
|
111
211
|
|
|
112
|
-
// src/components/user-action/Select.tsx
|
|
113
|
-
import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
114
|
-
var Select = ({
|
|
115
|
-
value,
|
|
116
|
-
label,
|
|
117
|
-
options,
|
|
118
|
-
onChange,
|
|
119
|
-
isHidingCurrentValue = true,
|
|
120
|
-
hintText = "",
|
|
121
|
-
showDisabledOptions = true,
|
|
122
|
-
isDisabled,
|
|
123
|
-
className,
|
|
124
|
-
textColor = "text-menu-text",
|
|
125
|
-
hoverColor = "hover:brightness-90",
|
|
126
|
-
additionalItems,
|
|
127
|
-
selectedDisplayOverwrite
|
|
128
|
-
}) => {
|
|
129
|
-
let filteredOptions = isHidingCurrentValue ? options.filter((option) => option.value !== value) : options;
|
|
130
|
-
if (!showDisabledOptions) {
|
|
131
|
-
filteredOptions = filteredOptions.filter((value2) => !value2.disabled);
|
|
132
|
-
}
|
|
133
|
-
const selectedOption = options.find((option) => option.value === value);
|
|
134
|
-
if (value !== void 0 && selectedOption === void 0 && selectedDisplayOverwrite === void 0) {
|
|
135
|
-
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");
|
|
136
|
-
}
|
|
137
|
-
const borderColor = "border-menu-border";
|
|
138
|
-
return /* @__PURE__ */ jsxs2("div", { className: clsx3(className), children: [
|
|
139
|
-
label && /* @__PURE__ */ jsx4(Label, { ...label, labelType: label.labelType ?? "labelBig", className: clsx3("mb-1", label.className) }),
|
|
140
|
-
/* @__PURE__ */ jsx4(Menu, { as: "div", className: "relative text-menu-text", children: ({ open }) => /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
141
|
-
/* @__PURE__ */ jsxs2(
|
|
142
|
-
Menu.Button,
|
|
143
|
-
{
|
|
144
|
-
className: clsx3(
|
|
145
|
-
"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",
|
|
146
|
-
textColor,
|
|
147
|
-
borderColor,
|
|
148
|
-
{
|
|
149
|
-
"rounded-b-lg": !open,
|
|
150
|
-
[hoverColor]: !isDisabled,
|
|
151
|
-
"bg-disabled-background cursor-not-allowed text-disabled": isDisabled
|
|
152
|
-
}
|
|
153
|
-
),
|
|
154
|
-
disabled: isDisabled,
|
|
155
|
-
children: [
|
|
156
|
-
/* @__PURE__ */ jsx4("span", { children: selectedDisplayOverwrite ?? selectedOption?.label ?? hintText }),
|
|
157
|
-
open ? /* @__PURE__ */ jsx4(ChevronUp, {}) : /* @__PURE__ */ jsx4(ChevronDown, {})
|
|
158
|
-
]
|
|
159
|
-
}
|
|
160
|
-
),
|
|
161
|
-
/* @__PURE__ */ jsxs2(
|
|
162
|
-
Menu.Items,
|
|
163
|
-
{
|
|
164
|
-
className: "absolute w-full z-10 rounded-b-lg bg-menu-background text-menu-text shadow-lg max-h-[500px] overflow-y-auto",
|
|
165
|
-
children: [
|
|
166
|
-
(additionalItems ?? []).map((item, index) => /* @__PURE__ */ jsx4(
|
|
167
|
-
"div",
|
|
168
|
-
{
|
|
169
|
-
className: clsx3(borderColor, "px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0", {
|
|
170
|
-
"border-b-0 rounded-b-lg": filteredOptions.length === 0 && index === (additionalItems?.length ?? 1) - 1
|
|
171
|
-
}),
|
|
172
|
-
children: item
|
|
173
|
-
},
|
|
174
|
-
`additionalItems${index}`
|
|
175
|
-
)),
|
|
176
|
-
filteredOptions.map((option, index) => /* @__PURE__ */ jsx4(Menu.Item, { children: /* @__PURE__ */ jsx4(
|
|
177
|
-
"div",
|
|
178
|
-
{
|
|
179
|
-
className: clsx3(
|
|
180
|
-
"px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0 cursor-pointer",
|
|
181
|
-
option.className,
|
|
182
|
-
borderColor,
|
|
183
|
-
{
|
|
184
|
-
"brightness-90": option.value === value,
|
|
185
|
-
"brightness-95": index % 2 === 1,
|
|
186
|
-
"text-disabled bg-disabled-background cursor-not-allowed": !!option.disabled,
|
|
187
|
-
"bg-menu-background text-menu-text hover:brightness-90 cursor-pointer": !option.disabled,
|
|
188
|
-
"rounded-b-lg": index === filteredOptions.length - 1
|
|
189
|
-
}
|
|
190
|
-
),
|
|
191
|
-
onClick: () => {
|
|
192
|
-
if (!option.disabled) {
|
|
193
|
-
onChange(option.value);
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
children: option.label
|
|
197
|
-
}
|
|
198
|
-
) }, `item${index}`))
|
|
199
|
-
]
|
|
200
|
-
}
|
|
201
|
-
)
|
|
202
|
-
] }) })
|
|
203
|
-
] });
|
|
204
|
-
};
|
|
205
|
-
|
|
206
212
|
// src/components/user-action/Button.tsx
|
|
207
|
-
import
|
|
208
|
-
import { jsx as
|
|
213
|
+
import clsx3 from "clsx";
|
|
214
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
209
215
|
var paddingMapping = {
|
|
210
216
|
small: "btn-sm",
|
|
211
217
|
medium: "btn-md",
|
|
@@ -249,25 +255,25 @@ var SolidButton = ({
|
|
|
249
255
|
negative: "text-button-solid-negative-icon",
|
|
250
256
|
neutral: "text-button-solid-neutral-icon"
|
|
251
257
|
}[color];
|
|
252
|
-
return /* @__PURE__ */
|
|
258
|
+
return /* @__PURE__ */ jsxs2(
|
|
253
259
|
"button",
|
|
254
260
|
{
|
|
255
261
|
onClick: disabled ? void 0 : onClick,
|
|
256
262
|
disabled: disabled || onClick === void 0,
|
|
257
|
-
className:
|
|
263
|
+
className: clsx3(
|
|
258
264
|
{
|
|
259
265
|
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
260
|
-
[
|
|
266
|
+
[clsx3(colorClasses, "hover:brightness-90")]: !disabled
|
|
261
267
|
},
|
|
262
268
|
ButtonUtil.paddingMapping[size],
|
|
263
269
|
className
|
|
264
270
|
),
|
|
265
271
|
...restProps,
|
|
266
272
|
children: [
|
|
267
|
-
startIcon && /* @__PURE__ */
|
|
273
|
+
startIcon && /* @__PURE__ */ jsx4(
|
|
268
274
|
"span",
|
|
269
275
|
{
|
|
270
|
-
className:
|
|
276
|
+
className: clsx3({
|
|
271
277
|
[iconColorClasses]: !disabled,
|
|
272
278
|
[`text-disabled-icon`]: disabled
|
|
273
279
|
}),
|
|
@@ -275,10 +281,10 @@ var SolidButton = ({
|
|
|
275
281
|
}
|
|
276
282
|
),
|
|
277
283
|
children,
|
|
278
|
-
endIcon && /* @__PURE__ */
|
|
284
|
+
endIcon && /* @__PURE__ */ jsx4(
|
|
279
285
|
"span",
|
|
280
286
|
{
|
|
281
|
-
className:
|
|
287
|
+
className: clsx3({
|
|
282
288
|
[iconColorClasses]: !disabled,
|
|
283
289
|
[`text-disabled-icon`]: disabled
|
|
284
290
|
}),
|
|
@@ -307,15 +313,15 @@ var IconButton = ({
|
|
|
307
313
|
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
308
314
|
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
309
315
|
}[color];
|
|
310
|
-
return /* @__PURE__ */
|
|
316
|
+
return /* @__PURE__ */ jsx4(
|
|
311
317
|
"button",
|
|
312
318
|
{
|
|
313
319
|
onClick: disabled ? void 0 : onClick,
|
|
314
320
|
disabled: disabled || onClick === void 0,
|
|
315
|
-
className:
|
|
321
|
+
className: clsx3(
|
|
316
322
|
{
|
|
317
323
|
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
318
|
-
[
|
|
324
|
+
[clsx3(colorClasses, "hover:brightness-90")]: !disabled
|
|
319
325
|
},
|
|
320
326
|
ButtonUtil.iconPaddingMapping[size],
|
|
321
327
|
className
|
|
@@ -326,21 +332,245 @@ var IconButton = ({
|
|
|
326
332
|
);
|
|
327
333
|
};
|
|
328
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
|
+
|
|
329
559
|
// src/components/layout-and-navigation/Overlay.tsx
|
|
330
|
-
import { useEffect as
|
|
560
|
+
import { useEffect as useEffect9, useRef as useRef3, useState as useState8 } from "react";
|
|
331
561
|
import ReactDOM from "react-dom";
|
|
332
|
-
import
|
|
562
|
+
import clsx8 from "clsx";
|
|
333
563
|
|
|
334
564
|
// src/hooks/useHoverState.ts
|
|
335
|
-
import { useEffect as
|
|
565
|
+
import { useEffect as useEffect8, useState as useState7 } from "react";
|
|
336
566
|
var defaultUseHoverStateProps = {
|
|
337
567
|
closingDelay: 200,
|
|
338
568
|
isDisabled: false
|
|
339
569
|
};
|
|
340
570
|
var useHoverState = (props = void 0) => {
|
|
341
571
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
342
|
-
const [isHovered, setIsHovered] =
|
|
343
|
-
const [timer, setTimer] =
|
|
572
|
+
const [isHovered, setIsHovered] = useState7(false);
|
|
573
|
+
const [timer, setTimer] = useState7();
|
|
344
574
|
const onMouseEnter = () => {
|
|
345
575
|
if (isDisabled) {
|
|
346
576
|
return;
|
|
@@ -356,14 +586,14 @@ var useHoverState = (props = void 0) => {
|
|
|
356
586
|
setIsHovered(false);
|
|
357
587
|
}, closingDelay));
|
|
358
588
|
};
|
|
359
|
-
|
|
589
|
+
useEffect8(() => {
|
|
360
590
|
if (timer) {
|
|
361
591
|
return () => {
|
|
362
592
|
clearTimeout(timer);
|
|
363
593
|
};
|
|
364
594
|
}
|
|
365
595
|
});
|
|
366
|
-
|
|
596
|
+
useEffect8(() => {
|
|
367
597
|
if (timer) {
|
|
368
598
|
clearTimeout(timer);
|
|
369
599
|
}
|
|
@@ -376,8 +606,8 @@ var useHoverState = (props = void 0) => {
|
|
|
376
606
|
};
|
|
377
607
|
|
|
378
608
|
// src/components/user-action/Tooltip.tsx
|
|
379
|
-
import { clsx as
|
|
380
|
-
import { jsx as
|
|
609
|
+
import { clsx as clsx7 } from "clsx";
|
|
610
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
381
611
|
var Tooltip = ({
|
|
382
612
|
tooltip,
|
|
383
613
|
children,
|
|
@@ -407,30 +637,30 @@ var Tooltip = ({
|
|
|
407
637
|
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
408
638
|
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
409
639
|
};
|
|
410
|
-
return /* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ jsxs6(
|
|
411
641
|
"div",
|
|
412
642
|
{
|
|
413
|
-
className:
|
|
643
|
+
className: clsx7("relative inline-block", containerClassName),
|
|
414
644
|
...handlers,
|
|
415
645
|
children: [
|
|
416
646
|
children,
|
|
417
|
-
isHovered && /* @__PURE__ */
|
|
647
|
+
isHovered && /* @__PURE__ */ jsxs6(
|
|
418
648
|
"div",
|
|
419
649
|
{
|
|
420
|
-
className:
|
|
650
|
+
className: clsx7(
|
|
421
651
|
`opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
|
|
422
|
-
animate-tooltip-fade-in shadow-
|
|
652
|
+
animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,
|
|
423
653
|
positionClasses[position],
|
|
424
654
|
tooltipClassName
|
|
425
655
|
),
|
|
426
656
|
style: { zIndex, animationDelay: animationDelay + "ms" },
|
|
427
657
|
children: [
|
|
428
658
|
tooltip,
|
|
429
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ jsx8(
|
|
430
660
|
"div",
|
|
431
661
|
{
|
|
432
|
-
className:
|
|
433
|
-
style: { ...triangleStyle[position], zIndex }
|
|
662
|
+
className: clsx7(`absolute w-0 h-0`, triangleClasses[position]),
|
|
663
|
+
style: { ...triangleStyle[position], zIndex: zIndex + 1 }
|
|
434
664
|
}
|
|
435
665
|
)
|
|
436
666
|
]
|
|
@@ -443,24 +673,24 @@ var Tooltip = ({
|
|
|
443
673
|
|
|
444
674
|
// src/components/layout-and-navigation/Overlay.tsx
|
|
445
675
|
import { X } from "lucide-react";
|
|
446
|
-
import { jsx as
|
|
676
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
447
677
|
var Overlay = ({
|
|
448
678
|
children,
|
|
449
679
|
isOpen,
|
|
450
680
|
onBackgroundClick,
|
|
451
681
|
backgroundClassName
|
|
452
682
|
}) => {
|
|
453
|
-
const [root, setRoot] =
|
|
454
|
-
|
|
683
|
+
const [root, setRoot] = useState8();
|
|
684
|
+
useEffect9(() => {
|
|
455
685
|
setRoot(document.body);
|
|
456
686
|
}, []);
|
|
457
687
|
if (!root || !isOpen) return null;
|
|
458
688
|
return ReactDOM.createPortal(
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
/* @__PURE__ */
|
|
689
|
+
/* @__PURE__ */ jsxs7("div", { className: clsx8("fixed inset-0 z-[9999]"), children: [
|
|
690
|
+
/* @__PURE__ */ jsx9(
|
|
461
691
|
"div",
|
|
462
692
|
{
|
|
463
|
-
className:
|
|
693
|
+
className: clsx8("fixed inset-0 h-screen w-screen bg-black/30", backgroundClassName),
|
|
464
694
|
onClick: onBackgroundClick
|
|
465
695
|
}
|
|
466
696
|
),
|
|
@@ -488,21 +718,21 @@ var OverlayHeader = ({
|
|
|
488
718
|
}) => {
|
|
489
719
|
const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation);
|
|
490
720
|
const hasTitleRow = !!title || !!titleText || !!onClose;
|
|
491
|
-
const titleRow = /* @__PURE__ */
|
|
492
|
-
title ?? /* @__PURE__ */
|
|
721
|
+
const titleRow = /* @__PURE__ */ jsxs7("div", { className: "row justify-between items-start gap-x-8", children: [
|
|
722
|
+
title ?? /* @__PURE__ */ jsx9(
|
|
493
723
|
"h2",
|
|
494
724
|
{
|
|
495
|
-
className:
|
|
725
|
+
className: clsx8("textstyle-title-lg", {
|
|
496
726
|
"mb-1": description || descriptionText
|
|
497
727
|
}),
|
|
498
728
|
children: titleText
|
|
499
729
|
}
|
|
500
730
|
),
|
|
501
|
-
!!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" }) }) })
|
|
502
732
|
] });
|
|
503
|
-
return /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ jsxs7("div", { className: "col", children: [
|
|
504
734
|
hasTitleRow && titleRow,
|
|
505
|
-
description ?? (descriptionText && /* @__PURE__ */
|
|
735
|
+
description ?? (descriptionText && /* @__PURE__ */ jsx9("span", { className: "textstyle-description", children: descriptionText }))
|
|
506
736
|
] });
|
|
507
737
|
};
|
|
508
738
|
var Modal = ({
|
|
@@ -513,8 +743,8 @@ var Modal = ({
|
|
|
513
743
|
backgroundClassName,
|
|
514
744
|
headerProps
|
|
515
745
|
}) => {
|
|
516
|
-
const ref =
|
|
517
|
-
|
|
746
|
+
const ref = useRef3(null);
|
|
747
|
+
useEffect9(() => {
|
|
518
748
|
if (!isOpen) return;
|
|
519
749
|
const modal = ref.current;
|
|
520
750
|
if (!modal) {
|
|
@@ -551,25 +781,25 @@ var Modal = ({
|
|
|
551
781
|
overlayStack = overlayStack.filter((m) => m !== modal);
|
|
552
782
|
};
|
|
553
783
|
}, [isOpen, onClose]);
|
|
554
|
-
return /* @__PURE__ */
|
|
784
|
+
return /* @__PURE__ */ jsx9(
|
|
555
785
|
Overlay,
|
|
556
786
|
{
|
|
557
787
|
isOpen,
|
|
558
788
|
onBackgroundClick: onClose,
|
|
559
789
|
backgroundClassName,
|
|
560
|
-
children: /* @__PURE__ */
|
|
790
|
+
children: /* @__PURE__ */ jsxs7(
|
|
561
791
|
"div",
|
|
562
792
|
{
|
|
563
793
|
ref,
|
|
564
794
|
tabIndex: -1,
|
|
565
|
-
className:
|
|
795
|
+
className: clsx8(
|
|
566
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",
|
|
567
797
|
className
|
|
568
798
|
),
|
|
569
799
|
role: "dialog",
|
|
570
800
|
"aria-modal": true,
|
|
571
801
|
children: [
|
|
572
|
-
/* @__PURE__ */
|
|
802
|
+
/* @__PURE__ */ jsx9(OverlayHeader, { ...headerProps, onClose }),
|
|
573
803
|
children
|
|
574
804
|
]
|
|
575
805
|
}
|
|
@@ -579,8 +809,8 @@ var Modal = ({
|
|
|
579
809
|
};
|
|
580
810
|
|
|
581
811
|
// src/theming/useTheme.tsx
|
|
582
|
-
import { createContext as createContext2, useContext as useContext2, useEffect as
|
|
583
|
-
import { jsx as
|
|
812
|
+
import { createContext as createContext2, useContext as useContext2, useEffect as useEffect10, useState as useState9 } from "react";
|
|
813
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
584
814
|
var themes = ["light", "dark"];
|
|
585
815
|
var defaultThemeTypeTranslation = {
|
|
586
816
|
en: {
|
|
@@ -603,7 +833,7 @@ var ThemeContext = createContext2({
|
|
|
603
833
|
var useTheme = () => useContext2(ThemeContext);
|
|
604
834
|
|
|
605
835
|
// src/components/modals/ThemeModal.tsx
|
|
606
|
-
import { jsx as
|
|
836
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
607
837
|
var defaultConfirmDialogTranslation = {
|
|
608
838
|
en: {
|
|
609
839
|
title: "Theme",
|
|
@@ -626,7 +856,7 @@ var ThemeModal = ({
|
|
|
626
856
|
}) => {
|
|
627
857
|
const { theme, setTheme } = useTheme();
|
|
628
858
|
const translation = useTranslation(defaultConfirmDialogTranslation, overwriteTranslation);
|
|
629
|
-
return /* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */ jsx11(
|
|
630
860
|
Modal,
|
|
631
861
|
{
|
|
632
862
|
headerProps: {
|
|
@@ -636,8 +866,8 @@ var ThemeModal = ({
|
|
|
636
866
|
},
|
|
637
867
|
onClose,
|
|
638
868
|
...modalProps,
|
|
639
|
-
children: /* @__PURE__ */
|
|
640
|
-
/* @__PURE__ */
|
|
869
|
+
children: /* @__PURE__ */ jsxs8("div", { className: "w-64", children: [
|
|
870
|
+
/* @__PURE__ */ jsx11(
|
|
641
871
|
Select,
|
|
642
872
|
{
|
|
643
873
|
className: "mt-2",
|
|
@@ -646,7 +876,7 @@ var ThemeModal = ({
|
|
|
646
876
|
onChange: (theme2) => setTheme(theme2)
|
|
647
877
|
}
|
|
648
878
|
),
|
|
649
|
-
/* @__PURE__ */
|
|
879
|
+
/* @__PURE__ */ jsx11("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ jsx11(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation.done }) })
|
|
650
880
|
] })
|
|
651
881
|
}
|
|
652
882
|
);
|