@helpwave/hightide 0.1.11 → 0.1.13

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 (277) hide show
  1. package/dist/components/date/DatePicker.js +37 -7
  2. package/dist/components/date/DatePicker.js.map +1 -1
  3. package/dist/components/date/DatePicker.mjs +37 -7
  4. package/dist/components/date/DatePicker.mjs.map +1 -1
  5. package/dist/components/date/DayPicker.js.map +1 -1
  6. package/dist/components/date/DayPicker.mjs.map +1 -1
  7. package/dist/components/date/TimePicker.js +27 -6
  8. package/dist/components/date/TimePicker.js.map +1 -1
  9. package/dist/components/date/TimePicker.mjs +27 -6
  10. package/dist/components/date/TimePicker.mjs.map +1 -1
  11. package/dist/components/date/YearMonthPicker.js +36 -6
  12. package/dist/components/date/YearMonthPicker.js.map +1 -1
  13. package/dist/components/date/YearMonthPicker.mjs +36 -6
  14. package/dist/components/date/YearMonthPicker.mjs.map +1 -1
  15. package/dist/components/dialogs/ConfirmDialog.js +16 -2
  16. package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
  17. package/dist/components/dialogs/ConfirmDialog.mjs +16 -2
  18. package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
  19. package/dist/components/layout-and-navigation/Carousel.js +42 -9
  20. package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
  21. package/dist/components/layout-and-navigation/Carousel.mjs +42 -9
  22. package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
  23. package/dist/components/layout-and-navigation/Expandable.js +1 -1
  24. package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
  25. package/dist/components/layout-and-navigation/Expandable.mjs +1 -1
  26. package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
  27. package/dist/components/layout-and-navigation/FAQSection.js +1 -1
  28. package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
  29. package/dist/components/layout-and-navigation/FAQSection.mjs +1 -1
  30. package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
  31. package/dist/components/layout-and-navigation/Overlay.js +16 -2
  32. package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
  33. package/dist/components/layout-and-navigation/Overlay.mjs +16 -2
  34. package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
  35. package/dist/components/layout-and-navigation/Pagination.d.mts +6 -3
  36. package/dist/components/layout-and-navigation/Pagination.d.ts +6 -3
  37. package/dist/components/layout-and-navigation/Pagination.js +404 -19
  38. package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
  39. package/dist/components/layout-and-navigation/Pagination.mjs +404 -19
  40. package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
  41. package/dist/components/layout-and-navigation/SearchableList.js +187 -67
  42. package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
  43. package/dist/components/layout-and-navigation/SearchableList.mjs +183 -63
  44. package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
  45. package/dist/components/layout-and-navigation/StepperBar.js +37 -5
  46. package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
  47. package/dist/components/layout-and-navigation/StepperBar.mjs +37 -5
  48. package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
  49. package/dist/components/layout-and-navigation/TextImage.js +2 -0
  50. package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
  51. package/dist/components/layout-and-navigation/TextImage.mjs +2 -0
  52. package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
  53. package/dist/components/loading-states/LoadingAndErrorComponent.js +2 -0
  54. package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
  55. package/dist/components/loading-states/LoadingAndErrorComponent.mjs +2 -0
  56. package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
  57. package/dist/components/loading-states/LoadingAnimation.js +2 -0
  58. package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
  59. package/dist/components/loading-states/LoadingAnimation.mjs +2 -0
  60. package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
  61. package/dist/components/loading-states/LoadingButton.js +9 -0
  62. package/dist/components/loading-states/LoadingButton.js.map +1 -1
  63. package/dist/components/loading-states/LoadingButton.mjs +9 -0
  64. package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
  65. package/dist/components/modals/ConfirmModal.js +16 -2
  66. package/dist/components/modals/ConfirmModal.js.map +1 -1
  67. package/dist/components/modals/ConfirmModal.mjs +16 -2
  68. package/dist/components/modals/ConfirmModal.mjs.map +1 -1
  69. package/dist/components/modals/DiscardChangesModal.js +16 -2
  70. package/dist/components/modals/DiscardChangesModal.js.map +1 -1
  71. package/dist/components/modals/DiscardChangesModal.mjs +16 -2
  72. package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
  73. package/dist/components/modals/InputModal.d.mts +1 -0
  74. package/dist/components/modals/InputModal.d.ts +1 -0
  75. package/dist/components/modals/InputModal.js +196 -76
  76. package/dist/components/modals/InputModal.js.map +1 -1
  77. package/dist/components/modals/InputModal.mjs +189 -69
  78. package/dist/components/modals/InputModal.mjs.map +1 -1
  79. package/dist/components/modals/LanguageModal.js +203 -83
  80. package/dist/components/modals/LanguageModal.js.map +1 -1
  81. package/dist/components/modals/LanguageModal.mjs +192 -72
  82. package/dist/components/modals/LanguageModal.mjs.map +1 -1
  83. package/dist/components/modals/ThemeModal.js +206 -86
  84. package/dist/components/modals/ThemeModal.js.map +1 -1
  85. package/dist/components/modals/ThemeModal.mjs +193 -73
  86. package/dist/components/modals/ThemeModal.mjs.map +1 -1
  87. package/dist/components/properties/CheckboxProperty.js +17 -5
  88. package/dist/components/properties/CheckboxProperty.js.map +1 -1
  89. package/dist/components/properties/CheckboxProperty.mjs +17 -5
  90. package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
  91. package/dist/components/properties/DateProperty.js +182 -65
  92. package/dist/components/properties/DateProperty.js.map +1 -1
  93. package/dist/components/properties/DateProperty.mjs +179 -62
  94. package/dist/components/properties/DateProperty.mjs.map +1 -1
  95. package/dist/components/properties/MultiSelectProperty.js +194 -74
  96. package/dist/components/properties/MultiSelectProperty.js.map +1 -1
  97. package/dist/components/properties/MultiSelectProperty.mjs +187 -67
  98. package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
  99. package/dist/components/properties/NumberProperty.js +182 -65
  100. package/dist/components/properties/NumberProperty.js.map +1 -1
  101. package/dist/components/properties/NumberProperty.mjs +179 -62
  102. package/dist/components/properties/NumberProperty.mjs.map +1 -1
  103. package/dist/components/properties/PropertyBase.js +12 -1
  104. package/dist/components/properties/PropertyBase.js.map +1 -1
  105. package/dist/components/properties/PropertyBase.mjs +12 -1
  106. package/dist/components/properties/PropertyBase.mjs.map +1 -1
  107. package/dist/components/properties/SelectProperty.js +194 -74
  108. package/dist/components/properties/SelectProperty.js.map +1 -1
  109. package/dist/components/properties/SelectProperty.mjs +187 -67
  110. package/dist/components/properties/SelectProperty.mjs.map +1 -1
  111. package/dist/components/properties/TextProperty.js +43 -34
  112. package/dist/components/properties/TextProperty.js.map +1 -1
  113. package/dist/components/properties/TextProperty.mjs +43 -34
  114. package/dist/components/properties/TextProperty.mjs.map +1 -1
  115. package/dist/components/table/FillerRowElement.d.mts +8 -0
  116. package/dist/components/table/FillerRowElement.d.ts +8 -0
  117. package/dist/components/table/FillerRowElement.js +36 -0
  118. package/dist/components/table/FillerRowElement.js.map +1 -0
  119. package/dist/components/table/FillerRowElement.mjs +12 -0
  120. package/dist/components/table/FillerRowElement.mjs.map +1 -0
  121. package/dist/components/table/Filter.d.mts +5 -0
  122. package/dist/components/table/Filter.d.ts +5 -0
  123. package/dist/components/table/Filter.js +41 -0
  124. package/dist/components/table/Filter.js.map +1 -0
  125. package/dist/components/table/Filter.mjs +17 -0
  126. package/dist/components/table/Filter.mjs.map +1 -0
  127. package/dist/components/table/Table.d.mts +41 -0
  128. package/dist/components/table/Table.d.ts +41 -0
  129. package/dist/components/table/Table.js +1549 -0
  130. package/dist/components/table/Table.js.map +1 -0
  131. package/dist/components/table/Table.mjs +1520 -0
  132. package/dist/components/table/Table.mjs.map +1 -0
  133. package/dist/components/table/TableCell.d.mts +9 -0
  134. package/dist/components/table/TableCell.d.ts +9 -0
  135. package/dist/components/table/TableCell.js +37 -0
  136. package/dist/components/table/TableCell.js.map +1 -0
  137. package/dist/components/table/TableCell.mjs +13 -0
  138. package/dist/components/table/TableCell.mjs.map +1 -0
  139. package/dist/components/table/TableFilterButton.d.mts +11 -0
  140. package/dist/components/table/TableFilterButton.d.ts +11 -0
  141. package/dist/components/table/TableFilterButton.js +888 -0
  142. package/dist/components/table/TableFilterButton.js.map +1 -0
  143. package/dist/components/table/TableFilterButton.mjs +852 -0
  144. package/dist/components/table/TableFilterButton.mjs.map +1 -0
  145. package/dist/components/table/TableSortButton.d.mts +15 -0
  146. package/dist/components/table/TableSortButton.d.ts +15 -0
  147. package/dist/components/table/TableSortButton.js +136 -0
  148. package/dist/components/table/TableSortButton.js.map +1 -0
  149. package/dist/components/table/TableSortButton.mjs +102 -0
  150. package/dist/components/table/TableSortButton.mjs.map +1 -0
  151. package/dist/components/user-action/Button.d.mts +20 -5
  152. package/dist/components/user-action/Button.d.ts +20 -5
  153. package/dist/components/user-action/Button.js +12 -3
  154. package/dist/components/user-action/Button.js.map +1 -1
  155. package/dist/components/user-action/Button.mjs +11 -3
  156. package/dist/components/user-action/Button.mjs.map +1 -1
  157. package/dist/components/user-action/Checkbox.js +5 -4
  158. package/dist/components/user-action/Checkbox.js.map +1 -1
  159. package/dist/components/user-action/Checkbox.mjs +5 -4
  160. package/dist/components/user-action/Checkbox.mjs.map +1 -1
  161. package/dist/components/user-action/DateAndTimePicker.js +41 -9
  162. package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
  163. package/dist/components/user-action/DateAndTimePicker.mjs +41 -9
  164. package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
  165. package/dist/components/user-action/Input.d.mts +27 -7
  166. package/dist/components/user-action/Input.d.ts +27 -7
  167. package/dist/components/user-action/Input.js +173 -64
  168. package/dist/components/user-action/Input.js.map +1 -1
  169. package/dist/components/user-action/Input.mjs +172 -63
  170. package/dist/components/user-action/Input.mjs.map +1 -1
  171. package/dist/components/user-action/MultiSelect.js +195 -75
  172. package/dist/components/user-action/MultiSelect.js.map +1 -1
  173. package/dist/components/user-action/MultiSelect.mjs +187 -67
  174. package/dist/components/user-action/MultiSelect.mjs.map +1 -1
  175. package/dist/components/user-action/ScrollPicker.js +26 -5
  176. package/dist/components/user-action/ScrollPicker.js.map +1 -1
  177. package/dist/components/user-action/ScrollPicker.mjs +26 -5
  178. package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
  179. package/dist/components/user-action/Select.js +195 -75
  180. package/dist/components/user-action/Select.js.map +1 -1
  181. package/dist/components/user-action/Select.mjs +187 -67
  182. package/dist/components/user-action/Select.mjs.map +1 -1
  183. package/dist/components/user-action/Textarea.d.mts +3 -1
  184. package/dist/components/user-action/Textarea.d.ts +3 -1
  185. package/dist/components/user-action/Textarea.js +31 -33
  186. package/dist/components/user-action/Textarea.js.map +1 -1
  187. package/dist/components/user-action/Textarea.mjs +31 -33
  188. package/dist/components/user-action/Textarea.mjs.map +1 -1
  189. package/dist/components/user-action/ToggleableInput.d.mts +3 -1
  190. package/dist/components/user-action/ToggleableInput.d.ts +3 -1
  191. package/dist/components/user-action/ToggleableInput.js +31 -33
  192. package/dist/components/user-action/ToggleableInput.js.map +1 -1
  193. package/dist/components/user-action/ToggleableInput.mjs +31 -33
  194. package/dist/components/user-action/ToggleableInput.mjs.map +1 -1
  195. package/dist/css/globals.css +431 -186
  196. package/dist/css/uncompiled/globals.css +36 -493
  197. package/dist/css/uncompiled/textstyles.css +69 -0
  198. package/dist/css/uncompiled/theme/colors-basic.css +72 -0
  199. package/dist/css/uncompiled/theme/colors-component.css +143 -0
  200. package/dist/css/uncompiled/theme/colors-semantic.css +99 -0
  201. package/dist/css/uncompiled/theme/index.css +5 -0
  202. package/dist/css/uncompiled/theme/theme.css +0 -0
  203. package/dist/css/uncompiled/theme/variants.css +3 -0
  204. package/dist/css/uncompiled/utitlity/animation.css +111 -0
  205. package/dist/css/uncompiled/utitlity/borderradius.css +23 -0
  206. package/dist/css/uncompiled/utitlity/general.css +11 -0
  207. package/dist/css/uncompiled/utitlity/index.css +4 -0
  208. package/dist/css/uncompiled/utitlity/shadow.css +29 -0
  209. package/dist/hooks/useDelay.d.mts +11 -0
  210. package/dist/hooks/useDelay.d.ts +11 -0
  211. package/dist/hooks/useDelay.js +64 -0
  212. package/dist/hooks/useDelay.js.map +1 -0
  213. package/dist/hooks/useDelay.mjs +40 -0
  214. package/dist/hooks/useDelay.mjs.map +1 -0
  215. package/dist/hooks/useFocusManagement.d.mts +9 -0
  216. package/dist/hooks/useFocusManagement.d.ts +9 -0
  217. package/dist/hooks/useFocusManagement.js +84 -0
  218. package/dist/hooks/useFocusManagement.js.map +1 -0
  219. package/dist/hooks/useFocusManagement.mjs +60 -0
  220. package/dist/hooks/useFocusManagement.mjs.map +1 -0
  221. package/dist/hooks/useFocusOnceVisible.d.mts +5 -0
  222. package/dist/hooks/useFocusOnceVisible.d.ts +5 -0
  223. package/dist/hooks/useFocusOnceVisible.js +60 -0
  224. package/dist/hooks/useFocusOnceVisible.js.map +1 -0
  225. package/dist/hooks/useFocusOnceVisible.mjs +26 -0
  226. package/dist/hooks/useFocusOnceVisible.mjs.map +1 -0
  227. package/dist/hooks/useRerender.d.mts +5 -0
  228. package/dist/hooks/useRerender.d.ts +5 -0
  229. package/dist/hooks/useRerender.js +33 -0
  230. package/dist/hooks/useRerender.js.map +1 -0
  231. package/dist/hooks/useRerender.mjs +9 -0
  232. package/dist/hooks/useRerender.mjs.map +1 -0
  233. package/dist/hooks/useResizeCallbackWrapper.d.mts +11 -0
  234. package/dist/hooks/useResizeCallbackWrapper.d.ts +11 -0
  235. package/dist/hooks/useResizeCallbackWrapper.js +38 -0
  236. package/dist/hooks/useResizeCallbackWrapper.js.map +1 -0
  237. package/dist/hooks/useResizeCallbackWrapper.mjs +14 -0
  238. package/dist/hooks/useResizeCallbackWrapper.mjs.map +1 -0
  239. package/dist/index.d.mts +16 -5
  240. package/dist/index.d.ts +16 -5
  241. package/dist/index.js +1428 -860
  242. package/dist/index.js.map +1 -1
  243. package/dist/index.mjs +1370 -799
  244. package/dist/index.mjs.map +1 -1
  245. package/dist/localization/defaults/form.d.mts +1 -0
  246. package/dist/localization/defaults/form.d.ts +1 -0
  247. package/dist/localization/defaults/form.js +2 -0
  248. package/dist/localization/defaults/form.js.map +1 -1
  249. package/dist/localization/defaults/form.mjs +2 -0
  250. package/dist/localization/defaults/form.mjs.map +1 -1
  251. package/dist/util/array.d.mts +11 -5
  252. package/dist/util/array.d.ts +11 -5
  253. package/dist/util/array.js +25 -4
  254. package/dist/util/array.js.map +1 -1
  255. package/dist/util/array.mjs +25 -4
  256. package/dist/util/array.mjs.map +1 -1
  257. package/dist/util/date.js.map +1 -1
  258. package/dist/util/date.mjs.map +1 -1
  259. package/dist/util/resolveSetState.d.mts +5 -0
  260. package/dist/util/resolveSetState.d.ts +5 -0
  261. package/dist/util/resolveSetState.js +32 -0
  262. package/dist/util/resolveSetState.js.map +1 -0
  263. package/dist/util/resolveSetState.mjs +8 -0
  264. package/dist/util/resolveSetState.mjs.map +1 -0
  265. package/package.json +4 -2
  266. package/dist/components/layout-and-navigation/Table.d.mts +0 -99
  267. package/dist/components/layout-and-navigation/Table.d.ts +0 -99
  268. package/dist/components/layout-and-navigation/Table.js +0 -688
  269. package/dist/components/layout-and-navigation/Table.js.map +0 -1
  270. package/dist/components/layout-and-navigation/Table.mjs +0 -645
  271. package/dist/components/layout-and-navigation/Table.mjs.map +0 -1
  272. package/dist/hooks/useSaveDelay.d.mts +0 -6
  273. package/dist/hooks/useSaveDelay.d.ts +0 -6
  274. package/dist/hooks/useSaveDelay.js +0 -67
  275. package/dist/hooks/useSaveDelay.js.map +0 -1
  276. package/dist/hooks/useSaveDelay.mjs +0 -43
  277. package/dist/hooks/useSaveDelay.mjs.map +0 -1
package/dist/index.mjs CHANGED
@@ -3222,14 +3222,35 @@ var equalSizeGroups = (array, groupSize) => {
3222
3222
  }
3223
3223
  return groups;
3224
3224
  };
