@helpwave/hightide 0.1.18 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/dist/components/branding/HelpwaveBadge.js +7 -7
  2. package/dist/components/branding/HelpwaveBadge.js.map +1 -1
  3. package/dist/components/branding/HelpwaveBadge.mjs +7 -7
  4. package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
  5. package/dist/components/date/DatePicker.js +65 -38
  6. package/dist/components/date/DatePicker.js.map +1 -1
  7. package/dist/components/date/DatePicker.mjs +54 -27
  8. package/dist/components/date/DatePicker.mjs.map +1 -1
  9. package/dist/components/date/DayPicker.js +3 -3
  10. package/dist/components/date/DayPicker.js.map +1 -1
  11. package/dist/components/date/DayPicker.mjs +3 -3
  12. package/dist/components/date/DayPicker.mjs.map +1 -1
  13. package/dist/components/date/TimePicker.js +4 -4
  14. package/dist/components/date/TimePicker.js.map +1 -1
  15. package/dist/components/date/TimePicker.mjs +4 -4
  16. package/dist/components/date/TimePicker.mjs.map +1 -1
  17. package/dist/components/date/YearMonthPicker.js +46 -19
  18. package/dist/components/date/YearMonthPicker.js.map +1 -1
  19. package/dist/components/date/YearMonthPicker.mjs +44 -17
  20. package/dist/components/date/YearMonthPicker.mjs.map +1 -1
  21. package/dist/components/dialogs/ConfirmDialog.js +32 -28
  22. package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
  23. package/dist/components/dialogs/ConfirmDialog.mjs +18 -14
  24. package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
  25. package/dist/components/icons-and-geometry/Avatar.js +2 -2
  26. package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
  27. package/dist/components/icons-and-geometry/Avatar.mjs +2 -2
  28. package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
  29. package/dist/components/icons-and-geometry/Ring.js +2 -2
  30. package/dist/components/icons-and-geometry/Ring.js.map +1 -1
  31. package/dist/components/icons-and-geometry/Ring.mjs +2 -2
  32. package/dist/components/icons-and-geometry/Ring.mjs.map +1 -1
  33. package/dist/components/layout-and-navigation/BreadCrumb.js +1 -1
  34. package/dist/components/layout-and-navigation/BreadCrumb.js.map +1 -1
  35. package/dist/components/layout-and-navigation/BreadCrumb.mjs +1 -1
  36. package/dist/components/layout-and-navigation/BreadCrumb.mjs.map +1 -1
  37. package/dist/components/layout-and-navigation/Carousel.js +84 -15
  38. package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
  39. package/dist/components/layout-and-navigation/Carousel.mjs +76 -7
  40. package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
  41. package/dist/components/layout-and-navigation/Chip.js +1 -1
  42. package/dist/components/layout-and-navigation/Chip.js.map +1 -1
  43. package/dist/components/layout-and-navigation/Chip.mjs +1 -1
  44. package/dist/components/layout-and-navigation/Chip.mjs.map +1 -1
  45. package/dist/components/layout-and-navigation/Expandable.d.mts +7 -1
  46. package/dist/components/layout-and-navigation/Expandable.d.ts +7 -1
  47. package/dist/components/layout-and-navigation/Expandable.js +36 -9
  48. package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
  49. package/dist/components/layout-and-navigation/Expandable.mjs +36 -10
  50. package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
  51. package/dist/components/layout-and-navigation/FAQSection.js +34 -11
  52. package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
  53. package/dist/components/layout-and-navigation/FAQSection.mjs +36 -13
  54. package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
  55. package/dist/components/layout-and-navigation/Overlay.js +92 -19
  56. package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
  57. package/dist/components/layout-and-navigation/Overlay.mjs +81 -8
  58. package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
  59. package/dist/components/layout-and-navigation/Pagination.js +82 -9
  60. package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
  61. package/dist/components/layout-and-navigation/Pagination.mjs +79 -6
  62. package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
  63. package/dist/components/layout-and-navigation/SearchableList.js +127 -25
  64. package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
  65. package/dist/components/layout-and-navigation/SearchableList.mjs +126 -24
  66. package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
  67. package/dist/components/layout-and-navigation/StepperBar.js +22 -16
  68. package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
  69. package/dist/components/layout-and-navigation/StepperBar.mjs +19 -13
  70. package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
  71. package/dist/components/layout-and-navigation/TextImage.js +7 -3
  72. package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
  73. package/dist/components/layout-and-navigation/TextImage.mjs +7 -3
  74. package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
  75. package/dist/components/layout-and-navigation/Tile.d.mts +2 -2
  76. package/dist/components/layout-and-navigation/Tile.d.ts +2 -2
  77. package/dist/components/layout-and-navigation/Tile.js +7 -7
  78. package/dist/components/layout-and-navigation/Tile.js.map +1 -1
  79. package/dist/components/layout-and-navigation/Tile.mjs +7 -7
  80. package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
  81. package/dist/components/loading-states/ErrorComponent.js +1 -1
  82. package/dist/components/loading-states/ErrorComponent.js.map +1 -1
  83. package/dist/components/loading-states/ErrorComponent.mjs +1 -1
  84. package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
  85. package/dist/components/loading-states/LoadingAndErrorComponent.js +6 -2
  86. package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
  87. package/dist/components/loading-states/LoadingAndErrorComponent.mjs +6 -2
  88. package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
  89. package/dist/components/loading-states/LoadingAnimation.js +5 -1
  90. package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
  91. package/dist/components/loading-states/LoadingAnimation.mjs +5 -1
  92. package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
  93. package/dist/components/loading-states/LoadingButton.js +8 -6
  94. package/dist/components/loading-states/LoadingButton.js.map +1 -1
  95. package/dist/components/loading-states/LoadingButton.mjs +8 -6
  96. package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
  97. package/dist/components/modals/ConfirmModal.js +32 -28
  98. package/dist/components/modals/ConfirmModal.js.map +1 -1
  99. package/dist/components/modals/ConfirmModal.mjs +18 -14
  100. package/dist/components/modals/ConfirmModal.mjs.map +1 -1
  101. package/dist/components/modals/DiscardChangesModal.js +28 -24
  102. package/dist/components/modals/DiscardChangesModal.js.map +1 -1
  103. package/dist/components/modals/DiscardChangesModal.mjs +18 -14
  104. package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
  105. package/dist/components/modals/InputModal.js +32 -28
  106. package/dist/components/modals/InputModal.js.map +1 -1
  107. package/dist/components/modals/InputModal.mjs +18 -14
  108. package/dist/components/modals/InputModal.mjs.map +1 -1
  109. package/dist/components/modals/LanguageModal.js +728 -434
  110. package/dist/components/modals/LanguageModal.js.map +1 -1
  111. package/dist/components/modals/LanguageModal.mjs +728 -430
  112. package/dist/components/modals/LanguageModal.mjs.map +1 -1
  113. package/dist/components/modals/ThemeModal.js +732 -438
  114. package/dist/components/modals/ThemeModal.js.map +1 -1
  115. package/dist/components/modals/ThemeModal.mjs +731 -433
  116. package/dist/components/modals/ThemeModal.mjs.map +1 -1
  117. package/dist/components/properties/CheckboxProperty.js +110 -35
  118. package/dist/components/properties/CheckboxProperty.js.map +1 -1
  119. package/dist/components/properties/CheckboxProperty.mjs +110 -35
  120. package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
  121. package/dist/components/properties/DateProperty.js +118 -41
  122. package/dist/components/properties/DateProperty.js.map +1 -1
  123. package/dist/components/properties/DateProperty.mjs +114 -37
  124. package/dist/components/properties/DateProperty.mjs.map +1 -1
  125. package/dist/components/properties/MultiSelectProperty.d.mts +10 -3
  126. package/dist/components/properties/MultiSelectProperty.d.ts +10 -3
  127. package/dist/components/properties/MultiSelectProperty.js +915 -463
  128. package/dist/components/properties/MultiSelectProperty.js.map +1 -1
  129. package/dist/components/properties/MultiSelectProperty.mjs +920 -464
  130. package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
  131. package/dist/components/properties/NumberProperty.js +101 -18
  132. package/dist/components/properties/NumberProperty.js.map +1 -1
  133. package/dist/components/properties/NumberProperty.mjs +101 -18
  134. package/dist/components/properties/NumberProperty.mjs.map +1 -1
  135. package/dist/components/properties/PropertyBase.js +103 -20
  136. package/dist/components/properties/PropertyBase.js.map +1 -1
  137. package/dist/components/properties/PropertyBase.mjs +99 -16
  138. package/dist/components/properties/PropertyBase.mjs.map +1 -1
  139. package/dist/components/properties/SelectProperty.d.mts +9 -2
  140. package/dist/components/properties/SelectProperty.d.ts +9 -2
  141. package/dist/components/properties/SelectProperty.js +682 -243
  142. package/dist/components/properties/SelectProperty.js.map +1 -1
  143. package/dist/components/properties/SelectProperty.mjs +686 -243
  144. package/dist/components/properties/SelectProperty.mjs.map +1 -1
  145. package/dist/components/properties/TextProperty.js +133 -46
  146. package/dist/components/properties/TextProperty.js.map +1 -1
  147. package/dist/components/properties/TextProperty.mjs +133 -46
  148. package/dist/components/properties/TextProperty.mjs.map +1 -1
  149. package/dist/components/table/Table.js +285 -185
  150. package/dist/components/table/Table.js.map +1 -1
  151. package/dist/components/table/Table.mjs +270 -166
  152. package/dist/components/table/Table.mjs.map +1 -1
  153. package/dist/components/table/TableFilterButton.js +179 -78
  154. package/dist/components/table/TableFilterButton.js.map +1 -1
  155. package/dist/components/table/TableFilterButton.mjs +160 -55
  156. package/dist/components/table/TableFilterButton.mjs.map +1 -1
  157. package/dist/components/table/TableSortButton.js +72 -3
  158. package/dist/components/table/TableSortButton.js.map +1 -1
  159. package/dist/components/table/TableSortButton.mjs +72 -3
  160. package/dist/components/table/TableSortButton.mjs.map +1 -1
  161. package/dist/components/user-action/Button.d.mts +15 -2
  162. package/dist/components/user-action/Button.d.ts +15 -2
  163. package/dist/components/user-action/Button.js +12 -12
  164. package/dist/components/user-action/Button.js.map +1 -1
  165. package/dist/components/user-action/Button.mjs +12 -12
  166. package/dist/components/user-action/Button.mjs.map +1 -1
  167. package/dist/components/user-action/Checkbox.js +6 -15
  168. package/dist/components/user-action/Checkbox.js.map +1 -1
  169. package/dist/components/user-action/Checkbox.mjs +6 -15
  170. package/dist/components/user-action/Checkbox.mjs.map +1 -1
  171. package/dist/components/user-action/CopyToClipboardWrapper.js +6 -2
  172. package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
  173. package/dist/components/user-action/CopyToClipboardWrapper.mjs +6 -2
  174. package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
  175. package/dist/components/user-action/DateAndTimePicker.js +79 -48
  176. package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
  177. package/dist/components/user-action/DateAndTimePicker.mjs +65 -34
  178. package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
  179. package/dist/components/user-action/Menu.d.mts +11 -6
  180. package/dist/components/user-action/Menu.d.ts +11 -6
  181. package/dist/components/user-action/Menu.js +128 -31
  182. package/dist/components/user-action/Menu.js.map +1 -1
  183. package/dist/components/user-action/Menu.mjs +134 -33
  184. package/dist/components/user-action/Menu.mjs.map +1 -1
  185. package/dist/components/user-action/MultiSelect.d.mts +17 -7
  186. package/dist/components/user-action/MultiSelect.d.ts +17 -7
  187. package/dist/components/user-action/MultiSelect.js +796 -375
  188. package/dist/components/user-action/MultiSelect.js.map +1 -1
  189. package/dist/components/user-action/MultiSelect.mjs +781 -356
  190. package/dist/components/user-action/MultiSelect.mjs.map +1 -1
  191. package/dist/components/user-action/ScrollPicker.js +2 -2
  192. package/dist/components/user-action/ScrollPicker.js.map +1 -1
  193. package/dist/components/user-action/ScrollPicker.mjs +2 -2
  194. package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
  195. package/dist/components/user-action/SearchBar.d.mts +14 -0
  196. package/dist/components/user-action/SearchBar.d.ts +14 -0
  197. package/dist/components/user-action/SearchBar.js +673 -0
  198. package/dist/components/user-action/SearchBar.js.map +1 -0
  199. package/dist/components/user-action/SearchBar.mjs +637 -0
  200. package/dist/components/user-action/SearchBar.mjs.map +1 -0
  201. package/dist/components/user-action/Select.d.mts +18 -5
  202. package/dist/components/user-action/Select.d.ts +18 -5
  203. package/dist/components/user-action/Select.js +764 -355
  204. package/dist/components/user-action/Select.js.map +1 -1
  205. package/dist/components/user-action/Select.mjs +761 -349
  206. package/dist/components/user-action/Select.mjs.map +1 -1
  207. package/dist/components/user-action/Textarea.d.mts +1 -1
  208. package/dist/components/user-action/Textarea.d.ts +1 -1
  209. package/dist/components/user-action/Textarea.js +13 -3
  210. package/dist/components/user-action/Textarea.js.map +1 -1
  211. package/dist/components/user-action/Textarea.mjs +13 -3
  212. package/dist/components/user-action/Textarea.mjs.map +1 -1
  213. package/dist/components/user-action/ToggleableInput.js +2 -2
  214. package/dist/components/user-action/ToggleableInput.js.map +1 -1
  215. package/dist/components/user-action/ToggleableInput.mjs +2 -2
  216. package/dist/components/user-action/ToggleableInput.mjs.map +1 -1
  217. package/dist/css/globals.css +251 -113
  218. package/dist/css/uncompiled/globals.css +19 -13
  219. package/dist/css/uncompiled/theme/colors-component.css +12 -3
  220. package/dist/css/uncompiled/theme/colors-semantic.css +10 -7
  221. package/dist/css/uncompiled/utitlity/animation.css +70 -1
  222. package/dist/css/uncompiled/utitlity/general.css +16 -0
  223. package/dist/hooks/usePopoverPosition.d.mts +15 -0
  224. package/dist/hooks/usePopoverPosition.d.ts +15 -0
  225. package/dist/hooks/usePopoverPosition.js +81 -0
  226. package/dist/hooks/usePopoverPosition.js.map +1 -0
  227. package/dist/hooks/usePopoverPosition.mjs +57 -0
  228. package/dist/hooks/usePopoverPosition.mjs.map +1 -0
  229. package/dist/hooks/useSearch.d.mts +7 -2
  230. package/dist/hooks/useSearch.d.ts +7 -2
  231. package/dist/hooks/useSearch.js +44 -15
  232. package/dist/hooks/useSearch.js.map +1 -1
  233. package/dist/hooks/useSearch.mjs +45 -16
  234. package/dist/hooks/useSearch.mjs.map +1 -1
  235. package/dist/index.d.mts +6 -4
  236. package/dist/index.d.ts +6 -4
  237. package/dist/index.js +1102 -819
  238. package/dist/index.js.map +1 -1
  239. package/dist/index.mjs +1001 -718
  240. package/dist/index.mjs.map +1 -1
  241. package/dist/localization/defaults/form.d.mts +2 -0
  242. package/dist/localization/defaults/form.d.ts +2 -0
  243. package/dist/localization/defaults/form.js +4 -0
  244. package/dist/localization/defaults/form.js.map +1 -1
  245. package/dist/localization/defaults/form.mjs +4 -0
  246. package/dist/localization/defaults/form.mjs.map +1 -1
  247. package/dist/util/simpleSearch.d.mts +1 -1
  248. package/dist/util/simpleSearch.d.ts +1 -1
  249. package/dist/util/simpleSearch.js +4 -1
  250. package/dist/util/simpleSearch.js.map +1 -1
  251. package/dist/util/simpleSearch.mjs +4 -1
  252. package/dist/util/simpleSearch.mjs.map +1 -1
  253. package/package.json +1 -1
