@helpwave/hightide 0.1.25 → 0.1.27

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 (664) hide show
  1. package/README.md +1 -1
  2. package/dist/components/branding/HelpwaveBadge.d.mts +4 -5
  3. package/dist/components/branding/HelpwaveBadge.d.ts +4 -5
  4. package/dist/components/branding/HelpwaveBadge.js +46 -87
  5. package/dist/components/branding/HelpwaveBadge.js.map +1 -1
  6. package/dist/components/branding/HelpwaveBadge.mjs +46 -89
  7. package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
  8. package/dist/components/date/DatePicker.d.mts +1 -1
  9. package/dist/components/date/DatePicker.d.ts +1 -1
  10. package/dist/components/date/DatePicker.js +65 -14
  11. package/dist/components/date/DatePicker.js.map +1 -1
  12. package/dist/components/date/DatePicker.mjs +66 -15
  13. package/dist/components/date/DatePicker.mjs.map +1 -1
  14. package/dist/components/date/DayPicker.d.mts +1 -1
  15. package/dist/components/date/DayPicker.d.ts +1 -1
  16. package/dist/components/date/DayPicker.js +3 -3
  17. package/dist/components/date/DayPicker.js.map +1 -1
  18. package/dist/components/date/DayPicker.mjs +3 -3
  19. package/dist/components/date/DayPicker.mjs.map +1 -1
  20. package/dist/components/date/TimeDisplay.js.map +1 -1
  21. package/dist/components/date/TimeDisplay.mjs.map +1 -1
  22. package/dist/components/date/TimePicker.js +2 -2
  23. package/dist/components/date/TimePicker.js.map +1 -1
  24. package/dist/components/date/TimePicker.mjs +2 -2
  25. package/dist/components/date/TimePicker.mjs.map +1 -1
  26. package/dist/components/date/YearMonthPicker.js +59 -8
  27. package/dist/components/date/YearMonthPicker.js.map +1 -1
  28. package/dist/components/date/YearMonthPicker.mjs +60 -9
  29. package/dist/components/date/YearMonthPicker.mjs.map +1 -1
  30. package/dist/components/{dialogs → dialog}/ConfirmDialog.d.mts +9 -8
  31. package/dist/components/{dialogs → dialog}/ConfirmDialog.d.ts +9 -8
  32. package/dist/components/dialog/ConfirmDialog.js +938 -0
  33. package/dist/components/dialog/ConfirmDialog.js.map +1 -0
  34. package/dist/components/dialog/ConfirmDialog.mjs +902 -0
  35. package/dist/components/dialog/ConfirmDialog.mjs.map +1 -0
  36. package/dist/components/dialog/Dialog.d.mts +27 -0
  37. package/dist/components/dialog/Dialog.d.ts +27 -0
  38. package/dist/components/dialog/Dialog.js +879 -0
  39. package/dist/components/dialog/Dialog.js.map +1 -0
  40. package/dist/components/dialog/Dialog.mjs +845 -0
  41. package/dist/components/dialog/Dialog.mjs.map +1 -0
  42. package/dist/components/dialog/DiscardChangesDialog.d.mts +24 -0
  43. package/dist/components/dialog/DiscardChangesDialog.d.ts +24 -0
  44. package/dist/components/dialog/DiscardChangesDialog.js +966 -0
  45. package/dist/components/dialog/DiscardChangesDialog.js.map +1 -0
  46. package/dist/components/dialog/DiscardChangesDialog.mjs +930 -0
  47. package/dist/components/dialog/DiscardChangesDialog.mjs.map +1 -0
  48. package/dist/components/dialog/InputDialog.d.mts +22 -0
  49. package/dist/components/dialog/InputDialog.d.ts +22 -0
  50. package/dist/components/dialog/InputDialog.js +1139 -0
  51. package/dist/components/dialog/InputDialog.js.map +1 -0
  52. package/dist/components/dialog/InputDialog.mjs +1103 -0
  53. package/dist/components/dialog/InputDialog.mjs.map +1 -0
  54. package/dist/components/dialog/LanguageDialog.d.mts +25 -0
  55. package/dist/components/dialog/LanguageDialog.d.ts +25 -0
  56. package/dist/components/dialog/LanguageDialog.js +1697 -0
  57. package/dist/components/dialog/LanguageDialog.js.map +1 -0
  58. package/dist/components/dialog/LanguageDialog.mjs +1671 -0
  59. package/dist/components/dialog/LanguageDialog.mjs.map +1 -0
  60. package/dist/components/dialog/ThemeDialog.d.mts +26 -0
  61. package/dist/components/dialog/ThemeDialog.d.ts +26 -0
  62. package/dist/components/dialog/ThemeDialog.js +1751 -0
  63. package/dist/components/dialog/ThemeDialog.js.map +1 -0
  64. package/dist/components/dialog/ThemeDialog.mjs +1725 -0
  65. package/dist/components/dialog/ThemeDialog.mjs.map +1 -0
  66. package/dist/components/dialog/index.d.mts +17 -0
  67. package/dist/components/dialog/index.d.ts +17 -0
  68. package/dist/components/dialog/index.js +2098 -0
  69. package/dist/components/dialog/index.js.map +1 -0
  70. package/dist/components/dialog/index.mjs +2067 -0
  71. package/dist/components/dialog/index.mjs.map +1 -0
  72. package/dist/components/form/FormElementWrapper.d.mts +29 -0
  73. package/dist/components/form/FormElementWrapper.d.ts +29 -0
  74. package/dist/components/form/FormElementWrapper.js +98 -0
  75. package/dist/components/form/FormElementWrapper.js.map +1 -0
  76. package/dist/components/form/FormElementWrapper.mjs +64 -0
  77. package/dist/components/form/FormElementWrapper.mjs.map +1 -0
  78. package/dist/components/icons-and-geometry/Avatar.js +498 -2886
  79. package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
  80. package/dist/components/icons-and-geometry/Avatar.mjs +490 -2878
  81. package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
  82. package/dist/components/icons-and-geometry/{Helpwave.d.mts → HelpwaveLogo.d.mts} +3 -3
  83. package/dist/components/icons-and-geometry/{Helpwave.d.ts → HelpwaveLogo.d.ts} +3 -3
  84. package/dist/components/icons-and-geometry/{Helpwave.js → HelpwaveLogo.js} +21 -22
  85. package/dist/components/icons-and-geometry/HelpwaveLogo.js.map +1 -0
  86. package/dist/components/icons-and-geometry/{Helpwave.mjs → HelpwaveLogo.mjs} +17 -18
  87. package/dist/components/icons-and-geometry/HelpwaveLogo.mjs.map +1 -0
  88. package/dist/components/icons-and-geometry/Ring.js +1 -1
  89. package/dist/components/icons-and-geometry/Ring.js.map +1 -1
  90. package/dist/components/icons-and-geometry/Ring.mjs +1 -1
  91. package/dist/components/icons-and-geometry/Ring.mjs.map +1 -1
  92. package/dist/components/icons-and-geometry/Tag.js +8 -20
  93. package/dist/components/icons-and-geometry/Tag.js.map +1 -1
  94. package/dist/components/icons-and-geometry/Tag.mjs +8 -20
  95. package/dist/components/icons-and-geometry/Tag.mjs.map +1 -1
  96. package/dist/components/layout/Carousel.d.mts +33 -0
  97. package/dist/components/layout/Carousel.d.ts +33 -0
  98. package/dist/components/layout/Carousel.js +684 -0
  99. package/dist/components/layout/Carousel.js.map +1 -0
  100. package/dist/components/layout/Carousel.mjs +659 -0
  101. package/dist/components/layout/Carousel.mjs.map +1 -0
  102. package/dist/components/{layout-and-navigation → layout}/Chip.d.mts +8 -5
  103. package/dist/components/{layout-and-navigation → layout}/Chip.d.ts +8 -5
  104. package/dist/components/{layout-and-navigation → layout}/Chip.js +18 -5
  105. package/dist/components/layout/Chip.js.map +1 -0
  106. package/dist/components/{layout-and-navigation → layout}/Chip.mjs +18 -5
  107. package/dist/components/layout/Chip.mjs.map +1 -0
  108. package/dist/components/{layout-and-navigation → layout}/DividerInserter.js +1 -1
  109. package/dist/components/layout/DividerInserter.js.map +1 -0
  110. package/dist/components/{layout-and-navigation → layout}/DividerInserter.mjs +1 -1
  111. package/dist/components/layout/DividerInserter.mjs.map +1 -0
  112. package/dist/components/{layout-and-navigation → layout}/Expandable.d.mts +13 -10
  113. package/dist/components/{layout-and-navigation → layout}/Expandable.d.ts +13 -10
  114. package/dist/components/{layout-and-navigation → layout}/Expandable.js +20 -7
  115. package/dist/components/layout/Expandable.js.map +1 -0
  116. package/dist/components/{layout-and-navigation → layout}/Expandable.mjs +21 -8
  117. package/dist/components/layout/Expandable.mjs.map +1 -0
  118. package/dist/components/{layout-and-navigation → layout}/FAQSection.js +26 -13
  119. package/dist/components/layout/FAQSection.js.map +1 -0
  120. package/dist/components/{layout-and-navigation → layout}/FAQSection.mjs +27 -14
  121. package/dist/components/layout/FAQSection.mjs.map +1 -0
  122. package/dist/components/layout/FloatingContainer.d.mts +38 -0
  123. package/dist/components/layout/FloatingContainer.d.ts +38 -0
  124. package/dist/components/layout/FloatingContainer.js +219 -0
  125. package/dist/components/layout/FloatingContainer.js.map +1 -0
  126. package/dist/components/layout/FloatingContainer.mjs +195 -0
  127. package/dist/components/layout/FloatingContainer.mjs.map +1 -0
  128. package/dist/components/layout/ListBox.d.mts +44 -0
  129. package/dist/components/layout/ListBox.d.ts +44 -0
  130. package/dist/components/layout/ListBox.js +329 -0
  131. package/dist/components/layout/ListBox.js.map +1 -0
  132. package/dist/components/layout/ListBox.mjs +290 -0
  133. package/dist/components/layout/ListBox.mjs.map +1 -0
  134. package/dist/components/{layout-and-navigation → layout}/MarkdownInterpreter.js +1 -1
  135. package/dist/components/layout/MarkdownInterpreter.js.map +1 -0
  136. package/dist/components/{layout-and-navigation → layout}/MarkdownInterpreter.mjs +1 -1
  137. package/dist/components/layout/MarkdownInterpreter.mjs.map +1 -0
  138. package/dist/components/layout/ScrollArea.d.mts +15 -0
  139. package/dist/components/layout/ScrollArea.d.ts +15 -0
  140. package/dist/components/layout/ScrollArea.js +1252 -0
  141. package/dist/components/layout/ScrollArea.js.map +1 -0
  142. package/dist/components/layout/ScrollArea.mjs +1216 -0
  143. package/dist/components/layout/ScrollArea.mjs.map +1 -0
  144. package/dist/components/{layout-and-navigation → layout}/TextImage.js +6 -4
  145. package/dist/components/layout/TextImage.js.map +1 -0
  146. package/dist/components/{layout-and-navigation → layout}/TextImage.mjs +5 -3
  147. package/dist/components/layout/TextImage.mjs.map +1 -0
  148. package/dist/components/{layout-and-navigation → layout}/VerticalDivider.js +1 -1
  149. package/dist/components/layout/VerticalDivider.js.map +1 -0
  150. package/dist/components/{layout-and-navigation → layout}/VerticalDivider.mjs +1 -1
  151. package/dist/components/layout/VerticalDivider.mjs.map +1 -0
  152. package/dist/components/loading-states/ErrorComponent.js.map +1 -1
  153. package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
  154. package/dist/components/loading-states/LoadingAndErrorComponent.d.mts +1 -1
  155. package/dist/components/loading-states/LoadingAndErrorComponent.d.ts +1 -1
  156. package/dist/components/loading-states/LoadingAnimation.js +18 -17
  157. package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
  158. package/dist/components/loading-states/LoadingAnimation.mjs +18 -17
  159. package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
  160. package/dist/components/loading-states/LoadingButton.js +55 -18
  161. package/dist/components/loading-states/LoadingButton.js.map +1 -1
  162. package/dist/components/loading-states/LoadingButton.mjs +55 -18
  163. package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
  164. package/dist/components/{layout-and-navigation → navigation}/BreadCrumb.js +668 -23
  165. package/dist/components/navigation/BreadCrumb.js.map +1 -0
  166. package/dist/components/{layout-and-navigation → navigation}/BreadCrumb.mjs +668 -23
  167. package/dist/components/navigation/BreadCrumb.mjs.map +1 -0
  168. package/dist/components/navigation/Navigation.d.mts +21 -0
  169. package/dist/components/navigation/Navigation.d.ts +21 -0
  170. package/dist/components/navigation/Navigation.js +4018 -0
  171. package/dist/components/navigation/Navigation.js.map +1 -0
  172. package/dist/components/navigation/Navigation.mjs +4012 -0
  173. package/dist/components/navigation/Navigation.mjs.map +1 -0
  174. package/dist/components/{layout-and-navigation → navigation}/Pagination.js +107 -192
  175. package/dist/components/navigation/Pagination.js.map +1 -0
  176. package/dist/components/{layout-and-navigation → navigation}/Pagination.mjs +102 -187
  177. package/dist/components/navigation/Pagination.mjs.map +1 -0
  178. package/dist/components/{layout-and-navigation → navigation}/StepperBar.js +44 -4
  179. package/dist/components/navigation/StepperBar.js.map +1 -0
  180. package/dist/components/{layout-and-navigation → navigation}/StepperBar.mjs +44 -4
  181. package/dist/components/navigation/StepperBar.mjs.map +1 -0
  182. package/dist/components/properties/CheckboxProperty.js +890 -135
  183. package/dist/components/properties/CheckboxProperty.js.map +1 -1
  184. package/dist/components/properties/CheckboxProperty.mjs +897 -142
  185. package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
  186. package/dist/components/properties/DateProperty.js +153 -198
  187. package/dist/components/properties/DateProperty.js.map +1 -1
  188. package/dist/components/properties/DateProperty.mjs +146 -191
  189. package/dist/components/properties/DateProperty.mjs.map +1 -1
  190. package/dist/components/properties/MultiSelectProperty.d.mts +5 -10
  191. package/dist/components/properties/MultiSelectProperty.d.ts +5 -10
  192. package/dist/components/properties/MultiSelectProperty.js +1156 -1160
  193. package/dist/components/properties/MultiSelectProperty.js.map +1 -1
  194. package/dist/components/properties/MultiSelectProperty.mjs +1169 -1163
  195. package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
  196. package/dist/components/properties/NumberProperty.js +155 -201
  197. package/dist/components/properties/NumberProperty.js.map +1 -1
  198. package/dist/components/properties/NumberProperty.mjs +148 -194
  199. package/dist/components/properties/NumberProperty.mjs.map +1 -1
  200. package/dist/components/properties/PropertyBase.js +49 -9
  201. package/dist/components/properties/PropertyBase.js.map +1 -1
  202. package/dist/components/properties/PropertyBase.mjs +49 -9
  203. package/dist/components/properties/PropertyBase.mjs.map +1 -1
  204. package/dist/components/properties/SelectProperty.d.mts +5 -8
  205. package/dist/components/properties/SelectProperty.d.ts +5 -8
  206. package/dist/components/properties/SelectProperty.js +1062 -836
  207. package/dist/components/properties/SelectProperty.js.map +1 -1
  208. package/dist/components/properties/SelectProperty.mjs +1077 -841
  209. package/dist/components/properties/SelectProperty.mjs.map +1 -1
  210. package/dist/components/properties/TextProperty.js +97 -100
  211. package/dist/components/properties/TextProperty.js.map +1 -1
  212. package/dist/components/properties/TextProperty.mjs +100 -103
  213. package/dist/components/properties/TextProperty.mjs.map +1 -1
  214. package/dist/components/table/Table.js +1619 -994
  215. package/dist/components/table/Table.js.map +1 -1
  216. package/dist/components/table/Table.mjs +1626 -1001
  217. package/dist/components/table/Table.mjs.map +1 -1
  218. package/dist/components/table/TableFilterButton.js +116 -201
  219. package/dist/components/table/TableFilterButton.js.map +1 -1
  220. package/dist/components/table/TableFilterButton.mjs +105 -190
  221. package/dist/components/table/TableFilterButton.mjs.map +1 -1
  222. package/dist/components/table/TableSortButton.js +4 -3
  223. package/dist/components/table/TableSortButton.js.map +1 -1
  224. package/dist/components/table/TableSortButton.mjs +4 -3
  225. package/dist/components/table/TableSortButton.mjs.map +1 -1
  226. package/dist/components/user-action/Button.d.mts +15 -11
  227. package/dist/components/user-action/Button.d.ts +15 -11
  228. package/dist/components/user-action/Button.js +10 -9
  229. package/dist/components/user-action/Button.js.map +1 -1
  230. package/dist/components/user-action/Button.mjs +10 -9
  231. package/dist/components/user-action/Button.mjs.map +1 -1
  232. package/dist/components/user-action/Checkbox.d.mts +9 -25
  233. package/dist/components/user-action/Checkbox.d.ts +9 -25
  234. package/dist/components/user-action/Checkbox.js +793 -103
  235. package/dist/components/user-action/Checkbox.js.map +1 -1
  236. package/dist/components/user-action/Checkbox.mjs +794 -104
  237. package/dist/components/user-action/Checkbox.mjs.map +1 -1
  238. package/dist/components/user-action/CopyToClipboardWrapper.js +3 -1
  239. package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
  240. package/dist/components/user-action/CopyToClipboardWrapper.mjs +3 -1
  241. package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
  242. package/dist/components/user-action/DateAndTimePicker.d.mts +1 -1
  243. package/dist/components/user-action/DateAndTimePicker.d.ts +1 -1
  244. package/dist/components/user-action/DateAndTimePicker.js +67 -14
  245. package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
  246. package/dist/components/user-action/DateAndTimePicker.mjs +68 -15
  247. package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
  248. package/dist/components/user-action/Label.d.mts +6 -8
  249. package/dist/components/user-action/Label.d.ts +6 -8
  250. package/dist/components/user-action/Label.js +4 -6
  251. package/dist/components/user-action/Label.js.map +1 -1
  252. package/dist/components/user-action/Label.mjs +4 -6
  253. package/dist/components/user-action/Label.mjs.map +1 -1
  254. package/dist/components/user-action/Menu.d.mts +2 -2
  255. package/dist/components/user-action/Menu.d.ts +2 -2
  256. package/dist/components/user-action/Menu.js +1 -1
  257. package/dist/components/user-action/Menu.js.map +1 -1
  258. package/dist/components/user-action/Menu.mjs +1 -1
  259. package/dist/components/user-action/Menu.mjs.map +1 -1
  260. package/dist/components/user-action/ScrollPicker.js +8 -6
  261. package/dist/components/user-action/ScrollPicker.js.map +1 -1
  262. package/dist/components/user-action/ScrollPicker.mjs +8 -6
  263. package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
  264. package/dist/components/user-action/SearchBar.d.mts +1 -2
  265. package/dist/components/user-action/SearchBar.d.ts +1 -2
  266. package/dist/components/user-action/SearchBar.js +93 -178
  267. package/dist/components/user-action/SearchBar.js.map +1 -1
  268. package/dist/components/user-action/SearchBar.mjs +86 -171
  269. package/dist/components/user-action/SearchBar.mjs.map +1 -1
  270. package/dist/components/user-action/Textarea.d.mts +22 -11
  271. package/dist/components/user-action/Textarea.d.ts +22 -11
  272. package/dist/components/user-action/Textarea.js +101 -92
  273. package/dist/components/user-action/Textarea.js.map +1 -1
  274. package/dist/components/user-action/Textarea.mjs +100 -92
  275. package/dist/components/user-action/Textarea.mjs.map +1 -1
  276. package/dist/components/user-action/input/Input.d.mts +37 -0
  277. package/dist/components/user-action/input/Input.d.ts +37 -0
  278. package/dist/components/user-action/input/Input.js +244 -0
  279. package/dist/components/user-action/input/Input.js.map +1 -0
  280. package/dist/components/user-action/input/Input.mjs +209 -0
  281. package/dist/components/user-action/input/Input.mjs.map +1 -0
  282. package/dist/components/user-action/input/InsideLabelInput.d.mts +20 -0
  283. package/dist/components/user-action/input/InsideLabelInput.d.ts +20 -0
  284. package/dist/components/user-action/input/InsideLabelInput.js +295 -0
  285. package/dist/components/user-action/input/InsideLabelInput.js.map +1 -0
  286. package/dist/components/user-action/input/InsideLabelInput.mjs +260 -0
  287. package/dist/components/user-action/input/InsideLabelInput.mjs.map +1 -0
  288. package/dist/components/user-action/input/ToggleableInput.d.mts +22 -0
  289. package/dist/components/user-action/input/ToggleableInput.d.ts +22 -0
  290. package/dist/components/user-action/{Input.js → input/ToggleableInput.js} +136 -171
  291. package/dist/components/user-action/input/ToggleableInput.js.map +1 -0
  292. package/dist/components/user-action/input/ToggleableInput.mjs +264 -0
  293. package/dist/components/user-action/input/ToggleableInput.mjs.map +1 -0
  294. package/dist/components/user-action/select/Select.d.mts +102 -0
  295. package/dist/components/user-action/select/Select.d.ts +102 -0
  296. package/dist/components/user-action/select/Select.js +1367 -0
  297. package/dist/components/user-action/select/Select.js.map +1 -0
  298. package/dist/components/user-action/select/Select.mjs +1333 -0
  299. package/dist/components/user-action/select/Select.mjs.map +1 -0
  300. package/dist/components/utils/FocusTrap.d.mts +28 -0
  301. package/dist/components/utils/FocusTrap.d.ts +28 -0
  302. package/dist/components/utils/FocusTrap.js +252 -0
  303. package/dist/components/utils/FocusTrap.js.map +1 -0
  304. package/dist/components/utils/FocusTrap.mjs +229 -0
  305. package/dist/components/utils/FocusTrap.mjs.map +1 -0
  306. package/dist/components/utils/Transition.d.mts +26 -0
  307. package/dist/components/utils/Transition.d.ts +26 -0
  308. package/dist/components/utils/Transition.js +74 -0
  309. package/dist/components/utils/Transition.js.map +1 -0
  310. package/dist/components/utils/Transition.mjs +50 -0
  311. package/dist/components/utils/Transition.mjs.map +1 -0
  312. package/dist/hooks/focus/useFocusGuards.d.mts +3 -0
  313. package/dist/hooks/focus/useFocusGuards.d.ts +3 -0
  314. package/dist/hooks/focus/useFocusGuards.js +74 -0
  315. package/dist/hooks/focus/useFocusGuards.js.map +1 -0
  316. package/dist/hooks/focus/useFocusGuards.mjs +50 -0
  317. package/dist/hooks/focus/useFocusGuards.mjs.map +1 -0
  318. package/dist/hooks/{useFocusManagement.js → focus/useFocusManagement.js} +1 -1
  319. package/dist/hooks/focus/useFocusManagement.js.map +1 -0
  320. package/dist/hooks/{useFocusManagement.mjs → focus/useFocusManagement.mjs} +1 -1
  321. package/dist/hooks/focus/useFocusManagement.mjs.map +1 -0
  322. package/dist/hooks/{useFocusOnceVisible.js → focus/useFocusOnceVisible.js} +1 -1
  323. package/dist/hooks/focus/useFocusOnceVisible.js.map +1 -0
  324. package/dist/hooks/{useFocusOnceVisible.mjs → focus/useFocusOnceVisible.mjs} +1 -1
  325. package/dist/hooks/focus/useFocusOnceVisible.mjs.map +1 -0
  326. package/dist/hooks/focus/useFocusTrap.d.mts +16 -0
  327. package/dist/hooks/focus/useFocusTrap.d.ts +16 -0
  328. package/dist/hooks/focus/useFocusTrap.js +233 -0
  329. package/dist/hooks/focus/useFocusTrap.js.map +1 -0
  330. package/dist/hooks/focus/useFocusTrap.mjs +210 -0
  331. package/dist/hooks/focus/useFocusTrap.mjs.map +1 -0
  332. package/dist/hooks/focus/useIsMounted.d.mts +3 -0
  333. package/dist/hooks/focus/useIsMounted.d.ts +3 -0
  334. package/dist/hooks/focus/useIsMounted.js +43 -0
  335. package/dist/hooks/focus/useIsMounted.js.map +1 -0
  336. package/dist/hooks/focus/useIsMounted.mjs +20 -0
  337. package/dist/hooks/focus/useIsMounted.mjs.map +1 -0
  338. package/dist/hooks/useFloatingElement.d.mts +22 -0
  339. package/dist/hooks/useFloatingElement.d.ts +22 -0
  340. package/dist/hooks/useFloatingElement.js +162 -0
  341. package/dist/hooks/useFloatingElement.js.map +1 -0
  342. package/dist/hooks/useFloatingElement.mjs +139 -0
  343. package/dist/hooks/useFloatingElement.mjs.map +1 -0
  344. package/dist/hooks/useLocalStorage.js +2 -2
  345. package/dist/hooks/useLocalStorage.js.map +1 -1
  346. package/dist/hooks/useLocalStorage.mjs +2 -2
  347. package/dist/hooks/useLocalStorage.mjs.map +1 -1
  348. package/dist/hooks/useLogOnce.d.mts +3 -4
  349. package/dist/hooks/useLogOnce.d.ts +3 -4
  350. package/dist/hooks/useLogOnce.js +5 -5
  351. package/dist/hooks/useLogOnce.js.map +1 -1
  352. package/dist/hooks/useLogOnce.mjs +5 -5
  353. package/dist/hooks/useLogOnce.mjs.map +1 -1
  354. package/dist/hooks/useRerender.d.mts +2 -2
  355. package/dist/hooks/useRerender.d.ts +2 -2
  356. package/dist/hooks/useSearch.d.mts +2 -2
  357. package/dist/hooks/useSearch.d.ts +2 -2
  358. package/dist/hooks/useSearch.js +1 -1
  359. package/dist/hooks/useSearch.js.map +1 -1
  360. package/dist/hooks/useSearch.mjs +1 -1
  361. package/dist/hooks/useSearch.mjs.map +1 -1
  362. package/dist/localization/LanguageProvider.d.mts +2 -2
  363. package/dist/localization/LanguageProvider.d.ts +2 -2
  364. package/dist/localization/LanguageProvider.js +2 -2
  365. package/dist/localization/LanguageProvider.js.map +1 -1
  366. package/dist/localization/LanguageProvider.mjs +2 -2
  367. package/dist/localization/LanguageProvider.mjs.map +1 -1
  368. package/dist/localization/defaults/form.d.mts +1 -0
  369. package/dist/localization/defaults/form.d.ts +1 -0
  370. package/dist/localization/defaults/form.js +2 -0
  371. package/dist/localization/defaults/form.js.map +1 -1
  372. package/dist/localization/defaults/form.mjs +2 -0
  373. package/dist/localization/defaults/form.mjs.map +1 -1
  374. package/dist/localization/useTranslation.js.map +1 -1
  375. package/dist/localization/useTranslation.mjs.map +1 -1
  376. package/dist/storybook/helper.d.mts +17 -0
  377. package/dist/storybook/helper.d.ts +17 -0
  378. package/dist/storybook/helper.js +61 -0
  379. package/dist/storybook/helper.js.map +1 -0
  380. package/dist/storybook/helper.mjs +37 -0
  381. package/dist/storybook/helper.mjs.map +1 -0
  382. package/dist/{css → style}/globals.css +836 -378
  383. package/dist/{css → style}/uncompiled/globals.css +80 -17
  384. package/dist/{css → style}/uncompiled/theme/colors-component.css +18 -4
  385. package/dist/{css → style}/uncompiled/theme/colors-semantic.css +2 -9
  386. package/dist/style/uncompiled/typography.css +171 -0
  387. package/dist/{css → style}/uncompiled/utitlity/animation.css +54 -42
  388. package/dist/{css → style}/uncompiled/utitlity/index.css +2 -1
  389. package/dist/{css → style}/uncompiled/utitlity/shadow.css +9 -1
  390. package/dist/style/uncompiled/utitlity/sizing.css +29 -0
  391. package/dist/theming/useTheme.d.mts +5 -3
  392. package/dist/theming/useTheme.d.ts +5 -3
  393. package/dist/theming/useTheme.js +42 -19
  394. package/dist/theming/useTheme.js.map +1 -1
  395. package/dist/theming/useTheme.mjs +40 -17
  396. package/dist/theming/useTheme.mjs.map +1 -1
  397. package/dist/{util → utils}/array.d.mts +1 -0
  398. package/dist/{util → utils}/array.d.ts +1 -0
  399. package/dist/{util → utils}/array.js +15 -2
  400. package/dist/utils/array.js.map +1 -0
  401. package/dist/{util → utils}/array.mjs +15 -2
  402. package/dist/utils/array.mjs.map +1 -0
  403. package/dist/utils/bagFunctions.d.mts +15 -0
  404. package/dist/utils/bagFunctions.d.ts +15 -0
  405. package/dist/{util/PropsWithFunctionChildren.js → utils/bagFunctions.js} +5 -5
  406. package/dist/utils/bagFunctions.js.map +1 -0
  407. package/dist/{util/PropsWithFunctionChildren.mjs → utils/bagFunctions.mjs} +2 -2
  408. package/dist/utils/bagFunctions.mjs.map +1 -0
  409. package/dist/{util → utils}/builder.js +1 -1
  410. package/dist/utils/builder.js.map +1 -0
  411. package/dist/{util → utils}/builder.mjs +1 -1
  412. package/dist/utils/builder.mjs.map +1 -0
  413. package/dist/{util → utils}/date.js +3 -3
  414. package/dist/utils/date.js.map +1 -0
  415. package/dist/{util → utils}/date.mjs +2 -2
  416. package/dist/utils/date.mjs.map +1 -0
  417. package/dist/{util → utils}/easeFunctions.js +5 -4
  418. package/dist/utils/easeFunctions.js.map +1 -0
  419. package/dist/{util → utils}/easeFunctions.mjs +4 -3
  420. package/dist/utils/easeFunctions.mjs.map +1 -0
  421. package/dist/{util → utils}/emailValidation.js +1 -1
  422. package/dist/utils/emailValidation.js.map +1 -0
  423. package/dist/{util → utils}/emailValidation.mjs +1 -1
  424. package/dist/utils/emailValidation.mjs.map +1 -0
  425. package/dist/{util → utils}/loopingArray.js +1 -1
  426. package/dist/utils/loopingArray.js.map +1 -0
  427. package/dist/{util → utils}/loopingArray.mjs +1 -1
  428. package/dist/utils/loopingArray.mjs.map +1 -0
  429. package/dist/utils/match.d.mts +3 -0
  430. package/dist/utils/match.d.ts +3 -0
  431. package/dist/utils/match.js +32 -0
  432. package/dist/utils/match.js.map +1 -0
  433. package/dist/utils/match.mjs +8 -0
  434. package/dist/utils/match.mjs.map +1 -0
  435. package/dist/utils/math.d.mts +3 -0
  436. package/dist/utils/math.d.ts +3 -0
  437. package/dist/{util → utils}/math.js +3 -2
  438. package/dist/utils/math.js.map +1 -0
  439. package/dist/utils/math.mjs +9 -0
  440. package/dist/utils/math.mjs.map +1 -0
  441. package/dist/{util → utils}/noop.js +1 -1
  442. package/dist/utils/noop.js.map +1 -0
  443. package/dist/utils/noop.mjs +6 -0
  444. package/dist/utils/noop.mjs.map +1 -0
  445. package/dist/{util → utils}/resolveSetState.js +1 -1
  446. package/dist/utils/resolveSetState.js.map +1 -0
  447. package/dist/{util → utils}/resolveSetState.mjs +1 -1
  448. package/dist/utils/resolveSetState.mjs.map +1 -0
  449. package/dist/{util → utils}/simpleSearch.js +1 -1
  450. package/dist/utils/simpleSearch.js.map +1 -0
  451. package/dist/{util → utils}/simpleSearch.mjs +1 -1
  452. package/dist/utils/simpleSearch.mjs.map +1 -0
  453. package/dist/{util → utils}/storage.js +1 -1
  454. package/dist/utils/storage.js.map +1 -0
  455. package/dist/{util → utils}/storage.mjs +1 -1
  456. package/dist/utils/storage.mjs.map +1 -0
  457. package/dist/{util → utils}/writeToClipboard.js +2 -1
  458. package/dist/utils/writeToClipboard.js.map +1 -0
  459. package/dist/{util → utils}/writeToClipboard.mjs +3 -1
  460. package/dist/utils/writeToClipboard.mjs.map +1 -0
  461. package/package.json +8 -8
  462. package/dist/components/dialogs/ConfirmDialog.js +0 -674
  463. package/dist/components/dialogs/ConfirmDialog.js.map +0 -1
  464. package/dist/components/dialogs/ConfirmDialog.mjs +0 -638
  465. package/dist/components/dialogs/ConfirmDialog.mjs.map +0 -1
  466. package/dist/components/icons-and-geometry/Helpwave.js.map +0 -1
  467. package/dist/components/icons-and-geometry/Helpwave.mjs.map +0 -1
  468. package/dist/components/layout-and-navigation/BreadCrumb.js.map +0 -1
  469. package/dist/components/layout-and-navigation/BreadCrumb.mjs.map +0 -1
  470. package/dist/components/layout-and-navigation/Carousel.d.mts +0 -25
  471. package/dist/components/layout-and-navigation/Carousel.d.ts +0 -25
  472. package/dist/components/layout-and-navigation/Carousel.js +0 -641
  473. package/dist/components/layout-and-navigation/Carousel.js.map +0 -1
  474. package/dist/components/layout-and-navigation/Carousel.mjs +0 -607
  475. package/dist/components/layout-and-navigation/Carousel.mjs.map +0 -1
  476. package/dist/components/layout-and-navigation/Chip.js.map +0 -1
  477. package/dist/components/layout-and-navigation/Chip.mjs.map +0 -1
  478. package/dist/components/layout-and-navigation/DividerInserter.js.map +0 -1
  479. package/dist/components/layout-and-navigation/DividerInserter.mjs.map +0 -1
  480. package/dist/components/layout-and-navigation/Expandable.js.map +0 -1
  481. package/dist/components/layout-and-navigation/Expandable.mjs.map +0 -1
  482. package/dist/components/layout-and-navigation/FAQSection.js.map +0 -1
  483. package/dist/components/layout-and-navigation/FAQSection.mjs.map +0 -1
  484. package/dist/components/layout-and-navigation/MarkdownInterpreter.js.map +0 -1
  485. package/dist/components/layout-and-navigation/MarkdownInterpreter.mjs.map +0 -1
  486. package/dist/components/layout-and-navigation/Overlay.d.mts +0 -67
  487. package/dist/components/layout-and-navigation/Overlay.d.ts +0 -67
  488. package/dist/components/layout-and-navigation/Overlay.js +0 -702
  489. package/dist/components/layout-and-navigation/Overlay.js.map +0 -1
  490. package/dist/components/layout-and-navigation/Overlay.mjs +0 -665
  491. package/dist/components/layout-and-navigation/Overlay.mjs.map +0 -1
  492. package/dist/components/layout-and-navigation/Pagination.js.map +0 -1
  493. package/dist/components/layout-and-navigation/Pagination.mjs.map +0 -1
  494. package/dist/components/layout-and-navigation/SearchableList.d.mts +0 -24
  495. package/dist/components/layout-and-navigation/SearchableList.d.ts +0 -24
  496. package/dist/components/layout-and-navigation/SearchableList.js +0 -758
  497. package/dist/components/layout-and-navigation/SearchableList.js.map +0 -1
  498. package/dist/components/layout-and-navigation/SearchableList.mjs +0 -724
  499. package/dist/components/layout-and-navigation/SearchableList.mjs.map +0 -1
  500. package/dist/components/layout-and-navigation/StepperBar.js.map +0 -1
  501. package/dist/components/layout-and-navigation/StepperBar.mjs.map +0 -1
  502. package/dist/components/layout-and-navigation/TextImage.js.map +0 -1
  503. package/dist/components/layout-and-navigation/TextImage.mjs.map +0 -1
  504. package/dist/components/layout-and-navigation/Tile.d.mts +0 -27
  505. package/dist/components/layout-and-navigation/Tile.d.ts +0 -27
  506. package/dist/components/layout-and-navigation/Tile.js +0 -96
  507. package/dist/components/layout-and-navigation/Tile.js.map +0 -1
  508. package/dist/components/layout-and-navigation/Tile.mjs +0 -61
  509. package/dist/components/layout-and-navigation/Tile.mjs.map +0 -1
  510. package/dist/components/layout-and-navigation/VerticalDivider.js.map +0 -1
  511. package/dist/components/layout-and-navigation/VerticalDivider.mjs.map +0 -1
  512. package/dist/components/modals/ConfirmModal.d.mts +0 -33
  513. package/dist/components/modals/ConfirmModal.d.ts +0 -33
  514. package/dist/components/modals/ConfirmModal.js +0 -687
  515. package/dist/components/modals/ConfirmModal.js.map +0 -1
  516. package/dist/components/modals/ConfirmModal.mjs +0 -651
  517. package/dist/components/modals/ConfirmModal.mjs.map +0 -1
  518. package/dist/components/modals/DiscardChangesModal.d.mts +0 -20
  519. package/dist/components/modals/DiscardChangesModal.d.ts +0 -20
  520. package/dist/components/modals/DiscardChangesModal.js +0 -717
  521. package/dist/components/modals/DiscardChangesModal.js.map +0 -1
  522. package/dist/components/modals/DiscardChangesModal.mjs +0 -681
  523. package/dist/components/modals/DiscardChangesModal.mjs.map +0 -1
  524. package/dist/components/modals/InputModal.d.mts +0 -21
  525. package/dist/components/modals/InputModal.d.ts +0 -21
  526. package/dist/components/modals/InputModal.js +0 -976
  527. package/dist/components/modals/InputModal.js.map +0 -1
  528. package/dist/components/modals/InputModal.mjs +0 -940
  529. package/dist/components/modals/InputModal.mjs.map +0 -1
  530. package/dist/components/modals/LanguageModal.d.mts +0 -21
  531. package/dist/components/modals/LanguageModal.d.ts +0 -21
  532. package/dist/components/modals/LanguageModal.js +0 -1468
  533. package/dist/components/modals/LanguageModal.js.map +0 -1
  534. package/dist/components/modals/LanguageModal.mjs +0 -1432
  535. package/dist/components/modals/LanguageModal.mjs.map +0 -1
  536. package/dist/components/modals/ThemeModal.d.mts +0 -21
  537. package/dist/components/modals/ThemeModal.d.ts +0 -21
  538. package/dist/components/modals/ThemeModal.js +0 -1497
  539. package/dist/components/modals/ThemeModal.js.map +0 -1
  540. package/dist/components/modals/ThemeModal.mjs +0 -1461
  541. package/dist/components/modals/ThemeModal.mjs.map +0 -1
  542. package/dist/components/user-action/Input.d.mts +0 -77
  543. package/dist/components/user-action/Input.d.ts +0 -77
  544. package/dist/components/user-action/Input.js.map +0 -1
  545. package/dist/components/user-action/Input.mjs +0 -298
  546. package/dist/components/user-action/Input.mjs.map +0 -1
  547. package/dist/components/user-action/MultiSelect.d.mts +0 -42
  548. package/dist/components/user-action/MultiSelect.d.ts +0 -42
  549. package/dist/components/user-action/MultiSelect.js +0 -1468
  550. package/dist/components/user-action/MultiSelect.js.map +0 -1
  551. package/dist/components/user-action/MultiSelect.mjs +0 -1433
  552. package/dist/components/user-action/MultiSelect.mjs.map +0 -1
  553. package/dist/components/user-action/Select.d.mts +0 -41
  554. package/dist/components/user-action/Select.d.ts +0 -41
  555. package/dist/components/user-action/Select.js +0 -1236
  556. package/dist/components/user-action/Select.js.map +0 -1
  557. package/dist/components/user-action/Select.mjs +0 -1201
  558. package/dist/components/user-action/Select.mjs.map +0 -1
  559. package/dist/components/user-action/ToggleableInput.d.mts +0 -37
  560. package/dist/components/user-action/ToggleableInput.d.ts +0 -37
  561. package/dist/components/user-action/ToggleableInput.js +0 -192
  562. package/dist/components/user-action/ToggleableInput.js.map +0 -1
  563. package/dist/components/user-action/ToggleableInput.mjs +0 -157
  564. package/dist/components/user-action/ToggleableInput.mjs.map +0 -1
  565. package/dist/css/uncompiled/textstyles.css +0 -69
  566. package/dist/hooks/useFocusManagement.js.map +0 -1
  567. package/dist/hooks/useFocusManagement.mjs.map +0 -1
  568. package/dist/hooks/useFocusOnceVisible.js.map +0 -1
  569. package/dist/hooks/useFocusOnceVisible.mjs.map +0 -1
  570. package/dist/index.d.mts +0 -103
  571. package/dist/index.d.ts +0 -103
  572. package/dist/index.js +0 -12610
  573. package/dist/index.js.map +0 -1
  574. package/dist/index.mjs +0 -12447
  575. package/dist/index.mjs.map +0 -1
  576. package/dist/util/PropsWithFunctionChildren.d.mts +0 -14
  577. package/dist/util/PropsWithFunctionChildren.d.ts +0 -14
  578. package/dist/util/PropsWithFunctionChildren.js.map +0 -1
  579. package/dist/util/PropsWithFunctionChildren.mjs.map +0 -1
  580. package/dist/util/array.js.map +0 -1
  581. package/dist/util/array.mjs.map +0 -1
  582. package/dist/util/builder.js.map +0 -1
  583. package/dist/util/builder.mjs.map +0 -1
  584. package/dist/util/date.js.map +0 -1
  585. package/dist/util/date.mjs.map +0 -1
  586. package/dist/util/easeFunctions.js.map +0 -1
  587. package/dist/util/easeFunctions.mjs.map +0 -1
  588. package/dist/util/emailValidation.js.map +0 -1
  589. package/dist/util/emailValidation.mjs.map +0 -1
  590. package/dist/util/loopingArray.js.map +0 -1
  591. package/dist/util/loopingArray.mjs.map +0 -1
  592. package/dist/util/math.d.mts +0 -3
  593. package/dist/util/math.d.ts +0 -3
  594. package/dist/util/math.js.map +0 -1
  595. package/dist/util/math.mjs +0 -8
  596. package/dist/util/math.mjs.map +0 -1
  597. package/dist/util/news.d.mts +0 -101
  598. package/dist/util/news.d.ts +0 -101
  599. package/dist/util/news.js +0 -76
  600. package/dist/util/news.js.map +0 -1
  601. package/dist/util/news.mjs +0 -49
  602. package/dist/util/news.mjs.map +0 -1
  603. package/dist/util/noop.js.map +0 -1
  604. package/dist/util/noop.mjs +0 -6
  605. package/dist/util/noop.mjs.map +0 -1
  606. package/dist/util/resolveSetState.js.map +0 -1
  607. package/dist/util/resolveSetState.mjs.map +0 -1
  608. package/dist/util/simpleSearch.js.map +0 -1
  609. package/dist/util/simpleSearch.mjs.map +0 -1
  610. package/dist/util/storage.js.map +0 -1
  611. package/dist/util/storage.mjs.map +0 -1
  612. package/dist/util/types.d.mts +0 -3
  613. package/dist/util/types.d.ts +0 -3
  614. package/dist/util/types.js +0 -18
  615. package/dist/util/types.js.map +0 -1
  616. package/dist/util/types.mjs +0 -1
  617. package/dist/util/types.mjs.map +0 -1
  618. package/dist/util/writeToClipboard.js.map +0 -1
  619. package/dist/util/writeToClipboard.mjs.map +0 -1
  620. /package/dist/components/{layout-and-navigation → layout}/DividerInserter.d.mts +0 -0
  621. /package/dist/components/{layout-and-navigation → layout}/DividerInserter.d.ts +0 -0
  622. /package/dist/components/{layout-and-navigation → layout}/FAQSection.d.mts +0 -0
  623. /package/dist/components/{layout-and-navigation → layout}/FAQSection.d.ts +0 -0
  624. /package/dist/components/{layout-and-navigation → layout}/MarkdownInterpreter.d.mts +0 -0
  625. /package/dist/components/{layout-and-navigation → layout}/MarkdownInterpreter.d.ts +0 -0
  626. /package/dist/components/{layout-and-navigation → layout}/TextImage.d.mts +0 -0
  627. /package/dist/components/{layout-and-navigation → layout}/TextImage.d.ts +0 -0
  628. /package/dist/components/{layout-and-navigation → layout}/VerticalDivider.d.mts +0 -0
  629. /package/dist/components/{layout-and-navigation → layout}/VerticalDivider.d.ts +0 -0
  630. /package/dist/components/{layout-and-navigation → navigation}/BreadCrumb.d.mts +0 -0
  631. /package/dist/components/{layout-and-navigation → navigation}/BreadCrumb.d.ts +0 -0
  632. /package/dist/components/{layout-and-navigation → navigation}/Pagination.d.mts +0 -0
  633. /package/dist/components/{layout-and-navigation → navigation}/Pagination.d.ts +0 -0
  634. /package/dist/components/{layout-and-navigation → navigation}/StepperBar.d.mts +0 -0
  635. /package/dist/components/{layout-and-navigation → navigation}/StepperBar.d.ts +0 -0
  636. /package/dist/hooks/{useFocusManagement.d.mts → focus/useFocusManagement.d.mts} +0 -0
  637. /package/dist/hooks/{useFocusManagement.d.ts → focus/useFocusManagement.d.ts} +0 -0
  638. /package/dist/hooks/{useFocusOnceVisible.d.mts → focus/useFocusOnceVisible.d.mts} +0 -0
  639. /package/dist/hooks/{useFocusOnceVisible.d.ts → focus/useFocusOnceVisible.d.ts} +0 -0
  640. /package/dist/{css → style}/uncompiled/theme/colors-basic.css +0 -0
  641. /package/dist/{css → style}/uncompiled/theme/index.css +0 -0
  642. /package/dist/{css → style}/uncompiled/theme/variants.css +0 -0
  643. /package/dist/{css → style}/uncompiled/utitlity/borderradius.css +0 -0
  644. /package/dist/{css → style}/uncompiled/utitlity/general.css +0 -0
  645. /package/dist/{util → utils}/builder.d.mts +0 -0
  646. /package/dist/{util → utils}/builder.d.ts +0 -0
  647. /package/dist/{util → utils}/date.d.mts +0 -0
  648. /package/dist/{util → utils}/date.d.ts +0 -0
  649. /package/dist/{util → utils}/easeFunctions.d.mts +0 -0
  650. /package/dist/{util → utils}/easeFunctions.d.ts +0 -0
  651. /package/dist/{util → utils}/emailValidation.d.mts +0 -0
  652. /package/dist/{util → utils}/emailValidation.d.ts +0 -0
  653. /package/dist/{util → utils}/loopingArray.d.mts +0 -0
  654. /package/dist/{util → utils}/loopingArray.d.ts +0 -0
  655. /package/dist/{util → utils}/noop.d.mts +0 -0
  656. /package/dist/{util → utils}/noop.d.ts +0 -0
  657. /package/dist/{util → utils}/resolveSetState.d.mts +0 -0
  658. /package/dist/{util → utils}/resolveSetState.d.ts +0 -0
  659. /package/dist/{util → utils}/simpleSearch.d.mts +0 -0
  660. /package/dist/{util → utils}/simpleSearch.d.ts +0 -0
  661. /package/dist/{util → utils}/storage.d.mts +0 -0
  662. /package/dist/{util → utils}/storage.d.ts +0 -0
  663. /package/dist/{util → utils}/writeToClipboard.d.mts +0 -0
  664. /package/dist/{util → utils}/writeToClipboard.d.ts +0 -0
