@helpwave/hightide 0.1.17 → 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 (261) 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 -10
  60. package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
  61. package/dist/components/layout-and-navigation/Pagination.mjs +79 -7
  62. package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
  63. package/dist/components/layout-and-navigation/SearchableList.js +127 -26
  64. package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
  65. package/dist/components/layout-and-navigation/SearchableList.mjs +126 -25
  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 -29
  106. package/dist/components/modals/InputModal.js.map +1 -1
  107. package/dist/components/modals/InputModal.mjs +18 -15
  108. package/dist/components/modals/InputModal.mjs.map +1 -1
  109. package/dist/components/modals/LanguageModal.js +728 -435
  110. package/dist/components/modals/LanguageModal.js.map +1 -1
  111. package/dist/components/modals/LanguageModal.mjs +728 -431
  112. package/dist/components/modals/LanguageModal.mjs.map +1 -1
  113. package/dist/components/modals/ThemeModal.js +732 -439
  114. package/dist/components/modals/ThemeModal.js.map +1 -1
  115. package/dist/components/modals/ThemeModal.mjs +731 -434
  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 -42
  122. package/dist/components/properties/DateProperty.js.map +1 -1
  123. package/dist/components/properties/DateProperty.mjs +114 -38
  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 -464
  128. package/dist/components/properties/MultiSelectProperty.js.map +1 -1
  129. package/dist/components/properties/MultiSelectProperty.mjs +920 -465
  130. package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
  131. package/dist/components/properties/NumberProperty.js +101 -19
  132. package/dist/components/properties/NumberProperty.js.map +1 -1
  133. package/dist/components/properties/NumberProperty.mjs +101 -19
  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 -244
  142. package/dist/components/properties/SelectProperty.js.map +1 -1
  143. package/dist/components/properties/SelectProperty.mjs +686 -244
  144. package/dist/components/properties/SelectProperty.mjs.map +1 -1
  145. package/dist/components/properties/TextProperty.js +133 -47
  146. package/dist/components/properties/TextProperty.js.map +1 -1
  147. package/dist/components/properties/TextProperty.mjs +133 -47
  148. package/dist/components/properties/TextProperty.mjs.map +1 -1
  149. package/dist/components/table/Table.js +285 -186
  150. package/dist/components/table/Table.js.map +1 -1
  151. package/dist/components/table/Table.mjs +270 -167
  152. package/dist/components/table/Table.mjs.map +1 -1
  153. package/dist/components/table/TableFilterButton.js +179 -79
  154. package/dist/components/table/TableFilterButton.js.map +1 -1
  155. package/dist/components/table/TableFilterButton.mjs +160 -56
  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/Input.js +0 -1
  180. package/dist/components/user-action/Input.js.map +1 -1
  181. package/dist/components/user-action/Input.mjs +0 -1
  182. package/dist/components/user-action/Input.mjs.map +1 -1
  183. package/dist/components/user-action/Menu.d.mts +11 -6
  184. package/dist/components/user-action/Menu.d.ts +11 -6
  185. package/dist/components/user-action/Menu.js +128 -31
  186. package/dist/components/user-action/Menu.js.map +1 -1
  187. package/dist/components/user-action/Menu.mjs +134 -33
  188. package/dist/components/user-action/Menu.mjs.map +1 -1
  189. package/dist/components/user-action/MultiSelect.d.mts +17 -7
  190. package/dist/components/user-action/MultiSelect.d.ts +17 -7
  191. package/dist/components/user-action/MultiSelect.js +796 -376
  192. package/dist/components/user-action/MultiSelect.js.map +1 -1
  193. package/dist/components/user-action/MultiSelect.mjs +781 -357
  194. package/dist/components/user-action/MultiSelect.mjs.map +1 -1
  195. package/dist/components/user-action/ScrollPicker.js +2 -2
  196. package/dist/components/user-action/ScrollPicker.js.map +1 -1
  197. package/dist/components/user-action/ScrollPicker.mjs +2 -2
  198. package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
  199. package/dist/components/user-action/SearchBar.d.mts +14 -0
  200. package/dist/components/user-action/SearchBar.d.ts +14 -0
  201. package/dist/components/user-action/SearchBar.js +673 -0
  202. package/dist/components/user-action/SearchBar.js.map +1 -0
  203. package/dist/components/user-action/SearchBar.mjs +637 -0
  204. package/dist/components/user-action/SearchBar.mjs.map +1 -0
  205. package/dist/components/user-action/Select.d.mts +18 -5
  206. package/dist/components/user-action/Select.d.ts +18 -5
  207. package/dist/components/user-action/Select.js +764 -356
  208. package/dist/components/user-action/Select.js.map +1 -1
  209. package/dist/components/user-action/Select.mjs +761 -350
  210. package/dist/components/user-action/Select.mjs.map +1 -1
  211. package/dist/components/user-action/Textarea.d.mts +1 -1
  212. package/dist/components/user-action/Textarea.d.ts +1 -1
  213. package/dist/components/user-action/Textarea.js +13 -4
  214. package/dist/components/user-action/Textarea.js.map +1 -1
  215. package/dist/components/user-action/Textarea.mjs +13 -4
  216. package/dist/components/user-action/Textarea.mjs.map +1 -1
  217. package/dist/components/user-action/ToggleableInput.js +2 -3
  218. package/dist/components/user-action/ToggleableInput.js.map +1 -1
  219. package/dist/components/user-action/ToggleableInput.mjs +2 -3
  220. package/dist/components/user-action/ToggleableInput.mjs.map +1 -1
  221. package/dist/css/globals.css +251 -113
  222. package/dist/css/uncompiled/globals.css +19 -13
  223. package/dist/css/uncompiled/theme/colors-component.css +12 -3
  224. package/dist/css/uncompiled/theme/colors-semantic.css +10 -7
  225. package/dist/css/uncompiled/utitlity/animation.css +70 -1
  226. package/dist/css/uncompiled/utitlity/general.css +16 -0
  227. package/dist/hooks/useDelay.js +0 -1
  228. package/dist/hooks/useDelay.js.map +1 -1
  229. package/dist/hooks/useDelay.mjs +0 -1
  230. package/dist/hooks/useDelay.mjs.map +1 -1
  231. package/dist/hooks/usePopoverPosition.d.mts +15 -0
  232. package/dist/hooks/usePopoverPosition.d.ts +15 -0
  233. package/dist/hooks/usePopoverPosition.js +81 -0
  234. package/dist/hooks/usePopoverPosition.js.map +1 -0
  235. package/dist/hooks/usePopoverPosition.mjs +57 -0
  236. package/dist/hooks/usePopoverPosition.mjs.map +1 -0
  237. package/dist/hooks/useSearch.d.mts +7 -2
  238. package/dist/hooks/useSearch.d.ts +7 -2
  239. package/dist/hooks/useSearch.js +44 -15
  240. package/dist/hooks/useSearch.js.map +1 -1
  241. package/dist/hooks/useSearch.mjs +45 -16
  242. package/dist/hooks/useSearch.mjs.map +1 -1
  243. package/dist/index.d.mts +6 -4
  244. package/dist/index.d.ts +6 -4
  245. package/dist/index.js +1102 -820
  246. package/dist/index.js.map +1 -1
  247. package/dist/index.mjs +1001 -719
  248. package/dist/index.mjs.map +1 -1
  249. package/dist/localization/defaults/form.d.mts +2 -0
  250. package/dist/localization/defaults/form.d.ts +2 -0
  251. package/dist/localization/defaults/form.js +4 -0
  252. package/dist/localization/defaults/form.js.map +1 -1
  253. package/dist/localization/defaults/form.mjs +4 -0
  254. package/dist/localization/defaults/form.mjs.map +1 -1
  255. package/dist/util/simpleSearch.d.mts +1 -1
  256. package/dist/util/simpleSearch.d.ts +1 -1
  257. package/dist/util/simpleSearch.js +4 -1
  258. package/dist/util/simpleSearch.js.map +1 -1
  259. package/dist/util/simpleSearch.mjs +4 -1
  260. package/dist/util/simpleSearch.mjs.map +1 -1
  261. package/package.json +1 -1
