@helpwave/hightide 0.1.25 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (664) hide show
  1. package/README.md +1 -1
  2. package/dist/components/branding/HelpwaveBadge.d.mts +4 -5
  3. package/dist/components/branding/HelpwaveBadge.d.ts +4 -5
  4. package/dist/components/branding/HelpwaveBadge.js +46 -87
  5. package/dist/components/branding/HelpwaveBadge.js.map +1 -1
  6. package/dist/components/branding/HelpwaveBadge.mjs +46 -89
  7. package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
  8. package/dist/components/date/DatePicker.d.mts +1 -1
  9. package/dist/components/date/DatePicker.d.ts +1 -1
  10. package/dist/components/date/DatePicker.js +65 -14
  11. package/dist/components/date/DatePicker.js.map +1 -1
  12. package/dist/components/date/DatePicker.mjs +66 -15
  13. package/dist/components/date/DatePicker.mjs.map +1 -1
  14. package/dist/components/date/DayPicker.d.mts +1 -1
  15. package/dist/components/date/DayPicker.d.ts +1 -1
  16. package/dist/components/date/DayPicker.js +3 -3
  17. package/dist/components/date/DayPicker.js.map +1 -1
  18. package/dist/components/date/DayPicker.mjs +3 -3
  19. package/dist/components/date/DayPicker.mjs.map +1 -1
  20. package/dist/components/date/TimeDisplay.js.map +1 -1
  21. package/dist/components/date/TimeDisplay.mjs.map +1 -1
  22. package/dist/components/date/TimePicker.js +2 -2
  23. package/dist/components/date/TimePicker.js.map +1 -1
  24. package/dist/components/date/TimePicker.mjs +2 -2
  25. package/dist/components/date/TimePicker.mjs.map +1 -1
  26. package/dist/components/date/YearMonthPicker.js +59 -8
  27. package/dist/components/date/YearMonthPicker.js.map +1 -1
  28. package/dist/components/date/YearMonthPicker.mjs +60 -9
  29. package/dist/components/date/YearMonthPicker.mjs.map +1 -1
  30. package/dist/components/{dialogs → dialog}/ConfirmDialog.d.mts +9 -8
  31. package/dist/components/{dialogs → dialog}/ConfirmDialog.d.ts +9 -8
  32. package/dist/components/dialog/ConfirmDialog.js +938 -0
  33. package/dist/components/dialog/ConfirmDialog.js.map +1 -0
  34. package/dist/components/dialog/ConfirmDialog.mjs +902 -0
  35. package/dist/components/dialog/ConfirmDialog.mjs.map +1 -0
  36. package/dist/components/dialog/Dialog.d.mts +27 -0
  37. package/dist/components/dialog/Dialog.d.ts +27 -0
  38. package/dist/components/dialog/Dialog.js +879 -0
  39. package/dist/components/dialog/Dialog.js.map +1 -0
  40. package/dist/components/dialog/Dialog.mjs +845 -0
  41. package/dist/components/dialog/Dialog.mjs.map +1 -0
  42. package/dist/components/dialog/DiscardChangesDialog.d.mts +24 -0
  43. package/dist/components/dialog/DiscardChangesDialog.d.ts +24 -0
  44. package/dist/components/dialog/DiscardChangesDialog.js +966 -0
  45. package/dist/components/dialog/DiscardChangesDialog.js.map +1 -0
  46. package/dist/components/dialog/DiscardChangesDialog.mjs +930 -0
  47. package/dist/components/dialog/DiscardChangesDialog.mjs.map +1 -0
  48. package/dist/components/dialog/InputDialog.d.mts +22 -0
  49. package/dist/components/dialog/InputDialog.d.ts +22 -0
  50. package/dist/components/dialog/InputDialog.js +1139 -0
  51. package/dist/components/dialog/InputDialog.js.map +1 -0
  52. package/dist/components/dialog/InputDialog.mjs +1103 -0
  53. package/dist/components/dialog/InputDialog.mjs.map +1 -0
  54. package/dist/components/dialog/LanguageDialog.d.mts +25 -0
  55. package/dist/components/dialog/LanguageDialog.d.ts +25 -0
  56. package/dist/components/dialog/LanguageDialog.js +1697 -0
  57. package/dist/components/dialog/LanguageDialog.js.map +1 -0
  58. package/dist/components/dialog/LanguageDialog.mjs +1671 -0
  59. package/dist/components/dialog/LanguageDialog.mjs.map +1 -0
  60. package/dist/components/dialog/ThemeDialog.d.mts +26 -0
  61. package/dist/components/dialog/ThemeDialog.d.ts +26 -0
  62. package/dist/components/dialog/ThemeDialog.js +1751 -0
  63. package/dist/components/dialog/ThemeDialog.js.map +1 -0
  64. package/dist/components/dialog/ThemeDialog.mjs +1725 -0
  65. package/dist/components/dialog/ThemeDialog.mjs.map +1 -0
  66. package/dist/components/dialog/index.d.mts +17 -0
  67. package/dist/components/dialog/index.d.ts +17 -0
  68. package/dist/components/dialog/index.js +2098 -0
  69. package/dist/components/dialog/index.js.map +1 -0
  70. package/dist/components/dialog/index.mjs +2067 -0
  71. package/dist/components/dialog/index.mjs.map +1 -0
  72. package/dist/components/form/FormElementWrapper.d.mts +29 -0
  73. package/dist/components/form/FormElementWrapper.d.ts +29 -0
  74. package/dist/components/form/FormElementWrapper.js +98 -0
  75. package/dist/components/form/FormElementWrapper.js.map +1 -0
  76. package/dist/components/form/FormElementWrapper.mjs +64 -0
  77. package/dist/components/form/FormElementWrapper.mjs.map +1 -0
  78. package/dist/components/icons-and-geometry/Avatar.js +498 -2886
  79. package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
  80. package/dist/components/icons-and-geometry/Avatar.mjs +490 -2878
  81. package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
  82. package/dist/components/icons-and-geometry/{Helpwave.d.mts → HelpwaveLogo.d.mts} +3 -3
  83. package/dist/components/icons-and-geometry/{Helpwave.d.ts → HelpwaveLogo.d.ts} +3 -3
  84. package/dist/components/icons-and-geometry/{Helpwave.js → HelpwaveLogo.js} +21 -22
  85. package/dist/components/icons-and-geometry/HelpwaveLogo.js.map +1 -0
  86. package/dist/components/icons-and-geometry/{Helpwave.mjs → HelpwaveLogo.mjs} +17 -18
  87. package/dist/components/icons-and-geometry/HelpwaveLogo.mjs.map +1 -0
  88. package/dist/components/icons-and-geometry/Ring.js +1 -1
  89. package/dist/components/icons-and-geometry/Ring.js.map +1 -1
  90. package/dist/components/icons-and-geometry/Ring.mjs +1 -1
  91. package/dist/components/icons-and-geometry/Ring.mjs.map +1 -1
  92. package/dist/components/icons-and-geometry/Tag.js +8 -20
  93. package/dist/components/icons-and-geometry/Tag.js.map +1 -1
  94. package/dist/components/icons-and-geometry/Tag.mjs +8 -20
  95. package/dist/components/icons-and-geometry/Tag.mjs.map +1 -1
  96. package/dist/components/layout/Carousel.d.mts +33 -0
  97. package/dist/components/layout/Carousel.d.ts +33 -0
  98. package/dist/components/layout/Carousel.js +684 -0
  99. package/dist/components/layout/Carousel.js.map +1 -0
  100. package/dist/components/layout/Carousel.mjs +659 -0
  101. package/dist/components/layout/Carousel.mjs.map +1 -0
  102. package/dist/components/{layout-and-navigation → layout}/Chip.d.mts +8 -5
  103. package/dist/components/{layout-and-navigation → layout}/Chip.d.ts +8 -5
  104. package/dist/components/{layout-and-navigation → layout}/Chip.js +18 -5
  105. package/dist/components/layout/Chip.js.map +1 -0
  106. package/dist/components/{layout-and-navigation → layout}/Chip.mjs +18 -5
  107. package/dist/components/layout/Chip.mjs.map +1 -0
  108. package/dist/components/{layout-and-navigation → layout}/DividerInserter.js +1 -1
  109. package/dist/components/layout/DividerInserter.js.map +1 -0
  110. package/dist/components/{layout-and-navigation → layout}/DividerInserter.mjs +1 -1
  111. package/dist/components/layout/DividerInserter.mjs.map +1 -0
  112. package/dist/components/{layout-and-navigation → layout}/Expandable.d.mts +13 -10
  113. package/dist/components/{layout-and-navigation → layout}/Expandable.d.ts +13 -10
  114. package/dist/components/{layout-and-navigation → layout}/Expandable.js +20 -7
  115. package/dist/components/layout/Expandable.js.map +1 -0
  116. package/dist/components/{layout-and-navigation → layout}/Expandable.mjs +21 -8
  117. package/dist/components/layout/Expandable.mjs.map +1 -0
  118. package/dist/components/{layout-and-navigation → layout}/FAQSection.js +26 -13
  119. package/dist/components/layout/FAQSection.js.map +1 -0
  120. package/dist/components/{layout-and-navigation → layout}/FAQSection.mjs +27 -14
  121. package/dist/components/layout/FAQSection.mjs.map +1 -0
  122. package/dist/components/layout/FloatingContainer.d.mts +38 -0
  123. package/dist/components/layout/FloatingContainer.d.ts +38 -0
  124. package/dist/components/layout/FloatingContainer.js +219 -0
  125. package/dist/components/layout/FloatingContainer.js.map +1 -0
  126. package/dist/components/layout/FloatingContainer.mjs +195 -0
  127. package/dist/components/layout/FloatingContainer.mjs.map +1 -0
  128. package/dist/components/layout/ListBox.d.mts +44 -0
  129. package/dist/components/layout/ListBox.d.ts +44 -0
  130. package/dist/components/layout/ListBox.js +329 -0
  131. package/dist/components/layout/ListBox.js.map +1 -0
  132. package/dist/components/layout/ListBox.mjs +290 -0
  133. package/dist/components/layout/ListBox.mjs.map +1 -0
  134. package/dist/components/{layout-and-navigation → layout}/MarkdownInterpreter.js +1 -1
  135. package/dist/components/layout/MarkdownInterpreter.js.map +1 -0
  136. package/dist/components/{layout-and-navigation → layout}/MarkdownInterpreter.mjs +1 -1
  137. package/dist/components/layout/MarkdownInterpreter.mjs.map +1 -0
  138. package/dist/components/layout/ScrollArea.d.mts +15 -0
  139. package/dist/components/layout/ScrollArea.d.ts +15 -0
  140. package/dist/components/layout/ScrollArea.js +1252 -0
  141. package/dist/components/layout/ScrollArea.js.map +1 -0
  142. package/dist/components/layout/ScrollArea.mjs +1216 -0
  143. package/dist/components/layout/ScrollArea.mjs.map +1 -0
  144. package/dist/components/{layout-and-navigation → layout}/TextImage.js +6 -4
  145. package/dist/components/layout/TextImage.js.map +1 -0
  146. package/dist/components/{layout-and-navigation → layout}/TextImage.mjs +5 -3
  147. package/dist/components/layout/TextImage.mjs.map +1 -0
  148. package/dist/components/{layout-and-navigation → layout}/VerticalDivider.js +1 -1
  149. package/dist/components/layout/VerticalDivider.js.map +1 -0
  150. package/dist/components/{layout-and-navigation → layout}/VerticalDivider.mjs +1 -1
  151. package/dist/components/layout/VerticalDivider.mjs.map +1 -0
  152. package/dist/components/loading-states/ErrorComponent.js.map +1 -1
  153. package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
  154. package/dist/components/loading-states/LoadingAndErrorComponent.d.mts +1 -1
  155. package/dist/components/loading-states/LoadingAndErrorComponent.d.ts +1 -1
  156. package/dist/components/loading-states/LoadingAnimation.js +18 -17
  157. package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
  158. package/dist/components/loading-states/LoadingAnimation.mjs +18 -17
  159. package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
  160. package/dist/components/loading-states/LoadingButton.js +55 -18
  161. package/dist/components/loading-states/LoadingButton.js.map +1 -1
  162. package/dist/components/loading-states/LoadingButton.mjs +55 -18
  163. package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
  164. package/dist/components/{layout-and-navigation → navigation}/BreadCrumb.js +668 -23
  165. package/dist/components/navigation/BreadCrumb.js.map +1 -0
  166. package/dist/components/{layout-and-navigation → navigation}/BreadCrumb.mjs +668 -23
  167. package/dist/components/navigation/BreadCrumb.mjs.map +1 -0
  168. package/dist/components/navigation/Navigation.d.mts +21 -0
  169. package/dist/components/navigation/Navigation.d.ts +21 -0
  170. package/dist/components/navigation/Navigation.js +4018 -0
  171. package/dist/components/navigation/Navigation.js.map +1 -0
  172. package/dist/components/navigation/Navigation.mjs +4012 -0
  173. package/dist/components/navigation/Navigation.mjs.map +1 -0
  174. package/dist/components/{layout-and-navigation → navigation}/Pagination.js +107 -192
  175. package/dist/components/navigation/Pagination.js.map +1 -0
  176. package/dist/components/{layout-and-navigation → navigation}/Pagination.mjs +102 -187
  177. package/dist/components/navigation/Pagination.mjs.map +1 -0
  178. package/dist/components/{layout-and-navigation → navigation}/StepperBar.js +44 -4
  179. package/dist/components/navigation/StepperBar.js.map +1 -0
  180. package/dist/components/{layout-and-navigation → navigation}/StepperBar.mjs +44 -4
  181. package/dist/components/navigation/StepperBar.mjs.map +1 -0
  182. package/dist/components/properties/CheckboxProperty.js +890 -135
  183. package/dist/components/properties/CheckboxProperty.js.map +1 -1
  184. package/dist/components/properties/CheckboxProperty.mjs +897 -142
  185. package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
  186. package/dist/components/properties/DateProperty.js +153 -198
  187. package/dist/components/properties/DateProperty.js.map +1 -1
  188. package/dist/components/properties/DateProperty.mjs +146 -191
  189. package/dist/components/properties/DateProperty.mjs.map +1 -1
  190. package/dist/components/properties/MultiSelectProperty.d.mts +5 -10
  191. package/dist/components/properties/MultiSelectProperty.d.ts +5 -10
  192. package/dist/components/properties/MultiSelectProperty.js +1156 -1160
  193. package/dist/components/properties/MultiSelectProperty.js.map +1 -1
  194. package/dist/components/properties/MultiSelectProperty.mjs +1169 -1163
  195. package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
  196. package/dist/components/properties/NumberProperty.js +155 -201
  197. package/dist/components/properties/NumberProperty.js.map +1 -1
  198. package/dist/components/properties/NumberProperty.mjs +148 -194
  199. package/dist/components/properties/NumberProperty.mjs.map +1 -1
  200. package/dist/components/properties/PropertyBase.js +49 -9
  201. package/dist/components/properties/PropertyBase.js.map +1 -1
  202. package/dist/components/properties/PropertyBase.mjs +49 -9
  203. package/dist/components/properties/PropertyBase.mjs.map +1 -1
  204. package/dist/components/properties/SelectProperty.d.mts +5 -8
  205. package/dist/components/properties/SelectProperty.d.ts +5 -8
  206. package/dist/components/properties/SelectProperty.js +1062 -836
  207. package/dist/components/properties/SelectProperty.js.map +1 -1
  208. package/dist/components/properties/SelectProperty.mjs +1077 -841
  209. package/dist/components/properties/SelectProperty.mjs.map +1 -1
  210. package/dist/components/properties/TextProperty.js +97 -100
  211. package/dist/components/properties/TextProperty.js.map +1 -1
  212. package/dist/components/properties/TextProperty.mjs +100 -103
  213. package/dist/components/properties/TextProperty.mjs.map +1 -1
  214. package/dist/components/table/Table.js +1619 -994
  215. package/dist/components/table/Table.js.map +1 -1
  216. package/dist/components/table/Table.mjs +1626 -1001
  217. package/dist/components/table/Table.mjs.map +1 -1
  218. package/dist/components/table/TableFilterButton.js +116 -201
  219. package/dist/components/table/TableFilterButton.js.map +1 -1
  220. package/dist/components/table/TableFilterButton.mjs +105 -190
  221. package/dist/components/table/TableFilterButton.mjs.map +1 -1
  222. package/dist/components/table/TableSortButton.js +4 -3
  223. package/dist/components/table/TableSortButton.js.map +1 -1
  224. package/dist/components/table/TableSortButton.mjs +4 -3
  225. package/dist/components/table/TableSortButton.mjs.map +1 -1
  226. package/dist/components/user-action/Button.d.mts +15 -11
  227. package/dist/components/user-action/Button.d.ts +15 -11
  228. package/dist/components/user-action/Button.js +10 -9
  229. package/dist/components/user-action/Button.js.map +1 -1
  230. package/dist/components/user-action/Button.mjs +10 -9
  231. package/dist/components/user-action/Button.mjs.map +1 -1
  232. package/dist/components/user-action/Checkbox.d.mts +9 -25
  233. package/dist/components/user-action/Checkbox.d.ts +9 -25
  234. package/dist/components/user-action/Checkbox.js +793 -103
  235. package/dist/components/user-action/Checkbox.js.map +1 -1
  236. package/dist/components/user-action/Checkbox.mjs +794 -104
  237. package/dist/components/user-action/Checkbox.mjs.map +1 -1
  238. package/dist/components/user-action/CopyToClipboardWrapper.js +3 -1
  239. package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
  240. package/dist/components/user-action/CopyToClipboardWrapper.mjs +3 -1
  241. package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
  242. package/dist/components/user-action/DateAndTimePicker.d.mts +1 -1
  243. package/dist/components/user-action/DateAndTimePicker.d.ts +1 -1
  244. package/dist/components/user-action/DateAndTimePicker.js +67 -14
  245. package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
  246. package/dist/components/user-action/DateAndTimePicker.mjs +68 -15
  247. package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
  248. package/dist/components/user-action/Label.d.mts +6 -8
  249. package/dist/components/user-action/Label.d.ts +6 -8
  250. package/dist/components/user-action/Label.js +4 -6
  251. package/dist/components/user-action/Label.js.map +1 -1
  252. package/dist/components/user-action/Label.mjs +4 -6
  253. package/dist/components/user-action/Label.mjs.map +1 -1
  254. package/dist/components/user-action/Menu.d.mts +2 -2
  255. package/dist/components/user-action/Menu.d.ts +2 -2
  256. package/dist/components/user-action/Menu.js +1 -1
  257. package/dist/components/user-action/Menu.js.map +1 -1
  258. package/dist/components/user-action/Menu.mjs +1 -1
  259. package/dist/components/user-action/Menu.mjs.map +1 -1
  260. package/dist/components/user-action/ScrollPicker.js +8 -6
  261. package/dist/components/user-action/ScrollPicker.js.map +1 -1
  262. package/dist/components/user-action/ScrollPicker.mjs +8 -6
  263. package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
  264. package/dist/components/user-action/SearchBar.d.mts +1 -2
  265. package/dist/components/user-action/SearchBar.d.ts +1 -2
  266. package/dist/components/user-action/SearchBar.js +93 -178
  267. package/dist/components/user-action/SearchBar.js.map +1 -1
  268. package/dist/components/user-action/SearchBar.mjs +86 -171
  269. package/dist/components/user-action/SearchBar.mjs.map +1 -1
  270. package/dist/components/user-action/Textarea.d.mts +22 -11
  271. package/dist/components/user-action/Textarea.d.ts +22 -11
  272. package/dist/components/user-action/Textarea.js +101 -92
  273. package/dist/components/user-action/Textarea.js.map +1 -1
  274. package/dist/components/user-action/Textarea.mjs +100 -92
  275. package/dist/components/user-action/Textarea.mjs.map +1 -1
  276. package/dist/components/user-action/input/Input.d.mts +37 -0
  277. package/dist/components/user-action/input/Input.d.ts +37 -0
  278. package/dist/components/user-action/input/Input.js +244 -0
  279. package/dist/components/user-action/input/Input.js.map +1 -0
  280. package/dist/components/user-action/input/Input.mjs +209 -0
  281. package/dist/components/user-action/input/Input.mjs.map +1 -0
  282. package/dist/components/user-action/input/InsideLabelInput.d.mts +20 -0
  283. package/dist/components/user-action/input/InsideLabelInput.d.ts +20 -0
  284. package/dist/components/user-action/input/InsideLabelInput.js +295 -0
  285. package/dist/components/user-action/input/InsideLabelInput.js.map +1 -0
  286. package/dist/components/user-action/input/InsideLabelInput.mjs +260 -0
  287. package/dist/components/user-action/input/InsideLabelInput.mjs.map +1 -0
  288. package/dist/components/user-action/input/ToggleableInput.d.mts +22 -0
  289. package/dist/components/user-action/input/ToggleableInput.d.ts +22 -0
  290. package/dist/components/user-action/{Input.js → input/ToggleableInput.js} +136 -171
  291. package/dist/components/user-action/input/ToggleableInput.js.map +1 -0
  292. package/dist/components/user-action/input/ToggleableInput.mjs +264 -0
  293. package/dist/components/user-action/input/ToggleableInput.mjs.map +1 -0
  294. package/dist/components/user-action/select/Select.d.mts +102 -0
  295. package/dist/components/user-action/select/Select.d.ts +102 -0
  296. package/dist/components/user-action/select/Select.js +1367 -0
  297. package/dist/components/user-action/select/Select.js.map +1 -0
  298. package/dist/components/user-action/select/Select.mjs +1333 -0
  299. package/dist/components/user-action/select/Select.mjs.map +1 -0
  300. package/dist/components/utils/FocusTrap.d.mts +28 -0
  301. package/dist/components/utils/FocusTrap.d.ts +28 -0
  302. package/dist/components/utils/FocusTrap.js +252 -0
  303. package/dist/components/utils/FocusTrap.js.map +1 -0
  304. package/dist/components/utils/FocusTrap.mjs +229 -0
  305. package/dist/components/utils/FocusTrap.mjs.map +1 -0
  306. package/dist/components/utils/Transition.d.mts +26 -0
  307. package/dist/components/utils/Transition.d.ts +26 -0
  308. package/dist/components/utils/Transition.js +74 -0
  309. package/dist/components/utils/Transition.js.map +1 -0
  310. package/dist/components/utils/Transition.mjs +50 -0
  311. package/dist/components/utils/Transition.mjs.map +1 -0
  312. package/dist/hooks/focus/useFocusGuards.d.mts +3 -0
  313. package/dist/hooks/focus/useFocusGuards.d.ts +3 -0
  314. package/dist/hooks/focus/useFocusGuards.js +74 -0
  315. package/dist/hooks/focus/useFocusGuards.js.map +1 -0
  316. package/dist/hooks/focus/useFocusGuards.mjs +50 -0
  317. package/dist/hooks/focus/useFocusGuards.mjs.map +1 -0
  318. package/dist/hooks/{useFocusManagement.js → focus/useFocusManagement.js} +1 -1
  319. package/dist/hooks/focus/useFocusManagement.js.map +1 -0
  320. package/dist/hooks/{useFocusManagement.mjs → focus/useFocusManagement.mjs} +1 -1
  321. package/dist/hooks/focus/useFocusManagement.mjs.map +1 -0
  322. package/dist/hooks/{useFocusOnceVisible.js → focus/useFocusOnceVisible.js} +1 -1
  323. package/dist/hooks/focus/useFocusOnceVisible.js.map +1 -0
  324. package/dist/hooks/{useFocusOnceVisible.mjs → focus/useFocusOnceVisible.mjs} +1 -1
  325. package/dist/hooks/focus/useFocusOnceVisible.mjs.map +1 -0
  326. package/dist/hooks/focus/useFocusTrap.d.mts +16 -0
  327. package/dist/hooks/focus/useFocusTrap.d.ts +16 -0
  328. package/dist/hooks/focus/useFocusTrap.js +233 -0
  329. package/dist/hooks/focus/useFocusTrap.js.map +1 -0
  330. package/dist/hooks/focus/useFocusTrap.mjs +210 -0
  331. package/dist/hooks/focus/useFocusTrap.mjs.map +1 -0
  332. package/dist/hooks/focus/useIsMounted.d.mts +3 -0
  333. package/dist/hooks/focus/useIsMounted.d.ts +3 -0
  334. package/dist/hooks/focus/useIsMounted.js +43 -0
  335. package/dist/hooks/focus/useIsMounted.js.map +1 -0
  336. package/dist/hooks/focus/useIsMounted.mjs +20 -0
  337. package/dist/hooks/focus/useIsMounted.mjs.map +1 -0
  338. package/dist/hooks/useFloatingElement.d.mts +22 -0
  339. package/dist/hooks/useFloatingElement.d.ts +22 -0
  340. package/dist/hooks/useFloatingElement.js +162 -0
  341. package/dist/hooks/useFloatingElement.js.map +1 -0
  342. package/dist/hooks/useFloatingElement.mjs +139 -0
  343. package/dist/hooks/useFloatingElement.mjs.map +1 -0
  344. package/dist/hooks/useLocalStorage.js +2 -2
  345. package/dist/hooks/useLocalStorage.js.map +1 -1
  346. package/dist/hooks/useLocalStorage.mjs +2 -2
  347. package/dist/hooks/useLocalStorage.mjs.map +1 -1
  348. package/dist/hooks/useLogOnce.d.mts +3 -4
  349. package/dist/hooks/useLogOnce.d.ts +3 -4
  350. package/dist/hooks/useLogOnce.js +5 -5
  351. package/dist/hooks/useLogOnce.js.map +1 -1
  352. package/dist/hooks/useLogOnce.mjs +5 -5
  353. package/dist/hooks/useLogOnce.mjs.map +1 -1
  354. package/dist/hooks/useRerender.d.mts +2 -2
  355. package/dist/hooks/useRerender.d.ts +2 -2
  356. package/dist/hooks/useSearch.d.mts +2 -2
  357. package/dist/hooks/useSearch.d.ts +2 -2
  358. package/dist/hooks/useSearch.js +1 -1
  359. package/dist/hooks/useSearch.js.map +1 -1
  360. package/dist/hooks/useSearch.mjs +1 -1
  361. package/dist/hooks/useSearch.mjs.map +1 -1
  362. package/dist/localization/LanguageProvider.d.mts +2 -2
  363. package/dist/localization/LanguageProvider.d.ts +2 -2
  364. package/dist/localization/LanguageProvider.js +2 -2
  365. package/dist/localization/LanguageProvider.js.map +1 -1
  366. package/dist/localization/LanguageProvider.mjs +2 -2
  367. package/dist/localization/LanguageProvider.mjs.map +1 -1
  368. package/dist/localization/defaults/form.d.mts +1 -0
  369. package/dist/localization/defaults/form.d.ts +1 -0
  370. package/dist/localization/defaults/form.js +2 -0
  371. package/dist/localization/defaults/form.js.map +1 -1
  372. package/dist/localization/defaults/form.mjs +2 -0
  373. package/dist/localization/defaults/form.mjs.map +1 -1
  374. package/dist/localization/useTranslation.js.map +1 -1
  375. package/dist/localization/useTranslation.mjs.map +1 -1
  376. package/dist/storybook/helper.d.mts +17 -0
  377. package/dist/storybook/helper.d.ts +17 -0
  378. package/dist/storybook/helper.js +61 -0
  379. package/dist/storybook/helper.js.map +1 -0
  380. package/dist/storybook/helper.mjs +37 -0
  381. package/dist/storybook/helper.mjs.map +1 -0
  382. package/dist/{css → style}/globals.css +836 -378
  383. package/dist/{css → style}/uncompiled/globals.css +80 -17
  384. package/dist/{css → style}/uncompiled/theme/colors-component.css +18 -4
  385. package/dist/{css → style}/uncompiled/theme/colors-semantic.css +2 -9
  386. package/dist/style/uncompiled/typography.css +171 -0
  387. package/dist/{css → style}/uncompiled/utitlity/animation.css +54 -42
  388. package/dist/{css → style}/uncompiled/utitlity/index.css +2 -1
  389. package/dist/{css → style}/uncompiled/utitlity/shadow.css +9 -1
  390. package/dist/style/uncompiled/utitlity/sizing.css +29 -0
  391. package/dist/theming/useTheme.d.mts +5 -3
  392. package/dist/theming/useTheme.d.ts +5 -3
  393. package/dist/theming/useTheme.js +42 -19
  394. package/dist/theming/useTheme.js.map +1 -1
  395. package/dist/theming/useTheme.mjs +40 -17
  396. package/dist/theming/useTheme.mjs.map +1 -1
  397. package/dist/{util → utils}/array.d.mts +1 -0
  398. package/dist/{util → utils}/array.d.ts +1 -0
  399. package/dist/{util → utils}/array.js +15 -2
  400. package/dist/utils/array.js.map +1 -0
  401. package/dist/{util → utils}/array.mjs +15 -2
  402. package/dist/utils/array.mjs.map +1 -0
  403. package/dist/utils/bagFunctions.d.mts +15 -0
  404. package/dist/utils/bagFunctions.d.ts +15 -0
  405. package/dist/{util/PropsWithFunctionChildren.js → utils/bagFunctions.js} +5 -5
  406. package/dist/utils/bagFunctions.js.map +1 -0
  407. package/dist/{util/PropsWithFunctionChildren.mjs → utils/bagFunctions.mjs} +2 -2
  408. package/dist/utils/bagFunctions.mjs.map +1 -0
  409. package/dist/{util → utils}/builder.js +1 -1
  410. package/dist/utils/builder.js.map +1 -0
  411. package/dist/{util → utils}/builder.mjs +1 -1
  412. package/dist/utils/builder.mjs.map +1 -0
  413. package/dist/{util → utils}/date.js +3 -3
  414. package/dist/utils/date.js.map +1 -0
  415. package/dist/{util → utils}/date.mjs +2 -2
  416. package/dist/utils/date.mjs.map +1 -0
  417. package/dist/{util → utils}/easeFunctions.js +5 -4
  418. package/dist/utils/easeFunctions.js.map +1 -0
  419. package/dist/{util → utils}/easeFunctions.mjs +4 -3
  420. package/dist/utils/easeFunctions.mjs.map +1 -0
  421. package/dist/{util → utils}/emailValidation.js +1 -1
  422. package/dist/utils/emailValidation.js.map +1 -0
  423. package/dist/{util → utils}/emailValidation.mjs +1 -1
  424. package/dist/utils/emailValidation.mjs.map +1 -0
  425. package/dist/{util → utils}/loopingArray.js +1 -1
  426. package/dist/utils/loopingArray.js.map +1 -0
  427. package/dist/{util → utils}/loopingArray.mjs +1 -1
  428. package/dist/utils/loopingArray.mjs.map +1 -0
  429. package/dist/utils/match.d.mts +3 -0
  430. package/dist/utils/match.d.ts +3 -0
  431. package/dist/utils/match.js +32 -0
  432. package/dist/utils/match.js.map +1 -0
  433. package/dist/utils/match.mjs +8 -0
  434. package/dist/utils/match.mjs.map +1 -0
  435. package/dist/utils/math.d.mts +3 -0
  436. package/dist/utils/math.d.ts +3 -0
  437. package/dist/{util → utils}/math.js +3 -2
  438. package/dist/utils/math.js.map +1 -0
  439. package/dist/utils/math.mjs +9 -0
  440. package/dist/utils/math.mjs.map +1 -0
  441. package/dist/{util → utils}/noop.js +1 -1
  442. package/dist/utils/noop.js.map +1 -0
  443. package/dist/utils/noop.mjs +6 -0
  444. package/dist/utils/noop.mjs.map +1 -0
  445. package/dist/{util → utils}/resolveSetState.js +1 -1
  446. package/dist/utils/resolveSetState.js.map +1 -0
  447. package/dist/{util → utils}/resolveSetState.mjs +1 -1
  448. package/dist/utils/resolveSetState.mjs.map +1 -0
  449. package/dist/{util → utils}/simpleSearch.js +1 -1
  450. package/dist/utils/simpleSearch.js.map +1 -0
  451. package/dist/{util → utils}/simpleSearch.mjs +1 -1
  452. package/dist/utils/simpleSearch.mjs.map +1 -0
  453. package/dist/{util → utils}/storage.js +1 -1
  454. package/dist/utils/storage.js.map +1 -0
  455. package/dist/{util → utils}/storage.mjs +1 -1
  456. package/dist/utils/storage.mjs.map +1 -0
  457. package/dist/{util → utils}/writeToClipboard.js +2 -1
  458. package/dist/utils/writeToClipboard.js.map +1 -0
  459. package/dist/{util → utils}/writeToClipboard.mjs +3 -1
  460. package/dist/utils/writeToClipboard.mjs.map +1 -0
  461. package/package.json +8 -8
  462. package/dist/components/dialogs/ConfirmDialog.js +0 -674
  463. package/dist/components/dialogs/ConfirmDialog.js.map +0 -1
  464. package/dist/components/dialogs/ConfirmDialog.mjs +0 -638
  465. package/dist/components/dialogs/ConfirmDialog.mjs.map +0 -1
  466. package/dist/components/icons-and-geometry/Helpwave.js.map +0 -1
  467. package/dist/components/icons-and-geometry/Helpwave.mjs.map +0 -1
  468. package/dist/components/layout-and-navigation/BreadCrumb.js.map +0 -1
  469. package/dist/components/layout-and-navigation/BreadCrumb.mjs.map +0 -1
  470. package/dist/components/layout-and-navigation/Carousel.d.mts +0 -25
  471. package/dist/components/layout-and-navigation/Carousel.d.ts +0 -25
  472. package/dist/components/layout-and-navigation/Carousel.js +0 -641
  473. package/dist/components/layout-and-navigation/Carousel.js.map +0 -1
  474. package/dist/components/layout-and-navigation/Carousel.mjs +0 -607
  475. package/dist/components/layout-and-navigation/Carousel.mjs.map +0 -1
  476. package/dist/components/layout-and-navigation/Chip.js.map +0 -1
  477. package/dist/components/layout-and-navigation/Chip.mjs.map +0 -1
  478. package/dist/components/layout-and-navigation/DividerInserter.js.map +0 -1
  479. package/dist/components/layout-and-navigation/DividerInserter.mjs.map +0 -1
  480. package/dist/components/layout-and-navigation/Expandable.js.map +0 -1
  481. package/dist/components/layout-and-navigation/Expandable.mjs.map +0 -1
  482. package/dist/components/layout-and-navigation/FAQSection.js.map +0 -1
  483. package/dist/components/layout-and-navigation/FAQSection.mjs.map +0 -1
  484. package/dist/components/layout-and-navigation/MarkdownInterpreter.js.map +0 -1
  485. package/dist/components/layout-and-navigation/MarkdownInterpreter.mjs.map +0 -1
  486. package/dist/components/layout-and-navigation/Overlay.d.mts +0 -67
  487. package/dist/components/layout-and-navigation/Overlay.d.ts +0 -67
  488. package/dist/components/layout-and-navigation/Overlay.js +0 -702
  489. package/dist/components/layout-and-navigation/Overlay.js.map +0 -1
  490. package/dist/components/layout-and-navigation/Overlay.mjs +0 -665
  491. package/dist/components/layout-and-navigation/Overlay.mjs.map +0 -1
  492. package/dist/components/layout-and-navigation/Pagination.js.map +0 -1
  493. package/dist/components/layout-and-navigation/Pagination.mjs.map +0 -1
  494. package/dist/components/layout-and-navigation/SearchableList.d.mts +0 -24
  495. package/dist/components/layout-and-navigation/SearchableList.d.ts +0 -24
  496. package/dist/components/layout-and-navigation/SearchableList.js +0 -758
  497. package/dist/components/layout-and-navigation/SearchableList.js.map +0 -1
  498. package/dist/components/layout-and-navigation/SearchableList.mjs +0 -724
  499. package/dist/components/layout-and-navigation/SearchableList.mjs.map +0 -1
  500. package/dist/components/layout-and-navigation/StepperBar.js.map +0 -1
  501. package/dist/components/layout-and-navigation/StepperBar.mjs.map +0 -1
  502. package/dist/components/layout-and-navigation/TextImage.js.map +0 -1
  503. package/dist/components/layout-and-navigation/TextImage.mjs.map +0 -1
  504. package/dist/components/layout-and-navigation/Tile.d.mts +0 -27
  505. package/dist/components/layout-and-navigation/Tile.d.ts +0 -27
  506. package/dist/components/layout-and-navigation/Tile.js +0 -96
  507. package/dist/components/layout-and-navigation/Tile.js.map +0 -1
  508. package/dist/components/layout-and-navigation/Tile.mjs +0 -61
  509. package/dist/components/layout-and-navigation/Tile.mjs.map +0 -1
  510. package/dist/components/layout-and-navigation/VerticalDivider.js.map +0 -1
  511. package/dist/components/layout-and-navigation/VerticalDivider.mjs.map +0 -1
  512. package/dist/components/modals/ConfirmModal.d.mts +0 -33
  513. package/dist/components/modals/ConfirmModal.d.ts +0 -33
  514. package/dist/components/modals/ConfirmModal.js +0 -687
  515. package/dist/components/modals/ConfirmModal.js.map +0 -1
  516. package/dist/components/modals/ConfirmModal.mjs +0 -651
  517. package/dist/components/modals/ConfirmModal.mjs.map +0 -1
  518. package/dist/components/modals/DiscardChangesModal.d.mts +0 -20
  519. package/dist/components/modals/DiscardChangesModal.d.ts +0 -20
  520. package/dist/components/modals/DiscardChangesModal.js +0 -717
  521. package/dist/components/modals/DiscardChangesModal.js.map +0 -1
  522. package/dist/components/modals/DiscardChangesModal.mjs +0 -681
  523. package/dist/components/modals/DiscardChangesModal.mjs.map +0 -1
  524. package/dist/components/modals/InputModal.d.mts +0 -21
  525. package/dist/components/modals/InputModal.d.ts +0 -21
  526. package/dist/components/modals/InputModal.js +0 -976
  527. package/dist/components/modals/InputModal.js.map +0 -1
  528. package/dist/components/modals/InputModal.mjs +0 -940
  529. package/dist/components/modals/InputModal.mjs.map +0 -1
  530. package/dist/components/modals/LanguageModal.d.mts +0 -21
  531. package/dist/components/modals/LanguageModal.d.ts +0 -21
  532. package/dist/components/modals/LanguageModal.js +0 -1468
  533. package/dist/components/modals/LanguageModal.js.map +0 -1
  534. package/dist/components/modals/LanguageModal.mjs +0 -1432
  535. package/dist/components/modals/LanguageModal.mjs.map +0 -1
  536. package/dist/components/modals/ThemeModal.d.mts +0 -21
  537. package/dist/components/modals/ThemeModal.d.ts +0 -21
  538. package/dist/components/modals/ThemeModal.js +0 -1497
  539. package/dist/components/modals/ThemeModal.js.map +0 -1
  540. package/dist/components/modals/ThemeModal.mjs +0 -1461
  541. package/dist/components/modals/ThemeModal.mjs.map +0 -1
  542. package/dist/components/user-action/Input.d.mts +0 -77
  543. package/dist/components/user-action/Input.d.ts +0 -77
  544. package/dist/components/user-action/Input.js.map +0 -1
  545. package/dist/components/user-action/Input.mjs +0 -298
  546. package/dist/components/user-action/Input.mjs.map +0 -1
  547. package/dist/components/user-action/MultiSelect.d.mts +0 -42
  548. package/dist/components/user-action/MultiSelect.d.ts +0 -42
  549. package/dist/components/user-action/MultiSelect.js +0 -1468
  550. package/dist/components/user-action/MultiSelect.js.map +0 -1
  551. package/dist/components/user-action/MultiSelect.mjs +0 -1433
  552. package/dist/components/user-action/MultiSelect.mjs.map +0 -1
  553. package/dist/components/user-action/Select.d.mts +0 -41
  554. package/dist/components/user-action/Select.d.ts +0 -41
  555. package/dist/components/user-action/Select.js +0 -1236
  556. package/dist/components/user-action/Select.js.map +0 -1
  557. package/dist/components/user-action/Select.mjs +0 -1201
  558. package/dist/components/user-action/Select.mjs.map +0 -1
  559. package/dist/components/user-action/ToggleableInput.d.mts +0 -37
  560. package/dist/components/user-action/ToggleableInput.d.ts +0 -37
  561. package/dist/components/user-action/ToggleableInput.js +0 -192
  562. package/dist/components/user-action/ToggleableInput.js.map +0 -1
  563. package/dist/components/user-action/ToggleableInput.mjs +0 -157
  564. package/dist/components/user-action/ToggleableInput.mjs.map +0 -1
  565. package/dist/css/uncompiled/textstyles.css +0 -69
  566. package/dist/hooks/useFocusManagement.js.map +0 -1
  567. package/dist/hooks/useFocusManagement.mjs.map +0 -1
  568. package/dist/hooks/useFocusOnceVisible.js.map +0 -1
  569. package/dist/hooks/useFocusOnceVisible.mjs.map +0 -1
  570. package/dist/index.d.mts +0 -103
  571. package/dist/index.d.ts +0 -103
  572. package/dist/index.js +0 -12610
  573. package/dist/index.js.map +0 -1
  574. package/dist/index.mjs +0 -12447
  575. package/dist/index.mjs.map +0 -1
  576. package/dist/util/PropsWithFunctionChildren.d.mts +0 -14
  577. package/dist/util/PropsWithFunctionChildren.d.ts +0 -14
  578. package/dist/util/PropsWithFunctionChildren.js.map +0 -1
  579. package/dist/util/PropsWithFunctionChildren.mjs.map +0 -1
  580. package/dist/util/array.js.map +0 -1
  581. package/dist/util/array.mjs.map +0 -1
  582. package/dist/util/builder.js.map +0 -1
  583. package/dist/util/builder.mjs.map +0 -1
  584. package/dist/util/date.js.map +0 -1
  585. package/dist/util/date.mjs.map +0 -1
  586. package/dist/util/easeFunctions.js.map +0 -1
  587. package/dist/util/easeFunctions.mjs.map +0 -1
  588. package/dist/util/emailValidation.js.map +0 -1
  589. package/dist/util/emailValidation.mjs.map +0 -1
  590. package/dist/util/loopingArray.js.map +0 -1
  591. package/dist/util/loopingArray.mjs.map +0 -1
  592. package/dist/util/math.d.mts +0 -3
  593. package/dist/util/math.d.ts +0 -3
  594. package/dist/util/math.js.map +0 -1
  595. package/dist/util/math.mjs +0 -8
  596. package/dist/util/math.mjs.map +0 -1
  597. package/dist/util/news.d.mts +0 -101
  598. package/dist/util/news.d.ts +0 -101
  599. package/dist/util/news.js +0 -76
  600. package/dist/util/news.js.map +0 -1
  601. package/dist/util/news.mjs +0 -49
  602. package/dist/util/news.mjs.map +0 -1
  603. package/dist/util/noop.js.map +0 -1
  604. package/dist/util/noop.mjs +0 -6
  605. package/dist/util/noop.mjs.map +0 -1
  606. package/dist/util/resolveSetState.js.map +0 -1
  607. package/dist/util/resolveSetState.mjs.map +0 -1
  608. package/dist/util/simpleSearch.js.map +0 -1
  609. package/dist/util/simpleSearch.mjs.map +0 -1
  610. package/dist/util/storage.js.map +0 -1
  611. package/dist/util/storage.mjs.map +0 -1
  612. package/dist/util/types.d.mts +0 -3
  613. package/dist/util/types.d.ts +0 -3
  614. package/dist/util/types.js +0 -18
  615. package/dist/util/types.js.map +0 -1
  616. package/dist/util/types.mjs +0 -1
  617. package/dist/util/types.mjs.map +0 -1
  618. package/dist/util/writeToClipboard.js.map +0 -1
  619. package/dist/util/writeToClipboard.mjs.map +0 -1
  620. /package/dist/components/{layout-and-navigation → layout}/DividerInserter.d.mts +0 -0
  621. /package/dist/components/{layout-and-navigation → layout}/DividerInserter.d.ts +0 -0
  622. /package/dist/components/{layout-and-navigation → layout}/FAQSection.d.mts +0 -0
  623. /package/dist/components/{layout-and-navigation → layout}/FAQSection.d.ts +0 -0
  624. /package/dist/components/{layout-and-navigation → layout}/MarkdownInterpreter.d.mts +0 -0
  625. /package/dist/components/{layout-and-navigation → layout}/MarkdownInterpreter.d.ts +0 -0
  626. /package/dist/components/{layout-and-navigation → layout}/TextImage.d.mts +0 -0
  627. /package/dist/components/{layout-and-navigation → layout}/TextImage.d.ts +0 -0
  628. /package/dist/components/{layout-and-navigation → layout}/VerticalDivider.d.mts +0 -0
  629. /package/dist/components/{layout-and-navigation → layout}/VerticalDivider.d.ts +0 -0
  630. /package/dist/components/{layout-and-navigation → navigation}/BreadCrumb.d.mts +0 -0
  631. /package/dist/components/{layout-and-navigation → navigation}/BreadCrumb.d.ts +0 -0
  632. /package/dist/components/{layout-and-navigation → navigation}/Pagination.d.mts +0 -0
  633. /package/dist/components/{layout-and-navigation → navigation}/Pagination.d.ts +0 -0
  634. /package/dist/components/{layout-and-navigation → navigation}/StepperBar.d.mts +0 -0
  635. /package/dist/components/{layout-and-navigation → navigation}/StepperBar.d.ts +0 -0
  636. /package/dist/hooks/{useFocusManagement.d.mts → focus/useFocusManagement.d.mts} +0 -0
  637. /package/dist/hooks/{useFocusManagement.d.ts → focus/useFocusManagement.d.ts} +0 -0
  638. /package/dist/hooks/{useFocusOnceVisible.d.mts → focus/useFocusOnceVisible.d.mts} +0 -0
  639. /package/dist/hooks/{useFocusOnceVisible.d.ts → focus/useFocusOnceVisible.d.ts} +0 -0
  640. /package/dist/{css → style}/uncompiled/theme/colors-basic.css +0 -0
  641. /package/dist/{css → style}/uncompiled/theme/index.css +0 -0
  642. /package/dist/{css → style}/uncompiled/theme/variants.css +0 -0
  643. /package/dist/{css → style}/uncompiled/utitlity/borderradius.css +0 -0
  644. /package/dist/{css → style}/uncompiled/utitlity/general.css +0 -0
  645. /package/dist/{util → utils}/builder.d.mts +0 -0
  646. /package/dist/{util → utils}/builder.d.ts +0 -0
  647. /package/dist/{util → utils}/date.d.mts +0 -0
  648. /package/dist/{util → utils}/date.d.ts +0 -0
  649. /package/dist/{util → utils}/easeFunctions.d.mts +0 -0
  650. /package/dist/{util → utils}/easeFunctions.d.ts +0 -0
  651. /package/dist/{util → utils}/emailValidation.d.mts +0 -0
  652. /package/dist/{util → utils}/emailValidation.d.ts +0 -0
  653. /package/dist/{util → utils}/loopingArray.d.mts +0 -0
  654. /package/dist/{util → utils}/loopingArray.d.ts +0 -0
  655. /package/dist/{util → utils}/noop.d.mts +0 -0
  656. /package/dist/{util → utils}/noop.d.ts +0 -0
  657. /package/dist/{util → utils}/resolveSetState.d.mts +0 -0
  658. /package/dist/{util → utils}/resolveSetState.d.ts +0 -0
  659. /package/dist/{util → utils}/simpleSearch.d.mts +0 -0
  660. /package/dist/{util → utils}/simpleSearch.d.ts +0 -0
  661. /package/dist/{util → utils}/storage.d.mts +0 -0
  662. /package/dist/{util → utils}/storage.d.ts +0 -0
  663. /package/dist/{util → utils}/writeToClipboard.d.mts +0 -0
  664. /package/dist/{util → utils}/writeToClipboard.d.ts +0 -0
