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