@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.
Files changed (102) hide show
  1. package/README.md +5 -0
  2. package/dist/components/branding/HelpwaveBadge.js +8 -5
  3. package/dist/components/branding/HelpwaveBadge.js.map +1 -1
  4. package/dist/components/branding/HelpwaveBadge.mjs +8 -5
  5. package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
  6. package/dist/components/icons-and-geometry/Avatar.js +2912 -33
  7. package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
  8. package/dist/components/icons-and-geometry/Avatar.mjs +2941 -33
  9. package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
  10. package/dist/components/icons-and-geometry/Tag.js +2912 -1
  11. package/dist/components/icons-and-geometry/Tag.js.map +1 -1
  12. package/dist/components/icons-and-geometry/Tag.mjs +2931 -1
  13. package/dist/components/icons-and-geometry/Tag.mjs.map +1 -1
  14. package/dist/components/layout-and-navigation/BreadCrumb.d.mts +2 -1
  15. package/dist/components/layout-and-navigation/BreadCrumb.d.ts +2 -1
  16. package/dist/components/layout-and-navigation/BreadCrumb.js +15 -11
  17. package/dist/components/layout-and-navigation/BreadCrumb.js.map +1 -1
  18. package/dist/components/layout-and-navigation/BreadCrumb.mjs +15 -11
  19. package/dist/components/layout-and-navigation/BreadCrumb.mjs.map +1 -1
  20. package/dist/components/layout-and-navigation/Chip.js +2 -2
  21. package/dist/components/layout-and-navigation/Chip.js.map +1 -1
  22. package/dist/components/layout-and-navigation/Chip.mjs +2 -2
  23. package/dist/components/layout-and-navigation/Chip.mjs.map +1 -1
  24. package/dist/components/layout-and-navigation/Tile.d.mts +9 -10
  25. package/dist/components/layout-and-navigation/Tile.d.ts +9 -10
  26. package/dist/components/layout-and-navigation/Tile.js +21 -4
  27. package/dist/components/layout-and-navigation/Tile.js.map +1 -1
  28. package/dist/components/layout-and-navigation/Tile.mjs +20 -4
  29. package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
  30. package/dist/components/loading-states/LoadingAndErrorComponent.js +1 -1
  31. package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
  32. package/dist/components/loading-states/LoadingAndErrorComponent.mjs +1 -1
  33. package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
  34. package/dist/components/modals/LanguageModal.js +21 -22
  35. package/dist/components/modals/LanguageModal.js.map +1 -1
  36. package/dist/components/modals/LanguageModal.mjs +21 -22
  37. package/dist/components/modals/LanguageModal.mjs.map +1 -1
  38. package/dist/components/modals/ThemeModal.js +21 -22
  39. package/dist/components/modals/ThemeModal.js.map +1 -1
  40. package/dist/components/modals/ThemeModal.mjs +21 -22
  41. package/dist/components/modals/ThemeModal.mjs.map +1 -1
  42. package/dist/components/properties/CheckboxProperty.js +1 -1
  43. package/dist/components/properties/CheckboxProperty.js.map +1 -1
  44. package/dist/components/properties/CheckboxProperty.mjs +1 -1
  45. package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
  46. package/dist/components/properties/DateProperty.js +1 -1
  47. package/dist/components/properties/DateProperty.js.map +1 -1
  48. package/dist/components/properties/DateProperty.mjs +1 -1
  49. package/dist/components/properties/DateProperty.mjs.map +1 -1
  50. package/dist/components/properties/MultiSelectProperty.d.mts +0 -1
  51. package/dist/components/properties/MultiSelectProperty.d.ts +0 -1
  52. package/dist/components/properties/MultiSelectProperty.js +745 -740
  53. package/dist/components/properties/MultiSelectProperty.js.map +1 -1
  54. package/dist/components/properties/MultiSelectProperty.mjs +752 -747
  55. package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
  56. package/dist/components/properties/NumberProperty.js +1 -1
  57. package/dist/components/properties/NumberProperty.js.map +1 -1
  58. package/dist/components/properties/NumberProperty.mjs +1 -1
  59. package/dist/components/properties/NumberProperty.mjs.map +1 -1
  60. package/dist/components/properties/PropertyBase.js +1 -1
  61. package/dist/components/properties/PropertyBase.js.map +1 -1
  62. package/dist/components/properties/PropertyBase.mjs +1 -1
  63. package/dist/components/properties/PropertyBase.mjs.map +1 -1
  64. package/dist/components/properties/SelectProperty.d.mts +0 -1
  65. package/dist/components/properties/SelectProperty.d.ts +0 -1
  66. package/dist/components/properties/SelectProperty.js +24 -25
  67. package/dist/components/properties/SelectProperty.js.map +1 -1
  68. package/dist/components/properties/SelectProperty.mjs +24 -25
  69. package/dist/components/properties/SelectProperty.mjs.map +1 -1
  70. package/dist/components/properties/TextProperty.js +1 -1
  71. package/dist/components/properties/TextProperty.js.map +1 -1
  72. package/dist/components/properties/TextProperty.mjs +1 -1
  73. package/dist/components/properties/TextProperty.mjs.map +1 -1
  74. package/dist/components/user-action/MultiSelect.d.mts +0 -1
  75. package/dist/components/user-action/MultiSelect.d.ts +0 -1
  76. package/dist/components/user-action/MultiSelect.js +617 -612
  77. package/dist/components/user-action/MultiSelect.js.map +1 -1
  78. package/dist/components/user-action/MultiSelect.mjs +635 -630
  79. package/dist/components/user-action/MultiSelect.mjs.map +1 -1
  80. package/dist/components/user-action/ScrollPicker.js +1 -1
  81. package/dist/components/user-action/ScrollPicker.js.map +1 -1
  82. package/dist/components/user-action/ScrollPicker.mjs +1 -1
  83. package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
  84. package/dist/components/user-action/Select.d.mts +1 -4
  85. package/dist/components/user-action/Select.d.ts +1 -4
  86. package/dist/components/user-action/Select.js +21 -24
  87. package/dist/components/user-action/Select.js.map +1 -1
  88. package/dist/components/user-action/Select.mjs +21 -23
  89. package/dist/components/user-action/Select.mjs.map +1 -1
  90. package/dist/css/globals.css +175 -179
  91. package/dist/css/uncompiled/globals.css +3 -3
  92. package/dist/css/uncompiled/textstyles.css +5 -5
  93. package/dist/css/uncompiled/theme/colors-basic.css +13 -5
  94. package/dist/css/uncompiled/theme/colors-component.css +56 -41
  95. package/dist/css/uncompiled/theme/colors-semantic.css +76 -83
  96. package/dist/index.d.mts +2 -2
  97. package/dist/index.d.ts +2 -2
  98. package/dist/index.js +3158 -371
  99. package/dist/index.js.map +1 -1
  100. package/dist/index.mjs +3030 -243
  101. package/dist/index.mjs.map +1 -1
  102. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  // src/components/user-action/MultiSelect.tsx
2
- import { useCallback as useCallback6 } from "react";
3
- import { useEffect as useEffect12, useState as useState11 } from "react";
2
+ import { useCallback as useCallback5 } from "react";
3
+ import { useEffect as useEffect11, useState as useState10 } from "react";
4
4
 
5
5
  // src/localization/LanguageProvider.tsx
6
6
  import { createContext, useContext, useEffect as useEffect2, useState as useState2 } from "react";
@@ -90,7 +90,7 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
90
90
  };
91
91
 
92
92
  // src/components/user-action/MultiSelect.tsx
93
- import clsx11 from "clsx";
93
+ import clsx10 from "clsx";
94
94
 
95
95
  // src/components/user-action/Label.tsx
96
96
  import clsx from "clsx";