@@ -121,9 +121,9 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
121
121
  };
122
122
 
123
123
  // src/components/user-action/Select.tsx
124
- var import_lucide_react3 = require("lucide-react");
125
- var import_react9 = require("react");
126
- var import_clsx6 = __toESM(require("clsx"));
124
+ var import_react13 = require("react");
125
+ var import_react14 = require("react");
126
+ var import_clsx8 = __toESM(require("clsx"));
127
127
 
128
128
  // src/components/user-action/Label.tsx
129
129
  var import_clsx = __toESM(require("clsx"));
@@ -143,22 +143,384 @@ var Label = ({
143
143
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
144
144
  };
145
145
 
146
- // src/components/layout-and-navigation/SearchableList.tsx
146
+ // src/components/layout-and-navigation/Tile.tsx
147
+ var import_clsx2 = __toESM(require("clsx"));
147
148
  var import_lucide_react = require("lucide-react");
149
+ var import_jsx_runtime3 = require("react/jsx-runtime");
150
+ var Tile = ({
151
+ title,
152
+ description,
153
+ onClick,
154
+ isSelected = false,
155
+ disabled = false,
156
+ prefix,
157
+ suffix,
158
+ normalClassName = "hover:bg-primary/40 cursor-pointer",
159
+ selectedClassName = " bg-primary/20",
160
+ disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
161
+ className
162
+ }) => {
163
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
164
+ "div",
165
+ {
166
+ className: (0, import_clsx2.default)(
167
+ "flex-row-2 w-full items-center",
168
+ {
169
+ [normalClassName]: !!onClick && !disabled,
170
+ [selectedClassName]: isSelected && !disabled,
171
+ [disabledClassName]: disabled
172
+ },
173
+ className
174
+ ),
175
+ onClick: disabled ? void 0 : onClick,
176
+ children: [
177
+ prefix,
178
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex-col-0 w-full", children: [
179
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h4", { className: (0, import_clsx2.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
180
+ !!description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: (0, import_clsx2.default)(description.className ?? "textstyle-description"), children: description.value })
181
+ ] }),
182
+ suffix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Check, { size: 24 }) : void 0)
183
+ ]
184
+ }
185
+ );
186
+ };
187
+
188
+ // src/components/layout-and-navigation/Expandable.tsx
189
+ var import_react3 = require("react");
190
+ var import_lucide_react2 = require("lucide-react");
191
+ var import_clsx3 = __toESM(require("clsx"));
192
+
193
+ // src/util/noop.ts
194
+ var noop = () => void 0;
195
+
196
+ // src/components/layout-and-navigation/Expandable.tsx
197
+ var import_jsx_runtime4 = require("react/jsx-runtime");
198
+ var ExpansionIcon = ({ isExpanded, className }) => {
199
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
200
+ import_lucide_react2.ChevronDown,
201
+ {
202
+ className: (0, import_clsx3.default)(
203
+ "min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
204
+ { "rotate-180": isExpanded },
205
+ className
206
+ )
207
+ }
208
+ );
209
+ };
210
+ var Expandable = (0, import_react3.forwardRef)(function Expandable2({
211
+ children,
212
+ label,
213
+ icon,
214
+ isExpanded = false,
215
+ onChange = noop,
216
+ clickOnlyOnHeader = true,
217
+ disabled = false,
218
+ className,
219
+ headerClassName,
220
+ contentClassName
221
+ }, ref) {
222
+ const defaultIcon = (0, import_react3.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
223
+ icon ??= defaultIcon;
224
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
225
+ "div",
226
+ {
227
+ ref,
228
+ className: (0, import_clsx3.default)("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
229
+ onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
230
+ children: [
231
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
232
+ "div",
233
+ {
234
+ className: (0, import_clsx3.default)(
235
+ "flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
236
+ {
237
+ "group-hover:brightness-97": !isExpanded,
238
+ "hover:brightness-97": isExpanded && !disabled,
239
+ "cursor-pointer": clickOnlyOnHeader && !disabled
240
+ },
241
+ headerClassName
242
+ ),
243
+ onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
244
+ children: [
245
+ label,
246
+ icon(isExpanded)
247
+ ]
248
+ }
249
+ ),
250
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
251
+ "div",
252
+ {
253
+ className: (0, import_clsx3.default)(
254
+ "flex-col-2 px-4 transition-all duration-300 ease-in-out",
255
+ {
256
+ "max-h-96 opacity-100 pb-2": isExpanded,
257
+ "max-h-0 opacity-0 overflow-hidden": !isExpanded
258
+ },
259
+ contentClassName
260
+ ),
261
+ children
262
+ }
263
+ )
264
+ ]
265
+ }
266
+ );
267
+ });
268
+ var ExpandableUncontrolled = (0, import_react3.forwardRef)(function ExpandableUncontrolled2({
269
+ isExpanded,
270
+ onChange = noop,
271
+ ...props
272
+ }, ref) {
273
+ const [usedIsExpanded, setUsedIsExpanded] = (0, import_react3.useState)(isExpanded);
274
+ (0, import_react3.useEffect)(() => {
275
+ setUsedIsExpanded(isExpanded);
276
+ }, [isExpanded]);
277
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
278
+ Expandable,
279
+ {
280
+ ...props,
281
+ ref,
282
+ isExpanded: usedIsExpanded,
283
+ onChange: (value) => {
284
+ onChange(value);
285
+ setUsedIsExpanded(value);
286
+ }
287
+ }
288
+ );
289
+ });
290
+
291
+ // src/components/user-action/Menu.tsx
292
+ var import_react6 = require("react");
148
293
  var import_clsx4 = __toESM(require("clsx"));
149
294
 
