@helpwave/hightide 0.1.18 → 0.1.19
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 +7 -7
- package/dist/components/branding/HelpwaveBadge.js.map +1 -1
- package/dist/components/branding/HelpwaveBadge.mjs +7 -7
- package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
- package/dist/components/date/DatePicker.js +65 -38
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +54 -27
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.js +3 -3
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs +3 -3
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/TimePicker.js +4 -4
- package/dist/components/date/TimePicker.js.map +1 -1
- package/dist/components/date/TimePicker.mjs +4 -4
- package/dist/components/date/TimePicker.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js +46 -19
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +44 -17
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.js +32 -28
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +18 -14
- 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/icons-and-geometry/Ring.js +2 -2
- package/dist/components/icons-and-geometry/Ring.js.map +1 -1
- package/dist/components/icons-and-geometry/Ring.mjs +2 -2
- package/dist/components/icons-and-geometry/Ring.mjs.map +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.js +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.js.map +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.mjs +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.js +84 -15
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.mjs +76 -7
- package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Chip.js +1 -1
- package/dist/components/layout-and-navigation/Chip.js.map +1 -1
- package/dist/components/layout-and-navigation/Chip.mjs +1 -1
- package/dist/components/layout-and-navigation/Chip.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.d.mts +7 -1
- package/dist/components/layout-and-navigation/Expandable.d.ts +7 -1
- package/dist/components/layout-and-navigation/Expandable.js +36 -9
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +36 -10
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +34 -11
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs +36 -13
- package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.js +92 -19
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +81 -8
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.js +82 -9
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +79 -6
- package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.js +127 -25
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +126 -24
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.js +22 -16
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +19 -13
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.js +7 -3
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +7 -3
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Tile.d.mts +2 -2
- package/dist/components/layout-and-navigation/Tile.d.ts +2 -2
- package/dist/components/layout-and-navigation/Tile.js +7 -7
- package/dist/components/layout-and-navigation/Tile.js.map +1 -1
- package/dist/components/layout-and-navigation/Tile.mjs +7 -7
- package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js +1 -1
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.js +6 -2
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +6 -2
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.js +5 -1
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +5 -1
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/loading-states/LoadingButton.js +8 -6
- package/dist/components/loading-states/LoadingButton.js.map +1 -1
- package/dist/components/loading-states/LoadingButton.mjs +8 -6
- package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.js +32 -28
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +18 -14
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.js +28 -24
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +18 -14
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
- package/dist/components/modals/InputModal.js +32 -28
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +18 -14
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +728 -434
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +728 -430
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +732 -438
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +731 -433
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js +110 -35
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +110 -35
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js +118 -41
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +114 -37
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +10 -3
- package/dist/components/properties/MultiSelectProperty.d.ts +10 -3
- package/dist/components/properties/MultiSelectProperty.js +915 -463
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +920 -464
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js +101 -18
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +101 -18
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js +103 -20
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +99 -16
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +9 -2
- package/dist/components/properties/SelectProperty.d.ts +9 -2
- package/dist/components/properties/SelectProperty.js +682 -243
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +686 -243
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js +133 -46
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +133 -46
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/table/Table.js +285 -185
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.mjs +270 -166
- package/dist/components/table/Table.mjs.map +1 -1
- package/dist/components/table/TableFilterButton.js +179 -78
- package/dist/components/table/TableFilterButton.js.map +1 -1
- package/dist/components/table/TableFilterButton.mjs +160 -55
- package/dist/components/table/TableFilterButton.mjs.map +1 -1
- package/dist/components/table/TableSortButton.js +72 -3
- package/dist/components/table/TableSortButton.js.map +1 -1
- package/dist/components/table/TableSortButton.mjs +72 -3
- package/dist/components/table/TableSortButton.mjs.map +1 -1
- package/dist/components/user-action/Button.d.mts +15 -2
- package/dist/components/user-action/Button.d.ts +15 -2
- package/dist/components/user-action/Button.js +12 -12
- package/dist/components/user-action/Button.js.map +1 -1
- package/dist/components/user-action/Button.mjs +12 -12
- package/dist/components/user-action/Button.mjs.map +1 -1
- package/dist/components/user-action/Checkbox.js +6 -15
- package/dist/components/user-action/Checkbox.js.map +1 -1
- package/dist/components/user-action/Checkbox.mjs +6 -15
- package/dist/components/user-action/Checkbox.mjs.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.js +6 -2
- package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.mjs +6 -2
- package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js +79 -48
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +65 -34
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Menu.d.mts +11 -6
- package/dist/components/user-action/Menu.d.ts +11 -6
- package/dist/components/user-action/Menu.js +128 -31
- package/dist/components/user-action/Menu.js.map +1 -1
- package/dist/components/user-action/Menu.mjs +134 -33
- package/dist/components/user-action/Menu.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +17 -7
- package/dist/components/user-action/MultiSelect.d.ts +17 -7
- package/dist/components/user-action/MultiSelect.js +796 -375
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +781 -356
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/ScrollPicker.js +2 -2
- package/dist/components/user-action/ScrollPicker.js.map +1 -1
- package/dist/components/user-action/ScrollPicker.mjs +2 -2
- package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
- package/dist/components/user-action/SearchBar.d.mts +14 -0
- package/dist/components/user-action/SearchBar.d.ts +14 -0
- package/dist/components/user-action/SearchBar.js +673 -0
- package/dist/components/user-action/SearchBar.js.map +1 -0
- package/dist/components/user-action/SearchBar.mjs +637 -0
- package/dist/components/user-action/SearchBar.mjs.map +1 -0
- package/dist/components/user-action/Select.d.mts +18 -5
- package/dist/components/user-action/Select.d.ts +18 -5
- package/dist/components/user-action/Select.js +764 -355
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +761 -349
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Textarea.d.mts +1 -1
- package/dist/components/user-action/Textarea.d.ts +1 -1
- package/dist/components/user-action/Textarea.js +13 -3
- package/dist/components/user-action/Textarea.js.map +1 -1
- package/dist/components/user-action/Textarea.mjs +13 -3
- package/dist/components/user-action/Textarea.mjs.map +1 -1
- package/dist/components/user-action/ToggleableInput.js +2 -2
- package/dist/components/user-action/ToggleableInput.js.map +1 -1
- package/dist/components/user-action/ToggleableInput.mjs +2 -2
- package/dist/components/user-action/ToggleableInput.mjs.map +1 -1
- package/dist/css/globals.css +251 -113
- package/dist/css/uncompiled/globals.css +19 -13
- package/dist/css/uncompiled/theme/colors-component.css +12 -3
- package/dist/css/uncompiled/theme/colors-semantic.css +10 -7
- package/dist/css/uncompiled/utitlity/animation.css +70 -1
- package/dist/css/uncompiled/utitlity/general.css +16 -0
- package/dist/hooks/usePopoverPosition.d.mts +15 -0
- package/dist/hooks/usePopoverPosition.d.ts +15 -0
- package/dist/hooks/usePopoverPosition.js +81 -0
- package/dist/hooks/usePopoverPosition.js.map +1 -0
- package/dist/hooks/usePopoverPosition.mjs +57 -0
- package/dist/hooks/usePopoverPosition.mjs.map +1 -0
- package/dist/hooks/useSearch.d.mts +7 -2
- package/dist/hooks/useSearch.d.ts +7 -2
- package/dist/hooks/useSearch.js +44 -15
- package/dist/hooks/useSearch.js.map +1 -1
- package/dist/hooks/useSearch.mjs +45 -16
- package/dist/hooks/useSearch.mjs.map +1 -1
- package/dist/index.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +1102 -819
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1001 -718
- package/dist/index.mjs.map +1 -1
- package/dist/localization/defaults/form.d.mts +2 -0
- package/dist/localization/defaults/form.d.ts +2 -0
- package/dist/localization/defaults/form.js +4 -0
- package/dist/localization/defaults/form.js.map +1 -1
- package/dist/localization/defaults/form.mjs +4 -0
- package/dist/localization/defaults/form.mjs.map +1 -1
- package/dist/util/simpleSearch.d.mts +1 -1
- package/dist/util/simpleSearch.d.ts +1 -1
- 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 -1
|
@@ -121,9 +121,9 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
// src/components/user-action/Select.tsx
|
|
124
|
-
var
|
|
125
|
-
var
|
|
126
|
-
var
|
|
124
|
+
var import_react13 = require("react");
|
|
125
|
+
var import_react14 = require("react");
|
|
126
|
+
var import_clsx8 = __toESM(require("clsx"));
|
|
127
127
|
|
|
128
128
|
// src/components/user-action/Label.tsx
|
|
129
129
|
var import_clsx = __toESM(require("clsx"));
|
|
@@ -143,22 +143,384 @@ var Label = ({
|
|
|
143
143
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
144
144
|
};
|
|
145
145
|
|
|
146
|
-
// src/components/layout-and-navigation/
|
|
146
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
147
|
+
var import_clsx2 = __toESM(require("clsx"));
|
|
147
148
|
var import_lucide_react = require("lucide-react");
|
|
149
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
150
|
+
var Tile = ({
|
|
151
|
+
title,
|
|
152
|
+
description,
|
|
153
|
+
onClick,
|
|
154
|
+
isSelected = false,
|
|
155
|
+
disabled = false,
|
|
156
|
+
prefix,
|
|
157
|
+
suffix,
|
|
158
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
159
|
+
selectedClassName = " bg-primary/20",
|
|
160
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
161
|
+
className
|
|
162
|
+
}) => {
|
|
163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
className: (0, import_clsx2.default)(
|
|
167
|
+
"flex-row-2 w-full items-center",
|
|
168
|
+
{
|
|
169
|
+
[normalClassName]: !!onClick && !disabled,
|
|
170
|
+
[selectedClassName]: isSelected && !disabled,
|
|
171
|
+
[disabledClassName]: disabled
|
|
172
|
+
},
|
|
173
|
+
className
|
|
174
|
+
),
|
|
175
|
+
onClick: disabled ? void 0 : onClick,
|
|
176
|
+
children: [
|
|
177
|
+
prefix,
|
|
178
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex-col-0 w-full", children: [
|
|
179
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h4", { className: (0, import_clsx2.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
|
|
180
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: (0, import_clsx2.default)(description.className ?? "textstyle-description"), children: description.value })
|
|
181
|
+
] }),
|
|
182
|
+
suffix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Check, { size: 24 }) : void 0)
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
189
|
+
var import_react3 = require("react");
|
|
190
|
+
var import_lucide_react2 = require("lucide-react");
|
|
191
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
192
|
+
|
|
193
|
+
// src/util/noop.ts
|
|
194
|
+
var noop = () => void 0;
|
|
195
|
+
|
|
196
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
197
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
198
|
+
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
200
|
+
import_lucide_react2.ChevronDown,
|
|
201
|
+
{
|
|
202
|
+
className: (0, import_clsx3.default)(
|
|
203
|
+
"min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
|
|
204
|
+
{ "rotate-180": isExpanded },
|
|
205
|
+
className
|
|
206
|
+
)
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
};
|
|
210
|
+
var Expandable = (0, import_react3.forwardRef)(function Expandable2({
|
|
211
|
+
children,
|
|
212
|
+
label,
|
|
213
|
+
icon,
|
|
214
|
+
isExpanded = false,
|
|
215
|
+
onChange = noop,
|
|
216
|
+
clickOnlyOnHeader = true,
|
|
217
|
+
disabled = false,
|
|
218
|
+
className,
|
|
219
|
+
headerClassName,
|
|
220
|
+
contentClassName
|
|
221
|
+
}, ref) {
|
|
222
|
+
const defaultIcon = (0, import_react3.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
|
|
223
|
+
icon ??= defaultIcon;
|
|
224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
225
|
+
"div",
|
|
226
|
+
{
|
|
227
|
+
ref,
|
|
228
|
+
className: (0, import_clsx3.default)("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
|
|
229
|
+
onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
230
|
+
children: [
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
232
|
+
"div",
|
|
233
|
+
{
|
|
234
|
+
className: (0, import_clsx3.default)(
|
|
235
|
+
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
|
|
236
|
+
{
|
|
237
|
+
"group-hover:brightness-97": !isExpanded,
|
|
238
|
+
"hover:brightness-97": isExpanded && !disabled,
|
|
239
|
+
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
240
|
+
},
|
|
241
|
+
headerClassName
|
|
242
|
+
),
|
|
243
|
+
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
244
|
+
children: [
|
|
245
|
+
label,
|
|
246
|
+
icon(isExpanded)
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
251
|
+
"div",
|
|
252
|
+
{
|
|
253
|
+
className: (0, import_clsx3.default)(
|
|
254
|
+
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
255
|
+
{
|
|
256
|
+
"max-h-96 opacity-100 pb-2": isExpanded,
|
|
257
|
+
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
258
|
+
},
|
|
259
|
+
contentClassName
|
|
260
|
+
),
|
|
261
|
+
children
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
});
|
|
268
|
+
var ExpandableUncontrolled = (0, import_react3.forwardRef)(function ExpandableUncontrolled2({
|
|
269
|
+
isExpanded,
|
|
270
|
+
onChange = noop,
|
|
271
|
+
...props
|
|
272
|
+
}, ref) {
|
|
273
|
+
const [usedIsExpanded, setUsedIsExpanded] = (0, import_react3.useState)(isExpanded);
|
|
274
|
+
(0, import_react3.useEffect)(() => {
|
|
275
|
+
setUsedIsExpanded(isExpanded);
|
|
276
|
+
}, [isExpanded]);
|
|
277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
278
|
+
Expandable,
|
|
279
|
+
{
|
|
280
|
+
...props,
|
|
281
|
+
ref,
|
|
282
|
+
isExpanded: usedIsExpanded,
|
|
283
|
+
onChange: (value) => {
|
|
284
|
+
onChange(value);
|
|
285
|
+
setUsedIsExpanded(value);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
// src/components/user-action/Menu.tsx
|
|
292
|
+
var import_react6 = require("react");
|
|
148
293
|
var import_clsx4 = __toESM(require("clsx"));
|
|
149
294
|
|
|
295
|
+
// src/hooks/useOutsideClick.ts
|
|
296
|
+
var import_react4 = require("react");
|
|
297
|
+
var useOutsideClick = (refs, handler) => {
|
|
298
|
+
(0, import_react4.useEffect)(() => {
|
|
299
|
+
const listener = (event) => {
|
|
300
|
+
if (event.target === null) return;
|
|
301
|
+
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
handler();
|
|
305
|
+
};
|
|
306
|
+
document.addEventListener("mousedown", listener);
|
|
307
|
+
document.addEventListener("touchstart", listener);
|
|
308
|
+
return () => {
|
|
309
|
+
document.removeEventListener("mousedown", listener);
|
|
310
|
+
document.removeEventListener("touchstart", listener);
|
|
311
|
+
};
|
|
312
|
+
}, [refs, handler]);
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
// src/hooks/useHoverState.ts
|
|
316
|
+
var import_react5 = require("react");
|
|
317
|
+
var defaultUseHoverStateProps = {
|
|
318
|
+
closingDelay: 200,
|
|
319
|
+
isDisabled: false
|
|
320
|
+
};
|
|
321
|
+
var useHoverState = (props = void 0) => {
|
|
322
|
+
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
323
|
+
const [isHovered, setIsHovered] = (0, import_react5.useState)(false);
|
|
324
|
+
const [timer, setTimer] = (0, import_react5.useState)();
|
|
325
|
+
const onMouseEnter = () => {
|
|
326
|
+
if (isDisabled) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
clearTimeout(timer);
|
|
330
|
+
setIsHovered(true);
|
|
331
|
+
};
|
|
332
|
+
const onMouseLeave = () => {
|
|
333
|
+
if (isDisabled) {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
setTimer(setTimeout(() => {
|
|
337
|
+
setIsHovered(false);
|
|
338
|
+
}, closingDelay));
|
|
339
|
+
};
|
|
340
|
+
(0, import_react5.useEffect)(() => {
|
|
341
|
+
if (timer) {
|
|
342
|
+
return () => {
|
|
343
|
+
clearTimeout(timer);
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
(0, import_react5.useEffect)(() => {
|
|
348
|
+
if (timer) {
|
|
349
|
+
clearTimeout(timer);
|
|
350
|
+
}
|
|
351
|
+
}, [isDisabled]);
|
|
352
|
+
return {
|
|
353
|
+
isHovered,
|
|
354
|
+
setIsHovered,
|
|
355
|
+
handlers: { onMouseEnter, onMouseLeave }
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
// src/util/PropsWithFunctionChildren.ts
|
|
360
|
+
var resolve = (children, bag) => {
|
|
361
|
+
if (typeof children === "function") {
|
|
362
|
+
return children(bag);
|
|
363
|
+
}
|
|
364
|
+
return children ?? void 0;
|
|
365
|
+
};
|
|
366
|
+
var BagFunctionUtil = {
|
|
367
|
+
resolve
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
// src/hooks/usePopoverPosition.ts
|
|
371
|
+
var defaultPopoverPositionOptions = {
|
|
372
|
+
edgePadding: 16,
|
|
373
|
+
outerGap: 4,
|
|
374
|
+
horizontalAlignment: "leftInside",
|
|
375
|
+
verticalAlignment: "bottomOutside",
|
|
376
|
+
disabled: false
|
|
377
|
+
};
|
|
378
|
+
var usePopoverPosition = (trigger, options) => {
|
|
379
|
+
const {
|
|
380
|
+
edgePadding,
|
|
381
|
+
outerGap,
|
|
382
|
+
verticalAlignment,
|
|
383
|
+
horizontalAlignment,
|
|
384
|
+
disabled
|
|
385
|
+
} = { ...defaultPopoverPositionOptions, ...options };
|
|
386
|
+
if (disabled || !trigger) {
|
|
387
|
+
return {};
|
|
388
|
+
}
|
|
389
|
+
const left = {
|
|
390
|
+
leftOutside: trigger.left - outerGap,
|
|
391
|
+
leftInside: trigger.left,
|
|
392
|
+
rightOutside: trigger.right + outerGap,
|
|
393
|
+
rightInside: trigger.right,
|
|
394
|
+
center: trigger.left + trigger.width / 2
|
|
395
|
+
}[horizontalAlignment];
|
|
396
|
+
const top = {
|
|
397
|
+
topOutside: trigger.top - outerGap,
|
|
398
|
+
topInside: trigger.top,
|
|
399
|
+
bottomOutside: trigger.bottom + outerGap,
|
|
400
|
+
bottomInside: trigger.bottom,
|
|
401
|
+
center: trigger.top + trigger.height / 2
|
|
402
|
+
}[verticalAlignment];
|
|
403
|
+
const translateX = {
|
|
404
|
+
leftOutside: "-100%",
|
|
405
|
+
leftInside: void 0,
|
|
406
|
+
rightOutside: void 0,
|
|
407
|
+
rightInside: "-100%",
|
|
408
|
+
center: "-50%"
|
|
409
|
+
}[horizontalAlignment];
|
|
410
|
+
const translateY = {
|
|
411
|
+
topOutside: "-100%",
|
|
412
|
+
topInside: void 0,
|
|
413
|
+
bottomOutside: void 0,
|
|
414
|
+
bottomInside: "-100%",
|
|
415
|
+
center: "-50%"
|
|
416
|
+
}[verticalAlignment];
|
|
417
|
+
return {
|
|
418
|
+
left: Math.max(left, edgePadding),
|
|
419
|
+
top: Math.max(top, edgePadding),
|
|
420
|
+
translate: [translateX ?? "0", translateY ?? "0"].join(" ")
|
|
421
|
+
};
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
// src/components/user-action/Menu.tsx
|
|
425
|
+
var import_react_dom = require("react-dom");
|
|
426
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
427
|
+
function getScrollableParents(element) {
|
|
428
|
+
const scrollables = [];
|
|
429
|
+
let parent = element.parentElement;
|
|
430
|
+
while (parent) {
|
|
431
|
+
scrollables.push(parent);
|
|
432
|
+
parent = parent.parentElement;
|
|
433
|
+
}
|
|
434
|
+
return scrollables;
|
|
435
|
+
}
|
|
436
|
+
var Menu = ({
|
|
437
|
+
trigger,
|
|
438
|
+
children,
|
|
439
|
+
alignmentHorizontal = "leftInside",
|
|
440
|
+
alignmentVertical = "bottomOutside",
|
|
441
|
+
showOnHover = false,
|
|
442
|
+
disabled = false,
|
|
443
|
+
menuClassName = ""
|
|
444
|
+
}) => {
|
|
445
|
+
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
446
|
+
const triggerRef = (0, import_react6.useRef)(null);
|
|
447
|
+
const menuRef = (0, import_react6.useRef)(null);
|
|
448
|
+
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
449
|
+
const [isHidden, setIsHidden] = (0, import_react6.useState)(true);
|
|
450
|
+
const bag = {
|
|
451
|
+
isOpen,
|
|
452
|
+
close: () => setIsOpen(false),
|
|
453
|
+
toggleOpen: () => setIsOpen((prevState) => !prevState),
|
|
454
|
+
disabled
|
|
455
|
+
};
|
|
456
|
+
const menuPosition = usePopoverPosition(
|
|
457
|
+
triggerRef.current?.getBoundingClientRect(),
|
|
458
|
+
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
459
|
+
);
|
|
460
|
+
(0, import_react6.useEffect)(() => {
|
|
461
|
+
if (!isOpen) return;
|
|
462
|
+
const triggerEl = triggerRef.current;
|
|
463
|
+
if (!triggerEl) return;
|
|
464
|
+
const scrollableParents = getScrollableParents(triggerEl);
|
|
465
|
+
const close = () => setIsOpen(false);
|
|
466
|
+
scrollableParents.forEach((parent) => {
|
|
467
|
+
parent.addEventListener("scroll", close);
|
|
468
|
+
});
|
|
469
|
+
window.addEventListener("resize", close);
|
|
470
|
+
return () => {
|
|
471
|
+
scrollableParents.forEach((parent) => {
|
|
472
|
+
parent.removeEventListener("scroll", close);
|
|
473
|
+
});
|
|
474
|
+
window.removeEventListener("resize", close);
|
|
475
|
+
};
|
|
476
|
+
}, [isOpen, setIsOpen]);
|
|
477
|
+
(0, import_react6.useEffect)(() => {
|
|
478
|
+
if (isOpen) {
|
|
479
|
+
setIsHidden(false);
|
|
480
|
+
}
|
|
481
|
+
}, [isOpen]);
|
|
482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
483
|
+
trigger(bag, triggerRef),
|
|
484
|
+
(0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
485
|
+
"div",
|
|
486
|
+
{
|
|
487
|
+
ref: menuRef,
|
|
488
|
+
onClick: (e) => e.stopPropagation(),
|
|
489
|
+
className: (0, import_clsx4.default)(
|
|
490
|
+
"absolute rounded-md bg-menu-background text-menu-text shadow-around-lg z-10",
|
|
491
|
+
{
|
|
492
|
+
"animate-pop-in": isOpen,
|
|
493
|
+
"animate-pop-out": !isOpen,
|
|
494
|
+
"hidden": isHidden
|
|
495
|
+
},
|
|
496
|
+
menuClassName
|
|
497
|
+
),
|
|
498
|
+
onAnimationEnd: () => {
|
|
499
|
+
if (!isOpen) {
|
|
500
|
+
setIsHidden(true);
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
style: {
|
|
504
|
+
...menuPosition
|
|
505
|
+
},
|
|
506
|
+
children: BagFunctionUtil.resolve(children, bag)
|
|
507
|
+
}
|
|
508
|
+
), document.body)
|
|
509
|
+
] });
|
|
510
|
+
};
|
|
511
|
+
|
|
150
512
|
// src/components/user-action/Input.tsx
|
|
151
|
-
var
|
|
152
|
-
var
|
|
513
|
+
var import_react10 = require("react");
|
|
514
|
+
var import_clsx5 = __toESM(require("clsx"));
|
|
153
515
|
|
|
154
516
|
// src/hooks/useDelay.ts
|
|
155
|
-
var
|
|
517
|
+
var import_react7 = require("react");
|
|
156
518
|
var defaultOptions = {
|
|
157
519
|
delay: 3e3,
|
|
158
520
|
disabled: false
|
|
159
521
|
};
|
|
160
522
|
function useDelay(options) {
|
|
161
|
-
const [timer, setTimer] = (0,
|
|
523
|
+
const [timer, setTimer] = (0, import_react7.useState)(void 0);
|
|
162
524
|
const { delay, disabled } = {
|
|
163
525
|
...defaultOptions,
|
|
164
526
|
...options
|
|
@@ -177,12 +539,12 @@ function useDelay(options) {
|
|
|
177
539
|
setTimer(void 0);
|
|
178
540
|
}, delay));
|
|
179
541
|
};
|
|
180
|
-
(0,
|
|
542
|
+
(0, import_react7.useEffect)(() => {
|
|
181
543
|
return () => {
|
|
182
544
|
clearTimeout(timer);
|
|
183
545
|
};
|
|
184
546
|
}, [timer]);
|
|
185
|
-
(0,
|
|
547
|
+
(0, import_react7.useEffect)(() => {
|
|
186
548
|
if (disabled) {
|
|
187
549
|
clearTimeout(timer);
|
|
188
550
|
setTimer(void 0);
|
|
@@ -191,13 +553,10 @@ function useDelay(options) {
|
|
|
191
553
|
return { restartTimer, clearTimer, hasActiveTimer: !!timer };
|
|
192
554
|
}
|
|
193
555
|
|
|
194
|
-
// src/util/noop.ts
|
|
195
|
-
var noop = () => void 0;
|
|
196
|
-
|
|
197
556
|
// src/hooks/useFocusManagement.ts
|
|
198
|
-
var
|
|
557
|
+
var import_react8 = require("react");
|
|
199
558
|
function useFocusManagement() {
|
|
200
|
-
const getFocusableElements = (0,
|
|
559
|
+
const getFocusableElements = (0, import_react8.useCallback)(() => {
|
|
201
560
|
return Array.from(
|
|
202
561
|
document.querySelectorAll(
|
|
203
562
|
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
@@ -206,7 +565,7 @@ function useFocusManagement() {
|
|
|
206
565
|
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
207
566
|
);
|
|
208
567
|
}, []);
|
|
209
|
-
const getNextFocusElement = (0,
|
|
568
|
+
const getNextFocusElement = (0, import_react8.useCallback)(() => {
|
|
210
569
|
const elements = getFocusableElements();
|
|
211
570
|
if (elements.length === 0) {
|
|
212
571
|
return void 0;
|
|
@@ -218,11 +577,11 @@ function useFocusManagement() {
|
|
|
218
577
|
}
|
|
219
578
|
return nextElement;
|
|
220
579
|
}, [getFocusableElements]);
|
|
221
|
-
const focusNext = (0,
|
|
580
|
+
const focusNext = (0, import_react8.useCallback)(() => {
|
|
222
581
|
const nextElement = getNextFocusElement();
|
|
223
582
|
nextElement?.focus();
|
|
224
583
|
}, [getNextFocusElement]);
|
|
225
|
-
const getPreviousFocusElement = (0,
|
|
584
|
+
const getPreviousFocusElement = (0, import_react8.useCallback)(() => {
|
|
226
585
|
const elements = getFocusableElements();
|
|
227
586
|
if (elements.length === 0) {
|
|
228
587
|
return void 0;
|
|
@@ -238,7 +597,7 @@ function useFocusManagement() {
|
|
|
238
597
|
}
|
|
239
598
|
return previousElement;
|
|
240
599
|
}, [getFocusableElements]);
|
|
241
|
-
const focusPrevious = (0,
|
|
600
|
+
const focusPrevious = (0, import_react8.useCallback)(() => {
|
|
242
601
|
const previousElement = getPreviousFocusElement();
|
|
243
602
|
if (previousElement) previousElement.focus();
|
|
244
603
|
}, [getPreviousFocusElement]);
|
|
@@ -252,10 +611,10 @@ function useFocusManagement() {
|
|
|
252
611
|
}
|
|
253
612
|
|
|
254
613
|
// src/hooks/useFocusOnceVisible.ts
|
|
255
|
-
var
|
|
614
|
+
var import_react9 = __toESM(require("react"));
|
|
256
615
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
257
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
258
|
-
(0,
|
|
616
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react9.default.useState(false);
|
|
617
|
+
(0, import_react9.useEffect)(() => {
|
|
259
618
|
if (disable || hasUsedFocus) {
|
|
260
619
|
return;
|
|
261
620
|
}
|
|
@@ -275,9 +634,9 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
275
634
|
};
|
|
276
635
|
|
|
277
636
|
// src/components/user-action/Input.tsx
|
|
278
|
-
var
|
|
637
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
279
638
|
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
280
|
-
return (0,
|
|
639
|
+
return (0, import_clsx5.default)(
|
|
281
640
|
"px-2 py-1.5 rounded-md border-2",
|
|
282
641
|
{
|
|
283
642
|
"bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
@@ -291,7 +650,7 @@ var defaultEditCompleteOptions = {
|
|
|
291
650
|
afterDelay: true,
|
|
292
651
|
delay: 2500
|
|
293
652
|
};
|
|
294
|
-
var Input = (0,
|
|
653
|
+
var Input = (0, import_react10.forwardRef)(function Input2({
|
|
295
654
|
id,
|
|
296
655
|
type = "text",
|
|
297
656
|
value,
|
|
@@ -314,10 +673,10 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
314
673
|
restartTimer,
|
|
315
674
|
clearTimer
|
|
316
675
|
} = useDelay({ delay, disabled: !afterDelay });
|
|
317
|
-
const innerRef = (0,
|
|
676
|
+
const innerRef = (0, import_react10.useRef)(null);
|
|
318
677
|
const { focusNext } = useFocusManagement();
|
|
319
678
|
useFocusOnceVisible(innerRef, !autoFocus);
|
|
320
|
-
(0,
|
|
679
|
+
(0, import_react10.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
321
680
|
const handleKeyDown = (e) => {
|
|
322
681
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
323
682
|
e.preventDefault();
|
|
@@ -325,9 +684,9 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
325
684
|
focusNext();
|
|
326
685
|
}
|
|
327
686
|
};
|
|
328
|
-
return /* @__PURE__ */ (0,
|
|
329
|
-
label && /* @__PURE__ */ (0,
|
|
330
|
-
/* @__PURE__ */ (0,
|
|
687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)({ "w-full": expanded }, containerClassName), children: [
|
|
688
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx5.default)("mb-1", label.className) }),
|
|
689
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
331
690
|
"input",
|
|
332
691
|
{
|
|
333
692
|
...restProps,
|
|
@@ -336,7 +695,7 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
336
695
|
id,
|
|
337
696
|
type,
|
|
338
697
|
disabled,
|
|
339
|
-
className: (0,
|
|
698
|
+
className: (0, import_clsx5.default)(getInputClassName({ disabled }), className),
|
|
340
699
|
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
341
700
|
onBlur: (event) => {
|
|
342
701
|
onBlur?.(event);
|
|
@@ -366,7 +725,7 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
366
725
|
)
|
|
367
726
|
] });
|
|
368
727
|
});
|
|
369
|
-
var FormInput = (0,
|
|
728
|
+
var FormInput = (0, import_react10.forwardRef)(function FormInput2({
|
|
370
729
|
id,
|
|
371
730
|
labelText,
|
|
372
731
|
errorText,
|
|
@@ -378,206 +737,33 @@ var FormInput = (0, import_react6.forwardRef)(function FormInput2({
|
|
|
378
737
|
disabled,
|
|
379
738
|
...restProps
|
|
380
739
|
}, ref) {
|
|
381
|
-
const input = /* @__PURE__ */ (0,
|
|
740
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
382
741
|
"input",
|
|
383
742
|
{
|
|
384
743
|
...restProps,
|
|
385
744
|
ref,
|
|
386
745
|
id,
|
|
387
746
|
disabled,
|
|
388
|
-
className: (0,
|
|
747
|
+
className: (0, import_clsx5.default)(
|
|
389
748
|
getInputClassName({ disabled, hasError: !!errorText }),
|
|
390
749
|
className
|
|
391
750
|
)
|
|
392
751
|
}
|
|
393
752
|
);
|
|
394
|
-
return /* @__PURE__ */ (0,
|
|
395
|
-
labelText && /* @__PURE__ */ (0,
|
|
753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
754
|
+
labelText && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { htmlFor: id, className: (0, import_clsx5.default)("textstyle-label-md", labelClassName), children: [
|
|
396
755
|
labelText,
|
|
397
|
-
required && /* @__PURE__ */ (0,
|
|
756
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
398
757
|
] }),
|
|
399
758
|
input,
|
|
400
|
-
errorText && /* @__PURE__ */ (0,
|
|
759
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: id, className: (0, import_clsx5.default)("text-negative", errorClassName), children: errorText })
|
|
401
760
|
] });
|
|
402
761
|
});
|
|
403
762
|
|
|
404
|
-
// src/components/user-action/Button.tsx
|
|
405
|
-
var import_clsx3 = __toESM(require("clsx"));
|
|
406
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
407
|
-
var ButtonColorUtil = {
|
|
408
|
-
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
409
|
-
text: ["primary", "negative", "neutral"],
|
|
410
|
-
outline: ["primary"]
|
|
411
|
-
};
|
|
412
|
-
var IconButtonUtil = {
|
|
413
|
-
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
414
|
-
};
|
|
415
|
-
var paddingMapping = {
|
|
416
|
-
small: "btn-sm",
|
|
417
|
-
medium: "btn-md",
|
|
418
|
-
large: "btn-lg"
|
|
419
|
-
};
|
|
420
|
-
var iconPaddingMapping = {
|
|
421
|
-
tiny: "icon-btn-xs",
|
|
422
|
-
small: "icon-btn-sm",
|
|
423
|
-
medium: "icon-btn-md",
|
|
424
|
-
large: "icon-btn-lg"
|
|
425
|
-
};
|
|
426
|
-
var ButtonUtil = {
|
|
427
|
-
paddingMapping,
|
|
428
|
-
iconPaddingMapping
|
|
429
|
-
};
|
|
430
|
-
var SolidButton = ({
|
|
431
|
-
children,
|
|
432
|
-
disabled = false,
|
|
433
|
-
color = "primary",
|
|
434
|
-
size = "medium",
|
|
435
|
-
startIcon,
|
|
436
|
-
endIcon,
|
|
437
|
-
onClick,
|
|
438
|
-
className,
|
|
439
|
-
...restProps
|
|
440
|
-
}) => {
|
|
441
|
-
const colorClasses = {
|
|
442
|
-
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
443
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
444
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
445
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
446
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
447
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
448
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
449
|
-
}[color];
|
|
450
|
-
const iconColorClasses = {
|
|
451
|
-
primary: "text-button-solid-primary-icon",
|
|
452
|
-
secondary: "text-button-solid-secondary-icon",
|
|
453
|
-
tertiary: "text-button-solid-tertiary-icon",
|
|
454
|
-
positive: "text-button-solid-positive-icon",
|
|
455
|
-
warning: "text-button-solid-warning-icon",
|
|
456
|
-
negative: "text-button-solid-negative-icon",
|
|
457
|
-
neutral: "text-button-solid-neutral-icon"
|
|
458
|
-
}[color];
|
|
459
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
460
|
-
"button",
|
|
461
|
-
{
|
|
462
|
-
onClick: disabled ? void 0 : onClick,
|
|
463
|
-
disabled: disabled || onClick === void 0,
|
|
464
|
-
className: (0, import_clsx3.default)(
|
|
465
|
-
{
|
|
466
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
467
|
-
[(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
468
|
-
},
|
|
469
|
-
ButtonUtil.paddingMapping[size],
|
|
470
|
-
className
|
|
471
|
-
),
|
|
472
|
-
...restProps,
|
|
473
|
-
children: [
|
|
474
|
-
startIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
475
|
-
"span",
|
|
476
|
-
{
|
|
477
|
-
className: (0, import_clsx3.default)({
|
|
478
|
-
[iconColorClasses]: !disabled,
|
|
479
|
-
[`text-disabled-icon`]: disabled
|
|
480
|
-
}),
|
|
481
|
-
children: startIcon
|
|
482
|
-
}
|
|
483
|
-
),
|
|
484
|
-
children,
|
|
485
|
-
endIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
486
|
-
"span",
|
|
487
|
-
{
|
|
488
|
-
className: (0, import_clsx3.default)({
|
|
489
|
-
[iconColorClasses]: !disabled,
|
|
490
|
-
[`text-disabled-icon`]: disabled
|
|
491
|
-
}),
|
|
492
|
-
children: endIcon
|
|
493
|
-
}
|
|
494
|
-
)
|
|
495
|
-
]
|
|
496
|
-
}
|
|
497
|
-
);
|
|
498
|
-
};
|
|
499
|
-
var IconButton = ({
|
|
500
|
-
children,
|
|
501
|
-
disabled = false,
|
|
502
|
-
color = "primary",
|
|
503
|
-
size = "medium",
|
|
504
|
-
onClick,
|
|
505
|
-
className,
|
|
506
|
-
...restProps
|
|
507
|
-
}) => {
|
|
508
|
-
const colorClasses = {
|
|
509
|
-
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
510
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
511
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
512
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
513
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
514
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
515
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
516
|
-
transparent: "bg-transparent"
|
|
517
|
-
}[color];
|
|
518
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
519
|
-
"button",
|
|
520
|
-
{
|
|
521
|
-
onClick: disabled ? void 0 : onClick,
|
|
522
|
-
disabled: disabled || onClick === void 0,
|
|
523
|
-
className: (0, import_clsx3.default)(
|
|
524
|
-
{
|
|
525
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
526
|
-
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
527
|
-
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
528
|
-
[(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
529
|
-
},
|
|
530
|
-
ButtonUtil.iconPaddingMapping[size],
|
|
531
|
-
className
|
|
532
|
-
),
|
|
533
|
-
...restProps,
|
|
534
|
-
children
|
|
535
|
-
}
|
|
536
|
-
);
|
|
537
|
-
};
|
|
538
|
-
|
|
539
|
-
// src/hooks/useSearch.ts
|
|
540
|
-
var import_react7 = require("react");
|
|
541
|
-
|
|
542
|
-
// src/util/simpleSearch.ts
|
|
543
|
-
var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
544
|
-
return objects.filter((object) => {
|
|
545
|
-
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
546
|
-
if (!mappedSearchKeywords) {
|
|
547
|
-
return true;
|
|
548
|
-
}
|
|
549
|
-
return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
|
|
550
|
-
});
|
|
551
|
-
};
|
|
552
|
-
|
|
553
|
-
// src/hooks/useSearch.ts
|
|
554
|
-
var useSearch = ({
|
|
555
|
-
list,
|
|
556
|
-
initialSearch,
|
|
557
|
-
searchMapping
|
|
558
|
-
}) => {
|
|
559
|
-
const [items, setItems] = (0, import_react7.useState)(list);
|
|
560
|
-
const [search, setSearch] = (0, import_react7.useState)(initialSearch);
|
|
561
|
-
(0, import_react7.useEffect)(() => {
|
|
562
|
-
setItems(list);
|
|
563
|
-
}, [list]);
|
|
564
|
-
const result = (0, import_react7.useMemo)(
|
|
565
|
-
() => MultiSearchWithMapping(search, items, searchMapping),
|
|
566
|
-
[search, items, searchMapping]
|
|
567
|
-
);
|
|
568
|
-
return {
|
|
569
|
-
result,
|
|
570
|
-
hasResult: result.length > 0,
|
|
571
|
-
allItems: items,
|
|
572
|
-
setItems,
|
|
573
|
-
search,
|
|
574
|
-
setSearch
|
|
575
|
-
};
|
|
576
|
-
};
|
|
577
|
-
|
|
578
763
|
// src/localization/defaults/form.ts
|
|
579
764
|
var formTranslation = {
|
|
580
765
|
en: {
|
|
766
|
+
add: "Add",
|
|
581
767
|
all: "All",
|
|
582
768
|
apply: "Apply",
|
|
583
769
|
back: "Back",
|
|
@@ -590,6 +776,7 @@ var formTranslation = {
|
|
|
590
776
|
confirm: "Confirm",
|
|
591
777
|
copy: "Copy",
|
|
592
778
|
copied: "Copied",
|
|
779
|
+
create: "Create",
|
|
593
780
|
decline: "Decline",
|
|
594
781
|
delete: "Delete",
|
|
595
782
|
discard: "Discard",
|
|
@@ -632,6 +819,7 @@ var formTranslation = {
|
|
|
632
819
|
yes: "Yes"
|
|
633
820
|
},
|
|
634
821
|
de: {
|
|
822
|
+
add: "Hinzuf\xFCgen",
|
|
635
823
|
all: "Alle",
|
|
636
824
|
apply: "Anwenden",
|
|
637
825
|
back: "Zur\xFCck",
|
|
@@ -644,6 +832,7 @@ var formTranslation = {
|
|
|
644
832
|
confirm: "Best\xE4tigen",
|
|
645
833
|
copy: "Kopieren",
|
|
646
834
|
copied: "Kopiert",
|
|
835
|
+
create: "Erstellen",
|
|
647
836
|
decline: "Ablehnen",
|
|
648
837
|
delete: "L\xF6schen",
|
|
649
838
|
discard: "Verwerfen",
|
|
@@ -687,241 +876,346 @@ var formTranslation = {
|
|
|
687
876
|
}
|
|
688
877
|
};
|
|
689
878
|
|
|
690
|
-
// src/components/
|
|
691
|
-
var
|
|
692
|
-
var
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
}
|
|
879
|
+
// src/components/user-action/Button.tsx
|
|
880
|
+
var import_react11 = require("react");
|
|
881
|
+
var import_clsx6 = __toESM(require("clsx"));
|
|
882
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
883
|
+
var ButtonColorUtil = {
|
|
884
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
885
|
+
text: ["primary", "negative", "neutral"],
|
|
886
|
+
outline: ["primary"]
|
|
699
887
|
};
|
|
700
|
-
var
|
|
701
|
-
|
|
702
|
-
list,
|
|
703
|
-
initialSearch = "",
|
|
704
|
-
searchMapping,
|
|
705
|
-
autoFocus,
|
|
706
|
-
minimumItemsForSearch = 6,
|
|
707
|
-
itemMapper,
|
|
708
|
-
className,
|
|
709
|
-
resultListClassName
|
|
710
|
-
}) => {
|
|
711
|
-
const translation = useTranslation([defaultSearchableListTranslation, formTranslation], overwriteTranslation);
|
|
712
|
-
const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
|
|
713
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("col gap-y-2", className), children: [
|
|
714
|
-
list.length > minimumItemsForSearch && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "row justify-between gap-x-4 items-center", children: [
|
|
715
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
716
|
-
Input,
|
|
717
|
-
{
|
|
718
|
-
value: search,
|
|
719
|
-
onChangeText: setSearch,
|
|
720
|
-
placeholder: translation("search"),
|
|
721
|
-
autoFocus,
|
|
722
|
-
className: "w-full"
|
|
723
|
-
}
|
|
724
|
-
),
|
|
725
|
-
/* @__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" }) })
|
|
726
|
-
] }),
|
|
727
|
-
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") })
|
|
728
|
-
] });
|
|
888
|
+
var IconButtonUtil = {
|
|
889
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
729
890
|
};
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
var
|
|
736
|
-
|
|
737
|
-
|
|
891
|
+
var paddingMapping = {
|
|
892
|
+
small: "btn-sm",
|
|
893
|
+
medium: "btn-md",
|
|
894
|
+
large: "btn-lg"
|
|
895
|
+
};
|
|
896
|
+
var iconPaddingMapping = {
|
|
897
|
+
tiny: "icon-btn-xs",
|
|
898
|
+
small: "icon-btn-sm",
|
|
899
|
+
medium: "icon-btn-md",
|
|
900
|
+
large: "icon-btn-lg"
|
|
901
|
+
};
|
|
902
|
+
var ButtonUtil = {
|
|
903
|
+
paddingMapping,
|
|
904
|
+
iconPaddingMapping
|
|
905
|
+
};
|
|
906
|
+
var SolidButton = (0, import_react11.forwardRef)(function SolidButton2({
|
|
907
|
+
children,
|
|
908
|
+
disabled = false,
|
|
909
|
+
color = "primary",
|
|
910
|
+
size = "medium",
|
|
911
|
+
startIcon,
|
|
912
|
+
endIcon,
|
|
738
913
|
onClick,
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
"
|
|
914
|
+
className,
|
|
915
|
+
...restProps
|
|
916
|
+
}, ref) {
|
|
917
|
+
const colorClasses = {
|
|
918
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
919
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
920
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
921
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
922
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
923
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
924
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
925
|
+
}[color];
|
|
926
|
+
const iconColorClasses = {
|
|
927
|
+
primary: "text-button-solid-primary-icon",
|
|
928
|
+
secondary: "text-button-solid-secondary-icon",
|
|
929
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
930
|
+
positive: "text-button-solid-positive-icon",
|
|
931
|
+
warning: "text-button-solid-warning-icon",
|
|
932
|
+
negative: "text-button-solid-negative-icon",
|
|
933
|
+
neutral: "text-button-solid-neutral-icon"
|
|
934
|
+
}[color];
|
|
935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
936
|
+
"button",
|
|
750
937
|
{
|
|
751
|
-
|
|
752
|
-
|
|
938
|
+
ref,
|
|
939
|
+
onClick,
|
|
940
|
+
disabled,
|
|
941
|
+
className: (0, import_clsx6.default)(
|
|
753
942
|
{
|
|
754
|
-
|
|
755
|
-
[
|
|
756
|
-
[disabledClassName]: isDisabled
|
|
943
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
944
|
+
[(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
757
945
|
},
|
|
946
|
+
ButtonUtil.paddingMapping[size],
|
|
758
947
|
className
|
|
759
948
|
),
|
|
760
|
-
|
|
949
|
+
...restProps,
|
|
761
950
|
children: [
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
951
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
952
|
+
"span",
|
|
953
|
+
{
|
|
954
|
+
className: (0, import_clsx6.default)({
|
|
955
|
+
[iconColorClasses]: !disabled,
|
|
956
|
+
[`text-disabled-icon`]: disabled
|
|
957
|
+
}),
|
|
958
|
+
children: startIcon
|
|
959
|
+
}
|
|
960
|
+
),
|
|
961
|
+
children,
|
|
962
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
963
|
+
"span",
|
|
964
|
+
{
|
|
965
|
+
className: (0, import_clsx6.default)({
|
|
966
|
+
[iconColorClasses]: !disabled,
|
|
967
|
+
[`text-disabled-icon`]: disabled
|
|
968
|
+
}),
|
|
969
|
+
children: endIcon
|
|
970
|
+
}
|
|
971
|
+
)
|
|
768
972
|
]
|
|
769
973
|
}
|
|
770
974
|
);
|
|
975
|
+
});
|
|
976
|
+
var IconButton = ({
|
|
977
|
+
children,
|
|
978
|
+
disabled = false,
|
|
979
|
+
color = "primary",
|
|
980
|
+
size = "medium",
|
|
981
|
+
className,
|
|
982
|
+
...restProps
|
|
983
|
+
}) => {
|
|
984
|
+
const colorClasses = {
|
|
985
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
986
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
987
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
988
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
989
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
990
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
991
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
992
|
+
transparent: "bg-transparent"
|
|
993
|
+
}[color];
|
|
994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
995
|
+
"button",
|
|
996
|
+
{
|
|
997
|
+
disabled,
|
|
998
|
+
className: (0, import_clsx6.default)(
|
|
999
|
+
{
|
|
1000
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
1001
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
1002
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
1003
|
+
[(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
1004
|
+
},
|
|
1005
|
+
ButtonUtil.iconPaddingMapping[size],
|
|
1006
|
+
className
|
|
1007
|
+
),
|
|
1008
|
+
...restProps,
|
|
1009
|
+
children
|
|
1010
|
+
}
|
|
1011
|
+
);
|
|
771
1012
|
};
|
|
772
1013
|
|
|
773
|
-
// src/
|
|
774
|
-
var
|
|
775
|
-
var
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
1014
|
+
// src/components/user-action/SearchBar.tsx
|
|
1015
|
+
var import_lucide_react3 = require("lucide-react");
|
|
1016
|
+
var import_clsx7 = require("clsx");
|
|
1017
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1018
|
+
var SearchBar = ({
|
|
1019
|
+
placeholder,
|
|
1020
|
+
onSearch,
|
|
1021
|
+
disableOnSearch,
|
|
1022
|
+
containerClassName,
|
|
1023
|
+
...inputProps
|
|
1024
|
+
}) => {
|
|
1025
|
+
const translation = useTranslation([formTranslation]);
|
|
1026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.clsx)("flex-row-2 justify-between items-center", containerClassName), children: [
|
|
1027
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1028
|
+
Input,
|
|
1029
|
+
{
|
|
1030
|
+
...inputProps,
|
|
1031
|
+
placeholder: placeholder ?? translation("search")
|
|
781
1032
|
}
|
|
782
|
-
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
1033
|
+
),
|
|
1034
|
+
onSearch && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.Search, { className: "w-full h-full" }) })
|
|
1035
|
+
] });
|
|
1036
|
+
};
|
|
1037
|
+
|
|
1038
|
+
// src/hooks/useSearch.ts
|
|
1039
|
+
var import_react12 = require("react");
|
|
1040
|
+
|
|
1041
|
+
// src/util/simpleSearch.ts
|
|
1042
|
+
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
1043
|
+
return objects.filter((object) => {
|
|
1044
|
+
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
1045
|
+
if (!mappedSearchKeywords) {
|
|
1046
|
+
return true;
|
|
1047
|
+
}
|
|
1048
|
+
return search.every((searchValue) => !!mappedSearchKeywords.find((value) => !!value && value.includes(searchValue.toLowerCase().trim())));
|
|
1049
|
+
});
|
|
1050
|
+
};
|
|
1051
|
+
|
|
1052
|
+
// src/hooks/useSearch.ts
|
|
1053
|
+
var useSearch = ({
|
|
1054
|
+
list,
|
|
1055
|
+
initialSearch,
|
|
1056
|
+
searchMapping,
|
|
1057
|
+
additionalSearchTags,
|
|
1058
|
+
isSearchInstant = true,
|
|
1059
|
+
sortingFunction,
|
|
1060
|
+
filter,
|
|
1061
|
+
disabled = false
|
|
1062
|
+
}) => {
|
|
1063
|
+
const [search, setSearch] = (0, import_react12.useState)(initialSearch ?? "");
|
|
1064
|
+
const [result, setResult] = (0, import_react12.useState)(list);
|
|
1065
|
+
const searchTags = (0, import_react12.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
1066
|
+
const updateSearch = (0, import_react12.useCallback)((newSearch) => {
|
|
1067
|
+
const usedSearch = newSearch ?? search;
|
|
1068
|
+
if (newSearch) {
|
|
1069
|
+
setSearch(search);
|
|
1070
|
+
}
|
|
1071
|
+
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
1072
|
+
}, [searchTags, list, search, searchMapping]);
|
|
1073
|
+
(0, import_react12.useEffect)(() => {
|
|
1074
|
+
if (isSearchInstant) {
|
|
1075
|
+
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
1076
|
+
}
|
|
1077
|
+
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
1078
|
+
const filteredResult = (0, import_react12.useMemo)(() => {
|
|
1079
|
+
if (!filter) {
|
|
1080
|
+
return result;
|
|
1081
|
+
}
|
|
1082
|
+
return result.filter(filter);
|
|
1083
|
+
}, [result, filter]);
|
|
1084
|
+
const sortedAndFilteredResult = (0, import_react12.useMemo)(() => {
|
|
1085
|
+
if (!sortingFunction) {
|
|
1086
|
+
return filteredResult;
|
|
1087
|
+
}
|
|
1088
|
+
return filteredResult.sort(sortingFunction);
|
|
1089
|
+
}, [filteredResult, sortingFunction]);
|
|
1090
|
+
const usedResult = (0, import_react12.useMemo)(() => {
|
|
1091
|
+
if (!disabled) {
|
|
1092
|
+
return sortedAndFilteredResult;
|
|
1093
|
+
}
|
|
1094
|
+
return list;
|
|
1095
|
+
}, [disabled, list, sortedAndFilteredResult]);
|
|
1096
|
+
return {
|
|
1097
|
+
result: usedResult,
|
|
1098
|
+
hasResult: usedResult.length > 0,
|
|
1099
|
+
allItems: list,
|
|
1100
|
+
updateSearch,
|
|
1101
|
+
search,
|
|
1102
|
+
setSearch
|
|
1103
|
+
};
|
|
791
1104
|
};
|
|
792
1105
|
|
|
793
1106
|
// src/components/user-action/Select.tsx
|
|
794
|
-
var
|
|
1107
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1108
|
+
var SelectTile = ({
|
|
1109
|
+
className,
|
|
1110
|
+
disabledClassName,
|
|
1111
|
+
title,
|
|
1112
|
+
...restProps
|
|
1113
|
+
}) => {
|
|
1114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1115
|
+
Tile,
|
|
1116
|
+
{
|
|
1117
|
+
...restProps,
|
|
1118
|
+
className: (0, import_clsx8.default)("px-2 py-1 rounded-md", className),
|
|
1119
|
+
disabledClassName: disabledClassName ?? "text-disabled-text cursor-not-allowed",
|
|
1120
|
+
title: { ...title, className: title.className ?? "font-semibold" }
|
|
1121
|
+
}
|
|
1122
|
+
);
|
|
1123
|
+
};
|
|
795
1124
|
var Select = ({
|
|
796
1125
|
value,
|
|
797
1126
|
label,
|
|
798
1127
|
options,
|
|
799
1128
|
onChange,
|
|
800
1129
|
hintText = "",
|
|
801
|
-
|
|
802
|
-
|
|
1130
|
+
selectedDisplayOverwrite,
|
|
1131
|
+
searchOptions,
|
|
1132
|
+
additionalItems,
|
|
803
1133
|
className,
|
|
804
|
-
|
|
1134
|
+
triggerClassName,
|
|
1135
|
+
hintTextClassName,
|
|
1136
|
+
...menuProps
|
|
805
1137
|
}) => {
|
|
806
|
-
const triggerRef = (0, import_react9.useRef)(null);
|
|
807
|
-
const menuRef = (0, import_react9.useRef)(null);
|
|
808
|
-
const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
|
|
809
|
-
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
810
1138
|
const selectedOption = options.find((option) => option.value === value);
|
|
811
1139
|
if (value !== void 0 && selectedOption === void 0 && selectedDisplayOverwrite === void 0) {
|
|
812
1140
|
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");
|
|
813
1141
|
}
|
|
814
1142
|
const isShowingHint = !selectedDisplayOverwrite && !selectedOption?.label;
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
1143
|
+
const { result, search, setSearch } = useSearch({
|
|
1144
|
+
list: options,
|
|
1145
|
+
searchMapping: (0, import_react13.useCallback)((item) => item.searchTags, []),
|
|
1146
|
+
...searchOptions
|
|
1147
|
+
});
|
|
1148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_clsx8.default)(className), children: [
|
|
1149
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Label, { ...label, labelType: label.labelType ?? "labelBig", className: (0, import_clsx8.default)("mb-1", label.className) }),
|
|
1150
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1151
|
+
Menu,
|
|
1152
|
+
{
|
|
1153
|
+
...menuProps,
|
|
1154
|
+
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1155
|
+
"button",
|
|
1156
|
+
{
|
|
1157
|
+
ref,
|
|
1158
|
+
className: (0, import_clsx8.default)(
|
|
1159
|
+
"btn-md justify-between w-full border-2",
|
|
1160
|
+
{
|
|
1161
|
+
"rounded-b-lg": !open,
|
|
1162
|
+
"bg-menu-background text-menu-text border-menu-border hover:border-primary": !disabled,
|
|
1163
|
+
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": disabled
|
|
1164
|
+
},
|
|
1165
|
+
triggerClassName
|
|
1166
|
+
),
|
|
1167
|
+
onClick: toggleOpen,
|
|
1168
|
+
disabled,
|
|
1169
|
+
children: [
|
|
1170
|
+
!isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? selectedOption?.label }),
|
|
1171
|
+
isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: (0, import_clsx8.default)("textstyle-description", hintTextClassName), children: hintText }),
|
|
1172
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ExpansionIcon, { isExpanded: isOpen })
|
|
1173
|
+
]
|
|
1174
|
+
}
|
|
1175
|
+
),
|
|
1176
|
+
menuClassName: (0, import_clsx8.default)("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
|
|
1177
|
+
children: (bag) => {
|
|
1178
|
+
const { close } = bag;
|
|
1179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1180
|
+
!searchOptions?.disabled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1181
|
+
SearchBar,
|
|
1182
|
+
{
|
|
1183
|
+
value: search,
|
|
1184
|
+
onChangeText: setSearch,
|
|
1185
|
+
autoFocus: true
|
|
1186
|
+
}
|
|
1187
|
+
),
|
|
1188
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-col-2 overflow-y-auto", children: [
|
|
1189
|
+
result.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1190
|
+
SelectTile,
|
|
852
1191
|
{
|
|
853
|
-
isSelected:
|
|
854
|
-
|
|
855
|
-
disabledClassName: "text-disabled-text cursor-not-allowed",
|
|
856
|
-
title: { value: option.label, className: "font-semibold" },
|
|
1192
|
+
isSelected: option === selectedOption,
|
|
1193
|
+
title: { value: option.label },
|
|
857
1194
|
onClick: () => {
|
|
858
1195
|
onChange(option.value);
|
|
859
|
-
|
|
1196
|
+
close();
|
|
860
1197
|
},
|
|
861
|
-
|
|
1198
|
+
disabled: option.disabled
|
|
862
1199
|
},
|
|
863
1200
|
index
|
|
864
|
-
)
|
|
865
|
-
|
|
866
|
-
|
|
1201
|
+
)),
|
|
1202
|
+
additionalItems && additionalItems({ ...bag, search, selected: value })
|
|
1203
|
+
] })
|
|
1204
|
+
] });
|
|
867
1205
|
}
|
|
868
|
-
|
|
869
|
-
|
|
1206
|
+
}
|
|
1207
|
+
)
|
|
870
1208
|
] });
|
|
871
1209
|
};
|
|
872
1210
|
|
|
873
1211
|
// src/components/layout-and-navigation/Overlay.tsx
|
|
874
|
-
var
|
|
875
|
-
var
|
|
876
|
-
var
|
|
877
|
-
|
|
878
|
-
// src/hooks/useHoverState.ts
|
|
879
|
-
var import_react10 = require("react");
|
|
880
|
-
var defaultUseHoverStateProps = {
|
|
881
|
-
closingDelay: 200,
|
|
882
|
-
isDisabled: false
|
|
883
|
-
};
|
|
884
|
-
var useHoverState = (props = void 0) => {
|
|
885
|
-
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
886
|
-
const [isHovered, setIsHovered] = (0, import_react10.useState)(false);
|
|
887
|
-
const [timer, setTimer] = (0, import_react10.useState)();
|
|
888
|
-
const onMouseEnter = () => {
|
|
889
|
-
if (isDisabled) {
|
|
890
|
-
return;
|
|
891
|
-
}
|
|
892
|
-
clearTimeout(timer);
|
|
893
|
-
setIsHovered(true);
|
|
894
|
-
};
|
|
895
|
-
const onMouseLeave = () => {
|
|
896
|
-
if (isDisabled) {
|
|
897
|
-
return;
|
|
898
|
-
}
|
|
899
|
-
setTimer(setTimeout(() => {
|
|
900
|
-
setIsHovered(false);
|
|
901
|
-
}, closingDelay));
|
|
902
|
-
};
|
|
903
|
-
(0, import_react10.useEffect)(() => {
|
|
904
|
-
if (timer) {
|
|
905
|
-
return () => {
|
|
906
|
-
clearTimeout(timer);
|
|
907
|
-
};
|
|
908
|
-
}
|
|
909
|
-
});
|
|
910
|
-
(0, import_react10.useEffect)(() => {
|
|
911
|
-
if (timer) {
|
|
912
|
-
clearTimeout(timer);
|
|
913
|
-
}
|
|
914
|
-
}, [isDisabled]);
|
|
915
|
-
return {
|
|
916
|
-
isHovered,
|
|
917
|
-
setIsHovered,
|
|
918
|
-
handlers: { onMouseEnter, onMouseLeave }
|
|
919
|
-
};
|
|
920
|
-
};
|
|
1212
|
+
var import_react15 = require("react");
|
|
1213
|
+
var import_react_dom2 = __toESM(require("react-dom"));
|
|
1214
|
+
var import_clsx10 = __toESM(require("clsx"));
|
|
921
1215
|
|
|
922
1216
|
// src/components/user-action/Tooltip.tsx
|
|
923
|
-
var
|
|
924
|
-
var
|
|
1217
|
+
var import_clsx9 = require("clsx");
|
|
1218
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
925
1219
|
var Tooltip = ({
|
|
926
1220
|
tooltip,
|
|
927
1221
|
children,
|
|
@@ -951,17 +1245,17 @@ var Tooltip = ({
|
|
|
951
1245
|
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
952
1246
|
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
953
1247
|
};
|
|
954
|
-
return /* @__PURE__ */ (0,
|
|
1248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
955
1249
|
"div",
|
|
956
1250
|
{
|
|
957
|
-
className: (0,
|
|
1251
|
+
className: (0, import_clsx9.clsx)("relative inline-block", containerClassName),
|
|
958
1252
|
...handlers,
|
|
959
1253
|
children: [
|
|
960
1254
|
children,
|
|
961
|
-
isHovered && /* @__PURE__ */ (0,
|
|
1255
|
+
isHovered && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
962
1256
|
"div",
|
|
963
1257
|
{
|
|
964
|
-
className: (0,
|
|
1258
|
+
className: (0, import_clsx9.clsx)(
|
|
965
1259
|
`opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
|
|
966
1260
|
animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,
|
|
967
1261
|
positionClasses[position],
|
|
@@ -970,10 +1264,10 @@ var Tooltip = ({
|
|
|
970
1264
|
style: { zIndex, animationDelay: animationDelay + "ms" },
|
|
971
1265
|
children: [
|
|
972
1266
|
tooltip,
|
|
973
|
-
/* @__PURE__ */ (0,
|
|
1267
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
974
1268
|
"div",
|
|
975
1269
|
{
|
|
976
|
-
className: (0,
|
|
1270
|
+
className: (0, import_clsx9.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
|
|
977
1271
|
style: { ...triangleStyle[position], zIndex: zIndex + 1 }
|
|
978
1272
|
}
|
|
979
1273
|
)
|
|
@@ -987,24 +1281,24 @@ var Tooltip = ({
|
|
|
987
1281
|
|
|
988
1282
|
// src/components/layout-and-navigation/Overlay.tsx
|
|
989
1283
|
var import_lucide_react4 = require("lucide-react");
|
|
990
|
-
var
|
|
1284
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
991
1285
|
var Overlay = ({
|
|
992
1286
|
children,
|
|
993
1287
|
isOpen,
|
|
994
1288
|
onBackgroundClick,
|
|
995
1289
|
backgroundClassName
|
|
996
1290
|
}) => {
|
|
997
|
-
const [root, setRoot] = (0,
|
|
998
|
-
(0,
|
|
1291
|
+
const [root, setRoot] = (0, import_react15.useState)();
|
|
1292
|
+
(0, import_react15.useEffect)(() => {
|
|
999
1293
|
setRoot(document.body);
|
|
1000
1294
|
}, []);
|
|
1001
1295
|
if (!root || !isOpen) return null;
|
|
1002
|
-
return
|
|
1003
|
-
/* @__PURE__ */ (0,
|
|
1004
|
-
/* @__PURE__ */ (0,
|
|
1296
|
+
return import_react_dom2.default.createPortal(
|
|
1297
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: (0, import_clsx10.default)("fixed inset-0 z-[9999]"), children: [
|
|
1298
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1005
1299
|
"div",
|
|
1006
1300
|
{
|
|
1007
|
-
className: (0,
|
|
1301
|
+
className: (0, import_clsx10.default)("fixed inset-0 h-screen w-screen bg-overlay-shadow", backgroundClassName),
|
|
1008
1302
|
onClick: onBackgroundClick
|
|
1009
1303
|
}
|
|
1010
1304
|
),
|
|
@@ -1032,21 +1326,21 @@ var OverlayHeader = ({
|
|
|
1032
1326
|
}) => {
|
|
1033
1327
|
const translation = useTranslation([defaultModalHeaderTranslation], overwriteTranslation);
|
|
1034
1328
|
const hasTitleRow = !!title || !!titleText || !!onClose;
|
|
1035
|
-
const titleRow = /* @__PURE__ */ (0,
|
|
1036
|
-
title ?? /* @__PURE__ */ (0,
|
|
1329
|
+
const titleRow = /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-row-8 justify-between items-start", children: [
|
|
1330
|
+
title ?? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1037
1331
|
"h2",
|
|
1038
1332
|
{
|
|
1039
|
-
className: (0,
|
|
1333
|
+
className: (0, import_clsx10.default)("textstyle-title-lg", {
|
|
1040
1334
|
"mb-1": description || descriptionText
|
|
1041
1335
|
}),
|
|
1042
1336
|
children: titleText
|
|
1043
1337
|
}
|
|
1044
1338
|
),
|
|
1045
|
-
!!onClose && /* @__PURE__ */ (0,
|
|
1339
|
+
!!onClose && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Tooltip, { tooltip: translation("close"), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconButton, { color: "neutral", size: "small", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.X, { className: "w-full h-full" }) }) })
|
|
1046
1340
|
] });
|
|
1047
|
-
return /* @__PURE__ */ (0,
|
|
1341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-col-2", children: [
|
|
1048
1342
|
hasTitleRow && titleRow,
|
|
1049
|
-
description ?? (descriptionText && /* @__PURE__ */ (0,
|
|
1343
|
+
description ?? (descriptionText && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "textstyle-description", children: descriptionText }))
|
|
1050
1344
|
] });
|
|
1051
1345
|
};
|
|
1052
1346
|
var Modal = ({
|
|
@@ -1057,8 +1351,8 @@ var Modal = ({
|
|
|
1057
1351
|
backgroundClassName,
|
|
1058
1352
|
headerProps
|
|
1059
1353
|
}) => {
|
|
1060
|
-
const ref = (0,
|
|
1061
|
-
(0,
|
|
1354
|
+
const ref = (0, import_react15.useRef)(null);
|
|
1355
|
+
(0, import_react15.useEffect)(() => {
|
|
1062
1356
|
if (!isOpen) return;
|
|
1063
1357
|
const modal = ref.current;
|
|
1064
1358
|
if (!modal) {
|
|
@@ -1095,25 +1389,25 @@ var Modal = ({
|
|
|
1095
1389
|
overlayStack = overlayStack.filter((m) => m !== modal);
|
|
1096
1390
|
};
|
|
1097
1391
|
}, [isOpen, onClose]);
|
|
1098
|
-
return /* @__PURE__ */ (0,
|
|
1392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1099
1393
|
Overlay,
|
|
1100
1394
|
{
|
|
1101
1395
|
isOpen,
|
|
1102
1396
|
onBackgroundClick: onClose,
|
|
1103
1397
|
backgroundClassName,
|
|
1104
|
-
children: /* @__PURE__ */ (0,
|
|
1398
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1105
1399
|
"div",
|
|
1106
1400
|
{
|
|
1107
1401
|
ref,
|
|
1108
1402
|
tabIndex: -1,
|
|
1109
|
-
className: (0,
|
|
1110
|
-
"fixed left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2
|
|
1403
|
+
className: (0, import_clsx10.default)(
|
|
1404
|
+
"flex-col-2 fixed left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 p-4 bg-overlay-background text-overlay-text rounded-xl shadow-xl animate-pop-in",
|
|
1111
1405
|
className
|
|
1112
1406
|
),
|
|
1113
1407
|
role: "dialog",
|
|
1114
1408
|
"aria-modal": true,
|
|
1115
1409
|
children: [
|
|
1116
|
-
/* @__PURE__ */ (0,
|
|
1410
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(OverlayHeader, { ...headerProps, onClose }),
|
|
1117
1411
|
children
|
|
1118
1412
|
]
|
|
1119
1413
|
}
|
|
@@ -1123,7 +1417,7 @@ var Modal = ({
|
|
|
1123
1417
|
};
|
|
1124
1418
|
|
|
1125
1419
|
// src/components/modals/LanguageModal.tsx
|
|
1126
|
-
var
|
|
1420
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1127
1421
|
var defaultLanguageModalTranslation = {
|
|
1128
1422
|
en: {
|
|
1129
1423
|
language: "Language",
|
|
@@ -1146,7 +1440,7 @@ var LanguageModal = ({
|
|
|
1146
1440
|
}) => {
|
|
1147
1441
|
const { language, setLanguage } = useLanguage();
|
|
1148
1442
|
const translation = useTranslation([defaultLanguageModalTranslation], overwriteTranslation);
|
|
1149
|
-
return /* @__PURE__ */ (0,
|
|
1443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1150
1444
|
Modal,
|
|
1151
1445
|
{
|
|
1152
1446
|
headerProps: {
|
|
@@ -1156,8 +1450,8 @@ var LanguageModal = ({
|
|
|
1156
1450
|
},
|
|
1157
1451
|
onClose,
|
|
1158
1452
|
...modalProps,
|
|
1159
|
-
children: /* @__PURE__ */ (0,
|
|
1160
|
-
/* @__PURE__ */ (0,
|
|
1453
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "w-64", children: [
|
|
1454
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1161
1455
|
Select,
|
|
1162
1456
|
{
|
|
1163
1457
|
className: "mt-2",
|
|
@@ -1166,7 +1460,7 @@ var LanguageModal = ({
|
|
|
1166
1460
|
onChange: (language2) => setLanguage(language2)
|
|
1167
1461
|
}
|
|
1168
1462
|
),
|
|
1169
|
-
/* @__PURE__ */ (0,
|
|
1463
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
|
|
1170
1464
|
] })
|
|
1171
1465
|
}
|
|
1172
1466
|
);
|