@helpwave/hightide 0.1.11 → 0.1.13
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.js +37 -7
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +37 -7
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/TimePicker.js +27 -6
- package/dist/components/date/TimePicker.js.map +1 -1
- package/dist/components/date/TimePicker.mjs +27 -6
- package/dist/components/date/TimePicker.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js +36 -6
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +36 -6
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.js +16 -2
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +16 -2
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.js +42 -9
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.mjs +42 -9
- package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.js +1 -1
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.js +16 -2
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +16 -2
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.d.mts +6 -3
- package/dist/components/layout-and-navigation/Pagination.d.ts +6 -3
- package/dist/components/layout-and-navigation/Pagination.js +404 -19
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +404 -19
- package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.js +187 -67
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +183 -63
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.js +37 -5
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +37 -5
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.js +2 -0
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +2 -0
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.js +2 -0
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +2 -0
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.js +2 -0
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +2 -0
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/loading-states/LoadingButton.js +9 -0
- package/dist/components/loading-states/LoadingButton.js.map +1 -1
- package/dist/components/loading-states/LoadingButton.mjs +9 -0
- package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.js +16 -2
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +16 -2
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.js +16 -2
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +16 -2
- 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 +196 -76
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +189 -69
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +203 -83
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +192 -72
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +206 -86
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +193 -73
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js +17 -5
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +17 -5
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js +182 -65
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +179 -62
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.js +194 -74
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +187 -67
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js +182 -65
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +179 -62
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js +12 -1
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +12 -1
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.js +194 -74
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +187 -67
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js +43 -34
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +43 -34
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/table/FillerRowElement.d.mts +8 -0
- package/dist/components/table/FillerRowElement.d.ts +8 -0
- package/dist/components/table/FillerRowElement.js +36 -0
- package/dist/components/table/FillerRowElement.js.map +1 -0
- package/dist/components/table/FillerRowElement.mjs +12 -0
- package/dist/components/table/FillerRowElement.mjs.map +1 -0
- package/dist/components/table/Filter.d.mts +5 -0
- package/dist/components/table/Filter.d.ts +5 -0
- package/dist/components/table/Filter.js +41 -0
- package/dist/components/table/Filter.js.map +1 -0
- package/dist/components/table/Filter.mjs +17 -0
- package/dist/components/table/Filter.mjs.map +1 -0
- package/dist/components/table/Table.d.mts +41 -0
- package/dist/components/table/Table.d.ts +41 -0
- package/dist/components/table/Table.js +1549 -0
- package/dist/components/table/Table.js.map +1 -0
- package/dist/components/table/Table.mjs +1520 -0
- package/dist/components/table/Table.mjs.map +1 -0
- package/dist/components/table/TableCell.d.mts +9 -0
- package/dist/components/table/TableCell.d.ts +9 -0
- package/dist/components/table/TableCell.js +37 -0
- package/dist/components/table/TableCell.js.map +1 -0
- package/dist/components/table/TableCell.mjs +13 -0
- package/dist/components/table/TableCell.mjs.map +1 -0
- package/dist/components/table/TableFilterButton.d.mts +11 -0
- package/dist/components/table/TableFilterButton.d.ts +11 -0
- package/dist/components/table/TableFilterButton.js +888 -0
- package/dist/components/table/TableFilterButton.js.map +1 -0
- package/dist/components/table/TableFilterButton.mjs +852 -0
- package/dist/components/table/TableFilterButton.mjs.map +1 -0
- package/dist/components/table/TableSortButton.d.mts +15 -0
- package/dist/components/table/TableSortButton.d.ts +15 -0
- package/dist/components/table/TableSortButton.js +136 -0
- package/dist/components/table/TableSortButton.js.map +1 -0
- package/dist/components/table/TableSortButton.mjs +102 -0
- package/dist/components/table/TableSortButton.mjs.map +1 -0
- package/dist/components/user-action/Button.d.mts +20 -5
- package/dist/components/user-action/Button.d.ts +20 -5
- package/dist/components/user-action/Button.js +12 -3
- package/dist/components/user-action/Button.js.map +1 -1
- package/dist/components/user-action/Button.mjs +11 -3
- package/dist/components/user-action/Button.mjs.map +1 -1
- package/dist/components/user-action/Checkbox.js +5 -4
- package/dist/components/user-action/Checkbox.js.map +1 -1
- package/dist/components/user-action/Checkbox.mjs +5 -4
- package/dist/components/user-action/Checkbox.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js +41 -9
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +41 -9
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Input.d.mts +27 -7
- package/dist/components/user-action/Input.d.ts +27 -7
- package/dist/components/user-action/Input.js +173 -64
- package/dist/components/user-action/Input.js.map +1 -1
- package/dist/components/user-action/Input.mjs +172 -63
- package/dist/components/user-action/Input.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.js +195 -75
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +187 -67
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/ScrollPicker.js +26 -5
- package/dist/components/user-action/ScrollPicker.js.map +1 -1
- package/dist/components/user-action/ScrollPicker.mjs +26 -5
- package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
- package/dist/components/user-action/Select.js +195 -75
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +187 -67
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Textarea.d.mts +3 -1
- package/dist/components/user-action/Textarea.d.ts +3 -1
- package/dist/components/user-action/Textarea.js +31 -33
- package/dist/components/user-action/Textarea.js.map +1 -1
- package/dist/components/user-action/Textarea.mjs +31 -33
- package/dist/components/user-action/Textarea.mjs.map +1 -1
- package/dist/components/user-action/ToggleableInput.d.mts +3 -1
- package/dist/components/user-action/ToggleableInput.d.ts +3 -1
- package/dist/components/user-action/ToggleableInput.js +31 -33
- package/dist/components/user-action/ToggleableInput.js.map +1 -1
- package/dist/components/user-action/ToggleableInput.mjs +31 -33
- package/dist/components/user-action/ToggleableInput.mjs.map +1 -1
- package/dist/css/globals.css +431 -186
- package/dist/css/uncompiled/globals.css +36 -493
- package/dist/css/uncompiled/textstyles.css +69 -0
- package/dist/css/uncompiled/theme/colors-basic.css +72 -0
- package/dist/css/uncompiled/theme/colors-component.css +143 -0
- package/dist/css/uncompiled/theme/colors-semantic.css +99 -0
- package/dist/css/uncompiled/theme/index.css +5 -0
- package/dist/css/uncompiled/theme/theme.css +0 -0
- package/dist/css/uncompiled/theme/variants.css +3 -0
- package/dist/css/uncompiled/utitlity/animation.css +111 -0
- package/dist/css/uncompiled/utitlity/borderradius.css +23 -0
- package/dist/css/uncompiled/utitlity/general.css +11 -0
- package/dist/css/uncompiled/utitlity/index.css +4 -0
- package/dist/css/uncompiled/utitlity/shadow.css +29 -0
- package/dist/hooks/useDelay.d.mts +11 -0
- package/dist/hooks/useDelay.d.ts +11 -0
- package/dist/hooks/useDelay.js +64 -0
- package/dist/hooks/useDelay.js.map +1 -0
- package/dist/hooks/useDelay.mjs +40 -0
- package/dist/hooks/useDelay.mjs.map +1 -0
- package/dist/hooks/useFocusManagement.d.mts +9 -0
- package/dist/hooks/useFocusManagement.d.ts +9 -0
- package/dist/hooks/useFocusManagement.js +84 -0
- package/dist/hooks/useFocusManagement.js.map +1 -0
- package/dist/hooks/useFocusManagement.mjs +60 -0
- package/dist/hooks/useFocusManagement.mjs.map +1 -0
- package/dist/hooks/useFocusOnceVisible.d.mts +5 -0
- package/dist/hooks/useFocusOnceVisible.d.ts +5 -0
- package/dist/hooks/useFocusOnceVisible.js +60 -0
- package/dist/hooks/useFocusOnceVisible.js.map +1 -0
- package/dist/hooks/useFocusOnceVisible.mjs +26 -0
- package/dist/hooks/useFocusOnceVisible.mjs.map +1 -0
- package/dist/hooks/useRerender.d.mts +5 -0
- package/dist/hooks/useRerender.d.ts +5 -0
- package/dist/hooks/useRerender.js +33 -0
- package/dist/hooks/useRerender.js.map +1 -0
- package/dist/hooks/useRerender.mjs +9 -0
- package/dist/hooks/useRerender.mjs.map +1 -0
- package/dist/hooks/useResizeCallbackWrapper.d.mts +11 -0
- package/dist/hooks/useResizeCallbackWrapper.d.ts +11 -0
- package/dist/hooks/useResizeCallbackWrapper.js +38 -0
- package/dist/hooks/useResizeCallbackWrapper.js.map +1 -0
- package/dist/hooks/useResizeCallbackWrapper.mjs +14 -0
- package/dist/hooks/useResizeCallbackWrapper.mjs.map +1 -0
- package/dist/index.d.mts +16 -5
- package/dist/index.d.ts +16 -5
- package/dist/index.js +1428 -860
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1370 -799
- package/dist/index.mjs.map +1 -1
- package/dist/localization/defaults/form.d.mts +1 -0
- package/dist/localization/defaults/form.d.ts +1 -0
- package/dist/localization/defaults/form.js +2 -0
- package/dist/localization/defaults/form.js.map +1 -1
- package/dist/localization/defaults/form.mjs +2 -0
- package/dist/localization/defaults/form.mjs.map +1 -1
- package/dist/util/array.d.mts +11 -5
- package/dist/util/array.d.ts +11 -5
- package/dist/util/array.js +25 -4
- package/dist/util/array.js.map +1 -1
- package/dist/util/array.mjs +25 -4
- package/dist/util/array.mjs.map +1 -1
- package/dist/util/date.js.map +1 -1
- package/dist/util/date.mjs.map +1 -1
- package/dist/util/resolveSetState.d.mts +5 -0
- package/dist/util/resolveSetState.d.ts +5 -0
- package/dist/util/resolveSetState.js +32 -0
- package/dist/util/resolveSetState.js.map +1 -0
- package/dist/util/resolveSetState.mjs +8 -0
- package/dist/util/resolveSetState.mjs.map +1 -0
- package/package.json +4 -2
- package/dist/components/layout-and-navigation/Table.d.mts +0 -99
- package/dist/components/layout-and-navigation/Table.d.ts +0 -99
- package/dist/components/layout-and-navigation/Table.js +0 -688
- package/dist/components/layout-and-navigation/Table.js.map +0 -1
- package/dist/components/layout-and-navigation/Table.mjs +0 -645
- package/dist/components/layout-and-navigation/Table.mjs.map +0 -1
- package/dist/hooks/useSaveDelay.d.mts +0 -6
- package/dist/hooks/useSaveDelay.d.ts +0 -6
- package/dist/hooks/useSaveDelay.js +0 -67
- package/dist/hooks/useSaveDelay.js.map +0 -1
- package/dist/hooks/useSaveDelay.mjs +0 -43
- package/dist/hooks/useSaveDelay.mjs.map +0 -1
|
@@ -1,45 +1,42 @@
|
|
|
1
1
|
// src/components/user-action/Input.tsx
|
|
2
|
-
import { forwardRef, useEffect as
|
|
2
|
+
import { forwardRef, useEffect as useEffect3, useImperativeHandle, useRef, useState as useState2 } from "react";
|
|
3
3
|
import clsx2 from "clsx";
|
|
4
4
|
|
|
5
|
-
// src/hooks/
|
|
5
|
+
// src/hooks/useDelay.ts
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
setNotificationTimer(setTimeout(() => {
|
|
17
|
-
setNotificationStatus(false);
|
|
18
|
-
clearTimeout(notificationTimer);
|
|
19
|
-
}, delay));
|
|
20
|
-
clearTimeout(updateTimer);
|
|
21
|
-
}, delay));
|
|
7
|
+
var defaultOptions = {
|
|
8
|
+
delay: 3e3,
|
|
9
|
+
disabled: false
|
|
10
|
+
};
|
|
11
|
+
function useDelay(options) {
|
|
12
|
+
const [timer, setTimer] = useState(void 0);
|
|
13
|
+
const { delay, disabled } = {
|
|
14
|
+
...defaultOptions,
|
|
15
|
+
...options
|
|
22
16
|
};
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
setNotificationStatus(true);
|
|
27
|
-
clearTimeout(notificationTimer);
|
|
28
|
-
setNotificationTimer(setTimeout(() => {
|
|
29
|
-
setNotificationStatus(false);
|
|
30
|
-
clearTimeout(notificationTimer);
|
|
31
|
-
}, delay));
|
|
32
|
-
} else {
|
|
33
|
-
setNotificationStatus(false);
|
|
17
|
+
const restartTimer = (onDelayFinish) => {
|
|
18
|
+
if (disabled) {
|
|
19
|
+
return;
|
|
34
20
|
}
|
|
21
|
+
clearTimeout(timer);
|
|
22
|
+
setTimer(setTimeout(() => {
|
|
23
|
+
onDelayFinish();
|
|
24
|
+
}, delay));
|
|
25
|
+
};
|
|
26
|
+
const clearTimer = () => {
|
|
27
|
+
clearTimeout(timer);
|
|
35
28
|
};
|
|
36
29
|
useEffect(() => {
|
|
37
30
|
return () => {
|
|
38
|
-
clearTimeout(
|
|
39
|
-
clearTimeout(notificationTimer);
|
|
31
|
+
clearTimeout(timer);
|
|
40
32
|
};
|
|
41
|
-
}, []);
|
|
42
|
-
|
|
33
|
+
}, [timer]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (disabled) {
|
|
36
|
+
clearTimeout(timer);
|
|
37
|
+
}
|
|
38
|
+
}, [disabled, timer]);
|
|
39
|
+
return { restartTimer, clearTimer };
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
// src/util/noop.ts
|
|
@@ -63,9 +60,104 @@ var Label = ({
|
|
|
63
60
|
return /* @__PURE__ */ jsx("label", { ...props, className: clsx(styleMapping[labelType], className), children: children ? children : name });
|
|
64
61
|
};
|
|
65
62
|
|
|
63
|
+
// src/hooks/useFocusManagement.ts
|
|
64
|
+
import { useCallback } from "react";
|
|
65
|
+
function useFocusManagement() {
|
|
66
|
+
const getFocusableElements = useCallback(() => {
|
|
67
|
+
return Array.from(
|
|
68
|
+
document.querySelectorAll(
|
|
69
|
+
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
70
|
+
)
|
|
71
|
+
).filter(
|
|
72
|
+
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
73
|
+
);
|
|
74
|
+
}, []);
|
|
75
|
+
const getNextFocusElement = useCallback(() => {
|
|
76
|
+
const elements = getFocusableElements();
|
|
77
|
+
if (elements.length === 0) {
|
|
78
|
+
return void 0;
|
|
79
|
+
}
|
|
80
|
+
let nextElement = elements[0];
|
|
81
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
82
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
83
|
+
nextElement = elements[(currentIndex + 1) % elements.length];
|
|
84
|
+
}
|
|
85
|
+
return nextElement;
|
|
86
|
+
}, [getFocusableElements]);
|
|
87
|
+
const focusNext = useCallback(() => {
|
|
88
|
+
const nextElement = getNextFocusElement();
|
|
89
|
+
nextElement?.focus();
|
|
90
|
+
}, [getNextFocusElement]);
|
|
91
|
+
const getPreviousFocusElement = useCallback(() => {
|
|
92
|
+
const elements = getFocusableElements();
|
|
93
|
+
if (elements.length === 0) {
|
|
94
|
+
return void 0;
|
|
95
|
+
}
|
|
96
|
+
let previousElement = elements[0];
|
|
97
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
98
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
99
|
+
if (currentIndex === 0) {
|
|
100
|
+
previousElement = elements[elements.length - 1];
|
|
101
|
+
} else {
|
|
102
|
+
previousElement = elements[currentIndex - 1];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return previousElement;
|
|
106
|
+
}, [getFocusableElements]);
|
|
107
|
+
const focusPrevious = useCallback(() => {
|
|
108
|
+
const previousElement = getPreviousFocusElement();
|
|
109
|
+
if (previousElement) previousElement.focus();
|
|
110
|
+
}, [getPreviousFocusElement]);
|
|
111
|
+
return {
|
|
112
|
+
getFocusableElements,
|
|
113
|
+
getNextFocusElement,
|
|
114
|
+
getPreviousFocusElement,
|
|
115
|
+
focusNext,
|
|
116
|
+
focusPrevious
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// src/hooks/useFocusOnceVisible.ts
|
|
121
|
+
import React, { useEffect as useEffect2 } from "react";
|
|
122
|
+
var useFocusOnceVisible = (ref, disable = false) => {
|
|
123
|
+
const [hasUsedFocus, setHasUsedFocus] = React.useState(false);
|
|
124
|
+
useEffect2(() => {
|
|
125
|
+
if (disable || hasUsedFocus) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
129
|
+
if (entry.isIntersecting && !hasUsedFocus) {
|
|
130
|
+
ref.current?.focus();
|
|
131
|
+
setHasUsedFocus(hasUsedFocus);
|
|
132
|
+
}
|
|
133
|
+
}, {
|
|
134
|
+
threshold: 0.1
|
|
135
|
+
});
|
|
136
|
+
if (ref.current) {
|
|
137
|
+
observer.observe(ref.current);
|
|
138
|
+
}
|
|
139
|
+
return () => observer.disconnect();
|
|
140
|
+
}, [disable, hasUsedFocus, ref]);
|
|
141
|
+
};
|
|
142
|
+
|
|
66
143
|
// src/components/user-action/Input.tsx
|
|
67
144
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
68
|
-
var
|
|
145
|
+
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
146
|
+
return clsx2(
|
|
147
|
+
"px-2 py-1.5 rounded-md border-2",
|
|
148
|
+
{
|
|
149
|
+
"bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
150
|
+
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
151
|
+
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
};
|
|
155
|
+
var defaultEditCompleteOptions = {
|
|
156
|
+
onBlur: true,
|
|
157
|
+
afterDelay: true,
|
|
158
|
+
delay: 2500
|
|
159
|
+
};
|
|
160
|
+
var Input = forwardRef(function Input2({
|
|
69
161
|
id,
|
|
70
162
|
type = "text",
|
|
71
163
|
value,
|
|
@@ -74,57 +166,72 @@ var Input = ({
|
|
|
74
166
|
onChangeText = noop,
|
|
75
167
|
onEditCompleted,
|
|
76
168
|
className = "",
|
|
169
|
+
allowEnterComplete = true,
|
|
77
170
|
expanded = true,
|
|
78
|
-
autoFocus,
|
|
171
|
+
autoFocus = false,
|
|
79
172
|
onBlur,
|
|
173
|
+
editCompleteOptions,
|
|
80
174
|
containerClassName,
|
|
175
|
+
disabled,
|
|
81
176
|
...restProps
|
|
82
|
-
})
|
|
177
|
+
}, forwardedRef) {
|
|
178
|
+
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
83
179
|
const {
|
|
84
180
|
restartTimer,
|
|
85
|
-
|
|
86
|
-
} =
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
181
|
+
clearTimer
|
|
182
|
+
} = useDelay({ delay, disabled: !afterDelay });
|
|
183
|
+
const innerRef = useRef(null);
|
|
184
|
+
const { focusNext } = useFocusManagement();
|
|
185
|
+
useFocusOnceVisible(innerRef, !autoFocus);
|
|
186
|
+
useImperativeHandle(forwardedRef, () => innerRef.current);
|
|
187
|
+
const handleKeyDown = (e) => {
|
|
188
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
189
|
+
e.preventDefault();
|
|
190
|
+
innerRef.current?.blur();
|
|
191
|
+
focusNext();
|
|
91
192
|
}
|
|
92
|
-
}
|
|
193
|
+
};
|
|
93
194
|
return /* @__PURE__ */ jsxs("div", { className: clsx2({ "w-full": expanded }, containerClassName), children: [
|
|
94
195
|
label && /* @__PURE__ */ jsx2(Label, { ...label, htmlFor: id, className: clsx2("mb-1", label.className) }),
|
|
95
196
|
/* @__PURE__ */ jsx2(
|
|
96
197
|
"input",
|
|
97
198
|
{
|
|
98
|
-
|
|
199
|
+
...restProps,
|
|
200
|
+
ref: innerRef,
|
|
99
201
|
value,
|
|
100
202
|
id,
|
|
101
203
|
type,
|
|
102
|
-
|
|
204
|
+
disabled,
|
|
205
|
+
className: clsx2(getInputClassName({ disabled }), className),
|
|
206
|
+
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
103
207
|
onBlur: (event) => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
if (onEditCompleted) {
|
|
208
|
+
onBlur?.(event);
|
|
209
|
+
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
108
210
|
onEditCompleted(event.target.value);
|
|
109
|
-
|
|
211
|
+
clearTimer();
|
|
110
212
|
}
|
|
111
213
|
},
|
|
112
214
|
onChange: (e) => {
|
|
113
215
|
const value2 = e.target.value;
|
|
114
216
|
if (onEditCompleted) {
|
|
115
217
|
restartTimer(() => {
|
|
116
|
-
|
|
117
|
-
|
|
218
|
+
if (innerRef.current) {
|
|
219
|
+
innerRef.current.blur();
|
|
220
|
+
if (!allowEditCompleteOnBlur) {
|
|
221
|
+
onEditCompleted(value2);
|
|
222
|
+
}
|
|
223
|
+
} else {
|
|
224
|
+
onEditCompleted(value2);
|
|
225
|
+
}
|
|
118
226
|
});
|
|
119
227
|
}
|
|
120
228
|
onChange(e);
|
|
121
229
|
onChangeText(value2);
|
|
122
|
-
}
|
|
123
|
-
...restProps
|
|
230
|
+
}
|
|
124
231
|
}
|
|
125
232
|
)
|
|
126
233
|
] });
|
|
127
|
-
};
|
|
234
|
+
});
|
|
128
235
|
var FormInput = forwardRef(function FormInput2({
|
|
129
236
|
id,
|
|
130
237
|
labelText,
|
|
@@ -134,19 +241,18 @@ var FormInput = forwardRef(function FormInput2({
|
|
|
134
241
|
errorClassName,
|
|
135
242
|
containerClassName,
|
|
136
243
|
required,
|
|
244
|
+
disabled,
|
|
137
245
|
...restProps
|
|
138
246
|
}, ref) {
|
|
139
247
|
const input = /* @__PURE__ */ jsx2(
|
|
140
248
|
"input",
|
|
141
249
|
{
|
|
250
|
+
...restProps,
|
|
142
251
|
ref,
|
|
143
252
|
id,
|
|
144
|
-
|
|
253
|
+
disabled,
|
|
145
254
|
className: clsx2(
|
|
146
|
-
{
|
|
147
|
-
"focus:border-primary focus:ring-primary": !errorText,
|
|
148
|
-
"focus:border-negative focus:ring-negative text-negative": !!errorText
|
|
149
|
-
},
|
|
255
|
+
getInputClassName({ disabled, hasError: !!errorText }),
|
|
150
256
|
className
|
|
151
257
|
)
|
|
152
258
|
}
|
|
@@ -164,12 +270,21 @@ var FormInput = forwardRef(function FormInput2({
|
|
|
164
270
|
// src/components/user-action/Button.tsx
|
|
165
271
|
import clsx3 from "clsx";
|
|
166
272
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
273
|
+
var ButtonColorUtil = {
|
|
274
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
275
|
+
text: ["primary", "negative", "neutral"],
|
|
276
|
+
outline: ["primary"]
|
|
277
|
+
};
|
|
278
|
+
var IconButtonUtil = {
|
|
279
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
280
|
+
};
|
|
167
281
|
var paddingMapping = {
|
|
168
282
|
small: "btn-sm",
|
|
169
283
|
medium: "btn-md",
|
|
170
284
|
large: "btn-lg"
|
|
171
285
|
};
|
|
172
286
|
var iconPaddingMapping = {
|
|
287
|
+
tiny: "icon-btn-xs",
|
|
173
288
|
small: "icon-btn-sm",
|
|
174
289
|
medium: "icon-btn-md",
|
|
175
290
|
large: "icon-btn-lg"
|
|
@@ -263,7 +378,8 @@ var IconButton = ({
|
|
|
263
378
|
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
264
379
|
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
265
380
|
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
266
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
381
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
382
|
+
transparent: "bg-transparent"
|
|
267
383
|
}[color];
|
|
268
384
|
return /* @__PURE__ */ jsx3(
|
|
269
385
|
"button",
|
|
@@ -272,7 +388,9 @@ var IconButton = ({
|
|
|
272
388
|
disabled: disabled || onClick === void 0,
|
|
273
389
|
className: clsx3(
|
|
274
390
|
{
|
|
275
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
391
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
392
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
393
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
276
394
|
[clsx3(colorClasses, "hover:brightness-90")]: !disabled
|
|
277
395
|
},
|
|
278
396
|
ButtonUtil.iconPaddingMapping[size],
|
|
@@ -285,10 +403,10 @@ var IconButton = ({
|
|
|
285
403
|
};
|
|
286
404
|
|
|
287
405
|
// src/localization/LanguageProvider.tsx
|
|
288
|
-
import { createContext, useContext, useEffect as
|
|
406
|
+
import { createContext, useContext, useEffect as useEffect5, useState as useState4 } from "react";
|
|
289
407
|
|
|
290
408
|
// src/hooks/useLocalStorage.ts
|
|
291
|
-
import { useCallback, useEffect as
|
|
409
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useState as useState3 } from "react";
|
|
292
410
|
|
|
293
411
|
// src/localization/util.ts
|
|
294
412
|
var languages = ["en", "de"];
|
|
@@ -375,12 +493,12 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
375
493
|
import clsx6 from "clsx";
|
|
376
494
|
|
|
377
495
|
// src/components/layout-and-navigation/Overlay.tsx
|
|
378
|
-
import { useEffect as
|
|
496
|
+
import { useEffect as useEffect7, useRef as useRef2, useState as useState6 } from "react";
|
|
379
497
|
import ReactDOM from "react-dom";
|
|
380
498
|
import clsx5 from "clsx";
|
|
381
499
|
|
|
382
500
|
// src/hooks/useHoverState.ts
|
|
383
|
-
import { useEffect as
|
|
501
|
+
import { useEffect as useEffect6, useState as useState5 } from "react";
|
|
384
502
|
var defaultUseHoverStateProps = {
|
|
385
503
|
closingDelay: 200,
|
|
386
504
|
isDisabled: false
|
|
@@ -404,14 +522,14 @@ var useHoverState = (props = void 0) => {
|
|
|
404
522
|
setIsHovered(false);
|
|
405
523
|
}, closingDelay));
|
|
406
524
|
};
|
|
407
|
-
|
|
525
|
+
useEffect6(() => {
|
|
408
526
|
if (timer) {
|
|
409
527
|
return () => {
|
|
410
528
|
clearTimeout(timer);
|
|
411
529
|
};
|
|
412
530
|
}
|
|
413
531
|
});
|
|
414
|
-
|
|
532
|
+
useEffect6(() => {
|
|
415
533
|
if (timer) {
|
|
416
534
|
clearTimeout(timer);
|
|
417
535
|
}
|
|
@@ -496,6 +614,7 @@ import { X } from "lucide-react";
|
|
|
496
614
|
var formTranslation = {
|
|
497
615
|
en: {
|
|
498
616
|
all: "All",
|
|
617
|
+
apply: "Apply",
|
|
499
618
|
back: "Back",
|
|
500
619
|
cancel: "Cancel",
|
|
501
620
|
change: "Change",
|
|
@@ -544,6 +663,7 @@ var formTranslation = {
|
|
|
544
663
|
},
|
|
545
664
|
de: {
|
|
546
665
|
all: "Alle",
|
|
666
|
+
apply: "Anwenden",
|
|
547
667
|
back: "Zur\xFCck",
|
|
548
668
|
cancel: "Abbrechen",
|
|
549
669
|
change: "\xC4ndern",
|
|
@@ -601,7 +721,7 @@ var Overlay = ({
|
|
|
601
721
|
backgroundClassName
|
|
602
722
|
}) => {
|
|
603
723
|
const [root, setRoot] = useState6();
|
|
604
|
-
|
|
724
|
+
useEffect7(() => {
|
|
605
725
|
setRoot(document.body);
|
|
606
726
|
}, []);
|
|
607
727
|
if (!root || !isOpen) return null;
|
|
@@ -664,7 +784,7 @@ var Modal = ({
|
|
|
664
784
|
headerProps
|
|
665
785
|
}) => {
|
|
666
786
|
const ref = useRef2(null);
|
|
667
|
-
|
|
787
|
+
useEffect7(() => {
|
|
668
788
|
if (!isOpen) return;
|
|
669
789
|
const modal = ref.current;
|
|
670
790
|
if (!modal) {
|