@@ -1,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
- // src/components/layout-and-navigation/Expandable.tsx
557
- import { forwardRef as forwardRef2, useCallback as useCallback2, useEffect as useEffect2, useState as useState3 } from "react";
493
+ // src/components/layout/Expandable.tsx
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
- // src/components/layout-and-navigation/Expandable.tsx
565
- import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
501
+ // src/components/layout/Expandable.tsx
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,1004 @@ 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/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 }
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
+ },
872
+ {
873
+ "rounded-md": variant === "normal",
874
+ "rounded-full": variant === "fullyRounded"
875
+ },
876
+ className
877
+ ),
878
+ children: [
879
+ children,
880
+ trailingIcon && /* @__PURE__ */ jsx5("span", { className: colorMappingIcon, children: trailingIcon })
881
+ ]
882
+ }
828
883
  );
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);
884
+ };
885
+
886
+ // src/hooks/useFloatingElement.ts
887
+ import { useCallback as useCallback4, useEffect as useEffect5, useState as useState6 } from "react";
888
+
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);
893
+ };
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
936
+ };
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");
965
+ }
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
+ }
844
977
  };
845
- }, [isOpen, setIsOpen]);
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;
846
982
  useEffect5(() => {
847
- if (isOpen) {
848
- setIsHidden(false);
983
+ if (active && isMounted) {
984
+ calculate();
985
+ } else {
986
+ setStyle(void 0);
849
987
  }
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
- }
871
- },
872
- style: {
873
- ...menuPosition
874
- },
875
- children: BagFunctionUtil.resolve(children, bag)
988
+ }, [calculate, active, isMounted, height, width]);
989
+ useEffect5(() => {
990
+ window.addEventListener("resize", calculate);
991
+ let timeout;
992
+ if (isPolling) {
993
+ timeout = setInterval(calculate, pollingInterval);
994
+ }
995
+ return () => {
996
+ window.removeEventListener("resize", calculate);
997
+ if (timeout) {
998
+ clearInterval(timeout);
876
999
  }
877
- ), document.body)
878
- ] });
879
- };
880
-
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";
1000
+ };
1001
+ }, [calculate, isPolling, pollingInterval]);
1002
+ return style;
1003
+ }
884
1004
 