@@ -110,165 +110,331 @@ var Label = ({
110
110
  return /* @__PURE__ */ jsx2("label", { ...props, className: clsx(styleMapping[labelType], className), children: children ? children : name });
111
111
  };
112
112
 
113
- // src/components/user-action/Select.tsx
114
- import { useCallback as useCallback5 } from "react";
115
- import { useEffect as useEffect11, useState as useState9 } from "react";
116
- import clsx8 from "clsx";
117
-
118
- // src/components/layout-and-navigation/Tile.tsx
113
+ // src/components/user-action/Button.tsx
114
+ import { forwardRef } from "react";
119
115
  import clsx2 from "clsx";
120
- import { Check } from "lucide-react";
121
116
  import { jsx as jsx3, jsxs } from "react/jsx-runtime";
122
- var Tile = ({
123
- title,
124
- description,
125
- onClick,
126
- isSelected = false,
117
+ var ButtonColorUtil = {
118
+ solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
119
+ text: ["primary", "negative", "neutral"],
120
+ outline: ["primary"]
121
+ };
122
+ var IconButtonUtil = {
123
+ icon: [...ButtonColorUtil.solid, "transparent"]
124
+ };
125
+ var paddingMapping = {
126
+ small: "btn-sm",
127
+ medium: "btn-md",
128
+ large: "btn-lg"
129
+ };
130
+ var iconPaddingMapping = {
131
+ tiny: "icon-btn-xs",
132
+ small: "icon-btn-sm",
133
+ medium: "icon-btn-md",
134
+ large: "icon-btn-lg"
135
+ };
136
+ var ButtonUtil = {
137
+ paddingMapping,
138
+ iconPaddingMapping
139
+ };
140
+ var SolidButton = forwardRef(function SolidButton2({
141
+ children,
127
142
  disabled = false,
128
- prefix,
129
- suffix,
130
- normalClassName = "hover:bg-primary/40 cursor-pointer",
131
- selectedClassName = " bg-primary/20",
132
- disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
133
- className
134
- }) => {
143
+ color = "primary",
144
+ size = "medium",
145
+ startIcon,
146
+ endIcon,
147
+ onClick,
148
+ className,
149
+ ...restProps
150
+ }, ref) {
151
+ const colorClasses = {
152
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
153
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
154
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
155
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
156
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
157
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
158
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
159
+ }[color];
160
+ const iconColorClasses = {
161
+ primary: "text-button-solid-primary-icon",
162
+ secondary: "text-button-solid-secondary-icon",
163
+ tertiary: "text-button-solid-tertiary-icon",
164
+ positive: "text-button-solid-positive-icon",
165
+ warning: "text-button-solid-warning-icon",
166
+ negative: "text-button-solid-negative-icon",
167
+ neutral: "text-button-solid-neutral-icon"
168
+ }[color];
135
169
  return /* @__PURE__ */ jsxs(
136
- "div",
170
+ "button",
137
171
  {
172
+ ref,
173
+ onClick,
174
+ disabled,
138
175
  className: clsx2(
139
- "flex-row-2 w-full items-center",
176
+ "font-semibold",
140
177
  {
141
- [normalClassName]: !!onClick && !disabled,
142
- [selectedClassName]: isSelected && !disabled,
143
- [disabledClassName]: disabled
178
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
179
+ [clsx2(colorClasses, "hover:brightness-90")]: !disabled
144
180
  },
181
+ ButtonUtil.paddingMapping[size],
145
182
  className
146
183
  ),
147
- onClick: disabled ? void 0 : onClick,
184
+ ...restProps,
148
185
  children: [
149
- prefix,
150
- /* @__PURE__ */ jsxs("div", { className: "flex-col-0 w-full", children: [
151
- /* @__PURE__ */ jsx3("h4", { className: clsx2(title.className ?? "textstyle-title-normal"), children: title.value }),
152
- !!description && /* @__PURE__ */ jsx3("span", { className: clsx2(description.className ?? "textstyle-description"), children: description.value })
153
- ] }),
154
- suffix ?? (isSelected ? /* @__PURE__ */ jsx3(Check, { size: 24 }) : void 0)
186
+ startIcon && /* @__PURE__ */ jsx3(
187
+ "span",
188
+ {
189
+ className: clsx2({
190
+ [iconColorClasses]: !disabled,
191
+ [`text-disabled-icon`]: disabled
192
+ }),
193
+ children: startIcon
194
+ }
195
+ ),
196
+ children,
197
+ endIcon && /* @__PURE__ */ jsx3(
198
+ "span",
199
+ {
200
+ className: clsx2({
201
+ [iconColorClasses]: !disabled,
202
+ [`text-disabled-icon`]: disabled
203
+ }),
204
+ children: endIcon
205
+ }
206
+ )
155
207
  ]
156
208
  }
157
209
  );
158
- };
159
-
160
- // src/components/layout-and-navigation/Expandable.tsx
161
- import { forwardRef, useCallback as useCallback2, useEffect as useEffect3, useState as useState3 } from "react";
162
- import { ChevronDown } from "lucide-react";
163
- import clsx3 from "clsx";
164
-
165
- // src/util/noop.ts
166
- var noop = () => void 0;
167
-
168
- // src/components/layout-and-navigation/Expandable.tsx
169
- import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
170
- var ExpansionIcon = ({ isExpanded, className }) => {
171
- return /* @__PURE__ */ jsx4(
172
- ChevronDown,
210
+ });
211
+ var IconButton = ({
212
+ children,
213
+ disabled = false,
214
+ color = "primary",
215
+ size = "medium",
216
+ className,
217
+ ...restProps
218
+ }) => {
219
+ const colorClasses = {
220
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
221
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
222
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
223
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
224
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
225
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
226
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
227
+ transparent: "bg-transparent"
228
+ }[color];
229
+ return /* @__PURE__ */ jsx3(
230
+ "button",
173
231
  {
174
- className: clsx3(
175
- "min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
176
- { "rotate-180": isExpanded },
232
+ disabled,
233
+ className: clsx2(
234
+ {
235
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
236
+ "text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
237
+ "hover:bg-button-text-hover-background": !disabled && color === "transparent",
238
+ [clsx2(colorClasses, "hover:brightness-90")]: !disabled
239
+ },
240
+ ButtonUtil.iconPaddingMapping[size],
177
241
  className
178
- )
242
+ ),
243
+ ...restProps,
244
+ children
179
245
  }
180
246
  );
181
247
  };
182
- var Expandable = forwardRef(function Expandable2({
248
+
249
+ // src/components/layout-and-navigation/Chip.tsx
250
+ import clsx3 from "clsx";
251
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
252
+ var Chip = ({
183
253
  children,
184
- label,
185
- icon,
186
- isExpanded = false,
187
- onChange = noop,
188
- clickOnlyOnHeader = true,
189
- disabled = false,
190
- className,
191
- headerClassName,
192
- contentClassName,
193
- contentExpandedClassName
194
- }, ref) {
195
- const defaultIcon = useCallback2((expanded) => /* @__PURE__ */ jsx4(ExpansionIcon, { isExpanded: expanded }), []);
196
- icon ??= defaultIcon;
254
+ trailingIcon,
255
+ color = "default",
256
+ variant = "normal",
257
+ className = "",
258
+ ...restProps
259
+ }) => {
260
+ const colorMapping = {
261
+ default: "text-tag-default-text bg-tag-default-background",
262
+ dark: "text-tag-dark-text bg-tag-dark-background",
263
+ red: "text-tag-red-text bg-tag-red-background",
264
+ yellow: "text-tag-yellow-text bg-tag-yellow-background",
265
+ green: "text-tag-green-text bg-tag-green-background",
266
+ blue: "text-tag-blue-text bg-tag-blue-background",
267
+ pink: "text-tag-pink-text bg-tag-pink-background"
268
+ }[color];
269
+ const colorMappingIcon = {
270
+ default: "text-tag-default-icon",
271
+ dark: "text-tag-dark-icon",
272
+ red: "text-tag-red-icon",
273
+ yellow: "text-tag-yellow-icon",
274
+ green: "text-tag-green-icon",
275
+ blue: "text-tag-blue-icon",
276
+ pink: "text-tag-pink-icon"
277
+ }[color];
197
278
  return /* @__PURE__ */ jsxs2(
198
279
  "div",
199
280
  {
200
- ref,
201
- className: clsx3("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
202
- onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
281
+ ...restProps,
282
+ className: clsx3(
283
+ `row w-fit px-2 py-1 font-semibold`,
284
+ colorMapping,
285
+ {
286
+ "rounded-md": variant === "normal",
287
+ "rounded-full": variant === "fullyRounded"
288
+ },
289
+ className
290
+ ),
203
291
  children: [
204
- /* @__PURE__ */ jsxs2(
205
- "div",
206
- {
207
- className: clsx3(
208
- "flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
209
- {
210
- "group-hover:brightness-97": !isExpanded,
211
- "hover:brightness-97": isExpanded && !disabled,
212
- "cursor-pointer": clickOnlyOnHeader && !disabled
213
- },
214
- headerClassName
215
- ),
216
- onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
217
- children: [
218
- label,
219
- icon(isExpanded)
220
- ]
221
- }
222
- ),
223
- /* @__PURE__ */ jsx4(
224
- "div",
225
- {
226
- className: clsx3(
227
- "flex-col-2 px-4 transition-all duration-300 ease-in-out",
228
- {
229
- [clsx3("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
230
- "max-h-0 opacity-0 overflow-hidden": !isExpanded
231
- },
232
- contentClassName
233
- ),
234
- children
235
- }
236
- )
292
+ children,
293
+ trailingIcon && /* @__PURE__ */ jsx4("span", { className: colorMappingIcon, children: trailingIcon })
237
294
  ]
238
295
  }
239
296
  );
240
- });
241
- var ExpandableUncontrolled = forwardRef(function ExpandableUncontrolled2({
242
- isExpanded,
243
- onChange = noop,
244
- ...props
245
- }, ref) {
246
- const [usedIsExpanded, setUsedIsExpanded] = useState3(isExpanded);
247
- useEffect3(() => {
248
- setUsedIsExpanded(isExpanded);
249
- }, [isExpanded]);
250
- return /* @__PURE__ */ jsx4(
251
- Expandable,
297
+ };
298
+ var ChipList = ({
299
+ list,
300
+ className = ""
301
+ }) => {
302
+ return /* @__PURE__ */ jsx4("div", { className: clsx3("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ jsx4(
303
+ Chip,
252
304
  {
253
- ...props,
254
- ref,
255
- isExpanded: usedIsExpanded,
256
- onChange: (value) => {
257
- onChange(value);
258
- setUsedIsExpanded(value);
259
- }
260
- }
261
- );
262
- });
263
-
264
- // src/components/user-action/Menu.tsx
265
- import { useEffect as useEffect6, useRef, useState as useState5 } from "react";
305
+ ...value,
306
+ color: value.color ?? "default",
307
+ variant: value.variant ?? "normal",
308
+ children: value.children
309
+ },
310
+ index
311
+ )) });
312
+ };
313
+
314
+ // src/localization/defaults/form.ts
315
+ var formTranslation = {
316
+ en: {
317
+ add: "Add",
318
+ all: "All",
319
+ apply: "Apply",
320
+ back: "Back",
321
+ cancel: "Cancel",
322
+ change: "Change",
323
+ clear: "Clear",
324
+ click: "Click",
325
+ clickToCopy: "Click to Copy",
326
+ close: "Close",
327
+ confirm: "Confirm",
328
+ copy: "Copy",
329
+ copied: "Copied",
330
+ create: "Create",
331
+ decline: "Decline",
332
+ delete: "Delete",
333
+ discard: "Discard",
334
+ discardChanges: "Discard Changes",
335
+ done: "Done",
336
+ edit: "Edit",
337
+ enterText: "Enter text here",
338
+ error: "Error",
339
+ exit: "Exit",
340
+ fieldRequiredError: "This field is required.",
341
+ invalidEmailError: "Please enter a valid email address.",
342
+ less: "Less",
343
+ loading: "Loading",
344
+ maxLengthError: "Maximum length exceeded.",
345
+ minLengthError: "Minimum length not met.",
346
+ more: "More",
347
+ next: "Next",
348
+ no: "No",
349
+ none: "None",
350
+ of: "of",
351
+ optional: "Optional",
352
+ pleaseWait: "Please wait...",
353
+ previous: "Previous",
354
+ remove: "Remove",
355
+ required: "Required",
356
+ reset: "Reset",
357
+ save: "Save",
358
+ saved: "Saved",
359
+ search: "Search",
360
+ select: "Select",
361
+ selectOption: "Select an option",
362
+ show: "Show",
363
+ showMore: "Show more",
364
+ showLess: "Show less",
365
+ submit: "Submit",
366
+ success: "Success",
367
+ update: "Update",
368
+ unsavedChanges: "Unsaved Changes",
369
+ unsavedChangesSaveQuestion: "Do you want to save your changes?",
370
+ yes: "Yes"
371
+ },
372
+ de: {
373
+ add: "Hinzuf\xFCgen",
374
+ all: "Alle",
375
+ apply: "Anwenden",
376
+ back: "Zur\xFCck",
377
+ cancel: "Abbrechen",
378
+ change: "\xC4ndern",
379
+ clear: "L\xF6schen",
380
+ click: "Klicken",
381
+ clickToCopy: "Zum kopieren klicken",
382
+ close: "Schlie\xDFen",
383
+ confirm: "Best\xE4tigen",
384
+ copy: "Kopieren",
385
+ copied: "Kopiert",
386
+ create: "Erstellen",
387
+ decline: "Ablehnen",
388
+ delete: "L\xF6schen",
389
+ discard: "Verwerfen",
390
+ discardChanges: "\xC4nderungen Verwerfen",
391
+ done: "Fertig",
392
+ edit: "Bearbeiten",
393
+ enterText: "Text hier eingeben",
394
+ error: "Fehler",
395
+ exit: "Beenden",
396
+ fieldRequiredError: "Dieses Feld ist erforderlich.",
397
+ invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
398
+ less: "Weniger",
399
+ loading: "L\xE4dt",
400
+ maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
401
+ minLengthError: "Mindestl\xE4nge nicht erreicht.",
402
+ more: "Mehr",
403
+ next: "Weiter",
404
+ no: "Nein",
405
+ none: "Nichts",
406
+ of: "von",
407
+ optional: "Optional",
408
+ pleaseWait: "Bitte warten...",
409
+ previous: "Vorherige",
410
+ remove: "Entfernen",
411
+ required: "Erforderlich",
412
+ reset: "Zur\xFCcksetzen",
413
+ save: "Speichern",
414
+ saved: "Gespeichert",
415
+ search: "Suche",
416
+ select: "Select",
417
+ selectOption: "Option ausw\xE4hlen",
418
+ show: "Anzeigen",
419
+ showMore: "Mehr anzeigen",
420
+ showLess: "Weniger anzeigen",
421
+ submit: "Abschicken",
422
+ success: "Erfolg",
423
+ update: "Update",
424
+ unsavedChanges: "Ungespeicherte \xC4nderungen",
425
+ unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
426
+ yes: "Ja"
427
+ }
428
+ };
429
+
430
+ // src/components/user-action/Menu.tsx
431
+ import { useEffect as useEffect5, useRef, useState as useState4 } from "react";
266
432
  import clsx4 from "clsx";
267
433
 
268
434
  // src/hooks/useOutsideClick.ts
269
- import { useEffect as useEffect4 } from "react";
435
+ import { useEffect as useEffect3 } from "react";
270
436
  var useOutsideClick = (refs, handler) => {
271
- useEffect4(() => {
437
+ useEffect3(() => {
272
438
  const listener = (event) => {
273
439
  if (event.target === null) return;
274
440
  if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
@@ -286,15 +452,15 @@ var useOutsideClick = (refs, handler) => {
286
452
  };
287
453
 
288
454
  // src/hooks/useHoverState.ts
289
- import { useEffect as useEffect5, useState as useState4 } from "react";
455
+ import { useEffect as useEffect4, useState as useState3 } from "react";
290
456
  var defaultUseHoverStateProps = {
291
457
  closingDelay: 200,
292
458
  isDisabled: false
293
459
  };
294
460
  var useHoverState = (props = void 0) => {
295
461
  const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
296
- const [isHovered, setIsHovered] = useState4(false);
297
- const [timer, setTimer] = useState4();
462
+ const [isHovered, setIsHovered] = useState3(false);
463
+ const [timer, setTimer] = useState3();
298
464
  const onMouseEnter = () => {
299
465
  if (isDisabled) {
300
466
  return;
@@ -310,14 +476,14 @@ var useHoverState = (props = void 0) => {
310
476
  setIsHovered(false);
311
477
  }, closingDelay));
312
478
  };
313
- useEffect5(() => {
479
+ useEffect4(() => {
314
480
  if (timer) {
315
481
  return () => {
316
482
  clearTimeout(timer);
317
483
  };
318
484
  }
319
485
  });
320
- useEffect5(() => {
486
+ useEffect4(() => {
321
487
  if (timer) {
322
488
  clearTimeout(timer);
323
489
  }
@@ -419,7 +585,7 @@ var Menu = ({
419
585
  const triggerRef = useRef(null);
420
586
  const menuRef = useRef(null);
421
587
  useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
422
- const [isHidden, setIsHidden] = useState5(true);
588
+ const [isHidden, setIsHidden] = useState4(true);
423
589
  const bag = {
424
590
  isOpen,
425
591
  close: () => setIsOpen(false),
@@ -430,7 +596,7 @@ var Menu = ({
430
596
  triggerRef.current?.getBoundingClientRect(),
431
597
  { verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
432
598
  );
433
- useEffect6(() => {
599
+ useEffect5(() => {
434
600
  if (!isOpen) return;
435
601
  const triggerEl = triggerRef.current;
436
602
  if (!triggerEl) return;
@@ -447,7 +613,7 @@ var Menu = ({
447
613
  window.removeEventListener("resize", close);
448
614
  };
449
615
  }, [isOpen, setIsOpen]);
450
- useEffect6(() => {
616
+ useEffect5(() => {
451
617
  if (isOpen) {
452
618
  setIsHidden(false);
453
619
  }
@@ -482,10 +648,114 @@ var Menu = ({
482
648
  ] });
483
649
  };
484
650
 
485
- // src/components/user-action/Input.tsx
486
- import { forwardRef as forwardRef2, useEffect as useEffect9, useImperativeHandle, useRef as useRef2, useState as useState7 } from "react";
651
+ // src/components/layout-and-navigation/Expandable.tsx
652
+ import { forwardRef as forwardRef2, useCallback as useCallback2, useEffect as useEffect6, useState as useState5 } from "react";
653
+ import { ChevronDown } from "lucide-react";
487
654
  import clsx5 from "clsx";
488
655
 
656
+ // src/util/noop.ts
657
+ var noop = () => void 0;
658
+
659
+ // src/components/layout-and-navigation/Expandable.tsx
660
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
661
+ var ExpansionIcon = ({ isExpanded, className }) => {
662
+ return /* @__PURE__ */ jsx6(
663
+ ChevronDown,
664
+ {
665
+ className: clsx5(
666
+ "min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
667
+ { "rotate-180": isExpanded },
668
+ className
669
+ )
670
+ }
671
+ );
672
+ };
673
+ var Expandable = forwardRef2(function Expandable2({
674
+ children,
675
+ label,
676
+ icon,
677
+ isExpanded = false,
678
+ onChange = noop,
679
+ clickOnlyOnHeader = true,
680
+ disabled = false,
681
+ className,
682
+ headerClassName,
683
+ contentClassName,
684
+ contentExpandedClassName
685
+ }, ref) {
686
+ const defaultIcon = useCallback2((expanded) => /* @__PURE__ */ jsx6(ExpansionIcon, { isExpanded: expanded }), []);
687
+ icon ??= defaultIcon;
688
+ return /* @__PURE__ */ jsxs4(
689
+ "div",
690
+ {
691
+ ref,
692
+ className: clsx5("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
693
+ onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
694
+ children: [
695
+ /* @__PURE__ */ jsxs4(
696
+ "div",
697
+ {
698
+ className: clsx5(
699
+ "flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
700
+ {
701
+ "group-hover:brightness-97": !isExpanded,
702
+ "hover:brightness-97": isExpanded && !disabled,
703
+ "cursor-pointer": clickOnlyOnHeader && !disabled
704
+ },
705
+ headerClassName
706
+ ),
707
+ onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
708
+ children: [
709
+ label,
710
+ icon(isExpanded)
711
+ ]
712
+ }
713
+ ),
714
+ /* @__PURE__ */ jsx6(
715
+ "div",
716
+ {
717
+ className: clsx5(
718
+ "flex-col-2 px-4 transition-all duration-300 ease-in-out",
719
+ {
720
+ [clsx5("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
721
+ "max-h-0 opacity-0 overflow-hidden": !isExpanded
722
+ },
723
+ contentClassName
724
+ ),
725
+ children
726
+ }
727
+ )
728
+ ]
729
+ }
730
+ );
731
+ });
732
+ var ExpandableUncontrolled = forwardRef2(function ExpandableUncontrolled2({
733
+ isExpanded,
734
+ onChange = noop,
735
+ ...props
736
+ }, ref) {
737
+ const [usedIsExpanded, setUsedIsExpanded] = useState5(isExpanded);
738
+ useEffect6(() => {
739
+ setUsedIsExpanded(isExpanded);
740
+ }, [isExpanded]);
741
+ return /* @__PURE__ */ jsx6(
742
+ Expandable,
743
+ {
744
+ ...props,
745
+ ref,
746
+ isExpanded: usedIsExpanded,
747
+ onChange: (value) => {
748
+ onChange(value);
749
+ setUsedIsExpanded(value);
750
+ }
751
+ }
752
+ );
753
+ });
754
+
755
+ // src/components/user-action/Input.tsx
756
+ import { forwardRef as forwardRef3, useEffect as useEffect9, useImperativeHandle, useRef as useRef2, useState as useState7 } from "react";
757
+ import clsx6 from "clsx";
758
+
489
759
  // src/hooks/useDelay.ts
490
760
  import { useEffect as useEffect7, useState as useState6 } from "react";
491
761
  var defaultOptions = {
@@ -606,384 +876,132 @@ var useFocusOnceVisible = (ref, disable = false) => {
606
876
  }, [disable, hasUsedFocus, ref]);
607
877
  };
608
878
 
609
- // src/components/user-action/Input.tsx
610
- import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
611
- var getInputClassName = ({ disabled = false, hasError = false }) => {
612
- return clsx5(
613
- "px-2 py-1.5 rounded-md border-2",
614
- {
615
- "bg-input-background text-input-text hover:border-primary focus:border-primary": !disabled && !hasError,
616
- "bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
617
- "bg-disabled-background text-disabled-text border-disabled-border": disabled
618
- }
619
- );
620
- };
621
- var defaultEditCompleteOptions = {
622
- onBlur: true,
623
- afterDelay: true,
624
- delay: 2500
625
- };
626
- var Input = forwardRef2(function Input2({
627
- id,
628
- type = "text",
629
- value,
630
- label,
631
- onChange = noop,
632
- onChangeText = noop,
633
- onEditCompleted,
634
- className = "",
635
- allowEnterComplete = true,
636
- expanded = true,
637
- autoFocus = false,
638
- onBlur,
639
- editCompleteOptions,
640
- containerClassName,
641
- disabled,
642
- ...restProps
643
- }, forwardedRef) {
644
- const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
645
- const {
646
- restartTimer,
647
- clearTimer
648
- } = useDelay({ delay, disabled: !afterDelay });
649
- const innerRef = useRef2(null);
650
- const { focusNext } = useFocusManagement();
651
- useFocusOnceVisible(innerRef, !autoFocus);
652
- useImperativeHandle(forwardedRef, () => innerRef.current);
653
- const handleKeyDown = (e) => {
654
- if (e.key === "Enter" && !e.shiftKey) {
655
- e.preventDefault();
656
- innerRef.current?.blur();
657
- focusNext();
658
- }
659
- };
660
- return /* @__PURE__ */ jsxs4("div", { className: clsx5({ "w-full": expanded }, containerClassName), children: [
661
- label && /* @__PURE__ */ jsx6(Label, { ...label, htmlFor: id, className: clsx5("mb-1", label.className) }),
662
- /* @__PURE__ */ jsx6(
663
- "input",
664
- {
665
- ...restProps,
666
- ref: innerRef,
667
- value,
668
- id,
669
- type,
670
- disabled,
671
- className: clsx5(getInputClassName({ disabled }), className),
672
- onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
673
- onBlur: (event) => {
674
- onBlur?.(event);
675
- if (onEditCompleted && allowEditCompleteOnBlur) {
676
- onEditCompleted(event.target.value);
677
- clearTimer();
678
- }
679
- },
680
- onChange: (e) => {
681
- const value2 = e.target.value;
682
- if (onEditCompleted) {
683
- restartTimer(() => {
684
- if (innerRef.current) {
685
- innerRef.current.blur();
686
- if (!allowEditCompleteOnBlur) {
687
- onEditCompleted(value2);
688
- }
689
- } else {
690
- onEditCompleted(value2);
691
- }
692
- });
693
- }
694
- onChange(e);
695
- onChangeText(value2);
696
- }
697
- }
698
- )
699
- ] });
700
- });
701
- var FormInput = forwardRef2(function FormInput2({
702
- id,
703
- labelText,
704
- errorText,
705
- className,
706
- labelClassName,
707
- errorClassName,
708
- containerClassName,
709
- required,
710
- disabled,
711
- ...restProps
712
- }, ref) {
713
- const input = /* @__PURE__ */ jsx6(
714
- "input",
715
- {
716
- ...restProps,
717
- ref,
718
- id,
719
- disabled,
720
- className: clsx5(
721
- getInputClassName({ disabled, hasError: !!errorText }),
722
- className
723
- )
724
- }
725
- );
726
- return /* @__PURE__ */ jsxs4("div", { className: clsx5("flex flex-col gap-y-1", containerClassName), children: [
727
- labelText && /* @__PURE__ */ jsxs4("label", { htmlFor: id, className: clsx5("textstyle-label-md", labelClassName), children: [
728
- labelText,
729
- required && /* @__PURE__ */ jsx6("span", { className: "text-primary font-bold", children: "*" })
730
- ] }),
731
- input,
732
- errorText && /* @__PURE__ */ jsx6("label", { htmlFor: id, className: clsx5("text-negative", errorClassName), children: errorText })
733
- ] });
734
- });
735
-
736
- // src/localization/defaults/form.ts
737
- var formTranslation = {
738
- en: {
739
- add: "Add",
740
- all: "All",
741
- apply: "Apply",
742
- back: "Back",
743
- cancel: "Cancel",
744
- change: "Change",
745
- clear: "Clear",
746
- click: "Click",
747
- clickToCopy: "Click to Copy",
748
- close: "Close",
749
- confirm: "Confirm",
750
- copy: "Copy",
751
- copied: "Copied",
752
- create: "Create",
753
- decline: "Decline",
754
- delete: "Delete",
755
- discard: "Discard",
756
- discardChanges: "Discard Changes",
757
- done: "Done",
758
- edit: "Edit",
759
- enterText: "Enter text here",
760
- error: "Error",
761
- exit: "Exit",
762
- fieldRequiredError: "This field is required.",
763
- invalidEmailError: "Please enter a valid email address.",
764
- less: "Less",
765
- loading: "Loading",
766
- maxLengthError: "Maximum length exceeded.",
767
- minLengthError: "Minimum length not met.",
768
- more: "More",
769
- next: "Next",
770
- no: "No",
771
- none: "None",
772
- of: "of",
773
- optional: "Optional",
774
- pleaseWait: "Please wait...",
775
- previous: "Previous",
776
- remove: "Remove",
777
- required: "Required",
778
- reset: "Reset",
779
- save: "Save",
780
- saved: "Saved",
781
- search: "Search",
782
- select: "Select",
783
- selectOption: "Select an option",
784
- show: "Show",
785
- showMore: "Show more",
786
- showLess: "Show less",
787
- submit: "Submit",
788
- success: "Success",
789
- update: "Update",
790
- unsavedChanges: "Unsaved Changes",
791
- unsavedChangesSaveQuestion: "Do you want to save your changes?",
792
- yes: "Yes"
793
- },
794
- de: {
795
- add: "Hinzuf\xFCgen",
796
- all: "Alle",
797
- apply: "Anwenden",
798
- back: "Zur\xFCck",
799
- cancel: "Abbrechen",
800
- change: "\xC4ndern",
801
- clear: "L\xF6schen",
802
- click: "Klicken",
803
- clickToCopy: "Zum kopieren klicken",
804
- close: "Schlie\xDFen",
805
- confirm: "Best\xE4tigen",
806
- copy: "Kopieren",
807
- copied: "Kopiert",
808
- create: "Erstellen",
809
- decline: "Ablehnen",
810
- delete: "L\xF6schen",
811
- discard: "Verwerfen",
812
- discardChanges: "\xC4nderungen Verwerfen",
813
- done: "Fertig",
814
- edit: "Bearbeiten",
815
- enterText: "Text hier eingeben",
816
- error: "Fehler",
817
- exit: "Beenden",
818
- fieldRequiredError: "Dieses Feld ist erforderlich.",
819
- invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
820
- less: "Weniger",
821
- loading: "L\xE4dt",
822
- maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
823
- minLengthError: "Mindestl\xE4nge nicht erreicht.",
824
- more: "Mehr",
825
- next: "Weiter",
826
- no: "Nein",
827
- none: "Nichts",
828
- of: "von",
829
- optional: "Optional",
830
- pleaseWait: "Bitte warten...",
831
- previous: "Vorherige",
832
- remove: "Entfernen",
833
- required: "Erforderlich",
834
- reset: "Zur\xFCcksetzen",
835
- save: "Speichern",
836
- saved: "Gespeichert",
837
- search: "Suche",
838
- select: "Select",
839
- selectOption: "Option ausw\xE4hlen",
840
- show: "Anzeigen",
841
- showMore: "Mehr anzeigen",
842
- showLess: "Weniger anzeigen",
843
- submit: "Abschicken",
844
- success: "Erfolg",
845
- update: "Update",
846
- unsavedChanges: "Ungespeicherte \xC4nderungen",
847
- unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
848
- yes: "Ja"
849
- }
850
- };
851
-
852
- // src/components/user-action/Button.tsx
853
- import { forwardRef as forwardRef3 } from "react";
854
- import clsx6 from "clsx";
855
- import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
856
- var ButtonColorUtil = {
857
- solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
858
- text: ["primary", "negative", "neutral"],
859
- outline: ["primary"]
860
- };
861
- var IconButtonUtil = {
862
- icon: [...ButtonColorUtil.solid, "transparent"]
863
- };
864
- var paddingMapping = {
865
- small: "btn-sm",
866
- medium: "btn-md",
867
- large: "btn-lg"
868
- };
869
- var iconPaddingMapping = {
870
- tiny: "icon-btn-xs",
871
- small: "icon-btn-sm",
872
- medium: "icon-btn-md",
873
- large: "icon-btn-lg"
874
- };
875
- var ButtonUtil = {
876
- paddingMapping,
877
- iconPaddingMapping
878
- };
879
- var SolidButton = forwardRef3(function SolidButton2({
880
- children,
881
- disabled = false,
882
- color = "primary",
883
- size = "medium",
884
- startIcon,
885
- endIcon,
886
- onClick,
887
- className,
888
- ...restProps
889
- }, ref) {
890
- const colorClasses = {
891
- primary: "bg-button-solid-primary-background text-button-solid-primary-text",
892
- secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
893
- tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
894
- positive: "bg-button-solid-positive-background text-button-solid-positive-text",
895
- warning: "bg-button-solid-warning-background text-button-solid-warning-text",
896
- negative: "bg-button-solid-negative-background text-button-solid-negative-text",
897
- neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
898
- }[color];
899
- const iconColorClasses = {
900
- primary: "text-button-solid-primary-icon",
901
- secondary: "text-button-solid-secondary-icon",
902
- tertiary: "text-button-solid-tertiary-icon",
903
- positive: "text-button-solid-positive-icon",
904
- warning: "text-button-solid-warning-icon",
905
- negative: "text-button-solid-negative-icon",
906
- neutral: "text-button-solid-neutral-icon"
907
- }[color];
908
- return /* @__PURE__ */ jsxs5(
909
- "button",
910
- {
911
- ref,
912
- onClick,
913
- disabled,
914
- className: clsx6(
915
- "font-semibold",
916
- {
917
- "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
918
- [clsx6(colorClasses, "hover:brightness-90")]: !disabled
919
- },
920
- ButtonUtil.paddingMapping[size],
921
- className
922
- ),
923
- ...restProps,
924
- children: [
925
- startIcon && /* @__PURE__ */ jsx7(
926
- "span",
927
- {
928
- className: clsx6({
929
- [iconColorClasses]: !disabled,
930
- [`text-disabled-icon`]: disabled
931
- }),
932
- children: startIcon
933
- }
934
- ),
935
- children,
936
- endIcon && /* @__PURE__ */ jsx7(
937
- "span",
938
- {
939
- className: clsx6({
940
- [iconColorClasses]: !disabled,
941
- [`text-disabled-icon`]: disabled
942
- }),
943
- children: endIcon
944
- }
945
- )
946
- ]
879
+ // src/components/user-action/Input.tsx
880
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
881
+ var getInputClassName = ({ disabled = false, hasError = false }) => {
882
+ return clsx6(
883
+ "px-2 py-1.5 rounded-md border-2",
884
+ {
885
+ "bg-input-background text-input-text hover:border-primary focus:border-primary": !disabled && !hasError,
886
+ "bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
887
+ "bg-disabled-background text-disabled-text border-disabled-border": disabled
947
888
  }
948
889
  );
890
+ };
891
+ var defaultEditCompleteOptions = {
892
+ onBlur: true,
893
+ afterDelay: true,
894
+ delay: 2500
895
+ };
896
+ var Input = forwardRef3(function Input2({
897
+ id,
898
+ type = "text",
899
+ value,
900
+ label,
901
+ onChange = noop,
902
+ onChangeText = noop,
903
+ onEditCompleted,
904
+ className = "",
905
+ allowEnterComplete = true,
906
+ expanded = true,
907
+ autoFocus = false,
908
+ onBlur,
909
+ editCompleteOptions,
910
+ containerClassName,
911
+ disabled,
912
+ ...restProps
913
+ }, forwardedRef) {
914
+ const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
915
+ const {
916
+ restartTimer,
917
+ clearTimer
918
+ } = useDelay({ delay, disabled: !afterDelay });
919
+ const innerRef = useRef2(null);
920
+ const { focusNext } = useFocusManagement();
921
+ useFocusOnceVisible(innerRef, !autoFocus);
922
+ useImperativeHandle(forwardedRef, () => innerRef.current);
923
+ const handleKeyDown = (e) => {
924
+ if (e.key === "Enter" && !e.shiftKey) {
925
+ e.preventDefault();
926
+ innerRef.current?.blur();
927
+ focusNext();
928
+ }
929
+ };
930
+ return /* @__PURE__ */ jsxs5("div", { className: clsx6({ "w-full": expanded }, containerClassName), children: [
931
+ label && /* @__PURE__ */ jsx7(Label, { ...label, htmlFor: id, className: clsx6("mb-1", label.className) }),
932
+ /* @__PURE__ */ jsx7(
933
+ "input",
934
+ {
935
+ ...restProps,
936
+ ref: innerRef,
937
+ value,
938
+ id,
939
+ type,
940
+ disabled,
941
+ className: clsx6(getInputClassName({ disabled }), className),
942
+ onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
943
+ onBlur: (event) => {
944
+ onBlur?.(event);
945
+ if (onEditCompleted && allowEditCompleteOnBlur) {
946
+ onEditCompleted(event.target.value);
947
+ clearTimer();
948
+ }
949
+ },
950
+ onChange: (e) => {
951
+ const value2 = e.target.value;
952
+ if (onEditCompleted) {
953
+ restartTimer(() => {
954
+ if (innerRef.current) {
955
+ innerRef.current.blur();
956
+ if (!allowEditCompleteOnBlur) {
957
+ onEditCompleted(value2);
958
+ }
959
+ } else {
960
+ onEditCompleted(value2);
961
+ }
962
+ });
963
+ }
964
+ onChange(e);
965
+ onChangeText(value2);
966
+ }
967
+ }
968
+ )
969
+ ] });
949
970
  });
950
- var IconButton = ({
951
- children,
952
- disabled = false,
953
- color = "primary",
954
- size = "medium",
971
+ var FormInput = forwardRef3(function FormInput2({
972
+ id,
973
+ labelText,
974
+ errorText,
955
975
  className,
976
+ labelClassName,
977
+ errorClassName,
978
+ containerClassName,
979
+ required,
980
+ disabled,
956
981
  ...restProps
957
- }) => {
958
- const colorClasses = {
959
- primary: "bg-button-solid-primary-background text-button-solid-primary-text",
960
- secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
961
- tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
962
- positive: "bg-button-solid-positive-background text-button-solid-positive-text",
963
- warning: "bg-button-solid-warning-background text-button-solid-warning-text",
964
- negative: "bg-button-solid-negative-background text-button-solid-negative-text",
965
- neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
966
- transparent: "bg-transparent"
967
- }[color];
968
- return /* @__PURE__ */ jsx7(
969
- "button",
982
+ }, ref) {
983
+ const input = /* @__PURE__ */ jsx7(
984
+ "input",
970
985
  {
986
+ ...restProps,
987
+ ref,
988
+ id,
971
989
  disabled,
972
990
  className: clsx6(
973
- {
974
- "text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
975
- "text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
976
- "hover:bg-button-text-hover-background": !disabled && color === "transparent",
977
- [clsx6(colorClasses, "hover:brightness-90")]: !disabled
978
- },
979
- ButtonUtil.iconPaddingMapping[size],
991
+ getInputClassName({ disabled, hasError: !!errorText }),
980
992
  className
981
- ),
982
- ...restProps,
983
- children
993
+ )
984
994
  }
985
995
  );
986
- };
996
+ return /* @__PURE__ */ jsxs5("div", { className: clsx6("flex flex-col gap-y-1", containerClassName), children: [
997
+ labelText && /* @__PURE__ */ jsxs5("label", { htmlFor: id, className: clsx6("textstyle-label-md", labelClassName), children: [
998
+ labelText,
999
+ required && /* @__PURE__ */ jsx7("span", { className: "text-primary font-bold", children: "*" })
1000
+ ] }),
1001
+ input,
1002
+ errorText && /* @__PURE__ */ jsx7("label", { htmlFor: id, className: clsx6("text-negative", errorClassName), children: errorText })
1003
+ ] });
1004
+ });
987
1005
 
988
1006
  // src/components/user-action/SearchBar.tsx
989
1007
  import { Search } from "lucide-react";
@@ -1077,96 +1095,12 @@ var useSearch = ({
1077
1095
  };
1078
1096
  };
1079
1097
 
1080
- // src/components/user-action/Select.tsx
1081
- import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
1082
- var SelectTile = ({
1083
- className,
1084
- disabledClassName,
1085
- title,
1086
- ...restProps
1087
- }) => {
1088
- return /* @__PURE__ */ jsx9(
1089
- Tile,
1090
- {
1091
- ...restProps,
1092
- className: clsx8("px-2 py-1 rounded-md", className),
1093
- disabledClassName: disabledClassName ?? "text-disabled-text cursor-not-allowed",
1094
- title: { ...title, className: title.className ?? "font-semibold" }
1095
- }
1096
- );
1097
- };
1098
-
1099
- // src/components/layout-and-navigation/Chip.tsx
1100
- import clsx9 from "clsx";
1101
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
1102
- var Chip = ({
1103
- children,
1104
- trailingIcon,
1105
- color = "default",
1106
- variant = "normal",
1107
- className = "",
1108
- ...restProps
1109
- }) => {
1110
- const colorMapping = {
1111
- default: "text-tag-default-text bg-tag-default-background",
1112
- dark: "text-tag-dark-text bg-tag-dark-background",
1113
- red: "text-tag-red-text bg-tag-red-background",
1114
- yellow: "text-tag-yellow-text bg-tag-yellow-background",
1115
- green: "text-tag-green-text bg-tag-green-background",
1116
- blue: "text-tag-blue-text bg-tag-blue-background",
1117
- pink: "text-tag-pink-text bg-tag-pink-background"
1118
- }[color];
1119
- const colorMappingIcon = {
1120
- default: "text-tag-default-icon",
1121
- dark: "text-tag-dark-icon",
1122
- red: "text-tag-red-icon",
1123
- yellow: "text-tag-yellow-icon",
1124
- green: "text-tag-green-icon",
1125
- blue: "text-tag-blue-icon",
1126
- pink: "text-tag-pink-icon"
1127
- }[color];
1128
- return /* @__PURE__ */ jsxs8(
1129
- "div",
1130
- {
1131
- ...restProps,
1132
- className: clsx9(
1133
- `row w-fit px-2 py-1`,
1134
- colorMapping,
1135
- {
1136
- "rounded-md": variant === "normal",
1137
- "rounded-full": variant === "fullyRounded"
1138
- },
1139
- className
1140
- ),
1141
- children: [
1142
- children,
1143
- trailingIcon && /* @__PURE__ */ jsx10("span", { className: colorMappingIcon, children: trailingIcon })
1144
- ]
1145
- }
1146
- );
1147
- };
1148
- var ChipList = ({
1149
- list,
1150
- className = ""
1151
- }) => {
1152
- return /* @__PURE__ */ jsx10("div", { className: clsx9("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ jsx10(
1153
- Chip,
1154
- {
1155
- ...value,
1156
- color: value.color ?? "dark",
1157
- variant: value.variant ?? "normal",
1158
- children: value.children
1159
- },
1160
- index
1161
- )) });
1162
- };
1163
-
1164
1098
  // src/components/user-action/Checkbox.tsx
1165
- import { useState as useState10 } from "react";
1099
+ import { useState as useState9 } from "react";
1166
1100
  import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
1167
- import { Check as Check2, Minus } from "lucide-react";
1168
- import clsx10 from "clsx";
1169
- import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
1101
+ import { Check, Minus } from "lucide-react";
1102
+ import clsx8 from "clsx";
1103
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
1170
1104
  var checkboxSizeMapping = {
1171
1105
  small: "size-5",
1172
1106
  medium: "size-6",
@@ -1202,33 +1136,92 @@ var Checkbox = ({
1202
1136
  const newValue = checked === "indeterminate" ? false : !checked;
1203
1137
  propagateChange(newValue);
1204
1138
  };
1205
- return /* @__PURE__ */ jsxs9("div", { className: clsx10("group flex-row-2 items-center cursor-pointer", containerClassName), onClick: changeValue, children: [
1206
- /* @__PURE__ */ jsx11(
1139
+ return /* @__PURE__ */ jsxs7("div", { className: clsx8("group flex-row-2 items-center cursor-pointer", containerClassName), onClick: changeValue, children: [
1140
+ /* @__PURE__ */ jsx9(
1207
1141
  CheckboxPrimitive.Root,
1208
1142
  {
1209
1143
  onCheckedChange: propagateChange,
1210
1144
  checked,
1211
1145
  disabled,
1212
1146
  id,
1213
- className: clsx10(usedSizeClass, `items-center border-2 rounded outline-none `, {
1147
+ className: clsx8(usedSizeClass, `items-center border-2 rounded outline-none `, {
1214
1148
  "text-disabled-text border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
1215
1149
  "focus:border-primary group-hover:border-primary ": !disabled,
1216
1150
  "bg-input-background": !disabled && !checked,
1217
1151
  "bg-primary/30 border-primary text-primary": !disabled && checked === true || checked === "indeterminate"
1218
1152
  }, className),
1219
- children: /* @__PURE__ */ jsxs9(CheckboxPrimitive.Indicator, { children: [
1220
- checked === true && /* @__PURE__ */ jsx11(Check2, { className: innerIconSize }),
1221
- checked === "indeterminate" && /* @__PURE__ */ jsx11(Minus, { className: innerIconSize })
1153
+ children: /* @__PURE__ */ jsxs7(CheckboxPrimitive.Indicator, { children: [
1154
+ checked === true && /* @__PURE__ */ jsx9(Check, { className: innerIconSize }),
1155
+ checked === "indeterminate" && /* @__PURE__ */ jsx9(Minus, { className: innerIconSize })
1222
1156
  ] })
1223
1157
  }
1224
1158
  ),
1225
- label && /* @__PURE__ */ jsx11(Label, { ...label, className: clsx10(label.className), htmlFor: id })
1159
+ label && /* @__PURE__ */ jsx9(Label, { ...label, className: clsx8(label.className), htmlFor: id })
1226
1160
  ] });
1227
1161
  };
1228
1162
 
1229
1163
  // src/components/user-action/MultiSelect.tsx
1230
1164
  import { Plus } from "lucide-react";
1231
- import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
1165
+
1166
+ // src/components/layout-and-navigation/Tile.tsx
1167
+ import clsx9 from "clsx";
1168
+ import { Check as Check2 } from "lucide-react";
1169
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
1170
+ var Tile = ({
1171
+ title,
1172
+ titleClassName,
1173
+ description,
1174
+ descriptionClassName,
1175
+ onClick,
1176
+ isSelected = false,
1177
+ disabled = false,
1178
+ prefix,
1179
+ suffix,
1180
+ normalClassName = "hover:bg-primary/40 cursor-pointer",
1181
+ selectedClassName = "bg-primary/20",
1182
+ disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
1183
+ className
1184
+ }) => {
1185
+ return /* @__PURE__ */ jsxs8(
1186
+ "div",
1187
+ {
1188
+ className: clsx9(
1189
+ "flex-row-2 w-full items-center",
1190
+ {
1191
+ [normalClassName]: onClick && !disabled,
1192
+ [selectedClassName]: isSelected && !disabled,
1193
+ [disabledClassName]: disabled
1194
+ },
1195
+ className
1196
+ ),
1197
+ onClick: disabled ? void 0 : onClick,
1198
+ children: [
1199
+ prefix,
1200
+ /* @__PURE__ */ jsxs8("div", { className: "flex-col-0 w-full", children: [
1201
+ /* @__PURE__ */ jsx10("span", { className: clsx9(titleClassName ?? "textstyle-title-normal"), children: title }),
1202
+ !!description && /* @__PURE__ */ jsx10("span", { className: clsx9(descriptionClassName ?? "textstyle-description"), children: description })
1203
+ ] }),
1204
+ suffix ?? (isSelected ? /* @__PURE__ */ jsx10(Check2, { size: 24 }) : void 0)
1205
+ ]
1206
+ }
1207
+ );
1208
+ };
1209
+ var ListTile = ({
1210
+ ...props
1211
+ }) => {
1212
+ return /* @__PURE__ */ jsx10(
1213
+ Tile,
1214
+ {
1215
+ ...props,
1216
+ titleClassName: props.titleClassName ?? "font-semibold",
1217
+ className: clsx9("px-2 py-1 rounded-md", props.className),
1218
+ disabledClassName: props.disabledClassName ?? "text-disabled-text cursor-not-allowed"
1219
+ }
1220
+ );
1221
+ };
1222
+
1223
+ // src/components/user-action/MultiSelect.tsx
1224
+ import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
1232
1225
  var defaultMultiSelectTranslation = {
1233
1226
  en: {
1234
1227
  selected: `{{amount}} selected`
@@ -1255,30 +1248,30 @@ var MultiSelect = ({
1255
1248
  const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
1256
1249
  const { result, search, setSearch } = useSearch({
1257
1250
  list: options,
1258
- searchMapping: useCallback6((item) => item.searchTags, []),
1251
+ searchMapping: useCallback5((item) => item.searchTags, []),
1259
1252
  ...searchOptions
1260
1253
  });
1261
1254
  const selectedItems = options.filter((value) => value.selected);
1262
1255
  const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
1263
- return /* @__PURE__ */ jsxs10("div", { className: clsx11(className), children: [
1264
- label && /* @__PURE__ */ jsx12(
1256
+ return /* @__PURE__ */ jsxs9("div", { className: clsx10(className), children: [
1257
+ label && /* @__PURE__ */ jsx11(
1265
1258
  Label,
1266
1259
  {
1267
1260
  ...label,
1268
1261
  htmlFor: label.name,
1269
- className: clsx11(" mb-1", label.className),
1262
+ className: clsx10(" mb-1", label.className),
1270
1263
  labelType: label.labelType ?? "labelBig"
1271
1264
  }
1272
1265
  ),
1273
- /* @__PURE__ */ jsx12(
1266
+ /* @__PURE__ */ jsx11(
1274
1267
  Menu,
1275
1268
  {
1276
1269
  ...menuProps,
1277
- trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ jsx12(
1270
+ trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ jsx11(
1278
1271
  "button",
1279
1272
  {
1280
1273
  ref,
1281
- className: clsx11(
1274
+ className: clsx10(
1282
1275
  "group btn-md justify-between w-full border-2 h-auto",
1283
1276
  {
1284
1277
  "min-h-14": useChipDisplay,
@@ -1289,18 +1282,30 @@ var MultiSelect = ({
1289
1282
  ),
1290
1283
  onClick: toggleOpen,
1291
1284
  disabled,
1292
- children: useChipDisplay ? /* @__PURE__ */ jsx12(Fragment3, { children: isShowingHint ? /* @__PURE__ */ jsx12("div", { className: "icon-btn-sm bg-button-solid-neutral-background text-button-solid-neutral-text hover:brightness-90 group-hover:brightness-90", children: /* @__PURE__ */ jsx12(Plus, {}) }) : /* @__PURE__ */ jsx12(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) }) : /* @__PURE__ */ jsxs10(Fragment3, { children: [
1293
- !isShowingHint && /* @__PURE__ */ jsx12("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? translation("selected", { replacements: { amount: selectedItems.length.toString() } }) }),
1294
- isShowingHint && /* @__PURE__ */ jsx12("span", { className: clsx11("textstyle-description", hintTextClassName), children: hintText ?? translation("select") }),
1295
- /* @__PURE__ */ jsx12(ExpansionIcon, { isExpanded: isOpen })
1285
+ children: useChipDisplay ? /* @__PURE__ */ jsx11(Fragment2, { children: isShowingHint ? /* @__PURE__ */ jsx11(
1286
+ "div",
1287
+ {
1288
+ className: clsx10(
1289
+ "icon-btn-sm ",
1290
+ {
1291
+ "bg-button-solid-neutral-background text-button-solid-neutral-text hover:brightness-90 group-hover:brightness-90": !disabled,
1292
+ "bg-disabled-background text-disabled-text": disabled
1293
+ }
1294
+ ),
1295
+ children: /* @__PURE__ */ jsx11(Plus, {})
1296
+ }
1297
+ ) : /* @__PURE__ */ jsx11(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) }) : /* @__PURE__ */ jsxs9(Fragment2, { children: [
1298
+ !isShowingHint && /* @__PURE__ */ jsx11("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? translation("selected", { replacements: { amount: selectedItems.length.toString() } }) }),
1299
+ isShowingHint && /* @__PURE__ */ jsx11("span", { className: clsx10("textstyle-description", hintTextClassName), children: hintText ?? translation("select") }),
1300
+ /* @__PURE__ */ jsx11(ExpansionIcon, { isExpanded: isOpen })
1296
1301
  ] })
1297
1302
  }
1298
1303
  ),
1299
- menuClassName: clsx11("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
1304
+ menuClassName: clsx10("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
1300
1305
  children: (bag) => {
1301
1306
  const { close } = bag;
1302
- return /* @__PURE__ */ jsxs10(Fragment3, { children: [
1303
- !searchOptions?.disabled && /* @__PURE__ */ jsx12(
1307
+ return /* @__PURE__ */ jsxs9(Fragment2, { children: [
1308
+ !searchOptions?.disabled && /* @__PURE__ */ jsx11(
1304
1309
  SearchBar,
1305
1310
  {
1306
1311
  value: search,
@@ -1308,7 +1313,7 @@ var MultiSelect = ({
1308
1313
  autoFocus: true
1309
1314
  }
1310
1315
  ),
1311
- /* @__PURE__ */ jsxs10("div", { className: "flex-col-2 overflow-y-auto", children: [
1316
+ /* @__PURE__ */ jsxs9("div", { className: "flex-col-2 overflow-y-auto", children: [
1312
1317
  result.map((option, index) => {
1313
1318
  const update = () => {
1314
1319
  onChange(options.map((value) => value.value === option.value ? {
@@ -1316,10 +1321,10 @@ var MultiSelect = ({
1316
1321
  selected: !value.selected
1317
1322
  } : value));
1318
1323
  };
1319
- return /* @__PURE__ */ jsx12(
1320
- SelectTile,
1324
+ return /* @__PURE__ */ jsx11(
1325
+ ListTile,
1321
1326
  {
1322
- prefix: /* @__PURE__ */ jsx12(
1327
+ prefix: /* @__PURE__ */ jsx11(
1323
1328
  Checkbox,
1324
1329
  {
1325
1330
  checked: option.selected,
@@ -1328,7 +1333,7 @@ var MultiSelect = ({
1328
1333
  disabled: option.disabled
1329
1334
  }
1330
1335
  ),
1331
- title: { value: option.label },
1336
+ title: option.label,
1332
1337
  onClick: update,
1333
1338
  disabled: option.disabled
1334
1339
  },
@@ -1337,9 +1342,9 @@ var MultiSelect = ({
1337
1342
  }),
1338
1343
  additionalItems && additionalItems({ ...bag, search })
1339
1344
  ] }),
1340
- /* @__PURE__ */ jsxs10("div", { className: "flex-row-2 justify-between", children: [
1341
- /* @__PURE__ */ jsxs10("div", { className: "flex-row-2", children: [
1342
- /* @__PURE__ */ jsx12(
1345
+ /* @__PURE__ */ jsxs9("div", { className: "flex-row-2 justify-between", children: [
1346
+ /* @__PURE__ */ jsxs9("div", { className: "flex-row-2", children: [
1347
+ /* @__PURE__ */ jsx11(
1343
1348
  SolidButton,
1344
1349
  {
1345
1350
  color: "neutral",
@@ -1354,7 +1359,7 @@ var MultiSelect = ({
1354
1359
  children: translation("all")
1355
1360
  }
1356
1361
  ),
1357
- /* @__PURE__ */ jsx12(
1362
+ /* @__PURE__ */ jsx11(
1358
1363
  SolidButton,
1359
1364
  {
1360
1365
  color: "neutral",
@@ -1369,7 +1374,7 @@ var MultiSelect = ({
1369
1374
  }
1370
1375
  )
1371
1376
  ] }),
1372
- /* @__PURE__ */ jsx12(SolidButton, { size: "small", onClick: close, children: "Done" })
1377
+ /* @__PURE__ */ jsx11(SolidButton, { size: "small", onClick: close, children: "Done" })
1373
1378
  ] })
1374
1379
  ] });
1375
1380
  }
@@ -1382,11 +1387,11 @@ var MultiSelectUncontrolled = ({
1382
1387
  onChange,
1383
1388
  ...props
1384
1389
  }) => {
1385
- const [usedOptions, setUsedOptions] = useState11(options);
1386
- useEffect12(() => {
1390
+ const [usedOptions, setUsedOptions] = useState10(options);
1391
+ useEffect11(() => {
1387
1392
  setUsedOptions(options);
1388
1393
  }, [options]);
1389
- return /* @__PURE__ */ jsx12(
1394
+ return /* @__PURE__ */ jsx11(
1390
1395
  MultiSelect,
1391
1396
  {
1392
1397
  ...props,