3225
- var range = (start, end, allowEmptyRange = false) => {
3226
- if (end < start) {
3225
+ var defaultRangeOptions = {
3226
+ allowEmptyRange: false,
3227
+ stepSize: 1,
3228
+ exclusiveStart: false,
3229
+ exclusiveEnd: true
3230
+ };
3231
+ var range = (endOrRange, options) => {
3232
+ const { allowEmptyRange, stepSize, exclusiveStart, exclusiveEnd } = { ...defaultRangeOptions, ...options };
3233
+ let start = 0;
3234
+ let end;
3235
+ if (typeof endOrRange === "number") {
3236
+ end = endOrRange;
3237
+ } else {
3238
+ start = endOrRange[0];
3239
+ end = endOrRange[1];
3240
+ }
3241
+ if (!exclusiveEnd) {
3242
+ end -= 1;
3243
+ }
3244
+ if (exclusiveStart) {
3245
+ start += 1;
3246
+ }
3247
+ if (end - 1 < start) {
3227
3248
  if (!allowEmptyRange) {
3228
- console.warn(`range: end (${end}) < start (${start}) should be allowed explicitly, set allowEmptyRange to true`);
3249
+ console.warn(`range: end (${end}) < start (${start}) should be allowed explicitly, set options.allowEmptyRange to true`);
3229
3250
  }
3230
3251
  return [];
3231
3252
  }
3232
- return Array.from({ length: end - start + 1 }, (_, index) => index + start);
3253
+ return Array.from({ length: end - start }, (_, index) => index * stepSize + start);
3233
3254
  };
3234
3255
  var closestMatch = (list, firstCloser) => {
3235
3256
  return list.reduce((item1, item2) => {
@@ -3440,12 +3461,16 @@ var ButtonColorUtil = {
3440
3461
  text: ["primary", "negative", "neutral"],
3441
3462
  outline: ["primary"]
3442
3463
  };
3464
+ var IconButtonUtil = {
3465
+ icon: [...ButtonColorUtil.solid, "transparent"]
3466
+ };
3443
3467
  var paddingMapping = {
3444
3468
  small: "btn-sm",
3445
3469
  medium: "btn-md",
3446
3470
  large: "btn-lg"
3447
3471
  };
3448
3472
  var iconPaddingMapping = {
3473
+ tiny: "icon-btn-xs",
3449
3474
  small: "icon-btn-sm",
3450
3475
  medium: "icon-btn-md",
3451
3476
  large: "icon-btn-lg"
@@ -3609,7 +3634,7 @@ var TextButton = ({
3609
3634
  className: clsx4(
3610
3635
  {
3611
3636
  "text-disabled-text cursor-not-allowed": disabled,
3612
- [clsx4(colorClasses, "hover:bg-button-text-hover-background rounded-full")]: !disabled
3637
+ [clsx4(colorClasses, "hover:bg-button-text-hover-background")]: !disabled
3613
3638
  },
3614
3639
  ButtonUtil.paddingMapping[size],
3615
3640
  className
@@ -3657,7 +3682,8 @@ var IconButton = ({
3657
3682
  positive: "bg-button-solid-positive-background text-button-solid-positive-text",
3658
3683
  warning: "bg-button-solid-warning-background text-button-solid-warning-text",
3659
3684
  negative: "bg-button-solid-negative-background text-button-solid-negative-text",
3660
- neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
3685
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
3686
+ transparent: "bg-transparent"
3661
3687
  }[color];
3662
3688
  return /* @__PURE__ */ jsx5(
3663
3689
  "button",
@@ -3666,7 +3692,9 @@ var IconButton = ({
3666
3692
  disabled: disabled || onClick === void 0,
3667
3693
  className: clsx4(
3668
3694
  {
3669
- "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
3695
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
3696
+ "text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
3697
+ "hover:bg-button-text-hover-background": !disabled && color === "transparent",
3670
3698
  [clsx4(colorClasses, "hover:brightness-90")]: !disabled
3671
3699
  },
3672
3700
  ButtonUtil.iconPaddingMapping[size],
@@ -3688,7 +3716,7 @@ import { forwardRef, useEffect as useEffect3, useState as useState3 } from "reac
3688
3716
  import { ChevronDown, ChevronUp } from "lucide-react";
3689
3717
  import clsx5 from "clsx";
3690
3718
  import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
3691
- var DefaultIcon = (expanded) => expanded ? /* @__PURE__ */ jsx6(ChevronUp, { size: 16, className: "min-w-[16px]" }) : /* @__PURE__ */ jsx6(ChevronDown, { size: 16, className: "min-w-[16px]" });
3719
+ var DefaultIcon = (expanded) => expanded ? /* @__PURE__ */ jsx6(ChevronUp, { className: "min-w-4 w-4" }) : /* @__PURE__ */ jsx6(ChevronDown, { className: "min-w-4 w-4" });
3692
3720
  var Expandable = forwardRef(function Expandable2({
3693
3721
  children,
3694
3722
  label,
@@ -3784,7 +3812,7 @@ var YearMonthPicker = ({
3784
3812
  console.error(`startYear: (${start}) less than endYear: (${end})`);
3785
3813
  return null;
3786
3814
  }
3787
- const years = range(start.getFullYear(), end.getFullYear());
3815
+ const years = range([start.getFullYear(), end.getFullYear()], { exclusiveEnd: false });
3788
3816
  return /* @__PURE__ */ jsx7("div", { className: clsx6("col select-none", className), children: /* @__PURE__ */ jsx7(Scrollbars, { autoHeight: true, autoHeightMax: maxHeight, style: { height: "100%" }, children: /* @__PURE__ */ jsx7("div", { className: "col gap-y-1 mr-3", children: years.map((year) => {
3789
3817
  const selectedYear = displayedYearMonth.getFullYear() === year;
3790
3818
  return /* @__PURE__ */ jsx7(
@@ -4183,8 +4211,8 @@ var TimePicker = ({
4183
4211
  const minuteRef = useRef2(null);
4184
4212
  const hourRef = useRef2(null);
4185
4213
  const isPM = time.getHours() >= 11;
4186
- const hours = is24HourFormat ? range(0, 23) : range(1, 12);
4187
- let minutes = range(0, 59);
4214
+ const hours = is24HourFormat ? range(24) : range([1, 12], { exclusiveEnd: false });
4215
+ let minutes = range(60);
4188
4216
  useEffect7(() => {
4189
4217
  const scrollToItem = () => {
4190
4218
  if (minuteRef.current) {
@@ -4431,6 +4459,7 @@ import { X } from "lucide-react";
4431
4459
  var formTranslation = {
4432
4460
  en: {
4433
4461
  all: "All",
4462
+ apply: "Apply",
4434
4463
  back: "Back",
4435
4464
  cancel: "Cancel",
4436
4465
  change: "Change",
@@ -4479,6 +4508,7 @@ var formTranslation = {
4479
4508
  },
4480
4509
  de: {
4481
4510
  all: "Alle",
4511
+ apply: "Anwenden",
4482
4512
  back: "Zur\xFCck",
4483
4513
  cancel: "Abbrechen",
4484
4514
  change: "\xC4ndern",
@@ -5300,7 +5330,7 @@ var Carousel = ({
5300
5330
  overScrollThreshold = 0.1,
5301
5331
  blurColor = "from-background",
5302
5332
  className = "",
5303
- heightClassName = "h-[24rem]",
5333
+ heightClassName = "h-96",
5304
5334
  widthClassName = "w-[70%] desktop:w-1/2"
5305
5335
  }) => {
5306
5336
  if (isAutoLooping && !isLooping) {
@@ -5583,10 +5613,10 @@ var Carousel = ({
5583
5613
  "div",
5584
5614
  {
5585
5615
  className: "row items-center justify-center w-full my-2",
5586
- children: range(0, length - 1).map((index) => /* @__PURE__ */ jsx20(
5616
+ children: range(length).map((index) => /* @__PURE__ */ jsx20(
5587
5617
  "button",
5588
5618
  {
5589
- className: clsx17("w-[2rem] min-w-[2rem] h-[0.75rem] min-h-[0.75rem] first:rounded-l-md last:rounded-r-md", {
5619
+ className: clsx17("w-8 min-w-8 h-3 min-h-3 first:rounded-l-md last:rounded-r-md", {
5590
5620
  "bg-carousel-dot-disabled hover:bg-carousel-dot-active": currentIndex !== index,
5591
5621
  "bg-carousel-dot-active hover:brightness-90": currentIndex === index
5592
5622
  }),
@@ -5944,85 +5974,52 @@ var FAQSection = ({
5944
5974
 
5945
5975
  // src/components/layout-and-navigation/Pagination.tsx
5946
5976
  import { ChevronFirst, ChevronLast, ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight2 } from "lucide-react";
5947
- import clsx21 from "clsx";
5948
- import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
5949
- var Pagination = ({
5950
- overwriteTranslation,
5951
- page,
5952
- numberOfPages,
5953
- onPageChanged
5954
- }) => {
5955
- const translation = useTranslation([formTranslation], overwriteTranslation);
5956
- const changePage = (page2) => {
5957
- onPageChanged(page2);
5958
- };
5959
- const noPages = numberOfPages === 0;
5960
- const onFirstPage = page === 0 && !noPages;
5961
- const onLastPage = page === numberOfPages - 1;
5962
- return /* @__PURE__ */ jsxs16("div", { className: clsx21("row", { "opacity-30": noPages }), children: [
5963
- /* @__PURE__ */ jsx25("button", { onClick: () => changePage(0), disabled: onFirstPage, children: /* @__PURE__ */ jsx25(ChevronFirst, { className: clsx21({ "opacity-30": onFirstPage }) }) }),
5964
- /* @__PURE__ */ jsx25("button", { onClick: () => changePage(page - 1), disabled: onFirstPage, children: /* @__PURE__ */ jsx25(ChevronLeft2, { className: clsx21({ "opacity-30": onFirstPage }) }) }),
5965
- /* @__PURE__ */ jsxs16("div", { className: "min-w-[80px] justify-center mx-2", children: [
5966
- /* @__PURE__ */ jsx25("span", { className: "select-none text-right flex-1", children: noPages ? 0 : page + 1 }),
5967
- /* @__PURE__ */ jsx25("span", { className: "select-none mx-2", children: translation("of") }),
5968
- /* @__PURE__ */ jsx25("span", { className: "select-none text-left flex-1", children: numberOfPages })
5969
- ] }),
5970
- /* @__PURE__ */ jsx25("button", { onClick: () => changePage(page + 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ jsx25(ChevronRight2, { className: clsx21({ "opacity-30": onLastPage }) }) }),
5971
- /* @__PURE__ */ jsx25("button", { onClick: () => changePage(numberOfPages - 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ jsx25(ChevronLast, { className: clsx21({ "opacity-30": onLastPage }) }) })
5972
- ] });
5973
- };
5974
-
5975
- // src/components/layout-and-navigation/SearchableList.tsx
5976
- import { Search } from "lucide-react";
5977
- import clsx24 from "clsx";
5977
+ import clsx23 from "clsx";
5978
5978
 
5979
5979
  // src/components/user-action/Input.tsx
5980
- import { forwardRef as forwardRef2, useEffect as useEffect13, useRef as useRef5, useState as useState13 } from "react";
5981
- import clsx23 from "clsx";
5980
+ import { forwardRef as forwardRef2, useEffect as useEffect14, useImperativeHandle, useRef as useRef5, useState as useState13 } from "react";
5981
+ import clsx22 from "clsx";
5982
5982
 
5983
- // src/hooks/useSaveDelay.ts
5983
+ // src/hooks/useDelay.ts
5984
5984
  import { useEffect as useEffect12, useState as useState12 } from "react";
5985
- function useSaveDelay(setNotificationStatus, delay) {
5986
- const [updateTimer, setUpdateTimer] = useState12(void 0);
5987
- const [notificationTimer, setNotificationTimer] = useState12(void 0);
5988
- const restartTimer = (onSave) => {
5989
- clearTimeout(updateTimer);
5990
- setUpdateTimer(setTimeout(() => {
5991
- onSave();
5992
- setNotificationStatus(true);
5993
- clearTimeout(notificationTimer);
5994
- setNotificationTimer(setTimeout(() => {
5995
- setNotificationStatus(false);
5996
- clearTimeout(notificationTimer);
5997
- }, delay));
5998
- clearTimeout(updateTimer);
5999
- }, delay));
5985
+ var defaultOptions = {
5986
+ delay: 3e3,
5987
+ disabled: false
5988
+ };
5989
+ function useDelay(options) {
5990
+ const [timer, setTimer] = useState12(void 0);
5991
+ const { delay, disabled } = {
5992
+ ...defaultOptions,
5993
+ ...options
6000
5994
  };
6001
- const clearUpdateTimer = (hasSaved = true) => {
6002
- clearTimeout(updateTimer);
6003
- if (hasSaved) {
6004
- setNotificationStatus(true);
6005
- clearTimeout(notificationTimer);
6006
- setNotificationTimer(setTimeout(() => {
6007
- setNotificationStatus(false);
6008
- clearTimeout(notificationTimer);
6009
- }, delay));
6010
- } else {
6011
- setNotificationStatus(false);
5995
+ const restartTimer = (onDelayFinish) => {
5996
+ if (disabled) {
5997
+ return;
6012
5998
  }
5999
+ clearTimeout(timer);
6000
+ setTimer(setTimeout(() => {
6001
+ onDelayFinish();
6002
+ }, delay));
6003
+ };
6004
+ const clearTimer = () => {
6005
+ clearTimeout(timer);
6013
6006
  };
6014
6007
  useEffect12(() => {
6015
6008
  return () => {
6016
- clearTimeout(updateTimer);
6017
- clearTimeout(notificationTimer);
6009
+ clearTimeout(timer);
6018
6010
  };
6019
- }, []);
6020
- return { restartTimer, clearUpdateTimer };
6011
+ }, [timer]);
6012
+ useEffect12(() => {
6013
+ if (disabled) {
6014
+ clearTimeout(timer);
6015
+ }
6016
+ }, [disabled, timer]);
6017
+ return { restartTimer, clearTimer };
6021
6018
  }
6022
6019
 
6023
6020
  // src/components/user-action/Label.tsx
6024
- import clsx22 from "clsx";
6025
- import { jsx as jsx26 } from "react/jsx-runtime";
6021
+ import clsx21 from "clsx";
6022
+ import { jsx as jsx25 } from "react/jsx-runtime";
6026
6023
  var styleMapping = {
6027
6024
  labelSmall: "textstyle-label-sm",
6028
6025
  labelMedium: "textstyle-label-md",
@@ -6035,12 +6032,107 @@ var Label = ({
6035
6032
  className,
6036
6033
  ...props
6037
6034
  }) => {
6038
- return /* @__PURE__ */ jsx26("label", { ...props, className: clsx22(styleMapping[labelType], className), children: children ? children : name });
6035
+ return /* @__PURE__ */ jsx25("label", { ...props, className: clsx21(styleMapping[labelType], className), children: children ? children : name });
6036
+ };
6037
+
6038
+ // src/hooks/useFocusManagement.ts
6039
+ import { useCallback as useCallback4 } from "react";
6040
+ function useFocusManagement() {
6041
+ const getFocusableElements = useCallback4(() => {
6042
+ return Array.from(
6043
+ document.querySelectorAll(
6044
+ 'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
6045
+ )
6046
+ ).filter(
6047
+ (el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
6048
+ );
6049
+ }, []);
6050
+ const getNextFocusElement = useCallback4(() => {
6051
+ const elements = getFocusableElements();
6052
+ if (elements.length === 0) {
6053
+ return void 0;
6054
+ }
6055
+ let nextElement = elements[0];
6056
+ if (document.activeElement instanceof HTMLElement) {
6057
+ const currentIndex = elements.indexOf(document.activeElement);
6058
+ nextElement = elements[(currentIndex + 1) % elements.length];
6059
+ }
6060
+ return nextElement;
6061
+ }, [getFocusableElements]);
6062
+ const focusNext = useCallback4(() => {
6063
+ const nextElement = getNextFocusElement();
6064
+ nextElement?.focus();
6065
+ }, [getNextFocusElement]);
6066
+ const getPreviousFocusElement = useCallback4(() => {
6067
+ const elements = getFocusableElements();
6068
+ if (elements.length === 0) {
6069
+ return void 0;
6070
+ }
6071
+ let previousElement = elements[0];
6072
+ if (document.activeElement instanceof HTMLElement) {
6073
+ const currentIndex = elements.indexOf(document.activeElement);
6074
+ if (currentIndex === 0) {
6075
+ previousElement = elements[elements.length - 1];
6076
+ } else {
6077
+ previousElement = elements[currentIndex - 1];
6078
+ }
6079
+ }
6080
+ return previousElement;
6081
+ }, [getFocusableElements]);
6082
+ const focusPrevious = useCallback4(() => {
6083
+ const previousElement = getPreviousFocusElement();
6084
+ if (previousElement) previousElement.focus();
6085
+ }, [getPreviousFocusElement]);
6086
+ return {
6087
+ getFocusableElements,
6088
+ getNextFocusElement,
6089
+ getPreviousFocusElement,
6090
+ focusNext,
6091
+ focusPrevious
6092
+ };
6093
+ }
6094
+
6095
+ // src/hooks/useFocusOnceVisible.ts
6096
+ import React2, { useEffect as useEffect13 } from "react";
6097
+ var useFocusOnceVisible = (ref, disable = false) => {
6098
+ const [hasUsedFocus, setHasUsedFocus] = React2.useState(false);
6099
+ useEffect13(() => {
6100
+ if (disable || hasUsedFocus) {
6101
+ return;
6102
+ }
6103
+ const observer = new IntersectionObserver(([entry]) => {
6104
+ if (entry.isIntersecting && !hasUsedFocus) {
6105
+ ref.current?.focus();
6106
+ setHasUsedFocus(hasUsedFocus);
6107
+ }
6108
+ }, {
6109
+ threshold: 0.1
6110
+ });
6111
+ if (ref.current) {
6112
+ observer.observe(ref.current);
6113
+ }
6114
+ return () => observer.disconnect();
6115
+ }, [disable, hasUsedFocus, ref]);
6039
6116
  };
6040
6117
 
6041
6118
  // src/components/user-action/Input.tsx
6042
- import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
6043
- var Input = ({
6119
+ import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
6120
+ var getInputClassName = ({ disabled = false, hasError = false }) => {
6121
+ return clsx22(
6122
+ "px-2 py-1.5 rounded-md border-2",
6123
+ {
6124
+ "bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
6125
+ "bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
6126
+ "bg-disabled-background text-disabled-text border-disabled-border": disabled
6127
+ }
6128
+ );
6129
+ };
6130
+ var defaultEditCompleteOptions = {
6131
+ onBlur: true,
6132
+ afterDelay: true,
6133
+ delay: 2500
6134
+ };
6135
+ var Input = forwardRef2(function Input2({
6044
6136
  id,
6045
6137
  type = "text",
6046
6138
  value,
@@ -6049,70 +6141,88 @@ var Input = ({
6049
6141
  onChangeText = noop,
6050
6142
  onEditCompleted,
6051
6143
  className = "",
6144
+ allowEnterComplete = true,
6052
6145
  expanded = true,
6053
- autoFocus,
6146
+ autoFocus = false,
6054
6147
  onBlur,
6148
+ editCompleteOptions,
6055
6149
  containerClassName,
6150
+ disabled,
6056
6151
  ...restProps
6057
- }) => {
6152
+ }, forwardedRef) {
6153
+ const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
6058
6154
  const {
6059
6155
  restartTimer,
6060
- clearUpdateTimer
6061
- } = useSaveDelay(() => void 0, 3e3);
6062
- const ref = useRef5(null);
6063
- useEffect13(() => {
6064
- if (autoFocus) {
6065
- ref.current?.focus();
6156
+ clearTimer
6157
+ } = useDelay({ delay, disabled: !afterDelay });
6158
+ const innerRef = useRef5(null);
6159
+ const { focusNext } = useFocusManagement();
6160
+ useFocusOnceVisible(innerRef, !autoFocus);
6161
+ useImperativeHandle(forwardedRef, () => innerRef.current);
6162
+ const handleKeyDown = (e) => {
6163
+ if (e.key === "Enter" && !e.shiftKey) {
6164
+ e.preventDefault();
6165
+ innerRef.current?.blur();
6166
+ focusNext();
6066
6167
  }
6067
- }, [autoFocus]);
6068
- return /* @__PURE__ */ jsxs17("div", { className: clsx23({ "w-full": expanded }, containerClassName), children: [
6069
- label && /* @__PURE__ */ jsx27(Label, { ...label, htmlFor: id, className: clsx23("mb-1", label.className) }),
6070
- /* @__PURE__ */ jsx27(
6168
+ };
6169
+ return /* @__PURE__ */ jsxs16("div", { className: clsx22({ "w-full": expanded }, containerClassName), children: [
6170
+ label && /* @__PURE__ */ jsx26(Label, { ...label, htmlFor: id, className: clsx22("mb-1", label.className) }),
6171
+ /* @__PURE__ */ jsx26(
6071
6172
  "input",
6072
6173
  {
6073
- ref,
6174
+ ...restProps,
6175
+ ref: innerRef,
6074
6176
  value,
6075
6177
  id,
6076
6178
  type,
6077
- className,
6179
+ disabled,
6180
+ className: clsx22(getInputClassName({ disabled }), className),
6181
+ onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
6078
6182
  onBlur: (event) => {
6079
- if (onBlur) {
6080
- onBlur(event);
6081
- }
6082
- if (onEditCompleted) {
6183
+ onBlur?.(event);
6184
+ if (onEditCompleted && allowEditCompleteOnBlur) {
6083
6185
  onEditCompleted(event.target.value);
6084
- clearUpdateTimer();
6186
+ clearTimer();
6085
6187
  }
6086
6188
  },
6087
6189
  onChange: (e) => {
6088
6190
  const value2 = e.target.value;
6089
6191
  if (onEditCompleted) {
6090
6192
  restartTimer(() => {
6091
- onEditCompleted(value2);
6092
- clearUpdateTimer();
6193
+ if (innerRef.current) {
6194
+ innerRef.current.blur();
6195
+ if (!allowEditCompleteOnBlur) {
6196
+ onEditCompleted(value2);
6197
+ }
6198
+ } else {
6199
+ onEditCompleted(value2);
6200
+ }
6093
6201
  });
6094
6202
  }
6095
6203
  onChange(e);
6096
6204
  onChangeText(value2);
6097
- },
6098
- ...restProps
6205
+ }
6099
6206
  }
6100
6207
  )
6101
6208
  ] });
6102
- };
6209
+ });
6103
6210
  var InputUncontrolled = ({
6104
- defaultValue = "",
6211
+ value = "",
6105
6212
  onChangeText = noop,
6106
6213
  ...props
6107
6214
  }) => {
6108
- const [value, setValue] = useState13(defaultValue);
6109
- return /* @__PURE__ */ jsx27(
6215
+ const [usedValue, setUsedValue] = useState13(value);
6216
+ useEffect14(() => {
6217
+ setUsedValue(value);
6218
+ }, [value]);
6219
+ return /* @__PURE__ */ jsx26(
6110
6220
  Input,
6111
6221
  {
6112
6222
  ...props,
6113
- value,
6223
+ value: usedValue,
6114
6224
  onChangeText: (text) => {
6115
- setValue(text);
6225
+ setUsedValue(text);
6116
6226
  onChangeText(text);
6117
6227
  }
6118
6228
  }
@@ -6127,35 +6237,107 @@ var FormInput = forwardRef2(function FormInput2({
6127
6237
  errorClassName,
6128
6238
  containerClassName,
6129
6239
  required,
6240
+ disabled,
6130
6241
  ...restProps
6131
6242
  }, ref) {
6132
- const input = /* @__PURE__ */ jsx27(
6243
+ const input = /* @__PURE__ */ jsx26(
6133
6244
  "input",
6134
6245
  {
6246
+ ...restProps,
6135
6247
  ref,
6136
6248
  id,
6137
- ...restProps,
6138
- className: clsx23(
6139
- {
6140
- "focus:border-primary focus:ring-primary": !errorText,
6141
- "focus:border-negative focus:ring-negative text-negative": !!errorText
6142
- },
6249
+ disabled,
6250
+ className: clsx22(
6251
+ getInputClassName({ disabled, hasError: !!errorText }),
6143
6252
  className
6144
6253
  )
6145
6254
  }
6146
6255
  );
6147
- return /* @__PURE__ */ jsxs17("div", { className: clsx23("flex flex-col gap-y-1", containerClassName), children: [
6148
- labelText && /* @__PURE__ */ jsxs17("label", { htmlFor: id, className: clsx23("textstyle-label-md", labelClassName), children: [
6256
+ return /* @__PURE__ */ jsxs16("div", { className: clsx22("flex flex-col gap-y-1", containerClassName), children: [
6257
+ labelText && /* @__PURE__ */ jsxs16("label", { htmlFor: id, className: clsx22("textstyle-label-md", labelClassName), children: [
6149
6258
  labelText,
6150
- required && /* @__PURE__ */ jsx27("span", { className: "text-primary font-bold", children: "*" })
6259
+ required && /* @__PURE__ */ jsx26("span", { className: "text-primary font-bold", children: "*" })
6151
6260
  ] }),
6152
6261
  input,
6153
- errorText && /* @__PURE__ */ jsx27("label", { htmlFor: id, className: clsx23("text-negative", errorClassName), children: errorText })
6262
+ errorText && /* @__PURE__ */ jsx26("label", { htmlFor: id, className: clsx22("text-negative", errorClassName), children: errorText })
6154
6263
  ] });
6155
6264
  });
6156
6265
 
6266
+ // src/components/layout-and-navigation/Pagination.tsx
6267
+ import { useEffect as useEffect15, useState as useState14 } from "react";
6268
+ import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
6269
+ var Pagination = ({
6270
+ overwriteTranslation,
6271
+ pageIndex,
6272
+ pageCount,
6273
+ onPageChanged,
6274
+ className,
6275
+ style
6276
+ }) => {
6277
+ const translation = useTranslation([formTranslation], overwriteTranslation);
6278
+ const [value, setValue] = useState14((pageIndex + 1).toString());
6279
+ const noPages = pageCount === 0;
6280
+ const onFirstPage = pageIndex === 0 && !noPages;
6281
+ const onLastPage = pageIndex === pageCount - 1;
6282
+ useEffect15(() => {
6283
+ if (noPages) {
6284
+ setValue("0");
6285
+ } else {
6286
+ setValue((pageIndex + 1).toString());
6287
+ }
6288
+ }, [pageIndex, noPages]);
6289
+ const changePage = (page) => {
6290
+ onPageChanged(page);
6291
+ };
6292
+ return /* @__PURE__ */ jsxs17("div", { className: clsx23("row gap-x-1", className), style, children: [
6293
+ /* @__PURE__ */ jsx27(IconButton, { color: "transparent", onClick: () => changePage(0), disabled: onFirstPage || noPages, children: /* @__PURE__ */ jsx27(ChevronFirst, {}) }),
6294
+ /* @__PURE__ */ jsx27(IconButton, { color: "transparent", onClick: () => changePage(pageIndex - 1), disabled: onFirstPage || noPages, children: /* @__PURE__ */ jsx27(ChevronLeft2, {}) }),
6295
+ /* @__PURE__ */ jsxs17("div", { className: "row min-w-56 gap-x-2 items-center justify-center mx-2 text-center", children: [
6296
+ /* @__PURE__ */ jsx27(
6297
+ Input,
6298
+ {
6299
+ value,
6300
+ containerClassName: "flex flex-1 h-10",
6301
+ className: clsx23(
6302
+ "w-full text-center font-bold input-indicator-hidden"
6303
+ ),
6304
+ type: "number",
6305
+ min: 1,
6306
+ max: pageCount,
6307
+ disabled: noPages,
6308
+ onChangeText: (value2) => {
6309
+ if (value2) {
6310
+ setValue(clamp(Number(value2), 1, pageCount).toString());
6311
+ } else {
6312
+ setValue(value2);
6313
+ }
6314
+ },
6315
+ onEditCompleted: (value2) => {
6316
+ changePage(clamp(Number(value2) - 1, 0, pageCount - 1));
6317
+ },
6318
+ editCompleteOptions: { delay: 800 }
6319
+ }
6320
+ ),
6321
+ /* @__PURE__ */ jsx27("span", { className: "select-none w-10", children: translation("of") }),
6322
+ /* @__PURE__ */ jsx27(
6323
+ "span",
6324
+ {
6325
+ className: "row flex-1 items-center justify-center select-none h-10 bg-surface text-on-surface rounded-md font-bold",
6326
+ children: pageCount
6327
+ }
6328
+ )
6329
+ ] }),
6330
+ /* @__PURE__ */ jsx27(IconButton, { color: "transparent", onClick: () => changePage(pageIndex + 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ jsx27(ChevronRight2, {}) }),
6331
+ /* @__PURE__ */ jsx27(IconButton, { color: "transparent", onClick: () => changePage(pageCount - 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ jsx27(ChevronLast, {}) })
6332
+ ] });
6333
+ };
6334
+
6335
+ // src/components/layout-and-navigation/SearchableList.tsx
6336
+ import { Search } from "lucide-react";
6337
+ import clsx24 from "clsx";
6338
+
6157
6339
  // src/hooks/useSearch.ts
6158
- import { useEffect as useEffect14, useMemo as useMemo2, useState as useState14 } from "react";
6340
+ import { useEffect as useEffect16, useMemo as useMemo2, useState as useState15 } from "react";
6159
6341
 
6160
6342
  // src/util/simpleSearch.ts
6161
6343
  var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
@@ -6186,9 +6368,9 @@ var useSearch = ({
6186
6368
  initialSearch,
6187
6369
  searchMapping
6188
6370
  }) => {
6189
- const [items, setItems] = useState14(list);
6190
- const [search, setSearch] = useState14(initialSearch);
6191
- useEffect14(() => {
6371
+ const [items, setItems] = useState15(list);
6372
+ const [search, setSearch] = useState15(initialSearch);
6373
+ useEffect16(() => {
6192
6374
  setItems(list);
6193
6375
  }, [list]);
6194
6376
  const result = useMemo2(
@@ -6249,7 +6431,7 @@ var SearchableList = ({
6249
6431
  // src/components/layout-and-navigation/StepperBar.tsx
6250
6432
  import { Check as Check2, ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight3 } from "lucide-react";
6251
6433
  import clsx25 from "clsx";
6252
- import { useEffect as useEffect15, useState as useState15 } from "react";
6434
+ import { useEffect as useEffect17, useState as useState16 } from "react";
6253
6435
  import { jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
6254
6436
  var defaultState = {
6255
6437
  currentStep: 0,
@@ -6267,7 +6449,7 @@ var StepperBar = ({
6267
6449
  className = ""
6268
6450
  }) => {
6269
6451
  const translation = useTranslation([formTranslation], overwriteTranslation);
6270
- const dots = range(0, numberOfSteps);
6452
+ const dots = range(numberOfSteps + 1);
6271
6453
  const { currentStep, seenSteps } = state ?? defaultState;
6272
6454
  const update = (newStep) => {
6273
6455
  seenSteps.add(newStep);
@@ -6343,8 +6525,8 @@ var StepperBar = ({
6343
6525
  );
6344
6526
  };
6345
6527
  var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
6346
- const [usedState, setUsedState] = useState15(state ?? defaultState);
6347
- useEffect15(() => {
6528
+ const [usedState, setUsedState] = useState16(state ?? defaultState);
6529
+ useEffect17(() => {
6348
6530
  setUsedState(state ?? defaultState);
6349
6531
  }, [state]);
6350
6532
  return /* @__PURE__ */ jsx29(
@@ -6360,394 +6542,59 @@ var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
6360
6542
  );
6361
6543
  };
6362
6544
 
6363
- // src/components/layout-and-navigation/Table.tsx
6364
- import { useEffect as useEffect16, useRef as useRef6, useState as useState17 } from "react";
6365
- import { Scrollbars as Scrollbars3 } from "react-custom-scrollbars-2";
6366
-
6367
- // src/components/user-action/Checkbox.tsx
6368
- import { useState as useState16 } from "react";
6369
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
6370
- import { Check as Check3, Minus } from "lucide-react";
6545
+ // src/components/layout-and-navigation/TextImage.tsx
6371
6546
  import clsx26 from "clsx";
6372
6547
  import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
6373
- var checkboxSizeMapping = {
6374
- small: "size-4",
6375
- medium: "size-6",
6376
- large: "size-8"
6377
- };
6378
- var checkboxIconSizeMapping = {
6379
- small: "size-3",
6380
- medium: "size-5",
6381
- large: "size-7"
6382
- };
6383
- var Checkbox = ({
6384
- id,
6385
- label,
6386
- checked,
6387
- disabled,
6388
- onChange,
6389
- onChangeTristate,
6390
- size = "medium",
6391
- className = "",
6392
- containerClassName
6548
+ var TextImage = ({
6549
+ overwriteTranslation,
6550
+ title,
6551
+ description,
6552
+ imageUrl,
6553
+ onShowMoreClicked,
6554
+ color = "primary",
6555
+ badge,
6556
+ contentClassName = "",
6557
+ className = ""
6393
6558
  }) => {
6394
- const usedSizeClass = checkboxSizeMapping[size];
6395
- const innerIconSize = checkboxIconSizeMapping[size];
6396
- const propagateChange = (checked2) => {
6397
- if (onChangeTristate) {
6398
- onChangeTristate(checked2);
6399
- }
6400
- if (onChange) {
6401
- onChange(checked2 === "indeterminate" ? false : checked2);
6402
- }
6403
- };
6404
- const changeValue = () => {
6405
- const newValue = checked === "indeterminate" ? false : !checked;
6406
- propagateChange(newValue);
6559
+ const translation = useTranslation([formTranslation], overwriteTranslation);
6560
+ const chipColorMapping = {
6561
+ primary: "text-text-image-primary-background bg-text-image-primary-text",
6562
+ secondary: "text-text-image-secondary-background bg-text-image-secondary-text",
6563
+ dark: "text-text-image-dark-background bg-text-image-dark-text"
6407
6564
  };
6408
- return /* @__PURE__ */ jsxs20("div", { className: clsx26("row justify-center items-center", containerClassName), children: [
6409
- /* @__PURE__ */ jsx30(
6410
- CheckboxPrimitive.Root,
6411
- {
6412
- onCheckedChange: propagateChange,
6413
- checked,
6414
- disabled,
6415
- id,
6416
- className: clsx26(usedSizeClass, `items-center border-2 rounded outline-none focus:border-primary`, {
6417
- "text-disabled-text border-disabled-text bg-disabled-background": disabled,
6418
- "bg-surface": !disabled && !checked,
6419
- "bg-primary/30 border-primary text-primary": checked === true || checked === "indeterminate",
6420
- "hover:border-primary focus:hover:border-primary": !checked
6421
- }, className),
6422
- children: /* @__PURE__ */ jsxs20(CheckboxPrimitive.Indicator, { children: [
6423
- checked === true && /* @__PURE__ */ jsx30(Check3, { className: innerIconSize }),
6424
- checked === "indeterminate" && /* @__PURE__ */ jsx30(Minus, { className: innerIconSize })
6425
- ] })
6426
- }
6427
- ),
6428
- label && /* @__PURE__ */ jsx30(
6429
- Label,
6430
- {
6431
- ...label,
6432
- className: clsx26("cursor-pointer", label.className),
6433
- htmlFor: id,
6434
- onClick: changeValue
6435
- }
6436
- )
6437
- ] });
6438
- };
6439
- var CheckboxUncontrolled = ({
6440
- onChange,
6441
- onChangeTristate,
6442
- defaultValue = false,
6443
- ...props
6444
- }) => {
6445
- const [checked, setChecked] = useState16(defaultValue);
6446
- const handleChange = (checked2) => {
6447
- if (onChangeTristate) {
6448
- onChangeTristate(checked2);
6449
- }
6450
- if (onChange) {
6451
- onChange(checked2 === "indeterminate" ? false : checked2);
6452
- }
6453
- setChecked(checked2);
6565
+ const colorMapping = {
6566
+ primary: "text-text-image-primary-text bg-linear-to-r from-30% from-text-image-primary-background to-text-image-primary-background/55",
6567
+ secondary: "text-text-image-secondary-text bg-linear-to-r from-30% from-text-image-secondary-background to-text-image-secondary-background/55",
6568
+ dark: "text-text-image-dark-text bg-linear-to-r from-30% from-text-image-dark-background to-text-image-dark-background/55"
6454
6569
  };
6455
6570
  return /* @__PURE__ */ jsx30(
6456
- Checkbox,
6571
+ "div",
6457
6572
  {
6458
- ...props,
6459
- checked,
6460
- onChangeTristate: handleChange
6573
+ className: clsx26("rounded-2xl w-full", className),
6574
+ style: {
6575
+ backgroundImage: `url(${imageUrl})`,
6576
+ backgroundSize: "cover"
6577
+ },
6578
+ children: /* @__PURE__ */ jsxs20(
6579
+ "div",
6580
+ {
6581
+ className: clsx26(`col px-6 py-12 rounded-2xl h-full`, colorMapping[color], contentClassName),
6582
+ children: [
6583
+ badge && /* @__PURE__ */ jsx30("div", { className: clsx26(`chip-full mb-2 py-2 px-4 w-fit`, chipColorMapping[color]), children: /* @__PURE__ */ jsx30("span", { className: "text-lg font-bold", children: badge }) }),
6584
+ /* @__PURE__ */ jsxs20("div", { className: "col gap-y-1 overflow-hidden", children: [
6585
+ /* @__PURE__ */ jsx30("span", { className: "textstyle-title-xl", children: title }),
6586
+ /* @__PURE__ */ jsx30("span", { className: "text-ellipsis overflow-hidden", children: description })
6587
+ ] }),
6588
+ onShowMoreClicked && /* @__PURE__ */ jsx30("div", { className: "row mt-2 underline", children: /* @__PURE__ */ jsx30("button", { onClick: onShowMoreClicked, children: translation("showMore") }) })
6589
+ ]
6590
+ }
6591
+ )
6461
6592
  }
6462
6593
  );
6463
6594
  };
6464
6595
 
6465
- // src/components/layout-and-navigation/Table.tsx
6466
- import clsx27 from "clsx";
6467
- import { ChevronDown as ChevronDown4, ChevronsUpDown, ChevronUp as ChevronUp3 } from "lucide-react";
6596
+ // src/components/layout-and-navigation/VerticalDivider.tsx
6468
6597
  import { jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
6469
- var defaultTableStatePagination = {
6470
- currentPage: 0,
6471
- entriesPerPage: 5
6472
- };
6473
- var defaultTableStateSelection = {
6474
- currentSelection: [],
6475
- hasSelectedAll: false,
6476
- hasSelectedSome: false,
6477
- hasSelectedNone: true
6478
- };
6479
- var isDataObjectSelected = (tableState, dataObject, identifierMapping) => {
6480
- if (!tableState.selection) {
6481
- return false;
6482
- }
6483
- return !!tableState.selection.currentSelection.find((value) => value.localeCompare(identifierMapping(dataObject)) === 0);
6484
- };
6485
- var pageForItem = (data, item, entriesPerPage, identifierMapping) => {
6486
- const index = data.findIndex((value) => identifierMapping(value) === identifierMapping(item));
6487
- if (index !== -1) {
6488
- return Math.floor(index / entriesPerPage);
6489
- }
6490
- console.warn("item doesn't exist on data", item, data);
6491
- return 0;
6492
- };
6493
- var updatePagination = (pagination, dataLength) => ({
6494
- ...pagination,
6495
- currentPage: Math.min(Math.max(Math.ceil(dataLength / pagination.entriesPerPage) - 1, 0), pagination.currentPage)
6496
- });
6497
- var addElementToTable = (tableState, data, dataObject, identifierMapping) => {
6498
- return {
6499
- ...tableState,
6500
- pagination: tableState.pagination ? {
6501
- ...tableState.pagination,
6502
- currentPage: pageForItem(data, dataObject, tableState.pagination.entriesPerPage, identifierMapping)
6503
- } : void 0,
6504
- selection: tableState.selection ? {
6505
- ...tableState.selection,
6506
- hasSelectedAll: false,
6507
- hasSelectedSome: tableState.selection.hasSelectedAll || tableState.selection.hasSelectedSome
6508
- } : void 0
6509
- };
6510
- };
6511
- var removeFromTableSelection = (tableState, deletedObjects, dataLength, identifierMapping) => {
6512
- if (!tableState.selection) {
6513
- return tableState;
6514
- }
6515
- const deletedObjectIds = deletedObjects.map(identifierMapping);
6516
- const elementsBefore = tableState.selection.currentSelection.length;
6517
- const currentSelection = tableState.selection.currentSelection.filter((value) => !deletedObjectIds.includes(value));
6518
- dataLength -= elementsBefore - currentSelection.length;
6519
- return {
6520
- ...tableState,
6521
- selection: {
6522
- currentSelection,
6523
- hasSelectedAll: currentSelection.length === dataLength && dataLength !== 0,
6524
- hasSelectedSome: currentSelection.length > 0 && currentSelection.length !== dataLength,
6525
- hasSelectedNone: currentSelection.length === 0
6526
- },
6527
- pagination: tableState.pagination ? updatePagination(tableState.pagination, dataLength) : void 0
6528
- };
6529
- };
6530
- var changeTableSelectionSingle = (tableState, dataObject, dataLength, identifierMapping) => {
6531
- if (!tableState.selection) {
6532
- return tableState;
6533
- }
6534
- const hasSelectedObject = isDataObjectSelected(tableState, dataObject, identifierMapping);
6535
- let currentSelection = [...tableState.selection.currentSelection, identifierMapping(dataObject)];
6536
- if (hasSelectedObject) {
6537
- currentSelection = tableState.selection.currentSelection.filter((value) => value.localeCompare(identifierMapping(dataObject)) !== 0);
6538
- }
6539
- return {
6540
- ...tableState,
6541
- selection: {
6542
- currentSelection,
6543
- hasSelectedAll: currentSelection.length === dataLength,
6544
- hasSelectedSome: currentSelection.length > 0 && currentSelection.length !== dataLength,
6545
- hasSelectedNone: currentSelection.length === 0
6546
- }
6547
- };
6548
- };
6549
- var changeTableSelectionAll = (tableState, data, identifierMapping) => {
6550
- if (!tableState.selection) {
6551
- return tableState;
6552
- }
6553
- if (data.length === 0) {
6554
- return {
6555
- ...tableState,
6556
- selection: {
6557
- currentSelection: [],
6558
- hasSelectedAll: false,
6559
- hasSelectedSome: false,
6560
- hasSelectedNone: true
6561
- }
6562
- };
6563
- }
6564
- const hasSelectedAll = !(tableState.selection.hasSelectedSome || tableState.selection.hasSelectedAll);
6565
- return {
6566
- ...tableState,
6567
- selection: {
6568
- currentSelection: hasSelectedAll ? data.map(identifierMapping) : [],
6569
- hasSelectedAll,
6570
- hasSelectedSome: false,
6571
- hasSelectedNone: !hasSelectedAll
6572
- }
6573
- };
6574
- };
6575
- var Table = ({
6576
- data,
6577
- stateManagement = [{}, noop],
6578
- identifierMapping,
6579
- header,
6580
- rowMappingToCells,
6581
- sorting,
6582
- focusElement,
6583
- className
6584
- }) => {
6585
- const sortedData = [...data];
6586
- if (sorting) {
6587
- const [sortingFunction, sortingType] = sorting;
6588
- sortedData.sort((a, b) => sortingFunction(a, b) * (sortingType === "ascending" ? 1 : -1));
6589
- }
6590
- let currentPage = 0;
6591
- let pageCount = 1;
6592
- let entriesPerPage = 5;
6593
- const [tableState, updateTableState] = stateManagement;
6594
- let shownElements = sortedData;
6595
- if (tableState?.pagination) {
6596
- if (tableState.pagination.entriesPerPage < 1) {
6597
- console.error("tableState.pagination.entriesPerPage must be >= 1", tableState.pagination.entriesPerPage);
6598
- }
6599
- entriesPerPage = Math.max(1, tableState.pagination.entriesPerPage);
6600
- pageCount = Math.ceil(sortedData.length / entriesPerPage);
6601
- if (tableState.pagination.currentPage < 0 || tableState.pagination.currentPage >= pageCount && pageCount !== 0) {
6602
- console.error(
6603
- "tableState.pagination.currentPage < 0 || (tableState.pagination.currentPage >= pageCount && pageCount !== 0) must be fullfilled",
6604
- [`pageCount: ${pageCount}`, `tableState.pagination.currentPage: ${tableState.pagination.currentPage}`]
6605
- );
6606
- } else {
6607
- currentPage = tableState.pagination.currentPage;
6608
- }
6609
- if (focusElement) {
6610
- currentPage = pageForItem(sortedData, focusElement, entriesPerPage, identifierMapping);
6611
- }
6612
- shownElements = sortedData.slice(currentPage * entriesPerPage, Math.min(sortedData.length, (currentPage + 1) * entriesPerPage));
6613
- } else {
6614
- currentPage = 0;
6615
- }
6616
- const headerRow = "border-b-2";
6617
- const headerPaddingHead = "pb-2";
6618
- const headerPaddingBody = "pt-2";
6619
- const cellPadding = "py-1 px-2";
6620
- const [scrollbarsAutoHeightMin, setScrollbarsAutoHeightMin] = useState17(0);
6621
- const tableRef = useRef6(null);
6622
- const calculateHeight = () => {
6623
- if (tableRef.current) {
6624
- const tableHeight = tableRef.current.offsetHeight;
6625
- const offset = 25;
6626
- setScrollbarsAutoHeightMin(tableHeight + offset);
6627
- }
6628
- };
6629
- useEffect16(() => {
6630
- calculateHeight();
6631
- const handleResize = () => {
6632
- calculateHeight();
6633
- };
6634
- window.addEventListener("resize", handleResize);
6635
- return () => {
6636
- window.removeEventListener("resize", handleResize);
6637
- };
6638
- }, [data, currentPage]);
6639
- return /* @__PURE__ */ jsxs21("div", { className: clsx27("col gap-y-4 overflow-hidden", className), children: [
6640
- /* @__PURE__ */ jsx31("div", { children: /* @__PURE__ */ jsx31(Scrollbars3, { autoHeight: true, autoHeightMin: scrollbarsAutoHeightMin, children: /* @__PURE__ */ jsxs21("table", { ref: tableRef, className: "w-full mb-[12px]", children: [
6641
- /* @__PURE__ */ jsx31("thead", { children: /* @__PURE__ */ jsxs21("tr", { className: headerRow, children: [
6642
- header && tableState.selection && /* @__PURE__ */ jsx31("th", { className: headerPaddingHead, children: /* @__PURE__ */ jsx31(
6643
- Checkbox,
6644
- {
6645
- checked: tableState.selection.hasSelectedSome ? "indeterminate" : tableState.selection.hasSelectedAll,
6646
- onChange: () => updateTableState(changeTableSelectionAll(tableState, data, identifierMapping))
6647
- }
6648
- ) }),
6649
- header && header.map((value, index) => /* @__PURE__ */ jsx31("th", { className: headerPaddingHead, children: /* @__PURE__ */ jsx31("div", { className: "row justify-start px-2", children: value }) }, `tableHeader${index}`))
6650
- ] }) }),
6651
- /* @__PURE__ */ jsx31("tbody", { children: shownElements.map((value, rowIndex) => /* @__PURE__ */ jsxs21("tr", { children: [
6652
- tableState.selection && /* @__PURE__ */ jsx31("td", { className: clsx27(cellPadding, { [headerPaddingBody]: rowIndex === 0 }), children: /* @__PURE__ */ jsx31(
6653
- Checkbox,
6654
- {
6655
- checked: isDataObjectSelected(tableState, value, identifierMapping),
6656
- onChange: () => {
6657
- updateTableState(changeTableSelectionSingle(tableState, value, data.length, identifierMapping));
6658
- }
6659
- }
6660
- ) }),
6661
- rowMappingToCells(value).map((value1, index) => /* @__PURE__ */ jsx31(
6662
- "td",
6663
- {
6664
- className: clsx27(cellPadding, { [headerPaddingBody]: rowIndex === 0 }),
6665
- children: value1
6666
- },
6667
- index
6668
- ))
6669
- ] }, identifierMapping(value))) })
6670
- ] }) }) }),
6671
- /* @__PURE__ */ jsx31("div", { className: "row justify-center", children: tableState.pagination && /* @__PURE__ */ jsx31(Pagination, { page: currentPage, numberOfPages: pageCount, onPageChanged: (page) => updateTableState({
6672
- ...tableState,
6673
- pagination: { entriesPerPage, currentPage: page }
6674
- }) }) })
6675
- ] });
6676
- };
6677
- var SortButton = ({
6678
- children,
6679
- ascending,
6680
- color,
6681
- onClick,
6682
- ...buttonProps
6683
- }) => {
6684
- return /* @__PURE__ */ jsx31(
6685
- TextButton,
6686
- {
6687
- color,
6688
- onClick: () => onClick(ascending === "descending" ? "ascending" : "descending"),
6689
- ...buttonProps,
6690
- children: /* @__PURE__ */ jsxs21("div", { className: "row gap-x-2", children: [
6691
- children,
6692
- ascending === "ascending" ? /* @__PURE__ */ jsx31(ChevronUp3, {}) : !ascending ? /* @__PURE__ */ jsx31(ChevronsUpDown, {}) : /* @__PURE__ */ jsx31(ChevronDown4, {})
6693
- ] })
6694
- }
6695
- );
6696
- };
6697
-
6698
- // src/components/layout-and-navigation/TextImage.tsx
6699
- import clsx28 from "clsx";
6700
- import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
6701
- var TextImage = ({
6702
- overwriteTranslation,
6703
- title,
6704
- description,
6705
- imageUrl,
6706
- onShowMoreClicked,
6707
- color = "primary",
6708
- badge,
6709
- contentClassName = "",
6710
- className = ""
6711
- }) => {
6712
- const translation = useTranslation([formTranslation], overwriteTranslation);
6713
- const chipColorMapping = {
6714
- primary: "text-text-image-primary-background bg-text-image-primary-text",
6715
- secondary: "text-text-image-secondary-background bg-text-image-secondary-text",
6716
- dark: "text-text-image-dark-background bg-text-image-dark-text"
6717
- };
6718
- const colorMapping = {
6719
- primary: "text-text-image-primary-text bg-linear-to-r from-30% from-text-image-primary-background to-text-image-primary-background/55",
6720
- secondary: "text-text-image-secondary-text bg-linear-to-r from-30% from-text-image-secondary-background to-text-image-secondary-background/55",
6721
- dark: "text-text-image-dark-text bg-linear-to-r from-30% from-text-image-dark-background to-text-image-dark-background/55"
6722
- };
6723
- return /* @__PURE__ */ jsx32(
6724
- "div",
6725
- {
6726
- className: clsx28("rounded-2xl w-full", className),
6727
- style: {
6728
- backgroundImage: `url(${imageUrl})`,
6729
- backgroundSize: "cover"
6730
- },
6731
- children: /* @__PURE__ */ jsxs22(
6732
- "div",
6733
- {
6734
- className: clsx28(`col px-6 py-12 rounded-2xl h-full`, colorMapping[color], contentClassName),
6735
- children: [
6736
- badge && /* @__PURE__ */ jsx32("div", { className: clsx28(`chip-full mb-2 py-2 px-4 w-fit`, chipColorMapping[color]), children: /* @__PURE__ */ jsx32("span", { className: "text-lg font-bold", children: badge }) }),
6737
- /* @__PURE__ */ jsxs22("div", { className: "col gap-y-1 overflow-hidden", children: [
6738
- /* @__PURE__ */ jsx32("span", { className: "textstyle-title-xl", children: title }),
6739
- /* @__PURE__ */ jsx32("span", { className: "text-ellipsis overflow-hidden", children: description })
6740
- ] }),
6741
- onShowMoreClicked && /* @__PURE__ */ jsx32("div", { className: "row mt-2 underline", children: /* @__PURE__ */ jsx32("button", { onClick: onShowMoreClicked, children: translation("showMore") }) })
6742
- ]
6743
- }
6744
- )
6745
- }
6746
- );
6747
- };
6748
-
6749
- // src/components/layout-and-navigation/VerticalDivider.tsx
6750
- import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
6751
6598
  var VerticalDivider = ({
6752
6599
  width = 1,
6753
6600
  height = 100,
@@ -6755,7 +6602,7 @@ var VerticalDivider = ({
6755
6602
  dashGap = 4,
6756
6603
  dashLength = 4
6757
6604
  }) => {
6758
- return /* @__PURE__ */ jsx33("div", { style: { width: width + "px", height: height + "px" }, children: /* @__PURE__ */ jsxs23(
6605
+ return /* @__PURE__ */ jsx31("div", { style: { width: width + "px", height: height + "px" }, children: /* @__PURE__ */ jsxs21(
6759
6606
  "svg",
6760
6607
  {
6761
6608
  width,
@@ -6764,7 +6611,7 @@ var VerticalDivider = ({
6764
6611
  fill: "none",
6765
6612
  xmlns: "http://www.w3.org/2000/svg",
6766
6613
  children: [
6767
- /* @__PURE__ */ jsx33(
6614
+ /* @__PURE__ */ jsx31(
6768
6615
  "line",
6769
6616
  {
6770
6617
  opacity: "0.5",
@@ -6778,7 +6625,7 @@ var VerticalDivider = ({
6778
6625
  strokeLinecap: "round"
6779
6626
  }
6780
6627
  ),
6781
- /* @__PURE__ */ jsx33("defs", { children: /* @__PURE__ */ jsxs23(
6628
+ /* @__PURE__ */ jsx31("defs", { children: /* @__PURE__ */ jsxs21(
6782
6629
  "linearGradient",
6783
6630
  {
6784
6631
  id: "paint_linear",
@@ -6788,9 +6635,9 @@ var VerticalDivider = ({
6788
6635
  y2: height,
6789
6636
  gradientUnits: "userSpaceOnUse",
6790
6637
  children: [
6791
- /* @__PURE__ */ jsx33("stop", { stopOpacity: "0", stopColor: "currentColor" }),
6792
- /* @__PURE__ */ jsx33("stop", { offset: "0.5", stopColor: "currentColor" }),
6793
- /* @__PURE__ */ jsx33("stop", { offset: "1", stopColor: "currentColor", stopOpacity: "0" })
6638
+ /* @__PURE__ */ jsx31("stop", { stopOpacity: "0", stopColor: "currentColor" }),
6639
+ /* @__PURE__ */ jsx31("stop", { offset: "0.5", stopColor: "currentColor" }),
6640
+ /* @__PURE__ */ jsx31("stop", { offset: "1", stopColor: "currentColor", stopOpacity: "0" })
6794
6641
  ]
6795
6642
  }
6796
6643
  ) })
@@ -6801,8 +6648,8 @@ var VerticalDivider = ({
6801
6648
 
6802
6649
  // src/components/loading-states/ErrorComponent.tsx
6803
6650
  import { AlertOctagon } from "lucide-react";
6804
- import clsx29 from "clsx";
6805
- import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
6651
+ import clsx27 from "clsx";
6652
+ import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
6806
6653
  var defaultErrorComponentTranslation = {
6807
6654
  en: {
6808
6655
  errorOccurred: "An error occurred"
@@ -6817,32 +6664,32 @@ var ErrorComponent = ({
6817
6664
  classname
6818
6665
  }) => {
6819
6666
  const translation = useTranslation([defaultErrorComponentTranslation], overwriteTranslation);
6820
- return /* @__PURE__ */ jsxs24("div", { className: clsx29("col items-center justify-center gap-y-4 w-full h-24", classname), children: [
6821
- /* @__PURE__ */ jsx34(AlertOctagon, { size: 64, className: "text-warning" }),
6667
+ return /* @__PURE__ */ jsxs22("div", { className: clsx27("col items-center justify-center gap-y-4 w-full h-24", classname), children: [
6668
+ /* @__PURE__ */ jsx32(AlertOctagon, { size: 64, className: "text-warning" }),
6822
6669
  errorText ?? `${translation("errorOccurred")} :(`
6823
6670
  ] });
6824
6671
  };
6825
6672
 
6826
6673
  // src/components/loading-states/LoadingAndErrorComponent.tsx
6827
- import { useState as useState18 } from "react";
6674
+ import { useState as useState17 } from "react";
6828
6675
 
6829
6676
  // src/components/loading-states/LoadingAnimation.tsx
6830
- import clsx30 from "clsx";
6831
- import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
6677
+ import clsx28 from "clsx";
6678
+ import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
6832
6679
  var LoadingAnimation = ({
6833
6680
  overwriteTranslation,
6834
6681
  loadingText,
6835
6682
  classname
6836
6683
  }) => {
6837
6684
  const translation = useTranslation([formTranslation], overwriteTranslation);
6838
- return /* @__PURE__ */ jsxs25("div", { className: clsx30("col items-center justify-center w-full h-24", classname), children: [
6839
- /* @__PURE__ */ jsx35(Helpwave, { animate: "loading" }),
6685
+ return /* @__PURE__ */ jsxs23("div", { className: clsx28("col items-center justify-center w-full h-24", classname), children: [
6686
+ /* @__PURE__ */ jsx33(Helpwave, { animate: "loading" }),
6840
6687
  loadingText ?? `${translation("loading")}...`
6841
6688
  ] });
6842
6689
  };
6843
6690
 
6844
6691
  // src/components/loading-states/LoadingAndErrorComponent.tsx
6845
- import { jsx as jsx36 } from "react/jsx-runtime";
6692
+ import { jsx as jsx34 } from "react/jsx-runtime";
6846
6693
  var LoadingAndErrorComponent = ({
6847
6694
  children,
6848
6695
  isLoading = false,
@@ -6851,8 +6698,8 @@ var LoadingAndErrorComponent = ({
6851
6698
  loadingProps,
6852
6699
  minimumLoadingDuration
6853
6700
  }) => {
6854
- const [isInMinimumLoading, setIsInMinimumLoading] = useState18(false);
6855
- const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = useState18(false);
6701
+ const [isInMinimumLoading, setIsInMinimumLoading] = useState17(false);
6702
+ const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = useState17(false);
6856
6703
  if (minimumLoadingDuration && !isInMinimumLoading && !hasUsedMinimumLoading) {
6857
6704
  setIsInMinimumLoading(true);
6858
6705
  setTimeout(() => {
@@ -6861,27 +6708,27 @@ var LoadingAndErrorComponent = ({
6861
6708
  }, minimumLoadingDuration);
6862
6709
  }
6863
6710
  if (isLoading || minimumLoadingDuration && isInMinimumLoading) {
6864
- return /* @__PURE__ */ jsx36(LoadingAnimation, { ...loadingProps });
6711
+ return /* @__PURE__ */ jsx34(LoadingAnimation, { ...loadingProps });
6865
6712
  }
6866
6713
  if (hasError) {
6867
- return /* @__PURE__ */ jsx36(ErrorComponent, { ...errorProps });
6714
+ return /* @__PURE__ */ jsx34(ErrorComponent, { ...errorProps });
6868
6715
  }
6869
6716
  return children;
6870
6717
  };
6871
6718
 
6872
6719
  // src/components/loading-states/LoadingButton.tsx
6873
- import clsx31 from "clsx";
6874
- import { jsx as jsx37, jsxs as jsxs26 } from "react/jsx-runtime";
6720
+ import clsx29 from "clsx";
6721
+ import { jsx as jsx35, jsxs as jsxs24 } from "react/jsx-runtime";
6875
6722
  var LoadingButton = ({ isLoading = false, size = "medium", onClick, ...rest }) => {
6876
6723
  const paddingClass = ButtonUtil.paddingMapping[size];
6877
- return /* @__PURE__ */ jsxs26("div", { className: "inline-block relative", children: [
6878
- isLoading && /* @__PURE__ */ jsx37("div", { className: clsx31("absolute inset-0 row items-center justify-center bg-white/40", paddingClass), children: /* @__PURE__ */ jsx37(Helpwave, { animate: "loading", className: "text-white" }) }),
6879
- /* @__PURE__ */ jsx37(SolidButton, { ...rest, disabled: rest.disabled, onClick: isLoading ? noop : onClick })
6724
+ return /* @__PURE__ */ jsxs24("div", { className: "inline-block relative", children: [
6725
+ isLoading && /* @__PURE__ */ jsx35("div", { className: clsx29("absolute inset-0 row items-center justify-center bg-white/40", paddingClass), children: /* @__PURE__ */ jsx35(Helpwave, { animate: "loading", className: "text-white" }) }),
6726
+ /* @__PURE__ */ jsx35(SolidButton, { ...rest, disabled: rest.disabled, onClick: isLoading ? noop : onClick })
6880
6727
  ] });
6881
6728
  };
6882
6729
 
6883
6730
  // src/components/loading-states/ProgressIndicator.tsx
6884
- import { jsx as jsx38, jsxs as jsxs27 } from "react/jsx-runtime";
6731
+ import { jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
6885
6732
  var sizeMapping = { small: 16, medium: 24, big: 48 };
6886
6733
  var ProgressIndicator = ({
6887
6734
  progress,
@@ -6898,7 +6745,7 @@ var ProgressIndicator = ({
6898
6745
  if (direction === "clockwise") {
6899
6746
  rotation += 360 * progress;
6900
6747
  }
6901
- return /* @__PURE__ */ jsxs27(
6748
+ return /* @__PURE__ */ jsxs25(
6902
6749
  "svg",
6903
6750
  {
6904
6751
  style: {
@@ -6907,7 +6754,7 @@ var ProgressIndicator = ({
6907
6754
  transform: `rotate(${rotation}deg)`
6908
6755
  },
6909
6756
  children: [
6910
- /* @__PURE__ */ jsx38(
6757
+ /* @__PURE__ */ jsx36(
6911
6758
  "circle",
6912
6759
  {
6913
6760
  cx: center,
@@ -6918,7 +6765,7 @@ var ProgressIndicator = ({
6918
6765
  className: "stroke-progress-indicator-fill"
6919
6766
  }
6920
6767
  ),
6921
- /* @__PURE__ */ jsx38(
6768
+ /* @__PURE__ */ jsx36(
6922
6769
  "circle",
6923
6770
  {
6924
6771
  cx: center,
@@ -6937,8 +6784,8 @@ var ProgressIndicator = ({
6937
6784
  };
6938
6785
 
6939
6786
  // src/components/modals/ConfirmModal.tsx
6940
- import clsx32 from "clsx";
6941
- import { jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
6787
+ import clsx30 from "clsx";
6788
+ import { jsx as jsx37, jsxs as jsxs26 } from "react/jsx-runtime";
6942
6789
  var ConfirmModal = ({
6943
6790
  overwriteTranslation,
6944
6791
  children,
@@ -6957,10 +6804,10 @@ var ConfirmModal = ({
6957
6804
  positive: "positive",
6958
6805
  primary: "primary"
6959
6806
  };
6960
- return /* @__PURE__ */ jsxs28(Modal, { ...restProps, onClose: onCancel, className: clsx32("justify-between", className), children: [
6961
- /* @__PURE__ */ jsx39("div", { className: "col grow", children }),
6962
- /* @__PURE__ */ jsxs28("div", { className: "row mt-3 gap-x-4 justify-end", children: [
6963
- onCancel && /* @__PURE__ */ jsx39(
6807
+ return /* @__PURE__ */ jsxs26(Modal, { ...restProps, onClose: onCancel, className: clsx30("justify-between", className), children: [
6808
+ /* @__PURE__ */ jsx37("div", { className: "col grow", children }),
6809
+ /* @__PURE__ */ jsxs26("div", { className: "row mt-3 gap-x-4 justify-end", children: [
6810
+ onCancel && /* @__PURE__ */ jsx37(
6964
6811
  SolidButton,
6965
6812
  {
6966
6813
  color: buttonOverwrites?.[0].color ?? "neutral",
@@ -6969,7 +6816,7 @@ var ConfirmModal = ({
6969
6816
  children: buttonOverwrites?.[0].text ?? translation("cancel")
6970
6817
  }
6971
6818
  ),
6972
- onDecline && /* @__PURE__ */ jsx39(
6819
+ onDecline && /* @__PURE__ */ jsx37(
6973
6820
  SolidButton,
6974
6821
  {
6975
6822
  color: buttonOverwrites?.[1].color ?? "negative",
@@ -6978,7 +6825,7 @@ var ConfirmModal = ({
6978
6825
  children: buttonOverwrites?.[1].text ?? translation("decline")
6979
6826
  }
6980
6827
  ),
6981
- /* @__PURE__ */ jsx39(
6828
+ /* @__PURE__ */ jsx37(
6982
6829
  SolidButton,
6983
6830
  {
6984
6831
  autoFocus: true,
@@ -6993,7 +6840,7 @@ var ConfirmModal = ({
6993
6840
  };
6994
6841
 
6995
6842
  // src/components/modals/DiscardChangesModal.tsx
6996
- import { jsx as jsx40 } from "react/jsx-runtime";
6843
+ import { jsx as jsx38 } from "react/jsx-runtime";
6997
6844
  var DiscardChangesModal = ({
6998
6845
  overwriteTranslation,
6999
6846
  children,
@@ -7004,7 +6851,7 @@ var DiscardChangesModal = ({
7004
6851
  ...modalProps
7005
6852
  }) => {
7006
6853
  const translation = useTranslation([formTranslation], overwriteTranslation);
7007
- return /* @__PURE__ */ jsx40(
6854
+ return /* @__PURE__ */ jsx38(
7008
6855
  ConfirmModal,
7009
6856
  {
7010
6857
  headerProps: {
@@ -7023,31 +6870,31 @@ var DiscardChangesModal = ({
7023
6870
  };
7024
6871
 
7025
6872
  // src/components/modals/InputModal.tsx
7026
- import { jsx as jsx41 } from "react/jsx-runtime";
6873
+ import { jsx as jsx39 } from "react/jsx-runtime";
7027
6874
  var InputModal = ({
7028
6875
  inputs,
7029
6876
  buttonOverwrites,
7030
6877
  ...restProps
7031
6878
  }) => {
7032
- return /* @__PURE__ */ jsx41(
6879
+ return /* @__PURE__ */ jsx39(
7033
6880
  ConfirmModal,
7034
6881
  {
7035
6882
  buttonOverwrites,
7036
6883
  ...restProps,
7037
- children: inputs.map((inputProps, index) => /* @__PURE__ */ jsx41(Input, { ...inputProps }, `input ${index}`))
6884
+ children: inputs.map((inputProps, index) => /* @__PURE__ */ jsx39(Input, { ...inputProps }, `input ${index}`))
7038
6885
  }
7039
6886
  );
7040
6887
  };
7041
6888
 
7042
6889
  // src/components/user-action/Select.tsx
7043
- import { ChevronDown as ChevronDown5, ChevronUp as ChevronUp4 } from "lucide-react";
7044
- import { useEffect as useEffect18, useRef as useRef7, useState as useState19 } from "react";
7045
- import clsx33 from "clsx";
6890
+ import { ChevronDown as ChevronDown4, ChevronUp as ChevronUp3 } from "lucide-react";
6891
+ import { useEffect as useEffect19, useRef as useRef6, useState as useState18 } from "react";
6892
+ import clsx31 from "clsx";
7046
6893
 
7047
6894
  // src/hooks/useOutsideClick.ts
7048
- import { useEffect as useEffect17 } from "react";
6895
+ import { useEffect as useEffect18 } from "react";
7049
6896
  var useOutsideClick = (refs, handler) => {
7050
- useEffect17(() => {
6897
+ useEffect18(() => {
7051
6898
  const listener = (event) => {
7052
6899
  if (event.target === null) return;
7053
6900
  if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
@@ -7065,7 +6912,7 @@ var useOutsideClick = (refs, handler) => {
7065
6912
  };
7066
6913
 
7067
6914
  // src/components/user-action/Select.tsx
7068
- import { jsx as jsx42, jsxs as jsxs29 } from "react/jsx-runtime";
6915
+ import { jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
7069
6916
  var Select = ({
7070
6917
  value,
7071
6918
  label,
@@ -7077,23 +6924,23 @@ var Select = ({
7077
6924
  className,
7078
6925
  selectedDisplayOverwrite
7079
6926
  }) => {
7080
- const triggerRef = useRef7(null);
7081
- const menuRef = useRef7(null);
7082
- const [isOpen, setIsOpen] = useState19(false);
6927
+ const triggerRef = useRef6(null);
6928
+ const menuRef = useRef6(null);
6929
+ const [isOpen, setIsOpen] = useState18(false);
7083
6930
  useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
7084
6931
  const selectedOption = options.find((option) => option.value === value);
7085
6932
  if (value !== void 0 && selectedOption === void 0 && selectedDisplayOverwrite === void 0) {
7086
6933
  console.warn("The selected value is not found in the options list. This might be an error on your part or default behavior if it is complex data type on which === does not work. In case of the latter use selectedDisplayOverwrite to set your selected text or component");
7087
6934
  }
7088
6935
  const isShowingHint = !selectedDisplayOverwrite && !selectedOption?.label;
7089
- return /* @__PURE__ */ jsxs29("div", { className: clsx33(className), children: [
7090
- label && /* @__PURE__ */ jsx42(Label, { ...label, labelType: label.labelType ?? "labelBig", className: clsx33("mb-1", label.className) }),
7091
- /* @__PURE__ */ jsxs29("div", { className: "relative", children: [
7092
- /* @__PURE__ */ jsxs29(
6936
+ return /* @__PURE__ */ jsxs27("div", { className: clsx31(className), children: [
6937
+ label && /* @__PURE__ */ jsx40(Label, { ...label, labelType: label.labelType ?? "labelBig", className: clsx31("mb-1", label.className) }),
6938
+ /* @__PURE__ */ jsxs27("div", { className: "relative", children: [
6939
+ /* @__PURE__ */ jsxs27(
7093
6940
  "button",
7094
6941
  {
7095
6942
  ref: triggerRef,
7096
- className: clsx33(
6943
+ className: clsx31(
7097
6944
  "btn-md justify-between w-full border-2",
7098
6945
  {
7099
6946
  "rounded-b-lg": !open,
@@ -7104,24 +6951,24 @@ var Select = ({
7104
6951
  onClick: () => setIsOpen(!isOpen),
7105
6952
  disabled: isDisabled,
7106
6953
  children: [
7107
- !isShowingHint && /* @__PURE__ */ jsx42("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? selectedOption?.label }),
7108
- isShowingHint && /* @__PURE__ */ jsx42("span", { className: "textstyle-description", children: hintText }),
7109
- isOpen ? /* @__PURE__ */ jsx42(ChevronUp4, {}) : /* @__PURE__ */ jsx42(ChevronDown5, {})
6954
+ !isShowingHint && /* @__PURE__ */ jsx40("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? selectedOption?.label }),
6955
+ isShowingHint && /* @__PURE__ */ jsx40("span", { className: "textstyle-description", children: hintText }),
6956
+ isOpen ? /* @__PURE__ */ jsx40(ChevronUp3, {}) : /* @__PURE__ */ jsx40(ChevronDown4, {})
7110
6957
  ]
7111
6958
  }
7112
6959
  ),
7113
- isOpen && /* @__PURE__ */ jsx42(
6960
+ isOpen && /* @__PURE__ */ jsx40(
7114
6961
  "div",
7115
6962
  {
7116
6963
  ref: menuRef,
7117
6964
  className: "absolute w-full z-10 rounded-lg mt-0.5 bg-menu-background text-menu-text shadow-around-lg max-h-[500px] overflow-y-auto p-2",
7118
- children: /* @__PURE__ */ jsx42(
6965
+ children: /* @__PURE__ */ jsx40(
7119
6966
  SearchableList,
7120
6967
  {
7121
6968
  list: options,
7122
6969
  minimumItemsForSearch: isSearchEnabled ? void 0 : options.length,
7123
6970
  searchMapping: (item) => item.searchTags,
7124
- itemMapper: (option, index) => /* @__PURE__ */ jsx42(
6971
+ itemMapper: (option, index) => /* @__PURE__ */ jsx40(
7125
6972
  Tile,
7126
6973
  {
7127
6974
  isSelected: selectedOption?.value === option.value,
@@ -7150,13 +6997,13 @@ var SelectUncontrolled = ({
7150
6997
  hintText,
7151
6998
  ...props
7152
6999
  }) => {
7153
- const [selected, setSelected] = useState19(value);
7154
- useEffect18(() => {
7000
+ const [selected, setSelected] = useState18(value);
7001
+ useEffect19(() => {
7155
7002
  if (options.find((options2) => options2.value === value)) {
7156
7003
  setSelected(value);
7157
7004
  }
7158
7005
  }, [options, value]);
7159
- return /* @__PURE__ */ jsx42(
7006
+ return /* @__PURE__ */ jsx40(
7160
7007
  Select,
7161
7008
  {
7162
7009
  value: selected,
@@ -7172,7 +7019,7 @@ var SelectUncontrolled = ({
7172
7019
  };
7173
7020
 
7174
7021
  // src/components/modals/LanguageModal.tsx
7175
- import { jsx as jsx43, jsxs as jsxs30 } from "react/jsx-runtime";
7022
+ import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
7176
7023
  var defaultLanguageModalTranslation = {
7177
7024
  en: {
7178
7025
  language: "Language",
@@ -7195,7 +7042,7 @@ var LanguageModal = ({
7195
7042
  }) => {
7196
7043
  const { language, setLanguage } = useLanguage();
7197
7044
  const translation = useTranslation([defaultLanguageModalTranslation], overwriteTranslation);
7198
- return /* @__PURE__ */ jsx43(
7045
+ return /* @__PURE__ */ jsx41(
7199
7046
  Modal,
7200
7047
  {
7201
7048
  headerProps: {
@@ -7205,8 +7052,8 @@ var LanguageModal = ({
7205
7052
  },
7206
7053
  onClose,
7207
7054
  ...modalProps,
7208
- children: /* @__PURE__ */ jsxs30("div", { className: "w-64", children: [
7209
- /* @__PURE__ */ jsx43(
7055
+ children: /* @__PURE__ */ jsxs28("div", { className: "w-64", children: [
7056
+ /* @__PURE__ */ jsx41(
7210
7057
  Select,
7211
7058
  {
7212
7059
  className: "mt-2",
@@ -7215,15 +7062,15 @@ var LanguageModal = ({
7215
7062
  onChange: (language2) => setLanguage(language2)
7216
7063
  }
7217
7064
  ),
7218
- /* @__PURE__ */ jsx43("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ jsx43(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
7065
+ /* @__PURE__ */ jsx41("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ jsx41(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
7219
7066
  ] })
7220
7067
  }
7221
7068
  );
7222
7069
  };
7223
7070
 
7224
7071
  // src/theming/useTheme.tsx
7225
- import { createContext as createContext2, useContext as useContext2, useEffect as useEffect19, useState as useState20 } from "react";
7226
- import { jsx as jsx44 } from "react/jsx-runtime";
7072
+ import { createContext as createContext2, useContext as useContext2, useEffect as useEffect20, useState as useState19 } from "react";
7073
+ import { jsx as jsx42 } from "react/jsx-runtime";
7227
7074
  var themes = ["light", "dark"];
7228
7075
  var defaultThemeTypeTranslation = {
7229
7076
  en: {
@@ -7252,22 +7099,22 @@ var ThemeContext = createContext2({
7252
7099
  setTheme: noop
7253
7100
  });
7254
7101
  var ThemeProvider = ({ children, initialTheme = "light" }) => {
7255
- const [theme, setTheme] = useState20(initialTheme);
7256
- useEffect19(() => {
7102
+ const [theme, setTheme] = useState19(initialTheme);
7103
+ useEffect20(() => {
7257
7104
  if (theme !== initialTheme) {
7258
7105
  console.warn("ThemeProvider initial state changed: Prefer using useTheme's setTheme instead");
7259
7106
  setTheme(initialTheme);
7260
7107
  }
7261
7108
  }, [initialTheme]);
7262
- useEffect19(() => {
7109
+ useEffect20(() => {
7263
7110
  document.documentElement.setAttribute("data-theme", theme);
7264
7111
  }, [theme]);
7265
- return /* @__PURE__ */ jsx44(ThemeContext.Provider, { value: { theme, setTheme }, children });
7112
+ return /* @__PURE__ */ jsx42(ThemeContext.Provider, { value: { theme, setTheme }, children });
7266
7113
  };
7267
7114
  var useTheme = () => useContext2(ThemeContext);
7268
7115
 
7269
7116
  // src/components/modals/ThemeModal.tsx
7270
- import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
7117
+ import { jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
7271
7118
  var defaultConfirmDialogTranslation = {
7272
7119
  en: {
7273
7120
  chooseTheme: "Choose your preferred theme"
@@ -7284,7 +7131,7 @@ var ThemeModal = ({
7284
7131
  }) => {
7285
7132
  const { theme, setTheme } = useTheme();
7286
7133
  const translation = useTranslation([defaultConfirmDialogTranslation, formTranslation, ThemeUtil.translation], overwriteTranslation);
7287
- return /* @__PURE__ */ jsx45(
7134
+ return /* @__PURE__ */ jsx43(
7288
7135
  Modal,
7289
7136
  {
7290
7137
  headerProps: {
@@ -7294,8 +7141,8 @@ var ThemeModal = ({
7294
7141
  },
7295
7142
  onClose,
7296
7143
  ...modalProps,
7297
- children: /* @__PURE__ */ jsxs31("div", { className: "w-64", children: [
7298
- /* @__PURE__ */ jsx45(
7144
+ children: /* @__PURE__ */ jsxs29("div", { className: "w-64", children: [
7145
+ /* @__PURE__ */ jsx43(
7299
7146
  Select,
7300
7147
  {
7301
7148
  className: "mt-2",
@@ -7304,7 +7151,7 @@ var ThemeModal = ({
7304
7151
  onChange: (theme2) => setTheme(theme2)
7305
7152
  }
7306
7153
  ),
7307
- /* @__PURE__ */ jsx45("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ jsx45(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
7154
+ /* @__PURE__ */ jsx43("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ jsx43(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
7308
7155
  ] })
7309
7156
  }
7310
7157
  );
@@ -7313,10 +7160,109 @@ var ThemeModal = ({
7313
7160
  // src/components/properties/CheckboxProperty.tsx
7314
7161
  import { Check as Check4 } from "lucide-react";
7315
7162
 
7163
+ // src/components/user-action/Checkbox.tsx
7164
+ import { useState as useState20 } from "react";
7165
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
7166
+ import { Check as Check3, Minus } from "lucide-react";
7167
+ import clsx32 from "clsx";
7168
+ import { jsx as jsx44, jsxs as jsxs30 } from "react/jsx-runtime";
7169
+ var checkboxSizeMapping = {
7170
+ small: "size-4",
7171
+ medium: "size-6",
7172
+ large: "size-8"
7173
+ };
7174
+ var checkboxIconSizeMapping = {
7175
+ small: "size-3",
7176
+ medium: "size-5",
7177
+ large: "size-7"
7178
+ };
7179
+ var Checkbox = ({
7180
+ id,
7181
+ label,
7182
+ checked,
7183
+ disabled,
7184
+ onChange,
7185
+ onChangeTristate,
7186
+ size = "medium",
7187
+ className = "",
7188
+ containerClassName
7189
+ }) => {
7190
+ const usedSizeClass = checkboxSizeMapping[size];
7191
+ const innerIconSize = checkboxIconSizeMapping[size];
7192
+ const propagateChange = (checked2) => {
7193
+ if (onChangeTristate) {
7194
+ onChangeTristate(checked2);
7195
+ }
7196
+ if (onChange) {
7197
+ onChange(checked2 === "indeterminate" ? false : checked2);
7198
+ }
7199
+ };
7200
+ const changeValue = () => {
7201
+ const newValue = checked === "indeterminate" ? false : !checked;
7202
+ propagateChange(newValue);
7203
+ };
7204
+ return /* @__PURE__ */ jsxs30("div", { className: clsx32("row justify-center items-center", containerClassName), children: [
7205
+ /* @__PURE__ */ jsx44(
7206
+ CheckboxPrimitive.Root,
7207
+ {
7208
+ onCheckedChange: propagateChange,
7209
+ checked,
7210
+ disabled,
7211
+ id,
7212
+ className: clsx32(usedSizeClass, `items-center border-2 rounded outline-none `, {
7213
+ "text-disabled-text border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
7214
+ "focus:border-primary": !disabled,
7215
+ "bg-surface": !disabled && !checked,
7216
+ "bg-primary/30 border-primary text-primary": !disabled && checked === true || checked === "indeterminate",
7217
+ "hover:border-primary focus:hover:border-primary": !disabled && !checked
7218
+ }, className),
7219
+ children: /* @__PURE__ */ jsxs30(CheckboxPrimitive.Indicator, { children: [
7220
+ checked === true && /* @__PURE__ */ jsx44(Check3, { className: innerIconSize }),
7221
+ checked === "indeterminate" && /* @__PURE__ */ jsx44(Minus, { className: innerIconSize })
7222
+ ] })
7223
+ }
7224
+ ),
7225
+ label && /* @__PURE__ */ jsx44(
7226
+ Label,
7227
+ {
7228
+ ...label,
7229
+ className: clsx32("cursor-pointer", label.className),
7230
+ htmlFor: id,
7231
+ onClick: changeValue
7232
+ }
7233
+ )
7234
+ ] });
7235
+ };
7236
+ var CheckboxUncontrolled = ({
7237
+ onChange,
7238
+ onChangeTristate,
7239
+ defaultValue = false,
7240
+ ...props
7241
+ }) => {
7242
+ const [checked, setChecked] = useState20(defaultValue);
7243
+ const handleChange = (checked2) => {
7244
+ if (onChangeTristate) {
7245
+ onChangeTristate(checked2);
7246
+ }
7247
+ if (onChange) {
7248
+ onChange(checked2 === "indeterminate" ? false : checked2);
7249
+ }
7250
+ setChecked(checked2);
7251
+ };
7252
+ return /* @__PURE__ */ jsx44(
7253
+ Checkbox,
7254
+ {
7255
+ ...props,
7256
+ checked,
7257
+ onChangeTristate: handleChange
7258
+ }
7259
+ );
7260
+ };
7261
+
7316
7262
  // src/components/properties/PropertyBase.tsx
7317
7263
  import { AlertTriangle } from "lucide-react";
7318
- import clsx34 from "clsx";
7319
- import { jsx as jsx46, jsxs as jsxs32 } from "react/jsx-runtime";
7264
+ import clsx33 from "clsx";
7265
+ import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
7320
7266
  var PropertyBase = ({
7321
7267
  overwriteTranslation,
7322
7268
  name,
@@ -7330,11 +7276,11 @@ var PropertyBase = ({
7330
7276
  }) => {
7331
7277
  const translation = useTranslation([formTranslation], overwriteTranslation);
7332
7278
  const requiredAndNoValue = softRequired && !hasValue;
7333
- return /* @__PURE__ */ jsxs32("div", { className: clsx34("row gap-x-0 group", className), children: [
7334
- /* @__PURE__ */ jsxs32(
7279
+ return /* @__PURE__ */ jsxs31("div", { className: clsx33("row gap-x-0 group", className), children: [
7280
+ /* @__PURE__ */ jsxs31(
7335
7281
  "div",
7336
7282
  {
7337
- className: clsx34("row gap-x-2 !w-[200px] px-4 py-2 items-center rounded-l-xl border-2 border-r-0", {
7283
+ className: clsx33("row gap-x-2 !w-[200px] px-4 py-2 items-center rounded-l-xl border-2 border-r-0", {
7338
7284
  "bg-property-title-background property-title-text group-hover:border-primary": !requiredAndNoValue,
7339
7285
  "bg-warning text-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
7340
7286
  }, className),
@@ -7344,22 +7290,22 @@ var PropertyBase = ({
7344
7290
  ]
7345
7291
  }
7346
7292
  ),
7347
- /* @__PURE__ */ jsxs32(
7293
+ /* @__PURE__ */ jsxs31(
7348
7294
  "div",
7349
7295
  {
7350
- className: clsx34("row gap-x-0 grow justify-between items-center rounded-r-xl border-2 border-l-0", {
7296
+ className: clsx33("row gap-x-0 grow justify-between items-center rounded-r-xl border-2 border-l-0", {
7351
7297
  "bg-surface group-hover:border-primary": !requiredAndNoValue,
7352
7298
  "bg-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
7353
7299
  }, className),
7354
7300
  children: [
7355
7301
  input({ softRequired, hasValue }),
7356
- requiredAndNoValue && /* @__PURE__ */ jsx46("div", { className: "text-warning pr-4", children: /* @__PURE__ */ jsx46(AlertTriangle, { size: 24 }) }),
7357
- onRemove && /* @__PURE__ */ jsx46(
7302
+ requiredAndNoValue && /* @__PURE__ */ jsx45("div", { className: "text-warning pr-4", children: /* @__PURE__ */ jsx45(AlertTriangle, { size: 24 }) }),
7303
+ onRemove && /* @__PURE__ */ jsx45(
7358
7304
  TextButton,
7359
7305
  {
7360
7306
  onClick: onRemove,
7361
7307
  color: "negative",
7362
- className: clsx34("pr-4 items-center", { "!text-transparent": !hasValue || readOnly }),
7308
+ className: clsx33("pr-4 items-center", { "!text-transparent": !hasValue || readOnly }),
7363
7309
  disabled: !hasValue || readOnly,
7364
7310
  children: translation("remove")
7365
7311
  }
@@ -7371,7 +7317,7 @@ var PropertyBase = ({
7371
7317
  };
7372
7318
 
7373
7319
  // src/components/properties/CheckboxProperty.tsx
7374
- import { jsx as jsx47 } from "react/jsx-runtime";
7320
+ import { jsx as jsx46 } from "react/jsx-runtime";
7375
7321
  var CheckboxProperty = ({
7376
7322
  overwriteTranslation,
7377
7323
  value,
@@ -7380,14 +7326,14 @@ var CheckboxProperty = ({
7380
7326
  ...baseProps
7381
7327
  }) => {
7382
7328
  const translation = useTranslation([formTranslation], overwriteTranslation);
7383
- return /* @__PURE__ */ jsx47(
7329
+ return /* @__PURE__ */ jsx46(
7384
7330
  PropertyBase,
7385
7331
  {
7386
7332
  ...baseProps,
7387
7333
  hasValue: true,
7388
7334
  readOnly,
7389
- icon: /* @__PURE__ */ jsx47(Check4, { size: 16 }),
7390
- input: () => /* @__PURE__ */ jsx47("div", { className: "row py-2 px-4 items-center", children: /* @__PURE__ */ jsx47(
7335
+ icon: /* @__PURE__ */ jsx46(Check4, { size: 16 }),
7336
+ input: () => /* @__PURE__ */ jsx46("div", { className: "row py-2 px-4 items-center", children: /* @__PURE__ */ jsx46(
7391
7337
  Checkbox,
7392
7338
  {
7393
7339
  checked: value ?? true,
@@ -7402,8 +7348,8 @@ var CheckboxProperty = ({
7402
7348
 
7403
7349
  // src/components/properties/DateProperty.tsx
7404
7350
  import { CalendarDays } from "lucide-react";
7405
- import clsx35 from "clsx";
7406
- import { jsx as jsx48 } from "react/jsx-runtime";
7351
+ import clsx34 from "clsx";
7352
+ import { jsx as jsx47 } from "react/jsx-runtime";
7407
7353
  var DateProperty = ({
7408
7354
  value,
7409
7355
  onChange = noop,
@@ -7414,20 +7360,20 @@ var DateProperty = ({
7414
7360
  }) => {
7415
7361
  const hasValue = !!value;
7416
7362
  const dateText = value ? type === "dateTime" ? formatDateTime(value) : formatDate(value) : "";
7417
- return /* @__PURE__ */ jsx48(
7363
+ return /* @__PURE__ */ jsx47(
7418
7364
  PropertyBase,
7419
7365
  {
7420
7366
  ...baseProps,
7421
7367
  hasValue,
7422
- icon: /* @__PURE__ */ jsx48(CalendarDays, { size: 16 }),
7423
- input: ({ softRequired }) => /* @__PURE__ */ jsx48(
7368
+ icon: /* @__PURE__ */ jsx47(CalendarDays, { size: 16 }),
7369
+ input: ({ softRequired }) => /* @__PURE__ */ jsx47(
7424
7370
  "div",
7425
7371
  {
7426
- className: clsx35("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
7427
- children: /* @__PURE__ */ jsx48(
7372
+ className: clsx34("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
7373
+ children: /* @__PURE__ */ jsx47(
7428
7374
  Input,
7429
7375
  {
7430
- className: clsx35("!ring-0 !border-0 !outline-0 !p-0 !m-0 !shadow-none !w-fit !rounded-none", { "bg-surface-warning": softRequired && !hasValue }),
7376
+ className: clsx34("!ring-0 !border-0 !outline-0 !p-0 !m-0 !shadow-none !w-fit !rounded-none", { "bg-surface-warning": softRequired && !hasValue }),
7431
7377
  value: dateText,
7432
7378
  type: type === "dateTime" ? "datetime-local" : "date",
7433
7379
  readOnly,
@@ -7451,13 +7397,13 @@ var DateProperty = ({
7451
7397
 
7452
7398
  // src/components/properties/MultiSelectProperty.tsx
7453
7399
  import { List } from "lucide-react";
7454
- import clsx37 from "clsx";
7400
+ import clsx36 from "clsx";
7455
7401
 
7456
7402
  // src/components/user-action/MultiSelect.tsx
7457
- import { useEffect as useEffect20, useRef as useRef8, useState as useState21 } from "react";
7458
- import { ChevronDown as ChevronDown6, ChevronUp as ChevronUp5 } from "lucide-react";
7459
- import clsx36 from "clsx";
7460
- import { jsx as jsx49, jsxs as jsxs33 } from "react/jsx-runtime";
7403
+ import { useEffect as useEffect21, useRef as useRef7, useState as useState21 } from "react";
7404
+ import { ChevronDown as ChevronDown5, ChevronUp as ChevronUp4 } from "lucide-react";
7405
+ import clsx35 from "clsx";
7406
+ import { jsx as jsx48, jsxs as jsxs32 } from "react/jsx-runtime";
7461
7407
  var defaultMultiSelectTranslation = {
7462
7408
  en: {
7463
7409
  selected: `{{amount}} selected`
@@ -7479,28 +7425,28 @@ var MultiSelect = ({
7479
7425
  className = ""
7480
7426
  }) => {
7481
7427
  const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
7482
- const triggerRef = useRef8(null);
7483
- const menuRef = useRef8(null);
7428
+ const triggerRef = useRef7(null);
7429
+ const menuRef = useRef7(null);
7484
7430
  const [isOpen, setIsOpen] = useState21(false);
7485
7431
  useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
7486
7432
  const selectedItems = options.filter((value) => value.selected);
7487
7433
  const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
7488
- return /* @__PURE__ */ jsxs33("div", { className: clsx36(className), children: [
7489
- label && /* @__PURE__ */ jsx49(
7434
+ return /* @__PURE__ */ jsxs32("div", { className: clsx35(className), children: [
7435
+ label && /* @__PURE__ */ jsx48(
7490
7436
  Label,
7491
7437
  {
7492
7438
  ...label,
7493
7439
  htmlFor: label.name,
7494
- className: clsx36(" mb-1", label.className),
7440
+ className: clsx35(" mb-1", label.className),
7495
7441
  labelType: label.labelType ?? "labelBig"
7496
7442
  }
7497
7443
  ),
7498
- /* @__PURE__ */ jsxs33("div", { className: "relative", children: [
7499
- /* @__PURE__ */ jsxs33(
7444
+ /* @__PURE__ */ jsxs32("div", { className: "relative", children: [
7445
+ /* @__PURE__ */ jsxs32(
7500
7446
  "button",
7501
7447
  {
7502
7448
  ref: triggerRef,
7503
- className: clsx36(
7449
+ className: clsx35(
7504
7450
  "btn-md justify-between w-full border-2 h-auto",
7505
7451
  {
7506
7452
  "rounded-b-lg": !open,
@@ -7511,25 +7457,25 @@ var MultiSelect = ({
7511
7457
  onClick: () => setIsOpen(!isOpen),
7512
7458
  disabled: isDisabled,
7513
7459
  children: [
7514
- !isShowingHint && /* @__PURE__ */ jsx49("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? (useChipDisplay && selectedItems ? /* @__PURE__ */ jsx49(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) : translation("selected", { replacements: { amount: selectedItems.length.toString() } })) }),
7515
- isShowingHint && /* @__PURE__ */ jsx49("span", { className: "textstyle-description", children: hintText ?? translation("select") }),
7516
- isOpen ? /* @__PURE__ */ jsx49(ChevronUp5, { size: 24, className: "min-w-6" }) : /* @__PURE__ */ jsx49(ChevronDown6, { className: "min-w-6" })
7460
+ !isShowingHint && /* @__PURE__ */ jsx48("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? (useChipDisplay && selectedItems ? /* @__PURE__ */ jsx48(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) : translation("selected", { replacements: { amount: selectedItems.length.toString() } })) }),
7461
+ isShowingHint && /* @__PURE__ */ jsx48("span", { className: "textstyle-description", children: hintText ?? translation("select") }),
7462
+ isOpen ? /* @__PURE__ */ jsx48(ChevronUp4, { size: 24, className: "min-w-6" }) : /* @__PURE__ */ jsx48(ChevronDown5, { className: "min-w-6" })
7517
7463
  ]
7518
7464
  }
7519
7465
  ),
7520
- isOpen && /* @__PURE__ */ jsxs33(
7466
+ isOpen && /* @__PURE__ */ jsxs32(
7521
7467
  "div",
7522
7468
  {
7523
7469
  ref: menuRef,
7524
7470
  className: "absolute w-full z-10 rounded-lg mt-0.5 bg-menu-background text-menu-text shadow-around-lg max-h-[500px] overflow-y-auto p-2",
7525
7471
  children: [
7526
- /* @__PURE__ */ jsx49(
7472
+ /* @__PURE__ */ jsx48(
7527
7473
  SearchableList,
7528
7474
  {
7529
7475
  list: options,
7530
7476
  minimumItemsForSearch: isSearchEnabled ? void 0 : options.length,
7531
7477
  searchMapping: (item) => item.searchTags,
7532
- itemMapper: (option, index) => /* @__PURE__ */ jsx49(
7478
+ itemMapper: (option, index) => /* @__PURE__ */ jsx48(
7533
7479
  Tile,
7534
7480
  {
7535
7481
  isSelected: option.selected,
@@ -7548,9 +7494,9 @@ var MultiSelect = ({
7548
7494
  )
7549
7495
  }
7550
7496
  ),
7551
- /* @__PURE__ */ jsxs33("div", { className: "row justify-between mt-2", children: [
7552
- /* @__PURE__ */ jsxs33("div", { className: "row gap-x-2", children: [
7553
- /* @__PURE__ */ jsx49(
7497
+ /* @__PURE__ */ jsxs32("div", { className: "row justify-between mt-2", children: [
7498
+ /* @__PURE__ */ jsxs32("div", { className: "row gap-x-2", children: [
7499
+ /* @__PURE__ */ jsx48(
7554
7500
  SolidButton,
7555
7501
  {
7556
7502
  color: "neutral",
@@ -7565,7 +7511,7 @@ var MultiSelect = ({
7565
7511
  children: translation("all")
7566
7512
  }
7567
7513
  ),
7568
- /* @__PURE__ */ jsx49(
7514
+ /* @__PURE__ */ jsx48(
7569
7515
  SolidButton,
7570
7516
  {
7571
7517
  color: "neutral",
@@ -7580,7 +7526,7 @@ var MultiSelect = ({
7580
7526
  }
7581
7527
  )
7582
7528
  ] }),
7583
- /* @__PURE__ */ jsx49(SolidButton, { size: "small", onClick: () => setIsOpen(false), children: "Done" })
7529
+ /* @__PURE__ */ jsx48(SolidButton, { size: "small", onClick: () => setIsOpen(false), children: "Done" })
7584
7530
  ] })
7585
7531
  ]
7586
7532
  }
@@ -7594,10 +7540,10 @@ var MultiSelectUncontrolled = ({
7594
7540
  ...props
7595
7541
  }) => {
7596
7542
  const [usedOptions, setUsedOptions] = useState21(options);
7597
- useEffect20(() => {
7543
+ useEffect21(() => {
7598
7544
  setUsedOptions(options);
7599
7545
  }, [options]);
7600
- return /* @__PURE__ */ jsx49(
7546
+ return /* @__PURE__ */ jsx48(
7601
7547
  MultiSelect,
7602
7548
  {
7603
7549
  ...props,
@@ -7611,7 +7557,7 @@ var MultiSelectUncontrolled = ({
7611
7557
  };
7612
7558
 
7613
7559
  // src/components/properties/MultiSelectProperty.tsx
7614
- import { jsx as jsx50 } from "react/jsx-runtime";
7560
+ import { jsx as jsx49 } from "react/jsx-runtime";
7615
7561
  var MultiSelectProperty = ({
7616
7562
  overwriteTranslation,
7617
7563
  options,
@@ -7623,7 +7569,7 @@ var MultiSelectProperty = ({
7623
7569
  }) => {
7624
7570
  const translation = useTranslation([formTranslation], overwriteTranslation);
7625
7571
  const hasValue = options.some((value) => value.selected);
7626
- return /* @__PURE__ */ jsx50(
7572
+ return /* @__PURE__ */ jsx49(
7627
7573
  PropertyBase,
7628
7574
  {
7629
7575
  name,
@@ -7631,16 +7577,16 @@ var MultiSelectProperty = ({
7631
7577
  readOnly,
7632
7578
  softRequired,
7633
7579
  hasValue,
7634
- icon: /* @__PURE__ */ jsx50(List, { size: 16 }),
7635
- input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ jsx50(
7580
+ icon: /* @__PURE__ */ jsx49(List, { size: 16 }),
7581
+ input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ jsx49(
7636
7582
  "div",
7637
7583
  {
7638
- className: clsx37("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired2 && !hasValue }),
7639
- children: /* @__PURE__ */ jsx50(
7584
+ className: clsx36("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired2 && !hasValue }),
7585
+ children: /* @__PURE__ */ jsx49(
7640
7586
  MultiSelect,
7641
7587
  {
7642
7588
  ...multiSelectProps,
7643
- className: clsx37("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
7589
+ className: clsx36("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
7644
7590
  options,
7645
7591
  isDisabled: readOnly,
7646
7592
  useChipDisplay: true,
@@ -7655,8 +7601,8 @@ var MultiSelectProperty = ({
7655
7601
 
7656
7602
  // src/components/properties/NumberProperty.tsx
7657
7603
  import { Binary } from "lucide-react";
7658
- import clsx38 from "clsx";
7659
- import { jsx as jsx51, jsxs as jsxs34 } from "react/jsx-runtime";
7604
+ import clsx37 from "clsx";
7605
+ import { jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
7660
7606
  var defaultNumberPropertyTranslation = {
7661
7607
  en: {
7662
7608
  value: "Value"
@@ -7677,23 +7623,23 @@ var NumberProperty = ({
7677
7623
  }) => {
7678
7624
  const translation = useTranslation([defaultNumberPropertyTranslation], overwriteTranslation);
7679
7625
  const hasValue = value !== void 0;
7680
- return /* @__PURE__ */ jsx51(
7626
+ return /* @__PURE__ */ jsx50(
7681
7627
  PropertyBase,
7682
7628
  {
7683
7629
  ...baseProps,
7684
7630
  onRemove,
7685
7631
  hasValue,
7686
- icon: /* @__PURE__ */ jsx51(Binary, { size: 16 }),
7687
- input: ({ softRequired }) => /* @__PURE__ */ jsxs34(
7632
+ icon: /* @__PURE__ */ jsx50(Binary, { size: 16 }),
7633
+ input: ({ softRequired }) => /* @__PURE__ */ jsxs33(
7688
7634
  "div",
7689
7635
  {
7690
- className: clsx38("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
7636
+ className: clsx37("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
7691
7637
  children: [
7692
- /* @__PURE__ */ jsx51(
7638
+ /* @__PURE__ */ jsx50(
7693
7639
  Input,
7694
7640
  {
7695
7641
  expanded: false,
7696
- className: clsx38("!ring-0 !border-0 !outline-0 !p-0 !m-0 !w-fit !shadow-none !rounded-none", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
7642
+ className: clsx37("!ring-0 !border-0 !outline-0 !p-0 !m-0 !w-fit !shadow-none !rounded-none", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
7697
7643
  value: value?.toString() ?? "",
7698
7644
  type: "number",
7699
7645
  readOnly,
@@ -7716,7 +7662,7 @@ var NumberProperty = ({
7716
7662
  }
7717
7663
  }
7718
7664
  ),
7719
- suffix && /* @__PURE__ */ jsx51("span", { className: clsx38("ml-1", { "bg-surface-warning": softRequired && !hasValue }), children: suffix })
7665
+ suffix && /* @__PURE__ */ jsx50("span", { className: clsx37("ml-1", { "bg-surface-warning": softRequired && !hasValue }), children: suffix })
7720
7666
  ]
7721
7667
  }
7722
7668
  )
@@ -7726,8 +7672,8 @@ var NumberProperty = ({
7726
7672
 
7727
7673
  // src/components/properties/SelectProperty.tsx
7728
7674
  import { List as List2 } from "lucide-react";
7729
- import clsx39 from "clsx";
7730
- import { jsx as jsx52 } from "react/jsx-runtime";
7675
+ import clsx38 from "clsx";
7676
+ import { jsx as jsx51 } from "react/jsx-runtime";
7731
7677
  var SingleSelectProperty = ({
7732
7678
  overwriteTranslation,
7733
7679
  value,
@@ -7740,7 +7686,7 @@ var SingleSelectProperty = ({
7740
7686
  }) => {
7741
7687
  const translation = useTranslation([formTranslation], overwriteTranslation);
7742
7688
  const hasValue = value !== void 0;
7743
- return /* @__PURE__ */ jsx52(
7689
+ return /* @__PURE__ */ jsx51(
7744
7690
  PropertyBase,
7745
7691
  {
7746
7692
  name,
@@ -7748,19 +7694,19 @@ var SingleSelectProperty = ({
7748
7694
  readOnly,
7749
7695
  softRequired,
7750
7696
  hasValue,
7751
- icon: /* @__PURE__ */ jsx52(List2, { size: 16 }),
7752
- input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ jsx52(
7697
+ icon: /* @__PURE__ */ jsx51(List2, { size: 16 }),
7698
+ input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ jsx51(
7753
7699
  "div",
7754
7700
  {
7755
- className: clsx39("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired2 && !hasValue }),
7756
- children: /* @__PURE__ */ jsx52(
7701
+ className: clsx38("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired2 && !hasValue }),
7702
+ children: /* @__PURE__ */ jsx51(
7757
7703
  Select,
7758
7704
  {
7759
7705
  ...selectProps,
7760
7706
  value,
7761
7707
  options,
7762
7708
  isDisabled: readOnly,
7763
- className: clsx39("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
7709
+ className: clsx38("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
7764
7710
  hintText: `${translation("select")}...`
7765
7711
  }
7766
7712
  )
@@ -7772,12 +7718,12 @@ var SingleSelectProperty = ({
7772
7718
 
7773
7719
  // src/components/properties/TextProperty.tsx
7774
7720
  import { Text } from "lucide-react";
7775
- import clsx41 from "clsx";
7721
+ import clsx40 from "clsx";
7776
7722
 
7777
7723
  // src/components/user-action/Textarea.tsx
7778
- import { useEffect as useEffect21, useState as useState22 } from "react";
7779
- import clsx40 from "clsx";
7780
- import { jsx as jsx53, jsxs as jsxs35 } from "react/jsx-runtime";
7724
+ import { useEffect as useEffect22, useState as useState22 } from "react";
7725
+ import clsx39 from "clsx";
7726
+ import { jsx as jsx52, jsxs as jsxs34 } from "react/jsx-runtime";
7781
7727
  var Textarea = ({
7782
7728
  label,
7783
7729
  headline,
@@ -7788,37 +7734,38 @@ var Textarea = ({
7788
7734
  disclaimer,
7789
7735
  onBlur = noop,
7790
7736
  onEditCompleted = noop,
7737
+ saveDelayOptions,
7791
7738
  defaultStyle = true,
7792
7739
  className,
7793
7740
  ...props
7794
7741
  }) => {
7795
7742
  const [hasFocus, setHasFocus] = useState22(false);
7796
- const { restartTimer, clearUpdateTimer } = useSaveDelay(() => void 0, 3e3);
7743
+ const { restartTimer, clearTimer } = useDelay(saveDelayOptions);
7797
7744
  const onEditCompletedWrapper = (text) => {
7798
7745
  onEditCompleted(text);
7799
- clearUpdateTimer();
7746
+ clearTimer();
7800
7747
  };
7801
- return /* @__PURE__ */ jsxs35("div", { className: "w-full", children: [
7802
- label && /* @__PURE__ */ jsx53(
7748
+ return /* @__PURE__ */ jsxs34("div", { className: "w-full", children: [
7749
+ label && /* @__PURE__ */ jsx52(
7803
7750
  Label,
7804
7751
  {
7805
7752
  ...label,
7806
7753
  htmlFor: id,
7807
- className: clsx40("mb-1", label.className),
7754
+ className: clsx39("mb-1", label.className),
7808
7755
  labelType: label.labelType ?? "labelSmall"
7809
7756
  }
7810
7757
  ),
7811
- /* @__PURE__ */ jsxs35(
7758
+ /* @__PURE__ */ jsxs34(
7812
7759
  "div",
7813
7760
  {
7814
- className: `${clsx40(" bg-surface text-on-surface focus-within:border-primary relative", { "shadow border-2 hover:border-primary rounded-lg": defaultStyle })}`,
7761
+ className: `${clsx39(" bg-surface text-on-surface focus-within:border-primary relative", { "shadow border-2 hover:border-primary rounded-lg": defaultStyle })}`,
7815
7762
  children: [
7816
- headline && /* @__PURE__ */ jsx53("span", { className: "mx-3 mt-3 block textstyle-label-md", children: headline }),
7817
- /* @__PURE__ */ jsx53(
7763
+ headline && /* @__PURE__ */ jsx52("span", { className: "mx-3 mt-3 block textstyle-label-md", children: headline }),
7764
+ /* @__PURE__ */ jsx52(
7818
7765
  "textarea",
7819
7766
  {
7820
7767
  id,
7821
- className: clsx40("pt-0 px-3 border-transparent focus:border-transparent focus:ring-0 appearance-none border w-full leading-tight focus:outline-none", {
7768
+ className: clsx39("pt-0 px-3 border-transparent focus:border-transparent focus:ring-0 appearance-none border w-full leading-tight focus:outline-none", {
7822
7769
  "resize-none": !resizable,
7823
7770
  "h-32": defaultStyle,
7824
7771
  "mt-3": !headline
@@ -7845,7 +7792,7 @@ var Textarea = ({
7845
7792
  ]
7846
7793
  }
7847
7794
  ),
7848
- hasFocus && disclaimer && /* @__PURE__ */ jsx53("label", { className: "text-negative", children: disclaimer })
7795
+ hasFocus && disclaimer && /* @__PURE__ */ jsx52("label", { className: "text-negative", children: disclaimer })
7849
7796
  ] });
7850
7797
  };
7851
7798
  var TextareaUncontrolled = ({
@@ -7854,10 +7801,10 @@ var TextareaUncontrolled = ({
7854
7801
  ...props
7855
7802
  }) => {
7856
7803
  const [text, setText] = useState22(value);
7857
- useEffect21(() => {
7804
+ useEffect22(() => {
7858
7805
  setText(value);
7859
7806
  }, [value]);
7860
- return /* @__PURE__ */ jsx53(
7807
+ return /* @__PURE__ */ jsx52(
7861
7808
  Textarea,
7862
7809
  {
7863
7810
  ...props,
@@ -7871,7 +7818,7 @@ var TextareaUncontrolled = ({
7871
7818
  };
7872
7819
 
7873
7820
  // src/components/properties/TextProperty.tsx
7874
- import { jsx as jsx54 } from "react/jsx-runtime";
7821
+ import { jsx as jsx53 } from "react/jsx-runtime";
7875
7822
  var defaultTextPropertyTranslation = {
7876
7823
  en: {
7877
7824
  text: "Text"
@@ -7891,21 +7838,21 @@ var TextProperty = ({
7891
7838
  }) => {
7892
7839
  const translation = useTranslation([defaultTextPropertyTranslation], overwriteTranslation);
7893
7840
  const hasValue = value !== void 0;
7894
- return /* @__PURE__ */ jsx54(
7841
+ return /* @__PURE__ */ jsx53(
7895
7842
  PropertyBase,
7896
7843
  {
7897
7844
  ...baseProps,
7898
7845
  onRemove,
7899
7846
  hasValue,
7900
- icon: /* @__PURE__ */ jsx54(Text, { size: 16 }),
7901
- input: ({ softRequired }) => /* @__PURE__ */ jsx54(
7847
+ icon: /* @__PURE__ */ jsx53(Text, { size: 16 }),
7848
+ input: ({ softRequired }) => /* @__PURE__ */ jsx53(
7902
7849
  "div",
7903
7850
  {
7904
- className: clsx41("row grow pt-2 pb-1 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
7905
- children: /* @__PURE__ */ jsx54(
7851
+ className: clsx40("row grow pt-2 pb-1 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
7852
+ children: /* @__PURE__ */ jsx53(
7906
7853
  Textarea,
7907
7854
  {
7908
- className: clsx41("ring-0 border-0 outline-0 p-0 m-0 shadow-none rounded-none", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
7855
+ className: clsx40("ring-0 border-0 outline-0 p-0 m-0 shadow-none rounded-none", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
7909
7856
  rows: 5,
7910
7857
  defaultStyle: false,
7911
7858
  value: value ?? "",
@@ -7933,74 +7880,48 @@ var TextProperty = ({
7933
7880
  );
7934
7881
  };
7935
7882
 
7936
- // src/components/user-action/DateAndTimePicker.tsx
7937
- import clsx42 from "clsx";
7938
- import { jsx as jsx55, jsxs as jsxs36 } from "react/jsx-runtime";
7939
- var DateTimePicker = ({
7940
- overwriteTranslation,
7941
- value = /* @__PURE__ */ new Date(),
7942
- start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
7943
- end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
7944
- mode = "dateTime",
7945
- onFinish = noop,
7946
- onChange = noop,
7947
- onRemove = noop,
7948
- timePickerProps,
7949
- datePickerProps
7883
+ // src/components/table/FillerRowElement.tsx
7884
+ import { clsx as clsx41 } from "clsx";
7885
+ import { jsx as jsx54 } from "react/jsx-runtime";
7886
+ var FillerRowElement = ({
7887
+ className
7950
7888
  }) => {
7951
- const translation = useTranslation([formTranslation, timeTranslation], overwriteTranslation);
7952
- const useDate = mode === "dateTime" || mode === "date";
7953
- const useTime = mode === "dateTime" || mode === "time";
7954
- let dateDisplay;
7955
- let timeDisplay;
7956
- if (useDate) {
7957
- dateDisplay = /* @__PURE__ */ jsx55(
7958
- DatePicker,
7959
- {
7960
- ...datePickerProps,
7961
- className: "min-w-[320px] min-h-[250px]",
7962
- yearMonthPickerProps: { maxHeight: 218 },
7963
- value,
7964
- start,
7965
- end,
7966
- onChange
7967
- }
7968
- );
7969
- }
7970
- if (useTime) {
7971
- timeDisplay = /* @__PURE__ */ jsx55(
7972
- TimePicker,
7973
- {
7974
- ...timePickerProps,
7975
- className: clsx42("h-full", { "justify-between w-full": mode === "time" }),
7976
- maxHeight: 250,
7977
- time: value,
7978
- onChange
7979
- }
7980
- );
7981
- }
7982
- return /* @__PURE__ */ jsxs36("div", { className: "col w-fit", children: [
7983
- /* @__PURE__ */ jsxs36("div", { className: "row gap-x-4", children: [
7984
- dateDisplay,
7985
- timeDisplay
7986
- ] }),
7987
- /* @__PURE__ */ jsx55("div", { className: "row justify-end", children: /* @__PURE__ */ jsxs36("div", { className: "row gap-x-2 mt-1", children: [
7988
- /* @__PURE__ */ jsx55(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
7989
- /* @__PURE__ */ jsx55(
7990
- SolidButton,
7991
- {
7992
- size: "medium",
7993
- onClick: () => onFinish(value),
7994
- children: translation("change")
7995
- }
7996
- )
7997
- ] }) })
7998
- ] });
7889
+ return /* @__PURE__ */ jsx54("div", { className: clsx41("flex flex-row items-center w-1/2 h-4 text-disabled-text font-bold", className), children: "-" });
7999
7890
  };
8000
7891
 
7892
+ // src/components/table/Filter.ts
7893
+ var dateRange = (row, columnId, filterValue) => {
7894
+ const [min, max] = filterValue;
7895
+ const value = row.getValue(columnId);
7896
+ const date = value instanceof Date ? value : new Date(value);
7897
+ if (isNaN(date.getTime())) return false;
7898
+ if (min && date < min) return false;
7899
+ if (max && date > max) return false;
7900
+ return true;
7901
+ };
7902
+ var TableFilters = {
7903
+ dateRange
7904
+ };
7905
+
7906
+ // src/components/table/Table.tsx
7907
+ import { useCallback as useCallback5, useEffect as useEffect25, useMemo as useMemo3, useRef as useRef9, useState as useState24 } from "react";
7908
+ import clsx45 from "clsx";
7909
+ import {
7910
+ flexRender,
7911
+ getCoreRowModel,
7912
+ getFilteredRowModel,
7913
+ getPaginationRowModel,
7914
+ getSortedRowModel,
7915
+ useReactTable
7916
+ } from "@tanstack/react-table";
7917
+ import { Scrollbars as Scrollbars3 } from "react-custom-scrollbars-2";
7918
+
7919
+ // src/components/table/TableFilterButton.tsx
7920
+ import { FilterIcon } from "lucide-react";
7921
+
8001
7922
  // src/components/user-action/Menu.tsx
8002
- import { useRef as useRef9 } from "react";
8003
- import clsx43 from "clsx";
7923
+ import { useRef as useRef8 } from "react";
7924
+ import clsx42 from "clsx";
8004
7925
 
8005
7926
  // src/util/PropsWithFunctionChildren.ts
8006
7927
  var resolve = (children, bag) => {
@@ -8014,17 +7935,17 @@ var BagFunctionUtil = {
8014
7935
  };
8015
7936
 
8016
7937
  // src/components/user-action/Menu.tsx
8017
- import { jsx as jsx56, jsxs as jsxs37 } from "react/jsx-runtime";
7938
+ import { jsx as jsx55, jsxs as jsxs35 } from "react/jsx-runtime";
8018
7939
  var MenuItem = ({
8019
7940
  children,
8020
7941
  onClick,
8021
7942
  alignment = "left",
8022
7943
  isDisabled = false,
8023
7944
  className
8024
- }) => /* @__PURE__ */ jsx56(
7945
+ }) => /* @__PURE__ */ jsx55(
8025
7946
  "div",
8026
7947
  {
8027
- className: clsx43("block px-3 py-1.5 bg-menu-background first:rounded-t-lg last:rounded-b-lg text-sm font-semibold", {
7948
+ className: clsx42("block px-3 py-1.5 bg-menu-background first:rounded-t-lg last:rounded-b-lg text-sm font-semibold", {
8028
7949
  "text-right": alignment === "right",
8029
7950
  "text-left": alignment === "left",
8030
7951
  "text-disabled-text cursor-not-allowed": isDisabled,
@@ -8043,23 +7964,23 @@ var Menu = ({
8043
7964
  menuClassName = ""
8044
7965
  }) => {
8045
7966
  const { isHovered: isOpen, setIsHovered: setIsOpen, handlers } = useHoverState({ isDisabled: !showOnHover });
8046
- const triggerRef = useRef9(null);
8047
- const menuRef = useRef9(null);
7967
+ const triggerRef = useRef8(null);
7968
+ const menuRef = useRef8(null);
8048
7969
  useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
8049
7970
  const bag = { isOpen, close: () => setIsOpen(false) };
8050
- return /* @__PURE__ */ jsxs37(
7971
+ return /* @__PURE__ */ jsxs35(
8051
7972
  "div",
8052
7973
  {
8053
7974
  className: "relative",
8054
7975
  ...handlers,
8055
7976
  children: [
8056
7977
  trigger(() => setIsOpen(!isOpen), triggerRef),
8057
- /* @__PURE__ */ jsx56(
7978
+ /* @__PURE__ */ jsx55(
8058
7979
  "div",
8059
7980
  {
8060
7981
  ref: menuRef,
8061
7982
  onClick: (e) => e.stopPropagation(),
8062
- className: clsx43(
7983
+ className: clsx42(
8063
7984
  "absolute top-full mt-1 min-w-40 rounded-lg bg-menu-background text-menu-text shadow-around-lg z-10",
8064
7985
  {
8065
7986
  "top-0": alignment[0] === "t",
@@ -8078,10 +7999,644 @@ var Menu = ({
8078
7999
  );
8079
8000
  };
8080
8001
 
8002
+ // src/components/table/TableFilterButton.tsx
8003
+ import { useEffect as useEffect23, useState as useState23 } from "react";
8004
+ import { Fragment as Fragment3, jsx as jsx56, jsxs as jsxs36 } from "react/jsx-runtime";
8005
+ var defaultTableFilterTranslation = {
8006
+ en: {
8007
+ filter: "Filter",
8008
+ min: "Min",
8009
+ max: "Max",
8010
+ startDate: "Start",
8011
+ endDate: "End",
8012
+ text: "Text..."
8013
+ },
8014
+ de: {
8015
+ filter: "Filter",
8016
+ min: "Min",
8017
+ max: "Max",
8018
+ startDate: "Start",
8019
+ endDate: "Ende",
8020
+ text: "Text..."
8021
+ }
8022
+ };
8023
+ var TableFilterButton = ({
8024
+ filterType,
8025
+ column
8026
+ }) => {
8027
+ const translation = useTranslation([formTranslation, defaultTableFilterTranslation]);
8028
+ const columnFilterValue = column.getFilterValue();
8029
+ const [filterValue, setFilterValue] = useState23(columnFilterValue);
8030
+ const hasFilter = !!filterValue;
8031
+ useEffect23(() => {
8032
+ setFilterValue(columnFilterValue);
8033
+ }, [columnFilterValue]);
8034
+ return /* @__PURE__ */ jsx56(
8035
+ Menu,
8036
+ {
8037
+ trigger: (onClick, ref) => /* @__PURE__ */ jsxs36("div", { ref, className: "relative", children: [
8038
+ /* @__PURE__ */ jsx56(IconButton, { color: "neutral", size: "tiny", onClick, children: /* @__PURE__ */ jsx56(FilterIcon, {}) }),
8039
+ hasFilter && /* @__PURE__ */ jsx56(
8040
+ "div",
8041
+ {
8042
+ className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-primary pointer-events-none",
8043
+ "aria-hidden": true
8044
+ }
8045
+ )
8046
+ ] }),
8047
+ children: ({ close }) => /* @__PURE__ */ jsxs36("div", { className: "col gap-y-1 p-2 items-start font-normal text-menu-text", children: [
8048
+ /* @__PURE__ */ jsx56("h4", { className: "textstyle-title-sm", children: translation("filter") }),
8049
+ filterType === "text" && /* @__PURE__ */ jsx56(
8050
+ Input,
8051
+ {
8052
+ value: filterValue ?? "",
8053
+ autoFocus: true,
8054
+ placeholder: translation("text"),
8055
+ onChangeText: setFilterValue,
8056
+ className: "h-10"
8057
+ }
8058
+ ),
8059
+ filterType === "range" && /* @__PURE__ */ jsxs36("div", { className: "row gap-x-2 items-center", children: [
8060
+ /* @__PURE__ */ jsx56(
8061
+ Input,
8062
+ {
8063
+ value: filterValue?.[0] ?? "",
8064
+ type: "number",
8065
+ placeholder: translation("min"),
8066
+ onChangeText: (text) => {
8067
+ const num = Number(text);
8068
+ setFilterValue((old) => [num, old?.[1]]);
8069
+ },
8070
+ className: "h-10 input-indicator-hidden w-40"
8071
+ }
8072
+ ),
8073
+ /* @__PURE__ */ jsx56("span", { className: "font-bold", children: "-" }),
8074
+ /* @__PURE__ */ jsx56(
8075
+ Input,
8076
+ {
8077
+ value: filterValue?.[1] ?? "",
8078
+ type: "number",
8079
+ placeholder: translation("max"),
8080
+ onChangeText: (text) => {
8081
+ const num = Number(text);
8082
+ setFilterValue((old) => [old?.[0], num]);
8083
+ },
8084
+ className: "h-10 input-indicator-hidden w-40"
8085
+ }
8086
+ )
8087
+ ] }),
8088
+ filterType === "dateRange" && /* @__PURE__ */ jsxs36(Fragment3, { children: [
8089
+ /* @__PURE__ */ jsx56(
8090
+ Input,
8091
+ {
8092
+ value: filterValue?.[0] ? filterValue?.[0].toISOString().slice(0, 16) : "",
8093
+ type: "datetime-local",
8094
+ placeholder: translation("startDate"),
8095
+ onChangeText: (text) => {
8096
+ const value = new Date(text);
8097
+ setFilterValue((old) => [value, old?.[1]]);
8098
+ },
8099
+ className: "h-10 w-50"
8100
+ }
8101
+ ),
8102
+ /* @__PURE__ */ jsx56(
8103
+ Input,
8104
+ {
8105
+ value: filterValue?.[1] ? filterValue?.[1].toISOString().slice(0, 16) : "",
8106
+ type: "datetime-local",
8107
+ placeholder: translation("endDate"),
8108
+ onChangeText: (text) => {
8109
+ const value = new Date(text);
8110
+ setFilterValue((old) => [old?.[0], value]);
8111
+ },
8112
+ className: "h-10 w-50"
8113
+ }
8114
+ )
8115
+ ] }),
8116
+ /* @__PURE__ */ jsxs36("div", { className: "row justify-end w-full", children: [
8117
+ hasFilter && /* @__PURE__ */ jsx56(SolidButton, { color: "negative", size: "small", onClick: () => {
8118
+ column.setFilterValue(void 0);
8119
+ close();
8120
+ }, children: translation("remove") }),
8121
+ /* @__PURE__ */ jsx56(SolidButton, { size: "small", onClick: () => {
8122
+ column.setFilterValue(filterValue);
8123
+ close();
8124
+ }, children: translation("apply") })
8125
+ ] })
8126
+ ] })
8127
+ }
8128
+ );
8129
+ };
8130
+
8131
+ // src/components/table/TableSortButton.tsx
8132
+ import { ChevronDown as ChevronDown6, ChevronsUpDown, ChevronUp as ChevronUp5 } from "lucide-react";
8133
+ import clsx43 from "clsx";
8134
+ import { jsx as jsx57 } from "react/jsx-runtime";
8135
+ var TableSortButton = ({
8136
+ sortDirection,
8137
+ invert = false,
8138
+ color = "neutral",
8139
+ className,
8140
+ ...buttonProps
8141
+ }) => {
8142
+ let icon = /* @__PURE__ */ jsx57(ChevronsUpDown, { className: "w-full h-full" });
8143
+ if (sortDirection) {
8144
+ let usedSortDirection = sortDirection;
8145
+ if (invert) {
8146
+ usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
8147
+ }
8148
+ icon = usedSortDirection === "asc" ? /* @__PURE__ */ jsx57(ChevronUp5, { className: "w-full h-full" }) : /* @__PURE__ */ jsx57(ChevronDown6, { className: "w-full h-full" });
8149
+ }
8150
+ return /* @__PURE__ */ jsx57(
8151
+ IconButton,
8152
+ {
8153
+ size: "tiny",
8154
+ color,
8155
+ className: clsx43(className),
8156
+ ...buttonProps,
8157
+ children: icon
8158
+ }
8159
+ );
8160
+ };
8161
+
8162
+ // src/hooks/useResizeCallbackWrapper.ts
8163
+ import { useEffect as useEffect24 } from "react";
8164
+ var useResizeCallbackWrapper = (callback) => {
8165
+ useEffect24(() => {
8166
+ window.addEventListener("resize", callback);
8167
+ return () => {
8168
+ window.removeEventListener("resize", callback);
8169
+ };
8170
+ }, [callback]);
8171
+ };
8172
+
8173
+ // src/components/table/TableCell.tsx
8174
+ import { clsx as clsx44 } from "clsx";
8175
+ import { jsx as jsx58 } from "react/jsx-runtime";
8176
+ var TableCell = ({
8177
+ children,
8178
+ className
8179
+ }) => {
8180
+ return /* @__PURE__ */ jsx58("span", { className: clsx44("block max-w-full overflow-ellipsis truncate", className), children });
8181
+ };
8182
+
8183
+ // src/components/table/Table.tsx
8184
+ import { jsx as jsx59, jsxs as jsxs37 } from "react/jsx-runtime";
8185
+ var Table = ({
8186
+ data,
8187
+ fillerRow,
8188
+ initialState,
8189
+ onRowClick = noop,
8190
+ className,
8191
+ tableClassName,
8192
+ defaultColumn,
8193
+ state,
8194
+ columns,
8195
+ ...tableOptions
8196
+ }) => {
8197
+ const ref = useRef9(null);
8198
+ const tableRef = useRef9(null);
8199
+ const [columnSizing, setColumnSizing] = useState24(columns.reduce((previousValue, currentValue) => {
8200
+ return {
8201
+ ...previousValue,
8202
+ [currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
8203
+ };
8204
+ }, {}));
8205
+ const [columnSizingInfo, setColumnSizingInfo] = useState24();
8206
+ const [pagination, setPagination] = useState24({
8207
+ pageSize: 10,
8208
+ pageIndex: 0,
8209
+ ...initialState?.pagination
8210
+ });
8211
+ const [columnFilters, setColumnFilters] = useState24(initialState?.columnFilters);
8212
+ const computedColumnMinWidths = useMemo3(() => {
8213
+ return columns.reduce((previousValue, column) => {
8214
+ return {
8215
+ ...previousValue,
8216
+ // every column is at least 12px wide
8217
+ [column.id]: column.minSize ?? defaultColumn?.minSize ?? 12
8218
+ };
8219
+ }, {});
8220
+ }, [columns, defaultColumn]);
8221
+ const computedColumnMaxWidths = useMemo3(() => {
8222
+ return columns.reduce((previousValue, column) => {
8223
+ return {
8224
+ ...previousValue,
8225
+ [column.id]: column.maxSize ?? defaultColumn?.maxSize
8226
+ };
8227
+ }, {});
8228
+ }, [columns, defaultColumn]);
8229
+ const tableMinWidth = useMemo3(() => {
8230
+ return columns.reduce((sum, column) => {
8231
+ return sum + computedColumnMinWidths[column.id];
8232
+ }, 0);
8233
+ }, [columns, computedColumnMinWidths]);
8234
+ const updateColumnSizes = useMemo3(() => {
8235
+ return (previous) => {
8236
+ const updateSizing = {
8237
+ ...columnSizing,
8238
+ ...previous
8239
+ };
8240
+ const containerWidth = ref.current.offsetWidth;
8241
+ columns.forEach((column) => {
8242
+ updateSizing[column.id] = clamp(updateSizing[column.id], computedColumnMinWidths[column.id], computedColumnMaxWidths[column.id] ?? containerWidth);
8243
+ });
8244
+ const width = columns.reduce((previousValue, currentValue) => previousValue + updateSizing[currentValue.id], 0);
8245
+ if (width > containerWidth) {
8246
+ if (tableMinWidth >= containerWidth) {
8247
+ return columns.reduce((previousValue, currentValue) => ({
8248
+ ...previousValue,
8249
+ [currentValue.id]: computedColumnMinWidths[currentValue.id]
8250
+ }), {});
8251
+ }
8252
+ let reduceableColumns = columns.map((value) => value.id).filter((id) => updateSizing[id] - computedColumnMinWidths[id] > 0);
8253
+ let spaceToReduce = width - containerWidth;
8254
+ while (spaceToReduce > 0 && reduceableColumns.length > 0) {
8255
+ let maxReduceAmount = reduceableColumns.reduce((previousValue, id) => Math.max(previousValue, updateSizing[id] - computedColumnMinWidths[id]), 0);
8256
+ if (maxReduceAmount * reduceableColumns.length > spaceToReduce) {
8257
+ maxReduceAmount = spaceToReduce / reduceableColumns.length;
8258
+ }
8259
+ reduceableColumns.forEach((id) => {
8260
+ updateSizing[id] -= maxReduceAmount;
8261
+ });
8262
+ spaceToReduce -= maxReduceAmount * reduceableColumns.length;
8263
+ reduceableColumns = reduceableColumns.filter((id) => updateSizing[id] - computedColumnMinWidths[id] > 0);
8264
+ }
8265
+ } else if (width <= containerWidth) {
8266
+ let distributableWidth = containerWidth - width;
8267
+ const violatingColumns = columns.filter((value) => computedColumnMaxWidths[value.id] && updateSizing[value.id] > computedColumnMaxWidths[value.id]);
8268
+ const violationColumnsAmount = violatingColumns.reduce(
8269
+ (previousValue, column) => previousValue + updateSizing[column.id] - computedColumnMaxWidths[column.id],
8270
+ 0
8271
+ );
8272
+ distributableWidth += violationColumnsAmount;
8273
+ let enlargeableColumns = columns.filter((col) => !computedColumnMaxWidths[col.id] || updateSizing[col.id] < computedColumnMaxWidths[col.id]).map((value) => value.id);
8274
+ while (distributableWidth > 0 && enlargeableColumns.length > 0) {
8275
+ let minEnlargeableAmount = enlargeableColumns.reduce((previousValue, id) => Math.min(previousValue, computedColumnMaxWidths[id] ? computedColumnMaxWidths[id] - updateSizing[id] : distributableWidth), distributableWidth);
8276
+ if (minEnlargeableAmount * enlargeableColumns.length > distributableWidth) {
8277
+ minEnlargeableAmount = distributableWidth / enlargeableColumns.length;
8278
+ }
8279
+ enlargeableColumns.forEach((id) => {
8280
+ updateSizing[id] += minEnlargeableAmount;
8281
+ });
8282
+ distributableWidth -= minEnlargeableAmount * enlargeableColumns.length;
8283
+ enlargeableColumns = enlargeableColumns.filter((id) => !computedColumnMaxWidths[id] || updateSizing[id] < computedColumnMaxWidths[id]);
8284
+ }
8285
+ if (distributableWidth > 0) {
8286
+ updateSizing[columns[columns.length - 1].id] += distributableWidth;
8287
+ }
8288
+ }
8289
+ return updateSizing;
8290
+ };
8291
+ }, [columns, computedColumnMaxWidths, computedColumnMinWidths, tableMinWidth]);
8292
+ const table = useReactTable({
8293
+ data,
8294
+ getCoreRowModel: getCoreRowModel(),
8295
+ getFilteredRowModel: getFilteredRowModel(),
8296
+ getSortedRowModel: getSortedRowModel(),
8297
+ getPaginationRowModel: getPaginationRowModel(),
8298
+ initialState,
8299
+ defaultColumn: {
8300
+ minSize: 60,
8301
+ maxSize: 700,
8302
+ cell: ({ cell }) => {
8303
+ return /* @__PURE__ */ jsx59(TableCell, { children: cell.getValue() });
8304
+ },
8305
+ ...defaultColumn
8306
+ },
8307
+ columns,
8308
+ state: {
8309
+ columnSizing,
8310
+ columnSizingInfo,
8311
+ pagination,
8312
+ columnFilters,
8313
+ ...state
8314
+ },
8315
+ filterFns: {
8316
+ ...tableOptions?.filterFns,
8317
+ dateRange: TableFilters.dateRange
8318
+ },
8319
+ onColumnSizingInfoChange: (updaterOrValue) => {
8320
+ setColumnSizingInfo(updaterOrValue);
8321
+ if (tableOptions.onColumnSizingInfoChange) {
8322
+ tableOptions?.onColumnSizingInfoChange(updaterOrValue);
8323
+ }
8324
+ },
8325
+ onColumnSizingChange: (updaterOrValue) => {
8326
+ setColumnSizing((previous) => {
8327
+ const newSizing = typeof updaterOrValue === "function" ? updaterOrValue(previous) : updaterOrValue;
8328
+ return updateColumnSizes(newSizing);
8329
+ });
8330
+ if (tableOptions.onColumnSizingChange) {
8331
+ tableOptions.onColumnSizingChange(updaterOrValue);
8332
+ }
8333
+ },
8334
+ onPaginationChange: (updaterOrValue) => {
8335
+ setPagination(updaterOrValue);
8336
+ if (tableOptions.onPaginationChange) {
8337
+ tableOptions.onPaginationChange(updaterOrValue);
8338
+ }
8339
+ },
8340
+ onColumnFiltersChange: (updaterOrValue) => {
8341
+ setColumnFilters(updaterOrValue);
8342
+ table.toggleAllRowsSelected(false);
8343
+ if (tableOptions.onColumnFiltersChange) {
8344
+ tableOptions.onColumnFiltersChange(updaterOrValue);
8345
+ }
8346
+ },
8347
+ autoResetPageIndex: false,
8348
+ columnResizeMode: "onChange",
8349
+ ...tableOptions
8350
+ });
8351
+ const [hasInitializedSizing, setHasInitializedSizing] = useState24(false);
8352
+ useEffect25(() => {
8353
+ if (!hasInitializedSizing && ref.current) {
8354
+ setHasInitializedSizing(true);
8355
+ table.setColumnSizing(updateColumnSizes(columnSizing));
8356
+ }
8357
+ }, [columnSizing, hasInitializedSizing]);
8358
+ useResizeCallbackWrapper(useCallback5(() => {
8359
+ table.setColumnSizing(updateColumnSizes);
8360
+ }, [updateColumnSizes]));
8361
+ const pageCount = table.getPageCount();
8362
+ useEffect25(() => {
8363
+ const totalPages = pageCount;
8364
+ if (totalPages === 0) {
8365
+ if (pagination.pageIndex !== 0) {
8366
+ table.setPagination((prevState) => ({
8367
+ ...prevState,
8368
+ pageIndex: 0
8369
+ }));
8370
+ }
8371
+ } else if (pagination.pageIndex >= totalPages) {
8372
+ table.setPagination((prev) => ({
8373
+ ...prev,
8374
+ pageIndex: totalPages - 1
8375
+ }));
8376
+ }
8377
+ }, [data, pageCount, pagination.pageSize, pagination.pageIndex]);
8378
+ const columnSizeVars = useMemo3(() => {
8379
+ const headers = table.getFlatHeaders();
8380
+ const colSizes = {};
8381
+ for (let i = 0; i < headers.length; i++) {
8382
+ const header = headers[i];
8383
+ colSizes[`--header-${header.id}-size`] = header.getSize();
8384
+ colSizes[`--col-${header.column.id}-size`] = header.column.getSize();
8385
+ }
8386
+ return colSizes;
8387
+ }, [table.getState().columnSizingInfo, table.getState().columnSizing]);
8388
+ return /* @__PURE__ */ jsxs37("div", { ref, className: clsx45("col gap-y-4", className), children: [
8389
+ /* @__PURE__ */ jsx59(Scrollbars3, { autoHeight: true, autoHeightMax: tableRef.current?.offsetHeight, autoHide: true, children: /* @__PURE__ */ jsxs37(
8390
+ "table",
8391
+ {
8392
+ ref: tableRef,
8393
+ className: clsx45(tableClassName),
8394
+ style: {
8395
+ ...columnSizeVars,
8396
+ width: Math.max(table.getTotalSize(), ref.current?.offsetWidth ?? table.getTotalSize())
8397
+ },
8398
+ children: [
8399
+ table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx59("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx59(
8400
+ "col",
8401
+ {
8402
+ style: {
8403
+ width: `calc(var(--header-${header?.id}-size) * 1px)`,
8404
+ minWidth: header.column.columnDef.minSize,
8405
+ maxWidth: header.column.columnDef.maxSize
8406
+ }
8407
+ },
8408
+ header.id
8409
+ )) }, headerGroup.id)),
8410
+ /* @__PURE__ */ jsx59("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx59("tr", { className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
8411
+ return /* @__PURE__ */ jsxs37(
8412
+ "th",
8413
+ {
8414
+ colSpan: header.colSpan,
8415
+ className: clsx45("relative group", header.column.columnDef.meta?.className),
8416
+ children: [
8417
+ /* @__PURE__ */ jsx59("div", { className: "row w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs37("div", { className: "row gap-x-1 items-center", children: [
8418
+ header.column.getCanSort() && /* @__PURE__ */ jsx59(
8419
+ TableSortButton,
8420
+ {
8421
+ sortDirection: header.column.getIsSorted(),
8422
+ onClick: () => header.column.toggleSorting()
8423
+ }
8424
+ ),
8425
+ header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ jsx59(
8426
+ TableFilterButton,
8427
+ {
8428
+ column: header.column,
8429
+ filterType: header.column.columnDef.meta.filterType
8430
+ }
8431
+ ) : null,
8432
+ flexRender(
8433
+ header.column.columnDef.header,
8434
+ header.getContext()
8435
+ )
8436
+ ] }) }),
8437
+ header.column.getCanResize() && /* @__PURE__ */ jsx59(
8438
+ "div",
8439
+ {
8440
+ onMouseDown: header.getResizeHandler(),
8441
+ onTouchStart: header.getResizeHandler(),
8442
+ onDoubleClick: () => {
8443
+ header.column.resetSize();
8444
+ },
8445
+ className: "table-resize-indicator w-2 rounded bg-primary cursor-col-resize select-none touch-none opacity-0 group-hover:opacity-100 transition-opacity",
8446
+ style: {
8447
+ opacity: !columnSizingInfo?.columnSizingStart ? void 0 : columnSizingInfo?.columnSizingStart?.findIndex(([id, _]) => id === header.column.id) !== -1 ? 1 : columnSizingInfo?.columnSizingStart?.length !== 0 ? 0 : void 0
8448
+ }
8449
+ }
8450
+ )
8451
+ ]
8452
+ },
8453
+ header.id
8454
+ );
8455
+ }) }, headerGroup.id)) }),
8456
+ /* @__PURE__ */ jsxs37("tbody", { children: [
8457
+ table.getRowModel().rows.map((row) => {
8458
+ return /* @__PURE__ */ jsx59("tr", { onClick: () => onRowClick(row, table), className: table.options.meta?.bodyRowClassName, children: row.getVisibleCells().map((cell) => {
8459
+ return /* @__PURE__ */ jsx59("td", { children: flexRender(
8460
+ cell.column.columnDef.cell,
8461
+ cell.getContext()
8462
+ ) }, cell.id);
8463
+ }) }, row.id);
8464
+ }),
8465
+ range(table.getState().pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
8466
+ return /* @__PURE__ */ jsx59("tr", { children: columns.map((column) => {
8467
+ return /* @__PURE__ */ jsx59("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ jsx59(FillerRowElement, {}) }, column.id);
8468
+ }) }, "filler-row-" + index);
8469
+ })
8470
+ ] })
8471
+ ]
8472
+ }
8473
+ ) }),
8474
+ /* @__PURE__ */ jsx59("div", { className: "row justify-center", children: /* @__PURE__ */ jsx59(
8475
+ Pagination,
8476
+ {
8477
+ pageIndex: table.getState().pagination.pageIndex,
8478
+ pageCount: table.getPageCount(),
8479
+ onPageChanged: (page) => table.setPageIndex(page)
8480
+ }
8481
+ ) })
8482
+ ] });
8483
+ };
8484
+ var TableUncontrolled = ({ data, ...props }) => {
8485
+ const [usedDate, setUsedData] = useState24(data);
8486
+ useEffect25(() => {
8487
+ setUsedData(data);
8488
+ }, [data]);
8489
+ return /* @__PURE__ */ jsx59(
8490
+ Table,
8491
+ {
8492
+ ...props,
8493
+ data: usedDate
8494
+ }
8495
+ );
8496
+ };
8497
+ var TableWithSelection = ({
8498
+ columns,
8499
+ state,
8500
+ fillerRow,
8501
+ rowSelection,
8502
+ selectionRowId = "selection",
8503
+ onRowClick = noop,
8504
+ meta,
8505
+ ...props
8506
+ }) => {
8507
+ const columnsWithSelection = useMemo3(() => {
8508
+ return [
8509
+ {
8510
+ id: selectionRowId,
8511
+ header: ({ table }) => {
8512
+ return /* @__PURE__ */ jsx59(
8513
+ Checkbox,
8514
+ {
8515
+ checked: table.getIsSomeRowsSelected() ? "indeterminate" : table.getIsAllRowsSelected(),
8516
+ onChangeTristate: (value) => {
8517
+ const newValue = !!value;
8518
+ table.toggleAllRowsSelected(newValue);
8519
+ },
8520
+ containerClassName: "max-w-6"
8521
+ }
8522
+ );
8523
+ },
8524
+ cell: ({ row }) => {
8525
+ return /* @__PURE__ */ jsx59(
8526
+ Checkbox,
8527
+ {
8528
+ disabled: !row.getCanSelect(),
8529
+ checked: row.getIsSelected(),
8530
+ onChange: row.getToggleSelectedHandler(),
8531
+ containerClassName: "max-w-6"
8532
+ }
8533
+ );
8534
+ },
8535
+ size: 60,
8536
+ minSize: 60,
8537
+ maxSize: 60,
8538
+ enableResizing: false,
8539
+ enableSorting: false
8540
+ },
8541
+ ...columns
8542
+ ];
8543
+ }, [columns, selectionRowId]);
8544
+ return /* @__PURE__ */ jsx59(
8545
+ Table,
8546
+ {
8547
+ columns: columnsWithSelection,
8548
+ fillerRow: (columnId, table) => {
8549
+ if (columnId === selectionRowId) {
8550
+ return /* @__PURE__ */ jsx59(Checkbox, { checked: false, disabled: true, containerClassName: "max-w-6" });
8551
+ }
8552
+ return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ jsx59(FillerRowElement, {});
8553
+ },
8554
+ state: {
8555
+ rowSelection,
8556
+ ...state
8557
+ },
8558
+ onRowClick: (row, table) => {
8559
+ row.toggleSelected();
8560
+ onRowClick(row, table);
8561
+ },
8562
+ meta: {
8563
+ bodyRowClassName: "cursor-pointer",
8564
+ ...meta
8565
+ },
8566
+ ...props
8567
+ }
8568
+ );
8569
+ };
8570
+
8571
+ // src/components/user-action/DateAndTimePicker.tsx
8572
+ import clsx46 from "clsx";
8573
+ import { jsx as jsx60, jsxs as jsxs38 } from "react/jsx-runtime";
8574
+ var DateTimePicker = ({
8575
+ overwriteTranslation,
8576
+ value = /* @__PURE__ */ new Date(),
8577
+ start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
8578
+ end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
8579
+ mode = "dateTime",
8580
+ onFinish = noop,
8581
+ onChange = noop,
8582
+ onRemove = noop,
8583
+ timePickerProps,
8584
+ datePickerProps
8585
+ }) => {
8586
+ const translation = useTranslation([formTranslation, timeTranslation], overwriteTranslation);
8587
+ const useDate = mode === "dateTime" || mode === "date";
8588
+ const useTime = mode === "dateTime" || mode === "time";
8589
+ let dateDisplay;
8590
+ let timeDisplay;
8591
+ if (useDate) {
8592
+ dateDisplay = /* @__PURE__ */ jsx60(
8593
+ DatePicker,
8594
+ {
8595
+ ...datePickerProps,
8596
+ className: "min-w-[320px] min-h-[250px]",
8597
+ yearMonthPickerProps: { maxHeight: 218 },
8598
+ value,
8599
+ start,
8600
+ end,
8601
+ onChange
8602
+ }
8603
+ );
8604
+ }
8605
+ if (useTime) {
8606
+ timeDisplay = /* @__PURE__ */ jsx60(
8607
+ TimePicker,
8608
+ {
8609
+ ...timePickerProps,
8610
+ className: clsx46("h-full", { "justify-between w-full": mode === "time" }),
8611
+ maxHeight: 250,
8612
+ time: value,
8613
+ onChange
8614
+ }
8615
+ );
8616
+ }
8617
+ return /* @__PURE__ */ jsxs38("div", { className: "col w-fit", children: [
8618
+ /* @__PURE__ */ jsxs38("div", { className: "row gap-x-4", children: [
8619
+ dateDisplay,
8620
+ timeDisplay
8621
+ ] }),
8622
+ /* @__PURE__ */ jsx60("div", { className: "row justify-end", children: /* @__PURE__ */ jsxs38("div", { className: "row gap-x-2 mt-1", children: [
8623
+ /* @__PURE__ */ jsx60(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
8624
+ /* @__PURE__ */ jsx60(
8625
+ SolidButton,
8626
+ {
8627
+ size: "medium",
8628
+ onClick: () => onFinish(value),
8629
+ children: translation("change")
8630
+ }
8631
+ )
8632
+ ] }) })
8633
+ ] });
8634
+ };
8635
+
8081
8636
  // src/components/user-action/ScrollPicker.tsx
8082
- import { useCallback as useCallback4, useEffect as useEffect22, useState as useState23 } from "react";
8083
- import clsx44 from "clsx";
8084
- import { jsx as jsx57, jsxs as jsxs38 } from "react/jsx-runtime";
8637
+ import { useCallback as useCallback6, useEffect as useEffect26, useState as useState25 } from "react";
8638
+ import clsx47 from "clsx";
8639
+ import { jsx as jsx61, jsxs as jsxs39 } from "react/jsx-runtime";
8085
8640
  var up = 1;
8086
8641
  var down = -1;
8087
8642
  var ScrollPicker = ({
@@ -8100,7 +8655,7 @@ var ScrollPicker = ({
8100
8655
  transition,
8101
8656
  items,
8102
8657
  lastTimeStamp
8103
- }, setAnimation] = useState23({
8658
+ }, setAnimation] = useState25({
8104
8659
  targetIndex: selectedIndex,
8105
8660
  currentIndex: disabled ? selectedIndex : 0,
8106
8661
  velocity: 0,
@@ -8109,14 +8664,14 @@ var ScrollPicker = ({
8109
8664
  items: options
8110
8665
  });
8111
8666
  const itemsShownCount = 5;
8112
- const shownItems = getNeighbours(range(0, items.length - 1), currentIndex).map((index) => ({
8667
+ const shownItems = getNeighbours(range(items.length), currentIndex).map((index) => ({
8113
8668
  name: mapping(items[index]),
8114
8669
  index
8115
8670
  }));
8116
8671
  const itemHeight = 40;
8117
8672
  const distance = 8;
8118
8673
  const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
8119
- const getDirection = useCallback4((targetIndex, currentIndex2, transition2, length) => {
8674
+ const getDirection = useCallback6((targetIndex, currentIndex2, transition2, length) => {
8120
8675
  if (targetIndex === currentIndex2) {
8121
8676
  return transition2 > 0 ? up : down;
8122
8677
  }
@@ -8126,7 +8681,7 @@ var ScrollPicker = ({
8126
8681
  }
8127
8682
  return distanceForward >= length / 2 ? down : up;
8128
8683
  }, []);
8129
- const animate = useCallback4((timestamp, startTime) => {
8684
+ const animate = useCallback6((timestamp, startTime) => {
8130
8685
  setAnimation((prevState) => {
8131
8686
  const {
8132
8687
  targetIndex,
@@ -8199,7 +8754,7 @@ var ScrollPicker = ({
8199
8754
  };
8200
8755
  });
8201
8756
  }, [disabled, getDirection, onChange]);
8202
- useEffect22(() => {
8757
+ useEffect26(() => {
8203
8758
  requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
8204
8759
  });
8205
8760
  const opacity = (transition2, index, itemsCount) => {
@@ -8220,7 +8775,7 @@ var ScrollPicker = ({
8220
8775
  }
8221
8776
  return clamp(1 - opacityValue / max);
8222
8777
  };
8223
- return /* @__PURE__ */ jsx57(
8778
+ return /* @__PURE__ */ jsx61(
8224
8779
  "div",
8225
8780
  {
8226
8781
  className: "relative overflow-hidden",
@@ -8230,15 +8785,15 @@ var ScrollPicker = ({
8230
8785
  setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + event.deltaY }));
8231
8786
  }
8232
8787
  },
8233
- children: /* @__PURE__ */ jsxs38("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
8234
- /* @__PURE__ */ jsx57(
8788
+ children: /* @__PURE__ */ jsxs39("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
8789
+ /* @__PURE__ */ jsx61(
8235
8790
  "div",
8236
8791
  {
8237
8792
  className: "absolute z-[1] top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-full min-w-[40px] border border-divider/30 border-y-2 border-x-0 ",
8238
8793
  style: { height: `${itemHeight}px` }
8239
8794
  }
8240
8795
  ),
8241
- /* @__PURE__ */ jsx57(
8796
+ /* @__PURE__ */ jsx61(
8242
8797
  "div",
8243
8798
  {
8244
8799
  className: "col select-none",
@@ -8246,10 +8801,10 @@ var ScrollPicker = ({
8246
8801
  transform: `translateY(${-transition * (distance + itemHeight)}px)`,
8247
8802
  columnGap: `${distance}px`
8248
8803
  },
8249
- children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ jsx57(
8804
+ children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ jsx61(
8250
8805
  "div",
8251
8806
  {
8252
- className: clsx44(
8807
+ className: clsx47(
8253
8808
  `col items-center justify-center rounded-md`,
8254
8809
  {
8255
8810
  "text-primary font-bold": currentIndex === index,
@@ -8276,10 +8831,10 @@ var ScrollPicker = ({
8276
8831
  };
8277
8832
 
8278
8833
  // src/components/user-action/ToggleableInput.tsx
8279
- import { useEffect as useEffect23, useRef as useRef10, useState as useState24 } from "react";
8834
+ import { useEffect as useEffect27, useRef as useRef10, useState as useState26 } from "react";
8280
8835
  import { Pencil } from "lucide-react";
8281
- import clsx45 from "clsx";
8282
- import { jsx as jsx58, jsxs as jsxs39 } from "react/jsx-runtime";
8836
+ import clsx48 from "clsx";
8837
+ import { jsx as jsx62, jsxs as jsxs40 } from "react/jsx-runtime";
8283
8838
  var ToggleableInput = ({
8284
8839
  type = "text",
8285
8840
  value,
@@ -8291,28 +8846,29 @@ var ToggleableInput = ({
8291
8846
  size = 16,
8292
8847
  disclaimer,
8293
8848
  onBlur,
8849
+ saveDelayOptions,
8294
8850
  ...restProps
8295
8851
  }) => {
8296
- const [isEditing, setIsEditing] = useState24(initialState !== "display");
8297
- const { restartTimer, clearUpdateTimer } = useSaveDelay(() => void 0, 3e3);
8852
+ const [isEditing, setIsEditing] = useState26(initialState !== "display");
8853
+ const { restartTimer, clearTimer } = useDelay(saveDelayOptions);
8298
8854
  const ref = useRef10(null);
8299
8855
  const onEditCompletedWrapper = (text) => {
8300
8856
  onEditCompleted(text);
8301
- clearUpdateTimer();
8857
+ clearTimer();
8302
8858
  };
8303
- useEffect23(() => {
8859
+ useEffect27(() => {
8304
8860
  if (isEditing) {
8305
8861
  ref.current?.focus();
8306
8862
  }
8307
8863
  }, [isEditing]);
8308
- return /* @__PURE__ */ jsxs39("div", { children: [
8309
- /* @__PURE__ */ jsxs39(
8864
+ return /* @__PURE__ */ jsxs40("div", { children: [
8865
+ /* @__PURE__ */ jsxs40(
8310
8866
  "div",
8311
8867
  {
8312
- className: clsx45("row items-center w-full gap-x-2 overflow-hidden", { "cursor-pointer": !isEditing }),
8868
+ className: clsx48("row items-center w-full gap-x-2 overflow-hidden", { "cursor-pointer": !isEditing }),
8313
8869
  onClick: () => !isEditing ? setIsEditing(!isEditing) : void 0,
8314
8870
  children: [
8315
- /* @__PURE__ */ jsx58("div", { className: clsx45("row overflow-hidden", { "flex-1": isEditing }), children: isEditing ? /* @__PURE__ */ jsx58(
8871
+ /* @__PURE__ */ jsx62("div", { className: clsx48("row overflow-hidden", { "flex-1": isEditing }), children: isEditing ? /* @__PURE__ */ jsx62(
8316
8872
  "input",
8317
8873
  {
8318
8874
  ref,
@@ -8340,16 +8896,16 @@ var ToggleableInput = ({
8340
8896
  onEditCompletedWrapper(value);
8341
8897
  }
8342
8898
  },
8343
- className: clsx45(`w-full border-none rounded-none ring-0 outline-0 text-inherit bg-inherit shadow-transparent decoration-primary p-0 underline-offset-4`, {
8899
+ className: clsx48(`w-full border-none rounded-none ring-0 outline-0 text-inherit bg-inherit shadow-transparent decoration-primary p-0 underline-offset-4`, {
8344
8900
  underline: isEditing
8345
8901
  }, labelClassName),
8346
8902
  onFocus: (event) => event.target.select()
8347
8903
  }
8348
- ) : /* @__PURE__ */ jsx58("span", { className: clsx45("max-w-xs break-words overflow-hidden", labelClassName), children: value }) }),
8349
- /* @__PURE__ */ jsx58(
8904
+ ) : /* @__PURE__ */ jsx62("span", { className: clsx48("max-w-xs break-words overflow-hidden", labelClassName), children: value }) }),
8905
+ /* @__PURE__ */ jsx62(
8350
8906
  Pencil,
8351
8907
  {
8352
- className: clsx45(`cursor-pointer`, { "text-transparent": isEditing }),
8908
+ className: clsx48(`cursor-pointer`, { "text-transparent": isEditing }),
8353
8909
  size,
8354
8910
  style: { minWidth: `${size}px` }
8355
8911
  }
@@ -8357,7 +8913,7 @@ var ToggleableInput = ({
8357
8913
  ]
8358
8914
  }
8359
8915
  ),
8360
- isEditing && disclaimer && /* @__PURE__ */ jsx58("label", { className: "text-negative", children: disclaimer })
8916
+ isEditing && disclaimer && /* @__PURE__ */ jsx62("label", { className: "text-negative", children: disclaimer })
8361
8917
  ] });
8362
8918
  };
8363
8919
  var ToggleableInputUncontrolled = ({
@@ -8365,11 +8921,11 @@ var ToggleableInputUncontrolled = ({
8365
8921
  onChangeText = noop,
8366
8922
  ...restProps
8367
8923
  }) => {
8368
- const [value, setValue] = useState24(initialValue);
8369
- useEffect23(() => {
8924
+ const [value, setValue] = useState26(initialValue);
8925
+ useEffect27(() => {
8370
8926
  setValue(initialValue);
8371
8927
  }, [initialValue]);
8372
- return /* @__PURE__ */ jsx58(
8928
+ return /* @__PURE__ */ jsx62(
8373
8929
  ToggleableInput,
8374
8930
  {
8375
8931
  value,
@@ -8382,6 +8938,12 @@ var ToggleableInputUncontrolled = ({
8382
8938
  );
8383
8939
  };
8384
8940
 
8941
+ // src/hooks/useRerender.ts
8942
+ import { useReducer } from "react";
8943
+ var useRerender = () => {
8944
+ return useReducer(() => ({}), {})[1];
8945
+ };
8946
+
8385
8947
  // src/util/builder.ts
8386
8948
  var builder = (value, update) => {
8387
8949
  update(value);
@@ -8420,6 +8982,11 @@ var localizedNewsSchema = z.record(z.enum(LanguageUtil.languages), newsListSchem
8420
8982
  var filterNews = (localizedNews, requiredKeys) => {
8421
8983
  return localizedNews.filter((news) => requiredKeys.every((value) => news.keys.includes(value)));
8422
8984
  };
8985
+
8986
+ // src/util/resolveSetState.ts
8987
+ function resolveSetState(action, prev) {
8988
+ return typeof action === "function" ? action(prev) : action;
8989
+ }
8423
8990
  export {
8424
8991
  ASTNodeInterpreter,
8425
8992
  AnimatedRing,
@@ -8453,10 +9020,12 @@ export {
8453
9020
  Expandable,
8454
9021
  ExpandableUncontrolled,
8455
9022
  FAQSection,
9023
+ FillerRowElement,
8456
9024
  FormInput,
8457
9025
  Helpwave,
8458
9026
  HelpwaveBadge,
8459
9027
  IconButton,
9028
+ IconButtonUtil,
8460
9029
  Input,
8461
9030
  InputModal,
8462
9031
  InputUncontrolled,
@@ -8498,10 +9067,15 @@ export {
8498
9067
  SimpleSearchWithMapping,
8499
9068
  SingleSelectProperty,
8500
9069
  SolidButton,
8501
- SortButton,
8502
9070
  StepperBar,
8503
9071
  StepperBarUncontrolled,
8504
9072
  Table,
9073
+ TableCell,
9074
+ TableFilterButton,
9075
+ TableFilters,
9076
+ TableSortButton,
9077
+ TableUncontrolled,
9078
+ TableWithSelection,
8505
9079
  TagIcon,
8506
9080
  TextButton,
8507
9081
  TextImage,
@@ -8524,18 +9098,14 @@ export {
8524
9098
  YearMonthPicker,
8525
9099
  YearMonthPickerUncontrolled,
8526
9100
  addDuration,
8527
- addElementToTable,
8528
9101
  avatarSizeMapping,
8529
9102
  avtarSizeList,
8530
9103
  builder,
8531
9104
  changeDuration,
8532
- changeTableSelectionSingle,
8533
9105
  clamp,
8534
9106
  closestMatch,
8535
9107
  createLoopingList,
8536
9108
  createLoopingListWithIndex,
8537
- defaultTableStatePagination,
8538
- defaultTableStateSelection,
8539
9109
  equalDate,
8540
9110
  equalSizeGroups,
8541
9111
  filterNews,
@@ -8547,7 +9117,6 @@ export {
8547
9117
  getDaysInMonth,
8548
9118
  getNeighbours,
8549
9119
  getWeeksForCalenderMonth,
8550
- isDataObjectSelected,
8551
9120
  isInTimeSpan,
8552
9121
  localizedNewsSchema,
8553
9122
  monthTranslation,
@@ -8555,19 +9124,21 @@ export {
8555
9124
  newsListSchema,
8556
9125
  newsSchema,
8557
9126
  noop,
8558
- pageForItem,
8559
9127
  range,
8560
- removeFromTableSelection,
9128
+ resolveSetState,
8561
9129
  shadingColorValues,
8562
9130
  subtractDuration,
8563
9131
  timeTranslation,
8564
- updatePagination,
9132
+ useDelay,
9133
+ useFocusManagement,
9134
+ useFocusOnceVisible,
8565
9135
  useHoverState,
8566
9136
  useLanguage,
8567
9137
  useLocalStorage,
8568
9138
  useLocale,
8569
9139
  useOutsideClick,
8570
- useSaveDelay,
9140
+ useRerender,
9141
+ useResizeCallbackWrapper,
8571
9142
  useSearch,
8572
9143
  useTheme,
8573
9144
  useTranslation,