@helpwave/hightide 0.1.7 → 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/branding/HelpwaveBadge.js +30 -8
- package/dist/components/branding/HelpwaveBadge.js.map +1 -1
- package/dist/components/branding/HelpwaveBadge.mjs +30 -8
- package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
- package/dist/components/date/DatePicker.d.mts +3 -4
- package/dist/components/date/DatePicker.d.ts +3 -4
- package/dist/components/date/DatePicker.js +135 -33
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +135 -33
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.d.mts +1 -1
- package/dist/components/date/DayPicker.d.ts +1 -1
- package/dist/components/date/DayPicker.js +23 -11
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs +23 -11
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/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/date/YearMonthPicker.js +106 -22
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +106 -22
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.d.mts +2 -5
- package/dist/components/dialogs/ConfirmDialog.d.ts +2 -5
- package/dist/components/dialogs/ConfirmDialog.js +157 -25
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +157 -25
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.js +2 -2
- package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.mjs +2 -2
- package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.d.mts +1 -1
- package/dist/components/layout-and-navigation/Carousel.d.ts +1 -1
- package/dist/components/layout-and-navigation/Carousel.js +86 -28
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.mjs +86 -28
- package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.d.mts +3 -0
- package/dist/components/layout-and-navigation/Expandable.d.ts +3 -0
- package/dist/components/layout-and-navigation/Expandable.js +4 -3
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +4 -3
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +4 -3
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs +4 -3
- package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.d.mts +2 -3
- package/dist/components/layout-and-navigation/Overlay.d.ts +2 -3
- package/dist/components/layout-and-navigation/Overlay.js +152 -12
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +152 -12
- 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 +10 -8
- package/dist/components/layout-and-navigation/SearchableList.d.ts +10 -8
- package/dist/components/layout-and-navigation/SearchableList.js +261 -30
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +261 -30
- 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 +149 -19
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +149 -19
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Table.js +146 -14
- package/dist/components/layout-and-navigation/Table.js.map +1 -1
- package/dist/components/layout-and-navigation/Table.mjs +146 -14
- 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/layout-and-navigation/Tile.d.mts +10 -15
- package/dist/components/layout-and-navigation/Tile.d.ts +10 -15
- package/dist/components/layout-and-navigation/Tile.js +30 -8
- package/dist/components/layout-and-navigation/Tile.js.map +1 -1
- package/dist/components/layout-and-navigation/Tile.mjs +30 -8
- package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
- package/dist/components/loading-states/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/loading-states/ProgressIndicator.js +2 -2
- package/dist/components/loading-states/ProgressIndicator.js.map +1 -1
- package/dist/components/loading-states/ProgressIndicator.mjs +2 -2
- package/dist/components/loading-states/ProgressIndicator.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.d.mts +2 -5
- package/dist/components/modals/ConfirmModal.d.ts +2 -5
- package/dist/components/modals/ConfirmModal.js +158 -28
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +158 -28
- 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 +162 -48
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +162 -48
- 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 +158 -28
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +158 -28
- 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 +538 -166
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +537 -165
- 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 +547 -176
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +544 -173
- 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 +148 -26
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +148 -26
- 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 +146 -14
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +146 -14
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +5 -5
- package/dist/components/properties/MultiSelectProperty.d.ts +5 -5
- package/dist/components/properties/MultiSelectProperty.js +626 -456
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +622 -452
- 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 +148 -16
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +148 -16
- 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 +146 -14
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +146 -14
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +5 -6
- package/dist/components/properties/SelectProperty.d.ts +5 -6
- package/dist/components/properties/SelectProperty.js +542 -279
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +542 -279
- 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 +150 -18
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +150 -18
- 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 +233 -71
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +233 -71
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Menu.d.mts +14 -8
- package/dist/components/user-action/Menu.d.ts +14 -8
- package/dist/components/user-action/Menu.js +32 -11
- package/dist/components/user-action/Menu.js.map +1 -1
- package/dist/components/user-action/Menu.mjs +32 -11
- package/dist/components/user-action/Menu.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +13 -23
- package/dist/components/user-action/MultiSelect.d.ts +13 -23
- package/dist/components/user-action/MultiSelect.js +632 -325
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +629 -323
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/Select.d.mts +5 -18
- package/dist/components/user-action/Select.d.ts +5 -18
- package/dist/components/user-action/Select.js +447 -113
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +442 -107
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Tooltip.js +2 -2
- package/dist/components/user-action/Tooltip.js.map +1 -1
- package/dist/components/user-action/Tooltip.mjs +2 -2
- package/dist/components/user-action/Tooltip.mjs.map +1 -1
- package/dist/css/globals.css +224 -207
- package/dist/css/uncompiled/globals.css +138 -74
- package/dist/hooks/useSearch.d.mts +17 -0
- package/dist/hooks/useSearch.d.ts +17 -0
- package/dist/hooks/useSearch.js +66 -0
- package/dist/hooks/useSearch.js.map +1 -0
- package/dist/hooks/useSearch.mjs +42 -0
- package/dist/hooks/useSearch.mjs.map +1 -0
- package/dist/index.d.mts +10 -6
- package/dist/index.d.ts +10 -6
- package/dist/index.js +882 -758
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +836 -717
- 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/dist/util/PropsWithFunctionChildren.d.mts +14 -0
- package/dist/util/PropsWithFunctionChildren.d.ts +14 -0
- package/dist/util/PropsWithFunctionChildren.js +38 -0
- package/dist/util/PropsWithFunctionChildren.js.map +1 -0
- package/dist/util/PropsWithFunctionChildren.mjs +14 -0
- package/dist/util/PropsWithFunctionChildren.mjs.map +1 -0
- package/dist/util/simpleSearch.d.mts +2 -2
- package/dist/util/simpleSearch.d.ts +2 -2
- package/dist/util/simpleSearch.js +4 -1
- package/dist/util/simpleSearch.js.map +1 -1
- package/dist/util/simpleSearch.mjs +4 -1
- package/dist/util/simpleSearch.mjs.map +1 -1
- package/package.json +1 -2
|
@@ -37,15 +37,55 @@ var useLocale = (overWriteLanguage) => {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
// src/localization/useTranslation.ts
|
|
40
|
-
var useTranslation = (
|
|
41
|
-
const { language: languageProp, translation: overwrite } =
|
|
40
|
+
var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
41
|
+
const { language: languageProp, translation: overwrite } = overwriteTranslation;
|
|
42
42
|
const { language: inferredLanguage } = useLanguage();
|
|
43
43
|
const usedLanguage = languageProp ?? inferredLanguage;
|
|
44
|
-
|
|
45
|
-
if (overwrite
|
|
46
|
-
|
|
44
|
+
const usedTranslations = [...translations];
|
|
45
|
+
if (overwrite) {
|
|
46
|
+
usedTranslations.push(overwrite);
|
|
47
47
|
}
|
|
48
|
-
return
|
|
48
|
+
return (key, options) => {
|
|
49
|
+
const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options };
|
|
50
|
+
try {
|
|
51
|
+
for (let i = translations.length - 1; i >= 0; i--) {
|
|
52
|
+
const translation = translations[i];
|
|
53
|
+
const localizedTranslation = translation[usedLanguage];
|
|
54
|
+
if (!localizedTranslation) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const value = localizedTranslation[key];
|
|
58
|
+
if (!value) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
let forProcessing;
|
|
62
|
+
if (typeof value !== "string") {
|
|
63
|
+
if (count <= 0 && value?.zero) {
|
|
64
|
+
forProcessing = value.zero;
|
|
65
|
+
} else if (count === 1 && value?.one) {
|
|
66
|
+
forProcessing = value.one;
|
|
67
|
+
} else if (count === 2 && value?.two) {
|
|
68
|
+
forProcessing = value.two;
|
|
69
|
+
} else if (count <= 10 && value?.few) {
|
|
70
|
+
forProcessing = value.few;
|
|
71
|
+
} else if (count > 10 && value?.many) {
|
|
72
|
+
forProcessing = value.many;
|
|
73
|
+
} else {
|
|
74
|
+
forProcessing = value.other;
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
forProcessing = value;
|
|
78
|
+
}
|
|
79
|
+
forProcessing = forProcessing.replace(/\{\{(\w+)}}/g, (_, placeholder) => {
|
|
80
|
+
return replacements[placeholder] ?? `{{${placeholder}}}`;
|
|
81
|
+
});
|
|
82
|
+
return forProcessing;
|
|
83
|
+
}
|
|
84
|
+
} catch (e) {
|
|
85
|
+
console.error(e);
|
|
86
|
+
}
|
|
87
|
+
return `{{${usedLanguage}:${key}}}`;
|
|
88
|
+
};
|
|
49
89
|
};
|
|
50
90
|
|
|
51
91
|
// src/util/noop.ts
|
|
@@ -461,8 +501,9 @@ var Expandable = forwardRef(function Expandable2({
|
|
|
461
501
|
onChange = noop,
|
|
462
502
|
clickOnlyOnHeader = true,
|
|
463
503
|
disabled = false,
|
|
464
|
-
className
|
|
465
|
-
headerClassName
|
|
504
|
+
className,
|
|
505
|
+
headerClassName,
|
|
506
|
+
contentClassName
|
|
466
507
|
}, ref) {
|
|
467
508
|
icon ??= DefaultIcon;
|
|
468
509
|
return /* @__PURE__ */ jsxs3(
|
|
@@ -491,7 +532,7 @@ var Expandable = forwardRef(function Expandable2({
|
|
|
491
532
|
]
|
|
492
533
|
}
|
|
493
534
|
),
|
|
494
|
-
isExpanded && /* @__PURE__ */ jsx4("div", { className: "col px-4 pb-2", children })
|
|
535
|
+
isExpanded && /* @__PURE__ */ jsx4("div", { className: clsx3("col px-4 pb-2", contentClassName), children })
|
|
495
536
|
]
|
|
496
537
|
}
|
|
497
538
|
);
|
|
@@ -556,7 +597,8 @@ var YearMonthPicker = ({
|
|
|
556
597
|
ref: (displayedYearMonth.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear()) === year ? ref : void 0,
|
|
557
598
|
label: /* @__PURE__ */ jsx5("span", { className: clsx4({ "text-primary font-bold": selectedYear }), children: year }),
|
|
558
599
|
isExpanded: showValueOpen && selectedYear,
|
|
559
|
-
|
|
600
|
+
contentClassName: "gap-y-1",
|
|
601
|
+
children: equalSizeGroups([...monthsList], 3).map((monthList, index) => /* @__PURE__ */ jsx5("div", { className: "row gap-x-1", children: monthList.map((month) => {
|
|
560
602
|
const monthIndex = monthsList.indexOf(month);
|
|
561
603
|
const newDate = new Date(year, monthIndex);
|
|
562
604
|
const selectedMonth = selectedYear && monthIndex === displayedYearMonth.getMonth();
|
|
@@ -566,17 +608,12 @@ var YearMonthPicker = ({
|
|
|
566
608
|
const isBeforeEnd = end === void 0 || firstOfMonth <= end;
|
|
567
609
|
const isValid = isAfterStart && isBeforeEnd;
|
|
568
610
|
return /* @__PURE__ */ jsx5(
|
|
569
|
-
|
|
611
|
+
SolidButton,
|
|
570
612
|
{
|
|
571
613
|
disabled: !isValid,
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
"bg-gray-50 text-black": !selectedMonth && isValid,
|
|
576
|
-
"bg-primary text-on-primary": selectedMonth && isValid,
|
|
577
|
-
"bg-disabled-background text-disabled-text": !isValid
|
|
578
|
-
}
|
|
579
|
-
),
|
|
614
|
+
color: selectedMonth && isValid ? "primary" : "neutral",
|
|
615
|
+
className: "flex-1",
|
|
616
|
+
size: "small",
|
|
580
617
|
onClick: () => {
|
|
581
618
|
onChange(newDate);
|
|
582
619
|
},
|
|
@@ -620,14 +657,15 @@ var DayPicker = ({
|
|
|
620
657
|
{
|
|
621
658
|
disabled: !isDayValid,
|
|
622
659
|
className: clsx5(
|
|
623
|
-
"flex-1 rounded-full border-2
|
|
660
|
+
"flex-1 rounded-full border-2",
|
|
624
661
|
{
|
|
625
|
-
"text-
|
|
626
|
-
"text-
|
|
627
|
-
"text-
|
|
628
|
-
"
|
|
629
|
-
"
|
|
630
|
-
"
|
|
662
|
+
"text-description": !isSameMonth && !isSelected && isDayValid,
|
|
663
|
+
"text-button-solid-neutral-text bg-button-solid-neutral-background": !isSelected && isSameMonth && isDayValid,
|
|
664
|
+
"text-button-solid-primary-text bg-button-solid-primary-background": isSelected && isDayValid,
|
|
665
|
+
"hover:brightness-90 hover:bg-button-solid-primary-background hover:text-button-solid-primary-text": isDayValid,
|
|
666
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": !isDayValid,
|
|
667
|
+
"border-secondary": isToday && markToday,
|
|
668
|
+
"border-transparent": !isToday || !markToday
|
|
631
669
|
}
|
|
632
670
|
),
|
|
633
671
|
onClick: () => onChange(date),
|
|
@@ -639,16 +677,80 @@ var DayPicker = ({
|
|
|
639
677
|
] });
|
|
640
678
|
};
|
|
641
679
|
|
|
642
|
-
// src/
|
|
643
|
-
|
|
644
|
-
var defaultDatePickerTranslation = {
|
|
680
|
+
// src/localization/defaults/time.ts
|
|
681
|
+
var monthTranslation = {
|
|
645
682
|
en: {
|
|
646
|
-
|
|
683
|
+
january: "January",
|
|
684
|
+
february: "Febuary",
|
|
685
|
+
march: "March",
|
|
686
|
+
april: "April",
|
|
687
|
+
may: "May",
|
|
688
|
+
june: "June",
|
|
689
|
+
july: "July",
|
|
690
|
+
august: "August",
|
|
691
|
+
september: "September",
|
|
692
|
+
october: "October",
|
|
693
|
+
november: "November",
|
|
694
|
+
december: "December"
|
|
647
695
|
},
|
|
648
696
|
de: {
|
|
649
|
-
|
|
697
|
+
january: "Januar",
|
|
698
|
+
february: "Febuar",
|
|
699
|
+
march: "M\xE4rz",
|
|
700
|
+
april: "April",
|
|
701
|
+
may: "Mai",
|
|
702
|
+
june: "Juni",
|
|
703
|
+
july: "Juli",
|
|
704
|
+
august: "August",
|
|
705
|
+
september: "September",
|
|
706
|
+
october: "October",
|
|
707
|
+
november: "November",
|
|
708
|
+
december: "December"
|
|
650
709
|
}
|
|
651
710
|
};
|
|
711
|
+
var timeTranslation = {
|
|
712
|
+
en: {
|
|
713
|
+
...monthTranslation.en,
|
|
714
|
+
century: { one: "Century", other: "Centuries" },
|
|
715
|
+
decade: { one: "Decade", other: "Decades" },
|
|
716
|
+
year: { one: "Year", other: "Years" },
|
|
717
|
+
month: { one: "Month", other: "Months" },
|
|
718
|
+
day: { one: "Day", other: "Days" },
|
|
719
|
+
hour: { one: "Hour", other: "Hours" },
|
|
720
|
+
minute: { one: "Minute", other: "Minutes" },
|
|
721
|
+
second: { one: "Second", other: "Seconds" },
|
|
722
|
+
millisecond: { one: "Millisecond", other: "Milliseconds" },
|
|
723
|
+
microsecond: { one: "Microsecond", other: "Microseconds" },
|
|
724
|
+
nanosecond: { one: "Nanosecond", other: "Nanoseconds" },
|
|
725
|
+
yesterday: "Yesterday",
|
|
726
|
+
today: "Today",
|
|
727
|
+
tomorrow: "Tomorrow",
|
|
728
|
+
in: "in",
|
|
729
|
+
ago: "ago"
|
|
730
|
+
},
|
|
731
|
+
de: {
|
|
732
|
+
...monthTranslation.de,
|
|
733
|
+
century: { one: "Jahrhundert", other: "Jahrhunderte" },
|
|
734
|
+
decade: { one: "Jahrzehnt", other: "Jahrzehnte" },
|
|
735
|
+
year: { one: "Jahr", other: "Jahre" },
|
|
736
|
+
month: { one: "Monat", other: "Monate" },
|
|
737
|
+
day: { one: "Tag", other: "Tage" },
|
|
738
|
+
hour: { one: "Stunde", other: "Stunden" },
|
|
739
|
+
minute: { one: "Minute", other: "Minuten" },
|
|
740
|
+
second: { one: "Sekunde", other: "Sekunden" },
|
|
741
|
+
millisecond: { one: "Millisekunde", other: "Millisekunden" },
|
|
742
|
+
microsecond: { one: "Mikrosekunde", other: "Mikrosekunden" },
|
|
743
|
+
nanosecond: { one: "Nanosekunde", other: "Nanosekunden" },
|
|
744
|
+
yesterday: "Gestern",
|
|
745
|
+
today: "Heute",
|
|
746
|
+
tomorrow: "Morgen",
|
|
747
|
+
in: "in",
|
|
748
|
+
ago: "vor"
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
// src/components/date/DatePicker.tsx
|
|
753
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
652
754
|
var DatePicker = ({
|
|
653
755
|
overwriteTranslation,
|
|
654
756
|
value = /* @__PURE__ */ new Date(),
|
|
@@ -661,7 +763,7 @@ var DatePicker = ({
|
|
|
661
763
|
className = ""
|
|
662
764
|
}) => {
|
|
663
765
|
const locale = useLocale();
|
|
664
|
-
const translation = useTranslation(
|
|
766
|
+
const translation = useTranslation([timeTranslation], overwriteTranslation);
|
|
665
767
|
const [displayedMonth, setDisplayedMonth] = useState7(value);
|
|
666
768
|
const [displayMode, setDisplayMode] = useState7(initialDisplay);
|
|
667
769
|
useEffect7(() => {
|
|
@@ -744,55 +846,115 @@ var DatePicker = ({
|
|
|
744
846
|
newDate.setHours(value.getHours(), value.getMinutes());
|
|
745
847
|
onChange(newDate);
|
|
746
848
|
},
|
|
747
|
-
children: translation
|
|
849
|
+
children: translation("today")
|
|
748
850
|
}
|
|
749
851
|
) })
|
|
750
852
|
] })
|
|
751
853
|
] });
|
|
752
854
|
};
|
|
753
855
|
|
|
754
|
-
// src/
|
|
755
|
-
|
|
756
|
-
var defaultTimeTranslation = {
|
|
856
|
+
// src/localization/defaults/form.ts
|
|
857
|
+
var formTranslation = {
|
|
757
858
|
en: {
|
|
758
|
-
|
|
859
|
+
all: "All",
|
|
860
|
+
back: "Back",
|
|
861
|
+
cancel: "Cancel",
|
|
759
862
|
change: "Change",
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
863
|
+
clear: "Clear",
|
|
864
|
+
close: "Close",
|
|
865
|
+
confirm: "Confirm",
|
|
866
|
+
decline: "Decline",
|
|
867
|
+
delete: "Delete",
|
|
868
|
+
discard: "Discard",
|
|
869
|
+
discardChanges: "Discard Changes",
|
|
870
|
+
done: "Done",
|
|
871
|
+
edit: "Edit",
|
|
872
|
+
enterText: "Enter text here",
|
|
873
|
+
error: "Error",
|
|
874
|
+
exit: "Exit",
|
|
875
|
+
fieldRequiredError: "This field is required.",
|
|
876
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
877
|
+
less: "Less",
|
|
878
|
+
loading: "Loading",
|
|
879
|
+
maxLengthError: "Maximum length exceeded.",
|
|
880
|
+
minLengthError: "Minimum length not met.",
|
|
881
|
+
more: "More",
|
|
882
|
+
next: "Next",
|
|
883
|
+
no: "No",
|
|
884
|
+
none: "None",
|
|
885
|
+
of: "of",
|
|
886
|
+
optional: "Optional",
|
|
887
|
+
pleaseWait: "Please wait...",
|
|
888
|
+
previous: "Previous",
|
|
889
|
+
remove: "Remove",
|
|
890
|
+
required: "Required",
|
|
891
|
+
reset: "Reset",
|
|
892
|
+
save: "Save",
|
|
893
|
+
search: "Search",
|
|
894
|
+
select: "Select",
|
|
895
|
+
selectOption: "Select an option",
|
|
896
|
+
show: "Show",
|
|
897
|
+
showMore: "Show more",
|
|
898
|
+
showLess: "Show less",
|
|
899
|
+
submit: "Submit",
|
|
900
|
+
success: "Success",
|
|
901
|
+
update: "Update",
|
|
902
|
+
unsavedChanges: "Unsaved Changes",
|
|
903
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
904
|
+
yes: "Yes"
|
|
775
905
|
},
|
|
776
906
|
de: {
|
|
777
|
-
|
|
907
|
+
all: "Alle",
|
|
908
|
+
back: "Zur\xFCck",
|
|
909
|
+
cancel: "Abbrechen",
|
|
778
910
|
change: "\xC4ndern",
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
911
|
+
clear: "L\xF6schen",
|
|
912
|
+
close: "Schlie\xDFen",
|
|
913
|
+
confirm: "Best\xE4tigen",
|
|
914
|
+
decline: "Ablehnen",
|
|
915
|
+
delete: "L\xF6schen",
|
|
916
|
+
discard: "Verwerfen",
|
|
917
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
918
|
+
done: "Fertig",
|
|
919
|
+
edit: "Bearbeiten",
|
|
920
|
+
enterText: "Text hier eingeben",
|
|
921
|
+
error: "Fehler",
|
|
922
|
+
exit: "Beenden",
|
|
923
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
924
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
925
|
+
less: "Weniger",
|
|
926
|
+
loading: "L\xE4dt",
|
|
927
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
928
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
929
|
+
more: "Mehr",
|
|
930
|
+
next: "Weiter",
|
|
931
|
+
no: "Nein",
|
|
932
|
+
none: "Nichts",
|
|
933
|
+
of: "von",
|
|
934
|
+
optional: "Optional",
|
|
935
|
+
pleaseWait: "Bitte warten...",
|
|
936
|
+
previous: "Vorherige",
|
|
937
|
+
remove: "Entfernen",
|
|
938
|
+
required: "Erforderlich",
|
|
939
|
+
reset: "Zur\xFCcksetzen",
|
|
940
|
+
save: "Speichern",
|
|
941
|
+
search: "Suche",
|
|
942
|
+
select: "Select",
|
|
943
|
+
selectOption: "Option ausw\xE4hlen",
|
|
944
|
+
show: "Anzeigen",
|
|
945
|
+
showMore: "Mehr anzeigen",
|
|
946
|
+
showLess: "Weniger anzeigen",
|
|
947
|
+
submit: "Abschicken",
|
|
948
|
+
success: "Erfolg",
|
|
949
|
+
update: "Update",
|
|
950
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
951
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
952
|
+
yes: "Ja"
|
|
794
953
|
}
|
|
795
954
|
};
|
|
955
|
+
|
|
956
|
+
// src/components/user-action/DateAndTimePicker.tsx
|
|
957
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
796
958
|
var DateTimePicker = ({
|
|
797
959
|
overwriteTranslation,
|
|
798
960
|
value = /* @__PURE__ */ new Date(),
|
|
@@ -805,7 +967,7 @@ var DateTimePicker = ({
|
|
|
805
967
|
timePickerProps,
|
|
806
968
|
datePickerProps
|
|
807
969
|
}) => {
|
|
808
|
-
const translation = useTranslation(
|
|
970
|
+
const translation = useTranslation([formTranslation, timeTranslation], overwriteTranslation);
|
|
809
971
|
const useDate = mode === "dateTime" || mode === "date";
|
|
810
972
|
const useTime = mode === "dateTime" || mode === "time";
|
|
811
973
|
let dateDisplay;
|
|
@@ -842,13 +1004,13 @@ var DateTimePicker = ({
|
|
|
842
1004
|
timeDisplay
|
|
843
1005
|
] }),
|
|
844
1006
|
/* @__PURE__ */ jsx8("div", { className: "row justify-end", children: /* @__PURE__ */ jsxs6("div", { className: "row gap-x-2 mt-1", children: [
|
|
845
|
-
/* @__PURE__ */ jsx8(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation
|
|
1007
|
+
/* @__PURE__ */ jsx8(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
|
|
846
1008
|
/* @__PURE__ */ jsx8(
|
|
847
1009
|
SolidButton,
|
|
848
1010
|
{
|
|
849
1011
|
size: "medium",
|
|
850
1012
|
onClick: () => onFinish(value),
|
|
851
|
-
children: translation
|
|
1013
|
+
children: translation("change")
|
|
852
1014
|
}
|
|
853
1015
|
)
|
|
854
1016
|
] }) })
|