@helpwave/hightide 0.1.24 → 0.1.26

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