@helpwave/hightide 0.1.18 → 0.1.19
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 +7 -7
- package/dist/components/branding/HelpwaveBadge.js.map +1 -1
- package/dist/components/branding/HelpwaveBadge.mjs +7 -7
- package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
- package/dist/components/date/DatePicker.js +65 -38
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +54 -27
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.js +3 -3
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs +3 -3
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/TimePicker.js +4 -4
- package/dist/components/date/TimePicker.js.map +1 -1
- package/dist/components/date/TimePicker.mjs +4 -4
- package/dist/components/date/TimePicker.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js +46 -19
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +44 -17
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.js +32 -28
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +18 -14
- 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/icons-and-geometry/Ring.js +2 -2
- package/dist/components/icons-and-geometry/Ring.js.map +1 -1
- package/dist/components/icons-and-geometry/Ring.mjs +2 -2
- package/dist/components/icons-and-geometry/Ring.mjs.map +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.js +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.js.map +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.mjs +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.js +84 -15
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.mjs +76 -7
- package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Chip.js +1 -1
- package/dist/components/layout-and-navigation/Chip.js.map +1 -1
- package/dist/components/layout-and-navigation/Chip.mjs +1 -1
- package/dist/components/layout-and-navigation/Chip.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.d.mts +7 -1
- package/dist/components/layout-and-navigation/Expandable.d.ts +7 -1
- package/dist/components/layout-and-navigation/Expandable.js +36 -9
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +36 -10
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +34 -11
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs +36 -13
- package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.js +92 -19
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +81 -8
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.js +82 -9
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +79 -6
- package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.js +127 -25
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +126 -24
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.js +22 -16
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +19 -13
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.js +7 -3
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +7 -3
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Tile.d.mts +2 -2
- package/dist/components/layout-and-navigation/Tile.d.ts +2 -2
- package/dist/components/layout-and-navigation/Tile.js +7 -7
- package/dist/components/layout-and-navigation/Tile.js.map +1 -1
- package/dist/components/layout-and-navigation/Tile.mjs +7 -7
- package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js +1 -1
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.js +6 -2
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +6 -2
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.js +5 -1
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +5 -1
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/loading-states/LoadingButton.js +8 -6
- package/dist/components/loading-states/LoadingButton.js.map +1 -1
- package/dist/components/loading-states/LoadingButton.mjs +8 -6
- package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.js +32 -28
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +18 -14
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.js +28 -24
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +18 -14
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
- package/dist/components/modals/InputModal.js +32 -28
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +18 -14
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +728 -434
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +728 -430
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +732 -438
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +731 -433
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js +110 -35
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +110 -35
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js +118 -41
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +114 -37
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +10 -3
- package/dist/components/properties/MultiSelectProperty.d.ts +10 -3
- package/dist/components/properties/MultiSelectProperty.js +915 -463
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +920 -464
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js +101 -18
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +101 -18
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js +103 -20
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +99 -16
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +9 -2
- package/dist/components/properties/SelectProperty.d.ts +9 -2
- package/dist/components/properties/SelectProperty.js +682 -243
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +686 -243
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js +133 -46
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +133 -46
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/table/Table.js +285 -185
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.mjs +270 -166
- package/dist/components/table/Table.mjs.map +1 -1
- package/dist/components/table/TableFilterButton.js +179 -78
- package/dist/components/table/TableFilterButton.js.map +1 -1
- package/dist/components/table/TableFilterButton.mjs +160 -55
- package/dist/components/table/TableFilterButton.mjs.map +1 -1
- package/dist/components/table/TableSortButton.js +72 -3
- package/dist/components/table/TableSortButton.js.map +1 -1
- package/dist/components/table/TableSortButton.mjs +72 -3
- package/dist/components/table/TableSortButton.mjs.map +1 -1
- package/dist/components/user-action/Button.d.mts +15 -2
- package/dist/components/user-action/Button.d.ts +15 -2
- package/dist/components/user-action/Button.js +12 -12
- package/dist/components/user-action/Button.js.map +1 -1
- package/dist/components/user-action/Button.mjs +12 -12
- package/dist/components/user-action/Button.mjs.map +1 -1
- package/dist/components/user-action/Checkbox.js +6 -15
- package/dist/components/user-action/Checkbox.js.map +1 -1
- package/dist/components/user-action/Checkbox.mjs +6 -15
- package/dist/components/user-action/Checkbox.mjs.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.js +6 -2
- package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.mjs +6 -2
- package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js +79 -48
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +65 -34
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Menu.d.mts +11 -6
- package/dist/components/user-action/Menu.d.ts +11 -6
- package/dist/components/user-action/Menu.js +128 -31
- package/dist/components/user-action/Menu.js.map +1 -1
- package/dist/components/user-action/Menu.mjs +134 -33
- package/dist/components/user-action/Menu.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +17 -7
- package/dist/components/user-action/MultiSelect.d.ts +17 -7
- package/dist/components/user-action/MultiSelect.js +796 -375
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +781 -356
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/ScrollPicker.js +2 -2
- package/dist/components/user-action/ScrollPicker.js.map +1 -1
- package/dist/components/user-action/ScrollPicker.mjs +2 -2
- package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
- package/dist/components/user-action/SearchBar.d.mts +14 -0
- package/dist/components/user-action/SearchBar.d.ts +14 -0
- package/dist/components/user-action/SearchBar.js +673 -0
- package/dist/components/user-action/SearchBar.js.map +1 -0
- package/dist/components/user-action/SearchBar.mjs +637 -0
- package/dist/components/user-action/SearchBar.mjs.map +1 -0
- package/dist/components/user-action/Select.d.mts +18 -5
- package/dist/components/user-action/Select.d.ts +18 -5
- package/dist/components/user-action/Select.js +764 -355
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +761 -349
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Textarea.d.mts +1 -1
- package/dist/components/user-action/Textarea.d.ts +1 -1
- package/dist/components/user-action/Textarea.js +13 -3
- package/dist/components/user-action/Textarea.js.map +1 -1
- package/dist/components/user-action/Textarea.mjs +13 -3
- package/dist/components/user-action/Textarea.mjs.map +1 -1
- package/dist/components/user-action/ToggleableInput.js +2 -2
- package/dist/components/user-action/ToggleableInput.js.map +1 -1
- package/dist/components/user-action/ToggleableInput.mjs +2 -2
- package/dist/components/user-action/ToggleableInput.mjs.map +1 -1
- package/dist/css/globals.css +251 -113
- package/dist/css/uncompiled/globals.css +19 -13
- package/dist/css/uncompiled/theme/colors-component.css +12 -3
- package/dist/css/uncompiled/theme/colors-semantic.css +10 -7
- package/dist/css/uncompiled/utitlity/animation.css +70 -1
- package/dist/css/uncompiled/utitlity/general.css +16 -0
- package/dist/hooks/usePopoverPosition.d.mts +15 -0
- package/dist/hooks/usePopoverPosition.d.ts +15 -0
- package/dist/hooks/usePopoverPosition.js +81 -0
- package/dist/hooks/usePopoverPosition.js.map +1 -0
- package/dist/hooks/usePopoverPosition.mjs +57 -0
- package/dist/hooks/usePopoverPosition.mjs.map +1 -0
- package/dist/hooks/useSearch.d.mts +7 -2
- package/dist/hooks/useSearch.d.ts +7 -2
- package/dist/hooks/useSearch.js +44 -15
- package/dist/hooks/useSearch.js.map +1 -1
- package/dist/hooks/useSearch.mjs +45 -16
- package/dist/hooks/useSearch.mjs.map +1 -1
- package/dist/index.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +1102 -819
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1001 -718
- package/dist/index.mjs.map +1 -1
- package/dist/localization/defaults/form.d.mts +2 -0
- package/dist/localization/defaults/form.d.ts +2 -0
- package/dist/localization/defaults/form.js +4 -0
- package/dist/localization/defaults/form.js.map +1 -1
- package/dist/localization/defaults/form.mjs +4 -0
- package/dist/localization/defaults/form.mjs.map +1 -1
- package/dist/util/simpleSearch.d.mts +1 -1
- package/dist/util/simpleSearch.d.ts +1 -1
- 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 -1
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/user-action/SearchBar.tsx
|
|
30
|
+
var SearchBar_exports = {};
|
|
31
|
+
__export(SearchBar_exports, {
|
|
32
|
+
SearchBar: () => SearchBar
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(SearchBar_exports);
|
|
35
|
+
|
|
36
|
+
// src/components/user-action/Input.tsx
|
|
37
|
+
var import_react4 = require("react");
|
|
38
|
+
var import_clsx2 = __toESM(require("clsx"));
|
|
39
|
+
|
|
40
|
+
// src/hooks/useDelay.ts
|
|
41
|
+
var import_react = require("react");
|
|
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
|
|
51
|
+
};
|
|
52
|
+
const clearTimer = () => {
|
|
53
|
+
clearTimeout(timer);
|
|
54
|
+
setTimer(void 0);
|
|
55
|
+
};
|
|
56
|
+
const restartTimer = (onDelayFinish) => {
|
|
57
|
+
if (disabled) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
clearTimeout(timer);
|
|
61
|
+
setTimer(setTimeout(() => {
|
|
62
|
+
onDelayFinish();
|
|
63
|
+
setTimer(void 0);
|
|
64
|
+
}, delay));
|
|
65
|
+
};
|
|
66
|
+
(0, import_react.useEffect)(() => {
|
|
67
|
+
return () => {
|
|
68
|
+
clearTimeout(timer);
|
|
69
|
+
};
|
|
70
|
+
}, [timer]);
|
|
71
|
+
(0, import_react.useEffect)(() => {
|
|
72
|
+
if (disabled) {
|
|
73
|
+
clearTimeout(timer);
|
|
74
|
+
setTimer(void 0);
|
|
75
|
+
}
|
|
76
|
+
}, [disabled, timer]);
|
|
77
|
+
return { restartTimer, clearTimer, hasActiveTimer: !!timer };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// src/util/noop.ts
|
|
81
|
+
var noop = () => void 0;
|
|
82
|
+
|
|
83
|
+
// src/components/user-action/Label.tsx
|
|
84
|
+
var import_clsx = __toESM(require("clsx"));
|
|
85
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
86
|
+
var styleMapping = {
|
|
87
|
+
labelSmall: "textstyle-label-sm",
|
|
88
|
+
labelMedium: "textstyle-label-md",
|
|
89
|
+
labelBig: "textstyle-label-lg"
|
|
90
|
+
};
|
|
91
|
+
var Label = ({
|
|
92
|
+
children,
|
|
93
|
+
name,
|
|
94
|
+
labelType = "labelSmall",
|
|
95
|
+
className,
|
|
96
|
+
...props
|
|
97
|
+
}) => {
|
|
98
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// src/hooks/useFocusManagement.ts
|
|
102
|
+
var import_react2 = require("react");
|
|
103
|
+
function useFocusManagement() {
|
|
104
|
+
const getFocusableElements = (0, import_react2.useCallback)(() => {
|
|
105
|
+
return Array.from(
|
|
106
|
+
document.querySelectorAll(
|
|
107
|
+
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
108
|
+
)
|
|
109
|
+
).filter(
|
|
110
|
+
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
111
|
+
);
|
|
112
|
+
}, []);
|
|
113
|
+
const getNextFocusElement = (0, import_react2.useCallback)(() => {
|
|
114
|
+
const elements = getFocusableElements();
|
|
115
|
+
if (elements.length === 0) {
|
|
116
|
+
return void 0;
|
|
117
|
+
}
|
|
118
|
+
let nextElement = elements[0];
|
|
119
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
120
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
121
|
+
nextElement = elements[(currentIndex + 1) % elements.length];
|
|
122
|
+
}
|
|
123
|
+
return nextElement;
|
|
124
|
+
}, [getFocusableElements]);
|
|
125
|
+
const focusNext = (0, import_react2.useCallback)(() => {
|
|
126
|
+
const nextElement = getNextFocusElement();
|
|
127
|
+
nextElement?.focus();
|
|
128
|
+
}, [getNextFocusElement]);
|
|
129
|
+
const getPreviousFocusElement = (0, import_react2.useCallback)(() => {
|
|
130
|
+
const elements = getFocusableElements();
|
|
131
|
+
if (elements.length === 0) {
|
|
132
|
+
return void 0;
|
|
133
|
+
}
|
|
134
|
+
let previousElement = elements[0];
|
|
135
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
136
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
137
|
+
if (currentIndex === 0) {
|
|
138
|
+
previousElement = elements[elements.length - 1];
|
|
139
|
+
} else {
|
|
140
|
+
previousElement = elements[currentIndex - 1];
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return previousElement;
|
|
144
|
+
}, [getFocusableElements]);
|
|
145
|
+
const focusPrevious = (0, import_react2.useCallback)(() => {
|
|
146
|
+
const previousElement = getPreviousFocusElement();
|
|
147
|
+
if (previousElement) previousElement.focus();
|
|
148
|
+
}, [getPreviousFocusElement]);
|
|
149
|
+
return {
|
|
150
|
+
getFocusableElements,
|
|
151
|
+
getNextFocusElement,
|
|
152
|
+
getPreviousFocusElement,
|
|
153
|
+
focusNext,
|
|
154
|
+
focusPrevious
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// src/hooks/useFocusOnceVisible.ts
|
|
159
|
+
var import_react3 = __toESM(require("react"));
|
|
160
|
+
var useFocusOnceVisible = (ref, disable = false) => {
|
|
161
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react3.default.useState(false);
|
|
162
|
+
(0, import_react3.useEffect)(() => {
|
|
163
|
+
if (disable || hasUsedFocus) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
167
|
+
if (entry.isIntersecting && !hasUsedFocus) {
|
|
168
|
+
ref.current?.focus();
|
|
169
|
+
setHasUsedFocus(hasUsedFocus);
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
172
|
+
threshold: 0.1
|
|
173
|
+
});
|
|
174
|
+
if (ref.current) {
|
|
175
|
+
observer.observe(ref.current);
|
|
176
|
+
}
|
|
177
|
+
return () => observer.disconnect();
|
|
178
|
+
}, [disable, hasUsedFocus, ref]);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
// src/components/user-action/Input.tsx
|
|
182
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
183
|
+
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
184
|
+
return (0, import_clsx2.default)(
|
|
185
|
+
"px-2 py-1.5 rounded-md border-2",
|
|
186
|
+
{
|
|
187
|
+
"bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
188
|
+
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
189
|
+
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
var defaultEditCompleteOptions = {
|
|
194
|
+
onBlur: true,
|
|
195
|
+
afterDelay: true,
|
|
196
|
+
delay: 2500
|
|
197
|
+
};
|
|
198
|
+
var Input = (0, import_react4.forwardRef)(function Input2({
|
|
199
|
+
id,
|
|
200
|
+
type = "text",
|
|
201
|
+
value,
|
|
202
|
+
label,
|
|
203
|
+
onChange = noop,
|
|
204
|
+
onChangeText = noop,
|
|
205
|
+
onEditCompleted,
|
|
206
|
+
className = "",
|
|
207
|
+
allowEnterComplete = true,
|
|
208
|
+
expanded = true,
|
|
209
|
+
autoFocus = false,
|
|
210
|
+
onBlur,
|
|
211
|
+
editCompleteOptions,
|
|
212
|
+
containerClassName,
|
|
213
|
+
disabled,
|
|
214
|
+
...restProps
|
|
215
|
+
}, forwardedRef) {
|
|
216
|
+
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
217
|
+
const {
|
|
218
|
+
restartTimer,
|
|
219
|
+
clearTimer
|
|
220
|
+
} = useDelay({ delay, disabled: !afterDelay });
|
|
221
|
+
const innerRef = (0, import_react4.useRef)(null);
|
|
222
|
+
const { focusNext } = useFocusManagement();
|
|
223
|
+
useFocusOnceVisible(innerRef, !autoFocus);
|
|
224
|
+
(0, import_react4.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
225
|
+
const handleKeyDown = (e) => {
|
|
226
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
227
|
+
e.preventDefault();
|
|
228
|
+
innerRef.current?.blur();
|
|
229
|
+
focusNext();
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: (0, import_clsx2.default)({ "w-full": expanded }, containerClassName), children: [
|
|
233
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx2.default)("mb-1", label.className) }),
|
|
234
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
235
|
+
"input",
|
|
236
|
+
{
|
|
237
|
+
...restProps,
|
|
238
|
+
ref: innerRef,
|
|
239
|
+
value,
|
|
240
|
+
id,
|
|
241
|
+
type,
|
|
242
|
+
disabled,
|
|
243
|
+
className: (0, import_clsx2.default)(getInputClassName({ disabled }), className),
|
|
244
|
+
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
245
|
+
onBlur: (event) => {
|
|
246
|
+
onBlur?.(event);
|
|
247
|
+
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
248
|
+
onEditCompleted(event.target.value);
|
|
249
|
+
clearTimer();
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
onChange: (e) => {
|
|
253
|
+
const value2 = e.target.value;
|
|
254
|
+
if (onEditCompleted) {
|
|
255
|
+
restartTimer(() => {
|
|
256
|
+
if (innerRef.current) {
|
|
257
|
+
innerRef.current.blur();
|
|
258
|
+
if (!allowEditCompleteOnBlur) {
|
|
259
|
+
onEditCompleted(value2);
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
onEditCompleted(value2);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
onChange(e);
|
|
267
|
+
onChangeText(value2);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
)
|
|
271
|
+
] });
|
|
272
|
+
});
|
|
273
|
+
var FormInput = (0, import_react4.forwardRef)(function FormInput2({
|
|
274
|
+
id,
|
|
275
|
+
labelText,
|
|
276
|
+
errorText,
|
|
277
|
+
className,
|
|
278
|
+
labelClassName,
|
|
279
|
+
errorClassName,
|
|
280
|
+
containerClassName,
|
|
281
|
+
required,
|
|
282
|
+
disabled,
|
|
283
|
+
...restProps
|
|
284
|
+
}, ref) {
|
|
285
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
286
|
+
"input",
|
|
287
|
+
{
|
|
288
|
+
...restProps,
|
|
289
|
+
ref,
|
|
290
|
+
id,
|
|
291
|
+
disabled,
|
|
292
|
+
className: (0, import_clsx2.default)(
|
|
293
|
+
getInputClassName({ disabled, hasError: !!errorText }),
|
|
294
|
+
className
|
|
295
|
+
)
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: (0, import_clsx2.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
299
|
+
labelText && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { htmlFor: id, className: (0, import_clsx2.default)("textstyle-label-md", labelClassName), children: [
|
|
300
|
+
labelText,
|
|
301
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
302
|
+
] }),
|
|
303
|
+
input,
|
|
304
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: id, className: (0, import_clsx2.default)("text-negative", errorClassName), children: errorText })
|
|
305
|
+
] });
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
// src/localization/LanguageProvider.tsx
|
|
309
|
+
var import_react6 = require("react");
|
|
310
|
+
|
|
311
|
+
// src/hooks/useLocalStorage.ts
|
|
312
|
+
var import_react5 = require("react");
|
|
313
|
+
|
|
314
|
+
// src/localization/util.ts
|
|
315
|
+
var languages = ["en", "de"];
|
|
316
|
+
var languagesLocalNames = {
|
|
317
|
+
en: "English",
|
|
318
|
+
de: "Deutsch"
|
|
319
|
+
};
|
|
320
|
+
var DEFAULT_LANGUAGE = "en";
|
|
321
|
+
var LanguageUtil = {
|
|
322
|
+
languages,
|
|
323
|
+
DEFAULT_LANGUAGE,
|
|
324
|
+
languagesLocalNames
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
// src/localization/LanguageProvider.tsx
|
|
328
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
329
|
+
var LanguageContext = (0, import_react6.createContext)({
|
|
330
|
+
language: LanguageUtil.DEFAULT_LANGUAGE,
|
|
331
|
+
setLanguage: (v) => v
|
|
332
|
+
});
|
|
333
|
+
var useLanguage = () => (0, import_react6.useContext)(LanguageContext);
|
|
334
|
+
|
|
335
|
+
// src/localization/useTranslation.ts
|
|
336
|
+
var TranslationPluralCount = {
|
|
337
|
+
zero: 0,
|
|
338
|
+
one: 1,
|
|
339
|
+
two: 2,
|
|
340
|
+
few: 3,
|
|
341
|
+
many: 11,
|
|
342
|
+
other: -1
|
|
343
|
+
};
|
|
344
|
+
var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
345
|
+
const { language: languageProp, translation: overwrite } = overwriteTranslation;
|
|
346
|
+
const { language: inferredLanguage } = useLanguage();
|
|
347
|
+
const usedLanguage = languageProp ?? inferredLanguage;
|
|
348
|
+
const usedTranslations = [...translations];
|
|
349
|
+
if (overwrite) {
|
|
350
|
+
usedTranslations.push(overwrite);
|
|
351
|
+
}
|
|
352
|
+
return (key, options) => {
|
|
353
|
+
const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options };
|
|
354
|
+
try {
|
|
355
|
+
for (let i = translations.length - 1; i >= 0; i--) {
|
|
356
|
+
const translation = translations[i];
|
|
357
|
+
const localizedTranslation = translation[usedLanguage];
|
|
358
|
+
if (!localizedTranslation) {
|
|
359
|
+
continue;
|
|
360
|
+
}
|
|
361
|
+
const value = localizedTranslation[key];
|
|
362
|
+
if (!value) {
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
let forProcessing;
|
|
366
|
+
if (typeof value !== "string") {
|
|
367
|
+
if (count === TranslationPluralCount.zero && value?.zero) {
|
|
368
|
+
forProcessing = value.zero;
|
|
369
|
+
} else if (count === TranslationPluralCount.one && value?.one) {
|
|
370
|
+
forProcessing = value.one;
|
|
371
|
+
} else if (count === TranslationPluralCount.two && value?.two) {
|
|
372
|
+
forProcessing = value.two;
|
|
373
|
+
} else if (TranslationPluralCount.few <= count && count < TranslationPluralCount.many && value?.few) {
|
|
374
|
+
forProcessing = value.few;
|
|
375
|
+
} else if (count > TranslationPluralCount.many && value?.many) {
|
|
376
|
+
forProcessing = value.many;
|
|
377
|
+
} else {
|
|
378
|
+
forProcessing = value.other;
|
|
379
|
+
}
|
|
380
|
+
} else {
|
|
381
|
+
forProcessing = value;
|
|
382
|
+
}
|
|
383
|
+
forProcessing = forProcessing.replace(/\{\{(\w+)}}/g, (_, placeholder) => {
|
|
384
|
+
return replacements[placeholder] ?? `{{key:${placeholder}}}`;
|
|
385
|
+
});
|
|
386
|
+
return forProcessing;
|
|
387
|
+
}
|
|
388
|
+
} catch (e) {
|
|
389
|
+
console.error(e);
|
|
390
|
+
}
|
|
391
|
+
return `{{${usedLanguage}:${key}}}`;
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
// src/localization/defaults/form.ts
|
|
396
|
+
var formTranslation = {
|
|
397
|
+
en: {
|
|
398
|
+
add: "Add",
|
|
399
|
+
all: "All",
|
|
400
|
+
apply: "Apply",
|
|
401
|
+
back: "Back",
|
|
402
|
+
cancel: "Cancel",
|
|
403
|
+
change: "Change",
|
|
404
|
+
clear: "Clear",
|
|
405
|
+
click: "Click",
|
|
406
|
+
clickToCopy: "Click to Copy",
|
|
407
|
+
close: "Close",
|
|
408
|
+
confirm: "Confirm",
|
|
409
|
+
copy: "Copy",
|
|
410
|
+
copied: "Copied",
|
|
411
|
+
create: "Create",
|
|
412
|
+
decline: "Decline",
|
|
413
|
+
delete: "Delete",
|
|
414
|
+
discard: "Discard",
|
|
415
|
+
discardChanges: "Discard Changes",
|
|
416
|
+
done: "Done",
|
|
417
|
+
edit: "Edit",
|
|
418
|
+
enterText: "Enter text here",
|
|
419
|
+
error: "Error",
|
|
420
|
+
exit: "Exit",
|
|
421
|
+
fieldRequiredError: "This field is required.",
|
|
422
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
423
|
+
less: "Less",
|
|
424
|
+
loading: "Loading",
|
|
425
|
+
maxLengthError: "Maximum length exceeded.",
|
|
426
|
+
minLengthError: "Minimum length not met.",
|
|
427
|
+
more: "More",
|
|
428
|
+
next: "Next",
|
|
429
|
+
no: "No",
|
|
430
|
+
none: "None",
|
|
431
|
+
of: "of",
|
|
432
|
+
optional: "Optional",
|
|
433
|
+
pleaseWait: "Please wait...",
|
|
434
|
+
previous: "Previous",
|
|
435
|
+
remove: "Remove",
|
|
436
|
+
required: "Required",
|
|
437
|
+
reset: "Reset",
|
|
438
|
+
save: "Save",
|
|
439
|
+
saved: "Saved",
|
|
440
|
+
search: "Search",
|
|
441
|
+
select: "Select",
|
|
442
|
+
selectOption: "Select an option",
|
|
443
|
+
show: "Show",
|
|
444
|
+
showMore: "Show more",
|
|
445
|
+
showLess: "Show less",
|
|
446
|
+
submit: "Submit",
|
|
447
|
+
success: "Success",
|
|
448
|
+
update: "Update",
|
|
449
|
+
unsavedChanges: "Unsaved Changes",
|
|
450
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
451
|
+
yes: "Yes"
|
|
452
|
+
},
|
|
453
|
+
de: {
|
|
454
|
+
add: "Hinzuf\xFCgen",
|
|
455
|
+
all: "Alle",
|
|
456
|
+
apply: "Anwenden",
|
|
457
|
+
back: "Zur\xFCck",
|
|
458
|
+
cancel: "Abbrechen",
|
|
459
|
+
change: "\xC4ndern",
|
|
460
|
+
clear: "L\xF6schen",
|
|
461
|
+
click: "Klicken",
|
|
462
|
+
clickToCopy: "Zum kopieren klicken",
|
|
463
|
+
close: "Schlie\xDFen",
|
|
464
|
+
confirm: "Best\xE4tigen",
|
|
465
|
+
copy: "Kopieren",
|
|
466
|
+
copied: "Kopiert",
|
|
467
|
+
create: "Erstellen",
|
|
468
|
+
decline: "Ablehnen",
|
|
469
|
+
delete: "L\xF6schen",
|
|
470
|
+
discard: "Verwerfen",
|
|
471
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
472
|
+
done: "Fertig",
|
|
473
|
+
edit: "Bearbeiten",
|
|
474
|
+
enterText: "Text hier eingeben",
|
|
475
|
+
error: "Fehler",
|
|
476
|
+
exit: "Beenden",
|
|
477
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
478
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
479
|
+
less: "Weniger",
|
|
480
|
+
loading: "L\xE4dt",
|
|
481
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
482
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
483
|
+
more: "Mehr",
|
|
484
|
+
next: "Weiter",
|
|
485
|
+
no: "Nein",
|
|
486
|
+
none: "Nichts",
|
|
487
|
+
of: "von",
|
|
488
|
+
optional: "Optional",
|
|
489
|
+
pleaseWait: "Bitte warten...",
|
|
490
|
+
previous: "Vorherige",
|
|
491
|
+
remove: "Entfernen",
|
|
492
|
+
required: "Erforderlich",
|
|
493
|
+
reset: "Zur\xFCcksetzen",
|
|
494
|
+
save: "Speichern",
|
|
495
|
+
saved: "Gespeichert",
|
|
496
|
+
search: "Suche",
|
|
497
|
+
select: "Select",
|
|
498
|
+
selectOption: "Option ausw\xE4hlen",
|
|
499
|
+
show: "Anzeigen",
|
|
500
|
+
showMore: "Mehr anzeigen",
|
|
501
|
+
showLess: "Weniger anzeigen",
|
|
502
|
+
submit: "Abschicken",
|
|
503
|
+
success: "Erfolg",
|
|
504
|
+
update: "Update",
|
|
505
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
506
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
507
|
+
yes: "Ja"
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
// src/components/user-action/Button.tsx
|
|
512
|
+
var import_react7 = require("react");
|
|
513
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
514
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
515
|
+
var ButtonColorUtil = {
|
|
516
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
517
|
+
text: ["primary", "negative", "neutral"],
|
|
518
|
+
outline: ["primary"]
|
|
519
|
+
};
|
|
520
|
+
var IconButtonUtil = {
|
|
521
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
522
|
+
};
|
|
523
|
+
var paddingMapping = {
|
|
524
|
+
small: "btn-sm",
|
|
525
|
+
medium: "btn-md",
|
|
526
|
+
large: "btn-lg"
|
|
527
|
+
};
|
|
528
|
+
var iconPaddingMapping = {
|
|
529
|
+
tiny: "icon-btn-xs",
|
|
530
|
+
small: "icon-btn-sm",
|
|
531
|
+
medium: "icon-btn-md",
|
|
532
|
+
large: "icon-btn-lg"
|
|
533
|
+
};
|
|
534
|
+
var ButtonUtil = {
|
|
535
|
+
paddingMapping,
|
|
536
|
+
iconPaddingMapping
|
|
537
|
+
};
|
|
538
|
+
var SolidButton = (0, import_react7.forwardRef)(function SolidButton2({
|
|
539
|
+
children,
|
|
540
|
+
disabled = false,
|
|
541
|
+
color = "primary",
|
|
542
|
+
size = "medium",
|
|
543
|
+
startIcon,
|
|
544
|
+
endIcon,
|
|
545
|
+
onClick,
|
|
546
|
+
className,
|
|
547
|
+
...restProps
|
|
548
|
+
}, ref) {
|
|
549
|
+
const colorClasses = {
|
|
550
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
551
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
552
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
553
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
554
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
555
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
556
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
557
|
+
}[color];
|
|
558
|
+
const iconColorClasses = {
|
|
559
|
+
primary: "text-button-solid-primary-icon",
|
|
560
|
+
secondary: "text-button-solid-secondary-icon",
|
|
561
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
562
|
+
positive: "text-button-solid-positive-icon",
|
|
563
|
+
warning: "text-button-solid-warning-icon",
|
|
564
|
+
negative: "text-button-solid-negative-icon",
|
|
565
|
+
neutral: "text-button-solid-neutral-icon"
|
|
566
|
+
}[color];
|
|
567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
568
|
+
"button",
|
|
569
|
+
{
|
|
570
|
+
ref,
|
|
571
|
+
onClick,
|
|
572
|
+
disabled,
|
|
573
|
+
className: (0, import_clsx3.default)(
|
|
574
|
+
{
|
|
575
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
576
|
+
[(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
577
|
+
},
|
|
578
|
+
ButtonUtil.paddingMapping[size],
|
|
579
|
+
className
|
|
580
|
+
),
|
|
581
|
+
...restProps,
|
|
582
|
+
children: [
|
|
583
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
584
|
+
"span",
|
|
585
|
+
{
|
|
586
|
+
className: (0, import_clsx3.default)({
|
|
587
|
+
[iconColorClasses]: !disabled,
|
|
588
|
+
[`text-disabled-icon`]: disabled
|
|
589
|
+
}),
|
|
590
|
+
children: startIcon
|
|
591
|
+
}
|
|
592
|
+
),
|
|
593
|
+
children,
|
|
594
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
595
|
+
"span",
|
|
596
|
+
{
|
|
597
|
+
className: (0, import_clsx3.default)({
|
|
598
|
+
[iconColorClasses]: !disabled,
|
|
599
|
+
[`text-disabled-icon`]: disabled
|
|
600
|
+
}),
|
|
601
|
+
children: endIcon
|
|
602
|
+
}
|
|
603
|
+
)
|
|
604
|
+
]
|
|
605
|
+
}
|
|
606
|
+
);
|
|
607
|
+
});
|
|
608
|
+
var IconButton = ({
|
|
609
|
+
children,
|
|
610
|
+
disabled = false,
|
|
611
|
+
color = "primary",
|
|
612
|
+
size = "medium",
|
|
613
|
+
className,
|
|
614
|
+
...restProps
|
|
615
|
+
}) => {
|
|
616
|
+
const colorClasses = {
|
|
617
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
618
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
619
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
620
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
621
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
622
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
623
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
624
|
+
transparent: "bg-transparent"
|
|
625
|
+
}[color];
|
|
626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
627
|
+
"button",
|
|
628
|
+
{
|
|
629
|
+
disabled,
|
|
630
|
+
className: (0, import_clsx3.default)(
|
|
631
|
+
{
|
|
632
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
633
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
634
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
635
|
+
[(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
636
|
+
},
|
|
637
|
+
ButtonUtil.iconPaddingMapping[size],
|
|
638
|
+
className
|
|
639
|
+
),
|
|
640
|
+
...restProps,
|
|
641
|
+
children
|
|
642
|
+
}
|
|
643
|
+
);
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
// src/components/user-action/SearchBar.tsx
|
|
647
|
+
var import_lucide_react = require("lucide-react");
|
|
648
|
+
var import_clsx4 = require("clsx");
|
|
649
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
650
|
+
var SearchBar = ({
|
|
651
|
+
placeholder,
|
|
652
|
+
onSearch,
|
|
653
|
+
disableOnSearch,
|
|
654
|
+
containerClassName,
|
|
655
|
+
...inputProps
|
|
656
|
+
}) => {
|
|
657
|
+
const translation = useTranslation([formTranslation]);
|
|
658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.clsx)("flex-row-2 justify-between items-center", containerClassName), children: [
|
|
659
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
660
|
+
Input,
|
|
661
|
+
{
|
|
662
|
+
...inputProps,
|
|
663
|
+
placeholder: placeholder ?? translation("search")
|
|
664
|
+
}
|
|
665
|
+
),
|
|
666
|
+
onSearch && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Search, { className: "w-full h-full" }) })
|
|
667
|
+
] });
|
|
668
|
+
};
|
|
669
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
670
|
+
0 && (module.exports = {
|
|
671
|
+
SearchBar
|
|
672
|
+
});
|
|
673
|
+
//# sourceMappingURL=SearchBar.js.map
|