@@ -32,8 +32,12 @@ __export(MultiSelectProperty_exports, {
32
32
  MultiSelectProperty: () => MultiSelectProperty
33
33
  });
34
34
  module.exports = __toCommonJS(MultiSelectProperty_exports);
35
- var import_lucide_react7 = require("lucide-react");
36
- var import_clsx12 = __toESM(require("clsx"));
35
+ var import_lucide_react4 = require("lucide-react");
36
+ var import_clsx6 = __toESM(require("clsx"));
37
+
38
+ // src/components/user-action/select/Select.tsx
39
+ var import_react8 = require("react");
40
+ var import_clsx4 = __toESM(require("clsx"));
37
41
 
38
42
  // src/localization/LanguageProvider.tsx
39
43
  var import_react2 = require("react");
@@ -122,33 +126,403 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
122
126
  };
123
127
  };
124
128
 
125
- // src/components/user-action/MultiSelect.tsx
126
- var import_react14 = require("react");
127
- var import_react15 = require("react");
128
- var import_clsx10 = __toESM(require("clsx"));
129
-
130
- // src/components/user-action/Label.tsx
129
+ // src/components/layout/Expandable.tsx
130
+ var import_react3 = require("react");
131
+ var import_lucide_react = require("lucide-react");
131
132
  var import_clsx = __toESM(require("clsx"));
