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