@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
|
@@ -129,12 +129,21 @@ var import_clsx2 = __toESM(require("clsx"));
|
|
|
129
129
|
// src/components/user-action/Button.tsx
|
|
130
130
|
var import_clsx = __toESM(require("clsx"));
|
|
131
131
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
132
|
+
var ButtonColorUtil = {
|
|
133
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
134
|
+
text: ["primary", "negative", "neutral"],
|
|
135
|
+
outline: ["primary"]
|
|
136
|
+
};
|
|
137
|
+
var IconButtonUtil = {
|
|
138
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
139
|
+
};
|
|
132
140
|
var paddingMapping = {
|
|
133
141
|
small: "btn-sm",
|
|
134
142
|
medium: "btn-md",
|
|
135
143
|
large: "btn-lg"
|
|
136
144
|
};
|
|
137
145
|
var iconPaddingMapping = {
|
|
146
|
+
tiny: "icon-btn-xs",
|
|
138
147
|
small: "icon-btn-sm",
|
|
139
148
|
medium: "icon-btn-md",
|
|
140
149
|
large: "icon-btn-lg"
|
|
@@ -172,7 +181,7 @@ var TextButton = ({
|
|
|
172
181
|
className: (0, import_clsx.default)(
|
|
173
182
|
{
|
|
174
183
|
"text-disabled-text cursor-not-allowed": disabled,
|
|
175
|
-
[(0, import_clsx.default)(colorClasses, "hover:bg-button-text-hover-background
|
|
184
|
+
[(0, import_clsx.default)(colorClasses, "hover:bg-button-text-hover-background")]: !disabled
|
|
176
185
|
},
|
|
177
186
|
ButtonUtil.paddingMapping[size],
|
|
178
187
|
className
|
|
@@ -220,7 +229,8 @@ var IconButton = ({
|
|
|
220
229
|
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
221
230
|
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
222
231
|
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
223
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
232
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
233
|
+
transparent: "bg-transparent"
|
|
224
234
|
}[color];
|
|
225
235
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
226
236
|
"button",
|
|
@@ -229,7 +239,9 @@ var IconButton = ({
|
|
|
229
239
|
disabled: disabled || onClick === void 0,
|
|
230
240
|
className: (0, import_clsx.default)(
|
|
231
241
|
{
|
|
232
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
242
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
243
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
244
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
233
245
|
[(0, import_clsx.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
234
246
|
},
|
|
235
247
|
ButtonUtil.iconPaddingMapping[size],
|
|
@@ -245,6 +257,7 @@ var IconButton = ({
|
|
|
245
257
|
var formTranslation = {
|
|
246
258
|
en: {
|
|
247
259
|
all: "All",
|
|
260
|
+
apply: "Apply",
|
|
248
261
|
back: "Back",
|
|
249
262
|
cancel: "Cancel",
|
|
250
263
|
change: "Change",
|
|
@@ -293,6 +306,7 @@ var formTranslation = {
|
|
|
293
306
|
},
|
|
294
307
|
de: {
|
|
295
308
|
all: "Alle",
|
|
309
|
+
apply: "Anwenden",
|
|
296
310
|
back: "Zur\xFCck",
|
|
297
311
|
cancel: "Abbrechen",
|
|
298
312
|
change: "\xC4ndern",
|
|
@@ -398,7 +412,7 @@ var PropertyBase = ({
|
|
|
398
412
|
|
|
399
413
|
// src/components/user-action/Select.tsx
|
|
400
414
|
var import_lucide_react4 = require("lucide-react");
|
|
401
|
-
var
|
|
415
|
+
var import_react9 = require("react");
|
|
402
416
|
var import_clsx7 = __toESM(require("clsx"));
|
|
403
417
|
|
|
404
418
|
// src/components/user-action/Label.tsx
|
|
@@ -424,55 +438,147 @@ var import_lucide_react2 = require("lucide-react");
|
|
|
424
438
|
var import_clsx5 = __toESM(require("clsx"));
|
|
425
439
|
|
|
426
440
|
// src/components/user-action/Input.tsx
|
|
427
|
-
var
|
|
441
|
+
var import_react6 = require("react");
|
|
428
442
|
var import_clsx4 = __toESM(require("clsx"));
|
|
429
443
|
|
|
430
|
-
// src/hooks/
|
|
444
|
+
// src/hooks/useDelay.ts
|
|
431
445
|
var import_react3 = require("react");
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
setNotificationTimer(setTimeout(() => {
|
|
442
|
-
setNotificationStatus(false);
|
|
443
|
-
clearTimeout(notificationTimer);
|
|
444
|
-
}, delay));
|
|
445
|
-
clearTimeout(updateTimer);
|
|
446
|
-
}, delay));
|
|
446
|
+
var defaultOptions = {
|
|
447
|
+
delay: 3e3,
|
|
448
|
+
disabled: false
|
|
449
|
+
};
|
|
450
|
+
function useDelay(options) {
|
|
451
|
+
const [timer, setTimer] = (0, import_react3.useState)(void 0);
|
|
452
|
+
const { delay, disabled } = {
|
|
453
|
+
...defaultOptions,
|
|
454
|
+
...options
|
|
447
455
|
};
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
setNotificationStatus(true);
|
|
452
|
-
clearTimeout(notificationTimer);
|
|
453
|
-
setNotificationTimer(setTimeout(() => {
|
|
454
|
-
setNotificationStatus(false);
|
|
455
|
-
clearTimeout(notificationTimer);
|
|
456
|
-
}, delay));
|
|
457
|
-
} else {
|
|
458
|
-
setNotificationStatus(false);
|
|
456
|
+
const restartTimer = (onDelayFinish) => {
|
|
457
|
+
if (disabled) {
|
|
458
|
+
return;
|
|
459
459
|
}
|
|
460
|
+
clearTimeout(timer);
|
|
461
|
+
setTimer(setTimeout(() => {
|
|
462
|
+
onDelayFinish();
|
|
463
|
+
}, delay));
|
|
464
|
+
};
|
|
465
|
+
const clearTimer = () => {
|
|
466
|
+
clearTimeout(timer);
|
|
460
467
|
};
|
|
461
468
|
(0, import_react3.useEffect)(() => {
|
|
462
469
|
return () => {
|
|
463
|
-
clearTimeout(
|
|
464
|
-
clearTimeout(notificationTimer);
|
|
470
|
+
clearTimeout(timer);
|
|
465
471
|
};
|
|
466
|
-
}, []);
|
|
467
|
-
|
|
472
|
+
}, [timer]);
|
|
473
|
+
(0, import_react3.useEffect)(() => {
|
|
474
|
+
if (disabled) {
|
|
475
|
+
clearTimeout(timer);
|
|
476
|
+
}
|
|
477
|
+
}, [disabled, timer]);
|
|
478
|
+
return { restartTimer, clearTimer };
|
|
468
479
|
}
|
|
469
480
|
|
|
470
481
|
// src/util/noop.ts
|
|
471
482
|
var noop = () => void 0;
|
|
472
483
|
|
|
484
|
+
// src/hooks/useFocusManagement.ts
|
|
485
|
+
var import_react4 = require("react");
|
|
486
|
+
function useFocusManagement() {
|
|
487
|
+
const getFocusableElements = (0, import_react4.useCallback)(() => {
|
|
488
|
+
return Array.from(
|
|
489
|
+
document.querySelectorAll(
|
|
490
|
+
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
491
|
+
)
|
|
492
|
+
).filter(
|
|
493
|
+
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
494
|
+
);
|
|
495
|
+
}, []);
|
|
496
|
+
const getNextFocusElement = (0, import_react4.useCallback)(() => {
|
|
497
|
+
const elements = getFocusableElements();
|
|
498
|
+
if (elements.length === 0) {
|
|
499
|
+
return void 0;
|
|
500
|
+
}
|
|
501
|
+
let nextElement = elements[0];
|
|
502
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
503
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
504
|
+
nextElement = elements[(currentIndex + 1) % elements.length];
|
|
505
|
+
}
|
|
506
|
+
return nextElement;
|
|
507
|
+
}, [getFocusableElements]);
|
|
508
|
+
const focusNext = (0, import_react4.useCallback)(() => {
|
|
509
|
+
const nextElement = getNextFocusElement();
|
|
510
|
+
nextElement?.focus();
|
|
511
|
+
}, [getNextFocusElement]);
|
|
512
|
+
const getPreviousFocusElement = (0, import_react4.useCallback)(() => {
|
|
513
|
+
const elements = getFocusableElements();
|
|
514
|
+
if (elements.length === 0) {
|
|
515
|
+
return void 0;
|
|
516
|
+
}
|
|
517
|
+
let previousElement = elements[0];
|
|
518
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
519
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
520
|
+
if (currentIndex === 0) {
|
|
521
|
+
previousElement = elements[elements.length - 1];
|
|
522
|
+
} else {
|
|
523
|
+
previousElement = elements[currentIndex - 1];
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
return previousElement;
|
|
527
|
+
}, [getFocusableElements]);
|
|
528
|
+
const focusPrevious = (0, import_react4.useCallback)(() => {
|
|
529
|
+
const previousElement = getPreviousFocusElement();
|
|
530
|
+
if (previousElement) previousElement.focus();
|
|
531
|
+
}, [getPreviousFocusElement]);
|
|
532
|
+
return {
|
|
533
|
+
getFocusableElements,
|
|
534
|
+
getNextFocusElement,
|
|
535
|
+
getPreviousFocusElement,
|
|
536
|
+
focusNext,
|
|
537
|
+
focusPrevious
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// src/hooks/useFocusOnceVisible.ts
|
|
542
|
+
var import_react5 = __toESM(require("react"));
|
|
543
|
+
var useFocusOnceVisible = (ref, disable = false) => {
|
|
544
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react5.default.useState(false);
|
|
545
|
+
(0, import_react5.useEffect)(() => {
|
|
546
|
+
if (disable || hasUsedFocus) {
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
550
|
+
if (entry.isIntersecting && !hasUsedFocus) {
|
|
551
|
+
ref.current?.focus();
|
|
552
|
+
setHasUsedFocus(hasUsedFocus);
|
|
553
|
+
}
|
|
554
|
+
}, {
|
|
555
|
+
threshold: 0.1
|
|
556
|
+
});
|
|
557
|
+
if (ref.current) {
|
|
558
|
+
observer.observe(ref.current);
|
|
559
|
+
}
|
|
560
|
+
return () => observer.disconnect();
|
|
561
|
+
}, [disable, hasUsedFocus, ref]);
|
|
562
|
+
};
|
|
563
|
+
|
|
473
564
|
// src/components/user-action/Input.tsx
|
|
474
565
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
475
|
-
var
|
|
566
|
+
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
567
|
+
return (0, import_clsx4.default)(
|
|
568
|
+
"px-2 py-1.5 rounded-md border-2",
|
|
569
|
+
{
|
|
570
|
+
"bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
571
|
+
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
572
|
+
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
573
|
+
}
|
|
574
|
+
);
|
|
575
|
+
};
|
|
576
|
+
var defaultEditCompleteOptions = {
|
|
577
|
+
onBlur: true,
|
|
578
|
+
afterDelay: true,
|
|
579
|
+
delay: 2500
|
|
580
|
+
};
|
|
581
|
+
var Input = (0, import_react6.forwardRef)(function Input2({
|
|
476
582
|
id,
|
|
477
583
|
type = "text",
|
|
478
584
|
value,
|
|
@@ -481,58 +587,73 @@ var Input = ({
|
|
|
481
587
|
onChangeText = noop,
|
|
482
588
|
onEditCompleted,
|
|
483
589
|
className = "",
|
|
590
|
+
allowEnterComplete = true,
|
|
484
591
|
expanded = true,
|
|
485
|
-
autoFocus,
|
|
592
|
+
autoFocus = false,
|
|
486
593
|
onBlur,
|
|
594
|
+
editCompleteOptions,
|
|
487
595
|
containerClassName,
|
|
596
|
+
disabled,
|
|
488
597
|
...restProps
|
|
489
|
-
})
|
|
598
|
+
}, forwardedRef) {
|
|
599
|
+
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
490
600
|
const {
|
|
491
601
|
restartTimer,
|
|
492
|
-
|
|
493
|
-
} =
|
|
494
|
-
const
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
602
|
+
clearTimer
|
|
603
|
+
} = useDelay({ delay, disabled: !afterDelay });
|
|
604
|
+
const innerRef = (0, import_react6.useRef)(null);
|
|
605
|
+
const { focusNext } = useFocusManagement();
|
|
606
|
+
useFocusOnceVisible(innerRef, !autoFocus);
|
|
607
|
+
(0, import_react6.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
608
|
+
const handleKeyDown = (e) => {
|
|
609
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
610
|
+
e.preventDefault();
|
|
611
|
+
innerRef.current?.blur();
|
|
612
|
+
focusNext();
|
|
498
613
|
}
|
|
499
|
-
}
|
|
614
|
+
};
|
|
500
615
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)({ "w-full": expanded }, containerClassName), children: [
|
|
501
616
|
label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx4.default)("mb-1", label.className) }),
|
|
502
617
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
503
618
|
"input",
|
|
504
619
|
{
|
|
505
|
-
|
|
620
|
+
...restProps,
|
|
621
|
+
ref: innerRef,
|
|
506
622
|
value,
|
|
507
623
|
id,
|
|
508
624
|
type,
|
|
509
|
-
|
|
625
|
+
disabled,
|
|
626
|
+
className: (0, import_clsx4.default)(getInputClassName({ disabled }), className),
|
|
627
|
+
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
510
628
|
onBlur: (event) => {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
}
|
|
514
|
-
if (onEditCompleted) {
|
|
629
|
+
onBlur?.(event);
|
|
630
|
+
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
515
631
|
onEditCompleted(event.target.value);
|
|
516
|
-
|
|
632
|
+
clearTimer();
|
|
517
633
|
}
|
|
518
634
|
},
|
|
519
635
|
onChange: (e) => {
|
|
520
636
|
const value2 = e.target.value;
|
|
521
637
|
if (onEditCompleted) {
|
|
522
638
|
restartTimer(() => {
|
|
523
|
-
|
|
524
|
-
|
|
639
|
+
if (innerRef.current) {
|
|
640
|
+
innerRef.current.blur();
|
|
641
|
+
if (!allowEditCompleteOnBlur) {
|
|
642
|
+
onEditCompleted(value2);
|
|
643
|
+
}
|
|
644
|
+
} else {
|
|
645
|
+
onEditCompleted(value2);
|
|
646
|
+
}
|
|
525
647
|
});
|
|
526
648
|
}
|
|
527
649
|
onChange(e);
|
|
528
650
|
onChangeText(value2);
|
|
529
|
-
}
|
|
530
|
-
...restProps
|
|
651
|
+
}
|
|
531
652
|
}
|
|
532
653
|
)
|
|
533
654
|
] });
|
|
534
|
-
};
|
|
535
|
-
var FormInput = (0,
|
|
655
|
+
});
|
|
656
|
+
var FormInput = (0, import_react6.forwardRef)(function FormInput2({
|
|
536
657
|
id,
|
|
537
658
|
labelText,
|
|
538
659
|
errorText,
|
|
@@ -541,19 +662,18 @@ var FormInput = (0, import_react4.forwardRef)(function FormInput2({
|
|
|
541
662
|
errorClassName,
|
|
542
663
|
containerClassName,
|
|
543
664
|
required,
|
|
665
|
+
disabled,
|
|
544
666
|
...restProps
|
|
545
667
|
}, ref) {
|
|
546
668
|
const input = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
547
669
|
"input",
|
|
548
670
|
{
|
|
671
|
+
...restProps,
|
|
549
672
|
ref,
|
|
550
673
|
id,
|
|
551
|
-
|
|
674
|
+
disabled,
|
|
552
675
|
className: (0, import_clsx4.default)(
|
|
553
|
-
{
|
|
554
|
-
"focus:border-primary focus:ring-primary": !errorText,
|
|
555
|
-
"focus:border-negative focus:ring-negative text-negative": !!errorText
|
|
556
|
-
},
|
|
676
|
+
getInputClassName({ disabled, hasError: !!errorText }),
|
|
557
677
|
className
|
|
558
678
|
)
|
|
559
679
|
}
|
|
@@ -569,7 +689,7 @@ var FormInput = (0, import_react4.forwardRef)(function FormInput2({
|
|
|
569
689
|
});
|
|
570
690
|
|
|
571
691
|
// src/hooks/useSearch.ts
|
|
572
|
-
var
|
|
692
|
+
var import_react7 = require("react");
|
|
573
693
|
|
|
574
694
|
// src/util/simpleSearch.ts
|
|
575
695
|
var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -588,12 +708,12 @@ var useSearch = ({
|
|
|
588
708
|
initialSearch,
|
|
589
709
|
searchMapping
|
|
590
710
|
}) => {
|
|
591
|
-
const [items, setItems] = (0,
|
|
592
|
-
const [search, setSearch] = (0,
|
|
593
|
-
(0,
|
|
711
|
+
const [items, setItems] = (0, import_react7.useState)(list);
|
|
712
|
+
const [search, setSearch] = (0, import_react7.useState)(initialSearch);
|
|
713
|
+
(0, import_react7.useEffect)(() => {
|
|
594
714
|
setItems(list);
|
|
595
715
|
}, [list]);
|
|
596
|
-
const result = (0,
|
|
716
|
+
const result = (0, import_react7.useMemo)(
|
|
597
717
|
() => MultiSearchWithMapping(search, items, searchMapping),
|
|
598
718
|
[search, items, searchMapping]
|
|
599
719
|
);
|
|
@@ -691,9 +811,9 @@ var Tile = ({
|
|
|
691
811
|
};
|
|
692
812
|
|
|
693
813
|
// src/hooks/useOutsideClick.ts
|
|
694
|
-
var
|
|
814
|
+
var import_react8 = require("react");
|
|
695
815
|
var useOutsideClick = (refs, handler) => {
|
|
696
|
-
(0,
|
|
816
|
+
(0, import_react8.useEffect)(() => {
|
|
697
817
|
const listener = (event) => {
|
|
698
818
|
if (event.target === null) return;
|
|
699
819
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -723,9 +843,9 @@ var Select = ({
|
|
|
723
843
|
className,
|
|
724
844
|
selectedDisplayOverwrite
|
|
725
845
|
}) => {
|
|
726
|
-
const triggerRef = (0,
|
|
727
|
-
const menuRef = (0,
|
|
728
|
-
const [isOpen, setIsOpen] = (0,
|
|
846
|
+
const triggerRef = (0, import_react9.useRef)(null);
|
|
847
|
+
const menuRef = (0, import_react9.useRef)(null);
|
|
848
|
+
const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
|
|
729
849
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
730
850
|
const selectedOption = options.find((option) => option.value === value);
|
|
731
851
|
if (value !== void 0 && selectedOption === void 0 && selectedDisplayOverwrite === void 0) {
|