295
+ // src/hooks/useOutsideClick.ts
296
+ var import_react4 = require("react");
297
+ var useOutsideClick = (refs, handler) => {
298
+ (0, import_react4.useEffect)(() => {
299
+ const listener = (event) => {
300
+ if (event.target === null) return;
301
+ if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
302
+ return;
303
+ }
304
+ handler();
305
+ };
306
+ document.addEventListener("mousedown", listener);
307
+ document.addEventListener("touchstart", listener);
308
+ return () => {
309
+ document.removeEventListener("mousedown", listener);
310
+ document.removeEventListener("touchstart", listener);
311
+ };
312
+ }, [refs, handler]);
313
+ };
314
+
315
+ // src/hooks/useHoverState.ts
316
+ var import_react5 = require("react");
317
+ var defaultUseHoverStateProps = {
318
+ closingDelay: 200,
319
+ isDisabled: false
320
+ };
321
+ var useHoverState = (props = void 0) => {
322
+ const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
323
+ const [isHovered, setIsHovered] = (0, import_react5.useState)(false);
324
+ const [timer, setTimer] = (0, import_react5.useState)();
325
+ const onMouseEnter = () => {
326
+ if (isDisabled) {
327
+ return;
328
+ }
329
+ clearTimeout(timer);
330
+ setIsHovered(true);
331
+ };
332
+ const onMouseLeave = () => {
333
+ if (isDisabled) {
334
+ return;
335
+ }
336
+ setTimer(setTimeout(() => {
337
+ setIsHovered(false);
338
+ }, closingDelay));
339
+ };
340
+ (0, import_react5.useEffect)(() => {
341
+ if (timer) {
342
+ return () => {
343
+ clearTimeout(timer);
344
+ };
345
+ }
346
+ });
347
+ (0, import_react5.useEffect)(() => {
348
+ if (timer) {
349
+ clearTimeout(timer);
350
+ }
351
+ }, [isDisabled]);
352
+ return {
353
+ isHovered,
354
+ setIsHovered,
355
+ handlers: { onMouseEnter, onMouseLeave }
356
+ };
357
+ };
358
+
359
+ // src/util/PropsWithFunctionChildren.ts
360
+ var resolve = (children, bag) => {
361
+ if (typeof children === "function") {
362
+ return children(bag);
363
+ }
364
+ return children ?? void 0;
365
+ };
366
+ var BagFunctionUtil = {
367
+ resolve
368
+ };
369
+
370
+ // src/hooks/usePopoverPosition.ts
371
+ var defaultPopoverPositionOptions = {
372
+ edgePadding: 16,
373
+ outerGap: 4,
374
+ horizontalAlignment: "leftInside",
375
+ verticalAlignment: "bottomOutside",
376
+ disabled: false
377
+ };
378
+ var usePopoverPosition = (trigger, options) => {
379
+ const {
380
+ edgePadding,
381
+ outerGap,
382
+ verticalAlignment,
383
+ horizontalAlignment,
384
+ disabled
385
+ } = { ...defaultPopoverPositionOptions, ...options };
386
+ if (disabled || !trigger) {
387
+ return {};
388
+ }
389
+ const left = {
390
+ leftOutside: trigger.left - outerGap,
391
+ leftInside: trigger.left,
392
+ rightOutside: trigger.right + outerGap,
393
+ rightInside: trigger.right,
394
+ center: trigger.left + trigger.width / 2
395
+ }[horizontalAlignment];
396
+ const top = {
397
+ topOutside: trigger.top - outerGap,
398
+ topInside: trigger.top,
399
+ bottomOutside: trigger.bottom + outerGap,
400
+ bottomInside: trigger.bottom,
401
+ center: trigger.top + trigger.height / 2
402
+ }[verticalAlignment];
403
+ const translateX = {
404
+ leftOutside: "-100%",
405
+ leftInside: void 0,
406
+ rightOutside: void 0,
407
+ rightInside: "-100%",
408
+ center: "-50%"
409
+ }[horizontalAlignment];
410
+ const translateY = {
411
+ topOutside: "-100%",
412
+ topInside: void 0,
413
+ bottomOutside: void 0,
414
+ bottomInside: "-100%",
415
+ center: "-50%"
416
+ }[verticalAlignment];
417
+ return {
418
+ left: Math.max(left, edgePadding),
419
+ top: Math.max(top, edgePadding),
420
+ translate: [translateX ?? "0", translateY ?? "0"].join(" ")
421
+ };
422
+ };
423
+
424
+ // src/components/user-action/Menu.tsx
425
+ var import_react_dom = require("react-dom");
426
+ var import_jsx_runtime5 = require("react/jsx-runtime");
427
+ function getScrollableParents(element) {
428
+ const scrollables = [];
429
+ let parent = element.parentElement;
430
+ while (parent) {
431
+ scrollables.push(parent);
432
+ parent = parent.parentElement;
433
+ }
434
+ return scrollables;
435
+ }
436
+ var Menu = ({
437
+ trigger,
438
+ children,
439
+ alignmentHorizontal = "leftInside",
440
+ alignmentVertical = "bottomOutside",
441
+ showOnHover = false,
442
+ disabled = false,
443
+ menuClassName = ""
444
+ }) => {
445
+ const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
446
+ const triggerRef = (0, import_react6.useRef)(null);
447
+ const menuRef = (0, import_react6.useRef)(null);
448
+ useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
449
+ const [isHidden, setIsHidden] = (0, import_react6.useState)(true);
450
+ const bag = {
451
+ isOpen,
452
+ close: () => setIsOpen(false),
453
+ toggleOpen: () => setIsOpen((prevState) => !prevState),
454
+ disabled
455
+ };
456
+ const menuPosition = usePopoverPosition(
457
+ triggerRef.current?.getBoundingClientRect(),
458
+ { verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
459
+ );
460
+ (0, import_react6.useEffect)(() => {
461
+ if (!isOpen) return;
462
+ const triggerEl = triggerRef.current;
463
+ if (!triggerEl) return;
464
+ const scrollableParents = getScrollableParents(triggerEl);
465
+ const close = () => setIsOpen(false);
466
+ scrollableParents.forEach((parent) => {
467
+ parent.addEventListener("scroll", close);
468
+ });
469
+ window.addEventListener("resize", close);
470
+ return () => {
471
+ scrollableParents.forEach((parent) => {
472
+ parent.removeEventListener("scroll", close);
473
+ });
474
+ window.removeEventListener("resize", close);
475
+ };
476
+ }, [isOpen, setIsOpen]);
477
+ (0, import_react6.useEffect)(() => {
478
+ if (isOpen) {
479
+ setIsHidden(false);
480
+ }
481
+ }, [isOpen]);
482
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
483
+ trigger(bag, triggerRef),
484
+ (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
485
+ "div",
486
+ {
487
+ ref: menuRef,
488
+ onClick: (e) => e.stopPropagation(),
489
+ className: (0, import_clsx4.default)(
490
+ "absolute rounded-md bg-menu-background text-menu-text shadow-around-lg z-10",
491
+ {
492
+ "animate-pop-in": isOpen,
493
+ "animate-pop-out": !isOpen,
494
+ "hidden": isHidden
495
+ },
496
+ menuClassName
497
+ ),
498
+ onAnimationEnd: () => {
499
+ if (!isOpen) {
500
+ setIsHidden(true);
501
+ }
502
+ },
503
+ style: {
504
+ ...menuPosition
505
+ },
506
+ children: BagFunctionUtil.resolve(children, bag)
507
+ }
508
+ ), document.body)
509
+ ] });
510
+ };
511
+
150
512
  // src/components/user-action/Input.tsx