885
- // src/hooks/useDelay.ts
886
- import { useEffect as useEffect6, useState as useState6 } from "react";
887
- var defaultOptions = {
888
- delay: 3e3,
889
- disabled: false
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"
890
1010
  };
891
- function useDelay(options) {
892
- const [timer, setTimer] = useState6(void 0);
893
- const { delay, disabled } = {
894
- ...defaultOptions,
895
- ...options
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
+ iconAppearance = "left"
1031
+ }) => {
1032
+ const optionsRef = useRef2([]);
1033
+ const triggerRef = useRef2(null);
1034
+ const generatedId = useId3();
1035
+ const usedId = id ?? generatedId;
1036
+ const [internalState, setInternalState] = useState7({
1037
+ isOpen
1038
+ });
1039
+ const state = {
1040
+ ...internalState,
1041
+ id: usedId,
1042
+ disabled,
1043
+ invalid,
1044
+ value: isMultiSelect ? values ?? [] : [value].filter(Boolean)
896
1045
  };
897
- const clearTimer = () => {
898
- clearTimeout(timer);
899
- setTimer(void 0);
1046
+ const config = {
1047
+ isMultiSelect,
1048
+ iconAppearance
900
1049
  };
901
- const restartTimer = (onDelayFinish) => {
1050
+ const registerItem = useCallback5((item) => {
1051
+ optionsRef.current.push(item);
1052
+ optionsRef.current.sort((a, b) => {
1053
+ const aEl = a.ref.current;
1054
+ const bEl = b.ref.current;
1055
+ if (!aEl || !bEl) return 0;
1056
+ return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
1057
+ });
1058
+ }, []);
1059
+ const unregisterItem = useCallback5((value2) => {
1060
+ optionsRef.current = optionsRef.current.filter((i) => i.value !== value2);
1061
+ }, []);
1062
+ const toggleSelection = (value2, isSelected) => {
902
1063
  if (disabled) {
903
1064
  return;
904
1065
  }
905
- clearTimeout(timer);
906
- setTimer(setTimeout(() => {
907
- onDelayFinish();
908
- setTimer(void 0);
909
- }, delay));
1066
+ const option = optionsRef.current.find((i) => i.value === value2);
1067
+ if (!option) {
1068
+ console.error(`SelectOption with value: ${value2} not found`);
1069
+ return;
1070
+ }
1071
+ let newValue;
1072
+ if (isMultiSelect) {
1073
+ const isSelectedBefore = state.value.includes(value2);
1074
+ const isSelectedAfter = isSelected ?? !isSelectedBefore;
1075
+ if (!isSelectedAfter) {
1076
+ newValue = state.value.filter((v) => v !== value2);
1077
+ } else {
1078
+ newValue = [...state.value, value2];
1079
+ }
1080
+ } else {
1081
+ newValue = [value2];
1082
+ }
1083
+ if (!isMultiSelect) {
1084
+ onValueChanged?.(newValue[0]);
1085
+ } else {
1086
+ onValuesChanged?.(newValue);
1087
+ }
1088
+ setInternalState((prevState) => ({
1089
+ ...prevState,
1090
+ highlightedValue: value2
1091
+ }));
910
1092
  };
911
- useEffect6(() => {
912
- return () => {
913
- clearTimeout(timer);
914
- };
915
- }, [timer]);
916
- useEffect6(() => {
1093
+ const highlightItem = (value2) => {
917
1094
  if (disabled) {
918
- clearTimeout(timer);
919
- setTimer(void 0);
1095
+ return;
920
1096
  }
921
- }, [disabled, timer]);
922
- return { restartTimer, clearTimer, hasActiveTimer: !!timer };
923
- }
924
-
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
- );
1097
+ setInternalState((prevState) => ({
1098
+ ...prevState,
1099
+ highlightedValue: value2
1100
+ }));
1101
+ };
1102
+ const registerTrigger = useCallback5((ref) => {
1103
+ triggerRef.current = ref.current;
1104
+ }, []);
1105
+ const unregisterTrigger = useCallback5(() => {
1106
+ triggerRef.current = null;
936
1107
  }, []);
937
- const getNextFocusElement = useCallback3(() => {
938
- const elements = getFocusableElements();
939
- if (elements.length === 0) {
940
- return void 0;
1108
+ const toggleOpen = (isOpen2, options) => {
1109
+ const { highlightStartPosition } = { ...defaultToggleOpenOptions, ...options };
1110
+ let highlightedIndex;
1111
+ if (highlightStartPosition === "first") {
1112
+ highlightedIndex = optionsRef.current.findIndex((option) => !option.disabled);
1113
+ } else {
1114
+ highlightedIndex = optionsRef.current.length - 1 - [...optionsRef.current].reverse().findIndex((option) => !option.disabled);
941
1115
  }
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];
1116
+ if (highlightedIndex === -1 || highlightedIndex === optionsRef.current.length) {
1117
+ highlightedIndex = 0;
946
1118
  }
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;
1119
+ setInternalState((prevState) => ({
1120
+ ...prevState,
1121
+ isOpen: isOpen2 ?? !prevState.isOpen,
1122
+ highlightedValue: optionsRef.current[highlightedIndex].value
1123
+ }));
1124
+ };
1125
+ const moveHighlightedIndex = (delta) => {
1126
+ let highlightedIndex = optionsRef.current.findIndex((value2) => value2.value === internalState.highlightedValue);
1127
+ if (highlightedIndex === -1) {
1128
+ highlightedIndex = 0;
957
1129
  }
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];
963
- } else {
964
- previousElement = elements[currentIndex - 1];
1130
+ const optionLength = optionsRef.current.length;
1131
+ const startIndex = (highlightedIndex + delta % optionLength + optionLength) % optionLength;
1132
+ const isForward = delta >= 0;
1133
+ let highlightedValue = optionsRef.current[startIndex].value;
1134
+ for (let i = 0; i < optionsRef.current.length; i++) {
1135
+ const index = (startIndex + (isForward ? i : -i) + optionLength) % optionLength;
1136
+ if (!optionsRef.current[index].disabled) {
1137
+ highlightedValue = optionsRef.current[index].value;
1138
+ break;
965
1139
  }
966
1140
  }
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
1141
+ setInternalState((prevState) => ({
1142
+ ...prevState,
1143
+ highlightedValue
1144
+ }));
979
1145
  };
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) {
988
- return;
1146
+ useEffect6(() => {
1147
+ if (!internalState.highlightedValue) return;
1148
+ const highlighted = optionsRef.current.find((value2) => value2.value === internalState.highlightedValue);
1149
+ if (highlighted) {
1150
+ highlighted.ref.current.scrollIntoView({ behavior: "instant", block: "nearest" });
1151
+ } else {
1152
+ console.error(`SelectRoot: Could not find highlighted value (${internalState.highlightedValue})`);
989
1153
  }
990
- const observer = new IntersectionObserver(([entry]) => {
991
- if (entry.isIntersecting && !hasUsedFocus) {
992
- ref.current?.focus();
993
- setHasUsedFocus(hasUsedFocus);
994
- }
995
- }, {
996
- threshold: 0.1
997
- });
998
- if (ref.current) {
999
- observer.observe(ref.current);
1154
+ }, [internalState.highlightedValue]);
1155
+ const contextValue = {
1156
+ state,
1157
+ config,
1158
+ item: {
1159
+ register: registerItem,
1160
+ unregister: unregisterItem,
1161
+ toggleSelection,
1162
+ highlightItem,
1163
+ moveHighlightedIndex
1164
+ },
1165
+ trigger: {
1166
+ ref: triggerRef,
1167
+ register: registerTrigger,
1168
+ unregister: unregisterTrigger,
1169
+ toggleOpen
1000
1170
  }
1001
- return () => observer.disconnect();
1002
- }, [disable, hasUsedFocus, ref]);
1171
+ };
1172
+ return /* @__PURE__ */ jsx6(SelectContext.Provider, { value: contextValue, children });
1003
1173
  };
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",
1174
+ var SelectOption = forwardRef3(
1175
+ function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
1176
+ const { state, config, item, trigger } = useSelectContext();
1177
+ const { register, unregister, toggleSelection, highlightItem } = item;
1178
+ const itemRef = useRef2(null);
1179
+ iconAppearance ??= config.iconAppearance;
1180
+ useEffect6(() => {
1181
+ register({
1182
+ value,
1183
+ disabled,
1184
+ ref: itemRef
1185
+ });
1186
+ return () => unregister(value);
1187
+ }, [value, disabled, register, unregister, children]);
1188
+ const isHighlighted = state.highlightedValue === value;
1189
+ const isSelected = state.value.includes(value);
1190
+ return /* @__PURE__ */ jsxs5(
1191
+ "li",
1192
+ {
1193
+ ...restProps,
1194
+ ref: (node) => {
1195
+ itemRef.current = node;
1196
+ if (typeof ref === "function") ref(node);
1197
+ else if (ref) ref.current = node;
1198
+ },
1199
+ id: value,
1200
+ role: "option",
1201
+ "aria-disabled": disabled,
1202
+ "aria-selected": isSelected,
1203
+ "data-highlighted": isHighlighted ? "" : void 0,
1204
+ "data-selected": isSelected ? "" : void 0,
1205
+ "data-disabled": disabled ? "" : void 0,
1206
+ className: clsx5(
1207
+ "flex-row-1 items-center px-2 py-1 rounded-md",
1208
+ "data-highlighted:bg-primary/20",
1209
+ "data-disabled:text-disabled data-disabled:cursor-not-allowed",
1210
+ "not-data-disabled:cursor-pointer",
1211
+ className
1212
+ ),
1213
+ onClick: (event) => {
1214
+ if (!disabled) {
1215
+ toggleSelection(value);
1216
+ if (!config.isMultiSelect) {
1217
+ trigger.toggleOpen(false);
1218
+ }
1219
+ restProps.onClick?.(event);
1220
+ }
1221
+ },
1222
+ onMouseEnter: (event) => {
1223
+ if (!disabled) {
1224
+ highlightItem(value);
1225
+ restProps.onMouseEnter?.(event);
1226
+ }
1227
+ },
1228
+ children: [
1229
+ iconAppearance === "left" && /* @__PURE__ */ jsx6(
1230
+ CheckIcon,
1231
+ {
1232
+ className: clsx5("w-4 h-4", { "opacity-0": !isSelected || disabled }),
1233
+ "aria-hidden": true
1234
+ }
1235
+ ),
1236
+ children ?? value,
1237
+ iconAppearance === "right" && /* @__PURE__ */ jsx6(
1238
+ CheckIcon,
1239
+ {
1240
+ className: clsx5("w-4 h-4", { "opacity-0": !isSelected || disabled }),
1241
+ "aria-hidden": true
1242
+ }
1243
+ )
1244
+ ]
1245
+ }
1246
+ );
1247
+ }
1248
+ );
1249
+ var defaultSelectButtonTranslation = {
1250
+ en: {
1251
+ clickToSelect: "Click to select"
1252
+ },
1253
+ de: {
1254
+ clickToSelect: "Zum ausw\xE4hlen dr\xFCcken"
1255
+ }
1256
+ };
1257
+ var SelectButton = forwardRef3(function SelectButton2({ placeholder, selectedDisplay, ...props }, ref) {
1258
+ const translation = useTranslation([defaultSelectButtonTranslation]);
1259
+ const { state, trigger } = useSelectContext();
1260
+ const { register, unregister, toggleOpen } = trigger;
1261
+ const innerRef = useRef2(null);
1262
+ useImperativeHandle(ref, () => innerRef.current);
1263
+ useEffect6(() => {
1264
+ register(innerRef);
1265
+ return () => unregister();
1266
+ }, [register, unregister]);
1267
+ const disabled = !!props?.disabled || !!state.disabled;
1268
+ const invalid = state.invalid;
1269
+ const hasValue = state.value.length > 0;
1270
+ return /* @__PURE__ */ jsxs5(
1271
+ "button",
1010
1272
  {
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
1273
+ ...props,
1274
+ ref: innerRef,
1275
+ id: state.id,
1276
+ className: clsx5(
1277
+ "flex-row-2 items-center justify-between bg-input-background text-input-text rounded-md px-2.5 py-2.5",
1278
+ "data-placeholder:text-description",
1279
+ props.className
1280
+ ),
1281
+ onClick: () => toggleOpen(!state.isOpen),
1282
+ onKeyDown: (event) => {
1283
+ switch (event.key) {
1284
+ case "ArrowDown":
1285
+ toggleOpen(true, { highlightStartPosition: "first" });
1286
+ break;
1287
+ case "ArrowUp":
1288
+ toggleOpen(true, { highlightStartPosition: "last" });
1289
+ break;
1290
+ }
1291
+ },
1292
+ "data-placeholder": !hasValue ? "" : void 0,
1293
+ "data-disabled": disabled ? "" : void 0,
1294
+ "data-invalid": invalid ? "" : void 0,
1295
+ "aria-invalid": invalid,
1296
+ "aria-disabled": disabled,
1297
+ "aria-haspopup": "listbox",
1298
+ "aria-expanded": state.isOpen,
1299
+ "aria-controls": state.isOpen ? `${state.id}-listbox` : void 0,
1300
+ children: [
1301
+ hasValue ? selectedDisplay?.(state.value) ?? state.value.join(", ") : placeholder ?? translation("clickToSelect"),
1302
+ /* @__PURE__ */ jsx6(ExpansionIcon, { isExpanded: state.isOpen })
1303
+ ]
1014
1304
  }
1015
1305
  );
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 });
1306
+ });
1307
+ var SelectChipDisplay = forwardRef3(function SelectChipDisplay2({ ...props }, ref) {
1308
+ const { state, trigger, item } = useSelectContext();
1309
+ const { register, unregister, toggleOpen } = trigger;
1045
1310
  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();
1311
+ useImperativeHandle(ref, () => innerRef.current);
1312
+ useEffect6(() => {
1313
+ register(innerRef);
1314
+ return () => unregister();
1315
+ }, [register, unregister]);
1316
+ const disabled = !!props?.disabled || !!state.disabled;
1317
+ const invalid = state.invalid;
1318
+ return /* @__PURE__ */ jsxs5(
1319
+ "div",
1320
+ {
1321
+ ...props,
1322
+ ref: innerRef,
1323
+ className: clsx5(
1324
+ "flex flex-wrap flex-row gap-2 items-center bg-input-background text-input-text rounded-md px-2.5 py-2.5",
1325
+ props.className
1326
+ ),
1327
+ "data-disabled": disabled ? "" : void 0,
1328
+ "data-invalid": invalid ? "" : void 0,
1329
+ "aria-invalid": invalid,
1330
+ "aria-disabled": disabled,
1331
+ children: [
1332
+ state.value.map((value) => /* @__PURE__ */ jsxs5(Chip, { className: "gap-x-2", children: [
1333
+ value,
1334
+ /* @__PURE__ */ jsx6(
1335
+ "button",
1336
+ {
1337
+ onClick: () => {
1338
+ item.toggleSelection(value, false);
1339
+ },
1340
+ 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",
1341
+ children: /* @__PURE__ */ jsx6(XIcon, {})
1342
+ }
1343
+ )
1344
+ ] }, value)),
1345
+ /* @__PURE__ */ jsx6(
1346
+ IconButton,
1347
+ {
1348
+ id: state.id,
1349
+ onClick: () => toggleOpen(),
1350
+ onKeyDown: (event) => {
1351
+ switch (event.key) {
1352
+ case "ArrowDown":
1353
+ toggleOpen(true, { highlightStartPosition: "first" });
1354
+ break;
1355
+ case "ArrowUp":
1356
+ toggleOpen(true, { highlightStartPosition: "last" });
1357
+ }
1358
+ },
1359
+ size: "small",
1360
+ color: "neutral",
1361
+ "aria-invalid": invalid,
1362
+ "aria-disabled": disabled,
1363
+ "aria-haspopup": "listbox",
1364
+ "aria-expanded": state.isOpen,
1365
+ "aria-controls": state.isOpen ? `${state.id}-listbox` : void 0,
1366
+ children: /* @__PURE__ */ jsx6(Plus, {})
1367
+ }
1368
+ )
1369
+ ]
1054
1370
  }
1055
- };
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,
1063
- value,
1064
- id,
1065
- type,
1066
- 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();
1371
+ );
1372
+ });
1373
+ var SelectContent = forwardRef3(
1374
+ function SelectContent2({
1375
+ alignment,
1376
+ orientation = "vertical",
1377
+ ...props
1378
+ }, ref) {
1379
+ const innerRef = useRef2(null);
1380
+ useImperativeHandle(ref, () => innerRef.current);
1381
+ const { trigger, state, config, item } = useSelectContext();
1382
+ const position = useFloatingElement({
1383
+ active: state.isOpen,
1384
+ anchorRef: trigger.ref,
1385
+ containerRef: innerRef,
1386
+ ...alignment
1387
+ });
1388
+ useFocusTrap({
1389
+ container: innerRef,
1390
+ active: state.isOpen && !!position
1391
+ });
1392
+ return createPortal(
1393
+ /* @__PURE__ */ jsxs5(Fragment, { children: [
1394
+ /* @__PURE__ */ jsx6(
1395
+ "div",
1396
+ {
1397
+ hidden: !state.isOpen,
1398
+ onClick: () => trigger.toggleOpen(false),
1399
+ className: clsx5("fixed w-screen h-screen inset-0")
1074
1400
  }
1075
- },
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);
1401
+ ),
1402
+ /* @__PURE__ */ jsx6(
1403
+ "ul",
1404
+ {
1405
+ ...props,
1406
+ id: `${state.id}-listbox`,
1407
+ ref: innerRef,
1408
+ hidden: !state.isOpen,
1409
+ onKeyDown: (event) => {
1410
+ switch (event.key) {
1411
+ case "Escape":
1412
+ trigger.toggleOpen(false);
1413
+ event.preventDefault();
1414
+ event.stopPropagation();
1415
+ break;
1416
+ case match(orientation, {
1417
+ vertical: "ArrowDown",
1418
+ horizontal: "ArrowUp"
1419
+ }):
1420
+ item.moveHighlightedIndex(1);
1421
+ event.preventDefault();
1422
+ break;
1423
+ case match(orientation, {
1424
+ vertical: "ArrowUp",
1425
+ horizontal: "ArrowDown"
1426
+ }):
1427
+ item.moveHighlightedIndex(-1);
1428
+ event.preventDefault();
1429
+ break;
1430
+ case "Home":
1431
+ event.preventDefault();
1432
+ break;
1433
+ case "End":
1434
+ event.preventDefault();
1435
+ break;
1436
+ case "Enter":
1437
+ // Fall through
1438
+ case " ":
1439
+ if (state.highlightedValue) {
1440
+ item.toggleSelection(state.highlightedValue);
1441
+ if (!config.isMultiSelect) {
1442
+ trigger.toggleOpen(false);
1443
+ }
1444
+ event.preventDefault();
1445
+ }
1446
+ break;
1087
1447
  }
1088
- });
1448
+ },
1449
+ 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),
1450
+ style: {
1451
+ opacity: position ? void 0 : 0,
1452
+ position: "fixed",
1453
+ ...position
1454
+ },
1455
+ role: "listbox",
1456
+ "aria-multiselectable": config.isMultiSelect,
1457
+ "aria-orientation": orientation,
1458
+ tabIndex: position ? 0 : void 0,
1459
+ children: props.children
1089
1460
  }
1090
- onChange(e);
1091
- onChangeText(value2);
1461
+ )
1462
+ ] }),
1463
+ document.body
1464
+ );
1465
+ }
1466
+ );
1467
+ var Select = forwardRef3(function Select2({
1468
+ children,
1469
+ contentPanelProps,
1470
+ buttonProps,
1471
+ ...props
1472
+ }, ref) {
1473
+ return /* @__PURE__ */ jsxs5(SelectRoot, { ...props, isMultiSelect: false, children: [
1474
+ /* @__PURE__ */ jsx6(
1475
+ SelectButton,
1476
+ {
1477
+ ref,
1478
+ ...buttonProps,
1479
+ selectedDisplay: (values) => {
1480
+ const value = values[0];
1481
+ if (!buttonProps?.selectedDisplay) return void 0;
1482
+ return buttonProps.selectedDisplay(value);
1092
1483
  }
1093
1484
  }
1094
- )
1485
+ ),
1486
+ /* @__PURE__ */ jsx6(SelectContent, { ...contentPanelProps, children })
1095
1487
  ] });
1096
1488
  });
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
1489
+ var SelectUncontrolled = forwardRef3(function SelectUncontrolled2({
1490
+ value: initialValue,
1491
+ onValueChanged,
1492
+ ...props
1108
1493
  }, ref) {
1109
- const input = /* @__PURE__ */ jsx8(
1110
- "input",
1494
+ const [value, setValue] = useState7(initialValue);
1495
+ useEffect6(() => {
1496
+ setValue(initialValue);
1497
+ }, [initialValue]);
1498
+ return /* @__PURE__ */ jsx6(
1499
+ Select,
1111
1500
  {
1112
- ...restProps,
1501
+ ...props,
1113
1502
  ref,
1114
- id,
1115
- disabled,
1116
- className: clsx7(
1117
- getInputClassName({ disabled, hasError: !!errorText }),
1118
- className
1119
- )
1503
+ value,
1504
+ onValueChanged: (value2) => {
1505
+ setValue(value2);
1506
+ onValueChanged?.(value2);
1507
+ }
1120
1508
  }
1121
1509
  );
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 })
1510
+ });
1511
+ var MultiSelect = forwardRef3(function MultiSelect2({
1512
+ children,
1513
+ contentPanelProps,
1514
+ buttonProps,
1515
+ ...props
1516
+ }, ref) {
1517
+ return /* @__PURE__ */ jsxs5(SelectRoot, { ...props, isMultiSelect: true, children: [
1518
+ /* @__PURE__ */ jsx6(SelectButton, { ref, ...buttonProps }),
1519
+ /* @__PURE__ */ jsx6(SelectContent, { ...contentPanelProps, children })
1129
1520
  ] });
1130
1521
  });
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")
1522
+ var MultiSelectUncontrolled = forwardRef3(function MultiSelectUncontrolled2({
1523
+ values: initialValues,
1524
+ onValuesChanged,
1525
+ ...props
1526
+ }, ref) {
1527
+ const [values, setValues] = useState7(initialValues);
1528
+ useEffect6(() => {
1529
+ setValues(initialValues);
1530
+ }, [initialValues]);
1531
+ return /* @__PURE__ */ jsx6(
1532
+ MultiSelect,
1533
+ {
1534
+ ...props,
1535
+ ref,
1536
+ values,
1537
+ onValuesChanged: (value) => {
1538
+ setValues(value);
1539
+ onValuesChanged?.(value);
1150
1540
  }
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
1541
  }
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
- }
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
- )
1542
+ );
1543
+ });
1544
+ var MultiSelectChipDisplay = forwardRef3(function MultiSelectChipDisplay2({
1545
+ children,
1546
+ contentPanelProps,
1547
+ chipDisplayProps,
1548
+ ...props
1549
+ }, ref) {
1550
+ return /* @__PURE__ */ jsxs5(SelectRoot, { ...props, isMultiSelect: true, children: [
1551
+ /* @__PURE__ */ jsx6(SelectChipDisplay, { ref, ...chipDisplayProps }),
1552
+ /* @__PURE__ */ jsx6(SelectContent, { ...contentPanelProps, children })
1307
1553
  ] });
1308
- };
1554
+ });
1555
+ var MultiSelectChipDisplayUncontrolled = forwardRef3(function MultiSelectChipDisplayUncontrolled2({
1556
+ values: initialValues,
1557
+ onValuesChanged,
1558
+ ...props
1559
+ }, ref) {
1560
+ const [values, setValues] = useState7(initialValues);
1561
+ useEffect6(() => {
1562
+ setValues(initialValues);
1563
+ }, [initialValues]);
1564
+ return /* @__PURE__ */ jsx6(
1565
+ MultiSelectChipDisplay,
1566
+ {
1567
+ ...props,
1568
+ ref,
1569
+ values,
1570
+ onValuesChanged: (value) => {
1571
+ setValues(value);
1572
+ onValuesChanged?.(value);
1573
+ }
1574
+ }
1575
+ );
1576
+ });
1309
1577
 
