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