@helpwave/hightide 0.1.18 → 0.1.20
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 +67 -39
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +56 -28
- 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 +48 -20
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +46 -18
- 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 +10 -1
- package/dist/components/layout-and-navigation/Expandable.d.ts +10 -1
- package/dist/components/layout-and-navigation/Expandable.js +38 -10
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +38 -11
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +36 -12
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs +38 -14
- 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.d.mts +5 -10
- package/dist/components/loading-states/LoadingAndErrorComponent.d.ts +5 -10
- package/dist/components/loading-states/LoadingAndErrorComponent.js +14 -327
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +15 -318
- 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/loading-states/LoadingContainer.d.mts +8 -0
- package/dist/components/loading-states/LoadingContainer.d.ts +8 -0
- package/dist/components/loading-states/LoadingContainer.js +34 -0
- package/dist/components/loading-states/LoadingContainer.js.map +1 -0
- package/dist/components/loading-states/LoadingContainer.mjs +10 -0
- package/dist/components/loading-states/LoadingContainer.mjs.map +1 -0
- 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 +729 -434
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +729 -430
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +733 -438
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +732 -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 +916 -463
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +921 -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 +683 -243
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +687 -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 +81 -49
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +67 -35
- 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 +797 -375
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +782 -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 +765 -355
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +762 -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 +284 -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 +96 -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 +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +1197 -902
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1048 -754
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/components/user-action/MultiSelect.tsx
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useCallback as useCallback6 } from "react";
|
|
3
|
+
import { useEffect as useEffect12, useState as useState11 } from "react";
|
|
4
4
|
|
|
5
5
|
// src/localization/LanguageProvider.tsx
|
|
6
6
|
import { createContext, useContext, useEffect as useEffect2, useState as useState2 } from "react";
|
|
@@ -90,7 +90,7 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
// src/components/user-action/MultiSelect.tsx
|
|
93
|
-
import
|
|
93
|
+
import clsx11 from "clsx";
|
|
94
94
|
|
|
95
95
|
// src/components/user-action/Label.tsx
|
|
96
96
|
import clsx from "clsx";
|
|
@@ -110,22 +110,394 @@ var Label = ({
|
|
|
110
110
|
return /* @__PURE__ */ jsx2("label", { ...props, className: clsx(styleMapping[labelType], className), children: children ? children : name });
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
// src/components/
|
|
114
|
-
import {
|
|
113
|
+
// src/components/user-action/Select.tsx
|
|
114
|
+
import { useCallback as useCallback5 } from "react";
|
|
115
|
+
import { useEffect as useEffect11, useState as useState9 } from "react";
|
|
116
|
+
import clsx8 from "clsx";
|
|
117
|
+
|
|
118
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
119
|
+
import clsx2 from "clsx";
|
|
120
|
+
import { Check } from "lucide-react";
|
|
121
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
122
|
+
var Tile = ({
|
|
123
|
+
title,
|
|
124
|
+
description,
|
|
125
|
+
onClick,
|
|
126
|
+
isSelected = false,
|
|
127
|
+
disabled = false,
|
|
128
|
+
prefix,
|
|
129
|
+
suffix,
|
|
130
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
131
|
+
selectedClassName = " bg-primary/20",
|
|
132
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
133
|
+
className
|
|
134
|
+
}) => {
|
|
135
|
+
return /* @__PURE__ */ jsxs(
|
|
136
|
+
"div",
|
|
137
|
+
{
|
|
138
|
+
className: clsx2(
|
|
139
|
+
"flex-row-2 w-full items-center",
|
|
140
|
+
{
|
|
141
|
+
[normalClassName]: !!onClick && !disabled,
|
|
142
|
+
[selectedClassName]: isSelected && !disabled,
|
|
143
|
+
[disabledClassName]: disabled
|
|
144
|
+
},
|
|
145
|
+
className
|
|
146
|
+
),
|
|
147
|
+
onClick: disabled ? void 0 : onClick,
|
|
148
|
+
children: [
|
|
149
|
+
prefix,
|
|
150
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-col-0 w-full", children: [
|
|
151
|
+
/* @__PURE__ */ jsx3("h4", { className: clsx2(title.className ?? "textstyle-title-normal"), children: title.value }),
|
|
152
|
+
!!description && /* @__PURE__ */ jsx3("span", { className: clsx2(description.className ?? "textstyle-description"), children: description.value })
|
|
153
|
+
] }),
|
|
154
|
+
suffix ?? (isSelected ? /* @__PURE__ */ jsx3(Check, { size: 24 }) : void 0)
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
161
|
+
import { forwardRef, useCallback as useCallback2, useEffect as useEffect3, useState as useState3 } from "react";
|
|
162
|
+
import { ChevronDown } from "lucide-react";
|
|
163
|
+
import clsx3 from "clsx";
|
|
164
|
+
|
|
165
|
+
// src/util/noop.ts
|
|
166
|
+
var noop = () => void 0;
|
|
167
|
+
|
|
168
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
169
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
170
|
+
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
171
|
+
return /* @__PURE__ */ jsx4(
|
|
172
|
+
ChevronDown,
|
|
173
|
+
{
|
|
174
|
+
className: clsx3(
|
|
175
|
+
"min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
|
|
176
|
+
{ "rotate-180": isExpanded },
|
|
177
|
+
className
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
};
|
|
182
|
+
var Expandable = forwardRef(function Expandable2({
|
|
183
|
+
children,
|
|
184
|
+
label,
|
|
185
|
+
icon,
|
|
186
|
+
isExpanded = false,
|
|
187
|
+
onChange = noop,
|
|
188
|
+
clickOnlyOnHeader = true,
|
|
189
|
+
disabled = false,
|
|
190
|
+
className,
|
|
191
|
+
headerClassName,
|
|
192
|
+
contentClassName,
|
|
193
|
+
contentExpandedClassName
|
|
194
|
+
}, ref) {
|
|
195
|
+
const defaultIcon = useCallback2((expanded) => /* @__PURE__ */ jsx4(ExpansionIcon, { isExpanded: expanded }), []);
|
|
196
|
+
icon ??= defaultIcon;
|
|
197
|
+
return /* @__PURE__ */ jsxs2(
|
|
198
|
+
"div",
|
|
199
|
+
{
|
|
200
|
+
ref,
|
|
201
|
+
className: clsx3("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
|
|
202
|
+
onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ jsxs2(
|
|
205
|
+
"div",
|
|
206
|
+
{
|
|
207
|
+
className: clsx3(
|
|
208
|
+
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
|
|
209
|
+
{
|
|
210
|
+
"group-hover:brightness-97": !isExpanded,
|
|
211
|
+
"hover:brightness-97": isExpanded && !disabled,
|
|
212
|
+
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
213
|
+
},
|
|
214
|
+
headerClassName
|
|
215
|
+
),
|
|
216
|
+
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
217
|
+
children: [
|
|
218
|
+
label,
|
|
219
|
+
icon(isExpanded)
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
),
|
|
223
|
+
/* @__PURE__ */ jsx4(
|
|
224
|
+
"div",
|
|
225
|
+
{
|
|
226
|
+
className: clsx3(
|
|
227
|
+
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
228
|
+
{
|
|
229
|
+
[clsx3("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
|
|
230
|
+
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
231
|
+
},
|
|
232
|
+
contentClassName
|
|
233
|
+
),
|
|
234
|
+
children
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
});
|
|
241
|
+
var ExpandableUncontrolled = forwardRef(function ExpandableUncontrolled2({
|
|
242
|
+
isExpanded,
|
|
243
|
+
onChange = noop,
|
|
244
|
+
...props
|
|
245
|
+
}, ref) {
|
|
246
|
+
const [usedIsExpanded, setUsedIsExpanded] = useState3(isExpanded);
|
|
247
|
+
useEffect3(() => {
|
|
248
|
+
setUsedIsExpanded(isExpanded);
|
|
249
|
+
}, [isExpanded]);
|
|
250
|
+
return /* @__PURE__ */ jsx4(
|
|
251
|
+
Expandable,
|
|
252
|
+
{
|
|
253
|
+
...props,
|
|
254
|
+
ref,
|
|
255
|
+
isExpanded: usedIsExpanded,
|
|
256
|
+
onChange: (value) => {
|
|
257
|
+
onChange(value);
|
|
258
|
+
setUsedIsExpanded(value);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
// src/components/user-action/Menu.tsx
|
|
265
|
+
import {
|
|
266
|
+
useEffect as useEffect6,
|
|
267
|
+
useRef,
|
|
268
|
+
useState as useState5
|
|
269
|
+
} from "react";
|
|
115
270
|
import clsx4 from "clsx";
|
|
116
271
|
|
|
272
|
+
// src/hooks/useOutsideClick.ts
|
|
273
|
+
import { useEffect as useEffect4 } from "react";
|
|
274
|
+
var useOutsideClick = (refs, handler) => {
|
|
275
|
+
useEffect4(() => {
|
|
276
|
+
const listener = (event) => {
|
|
277
|
+
if (event.target === null) return;
|
|
278
|
+
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
handler();
|
|
282
|
+
};
|
|
283
|
+
document.addEventListener("mousedown", listener);
|
|
284
|
+
document.addEventListener("touchstart", listener);
|
|
285
|
+
return () => {
|
|
286
|
+
document.removeEventListener("mousedown", listener);
|
|
287
|
+
document.removeEventListener("touchstart", listener);
|
|
288
|
+
};
|
|
289
|
+
}, [refs, handler]);
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
// src/hooks/useHoverState.ts
|
|
293
|
+
import { useEffect as useEffect5, useState as useState4 } from "react";
|
|
294
|
+
var defaultUseHoverStateProps = {
|
|
295
|
+
closingDelay: 200,
|
|
296
|
+
isDisabled: false
|
|
297
|
+
};
|
|
298
|
+
var useHoverState = (props = void 0) => {
|
|
299
|
+
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
300
|
+
const [isHovered, setIsHovered] = useState4(false);
|
|
301
|
+
const [timer, setTimer] = useState4();
|
|
302
|
+
const onMouseEnter = () => {
|
|
303
|
+
if (isDisabled) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
clearTimeout(timer);
|
|
307
|
+
setIsHovered(true);
|
|
308
|
+
};
|
|
309
|
+
const onMouseLeave = () => {
|
|
310
|
+
if (isDisabled) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
setTimer(setTimeout(() => {
|
|
314
|
+
setIsHovered(false);
|
|
315
|
+
}, closingDelay));
|
|
316
|
+
};
|
|
317
|
+
useEffect5(() => {
|
|
318
|
+
if (timer) {
|
|
319
|
+
return () => {
|
|
320
|
+
clearTimeout(timer);
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
useEffect5(() => {
|
|
325
|
+
if (timer) {
|
|
326
|
+
clearTimeout(timer);
|
|
327
|
+
}
|
|
328
|
+
}, [isDisabled]);
|
|
329
|
+
return {
|
|
330
|
+
isHovered,
|
|
331
|
+
setIsHovered,
|
|
332
|
+
handlers: { onMouseEnter, onMouseLeave }
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
// src/util/PropsWithFunctionChildren.ts
|
|
337
|
+
var resolve = (children, bag) => {
|
|
338
|
+
if (typeof children === "function") {
|
|
339
|
+
return children(bag);
|
|
340
|
+
}
|
|
341
|
+
return children ?? void 0;
|
|
342
|
+
};
|
|
343
|
+
var BagFunctionUtil = {
|
|
344
|
+
resolve
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
// src/hooks/usePopoverPosition.ts
|
|
348
|
+
var defaultPopoverPositionOptions = {
|
|
349
|
+
edgePadding: 16,
|
|
350
|
+
outerGap: 4,
|
|
351
|
+
horizontalAlignment: "leftInside",
|
|
352
|
+
verticalAlignment: "bottomOutside",
|
|
353
|
+
disabled: false
|
|
354
|
+
};
|
|
355
|
+
var usePopoverPosition = (trigger, options) => {
|
|
356
|
+
const {
|
|
357
|
+
edgePadding,
|
|
358
|
+
outerGap,
|
|
359
|
+
verticalAlignment,
|
|
360
|
+
horizontalAlignment,
|
|
361
|
+
disabled
|
|
362
|
+
} = { ...defaultPopoverPositionOptions, ...options };
|
|
363
|
+
if (disabled || !trigger) {
|
|
364
|
+
return {};
|
|
365
|
+
}
|
|
366
|
+
const left = {
|
|
367
|
+
leftOutside: trigger.left - outerGap,
|
|
368
|
+
leftInside: trigger.left,
|
|
369
|
+
rightOutside: trigger.right + outerGap,
|
|
370
|
+
rightInside: trigger.right,
|
|
371
|
+
center: trigger.left + trigger.width / 2
|
|
372
|
+
}[horizontalAlignment];
|
|
373
|
+
const top = {
|
|
374
|
+
topOutside: trigger.top - outerGap,
|
|
375
|
+
topInside: trigger.top,
|
|
376
|
+
bottomOutside: trigger.bottom + outerGap,
|
|
377
|
+
bottomInside: trigger.bottom,
|
|
378
|
+
center: trigger.top + trigger.height / 2
|
|
379
|
+
}[verticalAlignment];
|
|
380
|
+
const translateX = {
|
|
381
|
+
leftOutside: "-100%",
|
|
382
|
+
leftInside: void 0,
|
|
383
|
+
rightOutside: void 0,
|
|
384
|
+
rightInside: "-100%",
|
|
385
|
+
center: "-50%"
|
|
386
|
+
}[horizontalAlignment];
|
|
387
|
+
const translateY = {
|
|
388
|
+
topOutside: "-100%",
|
|
389
|
+
topInside: void 0,
|
|
390
|
+
bottomOutside: void 0,
|
|
391
|
+
bottomInside: "-100%",
|
|
392
|
+
center: "-50%"
|
|
393
|
+
}[verticalAlignment];
|
|
394
|
+
return {
|
|
395
|
+
left: Math.max(left, edgePadding),
|
|
396
|
+
top: Math.max(top, edgePadding),
|
|
397
|
+
translate: [translateX ?? "0", translateY ?? "0"].join(" ")
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
// src/components/user-action/Menu.tsx
|
|
402
|
+
import { createPortal } from "react-dom";
|
|
403
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
404
|
+
function getScrollableParents(element) {
|
|
405
|
+
const scrollables = [];
|
|
406
|
+
let parent = element.parentElement;
|
|
407
|
+
while (parent) {
|
|
408
|
+
scrollables.push(parent);
|
|
409
|
+
parent = parent.parentElement;
|
|
410
|
+
}
|
|
411
|
+
return scrollables;
|
|
412
|
+
}
|
|
413
|
+
var Menu = ({
|
|
414
|
+
trigger,
|
|
415
|
+
children,
|
|
416
|
+
alignmentHorizontal = "leftInside",
|
|
417
|
+
alignmentVertical = "bottomOutside",
|
|
418
|
+
showOnHover = false,
|
|
419
|
+
disabled = false,
|
|
420
|
+
menuClassName = ""
|
|
421
|
+
}) => {
|
|
422
|
+
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
423
|
+
const triggerRef = useRef(null);
|
|
424
|
+
const menuRef = useRef(null);
|
|
425
|
+
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
426
|
+
const [isHidden, setIsHidden] = useState5(true);
|
|
427
|
+
const bag = {
|
|
428
|
+
isOpen,
|
|
429
|
+
close: () => setIsOpen(false),
|
|
430
|
+
toggleOpen: () => setIsOpen((prevState) => !prevState),
|
|
431
|
+
disabled
|
|
432
|
+
};
|
|
433
|
+
const menuPosition = usePopoverPosition(
|
|
434
|
+
triggerRef.current?.getBoundingClientRect(),
|
|
435
|
+
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
436
|
+
);
|
|
437
|
+
useEffect6(() => {
|
|
438
|
+
if (!isOpen) return;
|
|
439
|
+
const triggerEl = triggerRef.current;
|
|
440
|
+
if (!triggerEl) return;
|
|
441
|
+
const scrollableParents = getScrollableParents(triggerEl);
|
|
442
|
+
const close = () => setIsOpen(false);
|
|
443
|
+
scrollableParents.forEach((parent) => {
|
|
444
|
+
parent.addEventListener("scroll", close);
|
|
445
|
+
});
|
|
446
|
+
window.addEventListener("resize", close);
|
|
447
|
+
return () => {
|
|
448
|
+
scrollableParents.forEach((parent) => {
|
|
449
|
+
parent.removeEventListener("scroll", close);
|
|
450
|
+
});
|
|
451
|
+
window.removeEventListener("resize", close);
|
|
452
|
+
};
|
|
453
|
+
}, [isOpen, setIsOpen]);
|
|
454
|
+
useEffect6(() => {
|
|
455
|
+
if (isOpen) {
|
|
456
|
+
setIsHidden(false);
|
|
457
|
+
}
|
|
458
|
+
}, [isOpen]);
|
|
459
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
460
|
+
trigger(bag, triggerRef),
|
|
461
|
+
createPortal(/* @__PURE__ */ jsx5(
|
|
462
|
+
"div",
|
|
463
|
+
{
|
|
464
|
+
ref: menuRef,
|
|
465
|
+
onClick: (e) => e.stopPropagation(),
|
|
466
|
+
className: clsx4(
|
|
467
|
+
"absolute rounded-md bg-menu-background text-menu-text shadow-around-lg z-10",
|
|
468
|
+
{
|
|
469
|
+
"animate-pop-in": isOpen,
|
|
470
|
+
"animate-pop-out": !isOpen,
|
|
471
|
+
"hidden": isHidden
|
|
472
|
+
},
|
|
473
|
+
menuClassName
|
|
474
|
+
),
|
|
475
|
+
onAnimationEnd: () => {
|
|
476
|
+
if (!isOpen) {
|
|
477
|
+
setIsHidden(true);
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
style: {
|
|
481
|
+
...menuPosition
|
|
482
|
+
},
|
|
483
|
+
children: BagFunctionUtil.resolve(children, bag)
|
|
484
|
+
}
|
|
485
|
+
), document.body)
|
|
486
|
+
] });
|
|
487
|
+
};
|
|
488
|
+
|
|
117
489
|
// src/components/user-action/Input.tsx
|
|
118
|
-
import { forwardRef, useEffect as
|
|
119
|
-
import
|
|
490
|
+
import { forwardRef as forwardRef2, useEffect as useEffect9, useImperativeHandle, useRef as useRef2, useState as useState7 } from "react";
|
|
491
|
+
import clsx5 from "clsx";
|
|
120
492
|
|
|
121
493
|
// src/hooks/useDelay.ts
|
|
122
|
-
import { useEffect as
|
|
494
|
+
import { useEffect as useEffect7, useState as useState6 } from "react";
|
|
123
495
|
var defaultOptions = {
|
|
124
496
|
delay: 3e3,
|
|
125
497
|
disabled: false
|
|
126
498
|
};
|
|
127
499
|
function useDelay(options) {
|
|
128
|
-
const [timer, setTimer] =
|
|
500
|
+
const [timer, setTimer] = useState6(void 0);
|
|
129
501
|
const { delay, disabled } = {
|
|
130
502
|
...defaultOptions,
|
|
131
503
|
...options
|
|
@@ -144,12 +516,12 @@ function useDelay(options) {
|
|
|
144
516
|
setTimer(void 0);
|
|
145
517
|
}, delay));
|
|
146
518
|
};
|
|
147
|
-
|
|
519
|
+
useEffect7(() => {
|
|
148
520
|
return () => {
|
|
149
521
|
clearTimeout(timer);
|
|
150
522
|
};
|
|
151
523
|
}, [timer]);
|
|
152
|
-
|
|
524
|
+
useEffect7(() => {
|
|
153
525
|
if (disabled) {
|
|
154
526
|
clearTimeout(timer);
|
|
155
527
|
setTimer(void 0);
|
|
@@ -158,13 +530,10 @@ function useDelay(options) {
|
|
|
158
530
|
return { restartTimer, clearTimer, hasActiveTimer: !!timer };
|
|
159
531
|
}
|
|
160
532
|
|
|
161
|
-
// src/util/noop.ts
|
|
162
|
-
var noop = () => void 0;
|
|
163
|
-
|
|
164
533
|
// src/hooks/useFocusManagement.ts
|
|
165
|
-
import { useCallback as
|
|
534
|
+
import { useCallback as useCallback3 } from "react";
|
|
166
535
|
function useFocusManagement() {
|
|
167
|
-
const getFocusableElements =
|
|
536
|
+
const getFocusableElements = useCallback3(() => {
|
|
168
537
|
return Array.from(
|
|
169
538
|
document.querySelectorAll(
|
|
170
539
|
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
@@ -173,7 +542,7 @@ function useFocusManagement() {
|
|
|
173
542
|
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
174
543
|
);
|
|
175
544
|
}, []);
|
|
176
|
-
const getNextFocusElement =
|
|
545
|
+
const getNextFocusElement = useCallback3(() => {
|
|
177
546
|
const elements = getFocusableElements();
|
|
178
547
|
if (elements.length === 0) {
|
|
179
548
|
return void 0;
|
|
@@ -185,11 +554,11 @@ function useFocusManagement() {
|
|
|
185
554
|
}
|
|
186
555
|
return nextElement;
|
|
187
556
|
}, [getFocusableElements]);
|
|
188
|
-
const focusNext =
|
|
557
|
+
const focusNext = useCallback3(() => {
|
|
189
558
|
const nextElement = getNextFocusElement();
|
|
190
559
|
nextElement?.focus();
|
|
191
560
|
}, [getNextFocusElement]);
|
|
192
|
-
const getPreviousFocusElement =
|
|
561
|
+
const getPreviousFocusElement = useCallback3(() => {
|
|
193
562
|
const elements = getFocusableElements();
|
|
194
563
|
if (elements.length === 0) {
|
|
195
564
|
return void 0;
|
|
@@ -205,7 +574,7 @@ function useFocusManagement() {
|
|
|
205
574
|
}
|
|
206
575
|
return previousElement;
|
|
207
576
|
}, [getFocusableElements]);
|
|
208
|
-
const focusPrevious =
|
|
577
|
+
const focusPrevious = useCallback3(() => {
|
|
209
578
|
const previousElement = getPreviousFocusElement();
|
|
210
579
|
if (previousElement) previousElement.focus();
|
|
211
580
|
}, [getPreviousFocusElement]);
|
|
@@ -219,10 +588,10 @@ function useFocusManagement() {
|
|
|
219
588
|
}
|
|
220
589
|
|
|
221
590
|
// src/hooks/useFocusOnceVisible.ts
|
|
222
|
-
import React, { useEffect as
|
|
591
|
+
import React, { useEffect as useEffect8 } from "react";
|
|
223
592
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
224
593
|
const [hasUsedFocus, setHasUsedFocus] = React.useState(false);
|
|
225
|
-
|
|
594
|
+
useEffect8(() => {
|
|
226
595
|
if (disable || hasUsedFocus) {
|
|
227
596
|
return;
|
|
228
597
|
}
|
|
@@ -242,9 +611,9 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
242
611
|
};
|
|
243
612
|
|
|
244
613
|
// src/components/user-action/Input.tsx
|
|
245
|
-
import { jsx as
|
|
614
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
246
615
|
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
247
|
-
return
|
|
616
|
+
return clsx5(
|
|
248
617
|
"px-2 py-1.5 rounded-md border-2",
|
|
249
618
|
{
|
|
250
619
|
"bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
@@ -258,7 +627,7 @@ var defaultEditCompleteOptions = {
|
|
|
258
627
|
afterDelay: true,
|
|
259
628
|
delay: 2500
|
|
260
629
|
};
|
|
261
|
-
var Input =
|
|
630
|
+
var Input = forwardRef2(function Input2({
|
|
262
631
|
id,
|
|
263
632
|
type = "text",
|
|
264
633
|
value,
|
|
@@ -281,7 +650,7 @@ var Input = forwardRef(function Input2({
|
|
|
281
650
|
restartTimer,
|
|
282
651
|
clearTimer
|
|
283
652
|
} = useDelay({ delay, disabled: !afterDelay });
|
|
284
|
-
const innerRef =
|
|
653
|
+
const innerRef = useRef2(null);
|
|
285
654
|
const { focusNext } = useFocusManagement();
|
|
286
655
|
useFocusOnceVisible(innerRef, !autoFocus);
|
|
287
656
|
useImperativeHandle(forwardedRef, () => innerRef.current);
|
|
@@ -292,9 +661,9 @@ var Input = forwardRef(function Input2({
|
|
|
292
661
|
focusNext();
|
|
293
662
|
}
|
|
294
663
|
};
|
|
295
|
-
return /* @__PURE__ */
|
|
296
|
-
label && /* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
664
|
+
return /* @__PURE__ */ jsxs4("div", { className: clsx5({ "w-full": expanded }, containerClassName), children: [
|
|
665
|
+
label && /* @__PURE__ */ jsx6(Label, { ...label, htmlFor: id, className: clsx5("mb-1", label.className) }),
|
|
666
|
+
/* @__PURE__ */ jsx6(
|
|
298
667
|
"input",
|
|
299
668
|
{
|
|
300
669
|
...restProps,
|
|
@@ -303,7 +672,7 @@ var Input = forwardRef(function Input2({
|
|
|
303
672
|
id,
|
|
304
673
|
type,
|
|
305
674
|
disabled,
|
|
306
|
-
className:
|
|
675
|
+
className: clsx5(getInputClassName({ disabled }), className),
|
|
307
676
|
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
308
677
|
onBlur: (event) => {
|
|
309
678
|
onBlur?.(event);
|
|
@@ -333,7 +702,7 @@ var Input = forwardRef(function Input2({
|
|
|
333
702
|
)
|
|
334
703
|
] });
|
|
335
704
|
});
|
|
336
|
-
var FormInput =
|
|
705
|
+
var FormInput = forwardRef2(function FormInput2({
|
|
337
706
|
id,
|
|
338
707
|
labelText,
|
|
339
708
|
errorText,
|
|
@@ -345,32 +714,149 @@ var FormInput = forwardRef(function FormInput2({
|
|
|
345
714
|
disabled,
|
|
346
715
|
...restProps
|
|
347
716
|
}, ref) {
|
|
348
|
-
const input = /* @__PURE__ */
|
|
717
|
+
const input = /* @__PURE__ */ jsx6(
|
|
349
718
|
"input",
|
|
350
719
|
{
|
|
351
720
|
...restProps,
|
|
352
721
|
ref,
|
|
353
722
|
id,
|
|
354
723
|
disabled,
|
|
355
|
-
className:
|
|
724
|
+
className: clsx5(
|
|
356
725
|
getInputClassName({ disabled, hasError: !!errorText }),
|
|
357
726
|
className
|
|
358
727
|
)
|
|
359
728
|
}
|
|
360
729
|
);
|
|
361
|
-
return /* @__PURE__ */
|
|
362
|
-
labelText && /* @__PURE__ */
|
|
730
|
+
return /* @__PURE__ */ jsxs4("div", { className: clsx5("flex flex-col gap-y-1", containerClassName), children: [
|
|
731
|
+
labelText && /* @__PURE__ */ jsxs4("label", { htmlFor: id, className: clsx5("textstyle-label-md", labelClassName), children: [
|
|
363
732
|
labelText,
|
|
364
|
-
required && /* @__PURE__ */
|
|
733
|
+
required && /* @__PURE__ */ jsx6("span", { className: "text-primary font-bold", children: "*" })
|
|
365
734
|
] }),
|
|
366
735
|
input,
|
|
367
|
-
errorText && /* @__PURE__ */
|
|
736
|
+
errorText && /* @__PURE__ */ jsx6("label", { htmlFor: id, className: clsx5("text-negative", errorClassName), children: errorText })
|
|
368
737
|
] });
|
|
369
738
|
});
|
|
370
739
|
|
|
740
|
+
// src/localization/defaults/form.ts
|
|
741
|
+
var formTranslation = {
|
|
742
|
+
en: {
|
|
743
|
+
add: "Add",
|
|
744
|
+
all: "All",
|
|
745
|
+
apply: "Apply",
|
|
746
|
+
back: "Back",
|
|
747
|
+
cancel: "Cancel",
|
|
748
|
+
change: "Change",
|
|
749
|
+
clear: "Clear",
|
|
750
|
+
click: "Click",
|
|
751
|
+
clickToCopy: "Click to Copy",
|
|
752
|
+
close: "Close",
|
|
753
|
+
confirm: "Confirm",
|
|
754
|
+
copy: "Copy",
|
|
755
|
+
copied: "Copied",
|
|
756
|
+
create: "Create",
|
|
757
|
+
decline: "Decline",
|
|
758
|
+
delete: "Delete",
|
|
759
|
+
discard: "Discard",
|
|
760
|
+
discardChanges: "Discard Changes",
|
|
761
|
+
done: "Done",
|
|
762
|
+
edit: "Edit",
|
|
763
|
+
enterText: "Enter text here",
|
|
764
|
+
error: "Error",
|
|
765
|
+
exit: "Exit",
|
|
766
|
+
fieldRequiredError: "This field is required.",
|
|
767
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
768
|
+
less: "Less",
|
|
769
|
+
loading: "Loading",
|
|
770
|
+
maxLengthError: "Maximum length exceeded.",
|
|
771
|
+
minLengthError: "Minimum length not met.",
|
|
772
|
+
more: "More",
|
|
773
|
+
next: "Next",
|
|
774
|
+
no: "No",
|
|
775
|
+
none: "None",
|
|
776
|
+
of: "of",
|
|
777
|
+
optional: "Optional",
|
|
778
|
+
pleaseWait: "Please wait...",
|
|
779
|
+
previous: "Previous",
|
|
780
|
+
remove: "Remove",
|
|
781
|
+
required: "Required",
|
|
782
|
+
reset: "Reset",
|
|
783
|
+
save: "Save",
|
|
784
|
+
saved: "Saved",
|
|
785
|
+
search: "Search",
|
|
786
|
+
select: "Select",
|
|
787
|
+
selectOption: "Select an option",
|
|
788
|
+
show: "Show",
|
|
789
|
+
showMore: "Show more",
|
|
790
|
+
showLess: "Show less",
|
|
791
|
+
submit: "Submit",
|
|
792
|
+
success: "Success",
|
|
793
|
+
update: "Update",
|
|
794
|
+
unsavedChanges: "Unsaved Changes",
|
|
795
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
796
|
+
yes: "Yes"
|
|
797
|
+
},
|
|
798
|
+
de: {
|
|
799
|
+
add: "Hinzuf\xFCgen",
|
|
800
|
+
all: "Alle",
|
|
801
|
+
apply: "Anwenden",
|
|
802
|
+
back: "Zur\xFCck",
|
|
803
|
+
cancel: "Abbrechen",
|
|
804
|
+
change: "\xC4ndern",
|
|
805
|
+
clear: "L\xF6schen",
|
|
806
|
+
click: "Klicken",
|
|
807
|
+
clickToCopy: "Zum kopieren klicken",
|
|
808
|
+
close: "Schlie\xDFen",
|
|
809
|
+
confirm: "Best\xE4tigen",
|
|
810
|
+
copy: "Kopieren",
|
|
811
|
+
copied: "Kopiert",
|
|
812
|
+
create: "Erstellen",
|
|
813
|
+
decline: "Ablehnen",
|
|
814
|
+
delete: "L\xF6schen",
|
|
815
|
+
discard: "Verwerfen",
|
|
816
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
817
|
+
done: "Fertig",
|
|
818
|
+
edit: "Bearbeiten",
|
|
819
|
+
enterText: "Text hier eingeben",
|
|
820
|
+
error: "Fehler",
|
|
821
|
+
exit: "Beenden",
|
|
822
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
823
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
824
|
+
less: "Weniger",
|
|
825
|
+
loading: "L\xE4dt",
|
|
826
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
827
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
828
|
+
more: "Mehr",
|
|
829
|
+
next: "Weiter",
|
|
830
|
+
no: "Nein",
|
|
831
|
+
none: "Nichts",
|
|
832
|
+
of: "von",
|
|
833
|
+
optional: "Optional",
|
|
834
|
+
pleaseWait: "Bitte warten...",
|
|
835
|
+
previous: "Vorherige",
|
|
836
|
+
remove: "Entfernen",
|
|
837
|
+
required: "Erforderlich",
|
|
838
|
+
reset: "Zur\xFCcksetzen",
|
|
839
|
+
save: "Speichern",
|
|
840
|
+
saved: "Gespeichert",
|
|
841
|
+
search: "Suche",
|
|
842
|
+
select: "Select",
|
|
843
|
+
selectOption: "Option ausw\xE4hlen",
|
|
844
|
+
show: "Anzeigen",
|
|
845
|
+
showMore: "Mehr anzeigen",
|
|
846
|
+
showLess: "Weniger anzeigen",
|
|
847
|
+
submit: "Abschicken",
|
|
848
|
+
success: "Erfolg",
|
|
849
|
+
update: "Update",
|
|
850
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
851
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
852
|
+
yes: "Ja"
|
|
853
|
+
}
|
|
854
|
+
};
|
|
855
|
+
|
|
371
856
|
// src/components/user-action/Button.tsx
|
|
372
|
-
import
|
|
373
|
-
import
|
|
857
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
858
|
+
import clsx6 from "clsx";
|
|
859
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
374
860
|
var ButtonColorUtil = {
|
|
375
861
|
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
376
862
|
text: ["primary", "negative", "neutral"],
|
|
@@ -394,7 +880,7 @@ var ButtonUtil = {
|
|
|
394
880
|
paddingMapping,
|
|
395
881
|
iconPaddingMapping
|
|
396
882
|
};
|
|
397
|
-
var SolidButton = ({
|
|
883
|
+
var SolidButton = forwardRef3(function SolidButton2({
|
|
398
884
|
children,
|
|
399
885
|
disabled = false,
|
|
400
886
|
color = "primary",
|
|
@@ -404,7 +890,7 @@ var SolidButton = ({
|
|
|
404
890
|
onClick,
|
|
405
891
|
className,
|
|
406
892
|
...restProps
|
|
407
|
-
})
|
|
893
|
+
}, ref) {
|
|
408
894
|
const colorClasses = {
|
|
409
895
|
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
410
896
|
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
@@ -423,25 +909,26 @@ var SolidButton = ({
|
|
|
423
909
|
negative: "text-button-solid-negative-icon",
|
|
424
910
|
neutral: "text-button-solid-neutral-icon"
|
|
425
911
|
}[color];
|
|
426
|
-
return /* @__PURE__ */
|
|
912
|
+
return /* @__PURE__ */ jsxs5(
|
|
427
913
|
"button",
|
|
428
914
|
{
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
915
|
+
ref,
|
|
916
|
+
onClick,
|
|
917
|
+
disabled,
|
|
918
|
+
className: clsx6(
|
|
432
919
|
{
|
|
433
920
|
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
434
|
-
[
|
|
921
|
+
[clsx6(colorClasses, "hover:brightness-90")]: !disabled
|
|
435
922
|
},
|
|
436
923
|
ButtonUtil.paddingMapping[size],
|
|
437
924
|
className
|
|
438
925
|
),
|
|
439
926
|
...restProps,
|
|
440
927
|
children: [
|
|
441
|
-
startIcon && /* @__PURE__ */
|
|
928
|
+
startIcon && /* @__PURE__ */ jsx7(
|
|
442
929
|
"span",
|
|
443
930
|
{
|
|
444
|
-
className:
|
|
931
|
+
className: clsx6({
|
|
445
932
|
[iconColorClasses]: !disabled,
|
|
446
933
|
[`text-disabled-icon`]: disabled
|
|
447
934
|
}),
|
|
@@ -449,10 +936,10 @@ var SolidButton = ({
|
|
|
449
936
|
}
|
|
450
937
|
),
|
|
451
938
|
children,
|
|
452
|
-
endIcon && /* @__PURE__ */
|
|
939
|
+
endIcon && /* @__PURE__ */ jsx7(
|
|
453
940
|
"span",
|
|
454
941
|
{
|
|
455
|
-
className:
|
|
942
|
+
className: clsx6({
|
|
456
943
|
[iconColorClasses]: !disabled,
|
|
457
944
|
[`text-disabled-icon`]: disabled
|
|
458
945
|
}),
|
|
@@ -462,13 +949,12 @@ var SolidButton = ({
|
|
|
462
949
|
]
|
|
463
950
|
}
|
|
464
951
|
);
|
|
465
|
-
};
|
|
952
|
+
});
|
|
466
953
|
var IconButton = ({
|
|
467
954
|
children,
|
|
468
955
|
disabled = false,
|
|
469
956
|
color = "primary",
|
|
470
957
|
size = "medium",
|
|
471
|
-
onClick,
|
|
472
958
|
className,
|
|
473
959
|
...restProps
|
|
474
960
|
}) => {
|
|
@@ -482,17 +968,16 @@ var IconButton = ({
|
|
|
482
968
|
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
483
969
|
transparent: "bg-transparent"
|
|
484
970
|
}[color];
|
|
485
|
-
return /* @__PURE__ */
|
|
971
|
+
return /* @__PURE__ */ jsx7(
|
|
486
972
|
"button",
|
|
487
973
|
{
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
className: clsx3(
|
|
974
|
+
disabled,
|
|
975
|
+
className: clsx6(
|
|
491
976
|
{
|
|
492
977
|
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
493
978
|
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
494
979
|
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
495
|
-
[
|
|
980
|
+
[clsx6(colorClasses, "hover:brightness-90")]: !disabled
|
|
496
981
|
},
|
|
497
982
|
ButtonUtil.iconPaddingMapping[size],
|
|
498
983
|
className
|
|
@@ -503,17 +988,41 @@ var IconButton = ({
|
|
|
503
988
|
);
|
|
504
989
|
};
|
|
505
990
|
|
|
991
|
+
// src/components/user-action/SearchBar.tsx
|
|
992
|
+
import { Search } from "lucide-react";
|
|
993
|
+
import { clsx as clsx7 } from "clsx";
|
|
994
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
995
|
+
var SearchBar = ({
|
|
996
|
+
placeholder,
|
|
997
|
+
onSearch,
|
|
998
|
+
disableOnSearch,
|
|
999
|
+
containerClassName,
|
|
1000
|
+
...inputProps
|
|
1001
|
+
}) => {
|
|
1002
|
+
const translation = useTranslation([formTranslation]);
|
|
1003
|
+
return /* @__PURE__ */ jsxs6("div", { className: clsx7("flex-row-2 justify-between items-center", containerClassName), children: [
|
|
1004
|
+
/* @__PURE__ */ jsx8(
|
|
1005
|
+
Input,
|
|
1006
|
+
{
|
|
1007
|
+
...inputProps,
|
|
1008
|
+
placeholder: placeholder ?? translation("search")
|
|
1009
|
+
}
|
|
1010
|
+
),
|
|
1011
|
+
onSearch && /* @__PURE__ */ jsx8(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ jsx8(Search, { className: "w-full h-full" }) })
|
|
1012
|
+
] });
|
|
1013
|
+
};
|
|
1014
|
+
|
|
506
1015
|
// src/hooks/useSearch.ts
|
|
507
|
-
import { useEffect as
|
|
1016
|
+
import { useCallback as useCallback4, useEffect as useEffect10, useMemo, useState as useState8 } from "react";
|
|
508
1017
|
|
|
509
1018
|
// src/util/simpleSearch.ts
|
|
510
|
-
var
|
|
1019
|
+
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
511
1020
|
return objects.filter((object) => {
|
|
512
1021
|
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
513
1022
|
if (!mappedSearchKeywords) {
|
|
514
1023
|
return true;
|
|
515
1024
|
}
|
|
516
|
-
return !!mappedSearchKeywords.find((value) => value.includes(
|
|
1025
|
+
return search.every((searchValue) => !!mappedSearchKeywords.find((value) => !!value && value.includes(searchValue.toLowerCase().trim())));
|
|
517
1026
|
});
|
|
518
1027
|
};
|
|
519
1028
|
|
|
@@ -521,225 +1030,78 @@ var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
|
521
1030
|
var useSearch = ({
|
|
522
1031
|
list,
|
|
523
1032
|
initialSearch,
|
|
524
|
-
searchMapping
|
|
1033
|
+
searchMapping,
|
|
1034
|
+
additionalSearchTags,
|
|
1035
|
+
isSearchInstant = true,
|
|
1036
|
+
sortingFunction,
|
|
1037
|
+
filter,
|
|
1038
|
+
disabled = false
|
|
525
1039
|
}) => {
|
|
526
|
-
const [
|
|
527
|
-
const [
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
1040
|
+
const [search, setSearch] = useState8(initialSearch ?? "");
|
|
1041
|
+
const [result, setResult] = useState8(list);
|
|
1042
|
+
const searchTags = useMemo(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
1043
|
+
const updateSearch = useCallback4((newSearch) => {
|
|
1044
|
+
const usedSearch = newSearch ?? search;
|
|
1045
|
+
if (newSearch) {
|
|
1046
|
+
setSearch(search);
|
|
1047
|
+
}
|
|
1048
|
+
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
1049
|
+
}, [searchTags, list, search, searchMapping]);
|
|
1050
|
+
useEffect10(() => {
|
|
1051
|
+
if (isSearchInstant) {
|
|
1052
|
+
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
1053
|
+
}
|
|
1054
|
+
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
1055
|
+
const filteredResult = useMemo(() => {
|
|
1056
|
+
if (!filter) {
|
|
1057
|
+
return result;
|
|
1058
|
+
}
|
|
1059
|
+
return result.filter(filter);
|
|
1060
|
+
}, [result, filter]);
|
|
1061
|
+
const sortedAndFilteredResult = useMemo(() => {
|
|
1062
|
+
if (!sortingFunction) {
|
|
1063
|
+
return filteredResult;
|
|
1064
|
+
}
|
|
1065
|
+
return filteredResult.sort(sortingFunction);
|
|
1066
|
+
}, [filteredResult, sortingFunction]);
|
|
1067
|
+
const usedResult = useMemo(() => {
|
|
1068
|
+
if (!disabled) {
|
|
1069
|
+
return sortedAndFilteredResult;
|
|
1070
|
+
}
|
|
1071
|
+
return list;
|
|
1072
|
+
}, [disabled, list, sortedAndFilteredResult]);
|
|
535
1073
|
return {
|
|
536
|
-
result,
|
|
537
|
-
hasResult:
|
|
538
|
-
allItems:
|
|
539
|
-
|
|
1074
|
+
result: usedResult,
|
|
1075
|
+
hasResult: usedResult.length > 0,
|
|
1076
|
+
allItems: list,
|
|
1077
|
+
updateSearch,
|
|
540
1078
|
search,
|
|
541
1079
|
setSearch
|
|
542
1080
|
};
|
|
543
1081
|
};
|
|
544
1082
|
|
|
545
|
-
// src/
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
all: "All",
|
|
549
|
-
apply: "Apply",
|
|
550
|
-
back: "Back",
|
|
551
|
-
cancel: "Cancel",
|
|
552
|
-
change: "Change",
|
|
553
|
-
clear: "Clear",
|
|
554
|
-
click: "Click",
|
|
555
|
-
clickToCopy: "Click to Copy",
|
|
556
|
-
close: "Close",
|
|
557
|
-
confirm: "Confirm",
|
|
558
|
-
copy: "Copy",
|
|
559
|
-
copied: "Copied",
|
|
560
|
-
decline: "Decline",
|
|
561
|
-
delete: "Delete",
|
|
562
|
-
discard: "Discard",
|
|
563
|
-
discardChanges: "Discard Changes",
|
|
564
|
-
done: "Done",
|
|
565
|
-
edit: "Edit",
|
|
566
|
-
enterText: "Enter text here",
|
|
567
|
-
error: "Error",
|
|
568
|
-
exit: "Exit",
|
|
569
|
-
fieldRequiredError: "This field is required.",
|
|
570
|
-
invalidEmailError: "Please enter a valid email address.",
|
|
571
|
-
less: "Less",
|
|
572
|
-
loading: "Loading",
|
|
573
|
-
maxLengthError: "Maximum length exceeded.",
|
|
574
|
-
minLengthError: "Minimum length not met.",
|
|
575
|
-
more: "More",
|
|
576
|
-
next: "Next",
|
|
577
|
-
no: "No",
|
|
578
|
-
none: "None",
|
|
579
|
-
of: "of",
|
|
580
|
-
optional: "Optional",
|
|
581
|
-
pleaseWait: "Please wait...",
|
|
582
|
-
previous: "Previous",
|
|
583
|
-
remove: "Remove",
|
|
584
|
-
required: "Required",
|
|
585
|
-
reset: "Reset",
|
|
586
|
-
save: "Save",
|
|
587
|
-
saved: "Saved",
|
|
588
|
-
search: "Search",
|
|
589
|
-
select: "Select",
|
|
590
|
-
selectOption: "Select an option",
|
|
591
|
-
show: "Show",
|
|
592
|
-
showMore: "Show more",
|
|
593
|
-
showLess: "Show less",
|
|
594
|
-
submit: "Submit",
|
|
595
|
-
success: "Success",
|
|
596
|
-
update: "Update",
|
|
597
|
-
unsavedChanges: "Unsaved Changes",
|
|
598
|
-
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
599
|
-
yes: "Yes"
|
|
600
|
-
},
|
|
601
|
-
de: {
|
|
602
|
-
all: "Alle",
|
|
603
|
-
apply: "Anwenden",
|
|
604
|
-
back: "Zur\xFCck",
|
|
605
|
-
cancel: "Abbrechen",
|
|
606
|
-
change: "\xC4ndern",
|
|
607
|
-
clear: "L\xF6schen",
|
|
608
|
-
click: "Klicken",
|
|
609
|
-
clickToCopy: "Zum kopieren klicken",
|
|
610
|
-
close: "Schlie\xDFen",
|
|
611
|
-
confirm: "Best\xE4tigen",
|
|
612
|
-
copy: "Kopieren",
|
|
613
|
-
copied: "Kopiert",
|
|
614
|
-
decline: "Ablehnen",
|
|
615
|
-
delete: "L\xF6schen",
|
|
616
|
-
discard: "Verwerfen",
|
|
617
|
-
discardChanges: "\xC4nderungen Verwerfen",
|
|
618
|
-
done: "Fertig",
|
|
619
|
-
edit: "Bearbeiten",
|
|
620
|
-
enterText: "Text hier eingeben",
|
|
621
|
-
error: "Fehler",
|
|
622
|
-
exit: "Beenden",
|
|
623
|
-
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
624
|
-
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
625
|
-
less: "Weniger",
|
|
626
|
-
loading: "L\xE4dt",
|
|
627
|
-
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
628
|
-
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
629
|
-
more: "Mehr",
|
|
630
|
-
next: "Weiter",
|
|
631
|
-
no: "Nein",
|
|
632
|
-
none: "Nichts",
|
|
633
|
-
of: "von",
|
|
634
|
-
optional: "Optional",
|
|
635
|
-
pleaseWait: "Bitte warten...",
|
|
636
|
-
previous: "Vorherige",
|
|
637
|
-
remove: "Entfernen",
|
|
638
|
-
required: "Erforderlich",
|
|
639
|
-
reset: "Zur\xFCcksetzen",
|
|
640
|
-
save: "Speichern",
|
|
641
|
-
saved: "Gespeichert",
|
|
642
|
-
search: "Suche",
|
|
643
|
-
select: "Select",
|
|
644
|
-
selectOption: "Option ausw\xE4hlen",
|
|
645
|
-
show: "Anzeigen",
|
|
646
|
-
showMore: "Mehr anzeigen",
|
|
647
|
-
showLess: "Weniger anzeigen",
|
|
648
|
-
submit: "Abschicken",
|
|
649
|
-
success: "Erfolg",
|
|
650
|
-
update: "Update",
|
|
651
|
-
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
652
|
-
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
653
|
-
yes: "Ja"
|
|
654
|
-
}
|
|
655
|
-
};
|
|
656
|
-
|
|
657
|
-
// src/components/layout-and-navigation/SearchableList.tsx
|
|
658
|
-
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
659
|
-
var defaultSearchableListTranslation = {
|
|
660
|
-
en: {
|
|
661
|
-
nothingFound: "Nothing found"
|
|
662
|
-
},
|
|
663
|
-
de: {
|
|
664
|
-
nothingFound: "Nichts gefunden"
|
|
665
|
-
}
|
|
666
|
-
};
|
|
667
|
-
var SearchableList = ({
|
|
668
|
-
overwriteTranslation,
|
|
669
|
-
list,
|
|
670
|
-
initialSearch = "",
|
|
671
|
-
searchMapping,
|
|
672
|
-
autoFocus,
|
|
673
|
-
minimumItemsForSearch = 6,
|
|
674
|
-
itemMapper,
|
|
1083
|
+
// src/components/user-action/Select.tsx
|
|
1084
|
+
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1085
|
+
var SelectTile = ({
|
|
675
1086
|
className,
|
|
676
|
-
|
|
677
|
-
}) => {
|
|
678
|
-
const translation = useTranslation([defaultSearchableListTranslation, formTranslation], overwriteTranslation);
|
|
679
|
-
const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
|
|
680
|
-
return /* @__PURE__ */ jsxs3("div", { className: clsx4("col gap-y-2", className), children: [
|
|
681
|
-
list.length > minimumItemsForSearch && /* @__PURE__ */ jsxs3("div", { className: "row justify-between gap-x-4 items-center", children: [
|
|
682
|
-
/* @__PURE__ */ jsx5(
|
|
683
|
-
Input,
|
|
684
|
-
{
|
|
685
|
-
value: search,
|
|
686
|
-
onChangeText: setSearch,
|
|
687
|
-
placeholder: translation("search"),
|
|
688
|
-
autoFocus,
|
|
689
|
-
className: "w-full"
|
|
690
|
-
}
|
|
691
|
-
),
|
|
692
|
-
/* @__PURE__ */ jsx5(IconButton, { color: "neutral", disabled: search.length === 0, children: /* @__PURE__ */ jsx5(Search, { className: "w-full h-full" }) })
|
|
693
|
-
] }),
|
|
694
|
-
hasResult ? /* @__PURE__ */ jsx5("div", { className: clsx4("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ jsx5("div", { className: "row text-description py-2 px-2", children: translation("nothingFound") })
|
|
695
|
-
] });
|
|
696
|
-
};
|
|
697
|
-
|
|
698
|
-
// src/components/layout-and-navigation/Tile.tsx
|
|
699
|
-
import clsx5 from "clsx";
|
|
700
|
-
import { Check } from "lucide-react";
|
|
701
|
-
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
702
|
-
var Tile = ({
|
|
1087
|
+
disabledClassName,
|
|
703
1088
|
title,
|
|
704
|
-
|
|
705
|
-
onClick,
|
|
706
|
-
isSelected = false,
|
|
707
|
-
isDisabled = false,
|
|
708
|
-
prefix,
|
|
709
|
-
suffix,
|
|
710
|
-
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
711
|
-
selectedClassName = " bg-primary/20",
|
|
712
|
-
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
713
|
-
className
|
|
1089
|
+
...restProps
|
|
714
1090
|
}) => {
|
|
715
|
-
return /* @__PURE__ */
|
|
716
|
-
|
|
1091
|
+
return /* @__PURE__ */ jsx9(
|
|
1092
|
+
Tile,
|
|
717
1093
|
{
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
[selectedClassName]: isSelected && !isDisabled,
|
|
723
|
-
[disabledClassName]: isDisabled
|
|
724
|
-
},
|
|
725
|
-
className
|
|
726
|
-
),
|
|
727
|
-
onClick: isDisabled ? void 0 : onClick,
|
|
728
|
-
children: [
|
|
729
|
-
prefix,
|
|
730
|
-
/* @__PURE__ */ jsxs4("div", { className: "col gap-y-0 w-full", children: [
|
|
731
|
-
/* @__PURE__ */ jsx6("h4", { className: clsx5(title.className ?? "textstyle-title-normal"), children: title.value }),
|
|
732
|
-
!!description && /* @__PURE__ */ jsx6("span", { className: clsx5(description.className ?? "textstyle-description"), children: description.value })
|
|
733
|
-
] }),
|
|
734
|
-
suffix ?? (isSelected ? /* @__PURE__ */ jsx6(Check, { size: 24 }) : void 0)
|
|
735
|
-
]
|
|
1094
|
+
...restProps,
|
|
1095
|
+
className: clsx8("px-2 py-1 rounded-md", className),
|
|
1096
|
+
disabledClassName: disabledClassName ?? "text-disabled-text cursor-not-allowed",
|
|
1097
|
+
title: { ...title, className: title.className ?? "font-semibold" }
|
|
736
1098
|
}
|
|
737
1099
|
);
|
|
738
1100
|
};
|
|
739
1101
|
|
|
740
1102
|
// src/components/layout-and-navigation/Chip.tsx
|
|
741
|
-
import
|
|
742
|
-
import { jsx as
|
|
1103
|
+
import clsx9 from "clsx";
|
|
1104
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
743
1105
|
var Chip = ({
|
|
744
1106
|
children,
|
|
745
1107
|
trailingIcon,
|
|
@@ -766,11 +1128,11 @@ var Chip = ({
|
|
|
766
1128
|
blue: "text-tag-blue-icon",
|
|
767
1129
|
pink: "text-tag-pink-icon"
|
|
768
1130
|
}[color];
|
|
769
|
-
return /* @__PURE__ */
|
|
1131
|
+
return /* @__PURE__ */ jsxs8(
|
|
770
1132
|
"div",
|
|
771
1133
|
{
|
|
772
1134
|
...restProps,
|
|
773
|
-
className:
|
|
1135
|
+
className: clsx9(
|
|
774
1136
|
`row w-fit px-2 py-1`,
|
|
775
1137
|
colorMapping,
|
|
776
1138
|
{
|
|
@@ -781,7 +1143,7 @@ var Chip = ({
|
|
|
781
1143
|
),
|
|
782
1144
|
children: [
|
|
783
1145
|
children,
|
|
784
|
-
trailingIcon && /* @__PURE__ */
|
|
1146
|
+
trailingIcon && /* @__PURE__ */ jsx10("span", { className: colorMappingIcon, children: trailingIcon })
|
|
785
1147
|
]
|
|
786
1148
|
}
|
|
787
1149
|
);
|
|
@@ -790,7 +1152,7 @@ var ChipList = ({
|
|
|
790
1152
|
list,
|
|
791
1153
|
className = ""
|
|
792
1154
|
}) => {
|
|
793
|
-
return /* @__PURE__ */
|
|
1155
|
+
return /* @__PURE__ */ jsx10("div", { className: clsx9("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ jsx10(
|
|
794
1156
|
Chip,
|
|
795
1157
|
{
|
|
796
1158
|
...value,
|
|
@@ -802,28 +1164,74 @@ var ChipList = ({
|
|
|
802
1164
|
)) });
|
|
803
1165
|
};
|
|
804
1166
|
|
|
805
|
-
// src/
|
|
806
|
-
import {
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
1167
|
+
// src/components/user-action/Checkbox.tsx
|
|
1168
|
+
import { useState as useState10 } from "react";
|
|
1169
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
1170
|
+
import { Check as Check2, Minus } from "lucide-react";
|
|
1171
|
+
import clsx10 from "clsx";
|
|
1172
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1173
|
+
var checkboxSizeMapping = {
|
|
1174
|
+
small: "size-5",
|
|
1175
|
+
medium: "size-6",
|
|
1176
|
+
large: "size-8"
|
|
1177
|
+
};
|
|
1178
|
+
var checkboxIconSizeMapping = {
|
|
1179
|
+
small: "size-4",
|
|
1180
|
+
medium: "size-5",
|
|
1181
|
+
large: "size-7"
|
|
1182
|
+
};
|
|
1183
|
+
var Checkbox = ({
|
|
1184
|
+
id,
|
|
1185
|
+
label,
|
|
1186
|
+
checked,
|
|
1187
|
+
disabled,
|
|
1188
|
+
onChange,
|
|
1189
|
+
onChangeTristate,
|
|
1190
|
+
size = "medium",
|
|
1191
|
+
className = "",
|
|
1192
|
+
containerClassName
|
|
1193
|
+
}) => {
|
|
1194
|
+
const usedSizeClass = checkboxSizeMapping[size];
|
|
1195
|
+
const innerIconSize = checkboxIconSizeMapping[size];
|
|
1196
|
+
const propagateChange = (checked2) => {
|
|
1197
|
+
if (onChangeTristate) {
|
|
1198
|
+
onChangeTristate(checked2);
|
|
1199
|
+
}
|
|
1200
|
+
if (onChange) {
|
|
1201
|
+
onChange(checked2 === "indeterminate" ? false : checked2);
|
|
1202
|
+
}
|
|
1203
|
+
};
|
|
1204
|
+
const changeValue = () => {
|
|
1205
|
+
const newValue = checked === "indeterminate" ? false : !checked;
|
|
1206
|
+
propagateChange(newValue);
|
|
1207
|
+
};
|
|
1208
|
+
return /* @__PURE__ */ jsxs9("div", { className: clsx10("group flex-row-2 items-center cursor-pointer", containerClassName), onClick: changeValue, children: [
|
|
1209
|
+
/* @__PURE__ */ jsx11(
|
|
1210
|
+
CheckboxPrimitive.Root,
|
|
1211
|
+
{
|
|
1212
|
+
onCheckedChange: propagateChange,
|
|
1213
|
+
checked,
|
|
1214
|
+
disabled,
|
|
1215
|
+
id,
|
|
1216
|
+
className: clsx10(usedSizeClass, `items-center border-2 rounded outline-none `, {
|
|
1217
|
+
"text-disabled-text border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
|
|
1218
|
+
"focus:border-primary group-hover:border-primary ": !disabled,
|
|
1219
|
+
"bg-surface": !disabled && !checked,
|
|
1220
|
+
"bg-primary/30 border-primary text-primary": !disabled && checked === true || checked === "indeterminate"
|
|
1221
|
+
}, className),
|
|
1222
|
+
children: /* @__PURE__ */ jsxs9(CheckboxPrimitive.Indicator, { children: [
|
|
1223
|
+
checked === true && /* @__PURE__ */ jsx11(Check2, { className: innerIconSize }),
|
|
1224
|
+
checked === "indeterminate" && /* @__PURE__ */ jsx11(Minus, { className: innerIconSize })
|
|
1225
|
+
] })
|
|
813
1226
|
}
|
|
814
|
-
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
document.addEventListener("touchstart", listener);
|
|
818
|
-
return () => {
|
|
819
|
-
document.removeEventListener("mousedown", listener);
|
|
820
|
-
document.removeEventListener("touchstart", listener);
|
|
821
|
-
};
|
|
822
|
-
}, [refs, handler]);
|
|
1227
|
+
),
|
|
1228
|
+
label && /* @__PURE__ */ jsx11(Label, { ...label, className: clsx10(label.className), htmlFor: id })
|
|
1229
|
+
] });
|
|
823
1230
|
};
|
|
824
1231
|
|
|
825
1232
|
// src/components/user-action/MultiSelect.tsx
|
|
826
|
-
import {
|
|
1233
|
+
import { Plus } from "lucide-react";
|
|
1234
|
+
import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
827
1235
|
var defaultMultiSelectTranslation = {
|
|
828
1236
|
en: {
|
|
829
1237
|
selected: `{{amount}} selected`
|
|
@@ -834,89 +1242,107 @@ var defaultMultiSelectTranslation = {
|
|
|
834
1242
|
};
|
|
835
1243
|
var MultiSelect = ({
|
|
836
1244
|
overwriteTranslation,
|
|
837
|
-
options,
|
|
838
1245
|
label,
|
|
1246
|
+
options,
|
|
839
1247
|
onChange,
|
|
840
1248
|
hintText,
|
|
841
|
-
isDisabled = false,
|
|
842
|
-
isSearchEnabled = false,
|
|
843
1249
|
selectedDisplayOverwrite,
|
|
1250
|
+
searchOptions,
|
|
1251
|
+
additionalItems,
|
|
844
1252
|
useChipDisplay = false,
|
|
845
|
-
className
|
|
1253
|
+
className,
|
|
1254
|
+
triggerClassName,
|
|
1255
|
+
hintTextClassName,
|
|
1256
|
+
...menuProps
|
|
846
1257
|
}) => {
|
|
847
1258
|
const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
|
|
848
|
-
const
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
1259
|
+
const { result, search, setSearch } = useSearch({
|
|
1260
|
+
list: options,
|
|
1261
|
+
searchMapping: useCallback6((item) => item.searchTags, []),
|
|
1262
|
+
...searchOptions
|
|
1263
|
+
});
|
|
852
1264
|
const selectedItems = options.filter((value) => value.selected);
|
|
853
1265
|
const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
|
|
854
|
-
return /* @__PURE__ */
|
|
855
|
-
label && /* @__PURE__ */
|
|
1266
|
+
return /* @__PURE__ */ jsxs10("div", { className: clsx11(className), children: [
|
|
1267
|
+
label && /* @__PURE__ */ jsx12(
|
|
856
1268
|
Label,
|
|
857
1269
|
{
|
|
858
1270
|
...label,
|
|
859
1271
|
htmlFor: label.name,
|
|
860
|
-
className:
|
|
1272
|
+
className: clsx11(" mb-1", label.className),
|
|
861
1273
|
labelType: label.labelType ?? "labelBig"
|
|
862
1274
|
}
|
|
863
1275
|
),
|
|
864
|
-
/* @__PURE__ */
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
"
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
1276
|
+
/* @__PURE__ */ jsx12(
|
|
1277
|
+
Menu,
|
|
1278
|
+
{
|
|
1279
|
+
...menuProps,
|
|
1280
|
+
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ jsx12(
|
|
1281
|
+
"button",
|
|
1282
|
+
{
|
|
1283
|
+
ref,
|
|
1284
|
+
className: clsx11(
|
|
1285
|
+
"btn-md justify-between w-full border-2 h-auto",
|
|
1286
|
+
{
|
|
1287
|
+
"min-h-14": useChipDisplay,
|
|
1288
|
+
"bg-menu-background text-menu-text border-menu-border hover:border-primary": !disabled,
|
|
1289
|
+
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": disabled
|
|
1290
|
+
},
|
|
1291
|
+
triggerClassName
|
|
1292
|
+
),
|
|
1293
|
+
onClick: toggleOpen,
|
|
1294
|
+
disabled,
|
|
1295
|
+
children: useChipDisplay ? /* @__PURE__ */ jsx12(Fragment3, { children: isShowingHint ? /* @__PURE__ */ jsx12(IconButton, { disabled, size: "small", color: "neutral", children: /* @__PURE__ */ jsx12(Plus, {}) }) : /* @__PURE__ */ jsx12(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) }) : /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
1296
|
+
!isShowingHint && /* @__PURE__ */ jsx12("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? translation("selected", { replacements: { amount: selectedItems.length.toString() } }) }),
|
|
1297
|
+
isShowingHint && /* @__PURE__ */ jsx12("span", { className: clsx11("textstyle-description", hintTextClassName), children: hintText ?? translation("select") }),
|
|
1298
|
+
/* @__PURE__ */ jsx12(ExpansionIcon, { isExpanded: isOpen })
|
|
1299
|
+
] })
|
|
1300
|
+
}
|
|
1301
|
+
),
|
|
1302
|
+
menuClassName: clsx11("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
|
|
1303
|
+
children: (bag) => {
|
|
1304
|
+
const { close } = bag;
|
|
1305
|
+
return /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
1306
|
+
!searchOptions?.disabled && /* @__PURE__ */ jsx12(
|
|
1307
|
+
SearchBar,
|
|
894
1308
|
{
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
1309
|
+
value: search,
|
|
1310
|
+
onChangeText: setSearch,
|
|
1311
|
+
autoFocus: true
|
|
1312
|
+
}
|
|
1313
|
+
),
|
|
1314
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex-col-2 overflow-y-auto", children: [
|
|
1315
|
+
result.map((option, index) => {
|
|
1316
|
+
const update = () => {
|
|
1317
|
+
onChange(options.map((value) => value.value === option.value ? {
|
|
1318
|
+
...option,
|
|
1319
|
+
selected: !value.selected
|
|
1320
|
+
} : value));
|
|
1321
|
+
};
|
|
1322
|
+
return /* @__PURE__ */ jsx12(
|
|
1323
|
+
SelectTile,
|
|
900
1324
|
{
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
},
|
|
911
|
-
|
|
1325
|
+
prefix: /* @__PURE__ */ jsx12(
|
|
1326
|
+
Checkbox,
|
|
1327
|
+
{
|
|
1328
|
+
checked: option.selected,
|
|
1329
|
+
onChange: update,
|
|
1330
|
+
size: "small",
|
|
1331
|
+
disabled: option.disabled
|
|
1332
|
+
}
|
|
1333
|
+
),
|
|
1334
|
+
title: { value: option.label },
|
|
1335
|
+
onClick: update,
|
|
1336
|
+
disabled: option.disabled
|
|
912
1337
|
},
|
|
913
1338
|
index
|
|
914
|
-
)
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
1339
|
+
);
|
|
1340
|
+
}),
|
|
1341
|
+
additionalItems && additionalItems({ ...bag, search })
|
|
1342
|
+
] }),
|
|
1343
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex-row-2 justify-between", children: [
|
|
1344
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex-row-2", children: [
|
|
1345
|
+
/* @__PURE__ */ jsx12(
|
|
920
1346
|
SolidButton,
|
|
921
1347
|
{
|
|
922
1348
|
color: "neutral",
|
|
@@ -931,7 +1357,7 @@ var MultiSelect = ({
|
|
|
931
1357
|
children: translation("all")
|
|
932
1358
|
}
|
|
933
1359
|
),
|
|
934
|
-
/* @__PURE__ */
|
|
1360
|
+
/* @__PURE__ */ jsx12(
|
|
935
1361
|
SolidButton,
|
|
936
1362
|
{
|
|
937
1363
|
color: "neutral",
|
|
@@ -946,12 +1372,12 @@ var MultiSelect = ({
|
|
|
946
1372
|
}
|
|
947
1373
|
)
|
|
948
1374
|
] }),
|
|
949
|
-
/* @__PURE__ */
|
|
1375
|
+
/* @__PURE__ */ jsx12(SolidButton, { size: "small", onClick: close, children: "Done" })
|
|
950
1376
|
] })
|
|
951
|
-
]
|
|
1377
|
+
] });
|
|
952
1378
|
}
|
|
953
|
-
|
|
954
|
-
|
|
1379
|
+
}
|
|
1380
|
+
)
|
|
955
1381
|
] });
|
|
956
1382
|
};
|
|
957
1383
|
var MultiSelectUncontrolled = ({
|
|
@@ -959,11 +1385,11 @@ var MultiSelectUncontrolled = ({
|
|
|
959
1385
|
onChange,
|
|
960
1386
|
...props
|
|
961
1387
|
}) => {
|
|
962
|
-
const [usedOptions, setUsedOptions] =
|
|
963
|
-
|
|
1388
|
+
const [usedOptions, setUsedOptions] = useState11(options);
|
|
1389
|
+
useEffect12(() => {
|
|
964
1390
|
setUsedOptions(options);
|
|
965
1391
|
}, [options]);
|
|
966
|
-
return /* @__PURE__ */
|
|
1392
|
+
return /* @__PURE__ */ jsx12(
|
|
967
1393
|
MultiSelect,
|
|
968
1394
|
{
|
|
969
1395
|
...props,
|