@helpwave/hightide 0.1.8 → 0.1.9
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 +117 -13
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +117 -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 +121 -37
- package/dist/components/date/TimeDisplay.js.map +1 -1
- package/dist/components/date/TimeDisplay.mjs +121 -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 +155 -23
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +155 -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 +150 -10
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +150 -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 +145 -13
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +145 -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 +149 -11
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +149 -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 +145 -15
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +145 -15
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Table.js +145 -13
- package/dist/components/layout-and-navigation/Table.js.map +1 -1
- package/dist/components/layout-and-navigation/Table.mjs +145 -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 +153 -19
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +153 -19
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js +48 -8
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs +48 -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 +147 -15
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +147 -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 +145 -13
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +145 -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 +156 -26
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +156 -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 +160 -46
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +160 -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 +156 -26
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +156 -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 +161 -23
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +161 -23
- 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 +169 -29
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +169 -29
- 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 +147 -25
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +147 -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 +145 -13
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +145 -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 +160 -42
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +160 -42
- 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 +147 -15
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +147 -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 +145 -13
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +145 -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 +150 -28
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +150 -28
- 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 +149 -17
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +149 -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 +215 -51
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +215 -51
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +4 -8
- package/dist/components/user-action/MultiSelect.d.ts +4 -8
- package/dist/components/user-action/MultiSelect.js +156 -22
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +156 -22
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/Select.js +149 -11
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +149 -11
- 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 +332 -300
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +329 -300
- 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 +30 -6
- package/dist/localization/useTranslation.d.ts +30 -6
- package/dist/localization/useTranslation.js +46 -6
- package/dist/localization/useTranslation.js.map +1 -1
- package/dist/localization/useTranslation.mjs +46 -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
|
@@ -61,15 +61,55 @@ var LanguageContext = (0, import_react2.createContext)({
|
|
|
61
61
|
var useLanguage = () => (0, import_react2.useContext)(LanguageContext);
|
|
62
62
|
|
|
63
63
|
// src/localization/useTranslation.ts
|
|
64
|
-
var useTranslation = (
|
|
65
|
-
const { language: languageProp, translation: overwrite } =
|
|
64
|
+
var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
65
|
+
const { language: languageProp, translation: overwrite } = overwriteTranslation;
|
|
66
66
|
const { language: inferredLanguage } = useLanguage();
|
|
67
67
|
const usedLanguage = languageProp ?? inferredLanguage;
|
|
68
|
-
|
|
69
|
-
if (overwrite
|
|
70
|
-
|
|
68
|
+
const usedTranslations = [...translations];
|
|
69
|
+
if (overwrite) {
|
|
70
|
+
usedTranslations.push(overwrite);
|
|
71
71
|
}
|
|
72
|
-
return
|
|
72
|
+
return (key, options) => {
|
|
73
|
+
const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options };
|
|
74
|
+
try {
|
|
75
|
+
for (let i = translations.length - 1; i >= 0; i--) {
|
|
76
|
+
const translation = translations[i];
|
|
77
|
+
const localizedTranslation = translation[usedLanguage];
|
|
78
|
+
if (!localizedTranslation) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const value = localizedTranslation[key];
|
|
82
|
+
if (!value) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
let forProcessing;
|
|
86
|
+
if (typeof value !== "string") {
|
|
87
|
+
if (count <= 0 && value?.zero) {
|
|
88
|
+
forProcessing = value.zero;
|
|
89
|
+
} else if (count === 1 && value?.one) {
|
|
90
|
+
forProcessing = value.one;
|
|
91
|
+
} else if (count === 2 && value?.two) {
|
|
92
|
+
forProcessing = value.two;
|
|
93
|
+
} else if (count <= 10 && value?.few) {
|
|
94
|
+
forProcessing = value.few;
|
|
95
|
+
} else if (count > 10 && value?.many) {
|
|
96
|
+
forProcessing = value.many;
|
|
97
|
+
} else {
|
|
98
|
+
forProcessing = value.other;
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
forProcessing = value;
|
|
102
|
+
}
|
|
103
|
+
forProcessing = forProcessing.replace(/\{\{(\w+)}}/g, (_, placeholder) => {
|
|
104
|
+
return replacements[placeholder] ?? `{{${placeholder}}}`;
|
|
105
|
+
});
|
|
106
|
+
return forProcessing;
|
|
107
|
+
}
|
|
108
|
+
} catch (e) {
|
|
109
|
+
console.error(e);
|
|
110
|
+
}
|
|
111
|
+
return `{{${usedLanguage}:${key}}}`;
|
|
112
|
+
};
|
|
73
113
|
};
|
|
74
114
|
|
|
75
115
|
// src/components/user-action/Select.tsx
|
|
@@ -406,15 +446,113 @@ var useSearch = ({
|
|
|
406
446
|
};
|
|
407
447
|
};
|
|
408
448
|
|
|
449
|
+
// src/localization/defaults/form.ts
|
|
450
|
+
var formTranslation = {
|
|
451
|
+
en: {
|
|
452
|
+
all: "All",
|
|
453
|
+
back: "Back",
|
|
454
|
+
cancel: "Cancel",
|
|
455
|
+
change: "Change",
|
|
456
|
+
clear: "Clear",
|
|
457
|
+
close: "Close",
|
|
458
|
+
confirm: "Confirm",
|
|
459
|
+
decline: "Decline",
|
|
460
|
+
delete: "Delete",
|
|
461
|
+
discard: "Discard",
|
|
462
|
+
discardChanges: "Discard Changes",
|
|
463
|
+
done: "Done",
|
|
464
|
+
edit: "Edit",
|
|
465
|
+
enterText: "Enter text here",
|
|
466
|
+
error: "Error",
|
|
467
|
+
exit: "Exit",
|
|
468
|
+
fieldRequiredError: "This field is required.",
|
|
469
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
470
|
+
less: "Less",
|
|
471
|
+
loading: "Loading",
|
|
472
|
+
maxLengthError: "Maximum length exceeded.",
|
|
473
|
+
minLengthError: "Minimum length not met.",
|
|
474
|
+
more: "More",
|
|
475
|
+
next: "Next",
|
|
476
|
+
no: "No",
|
|
477
|
+
none: "None",
|
|
478
|
+
of: "of",
|
|
479
|
+
optional: "Optional",
|
|
480
|
+
pleaseWait: "Please wait...",
|
|
481
|
+
previous: "Previous",
|
|
482
|
+
remove: "Remove",
|
|
483
|
+
required: "Required",
|
|
484
|
+
reset: "Reset",
|
|
485
|
+
save: "Save",
|
|
486
|
+
search: "Search",
|
|
487
|
+
select: "Select",
|
|
488
|
+
selectOption: "Select an option",
|
|
489
|
+
show: "Show",
|
|
490
|
+
showMore: "Show more",
|
|
491
|
+
showLess: "Show less",
|
|
492
|
+
submit: "Submit",
|
|
493
|
+
success: "Success",
|
|
494
|
+
update: "Update",
|
|
495
|
+
unsavedChanges: "Unsaved Changes",
|
|
496
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
497
|
+
yes: "Yes"
|
|
498
|
+
},
|
|
499
|
+
de: {
|
|
500
|
+
all: "Alle",
|
|
501
|
+
back: "Zur\xFCck",
|
|
502
|
+
cancel: "Abbrechen",
|
|
503
|
+
change: "\xC4ndern",
|
|
504
|
+
clear: "L\xF6schen",
|
|
505
|
+
close: "Schlie\xDFen",
|
|
506
|
+
confirm: "Best\xE4tigen",
|
|
507
|
+
decline: "Ablehnen",
|
|
508
|
+
delete: "L\xF6schen",
|
|
509
|
+
discard: "Verwerfen",
|
|
510
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
511
|
+
done: "Fertig",
|
|
512
|
+
edit: "Bearbeiten",
|
|
513
|
+
enterText: "Text hier eingeben",
|
|
514
|
+
error: "Fehler",
|
|
515
|
+
exit: "Beenden",
|
|
516
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
517
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
518
|
+
less: "Weniger",
|
|
519
|
+
loading: "L\xE4dt",
|
|
520
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
521
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
522
|
+
more: "Mehr",
|
|
523
|
+
next: "Weiter",
|
|
524
|
+
no: "Nein",
|
|
525
|
+
none: "Nichts",
|
|
526
|
+
of: "von",
|
|
527
|
+
optional: "Optional",
|
|
528
|
+
pleaseWait: "Bitte warten...",
|
|
529
|
+
previous: "Vorherige",
|
|
530
|
+
remove: "Entfernen",
|
|
531
|
+
required: "Erforderlich",
|
|
532
|
+
reset: "Zur\xFCcksetzen",
|
|
533
|
+
save: "Speichern",
|
|
534
|
+
search: "Suche",
|
|
535
|
+
select: "Select",
|
|
536
|
+
selectOption: "Option ausw\xE4hlen",
|
|
537
|
+
show: "Anzeigen",
|
|
538
|
+
showMore: "Mehr anzeigen",
|
|
539
|
+
showLess: "Weniger anzeigen",
|
|
540
|
+
submit: "Abschicken",
|
|
541
|
+
success: "Erfolg",
|
|
542
|
+
update: "Update",
|
|
543
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
544
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
545
|
+
yes: "Ja"
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
|
|
409
549
|
// src/components/layout-and-navigation/SearchableList.tsx
|
|
410
550
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
411
551
|
var defaultSearchableListTranslation = {
|
|
412
552
|
en: {
|
|
413
|
-
search: "Search",
|
|
414
553
|
nothingFound: "Nothing found"
|
|
415
554
|
},
|
|
416
555
|
de: {
|
|
417
|
-
search: "Suche",
|
|
418
556
|
nothingFound: "Nichts gefunden"
|
|
419
557
|
}
|
|
420
558
|
};
|
|
@@ -429,7 +567,7 @@ var SearchableList = ({
|
|
|
429
567
|
className,
|
|
430
568
|
resultListClassName
|
|
431
569
|
}) => {
|
|
432
|
-
const translation = useTranslation(defaultSearchableListTranslation, overwriteTranslation);
|
|
570
|
+
const translation = useTranslation([defaultSearchableListTranslation, formTranslation], overwriteTranslation);
|
|
433
571
|
const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
|
|
434
572
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("col gap-y-2", className), children: [
|
|
435
573
|
list.length > minimumItemsForSearch && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "row justify-between gap-x-4 items-center", children: [
|
|
@@ -438,14 +576,14 @@ var SearchableList = ({
|
|
|
438
576
|
{
|
|
439
577
|
value: search,
|
|
440
578
|
onChangeText: setSearch,
|
|
441
|
-
placeholder: translation
|
|
579
|
+
placeholder: translation("search"),
|
|
442
580
|
autoFocus,
|
|
443
581
|
className: "w-full"
|
|
444
582
|
}
|
|
445
583
|
),
|
|
446
584
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconButton, { color: "neutral", disabled: search.length === 0, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Search, { className: "w-full h-full" }) })
|
|
447
585
|
] }),
|
|
448
|
-
hasResult ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_clsx4.default)("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "row text-description py-2 px-2", children: translation
|
|
586
|
+
hasResult ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_clsx4.default)("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "row text-description py-2 px-2", children: translation("nothingFound") })
|
|
449
587
|
] });
|
|
450
588
|
};
|
|
451
589
|
|
|
@@ -737,10 +875,10 @@ var Overlay = ({
|
|
|
737
875
|
var overlayStack = [];
|
|
738
876
|
var defaultModalHeaderTranslation = {
|
|
739
877
|
en: {
|
|
740
|
-
|
|
878
|
+
...formTranslation.en
|
|
741
879
|
},
|
|
742
880
|
de: {
|
|
743
|
-
|
|
881
|
+
...formTranslation.de
|
|
744
882
|
}
|
|
745
883
|
};
|
|
746
884
|
var OverlayHeader = ({
|
|
@@ -751,7 +889,7 @@ var OverlayHeader = ({
|
|
|
751
889
|
description,
|
|
752
890
|
descriptionText = ""
|
|
753
891
|
}) => {
|
|
754
|
-
const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation);
|
|
892
|
+
const translation = useTranslation([defaultModalHeaderTranslation], overwriteTranslation);
|
|
755
893
|
const hasTitleRow = !!title || !!titleText || !!onClose;
|
|
756
894
|
const titleRow = /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "row justify-between items-start gap-x-8", children: [
|
|
757
895
|
title ?? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -763,7 +901,7 @@ var OverlayHeader = ({
|
|
|
763
901
|
children: titleText
|
|
764
902
|
}
|
|
765
903
|
),
|
|
766
|
-
!!onClose && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Tooltip, { tooltip: translation
|
|
904
|
+
!!onClose && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Tooltip, { tooltip: translation("close"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconButton, { color: "neutral", size: "small", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.X, { className: "w-full h-full" }) }) })
|
|
767
905
|
] });
|
|
768
906
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "col", children: [
|
|
769
907
|
hasTitleRow && titleRow,
|
|
@@ -850,11 +988,19 @@ var themes = ["light", "dark"];
|
|
|
850
988
|
var defaultThemeTypeTranslation = {
|
|
851
989
|
en: {
|
|
852
990
|
dark: "Dark",
|
|
853
|
-
light: "Light"
|
|
991
|
+
light: "Light",
|
|
992
|
+
theme: {
|
|
993
|
+
one: "Theme",
|
|
994
|
+
other: "Themes"
|
|
995
|
+
}
|
|
854
996
|
},
|
|
855
997
|
de: {
|
|
856
998
|
dark: "Dunkel",
|
|
857
|
-
light: "Hell"
|
|
999
|
+
light: "Hell",
|
|
1000
|
+
theme: {
|
|
1001
|
+
one: "Farbschema",
|
|
1002
|
+
other: "Farbschemas"
|
|
1003
|
+
}
|
|
858
1004
|
}
|
|
859
1005
|
};
|
|
860
1006
|
var ThemeUtil = {
|
|
@@ -871,16 +1017,10 @@ var useTheme = () => (0, import_react10.useContext)(ThemeContext);
|
|
|
871
1017
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
872
1018
|
var defaultConfirmDialogTranslation = {
|
|
873
1019
|
en: {
|
|
874
|
-
|
|
875
|
-
message: "Choose your preferred theme",
|
|
876
|
-
done: "Done",
|
|
877
|
-
...ThemeUtil.translation.en
|
|
1020
|
+
chooseTheme: "Choose your preferred theme"
|
|
878
1021
|
},
|
|
879
1022
|
de: {
|
|
880
|
-
|
|
881
|
-
message: "W\xE4hle dein bevorzugtes Farbschema",
|
|
882
|
-
done: "Fertig",
|
|
883
|
-
...ThemeUtil.translation.en
|
|
1023
|
+
chooseTheme: "W\xE4hle dein bevorzugtes Farbschema"
|
|
884
1024
|
}
|
|
885
1025
|
};
|
|
886
1026
|
var ThemeModal = ({
|
|
@@ -890,14 +1030,14 @@ var ThemeModal = ({
|
|
|
890
1030
|
...modalProps
|
|
891
1031
|
}) => {
|
|
892
1032
|
const { theme, setTheme } = useTheme();
|
|
893
|
-
const translation = useTranslation(defaultConfirmDialogTranslation, overwriteTranslation);
|
|
1033
|
+
const translation = useTranslation([defaultConfirmDialogTranslation, formTranslation, ThemeUtil.translation], overwriteTranslation);
|
|
894
1034
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
895
1035
|
Modal,
|
|
896
1036
|
{
|
|
897
1037
|
headerProps: {
|
|
898
1038
|
...headerProps,
|
|
899
|
-
titleText: headerProps?.titleText ?? translation
|
|
900
|
-
descriptionText: headerProps?.descriptionText ?? translation
|
|
1039
|
+
titleText: headerProps?.titleText ?? translation("theme"),
|
|
1040
|
+
descriptionText: headerProps?.descriptionText ?? translation("chooseTheme")
|
|
901
1041
|
},
|
|
902
1042
|
onClose,
|
|
903
1043
|
...modalProps,
|
|
@@ -911,7 +1051,7 @@ var ThemeModal = ({
|
|
|
911
1051
|
onChange: (theme2) => setTheme(theme2)
|
|
912
1052
|
}
|
|
913
1053
|
),
|
|
914
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation
|
|
1054
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
|
|
915
1055
|
] })
|
|
916
1056
|
}
|
|
917
1057
|
);
|