133
+
134
+ // src/utils/noop.ts
135
+ var noop = () => void 0;
136
+
137
+ // src/components/layout/Expandable.tsx
132
138
  var import_jsx_runtime2 = require("react/jsx-runtime");
133
- var styleMapping = {
134
- labelSmall: "textstyle-label-sm",
135
- labelMedium: "textstyle-label-md",
136
- labelBig: "textstyle-label-lg"
139
+ var ExpansionIcon = ({ isExpanded, className }) => {
140
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
141
+ import_lucide_react.ChevronDown,
142
+ {
143
+ "aria-hidden": true,
144
+ className: (0, import_clsx.default)(
145
+ "min-w-6 w-6 min-h-6 h-6 transition-transform motion-safe:duration-200 motion-reduce:duration-0 ease-in-out",
146
+ { "rotate-180": isExpanded },
147
+ className
148
+ )
149
+ }
150
+ );
137
151
  };
138
- var Label = ({
152
+ var Expandable = (0, import_react3.forwardRef)(function Expandable2({
139
153
  children,
140
- name,
141
- labelType = "labelSmall",
154
+ id: providedId,
155
+ label,
156
+ icon,
157
+ isExpanded = false,
158
+ onChange = noop,
159
+ clickOnlyOnHeader = true,
160
+ disabled = false,
142
161
  className,
162
+ headerClassName,
163
+ contentClassName,
164
+ contentExpandedClassName
165
+ }, ref) {
166
+ const defaultIcon = (0, import_react3.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
167
+ icon ??= defaultIcon;
168
+ const generatedId = (0, import_react3.useId)();
169
+ const id = providedId ?? generatedId;
170
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
171
+ "div",
172
+ {
173
+ ref,
174
+ onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
175
+ className: (0, import_clsx.default)(
176
+ "flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm",
177
+ { "cursor-pointer": !clickOnlyOnHeader && !disabled },
178
+ className
179
+ ),
180
+ children: [
181
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
182
+ "button",
183
+ {
184
+ onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
185
+ className: (0, import_clsx.default)(
186
+ "flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
187
+ {
188
+ "group-hover:brightness-97": !isExpanded,
189
+ "hover:brightness-97": isExpanded && !disabled,
190
+ "cursor-pointer": clickOnlyOnHeader && !disabled
191
+ },
192
+ headerClassName
193
+ ),
194
+ "aria-expanded": isExpanded,
195
+ "aria-controls": `${id}-content`,
196
+ "aria-disabled": disabled ?? void 0,
197
+ children: [
198
+ label,
199
+ icon(isExpanded)
200
+ ]
201
+ }
202
+ ),
203
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
204
+ "div",
205
+ {
206
+ id: `${id}-content`,
207
+ className: (0, import_clsx.default)(
208
+ "flex-col-2 px-4 transition-all duration-300 ease-in-out",
209
+ {
210
+ [(0, import_clsx.default)("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
211
+ "max-h-0 opacity-0 overflow-hidden": !isExpanded
212
+ },
213
+ contentClassName
214
+ ),
215
+ role: "region",
216
+ children
217
+ }
218
+ )
219
+ ]
220
+ }
221
+ );
222
+ });
223
+ var ExpandableUncontrolled = (0, import_react3.forwardRef)(function ExpandableUncontrolled2({
224
+ isExpanded,
225
+ onChange = noop,
143
226
  ...props
227
+ }, ref) {
228
+ const [usedIsExpanded, setUsedIsExpanded] = (0, import_react3.useState)(isExpanded);
229
+ (0, import_react3.useEffect)(() => {
230
+ setUsedIsExpanded(isExpanded);
231
+ }, [isExpanded]);
232
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
233
+ Expandable,
234
+ {
235
+ ...props,
236
+ ref,
237
+ isExpanded: usedIsExpanded,
238
+ onChange: (value) => {
239
+ onChange(value);
240
+ setUsedIsExpanded(value);
241
+ }
242
+ }
243
+ );
244
+ });
245
+
246
+ // src/hooks/focus/useFocusTrap.ts
247
+ var import_react5 = require("react");
248
+
249
+ // src/hooks/focus/useIsMounted.ts
250
+ var import_react4 = require("react");
251
+ var isClient = typeof window !== "undefined" && typeof document !== "undefined";
252
+ var useIsomorphicEffect = isClient ? import_react4.useLayoutEffect : import_react4.useEffect;
253
+ var useIsMounted = () => {
254
+ const [isMounted, setIsMounted] = (0, import_react4.useState)(false);
255
+ useIsomorphicEffect(() => {
256
+ setIsMounted(true);
257
+ return () => {
258
+ setIsMounted(false);
259
+ };
260
+ }, []);
261
+ return isMounted;
262
+ };
263
+
264
+ // src/hooks/focus/useFocusTrap.ts
265
+ var createFocusGuard = () => {
266
+ const div = document.createElement("div");
267
+ Object.assign(div.style, {
268
+ opacity: "0",
269
+ outline: "none",
270
+ boxShadow: "none",
271
+ position: "fixed",
272
+ pointerEvents: "none",
273
+ touchAction: "none"
274
+ });
275
+ div.tabIndex = 0;
276
+ div.setAttribute("data-hw-focus-guard", "");
277
+ document.body.appendChild(div);
278
+ return div;
279
+ };
280
+ function getContainedFocusableElements(element) {
281
+ return element?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
282
+ }
283
+ var FocusTrapService = class {
284
+ constructor() {
285
+ // The last entry is always the active one
286
+ this.listeners = [];
287
+ this.onFocusIn = (event) => {
288
+ const active = this.getActive();
289
+ if (!active || !active.container.current) return;
290
+ const { container } = active;
291
+ if (!container.current.contains(event.target)) {
292
+ this.focusElement();
293
+ }
294
+ };
295
+ }
296
+ getActive() {
297
+ if (this.listeners.length === 0) return void 0;
298
+ return this.listeners[this.listeners.length - 1];
299
+ }
300
+ focusElement() {
301
+ const active = this.getActive();
302
+ if (!active) return;
303
+ const { container, initialFocusElement } = active;
304
+ const containerElement = container.current;
305
+ if (initialFocusElement?.current) {
306
+ initialFocusElement.current.focus();
307
+ } else {
308
+ const elements = getContainedFocusableElements(containerElement);
309
+ if (elements && elements.length > 0) {
310
+ const first = elements.item(0);
311
+ first.focus();
312
+ } else {
313
+ containerElement.focus();
314
+ }
315
+ }
316
+ }
317
+ removeGuards() {
318
+ document.querySelectorAll("[data-hw-focus-guard]").forEach((node) => node.remove());
319
+ }
320
+ addGuards() {
321
+ document.body.insertAdjacentElement("afterbegin", createFocusGuard());
322
+ document.body.insertAdjacentElement("beforeend", createFocusGuard());
323
+ }
324
+ activate() {
325
+ document.addEventListener("focusin", this.onFocusIn);
326
+ this.addGuards();
327
+ }
328
+ deactivate() {
329
+ document.removeEventListener("focusin", this.onFocusIn);
330
+ this.removeGuards();
331
+ }
332
+ register(listener) {
333
+ this.listeners.push(listener);
334
+ if (this.listeners.length === 1) {
335
+ this.activate();
336
+ }
337
+ const active = listener;
338
+ this.listeners.forEach((listener2) => {
339
+ const { focus, pause } = listener2;
340
+ if (listener2 === active) {
341
+ focus();
342
+ } else {
343
+ pause();
344
+ }
345
+ });
346
+ }
347
+ unregister(id) {
348
+ const index = this.listeners.findIndex((trap) => trap.id === id);
349
+ if (index !== -1) {
350
+ const isActive = index === this.listeners.length - 1;
351
+ const listener = this.listeners[index];
352
+ this.listeners = this.listeners.filter((listener2) => listener2.id !== id);
353
+ if (isActive) {
354
+ this.deactivate();
355
+ listener.focusLast();
356
+ const active = this.getActive();
357
+ this.listeners.forEach((listener2) => {
358
+ const { pause, unpause } = listener2;
359
+ if (listener2 === active) {
360
+ unpause();
361
+ } else {
362
+ pause();
363
+ }
364
+ });
365
+ if (this.listeners.length > 0) {
366
+ this.activate();
367
+ }
368
+ }
369
+ } else {
370
+ console.warn(`Unable to unregister id ${id}: not found`);
371
+ }
372
+ }
373
+ };
374
+ var service = new FocusTrapService();
375
+ var useFocusTrap = ({
376
+ container,
377
+ active = true,
378
+ initialFocus,
379
+ focusFirst = true
144
380
  }) => {
145
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
381
+ const lastFocusRef = (0, import_react5.useRef)(null);
382
+ const [paused, setPaused] = (0, import_react5.useState)(false);
383
+ const isMounted = useIsMounted();
384
+ const id = (0, import_react5.useId)();
385
+ const focusElement = (0, import_react5.useCallback)(() => {
386
+ const containerElement = container.current;
387
+ if (initialFocus?.current) {
388
+ initialFocus.current.focus();
389
+ } else {
390
+ const elements = getContainedFocusableElements(containerElement);
391
+ if (elements && elements.length > 0) {
392
+ const first = elements.item(0);
393
+ first.focus();
394
+ } else {
395
+ containerElement.focus();
396
+ }
397
+ }
398
+ }, [container, initialFocus]);
399
+ (0, import_react5.useEffect)(() => {
400
+ if (active && isMounted) {
401
+ let pause = function() {
402
+ setPaused(true);
403
+ }, unpause = function() {
404
+ setPaused(false);
405
+ if (!container.current.contains(document.activeElement)) {
406
+ focusElement();
407
+ }
408
+ }, focus = function() {
409
+ focusElement();
410
+ setPaused(false);
411
+ }, focusLast = function() {
412
+ lastFocusRef.current?.focus();
413
+ };
414
+ if (!lastFocusRef.current) {
415
+ lastFocusRef.current = document.activeElement;
416
+ }
417
+ service.register({ id, pause, focus, focusLast, unpause, container, initialFocusElement: initialFocus });
418
+ return () => {
419
+ service.unregister(id);
420
+ lastFocusRef.current = void 0;
421
+ };
422
+ }
423
+ }, [active, container, focusElement, id, initialFocus, isMounted]);
424
+ (0, import_react5.useEffect)(() => {
425
+ if (active && !paused && isMounted) {
426
+ let onKeyDown = function(event) {
427
+ const key = event.key;
428
+ const elements = getContainedFocusableElements(containerElement);
429
+ const active2 = document.activeElement;
430
+ const index = [...elements].findIndex((value) => value === active2);
431
+ if (index === -1 || event.altKey || event.ctrlKey || event.metaKey) {
432
+ return;
433
+ }
434
+ if (key === "Tab") {
435
+ const next = event.shiftKey ? -1 : 1;
436
+ const nextIndex = (index + next + elements.length) % elements.length;
437
+ const nextElement = elements[nextIndex];
438
+ nextElement.focus();
439
+ event.preventDefault();
440
+ }
441
+ };
442
+ const containerElement = container.current;
443
+ containerElement.addEventListener("keydown", onKeyDown);
444
+ return () => {
445
+ containerElement.removeEventListener("keydown", onKeyDown);
446
+ };
447
+ }
448
+ }, [active, paused, isMounted, container, initialFocus, focusFirst, focusElement]);
146
449
  };
147
450
 
148
- // src/components/user-action/Button.tsx
149
- var import_react3 = require("react");
451
+ // src/utils/match.ts
452
+ var match = (key, values) => {
453
+ return values[key];
454
+ };
455
+
456
+ // src/components/user-action/select/Select.tsx
457
+ var import_lucide_react2 = require("lucide-react");
458
+
459
+ // src/components/layout/Chip.tsx
150
460
  var import_clsx2 = __toESM(require("clsx"));
151
461
  var import_jsx_runtime3 = require("react/jsx-runtime");
462
+ var Chip = ({
463
+ children,
464
+ trailingIcon,
465
+ color = "default",
466
+ size = "md",
467
+ icon = false,
468
+ variant = "normal",
469
+ className = "",
470
+ ...restProps
471
+ }) => {
472
+ const colorMapping = {
473
+ default: "text-tag-default-text bg-tag-default-background",
474
+ dark: "text-tag-dark-text bg-tag-dark-background",
475
+ red: "text-tag-red-text bg-tag-red-background",
476
+ yellow: "text-tag-yellow-text bg-tag-yellow-background",
477
+ green: "text-tag-green-text bg-tag-green-background",
478
+ blue: "text-tag-blue-text bg-tag-blue-background",
479
+ pink: "text-tag-pink-text bg-tag-pink-background",
480
+ orange: "text-tag-orange-text bg-tag-orange-background"
481
+ }[color];
482
+ const colorMappingIcon = {
483
+ default: "text-tag-default-icon",
484
+ dark: "text-tag-dark-icon",
485
+ red: "text-tag-red-icon",
486
+ yellow: "text-tag-yellow-icon",
487
+ green: "text-tag-green-icon",
488
+ blue: "text-tag-blue-icon",
489
+ pink: "text-tag-pink-icon",
490
+ orange: "text-tag-orange-icon"
491
+ }[color];
492
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
493
+ "div",
494
+ {
495
+ ...restProps,
496
+ className: (0, import_clsx2.default)(
497
+ `flex-row-0 w-fit font-semibold`,
498
+ colorMapping,
499
+ !icon ? {
500
+ "px-1 py-0.5": size === "sm",
501
+ "px-2 py-1": size === "md",
502
+ "px-4 py-2": size === "lg"
503
+ } : {
504
+ "p-0.5": size === "sm",
505
+ "p-1": size === "md",
506
+ "p-2": size === "lg"
507
+ },
508
+ {
509
+ "rounded-md": variant === "normal",
510
+ "rounded-full": variant === "fullyRounded"
511
+ },
512
+ className
513
+ ),
514
+ children: [
515
+ children,
516
+ trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
517
+ ]
518
+ }
519
+ );
520
+ };
521
+
522
+ // src/components/user-action/Button.tsx
523
+ var import_react6 = require("react");
524
+ var import_clsx3 = __toESM(require("clsx"));
525
+ var import_jsx_runtime4 = require("react/jsx-runtime");
152
526
  var ButtonColorUtil = {
153
527
  solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
154
528
  text: ["primary", "negative", "neutral"],
@@ -172,7 +546,7 @@ var ButtonUtil = {
172
546
  paddingMapping,
173
547
  iconPaddingMapping
174
548
  };
175
- var SolidButton = (0, import_react3.forwardRef)(function SolidButton2({
549
+ var SolidButton = (0, import_react6.forwardRef)(function SolidButton2({
176
550
  children,
177
551
  color = "primary",
178
552
  size = "medium",
@@ -200,12 +574,12 @@ var SolidButton = (0, import_react3.forwardRef)(function SolidButton2({
200
574
  negative: "not-group-disabled:text-button-solid-negative-icon",
201
575
  neutral: "not-group-disabled:text-button-solid-neutral-icon"
202
576
  }[color];
203
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
577
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
204
578
  "button",
205
579
  {
206
580
  ref,
207
581
  onClick,
208
- className: (0, import_clsx2.default)(
582
+ className: (0, import_clsx3.default)(
209
583
  "group font-semibold",
210
584
  colorClasses,
211
585
  "not-disabled:hover:brightness-90",
@@ -215,10 +589,10 @@ var SolidButton = (0, import_react3.forwardRef)(function SolidButton2({
215
589
  ),
216
590
  ...restProps,
217
591
  children: [
218
- startIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
592
+ startIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
219
593
  "span",
220
594
  {
221
- className: (0, import_clsx2.default)(
595
+ className: (0, import_clsx3.default)(
222
596
  iconColorClasses,
223
597
  "group-disabled:text-disabled-icon"
224
598
  ),
@@ -226,10 +600,10 @@ var SolidButton = (0, import_react3.forwardRef)(function SolidButton2({
226
600
  }
227
601
  ),
228
602
  children,
229
- endIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
603
+ endIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
230
604
  "span",
231
605
  {
232
- className: (0, import_clsx2.default)(
606
+ className: (0, import_clsx3.default)(
233
607
  iconColorClasses,
234
608
  "group-disabled:text-disabled-icon"
235
609
  ),
@@ -252,25 +626,25 @@ var TextButton = ({
252
626
  ...restProps
253
627
  }) => {
254
628
  const colorClasses = {
255
- primary: "not-disabled:bg-transparent not-disabled:text-button-text-primary-text",
256
- negative: "not-disabled:bg-transparent not-disabled:text-button-text-negative-text",
257
- neutral: "not-disabled:bg-transparent not-disabled:text-button-text-neutral-text"
629
+ primary: "not-disabled:bg-transparent not-disabled:text-button-text-primary-text focus-style-none focus-visible:ring-2 not-disabled:focus-visible:ring-button-text-primary-text",
630
+ negative: "not-disabled:bg-transparent not-disabled:text-button-text-negative-text focus-style-none focus-visible:ring-2 not-disabled:focus-visible:ring-button-text-negative-text",
631
+ neutral: "not-disabled:bg-transparent not-disabled:text-button-text-neutral-text focus-style-none focus-visible:ring-2 not-disabled:focus-visible:ring-button-text-neutral-text"
258
632
  }[color];
259
633
  const backgroundColor = {
260
- primary: "not-disabled:hover:bg-button-text-primary-text/20",
261
- negative: "not-disabled:hover:bg-button-text-negative-text/20",
262
- neutral: "not-disabled:hover:bg-button-text-neutral-text/20"
634
+ primary: "not-disabled:hover:bg-button-text-primary-text/20 not-disabled:focus-visible:bg-button-text-primary-text/20",
635
+ negative: "not-disabled:hover:bg-button-text-negative-text/20 not-disabled:focus-visible:bg-button-text-negative-text/20",
636
+ neutral: "not-disabled:hover:bg-button-text-neutral-text/20 not-disabled:focus-visible:bg-button-text-neutral-text/20"
263
637
  }[color];
264
638
  const iconColorClasses = {
265
639
  primary: "not-group-disabled:text-button-text-primary-icon",
266
640
  negative: "not-group-disabled:text-button-text-negative-icon",
267
641
  neutral: "not-group-disabled:text-button-text-neutral-icon"
268
642
  }[color];
269
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
643
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
270
644
  "button",
271
645
  {
272
646
  onClick,
273
- className: (0, import_clsx2.default)(
647
+ className: (0, import_clsx3.default)(
274
648
  "group font-semibold",
275
649
  "disabled:text-disabled-text",
276
650
  colorClasses,
@@ -283,10 +657,10 @@ var TextButton = ({
283
657
  ),
284
658
  ...restProps,
285
659
  children: [
286
- startIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
660
+ startIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
287
661
  "span",
288
662
  {
289
- className: (0, import_clsx2.default)(
663
+ className: (0, import_clsx3.default)(
290
664
  iconColorClasses,
291
665
  "group-disabled:text-disabled-icon"
292
666
  ),
@@ -294,10 +668,10 @@ var TextButton = ({
294
668
  }
295
669
  ),
296
670
  children,
297
- endIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
671
+ endIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
298
672
  "span",
299
673
  {
300
- className: (0, import_clsx2.default)(
674
+ className: (0, import_clsx3.default)(
301
675
  iconColorClasses,
302
676
  "group-disabled:text-disabled-icon"
303
677
  ),
@@ -308,13 +682,13 @@ var TextButton = ({
308
682
  }
309
683
  );
310
684
  };
311
- var IconButton = ({
685
+ var IconButton = (0, import_react6.forwardRef)(function IconButton2({
312
686
  children,
313
687
  color = "primary",
314
688
  size = "medium",
315
689
  className,
316
690
  ...restProps
317
- }) => {
691
+ }, ref) {
318
692
  const colorClasses = {
319
693
  primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
320
694
  secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
@@ -325,10 +699,11 @@ var IconButton = ({
325
699
  neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text",
326
700
  transparent: "not-disabled:bg-transparent"
327
701
  }[color];
328
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
702
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
329
703
  "button",
330
704
  {
331
- className: (0, import_clsx2.default)(
705
+ ref,
706
+ className: (0, import_clsx3.default)(
332
707
  colorClasses,
333
708
  "not-disabled:hover:brightness-90",
334
709
  "disabled:text-disabled-text",
@@ -344,72 +719,703 @@ var IconButton = ({
344
719
  children
345
720
  }
346
721
  );
722
+ });
723
+
724
+ // src/hooks/useFloatingElement.ts
725
+ var import_react7 = require("react");
726
+
727
+ // src/utils/math.ts
728
+ var clamp = (value, range = [0, 1]) => {
729
+ const [min, max] = range;
730
+ return Math.min(Math.max(value, min), max);
347
731
  };
348
732
 
349
- // src/components/layout-and-navigation/Chip.tsx
350
- var import_clsx3 = __toESM(require("clsx"));
351
- var import_jsx_runtime4 = require("react/jsx-runtime");
352
- var Chip = ({
733
+ // src/hooks/useFloatingElement.ts
734
+ function calculatePosition({
735
+ windowRect,
736
+ containerRect,
737
+ anchorRect,
738
+ options
739
+ }) {
740
+ const { verticalAlignment, horizontalAlignment, gap, screenPadding } = options;
741
+ const windowWidth = windowRect.width;
742
+ const windowHeight = windowRect.height;
743
+ const maxWidth = windowWidth - 2 * screenPadding;
744
+ const maxHeight = windowHeight - 2 * screenPadding;
745
+ const width = Math.min(containerRect.width, maxWidth);
746
+ const height = Math.min(containerRect.height, maxHeight);
747
+ const leftSuggestion = {
748
+ beforeStart: anchorRect.left - width - gap,
749
+ afterStart: anchorRect.left,
750
+ center: anchorRect.left + anchorRect.width / 2 - width / 2,
751
+ beforeEnd: anchorRect.right - width,
752
+ afterEnd: anchorRect.right + gap
753
+ }[horizontalAlignment];
754
+ const topSuggestion = {
755
+ beforeStart: anchorRect.top - height - gap,
756
+ afterStart: anchorRect.top,
757
+ center: anchorRect.top + anchorRect.height / 2 - height / 2,
758
+ beforeEnd: anchorRect.bottom - height,
759
+ afterEnd: anchorRect.bottom + gap
760
+ }[verticalAlignment];
761
+ const left = clamp(leftSuggestion, [
762
+ screenPadding,
763
+ windowWidth - screenPadding - width
764
+ ]);
765
+ const top = clamp(topSuggestion, [
766
+ screenPadding,
767
+ windowHeight - screenPadding - height
768
+ ]);
769
+ return {
770
+ left,
771
+ top,
772
+ maxWidth,
773
+ maxHeight
774
+ };
775
+ }
776
+ function useFloatingElement({
777
+ active = true,
778
+ windowRef,
779
+ anchorRef,
780
+ containerRef,
781
+ isPolling = false,
782
+ pollingInterval = 100,
783
+ verticalAlignment = "afterEnd",
784
+ horizontalAlignment = "afterStart",
785
+ screenPadding = 16,
786
+ gap = 4
787
+ }) {
788
+ const [style, setStyle] = (0, import_react7.useState)();
789
+ const isMounted = useIsMounted();
790
+ const calculate = (0, import_react7.useCallback)(() => {
791
+ const containerRect = containerRef.current.getBoundingClientRect();
792
+ const windowRect = windowRef?.current.getBoundingClientRect() ?? {
793
+ top: 0,
794
+ bottom: window.innerHeight,
795
+ left: 0,
796
+ right: window.innerWidth,
797
+ width: window.innerWidth,
798
+ height: window.innerHeight
799
+ };
800
+ const anchorElement = anchorRef?.current;
801
+ if (anchorRef && !anchorElement) {
802
+ console.warn("FloatingContainer anchor provided, but its value is undefined");
803
+ }
804
+ const anchorRect = anchorElement?.getBoundingClientRect() ?? windowRect;
805
+ const calculateProps = {
806
+ windowRect,
807
+ anchorRect,
808
+ containerRect,
809
+ options: {
810
+ horizontalAlignment,
811
+ verticalAlignment,
812
+ screenPadding,
813
+ gap
814
+ }
815
+ };
816
+ setStyle(calculatePosition(calculateProps));
817
+ }, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef]);
818
+ const height = containerRef.current?.getBoundingClientRect().height;
819
+ const width = containerRef.current?.getBoundingClientRect().width;
820
+ (0, import_react7.useEffect)(() => {
821
+ if (active && isMounted) {
822
+ calculate();
823
+ } else {
824
+ setStyle(void 0);
825
+ }
826
+ }, [calculate, active, isMounted, height, width]);
827
+ (0, import_react7.useEffect)(() => {
828
+ window.addEventListener("resize", calculate);
829
+ let timeout;
830
+ if (isPolling) {
831
+ timeout = setInterval(calculate, pollingInterval);
832
+ }
833
+ return () => {
834
+ window.removeEventListener("resize", calculate);
835
+ if (timeout) {
836
+ clearInterval(timeout);
837
+ }
838
+ };
839
+ }, [calculate, isPolling, pollingInterval]);
840
+ return style;
841
+ }
842
+
843
+ // src/components/user-action/select/Select.tsx
844
+ var import_react_dom = require("react-dom");
845
+ var import_jsx_runtime5 = require("react/jsx-runtime");
846
+ var defaultToggleOpenOptions = {
847
+ highlightStartPosition: "first"
848
+ };
849
+ var SelectContext = (0, import_react8.createContext)(null);
850
+ function useSelectContext() {
851
+ const ctx = (0, import_react8.useContext)(SelectContext);
852
+ if (!ctx) {
853
+ throw new Error("SelectContext must be used within a ListBoxPrimitive");
854
+ }
855
+ return ctx;
856
+ }
857
+ var SelectRoot = ({
353
858
  children,
354
- trailingIcon,
355
- color = "default",
356
- variant = "normal",
357
- className = "",
358
- ...restProps
859
+ id,
860
+ value,
861
+ onValueChanged,
862
+ values,
863
+ onValuesChanged,
864
+ isOpen = false,
865
+ disabled = false,
866
+ invalid = false,
867
+ isMultiSelect = false,
868
+ iconAppearance = "left"
359
869
  }) => {
360
- const colorMapping = {
361
- default: "text-tag-default-text bg-tag-default-background",
362
- dark: "text-tag-dark-text bg-tag-dark-background",
363
- red: "text-tag-red-text bg-tag-red-background",
364
- yellow: "text-tag-yellow-text bg-tag-yellow-background",
365
- green: "text-tag-green-text bg-tag-green-background",
366
- blue: "text-tag-blue-text bg-tag-blue-background",
367
- pink: "text-tag-pink-text bg-tag-pink-background"
368
- }[color];
369
- const colorMappingIcon = {
370
- default: "text-tag-default-icon",
371
- dark: "text-tag-dark-icon",
372
- red: "text-tag-red-icon",
373
- yellow: "text-tag-yellow-icon",
374
- green: "text-tag-green-icon",
375
- blue: "text-tag-blue-icon",
376
- pink: "text-tag-pink-icon"
377
- }[color];
378
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
870
+ const optionsRef = (0, import_react8.useRef)([]);
871
+ const triggerRef = (0, import_react8.useRef)(null);
872
+ const generatedId = (0, import_react8.useId)();
873
+ const usedId = id ?? generatedId;
874
+ const [internalState, setInternalState] = (0, import_react8.useState)({
875
+ isOpen
876
+ });
877
+ const state = {
878
+ ...internalState,
879
+ id: usedId,
880
+ disabled,
881
+ invalid,
882
+ value: isMultiSelect ? values ?? [] : [value].filter(Boolean)
883
+ };
884
+ const config = {
885
+ isMultiSelect,
886
+ iconAppearance
887
+ };
888
+ const registerItem = (0, import_react8.useCallback)((item) => {
889
+ optionsRef.current.push(item);
890
+ optionsRef.current.sort((a, b) => {
891
+ const aEl = a.ref.current;
892
+ const bEl = b.ref.current;
893
+ if (!aEl || !bEl) return 0;
894
+ return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
895
+ });
896
+ }, []);
897
+ const unregisterItem = (0, import_react8.useCallback)((value2) => {
898
+ optionsRef.current = optionsRef.current.filter((i) => i.value !== value2);
899
+ }, []);
900
+ const toggleSelection = (value2, isSelected) => {
901
+ if (disabled) {
902
+ return;
903
+ }
904
+ const option = optionsRef.current.find((i) => i.value === value2);
905
+ if (!option) {
906
+ console.error(`SelectOption with value: ${value2} not found`);
907
+ return;
908
+ }
909
+ let newValue;
910
+ if (isMultiSelect) {
911
+ const isSelectedBefore = state.value.includes(value2);
912
+ const isSelectedAfter = isSelected ?? !isSelectedBefore;
913
+ if (!isSelectedAfter) {
914
+ newValue = state.value.filter((v) => v !== value2);
915
+ } else {
916
+ newValue = [...state.value, value2];
917
+ }
918
+ } else {
919
+ newValue = [value2];
920
+ }
921
+ if (!isMultiSelect) {
922
+ onValueChanged?.(newValue[0]);
923
+ } else {
924
+ onValuesChanged?.(newValue);
925
+ }
926
+ setInternalState((prevState) => ({
927
+ ...prevState,
928
+ highlightedValue: value2
929
+ }));
930
+ };
931
+ const highlightItem = (value2) => {
932
+ if (disabled) {
933
+ return;
934
+ }
935
+ setInternalState((prevState) => ({
936
+ ...prevState,
937
+ highlightedValue: value2
938
+ }));
939
+ };
940
+ const registerTrigger = (0, import_react8.useCallback)((ref) => {
941
+ triggerRef.current = ref.current;
942
+ }, []);
943
+ const unregisterTrigger = (0, import_react8.useCallback)(() => {
944
+ triggerRef.current = null;
945
+ }, []);
946
+ const toggleOpen = (isOpen2, options) => {
947
+ const { highlightStartPosition } = { ...defaultToggleOpenOptions, ...options };
948
+ let highlightedIndex;
949
+ if (highlightStartPosition === "first") {
950
+ highlightedIndex = optionsRef.current.findIndex((option) => !option.disabled);
951
+ } else {
952
+ highlightedIndex = optionsRef.current.length - 1 - [...optionsRef.current].reverse().findIndex((option) => !option.disabled);
953
+ }
954
+ if (highlightedIndex === -1 || highlightedIndex === optionsRef.current.length) {
955
+ highlightedIndex = 0;
956
+ }
957
+ setInternalState((prevState) => ({
958
+ ...prevState,
959
+ isOpen: isOpen2 ?? !prevState.isOpen,
960
+ highlightedValue: optionsRef.current[highlightedIndex].value
961
+ }));
962
+ };
963
+ const moveHighlightedIndex = (delta) => {
964
+ let highlightedIndex = optionsRef.current.findIndex((value2) => value2.value === internalState.highlightedValue);
965
+ if (highlightedIndex === -1) {
966
+ highlightedIndex = 0;
967
+ }
968
+ const optionLength = optionsRef.current.length;
969
+ const startIndex = (highlightedIndex + delta % optionLength + optionLength) % optionLength;
970
+ const isForward = delta >= 0;
971
+ let highlightedValue = optionsRef.current[startIndex].value;
972
+ for (let i = 0; i < optionsRef.current.length; i++) {
973
+ const index = (startIndex + (isForward ? i : -i) + optionLength) % optionLength;
974
+ if (!optionsRef.current[index].disabled) {
975
+ highlightedValue = optionsRef.current[index].value;
976
+ break;
977
+ }
978
+ }
979
+ setInternalState((prevState) => ({
980
+ ...prevState,
981
+ highlightedValue
982
+ }));
983
+ };
984
+ (0, import_react8.useEffect)(() => {
985
+ if (!internalState.highlightedValue) return;
986
+ const highlighted = optionsRef.current.find((value2) => value2.value === internalState.highlightedValue);
987
+ if (highlighted) {
988
+ highlighted.ref.current.scrollIntoView({ behavior: "instant", block: "nearest" });
989
+ } else {
990
+ console.error(`SelectRoot: Could not find highlighted value (${internalState.highlightedValue})`);
991
+ }
992
+ }, [internalState.highlightedValue]);
993
+ const contextValue = {
994
+ state,
995
+ config,
996
+ item: {
997
+ register: registerItem,
998
+ unregister: unregisterItem,
999
+ toggleSelection,
1000
+ highlightItem,
1001
+ moveHighlightedIndex
1002
+ },
1003
+ trigger: {
1004
+ ref: triggerRef,
1005
+ register: registerTrigger,
1006
+ unregister: unregisterTrigger,
1007
+ toggleOpen
1008
+ }
1009
+ };
1010
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectContext.Provider, { value: contextValue, children });
1011
+ };
1012
+ var SelectOption = (0, import_react8.forwardRef)(
1013
+ function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
1014
+ const { state, config, item, trigger } = useSelectContext();
1015
+ const { register, unregister, toggleSelection, highlightItem } = item;
1016
+ const itemRef = (0, import_react8.useRef)(null);
1017
+ iconAppearance ??= config.iconAppearance;
1018
+ (0, import_react8.useEffect)(() => {
1019
+ register({
1020
+ value,
1021
+ disabled,
1022
+ ref: itemRef
1023
+ });
1024
+ return () => unregister(value);
1025
+ }, [value, disabled, register, unregister, children]);
1026
+ const isHighlighted = state.highlightedValue === value;
1027
+ const isSelected = state.value.includes(value);
1028
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1029
+ "li",
1030
+ {
1031
+ ...restProps,
1032
+ ref: (node) => {
1033
+ itemRef.current = node;
1034
+ if (typeof ref === "function") ref(node);
1035
+ else if (ref) ref.current = node;
1036
+ },
1037
+ id: value,
1038
+ role: "option",
1039
+ "aria-disabled": disabled,
1040
+ "aria-selected": isSelected,
1041
+ "data-highlighted": isHighlighted ? "" : void 0,
1042
+ "data-selected": isSelected ? "" : void 0,
1043
+ "data-disabled": disabled ? "" : void 0,
1044
+ className: (0, import_clsx4.default)(
1045
+ "flex-row-1 items-center px-2 py-1 rounded-md",
1046
+ "data-highlighted:bg-primary/20",
1047
+ "data-disabled:text-disabled data-disabled:cursor-not-allowed",
1048
+ "not-data-disabled:cursor-pointer",
1049
+ className
1050
+ ),
1051
+ onClick: (event) => {
1052
+ if (!disabled) {
1053
+ toggleSelection(value);
1054
+ if (!config.isMultiSelect) {
1055
+ trigger.toggleOpen(false);
1056
+ }
1057
+ restProps.onClick?.(event);
1058
+ }
1059
+ },
1060
+ onMouseEnter: (event) => {
1061
+ if (!disabled) {
1062
+ highlightItem(value);
1063
+ restProps.onMouseEnter?.(event);
1064
+ }
1065
+ },
1066
+ children: [
1067
+ iconAppearance === "left" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1068
+ import_lucide_react2.CheckIcon,
1069
+ {
1070
+ className: (0, import_clsx4.default)("w-4 h-4", { "opacity-0": !isSelected || disabled }),
1071
+ "aria-hidden": true
1072
+ }
1073
+ ),
1074
+ children ?? value,
1075
+ iconAppearance === "right" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1076
+ import_lucide_react2.CheckIcon,
1077
+ {
1078
+ className: (0, import_clsx4.default)("w-4 h-4", { "opacity-0": !isSelected || disabled }),
1079
+ "aria-hidden": true
1080
+ }
1081
+ )
1082
+ ]
1083
+ }
1084
+ );
1085
+ }
1086
+ );
1087
+ var defaultSelectButtonTranslation = {
1088
+ en: {
1089
+ clickToSelect: "Click to select"
1090
+ },
1091
+ de: {
1092
+ clickToSelect: "Zum ausw\xE4hlen dr\xFCcken"
1093
+ }
1094
+ };
1095
+ var SelectButton = (0, import_react8.forwardRef)(function SelectButton2({ placeholder, selectedDisplay, ...props }, ref) {
1096
+ const translation = useTranslation([defaultSelectButtonTranslation]);
1097
+ const { state, trigger } = useSelectContext();
1098
+ const { register, unregister, toggleOpen } = trigger;
1099
+ const innerRef = (0, import_react8.useRef)(null);
1100
+ (0, import_react8.useImperativeHandle)(ref, () => innerRef.current);
1101
+ (0, import_react8.useEffect)(() => {
1102
+ register(innerRef);
1103
+ return () => unregister();
1104
+ }, [register, unregister]);
1105
+ const disabled = !!props?.disabled || !!state.disabled;
1106
+ const invalid = state.invalid;
1107
+ const hasValue = state.value.length > 0;
1108
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1109
+ "button",
1110
+ {
1111
+ ...props,
1112
+ ref: innerRef,
1113
+ id: state.id,
1114
+ className: (0, import_clsx4.default)(
1115
+ "flex-row-2 items-center justify-between bg-input-background text-input-text rounded-md px-2.5 py-2.5",
1116
+ "data-placeholder:text-description",
1117
+ props.className
1118
+ ),
1119
+ onClick: () => toggleOpen(!state.isOpen),
1120
+ onKeyDown: (event) => {
1121
+ switch (event.key) {
1122
+ case "ArrowDown":
1123
+ toggleOpen(true, { highlightStartPosition: "first" });
1124
+ break;
1125
+ case "ArrowUp":
1126
+ toggleOpen(true, { highlightStartPosition: "last" });
1127
+ break;
1128
+ }
1129
+ },
1130
+ "data-placeholder": !hasValue ? "" : void 0,
1131
+ "data-disabled": disabled ? "" : void 0,
1132
+ "data-invalid": invalid ? "" : void 0,
1133
+ "aria-invalid": invalid,
1134
+ "aria-disabled": disabled,
1135
+ "aria-haspopup": "listbox",
1136
+ "aria-expanded": state.isOpen,
1137
+ "aria-controls": state.isOpen ? `${state.id}-listbox` : void 0,
1138
+ children: [
1139
+ hasValue ? selectedDisplay?.(state.value) ?? state.value.join(", ") : placeholder ?? translation("clickToSelect"),
1140
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ExpansionIcon, { isExpanded: state.isOpen })
1141
+ ]
1142
+ }
1143
+ );
1144
+ });
1145
+ var SelectChipDisplay = (0, import_react8.forwardRef)(function SelectChipDisplay2({ ...props }, ref) {
1146
+ const { state, trigger, item } = useSelectContext();
1147
+ const { register, unregister, toggleOpen } = trigger;
1148
+ const innerRef = (0, import_react8.useRef)(null);
1149
+ (0, import_react8.useImperativeHandle)(ref, () => innerRef.current);
1150
+ (0, import_react8.useEffect)(() => {
1151
+ register(innerRef);
1152
+ return () => unregister();
1153
+ }, [register, unregister]);
1154
+ const disabled = !!props?.disabled || !!state.disabled;
1155
+ const invalid = state.invalid;
1156
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
379
1157
  "div",
380
1158
  {
381
- ...restProps,
382
- className: (0, import_clsx3.default)(
383
- `row w-fit px-2 py-1 font-semibold`,
384
- colorMapping,
385
- {
386
- "rounded-md": variant === "normal",
387
- "rounded-full": variant === "fullyRounded"
388
- },
389
- className
1159
+ ...props,
1160
+ ref: innerRef,
1161
+ className: (0, import_clsx4.default)(
1162
+ "flex flex-wrap flex-row gap-2 items-center bg-input-background text-input-text rounded-md px-2.5 py-2.5",
1163
+ props.className
390
1164
  ),
1165
+ "data-disabled": disabled ? "" : void 0,
1166
+ "data-invalid": invalid ? "" : void 0,
1167
+ "aria-invalid": invalid,
1168
+ "aria-disabled": disabled,
391
1169
  children: [
392
- children,
393
- trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
1170
+ state.value.map((value) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Chip, { className: "gap-x-2", children: [
1171
+ value,
1172
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1173
+ "button",
1174
+ {
1175
+ onClick: () => {
1176
+ item.toggleSelection(value, false);
1177
+ },
1178
+ className: "focus-within:text-negative hover:bg-negative/20 hover:text-negative rounded-md focus-style-none focus-visible:ring-2 focus-visible:ring-negative focus-visible:bg-negative/20",
1179
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.XIcon, {})
1180
+ }
1181
+ )
1182
+ ] }, value)),
1183
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1184
+ IconButton,
1185
+ {
1186
+ id: state.id,
1187
+ onClick: () => toggleOpen(),
1188
+ onKeyDown: (event) => {
1189
+ switch (event.key) {
1190
+ case "ArrowDown":
1191
+ toggleOpen(true, { highlightStartPosition: "first" });
1192
+ break;
1193
+ case "ArrowUp":
1194
+ toggleOpen(true, { highlightStartPosition: "last" });
1195
+ }
1196
+ },
1197
+ size: "small",
1198
+ color: "neutral",
1199
+ "aria-invalid": invalid,
1200
+ "aria-disabled": disabled,
1201
+ "aria-haspopup": "listbox",
1202
+ "aria-expanded": state.isOpen,
1203
+ "aria-controls": state.isOpen ? `${state.id}-listbox` : void 0,
1204
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.Plus, {})
1205
+ }
1206
+ )
394
1207
  ]
395
1208
  }
396
1209
  );
397
- };
398
- var ChipList = ({
399
- list,
400
- className = ""
401
- }) => {
402
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: (0, import_clsx3.default)("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
403
- Chip,
1210
+ });
1211
+ var SelectContent = (0, import_react8.forwardRef)(
1212
+ function SelectContent2({
1213
+ alignment,
1214
+ orientation = "vertical",
1215
+ ...props
1216
+ }, ref) {
1217
+ const innerRef = (0, import_react8.useRef)(null);
1218
+ (0, import_react8.useImperativeHandle)(ref, () => innerRef.current);
1219
+ const { trigger, state, config, item } = useSelectContext();
1220
+ const position = useFloatingElement({
1221
+ active: state.isOpen,
1222
+ anchorRef: trigger.ref,
1223
+ containerRef: innerRef,
1224
+ ...alignment
1225
+ });
1226
+ useFocusTrap({
1227
+ container: innerRef,
1228
+ active: state.isOpen && !!position
1229
+ });
1230
+ return (0, import_react_dom.createPortal)(
1231
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1232
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1233
+ "div",
1234
+ {
1235
+ hidden: !state.isOpen,
1236
+ onClick: () => trigger.toggleOpen(false),
1237
+ className: (0, import_clsx4.default)("fixed w-screen h-screen inset-0")
1238
+ }
1239
+ ),
1240
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1241
+ "ul",
1242
+ {
1243
+ ...props,
1244
+ id: `${state.id}-listbox`,
1245
+ ref: innerRef,
1246
+ hidden: !state.isOpen,
1247
+ onKeyDown: (event) => {
1248
+ switch (event.key) {
1249
+ case "Escape":
1250
+ trigger.toggleOpen(false);
1251
+ event.preventDefault();
1252
+ event.stopPropagation();
1253
+ break;
1254
+ case match(orientation, {
1255
+ vertical: "ArrowDown",
1256
+ horizontal: "ArrowUp"
1257
+ }):
1258
+ item.moveHighlightedIndex(1);
1259
+ event.preventDefault();
1260
+ break;
1261
+ case match(orientation, {
1262
+ vertical: "ArrowUp",
1263
+ horizontal: "ArrowDown"
1264
+ }):
1265
+ item.moveHighlightedIndex(-1);
1266
+ event.preventDefault();
1267
+ break;
1268
+ case "Home":
1269
+ event.preventDefault();
1270
+ break;
1271
+ case "End":
1272
+ event.preventDefault();
1273
+ break;
1274
+ case "Enter":
1275
+ // Fall through
1276
+ case " ":
1277
+ if (state.highlightedValue) {
1278
+ item.toggleSelection(state.highlightedValue);
1279
+ if (!config.isMultiSelect) {
1280
+ trigger.toggleOpen(false);
1281
+ }
1282
+ event.preventDefault();
1283
+ }
1284
+ break;
1285
+ }
1286
+ },
1287
+ className: (0, import_clsx4.default)("flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-style-within overflow-auto", props.className),
1288
+ style: {
1289
+ opacity: position ? void 0 : 0,
1290
+ position: "fixed",
1291
+ ...position
1292
+ },
1293
+ role: "listbox",
1294
+ "aria-multiselectable": config.isMultiSelect,
1295
+ "aria-orientation": orientation,
1296
+ tabIndex: position ? 0 : void 0,
1297
+ children: props.children
1298
+ }
1299
+ )
1300
+ ] }),
1301
+ document.body
1302
+ );
1303
+ }
1304
+ );
1305
+ var Select = (0, import_react8.forwardRef)(function Select2({
1306
+ children,
1307
+ contentPanelProps,
1308
+ buttonProps,
1309
+ ...props
1310
+ }, ref) {
1311
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(SelectRoot, { ...props, isMultiSelect: false, children: [
1312
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1313
+ SelectButton,
1314
+ {
1315
+ ref,
1316
+ ...buttonProps,
1317
+ selectedDisplay: (values) => {
1318
+ const value = values[0];
1319
+ if (!buttonProps?.selectedDisplay) return void 0;
1320
+ return buttonProps.selectedDisplay(value);
1321
+ }
1322
+ }
1323
+ ),
1324
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectContent, { ...contentPanelProps, children })
1325
+ ] });
1326
+ });
1327
+ var SelectUncontrolled = (0, import_react8.forwardRef)(function SelectUncontrolled2({
1328
+ value: initialValue,
1329
+ onValueChanged,
1330
+ ...props
1331
+ }, ref) {
1332
+ const [value, setValue] = (0, import_react8.useState)(initialValue);
1333
+ (0, import_react8.useEffect)(() => {
1334
+ setValue(initialValue);
1335
+ }, [initialValue]);
1336
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1337
+ Select,
404
1338
  {
405
- ...value,
406
- color: value.color ?? "default",
407
- variant: value.variant ?? "normal",
408
- children: value.children
409
- },
410
- index
411
- )) });
412
- };
1339
+ ...props,
1340
+ ref,
1341
+ value,
1342
+ onValueChanged: (value2) => {
1343
+ setValue(value2);
1344
+ onValueChanged?.(value2);
1345
+ }
1346
+ }
1347
+ );
1348
+ });
1349
+ var MultiSelect = (0, import_react8.forwardRef)(function MultiSelect2({
1350
+ children,
1351
+ contentPanelProps,
1352
+ buttonProps,
1353
+ ...props
1354
+ }, ref) {
1355
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(SelectRoot, { ...props, isMultiSelect: true, children: [
1356
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectButton, { ref, ...buttonProps }),
1357
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectContent, { ...contentPanelProps, children })
1358
+ ] });
1359
+ });
1360
+ var MultiSelectUncontrolled = (0, import_react8.forwardRef)(function MultiSelectUncontrolled2({
1361
+ values: initialValues,
1362
+ onValuesChanged,
1363
+ ...props
1364
+ }, ref) {
1365
+ const [values, setValues] = (0, import_react8.useState)(initialValues);
1366
+ (0, import_react8.useEffect)(() => {
1367
+ setValues(initialValues);
1368
+ }, [initialValues]);
1369
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1370
+ MultiSelect,
1371
+ {
1372
+ ...props,
1373
+ ref,
1374
+ values,
1375
+ onValuesChanged: (value) => {
1376
+ setValues(value);
1377
+ onValuesChanged?.(value);
1378
+ }
1379
+ }
1380
+ );
1381
+ });
1382
+ var MultiSelectChipDisplay = (0, import_react8.forwardRef)(function MultiSelectChipDisplay2({
1383
+ children,
1384
+ contentPanelProps,
1385
+ chipDisplayProps,
1386
+ ...props
1387
+ }, ref) {
1388
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(SelectRoot, { ...props, isMultiSelect: true, children: [
1389
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectChipDisplay, { ref, ...chipDisplayProps }),
1390
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectContent, { ...contentPanelProps, children })
1391
+ ] });
1392
+ });
1393
+ var MultiSelectChipDisplayUncontrolled = (0, import_react8.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
1394
+ values: initialValues,
1395
+ onValuesChanged,
1396
+ ...props
1397
+ }, ref) {
1398
+ const [values, setValues] = (0, import_react8.useState)(initialValues);
1399
+ (0, import_react8.useEffect)(() => {
1400
+ setValues(initialValues);
1401
+ }, [initialValues]);
1402
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1403
+ MultiSelectChipDisplay,
1404
+ {
1405
+ ...props,
1406
+ ref,
1407
+ values,
1408
+ onValuesChanged: (value) => {
1409
+ setValues(value);
1410
+ onValuesChanged?.(value);
1411
+ }
1412
+ }
1413
+ );
1414
+ });
1415
+
1416
+ // src/components/properties/PropertyBase.tsx
1417
+ var import_lucide_react3 = require("lucide-react");
1418
+ var import_clsx5 = __toESM(require("clsx"));
413
1419
 
414
1420
  // src/localization/defaults/form.ts
415
1421
  var formTranslation = {
@@ -447,6 +1453,7 @@ var formTranslation = {
447
1453
  next: "Next",
448
1454
  no: "No",
449
1455
  none: "None",
1456
+ nothingFound: "Nothing found",
450
1457
  of: "of",
451
1458
  optional: "Optional",
452
1459
  pleaseWait: "Please wait...",
@@ -503,6 +1510,7 @@ var formTranslation = {
503
1510
  next: "Weiter",
504
1511
  no: "Nein",
505
1512
  none: "Nichts",
1513
+ nothingFound: "Nichts gefunden",
506
1514
  of: "von",
507
1515
  optional: "Optional",
508
1516
  pleaseWait: "Bitte warten...",
@@ -527,1027 +1535,43 @@ var formTranslation = {
527
1535
  }
528
1536
  };
529
1537
 
530
- // src/components/user-action/Menu.tsx
531
- var import_react6 = require("react");
532
- var import_clsx4 = __toESM(require("clsx"));
533
-
534
- // src/hooks/useOutsideClick.ts
535
- var import_react4 = require("react");
536
- var useOutsideClick = (refs, handler) => {
537
- (0, import_react4.useEffect)(() => {
538
- const listener = (event) => {
539
- if (event.target === null) return;
540
- if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
541
- return;
542
- }
543
- handler();
544
- };
545
- document.addEventListener("mousedown", listener);
546
- document.addEventListener("touchstart", listener);
547
- return () => {
548
- document.removeEventListener("mousedown", listener);
549
- document.removeEventListener("touchstart", listener);
550
- };
551
- }, [refs, handler]);
552
- };
553
-
554
- // src/hooks/useHoverState.ts
555
- var import_react5 = require("react");
556
- var defaultUseHoverStateProps = {
557
- closingDelay: 200,
558
- isDisabled: false
559
- };
560
- var useHoverState = (props = void 0) => {
561
- const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
562
- const [isHovered, setIsHovered] = (0, import_react5.useState)(false);
563
- const [timer, setTimer] = (0, import_react5.useState)();
564
- const onMouseEnter = () => {
565
- if (isDisabled) {
566
- return;
567
- }
568
- clearTimeout(timer);
569
- setIsHovered(true);
570
- };
571
- const onMouseLeave = () => {
572
- if (isDisabled) {
573
- return;
574
- }
575
- setTimer(setTimeout(() => {
576
- setIsHovered(false);
577
- }, closingDelay));
578
- };
579
- (0, import_react5.useEffect)(() => {
580
- if (timer) {
581
- return () => {
582
- clearTimeout(timer);
583
- };
584
- }
585
- });
586
- (0, import_react5.useEffect)(() => {
587
- if (timer) {
588
- clearTimeout(timer);
589
- }
590
- }, [isDisabled]);
591
- return {
592
- isHovered,
593
- setIsHovered,
594
- handlers: { onMouseEnter, onMouseLeave }
595
- };
596
- };
597
-
598
- // src/util/PropsWithFunctionChildren.ts
599
- var resolve = (children, bag) => {
600
- if (typeof children === "function") {
601
- return children(bag);
602
- }
603
- return children ?? void 0;
604
- };
605
- var BagFunctionUtil = {
606
- resolve
607
- };
608
-
609
- // src/hooks/usePopoverPosition.ts
610
- var defaultPopoverPositionOptions = {
611
- edgePadding: 16,
612
- outerGap: 4,
613
- horizontalAlignment: "leftInside",
614
- verticalAlignment: "bottomOutside",
615
- disabled: false
616
- };
617
- var usePopoverPosition = (trigger, options) => {
618
- const {
619
- edgePadding,
620
- outerGap,
621
- verticalAlignment,
622
- horizontalAlignment,
623
- disabled
624
- } = { ...defaultPopoverPositionOptions, ...options };
625
- if (disabled || !trigger) {
626
- return {};
627
- }
628
- const left = {
629
- leftOutside: trigger.left - outerGap,
630
- leftInside: trigger.left,
631
- rightOutside: trigger.right + outerGap,
632
- rightInside: trigger.right,
633
- center: trigger.left + trigger.width / 2
634
- }[horizontalAlignment];
635
- const top = {
636
- topOutside: trigger.top - outerGap,
637
- topInside: trigger.top,
638
- bottomOutside: trigger.bottom + outerGap,
639
- bottomInside: trigger.bottom,
640
- center: trigger.top + trigger.height / 2
641
- }[verticalAlignment];
642
- const translateX = {
643
- leftOutside: "-100%",
644
- leftInside: void 0,
645
- rightOutside: void 0,
646
- rightInside: "-100%",
647
- center: "-50%"
648
- }[horizontalAlignment];
649
- const translateY = {
650
- topOutside: "-100%",
651
- topInside: void 0,
652
- bottomOutside: void 0,
653
- bottomInside: "-100%",
654
- center: "-50%"
655
- }[verticalAlignment];
656
- return {
657
- left: Math.max(left, edgePadding),
658
- top: Math.max(top, edgePadding),
659
- translate: [translateX ?? "0", translateY ?? "0"].join(" ")
660
- };
661
- };
662
-
663
- // src/components/user-action/Menu.tsx
664
- var import_react_dom = require("react-dom");
665
- var import_jsx_runtime5 = require("react/jsx-runtime");
666
- function getScrollableParents(element) {
667
- const scrollables = [];
668
- let parent = element.parentElement;
669
- while (parent) {
670
- scrollables.push(parent);
671
- parent = parent.parentElement;
672
- }
673
- return scrollables;
674
- }
675
- var Menu = ({
676
- trigger,
677
- children,
678
- alignmentHorizontal = "leftInside",
679
- alignmentVertical = "bottomOutside",
680
- showOnHover = false,
681
- disabled = false,
682
- menuClassName = ""
1538
+ // src/components/properties/PropertyBase.tsx
1539
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1540
+ var PropertyBase = ({
1541
+ overwriteTranslation,
1542
+ name,
1543
+ input,
1544
+ softRequired = false,
1545
+ hasValue,
1546
+ icon,
1547
+ readOnly,
1548
+ onRemove,
1549
+ className = ""
683
1550
  }) => {
684
- const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
685
- const triggerRef = (0, import_react6.useRef)(null);
686
- const menuRef = (0, import_react6.useRef)(null);
687
- useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
688
- const [isHidden, setIsHidden] = (0, import_react6.useState)(true);
689
- const bag = {
690
- isOpen,
691
- close: () => setIsOpen(false),
692
- toggleOpen: () => setIsOpen((prevState) => !prevState),
693
- disabled
694
- };
695
- const menuPosition = usePopoverPosition(
696
- triggerRef.current?.getBoundingClientRect(),
697
- { verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
698
- );
699
- (0, import_react6.useEffect)(() => {
700
- if (!isOpen) return;
701
- const triggerEl = triggerRef.current;
702
- if (!triggerEl) return;
703
- const scrollableParents = getScrollableParents(triggerEl);
704
- const close = () => setIsOpen(false);
705
- scrollableParents.forEach((parent) => {
706
- parent.addEventListener("scroll", close);
707
- });
708
- window.addEventListener("resize", close);
709
- return () => {
710
- scrollableParents.forEach((parent) => {
711
- parent.removeEventListener("scroll", close);
712
- });
713
- window.removeEventListener("resize", close);
714
- };
715
- }, [isOpen, setIsOpen]);
716
- (0, import_react6.useEffect)(() => {
717
- if (isOpen) {
718
- setIsHidden(false);
719
- }
720
- }, [isOpen]);
721
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
722
- trigger(bag, triggerRef),
723
- (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1551
+ const translation = useTranslation([formTranslation], overwriteTranslation);
1552
+ const requiredAndNoValue = softRequired && !hasValue;
1553
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)("flex-row-0 group", className), children: [
1554
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
724
1555
  "div",
725
1556
  {
726
- ref: menuRef,
727
- onClick: (e) => e.stopPropagation(),
728
- className: (0, import_clsx4.default)(
729
- "absolute rounded-md bg-menu-background text-menu-text shadow-around-lg shadow-strong z-[300]",
1557
+ className: (0, import_clsx5.default)(
1558
+ "flex-row-2 max-w-48 min-w-48 px-3 py-2 items-center rounded-l-xl border-2 border-r-0",
730
1559
  {
731
- "animate-pop-in": isOpen,
732
- "animate-pop-out": !isOpen,
733
- "hidden": isHidden
1560
+ "bg-property-title-background text-property-title-text group-hover:border-primary": !requiredAndNoValue,
1561
+ "bg-warning text-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
734
1562
  },
735
- menuClassName
1563
+ className
736
1564
  ),
737
- onAnimationEnd: () => {
738
- if (!isOpen) {
739
- setIsHidden(true);
740
- }
741
- },
742
- style: {
743
- ...menuPosition
744
- },
745
- children: BagFunctionUtil.resolve(children, bag)
746
- }
747
- ), document.body)
748
- ] });
749
- };
750
-
751
- // src/components/layout-and-navigation/Expandable.tsx
752
- var import_react7 = require("react");
753
- var import_lucide_react = require("lucide-react");
754
- var import_clsx5 = __toESM(require("clsx"));
755
-
756
- // src/util/noop.ts
757
- var noop = () => void 0;
758
-
759
- // src/components/layout-and-navigation/Expandable.tsx
760
- var import_jsx_runtime6 = require("react/jsx-runtime");
761
- var ExpansionIcon = ({ isExpanded, className }) => {
762
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
763
- import_lucide_react.ChevronDown,
764
- {
765
- className: (0, import_clsx5.default)(
766
- "min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
767
- { "rotate-180": isExpanded },
768
- className
769
- )
770
- }
771
- );
772
- };
773
- var Expandable = (0, import_react7.forwardRef)(function Expandable2({
774
- children,
775
- label,
776
- icon,
777
- isExpanded = false,
778
- onChange = noop,
779
- clickOnlyOnHeader = true,
780
- disabled = false,
781
- className,
782
- headerClassName,
783
- contentClassName,
784
- contentExpandedClassName
785
- }, ref) {
786
- const defaultIcon = (0, import_react7.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
787
- icon ??= defaultIcon;
788
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
789
- "div",
790
- {
791
- ref,
792
- className: (0, import_clsx5.default)("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
793
- onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
794
- children: [
795
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
796
- "div",
797
- {
798
- className: (0, import_clsx5.default)(
799
- "flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
800
- {
801
- "group-hover:brightness-97": !isExpanded,
802
- "hover:brightness-97": isExpanded && !disabled,
803
- "cursor-pointer": clickOnlyOnHeader && !disabled
804
- },
805
- headerClassName
806
- ),
807
- onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
808
- children: [
809
- label,
810
- icon(isExpanded)
811
- ]
812
- }
813
- ),
814
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
815
- "div",
816
- {
817
- className: (0, import_clsx5.default)(
818
- "flex-col-2 px-4 transition-all duration-300 ease-in-out",
819
- {
820
- [(0, import_clsx5.default)("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
821
- "max-h-0 opacity-0 overflow-hidden": !isExpanded
822
- },
823
- contentClassName
824
- ),
825
- children
826
- }
827
- )
828
- ]
829
- }
830
- );
831
- });
832
- var ExpandableUncontrolled = (0, import_react7.forwardRef)(function ExpandableUncontrolled2({
833
- isExpanded,
834
- onChange = noop,
835
- ...props
836
- }, ref) {
837
- const [usedIsExpanded, setUsedIsExpanded] = (0, import_react7.useState)(isExpanded);
838
- (0, import_react7.useEffect)(() => {
839
- setUsedIsExpanded(isExpanded);
840
- }, [isExpanded]);
841
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
842
- Expandable,
843
- {
844
- ...props,
845
- ref,
846
- isExpanded: usedIsExpanded,
847
- onChange: (value) => {
848
- onChange(value);
849
- setUsedIsExpanded(value);
850
- }
851
- }
852
- );
853
- });
854
-
855
- // src/components/user-action/Input.tsx
856
- var import_react11 = require("react");
857
- var import_clsx6 = __toESM(require("clsx"));
858
-
859
- // src/hooks/useDelay.ts
860
- var import_react8 = require("react");
861
- var defaultOptions = {
862
- delay: 3e3,
863
- disabled: false
864
- };
865
- function useDelay(options) {
866
- const [timer, setTimer] = (0, import_react8.useState)(void 0);
867
- const { delay, disabled } = {
868
- ...defaultOptions,
869
- ...options
870
- };
871
- const clearTimer = () => {
872
- clearTimeout(timer);
873
- setTimer(void 0);
874
- };
875
- const restartTimer = (onDelayFinish) => {
876
- if (disabled) {
877
- return;
878
- }
879
- clearTimeout(timer);
880
- setTimer(setTimeout(() => {
881
- onDelayFinish();
882
- setTimer(void 0);
883
- }, delay));
884
- };
885
- (0, import_react8.useEffect)(() => {
886
- return () => {
887
- clearTimeout(timer);
888
- };
889
- }, [timer]);
890
- (0, import_react8.useEffect)(() => {
891
- if (disabled) {
892
- clearTimeout(timer);
893
- setTimer(void 0);
894
- }
895
- }, [disabled, timer]);
896
- return { restartTimer, clearTimer, hasActiveTimer: !!timer };
897
- }
898
-
899
- // src/hooks/useFocusManagement.ts
900
- var import_react9 = require("react");
901
- function useFocusManagement() {
902
- const getFocusableElements = (0, import_react9.useCallback)(() => {
903
- return Array.from(
904
- document.querySelectorAll(
905
- 'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
906
- )
907
- ).filter(
908
- (el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
909
- );
910
- }, []);
911
- const getNextFocusElement = (0, import_react9.useCallback)(() => {
912
- const elements = getFocusableElements();
913
- if (elements.length === 0) {
914
- return void 0;
915
- }
916
- let nextElement = elements[0];
917
- if (document.activeElement instanceof HTMLElement) {
918
- const currentIndex = elements.indexOf(document.activeElement);
919
- nextElement = elements[(currentIndex + 1) % elements.length];
920
- }
921
- return nextElement;
922
- }, [getFocusableElements]);
923
- const focusNext = (0, import_react9.useCallback)(() => {
924
- const nextElement = getNextFocusElement();
925
- nextElement?.focus();
926
- }, [getNextFocusElement]);
927
- const getPreviousFocusElement = (0, import_react9.useCallback)(() => {
928
- const elements = getFocusableElements();
929
- if (elements.length === 0) {
930
- return void 0;
931
- }
932
- let previousElement = elements[0];
933
- if (document.activeElement instanceof HTMLElement) {
934
- const currentIndex = elements.indexOf(document.activeElement);
935
- if (currentIndex === 0) {
936
- previousElement = elements[elements.length - 1];
937
- } else {
938
- previousElement = elements[currentIndex - 1];
939
- }
940
- }
941
- return previousElement;
942
- }, [getFocusableElements]);
943
- const focusPrevious = (0, import_react9.useCallback)(() => {
944
- const previousElement = getPreviousFocusElement();
945
- if (previousElement) previousElement.focus();
946
- }, [getPreviousFocusElement]);
947
- return {
948
- getFocusableElements,
949
- getNextFocusElement,
950
- getPreviousFocusElement,
951
- focusNext,
952
- focusPrevious
953
- };
954
- }
955
-
956
- // src/hooks/useFocusOnceVisible.ts
957
- var import_react10 = __toESM(require("react"));
958
- var useFocusOnceVisible = (ref, disable = false) => {
959
- const [hasUsedFocus, setHasUsedFocus] = import_react10.default.useState(false);
960
- (0, import_react10.useEffect)(() => {
961
- if (disable || hasUsedFocus) {
962
- return;
963
- }
964
- const observer = new IntersectionObserver(([entry]) => {
965
- if (entry.isIntersecting && !hasUsedFocus) {
966
- ref.current?.focus();
967
- setHasUsedFocus(hasUsedFocus);
968
- }
969
- }, {
970
- threshold: 0.1
971
- });
972
- if (ref.current) {
973
- observer.observe(ref.current);
974
- }
975
- return () => observer.disconnect();
976
- }, [disable, hasUsedFocus, ref]);
977
- };
978
-
979
- // src/components/user-action/Input.tsx
980
- var import_jsx_runtime7 = require("react/jsx-runtime");
981
- var getInputClassName = ({ disabled = false, hasError = false }) => {
982
- return (0, import_clsx6.default)(
983
- "px-2 py-1.5 rounded-md border-2",
984
- {
985
- "bg-input-background text-input-text hover:border-primary focus:border-primary": !disabled && !hasError,
986
- "bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
987
- "bg-disabled-background text-disabled-text border-disabled-border": disabled
988
- }
989
- );
990
- };
991
- var defaultEditCompleteOptions = {
992
- onBlur: true,
993
- afterDelay: true,
994
- delay: 2500
995
- };
996
- var Input = (0, import_react11.forwardRef)(function Input2({
997
- id,
998
- type = "text",
999
- value,
1000
- label,
1001
- onChange = noop,
1002
- onChangeText = noop,
1003
- onEditCompleted,
1004
- className = "",
1005
- allowEnterComplete = true,
1006
- expanded = true,
1007
- autoFocus = false,
1008
- onBlur,
1009
- editCompleteOptions,
1010
- containerClassName,
1011
- disabled,
1012
- ...restProps
1013
- }, forwardedRef) {
1014
- const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
1015
- const {
1016
- restartTimer,
1017
- clearTimer
1018
- } = useDelay({ delay, disabled: !afterDelay });
1019
- const innerRef = (0, import_react11.useRef)(null);
1020
- const { focusNext } = useFocusManagement();
1021
- useFocusOnceVisible(innerRef, !autoFocus);
1022
- (0, import_react11.useImperativeHandle)(forwardedRef, () => innerRef.current);
1023
- const handleKeyDown = (e) => {
1024
- if (e.key === "Enter" && !e.shiftKey) {
1025
- e.preventDefault();
1026
- innerRef.current?.blur();
1027
- focusNext();
1028
- }
1029
- };
1030
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_clsx6.default)({ "w-full": expanded }, containerClassName), children: [
1031
- label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx6.default)("mb-1", label.className) }),
1032
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1033
- "input",
1034
- {
1035
- ...restProps,
1036
- ref: innerRef,
1037
- value,
1038
- id,
1039
- type,
1040
- disabled,
1041
- className: (0, import_clsx6.default)(getInputClassName({ disabled }), className),
1042
- onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
1043
- onBlur: (event) => {
1044
- onBlur?.(event);
1045
- if (onEditCompleted && allowEditCompleteOnBlur) {
1046
- onEditCompleted(event.target.value);
1047
- clearTimer();
1048
- }
1049
- },
1050
- onChange: (e) => {
1051
- const value2 = e.target.value;
1052
- if (onEditCompleted) {
1053
- restartTimer(() => {
1054
- if (innerRef.current) {
1055
- innerRef.current.blur();
1056
- if (!allowEditCompleteOnBlur) {
1057
- onEditCompleted(value2);
1058
- }
1059
- } else {
1060
- onEditCompleted(value2);
1061
- }
1062
- });
1063
- }
1064
- onChange(e);
1065
- onChangeText(value2);
1066
- }
1067
- }
1068
- )
1069
- ] });
1070
- });
1071
- var FormInput = (0, import_react11.forwardRef)(function FormInput2({
1072
- id,
1073
- labelText,
1074
- errorText,
1075
- className,
1076
- labelClassName,
1077
- errorClassName,
1078
- containerClassName,
1079
- required,
1080
- disabled,
1081
- ...restProps
1082
- }, ref) {
1083
- const input = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1084
- "input",
1085
- {
1086
- ...restProps,
1087
- ref,
1088
- id,
1089
- disabled,
1090
- className: (0, import_clsx6.default)(
1091
- getInputClassName({ disabled, hasError: !!errorText }),
1092
- className
1093
- )
1094
- }
1095
- );
1096
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_clsx6.default)("flex flex-col gap-y-1", containerClassName), children: [
1097
- labelText && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { htmlFor: id, className: (0, import_clsx6.default)("textstyle-label-md", labelClassName), children: [
1098
- labelText,
1099
- required && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-primary font-bold", children: "*" })
1100
- ] }),
1101
- input,
1102
- errorText && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: id, className: (0, import_clsx6.default)("text-negative", errorClassName), children: errorText })
1103
- ] });
1104
- });
1105
-
1106
- // src/components/user-action/SearchBar.tsx
1107
- var import_lucide_react2 = require("lucide-react");
1108
- var import_clsx7 = require("clsx");
1109
- var import_jsx_runtime8 = require("react/jsx-runtime");
1110
- var SearchBar = ({
1111
- placeholder,
1112
- onSearch,
1113
- disableOnSearch,
1114
- containerClassName,
1115
- ...inputProps
1116
- }) => {
1117
- const translation = useTranslation([formTranslation]);
1118
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.clsx)("flex-row-2 justify-between items-center", containerClassName), children: [
1119
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1120
- Input,
1121
- {
1122
- ...inputProps,
1123
- placeholder: placeholder ?? translation("search")
1565
+ children: [
1566
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "max-w-6 min-w-6 text-text-primary", children: icon }),
1567
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "font-semibold", children: name })
1568
+ ]
1124
1569
  }
