@helpwave/hightide 0.1.8 → 0.1.10
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/date/DatePicker.d.mts +3 -4
- package/dist/components/date/DatePicker.d.ts +3 -4
- package/dist/components/date/DatePicker.js +125 -13
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +125 -13
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/TimeDisplay.d.mts +5 -19
- package/dist/components/date/TimeDisplay.d.ts +5 -19
- package/dist/components/date/TimeDisplay.js +129 -37
- package/dist/components/date/TimeDisplay.js.map +1 -1
- package/dist/components/date/TimeDisplay.mjs +129 -37
- package/dist/components/date/TimeDisplay.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.d.mts +2 -5
- package/dist/components/dialogs/ConfirmDialog.d.ts +2 -5
- package/dist/components/dialogs/ConfirmDialog.js +163 -23
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +163 -23
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.d.mts +2 -3
- package/dist/components/layout-and-navigation/Overlay.d.ts +2 -3
- package/dist/components/layout-and-navigation/Overlay.js +158 -10
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +158 -10
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.d.mts +2 -3
- package/dist/components/layout-and-navigation/Pagination.d.ts +2 -3
- package/dist/components/layout-and-navigation/Pagination.js +153 -13
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +153 -13
- package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.d.mts +3 -2
- package/dist/components/layout-and-navigation/SearchableList.d.ts +3 -2
- package/dist/components/layout-and-navigation/SearchableList.js +157 -11
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +157 -11
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.d.mts +2 -5
- package/dist/components/layout-and-navigation/StepperBar.d.ts +2 -5
- package/dist/components/layout-and-navigation/StepperBar.js +153 -15
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +153 -15
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Table.js +153 -13
- package/dist/components/layout-and-navigation/Table.js.map +1 -1
- package/dist/components/layout-and-navigation/Table.mjs +153 -13
- package/dist/components/layout-and-navigation/Table.mjs.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.d.mts +3 -4
- package/dist/components/layout-and-navigation/TextImage.d.ts +3 -4
- package/dist/components/layout-and-navigation/TextImage.js +161 -19
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +161 -19
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js +56 -8
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs +56 -8
- package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.d.mts +1 -0
- package/dist/components/loading-states/LoadingAndErrorComponent.d.ts +1 -0
- package/dist/components/loading-states/LoadingAndErrorComponent.js +155 -15
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +155 -15
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.d.mts +2 -3
- package/dist/components/loading-states/LoadingAnimation.d.ts +2 -3
- package/dist/components/loading-states/LoadingAnimation.js +153 -13
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +153 -13
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.d.mts +2 -5
- package/dist/components/modals/ConfirmModal.d.ts +2 -5
- package/dist/components/modals/ConfirmModal.js +164 -26
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +164 -26
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.d.mts +2 -7
- package/dist/components/modals/DiscardChangesModal.d.ts +2 -7
- package/dist/components/modals/DiscardChangesModal.js +168 -46
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +168 -46
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
- package/dist/components/modals/InputModal.d.mts +1 -0
- package/dist/components/modals/InputModal.d.ts +1 -0
- package/dist/components/modals/InputModal.js +164 -26
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +164 -26
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.d.mts +3 -2
- package/dist/components/modals/LanguageModal.d.ts +3 -2
- package/dist/components/modals/LanguageModal.js +170 -24
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +170 -24
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.d.mts +5 -5
- package/dist/components/modals/ThemeModal.d.ts +5 -5
- package/dist/components/modals/ThemeModal.js +178 -30
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +178 -30
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.d.mts +3 -5
- package/dist/components/properties/CheckboxProperty.d.ts +3 -5
- package/dist/components/properties/CheckboxProperty.js +155 -25
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +155 -25
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.d.mts +1 -0
- package/dist/components/properties/DateProperty.d.ts +1 -0
- package/dist/components/properties/DateProperty.js +153 -13
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +153 -13
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +4 -5
- package/dist/components/properties/MultiSelectProperty.d.ts +4 -5
- package/dist/components/properties/MultiSelectProperty.js +169 -43
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +169 -43
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.d.mts +1 -0
- package/dist/components/properties/NumberProperty.d.ts +1 -0
- package/dist/components/properties/NumberProperty.js +155 -15
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +155 -15
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.d.mts +2 -3
- package/dist/components/properties/PropertyBase.d.ts +2 -3
- package/dist/components/properties/PropertyBase.js +153 -13
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +153 -13
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +2 -3
- package/dist/components/properties/SelectProperty.d.ts +2 -3
- package/dist/components/properties/SelectProperty.js +159 -29
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +159 -29
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.d.mts +2 -1
- package/dist/components/properties/TextProperty.d.ts +2 -1
- package/dist/components/properties/TextProperty.js +157 -17
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +157 -17
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.d.mts +4 -20
- package/dist/components/user-action/DateAndTimePicker.d.ts +4 -20
- package/dist/components/user-action/DateAndTimePicker.js +223 -51
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +223 -51
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Menu.js +1 -1
- package/dist/components/user-action/Menu.js.map +1 -1
- package/dist/components/user-action/Menu.mjs +1 -1
- package/dist/components/user-action/Menu.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +5 -9
- package/dist/components/user-action/MultiSelect.d.ts +5 -9
- package/dist/components/user-action/MultiSelect.js +165 -23
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +165 -23
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/Select.js +158 -12
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +158 -12
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/css/globals.css +13 -4
- package/dist/css/uncompiled/globals.css +4 -4
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +345 -303
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +341 -303
- package/dist/index.mjs.map +1 -1
- package/dist/localization/defaults/form.d.mts +54 -0
- package/dist/localization/defaults/form.d.ts +54 -0
- package/dist/localization/defaults/form.js +127 -0
- package/dist/localization/defaults/form.js.map +1 -0
- package/dist/localization/defaults/form.mjs +103 -0
- package/dist/localization/defaults/form.mjs.map +1 -0
- package/dist/localization/defaults/time.d.mts +39 -0
- package/dist/localization/defaults/time.d.ts +39 -0
- package/dist/localization/defaults/time.js +101 -0
- package/dist/localization/defaults/time.js.map +1 -0
- package/dist/localization/defaults/time.mjs +76 -0
- package/dist/localization/defaults/time.mjs.map +1 -0
- package/dist/localization/useTranslation.d.mts +38 -6
- package/dist/localization/useTranslation.d.ts +38 -6
- package/dist/localization/useTranslation.js +56 -6
- package/dist/localization/useTranslation.js.map +1 -1
- package/dist/localization/useTranslation.mjs +55 -6
- package/dist/localization/useTranslation.mjs.map +1 -1
- package/dist/theming/useTheme.d.mts +4 -2
- package/dist/theming/useTheme.d.ts +4 -2
- package/dist/theming/useTheme.js +10 -2
- package/dist/theming/useTheme.js.map +1 -1
- package/dist/theming/useTheme.mjs +10 -2
- package/dist/theming/useTheme.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -184,15 +184,63 @@ var LanguageContext = (0, import_react2.createContext)({
|
|
|
184
184
|
var useLanguage = () => (0, import_react2.useContext)(LanguageContext);
|
|
185
185
|
|
|
186
186
|
// src/localization/useTranslation.ts
|
|
187
|
-
var
|
|
188
|
-
|
|
187
|
+
var TranslationPluralCount = {
|
|
188
|
+
zero: 0,
|
|
189
|
+
one: 1,
|
|
190
|
+
two: 2,
|
|
191
|
+
few: 3,
|
|
192
|
+
many: 11,
|
|
193
|
+
other: -1
|
|
194
|
+
};
|
|
195
|
+
var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
196
|
+
const { language: languageProp, translation: overwrite } = overwriteTranslation;
|
|
189
197
|
const { language: inferredLanguage } = useLanguage();
|
|
190
198
|
const usedLanguage = languageProp ?? inferredLanguage;
|
|
191
|
-
|
|
192
|
-
if (overwrite
|
|
193
|
-
|
|
199
|
+
const usedTranslations = [...translations];
|
|
200
|
+
if (overwrite) {
|
|
201
|
+
usedTranslations.push(overwrite);
|
|
194
202
|
}
|
|
195
|
-
return
|
|
203
|
+
return (key, options) => {
|
|
204
|
+
const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options };
|
|
205
|
+
try {
|
|
206
|
+
for (let i = translations.length - 1; i >= 0; i--) {
|
|
207
|
+
const translation = translations[i];
|
|
208
|
+
const localizedTranslation = translation[usedLanguage];
|
|
209
|
+
if (!localizedTranslation) {
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
const value = localizedTranslation[key];
|
|
213
|
+
if (!value) {
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
let forProcessing;
|
|
217
|
+
if (typeof value !== "string") {
|
|
218
|
+
if (count === TranslationPluralCount.zero && value?.zero) {
|
|
219
|
+
forProcessing = value.zero;
|
|
220
|
+
} else if (count === TranslationPluralCount.one && value?.one) {
|
|
221
|
+
forProcessing = value.one;
|
|
222
|
+
} else if (count === TranslationPluralCount.two && value?.two) {
|
|
223
|
+
forProcessing = value.two;
|
|
224
|
+
} else if (TranslationPluralCount.few <= count && count < TranslationPluralCount.many && value?.few) {
|
|
225
|
+
forProcessing = value.few;
|
|
226
|
+
} else if (count > TranslationPluralCount.many && value?.many) {
|
|
227
|
+
forProcessing = value.many;
|
|
228
|
+
} else {
|
|
229
|
+
forProcessing = value.other;
|
|
230
|
+
}
|
|
231
|
+
} else {
|
|
232
|
+
forProcessing = value;
|
|
233
|
+
}
|
|
234
|
+
forProcessing = forProcessing.replace(/\{\{(\w+)}}/g, (_, placeholder) => {
|
|
235
|
+
return replacements[placeholder] ?? `{{key:${placeholder}}}`;
|
|
236
|
+
});
|
|
237
|
+
return forProcessing;
|
|
238
|
+
}
|
|
239
|
+
} catch (e) {
|
|
240
|
+
console.error(e);
|
|
241
|
+
}
|
|
242
|
+
return `{{${usedLanguage}:${key}}}`;
|
|
243
|
+
};
|
|
196
244
|
};
|
|
197
245
|
|
|
198
246
|
// src/components/dialogs/ConfirmDialog.tsx
|
|
@@ -315,6 +363,108 @@ var Tooltip = ({
|
|
|
315
363
|
|
|
316
364
|
// src/components/layout-and-navigation/Overlay.tsx
|
|
317
365
|
var import_lucide_react = require("lucide-react");
|
|
366
|
+
|
|
367
|
+
// src/localization/defaults/form.ts
|
|
368
|
+
var formTranslation = {
|
|
369
|
+
en: {
|
|
370
|
+
all: "All",
|
|
371
|
+
back: "Back",
|
|
372
|
+
cancel: "Cancel",
|
|
373
|
+
change: "Change",
|
|
374
|
+
clear: "Clear",
|
|
375
|
+
close: "Close",
|
|
376
|
+
confirm: "Confirm",
|
|
377
|
+
decline: "Decline",
|
|
378
|
+
delete: "Delete",
|
|
379
|
+
discard: "Discard",
|
|
380
|
+
discardChanges: "Discard Changes",
|
|
381
|
+
done: "Done",
|
|
382
|
+
edit: "Edit",
|
|
383
|
+
enterText: "Enter text here",
|
|
384
|
+
error: "Error",
|
|
385
|
+
exit: "Exit",
|
|
386
|
+
fieldRequiredError: "This field is required.",
|
|
387
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
388
|
+
less: "Less",
|
|
389
|
+
loading: "Loading",
|
|
390
|
+
maxLengthError: "Maximum length exceeded.",
|
|
391
|
+
minLengthError: "Minimum length not met.",
|
|
392
|
+
more: "More",
|
|
393
|
+
next: "Next",
|
|
394
|
+
no: "No",
|
|
395
|
+
none: "None",
|
|
396
|
+
of: "of",
|
|
397
|
+
optional: "Optional",
|
|
398
|
+
pleaseWait: "Please wait...",
|
|
399
|
+
previous: "Previous",
|
|
400
|
+
remove: "Remove",
|
|
401
|
+
required: "Required",
|
|
402
|
+
reset: "Reset",
|
|
403
|
+
save: "Save",
|
|
404
|
+
search: "Search",
|
|
405
|
+
select: "Select",
|
|
406
|
+
selectOption: "Select an option",
|
|
407
|
+
show: "Show",
|
|
408
|
+
showMore: "Show more",
|
|
409
|
+
showLess: "Show less",
|
|
410
|
+
submit: "Submit",
|
|
411
|
+
success: "Success",
|
|
412
|
+
update: "Update",
|
|
413
|
+
unsavedChanges: "Unsaved Changes",
|
|
414
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
415
|
+
yes: "Yes"
|
|
416
|
+
},
|
|
417
|
+
de: {
|
|
418
|
+
all: "Alle",
|
|
419
|
+
back: "Zur\xFCck",
|
|
420
|
+
cancel: "Abbrechen",
|
|
421
|
+
change: "\xC4ndern",
|
|
422
|
+
clear: "L\xF6schen",
|
|
423
|
+
close: "Schlie\xDFen",
|
|
424
|
+
confirm: "Best\xE4tigen",
|
|
425
|
+
decline: "Ablehnen",
|
|
426
|
+
delete: "L\xF6schen",
|
|
427
|
+
discard: "Verwerfen",
|
|
428
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
429
|
+
done: "Fertig",
|
|
430
|
+
edit: "Bearbeiten",
|
|
431
|
+
enterText: "Text hier eingeben",
|
|
432
|
+
error: "Fehler",
|
|
433
|
+
exit: "Beenden",
|
|
434
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
435
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
436
|
+
less: "Weniger",
|
|
437
|
+
loading: "L\xE4dt",
|
|
438
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
439
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
440
|
+
more: "Mehr",
|
|
441
|
+
next: "Weiter",
|
|
442
|
+
no: "Nein",
|
|
443
|
+
none: "Nichts",
|
|
444
|
+
of: "von",
|
|
445
|
+
optional: "Optional",
|
|
446
|
+
pleaseWait: "Bitte warten...",
|
|
447
|
+
previous: "Vorherige",
|
|
448
|
+
remove: "Entfernen",
|
|
449
|
+
required: "Erforderlich",
|
|
450
|
+
reset: "Zur\xFCcksetzen",
|
|
451
|
+
save: "Speichern",
|
|
452
|
+
search: "Suche",
|
|
453
|
+
select: "Select",
|
|
454
|
+
selectOption: "Option ausw\xE4hlen",
|
|
455
|
+
show: "Anzeigen",
|
|
456
|
+
showMore: "Mehr anzeigen",
|
|
457
|
+
showLess: "Weniger anzeigen",
|
|
458
|
+
submit: "Abschicken",
|
|
459
|
+
success: "Erfolg",
|
|
460
|
+
update: "Update",
|
|
461
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
462
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
463
|
+
yes: "Ja"
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
// src/components/layout-and-navigation/Overlay.tsx
|
|
318
468
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
319
469
|
var Overlay = ({
|
|
320
470
|
children,
|
|
@@ -344,10 +494,10 @@ var Overlay = ({
|
|
|
344
494
|
var overlayStack = [];
|
|
345
495
|
var defaultModalHeaderTranslation = {
|
|
346
496
|
en: {
|
|
347
|
-
|
|
497
|
+
...formTranslation.en
|
|
348
498
|
},
|
|
349
499
|
de: {
|
|
350
|
-
|
|
500
|
+
...formTranslation.de
|
|
351
501
|
}
|
|
352
502
|
};
|
|
353
503
|
var OverlayHeader = ({
|
|
@@ -358,7 +508,7 @@ var OverlayHeader = ({
|
|
|
358
508
|
description,
|
|
359
509
|
descriptionText = ""
|
|
360
510
|
}) => {
|
|
361
|
-
const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation);
|
|
511
|
+
const translation = useTranslation([defaultModalHeaderTranslation], overwriteTranslation);
|
|
362
512
|
const hasTitleRow = !!title || !!titleText || !!onClose;
|
|
363
513
|
const titleRow = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "row justify-between items-start gap-x-8", children: [
|
|
364
514
|
title ?? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
@@ -370,7 +520,7 @@ var OverlayHeader = ({
|
|
|
370
520
|
children: titleText
|
|
371
521
|
}
|
|
372
522
|
),
|
|
373
|
-
!!onClose && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Tooltip, { tooltip: translation
|
|
523
|
+
!!onClose && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Tooltip, { tooltip: translation("close"), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IconButton, { color: "neutral", size: "small", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.X, { className: "w-full h-full" }) }) })
|
|
374
524
|
] });
|
|
375
525
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "col", children: [
|
|
376
526
|
hasTitleRow && titleRow,
|
|
@@ -449,16 +599,6 @@ var Dialog = ({
|
|
|
449
599
|
|
|
450
600
|
// src/components/dialogs/ConfirmDialog.tsx
|
|
451
601
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
452
|
-
var defaultConfirmDialogTranslation = {
|
|
453
|
-
en: {
|
|
454
|
-
confirm: "Confirm",
|
|
455
|
-
decline: "Decline"
|
|
456
|
-
},
|
|
457
|
-
de: {
|
|
458
|
-
confirm: "Best\xE4tigen",
|
|
459
|
-
decline: "Ablehnen"
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
602
|
var ConfirmDialog = ({
|
|
463
603
|
overwriteTranslation,
|
|
464
604
|
children,
|
|
@@ -469,7 +609,7 @@ var ConfirmDialog = ({
|
|
|
469
609
|
className,
|
|
470
610
|
...restProps
|
|
471
611
|
}) => {
|
|
472
|
-
const translation = useTranslation(
|
|
612
|
+
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
473
613
|
const mapping = {
|
|
474
614
|
neutral: "primary",
|
|
475
615
|
negative: "negative",
|
|
@@ -485,7 +625,7 @@ var ConfirmDialog = ({
|
|
|
485
625
|
color: buttonOverwrites?.[0].color ?? "negative",
|
|
486
626
|
onClick: onDecline,
|
|
487
627
|
disabled: buttonOverwrites?.[0].disabled ?? false,
|
|
488
|
-
children: buttonOverwrites?.[0].text ?? translation
|
|
628
|
+
children: buttonOverwrites?.[0].text ?? translation("decline")
|
|
489
629
|
}
|
|
490
630
|
),
|
|
491
631
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
@@ -495,7 +635,7 @@ var ConfirmDialog = ({
|
|
|
495
635
|
color: buttonOverwrites?.[1].color ?? mapping[confirmType],
|
|
496
636
|
onClick: onConfirm,
|
|
497
637
|
disabled: buttonOverwrites?.[1].disabled ?? false,
|
|
498
|
-
children: buttonOverwrites?.[1].text ?? translation
|
|
638
|
+
children: buttonOverwrites?.[1].text ?? translation("confirm")
|
|
499
639
|
}
|
|
500
640
|
)
|
|
501
641
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/dialogs/ConfirmDialog.tsx","../../../src/components/user-action/Button.tsx","../../../src/localization/LanguageProvider.tsx","../../../src/hooks/useLocalStorage.ts","../../../src/localization/util.ts","../../../src/localization/useTranslation.ts","../../../src/components/layout-and-navigation/Overlay.tsx","../../../src/hooks/useHoverState.ts","../../../src/components/user-action/Tooltip.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react'\nimport type { SolidButtonColor } from '../user-action/Button'\nimport { SolidButton } from '../user-action/Button'\nimport type { PropsForTranslation } from '../../localization/useTranslation'\nimport { useTranslation } from '../../localization/useTranslation'\nimport clsx from 'clsx'\nimport type { DialogProps } from '../layout-and-navigation/Overlay'\nimport { Dialog } from '../layout-and-navigation/Overlay'\n\ntype ConfirmDialogTranslation = {\n confirm: string,\n cancel: string,\n decline: string,\n}\n\nexport type ConfirmDialogType = 'positive' | 'negative' | 'neutral' | 'primary'\n\nconst defaultConfirmDialogTranslation = {\n en: {\n confirm: 'Confirm',\n decline: 'Decline'\n },\n de: {\n confirm: 'Bestätigen',\n decline: 'Ablehnen'\n }\n}\n\ntype ButtonOverwriteType = {\n text?: string,\n color?: SolidButtonColor,\n disabled?: boolean,\n}\n\nexport type ConfirmDialogProps = DialogProps & {\n isShowingDecline?: boolean,\n requireAnswer?: boolean,\n onConfirm: () => void,\n onDecline?: () => void,\n confirmType?: ConfirmDialogType,\n /**\n * Order: Decline, Confirm\n */\n buttonOverwrites?: [ButtonOverwriteType, ButtonOverwriteType],\n}\n\n/**\n * A Dialog for demanding the user for confirmation\n *\n * To allow for background closing, prefer using a ConfirmModal\n */\nexport const ConfirmDialog = ({\n overwriteTranslation,\n children,\n onConfirm,\n onDecline,\n confirmType = 'positive',\n buttonOverwrites,\n className,\n ...restProps\n }: PropsForTranslation<ConfirmDialogTranslation, PropsWithChildren<ConfirmDialogProps>>) => {\n const translation = useTranslation(defaultConfirmDialogTranslation, overwriteTranslation)\n\n const mapping: Record<ConfirmDialogType, SolidButtonColor> = {\n neutral: 'primary',\n negative: 'negative',\n positive: 'positive',\n primary: 'primary',\n }\n\n return (\n <Dialog {...restProps} className={clsx('justify-between', className)}>\n <div className=\"col grow\">\n {children}\n </div>\n <div className=\"row mt-3 gap-x-4 justify-end\">\n {onDecline && (\n <SolidButton\n color={buttonOverwrites?.[0].color ?? 'negative'}\n onClick={onDecline}\n\n disabled={buttonOverwrites?.[0].disabled ?? false}\n >\n {buttonOverwrites?.[0].text ?? translation.decline}\n </SolidButton>\n )}\n <SolidButton\n autoFocus\n color={buttonOverwrites?.[1].color ?? mapping[confirmType]}\n onClick={onConfirm}\n disabled={buttonOverwrites?.[1].disabled ?? false}\n >\n {buttonOverwrites?.[1].text ?? translation.confirm}\n </SolidButton>\n </div>\n </Dialog>\n )\n}\n","import type { ButtonHTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport clsx from 'clsx'\n\n\nexport const ButtonColorUtil = {\n solid: ['primary', 'secondary', 'tertiary', 'positive', 'warning', 'negative', 'neutral'] as const,\n text: ['primary', 'negative', 'neutral'] as const,\n outline: ['primary'] as const,\n}\n\n\n/**\n * The allowed colors for the SolidButton and IconButton\n */\nexport type SolidButtonColor = typeof ButtonColorUtil.solid[number]\n/**\n * The allowed colors for the OutlineButton\n */\nexport type OutlineButtonColor = typeof ButtonColorUtil.outline[number]\n/**\n * The allowed colors for the TextButton\n */\nexport type TextButtonColor = typeof ButtonColorUtil.text[number]\n\n/**\n * The different sizes for a button\n */\ntype ButtonSizes = 'small' | 'medium' | 'large'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}> & ButtonHTMLAttributes<Element>\n\nconst paddingMapping: Record<ButtonSizes, string> = {\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\n}\n\nconst iconPaddingMapping: Record<ButtonSizes, string> = {\n small: 'icon-btn-sm',\n medium: 'icon-btn-md',\n large: 'icon-btn-lg'\n}\n\nexport const ButtonUtil = {\n paddingMapping,\n iconPaddingMapping\n}\n\ntype ButtonWithIconsProps = ButtonProps & {\n startIcon?: ReactNode,\n endIcon?: ReactNode,\n}\n\nexport type SolidButtonProps = ButtonWithIconsProps & {\n color?: SolidButtonColor,\n}\n\nexport type OutlineButtonProps = ButtonWithIconsProps & {\n color?: OutlineButtonColor,\n}\n\nexport type TextButtonProps = ButtonWithIconsProps & {\n color?: TextButtonColor,\n}\n\nexport type IconButtonProps = ButtonProps & {\n color?: SolidButtonColor,\n}\n\n/**\n * A button with a solid background and different sizes\n */\nconst SolidButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: SolidButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-solid-primary-icon',\n secondary: 'text-button-solid-secondary-icon',\n tertiary: 'text-button-solid-tertiary-icon',\n positive: 'text-button-solid-positive-icon',\n warning: 'text-button-solid-warning-icon',\n negative: 'text-button-solid-negative-icon',\n neutral: 'text-button-solid-neutral-icon',\n }[color]\n\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A button with an outline border and different sizes\n */\nconst OutlineButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent border-2 border-button-outline-primary-text text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text border-disabled-outline cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-80')]: !disabled,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A text that is a button that can have different sizes\n */\nconst TextButton = ({\n children,\n disabled = false,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent text-button-text-primary-text',\n negative: 'bg-transparent text-button-text-negative-text',\n neutral: 'bg-transparent text-button-text-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-text-primary-icon',\n negative: 'text-button-text-negative-icon',\n neutral: 'text-button-text-neutral-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:bg-button-text-hover-background rounded-full')]: !disabled,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n\n/**\n * A button for icons with a solid background and different sizes\n */\nconst IconButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n onClick,\n className,\n ...restProps\n }: IconButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n }[color]\n\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled\n },\n ButtonUtil.iconPaddingMapping[size],\n className\n )}\n {...restProps}\n >\n {children}\n </button>\n )\n}\n\nexport { SolidButton, OutlineButton, TextButton, IconButton }\n","import type { Dispatch, PropsWithChildren, SetStateAction } from 'react'\nimport { createContext, useContext, useEffect, useState } from 'react'\nimport { useLocalStorage } from '../hooks/useLocalStorage'\nimport type { Language } from './util'\nimport { LanguageUtil } from './util'\n\nexport type LanguageContextValue = {\n language: Language,\n setLanguage: Dispatch<SetStateAction<Language>>,\n}\n\nexport const LanguageContext = createContext<LanguageContextValue>({\n language: LanguageUtil.DEFAULT_LANGUAGE,\n setLanguage: (v) => v\n})\n\nexport const useLanguage = () => useContext(LanguageContext)\n\nexport const useLocale = (overWriteLanguage?: Language) => {\n const { language } = useLanguage()\n const mapping: Record<Language, string> = {\n en: 'en-US',\n de: 'de-DE'\n }\n return mapping[overWriteLanguage ?? language]\n}\n\ntype LanguageProviderProps = {\n initialLanguage?: Language,\n}\n\nexport const LanguageProvider = ({ initialLanguage, children }: PropsWithChildren<LanguageProviderProps>) => {\n const [language, setLanguage] = useState<Language>(initialLanguage ?? LanguageUtil.DEFAULT_LANGUAGE)\n const [storedLanguage, setStoredLanguage] = useLocalStorage<Language>('language', initialLanguage ?? LanguageUtil.DEFAULT_LANGUAGE)\n\n useEffect(() => {\n if (language !== initialLanguage && initialLanguage) {\n console.warn('LanguageProvider initial state changed: Prefer using languageProvider\\'s setLanguage instead')\n setLanguage(initialLanguage)\n }\n }, [initialLanguage]) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n // TODO set locale of html tag here as well\n setStoredLanguage(language)\n }, [language, setStoredLanguage])\n\n useEffect(() => {\n if (storedLanguage !== null) {\n setLanguage(storedLanguage)\n return\n }\n\n const LanguageToTestAgainst = Object.values(LanguageUtil.languages)\n\n const matchingBrowserLanguage = window.navigator.languages\n .map(language => LanguageToTestAgainst.find((test) => language === test || language.split('-')[0] === test))\n .filter(entry => entry !== undefined)\n\n if (matchingBrowserLanguage.length === 0) return\n\n const firstMatch = matchingBrowserLanguage[0] as Language\n setLanguage(firstMatch)\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n <LanguageContext.Provider value={{\n language,\n setLanguage\n }}>\n {children}\n </LanguageContext.Provider>\n )\n}","import type { Dispatch, SetStateAction } from 'react'\nimport { useCallback, useEffect, useState } from 'react'\nimport { LocalStorageService } from '../util/storage'\n\ntype SetValue<T> = Dispatch<SetStateAction<T>>\nexport const useLocalStorage = <T>(key: string, initValue: T): [T, SetValue<T>] => {\n const get = useCallback((): T => {\n if (typeof window === 'undefined') {\n return initValue\n }\n const storageService = new LocalStorageService()\n const value = storageService.get<T>(key)\n return value || initValue\n }, [initValue, key])\n\n const [storedValue, setStoredValue] = useState<T>(get)\n\n const setValue: SetValue<T> = useCallback(value => {\n const newValue = value instanceof Function ? value(storedValue) : value\n const storageService = new LocalStorageService()\n storageService.set(key, value)\n\n setStoredValue(newValue)\n }, [storedValue, setStoredValue, key])\n\n useEffect(() => {\n setStoredValue(get())\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return [storedValue, setValue]\n}","/**\n * The supported languages\n */\nconst languages = ['en', 'de'] as const\n\n/**\n * The supported languages\n */\nexport type Language = typeof languages[number]\n\n/**\n * The supported languages' names in their respective language\n */\nconst languagesLocalNames: Record<Language, string> = {\n en: 'English',\n de: 'Deutsch',\n}\n\n/**\n * The default language\n */\nconst DEFAULT_LANGUAGE: Language = 'en'\n\n/**\n * A constant definition for holding data regarding languages\n */\nexport const LanguageUtil = {\n languages,\n DEFAULT_LANGUAGE,\n languagesLocalNames,\n}","import { useLanguage } from './LanguageProvider'\nimport type { Language } from './util'\n\nexport type Translation<T> = Record<Language, T>\n\ntype OverwriteTranslationType<Translation extends Record<string, unknown>> = {\n language?: Language,\n translation?: Partial<Record<Language, Partial<Translation>>>,\n}\n\n/**\n * Adds the `language` prop to the component props.\n *\n * @param Translation the type of the translation object\n *\n * @param Props the type of the component props, defaults to `Record<string, never>`,\n * if you don't expect any other props other than `language` and get an\n * error when using your component (because it uses `forwardRef` etc.)\n * you can try out `Record<string, unknown>`, this might resolve your\n * problem as `SomeType & never` is still `never` but `SomeType & unknown`\n * is `SomeType` which means that adding back props (like `ref` etc.)\n * works properly\n */\nexport type PropsForTranslation<\n Translation extends Record<string, unknown>,\n Props = Record<string, never>\n> = Props & {\n overwriteTranslation?: OverwriteTranslationType<Translation>,\n};\n\nexport const useTranslation = <Translation extends Record<string, unknown>>(\n defaults: Record<Language, Translation>,\n translationOverwrite: OverwriteTranslationType<Translation> = {}\n): Translation => {\n const { language: languageProp, translation: overwrite } = translationOverwrite\n const { language: inferredLanguage } = useLanguage()\n const usedLanguage = languageProp ?? inferredLanguage\n let defaultValues: Translation = defaults[usedLanguage]\n if (overwrite && overwrite[usedLanguage]) {\n defaultValues = { ...defaultValues, ...overwrite[usedLanguage] }\n }\n return defaultValues\n}\n","import type { PropsWithChildren, ReactNode } from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport ReactDOM from 'react-dom'\nimport clsx from 'clsx'\nimport { Tooltip } from '../user-action/Tooltip'\nimport { X } from 'lucide-react'\nimport { IconButton } from '../user-action/Button'\nimport type { PropsForTranslation } from '../../localization/useTranslation'\nimport { useTranslation } from '../../localization/useTranslation'\nimport type { Language } from '../../localization/util'\n\nexport type OverlayProps = PropsWithChildren<{\n /**\n * Whether the overlay should be currently displayed\n */\n isOpen: boolean,\n /**\n * Callback when the background is clicked\n */\n onBackgroundClick?: () => void,\n /**\n * Styling for the background\n *\n * To remove the darkening, set bg-transparent\n */\n backgroundClassName?: string,\n}>\n\n/**\n * A generic overlay window which is managed by its parent\n */\nexport const Overlay = ({\n children,\n isOpen,\n onBackgroundClick,\n backgroundClassName,\n }: PropsWithChildren<OverlayProps>) => {\n // The element to which the overlay will be attached to\n const [root, setRoot] = useState<HTMLElement>()\n\n useEffect(() => {\n setRoot(document.body)\n }, [])\n\n if (!root || !isOpen) return null\n\n\n return ReactDOM.createPortal(\n <div className={clsx('fixed inset-0 z-[9999]')}>\n <div\n className={clsx('fixed inset-0 h-screen w-screen bg-black/30', backgroundClassName)}\n onClick={onBackgroundClick}\n />\n {children}\n </div>,\n root\n )\n}\n\n\nlet overlayStack: HTMLDivElement[] = []\n\n\n// --- Modal ---\n\ntype ModalHeaderTranslation = {\n close: string,\n}\n\nconst defaultModalHeaderTranslation: Record<Language, ModalHeaderTranslation> = {\n en: {\n close: 'Close'\n },\n de: {\n close: 'Schließen'\n }\n}\n\nexport type OverlayHeaderProps = {\n /**\n * Callback when the close button is clicked. If omitted or undefined, the button is hidden\n */\n onClose?: () => void,\n /** The title of the Modal. If you want to only set the text use `titleText` instead */\n title?: ReactNode,\n /** The title text of the Modal. If you want to set a custom title use `title` instead */\n titleText?: string,\n /** The description of the Modal. If you want to only set the text use `descriptionText` instead */\n description?: ReactNode,\n /** The description text of the Modal. If you want to set a custom description use `description` instead */\n descriptionText?: string,\n}\n\n/**\n * A header that should be in an Overlay\n */\nexport const OverlayHeader = ({\n overwriteTranslation,\n onClose,\n title,\n titleText = '',\n description,\n descriptionText = ''\n }: PropsForTranslation<ModalHeaderTranslation, OverlayHeaderProps>) => {\n const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation)\n const hasTitleRow = !!title || !!titleText || !!onClose\n const titleRow = (\n <div className=\"row justify-between items-start gap-x-8\">\n {title ?? (\n <h2\n className={clsx('textstyle-title-lg', {\n 'mb-1': description || descriptionText,\n })}\n >\n {titleText}\n </h2>\n )}\n {!!onClose && (\n <Tooltip tooltip={translation.close}>\n <IconButton color=\"neutral\" size=\"small\" onClick={onClose}>\n <X className=\"w-full h-full\"/>\n </IconButton>\n </Tooltip>\n )}\n </div>\n )\n\n return (\n <div className=\"col\">\n {hasTitleRow && (titleRow)}\n {description ?? (descriptionText && (<span className=\"textstyle-description\">{descriptionText}</span>))}\n </div>\n )\n}\n\nexport type ModalProps = {\n isOpen: boolean,\n onClose: () => void,\n className?: string,\n backgroundClassName?: string,\n headerProps?: Omit<OverlayHeaderProps, 'onClose'>,\n}\n\n/**\n * A Generic Modal Window\n */\nexport const Modal = ({\n children,\n isOpen,\n onClose,\n className,\n backgroundClassName,\n headerProps,\n }: PropsWithChildren<ModalProps>) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (!isOpen) return\n\n const modal = ref.current\n\n if (!modal) {\n console.error('modal open, but no ref found')\n return\n }\n\n overlayStack.push(modal)\n\n const focusable = modal?.querySelectorAll(\n 'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex=\"-1\"])'\n )\n const first = focusable[0]\n const last = focusable[focusable.length - 1]\n\n const handleKeyDown = (e: KeyboardEvent) => {\n const isTopmost = overlayStack[overlayStack.length - 1] === modal\n if (!isTopmost) return\n\n if (e.key === 'Escape') {\n e.stopPropagation()\n onClose()\n } else if (e.key === 'Tab') {\n if (focusable.length === 0) return\n\n if (e.shiftKey && document.activeElement === first) {\n e.preventDefault();\n (last as HTMLElement).focus()\n } else if (!e.shiftKey && document.activeElement === last) {\n e.preventDefault();\n (first as HTMLElement).focus()\n }\n }\n }\n\n modal.focus()\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n overlayStack = overlayStack.filter(m => m !== modal)\n }\n }, [isOpen, onClose])\n\n return (\n <Overlay\n isOpen={isOpen}\n onBackgroundClick={onClose}\n backgroundClassName={backgroundClassName}\n >\n <div\n ref={ref}\n tabIndex={-1}\n className={clsx(\n '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',\n className\n )}\n role=\"dialog\"\n aria-modal={true}\n >\n <OverlayHeader {...headerProps} onClose={onClose}/>\n {children}\n </div>\n </Overlay>\n )\n}\n\n// --- Dialog ---\n\nexport type DialogProps = Omit<OverlayProps, 'onBackgroundClick'> & {\n headerProps?: Omit<OverlayHeaderProps, 'onClose'>,\n className?: string,\n}\n\n/**\n * A Generic Dialog Window\n */\nexport const Dialog = ({\n children,\n isOpen,\n className,\n backgroundClassName,\n headerProps,\n }: PropsWithChildren<DialogProps>) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (!isOpen) return\n\n const dialog = ref.current\n\n if (!dialog) {\n console.error('dialog open, but no ref found')\n return\n }\n\n overlayStack.push(dialog)\n\n const focusable = dialog?.querySelectorAll(\n 'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex=\"-1\"])'\n )\n const first = focusable[0]\n const last = focusable[focusable.length - 1]\n\n const handleKeyDown = (e: KeyboardEvent) => {\n const isTopmost = overlayStack[overlayStack.length - 1] === dialog\n if (!isTopmost) return\n\n if (e.key === 'Escape') {\n e.stopPropagation()\n } else if (e.key === 'Tab') {\n if (focusable.length === 0) return\n\n if (e.shiftKey && document.activeElement === first) {\n e.preventDefault();\n (last as HTMLElement).focus()\n } else if (!e.shiftKey && document.activeElement === last) {\n e.preventDefault();\n (first as HTMLElement).focus()\n }\n }\n }\n\n dialog.focus()\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n overlayStack = overlayStack.filter(m => m !== dialog)\n }\n }, [isOpen])\n\n return (\n <Overlay\n isOpen={isOpen}\n backgroundClassName={backgroundClassName}\n >\n <div\n ref={ref}\n tabIndex={-1}\n className={clsx(\n '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',\n className\n )}\n role=\"dialog\"\n aria-modal={true}\n >\n {!!headerProps && (<OverlayHeader {...headerProps}/>)}\n {children}\n </div>\n </Overlay>\n )\n}","import type { Dispatch, SetStateAction } from 'react'\nimport { useEffect, useState } from 'react'\n\ntype UseHoverStateProps = {\n /**\n * The delay after which the menu is closed in milliseconds\n *\n * default: 200ms\n */\n closingDelay: number,\n /**\n * Whether the hover state management should be disabled\n *\n * default: false\n */\n isDisabled: boolean,\n}\n\ntype UseHoverStateReturnType = {\n /**\n * Whether the element is hovered\n */\n isHovered: boolean,\n /**\n * Function to change the current hover status\n */\n setIsHovered: Dispatch<SetStateAction<boolean>>,\n /**\n * Handlers to pass on to the component that should be hovered\n */\n handlers: {\n onMouseEnter: () => void,\n onMouseLeave: () => void,\n },\n}\n\nconst defaultUseHoverStateProps: UseHoverStateProps = {\n closingDelay: 200,\n isDisabled: false,\n}\n\n/**\n * @param props See UseHoverStateProps\n *\n * A react hook for managing the hover state of a component. The handlers provided should be\n * forwarded to the component which should be hovered over\n */\nexport const useHoverState = (props: Partial<UseHoverStateProps> | undefined = undefined): UseHoverStateReturnType => {\n const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props }\n\n const [isHovered, setIsHovered] = useState(false)\n const [timer, setTimer] = useState<NodeJS.Timeout>()\n\n const onMouseEnter = () => {\n if (isDisabled) {\n return\n }\n clearTimeout(timer)\n setIsHovered(true)\n }\n\n const onMouseLeave = () => {\n if (isDisabled) {\n return\n }\n setTimer(setTimeout(() => {\n setIsHovered(false)\n }, closingDelay))\n }\n\n useEffect(() => {\n if (timer) {\n return () => {\n clearTimeout(timer)\n }\n }\n })\n\n useEffect(() => {\n if (timer) {\n clearTimeout(timer)\n }\n }, [isDisabled]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return {\n isHovered, setIsHovered, handlers: { onMouseEnter, onMouseLeave }\n }\n}\n","import type { CSSProperties, PropsWithChildren, ReactNode } from 'react'\nimport { useHoverState } from '../../hooks/useHoverState'\nimport { clsx } from 'clsx'\n\ntype Position = 'top' | 'bottom' | 'left' | 'right'\n\nexport type TooltipProps = PropsWithChildren<{\n tooltip: string | ReactNode,\n /**\n * Number of milliseconds until the tooltip appears\n *\n * defaults to 1000ms\n */\n animationDelay?: number,\n /**\n * Class names of additional styling properties for the tooltip\n */\n tooltipClassName?: string,\n /**\n * Class names of additional styling properties for the container from which the tooltip will be created\n */\n containerClassName?: string,\n position?: Position,\n zIndex?: number,\n}>\n\n/**\n * A Component for showing a tooltip when hovering over Content\n * @param tooltip The tooltip to show can be a text or any ReactNode\n * @param children The Content for which the tooltip should be created\n * @param animationDelay The delay before the tooltip appears\n * @param tooltipClassName Additional ClassNames for the Container of the tooltip\n * @param containerClassName Additional ClassNames for the Container holding the content\n * @param position The direction of the tooltip relative to the Container\n * @param zIndex The z Index of the tooltip (you may require this when stacking modal)\n * @constructor\n */\nexport const Tooltip = ({\n tooltip,\n children,\n animationDelay = 650,\n tooltipClassName = '',\n containerClassName = '',\n position = 'bottom',\n zIndex = 10,\n }: TooltipProps) => {\n const { isHovered, handlers } = useHoverState()\n\n const positionClasses = {\n top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,\n bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,\n left: `right-full top-1/2 -translate-y-1/2 mr-[6px]`,\n right: `left-full top-1/2 -translate-y-1/2 ml-[6px]`\n }\n\n const triangleSize = 6\n const triangleClasses = {\n top: `top-full left-1/2 -translate-x-1/2 border-t-tooltip-background border-l-transparent border-r-transparent`,\n bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-tooltip-background border-l-transparent border-r-transparent`,\n left: `left-full top-1/2 -translate-y-1/2 border-l-tooltip-background border-t-transparent border-b-transparent`,\n right: `right-full top-1/2 -translate-y-1/2 border-r-tooltip-background border-t-transparent border-b-transparent`\n }\n\n const triangleStyle: Record<Position, CSSProperties> = {\n top: { borderWidth: `${triangleSize}px ${triangleSize}px 0 ${triangleSize}px` },\n bottom: { borderWidth: `0 ${triangleSize}px ${triangleSize}px ${triangleSize}px` },\n left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },\n right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }\n }\n\n return (\n <div\n className={clsx('relative inline-block', containerClassName)}\n {...handlers}\n >\n {children}\n {isHovered && (\n <div\n className={clsx(\n `opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap\n animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,\n positionClasses[position], tooltipClassName\n )}\n style={{ zIndex, animationDelay: animationDelay + 'ms' }}\n >\n {tooltip}\n <div\n className={clsx(`absolute w-0 h-0`, triangleClasses[position])}\n style={{ ...triangleStyle[position], zIndex: zIndex + 1 }}\n />\n </div>\n )}\n </div>\n )\n}\n"],"mappings":";;;;;;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C;AAAA,MAEF;AAAA,QAAC;AAAA;AAAA,UACC,WAAS;AAAA,UACT,OAAO,mBAAmB,CAAC,EAAE,SAAS,QAAQ,WAAW;AAAA,UACzD,SAAS;AAAA,UACT,UAAU,mBAAmB,CAAC,EAAE,YAAY;AAAA,UAE3C,6BAAmB,CAAC,EAAE,QAAQ,YAAY;AAAA;AAAA,MAC7C;AAAA,OACF;AAAA,KACF;AAEJ;","names":["clsx","clsx","import_react","import_jsx_runtime","import_clsx","import_react","import_clsx","import_react","import_clsx","import_jsx_runtime","import_jsx_runtime","ReactDOM","clsx","clsx","import_jsx_runtime","clsx"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/dialogs/ConfirmDialog.tsx","../../../src/components/user-action/Button.tsx","../../../src/localization/LanguageProvider.tsx","../../../src/hooks/useLocalStorage.ts","../../../src/localization/util.ts","../../../src/localization/useTranslation.ts","../../../src/components/layout-and-navigation/Overlay.tsx","../../../src/hooks/useHoverState.ts","../../../src/components/user-action/Tooltip.tsx","../../../src/localization/defaults/form.ts"],"sourcesContent":["import type { PropsWithChildren } from 'react'\nimport type { SolidButtonColor } from '../user-action/Button'\nimport { SolidButton } from '../user-action/Button'\nimport type { PropsForTranslation } from '../../localization/useTranslation'\nimport { useTranslation } from '../../localization/useTranslation'\nimport clsx from 'clsx'\nimport type { DialogProps } from '../layout-and-navigation/Overlay'\nimport { Dialog } from '../layout-and-navigation/Overlay'\nimport type { FormTranslationType } from '../../localization/defaults/form'\nimport { formTranslation } from '../../localization/defaults/form'\n\ntype ConfirmDialogTranslation = FormTranslationType\n\nexport type ConfirmDialogType = 'positive' | 'negative' | 'neutral' | 'primary'\n\ntype ButtonOverwriteType = {\n text?: string,\n color?: SolidButtonColor,\n disabled?: boolean,\n}\n\nexport type ConfirmDialogProps = DialogProps & {\n isShowingDecline?: boolean,\n requireAnswer?: boolean,\n onConfirm: () => void,\n onDecline?: () => void,\n confirmType?: ConfirmDialogType,\n /**\n * Order: Decline, Confirm\n */\n buttonOverwrites?: [ButtonOverwriteType, ButtonOverwriteType],\n}\n\n/**\n * A Dialog for demanding the user for confirmation\n *\n * To allow for background closing, prefer using a ConfirmModal\n */\nexport const ConfirmDialog = ({\n overwriteTranslation,\n children,\n onConfirm,\n onDecline,\n confirmType = 'positive',\n buttonOverwrites,\n className,\n ...restProps\n }: PropsForTranslation<ConfirmDialogTranslation, PropsWithChildren<ConfirmDialogProps>>) => {\n const translation = useTranslation([formTranslation], overwriteTranslation)\n\n const mapping: Record<ConfirmDialogType, SolidButtonColor> = {\n neutral: 'primary',\n negative: 'negative',\n positive: 'positive',\n primary: 'primary',\n }\n\n return (\n <Dialog {...restProps} className={clsx('justify-between', className)}>\n <div className=\"col grow\">\n {children}\n </div>\n <div className=\"row mt-3 gap-x-4 justify-end\">\n {onDecline && (\n <SolidButton\n color={buttonOverwrites?.[0].color ?? 'negative'}\n onClick={onDecline}\n\n disabled={buttonOverwrites?.[0].disabled ?? false}\n >\n {buttonOverwrites?.[0].text ?? translation('decline')}\n </SolidButton>\n )}\n <SolidButton\n autoFocus\n color={buttonOverwrites?.[1].color ?? mapping[confirmType]}\n onClick={onConfirm}\n disabled={buttonOverwrites?.[1].disabled ?? false}\n >\n {buttonOverwrites?.[1].text ?? translation('confirm')}\n </SolidButton>\n </div>\n </Dialog>\n )\n}\n","import type { ButtonHTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport clsx from 'clsx'\n\n\nexport const ButtonColorUtil = {\n solid: ['primary', 'secondary', 'tertiary', 'positive', 'warning', 'negative', 'neutral'] as const,\n text: ['primary', 'negative', 'neutral'] as const,\n outline: ['primary'] as const,\n}\n\n\n/**\n * The allowed colors for the SolidButton and IconButton\n */\nexport type SolidButtonColor = typeof ButtonColorUtil.solid[number]\n/**\n * The allowed colors for the OutlineButton\n */\nexport type OutlineButtonColor = typeof ButtonColorUtil.outline[number]\n/**\n * The allowed colors for the TextButton\n */\nexport type TextButtonColor = typeof ButtonColorUtil.text[number]\n\n/**\n * The different sizes for a button\n */\ntype ButtonSizes = 'small' | 'medium' | 'large'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}> & ButtonHTMLAttributes<Element>\n\nconst paddingMapping: Record<ButtonSizes, string> = {\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\n}\n\nconst iconPaddingMapping: Record<ButtonSizes, string> = {\n small: 'icon-btn-sm',\n medium: 'icon-btn-md',\n large: 'icon-btn-lg'\n}\n\nexport const ButtonUtil = {\n paddingMapping,\n iconPaddingMapping\n}\n\ntype ButtonWithIconsProps = ButtonProps & {\n startIcon?: ReactNode,\n endIcon?: ReactNode,\n}\n\nexport type SolidButtonProps = ButtonWithIconsProps & {\n color?: SolidButtonColor,\n}\n\nexport type OutlineButtonProps = ButtonWithIconsProps & {\n color?: OutlineButtonColor,\n}\n\nexport type TextButtonProps = ButtonWithIconsProps & {\n color?: TextButtonColor,\n}\n\nexport type IconButtonProps = ButtonProps & {\n color?: SolidButtonColor,\n}\n\n/**\n * A button with a solid background and different sizes\n */\nconst SolidButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: SolidButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-solid-primary-icon',\n secondary: 'text-button-solid-secondary-icon',\n tertiary: 'text-button-solid-tertiary-icon',\n positive: 'text-button-solid-positive-icon',\n warning: 'text-button-solid-warning-icon',\n negative: 'text-button-solid-negative-icon',\n neutral: 'text-button-solid-neutral-icon',\n }[color]\n\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A button with an outline border and different sizes\n */\nconst OutlineButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent border-2 border-button-outline-primary-text text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text border-disabled-outline cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-80')]: !disabled,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A text that is a button that can have different sizes\n */\nconst TextButton = ({\n children,\n disabled = false,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent text-button-text-primary-text',\n negative: 'bg-transparent text-button-text-negative-text',\n neutral: 'bg-transparent text-button-text-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-text-primary-icon',\n negative: 'text-button-text-negative-icon',\n neutral: 'text-button-text-neutral-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:bg-button-text-hover-background rounded-full')]: !disabled,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n\n/**\n * A button for icons with a solid background and different sizes\n */\nconst IconButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n onClick,\n className,\n ...restProps\n }: IconButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n }[color]\n\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled\n },\n ButtonUtil.iconPaddingMapping[size],\n className\n )}\n {...restProps}\n >\n {children}\n </button>\n )\n}\n\nexport { SolidButton, OutlineButton, TextButton, IconButton }\n","import type { Dispatch, PropsWithChildren, SetStateAction } from 'react'\nimport { createContext, useContext, useEffect, useState } from 'react'\nimport { useLocalStorage } from '../hooks/useLocalStorage'\nimport type { Language } from './util'\nimport { LanguageUtil } from './util'\n\nexport type LanguageContextValue = {\n language: Language,\n setLanguage: Dispatch<SetStateAction<Language>>,\n}\n\nexport const LanguageContext = createContext<LanguageContextValue>({\n language: LanguageUtil.DEFAULT_LANGUAGE,\n setLanguage: (v) => v\n})\n\nexport const useLanguage = () => useContext(LanguageContext)\n\nexport const useLocale = (overWriteLanguage?: Language) => {\n const { language } = useLanguage()\n const mapping: Record<Language, string> = {\n en: 'en-US',\n de: 'de-DE'\n }\n return mapping[overWriteLanguage ?? language]\n}\n\ntype LanguageProviderProps = {\n initialLanguage?: Language,\n}\n\nexport const LanguageProvider = ({ initialLanguage, children }: PropsWithChildren<LanguageProviderProps>) => {\n const [language, setLanguage] = useState<Language>(initialLanguage ?? LanguageUtil.DEFAULT_LANGUAGE)\n const [storedLanguage, setStoredLanguage] = useLocalStorage<Language>('language', initialLanguage ?? LanguageUtil.DEFAULT_LANGUAGE)\n\n useEffect(() => {\n if (language !== initialLanguage && initialLanguage) {\n console.warn('LanguageProvider initial state changed: Prefer using languageProvider\\'s setLanguage instead')\n setLanguage(initialLanguage)\n }\n }, [initialLanguage]) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n // TODO set locale of html tag here as well\n setStoredLanguage(language)\n }, [language, setStoredLanguage])\n\n useEffect(() => {\n if (storedLanguage !== null) {\n setLanguage(storedLanguage)\n return\n }\n\n const LanguageToTestAgainst = Object.values(LanguageUtil.languages)\n\n const matchingBrowserLanguage = window.navigator.languages\n .map(language => LanguageToTestAgainst.find((test) => language === test || language.split('-')[0] === test))\n .filter(entry => entry !== undefined)\n\n if (matchingBrowserLanguage.length === 0) return\n\n const firstMatch = matchingBrowserLanguage[0] as Language\n setLanguage(firstMatch)\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n <LanguageContext.Provider value={{\n language,\n setLanguage\n }}>\n {children}\n </LanguageContext.Provider>\n )\n}","import type { Dispatch, SetStateAction } from 'react'\nimport { useCallback, useEffect, useState } from 'react'\nimport { LocalStorageService } from '../util/storage'\n\ntype SetValue<T> = Dispatch<SetStateAction<T>>\nexport const useLocalStorage = <T>(key: string, initValue: T): [T, SetValue<T>] => {\n const get = useCallback((): T => {\n if (typeof window === 'undefined') {\n return initValue\n }\n const storageService = new LocalStorageService()\n const value = storageService.get<T>(key)\n return value || initValue\n }, [initValue, key])\n\n const [storedValue, setStoredValue] = useState<T>(get)\n\n const setValue: SetValue<T> = useCallback(value => {\n const newValue = value instanceof Function ? value(storedValue) : value\n const storageService = new LocalStorageService()\n storageService.set(key, value)\n\n setStoredValue(newValue)\n }, [storedValue, setStoredValue, key])\n\n useEffect(() => {\n setStoredValue(get())\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return [storedValue, setValue]\n}","/**\n * The supported languages\n */\nconst languages = ['en', 'de'] as const\n\n/**\n * The supported languages\n */\nexport type Language = typeof languages[number]\n\n/**\n * The supported languages' names in their respective language\n */\nconst languagesLocalNames: Record<Language, string> = {\n en: 'English',\n de: 'Deutsch',\n}\n\n/**\n * The default language\n */\nconst DEFAULT_LANGUAGE: Language = 'en'\n\n/**\n * A constant definition for holding data regarding languages\n */\nexport const LanguageUtil = {\n languages,\n DEFAULT_LANGUAGE,\n languagesLocalNames,\n}","import { useLanguage } from './LanguageProvider'\nimport type { Language } from './util'\n\n/**\n * A type describing the pluralization of a word\n */\nexport type TranslationPlural = {\n zero?: string,\n one?: string,\n two?: string,\n few?: string,\n many?: string,\n other: string,\n}\n\n/**\n * The type describing all values of a translation\n */\nexport type TranslationType = Record<string, string | TranslationPlural>\n\n/**\n * The type of translations\n */\nexport type Translation<T extends TranslationType> = Record<Language, T>\n\ntype OverwriteTranslationType<T extends TranslationType> = {\n language?: Language,\n translation?: Translation<Partial<T>>,\n}\n\n/**\n * Adds the `language` prop to the component props.\n *\n * @param Translation the type of the translation object\n *\n * @param Props the type of the component props, defaults to `Record<string, never>`,\n * if you don't expect any other props other than `language` and get an\n * error when using your component (because it uses `forwardRef` etc.)\n * you can try out `Record<string, unknown>`, this might resolve your\n * problem as `SomeType & never` is still `never` but `SomeType & unknown`\n * is `SomeType` which means that adding back props (like `ref` etc.)\n * works properly\n */\nexport type PropsForTranslation<\n Translation extends TranslationType,\n Props = unknown\n> = Props & {\n overwriteTranslation?: OverwriteTranslationType<Translation>,\n}\n\ntype StringKeys<T> = Extract<keyof T, string>;\n\ntype TranslationFunctionOptions = {\n replacements?: Record<string, string>,\n count?: number,\n}\ntype TranslationFunction<T extends TranslationType> = (key: StringKeys<T>, options?: TranslationFunctionOptions) => string\n\nexport const TranslationPluralCount = {\n zero: 0,\n one: 1,\n two: 2,\n few: 3,\n many: 11,\n other: -1,\n}\n\n\nexport const useTranslation = <T extends TranslationType>(\n translations: Translation<Partial<TranslationType>>[],\n overwriteTranslation: OverwriteTranslationType<T> = {}\n): TranslationFunction<T> => {\n const { language: languageProp, translation: overwrite } = overwriteTranslation\n const { language: inferredLanguage } = useLanguage()\n const usedLanguage = languageProp ?? inferredLanguage\n const usedTranslations = [...translations]\n if (overwrite) {\n usedTranslations.push(overwrite)\n }\n\n return (key: StringKeys<T>, options?: TranslationFunctionOptions): string => {\n const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options }\n\n try {\n for (let i = translations.length - 1; i >= 0; i--) {\n const translation = translations[i]\n const localizedTranslation = translation[usedLanguage]\n if (!localizedTranslation) {\n continue\n }\n const value = localizedTranslation[key]\n if(!value) {\n continue\n }\n\n let forProcessing: string\n if (typeof value !== 'string') {\n if (count === TranslationPluralCount.zero && value?.zero) {\n forProcessing = value.zero\n } else if (count === TranslationPluralCount.one && value?.one) {\n forProcessing = value.one\n } else if (count === TranslationPluralCount.two && value?.two) {\n forProcessing = value.two\n } else if (TranslationPluralCount.few <= count && count < TranslationPluralCount.many && value?.few) {\n forProcessing = value.few\n } else if (count > TranslationPluralCount.many && value?.many) {\n forProcessing = value.many\n } else {\n forProcessing = value.other\n }\n } else {\n forProcessing = value\n }\n forProcessing = forProcessing.replace(/\\{\\{(\\w+)}}/g, (_, placeholder) => {\n return replacements[placeholder] ?? `{{key:${placeholder}}}` // fallback if key is missing\n })\n return forProcessing\n }\n } catch (e) {\n console.error(e)\n }\n return `{{${usedLanguage}:${key}}}`\n }\n}","import type { PropsWithChildren, ReactNode } from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport ReactDOM from 'react-dom'\nimport clsx from 'clsx'\nimport { Tooltip } from '../user-action/Tooltip'\nimport { X } from 'lucide-react'\nimport { IconButton } from '../user-action/Button'\nimport type { PropsForTranslation, Translation } from '../../localization/useTranslation'\nimport { useTranslation } from '../../localization/useTranslation'\nimport type { FormTranslationType } from '../../localization/defaults/form'\nimport { formTranslation } from '../../localization/defaults/form'\n\nexport type OverlayProps = PropsWithChildren<{\n /**\n * Whether the overlay should be currently displayed\n */\n isOpen: boolean,\n /**\n * Callback when the background is clicked\n */\n onBackgroundClick?: () => void,\n /**\n * Styling for the background\n *\n * To remove the darkening, set bg-transparent\n */\n backgroundClassName?: string,\n}>\n\n/**\n * A generic overlay window which is managed by its parent\n */\nexport const Overlay = ({\n children,\n isOpen,\n onBackgroundClick,\n backgroundClassName,\n }: PropsWithChildren<OverlayProps>) => {\n // The element to which the overlay will be attached to\n const [root, setRoot] = useState<HTMLElement>()\n\n useEffect(() => {\n setRoot(document.body)\n }, [])\n\n if (!root || !isOpen) return null\n\n\n return ReactDOM.createPortal(\n <div className={clsx('fixed inset-0 z-[9999]')}>\n <div\n className={clsx('fixed inset-0 h-screen w-screen bg-black/30', backgroundClassName)}\n onClick={onBackgroundClick}\n />\n {children}\n </div>,\n root\n )\n}\n\n\nlet overlayStack: HTMLDivElement[] = []\n\n\n// --- Modal ---\n\ntype ModalHeaderTranslation = FormTranslationType\n\nconst defaultModalHeaderTranslation: Translation<FormTranslationType> = {\n en: {\n ...formTranslation.en\n },\n de: {\n ...formTranslation.de\n }\n}\n\nexport type OverlayHeaderProps = {\n /**\n * Callback when the close button is clicked. If omitted or undefined, the button is hidden\n */\n onClose?: () => void,\n /** The title of the Modal. If you want to only set the text use `titleText` instead */\n title?: ReactNode,\n /** The title text of the Modal. If you want to set a custom title use `title` instead */\n titleText?: string,\n /** The description of the Modal. If you want to only set the text use `descriptionText` instead */\n description?: ReactNode,\n /** The description text of the Modal. If you want to set a custom description use `description` instead */\n descriptionText?: string,\n}\n\n/**\n * A header that should be in an Overlay\n */\nexport const OverlayHeader = ({\n overwriteTranslation,\n onClose,\n title,\n titleText = '',\n description,\n descriptionText = ''\n }: PropsForTranslation<ModalHeaderTranslation, OverlayHeaderProps>) => {\n const translation = useTranslation([defaultModalHeaderTranslation], overwriteTranslation)\n const hasTitleRow = !!title || !!titleText || !!onClose\n const titleRow = (\n <div className=\"row justify-between items-start gap-x-8\">\n {title ?? (\n <h2\n className={clsx('textstyle-title-lg', {\n 'mb-1': description || descriptionText,\n })}\n >\n {titleText}\n </h2>\n )}\n {!!onClose && (\n <Tooltip tooltip={translation('close')}>\n <IconButton color=\"neutral\" size=\"small\" onClick={onClose}>\n <X className=\"w-full h-full\"/>\n </IconButton>\n </Tooltip>\n )}\n </div>\n )\n\n return (\n <div className=\"col\">\n {hasTitleRow && (titleRow)}\n {description ?? (descriptionText && (<span className=\"textstyle-description\">{descriptionText}</span>))}\n </div>\n )\n}\n\nexport type ModalProps = {\n isOpen: boolean,\n onClose: () => void,\n className?: string,\n backgroundClassName?: string,\n headerProps?: Omit<OverlayHeaderProps, 'onClose'>,\n}\n\n/**\n * A Generic Modal Window\n */\nexport const Modal = ({\n children,\n isOpen,\n onClose,\n className,\n backgroundClassName,\n headerProps,\n }: PropsWithChildren<ModalProps>) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (!isOpen) return\n\n const modal = ref.current\n\n if (!modal) {\n console.error('modal open, but no ref found')\n return\n }\n\n overlayStack.push(modal)\n\n const focusable = modal?.querySelectorAll(\n 'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex=\"-1\"])'\n )\n const first = focusable[0]\n const last = focusable[focusable.length - 1]\n\n const handleKeyDown = (e: KeyboardEvent) => {\n const isTopmost = overlayStack[overlayStack.length - 1] === modal\n if (!isTopmost) return\n\n if (e.key === 'Escape') {\n e.stopPropagation()\n onClose()\n } else if (e.key === 'Tab') {\n if (focusable.length === 0) return\n\n if (e.shiftKey && document.activeElement === first) {\n e.preventDefault();\n (last as HTMLElement).focus()\n } else if (!e.shiftKey && document.activeElement === last) {\n e.preventDefault();\n (first as HTMLElement).focus()\n }\n }\n }\n\n modal.focus()\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n overlayStack = overlayStack.filter(m => m !== modal)\n }\n }, [isOpen, onClose])\n\n return (\n <Overlay\n isOpen={isOpen}\n onBackgroundClick={onClose}\n backgroundClassName={backgroundClassName}\n >\n <div\n ref={ref}\n tabIndex={-1}\n className={clsx(\n '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',\n className\n )}\n role=\"dialog\"\n aria-modal={true}\n >\n <OverlayHeader {...headerProps} onClose={onClose}/>\n {children}\n </div>\n </Overlay>\n )\n}\n\n// --- Dialog ---\n\nexport type DialogProps = Omit<OverlayProps, 'onBackgroundClick'> & {\n headerProps?: Omit<OverlayHeaderProps, 'onClose'>,\n className?: string,\n}\n\n/**\n * A Generic Dialog Window\n */\nexport const Dialog = ({\n children,\n isOpen,\n className,\n backgroundClassName,\n headerProps,\n }: PropsWithChildren<DialogProps>) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (!isOpen) return\n\n const dialog = ref.current\n\n if (!dialog) {\n console.error('dialog open, but no ref found')\n return\n }\n\n overlayStack.push(dialog)\n\n const focusable = dialog?.querySelectorAll(\n 'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex=\"-1\"])'\n )\n const first = focusable[0]\n const last = focusable[focusable.length - 1]\n\n const handleKeyDown = (e: KeyboardEvent) => {\n const isTopmost = overlayStack[overlayStack.length - 1] === dialog\n if (!isTopmost) return\n\n if (e.key === 'Escape') {\n e.stopPropagation()\n } else if (e.key === 'Tab') {\n if (focusable.length === 0) return\n\n if (e.shiftKey && document.activeElement === first) {\n e.preventDefault();\n (last as HTMLElement).focus()\n } else if (!e.shiftKey && document.activeElement === last) {\n e.preventDefault();\n (first as HTMLElement).focus()\n }\n }\n }\n\n dialog.focus()\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n overlayStack = overlayStack.filter(m => m !== dialog)\n }\n }, [isOpen])\n\n return (\n <Overlay\n isOpen={isOpen}\n backgroundClassName={backgroundClassName}\n >\n <div\n ref={ref}\n tabIndex={-1}\n className={clsx(\n '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',\n className\n )}\n role=\"dialog\"\n aria-modal={true}\n >\n {!!headerProps && (<OverlayHeader {...headerProps}/>)}\n {children}\n </div>\n </Overlay>\n )\n}","import type { Dispatch, SetStateAction } from 'react'\nimport { useEffect, useState } from 'react'\n\ntype UseHoverStateProps = {\n /**\n * The delay after which the menu is closed in milliseconds\n *\n * default: 200ms\n */\n closingDelay: number,\n /**\n * Whether the hover state management should be disabled\n *\n * default: false\n */\n isDisabled: boolean,\n}\n\ntype UseHoverStateReturnType = {\n /**\n * Whether the element is hovered\n */\n isHovered: boolean,\n /**\n * Function to change the current hover status\n */\n setIsHovered: Dispatch<SetStateAction<boolean>>,\n /**\n * Handlers to pass on to the component that should be hovered\n */\n handlers: {\n onMouseEnter: () => void,\n onMouseLeave: () => void,\n },\n}\n\nconst defaultUseHoverStateProps: UseHoverStateProps = {\n closingDelay: 200,\n isDisabled: false,\n}\n\n/**\n * @param props See UseHoverStateProps\n *\n * A react hook for managing the hover state of a component. The handlers provided should be\n * forwarded to the component which should be hovered over\n */\nexport const useHoverState = (props: Partial<UseHoverStateProps> | undefined = undefined): UseHoverStateReturnType => {\n const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props }\n\n const [isHovered, setIsHovered] = useState(false)\n const [timer, setTimer] = useState<NodeJS.Timeout>()\n\n const onMouseEnter = () => {\n if (isDisabled) {\n return\n }\n clearTimeout(timer)\n setIsHovered(true)\n }\n\n const onMouseLeave = () => {\n if (isDisabled) {\n return\n }\n setTimer(setTimeout(() => {\n setIsHovered(false)\n }, closingDelay))\n }\n\n useEffect(() => {\n if (timer) {\n return () => {\n clearTimeout(timer)\n }\n }\n })\n\n useEffect(() => {\n if (timer) {\n clearTimeout(timer)\n }\n }, [isDisabled]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return {\n isHovered, setIsHovered, handlers: { onMouseEnter, onMouseLeave }\n }\n}\n","import type { CSSProperties, PropsWithChildren, ReactNode } from 'react'\nimport { useHoverState } from '../../hooks/useHoverState'\nimport { clsx } from 'clsx'\n\ntype Position = 'top' | 'bottom' | 'left' | 'right'\n\nexport type TooltipProps = PropsWithChildren<{\n tooltip: string | ReactNode,\n /**\n * Number of milliseconds until the tooltip appears\n *\n * defaults to 1000ms\n */\n animationDelay?: number,\n /**\n * Class names of additional styling properties for the tooltip\n */\n tooltipClassName?: string,\n /**\n * Class names of additional styling properties for the container from which the tooltip will be created\n */\n containerClassName?: string,\n position?: Position,\n zIndex?: number,\n}>\n\n/**\n * A Component for showing a tooltip when hovering over Content\n * @param tooltip The tooltip to show can be a text or any ReactNode\n * @param children The Content for which the tooltip should be created\n * @param animationDelay The delay before the tooltip appears\n * @param tooltipClassName Additional ClassNames for the Container of the tooltip\n * @param containerClassName Additional ClassNames for the Container holding the content\n * @param position The direction of the tooltip relative to the Container\n * @param zIndex The z Index of the tooltip (you may require this when stacking modal)\n * @constructor\n */\nexport const Tooltip = ({\n tooltip,\n children,\n animationDelay = 650,\n tooltipClassName = '',\n containerClassName = '',\n position = 'bottom',\n zIndex = 10,\n }: TooltipProps) => {\n const { isHovered, handlers } = useHoverState()\n\n const positionClasses = {\n top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,\n bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,\n left: `right-full top-1/2 -translate-y-1/2 mr-[6px]`,\n right: `left-full top-1/2 -translate-y-1/2 ml-[6px]`\n }\n\n const triangleSize = 6\n const triangleClasses = {\n top: `top-full left-1/2 -translate-x-1/2 border-t-tooltip-background border-l-transparent border-r-transparent`,\n bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-tooltip-background border-l-transparent border-r-transparent`,\n left: `left-full top-1/2 -translate-y-1/2 border-l-tooltip-background border-t-transparent border-b-transparent`,\n right: `right-full top-1/2 -translate-y-1/2 border-r-tooltip-background border-t-transparent border-b-transparent`\n }\n\n const triangleStyle: Record<Position, CSSProperties> = {\n top: { borderWidth: `${triangleSize}px ${triangleSize}px 0 ${triangleSize}px` },\n bottom: { borderWidth: `0 ${triangleSize}px ${triangleSize}px ${triangleSize}px` },\n left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },\n right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }\n }\n\n return (\n <div\n className={clsx('relative inline-block', containerClassName)}\n {...handlers}\n >\n {children}\n {isHovered && (\n <div\n className={clsx(\n `opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap\n animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,\n positionClasses[position], tooltipClassName\n )}\n style={{ zIndex, animationDelay: animationDelay + 'ms' }}\n >\n {tooltip}\n <div\n className={clsx(`absolute w-0 h-0`, triangleClasses[position])}\n style={{ ...triangleStyle[position], zIndex: zIndex + 1 }}\n />\n </div>\n )}\n </div>\n )\n}\n","import type { Translation } from '../useTranslation'\n\nexport type FormTranslationType = {\n all: string,\n back: string,\n cancel: string,\n change: string,\n clear: string,\n close: string,\n confirm: string,\n decline: string,\n delete: string,\n discard: string,\n discardChanges: string,\n done: string,\n edit: string,\n enterText: string,\n error: string,\n exit: string,\n fieldRequiredError: string,\n invalidEmailError: string,\n less: string,\n loading: string,\n maxLengthError: string,\n minLengthError: string,\n more: string,\n next: string,\n no: string,\n none: string,\n of: string,\n optional: string,\n pleaseWait: string,\n previous: string,\n remove: string,\n required: string,\n reset: string,\n save: string,\n search: string,\n select: string,\n selectOption: string,\n show: string,\n showMore: string,\n showLess: string,\n submit: string,\n success: string,\n unsavedChanges: string,\n unsavedChangesSaveQuestion: string,\n update: string,\n yes: string,\n}\n\nexport const formTranslation: Translation<FormTranslationType> = {\n en: {\n all: 'All',\n back: 'Back',\n cancel: 'Cancel',\n change: 'Change',\n clear: 'Clear',\n close: 'Close',\n confirm: 'Confirm',\n decline: 'Decline',\n delete: 'Delete',\n discard: 'Discard',\n discardChanges: 'Discard Changes',\n done: 'Done',\n edit: 'Edit',\n enterText: 'Enter text here',\n error: 'Error',\n exit: 'Exit',\n fieldRequiredError: 'This field is required.',\n invalidEmailError: 'Please enter a valid email address.',\n less: 'Less',\n loading: 'Loading',\n maxLengthError: 'Maximum length exceeded.',\n minLengthError: 'Minimum length not met.',\n more: 'More',\n next: 'Next',\n no: 'No',\n none: 'None',\n of: 'of',\n optional: 'Optional',\n pleaseWait: 'Please wait...',\n previous: 'Previous',\n remove: 'Remove',\n required: 'Required',\n reset: 'Reset',\n save: 'Save',\n search: 'Search',\n select: 'Select',\n selectOption: 'Select an option',\n show: 'Show',\n showMore: 'Show more',\n showLess: 'Show less',\n submit: 'Submit',\n success: 'Success',\n update: 'Update',\n unsavedChanges: 'Unsaved Changes',\n unsavedChangesSaveQuestion: 'Do you want to save your changes?',\n yes: 'Yes',\n },\n de: {\n all: 'Alle',\n back: 'Zurück',\n cancel: 'Abbrechen',\n change: 'Ändern',\n clear: 'Löschen',\n close: 'Schließen',\n confirm: 'Bestätigen',\n decline: 'Ablehnen',\n delete: 'Löschen',\n discard: 'Verwerfen',\n discardChanges: 'Änderungen Verwerfen',\n done: 'Fertig',\n edit: 'Bearbeiten',\n enterText: 'Text hier eingeben',\n error: 'Fehler',\n exit: 'Beenden',\n fieldRequiredError: 'Dieses Feld ist erforderlich.',\n invalidEmailError: 'Bitte geben Sie eine gültige E-Mail-Adresse ein.',\n less: 'Weniger',\n loading: 'Lädt',\n maxLengthError: 'Maximale Länge überschritten.',\n minLengthError: 'Mindestlänge nicht erreicht.',\n more: 'Mehr',\n next: 'Weiter',\n no: 'Nein',\n none: 'Nichts',\n of: 'von',\n optional: 'Optional',\n pleaseWait: 'Bitte warten...',\n previous: 'Vorherige',\n remove: 'Entfernen',\n required: 'Erforderlich',\n reset: 'Zurücksetzen',\n save: 'Speichern',\n search: 'Suche',\n select: 'Select',\n selectOption: 'Option auswählen',\n show: 'Anzeigen',\n showMore: 'Mehr anzeigen',\n showLess: 'Weniger anzeigen',\n submit: 'Abschicken',\n success: 'Erfolg',\n update: 'Update',\n unsavedChanges: 'Ungespeicherte Änderungen',\n unsavedChangesSaveQuestion: 'Möchtest du die Änderungen speichern?',\n yes: 'Ja',\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,kBAAiB;AA+Gb;AAzEJ,IAAM,iBAA8C;AAAA,EAClD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;AAEA,IAAM,qBAAkD;AAAA,EACtD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;AAEO,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AACF;AA0BA,IAAM,cAAc,CAAC;AAAA,EACE;AAAA,EACA,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,EACP;AAAA,EAC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;AAAA;AAAA,UACC,WAAS;AAAA,UACT,OAAO,mBAAmB,CAAC,EAAE,SAAS,QAAQ,WAAW;AAAA,UACzD,SAAS;AAAA,UACT,UAAU,mBAAmB,CAAC,EAAE,YAAY;AAAA,UAE3C,6BAAmB,CAAC,EAAE,QAAQ,YAAY,SAAS;AAAA;AAAA,MACtD;AAAA,OACF;AAAA,KACF;AAEJ;","names":["clsx","clsx","import_react","import_jsx_runtime","import_clsx","import_react","import_clsx","import_react","import_clsx","import_jsx_runtime","import_jsx_runtime","ReactDOM","clsx","clsx","import_jsx_runtime","clsx"]}
|