@helpwave/hightide 0.1.24 → 0.1.26

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