@helpwave/hightide 0.1.25 → 0.1.27

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