151
- var import_react6 = require("react");
152
- var import_clsx2 = __toESM(require("clsx"));
513
+ var import_react10 = require("react");
514
+ var import_clsx5 = __toESM(require("clsx"));
153
515
 
154
516
  // src/hooks/useDelay.ts
155
- var import_react3 = require("react");
517
+ var import_react7 = require("react");
156
518
  var defaultOptions = {
157
519
  delay: 3e3,
158
520
  disabled: false
159
521
  };
160
522
  function useDelay(options) {
161
- const [timer, setTimer] = (0, import_react3.useState)(void 0);
523
+ const [timer, setTimer] = (0, import_react7.useState)(void 0);
162
524
  const { delay, disabled } = {
163
525
  ...defaultOptions,
164
526
  ...options
@@ -177,28 +539,24 @@ function useDelay(options) {
177
539
  setTimer(void 0);
178
540
  }, delay));
179
541
  };
180
- (0, import_react3.useEffect)(() => {
542
+ (0, import_react7.useEffect)(() => {
181
543
  return () => {
182
544
  clearTimeout(timer);
183
545
  };
184
546
  }, [timer]);
185
- (0, import_react3.useEffect)(() => {
547
+ (0, import_react7.useEffect)(() => {
186
548
  if (disabled) {
187
549
  clearTimeout(timer);
188
550
  setTimer(void 0);
189
551
  }
190
552
  }, [disabled, timer]);
191
- console.log(timer);
192
553
  return { restartTimer, clearTimer, hasActiveTimer: !!timer };
193
554
  }
194
555
 
195
- // src/util/noop.ts
196
- var noop = () => void 0;
197
-
198
556
  // src/hooks/useFocusManagement.ts
199
- var import_react4 = require("react");
557
+ var import_react8 = require("react");
200
558
  function useFocusManagement() {
201
- const getFocusableElements = (0, import_react4.useCallback)(() => {
559
+ const getFocusableElements = (0, import_react8.useCallback)(() => {
202
560
  return Array.from(
203
561
  document.querySelectorAll(
204
562
  'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
@@ -207,7 +565,7 @@ function useFocusManagement() {
207
565
  (el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
208
566
  );
209
567
  }, []);
210
- const getNextFocusElement = (0, import_react4.useCallback)(() => {
568
+ const getNextFocusElement = (0, import_react8.useCallback)(() => {
211
569
  const elements = getFocusableElements();
212
570
  if (elements.length === 0) {
213
571
  return void 0;
@@ -219,11 +577,11 @@ function useFocusManagement() {
219
577
  }
220
578
  return nextElement;
221
579
  }, [getFocusableElements]);
222
- const focusNext = (0, import_react4.useCallback)(() => {
580
+ const focusNext = (0, import_react8.useCallback)(() => {
223
581
  const nextElement = getNextFocusElement();
224
582
  nextElement?.focus();
225
583
  }, [getNextFocusElement]);
226
- const getPreviousFocusElement = (0, import_react4.useCallback)(() => {
584
+ const getPreviousFocusElement = (0, import_react8.useCallback)(() => {
227
585
  const elements = getFocusableElements();
228
586
  if (elements.length === 0) {
229
587
  return void 0;
@@ -239,7 +597,7 @@ function useFocusManagement() {
239
597
  }
240
598
  return previousElement;
241
599
  }, [getFocusableElements]);
242
- const focusPrevious = (0, import_react4.useCallback)(() => {
600
+ const focusPrevious = (0, import_react8.useCallback)(() => {
243
601
  const previousElement = getPreviousFocusElement();
244
602
  if (previousElement) previousElement.focus();
245
603
  }, [getPreviousFocusElement]);
@@ -253,10 +611,10 @@ function useFocusManagement() {
253
611
  }
254
612
 
255
613
  // src/hooks/useFocusOnceVisible.ts
256
- var import_react5 = __toESM(require("react"));
614
+ var import_react9 = __toESM(require("react"));
257
615
  var useFocusOnceVisible = (ref, disable = false) => {
258
- const [hasUsedFocus, setHasUsedFocus] = import_react5.default.useState(false);
259
- (0, import_react5.useEffect)(() => {
616
+ const [hasUsedFocus, setHasUsedFocus] = import_react9.default.useState(false);
617
+ (0, import_react9.useEffect)(() => {
260
618
  if (disable || hasUsedFocus) {
261
619
  return;
262
620
  }
@@ -276,9 +634,9 @@ var useFocusOnceVisible = (ref, disable = false) => {
276
634
  };
277
635
 
278
636
  // src/components/user-action/Input.tsx
279
- var import_jsx_runtime3 = require("react/jsx-runtime");
637
+ var import_jsx_runtime6 = require("react/jsx-runtime");
280
638
  var getInputClassName = ({ disabled = false, hasError = false }) => {
281
- return (0, import_clsx2.default)(
639
+ return (0, import_clsx5.default)(
282
640
  "px-2 py-1.5 rounded-md border-2",
283
641
  {
284
642
  "bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
@@ -292,7 +650,7 @@ var defaultEditCompleteOptions = {
292
650
  afterDelay: true,
293
651
  delay: 2500
294
652
  };
295
- var Input = (0, import_react6.forwardRef)(function Input2({
653
+ var Input = (0, import_react10.forwardRef)(function Input2({
296
654
  id,
297
655
  type = "text",
298
656
  value,
@@ -315,10 +673,10 @@ var Input = (0, import_react6.forwardRef)(function Input2({
315
673
  restartTimer,
316
674
  clearTimer
317
675
  } = useDelay({ delay, disabled: !afterDelay });
318
- const innerRef = (0, import_react6.useRef)(null);
676
+ const innerRef = (0, import_react10.useRef)(null);
319
677
  const { focusNext } = useFocusManagement();
320
678
  useFocusOnceVisible(innerRef, !autoFocus);
321
- (0, import_react6.useImperativeHandle)(forwardedRef, () => innerRef.current);
679
+ (0, import_react10.useImperativeHandle)(forwardedRef, () => innerRef.current);
322
680
  const handleKeyDown = (e) => {
323
681
  if (e.key === "Enter" && !e.shiftKey) {
324
682
  e.preventDefault();
@@ -326,9 +684,9 @@ var Input = (0, import_react6.forwardRef)(function Input2({
326
684
  focusNext();
327
685
  }
328
686
  };
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)(
687
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)({ "w-full": expanded }, containerClassName), children: [
688
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx5.default)("mb-1", label.className) }),
689
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
332
690
  "input",
333
691
  {
334
692
  ...restProps,
@@ -337,7 +695,7 @@ var Input = (0, import_react6.forwardRef)(function Input2({
337
695
  id,
338
696
  type,
339
697
  disabled,
340
- className: (0, import_clsx2.default)(getInputClassName({ disabled }), className),
698
+ className: (0, import_clsx5.default)(getInputClassName({ disabled }), className),
341
699
  onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
342
700
  onBlur: (event) => {
343
701
  onBlur?.(event);
@@ -367,7 +725,7 @@ var Input = (0, import_react6.forwardRef)(function Input2({
367
725
  )
368
726
  ] });
369
727
  });
370
- var FormInput = (0, import_react6.forwardRef)(function FormInput2({
728
+ var FormInput = (0, import_react10.forwardRef)(function FormInput2({
371
729
  id,
372
730
  labelText,
373
731
  errorText,
@@ -379,206 +737,33 @@ var FormInput = (0, import_react6.forwardRef)(function FormInput2({
379
737
  disabled,
380
738
  ...restProps
381
739
  }, ref) {
382
- const input = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
740
+ const input = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
383
741
  "input",
384
742
  {
385
743
  ...restProps,
386
744
  ref,
387
745
  id,
388
746
  disabled,
389
- className: (0, import_clsx2.default)(
747
+ className: (0, import_clsx5.default)(
390
748
  getInputClassName({ disabled, hasError: !!errorText }),
391
749
  className
392
750
  )
393
751
  }
394
752
  );
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: [
753
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)("flex flex-col gap-y-1", containerClassName), children: [
754
+ labelText && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { htmlFor: id, className: (0, import_clsx5.default)("textstyle-label-md", labelClassName), children: [
397
755
  labelText,
398
- required && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-primary font-bold", children: "*" })
756
+ required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-primary font-bold", children: "*" })
399
757
  ] }),
400
758
  input,
401
- errorText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: id, className: (0, import_clsx2.default)("text-negative", errorClassName), children: errorText })
759
+ errorText && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: id, className: (0, import_clsx5.default)("text-negative", errorClassName), children: errorText })
402
760
  ] });
403
761
  });
404
762
 
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
763
  // src/localization/defaults/form.ts
580
764
  var formTranslation = {
581
765
  en: {
766
+ add: "Add",
582
767
  all: "All",
583
768
  apply: "Apply",
584
769
  back: "Back",
@@ -591,6 +776,7 @@ var formTranslation = {
591
776
  confirm: "Confirm",
592
777
  copy: "Copy",
593
778
  copied: "Copied",
779
+ create: "Create",
594
780
  decline: "Decline",
595
781
  delete: "Delete",
596
782
  discard: "Discard",
@@ -633,6 +819,7 @@ var formTranslation = {
633
819
  yes: "Yes"
634
820
  },
635
821
  de: {
822
+ add: "Hinzuf\xFCgen",
636
823
  all: "Alle",
637
824
  apply: "Anwenden",
638
825
  back: "Zur\xFCck",
@@ -645,6 +832,7 @@ var formTranslation = {
645
832
  confirm: "Best\xE4tigen",
646
833
  copy: "Kopieren",
647
834
  copied: "Kopiert",
835
+ create: "Erstellen",
648
836
  decline: "Ablehnen",
649
837
  delete: "L\xF6schen",
650
838
  discard: "Verwerfen",
@@ -688,241 +876,346 @@ var formTranslation = {
688
876
  }
689
877
  };
690
878
 
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
- }
879
+ // src/components/user-action/Button.tsx
880
+ var import_react11 = require("react");
881
+ var import_clsx6 = __toESM(require("clsx"));
882
+ var import_jsx_runtime7 = require("react/jsx-runtime");
883
+ var ButtonColorUtil = {
884
+ solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
885
+ text: ["primary", "negative", "neutral"],
886
+ outline: ["primary"]
700
887
  };
701
- var SearchableList = ({
702
- overwriteTranslation,
703
- list,
704
- initialSearch = "",
705
- searchMapping,
706
- autoFocus,
707
- minimumItemsForSearch = 6,
708
- itemMapper,
709
- className,
710
- resultListClassName
711
- }) => {
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,
718
- {
719
- value: search,
720
- onChangeText: setSearch,
721
- placeholder: translation("search"),
722
- autoFocus,
723
- className: "w-full"
724
- }
725
- ),
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") })
729
- ] });
888
+ var IconButtonUtil = {
889
+ icon: [...ButtonColorUtil.solid, "transparent"]
730
890
  };
731
-
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 = ({
737
- title,
738
- description,
891
+ var paddingMapping = {
892
+ small: "btn-sm",
893
+ medium: "btn-md",
894
+ large: "btn-lg"
895
+ };
896
+ var iconPaddingMapping = {
897
+ tiny: "icon-btn-xs",
898
+ small: "icon-btn-sm",
899
+ medium: "icon-btn-md",
900
+ large: "icon-btn-lg"
901
+ };
902
+ var ButtonUtil = {
903
+ paddingMapping,
904
+ iconPaddingMapping
905
+ };
906
+ var SolidButton = (0, import_react11.forwardRef)(function SolidButton2({
907
+ children,
908
+ disabled = false,
909
+ color = "primary",
910
+ size = "medium",
911
+ startIcon,
912
+ endIcon,
739
913
  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
748
- }) => {
749
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
750
- "div",
914
+ className,
915
+ ...restProps
916
+ }, ref) {
917
+ const colorClasses = {
918
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
919
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
920
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
921
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
922
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
923
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
924
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
925
+ }[color];
926
+ const iconColorClasses = {
927
+ primary: "text-button-solid-primary-icon",
928
+ secondary: "text-button-solid-secondary-icon",
929
+ tertiary: "text-button-solid-tertiary-icon",
930
+ positive: "text-button-solid-positive-icon",
931
+ warning: "text-button-solid-warning-icon",
932
+ negative: "text-button-solid-negative-icon",
933
+ neutral: "text-button-solid-neutral-icon"
934
+ }[color];
935
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
936
+ "button",
751
937
  {
752
- className: (0, import_clsx5.default)(
753
- "row gap-x-2 w-full items-center",
938
+ ref,
939
+ onClick,
940
+ disabled,
941
+ className: (0, import_clsx6.default)(
754
942
  {
755
- [normalClassName]: !!onClick && !isDisabled,
756
- [selectedClassName]: isSelected && !isDisabled,
757
- [disabledClassName]: isDisabled
943
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
944
+ [(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
758
945
  },
946
+ ButtonUtil.paddingMapping[size],
759
947
  className
760
948
  ),
761
- onClick: isDisabled ? void 0 : onClick,
949
+ ...restProps,
762
950
  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)
951
+ startIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
952
+ "span",
953
+ {
954
+ className: (0, import_clsx6.default)({
955
+ [iconColorClasses]: !disabled,
956
+ [`text-disabled-icon`]: disabled
957
+ }),
958
+ children: startIcon
959
+ }
960
+ ),
961
+ children,
962
+ endIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
963
+ "span",
964
+ {
965
+ className: (0, import_clsx6.default)({
966
+ [iconColorClasses]: !disabled,
967
+ [`text-disabled-icon`]: disabled
968
+ }),
969
+ children: endIcon
970
+ }
971
+ )
769
972
  ]
770
973
  }
771
974
  );
975
+ });
976
+ var IconButton = ({
977
+ children,
978
+ disabled = false,
979
+ color = "primary",
980
+ size = "medium",
981
+ className,
982
+ ...restProps
983
+ }) => {
984
+ const colorClasses = {
985
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
986
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
987
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
988
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
989
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
990
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
991
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
992
+ transparent: "bg-transparent"
993
+ }[color];
994
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
995
+ "button",
996
+ {
997
+ disabled,
998
+ className: (0, import_clsx6.default)(
999
+ {
1000
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
1001
+ "text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
1002
+ "hover:bg-button-text-hover-background": !disabled && color === "transparent",
1003
+ [(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
1004
+ },
1005
+ ButtonUtil.iconPaddingMapping[size],
1006
+ className
1007
+ ),
1008
+ ...restProps,
1009
+ children
1010
+ }
1011
+ );
772
1012
  };
773
1013
 
774
- // src/hooks/useOutsideClick.ts
775
- var import_react8 = require("react");
776
- var useOutsideClick = (refs, handler) => {
777
- (0, import_react8.useEffect)(() => {
778
- const listener = (event) => {
779
- if (event.target === null) return;
780
- if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
781
- return;
1014
+ // src/components/user-action/SearchBar.tsx
1015
+ var import_lucide_react3 = require("lucide-react");
1016
+ var import_clsx7 = require("clsx");
1017
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1018
+ var SearchBar = ({
1019
+ placeholder,
1020
+ onSearch,
1021
+ disableOnSearch,
1022
+ containerClassName,
1023
+ ...inputProps
1024
+ }) => {
1025
+ const translation = useTranslation([formTranslation]);
1026
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.clsx)("flex-row-2 justify-between items-center", containerClassName), children: [
1027
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1028
+ Input,
1029
+ {
1030
+ ...inputProps,
1031
+ placeholder: placeholder ?? translation("search")
782
1032
  }
783
- handler();
784
- };
785
- document.addEventListener("mousedown", listener);
786
- document.addEventListener("touchstart", listener);
787
- return () => {
788
- document.removeEventListener("mousedown", listener);
789
- document.removeEventListener("touchstart", listener);
790
- };
791
- }, [refs, handler]);
1033
+ ),
1034
+ 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" }) })
1035
+ ] });
1036
+ };
1037
+
1038
+ // src/hooks/useSearch.ts
1039
+ var import_react12 = require("react");
1040
+
1041
+ // src/util/simpleSearch.ts
1042
+ var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
1043
+ return objects.filter((object) => {
1044
+ const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
1045
+ if (!mappedSearchKeywords) {
1046
+ return true;
1047
+ }
1048
+ return search.every((searchValue) => !!mappedSearchKeywords.find((value) => !!value && value.includes(searchValue.toLowerCase().trim())));
1049
+ });
1050
+ };
1051
+
1052
+ // src/hooks/useSearch.ts
1053
+ var useSearch = ({
1054
+ list,
1055
+ initialSearch,
1056
+ searchMapping,
1057
+ additionalSearchTags,
1058
+ isSearchInstant = true,
1059
+ sortingFunction,
1060
+ filter,
1061
+ disabled = false
1062
+ }) => {
1063
+ const [search, setSearch] = (0, import_react12.useState)(initialSearch ?? "");
1064
+ const [result, setResult] = (0, import_react12.useState)(list);
1065
+ const searchTags = (0, import_react12.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
1066
+ const updateSearch = (0, import_react12.useCallback)((newSearch) => {
1067
+ const usedSearch = newSearch ?? search;
1068
+ if (newSearch) {
1069
+ setSearch(search);
1070
+ }
1071
+ setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
1072
+ }, [searchTags, list, search, searchMapping]);
1073
+ (0, import_react12.useEffect)(() => {
1074
+ if (isSearchInstant) {
1075
+ setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
1076
+ }
1077
+ }, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
1078
+ const filteredResult = (0, import_react12.useMemo)(() => {
1079
+ if (!filter) {
1080
+ return result;
1081
+ }
1082
+ return result.filter(filter);
1083
+ }, [result, filter]);
1084
+ const sortedAndFilteredResult = (0, import_react12.useMemo)(() => {
1085
+ if (!sortingFunction) {
1086
+ return filteredResult;
1087
+ }
1088
+ return filteredResult.sort(sortingFunction);
1089
+ }, [filteredResult, sortingFunction]);
1090
+ const usedResult = (0, import_react12.useMemo)(() => {
1091
+ if (!disabled) {
1092
+ return sortedAndFilteredResult;
1093
+ }
1094
+ return list;
1095
+ }, [disabled, list, sortedAndFilteredResult]);
1096
+ return {
1097
+ result: usedResult,
1098
+ hasResult: usedResult.length > 0,
1099
+ allItems: list,
1100
+ updateSearch,
1101
+ search,
1102
+ setSearch
1103
+ };
792
1104
  };
793
1105
 
794
1106
  // src/components/user-action/Select.tsx
795
- var import_jsx_runtime7 = require("react/jsx-runtime");
1107
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1108
+ var SelectTile = ({
1109
+ className,
1110
+ disabledClassName,
1111
+ title,
1112
+ ...restProps
1113
+ }) => {
1114
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1115
+ Tile,
1116
+ {
1117
+ ...restProps,
1118
+ className: (0, import_clsx8.default)("px-2 py-1 rounded-md", className),
1119
+ disabledClassName: disabledClassName ?? "text-disabled-text cursor-not-allowed",
1120
+ title: { ...title, className: title.className ?? "font-semibold" }
1121
+ }
1122
+ );
1123
+ };
796
1124
  var Select = ({
797
1125
  value,
798
1126
  label,
799
1127
  options,
800
1128
  onChange,
801
1129
  hintText = "",
802
- isDisabled,
803
- isSearchEnabled = false,
1130
+ selectedDisplayOverwrite,
1131
+ searchOptions,
1132
+ additionalItems,
804
1133
  className,
805
- selectedDisplayOverwrite
1134
+ triggerClassName,
1135
+ hintTextClassName,
1136
+ ...menuProps
806
1137
  }) => {
807
- const triggerRef = (0, import_react9.useRef)(null);
808
- const menuRef = (0, import_react9.useRef)(null);
809
- const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
810
- useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
811
1138
  const selectedOption = options.find((option) => option.value === value);
812
1139
  if (value !== void 0 && selectedOption === void 0 && selectedDisplayOverwrite === void 0) {
813
1140
  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");
814
1141
  }
815
1142
  const isShowingHint = !selectedDisplayOverwrite && !selectedOption?.label;
816
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_clsx6.default)(className), children: [
817
- label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Label, { ...label, labelType: label.labelType ?? "labelBig", className: (0, import_clsx6.default)("mb-1", label.className) }),
818
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative", children: [
819
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
820
- "button",
821
- {
822
- ref: triggerRef,
823
- className: (0, import_clsx6.default)(
824
- "btn-md justify-between w-full border-2",
825
- {
826
- "rounded-b-lg": !open,
827
- "bg-menu-background border-menu-border hover:border-primary": !isDisabled,
828
- "bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": isDisabled
829
- }
830
- ),
831
- onClick: () => setIsOpen(!isOpen),
832
- disabled: isDisabled,
833
- children: [
834
- !isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? selectedOption?.label }),
835
- isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "textstyle-description", children: hintText }),
836
- isOpen ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.ChevronUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.ChevronDown, {})
837
- ]
838
- }
839
- ),
840
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
841
- "div",
842
- {
843
- ref: menuRef,
844
- 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",
845
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
846
- SearchableList,
847
- {
848
- list: options,
849
- minimumItemsForSearch: isSearchEnabled ? void 0 : options.length,
850
- searchMapping: (item) => item.searchTags,
851
- itemMapper: (option, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
852
- Tile,
1143
+ const { result, search, setSearch } = useSearch({
1144
+ list: options,
1145
+ searchMapping: (0, import_react13.useCallback)((item) => item.searchTags, []),
1146
+ ...searchOptions
1147
+ });
1148
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_clsx8.default)(className), children: [
1149
+ label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Label, { ...label, labelType: label.labelType ?? "labelBig", className: (0, import_clsx8.default)("mb-1", label.className) }),
1150
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1151
+ Menu,
1152
+ {
1153
+ ...menuProps,
1154
+ trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1155
+ "button",
1156
+ {
1157
+ ref,
1158
+ className: (0, import_clsx8.default)(
1159
+ "btn-md justify-between w-full border-2",
1160
+ {
1161
+ "rounded-b-lg": !open,
1162
+ "bg-menu-background text-menu-text border-menu-border hover:border-primary": !disabled,
1163
+ "bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": disabled
1164
+ },
1165
+ triggerClassName
1166
+ ),
1167
+ onClick: toggleOpen,
1168
+ disabled,
1169
+ children: [
1170
+ !isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? selectedOption?.label }),
1171
+ isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: (0, import_clsx8.default)("textstyle-description", hintTextClassName), children: hintText }),
1172
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ExpansionIcon, { isExpanded: isOpen })
1173
+ ]
1174
+ }
1175
+ ),
1176
+ menuClassName: (0, import_clsx8.default)("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
1177
+ children: (bag) => {
1178
+ const { close } = bag;
1179
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1180
+ !searchOptions?.disabled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1181
+ SearchBar,
1182
+ {
1183
+ value: search,
1184
+ onChangeText: setSearch,
1185
+ autoFocus: true
1186
+ }
1187
+ ),
1188
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-col-2 overflow-y-auto", children: [
1189
+ result.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1190
+ SelectTile,
853
1191
  {
854
- isSelected: selectedOption?.value === option.value,
855
- className: "px-2 py-1 rounded-md",
856
- disabledClassName: "text-disabled-text cursor-not-allowed",
857
- title: { value: option.label, className: "font-semibold" },
1192
+ isSelected: option === selectedOption,
1193
+ title: { value: option.label },
858
1194
  onClick: () => {
859
1195
  onChange(option.value);
860
- setIsOpen(false);
1196
+ close();
861
1197
  },
862
- isDisabled: option.disabled
1198
+ disabled: option.disabled
863
1199
  },
864
1200
  index
865
- )
866
- }
867
- )
1201
+ )),
1202
+ additionalItems && additionalItems({ ...bag, search, selected: value })
1203
+ ] })
1204
+ ] });
868
1205
  }
869
- )
870
- ] })
1206
+ }
1207
+ )
871
1208
  ] });
872
1209
  };
873
1210
 
874
1211
  // src/components/layout-and-navigation/Overlay.tsx
875
- var import_react11 = require("react");
876
- var import_react_dom = __toESM(require("react-dom"));
877
- var import_clsx8 = __toESM(require("clsx"));
878
-
879
- // src/hooks/useHoverState.ts
880
- var import_react10 = require("react");
881
- var defaultUseHoverStateProps = {
882
- closingDelay: 200,
883
- isDisabled: false
884
- };
885
- var useHoverState = (props = void 0) => {
886
- const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
887
- const [isHovered, setIsHovered] = (0, import_react10.useState)(false);
888
- const [timer, setTimer] = (0, import_react10.useState)();
889
- const onMouseEnter = () => {
890
- if (isDisabled) {
891
- return;
892
- }
893
- clearTimeout(timer);
894
- setIsHovered(true);
895
- };
896
- const onMouseLeave = () => {
897
- if (isDisabled) {
898
- return;
899
- }
900
- setTimer(setTimeout(() => {
901
- setIsHovered(false);
902
- }, closingDelay));
903
- };
904
- (0, import_react10.useEffect)(() => {
905
- if (timer) {
906
- return () => {
907
- clearTimeout(timer);
908
- };
909
- }
910
- });
911
- (0, import_react10.useEffect)(() => {
912
- if (timer) {
913
- clearTimeout(timer);
914
- }
915
- }, [isDisabled]);
916
- return {
917
- isHovered,
918
- setIsHovered,
919
- handlers: { onMouseEnter, onMouseLeave }
920
- };
921
- };
1212
+ var import_react15 = require("react");
1213
+ var import_react_dom2 = __toESM(require("react-dom"));
1214
+ var import_clsx10 = __toESM(require("clsx"));
922
1215
 
923
1216
  // src/components/user-action/Tooltip.tsx
924
- var import_clsx7 = require("clsx");
925
- var import_jsx_runtime8 = require("react/jsx-runtime");
1217
+ var import_clsx9 = require("clsx");
1218
+ var import_jsx_runtime10 = require("react/jsx-runtime");
926
1219
  var Tooltip = ({
927
1220
  tooltip,
928
1221
  children,
@@ -952,17 +1245,17 @@ var Tooltip = ({
952
1245
  left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
953
1246
  right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
954
1247
  };
955
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1248
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
956
1249
  "div",
957
1250
  {
958
- className: (0, import_clsx7.clsx)("relative inline-block", containerClassName),
1251
+ className: (0, import_clsx9.clsx)("relative inline-block", containerClassName),
959
1252
  ...handlers,
960
1253
  children: [
961
1254
  children,
962
- isHovered && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1255
+ isHovered && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
963
1256
  "div",
964
1257
  {
965
- className: (0, import_clsx7.clsx)(
1258
+ className: (0, import_clsx9.clsx)(
966
1259
  `opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
967
1260
  animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,
968
1261
  positionClasses[position],
@@ -971,10 +1264,10 @@ var Tooltip = ({
971
1264
  style: { zIndex, animationDelay: animationDelay + "ms" },
972
1265
  children: [
973
1266
  tooltip,
974
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1267
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
975
1268
  "div",
976
1269
  {
977
- className: (0, import_clsx7.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
1270
+ className: (0, import_clsx9.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
978
1271
  style: { ...triangleStyle[position], zIndex: zIndex + 1 }
979
1272
  }
980
1273
  )
@@ -988,24 +1281,24 @@ var Tooltip = ({
988
1281
 
989
1282
  // src/components/layout-and-navigation/Overlay.tsx
990
1283
  var import_lucide_react4 = require("lucide-react");
991
- var import_jsx_runtime9 = require("react/jsx-runtime");
1284
+ var import_jsx_runtime11 = require("react/jsx-runtime");
992
1285
  var Overlay = ({
993
1286
  children,
994
1287
  isOpen,
995
1288
  onBackgroundClick,
996
1289
  backgroundClassName
997
1290
  }) => {
998
- const [root, setRoot] = (0, import_react11.useState)();
999
- (0, import_react11.useEffect)(() => {
1291
+ const [root, setRoot] = (0, import_react15.useState)();
1292
+ (0, import_react15.useEffect)(() => {
1000
1293
  setRoot(document.body);
1001
1294
  }, []);
1002
1295
  if (!root || !isOpen) return null;
1003
- return import_react_dom.default.createPortal(
1004
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_clsx8.default)("fixed inset-0 z-[9999]"), children: [
1005
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1296
+ return import_react_dom2.default.createPortal(
1297
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: (0, import_clsx10.default)("fixed inset-0 z-[9999]"), children: [
1298
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1006
1299
  "div",
1007
1300
  {
1008
- className: (0, import_clsx8.default)("fixed inset-0 h-screen w-screen bg-black/30", backgroundClassName),
1301
+ className: (0, import_clsx10.default)("fixed inset-0 h-screen w-screen bg-overlay-shadow", backgroundClassName),
1009
1302
  onClick: onBackgroundClick
1010
1303
  }
1011
1304
  ),
@@ -1033,21 +1326,21 @@ var OverlayHeader = ({
1033
1326
  }) => {
1034
1327
  const translation = useTranslation([defaultModalHeaderTranslation], overwriteTranslation);
1035
1328
  const hasTitleRow = !!title || !!titleText || !!onClose;
1036
- const titleRow = /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "row justify-between items-start gap-x-8", children: [
1037
- title ?? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1329
+ const titleRow = /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-row-8 justify-between items-start", children: [
1330
+ title ?? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1038
1331
  "h2",
1039
1332
  {
1040
- className: (0, import_clsx8.default)("textstyle-title-lg", {
1333
+ className: (0, import_clsx10.default)("textstyle-title-lg", {
1041
1334
  "mb-1": description || descriptionText
1042
1335
  }),
1043
1336
  children: titleText
1044
1337
  }
1045
1338
  ),
1046
- !!onClose && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Tooltip, { tooltip: translation("close"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconButton, { color: "neutral", size: "small", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.X, { className: "w-full h-full" }) }) })
1339
+ !!onClose && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Tooltip, { tooltip: translation("close"), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconButton, { color: "neutral", size: "small", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.X, { className: "w-full h-full" }) }) })
1047
1340
  ] });
1048
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "col", children: [
1341
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-col-2", children: [
1049
1342
  hasTitleRow && titleRow,
1050
- description ?? (descriptionText && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "textstyle-description", children: descriptionText }))
1343
+ description ?? (descriptionText && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "textstyle-description", children: descriptionText }))
1051
1344
  ] });
1052
1345
  };
1053
1346
  var Modal = ({
@@ -1058,8 +1351,8 @@ var Modal = ({
1058
1351
  backgroundClassName,
1059
1352
  headerProps
1060
1353
  }) => {
1061
- const ref = (0, import_react11.useRef)(null);
1062
- (0, import_react11.useEffect)(() => {
1354
+ const ref = (0, import_react15.useRef)(null);
1355
+ (0, import_react15.useEffect)(() => {
1063
1356
  if (!isOpen) return;
1064
1357
  const modal = ref.current;
1065
1358
  if (!modal) {
@@ -1096,25 +1389,25 @@ var Modal = ({
1096
1389
  overlayStack = overlayStack.filter((m) => m !== modal);
1097
1390
  };
1098
1391
  }, [isOpen, onClose]);
1099
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1392
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1100
1393
  Overlay,
1101
1394
  {
1102
1395
  isOpen,
1103
1396
  onBackgroundClick: onClose,
1104
1397
  backgroundClassName,
1105
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1398
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1106
1399
  "div",
1107
1400
  {
1108
1401
  ref,
1109
1402
  tabIndex: -1,
1110
- className: (0, import_clsx8.default)(
1111
- "fixed left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 col p-4 bg-overlay-background text-overlay-text rounded-xl shadow-xl",
1403
+ className: (0, import_clsx10.default)(
1404
+ "flex-col-2 fixed left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 p-4 bg-overlay-background text-overlay-text rounded-xl shadow-xl animate-pop-in",
1112
1405
  className
1113
1406
  ),
1114
1407
  role: "dialog",
1115
1408
  "aria-modal": true,
1116
1409
  children: [
1117
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(OverlayHeader, { ...headerProps, onClose }),
1410
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(OverlayHeader, { ...headerProps, onClose }),
1118
1411
  children
1119
1412
  ]
1120
1413
  }
@@ -1124,7 +1417,7 @@ var Modal = ({
1124
1417
  };
1125
1418
 
1126
1419
  // src/components/modals/LanguageModal.tsx
1127
- var import_jsx_runtime10 = require("react/jsx-runtime");
1420
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1128
1421
  var defaultLanguageModalTranslation = {
1129
1422
  en: {
1130
1423
  language: "Language",
@@ -1147,7 +1440,7 @@ var LanguageModal = ({
1147
1440
  }) => {
1148
1441
  const { language, setLanguage } = useLanguage();
1149
1442
  const translation = useTranslation([defaultLanguageModalTranslation], overwriteTranslation);
1150
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1443
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1151
1444
  Modal,
1152
1445
  {
1153
1446
  headerProps: {
@@ -1157,8 +1450,8 @@ var LanguageModal = ({
1157
1450
  },
1158
1451
  onClose,
1159
1452
  ...modalProps,
1160
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w-64", children: [
1161
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1453
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "w-64", children: [
1454
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1162
1455
  Select,
1163
1456
  {
1164
1457
  className: "mt-2",
@@ -1167,7 +1460,7 @@ var LanguageModal = ({
1167
1460
  onChange: (language2) => setLanguage(language2)
1168
1461
  }
1169
1462
  ),
1170
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
1463
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
1171
1464
  ] })
1172
1465
  }
1173
1466
  );