@helpwave/hightide 0.1.22 → 0.1.23
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/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/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/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/modals/LanguageModal.js +21 -22
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +21 -22
- 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 +21 -22
- 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 +1 -1
- 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 +1 -1
- 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 +752 -747
- 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 +1 -1
- 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 +1 -1
- 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 +24 -25
- 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 +1 -1
- package/dist/components/properties/TextProperty.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 +635 -630
- 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/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 +21 -23
- 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/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3158 -371
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3030 -243
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -33,8 +33,8 @@ __export(MultiSelect_exports, {
|
|
|
33
33
|
MultiSelectUncontrolled: () => MultiSelectUncontrolled
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(MultiSelect_exports);
|
|
36
|
-
var
|
|
37
|
-
var
|
|
36
|
+
var import_react14 = require("react");
|
|
37
|
+
var import_react15 = require("react");
|
|
38
38
|
|
|
39
39
|
// src/localization/LanguageProvider.tsx
|
|
40
40
|
var import_react2 = require("react");
|
|
@@ -124,7 +124,7 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
// src/components/user-action/MultiSelect.tsx
|
|
127
|
-
var
|
|
127
|
+
var import_clsx10 = __toESM(require("clsx"));
|
|
128
128
|
|
|
129
129
|
// src/components/user-action/Label.tsx
|
|
130
130
|
var import_clsx = __toESM(require("clsx"));
|
|
@@ -144,156 +144,322 @@ var Label = ({
|
|
|
144
144
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
// src/components/user-action/
|
|
148
|
-
var
|
|
149
|
-
var import_react14 = require("react");
|
|
150
|
-
var import_clsx8 = __toESM(require("clsx"));
|
|
151
|
-
|
|
152
|
-
// src/components/layout-and-navigation/Tile.tsx
|
|
147
|
+
// src/components/user-action/Button.tsx
|
|
148
|
+
var import_react3 = require("react");
|
|
153
149
|
var import_clsx2 = __toESM(require("clsx"));
|
|
154
|
-
var import_lucide_react = require("lucide-react");
|
|
155
150
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
156
|
-
var
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
151
|
+
var ButtonColorUtil = {
|
|
152
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
153
|
+
text: ["primary", "negative", "neutral"],
|
|
154
|
+
outline: ["primary"]
|
|
155
|
+
};
|
|
156
|
+
var IconButtonUtil = {
|
|
157
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
158
|
+
};
|
|
159
|
+
var paddingMapping = {
|
|
160
|
+
small: "btn-sm",
|
|
161
|
+
medium: "btn-md",
|
|
162
|
+
large: "btn-lg"
|
|
163
|
+
};
|
|
164
|
+
var iconPaddingMapping = {
|
|
165
|
+
tiny: "icon-btn-xs",
|
|
166
|
+
small: "icon-btn-sm",
|
|
167
|
+
medium: "icon-btn-md",
|
|
168
|
+
large: "icon-btn-lg"
|
|
169
|
+
};
|
|
170
|
+
var ButtonUtil = {
|
|
171
|
+
paddingMapping,
|
|
172
|
+
iconPaddingMapping
|
|
173
|
+
};
|
|
174
|
+
var SolidButton = (0, import_react3.forwardRef)(function SolidButton2({
|
|
175
|
+
children,
|
|
161
176
|
disabled = false,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
className
|
|
168
|
-
|
|
177
|
+
color = "primary",
|
|
178
|
+
size = "medium",
|
|
179
|
+
startIcon,
|
|
180
|
+
endIcon,
|
|
181
|
+
onClick,
|
|
182
|
+
className,
|
|
183
|
+
...restProps
|
|
184
|
+
}, ref) {
|
|
185
|
+
const colorClasses = {
|
|
186
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
187
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
188
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
189
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
190
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
191
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
192
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
193
|
+
}[color];
|
|
194
|
+
const iconColorClasses = {
|
|
195
|
+
primary: "text-button-solid-primary-icon",
|
|
196
|
+
secondary: "text-button-solid-secondary-icon",
|
|
197
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
198
|
+
positive: "text-button-solid-positive-icon",
|
|
199
|
+
warning: "text-button-solid-warning-icon",
|
|
200
|
+
negative: "text-button-solid-negative-icon",
|
|
201
|
+
neutral: "text-button-solid-neutral-icon"
|
|
202
|
+
}[color];
|
|
169
203
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
170
|
-
"
|
|
204
|
+
"button",
|
|
171
205
|
{
|
|
206
|
+
ref,
|
|
207
|
+
onClick,
|
|
208
|
+
disabled,
|
|
172
209
|
className: (0, import_clsx2.default)(
|
|
173
|
-
"
|
|
210
|
+
"font-semibold",
|
|
174
211
|
{
|
|
175
|
-
|
|
176
|
-
[
|
|
177
|
-
[disabledClassName]: disabled
|
|
212
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
213
|
+
[(0, import_clsx2.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
178
214
|
},
|
|
215
|
+
ButtonUtil.paddingMapping[size],
|
|
179
216
|
className
|
|
180
217
|
),
|
|
181
|
-
|
|
218
|
+
...restProps,
|
|
182
219
|
children: [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
220
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
221
|
+
"span",
|
|
222
|
+
{
|
|
223
|
+
className: (0, import_clsx2.default)({
|
|
224
|
+
[iconColorClasses]: !disabled,
|
|
225
|
+
[`text-disabled-icon`]: disabled
|
|
226
|
+
}),
|
|
227
|
+
children: startIcon
|
|
228
|
+
}
|
|
229
|
+
),
|
|
230
|
+
children,
|
|
231
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
232
|
+
"span",
|
|
233
|
+
{
|
|
234
|
+
className: (0, import_clsx2.default)({
|
|
235
|
+
[iconColorClasses]: !disabled,
|
|
236
|
+
[`text-disabled-icon`]: disabled
|
|
237
|
+
}),
|
|
238
|
+
children: endIcon
|
|
239
|
+
}
|
|
240
|
+
)
|
|
189
241
|
]
|
|
190
242
|
}
|
|
191
243
|
);
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
244
|
+
});
|
|
245
|
+
var IconButton = ({
|
|
246
|
+
children,
|
|
247
|
+
disabled = false,
|
|
248
|
+
color = "primary",
|
|
249
|
+
size = "medium",
|
|
250
|
+
className,
|
|
251
|
+
...restProps
|
|
252
|
+
}) => {
|
|
253
|
+
const colorClasses = {
|
|
254
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
255
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
256
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
257
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
258
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
259
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
260
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
261
|
+
transparent: "bg-transparent"
|
|
262
|
+
}[color];
|
|
263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
264
|
+
"button",
|
|
207
265
|
{
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
{
|
|
266
|
+
disabled,
|
|
267
|
+
className: (0, import_clsx2.default)(
|
|
268
|
+
{
|
|
269
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
270
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
271
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
272
|
+
[(0, import_clsx2.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
273
|
+
},
|
|
274
|
+
ButtonUtil.iconPaddingMapping[size],
|
|
211
275
|
className
|
|
212
|
-
)
|
|
276
|
+
),
|
|
277
|
+
...restProps,
|
|
278
|
+
children
|
|
213
279
|
}
|
|
214
280
|
);
|
|
215
281
|
};
|
|
216
|
-
|
|
282
|
+
|
|
283
|
+
// src/components/layout-and-navigation/Chip.tsx
|
|
284
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
285
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
286
|
+
var Chip = ({
|
|
217
287
|
children,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
288
|
+
trailingIcon,
|
|
289
|
+
color = "default",
|
|
290
|
+
variant = "normal",
|
|
291
|
+
className = "",
|
|
292
|
+
...restProps
|
|
293
|
+
}) => {
|
|
294
|
+
const colorMapping = {
|
|
295
|
+
default: "text-tag-default-text bg-tag-default-background",
|
|
296
|
+
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
297
|
+
red: "text-tag-red-text bg-tag-red-background",
|
|
298
|
+
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
299
|
+
green: "text-tag-green-text bg-tag-green-background",
|
|
300
|
+
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
301
|
+
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
302
|
+
}[color];
|
|
303
|
+
const colorMappingIcon = {
|
|
304
|
+
default: "text-tag-default-icon",
|
|
305
|
+
dark: "text-tag-dark-icon",
|
|
306
|
+
red: "text-tag-red-icon",
|
|
307
|
+
yellow: "text-tag-yellow-icon",
|
|
308
|
+
green: "text-tag-green-icon",
|
|
309
|
+
blue: "text-tag-blue-icon",
|
|
310
|
+
pink: "text-tag-pink-icon"
|
|
311
|
+
}[color];
|
|
231
312
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
232
313
|
"div",
|
|
233
314
|
{
|
|
234
|
-
|
|
235
|
-
className: (0, import_clsx3.default)(
|
|
236
|
-
|
|
315
|
+
...restProps,
|
|
316
|
+
className: (0, import_clsx3.default)(
|
|
317
|
+
`row w-fit px-2 py-1 font-semibold`,
|
|
318
|
+
colorMapping,
|
|
319
|
+
{
|
|
320
|
+
"rounded-md": variant === "normal",
|
|
321
|
+
"rounded-full": variant === "fullyRounded"
|
|
322
|
+
},
|
|
323
|
+
className
|
|
324
|
+
),
|
|
237
325
|
children: [
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
{
|
|
241
|
-
className: (0, import_clsx3.default)(
|
|
242
|
-
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
|
|
243
|
-
{
|
|
244
|
-
"group-hover:brightness-97": !isExpanded,
|
|
245
|
-
"hover:brightness-97": isExpanded && !disabled,
|
|
246
|
-
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
247
|
-
},
|
|
248
|
-
headerClassName
|
|
249
|
-
),
|
|
250
|
-
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
251
|
-
children: [
|
|
252
|
-
label,
|
|
253
|
-
icon(isExpanded)
|
|
254
|
-
]
|
|
255
|
-
}
|
|
256
|
-
),
|
|
257
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
258
|
-
"div",
|
|
259
|
-
{
|
|
260
|
-
className: (0, import_clsx3.default)(
|
|
261
|
-
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
262
|
-
{
|
|
263
|
-
[(0, import_clsx3.default)("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
|
|
264
|
-
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
265
|
-
},
|
|
266
|
-
contentClassName
|
|
267
|
-
),
|
|
268
|
-
children
|
|
269
|
-
}
|
|
270
|
-
)
|
|
326
|
+
children,
|
|
327
|
+
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
|
|
271
328
|
]
|
|
272
329
|
}
|
|
273
330
|
);
|
|
274
|
-
}
|
|
275
|
-
var
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
(0, import_react3.useEffect)(() => {
|
|
282
|
-
setUsedIsExpanded(isExpanded);
|
|
283
|
-
}, [isExpanded]);
|
|
284
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
285
|
-
Expandable,
|
|
331
|
+
};
|
|
332
|
+
var ChipList = ({
|
|
333
|
+
list,
|
|
334
|
+
className = ""
|
|
335
|
+
}) => {
|
|
336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: (0, import_clsx3.default)("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
337
|
+
Chip,
|
|
286
338
|
{
|
|
287
|
-
...
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
339
|
+
...value,
|
|
340
|
+
color: value.color ?? "default",
|
|
341
|
+
variant: value.variant ?? "normal",
|
|
342
|
+
children: value.children
|
|
343
|
+
},
|
|
344
|
+
index
|
|
345
|
+
)) });
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
// src/localization/defaults/form.ts
|
|
349
|
+
var formTranslation = {
|
|
350
|
+
en: {
|
|
351
|
+
add: "Add",
|
|
352
|
+
all: "All",
|
|
353
|
+
apply: "Apply",
|
|
354
|
+
back: "Back",
|
|
355
|
+
cancel: "Cancel",
|
|
356
|
+
change: "Change",
|
|
357
|
+
clear: "Clear",
|
|
358
|
+
click: "Click",
|
|
359
|
+
clickToCopy: "Click to Copy",
|
|
360
|
+
close: "Close",
|
|
361
|
+
confirm: "Confirm",
|
|
362
|
+
copy: "Copy",
|
|
363
|
+
copied: "Copied",
|
|
364
|
+
create: "Create",
|
|
365
|
+
decline: "Decline",
|
|
366
|
+
delete: "Delete",
|
|
367
|
+
discard: "Discard",
|
|
368
|
+
discardChanges: "Discard Changes",
|
|
369
|
+
done: "Done",
|
|
370
|
+
edit: "Edit",
|
|
371
|
+
enterText: "Enter text here",
|
|
372
|
+
error: "Error",
|
|
373
|
+
exit: "Exit",
|
|
374
|
+
fieldRequiredError: "This field is required.",
|
|
375
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
376
|
+
less: "Less",
|
|
377
|
+
loading: "Loading",
|
|
378
|
+
maxLengthError: "Maximum length exceeded.",
|
|
379
|
+
minLengthError: "Minimum length not met.",
|
|
380
|
+
more: "More",
|
|
381
|
+
next: "Next",
|
|
382
|
+
no: "No",
|
|
383
|
+
none: "None",
|
|
384
|
+
of: "of",
|
|
385
|
+
optional: "Optional",
|
|
386
|
+
pleaseWait: "Please wait...",
|
|
387
|
+
previous: "Previous",
|
|
388
|
+
remove: "Remove",
|
|
389
|
+
required: "Required",
|
|
390
|
+
reset: "Reset",
|
|
391
|
+
save: "Save",
|
|
392
|
+
saved: "Saved",
|
|
393
|
+
search: "Search",
|
|
394
|
+
select: "Select",
|
|
395
|
+
selectOption: "Select an option",
|
|
396
|
+
show: "Show",
|
|
397
|
+
showMore: "Show more",
|
|
398
|
+
showLess: "Show less",
|
|
399
|
+
submit: "Submit",
|
|
400
|
+
success: "Success",
|
|
401
|
+
update: "Update",
|
|
402
|
+
unsavedChanges: "Unsaved Changes",
|
|
403
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
404
|
+
yes: "Yes"
|
|
405
|
+
},
|
|
406
|
+
de: {
|
|
407
|
+
add: "Hinzuf\xFCgen",
|
|
408
|
+
all: "Alle",
|
|
409
|
+
apply: "Anwenden",
|
|
410
|
+
back: "Zur\xFCck",
|
|
411
|
+
cancel: "Abbrechen",
|
|
412
|
+
change: "\xC4ndern",
|
|
413
|
+
clear: "L\xF6schen",
|
|
414
|
+
click: "Klicken",
|
|
415
|
+
clickToCopy: "Zum kopieren klicken",
|
|
416
|
+
close: "Schlie\xDFen",
|
|
417
|
+
confirm: "Best\xE4tigen",
|
|
418
|
+
copy: "Kopieren",
|
|
419
|
+
copied: "Kopiert",
|
|
420
|
+
create: "Erstellen",
|
|
421
|
+
decline: "Ablehnen",
|
|
422
|
+
delete: "L\xF6schen",
|
|
423
|
+
discard: "Verwerfen",
|
|
424
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
425
|
+
done: "Fertig",
|
|
426
|
+
edit: "Bearbeiten",
|
|
427
|
+
enterText: "Text hier eingeben",
|
|
428
|
+
error: "Fehler",
|
|
429
|
+
exit: "Beenden",
|
|
430
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
431
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
432
|
+
less: "Weniger",
|
|
433
|
+
loading: "L\xE4dt",
|
|
434
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
435
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
436
|
+
more: "Mehr",
|
|
437
|
+
next: "Weiter",
|
|
438
|
+
no: "Nein",
|
|
439
|
+
none: "Nichts",
|
|
440
|
+
of: "von",
|
|
441
|
+
optional: "Optional",
|
|
442
|
+
pleaseWait: "Bitte warten...",
|
|
443
|
+
previous: "Vorherige",
|
|
444
|
+
remove: "Entfernen",
|
|
445
|
+
required: "Erforderlich",
|
|
446
|
+
reset: "Zur\xFCcksetzen",
|
|
447
|
+
save: "Speichern",
|
|
448
|
+
saved: "Gespeichert",
|
|
449
|
+
search: "Suche",
|
|
450
|
+
select: "Select",
|
|
451
|
+
selectOption: "Option ausw\xE4hlen",
|
|
452
|
+
show: "Anzeigen",
|
|
453
|
+
showMore: "Mehr anzeigen",
|
|
454
|
+
showLess: "Weniger anzeigen",
|
|
455
|
+
submit: "Abschicken",
|
|
456
|
+
success: "Erfolg",
|
|
457
|
+
update: "Update",
|
|
458
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
459
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
460
|
+
yes: "Ja"
|
|
461
|
+
}
|
|
462
|
+
};
|
|
297
463
|
|
|
298
464
|
// src/components/user-action/Menu.tsx
|
|
299
465
|
var import_react6 = require("react");
|
|
@@ -516,18 +682,122 @@ var Menu = ({
|
|
|
516
682
|
] });
|
|
517
683
|
};
|
|
518
684
|
|
|
519
|
-
// src/components/
|
|
520
|
-
var
|
|
685
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
686
|
+
var import_react7 = require("react");
|
|
687
|
+
var import_lucide_react = require("lucide-react");
|
|
521
688
|
var import_clsx5 = __toESM(require("clsx"));
|
|
522
689
|
|
|
690
|
+
// src/util/noop.ts
|
|
691
|
+
var noop = () => void 0;
|
|
692
|
+
|
|
693
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
694
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
695
|
+
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
697
|
+
import_lucide_react.ChevronDown,
|
|
698
|
+
{
|
|
699
|
+
className: (0, import_clsx5.default)(
|
|
700
|
+
"min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
|
|
701
|
+
{ "rotate-180": isExpanded },
|
|
702
|
+
className
|
|
703
|
+
)
|
|
704
|
+
}
|
|
705
|
+
);
|
|
706
|
+
};
|
|
707
|
+
var Expandable = (0, import_react7.forwardRef)(function Expandable2({
|
|
708
|
+
children,
|
|
709
|
+
label,
|
|
710
|
+
icon,
|
|
711
|
+
isExpanded = false,
|
|
712
|
+
onChange = noop,
|
|
713
|
+
clickOnlyOnHeader = true,
|
|
714
|
+
disabled = false,
|
|
715
|
+
className,
|
|
716
|
+
headerClassName,
|
|
717
|
+
contentClassName,
|
|
718
|
+
contentExpandedClassName
|
|
719
|
+
}, ref) {
|
|
720
|
+
const defaultIcon = (0, import_react7.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
|
|
721
|
+
icon ??= defaultIcon;
|
|
722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
723
|
+
"div",
|
|
724
|
+
{
|
|
725
|
+
ref,
|
|
726
|
+
className: (0, import_clsx5.default)("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
|
|
727
|
+
onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
728
|
+
children: [
|
|
729
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
730
|
+
"div",
|
|
731
|
+
{
|
|
732
|
+
className: (0, import_clsx5.default)(
|
|
733
|
+
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
|
|
734
|
+
{
|
|
735
|
+
"group-hover:brightness-97": !isExpanded,
|
|
736
|
+
"hover:brightness-97": isExpanded && !disabled,
|
|
737
|
+
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
738
|
+
},
|
|
739
|
+
headerClassName
|
|
740
|
+
),
|
|
741
|
+
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
742
|
+
children: [
|
|
743
|
+
label,
|
|
744
|
+
icon(isExpanded)
|
|
745
|
+
]
|
|
746
|
+
}
|
|
747
|
+
),
|
|
748
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
749
|
+
"div",
|
|
750
|
+
{
|
|
751
|
+
className: (0, import_clsx5.default)(
|
|
752
|
+
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
753
|
+
{
|
|
754
|
+
[(0, import_clsx5.default)("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
|
|
755
|
+
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
756
|
+
},
|
|
757
|
+
contentClassName
|
|
758
|
+
),
|
|
759
|
+
children
|
|
760
|
+
}
|
|
761
|
+
)
|
|
762
|
+
]
|
|
763
|
+
}
|
|
764
|
+
);
|
|
765
|
+
});
|
|
766
|
+
var ExpandableUncontrolled = (0, import_react7.forwardRef)(function ExpandableUncontrolled2({
|
|
767
|
+
isExpanded,
|
|
768
|
+
onChange = noop,
|
|
769
|
+
...props
|
|
770
|
+
}, ref) {
|
|
771
|
+
const [usedIsExpanded, setUsedIsExpanded] = (0, import_react7.useState)(isExpanded);
|
|
772
|
+
(0, import_react7.useEffect)(() => {
|
|
773
|
+
setUsedIsExpanded(isExpanded);
|
|
774
|
+
}, [isExpanded]);
|
|
775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
776
|
+
Expandable,
|
|
777
|
+
{
|
|
778
|
+
...props,
|
|
779
|
+
ref,
|
|
780
|
+
isExpanded: usedIsExpanded,
|
|
781
|
+
onChange: (value) => {
|
|
782
|
+
onChange(value);
|
|
783
|
+
setUsedIsExpanded(value);
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
);
|
|
787
|
+
});
|
|
788
|
+
|
|
789
|
+
// src/components/user-action/Input.tsx
|
|
790
|
+
var import_react11 = require("react");
|
|
791
|
+
var import_clsx6 = __toESM(require("clsx"));
|
|
792
|
+
|
|
523
793
|
// src/hooks/useDelay.ts
|
|
524
|
-
var
|
|
794
|
+
var import_react8 = require("react");
|
|
525
795
|
var defaultOptions = {
|
|
526
796
|
delay: 3e3,
|
|
527
797
|
disabled: false
|
|
528
798
|
};
|
|
529
799
|
function useDelay(options) {
|
|
530
|
-
const [timer, setTimer] = (0,
|
|
800
|
+
const [timer, setTimer] = (0, import_react8.useState)(void 0);
|
|
531
801
|
const { delay, disabled } = {
|
|
532
802
|
...defaultOptions,
|
|
533
803
|
...options
|
|
@@ -546,12 +816,12 @@ function useDelay(options) {
|
|
|
546
816
|
setTimer(void 0);
|
|
547
817
|
}, delay));
|
|
548
818
|
};
|
|
549
|
-
(0,
|
|
819
|
+
(0, import_react8.useEffect)(() => {
|
|
550
820
|
return () => {
|
|
551
821
|
clearTimeout(timer);
|
|
552
822
|
};
|
|
553
823
|
}, [timer]);
|
|
554
|
-
(0,
|
|
824
|
+
(0, import_react8.useEffect)(() => {
|
|
555
825
|
if (disabled) {
|
|
556
826
|
clearTimeout(timer);
|
|
557
827
|
setTimer(void 0);
|
|
@@ -561,9 +831,9 @@ function useDelay(options) {
|
|
|
561
831
|
}
|
|
562
832
|
|
|
563
833
|
// src/hooks/useFocusManagement.ts
|
|
564
|
-
var
|
|
834
|
+
var import_react9 = require("react");
|
|
565
835
|
function useFocusManagement() {
|
|
566
|
-
const getFocusableElements = (0,
|
|
836
|
+
const getFocusableElements = (0, import_react9.useCallback)(() => {
|
|
567
837
|
return Array.from(
|
|
568
838
|
document.querySelectorAll(
|
|
569
839
|
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
@@ -572,7 +842,7 @@ function useFocusManagement() {
|
|
|
572
842
|
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
573
843
|
);
|
|
574
844
|
}, []);
|
|
575
|
-
const getNextFocusElement = (0,
|
|
845
|
+
const getNextFocusElement = (0, import_react9.useCallback)(() => {
|
|
576
846
|
const elements = getFocusableElements();
|
|
577
847
|
if (elements.length === 0) {
|
|
578
848
|
return void 0;
|
|
@@ -584,11 +854,11 @@ function useFocusManagement() {
|
|
|
584
854
|
}
|
|
585
855
|
return nextElement;
|
|
586
856
|
}, [getFocusableElements]);
|
|
587
|
-
const focusNext = (0,
|
|
857
|
+
const focusNext = (0, import_react9.useCallback)(() => {
|
|
588
858
|
const nextElement = getNextFocusElement();
|
|
589
859
|
nextElement?.focus();
|
|
590
860
|
}, [getNextFocusElement]);
|
|
591
|
-
const getPreviousFocusElement = (0,
|
|
861
|
+
const getPreviousFocusElement = (0, import_react9.useCallback)(() => {
|
|
592
862
|
const elements = getFocusableElements();
|
|
593
863
|
if (elements.length === 0) {
|
|
594
864
|
return void 0;
|
|
@@ -604,7 +874,7 @@ function useFocusManagement() {
|
|
|
604
874
|
}
|
|
605
875
|
return previousElement;
|
|
606
876
|
}, [getFocusableElements]);
|
|
607
|
-
const focusPrevious = (0,
|
|
877
|
+
const focusPrevious = (0, import_react9.useCallback)(() => {
|
|
608
878
|
const previousElement = getPreviousFocusElement();
|
|
609
879
|
if (previousElement) previousElement.focus();
|
|
610
880
|
}, [getPreviousFocusElement]);
|
|
@@ -618,10 +888,10 @@ function useFocusManagement() {
|
|
|
618
888
|
}
|
|
619
889
|
|
|
620
890
|
// src/hooks/useFocusOnceVisible.ts
|
|
621
|
-
var
|
|
891
|
+
var import_react10 = __toESM(require("react"));
|
|
622
892
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
623
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
624
|
-
(0,
|
|
893
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react10.default.useState(false);
|
|
894
|
+
(0, import_react10.useEffect)(() => {
|
|
625
895
|
if (disable || hasUsedFocus) {
|
|
626
896
|
return;
|
|
627
897
|
}
|
|
@@ -641,9 +911,9 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
641
911
|
};
|
|
642
912
|
|
|
643
913
|
// src/components/user-action/Input.tsx
|
|
644
|
-
var
|
|
914
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
645
915
|
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
646
|
-
return (0,
|
|
916
|
+
return (0, import_clsx6.default)(
|
|
647
917
|
"px-2 py-1.5 rounded-md border-2",
|
|
648
918
|
{
|
|
649
919
|
"bg-input-background text-input-text hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
@@ -657,370 +927,118 @@ var defaultEditCompleteOptions = {
|
|
|
657
927
|
afterDelay: true,
|
|
658
928
|
delay: 2500
|
|
659
929
|
};
|
|
660
|
-
var Input = (0,
|
|
930
|
+
var Input = (0, import_react11.forwardRef)(function Input2({
|
|
661
931
|
id,
|
|
662
932
|
type = "text",
|
|
663
933
|
value,
|
|
664
934
|
label,
|
|
665
935
|
onChange = noop,
|
|
666
|
-
onChangeText = noop,
|
|
667
|
-
onEditCompleted,
|
|
668
|
-
className = "",
|
|
669
|
-
allowEnterComplete = true,
|
|
670
|
-
expanded = true,
|
|
671
|
-
autoFocus = false,
|
|
672
|
-
onBlur,
|
|
673
|
-
editCompleteOptions,
|
|
674
|
-
containerClassName,
|
|
675
|
-
disabled,
|
|
676
|
-
...restProps
|
|
677
|
-
}, forwardedRef) {
|
|
678
|
-
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
679
|
-
const {
|
|
680
|
-
restartTimer,
|
|
681
|
-
clearTimer
|
|
682
|
-
} = useDelay({ delay, disabled: !afterDelay });
|
|
683
|
-
const innerRef = (0,
|
|
684
|
-
const { focusNext } = useFocusManagement();
|
|
685
|
-
useFocusOnceVisible(innerRef, !autoFocus);
|
|
686
|
-
(0,
|
|
687
|
-
const handleKeyDown = (e) => {
|
|
688
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
689
|
-
e.preventDefault();
|
|
690
|
-
innerRef.current?.blur();
|
|
691
|
-
focusNext();
|
|
692
|
-
}
|
|
693
|
-
};
|
|
694
|
-
return /* @__PURE__ */ (0,
|
|
695
|
-
label && /* @__PURE__ */ (0,
|
|
696
|
-
/* @__PURE__ */ (0,
|
|
697
|
-
"input",
|
|
698
|
-
{
|
|
699
|
-
...restProps,
|
|
700
|
-
ref: innerRef,
|
|
701
|
-
value,
|
|
702
|
-
id,
|
|
703
|
-
type,
|
|
704
|
-
disabled,
|
|
705
|
-
className: (0,
|
|
706
|
-
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
707
|
-
onBlur: (event) => {
|
|
708
|
-
onBlur?.(event);
|
|
709
|
-
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
710
|
-
onEditCompleted(event.target.value);
|
|
711
|
-
clearTimer();
|
|
712
|
-
}
|
|
713
|
-
},
|
|
714
|
-
onChange: (e) => {
|
|
715
|
-
const value2 = e.target.value;
|
|
716
|
-
if (onEditCompleted) {
|
|
717
|
-
restartTimer(() => {
|
|
718
|
-
if (innerRef.current) {
|
|
719
|
-
innerRef.current.blur();
|
|
720
|
-
if (!allowEditCompleteOnBlur) {
|
|
721
|
-
onEditCompleted(value2);
|
|
722
|
-
}
|
|
723
|
-
} else {
|
|
724
|
-
onEditCompleted(value2);
|
|
725
|
-
}
|
|
726
|
-
});
|
|
727
|
-
}
|
|
728
|
-
onChange(e);
|
|
729
|
-
onChangeText(value2);
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
)
|
|
733
|
-
] });
|
|
734
|
-
});
|
|
735
|
-
var FormInput = (0, import_react10.forwardRef)(function FormInput2({
|
|
736
|
-
id,
|
|
737
|
-
labelText,
|
|
738
|
-
errorText,
|
|
739
|
-
className,
|
|
740
|
-
labelClassName,
|
|
741
|
-
errorClassName,
|
|
742
|
-
containerClassName,
|
|
743
|
-
required,
|
|
744
|
-
disabled,
|
|
745
|
-
...restProps
|
|
746
|
-
}, ref) {
|
|
747
|
-
const input = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
748
|
-
"input",
|
|
749
|
-
{
|
|
750
|
-
...restProps,
|
|
751
|
-
ref,
|
|
752
|
-
id,
|
|
753
|
-
disabled,
|
|
754
|
-
className: (0, import_clsx5.default)(
|
|
755
|
-
getInputClassName({ disabled, hasError: !!errorText }),
|
|
756
|
-
className
|
|
757
|
-
)
|
|
758
|
-
}
|
|
759
|
-
);
|
|
760
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
761
|
-
labelText && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { htmlFor: id, className: (0, import_clsx5.default)("textstyle-label-md", labelClassName), children: [
|
|
762
|
-
labelText,
|
|
763
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
764
|
-
] }),
|
|
765
|
-
input,
|
|
766
|
-
errorText && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: id, className: (0, import_clsx5.default)("text-negative", errorClassName), children: errorText })
|
|
767
|
-
] });
|
|
768
|
-
});
|
|
769
|
-
|
|
770
|
-
// src/localization/defaults/form.ts
|
|
771
|
-
var formTranslation = {
|
|
772
|
-
en: {
|
|
773
|
-
add: "Add",
|
|
774
|
-
all: "All",
|
|
775
|
-
apply: "Apply",
|
|
776
|
-
back: "Back",
|
|
777
|
-
cancel: "Cancel",
|
|
778
|
-
change: "Change",
|
|
779
|
-
clear: "Clear",
|
|
780
|
-
click: "Click",
|
|
781
|
-
clickToCopy: "Click to Copy",
|
|
782
|
-
close: "Close",
|
|
783
|
-
confirm: "Confirm",
|
|
784
|
-
copy: "Copy",
|
|
785
|
-
copied: "Copied",
|
|
786
|
-
create: "Create",
|
|
787
|
-
decline: "Decline",
|
|
788
|
-
delete: "Delete",
|
|
789
|
-
discard: "Discard",
|
|
790
|
-
discardChanges: "Discard Changes",
|
|
791
|
-
done: "Done",
|
|
792
|
-
edit: "Edit",
|
|
793
|
-
enterText: "Enter text here",
|
|
794
|
-
error: "Error",
|
|
795
|
-
exit: "Exit",
|
|
796
|
-
fieldRequiredError: "This field is required.",
|
|
797
|
-
invalidEmailError: "Please enter a valid email address.",
|
|
798
|
-
less: "Less",
|
|
799
|
-
loading: "Loading",
|
|
800
|
-
maxLengthError: "Maximum length exceeded.",
|
|
801
|
-
minLengthError: "Minimum length not met.",
|
|
802
|
-
more: "More",
|
|
803
|
-
next: "Next",
|
|
804
|
-
no: "No",
|
|
805
|
-
none: "None",
|
|
806
|
-
of: "of",
|
|
807
|
-
optional: "Optional",
|
|
808
|
-
pleaseWait: "Please wait...",
|
|
809
|
-
previous: "Previous",
|
|
810
|
-
remove: "Remove",
|
|
811
|
-
required: "Required",
|
|
812
|
-
reset: "Reset",
|
|
813
|
-
save: "Save",
|
|
814
|
-
saved: "Saved",
|
|
815
|
-
search: "Search",
|
|
816
|
-
select: "Select",
|
|
817
|
-
selectOption: "Select an option",
|
|
818
|
-
show: "Show",
|
|
819
|
-
showMore: "Show more",
|
|
820
|
-
showLess: "Show less",
|
|
821
|
-
submit: "Submit",
|
|
822
|
-
success: "Success",
|
|
823
|
-
update: "Update",
|
|
824
|
-
unsavedChanges: "Unsaved Changes",
|
|
825
|
-
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
826
|
-
yes: "Yes"
|
|
827
|
-
},
|
|
828
|
-
de: {
|
|
829
|
-
add: "Hinzuf\xFCgen",
|
|
830
|
-
all: "Alle",
|
|
831
|
-
apply: "Anwenden",
|
|
832
|
-
back: "Zur\xFCck",
|
|
833
|
-
cancel: "Abbrechen",
|
|
834
|
-
change: "\xC4ndern",
|
|
835
|
-
clear: "L\xF6schen",
|
|
836
|
-
click: "Klicken",
|
|
837
|
-
clickToCopy: "Zum kopieren klicken",
|
|
838
|
-
close: "Schlie\xDFen",
|
|
839
|
-
confirm: "Best\xE4tigen",
|
|
840
|
-
copy: "Kopieren",
|
|
841
|
-
copied: "Kopiert",
|
|
842
|
-
create: "Erstellen",
|
|
843
|
-
decline: "Ablehnen",
|
|
844
|
-
delete: "L\xF6schen",
|
|
845
|
-
discard: "Verwerfen",
|
|
846
|
-
discardChanges: "\xC4nderungen Verwerfen",
|
|
847
|
-
done: "Fertig",
|
|
848
|
-
edit: "Bearbeiten",
|
|
849
|
-
enterText: "Text hier eingeben",
|
|
850
|
-
error: "Fehler",
|
|
851
|
-
exit: "Beenden",
|
|
852
|
-
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
853
|
-
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
854
|
-
less: "Weniger",
|
|
855
|
-
loading: "L\xE4dt",
|
|
856
|
-
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
857
|
-
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
858
|
-
more: "Mehr",
|
|
859
|
-
next: "Weiter",
|
|
860
|
-
no: "Nein",
|
|
861
|
-
none: "Nichts",
|
|
862
|
-
of: "von",
|
|
863
|
-
optional: "Optional",
|
|
864
|
-
pleaseWait: "Bitte warten...",
|
|
865
|
-
previous: "Vorherige",
|
|
866
|
-
remove: "Entfernen",
|
|
867
|
-
required: "Erforderlich",
|
|
868
|
-
reset: "Zur\xFCcksetzen",
|
|
869
|
-
save: "Speichern",
|
|
870
|
-
saved: "Gespeichert",
|
|
871
|
-
search: "Suche",
|
|
872
|
-
select: "Select",
|
|
873
|
-
selectOption: "Option ausw\xE4hlen",
|
|
874
|
-
show: "Anzeigen",
|
|
875
|
-
showMore: "Mehr anzeigen",
|
|
876
|
-
showLess: "Weniger anzeigen",
|
|
877
|
-
submit: "Abschicken",
|
|
878
|
-
success: "Erfolg",
|
|
879
|
-
update: "Update",
|
|
880
|
-
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
881
|
-
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
882
|
-
yes: "Ja"
|
|
883
|
-
}
|
|
884
|
-
};
|
|
885
|
-
|
|
886
|
-
// src/components/user-action/Button.tsx
|
|
887
|
-
var import_react11 = require("react");
|
|
888
|
-
var import_clsx6 = __toESM(require("clsx"));
|
|
889
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
890
|
-
var ButtonColorUtil = {
|
|
891
|
-
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
892
|
-
text: ["primary", "negative", "neutral"],
|
|
893
|
-
outline: ["primary"]
|
|
894
|
-
};
|
|
895
|
-
var IconButtonUtil = {
|
|
896
|
-
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
897
|
-
};
|
|
898
|
-
var paddingMapping = {
|
|
899
|
-
small: "btn-sm",
|
|
900
|
-
medium: "btn-md",
|
|
901
|
-
large: "btn-lg"
|
|
902
|
-
};
|
|
903
|
-
var iconPaddingMapping = {
|
|
904
|
-
tiny: "icon-btn-xs",
|
|
905
|
-
small: "icon-btn-sm",
|
|
906
|
-
medium: "icon-btn-md",
|
|
907
|
-
large: "icon-btn-lg"
|
|
908
|
-
};
|
|
909
|
-
var ButtonUtil = {
|
|
910
|
-
paddingMapping,
|
|
911
|
-
iconPaddingMapping
|
|
912
|
-
};
|
|
913
|
-
var SolidButton = (0, import_react11.forwardRef)(function SolidButton2({
|
|
914
|
-
children,
|
|
915
|
-
disabled = false,
|
|
916
|
-
color = "primary",
|
|
917
|
-
size = "medium",
|
|
918
|
-
startIcon,
|
|
919
|
-
endIcon,
|
|
920
|
-
onClick,
|
|
921
|
-
className,
|
|
922
|
-
...restProps
|
|
923
|
-
}, ref) {
|
|
924
|
-
const colorClasses = {
|
|
925
|
-
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
926
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
927
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
928
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
929
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
930
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
931
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
932
|
-
}[color];
|
|
933
|
-
const iconColorClasses = {
|
|
934
|
-
primary: "text-button-solid-primary-icon",
|
|
935
|
-
secondary: "text-button-solid-secondary-icon",
|
|
936
|
-
tertiary: "text-button-solid-tertiary-icon",
|
|
937
|
-
positive: "text-button-solid-positive-icon",
|
|
938
|
-
warning: "text-button-solid-warning-icon",
|
|
939
|
-
negative: "text-button-solid-negative-icon",
|
|
940
|
-
neutral: "text-button-solid-neutral-icon"
|
|
941
|
-
}[color];
|
|
942
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
943
|
-
"button",
|
|
944
|
-
{
|
|
945
|
-
ref,
|
|
946
|
-
onClick,
|
|
947
|
-
disabled,
|
|
948
|
-
className: (0, import_clsx6.default)(
|
|
949
|
-
"font-semibold",
|
|
950
|
-
{
|
|
951
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
952
|
-
[(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
953
|
-
},
|
|
954
|
-
ButtonUtil.paddingMapping[size],
|
|
955
|
-
className
|
|
956
|
-
),
|
|
957
|
-
...restProps,
|
|
958
|
-
children: [
|
|
959
|
-
startIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
960
|
-
"span",
|
|
961
|
-
{
|
|
962
|
-
className: (0, import_clsx6.default)({
|
|
963
|
-
[iconColorClasses]: !disabled,
|
|
964
|
-
[`text-disabled-icon`]: disabled
|
|
965
|
-
}),
|
|
966
|
-
children: startIcon
|
|
936
|
+
onChangeText = noop,
|
|
937
|
+
onEditCompleted,
|
|
938
|
+
className = "",
|
|
939
|
+
allowEnterComplete = true,
|
|
940
|
+
expanded = true,
|
|
941
|
+
autoFocus = false,
|
|
942
|
+
onBlur,
|
|
943
|
+
editCompleteOptions,
|
|
944
|
+
containerClassName,
|
|
945
|
+
disabled,
|
|
946
|
+
...restProps
|
|
947
|
+
}, forwardedRef) {
|
|
948
|
+
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
949
|
+
const {
|
|
950
|
+
restartTimer,
|
|
951
|
+
clearTimer
|
|
952
|
+
} = useDelay({ delay, disabled: !afterDelay });
|
|
953
|
+
const innerRef = (0, import_react11.useRef)(null);
|
|
954
|
+
const { focusNext } = useFocusManagement();
|
|
955
|
+
useFocusOnceVisible(innerRef, !autoFocus);
|
|
956
|
+
(0, import_react11.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
957
|
+
const handleKeyDown = (e) => {
|
|
958
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
959
|
+
e.preventDefault();
|
|
960
|
+
innerRef.current?.blur();
|
|
961
|
+
focusNext();
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_clsx6.default)({ "w-full": expanded }, containerClassName), children: [
|
|
965
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx6.default)("mb-1", label.className) }),
|
|
966
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
967
|
+
"input",
|
|
968
|
+
{
|
|
969
|
+
...restProps,
|
|
970
|
+
ref: innerRef,
|
|
971
|
+
value,
|
|
972
|
+
id,
|
|
973
|
+
type,
|
|
974
|
+
disabled,
|
|
975
|
+
className: (0, import_clsx6.default)(getInputClassName({ disabled }), className),
|
|
976
|
+
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
977
|
+
onBlur: (event) => {
|
|
978
|
+
onBlur?.(event);
|
|
979
|
+
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
980
|
+
onEditCompleted(event.target.value);
|
|
981
|
+
clearTimer();
|
|
967
982
|
}
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
983
|
+
},
|
|
984
|
+
onChange: (e) => {
|
|
985
|
+
const value2 = e.target.value;
|
|
986
|
+
if (onEditCompleted) {
|
|
987
|
+
restartTimer(() => {
|
|
988
|
+
if (innerRef.current) {
|
|
989
|
+
innerRef.current.blur();
|
|
990
|
+
if (!allowEditCompleteOnBlur) {
|
|
991
|
+
onEditCompleted(value2);
|
|
992
|
+
}
|
|
993
|
+
} else {
|
|
994
|
+
onEditCompleted(value2);
|
|
995
|
+
}
|
|
996
|
+
});
|
|
978
997
|
}
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
998
|
+
onChange(e);
|
|
999
|
+
onChangeText(value2);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
)
|
|
1003
|
+
] });
|
|
983
1004
|
});
|
|
984
|
-
var
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
size = "medium",
|
|
1005
|
+
var FormInput = (0, import_react11.forwardRef)(function FormInput2({
|
|
1006
|
+
id,
|
|
1007
|
+
labelText,
|
|
1008
|
+
errorText,
|
|
989
1009
|
className,
|
|
1010
|
+
labelClassName,
|
|
1011
|
+
errorClassName,
|
|
1012
|
+
containerClassName,
|
|
1013
|
+
required,
|
|
1014
|
+
disabled,
|
|
990
1015
|
...restProps
|
|
991
|
-
})
|
|
992
|
-
const
|
|
993
|
-
|
|
994
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
995
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
996
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
997
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
998
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
999
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
1000
|
-
transparent: "bg-transparent"
|
|
1001
|
-
}[color];
|
|
1002
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1003
|
-
"button",
|
|
1016
|
+
}, ref) {
|
|
1017
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1018
|
+
"input",
|
|
1004
1019
|
{
|
|
1020
|
+
...restProps,
|
|
1021
|
+
ref,
|
|
1022
|
+
id,
|
|
1005
1023
|
disabled,
|
|
1006
1024
|
className: (0, import_clsx6.default)(
|
|
1007
|
-
{
|
|
1008
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
1009
|
-
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
1010
|
-
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
1011
|
-
[(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
1012
|
-
},
|
|
1013
|
-
ButtonUtil.iconPaddingMapping[size],
|
|
1025
|
+
getInputClassName({ disabled, hasError: !!errorText }),
|
|
1014
1026
|
className
|
|
1015
|
-
)
|
|
1016
|
-
...restProps,
|
|
1017
|
-
children
|
|
1027
|
+
)
|
|
1018
1028
|
}
|
|
1019
1029
|
);
|
|
1020
|
-
|
|
1030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_clsx6.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
1031
|
+
labelText && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { htmlFor: id, className: (0, import_clsx6.default)("textstyle-label-md", labelClassName), children: [
|
|
1032
|
+
labelText,
|
|
1033
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
1034
|
+
] }),
|
|
1035
|
+
input,
|
|
1036
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: id, className: (0, import_clsx6.default)("text-negative", errorClassName), children: errorText })
|
|
1037
|
+
] });
|
|
1038
|
+
});
|
|
1021
1039
|
|
|
1022
1040
|
// src/components/user-action/SearchBar.tsx
|
|
1023
|
-
var
|
|
1041
|
+
var import_lucide_react2 = require("lucide-react");
|
|
1024
1042
|
var import_clsx7 = require("clsx");
|
|
1025
1043
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1026
1044
|
var SearchBar = ({
|
|
@@ -1039,7 +1057,7 @@ var SearchBar = ({
|
|
|
1039
1057
|
placeholder: placeholder ?? translation("search")
|
|
1040
1058
|
}
|
|
1041
1059
|
),
|
|
1042
|
-
onSearch && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1060
|
+
onSearch && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Search, { className: "w-full h-full" }) })
|
|
1043
1061
|
] });
|
|
1044
1062
|
};
|
|
1045
1063
|
|
|
@@ -1111,96 +1129,12 @@ var useSearch = ({
|
|
|
1111
1129
|
};
|
|
1112
1130
|
};
|
|
1113
1131
|
|
|
1114
|
-
// src/components/user-action/Select.tsx
|
|
1115
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1116
|
-
var SelectTile = ({
|
|
1117
|
-
className,
|
|
1118
|
-
disabledClassName,
|
|
1119
|
-
title,
|
|
1120
|
-
...restProps
|
|
1121
|
-
}) => {
|
|
1122
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1123
|
-
Tile,
|
|
1124
|
-
{
|
|
1125
|
-
...restProps,
|
|
1126
|
-
className: (0, import_clsx8.default)("px-2 py-1 rounded-md", className),
|
|
1127
|
-
disabledClassName: disabledClassName ?? "text-disabled-text cursor-not-allowed",
|
|
1128
|
-
title: { ...title, className: title.className ?? "font-semibold" }
|
|
1129
|
-
}
|
|
1130
|
-
);
|
|
1131
|
-
};
|
|
1132
|
-
|
|
1133
|
-
// src/components/layout-and-navigation/Chip.tsx
|
|
1134
|
-
var import_clsx9 = __toESM(require("clsx"));
|
|
1135
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1136
|
-
var Chip = ({
|
|
1137
|
-
children,
|
|
1138
|
-
trailingIcon,
|
|
1139
|
-
color = "default",
|
|
1140
|
-
variant = "normal",
|
|
1141
|
-
className = "",
|
|
1142
|
-
...restProps
|
|
1143
|
-
}) => {
|
|
1144
|
-
const colorMapping = {
|
|
1145
|
-
default: "text-tag-default-text bg-tag-default-background",
|
|
1146
|
-
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
1147
|
-
red: "text-tag-red-text bg-tag-red-background",
|
|
1148
|
-
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
1149
|
-
green: "text-tag-green-text bg-tag-green-background",
|
|
1150
|
-
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
1151
|
-
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
1152
|
-
}[color];
|
|
1153
|
-
const colorMappingIcon = {
|
|
1154
|
-
default: "text-tag-default-icon",
|
|
1155
|
-
dark: "text-tag-dark-icon",
|
|
1156
|
-
red: "text-tag-red-icon",
|
|
1157
|
-
yellow: "text-tag-yellow-icon",
|
|
1158
|
-
green: "text-tag-green-icon",
|
|
1159
|
-
blue: "text-tag-blue-icon",
|
|
1160
|
-
pink: "text-tag-pink-icon"
|
|
1161
|
-
}[color];
|
|
1162
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1163
|
-
"div",
|
|
1164
|
-
{
|
|
1165
|
-
...restProps,
|
|
1166
|
-
className: (0, import_clsx9.default)(
|
|
1167
|
-
`row w-fit px-2 py-1`,
|
|
1168
|
-
colorMapping,
|
|
1169
|
-
{
|
|
1170
|
-
"rounded-md": variant === "normal",
|
|
1171
|
-
"rounded-full": variant === "fullyRounded"
|
|
1172
|
-
},
|
|
1173
|
-
className
|
|
1174
|
-
),
|
|
1175
|
-
children: [
|
|
1176
|
-
children,
|
|
1177
|
-
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
|
|
1178
|
-
]
|
|
1179
|
-
}
|
|
1180
|
-
);
|
|
1181
|
-
};
|
|
1182
|
-
var ChipList = ({
|
|
1183
|
-
list,
|
|
1184
|
-
className = ""
|
|
1185
|
-
}) => {
|
|
1186
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: (0, import_clsx9.default)("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1187
|
-
Chip,
|
|
1188
|
-
{
|
|
1189
|
-
...value,
|
|
1190
|
-
color: value.color ?? "dark",
|
|
1191
|
-
variant: value.variant ?? "normal",
|
|
1192
|
-
children: value.children
|
|
1193
|
-
},
|
|
1194
|
-
index
|
|
1195
|
-
)) });
|
|
1196
|
-
};
|
|
1197
|
-
|
|
1198
1132
|
// src/components/user-action/Checkbox.tsx
|
|
1199
|
-
var
|
|
1133
|
+
var import_react13 = require("react");
|
|
1200
1134
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
1201
|
-
var
|
|
1202
|
-
var
|
|
1203
|
-
var
|
|
1135
|
+
var import_lucide_react3 = require("lucide-react");
|
|
1136
|
+
var import_clsx8 = __toESM(require("clsx"));
|
|
1137
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1204
1138
|
var checkboxSizeMapping = {
|
|
1205
1139
|
small: "size-5",
|
|
1206
1140
|
medium: "size-6",
|
|
@@ -1236,33 +1170,92 @@ var Checkbox = ({
|
|
|
1236
1170
|
const newValue = checked === "indeterminate" ? false : !checked;
|
|
1237
1171
|
propagateChange(newValue);
|
|
1238
1172
|
};
|
|
1239
|
-
return /* @__PURE__ */ (0,
|
|
1240
|
-
/* @__PURE__ */ (0,
|
|
1173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_clsx8.default)("group flex-row-2 items-center cursor-pointer", containerClassName), onClick: changeValue, children: [
|
|
1174
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1241
1175
|
CheckboxPrimitive.Root,
|
|
1242
1176
|
{
|
|
1243
1177
|
onCheckedChange: propagateChange,
|
|
1244
1178
|
checked,
|
|
1245
1179
|
disabled,
|
|
1246
1180
|
id,
|
|
1247
|
-
className: (0,
|
|
1181
|
+
className: (0, import_clsx8.default)(usedSizeClass, `items-center border-2 rounded outline-none `, {
|
|
1248
1182
|
"text-disabled-text border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
|
|
1249
1183
|
"focus:border-primary group-hover:border-primary ": !disabled,
|
|
1250
1184
|
"bg-input-background": !disabled && !checked,
|
|
1251
1185
|
"bg-primary/30 border-primary text-primary": !disabled && checked === true || checked === "indeterminate"
|
|
1252
1186
|
}, className),
|
|
1253
|
-
children: /* @__PURE__ */ (0,
|
|
1254
|
-
checked === true && /* @__PURE__ */ (0,
|
|
1255
|
-
checked === "indeterminate" && /* @__PURE__ */ (0,
|
|
1187
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(CheckboxPrimitive.Indicator, { children: [
|
|
1188
|
+
checked === true && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Check, { className: innerIconSize }),
|
|
1189
|
+
checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Minus, { className: innerIconSize })
|
|
1256
1190
|
] })
|
|
1257
1191
|
}
|
|
1258
1192
|
),
|
|
1259
|
-
label && /* @__PURE__ */ (0,
|
|
1193
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Label, { ...label, className: (0, import_clsx8.default)(label.className), htmlFor: id })
|
|
1260
1194
|
] });
|
|
1261
1195
|
};
|
|
1262
1196
|
|
|
1263
1197
|
// src/components/user-action/MultiSelect.tsx
|
|
1264
1198
|
var import_lucide_react5 = require("lucide-react");
|
|
1265
|
-
|
|
1199
|
+
|
|
1200
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
1201
|
+
var import_clsx9 = __toESM(require("clsx"));
|
|
1202
|
+
var import_lucide_react4 = require("lucide-react");
|
|
1203
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1204
|
+
var Tile = ({
|
|
1205
|
+
title,
|
|
1206
|
+
titleClassName,
|
|
1207
|
+
description,
|
|
1208
|
+
descriptionClassName,
|
|
1209
|
+
onClick,
|
|
1210
|
+
isSelected = false,
|
|
1211
|
+
disabled = false,
|
|
1212
|
+
prefix,
|
|
1213
|
+
suffix,
|
|
1214
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
1215
|
+
selectedClassName = "bg-primary/20",
|
|
1216
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
1217
|
+
className
|
|
1218
|
+
}) => {
|
|
1219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1220
|
+
"div",
|
|
1221
|
+
{
|
|
1222
|
+
className: (0, import_clsx9.default)(
|
|
1223
|
+
"flex-row-2 w-full items-center",
|
|
1224
|
+
{
|
|
1225
|
+
[normalClassName]: onClick && !disabled,
|
|
1226
|
+
[selectedClassName]: isSelected && !disabled,
|
|
1227
|
+
[disabledClassName]: disabled
|
|
1228
|
+
},
|
|
1229
|
+
className
|
|
1230
|
+
),
|
|
1231
|
+
onClick: disabled ? void 0 : onClick,
|
|
1232
|
+
children: [
|
|
1233
|
+
prefix,
|
|
1234
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex-col-0 w-full", children: [
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: (0, import_clsx9.default)(titleClassName ?? "textstyle-title-normal"), children: title }),
|
|
1236
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: (0, import_clsx9.default)(descriptionClassName ?? "textstyle-description"), children: description })
|
|
1237
|
+
] }),
|
|
1238
|
+
suffix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Check, { size: 24 }) : void 0)
|
|
1239
|
+
]
|
|
1240
|
+
}
|
|
1241
|
+
);
|
|
1242
|
+
};
|
|
1243
|
+
var ListTile = ({
|
|
1244
|
+
...props
|
|
1245
|
+
}) => {
|
|
1246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1247
|
+
Tile,
|
|
1248
|
+
{
|
|
1249
|
+
...props,
|
|
1250
|
+
titleClassName: props.titleClassName ?? "font-semibold",
|
|
1251
|
+
className: (0, import_clsx9.default)("px-2 py-1 rounded-md", props.className),
|
|
1252
|
+
disabledClassName: props.disabledClassName ?? "text-disabled-text cursor-not-allowed"
|
|
1253
|
+
}
|
|
1254
|
+
);
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1257
|
+
// src/components/user-action/MultiSelect.tsx
|
|
1258
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1266
1259
|
var defaultMultiSelectTranslation = {
|
|
1267
1260
|
en: {
|
|
1268
1261
|
selected: `{{amount}} selected`
|
|
@@ -1289,30 +1282,30 @@ var MultiSelect = ({
|
|
|
1289
1282
|
const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
|
|
1290
1283
|
const { result, search, setSearch } = useSearch({
|
|
1291
1284
|
list: options,
|
|
1292
|
-
searchMapping: (0,
|
|
1285
|
+
searchMapping: (0, import_react14.useCallback)((item) => item.searchTags, []),
|
|
1293
1286
|
...searchOptions
|
|
1294
1287
|
});
|
|
1295
1288
|
const selectedItems = options.filter((value) => value.selected);
|
|
1296
1289
|
const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
|
|
1297
|
-
return /* @__PURE__ */ (0,
|
|
1298
|
-
label && /* @__PURE__ */ (0,
|
|
1290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: (0, import_clsx10.default)(className), children: [
|
|
1291
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1299
1292
|
Label,
|
|
1300
1293
|
{
|
|
1301
1294
|
...label,
|
|
1302
1295
|
htmlFor: label.name,
|
|
1303
|
-
className: (0,
|
|
1296
|
+
className: (0, import_clsx10.default)(" mb-1", label.className),
|
|
1304
1297
|
labelType: label.labelType ?? "labelBig"
|
|
1305
1298
|
}
|
|
1306
1299
|
),
|
|
1307
|
-
/* @__PURE__ */ (0,
|
|
1300
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1308
1301
|
Menu,
|
|
1309
1302
|
{
|
|
1310
1303
|
...menuProps,
|
|
1311
|
-
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ (0,
|
|
1304
|
+
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1312
1305
|
"button",
|
|
1313
1306
|
{
|
|
1314
1307
|
ref,
|
|
1315
|
-
className: (0,
|
|
1308
|
+
className: (0, import_clsx10.default)(
|
|
1316
1309
|
"group btn-md justify-between w-full border-2 h-auto",
|
|
1317
1310
|
{
|
|
1318
1311
|
"min-h-14": useChipDisplay,
|
|
@@ -1323,18 +1316,30 @@ var MultiSelect = ({
|
|
|
1323
1316
|
),
|
|
1324
1317
|
onClick: toggleOpen,
|
|
1325
1318
|
disabled,
|
|
1326
|
-
children: useChipDisplay ? /* @__PURE__ */ (0,
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1319
|
+
children: useChipDisplay ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, { children: isShowingHint ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1320
|
+
"div",
|
|
1321
|
+
{
|
|
1322
|
+
className: (0, import_clsx10.default)(
|
|
1323
|
+
"icon-btn-sm ",
|
|
1324
|
+
{
|
|
1325
|
+
"bg-button-solid-neutral-background text-button-solid-neutral-text hover:brightness-90 group-hover:brightness-90": !disabled,
|
|
1326
|
+
"bg-disabled-background text-disabled-text": disabled
|
|
1327
|
+
}
|
|
1328
|
+
),
|
|
1329
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react5.Plus, {})
|
|
1330
|
+
}
|
|
1331
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1332
|
+
!isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? translation("selected", { replacements: { amount: selectedItems.length.toString() } }) }),
|
|
1333
|
+
isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: (0, import_clsx10.default)("textstyle-description", hintTextClassName), children: hintText ?? translation("select") }),
|
|
1334
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ExpansionIcon, { isExpanded: isOpen })
|
|
1330
1335
|
] })
|
|
1331
1336
|
}
|
|
1332
1337
|
),
|
|
1333
|
-
menuClassName: (0,
|
|
1338
|
+
menuClassName: (0, import_clsx10.default)("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
|
|
1334
1339
|
children: (bag) => {
|
|
1335
1340
|
const { close } = bag;
|
|
1336
|
-
return /* @__PURE__ */ (0,
|
|
1337
|
-
!searchOptions?.disabled && /* @__PURE__ */ (0,
|
|
1341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1342
|
+
!searchOptions?.disabled && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1338
1343
|
SearchBar,
|
|
1339
1344
|
{
|
|
1340
1345
|
value: search,
|
|
@@ -1342,7 +1347,7 @@ var MultiSelect = ({
|
|
|
1342
1347
|
autoFocus: true
|
|
1343
1348
|
}
|
|
1344
1349
|
),
|
|
1345
|
-
/* @__PURE__ */ (0,
|
|
1350
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-col-2 overflow-y-auto", children: [
|
|
1346
1351
|
result.map((option, index) => {
|
|
1347
1352
|
const update = () => {
|
|
1348
1353
|
onChange(options.map((value) => value.value === option.value ? {
|
|
@@ -1350,10 +1355,10 @@ var MultiSelect = ({
|
|
|
1350
1355
|
selected: !value.selected
|
|
1351
1356
|
} : value));
|
|
1352
1357
|
};
|
|
1353
|
-
return /* @__PURE__ */ (0,
|
|
1354
|
-
|
|
1358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1359
|
+
ListTile,
|
|
1355
1360
|
{
|
|
1356
|
-
prefix: /* @__PURE__ */ (0,
|
|
1361
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1357
1362
|
Checkbox,
|
|
1358
1363
|
{
|
|
1359
1364
|
checked: option.selected,
|
|
@@ -1362,7 +1367,7 @@ var MultiSelect = ({
|
|
|
1362
1367
|
disabled: option.disabled
|
|
1363
1368
|
}
|
|
1364
1369
|
),
|
|
1365
|
-
title:
|
|
1370
|
+
title: option.label,
|
|
1366
1371
|
onClick: update,
|
|
1367
1372
|
disabled: option.disabled
|
|
1368
1373
|
},
|
|
@@ -1371,9 +1376,9 @@ var MultiSelect = ({
|
|
|
1371
1376
|
}),
|
|
1372
1377
|
additionalItems && additionalItems({ ...bag, search })
|
|
1373
1378
|
] }),
|
|
1374
|
-
/* @__PURE__ */ (0,
|
|
1375
|
-
/* @__PURE__ */ (0,
|
|
1376
|
-
/* @__PURE__ */ (0,
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-row-2 justify-between", children: [
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-row-2", children: [
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1377
1382
|
SolidButton,
|
|
1378
1383
|
{
|
|
1379
1384
|
color: "neutral",
|
|
@@ -1388,7 +1393,7 @@ var MultiSelect = ({
|
|
|
1388
1393
|
children: translation("all")
|
|
1389
1394
|
}
|
|
1390
1395
|
),
|
|
1391
|
-
/* @__PURE__ */ (0,
|
|
1396
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1392
1397
|
SolidButton,
|
|
1393
1398
|
{
|
|
1394
1399
|
color: "neutral",
|
|
@@ -1403,7 +1408,7 @@ var MultiSelect = ({
|
|
|
1403
1408
|
}
|
|
1404
1409
|
)
|
|
1405
1410
|
] }),
|
|
1406
|
-
/* @__PURE__ */ (0,
|
|
1411
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SolidButton, { size: "small", onClick: close, children: "Done" })
|
|
1407
1412
|
] })
|
|
1408
1413
|
] });
|
|
1409
1414
|
}
|
|
@@ -1416,11 +1421,11 @@ var MultiSelectUncontrolled = ({
|
|
|
1416
1421
|
onChange,
|
|
1417
1422
|
...props
|
|
1418
1423
|
}) => {
|
|
1419
|
-
const [usedOptions, setUsedOptions] = (0,
|
|
1420
|
-
(0,
|
|
1424
|
+
const [usedOptions, setUsedOptions] = (0, import_react15.useState)(options);
|
|
1425
|
+
(0, import_react15.useEffect)(() => {
|
|
1421
1426
|
setUsedOptions(options);
|
|
1422
1427
|
}, [options]);
|
|
1423
|
-
return /* @__PURE__ */ (0,
|
|
1428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1424
1429
|
MultiSelect,
|
|
1425
1430
|
{
|
|
1426
1431
|
...props,
|