@helpwave/hightide 0.1.22 → 0.1.24
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/README.md +5 -0
- package/dist/components/branding/HelpwaveBadge.js +8 -5
- package/dist/components/branding/HelpwaveBadge.js.map +1 -1
- package/dist/components/branding/HelpwaveBadge.mjs +8 -5
- package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +10 -10
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs +4 -4
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/TimeDisplay.js.map +1 -1
- package/dist/components/date/TimeDisplay.mjs +2 -2
- package/dist/components/date/TimeDisplay.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +5 -5
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +8 -8
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.js +2912 -33
- package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.mjs +2941 -33
- package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
- package/dist/components/icons-and-geometry/Tag.js +2912 -1
- package/dist/components/icons-and-geometry/Tag.js.map +1 -1
- package/dist/components/icons-and-geometry/Tag.mjs +2931 -1
- package/dist/components/icons-and-geometry/Tag.mjs.map +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.d.mts +2 -1
- package/dist/components/layout-and-navigation/BreadCrumb.d.ts +2 -1
- package/dist/components/layout-and-navigation/BreadCrumb.js +15 -11
- package/dist/components/layout-and-navigation/BreadCrumb.js.map +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.mjs +15 -11
- package/dist/components/layout-and-navigation/BreadCrumb.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Chip.js +2 -2
- package/dist/components/layout-and-navigation/Chip.js.map +1 -1
- package/dist/components/layout-and-navigation/Chip.mjs +2 -2
- package/dist/components/layout-and-navigation/Chip.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +6 -6
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +10 -10
- package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +10 -10
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +4 -4
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +2 -2
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Tile.d.mts +9 -10
- package/dist/components/layout-and-navigation/Tile.d.ts +9 -10
- package/dist/components/layout-and-navigation/Tile.js +21 -4
- package/dist/components/layout-and-navigation/Tile.js.map +1 -1
- package/dist/components/layout-and-navigation/Tile.mjs +20 -4
- package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs +2 -2
- package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.js +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +2 -2
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +8 -8
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +8 -8
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +8 -8
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +21 -22
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +45 -46
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +21 -22
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +46 -47
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js +1 -1
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +3 -3
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js +1 -1
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +3 -3
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +0 -1
- package/dist/components/properties/MultiSelectProperty.d.ts +0 -1
- package/dist/components/properties/MultiSelectProperty.js +745 -740
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +762 -757
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js +1 -1
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +3 -3
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js +1 -1
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +3 -3
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +0 -1
- package/dist/components/properties/SelectProperty.d.ts +0 -1
- package/dist/components/properties/SelectProperty.js +24 -25
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +45 -46
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js +1 -1
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +7 -7
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.mjs +26 -26
- package/dist/components/table/Table.mjs.map +1 -1
- package/dist/components/table/TableFilterButton.js.map +1 -1
- package/dist/components/table/TableFilterButton.mjs +4 -4
- package/dist/components/table/TableFilterButton.mjs.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.mjs +2 -2
- package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +12 -12
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +0 -1
- package/dist/components/user-action/MultiSelect.d.ts +0 -1
- package/dist/components/user-action/MultiSelect.js +617 -612
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +642 -637
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/ScrollPicker.js +1 -1
- package/dist/components/user-action/ScrollPicker.js.map +1 -1
- package/dist/components/user-action/ScrollPicker.mjs +1 -1
- package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
- package/dist/components/user-action/SearchBar.js.map +1 -1
- package/dist/components/user-action/SearchBar.mjs +2 -2
- package/dist/components/user-action/SearchBar.mjs.map +1 -1
- package/dist/components/user-action/Select.d.mts +1 -4
- package/dist/components/user-action/Select.d.ts +1 -4
- package/dist/components/user-action/Select.js +21 -24
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +27 -29
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/css/globals.css +175 -179
- package/dist/css/uncompiled/globals.css +3 -3
- package/dist/css/uncompiled/textstyles.css +5 -5
- package/dist/css/uncompiled/theme/colors-basic.css +13 -5
- package/dist/css/uncompiled/theme/colors-component.css +56 -41
- package/dist/css/uncompiled/theme/colors-semantic.css +76 -83
- package/dist/css/uncompiled/theme/index.css +1 -2
- package/dist/hooks/useLocalStorage.js +1 -3
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/hooks/useLocalStorage.mjs +3 -4
- package/dist/hooks/useLocalStorage.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3161 -377
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3098 -314
- package/dist/index.mjs.map +1 -1
- package/dist/localization/LanguageProvider.js +0 -3
- package/dist/localization/LanguageProvider.js.map +1 -1
- package/dist/localization/LanguageProvider.mjs +5 -8
- package/dist/localization/LanguageProvider.mjs.map +1 -1
- package/dist/localization/useTranslation.js.map +1 -1
- package/dist/localization/useTranslation.mjs +2 -2
- package/dist/localization/useTranslation.mjs.map +1 -1
- package/dist/theming/useTheme.js +4 -7
- package/dist/theming/useTheme.js.map +1 -1
- package/dist/theming/useTheme.mjs +9 -12
- package/dist/theming/useTheme.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/css/uncompiled/theme/theme.css +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// src/components/properties/MultiSelectProperty.tsx
|
|
2
2
|
import { List, Plus as Plus2 } from "lucide-react";
|
|
3
|
-
import
|
|
3
|
+
import clsx12 from "clsx";
|
|
4
4
|
|
|
5
5
|
// src/localization/LanguageProvider.tsx
|
|
6
|
-
import { createContext, useContext, useEffect
|
|
6
|
+
import { createContext, useContext, useEffect, useState as useState2 } from "react";
|
|
7
7
|
|
|
8
8
|
// src/hooks/useLocalStorage.ts
|
|
9
|
-
import { useCallback,
|
|
9
|
+
import { useCallback, useState } from "react";
|
|
10
10
|
|
|
11
11
|
// src/localization/util.ts
|
|
12
12
|
var languages = ["en", "de"];
|
|
@@ -90,9 +90,9 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
// src/components/user-action/MultiSelect.tsx
|
|
93
|
-
import { useCallback as
|
|
94
|
-
import { useEffect as
|
|
95
|
-
import
|
|
93
|
+
import { useCallback as useCallback5 } from "react";
|
|
94
|
+
import { useEffect as useEffect10, useState as useState10 } from "react";
|
|
95
|
+
import clsx10 from "clsx";
|
|
96
96
|
|
|
97
97
|
// src/components/user-action/Label.tsx
|
|
98
98
|
import clsx from "clsx";
|
|
@@ -112,191 +112,427 @@ var Label = ({
|
|
|
112
112
|
return /* @__PURE__ */ jsx2("label", { ...props, className: clsx(styleMapping[labelType], className), children: children ? children : name });
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
// src/components/user-action/
|
|
116
|
-
import {
|
|
117
|
-
import { useEffect as useEffect11, useState as useState9 } from "react";
|
|
118
|
-
import clsx8 from "clsx";
|
|
119
|
-
|
|
120
|
-
// src/components/layout-and-navigation/Tile.tsx
|
|
115
|
+
// src/components/user-action/Button.tsx
|
|
116
|
+
import { forwardRef } from "react";
|
|
121
117
|
import clsx2 from "clsx";
|
|
122
|
-
import { Check } from "lucide-react";
|
|
123
118
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
119
|
+
var ButtonColorUtil = {
|
|
120
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
121
|
+
text: ["primary", "negative", "neutral"],
|
|
122
|
+
outline: ["primary"]
|
|
123
|
+
};
|
|
124
|
+
var IconButtonUtil = {
|
|
125
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
126
|
+
};
|
|
127
|
+
var paddingMapping = {
|
|
128
|
+
small: "btn-sm",
|
|
129
|
+
medium: "btn-md",
|
|
130
|
+
large: "btn-lg"
|
|
131
|
+
};
|
|
132
|
+
var iconPaddingMapping = {
|
|
133
|
+
tiny: "icon-btn-xs",
|
|
134
|
+
small: "icon-btn-sm",
|
|
135
|
+
medium: "icon-btn-md",
|
|
136
|
+
large: "icon-btn-lg"
|
|
137
|
+
};
|
|
138
|
+
var ButtonUtil = {
|
|
139
|
+
paddingMapping,
|
|
140
|
+
iconPaddingMapping
|
|
141
|
+
};
|
|
142
|
+
var SolidButton = forwardRef(function SolidButton2({
|
|
143
|
+
children,
|
|
129
144
|
disabled = false,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
className
|
|
136
|
-
|
|
145
|
+
color = "primary",
|
|
146
|
+
size = "medium",
|
|
147
|
+
startIcon,
|
|
148
|
+
endIcon,
|
|
149
|
+
onClick,
|
|
150
|
+
className,
|
|
151
|
+
...restProps
|
|
152
|
+
}, ref) {
|
|
153
|
+
const colorClasses = {
|
|
154
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
155
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
156
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
157
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
158
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
159
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
160
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
161
|
+
}[color];
|
|
162
|
+
const iconColorClasses = {
|
|
163
|
+
primary: "text-button-solid-primary-icon",
|
|
164
|
+
secondary: "text-button-solid-secondary-icon",
|
|
165
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
166
|
+
positive: "text-button-solid-positive-icon",
|
|
167
|
+
warning: "text-button-solid-warning-icon",
|
|
168
|
+
negative: "text-button-solid-negative-icon",
|
|
169
|
+
neutral: "text-button-solid-neutral-icon"
|
|
170
|
+
}[color];
|
|
137
171
|
return /* @__PURE__ */ jsxs(
|
|
138
|
-
"
|
|
172
|
+
"button",
|
|
139
173
|
{
|
|
174
|
+
ref,
|
|
175
|
+
onClick,
|
|
176
|
+
disabled,
|
|
140
177
|
className: clsx2(
|
|
141
|
-
"
|
|
178
|
+
"font-semibold",
|
|
142
179
|
{
|
|
143
|
-
|
|
144
|
-
[
|
|
145
|
-
[disabledClassName]: disabled
|
|
180
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
181
|
+
[clsx2(colorClasses, "hover:brightness-90")]: !disabled
|
|
146
182
|
},
|
|
183
|
+
ButtonUtil.paddingMapping[size],
|
|
147
184
|
className
|
|
148
185
|
),
|
|
149
|
-
|
|
186
|
+
...restProps,
|
|
150
187
|
children: [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
188
|
+
startIcon && /* @__PURE__ */ jsx3(
|
|
189
|
+
"span",
|
|
190
|
+
{
|
|
191
|
+
className: clsx2({
|
|
192
|
+
[iconColorClasses]: !disabled,
|
|
193
|
+
[`text-disabled-icon`]: disabled
|
|
194
|
+
}),
|
|
195
|
+
children: startIcon
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
children,
|
|
199
|
+
endIcon && /* @__PURE__ */ jsx3(
|
|
200
|
+
"span",
|
|
201
|
+
{
|
|
202
|
+
className: clsx2({
|
|
203
|
+
[iconColorClasses]: !disabled,
|
|
204
|
+
[`text-disabled-icon`]: disabled
|
|
205
|
+
}),
|
|
206
|
+
children: endIcon
|
|
207
|
+
}
|
|
208
|
+
)
|
|
157
209
|
]
|
|
158
210
|
}
|
|
159
211
|
);
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
// src/components/layout-and-navigation/Expandable.tsx
|
|
163
|
-
import { forwardRef, useCallback as useCallback2, useEffect as useEffect3, useState as useState3 } from "react";
|
|
164
|
-
import { ChevronDown } from "lucide-react";
|
|
165
|
-
import clsx3 from "clsx";
|
|
166
|
-
|
|
167
|
-
// src/util/noop.ts
|
|
168
|
-
var noop = () => void 0;
|
|
169
|
-
|
|
170
|
-
// src/components/layout-and-navigation/Expandable.tsx
|
|
171
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
172
|
-
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
173
|
-
return /* @__PURE__ */ jsx4(
|
|
174
|
-
ChevronDown,
|
|
175
|
-
{
|
|
176
|
-
className: clsx3(
|
|
177
|
-
"min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
|
|
178
|
-
{ "rotate-180": isExpanded },
|
|
179
|
-
className
|
|
180
|
-
)
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
|
-
};
|
|
184
|
-
var Expandable = forwardRef(function Expandable2({
|
|
212
|
+
});
|
|
213
|
+
var TextButton = ({
|
|
185
214
|
children,
|
|
186
|
-
label,
|
|
187
|
-
icon,
|
|
188
|
-
isExpanded = false,
|
|
189
|
-
onChange = noop,
|
|
190
|
-
clickOnlyOnHeader = true,
|
|
191
215
|
disabled = false,
|
|
216
|
+
color = "neutral",
|
|
217
|
+
size = "medium",
|
|
218
|
+
startIcon,
|
|
219
|
+
endIcon,
|
|
220
|
+
onClick,
|
|
221
|
+
coloredHoverBackground = true,
|
|
192
222
|
className,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
223
|
+
...restProps
|
|
224
|
+
}) => {
|
|
225
|
+
const colorClasses = {
|
|
226
|
+
primary: "bg-transparent text-button-text-primary-text",
|
|
227
|
+
negative: "bg-transparent text-button-text-negative-text",
|
|
228
|
+
neutral: "bg-transparent text-button-text-neutral-text"
|
|
229
|
+
}[color];
|
|
230
|
+
const backgroundColor = {
|
|
231
|
+
primary: "hover:bg-button-text-primary-text/20",
|
|
232
|
+
negative: "hover:bg-button-text-negative-text/20",
|
|
233
|
+
neutral: "hover:bg-button-text-neutral-text/20"
|
|
234
|
+
}[color];
|
|
235
|
+
const iconColorClasses = {
|
|
236
|
+
primary: "text-button-text-primary-icon",
|
|
237
|
+
negative: "text-button-text-negative-icon",
|
|
238
|
+
neutral: "text-button-text-neutral-icon"
|
|
239
|
+
}[color];
|
|
240
|
+
return /* @__PURE__ */ jsxs(
|
|
241
|
+
"button",
|
|
201
242
|
{
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
243
|
+
onClick,
|
|
244
|
+
disabled,
|
|
245
|
+
className: clsx2(
|
|
246
|
+
"font-semibold",
|
|
247
|
+
{
|
|
248
|
+
"text-disabled-text cursor-not-allowed": disabled,
|
|
249
|
+
[colorClasses]: !disabled,
|
|
250
|
+
[backgroundColor]: !disabled && coloredHoverBackground,
|
|
251
|
+
"hover:bg-button-text-hover-background": !disabled && !coloredHoverBackground
|
|
252
|
+
},
|
|
253
|
+
ButtonUtil.paddingMapping[size],
|
|
254
|
+
className
|
|
255
|
+
),
|
|
256
|
+
...restProps,
|
|
205
257
|
children: [
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
"
|
|
258
|
+
startIcon && /* @__PURE__ */ jsx3(
|
|
259
|
+
"span",
|
|
208
260
|
{
|
|
209
|
-
className:
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
215
|
-
},
|
|
216
|
-
headerClassName
|
|
217
|
-
),
|
|
218
|
-
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
219
|
-
children: [
|
|
220
|
-
label,
|
|
221
|
-
icon(isExpanded)
|
|
222
|
-
]
|
|
261
|
+
className: clsx2({
|
|
262
|
+
[iconColorClasses]: !disabled,
|
|
263
|
+
[`text-disabled-icon`]: disabled
|
|
264
|
+
}),
|
|
265
|
+
children: startIcon
|
|
223
266
|
}
|
|
224
267
|
),
|
|
225
|
-
|
|
226
|
-
|
|
268
|
+
children,
|
|
269
|
+
endIcon && /* @__PURE__ */ jsx3(
|
|
270
|
+
"span",
|
|
227
271
|
{
|
|
228
|
-
className:
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
},
|
|
234
|
-
contentClassName
|
|
235
|
-
),
|
|
236
|
-
children
|
|
272
|
+
className: clsx2({
|
|
273
|
+
[iconColorClasses]: !disabled,
|
|
274
|
+
[`text-disabled-icon`]: disabled
|
|
275
|
+
}),
|
|
276
|
+
children: endIcon
|
|
237
277
|
}
|
|
238
278
|
)
|
|
239
279
|
]
|
|
240
280
|
}
|
|
241
281
|
);
|
|
242
|
-
});
|
|
243
|
-
var ExpandableUncontrolled = forwardRef(function ExpandableUncontrolled2({
|
|
244
|
-
isExpanded,
|
|
245
|
-
onChange = noop,
|
|
246
|
-
...props
|
|
247
|
-
}, ref) {
|
|
248
|
-
const [usedIsExpanded, setUsedIsExpanded] = useState3(isExpanded);
|
|
249
|
-
useEffect3(() => {
|
|
250
|
-
setUsedIsExpanded(isExpanded);
|
|
251
|
-
}, [isExpanded]);
|
|
252
|
-
return /* @__PURE__ */ jsx4(
|
|
253
|
-
Expandable,
|
|
254
|
-
{
|
|
255
|
-
...props,
|
|
256
|
-
ref,
|
|
257
|
-
isExpanded: usedIsExpanded,
|
|
258
|
-
onChange: (value) => {
|
|
259
|
-
onChange(value);
|
|
260
|
-
setUsedIsExpanded(value);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
);
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
// src/components/user-action/Menu.tsx
|
|
267
|
-
import { useEffect as useEffect6, useRef, useState as useState5 } from "react";
|
|
268
|
-
import clsx4 from "clsx";
|
|
269
|
-
|
|
270
|
-
// src/hooks/useOutsideClick.ts
|
|
271
|
-
import { useEffect as useEffect4 } from "react";
|
|
272
|
-
var useOutsideClick = (refs, handler) => {
|
|
273
|
-
useEffect4(() => {
|
|
274
|
-
const listener = (event) => {
|
|
275
|
-
if (event.target === null) return;
|
|
276
|
-
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
handler();
|
|
280
|
-
};
|
|
281
|
-
document.addEventListener("mousedown", listener);
|
|
282
|
-
document.addEventListener("touchstart", listener);
|
|
283
|
-
return () => {
|
|
284
|
-
document.removeEventListener("mousedown", listener);
|
|
285
|
-
document.removeEventListener("touchstart", listener);
|
|
286
|
-
};
|
|
287
|
-
}, [refs, handler]);
|
|
288
282
|
};
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
283
|
+
var IconButton = ({
|
|
284
|
+
children,
|
|
285
|
+
disabled = false,
|
|
286
|
+
color = "primary",
|
|
287
|
+
size = "medium",
|
|
288
|
+
className,
|
|
289
|
+
...restProps
|
|
290
|
+
}) => {
|
|
291
|
+
const colorClasses = {
|
|
292
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
293
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
294
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
295
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
296
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
297
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
298
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
299
|
+
transparent: "bg-transparent"
|
|
300
|
+
}[color];
|
|
301
|
+
return /* @__PURE__ */ jsx3(
|
|
302
|
+
"button",
|
|
303
|
+
{
|
|
304
|
+
disabled,
|
|
305
|
+
className: clsx2(
|
|
306
|
+
{
|
|
307
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
308
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
309
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
310
|
+
[clsx2(colorClasses, "hover:brightness-90")]: !disabled
|
|
311
|
+
},
|
|
312
|
+
ButtonUtil.iconPaddingMapping[size],
|
|
313
|
+
className
|
|
314
|
+
),
|
|
315
|
+
...restProps,
|
|
316
|
+
children
|
|
317
|
+
}
|
|
318
|
+
);
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
// src/components/layout-and-navigation/Chip.tsx
|
|
322
|
+
import clsx3 from "clsx";
|
|
323
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
324
|
+
var Chip = ({
|
|
325
|
+
children,
|
|
326
|
+
trailingIcon,
|
|
327
|
+
color = "default",
|
|
328
|
+
variant = "normal",
|
|
329
|
+
className = "",
|
|
330
|
+
...restProps
|
|
331
|
+
}) => {
|
|
332
|
+
const colorMapping = {
|
|
333
|
+
default: "text-tag-default-text bg-tag-default-background",
|
|
334
|
+
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
335
|
+
red: "text-tag-red-text bg-tag-red-background",
|
|
336
|
+
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
337
|
+
green: "text-tag-green-text bg-tag-green-background",
|
|
338
|
+
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
339
|
+
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
340
|
+
}[color];
|
|
341
|
+
const colorMappingIcon = {
|
|
342
|
+
default: "text-tag-default-icon",
|
|
343
|
+
dark: "text-tag-dark-icon",
|
|
344
|
+
red: "text-tag-red-icon",
|
|
345
|
+
yellow: "text-tag-yellow-icon",
|
|
346
|
+
green: "text-tag-green-icon",
|
|
347
|
+
blue: "text-tag-blue-icon",
|
|
348
|
+
pink: "text-tag-pink-icon"
|
|
349
|
+
}[color];
|
|
350
|
+
return /* @__PURE__ */ jsxs2(
|
|
351
|
+
"div",
|
|
352
|
+
{
|
|
353
|
+
...restProps,
|
|
354
|
+
className: clsx3(
|
|
355
|
+
`row w-fit px-2 py-1 font-semibold`,
|
|
356
|
+
colorMapping,
|
|
357
|
+
{
|
|
358
|
+
"rounded-md": variant === "normal",
|
|
359
|
+
"rounded-full": variant === "fullyRounded"
|
|
360
|
+
},
|
|
361
|
+
className
|
|
362
|
+
),
|
|
363
|
+
children: [
|
|
364
|
+
children,
|
|
365
|
+
trailingIcon && /* @__PURE__ */ jsx4("span", { className: colorMappingIcon, children: trailingIcon })
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
};
|
|
370
|
+
var ChipList = ({
|
|
371
|
+
list,
|
|
372
|
+
className = ""
|
|
373
|
+
}) => {
|
|
374
|
+
return /* @__PURE__ */ jsx4("div", { className: clsx3("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ jsx4(
|
|
375
|
+
Chip,
|
|
376
|
+
{
|
|
377
|
+
...value,
|
|
378
|
+
color: value.color ?? "default",
|
|
379
|
+
variant: value.variant ?? "normal",
|
|
380
|
+
children: value.children
|
|
381
|
+
},
|
|
382
|
+
index
|
|
383
|
+
)) });
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
// src/localization/defaults/form.ts
|
|
387
|
+
var formTranslation = {
|
|
388
|
+
en: {
|
|
389
|
+
add: "Add",
|
|
390
|
+
all: "All",
|
|
391
|
+
apply: "Apply",
|
|
392
|
+
back: "Back",
|
|
393
|
+
cancel: "Cancel",
|
|
394
|
+
change: "Change",
|
|
395
|
+
clear: "Clear",
|
|
396
|
+
click: "Click",
|
|
397
|
+
clickToCopy: "Click to Copy",
|
|
398
|
+
close: "Close",
|
|
399
|
+
confirm: "Confirm",
|
|
400
|
+
copy: "Copy",
|
|
401
|
+
copied: "Copied",
|
|
402
|
+
create: "Create",
|
|
403
|
+
decline: "Decline",
|
|
404
|
+
delete: "Delete",
|
|
405
|
+
discard: "Discard",
|
|
406
|
+
discardChanges: "Discard Changes",
|
|
407
|
+
done: "Done",
|
|
408
|
+
edit: "Edit",
|
|
409
|
+
enterText: "Enter text here",
|
|
410
|
+
error: "Error",
|
|
411
|
+
exit: "Exit",
|
|
412
|
+
fieldRequiredError: "This field is required.",
|
|
413
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
414
|
+
less: "Less",
|
|
415
|
+
loading: "Loading",
|
|
416
|
+
maxLengthError: "Maximum length exceeded.",
|
|
417
|
+
minLengthError: "Minimum length not met.",
|
|
418
|
+
more: "More",
|
|
419
|
+
next: "Next",
|
|
420
|
+
no: "No",
|
|
421
|
+
none: "None",
|
|
422
|
+
of: "of",
|
|
423
|
+
optional: "Optional",
|
|
424
|
+
pleaseWait: "Please wait...",
|
|
425
|
+
previous: "Previous",
|
|
426
|
+
remove: "Remove",
|
|
427
|
+
required: "Required",
|
|
428
|
+
reset: "Reset",
|
|
429
|
+
save: "Save",
|
|
430
|
+
saved: "Saved",
|
|
431
|
+
search: "Search",
|
|
432
|
+
select: "Select",
|
|
433
|
+
selectOption: "Select an option",
|
|
434
|
+
show: "Show",
|
|
435
|
+
showMore: "Show more",
|
|
436
|
+
showLess: "Show less",
|
|
437
|
+
submit: "Submit",
|
|
438
|
+
success: "Success",
|
|
439
|
+
update: "Update",
|
|
440
|
+
unsavedChanges: "Unsaved Changes",
|
|
441
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
442
|
+
yes: "Yes"
|
|
443
|
+
},
|
|
444
|
+
de: {
|
|
445
|
+
add: "Hinzuf\xFCgen",
|
|
446
|
+
all: "Alle",
|
|
447
|
+
apply: "Anwenden",
|
|
448
|
+
back: "Zur\xFCck",
|
|
449
|
+
cancel: "Abbrechen",
|
|
450
|
+
change: "\xC4ndern",
|
|
451
|
+
clear: "L\xF6schen",
|
|
452
|
+
click: "Klicken",
|
|
453
|
+
clickToCopy: "Zum kopieren klicken",
|
|
454
|
+
close: "Schlie\xDFen",
|
|
455
|
+
confirm: "Best\xE4tigen",
|
|
456
|
+
copy: "Kopieren",
|
|
457
|
+
copied: "Kopiert",
|
|
458
|
+
create: "Erstellen",
|
|
459
|
+
decline: "Ablehnen",
|
|
460
|
+
delete: "L\xF6schen",
|
|
461
|
+
discard: "Verwerfen",
|
|
462
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
463
|
+
done: "Fertig",
|
|
464
|
+
edit: "Bearbeiten",
|
|
465
|
+
enterText: "Text hier eingeben",
|
|
466
|
+
error: "Fehler",
|
|
467
|
+
exit: "Beenden",
|
|
468
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
469
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
470
|
+
less: "Weniger",
|
|
471
|
+
loading: "L\xE4dt",
|
|
472
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
473
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
474
|
+
more: "Mehr",
|
|
475
|
+
next: "Weiter",
|
|
476
|
+
no: "Nein",
|
|
477
|
+
none: "Nichts",
|
|
478
|
+
of: "von",
|
|
479
|
+
optional: "Optional",
|
|
480
|
+
pleaseWait: "Bitte warten...",
|
|
481
|
+
previous: "Vorherige",
|
|
482
|
+
remove: "Entfernen",
|
|
483
|
+
required: "Erforderlich",
|
|
484
|
+
reset: "Zur\xFCcksetzen",
|
|
485
|
+
save: "Speichern",
|
|
486
|
+
saved: "Gespeichert",
|
|
487
|
+
search: "Suche",
|
|
488
|
+
select: "Select",
|
|
489
|
+
selectOption: "Option ausw\xE4hlen",
|
|
490
|
+
show: "Anzeigen",
|
|
491
|
+
showMore: "Mehr anzeigen",
|
|
492
|
+
showLess: "Weniger anzeigen",
|
|
493
|
+
submit: "Abschicken",
|
|
494
|
+
success: "Erfolg",
|
|
495
|
+
update: "Update",
|
|
496
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
497
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
498
|
+
yes: "Ja"
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
// src/components/user-action/Menu.tsx
|
|
503
|
+
import { useEffect as useEffect4, useRef, useState as useState4 } from "react";
|
|
504
|
+
import clsx4 from "clsx";
|
|
505
|
+
|
|
506
|
+
// src/hooks/useOutsideClick.ts
|
|
507
|
+
import { useEffect as useEffect2 } from "react";
|
|
508
|
+
var useOutsideClick = (refs, handler) => {
|
|
509
|
+
useEffect2(() => {
|
|
510
|
+
const listener = (event) => {
|
|
511
|
+
if (event.target === null) return;
|
|
512
|
+
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
handler();
|
|
516
|
+
};
|
|
517
|
+
document.addEventListener("mousedown", listener);
|
|
518
|
+
document.addEventListener("touchstart", listener);
|
|
519
|
+
return () => {
|
|
520
|
+
document.removeEventListener("mousedown", listener);
|
|
521
|
+
document.removeEventListener("touchstart", listener);
|
|
522
|
+
};
|
|
523
|
+
}, [refs, handler]);
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
// src/hooks/useHoverState.ts
|
|
527
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
528
|
+
var defaultUseHoverStateProps = {
|
|
293
529
|
closingDelay: 200,
|
|
294
530
|
isDisabled: false
|
|
295
531
|
};
|
|
296
532
|
var useHoverState = (props = void 0) => {
|
|
297
533
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
298
|
-
const [isHovered, setIsHovered] =
|
|
299
|
-
const [timer, setTimer] =
|
|
534
|
+
const [isHovered, setIsHovered] = useState3(false);
|
|
535
|
+
const [timer, setTimer] = useState3();
|
|
300
536
|
const onMouseEnter = () => {
|
|
301
537
|
if (isDisabled) {
|
|
302
538
|
return;
|
|
@@ -312,14 +548,14 @@ var useHoverState = (props = void 0) => {
|
|
|
312
548
|
setIsHovered(false);
|
|
313
549
|
}, closingDelay));
|
|
314
550
|
};
|
|
315
|
-
|
|
551
|
+
useEffect3(() => {
|
|
316
552
|
if (timer) {
|
|
317
553
|
return () => {
|
|
318
554
|
clearTimeout(timer);
|
|
319
555
|
};
|
|
320
556
|
}
|
|
321
557
|
});
|
|
322
|
-
|
|
558
|
+
useEffect3(() => {
|
|
323
559
|
if (timer) {
|
|
324
560
|
clearTimeout(timer);
|
|
325
561
|
}
|
|
@@ -421,7 +657,7 @@ var Menu = ({
|
|
|
421
657
|
const triggerRef = useRef(null);
|
|
422
658
|
const menuRef = useRef(null);
|
|
423
659
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
424
|
-
const [isHidden, setIsHidden] =
|
|
660
|
+
const [isHidden, setIsHidden] = useState4(true);
|
|
425
661
|
const bag = {
|
|
426
662
|
isOpen,
|
|
427
663
|
close: () => setIsOpen(false),
|
|
@@ -432,7 +668,7 @@ var Menu = ({
|
|
|
432
668
|
triggerRef.current?.getBoundingClientRect(),
|
|
433
669
|
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
434
670
|
);
|
|
435
|
-
|
|
671
|
+
useEffect4(() => {
|
|
436
672
|
if (!isOpen) return;
|
|
437
673
|
const triggerEl = triggerRef.current;
|
|
438
674
|
if (!triggerEl) return;
|
|
@@ -449,7 +685,7 @@ var Menu = ({
|
|
|
449
685
|
window.removeEventListener("resize", close);
|
|
450
686
|
};
|
|
451
687
|
}, [isOpen, setIsOpen]);
|
|
452
|
-
|
|
688
|
+
useEffect4(() => {
|
|
453
689
|
if (isOpen) {
|
|
454
690
|
setIsHidden(false);
|
|
455
691
|
}
|
|
@@ -484,20 +720,124 @@ var Menu = ({
|
|
|
484
720
|
] });
|
|
485
721
|
};
|
|
486
722
|
|
|
487
|
-
// src/components/
|
|
488
|
-
import { forwardRef as forwardRef2,
|
|
723
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
724
|
+
import { forwardRef as forwardRef2, useCallback as useCallback2, useEffect as useEffect5, useState as useState5 } from "react";
|
|
725
|
+
import { ChevronDown } from "lucide-react";
|
|
489
726
|
import clsx5 from "clsx";
|
|
490
727
|
|
|
491
|
-
// src/
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
728
|
+
// src/util/noop.ts
|
|
729
|
+
var noop = () => void 0;
|
|
730
|
+
|
|
731
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
732
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
733
|
+
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
734
|
+
return /* @__PURE__ */ jsx6(
|
|
735
|
+
ChevronDown,
|
|
736
|
+
{
|
|
737
|
+
className: clsx5(
|
|
738
|
+
"min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
|
|
739
|
+
{ "rotate-180": isExpanded },
|
|
740
|
+
className
|
|
741
|
+
)
|
|
742
|
+
}
|
|
743
|
+
);
|
|
744
|
+
};
|
|
745
|
+
var Expandable = forwardRef2(function Expandable2({
|
|
746
|
+
children,
|
|
747
|
+
label,
|
|
748
|
+
icon,
|
|
749
|
+
isExpanded = false,
|
|
750
|
+
onChange = noop,
|
|
751
|
+
clickOnlyOnHeader = true,
|
|
752
|
+
disabled = false,
|
|
753
|
+
className,
|
|
754
|
+
headerClassName,
|
|
755
|
+
contentClassName,
|
|
756
|
+
contentExpandedClassName
|
|
757
|
+
}, ref) {
|
|
758
|
+
const defaultIcon = useCallback2((expanded) => /* @__PURE__ */ jsx6(ExpansionIcon, { isExpanded: expanded }), []);
|
|
759
|
+
icon ??= defaultIcon;
|
|
760
|
+
return /* @__PURE__ */ jsxs4(
|
|
761
|
+
"div",
|
|
762
|
+
{
|
|
763
|
+
ref,
|
|
764
|
+
className: clsx5("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
|
|
765
|
+
onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
766
|
+
children: [
|
|
767
|
+
/* @__PURE__ */ jsxs4(
|
|
768
|
+
"div",
|
|
769
|
+
{
|
|
770
|
+
className: clsx5(
|
|
771
|
+
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
|
|
772
|
+
{
|
|
773
|
+
"group-hover:brightness-97": !isExpanded,
|
|
774
|
+
"hover:brightness-97": isExpanded && !disabled,
|
|
775
|
+
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
776
|
+
},
|
|
777
|
+
headerClassName
|
|
778
|
+
),
|
|
779
|
+
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
780
|
+
children: [
|
|
781
|
+
label,
|
|
782
|
+
icon(isExpanded)
|
|
783
|
+
]
|
|
784
|
+
}
|
|
785
|
+
),
|
|
786
|
+
/* @__PURE__ */ jsx6(
|
|
787
|
+
"div",
|
|
788
|
+
{
|
|
789
|
+
className: clsx5(
|
|
790
|
+
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
791
|
+
{
|
|
792
|
+
[clsx5("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
|
|
793
|
+
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
794
|
+
},
|
|
795
|
+
contentClassName
|
|
796
|
+
),
|
|
797
|
+
children
|
|
798
|
+
}
|
|
799
|
+
)
|
|
800
|
+
]
|
|
801
|
+
}
|
|
802
|
+
);
|
|
803
|
+
});
|
|
804
|
+
var ExpandableUncontrolled = forwardRef2(function ExpandableUncontrolled2({
|
|
805
|
+
isExpanded,
|
|
806
|
+
onChange = noop,
|
|
807
|
+
...props
|
|
808
|
+
}, ref) {
|
|
809
|
+
const [usedIsExpanded, setUsedIsExpanded] = useState5(isExpanded);
|
|
810
|
+
useEffect5(() => {
|
|
811
|
+
setUsedIsExpanded(isExpanded);
|
|
812
|
+
}, [isExpanded]);
|
|
813
|
+
return /* @__PURE__ */ jsx6(
|
|
814
|
+
Expandable,
|
|
815
|
+
{
|
|
816
|
+
...props,
|
|
817
|
+
ref,
|
|
818
|
+
isExpanded: usedIsExpanded,
|
|
819
|
+
onChange: (value) => {
|
|
820
|
+
onChange(value);
|
|
821
|
+
setUsedIsExpanded(value);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
);
|
|
825
|
+
});
|
|
826
|
+
|
|
827
|
+
// src/components/user-action/Input.tsx
|
|
828
|
+
import { forwardRef as forwardRef3, useEffect as useEffect8, useImperativeHandle, useRef as useRef2, useState as useState7 } from "react";
|
|
829
|
+
import clsx6 from "clsx";
|
|
830
|
+
|
|
831
|
+
// src/hooks/useDelay.ts
|
|
832
|
+
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
833
|
+
var defaultOptions = {
|
|
834
|
+
delay: 3e3,
|
|
835
|
+
disabled: false
|
|
836
|
+
};
|
|
837
|
+
function useDelay(options) {
|
|
838
|
+
const [timer, setTimer] = useState6(void 0);
|
|
839
|
+
const { delay, disabled } = {
|
|
840
|
+
...defaultOptions,
|
|
501
841
|
...options
|
|
502
842
|
};
|
|
503
843
|
const clearTimer = () => {
|
|
@@ -514,12 +854,12 @@ function useDelay(options) {
|
|
|
514
854
|
setTimer(void 0);
|
|
515
855
|
}, delay));
|
|
516
856
|
};
|
|
517
|
-
|
|
857
|
+
useEffect6(() => {
|
|
518
858
|
return () => {
|
|
519
859
|
clearTimeout(timer);
|
|
520
860
|
};
|
|
521
861
|
}, [timer]);
|
|
522
|
-
|
|
862
|
+
useEffect6(() => {
|
|
523
863
|
if (disabled) {
|
|
524
864
|
clearTimeout(timer);
|
|
525
865
|
setTimer(void 0);
|
|
@@ -586,10 +926,10 @@ function useFocusManagement() {
|
|
|
586
926
|
}
|
|
587
927
|
|
|
588
928
|
// src/hooks/useFocusOnceVisible.ts
|
|
589
|
-
import React, { useEffect as
|
|
929
|
+
import React, { useEffect as useEffect7 } from "react";
|
|
590
930
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
591
931
|
const [hasUsedFocus, setHasUsedFocus] = React.useState(false);
|
|
592
|
-
|
|
932
|
+
useEffect7(() => {
|
|
593
933
|
if (disable || hasUsedFocus) {
|
|
594
934
|
return;
|
|
595
935
|
}
|
|
@@ -609,453 +949,131 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
609
949
|
};
|
|
610
950
|
|
|
611
951
|
// src/components/user-action/Input.tsx
|
|
612
|
-
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
613
|
-
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
614
|
-
return clsx5(
|
|
615
|
-
"px-2 py-1.5 rounded-md border-2",
|
|
616
|
-
{
|
|
617
|
-
"bg-input-background text-input-text hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
618
|
-
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
619
|
-
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
620
|
-
}
|
|
621
|
-
);
|
|
622
|
-
};
|
|
623
|
-
var defaultEditCompleteOptions = {
|
|
624
|
-
onBlur: true,
|
|
625
|
-
afterDelay: true,
|
|
626
|
-
delay: 2500
|
|
627
|
-
};
|
|
628
|
-
var Input = forwardRef2(function Input2({
|
|
629
|
-
id,
|
|
630
|
-
type = "text",
|
|
631
|
-
value,
|
|
632
|
-
label,
|
|
633
|
-
onChange = noop,
|
|
634
|
-
onChangeText = noop,
|
|
635
|
-
onEditCompleted,
|
|
636
|
-
className = "",
|
|
637
|
-
allowEnterComplete = true,
|
|
638
|
-
expanded = true,
|
|
639
|
-
autoFocus = false,
|
|
640
|
-
onBlur,
|
|
641
|
-
editCompleteOptions,
|
|
642
|
-
containerClassName,
|
|
643
|
-
disabled,
|
|
644
|
-
...restProps
|
|
645
|
-
}, forwardedRef) {
|
|
646
|
-
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
647
|
-
const {
|
|
648
|
-
restartTimer,
|
|
649
|
-
clearTimer
|
|
650
|
-
} = useDelay({ delay, disabled: !afterDelay });
|
|
651
|
-
const innerRef = useRef2(null);
|
|
652
|
-
const { focusNext } = useFocusManagement();
|
|
653
|
-
useFocusOnceVisible(innerRef, !autoFocus);
|
|
654
|
-
useImperativeHandle(forwardedRef, () => innerRef.current);
|
|
655
|
-
const handleKeyDown = (e) => {
|
|
656
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
657
|
-
e.preventDefault();
|
|
658
|
-
innerRef.current?.blur();
|
|
659
|
-
focusNext();
|
|
660
|
-
}
|
|
661
|
-
};
|
|
662
|
-
return /* @__PURE__ */ jsxs4("div", { className: clsx5({ "w-full": expanded }, containerClassName), children: [
|
|
663
|
-
label && /* @__PURE__ */ jsx6(Label, { ...label, htmlFor: id, className: clsx5("mb-1", label.className) }),
|
|
664
|
-
/* @__PURE__ */ jsx6(
|
|
665
|
-
"input",
|
|
666
|
-
{
|
|
667
|
-
...restProps,
|
|
668
|
-
ref: innerRef,
|
|
669
|
-
value,
|
|
670
|
-
id,
|
|
671
|
-
type,
|
|
672
|
-
disabled,
|
|
673
|
-
className: clsx5(getInputClassName({ disabled }), className),
|
|
674
|
-
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
675
|
-
onBlur: (event) => {
|
|
676
|
-
onBlur?.(event);
|
|
677
|
-
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
678
|
-
onEditCompleted(event.target.value);
|
|
679
|
-
clearTimer();
|
|
680
|
-
}
|
|
681
|
-
},
|
|
682
|
-
onChange: (e) => {
|
|
683
|
-
const value2 = e.target.value;
|
|
684
|
-
if (onEditCompleted) {
|
|
685
|
-
restartTimer(() => {
|
|
686
|
-
if (innerRef.current) {
|
|
687
|
-
innerRef.current.blur();
|
|
688
|
-
if (!allowEditCompleteOnBlur) {
|
|
689
|
-
onEditCompleted(value2);
|
|
690
|
-
}
|
|
691
|
-
} else {
|
|
692
|
-
onEditCompleted(value2);
|
|
693
|
-
}
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
onChange(e);
|
|
697
|
-
onChangeText(value2);
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
)
|
|
701
|
-
] });
|
|
702
|
-
});
|
|
703
|
-
var FormInput = forwardRef2(function FormInput2({
|
|
704
|
-
id,
|
|
705
|
-
labelText,
|
|
706
|
-
errorText,
|
|
707
|
-
className,
|
|
708
|
-
labelClassName,
|
|
709
|
-
errorClassName,
|
|
710
|
-
containerClassName,
|
|
711
|
-
required,
|
|
712
|
-
disabled,
|
|
713
|
-
...restProps
|
|
714
|
-
}, ref) {
|
|
715
|
-
const input = /* @__PURE__ */ jsx6(
|
|
716
|
-
"input",
|
|
717
|
-
{
|
|
718
|
-
...restProps,
|
|
719
|
-
ref,
|
|
720
|
-
id,
|
|
721
|
-
disabled,
|
|
722
|
-
className: clsx5(
|
|
723
|
-
getInputClassName({ disabled, hasError: !!errorText }),
|
|
724
|
-
className
|
|
725
|
-
)
|
|
726
|
-
}
|
|
727
|
-
);
|
|
728
|
-
return /* @__PURE__ */ jsxs4("div", { className: clsx5("flex flex-col gap-y-1", containerClassName), children: [
|
|
729
|
-
labelText && /* @__PURE__ */ jsxs4("label", { htmlFor: id, className: clsx5("textstyle-label-md", labelClassName), children: [
|
|
730
|
-
labelText,
|
|
731
|
-
required && /* @__PURE__ */ jsx6("span", { className: "text-primary font-bold", children: "*" })
|
|
732
|
-
] }),
|
|
733
|
-
input,
|
|
734
|
-
errorText && /* @__PURE__ */ jsx6("label", { htmlFor: id, className: clsx5("text-negative", errorClassName), children: errorText })
|
|
735
|
-
] });
|
|
736
|
-
});
|
|
737
|
-
|
|
738
|
-
// src/localization/defaults/form.ts
|
|
739
|
-
var formTranslation = {
|
|
740
|
-
en: {
|
|
741
|
-
add: "Add",
|
|
742
|
-
all: "All",
|
|
743
|
-
apply: "Apply",
|
|
744
|
-
back: "Back",
|
|
745
|
-
cancel: "Cancel",
|
|
746
|
-
change: "Change",
|
|
747
|
-
clear: "Clear",
|
|
748
|
-
click: "Click",
|
|
749
|
-
clickToCopy: "Click to Copy",
|
|
750
|
-
close: "Close",
|
|
751
|
-
confirm: "Confirm",
|
|
752
|
-
copy: "Copy",
|
|
753
|
-
copied: "Copied",
|
|
754
|
-
create: "Create",
|
|
755
|
-
decline: "Decline",
|
|
756
|
-
delete: "Delete",
|
|
757
|
-
discard: "Discard",
|
|
758
|
-
discardChanges: "Discard Changes",
|
|
759
|
-
done: "Done",
|
|
760
|
-
edit: "Edit",
|
|
761
|
-
enterText: "Enter text here",
|
|
762
|
-
error: "Error",
|
|
763
|
-
exit: "Exit",
|
|
764
|
-
fieldRequiredError: "This field is required.",
|
|
765
|
-
invalidEmailError: "Please enter a valid email address.",
|
|
766
|
-
less: "Less",
|
|
767
|
-
loading: "Loading",
|
|
768
|
-
maxLengthError: "Maximum length exceeded.",
|
|
769
|
-
minLengthError: "Minimum length not met.",
|
|
770
|
-
more: "More",
|
|
771
|
-
next: "Next",
|
|
772
|
-
no: "No",
|
|
773
|
-
none: "None",
|
|
774
|
-
of: "of",
|
|
775
|
-
optional: "Optional",
|
|
776
|
-
pleaseWait: "Please wait...",
|
|
777
|
-
previous: "Previous",
|
|
778
|
-
remove: "Remove",
|
|
779
|
-
required: "Required",
|
|
780
|
-
reset: "Reset",
|
|
781
|
-
save: "Save",
|
|
782
|
-
saved: "Saved",
|
|
783
|
-
search: "Search",
|
|
784
|
-
select: "Select",
|
|
785
|
-
selectOption: "Select an option",
|
|
786
|
-
show: "Show",
|
|
787
|
-
showMore: "Show more",
|
|
788
|
-
showLess: "Show less",
|
|
789
|
-
submit: "Submit",
|
|
790
|
-
success: "Success",
|
|
791
|
-
update: "Update",
|
|
792
|
-
unsavedChanges: "Unsaved Changes",
|
|
793
|
-
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
794
|
-
yes: "Yes"
|
|
795
|
-
},
|
|
796
|
-
de: {
|
|
797
|
-
add: "Hinzuf\xFCgen",
|
|
798
|
-
all: "Alle",
|
|
799
|
-
apply: "Anwenden",
|
|
800
|
-
back: "Zur\xFCck",
|
|
801
|
-
cancel: "Abbrechen",
|
|
802
|
-
change: "\xC4ndern",
|
|
803
|
-
clear: "L\xF6schen",
|
|
804
|
-
click: "Klicken",
|
|
805
|
-
clickToCopy: "Zum kopieren klicken",
|
|
806
|
-
close: "Schlie\xDFen",
|
|
807
|
-
confirm: "Best\xE4tigen",
|
|
808
|
-
copy: "Kopieren",
|
|
809
|
-
copied: "Kopiert",
|
|
810
|
-
create: "Erstellen",
|
|
811
|
-
decline: "Ablehnen",
|
|
812
|
-
delete: "L\xF6schen",
|
|
813
|
-
discard: "Verwerfen",
|
|
814
|
-
discardChanges: "\xC4nderungen Verwerfen",
|
|
815
|
-
done: "Fertig",
|
|
816
|
-
edit: "Bearbeiten",
|
|
817
|
-
enterText: "Text hier eingeben",
|
|
818
|
-
error: "Fehler",
|
|
819
|
-
exit: "Beenden",
|
|
820
|
-
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
821
|
-
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
822
|
-
less: "Weniger",
|
|
823
|
-
loading: "L\xE4dt",
|
|
824
|
-
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
825
|
-
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
826
|
-
more: "Mehr",
|
|
827
|
-
next: "Weiter",
|
|
828
|
-
no: "Nein",
|
|
829
|
-
none: "Nichts",
|
|
830
|
-
of: "von",
|
|
831
|
-
optional: "Optional",
|
|
832
|
-
pleaseWait: "Bitte warten...",
|
|
833
|
-
previous: "Vorherige",
|
|
834
|
-
remove: "Entfernen",
|
|
835
|
-
required: "Erforderlich",
|
|
836
|
-
reset: "Zur\xFCcksetzen",
|
|
837
|
-
save: "Speichern",
|
|
838
|
-
saved: "Gespeichert",
|
|
839
|
-
search: "Suche",
|
|
840
|
-
select: "Select",
|
|
841
|
-
selectOption: "Option ausw\xE4hlen",
|
|
842
|
-
show: "Anzeigen",
|
|
843
|
-
showMore: "Mehr anzeigen",
|
|
844
|
-
showLess: "Weniger anzeigen",
|
|
845
|
-
submit: "Abschicken",
|
|
846
|
-
success: "Erfolg",
|
|
847
|
-
update: "Update",
|
|
848
|
-
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
849
|
-
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
850
|
-
yes: "Ja"
|
|
851
|
-
}
|
|
852
|
-
};
|
|
853
|
-
|
|
854
|
-
// src/components/user-action/Button.tsx
|
|
855
|
-
import { forwardRef as forwardRef3 } from "react";
|
|
856
|
-
import clsx6 from "clsx";
|
|
857
952
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
858
|
-
var
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
};
|
|
866
|
-
var paddingMapping = {
|
|
867
|
-
small: "btn-sm",
|
|
868
|
-
medium: "btn-md",
|
|
869
|
-
large: "btn-lg"
|
|
870
|
-
};
|
|
871
|
-
var iconPaddingMapping = {
|
|
872
|
-
tiny: "icon-btn-xs",
|
|
873
|
-
small: "icon-btn-sm",
|
|
874
|
-
medium: "icon-btn-md",
|
|
875
|
-
large: "icon-btn-lg"
|
|
876
|
-
};
|
|
877
|
-
var ButtonUtil = {
|
|
878
|
-
paddingMapping,
|
|
879
|
-
iconPaddingMapping
|
|
880
|
-
};
|
|
881
|
-
var SolidButton = forwardRef3(function SolidButton2({
|
|
882
|
-
children,
|
|
883
|
-
disabled = false,
|
|
884
|
-
color = "primary",
|
|
885
|
-
size = "medium",
|
|
886
|
-
startIcon,
|
|
887
|
-
endIcon,
|
|
888
|
-
onClick,
|
|
889
|
-
className,
|
|
890
|
-
...restProps
|
|
891
|
-
}, ref) {
|
|
892
|
-
const colorClasses = {
|
|
893
|
-
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
894
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
895
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
896
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
897
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
898
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
899
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
900
|
-
}[color];
|
|
901
|
-
const iconColorClasses = {
|
|
902
|
-
primary: "text-button-solid-primary-icon",
|
|
903
|
-
secondary: "text-button-solid-secondary-icon",
|
|
904
|
-
tertiary: "text-button-solid-tertiary-icon",
|
|
905
|
-
positive: "text-button-solid-positive-icon",
|
|
906
|
-
warning: "text-button-solid-warning-icon",
|
|
907
|
-
negative: "text-button-solid-negative-icon",
|
|
908
|
-
neutral: "text-button-solid-neutral-icon"
|
|
909
|
-
}[color];
|
|
910
|
-
return /* @__PURE__ */ jsxs5(
|
|
911
|
-
"button",
|
|
912
|
-
{
|
|
913
|
-
ref,
|
|
914
|
-
onClick,
|
|
915
|
-
disabled,
|
|
916
|
-
className: clsx6(
|
|
917
|
-
"font-semibold",
|
|
918
|
-
{
|
|
919
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
920
|
-
[clsx6(colorClasses, "hover:brightness-90")]: !disabled
|
|
921
|
-
},
|
|
922
|
-
ButtonUtil.paddingMapping[size],
|
|
923
|
-
className
|
|
924
|
-
),
|
|
925
|
-
...restProps,
|
|
926
|
-
children: [
|
|
927
|
-
startIcon && /* @__PURE__ */ jsx7(
|
|
928
|
-
"span",
|
|
929
|
-
{
|
|
930
|
-
className: clsx6({
|
|
931
|
-
[iconColorClasses]: !disabled,
|
|
932
|
-
[`text-disabled-icon`]: disabled
|
|
933
|
-
}),
|
|
934
|
-
children: startIcon
|
|
935
|
-
}
|
|
936
|
-
),
|
|
937
|
-
children,
|
|
938
|
-
endIcon && /* @__PURE__ */ jsx7(
|
|
939
|
-
"span",
|
|
940
|
-
{
|
|
941
|
-
className: clsx6({
|
|
942
|
-
[iconColorClasses]: !disabled,
|
|
943
|
-
[`text-disabled-icon`]: disabled
|
|
944
|
-
}),
|
|
945
|
-
children: endIcon
|
|
946
|
-
}
|
|
947
|
-
)
|
|
948
|
-
]
|
|
949
|
-
}
|
|
950
|
-
);
|
|
951
|
-
});
|
|
952
|
-
var TextButton = ({
|
|
953
|
-
children,
|
|
954
|
-
disabled = false,
|
|
955
|
-
color = "neutral",
|
|
956
|
-
size = "medium",
|
|
957
|
-
startIcon,
|
|
958
|
-
endIcon,
|
|
959
|
-
onClick,
|
|
960
|
-
coloredHoverBackground = true,
|
|
961
|
-
className,
|
|
962
|
-
...restProps
|
|
963
|
-
}) => {
|
|
964
|
-
const colorClasses = {
|
|
965
|
-
primary: "bg-transparent text-button-text-primary-text",
|
|
966
|
-
negative: "bg-transparent text-button-text-negative-text",
|
|
967
|
-
neutral: "bg-transparent text-button-text-neutral-text"
|
|
968
|
-
}[color];
|
|
969
|
-
const backgroundColor = {
|
|
970
|
-
primary: "hover:bg-button-text-primary-text/20",
|
|
971
|
-
negative: "hover:bg-button-text-negative-text/20",
|
|
972
|
-
neutral: "hover:bg-button-text-neutral-text/20"
|
|
973
|
-
}[color];
|
|
974
|
-
const iconColorClasses = {
|
|
975
|
-
primary: "text-button-text-primary-icon",
|
|
976
|
-
negative: "text-button-text-negative-icon",
|
|
977
|
-
neutral: "text-button-text-neutral-icon"
|
|
978
|
-
}[color];
|
|
979
|
-
return /* @__PURE__ */ jsxs5(
|
|
980
|
-
"button",
|
|
981
|
-
{
|
|
982
|
-
onClick,
|
|
983
|
-
disabled,
|
|
984
|
-
className: clsx6(
|
|
985
|
-
"font-semibold",
|
|
986
|
-
{
|
|
987
|
-
"text-disabled-text cursor-not-allowed": disabled,
|
|
988
|
-
[colorClasses]: !disabled,
|
|
989
|
-
[backgroundColor]: !disabled && coloredHoverBackground,
|
|
990
|
-
"hover:bg-button-text-hover-background": !disabled && !coloredHoverBackground
|
|
991
|
-
},
|
|
992
|
-
ButtonUtil.paddingMapping[size],
|
|
993
|
-
className
|
|
994
|
-
),
|
|
995
|
-
...restProps,
|
|
996
|
-
children: [
|
|
997
|
-
startIcon && /* @__PURE__ */ jsx7(
|
|
998
|
-
"span",
|
|
999
|
-
{
|
|
1000
|
-
className: clsx6({
|
|
1001
|
-
[iconColorClasses]: !disabled,
|
|
1002
|
-
[`text-disabled-icon`]: disabled
|
|
1003
|
-
}),
|
|
1004
|
-
children: startIcon
|
|
1005
|
-
}
|
|
1006
|
-
),
|
|
1007
|
-
children,
|
|
1008
|
-
endIcon && /* @__PURE__ */ jsx7(
|
|
1009
|
-
"span",
|
|
1010
|
-
{
|
|
1011
|
-
className: clsx6({
|
|
1012
|
-
[iconColorClasses]: !disabled,
|
|
1013
|
-
[`text-disabled-icon`]: disabled
|
|
1014
|
-
}),
|
|
1015
|
-
children: endIcon
|
|
1016
|
-
}
|
|
1017
|
-
)
|
|
1018
|
-
]
|
|
953
|
+
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
954
|
+
return clsx6(
|
|
955
|
+
"px-2 py-1.5 rounded-md border-2",
|
|
956
|
+
{
|
|
957
|
+
"bg-input-background text-input-text hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
958
|
+
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
959
|
+
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
1019
960
|
}
|
|
1020
961
|
);
|
|
1021
962
|
};
|
|
1022
|
-
var
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
963
|
+
var defaultEditCompleteOptions = {
|
|
964
|
+
onBlur: true,
|
|
965
|
+
afterDelay: true,
|
|
966
|
+
delay: 2500
|
|
967
|
+
};
|
|
968
|
+
var Input = forwardRef3(function Input2({
|
|
969
|
+
id,
|
|
970
|
+
type = "text",
|
|
971
|
+
value,
|
|
972
|
+
label,
|
|
973
|
+
onChange = noop,
|
|
974
|
+
onChangeText = noop,
|
|
975
|
+
onEditCompleted,
|
|
976
|
+
className = "",
|
|
977
|
+
allowEnterComplete = true,
|
|
978
|
+
expanded = true,
|
|
979
|
+
autoFocus = false,
|
|
980
|
+
onBlur,
|
|
981
|
+
editCompleteOptions,
|
|
982
|
+
containerClassName,
|
|
983
|
+
disabled,
|
|
984
|
+
...restProps
|
|
985
|
+
}, forwardedRef) {
|
|
986
|
+
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
987
|
+
const {
|
|
988
|
+
restartTimer,
|
|
989
|
+
clearTimer
|
|
990
|
+
} = useDelay({ delay, disabled: !afterDelay });
|
|
991
|
+
const innerRef = useRef2(null);
|
|
992
|
+
const { focusNext } = useFocusManagement();
|
|
993
|
+
useFocusOnceVisible(innerRef, !autoFocus);
|
|
994
|
+
useImperativeHandle(forwardedRef, () => innerRef.current);
|
|
995
|
+
const handleKeyDown = (e) => {
|
|
996
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
997
|
+
e.preventDefault();
|
|
998
|
+
innerRef.current?.blur();
|
|
999
|
+
focusNext();
|
|
1000
|
+
}
|
|
1001
|
+
};
|
|
1002
|
+
return /* @__PURE__ */ jsxs5("div", { className: clsx6({ "w-full": expanded }, containerClassName), children: [
|
|
1003
|
+
label && /* @__PURE__ */ jsx7(Label, { ...label, htmlFor: id, className: clsx6("mb-1", label.className) }),
|
|
1004
|
+
/* @__PURE__ */ jsx7(
|
|
1005
|
+
"input",
|
|
1006
|
+
{
|
|
1007
|
+
...restProps,
|
|
1008
|
+
ref: innerRef,
|
|
1009
|
+
value,
|
|
1010
|
+
id,
|
|
1011
|
+
type,
|
|
1012
|
+
disabled,
|
|
1013
|
+
className: clsx6(getInputClassName({ disabled }), className),
|
|
1014
|
+
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
1015
|
+
onBlur: (event) => {
|
|
1016
|
+
onBlur?.(event);
|
|
1017
|
+
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
1018
|
+
onEditCompleted(event.target.value);
|
|
1019
|
+
clearTimer();
|
|
1020
|
+
}
|
|
1021
|
+
},
|
|
1022
|
+
onChange: (e) => {
|
|
1023
|
+
const value2 = e.target.value;
|
|
1024
|
+
if (onEditCompleted) {
|
|
1025
|
+
restartTimer(() => {
|
|
1026
|
+
if (innerRef.current) {
|
|
1027
|
+
innerRef.current.blur();
|
|
1028
|
+
if (!allowEditCompleteOnBlur) {
|
|
1029
|
+
onEditCompleted(value2);
|
|
1030
|
+
}
|
|
1031
|
+
} else {
|
|
1032
|
+
onEditCompleted(value2);
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
onChange(e);
|
|
1037
|
+
onChangeText(value2);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
)
|
|
1041
|
+
] });
|
|
1042
|
+
});
|
|
1043
|
+
var FormInput = forwardRef3(function FormInput2({
|
|
1044
|
+
id,
|
|
1045
|
+
labelText,
|
|
1046
|
+
errorText,
|
|
1027
1047
|
className,
|
|
1048
|
+
labelClassName,
|
|
1049
|
+
errorClassName,
|
|
1050
|
+
containerClassName,
|
|
1051
|
+
required,
|
|
1052
|
+
disabled,
|
|
1028
1053
|
...restProps
|
|
1029
|
-
})
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
1033
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
1034
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
1035
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
1036
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
1037
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
1038
|
-
transparent: "bg-transparent"
|
|
1039
|
-
}[color];
|
|
1040
|
-
return /* @__PURE__ */ jsx7(
|
|
1041
|
-
"button",
|
|
1054
|
+
}, ref) {
|
|
1055
|
+
const input = /* @__PURE__ */ jsx7(
|
|
1056
|
+
"input",
|
|
1042
1057
|
{
|
|
1058
|
+
...restProps,
|
|
1059
|
+
ref,
|
|
1060
|
+
id,
|
|
1043
1061
|
disabled,
|
|
1044
1062
|
className: clsx6(
|
|
1045
|
-
{
|
|
1046
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
1047
|
-
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
1048
|
-
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
1049
|
-
[clsx6(colorClasses, "hover:brightness-90")]: !disabled
|
|
1050
|
-
},
|
|
1051
|
-
ButtonUtil.iconPaddingMapping[size],
|
|
1063
|
+
getInputClassName({ disabled, hasError: !!errorText }),
|
|
1052
1064
|
className
|
|
1053
|
-
)
|
|
1054
|
-
...restProps,
|
|
1055
|
-
children
|
|
1065
|
+
)
|
|
1056
1066
|
}
|
|
1057
1067
|
);
|
|
1058
|
-
|
|
1068
|
+
return /* @__PURE__ */ jsxs5("div", { className: clsx6("flex flex-col gap-y-1", containerClassName), children: [
|
|
1069
|
+
labelText && /* @__PURE__ */ jsxs5("label", { htmlFor: id, className: clsx6("textstyle-label-md", labelClassName), children: [
|
|
1070
|
+
labelText,
|
|
1071
|
+
required && /* @__PURE__ */ jsx7("span", { className: "text-primary font-bold", children: "*" })
|
|
1072
|
+
] }),
|
|
1073
|
+
input,
|
|
1074
|
+
errorText && /* @__PURE__ */ jsx7("label", { htmlFor: id, className: clsx6("text-negative", errorClassName), children: errorText })
|
|
1075
|
+
] });
|
|
1076
|
+
});
|
|
1059
1077
|
|
|
1060
1078
|
// src/components/user-action/SearchBar.tsx
|
|
1061
1079
|
import { Search } from "lucide-react";
|
|
@@ -1082,7 +1100,7 @@ var SearchBar = ({
|
|
|
1082
1100
|
};
|
|
1083
1101
|
|
|
1084
1102
|
// src/hooks/useSearch.ts
|
|
1085
|
-
import { useCallback as useCallback4, useEffect as
|
|
1103
|
+
import { useCallback as useCallback4, useEffect as useEffect9, useMemo, useState as useState8 } from "react";
|
|
1086
1104
|
|
|
1087
1105
|
// src/util/simpleSearch.ts
|
|
1088
1106
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -1116,7 +1134,7 @@ var useSearch = ({
|
|
|
1116
1134
|
}
|
|
1117
1135
|
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
1118
1136
|
}, [searchTags, list, search, searchMapping]);
|
|
1119
|
-
|
|
1137
|
+
useEffect9(() => {
|
|
1120
1138
|
if (isSearchInstant) {
|
|
1121
1139
|
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
1122
1140
|
}
|
|
@@ -1149,96 +1167,12 @@ var useSearch = ({
|
|
|
1149
1167
|
};
|
|
1150
1168
|
};
|
|
1151
1169
|
|
|
1152
|
-
// src/components/user-action/Select.tsx
|
|
1153
|
-
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1154
|
-
var SelectTile = ({
|
|
1155
|
-
className,
|
|
1156
|
-
disabledClassName,
|
|
1157
|
-
title,
|
|
1158
|
-
...restProps
|
|
1159
|
-
}) => {
|
|
1160
|
-
return /* @__PURE__ */ jsx9(
|
|
1161
|
-
Tile,
|
|
1162
|
-
{
|
|
1163
|
-
...restProps,
|
|
1164
|
-
className: clsx8("px-2 py-1 rounded-md", className),
|
|
1165
|
-
disabledClassName: disabledClassName ?? "text-disabled-text cursor-not-allowed",
|
|
1166
|
-
title: { ...title, className: title.className ?? "font-semibold" }
|
|
1167
|
-
}
|
|
1168
|
-
);
|
|
1169
|
-
};
|
|
1170
|
-
|
|
1171
|
-
// src/components/layout-and-navigation/Chip.tsx
|
|
1172
|
-
import clsx9 from "clsx";
|
|
1173
|
-
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1174
|
-
var Chip = ({
|
|
1175
|
-
children,
|
|
1176
|
-
trailingIcon,
|
|
1177
|
-
color = "default",
|
|
1178
|
-
variant = "normal",
|
|
1179
|
-
className = "",
|
|
1180
|
-
...restProps
|
|
1181
|
-
}) => {
|
|
1182
|
-
const colorMapping = {
|
|
1183
|
-
default: "text-tag-default-text bg-tag-default-background",
|
|
1184
|
-
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
1185
|
-
red: "text-tag-red-text bg-tag-red-background",
|
|
1186
|
-
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
1187
|
-
green: "text-tag-green-text bg-tag-green-background",
|
|
1188
|
-
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
1189
|
-
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
1190
|
-
}[color];
|
|
1191
|
-
const colorMappingIcon = {
|
|
1192
|
-
default: "text-tag-default-icon",
|
|
1193
|
-
dark: "text-tag-dark-icon",
|
|
1194
|
-
red: "text-tag-red-icon",
|
|
1195
|
-
yellow: "text-tag-yellow-icon",
|
|
1196
|
-
green: "text-tag-green-icon",
|
|
1197
|
-
blue: "text-tag-blue-icon",
|
|
1198
|
-
pink: "text-tag-pink-icon"
|
|
1199
|
-
}[color];
|
|
1200
|
-
return /* @__PURE__ */ jsxs8(
|
|
1201
|
-
"div",
|
|
1202
|
-
{
|
|
1203
|
-
...restProps,
|
|
1204
|
-
className: clsx9(
|
|
1205
|
-
`row w-fit px-2 py-1`,
|
|
1206
|
-
colorMapping,
|
|
1207
|
-
{
|
|
1208
|
-
"rounded-md": variant === "normal",
|
|
1209
|
-
"rounded-full": variant === "fullyRounded"
|
|
1210
|
-
},
|
|
1211
|
-
className
|
|
1212
|
-
),
|
|
1213
|
-
children: [
|
|
1214
|
-
children,
|
|
1215
|
-
trailingIcon && /* @__PURE__ */ jsx10("span", { className: colorMappingIcon, children: trailingIcon })
|
|
1216
|
-
]
|
|
1217
|
-
}
|
|
1218
|
-
);
|
|
1219
|
-
};
|
|
1220
|
-
var ChipList = ({
|
|
1221
|
-
list,
|
|
1222
|
-
className = ""
|
|
1223
|
-
}) => {
|
|
1224
|
-
return /* @__PURE__ */ jsx10("div", { className: clsx9("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ jsx10(
|
|
1225
|
-
Chip,
|
|
1226
|
-
{
|
|
1227
|
-
...value,
|
|
1228
|
-
color: value.color ?? "dark",
|
|
1229
|
-
variant: value.variant ?? "normal",
|
|
1230
|
-
children: value.children
|
|
1231
|
-
},
|
|
1232
|
-
index
|
|
1233
|
-
)) });
|
|
1234
|
-
};
|
|
1235
|
-
|
|
1236
1170
|
// src/components/user-action/Checkbox.tsx
|
|
1237
|
-
import { useState as
|
|
1171
|
+
import { useState as useState9 } from "react";
|
|
1238
1172
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
1239
|
-
import { Check
|
|
1240
|
-
import
|
|
1241
|
-
import { jsx as
|
|
1173
|
+
import { Check, Minus } from "lucide-react";
|
|
1174
|
+
import clsx8 from "clsx";
|
|
1175
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1242
1176
|
var checkboxSizeMapping = {
|
|
1243
1177
|
small: "size-5",
|
|
1244
1178
|
medium: "size-6",
|
|
@@ -1274,33 +1208,92 @@ var Checkbox = ({
|
|
|
1274
1208
|
const newValue = checked === "indeterminate" ? false : !checked;
|
|
1275
1209
|
propagateChange(newValue);
|
|
1276
1210
|
};
|
|
1277
|
-
return /* @__PURE__ */
|
|
1278
|
-
/* @__PURE__ */
|
|
1211
|
+
return /* @__PURE__ */ jsxs7("div", { className: clsx8("group flex-row-2 items-center cursor-pointer", containerClassName), onClick: changeValue, children: [
|
|
1212
|
+
/* @__PURE__ */ jsx9(
|
|
1279
1213
|
CheckboxPrimitive.Root,
|
|
1280
1214
|
{
|
|
1281
1215
|
onCheckedChange: propagateChange,
|
|
1282
1216
|
checked,
|
|
1283
1217
|
disabled,
|
|
1284
1218
|
id,
|
|
1285
|
-
className:
|
|
1219
|
+
className: clsx8(usedSizeClass, `items-center border-2 rounded outline-none `, {
|
|
1286
1220
|
"text-disabled-text border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
|
|
1287
1221
|
"focus:border-primary group-hover:border-primary ": !disabled,
|
|
1288
1222
|
"bg-input-background": !disabled && !checked,
|
|
1289
1223
|
"bg-primary/30 border-primary text-primary": !disabled && checked === true || checked === "indeterminate"
|
|
1290
1224
|
}, className),
|
|
1291
|
-
children: /* @__PURE__ */
|
|
1292
|
-
checked === true && /* @__PURE__ */
|
|
1293
|
-
checked === "indeterminate" && /* @__PURE__ */
|
|
1225
|
+
children: /* @__PURE__ */ jsxs7(CheckboxPrimitive.Indicator, { children: [
|
|
1226
|
+
checked === true && /* @__PURE__ */ jsx9(Check, { className: innerIconSize }),
|
|
1227
|
+
checked === "indeterminate" && /* @__PURE__ */ jsx9(Minus, { className: innerIconSize })
|
|
1294
1228
|
] })
|
|
1295
1229
|
}
|
|
1296
1230
|
),
|
|
1297
|
-
label && /* @__PURE__ */
|
|
1231
|
+
label && /* @__PURE__ */ jsx9(Label, { ...label, className: clsx8(label.className), htmlFor: id })
|
|
1298
1232
|
] });
|
|
1299
1233
|
};
|
|
1300
1234
|
|
|
1301
1235
|
// src/components/user-action/MultiSelect.tsx
|
|
1302
1236
|
import { Plus } from "lucide-react";
|
|
1303
|
-
|
|
1237
|
+
|
|
1238
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
1239
|
+
import clsx9 from "clsx";
|
|
1240
|
+
import { Check as Check2 } from "lucide-react";
|
|
1241
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1242
|
+
var Tile = ({
|
|
1243
|
+
title,
|
|
1244
|
+
titleClassName,
|
|
1245
|
+
description,
|
|
1246
|
+
descriptionClassName,
|
|
1247
|
+
onClick,
|
|
1248
|
+
isSelected = false,
|
|
1249
|
+
disabled = false,
|
|
1250
|
+
prefix,
|
|
1251
|
+
suffix,
|
|
1252
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
1253
|
+
selectedClassName = "bg-primary/20",
|
|
1254
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
1255
|
+
className
|
|
1256
|
+
}) => {
|
|
1257
|
+
return /* @__PURE__ */ jsxs8(
|
|
1258
|
+
"div",
|
|
1259
|
+
{
|
|
1260
|
+
className: clsx9(
|
|
1261
|
+
"flex-row-2 w-full items-center",
|
|
1262
|
+
{
|
|
1263
|
+
[normalClassName]: onClick && !disabled,
|
|
1264
|
+
[selectedClassName]: isSelected && !disabled,
|
|
1265
|
+
[disabledClassName]: disabled
|
|
1266
|
+
},
|
|
1267
|
+
className
|
|
1268
|
+
),
|
|
1269
|
+
onClick: disabled ? void 0 : onClick,
|
|
1270
|
+
children: [
|
|
1271
|
+
prefix,
|
|
1272
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex-col-0 w-full", children: [
|
|
1273
|
+
/* @__PURE__ */ jsx10("span", { className: clsx9(titleClassName ?? "textstyle-title-normal"), children: title }),
|
|
1274
|
+
!!description && /* @__PURE__ */ jsx10("span", { className: clsx9(descriptionClassName ?? "textstyle-description"), children: description })
|
|
1275
|
+
] }),
|
|
1276
|
+
suffix ?? (isSelected ? /* @__PURE__ */ jsx10(Check2, { size: 24 }) : void 0)
|
|
1277
|
+
]
|
|
1278
|
+
}
|
|
1279
|
+
);
|
|
1280
|
+
};
|
|
1281
|
+
var ListTile = ({
|
|
1282
|
+
...props
|
|
1283
|
+
}) => {
|
|
1284
|
+
return /* @__PURE__ */ jsx10(
|
|
1285
|
+
Tile,
|
|
1286
|
+
{
|
|
1287
|
+
...props,
|
|
1288
|
+
titleClassName: props.titleClassName ?? "font-semibold",
|
|
1289
|
+
className: clsx9("px-2 py-1 rounded-md", props.className),
|
|
1290
|
+
disabledClassName: props.disabledClassName ?? "text-disabled-text cursor-not-allowed"
|
|
1291
|
+
}
|
|
1292
|
+
);
|
|
1293
|
+
};
|
|
1294
|
+
|
|
1295
|
+
// src/components/user-action/MultiSelect.tsx
|
|
1296
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1304
1297
|
var defaultMultiSelectTranslation = {
|
|
1305
1298
|
en: {
|
|
1306
1299
|
selected: `{{amount}} selected`
|
|
@@ -1327,30 +1320,30 @@ var MultiSelect = ({
|
|
|
1327
1320
|
const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
|
|
1328
1321
|
const { result, search, setSearch } = useSearch({
|
|
1329
1322
|
list: options,
|
|
1330
|
-
searchMapping:
|
|
1323
|
+
searchMapping: useCallback5((item) => item.searchTags, []),
|
|
1331
1324
|
...searchOptions
|
|
1332
1325
|
});
|
|
1333
1326
|
const selectedItems = options.filter((value) => value.selected);
|
|
1334
1327
|
const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
|
|
1335
|
-
return /* @__PURE__ */
|
|
1336
|
-
label && /* @__PURE__ */
|
|
1328
|
+
return /* @__PURE__ */ jsxs9("div", { className: clsx10(className), children: [
|
|
1329
|
+
label && /* @__PURE__ */ jsx11(
|
|
1337
1330
|
Label,
|
|
1338
1331
|
{
|
|
1339
1332
|
...label,
|
|
1340
1333
|
htmlFor: label.name,
|
|
1341
|
-
className:
|
|
1334
|
+
className: clsx10(" mb-1", label.className),
|
|
1342
1335
|
labelType: label.labelType ?? "labelBig"
|
|
1343
1336
|
}
|
|
1344
1337
|
),
|
|
1345
|
-
/* @__PURE__ */
|
|
1338
|
+
/* @__PURE__ */ jsx11(
|
|
1346
1339
|
Menu,
|
|
1347
1340
|
{
|
|
1348
1341
|
...menuProps,
|
|
1349
|
-
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */
|
|
1342
|
+
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ jsx11(
|
|
1350
1343
|
"button",
|
|
1351
1344
|
{
|
|
1352
1345
|
ref,
|
|
1353
|
-
className:
|
|
1346
|
+
className: clsx10(
|
|
1354
1347
|
"group btn-md justify-between w-full border-2 h-auto",
|
|
1355
1348
|
{
|
|
1356
1349
|
"min-h-14": useChipDisplay,
|
|
@@ -1361,18 +1354,30 @@ var MultiSelect = ({
|
|
|
1361
1354
|
),
|
|
1362
1355
|
onClick: toggleOpen,
|
|
1363
1356
|
disabled,
|
|
1364
|
-
children: useChipDisplay ? /* @__PURE__ */
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1357
|
+
children: useChipDisplay ? /* @__PURE__ */ jsx11(Fragment2, { children: isShowingHint ? /* @__PURE__ */ jsx11(
|
|
1358
|
+
"div",
|
|
1359
|
+
{
|
|
1360
|
+
className: clsx10(
|
|
1361
|
+
"icon-btn-sm ",
|
|
1362
|
+
{
|
|
1363
|
+
"bg-button-solid-neutral-background text-button-solid-neutral-text hover:brightness-90 group-hover:brightness-90": !disabled,
|
|
1364
|
+
"bg-disabled-background text-disabled-text": disabled
|
|
1365
|
+
}
|
|
1366
|
+
),
|
|
1367
|
+
children: /* @__PURE__ */ jsx11(Plus, {})
|
|
1368
|
+
}
|
|
1369
|
+
) : /* @__PURE__ */ jsx11(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) }) : /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1370
|
+
!isShowingHint && /* @__PURE__ */ jsx11("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? translation("selected", { replacements: { amount: selectedItems.length.toString() } }) }),
|
|
1371
|
+
isShowingHint && /* @__PURE__ */ jsx11("span", { className: clsx10("textstyle-description", hintTextClassName), children: hintText ?? translation("select") }),
|
|
1372
|
+
/* @__PURE__ */ jsx11(ExpansionIcon, { isExpanded: isOpen })
|
|
1368
1373
|
] })
|
|
1369
1374
|
}
|
|
1370
1375
|
),
|
|
1371
|
-
menuClassName:
|
|
1376
|
+
menuClassName: clsx10("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
|
|
1372
1377
|
children: (bag) => {
|
|
1373
1378
|
const { close } = bag;
|
|
1374
|
-
return /* @__PURE__ */
|
|
1375
|
-
!searchOptions?.disabled && /* @__PURE__ */
|
|
1379
|
+
return /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1380
|
+
!searchOptions?.disabled && /* @__PURE__ */ jsx11(
|
|
1376
1381
|
SearchBar,
|
|
1377
1382
|
{
|
|
1378
1383
|
value: search,
|
|
@@ -1380,7 +1385,7 @@ var MultiSelect = ({
|
|
|
1380
1385
|
autoFocus: true
|
|
1381
1386
|
}
|
|
1382
1387
|
),
|
|
1383
|
-
/* @__PURE__ */
|
|
1388
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-col-2 overflow-y-auto", children: [
|
|
1384
1389
|
result.map((option, index) => {
|
|
1385
1390
|
const update = () => {
|
|
1386
1391
|
onChange(options.map((value) => value.value === option.value ? {
|
|
@@ -1388,10 +1393,10 @@ var MultiSelect = ({
|
|
|
1388
1393
|
selected: !value.selected
|
|
1389
1394
|
} : value));
|
|
1390
1395
|
};
|
|
1391
|
-
return /* @__PURE__ */
|
|
1392
|
-
|
|
1396
|
+
return /* @__PURE__ */ jsx11(
|
|
1397
|
+
ListTile,
|
|
1393
1398
|
{
|
|
1394
|
-
prefix: /* @__PURE__ */
|
|
1399
|
+
prefix: /* @__PURE__ */ jsx11(
|
|
1395
1400
|
Checkbox,
|
|
1396
1401
|
{
|
|
1397
1402
|
checked: option.selected,
|
|
@@ -1400,7 +1405,7 @@ var MultiSelect = ({
|
|
|
1400
1405
|
disabled: option.disabled
|
|
1401
1406
|
}
|
|
1402
1407
|
),
|
|
1403
|
-
title:
|
|
1408
|
+
title: option.label,
|
|
1404
1409
|
onClick: update,
|
|
1405
1410
|
disabled: option.disabled
|
|
1406
1411
|
},
|
|
@@ -1409,9 +1414,9 @@ var MultiSelect = ({
|
|
|
1409
1414
|
}),
|
|
1410
1415
|
additionalItems && additionalItems({ ...bag, search })
|
|
1411
1416
|
] }),
|
|
1412
|
-
/* @__PURE__ */
|
|
1413
|
-
/* @__PURE__ */
|
|
1414
|
-
/* @__PURE__ */
|
|
1417
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-row-2 justify-between", children: [
|
|
1418
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-row-2", children: [
|
|
1419
|
+
/* @__PURE__ */ jsx11(
|
|
1415
1420
|
SolidButton,
|
|
1416
1421
|
{
|
|
1417
1422
|
color: "neutral",
|
|
@@ -1426,7 +1431,7 @@ var MultiSelect = ({
|
|
|
1426
1431
|
children: translation("all")
|
|
1427
1432
|
}
|
|
1428
1433
|
),
|
|
1429
|
-
/* @__PURE__ */
|
|
1434
|
+
/* @__PURE__ */ jsx11(
|
|
1430
1435
|
SolidButton,
|
|
1431
1436
|
{
|
|
1432
1437
|
color: "neutral",
|
|
@@ -1441,7 +1446,7 @@ var MultiSelect = ({
|
|
|
1441
1446
|
}
|
|
1442
1447
|
)
|
|
1443
1448
|
] }),
|
|
1444
|
-
/* @__PURE__ */
|
|
1449
|
+
/* @__PURE__ */ jsx11(SolidButton, { size: "small", onClick: close, children: "Done" })
|
|
1445
1450
|
] })
|
|
1446
1451
|
] });
|
|
1447
1452
|
}
|
|
@@ -1452,8 +1457,8 @@ var MultiSelect = ({
|
|
|
1452
1457
|
|
|
1453
1458
|
// src/components/properties/PropertyBase.tsx
|
|
1454
1459
|
import { AlertTriangle } from "lucide-react";
|
|
1455
|
-
import
|
|
1456
|
-
import { jsx as
|
|
1460
|
+
import clsx11 from "clsx";
|
|
1461
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1457
1462
|
var PropertyBase = ({
|
|
1458
1463
|
overwriteTranslation,
|
|
1459
1464
|
name,
|
|
@@ -1467,11 +1472,11 @@ var PropertyBase = ({
|
|
|
1467
1472
|
}) => {
|
|
1468
1473
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
1469
1474
|
const requiredAndNoValue = softRequired && !hasValue;
|
|
1470
|
-
return /* @__PURE__ */
|
|
1471
|
-
/* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ jsxs10("div", { className: clsx11("flex-row-0 group", className), children: [
|
|
1476
|
+
/* @__PURE__ */ jsxs10(
|
|
1472
1477
|
"div",
|
|
1473
1478
|
{
|
|
1474
|
-
className:
|
|
1479
|
+
className: clsx11(
|
|
1475
1480
|
"flex-row-2 max-w-48 min-w-48 px-3 py-2 items-center rounded-l-xl border-2 border-r-0",
|
|
1476
1481
|
{
|
|
1477
1482
|
"bg-property-title-background text-property-title-text group-hover:border-primary": !requiredAndNoValue,
|
|
@@ -1480,15 +1485,15 @@ var PropertyBase = ({
|
|
|
1480
1485
|
className
|
|
1481
1486
|
),
|
|
1482
1487
|
children: [
|
|
1483
|
-
/* @__PURE__ */
|
|
1484
|
-
/* @__PURE__ */
|
|
1488
|
+
/* @__PURE__ */ jsx12("div", { className: "max-w-6 min-w-6 text-text-primary", children: icon }),
|
|
1489
|
+
/* @__PURE__ */ jsx12("span", { className: "font-semibold", children: name })
|
|
1485
1490
|
]
|
|
1486
1491
|
}
|
|
1487
1492
|
),
|
|
1488
|
-
/* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ jsxs10(
|
|
1489
1494
|
"div",
|
|
1490
1495
|
{
|
|
1491
|
-
className:
|
|
1496
|
+
className: clsx11(
|
|
1492
1497
|
"flex-row-2 grow px-3 py-2 justify-between items-center rounded-r-xl border-2 border-l-0 min-h-15",
|
|
1493
1498
|
{
|
|
1494
1499
|
"bg-input-background text-input-text group-hover:border-primary": !requiredAndNoValue,
|
|
@@ -1498,13 +1503,13 @@ var PropertyBase = ({
|
|
|
1498
1503
|
),
|
|
1499
1504
|
children: [
|
|
1500
1505
|
input({ softRequired, hasValue }),
|
|
1501
|
-
requiredAndNoValue && /* @__PURE__ */
|
|
1502
|
-
onRemove && hasValue && /* @__PURE__ */
|
|
1506
|
+
requiredAndNoValue && /* @__PURE__ */ jsx12("div", { className: "text-warning", children: /* @__PURE__ */ jsx12(AlertTriangle, { size: 24 }) }),
|
|
1507
|
+
onRemove && hasValue && /* @__PURE__ */ jsx12(
|
|
1503
1508
|
TextButton,
|
|
1504
1509
|
{
|
|
1505
1510
|
onClick: onRemove,
|
|
1506
1511
|
color: "negative",
|
|
1507
|
-
className:
|
|
1512
|
+
className: clsx11("items-center", { "!text-transparent": !hasValue || readOnly }),
|
|
1508
1513
|
disabled: !hasValue || readOnly,
|
|
1509
1514
|
children: translation("remove")
|
|
1510
1515
|
}
|
|
@@ -1516,7 +1521,7 @@ var PropertyBase = ({
|
|
|
1516
1521
|
};
|
|
1517
1522
|
|
|
1518
1523
|
// src/components/properties/MultiSelectProperty.tsx
|
|
1519
|
-
import { jsx as
|
|
1524
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1520
1525
|
var MultiSelectProperty = ({
|
|
1521
1526
|
overwriteTranslation,
|
|
1522
1527
|
options,
|
|
@@ -1529,7 +1534,7 @@ var MultiSelectProperty = ({
|
|
|
1529
1534
|
}) => {
|
|
1530
1535
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
1531
1536
|
const hasValue = options.some((value) => value.selected);
|
|
1532
|
-
return /* @__PURE__ */
|
|
1537
|
+
return /* @__PURE__ */ jsx13(
|
|
1533
1538
|
PropertyBase,
|
|
1534
1539
|
{
|
|
1535
1540
|
name,
|
|
@@ -1537,12 +1542,12 @@ var MultiSelectProperty = ({
|
|
|
1537
1542
|
readOnly,
|
|
1538
1543
|
softRequired,
|
|
1539
1544
|
hasValue,
|
|
1540
|
-
icon: /* @__PURE__ */
|
|
1541
|
-
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */
|
|
1545
|
+
icon: /* @__PURE__ */ jsx13(List, { size: 24 }),
|
|
1546
|
+
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ jsx13(
|
|
1542
1547
|
MultiSelect,
|
|
1543
1548
|
{
|
|
1544
1549
|
...multiSelectProps,
|
|
1545
|
-
className:
|
|
1550
|
+
className: clsx12("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
|
|
1546
1551
|
options,
|
|
1547
1552
|
disabled: readOnly,
|
|
1548
1553
|
useChipDisplay: true,
|
|
@@ -1555,11 +1560,11 @@ var MultiSelectProperty = ({
|
|
|
1555
1560
|
if (!onAddNew && !search.trim()) {
|
|
1556
1561
|
return void 0;
|
|
1557
1562
|
}
|
|
1558
|
-
return /* @__PURE__ */
|
|
1559
|
-
|
|
1563
|
+
return /* @__PURE__ */ jsx13(
|
|
1564
|
+
ListTile,
|
|
1560
1565
|
{
|
|
1561
|
-
prefix: /* @__PURE__ */
|
|
1562
|
-
title:
|
|
1566
|
+
prefix: /* @__PURE__ */ jsx13(Plus2, {}),
|
|
1567
|
+
title: `${translation("add")} ${search.trim()}`,
|
|
1563
1568
|
onClick: () => {
|
|
1564
1569
|
onAddNew(search);
|
|
1565
1570
|
close();
|
|
@@ -1568,7 +1573,7 @@ var MultiSelectProperty = ({
|
|
|
1568
1573
|
}
|
|
1569
1574
|
);
|
|
1570
1575
|
},
|
|
1571
|
-
triggerClassName:
|
|
1576
|
+
triggerClassName: clsx12(
|
|
1572
1577
|
"!border-none !p-0 !min-h-10",
|
|
1573
1578
|
{
|
|
1574
1579
|
"!bg-warning !text-surface-warning": softRequired2 && !hasValue,
|