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