1125
1570
  ),
1126
- onSearch && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Search, { className: "w-full h-full" }) })
1127
- ] });
1128
- };
1129
-
1130
- // src/hooks/useSearch.ts
1131
- var import_react12 = require("react");
1132
-
1133
- // src/util/simpleSearch.ts
1134
- var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
1135
- return objects.filter((object) => {
1136
- const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
1137
- if (!mappedSearchKeywords) {
1138
- return true;
1139
- }
1140
- return search.every((searchValue) => !!mappedSearchKeywords.find((value) => !!value && value.includes(searchValue.toLowerCase().trim())));
1141
- });
1142
- };
1143
-
1144
- // src/hooks/useSearch.ts
1145
- var useSearch = ({
1146
- list,
1147
- initialSearch,
1148
- searchMapping,
1149
- additionalSearchTags,
1150
- isSearchInstant = true,
1151
- sortingFunction,
1152
- filter,
1153
- disabled = false
1154
- }) => {
1155
- const [search, setSearch] = (0, import_react12.useState)(initialSearch ?? "");
1156
- const [result, setResult] = (0, import_react12.useState)(list);
1157
- const searchTags = (0, import_react12.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
1158
- const updateSearch = (0, import_react12.useCallback)((newSearch) => {
1159
- const usedSearch = newSearch ?? search;
1160
- if (newSearch) {
1161
- setSearch(search);
1162
- }
1163
- setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
1164
- }, [searchTags, list, search, searchMapping]);
1165
- (0, import_react12.useEffect)(() => {
1166
- if (isSearchInstant) {
1167
- setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
1168
- }
1169
- }, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
1170
- const filteredResult = (0, import_react12.useMemo)(() => {
1171
- if (!filter) {
1172
- return result;
1173
- }
1174
- return result.filter(filter);
1175
- }, [result, filter]);
1176
- const sortedAndFilteredResult = (0, import_react12.useMemo)(() => {
1177
- if (!sortingFunction) {
1178
- return filteredResult;
1179
- }
1180
- return filteredResult.sort(sortingFunction);
1181
- }, [filteredResult, sortingFunction]);
1182
- const usedResult = (0, import_react12.useMemo)(() => {
1183
- if (!disabled) {
1184
- return sortedAndFilteredResult;
1185
- }
1186
- return list;
1187
- }, [disabled, list, sortedAndFilteredResult]);
1188
- return {
1189
- result: usedResult,
1190
- hasResult: usedResult.length > 0,
1191
- allItems: list,
1192
- updateSearch,
1193
- search,
1194
- setSearch
1195
- };
1196
- };
1197
-
1198
- // src/components/user-action/Checkbox.tsx
1199
- var import_react13 = require("react");
1200
- var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
1201
- var import_lucide_react3 = require("lucide-react");
1202
- var import_clsx8 = __toESM(require("clsx"));
1203
- var import_jsx_runtime9 = require("react/jsx-runtime");
1204
- var checkboxSizeMapping = {
1205
- small: "size-5",
1206
- medium: "size-6",
1207
- large: "size-8"
1208
- };
1209
- var checkboxIconSizeMapping = {
1210
- small: "size-4",
1211
- medium: "size-5",
1212
- large: "size-7"
1213
- };
1214
- var Checkbox = ({
1215
- id,
1216
- label,
1217
- checked,
1218
- disabled,
1219
- onChange,
1220
- onChangeTristate,
1221
- size = "medium",
1222
- className = "",
1223
- containerClassName
1224
- }) => {
1225
- const usedSizeClass = checkboxSizeMapping[size];
1226
- const innerIconSize = checkboxIconSizeMapping[size];
1227
- const propagateChange = (checked2) => {
1228
- if (onChangeTristate) {
1229
- onChangeTristate(checked2);
1230
- }
1231
- if (onChange) {
1232
- onChange(checked2 === "indeterminate" ? false : checked2);
1233
- }
1234
- };
1235
- const changeValue = () => {
1236
- if (disabled) {
1237
- return;
1238
- }
1239
- const newValue = checked === "indeterminate" ? false : !checked;
1240
- propagateChange(newValue);
1241
- };
1242
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1243
- "div",
1244
- {
1245
- className: (0, import_clsx8.default)("group flex-row-2 items-center", {
1246
- "cursor-pointer": !disabled,
1247
- "cursor-not-allowed": disabled
1248
- }, containerClassName),
1249
- onClick: changeValue,
1250
- children: [
1251
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1252
- CheckboxPrimitive.Root,
1253
- {
1254
- onCheckedChange: propagateChange,
1255
- checked,
1256
- disabled,
1257
- id,
1258
- className: (0, import_clsx8.default)(usedSizeClass, `items-center border-2 rounded outline-none `, {
1259
- "text-disabled-text border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
1260
- "focus:border-primary group-hover:border-primary ": !disabled,
1261
- "bg-input-background": !disabled && !checked,
1262
- "bg-primary/30 border-primary text-primary": !disabled && checked === true || checked === "indeterminate"
1263
- }, className),
1264
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(CheckboxPrimitive.Indicator, { children: [
1265
- checked === true && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Check, { className: innerIconSize }),
1266
- checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Minus, { className: innerIconSize })
1267
- ] })
1268
- }
1269
- ),
1270
- label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1271
- Label,
1272
- {
1273
- ...label,
1274
- className: (0, import_clsx8.default)(
1275
- label.className,
1276
- {
1277
- "cursor-pointer": !disabled,
1278
- "cursor-not-allowed": disabled
1279
- }
1280
- ),
1281
- htmlFor: id
1282
- }
1283
- )
1284
- ]
1285
- }
1286
- );
1287
- };
1288
-
1289
- // src/components/user-action/MultiSelect.tsx
1290
- var import_lucide_react5 = require("lucide-react");
1291
-
1292
- // src/components/layout-and-navigation/Tile.tsx
1293
- var import_clsx9 = __toESM(require("clsx"));
1294
- var import_lucide_react4 = require("lucide-react");
1295
- var import_jsx_runtime10 = require("react/jsx-runtime");
1296
- var Tile = ({
1297
- title,
1298
- titleClassName,
1299
- description,
1300
- descriptionClassName,
1301
- onClick,
1302
- isSelected = false,
1303
- disabled = false,
1304
- prefix,
1305
- suffix,
1306
- normalClassName = "hover:bg-primary/40 cursor-pointer",
1307
- selectedClassName = "bg-primary/20",
1308
- disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
1309
- className
1310
- }) => {
1311
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1312
- "div",
1313
- {
1314
- className: (0, import_clsx9.default)(
1315
- "flex-row-2 w-full items-center",
1316
- {
1317
- [normalClassName]: onClick && !disabled,
1318
- [selectedClassName]: isSelected && !disabled,
1319
- [disabledClassName]: disabled
1320
- },
1321
- className
1322
- ),
1323
- onClick: disabled ? void 0 : onClick,
1324
- children: [
1325
- prefix,
1326
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex-col-0 w-full", children: [
1327
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: (0, import_clsx9.default)(titleClassName ?? "textstyle-title-normal"), children: title }),
1328
- !!description && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: (0, import_clsx9.default)(descriptionClassName ?? "textstyle-description"), children: description })
1329
- ] }),
1330
- suffix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Check, { size: 24 }) : void 0)
1331
- ]
1332
- }
1333
- );
1334
- };
1335
- var ListTile = ({
1336
- ...props
1337
- }) => {
1338
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1339
- Tile,
1340
- {
1341
- ...props,
1342
- titleClassName: props.titleClassName ?? "font-semibold",
1343
- className: (0, import_clsx9.default)("px-2 py-1 rounded-md", props.className),
1344
- disabledClassName: props.disabledClassName ?? "text-disabled-text cursor-not-allowed"
1345
- }
1346
- );
1347
- };
1348
-
1349
- // src/components/user-action/MultiSelect.tsx
1350
- var import_jsx_runtime11 = require("react/jsx-runtime");
1351
- var defaultMultiSelectTranslation = {
1352
- en: {
1353
- selected: `{{amount}} selected`
1354
- },
1355
- de: {
1356
- selected: `{{amount}} ausgew\xE4hlt`
1357
- }
1358
- };
1359
- var MultiSelect = ({
1360
- overwriteTranslation,
1361
- label,
1362
- options,
1363
- onChange,
1364
- hintText,
1365
- selectedDisplayOverwrite,
1366
- searchOptions,
1367
- additionalItems,
1368
- useChipDisplay = false,
1369
- className,
1370
- triggerClassName,
1371
- hintTextClassName,
1372
- ...menuProps
1373
- }) => {
1374
- const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
1375
- const { result, search, setSearch } = useSearch({
1376
- list: options,
1377
- searchMapping: (0, import_react14.useCallback)((item) => item.searchTags, []),
1378
- ...searchOptions
1379
- });
1380
- const selectedItems = options.filter((value) => value.selected);
1381
- const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
1382
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: (0, import_clsx10.default)(className), children: [
1383
- label && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1384
- Label,
1385
- {
1386
- ...label,
1387
- htmlFor: label.name,
1388
- className: (0, import_clsx10.default)(" mb-1", label.className),
1389
- labelType: label.labelType ?? "labelSmall"
1390
- }
1391
- ),
1392
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1393
- Menu,
1394
- {
1395
- ...menuProps,
1396
- trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1397
- "button",
1398
- {
1399
- ref,
1400
- className: (0, import_clsx10.default)(
1401
- "group btn-md justify-between w-full border-2 h-auto",
1402
- "not-disabled:bg-input-background not-disabled:text-input-text not-disabled:hover:border-primary",
1403
- "disabled:bg-disabled-background disabled:text-disabled-text disabled:border-disabled-border",
1404
- {
1405
- "min-h-14": useChipDisplay
1406
- },
1407
- triggerClassName
1408
- ),
1409
- onClick: toggleOpen,
1410
- disabled,
1411
- children: useChipDisplay ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, { children: isShowingHint ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1412
- "div",
1413
- {
1414
- className: (0, import_clsx10.default)(
1415
- "icon-btn-sm ",
1416
- {
1417
- "bg-button-solid-neutral-background text-button-solid-neutral-text hover:brightness-90 group-hover:brightness-90": !disabled,
1418
- "bg-disabled-background text-disabled-text": disabled
1419
- }
1420
- ),
1421
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react5.Plus, {})
1422
- }
1423
- ) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1424
- !isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? translation("selected", { replacements: { amount: selectedItems.length.toString() } }) }),
1425
- isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: (0, import_clsx10.default)("textstyle-description", hintTextClassName), children: hintText ?? translation("select") }),
1426
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ExpansionIcon, { isExpanded: isOpen })
1427
- ] })
1428
- }
1429
- ),
1430
- menuClassName: (0, import_clsx10.default)("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
1431
- children: (bag) => {
1432
- const { close } = bag;
1433
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1434
- !searchOptions?.disabled && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1435
- SearchBar,
1436
- {
1437
- value: search,
1438
- onChangeText: setSearch,
1439
- autoFocus: true
1440
- }
1441
- ),
1442
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-col-2 overflow-y-auto", children: [
1443
- result.map((option, index) => {
1444
- const update = () => {
1445
- onChange(options.map((value) => value.value === option.value ? {
1446
- ...option,
1447
- selected: !value.selected
1448
- } : value));
1449
- };
1450
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1451
- ListTile,
1452
- {
1453
- prefix: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1454
- Checkbox,
1455
- {
1456
- checked: option.selected,
1457
- onChange: update,
1458
- size: "small",
1459
- disabled: option.disabled
1460
- }
1461
- ),
1462
- title: option.label,
1463
- onClick: update,
1464
- disabled: option.disabled
1465
- },
1466
- index
1467
- );
1468
- }),
1469
- additionalItems && additionalItems({ ...bag, search })
1470
- ] }),
1471
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-row-2 justify-between", children: [
1472
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-row-2", children: [
1473
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1474
- SolidButton,
1475
- {
1476
- color: "neutral",
1477
- size: "small",
1478
- onClick: () => {
1479
- onChange(options.map((option) => ({
1480
- ...option,
1481
- selected: !option.disabled
1482
- })));
1483
- },
1484
- disabled: options.every((value) => value.selected || value.disabled),
1485
- children: translation("all")
1486
- }
1487
- ),
1488
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1489
- SolidButton,
1490
- {
1491
- color: "neutral",
1492
- size: "small",
1493
- onClick: () => {
1494
- onChange(options.map((option) => ({
1495
- ...option,
1496
- selected: false
1497
- })));
1498
- },
1499
- children: translation("none")
1500
- }
1501
- )
1502
- ] }),
1503
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SolidButton, { size: "small", onClick: close, children: "Done" })
1504
- ] })
1505
- ] });
1506
- }
1507
- }
1508
- )
1509
- ] });
1510
- };
1511
-
1512
- // src/components/properties/PropertyBase.tsx
1513
- var import_lucide_react6 = require("lucide-react");
1514
- var import_clsx11 = __toESM(require("clsx"));
1515
- var import_jsx_runtime12 = require("react/jsx-runtime");
1516
- var PropertyBase = ({
1517
- overwriteTranslation,
1518
- name,
1519
- input,
1520
- softRequired = false,
1521
- hasValue,
1522
- icon,
1523
- readOnly,
1524
- onRemove,
1525
- className = ""
1526
- }) => {
1527
- const translation = useTranslation([formTranslation], overwriteTranslation);
1528
- const requiredAndNoValue = softRequired && !hasValue;
1529
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_clsx11.default)("flex-row-0 group", className), children: [
1530
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1571
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1531
1572
  "div",
1532
1573
  {
1533
- className: (0, import_clsx11.default)(
1534
- "flex-row-2 max-w-48 min-w-48 px-3 py-2 items-center rounded-l-xl border-2 border-r-0",
1535
- {
1536
- "bg-property-title-background text-property-title-text group-hover:border-primary": !requiredAndNoValue,
1537
- "bg-warning text-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
1538
- },
1539
- className
1540
- ),
1541
- children: [
1542
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "max-w-6 min-w-6 text-text-primary", children: icon }),
1543
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-semibold", children: name })
1544
- ]
1545
- }
1546
- ),
1547
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1548
- "div",
1549
- {
1550
- className: (0, import_clsx11.default)(
1574
+ className: (0, import_clsx5.default)(
1551
1575
  "flex-row-2 grow px-3 py-2 justify-between items-center rounded-r-xl border-2 border-l-0 min-h-15",
1552
1576
  {
1553
1577
  "bg-input-background text-input-text group-hover:border-primary": !requiredAndNoValue,
@@ -1557,14 +1581,14 @@ var PropertyBase = ({
1557
1581
  ),
1558
1582
  children: [
1559
1583
  input({ softRequired, hasValue }),
1560
- requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "text-warning", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.AlertTriangle, { size: 24 }) }),
1561
- onRemove && hasValue && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1584
+ requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "text-warning", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.AlertTriangle, { size: 24 }) }),
1585
+ onRemove && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1562
1586
  TextButton,