1310
1578
  // src/components/properties/SelectProperty.tsx
1311
- import { jsx as jsx11 } from "react/jsx-runtime";
1579
+ import { jsx as jsx7 } from "react/jsx-runtime";
1312
1580
  var SingleSelectProperty = ({
1313
- overwriteTranslation,
1314
1581
  value,
1315
1582
  options,
1316
- name,
1317
- readOnly = false,
1318
- softRequired,
1319
- onRemove,
1320
- onAddNew,
1321
- ...selectProps
1583
+ onValueChanged,
1584
+ ...props
1322
1585
  }) => {
1323
- const translation = useTranslation([formTranslation], overwriteTranslation);
1324
1586
  const hasValue = value !== void 0;
1325
- return /* @__PURE__ */ jsx11(
1587
+ return /* @__PURE__ */ jsx7(
1326
1588
  PropertyBase,
1327
1589
  {
1328
- name,
1329
- onRemove,
1330
- readOnly,
1331
- softRequired,
1590
+ ...props,
1332
1591
  hasValue,
1333
- icon: /* @__PURE__ */ jsx11(List, { size: 24 }),
1334
- input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ jsx11(
1592
+ icon: /* @__PURE__ */ jsx7(List, { size: 24 }),
1593
+ input: ({ softRequired }) => /* @__PURE__ */ jsx7(
1335
1594
  Select,
1336
1595
  {
1337
- ...selectProps,
1338
1596
  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,
1597
+ onValueChanged,
1598
+ disabled: props.readOnly,
1599
+ buttonProps: {
1600
+ className: clsx6(
1601
+ "border-none w-full",
1353
1602
  {
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())
1603
+ "!bg-warning !text-surface-warning": softRequired && !hasValue
1361
1604
  }
1362
- );
1605
+ )
1363
1606
  },
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
1607
+ children: options.map((value2) => /* @__PURE__ */ jsx7(SelectOption, { value: value2 }, value2))
1372
1608
  }
1373
1609
  )
1374
1610
  }