@@ -33,8 +33,8 @@ __export(MultiSelect_exports, {
33
33
  MultiSelectUncontrolled: () => MultiSelectUncontrolled
34
34
  });
35
35
  module.exports = __toCommonJS(MultiSelect_exports);
36
- var import_react9 = require("react");
37
- var import_lucide_react3 = require("lucide-react");
36
+ var import_react16 = require("react");
37
+ var import_react17 = require("react");
38
38
 
39
39
  // src/localization/LanguageProvider.tsx
40
40
  var import_react2 = require("react");
@@ -124,7 +124,7 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
124
124
  };
125
125
 
126
126
  // src/components/user-action/MultiSelect.tsx
127
- var import_clsx7 = __toESM(require("clsx"));
127
+ var import_clsx11 = __toESM(require("clsx"));
128
128
 
129
129
  // src/components/user-action/Label.tsx
130
130
  var import_clsx = __toESM(require("clsx"));
@@ -144,22 +144,389 @@ var Label = ({
144
144
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
145
145
  };
146
146
 
147
- // src/components/layout-and-navigation/SearchableList.tsx
147
+ // src/components/user-action/Select.tsx
148
+ var import_react13 = require("react");
149
+ var import_react14 = require("react");
150
+ var import_clsx8 = __toESM(require("clsx"));
151
+
152
+ // src/components/layout-and-navigation/Tile.tsx
153
+ var import_clsx2 = __toESM(require("clsx"));
148
154
  var import_lucide_react = require("lucide-react");
155
+ var import_jsx_runtime3 = require("react/jsx-runtime");
156
+ var Tile = ({
157
+ title,
158
+ description,
159
+ onClick,
160
+ isSelected = false,
161
+ disabled = false,
162
+ prefix,
163
+ suffix,
164
+ normalClassName = "hover:bg-primary/40 cursor-pointer",
165
+ selectedClassName = " bg-primary/20",
166
+ disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
167
+ className
168
+ }) => {
169
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
170
+ "div",
171
+ {
172
+ className: (0, import_clsx2.default)(
173
+ "flex-row-2 w-full items-center",
174
+ {
175
+ [normalClassName]: !!onClick && !disabled,
176
+ [selectedClassName]: isSelected && !disabled,
177
+ [disabledClassName]: disabled
178
+ },
179
+ className
180
+ ),
181
+ onClick: disabled ? void 0 : onClick,
182
+ children: [
183
+ prefix,
184
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex-col-0 w-full", children: [
185
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h4", { className: (0, import_clsx2.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
186
+ !!description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: (0, import_clsx2.default)(description.className ?? "textstyle-description"), children: description.value })
187
+ ] }),
188
+ suffix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Check, { size: 24 }) : void 0)
189
+ ]
190
+ }
191
+ );
192
+ };
193
+
194
+ // src/components/layout-and-navigation/Expandable.tsx
195
+ var import_react3 = require("react");
196
+ var import_lucide_react2 = require("lucide-react");
197
+ var import_clsx3 = __toESM(require("clsx"));
198
+
199
+ // src/util/noop.ts
200
+ var noop = () => void 0;
201
+
202
+ // src/components/layout-and-navigation/Expandable.tsx
203
+ var import_jsx_runtime4 = require("react/jsx-runtime");
204
+ var ExpansionIcon = ({ isExpanded, className }) => {
205
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
206
+ import_lucide_react2.ChevronDown,
207
+ {
208
+ className: (0, import_clsx3.default)(
209
+ "min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
210
+ { "rotate-180": isExpanded },
211
+ className
212
+ )
213
+ }
214
+ );
215
+ };
216
+ var Expandable = (0, import_react3.forwardRef)(function Expandable2({
217
+ children,
218
+ label,
219
+ icon,
220
+ isExpanded = false,
221
+ onChange = noop,
222
+ clickOnlyOnHeader = true,
223
+ disabled = false,
224
+ className,
225
+ headerClassName,
226
+ contentClassName
227
+ }, ref) {
228
+ const defaultIcon = (0, import_react3.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
229
+ icon ??= defaultIcon;
230
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
231
+ "div",
232
+ {
233
+ ref,
234
+ className: (0, import_clsx3.default)("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
235
+ onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
236
+ children: [
237
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
238
+ "div",
239
+ {
240
+ className: (0, import_clsx3.default)(
241
+ "flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
242
+ {
243
+ "group-hover:brightness-97": !isExpanded,
244
+ "hover:brightness-97": isExpanded && !disabled,
245
+ "cursor-pointer": clickOnlyOnHeader && !disabled
246
+ },
247
+ headerClassName
248
+ ),
249
+ onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
250
+ children: [
251
+ label,
252
+ icon(isExpanded)
253
+ ]
254
+ }
255
+ ),
256
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
257
+ "div",
258
+ {
259
+ className: (0, import_clsx3.default)(
260
+ "flex-col-2 px-4 transition-all duration-300 ease-in-out",
261
+ {
262
+ "max-h-96 opacity-100 pb-2": isExpanded,
263
+ "max-h-0 opacity-0 overflow-hidden": !isExpanded
264
+ },
265
+ contentClassName
266
+ ),
267
+ children
268
+ }
269
+ )
270
+ ]
271
+ }
272
+ );
273
+ });
274
+ var ExpandableUncontrolled = (0, import_react3.forwardRef)(function ExpandableUncontrolled2({
275
+ isExpanded,
276
+ onChange = noop,
277
+ ...props
278
+ }, ref) {
279
+ const [usedIsExpanded, setUsedIsExpanded] = (0, import_react3.useState)(isExpanded);
280
+ (0, import_react3.useEffect)(() => {
281
+ setUsedIsExpanded(isExpanded);
282
+ }, [isExpanded]);
283
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
284
+ Expandable,
285
+ {
286
+ ...props,
287
+ ref,
288
+ isExpanded: usedIsExpanded,
289
+ onChange: (value) => {
290
+ onChange(value);
291
+ setUsedIsExpanded(value);
292
+ }
293
+ }
294
+ );
295
+ });
296
+
297
+ // src/components/user-action/Menu.tsx
298
+ var import_react6 = require("react");
149
299
  var import_clsx4 = __toESM(require("clsx"));