1563
1587
  {
1564
1588
  onClick: onRemove,
1565
1589
  color: "negative",
1566
- className: (0, import_clsx11.default)("items-center", { "!text-transparent": !hasValue || readOnly }),
1567
- disabled: !hasValue || readOnly,
1590
+ className: (0, import_clsx5.default)("items-center"),
1591
+ disabled: !hasValue,
1568
1592
  children: translation("remove")
1569
1593
  }
1570
1594
  )
@@ -1575,65 +1599,37 @@ var PropertyBase = ({
1575
1599
  };
1576
1600
 
1577
1601
  // src/components/properties/MultiSelectProperty.tsx
1578
- var import_jsx_runtime13 = require("react/jsx-runtime");
1602
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1579
1603
  var MultiSelectProperty = ({
1580
- overwriteTranslation,
1604
+ values,
1581
1605
  options,
1582
- name,
1583
- readOnly = false,
1584
- softRequired,
1585
- onRemove,
1586
- onAddNew,
1587
- ...multiSelectProps
1606
+ onValuesChanged,
1607
+ ...props
1588
1608
  }) => {
1589
- const translation = useTranslation([formTranslation], overwriteTranslation);
1590
- const hasValue = options.some((value) => value.selected);
1591
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1609
+ const hasValue = values.length > 0;
1610
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1592
1611
  PropertyBase,
1593
1612
  {
1594
- name,
1595
- onRemove,
1596
- readOnly,
1597
- softRequired,
1613
+ ...props,
1598
1614
  hasValue,
1599
- icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.List, { size: 24 }),
1600
- input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1601
- MultiSelect,
1615
+ icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react4.List, { size: 24 }),
1616
+ input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1617
+ MultiSelectChipDisplay,
1602
1618
  {
1603
- ...multiSelectProps,
1604
- className: (0, import_clsx12.default)("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
1605
- options,
1606
- disabled: readOnly,
1607
- useChipDisplay: true,
1608
- hintText: `${translation("select")}...`,
1609
- searchOptions: {
1610
- sortingFunction: (a, b) => a.value.localeCompare(b.value),
1611
- ...multiSelectProps?.searchOptions
1619
+ values,
1620
+ onValuesChanged,
1621
+ disabled: props.readOnly,
1622
+ contentPanelProps: {
1623
+ className: (0, import_clsx6.default)(
1624
+ "!border-none !min-h-10"
1625
+ )
1612
1626
  },
1613
- additionalItems: ({ close, search }) => {
1614
- if (!onAddNew && !search.trim()) {
1615
- return void 0;
1616
- }
1617
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1618
- ListTile,
1619
- {
1620
- prefix: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.Plus, {}),
1621
- title: `${translation("add")} ${search.trim()}`,
1622
- onClick: () => {
1623
- onAddNew(search);
1624
- close();
1625
- },
1626
- disabled: options.some((value) => value.value === search.trim())
1627
- }
1628
- );
1627
+ chipDisplayProps: {
1628
+ className: (0, import_clsx6.default)({
1629
+ "!bg-warning !text-surface-warning": softRequired && !hasValue
1630
+ })
1629
1631
  },
1630
- triggerClassName: (0, import_clsx12.default)(
1631
- "!border-none !p-0 !min-h-10",
1632
- {
1633
- "!bg-warning !text-surface-warning": softRequired2 && !hasValue,
1634
- "": !softRequired2 || hasValue
1635
- }
1636
- )
1632
+ children: options.map((value) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SelectOption, { value }, value))
1637
1633
  }
1638
1634
  )
1639
1635
  }