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