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