@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
|
@@ -34,47 +34,44 @@ __export(InputModal_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(InputModal_exports);
|
|
35
35
|
|
|
36
36
|
// src/components/user-action/Input.tsx
|
|
37
|
-
var
|
|
37
|
+
var import_react4 = require("react");
|
|
38
38
|
var import_clsx2 = __toESM(require("clsx"));
|
|
39
39
|
|
|
40
|
-
// src/hooks/
|
|
40
|
+
// src/hooks/useDelay.ts
|
|
41
41
|
var import_react = require("react");
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
setNotificationTimer(setTimeout(() => {
|
|
52
|
-
setNotificationStatus(false);
|
|
53
|
-
clearTimeout(notificationTimer);
|
|
54
|
-
}, delay));
|
|
55
|
-
clearTimeout(updateTimer);
|
|
56
|
-
}, delay));
|
|
42
|
+
var defaultOptions = {
|
|
43
|
+
delay: 3e3,
|
|
44
|
+
disabled: false
|
|
45
|
+
};
|
|
46
|
+
function useDelay(options) {
|
|
47
|
+
const [timer, setTimer] = (0, import_react.useState)(void 0);
|
|
48
|
+
const { delay, disabled } = {
|
|
49
|
+
...defaultOptions,
|
|
50
|
+
...options
|
|
57
51
|
};
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
setNotificationStatus(true);
|
|
62
|
-
clearTimeout(notificationTimer);
|
|
63
|
-
setNotificationTimer(setTimeout(() => {
|
|
64
|
-
setNotificationStatus(false);
|
|
65
|
-
clearTimeout(notificationTimer);
|
|
66
|
-
}, delay));
|
|
67
|
-
} else {
|
|
68
|
-
setNotificationStatus(false);
|
|
52
|
+
const restartTimer = (onDelayFinish) => {
|
|
53
|
+
if (disabled) {
|
|
54
|
+
return;
|
|
69
55
|
}
|
|
56
|
+
clearTimeout(timer);
|
|
57
|
+
setTimer(setTimeout(() => {
|
|
58
|
+
onDelayFinish();
|
|
59
|
+
}, delay));
|
|
60
|
+
};
|
|
61
|
+
const clearTimer = () => {
|
|
62
|
+
clearTimeout(timer);
|
|
70
63
|
};
|
|
71
64
|
(0, import_react.useEffect)(() => {
|
|
72
65
|
return () => {
|
|
73
|
-
clearTimeout(
|
|
74
|
-
clearTimeout(notificationTimer);
|
|
66
|
+
clearTimeout(timer);
|
|
75
67
|
};
|
|
76
|
-
}, []);
|
|
77
|
-
|
|
68
|
+
}, [timer]);
|
|
69
|
+
(0, import_react.useEffect)(() => {
|
|
70
|
+
if (disabled) {
|
|
71
|
+
clearTimeout(timer);
|
|
72
|
+
}
|
|
73
|
+
}, [disabled, timer]);
|
|
74
|
+
return { restartTimer, clearTimer };
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
// src/util/noop.ts
|
|
@@ -98,9 +95,104 @@ var Label = ({
|
|
|
98
95
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
99
96
|
};
|
|
100
97
|
|
|
98
|
+
// src/hooks/useFocusManagement.ts
|
|
99
|
+
var import_react2 = require("react");
|
|
100
|
+
function useFocusManagement() {
|
|
101
|
+
const getFocusableElements = (0, import_react2.useCallback)(() => {
|
|
102
|
+
return Array.from(
|
|
103
|
+
document.querySelectorAll(
|
|
104
|
+
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
105
|
+
)
|
|
106
|
+
).filter(
|
|
107
|
+
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
108
|
+
);
|
|
109
|
+
}, []);
|
|
110
|
+
const getNextFocusElement = (0, import_react2.useCallback)(() => {
|
|
111
|
+
const elements = getFocusableElements();
|
|
112
|
+
if (elements.length === 0) {
|
|
113
|
+
return void 0;
|
|
114
|
+
}
|
|
115
|
+
let nextElement = elements[0];
|
|
116
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
117
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
118
|
+
nextElement = elements[(currentIndex + 1) % elements.length];
|
|
119
|
+
}
|
|
120
|
+
return nextElement;
|
|
121
|
+
}, [getFocusableElements]);
|
|
122
|
+
const focusNext = (0, import_react2.useCallback)(() => {
|
|
123
|
+
const nextElement = getNextFocusElement();
|
|
124
|
+
nextElement?.focus();
|
|
125
|
+
}, [getNextFocusElement]);
|
|
126
|
+
const getPreviousFocusElement = (0, import_react2.useCallback)(() => {
|
|
127
|
+
const elements = getFocusableElements();
|
|
128
|
+
if (elements.length === 0) {
|
|
129
|
+
return void 0;
|
|
130
|
+
}
|
|
131
|
+
let previousElement = elements[0];
|
|
132
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
133
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
134
|
+
if (currentIndex === 0) {
|
|
135
|
+
previousElement = elements[elements.length - 1];
|
|
136
|
+
} else {
|
|
137
|
+
previousElement = elements[currentIndex - 1];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return previousElement;
|
|
141
|
+
}, [getFocusableElements]);
|
|
142
|
+
const focusPrevious = (0, import_react2.useCallback)(() => {
|
|
143
|
+
const previousElement = getPreviousFocusElement();
|
|
144
|
+
if (previousElement) previousElement.focus();
|
|
145
|
+
}, [getPreviousFocusElement]);
|
|
146
|
+
return {
|
|
147
|
+
getFocusableElements,
|
|
148
|
+
getNextFocusElement,
|
|
149
|
+
getPreviousFocusElement,
|
|
150
|
+
focusNext,
|
|
151
|
+
focusPrevious
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// src/hooks/useFocusOnceVisible.ts
|
|
156
|
+
var import_react3 = __toESM(require("react"));
|
|
157
|
+
var useFocusOnceVisible = (ref, disable = false) => {
|
|
158
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react3.default.useState(false);
|
|
159
|
+
(0, import_react3.useEffect)(() => {
|
|
160
|
+
if (disable || hasUsedFocus) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
164
|
+
if (entry.isIntersecting && !hasUsedFocus) {
|
|
165
|
+
ref.current?.focus();
|
|
166
|
+
setHasUsedFocus(hasUsedFocus);
|
|
167
|
+
}
|
|
168
|
+
}, {
|
|
169
|
+
threshold: 0.1
|
|
170
|
+
});
|
|
171
|
+
if (ref.current) {
|
|
172
|
+
observer.observe(ref.current);
|
|
173
|
+
}
|
|
174
|
+
return () => observer.disconnect();
|
|
175
|
+
}, [disable, hasUsedFocus, ref]);
|
|
176
|
+
};
|
|
177
|
+
|
|
101
178
|
// src/components/user-action/Input.tsx
|
|
102
179
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
103
|
-
var
|
|
180
|
+
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
181
|
+
return (0, import_clsx2.default)(
|
|
182
|
+
"px-2 py-1.5 rounded-md border-2",
|
|
183
|
+
{
|
|
184
|
+
"bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
185
|
+
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
186
|
+
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
};
|
|
190
|
+
var defaultEditCompleteOptions = {
|
|
191
|
+
onBlur: true,
|
|
192
|
+
afterDelay: true,
|
|
193
|
+
delay: 2500
|
|
194
|
+
};
|
|
195
|
+
var Input = (0, import_react4.forwardRef)(function Input2({
|
|
104
196
|
id,
|
|
105
197
|
type = "text",
|
|
106
198
|
value,
|
|
@@ -109,58 +201,73 @@ var Input = ({
|
|
|
109
201
|
onChangeText = noop,
|
|
110
202
|
onEditCompleted,
|
|
111
203
|
className = "",
|
|
204
|
+
allowEnterComplete = true,
|
|
112
205
|
expanded = true,
|
|
113
|
-
autoFocus,
|
|
206
|
+
autoFocus = false,
|
|
114
207
|
onBlur,
|
|
208
|
+
editCompleteOptions,
|
|
115
209
|
containerClassName,
|
|
210
|
+
disabled,
|
|
116
211
|
...restProps
|
|
117
|
-
})
|
|
212
|
+
}, forwardedRef) {
|
|
213
|
+
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
118
214
|
const {
|
|
119
215
|
restartTimer,
|
|
120
|
-
|
|
121
|
-
} =
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
216
|
+
clearTimer
|
|
217
|
+
} = useDelay({ delay, disabled: !afterDelay });
|
|
218
|
+
const innerRef = (0, import_react4.useRef)(null);
|
|
219
|
+
const { focusNext } = useFocusManagement();
|
|
220
|
+
useFocusOnceVisible(innerRef, !autoFocus);
|
|
221
|
+
(0, import_react4.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
222
|
+
const handleKeyDown = (e) => {
|
|
223
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
224
|
+
e.preventDefault();
|
|
225
|
+
innerRef.current?.blur();
|
|
226
|
+
focusNext();
|
|
126
227
|
}
|
|
127
|
-
}
|
|
228
|
+
};
|
|
128
229
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: (0, import_clsx2.default)({ "w-full": expanded }, containerClassName), children: [
|
|
129
230
|
label && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx2.default)("mb-1", label.className) }),
|
|
130
231
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
131
232
|
"input",
|
|
132
233
|
{
|
|
133
|
-
|
|
234
|
+
...restProps,
|
|
235
|
+
ref: innerRef,
|
|
134
236
|
value,
|
|
135
237
|
id,
|
|
136
238
|
type,
|
|
137
|
-
|
|
239
|
+
disabled,
|
|
240
|
+
className: (0, import_clsx2.default)(getInputClassName({ disabled }), className),
|
|
241
|
+
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
138
242
|
onBlur: (event) => {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
if (onEditCompleted) {
|
|
243
|
+
onBlur?.(event);
|
|
244
|
+
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
143
245
|
onEditCompleted(event.target.value);
|
|
144
|
-
|
|
246
|
+
clearTimer();
|
|
145
247
|
}
|
|
146
248
|
},
|
|
147
249
|
onChange: (e) => {
|
|
148
250
|
const value2 = e.target.value;
|
|
149
251
|
if (onEditCompleted) {
|
|
150
252
|
restartTimer(() => {
|
|
151
|
-
|
|
152
|
-
|
|
253
|
+
if (innerRef.current) {
|
|
254
|
+
innerRef.current.blur();
|
|
255
|
+
if (!allowEditCompleteOnBlur) {
|
|
256
|
+
onEditCompleted(value2);
|
|
257
|
+
}
|
|
258
|
+
} else {
|
|
259
|
+
onEditCompleted(value2);
|
|
260
|
+
}
|
|
153
261
|
});
|
|
154
262
|
}
|
|
155
263
|
onChange(e);
|
|
156
264
|
onChangeText(value2);
|
|
157
|
-
}
|
|
158
|
-
...restProps
|
|
265
|
+
}
|
|
159
266
|
}
|
|
160
267
|
)
|
|
161
268
|
] });
|
|
162
|
-
};
|
|
163
|
-
var FormInput = (0,
|
|
269
|
+
});
|
|
270
|
+
var FormInput = (0, import_react4.forwardRef)(function FormInput2({
|
|
164
271
|
id,
|
|
165
272
|
labelText,
|
|
166
273
|
errorText,
|
|
@@ -169,19 +276,18 @@ var FormInput = (0, import_react2.forwardRef)(function FormInput2({
|
|
|
169
276
|
errorClassName,
|
|
170
277
|
containerClassName,
|
|
171
278
|
required,
|
|
279
|
+
disabled,
|
|
172
280
|
...restProps
|
|
173
281
|
}, ref) {
|
|
174
282
|
const input = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
175
283
|
"input",
|
|
176
284
|
{
|
|
285
|
+
...restProps,
|
|
177
286
|
ref,
|
|
178
287
|
id,
|
|
179
|
-
|
|
288
|
+
disabled,
|
|
180
289
|
className: (0, import_clsx2.default)(
|
|
181
|
-
{
|
|
182
|
-
"focus:border-primary focus:ring-primary": !errorText,
|
|
183
|
-
"focus:border-negative focus:ring-negative text-negative": !!errorText
|
|
184
|
-
},
|
|
290
|
+
getInputClassName({ disabled, hasError: !!errorText }),
|
|
185
291
|
className
|
|
186
292
|
)
|
|
187
293
|
}
|
|
@@ -199,12 +305,21 @@ var FormInput = (0, import_react2.forwardRef)(function FormInput2({
|
|
|
199
305
|
// src/components/user-action/Button.tsx
|
|
200
306
|
var import_clsx3 = __toESM(require("clsx"));
|
|
201
307
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
308
|
+
var ButtonColorUtil = {
|
|
309
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
310
|
+
text: ["primary", "negative", "neutral"],
|
|
311
|
+
outline: ["primary"]
|
|
312
|
+
};
|
|
313
|
+
var IconButtonUtil = {
|
|
314
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
315
|
+
};
|
|
202
316
|
var paddingMapping = {
|
|
203
317
|
small: "btn-sm",
|
|
204
318
|
medium: "btn-md",
|
|
205
319
|
large: "btn-lg"
|
|
206
320
|
};
|
|
207
321
|
var iconPaddingMapping = {
|
|
322
|
+
tiny: "icon-btn-xs",
|
|
208
323
|
small: "icon-btn-sm",
|
|
209
324
|
medium: "icon-btn-md",
|
|
210
325
|
large: "icon-btn-lg"
|
|
@@ -298,7 +413,8 @@ var IconButton = ({
|
|
|
298
413
|
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
299
414
|
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
300
415
|
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
301
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
416
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
417
|
+
transparent: "bg-transparent"
|
|
302
418
|
}[color];
|
|
303
419
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
304
420
|
"button",
|
|
@@ -307,7 +423,9 @@ var IconButton = ({
|
|
|
307
423
|
disabled: disabled || onClick === void 0,
|
|
308
424
|
className: (0, import_clsx3.default)(
|
|
309
425
|
{
|
|
310
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
426
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
427
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
428
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
311
429
|
[(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
312
430
|
},
|
|
313
431
|
ButtonUtil.iconPaddingMapping[size],
|
|
@@ -320,10 +438,10 @@ var IconButton = ({
|
|
|
320
438
|
};
|
|
321
439
|
|
|
322
440
|
// src/localization/LanguageProvider.tsx
|
|
323
|
-
var
|
|
441
|
+
var import_react6 = require("react");
|
|
324
442
|
|
|
325
443
|
// src/hooks/useLocalStorage.ts
|
|
326
|
-
var
|
|
444
|
+
var import_react5 = require("react");
|
|
327
445
|
|
|
328
446
|
// src/localization/util.ts
|
|
329
447
|
var languages = ["en", "de"];
|
|
@@ -340,11 +458,11 @@ var LanguageUtil = {
|
|
|
340
458
|
|
|
341
459
|
// src/localization/LanguageProvider.tsx
|
|
342
460
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
343
|
-
var LanguageContext = (0,
|
|
461
|
+
var LanguageContext = (0, import_react6.createContext)({
|
|
344
462
|
language: LanguageUtil.DEFAULT_LANGUAGE,
|
|
345
463
|
setLanguage: (v) => v
|
|
346
464
|
});
|
|
347
|
-
var useLanguage = () => (0,
|
|
465
|
+
var useLanguage = () => (0, import_react6.useContext)(LanguageContext);
|
|
348
466
|
|
|
349
467
|
// src/localization/useTranslation.ts
|
|
350
468
|
var TranslationPluralCount = {
|
|
@@ -410,20 +528,20 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
410
528
|
var import_clsx6 = __toESM(require("clsx"));
|
|
411
529
|
|
|
412
530
|
// src/components/layout-and-navigation/Overlay.tsx
|
|
413
|
-
var
|
|
531
|
+
var import_react8 = require("react");
|
|
414
532
|
var import_react_dom = __toESM(require("react-dom"));
|
|
415
533
|
var import_clsx5 = __toESM(require("clsx"));
|
|
416
534
|
|
|
417
535
|
// src/hooks/useHoverState.ts
|
|
418
|
-
var
|
|
536
|
+
var import_react7 = require("react");
|
|
419
537
|
var defaultUseHoverStateProps = {
|
|
420
538
|
closingDelay: 200,
|
|
421
539
|
isDisabled: false
|
|
422
540
|
};
|
|
423
541
|
var useHoverState = (props = void 0) => {
|
|
424
542
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
425
|
-
const [isHovered, setIsHovered] = (0,
|
|
426
|
-
const [timer, setTimer] = (0,
|
|
543
|
+
const [isHovered, setIsHovered] = (0, import_react7.useState)(false);
|
|
544
|
+
const [timer, setTimer] = (0, import_react7.useState)();
|
|
427
545
|
const onMouseEnter = () => {
|
|
428
546
|
if (isDisabled) {
|
|
429
547
|
return;
|
|
@@ -439,14 +557,14 @@ var useHoverState = (props = void 0) => {
|
|
|
439
557
|
setIsHovered(false);
|
|
440
558
|
}, closingDelay));
|
|
441
559
|
};
|
|
442
|
-
(0,
|
|
560
|
+
(0, import_react7.useEffect)(() => {
|
|
443
561
|
if (timer) {
|
|
444
562
|
return () => {
|
|
445
563
|
clearTimeout(timer);
|
|
446
564
|
};
|
|
447
565
|
}
|
|
448
566
|
});
|
|
449
|
-
(0,
|
|
567
|
+
(0, import_react7.useEffect)(() => {
|
|
450
568
|
if (timer) {
|
|
451
569
|
clearTimeout(timer);
|
|
452
570
|
}
|
|
@@ -531,6 +649,7 @@ var import_lucide_react = require("lucide-react");
|
|
|
531
649
|
var formTranslation = {
|
|
532
650
|
en: {
|
|
533
651
|
all: "All",
|
|
652
|
+
apply: "Apply",
|
|
534
653
|
back: "Back",
|
|
535
654
|
cancel: "Cancel",
|
|
536
655
|
change: "Change",
|
|
@@ -579,6 +698,7 @@ var formTranslation = {
|
|
|
579
698
|
},
|
|
580
699
|
de: {
|
|
581
700
|
all: "Alle",
|
|
701
|
+
apply: "Anwenden",
|
|
582
702
|
back: "Zur\xFCck",
|
|
583
703
|
cancel: "Abbrechen",
|
|
584
704
|
change: "\xC4ndern",
|
|
@@ -635,8 +755,8 @@ var Overlay = ({
|
|
|
635
755
|
onBackgroundClick,
|
|
636
756
|
backgroundClassName
|
|
637
757
|
}) => {
|
|
638
|
-
const [root, setRoot] = (0,
|
|
639
|
-
(0,
|
|
758
|
+
const [root, setRoot] = (0, import_react8.useState)();
|
|
759
|
+
(0, import_react8.useEffect)(() => {
|
|
640
760
|
setRoot(document.body);
|
|
641
761
|
}, []);
|
|
642
762
|
if (!root || !isOpen) return null;
|
|
@@ -698,8 +818,8 @@ var Modal = ({
|
|
|
698
818
|
backgroundClassName,
|
|
699
819
|
headerProps
|
|
700
820
|
}) => {
|
|
701
|
-
const ref = (0,
|
|
702
|
-
(0,
|
|
821
|
+
const ref = (0, import_react8.useRef)(null);
|
|
822
|
+
(0, import_react8.useEffect)(() => {
|
|
703
823
|
if (!isOpen) return;
|
|
704
824
|
const modal = ref.current;
|
|
705
825
|
if (!modal) {
|