150
300
 
301
+ // src/hooks/useOutsideClick.ts
302
+ var import_react4 = require("react");
303
+ var useOutsideClick = (refs, handler) => {
304
+ (0, import_react4.useEffect)(() => {
305
+ const listener = (event) => {
306
+ if (event.target === null) return;
307
+ if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
308
+ return;
309
+ }
310
+ handler();
311
+ };
312
+ document.addEventListener("mousedown", listener);
313
+ document.addEventListener("touchstart", listener);
314
+ return () => {
315
+ document.removeEventListener("mousedown", listener);
316
+ document.removeEventListener("touchstart", listener);
317
+ };
318
+ }, [refs, handler]);
319
+ };
320
+
321
+ // src/hooks/useHoverState.ts
322
+ var import_react5 = require("react");
323
+ var defaultUseHoverStateProps = {
324
+ closingDelay: 200,
325
+ isDisabled: false
326
+ };
327
+ var useHoverState = (props = void 0) => {
328
+ const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
329
+ const [isHovered, setIsHovered] = (0, import_react5.useState)(false);
330
+ const [timer, setTimer] = (0, import_react5.useState)();
331
+ const onMouseEnter = () => {
332
+ if (isDisabled) {
333
+ return;
334
+ }
335
+ clearTimeout(timer);
336
+ setIsHovered(true);
337
+ };
338
+ const onMouseLeave = () => {
339
+ if (isDisabled) {
340
+ return;
341
+ }
342
+ setTimer(setTimeout(() => {
343
+ setIsHovered(false);
344
+ }, closingDelay));
345
+ };
346
+ (0, import_react5.useEffect)(() => {
347
+ if (timer) {
348
+ return () => {
349
+ clearTimeout(timer);
350
+ };
351
+ }
352
+ });
353
+ (0, import_react5.useEffect)(() => {
354
+ if (timer) {
355
+ clearTimeout(timer);
356
+ }
357
+ }, [isDisabled]);
358
+ return {
359
+ isHovered,
360
+ setIsHovered,
361
+ handlers: { onMouseEnter, onMouseLeave }
362
+ };
363
+ };
364
+
365
+ // src/util/PropsWithFunctionChildren.ts
366
+ var resolve = (children, bag) => {
367
+ if (typeof children === "function") {
368
+ return children(bag);
369
+ }
370
+ return children ?? void 0;
371
+ };
372
+ var BagFunctionUtil = {
373
+ resolve
374
+ };
375
+
376
+ // src/hooks/usePopoverPosition.ts
377
+ var defaultPopoverPositionOptions = {
378
+ edgePadding: 16,
379
+ outerGap: 4,
380
+ horizontalAlignment: "leftInside",
381
+ verticalAlignment: "bottomOutside",
382
+ disabled: false
383
+ };
384
+ var usePopoverPosition = (trigger, options) => {
385
+ const {
386
+ edgePadding,
387
+ outerGap,
388
+ verticalAlignment,
389
+ horizontalAlignment,
390
+ disabled
391
+ } = { ...defaultPopoverPositionOptions, ...options };
392
+ if (disabled || !trigger) {
393
+ return {};
394
+ }
395
+ const left = {
396
+ leftOutside: trigger.left - outerGap,
397
+ leftInside: trigger.left,
398
+ rightOutside: trigger.right + outerGap,
399
+ rightInside: trigger.right,
400
+ center: trigger.left + trigger.width / 2
401
+ }[horizontalAlignment];
402
+ const top = {
403
+ topOutside: trigger.top - outerGap,
404
+ topInside: trigger.top,
405
+ bottomOutside: trigger.bottom + outerGap,
406
+ bottomInside: trigger.bottom,
407
+ center: trigger.top + trigger.height / 2
408
+ }[verticalAlignment];
409
+ const translateX = {
410
+ leftOutside: "-100%",
411
+ leftInside: void 0,
412
+ rightOutside: void 0,
413
+ rightInside: "-100%",
414
+ center: "-50%"
415
+ }[horizontalAlignment];
416
+ const translateY = {
417
+ topOutside: "-100%",
418
+ topInside: void 0,
419
+ bottomOutside: void 0,
420
+ bottomInside: "-100%",
421
+ center: "-50%"
422
+ }[verticalAlignment];
423
+ return {
424
+ left: Math.max(left, edgePadding),
425
+ top: Math.max(top, edgePadding),
426
+ translate: [translateX ?? "0", translateY ?? "0"].join(" ")
427
+ };
428
+ };
429
+
430
+ // src/components/user-action/Menu.tsx
431
+ var import_react_dom = require("react-dom");
432
+ var import_jsx_runtime5 = require("react/jsx-runtime");
433
+ function getScrollableParents(element) {
434
+ const scrollables = [];
435
+ let parent = element.parentElement;
436
+ while (parent) {
437
+ scrollables.push(parent);
438
+ parent = parent.parentElement;
439
+ }
440
+ return scrollables;
441
+ }
442
+ var Menu = ({
443
+ trigger,
444
+ children,
445
+ alignmentHorizontal = "leftInside",
446
+ alignmentVertical = "bottomOutside",
447
+ showOnHover = false,
448
+ disabled = false,
449
+ menuClassName = ""
450
+ }) => {
451
+ const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
452
+ const triggerRef = (0, import_react6.useRef)(null);
453
+ const menuRef = (0, import_react6.useRef)(null);
454
+ useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
455
+ const [isHidden, setIsHidden] = (0, import_react6.useState)(true);
456
+ const bag = {
457
+ isOpen,
458
+ close: () => setIsOpen(false),
459
+ toggleOpen: () => setIsOpen((prevState) => !prevState),
460
+ disabled
461
+ };
462
+ const menuPosition = usePopoverPosition(
463
+ triggerRef.current?.getBoundingClientRect(),
464
+ { verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
465
+ );
466
+ (0, import_react6.useEffect)(() => {
467
+ if (!isOpen) return;
468
+ const triggerEl = triggerRef.current;
469
+ if (!triggerEl) return;
470
+ const scrollableParents = getScrollableParents(triggerEl);
471
+ const close = () => setIsOpen(false);
472
+ scrollableParents.forEach((parent) => {
473
+ parent.addEventListener("scroll", close);
474
+ });
475
+ window.addEventListener("resize", close);
476
+ return () => {
477
+ scrollableParents.forEach((parent) => {
478
+ parent.removeEventListener("scroll", close);
479
+ });
480
+ window.removeEventListener("resize", close);
481
+ };
482
+ }, [isOpen, setIsOpen]);
483
+ (0, import_react6.useEffect)(() => {
484
+ if (isOpen) {
485
+ setIsHidden(false);
486
+ }
487
+ }, [isOpen]);
488
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
489
+ trigger(bag, triggerRef),
490
+ (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
491
+ "div",
492
+ {
493
+ ref: menuRef,
494
+ onClick: (e) => e.stopPropagation(),
495
+ className: (0, import_clsx4.default)(
496
+ "absolute rounded-md bg-menu-background text-menu-text shadow-around-lg z-10",
497
+ {
498
+ "animate-pop-in": isOpen,
499
+ "animate-pop-out": !isOpen,
500
+ "hidden": isHidden
501
+ },
502
+ menuClassName
503
+ ),
504
+ onAnimationEnd: () => {
505
+ if (!isOpen) {
506
+ setIsHidden(true);
507
+ }
508
+ },
509
+ style: {
510
+ ...menuPosition
511
+ },
512
+ children: BagFunctionUtil.resolve(children, bag)
513
+ }
514
+ ), document.body)
515
+ ] });
516
+ };
517
+
151
518
  // src/components/user-action/Input.tsx
152
- var import_react6 = require("react");
153
- var import_clsx2 = __toESM(require("clsx"));
519
+ var import_react10 = require("react");
520
+ var import_clsx5 = __toESM(require("clsx"));
154
521
 
155
522
  // src/hooks/useDelay.ts
156
- var import_react3 = require("react");
523
+ var import_react7 = require("react");
157
524
  var defaultOptions = {
158
525
  delay: 3e3,
159
526
  disabled: false
160
527
  };
161
528
  function useDelay(options) {
162
- const [timer, setTimer] = (0, import_react3.useState)(void 0);
529
+ const [timer, setTimer] = (0, import_react7.useState)(void 0);
163
530
  const { delay, disabled } = {
164
531
  ...defaultOptions,
165
532
  ...options
@@ -178,12 +545,12 @@ function useDelay(options) {
178
545
  setTimer(void 0);
179
546
  }, delay));
180
547
  };
181
- (0, import_react3.useEffect)(() => {
548
+ (0, import_react7.useEffect)(() => {
182
549
  return () => {
183
550
  clearTimeout(timer);
184
551
  };
185
552
  }, [timer]);
186
- (0, import_react3.useEffect)(() => {
553
+ (0, import_react7.useEffect)(() => {
187
554
  if (disabled) {
188
555
  clearTimeout(timer);
189
556
  setTimer(void 0);
@@ -192,13 +559,10 @@ function useDelay(options) {
192
559
  return { restartTimer, clearTimer, hasActiveTimer: !!timer };
193
560
  }
194
561
 
195
- // src/util/noop.ts
196
- var noop = () => void 0;
197
-
198
562
  // src/hooks/useFocusManagement.ts
199
- var import_react4 = require("react");
563
+ var import_react8 = require("react");
200
564
  function useFocusManagement() {
201
- const getFocusableElements = (0, import_react4.useCallback)(() => {
565
+ const getFocusableElements = (0, import_react8.useCallback)(() => {
202
566
  return Array.from(
203
567
  document.querySelectorAll(
204
568
  'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
@@ -207,7 +571,7 @@ function useFocusManagement() {
207
571
  (el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
208
572
  );
209
573
  }, []);
210
- const getNextFocusElement = (0, import_react4.useCallback)(() => {
574
+ const getNextFocusElement = (0, import_react8.useCallback)(() => {
211
575
  const elements = getFocusableElements();
212
576
  if (elements.length === 0) {
213
577
  return void 0;
@@ -219,11 +583,11 @@ function useFocusManagement() {
219
583
  }
220
584
  return nextElement;
221
585
  }, [getFocusableElements]);
222
- const focusNext = (0, import_react4.useCallback)(() => {
586
+ const focusNext = (0, import_react8.useCallback)(() => {
223
587
  const nextElement = getNextFocusElement();
224
588
  nextElement?.focus();
225
589
  }, [getNextFocusElement]);
226
- const getPreviousFocusElement = (0, import_react4.useCallback)(() => {
590
+ const getPreviousFocusElement = (0, import_react8.useCallback)(() => {
227
591
  const elements = getFocusableElements();
228
592
  if (elements.length === 0) {
229
593
  return void 0;
@@ -239,7 +603,7 @@ function useFocusManagement() {
239
603
  }
240
604
  return previousElement;
241
605
  }, [getFocusableElements]);
242
- const focusPrevious = (0, import_react4.useCallback)(() => {
606
+ const focusPrevious = (0, import_react8.useCallback)(() => {
243
607
  const previousElement = getPreviousFocusElement();
244
608
  if (previousElement) previousElement.focus();
245
609
  }, [getPreviousFocusElement]);
@@ -253,10 +617,10 @@ function useFocusManagement() {
253
617
  }
254
618
 
255
619
  // src/hooks/useFocusOnceVisible.ts
256
- var import_react5 = __toESM(require("react"));
620
+ var import_react9 = __toESM(require("react"));
257
621
  var useFocusOnceVisible = (ref, disable = false) => {
258
- const [hasUsedFocus, setHasUsedFocus] = import_react5.default.useState(false);
259
- (0, import_react5.useEffect)(() => {
622
+ const [hasUsedFocus, setHasUsedFocus] = import_react9.default.useState(false);
623
+ (0, import_react9.useEffect)(() => {
260
624
  if (disable || hasUsedFocus) {
261
625
  return;
262
626
  }
@@ -276,9 +640,9 @@ var useFocusOnceVisible = (ref, disable = false) => {
276
640
  };
277
641
 
278
642
  // src/components/user-action/Input.tsx
279
- var import_jsx_runtime3 = require("react/jsx-runtime");
643
+ var import_jsx_runtime6 = require("react/jsx-runtime");
280
644
  var getInputClassName = ({ disabled = false, hasError = false }) => {
281
- return (0, import_clsx2.default)(
645
+ return (0, import_clsx5.default)(
282
646
  "px-2 py-1.5 rounded-md border-2",
283
647
  {
284
648
  "bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
@@ -292,7 +656,7 @@ var defaultEditCompleteOptions = {
292
656
  afterDelay: true,
293
657
  delay: 2500
294
658
  };
295
- var Input = (0, import_react6.forwardRef)(function Input2({
659
+ var Input = (0, import_react10.forwardRef)(function Input2({
296
660
  id,
297
661
  type = "text",
298
662
  value,
@@ -315,10 +679,10 @@ var Input = (0, import_react6.forwardRef)(function Input2({
315
679
  restartTimer,
316
680
  clearTimer
317
681
  } = useDelay({ delay, disabled: !afterDelay });
318
- const innerRef = (0, import_react6.useRef)(null);
682
+ const innerRef = (0, import_react10.useRef)(null);
319
683
  const { focusNext } = useFocusManagement();
320
684
  useFocusOnceVisible(innerRef, !autoFocus);
321
- (0, import_react6.useImperativeHandle)(forwardedRef, () => innerRef.current);
685
+ (0, import_react10.useImperativeHandle)(forwardedRef, () => innerRef.current);
322
686
  const handleKeyDown = (e) => {
323
687
  if (e.key === "Enter" && !e.shiftKey) {
324
688
  e.preventDefault();
@@ -326,9 +690,9 @@ var Input = (0, import_react6.forwardRef)(function Input2({
326
690
  focusNext();
327
691
  }
328
692
  };
329
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)({ "w-full": expanded }, containerClassName), children: [
330
- label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx2.default)("mb-1", label.className) }),
331
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
693
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)({ "w-full": expanded }, containerClassName), children: [
694
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx5.default)("mb-1", label.className) }),
695
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
332
696
  "input",
333
697
  {
334
698
  ...restProps,
@@ -337,7 +701,7 @@ var Input = (0, import_react6.forwardRef)(function Input2({
337
701
  id,
338
702
  type,
339
703
  disabled,
340
- className: (0, import_clsx2.default)(getInputClassName({ disabled }), className),
704
+ className: (0, import_clsx5.default)(getInputClassName({ disabled }), className),
341
705
  onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
342
706
  onBlur: (event) => {
343
707
  onBlur?.(event);
@@ -367,7 +731,7 @@ var Input = (0, import_react6.forwardRef)(function Input2({
367
731
  )
368
732
  ] });
369
733
  });
370
- var FormInput = (0, import_react6.forwardRef)(function FormInput2({
734
+ var FormInput = (0, import_react10.forwardRef)(function FormInput2({
371
735
  id,
372
736
  labelText,
373
737
  errorText,
@@ -379,206 +743,33 @@ var FormInput = (0, import_react6.forwardRef)(function FormInput2({
379
743
  disabled,
380
744
  ...restProps
381
745
  }, ref) {
382
- const input = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
746
+ const input = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
383
747
  "input",
384
748
  {
385
749
  ...restProps,
386
750
  ref,
387
751
  id,
388
752
  disabled,
389
- className: (0, import_clsx2.default)(
753
+ className: (0, import_clsx5.default)(
390
754
  getInputClassName({ disabled, hasError: !!errorText }),
391
755
  className
392
756
  )
393
757
  }
394
758
  );
395
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)("flex flex-col gap-y-1", containerClassName), children: [
396
- labelText && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { htmlFor: id, className: (0, import_clsx2.default)("textstyle-label-md", labelClassName), children: [
759
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)("flex flex-col gap-y-1", containerClassName), children: [
760
+ labelText && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { htmlFor: id, className: (0, import_clsx5.default)("textstyle-label-md", labelClassName), children: [
397
761
  labelText,
398
- required && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-primary font-bold", children: "*" })
762
+ required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-primary font-bold", children: "*" })
399
763
  ] }),
400
764
  input,
401
- errorText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: id, className: (0, import_clsx2.default)("text-negative", errorClassName), children: errorText })
765
+ errorText && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: id, className: (0, import_clsx5.default)("text-negative", errorClassName), children: errorText })
402
766
  ] });
403
767
  });
404
768
 
405
- // src/components/user-action/Button.tsx
406
- var import_clsx3 = __toESM(require("clsx"));
407
- var import_jsx_runtime4 = require("react/jsx-runtime");
408
- var ButtonColorUtil = {
409
- solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
410
- text: ["primary", "negative", "neutral"],
411
- outline: ["primary"]
412
- };
413
- var IconButtonUtil = {
414
- icon: [...ButtonColorUtil.solid, "transparent"]
415
- };
416
- var paddingMapping = {
417
- small: "btn-sm",
418
- medium: "btn-md",
419
- large: "btn-lg"
420
- };
421
- var iconPaddingMapping = {
422
- tiny: "icon-btn-xs",
423
- small: "icon-btn-sm",
424
- medium: "icon-btn-md",
425
- large: "icon-btn-lg"
426
- };
427
- var ButtonUtil = {
428
- paddingMapping,
429
- iconPaddingMapping
430
- };
431
- var SolidButton = ({
432
- children,
433
- disabled = false,
434
- color = "primary",
435
- size = "medium",
436
- startIcon,
437
- endIcon,
438
- onClick,
439
- className,
440
- ...restProps
441
- }) => {
442
- const colorClasses = {
443
- primary: "bg-button-solid-primary-background text-button-solid-primary-text",
444
- secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
445
- tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
446
- positive: "bg-button-solid-positive-background text-button-solid-positive-text",
447
- warning: "bg-button-solid-warning-background text-button-solid-warning-text",
448
- negative: "bg-button-solid-negative-background text-button-solid-negative-text",
449
- neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
450
- }[color];
451
- const iconColorClasses = {
452
- primary: "text-button-solid-primary-icon",
453
- secondary: "text-button-solid-secondary-icon",
454
- tertiary: "text-button-solid-tertiary-icon",
455
- positive: "text-button-solid-positive-icon",
456
- warning: "text-button-solid-warning-icon",
457
- negative: "text-button-solid-negative-icon",
458
- neutral: "text-button-solid-neutral-icon"
459
- }[color];
460
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
461
- "button",
462
- {
463
- onClick: disabled ? void 0 : onClick,
464
- disabled: disabled || onClick === void 0,
465
- className: (0, import_clsx3.default)(
466
- {
467
- "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
468
- [(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
469
- },
470
- ButtonUtil.paddingMapping[size],
471
- className
472
- ),
473
- ...restProps,
474
- children: [
475
- startIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
476
- "span",
477
- {
478
- className: (0, import_clsx3.default)({
479
- [iconColorClasses]: !disabled,
480
- [`text-disabled-icon`]: disabled
481
- }),
482
- children: startIcon
483
- }
484
- ),
485
- children,
486
- endIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
487
- "span",
488
- {
489
- className: (0, import_clsx3.default)({
490
- [iconColorClasses]: !disabled,
491
- [`text-disabled-icon`]: disabled
492
- }),
493
- children: endIcon
494
- }
495
- )
496
- ]
497
- }
498
- );
499
- };
500
- var IconButton = ({
501
- children,
502
- disabled = false,
503
- color = "primary",
504
- size = "medium",
505
- onClick,
506
- className,
507
- ...restProps
508
- }) => {
509
- const colorClasses = {
510
- primary: "bg-button-solid-primary-background text-button-solid-primary-text",
511
- secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
512
- tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
513
- positive: "bg-button-solid-positive-background text-button-solid-positive-text",
514
- warning: "bg-button-solid-warning-background text-button-solid-warning-text",
515
- negative: "bg-button-solid-negative-background text-button-solid-negative-text",
516
- neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
517
- transparent: "bg-transparent"
518
- }[color];
519
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
520
- "button",
521
- {
522
- onClick: disabled ? void 0 : onClick,
523
- disabled: disabled || onClick === void 0,
524
- className: (0, import_clsx3.default)(
525
- {
526
- "text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
527
- "text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
528
- "hover:bg-button-text-hover-background": !disabled && color === "transparent",
529
- [(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
530
- },
531
- ButtonUtil.iconPaddingMapping[size],
532
- className
533
- ),
534
- ...restProps,
535
- children
536
- }
537
- );
538
- };
539
-
540
- // src/hooks/useSearch.ts
541
- var import_react7 = require("react");
542
-
543
- // src/util/simpleSearch.ts
544
- var MultiSearchWithMapping = (search, objects, mapping) => {
545
- return objects.filter((object) => {
546
- const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
547
- if (!mappedSearchKeywords) {
548
- return true;
549
- }
550
- return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
551
- });
552
- };
553
-
554
- // src/hooks/useSearch.ts
555
- var useSearch = ({
556
- list,
557
- initialSearch,
558
- searchMapping
559
- }) => {
560
- const [items, setItems] = (0, import_react7.useState)(list);
561
- const [search, setSearch] = (0, import_react7.useState)(initialSearch);
562
- (0, import_react7.useEffect)(() => {
563
- setItems(list);
564
- }, [list]);
565
- const result = (0, import_react7.useMemo)(
566
- () => MultiSearchWithMapping(search, items, searchMapping),
567
- [search, items, searchMapping]
568
- );
569
- return {
570
- result,
571
- hasResult: result.length > 0,
572
- allItems: items,
573
- setItems,
574
- search,
575
- setSearch
576
- };
577
- };
578
-
579
769
  // src/localization/defaults/form.ts
580
770
  var formTranslation = {
581
771
  en: {
772
+ add: "Add",
582
773
  all: "All",
583
774
  apply: "Apply",
584
775
  back: "Back",
@@ -591,6 +782,7 @@ var formTranslation = {
591
782
  confirm: "Confirm",
592
783
  copy: "Copy",
593
784
  copied: "Copied",
785
+ create: "Create",
594
786
  decline: "Decline",
595
787
  delete: "Delete",
596
788
  discard: "Discard",
@@ -633,6 +825,7 @@ var formTranslation = {
633
825
  yes: "Yes"
634
826
  },
635
827
  de: {
828
+ add: "Hinzuf\xFCgen",
636
829
  all: "Alle",
637
830
  apply: "Anwenden",
638
831
  back: "Zur\xFCck",
@@ -645,6 +838,7 @@ var formTranslation = {
645
838
  confirm: "Best\xE4tigen",
646
839
  copy: "Kopieren",
647
840
  copied: "Kopiert",
841
+ create: "Erstellen",
648
842
  decline: "Ablehnen",
649
843
  delete: "L\xF6schen",
650
844
  discard: "Verwerfen",
@@ -688,92 +882,255 @@ var formTranslation = {
688
882
  }
689
883
  };
690
884
 
691
- // src/components/layout-and-navigation/SearchableList.tsx
692
- var import_jsx_runtime5 = require("react/jsx-runtime");
693
- var defaultSearchableListTranslation = {
694
- en: {
695
- nothingFound: "Nothing found"
696
- },
697
- de: {
698
- nothingFound: "Nichts gefunden"
699
- }
885
+ // src/components/user-action/Button.tsx
886
+ var import_react11 = require("react");
887
+ var import_clsx6 = __toESM(require("clsx"));
888
+ var import_jsx_runtime7 = require("react/jsx-runtime");
889
+ var ButtonColorUtil = {
890
+ solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
891
+ text: ["primary", "negative", "neutral"],
892
+ outline: ["primary"]
700
893
  };
701
- var SearchableList = ({
702
- overwriteTranslation,
703
- list,
704
- initialSearch = "",
705
- searchMapping,
706
- autoFocus,
707
- minimumItemsForSearch = 6,
708
- itemMapper,
894
+ var IconButtonUtil = {
895
+ icon: [...ButtonColorUtil.solid, "transparent"]
896
+ };
897
+ var paddingMapping = {
898
+ small: "btn-sm",
899
+ medium: "btn-md",
900
+ large: "btn-lg"
901
+ };
902
+ var iconPaddingMapping = {
903
+ tiny: "icon-btn-xs",
904
+ small: "icon-btn-sm",
905
+ medium: "icon-btn-md",
906
+ large: "icon-btn-lg"
907
+ };
908
+ var ButtonUtil = {
909
+ paddingMapping,
910
+ iconPaddingMapping
911
+ };
912
+ var SolidButton = (0, import_react11.forwardRef)(function SolidButton2({
913
+ children,
914
+ disabled = false,
915
+ color = "primary",
916
+ size = "medium",
917
+ startIcon,
918
+ endIcon,
919
+ onClick,
709
920
  className,
710
- resultListClassName
921
+ ...restProps
922
+ }, ref) {
923
+ const colorClasses = {
924
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
925
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
926
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
927
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
928
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
929
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
930
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
931
+ }[color];
932
+ const iconColorClasses = {
933
+ primary: "text-button-solid-primary-icon",
934
+ secondary: "text-button-solid-secondary-icon",
935
+ tertiary: "text-button-solid-tertiary-icon",
936
+ positive: "text-button-solid-positive-icon",
937
+ warning: "text-button-solid-warning-icon",
938
+ negative: "text-button-solid-negative-icon",
939
+ neutral: "text-button-solid-neutral-icon"
940
+ }[color];
941
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
942
+ "button",
943
+ {
944
+ ref,
945
+ onClick,
946
+ disabled,
947
+ className: (0, import_clsx6.default)(
948
+ {
949
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
950
+ [(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
951
+ },
952
+ ButtonUtil.paddingMapping[size],
953
+ className
954
+ ),
955
+ ...restProps,
956
+ children: [
957
+ startIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
958
+ "span",
959
+ {
960
+ className: (0, import_clsx6.default)({
961
+ [iconColorClasses]: !disabled,
962
+ [`text-disabled-icon`]: disabled
963
+ }),
964
+ children: startIcon
965
+ }
966
+ ),
967
+ children,
968
+ endIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
969
+ "span",
970
+ {
971
+ className: (0, import_clsx6.default)({
972
+ [iconColorClasses]: !disabled,
973
+ [`text-disabled-icon`]: disabled
974
+ }),
975
+ children: endIcon
976
+ }
977
+ )
978
+ ]
979
+ }
980
+ );
981
+ });
982
+ var IconButton = ({
983
+ children,
984
+ disabled = false,
985
+ color = "primary",
986
+ size = "medium",
987
+ className,
988
+ ...restProps
711
989
  }) => {
712
- const translation = useTranslation([defaultSearchableListTranslation, formTranslation], overwriteTranslation);
713
- const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
714
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("col gap-y-2", className), children: [
715
- list.length > minimumItemsForSearch && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "row justify-between gap-x-4 items-center", children: [
716
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
717
- Input,
990
+ const colorClasses = {
991
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
992
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
993
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
994
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
995
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
996
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
997
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
998
+ transparent: "bg-transparent"
999
+ }[color];
1000
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1001
+ "button",
1002
+ {
1003
+ disabled,
1004
+ className: (0, import_clsx6.default)(
718
1005
  {
719
- value: search,
720
- onChangeText: setSearch,
721
- placeholder: translation("search"),
722
- autoFocus,
723
- className: "w-full"
724
- }
1006
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
1007
+ "text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
1008
+ "hover:bg-button-text-hover-background": !disabled && color === "transparent",
1009
+ [(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
1010
+ },
1011
+ ButtonUtil.iconPaddingMapping[size],
1012
+ className
725
1013
  ),
726
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconButton, { color: "neutral", disabled: search.length === 0, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Search, { className: "w-full h-full" }) })
727
- ] }),
728
- hasResult ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_clsx4.default)("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "row text-description py-2 px-2", children: translation("nothingFound") })
1014
+ ...restProps,
1015
+ children
1016
+ }
1017
+ );
1018
+ };
1019
+
1020
+ // src/components/user-action/SearchBar.tsx
1021
+ var import_lucide_react3 = require("lucide-react");
1022
+ var import_clsx7 = require("clsx");
1023
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1024
+ var SearchBar = ({
1025
+ placeholder,
1026
+ onSearch,
1027
+ disableOnSearch,
1028
+ containerClassName,
1029
+ ...inputProps
1030
+ }) => {
1031
+ const translation = useTranslation([formTranslation]);
1032
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.clsx)("flex-row-2 justify-between items-center", containerClassName), children: [
1033
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1034
+ Input,
1035
+ {
1036
+ ...inputProps,
1037
+ placeholder: placeholder ?? translation("search")
1038
+ }
1039
+ ),
1040
+ onSearch && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.Search, { className: "w-full h-full" }) })
729
1041
  ] });
730
1042
  };
731
1043
 
732
- // src/components/layout-and-navigation/Tile.tsx
733
- var import_clsx5 = __toESM(require("clsx"));
734
- var import_lucide_react2 = require("lucide-react");
735
- var import_jsx_runtime6 = require("react/jsx-runtime");
736
- var Tile = ({
1044
+ // src/hooks/useSearch.ts
1045
+ var import_react12 = require("react");
1046
+
1047
+ // src/util/simpleSearch.ts
1048
+ var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
1049
+ return objects.filter((object) => {
1050
+ const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
1051
+ if (!mappedSearchKeywords) {
1052
+ return true;
1053
+ }
1054
+ return search.every((searchValue) => !!mappedSearchKeywords.find((value) => !!value && value.includes(searchValue.toLowerCase().trim())));
1055
+ });
1056
+ };
1057
+
1058
+ // src/hooks/useSearch.ts
1059
+ var useSearch = ({
1060
+ list,
1061
+ initialSearch,
1062
+ searchMapping,
1063
+ additionalSearchTags,
1064
+ isSearchInstant = true,
1065
+ sortingFunction,
1066
+ filter,
1067
+ disabled = false
1068
+ }) => {
1069
+ const [search, setSearch] = (0, import_react12.useState)(initialSearch ?? "");
1070
+ const [result, setResult] = (0, import_react12.useState)(list);
1071
+ const searchTags = (0, import_react12.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
1072
+ const updateSearch = (0, import_react12.useCallback)((newSearch) => {
1073
+ const usedSearch = newSearch ?? search;
1074
+ if (newSearch) {
1075
+ setSearch(search);
1076
+ }
1077
+ setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
1078
+ }, [searchTags, list, search, searchMapping]);
1079
+ (0, import_react12.useEffect)(() => {
1080
+ if (isSearchInstant) {
1081
+ setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
1082
+ }
1083
+ }, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
1084
+ const filteredResult = (0, import_react12.useMemo)(() => {
1085
+ if (!filter) {
1086
+ return result;
1087
+ }
1088
+ return result.filter(filter);
1089
+ }, [result, filter]);
1090
+ const sortedAndFilteredResult = (0, import_react12.useMemo)(() => {
1091
+ if (!sortingFunction) {
1092
+ return filteredResult;
1093
+ }
1094
+ return filteredResult.sort(sortingFunction);
1095
+ }, [filteredResult, sortingFunction]);
1096
+ const usedResult = (0, import_react12.useMemo)(() => {
1097
+ if (!disabled) {
1098
+ return sortedAndFilteredResult;
1099
+ }
1100
+ return list;
1101
+ }, [disabled, list, sortedAndFilteredResult]);
1102
+ return {
1103
+ result: usedResult,
1104
+ hasResult: usedResult.length > 0,
1105
+ allItems: list,
1106
+ updateSearch,
1107
+ search,
1108
+ setSearch
1109
+ };
1110
+ };
1111
+
1112
+ // src/components/user-action/Select.tsx
1113
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1114
+ var SelectTile = ({
1115
+ className,
1116
+ disabledClassName,
737
1117
  title,
738
- description,
739
- onClick,
740
- isSelected = false,
741
- isDisabled = false,
742
- prefix,
743
- suffix,
744
- normalClassName = "hover:bg-primary/40 cursor-pointer",
745
- selectedClassName = " bg-primary/20",
746
- disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
747
- className
1118
+ ...restProps
748
1119
  }) => {
749
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
750
- "div",
1120
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1121
+ Tile,
751
1122
  {
752
- className: (0, import_clsx5.default)(
753
- "row gap-x-2 w-full items-center",
754
- {
755
- [normalClassName]: !!onClick && !isDisabled,
756
- [selectedClassName]: isSelected && !isDisabled,
757
- [disabledClassName]: isDisabled
758
- },
759
- className
760
- ),
761
- onClick: isDisabled ? void 0 : onClick,
762
- children: [
763
- prefix,
764
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "col gap-y-0 w-full", children: [
765
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h4", { className: (0, import_clsx5.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
766
- !!description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: (0, import_clsx5.default)(description.className ?? "textstyle-description"), children: description.value })
767
- ] }),
768
- suffix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Check, { size: 24 }) : void 0)
769
- ]
1123
+ ...restProps,
1124
+ className: (0, import_clsx8.default)("px-2 py-1 rounded-md", className),
1125
+ disabledClassName: disabledClassName ?? "text-disabled-text cursor-not-allowed",
1126
+ title: { ...title, className: title.className ?? "font-semibold" }
770
1127
  }
771
1128
  );
772
1129
  };
773
1130
 
774
1131
  // src/components/layout-and-navigation/Chip.tsx
775
- var import_clsx6 = __toESM(require("clsx"));
776
- var import_jsx_runtime7 = require("react/jsx-runtime");
1132
+ var import_clsx9 = __toESM(require("clsx"));
1133
+ var import_jsx_runtime10 = require("react/jsx-runtime");
777
1134
  var Chip = ({
778
1135
  children,
779
1136
  trailingIcon,
@@ -800,11 +1157,11 @@ var Chip = ({
800
1157
  blue: "text-tag-blue-icon",
801
1158
  pink: "text-tag-pink-icon"
802
1159
  }[color];
803
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1160
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
804
1161
  "div",
805
1162
  {
806
1163
  ...restProps,
807
- className: (0, import_clsx6.default)(
1164
+ className: (0, import_clsx9.default)(
808
1165
  `row w-fit px-2 py-1`,
809
1166
  colorMapping,
810
1167
  {
@@ -815,7 +1172,7 @@ var Chip = ({
815
1172
  ),
816
1173
  children: [
817
1174
  children,
818
- trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
1175
+ trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
819
1176
  ]
820
1177
  }
821
1178
  );
@@ -824,7 +1181,7 @@ var ChipList = ({
824
1181
  list,
825
1182
  className = ""
826
1183
  }) => {
827
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_clsx6.default)("flex flex-wrap gap-x-4 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1184
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: (0, import_clsx9.default)("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
828
1185
  Chip,
829
1186
  {
830
1187
  ...value,
@@ -836,28 +1193,74 @@ var ChipList = ({
836
1193
  )) });
837
1194
  };
838
1195
 
839
- // src/hooks/useOutsideClick.ts
840
- var import_react8 = require("react");
841
- var useOutsideClick = (refs, handler) => {
842
- (0, import_react8.useEffect)(() => {
843
- const listener = (event) => {
844
- if (event.target === null) return;
845
- if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
846
- return;
1196
+ // src/components/user-action/Checkbox.tsx
1197
+ var import_react15 = require("react");
1198
+ var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
1199
+ var import_lucide_react4 = require("lucide-react");
1200
+ var import_clsx10 = __toESM(require("clsx"));
1201
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1202
+ var checkboxSizeMapping = {
1203
+ small: "size-5",
1204
+ medium: "size-6",
1205
+ large: "size-8"
1206
+ };
1207
+ var checkboxIconSizeMapping = {
1208
+ small: "size-4",
1209
+ medium: "size-5",
1210
+ large: "size-7"
1211
+ };
1212
+ var Checkbox = ({
1213
+ id,
1214
+ label,
1215
+ checked,
1216
+ disabled,
1217
+ onChange,
1218
+ onChangeTristate,
1219
+ size = "medium",
1220
+ className = "",
1221
+ containerClassName
1222
+ }) => {
1223
+ const usedSizeClass = checkboxSizeMapping[size];
1224
+ const innerIconSize = checkboxIconSizeMapping[size];
1225
+ const propagateChange = (checked2) => {
1226
+ if (onChangeTristate) {
1227
+ onChangeTristate(checked2);
1228
+ }
1229
+ if (onChange) {
1230
+ onChange(checked2 === "indeterminate" ? false : checked2);
1231
+ }
1232
+ };
1233
+ const changeValue = () => {
1234
+ const newValue = checked === "indeterminate" ? false : !checked;
1235
+ propagateChange(newValue);
1236
+ };
1237
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: (0, import_clsx10.default)("group flex-row-2 items-center cursor-pointer", containerClassName), onClick: changeValue, children: [
1238
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1239
+ CheckboxPrimitive.Root,
1240
+ {
1241
+ onCheckedChange: propagateChange,
1242
+ checked,
1243
+ disabled,
1244
+ id,
1245
+ className: (0, import_clsx10.default)(usedSizeClass, `items-center border-2 rounded outline-none `, {
1246
+ "text-disabled-text border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
1247
+ "focus:border-primary group-hover:border-primary ": !disabled,
1248
+ "bg-surface": !disabled && !checked,
1249
+ "bg-primary/30 border-primary text-primary": !disabled && checked === true || checked === "indeterminate"
1250
+ }, className),
1251
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(CheckboxPrimitive.Indicator, { children: [
1252
+ checked === true && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.Check, { className: innerIconSize }),
1253
+ checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.Minus, { className: innerIconSize })
1254
+ ] })
847
1255
  }
848
- handler();
849
- };
850
- document.addEventListener("mousedown", listener);
851
- document.addEventListener("touchstart", listener);
852
- return () => {
853
- document.removeEventListener("mousedown", listener);
854
- document.removeEventListener("touchstart", listener);
855
- };
856
- }, [refs, handler]);
1256
+ ),
1257
+ label && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Label, { ...label, className: (0, import_clsx10.default)(label.className), htmlFor: id })
1258
+ ] });
857
1259
  };
858
1260
 
859
1261
  // src/components/user-action/MultiSelect.tsx
860
- var import_jsx_runtime8 = require("react/jsx-runtime");
1262
+ var import_lucide_react5 = require("lucide-react");
1263
+ var import_jsx_runtime12 = require("react/jsx-runtime");
861
1264
  var defaultMultiSelectTranslation = {
862
1265
  en: {
863
1266
  selected: `{{amount}} selected`
@@ -868,89 +1271,107 @@ var defaultMultiSelectTranslation = {
868
1271
  };
869
1272
  var MultiSelect = ({
870
1273
  overwriteTranslation,
871
- options,
872
1274
  label,
1275
+ options,
873
1276
  onChange,
874
1277
  hintText,
875
- isDisabled = false,
876
- isSearchEnabled = false,
877
1278
  selectedDisplayOverwrite,
1279
+ searchOptions,
1280
+ additionalItems,
878
1281
  useChipDisplay = false,
879
- className = ""
1282
+ className,
1283
+ triggerClassName,
1284
+ hintTextClassName,
1285
+ ...menuProps
880
1286
  }) => {
881
1287
  const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
882
- const triggerRef = (0, import_react9.useRef)(null);
883
- const menuRef = (0, import_react9.useRef)(null);
884
- const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
885
- useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
1288
+ const { result, search, setSearch } = useSearch({
1289
+ list: options,
1290
+ searchMapping: (0, import_react16.useCallback)((item) => item.searchTags, []),
1291
+ ...searchOptions
1292
+ });
886
1293
  const selectedItems = options.filter((value) => value.selected);
887
1294
  const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
888
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.default)(className), children: [
889
- label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1295
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_clsx11.default)(className), children: [
1296
+ label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
890
1297
  Label,
891
1298
  {
892
1299
  ...label,
893
1300
  htmlFor: label.name,
894
- className: (0, import_clsx7.default)(" mb-1", label.className),
1301
+ className: (0, import_clsx11.default)(" mb-1", label.className),
895
1302
  labelType: label.labelType ?? "labelBig"
896
1303
  }
897
1304
  ),
898
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative", children: [
899
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
900
- "button",
901
- {
902
- ref: triggerRef,
903
- className: (0, import_clsx7.default)(
904
- "btn-md justify-between w-full border-2 h-auto",
905
- {
906
- "rounded-b-lg": !open,
907
- "bg-menu-background border-menu-border hover:border-primary": !isDisabled,
908
- "bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": isDisabled
909
- }
910
- ),
911
- onClick: () => setIsOpen(!isOpen),
912
- disabled: isDisabled,
913
- children: [
914
- !isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? (useChipDisplay && selectedItems ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) : translation("selected", { replacements: { amount: selectedItems.length.toString() } })) }),
915
- isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "textstyle-description", children: hintText ?? translation("select") }),
916
- isOpen ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ChevronUp, { size: 24, className: "min-w-6" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ChevronDown, { className: "min-w-6" })
917
- ]
918
- }
919
- ),
920
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
921
- "div",
922
- {
923
- ref: menuRef,
924
- 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",
925
- children: [
926
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
927
- SearchableList,
1305
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1306
+ Menu,
1307
+ {
1308
+ ...menuProps,
1309
+ trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1310
+ "button",
1311
+ {
1312
+ ref,
1313
+ className: (0, import_clsx11.default)(
1314
+ "btn-md justify-between w-full border-2 h-auto",
928
1315
  {
929
- list: options,
930
- minimumItemsForSearch: isSearchEnabled ? void 0 : options.length,
931
- searchMapping: (item) => item.searchTags,
932
- itemMapper: (option, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
933
- Tile,
1316
+ "min-h-14": useChipDisplay,
1317
+ "bg-menu-background text-menu-text border-menu-border hover:border-primary": !disabled,
1318
+ "bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": disabled
1319
+ },
1320
+ triggerClassName
1321
+ ),
1322
+ onClick: toggleOpen,
1323
+ disabled,
1324
+ children: useChipDisplay ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children: isShowingHint ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconButton, { disabled, size: "small", color: "neutral", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react5.Plus, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
1325
+ !isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? translation("selected", { replacements: { amount: selectedItems.length.toString() } }) }),
1326
+ isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: (0, import_clsx11.default)("textstyle-description", hintTextClassName), children: hintText ?? translation("select") }),
1327
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ExpansionIcon, { isExpanded: isOpen })
1328
+ ] })
1329
+ }
1330
+ ),
1331
+ menuClassName: (0, import_clsx11.default)("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
1332
+ children: (bag) => {
1333
+ const { close } = bag;
1334
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
1335
+ !searchOptions?.disabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1336
+ SearchBar,
1337
+ {
1338
+ value: search,
1339
+ onChangeText: setSearch,
1340
+ autoFocus: true
1341
+ }
1342
+ ),
1343
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex-col-2 overflow-y-auto", children: [
1344
+ result.map((option, index) => {
1345
+ const update = () => {
1346
+ onChange(options.map((value) => value.value === option.value ? {
1347
+ ...option,
1348
+ selected: !value.selected
1349
+ } : value));
1350
+ };
1351
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1352
+ SelectTile,
934
1353
  {
935
- isSelected: option.selected,
936
- className: "px-2 py-1 rounded-md",
937
- disabledClassName: "text-disabled-text cursor-not-allowed",
938
- title: { value: option.label, className: "font-semibold" },
939
- onClick: () => {
940
- onChange(options.map((value) => value.value === option.value ? {
941
- ...option,
942
- selected: !value.selected
943
- } : value));
944
- },
945
- isDisabled: option.disabled
1354
+ prefix: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1355
+ Checkbox,
1356
+ {
1357
+ checked: option.selected,
1358
+ onChange: update,
1359
+ size: "small",
1360
+ disabled: option.disabled
1361
+ }
1362
+ ),
1363
+ title: { value: option.label },
1364
+ onClick: update,
1365
+ disabled: option.disabled
946
1366
  },
947
1367
  index
948
- )
949
- }
950
- ),
951
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "row justify-between mt-2", children: [
952
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "row gap-x-2", children: [
953
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1368
+ );
1369
+ }),
1370
+ additionalItems && additionalItems({ ...bag, search })
1371
+ ] }),
1372
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex-row-2 justify-between", children: [
1373
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex-row-2", children: [
1374
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
954
1375
  SolidButton,
955
1376
  {
956
1377
  color: "neutral",
@@ -965,7 +1386,7 @@ var MultiSelect = ({
965
1386
  children: translation("all")
966
1387
  }
967
1388
  ),
968
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1389
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
969
1390
  SolidButton,
970
1391
  {
971
1392
  color: "neutral",
@@ -980,12 +1401,12 @@ var MultiSelect = ({
980
1401
  }
981
1402
  )
982
1403
  ] }),
983
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SolidButton, { size: "small", onClick: () => setIsOpen(false), children: "Done" })
1404
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SolidButton, { size: "small", onClick: close, children: "Done" })
984
1405
  ] })
985
- ]
1406
+ ] });
986
1407
  }
987
- )
988
- ] })
1408
+ }
1409
+ )
989
1410
  ] });
990
1411
  };
991
1412
  var MultiSelectUncontrolled = ({
@@ -993,11 +1414,11 @@ var MultiSelectUncontrolled = ({
993
1414
  onChange,
994
1415
  ...props
995
1416
  }) => {
996
- const [usedOptions, setUsedOptions] = (0, import_react9.useState)(options);
997
- (0, import_react9.useEffect)(() => {
1417
+ const [usedOptions, setUsedOptions] = (0, import_react17.useState)(options);
1418
+ (0, import_react17.useEffect)(() => {
998
1419
  setUsedOptions(options);
999
1420
  }, [options]);
1000
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1421
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1001
1422
  MultiSelect,
1002
1423
  {
1003
1424
  ...props,