@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
@@ -0,0 +1,1725 @@
1
+ // src/localization/LanguageProvider.tsx
2
+ import { createContext, useContext, useEffect, useState as useState2 } from "react";
3
+
4
+ // src/hooks/useLocalStorage.ts
5
+ import { useCallback, useState } from "react";
6
+
7
+ // src/localization/util.ts
8
+ var languages = ["en", "de"];
9
+ var languagesLocalNames = {
10
+ en: "English",
11
+ de: "Deutsch"
12
+ };
13
+ var DEFAULT_LANGUAGE = "en";
14
+ var LanguageUtil = {
15
+ languages,
16
+ DEFAULT_LANGUAGE,
17
+ languagesLocalNames
18
+ };
19
+
20
+ // src/localization/LanguageProvider.tsx
21
+ import { jsx } from "react/jsx-runtime";
22
+ var LanguageContext = createContext({
23
+ language: LanguageUtil.DEFAULT_LANGUAGE,
24
+ setLanguage: (v) => v
25
+ });
26
+ var useLanguage = () => useContext(LanguageContext);
27
+
28
+ // src/localization/useTranslation.ts
29
+ var TranslationPluralCount = {
30
+ zero: 0,
31
+ one: 1,
32
+ two: 2,
33
+ few: 3,
34
+ many: 11,
35
+ other: -1
36
+ };
37
+ var useTranslation = (translations, overwriteTranslation = {}) => {
38
+ const { language: languageProp, translation: overwrite } = overwriteTranslation;
39
+ const { language: inferredLanguage } = useLanguage();
40
+ const usedLanguage = languageProp ?? inferredLanguage;
41
+ const usedTranslations = [...translations];
42
+ if (overwrite) {
43
+ usedTranslations.push(overwrite);
44
+ }
45
+ return (key, options) => {
46
+ const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options };
47
+ try {
48
+ for (let i = translations.length - 1; i >= 0; i--) {
49
+ const translation = translations[i];
50
+ const localizedTranslation = translation[usedLanguage];
51
+ if (!localizedTranslation) {
52
+ continue;
53
+ }
54
+ const value = localizedTranslation[key];
55
+ if (!value) {
56
+ continue;
57
+ }
58
+ let forProcessing;
59
+ if (typeof value !== "string") {
60
+ if (count === TranslationPluralCount.zero && value?.zero) {
61
+ forProcessing = value.zero;
62
+ } else if (count === TranslationPluralCount.one && value?.one) {
63
+ forProcessing = value.one;
64
+ } else if (count === TranslationPluralCount.two && value?.two) {
65
+ forProcessing = value.two;
66
+ } else if (TranslationPluralCount.few <= count && count < TranslationPluralCount.many && value?.few) {
67
+ forProcessing = value.few;
68
+ } else if (count > TranslationPluralCount.many && value?.many) {
69
+ forProcessing = value.many;
70
+ } else {
71
+ forProcessing = value.other;
72
+ }
73
+ } else {
74
+ forProcessing = value;
75
+ }
76
+ forProcessing = forProcessing.replace(/\{\{(\w+)}}/g, (_, placeholder) => {
77
+ return replacements[placeholder] ?? `{{key:${placeholder}}}`;
78
+ });
79
+ return forProcessing;
80
+ }
81
+ } catch (e) {
82
+ console.error(e);
83
+ }
84
+ return `{{${usedLanguage}:${key}}}`;
85
+ };
86
+ };
87
+
88
+ // src/components/user-action/select/Select.tsx
89
+ import {
90
+ createContext as createContext2,
91
+ forwardRef as forwardRef3,
92
+ useCallback as useCallback5,
93
+ useContext as useContext2,
94
+ useEffect as useEffect6,
95
+ useId as useId3,
96
+ useImperativeHandle,
97
+ useRef as useRef2,
98
+ useState as useState7
99
+ } from "react";
100
+ import clsx4 from "clsx";
101
+
102
+ // src/components/layout/Expandable.tsx
103
+ import { forwardRef, useCallback as useCallback2, useEffect as useEffect2, useId, useState as useState3 } from "react";
104
+ import { ChevronDown } from "lucide-react";
105
+ import clsx from "clsx";
106
+
107
+ // src/utils/noop.ts
108
+ var noop = () => void 0;
109
+
110
+ // src/components/layout/Expandable.tsx
111
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
112
+ var ExpansionIcon = ({ isExpanded, className }) => {
113
+ return /* @__PURE__ */ jsx2(
114
+ ChevronDown,
115
+ {
116
+ "aria-hidden": true,
117
+ className: clsx(
118
+ "min-w-6 w-6 min-h-6 h-6 transition-transform motion-safe:duration-200 motion-reduce:duration-0 ease-in-out",
119
+ { "rotate-180": isExpanded },
120
+ className
121
+ )
122
+ }
123
+ );
124
+ };
125
+ var Expandable = forwardRef(function Expandable2({
126
+ children,
127
+ id: providedId,
128
+ label,
129
+ icon,
130
+ isExpanded = false,
131
+ onChange = noop,
132
+ clickOnlyOnHeader = true,
133
+ disabled = false,
134
+ className,
135
+ headerClassName,
136
+ contentClassName,
137
+ contentExpandedClassName
138
+ }, ref) {
139
+ const defaultIcon = useCallback2((expanded) => /* @__PURE__ */ jsx2(ExpansionIcon, { isExpanded: expanded }), []);
140
+ icon ??= defaultIcon;
141
+ const generatedId = useId();
142
+ const id = providedId ?? generatedId;
143
+ return /* @__PURE__ */ jsxs(
144
+ "div",
145
+ {
146
+ ref,
147
+ onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
148
+ className: clsx(
149
+ "flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm",
150
+ { "cursor-pointer": !clickOnlyOnHeader && !disabled },
151
+ className
152
+ ),
153
+ children: [
154
+ /* @__PURE__ */ jsxs(
155
+ "button",
156
+ {
157
+ onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
158
+ className: clsx(
159
+ "flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
160
+ {
161
+ "group-hover:brightness-97": !isExpanded,
162
+ "hover:brightness-97": isExpanded && !disabled,
163
+ "cursor-pointer": clickOnlyOnHeader && !disabled
164
+ },
165
+ headerClassName
166
+ ),
167
+ "aria-expanded": isExpanded,
168
+ "aria-controls": `${id}-content`,
169
+ "aria-disabled": disabled ?? void 0,
170
+ children: [
171
+ label,
172
+ icon(isExpanded)
173
+ ]
174
+ }
175
+ ),
176
+ /* @__PURE__ */ jsx2(
177
+ "div",
178
+ {
179
+ id: `${id}-content`,
180
+ className: clsx(
181
+ "flex-col-2 px-4 transition-all duration-300 ease-in-out",
182
+ {
183
+ [clsx("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
184
+ "max-h-0 opacity-0 overflow-hidden": !isExpanded
185
+ },
186
+ contentClassName
187
+ ),
188
+ role: "region",
189
+ children
190
+ }
191
+ )
192
+ ]
193
+ }
194
+ );
195
+ });
196
+ var ExpandableUncontrolled = forwardRef(function ExpandableUncontrolled2({
197
+ isExpanded,
198
+ onChange = noop,
199
+ ...props
200
+ }, ref) {
201
+ const [usedIsExpanded, setUsedIsExpanded] = useState3(isExpanded);
202
+ useEffect2(() => {
203
+ setUsedIsExpanded(isExpanded);
204
+ }, [isExpanded]);
205
+ return /* @__PURE__ */ jsx2(
206
+ Expandable,
207
+ {
208
+ ...props,
209
+ ref,
210
+ isExpanded: usedIsExpanded,
211
+ onChange: (value) => {
212
+ onChange(value);
213
+ setUsedIsExpanded(value);
214
+ }
215
+ }
216
+ );
217
+ });
218
+
219
+ // src/hooks/focus/useFocusTrap.ts
220
+ import { useCallback as useCallback3, useEffect as useEffect4, useId as useId2, useRef, useState as useState5 } from "react";
221
+
222
+ // src/hooks/focus/useIsMounted.ts
223
+ import { useEffect as useEffect3, useLayoutEffect, useState as useState4 } from "react";
224
+ var isClient = typeof window !== "undefined" && typeof document !== "undefined";
225
+ var useIsomorphicEffect = isClient ? useLayoutEffect : useEffect3;
226
+ var useIsMounted = () => {
227
+ const [isMounted, setIsMounted] = useState4(false);
228
+ useIsomorphicEffect(() => {
229
+ setIsMounted(true);
230
+ return () => {
231
+ setIsMounted(false);
232
+ };
233
+ }, []);
234
+ return isMounted;
235
+ };
236
+
237
+ // src/hooks/focus/useFocusTrap.ts
238
+ var createFocusGuard = () => {
239
+ const div = document.createElement("div");
240
+ Object.assign(div.style, {
241
+ opacity: "0",
242
+ outline: "none",
243
+ boxShadow: "none",
244
+ position: "fixed",
245
+ pointerEvents: "none",
246
+ touchAction: "none"
247
+ });
248
+ div.tabIndex = 0;
249
+ div.setAttribute("data-hw-focus-guard", "");
250
+ document.body.appendChild(div);
251
+ return div;
252
+ };
253
+ function getContainedFocusableElements(element) {
254
+ return element?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
255
+ }
256
+ var FocusTrapService = class {
257
+ constructor() {
258
+ // The last entry is always the active one
259
+ this.listeners = [];
260
+ this.onFocusIn = (event) => {
261
+ const active = this.getActive();
262
+ if (!active || !active.container.current) return;
263
+ const { container } = active;
264
+ if (!container.current.contains(event.target)) {
265
+ this.focusElement();
266
+ }
267
+ };
268
+ }
269
+ getActive() {
270
+ if (this.listeners.length === 0) return void 0;
271
+ return this.listeners[this.listeners.length - 1];
272
+ }
273
+ focusElement() {
274
+ const active = this.getActive();
275
+ if (!active) return;
276
+ const { container, initialFocusElement } = active;
277
+ const containerElement = container.current;
278
+ if (initialFocusElement?.current) {
279
+ initialFocusElement.current.focus();
280
+ } else {
281
+ const elements = getContainedFocusableElements(containerElement);
282
+ if (elements && elements.length > 0) {
283
+ const first = elements.item(0);
284
+ first.focus();
285
+ } else {
286
+ containerElement.focus();
287
+ }
288
+ }
289
+ }
290
+ removeGuards() {
291
+ document.querySelectorAll("[data-hw-focus-guard]").forEach((node) => node.remove());
292
+ }
293
+ addGuards() {
294
+ document.body.insertAdjacentElement("afterbegin", createFocusGuard());
295
+ document.body.insertAdjacentElement("beforeend", createFocusGuard());
296
+ }
297
+ activate() {
298
+ document.addEventListener("focusin", this.onFocusIn);
299
+ this.addGuards();
300
+ }
301
+ deactivate() {
302
+ document.removeEventListener("focusin", this.onFocusIn);
303
+ this.removeGuards();
304
+ }
305
+ register(listener) {
306
+ this.listeners.push(listener);
307
+ if (this.listeners.length === 1) {
308
+ this.activate();
309
+ }
310
+ const active = listener;
311
+ this.listeners.forEach((listener2) => {
312
+ const { focus, pause } = listener2;
313
+ if (listener2 === active) {
314
+ focus();
315
+ } else {
316
+ pause();
317
+ }
318
+ });
319
+ }
320
+ unregister(id) {
321
+ const index = this.listeners.findIndex((trap) => trap.id === id);
322
+ if (index !== -1) {
323
+ const isActive = index === this.listeners.length - 1;
324
+ const listener = this.listeners[index];
325
+ this.listeners = this.listeners.filter((listener2) => listener2.id !== id);
326
+ if (isActive) {
327
+ this.deactivate();
328
+ listener.focusLast();
329
+ const active = this.getActive();
330
+ this.listeners.forEach((listener2) => {
331
+ const { pause, unpause } = listener2;
332
+ if (listener2 === active) {
333
+ unpause();
334
+ } else {
335
+ pause();
336
+ }
337
+ });
338
+ if (this.listeners.length > 0) {
339
+ this.activate();
340
+ }
341
+ }
342
+ } else {
343
+ console.warn(`Unable to unregister id ${id}: not found`);
344
+ }
345
+ }
346
+ };
347
+ var service = new FocusTrapService();
348
+ var useFocusTrap = ({
349
+ container,
350
+ active = true,
351
+ initialFocus,
352
+ focusFirst = true
353
+ }) => {
354
+ const lastFocusRef = useRef(null);
355
+ const [paused, setPaused] = useState5(false);
356
+ const isMounted = useIsMounted();
357
+ const id = useId2();
358
+ const focusElement = useCallback3(() => {
359
+ const containerElement = container.current;
360
+ if (initialFocus?.current) {
361
+ initialFocus.current.focus();
362
+ } else {
363
+ const elements = getContainedFocusableElements(containerElement);
364
+ if (elements && elements.length > 0) {
365
+ const first = elements.item(0);
366
+ first.focus();
367
+ } else {
368
+ containerElement.focus();
369
+ }
370
+ }
371
+ }, [container, initialFocus]);
372
+ useEffect4(() => {
373
+ if (active && isMounted) {
374
+ let pause = function() {
375
+ setPaused(true);
376
+ }, unpause = function() {
377
+ setPaused(false);
378
+ if (!container.current.contains(document.activeElement)) {
379
+ focusElement();
380
+ }
381
+ }, focus = function() {
382
+ focusElement();
383
+ setPaused(false);
384
+ }, focusLast = function() {
385
+ lastFocusRef.current?.focus();
386
+ };
387
+ if (!lastFocusRef.current) {
388
+ lastFocusRef.current = document.activeElement;
389
+ }
390
+ service.register({ id, pause, focus, focusLast, unpause, container, initialFocusElement: initialFocus });
391
+ return () => {
392
+ service.unregister(id);
393
+ lastFocusRef.current = void 0;
394
+ };
395
+ }
396
+ }, [active, container, focusElement, id, initialFocus, isMounted]);
397
+ useEffect4(() => {
398
+ if (active && !paused && isMounted) {
399
+ let onKeyDown = function(event) {
400
+ const key = event.key;
401
+ const elements = getContainedFocusableElements(containerElement);
402
+ const active2 = document.activeElement;
403
+ const index = [...elements].findIndex((value) => value === active2);
404
+ if (index === -1 || event.altKey || event.ctrlKey || event.metaKey) {
405
+ return;
406
+ }
407
+ if (key === "Tab") {
408
+ const next = event.shiftKey ? -1 : 1;
409
+ const nextIndex = (index + next + elements.length) % elements.length;
410
+ const nextElement = elements[nextIndex];
411
+ nextElement.focus();
412
+ event.preventDefault();
413
+ }
414
+ };
415
+ const containerElement = container.current;
416
+ containerElement.addEventListener("keydown", onKeyDown);
417
+ return () => {
418
+ containerElement.removeEventListener("keydown", onKeyDown);
419
+ };
420
+ }
421
+ }, [active, paused, isMounted, container, initialFocus, focusFirst, focusElement]);
422
+ };
423
+
424
+ // src/utils/match.ts
425
+ var match = (key, values) => {
426
+ return values[key];
427
+ };
428
+
429
+ // src/components/user-action/select/Select.tsx
430
+ import { CheckIcon, Plus, XIcon } from "lucide-react";
431
+
432
+ // src/components/layout/Chip.tsx
433
+ import clsx2 from "clsx";
434
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
435
+ var Chip = ({
436
+ children,
437
+ trailingIcon,
438
+ color = "default",
439
+ size = "md",
440
+ icon = false,
441
+ variant = "normal",
442
+ className = "",
443
+ ...restProps
444
+ }) => {
445
+ const colorMapping = {
446
+ default: "text-tag-default-text bg-tag-default-background",
447
+ dark: "text-tag-dark-text bg-tag-dark-background",
448
+ red: "text-tag-red-text bg-tag-red-background",
449
+ yellow: "text-tag-yellow-text bg-tag-yellow-background",
450
+ green: "text-tag-green-text bg-tag-green-background",
451
+ blue: "text-tag-blue-text bg-tag-blue-background",
452
+ pink: "text-tag-pink-text bg-tag-pink-background",
453
+ orange: "text-tag-orange-text bg-tag-orange-background"
454
+ }[color];
455
+ const colorMappingIcon = {
456
+ default: "text-tag-default-icon",
457
+ dark: "text-tag-dark-icon",
458
+ red: "text-tag-red-icon",
459
+ yellow: "text-tag-yellow-icon",
460
+ green: "text-tag-green-icon",
461
+ blue: "text-tag-blue-icon",
462
+ pink: "text-tag-pink-icon",
463
+ orange: "text-tag-orange-icon"
464
+ }[color];
465
+ return /* @__PURE__ */ jsxs2(
466
+ "div",
467
+ {
468
+ ...restProps,
469
+ className: clsx2(
470
+ `flex-row-0 w-fit font-semibold`,
471
+ colorMapping,
472
+ !icon ? {
473
+ "px-1 py-0.5": size === "sm",
474
+ "px-2 py-1": size === "md",
475
+ "px-4 py-2": size === "lg"
476
+ } : {
477
+ "p-0.5": size === "sm",
478
+ "p-1": size === "md",
479
+ "p-2": size === "lg"
480
+ },
481
+ {
482
+ "rounded-md": variant === "normal",
483
+ "rounded-full": variant === "fullyRounded"
484
+ },
485
+ className
486
+ ),
487
+ children: [
488
+ children,
489
+ trailingIcon && /* @__PURE__ */ jsx3("span", { className: colorMappingIcon, children: trailingIcon })
490
+ ]
491
+ }
492
+ );
493
+ };
494
+
495
+ // src/components/user-action/Button.tsx
496
+ import { forwardRef as forwardRef2 } from "react";
497
+ import clsx3 from "clsx";
498
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
499
+ var ButtonColorUtil = {
500
+ solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
501
+ text: ["primary", "negative", "neutral"],
502
+ outline: ["primary"]
503
+ };
504
+ var IconButtonUtil = {
505
+ icon: [...ButtonColorUtil.solid, "transparent"]
506
+ };
507
+ var paddingMapping = {
508
+ small: "btn-sm",
509
+ medium: "btn-md",
510
+ large: "btn-lg"
511
+ };
512
+ var iconPaddingMapping = {
513
+ tiny: "icon-btn-xs",
514
+ small: "icon-btn-sm",
515
+ medium: "icon-btn-md",
516
+ large: "icon-btn-lg"
517
+ };
518
+ var ButtonUtil = {
519
+ paddingMapping,
520
+ iconPaddingMapping
521
+ };
522
+ var SolidButton = forwardRef2(function SolidButton2({
523
+ children,
524
+ color = "primary",
525
+ size = "medium",
526
+ startIcon,
527
+ endIcon,
528
+ onClick,
529
+ className,
530
+ ...restProps
531
+ }, ref) {
532
+ const colorClasses = {
533
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
534
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
535
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
536
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
537
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
538
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
539
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text"
540
+ }[color];
541
+ const iconColorClasses = {
542
+ primary: "not-group-disabled:text-button-solid-primary-icon",
543
+ secondary: "not-group-disabled:text-button-solid-secondary-icon",
544
+ tertiary: "not-group-disabled:text-button-solid-tertiary-icon",
545
+ positive: "not-group-disabled:text-button-solid-positive-icon",
546
+ warning: "not-group-disabled:text-button-solid-warning-icon",
547
+ negative: "not-group-disabled:text-button-solid-negative-icon",
548
+ neutral: "not-group-disabled:text-button-solid-neutral-icon"
549
+ }[color];
550
+ return /* @__PURE__ */ jsxs3(
551
+ "button",
552
+ {
553
+ ref,
554
+ onClick,
555
+ className: clsx3(
556
+ "group font-semibold",
557
+ colorClasses,
558
+ "not-disabled:hover:brightness-90",
559
+ "disabled:text-disabled-text disabled:bg-disabled-background",
560
+ ButtonUtil.paddingMapping[size],
561
+ className
562
+ ),
563
+ ...restProps,
564
+ children: [
565
+ startIcon && /* @__PURE__ */ jsx4(
566
+ "span",
567
+ {
568
+ className: clsx3(
569
+ iconColorClasses,
570
+ "group-disabled:text-disabled-icon"
571
+ ),
572
+ children: startIcon
573
+ }
574
+ ),
575
+ children,
576
+ endIcon && /* @__PURE__ */ jsx4(
577
+ "span",
578
+ {
579
+ className: clsx3(
580
+ iconColorClasses,
581
+ "group-disabled:text-disabled-icon"
582
+ ),
583
+ children: endIcon
584
+ }
585
+ )
586
+ ]
587
+ }
588
+ );
589
+ });
590
+ var IconButton = forwardRef2(function IconButton2({
591
+ children,
592
+ color = "primary",
593
+ size = "medium",
594
+ className,
595
+ ...restProps
596
+ }, ref) {
597
+ const colorClasses = {
598
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
599
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
600
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
601
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
602
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
603
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
604
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text",
605
+ transparent: "not-disabled:bg-transparent"
606
+ }[color];
607
+ return /* @__PURE__ */ jsx4(
608
+ "button",
609
+ {
610
+ ref,
611
+ className: clsx3(
612
+ colorClasses,
613
+ "not-disabled:hover:brightness-90",
614
+ "disabled:text-disabled-text",
615
+ {
616
+ "disabled:bg-disabled-background": color !== "transparent",
617
+ "disabled:opacity-70": color === "transparent",
618
+ "not-disabled:hover:bg-button-text-hover-background": color === "transparent"
619
+ },
620
+ ButtonUtil.iconPaddingMapping[size],
621
+ className
622
+ ),
623
+ ...restProps,
624
+ children
625
+ }
626
+ );
627
+ });
628
+
629
+ // src/hooks/useFloatingElement.ts
630
+ import { useCallback as useCallback4, useEffect as useEffect5, useState as useState6 } from "react";
631
+
632
+ // src/utils/math.ts
633
+ var clamp = (value, range = [0, 1]) => {
634
+ const [min, max] = range;
635
+ return Math.min(Math.max(value, min), max);
636
+ };
637
+
638
+ // src/hooks/useFloatingElement.ts
639
+ function calculatePosition({
640
+ windowRect,
641
+ containerRect,
642
+ anchorRect,
643
+ options
644
+ }) {
645
+ const { verticalAlignment, horizontalAlignment, gap, screenPadding } = options;
646
+ const windowWidth = windowRect.width;
647
+ const windowHeight = windowRect.height;
648
+ const maxWidth = windowWidth - 2 * screenPadding;
649
+ const maxHeight = windowHeight - 2 * screenPadding;
650
+ const width = Math.min(containerRect.width, maxWidth);
651
+ const height = Math.min(containerRect.height, maxHeight);
652
+ const leftSuggestion = {
653
+ beforeStart: anchorRect.left - width - gap,
654
+ afterStart: anchorRect.left,
655
+ center: anchorRect.left + anchorRect.width / 2 - width / 2,
656
+ beforeEnd: anchorRect.right - width,
657
+ afterEnd: anchorRect.right + gap
658
+ }[horizontalAlignment];
659
+ const topSuggestion = {
660
+ beforeStart: anchorRect.top - height - gap,
661
+ afterStart: anchorRect.top,
662
+ center: anchorRect.top + anchorRect.height / 2 - height / 2,
663
+ beforeEnd: anchorRect.bottom - height,
664
+ afterEnd: anchorRect.bottom + gap
665
+ }[verticalAlignment];
666
+ const left = clamp(leftSuggestion, [
667
+ screenPadding,
668
+ windowWidth - screenPadding - width
669
+ ]);
670
+ const top = clamp(topSuggestion, [
671
+ screenPadding,
672
+ windowHeight - screenPadding - height
673
+ ]);
674
+ return {
675
+ left,
676
+ top,
677
+ maxWidth,
678
+ maxHeight
679
+ };
680
+ }
681
+ function useFloatingElement({
682
+ active = true,
683
+ windowRef,
684
+ anchorRef,
685
+ containerRef,
686
+ isPolling = false,
687
+ pollingInterval = 100,
688
+ verticalAlignment = "afterEnd",
689
+ horizontalAlignment = "afterStart",
690
+ screenPadding = 16,
691
+ gap = 4
692
+ }) {
693
+ const [style, setStyle] = useState6();
694
+ const isMounted = useIsMounted();
695
+ const calculate = useCallback4(() => {
696
+ const containerRect = containerRef.current.getBoundingClientRect();
697
+ const windowRect = windowRef?.current.getBoundingClientRect() ?? {
698
+ top: 0,
699
+ bottom: window.innerHeight,
700
+ left: 0,
701
+ right: window.innerWidth,
702
+ width: window.innerWidth,
703
+ height: window.innerHeight
704
+ };
705
+ const anchorElement = anchorRef?.current;
706
+ if (anchorRef && !anchorElement) {
707
+ console.warn("FloatingContainer anchor provided, but its value is undefined");
708
+ }
709
+ const anchorRect = anchorElement?.getBoundingClientRect() ?? windowRect;
710
+ const calculateProps = {
711
+ windowRect,
712
+ anchorRect,
713
+ containerRect,
714
+ options: {
715
+ horizontalAlignment,
716
+ verticalAlignment,
717
+ screenPadding,
718
+ gap
719
+ }
720
+ };
721
+ setStyle(calculatePosition(calculateProps));
722
+ }, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef]);
723
+ const height = containerRef.current?.getBoundingClientRect().height;
724
+ const width = containerRef.current?.getBoundingClientRect().width;
725
+ useEffect5(() => {
726
+ if (active && isMounted) {
727
+ calculate();
728
+ } else {
729
+ setStyle(void 0);
730
+ }
731
+ }, [calculate, active, isMounted, height, width]);
732
+ useEffect5(() => {
733
+ window.addEventListener("resize", calculate);
734
+ let timeout;
735
+ if (isPolling) {
736
+ timeout = setInterval(calculate, pollingInterval);
737
+ }
738
+ return () => {
739
+ window.removeEventListener("resize", calculate);
740
+ if (timeout) {
741
+ clearInterval(timeout);
742
+ }
743
+ };
744
+ }, [calculate, isPolling, pollingInterval]);
745
+ return style;
746
+ }
747
+
748
+ // src/components/user-action/select/Select.tsx
749
+ import { createPortal } from "react-dom";
750
+ import { Fragment, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
751
+ var defaultToggleOpenOptions = {
752
+ highlightStartPosition: "first"
753
+ };
754
+ var SelectContext = createContext2(null);
755
+ function useSelectContext() {
756
+ const ctx = useContext2(SelectContext);
757
+ if (!ctx) {
758
+ throw new Error("SelectContext must be used within a ListBoxPrimitive");
759
+ }
760
+ return ctx;
761
+ }
762
+ var SelectRoot = ({
763
+ children,
764
+ id,
765
+ value,
766
+ onValueChanged,
767
+ values,
768
+ onValuesChanged,
769
+ isOpen = false,
770
+ disabled = false,
771
+ invalid = false,
772
+ isMultiSelect = false,
773
+ iconAppearance = "left"
774
+ }) => {
775
+ const optionsRef = useRef2([]);
776
+ const triggerRef = useRef2(null);
777
+ const generatedId = useId3();
778
+ const usedId = id ?? generatedId;
779
+ const [internalState, setInternalState] = useState7({
780
+ isOpen
781
+ });
782
+ const state = {
783
+ ...internalState,
784
+ id: usedId,
785
+ disabled,
786
+ invalid,
787
+ value: isMultiSelect ? values ?? [] : [value].filter(Boolean)
788
+ };
789
+ const config = {
790
+ isMultiSelect,
791
+ iconAppearance
792
+ };
793
+ const registerItem = useCallback5((item) => {
794
+ optionsRef.current.push(item);
795
+ optionsRef.current.sort((a, b) => {
796
+ const aEl = a.ref.current;
797
+ const bEl = b.ref.current;
798
+ if (!aEl || !bEl) return 0;
799
+ return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
800
+ });
801
+ }, []);
802
+ const unregisterItem = useCallback5((value2) => {
803
+ optionsRef.current = optionsRef.current.filter((i) => i.value !== value2);
804
+ }, []);
805
+ const toggleSelection = (value2, isSelected) => {
806
+ if (disabled) {
807
+ return;
808
+ }
809
+ const option = optionsRef.current.find((i) => i.value === value2);
810
+ if (!option) {
811
+ console.error(`SelectOption with value: ${value2} not found`);
812
+ return;
813
+ }
814
+ let newValue;
815
+ if (isMultiSelect) {
816
+ const isSelectedBefore = state.value.includes(value2);
817
+ const isSelectedAfter = isSelected ?? !isSelectedBefore;
818
+ if (!isSelectedAfter) {
819
+ newValue = state.value.filter((v) => v !== value2);
820
+ } else {
821
+ newValue = [...state.value, value2];
822
+ }
823
+ } else {
824
+ newValue = [value2];
825
+ }
826
+ if (!isMultiSelect) {
827
+ onValueChanged?.(newValue[0]);
828
+ } else {
829
+ onValuesChanged?.(newValue);
830
+ }
831
+ setInternalState((prevState) => ({
832
+ ...prevState,
833
+ highlightedValue: value2
834
+ }));
835
+ };
836
+ const highlightItem = (value2) => {
837
+ if (disabled) {
838
+ return;
839
+ }
840
+ setInternalState((prevState) => ({
841
+ ...prevState,
842
+ highlightedValue: value2
843
+ }));
844
+ };
845
+ const registerTrigger = useCallback5((ref) => {
846
+ triggerRef.current = ref.current;
847
+ }, []);
848
+ const unregisterTrigger = useCallback5(() => {
849
+ triggerRef.current = null;
850
+ }, []);
851
+ const toggleOpen = (isOpen2, options) => {
852
+ const { highlightStartPosition } = { ...defaultToggleOpenOptions, ...options };
853
+ let highlightedIndex;
854
+ if (highlightStartPosition === "first") {
855
+ highlightedIndex = optionsRef.current.findIndex((option) => !option.disabled);
856
+ } else {
857
+ highlightedIndex = optionsRef.current.length - 1 - [...optionsRef.current].reverse().findIndex((option) => !option.disabled);
858
+ }
859
+ if (highlightedIndex === -1 || highlightedIndex === optionsRef.current.length) {
860
+ highlightedIndex = 0;
861
+ }
862
+ setInternalState((prevState) => ({
863
+ ...prevState,
864
+ isOpen: isOpen2 ?? !prevState.isOpen,
865
+ highlightedValue: optionsRef.current[highlightedIndex].value
866
+ }));
867
+ };
868
+ const moveHighlightedIndex = (delta) => {
869
+ let highlightedIndex = optionsRef.current.findIndex((value2) => value2.value === internalState.highlightedValue);
870
+ if (highlightedIndex === -1) {
871
+ highlightedIndex = 0;
872
+ }
873
+ const optionLength = optionsRef.current.length;
874
+ const startIndex = (highlightedIndex + delta % optionLength + optionLength) % optionLength;
875
+ const isForward = delta >= 0;
876
+ let highlightedValue = optionsRef.current[startIndex].value;
877
+ for (let i = 0; i < optionsRef.current.length; i++) {
878
+ const index = (startIndex + (isForward ? i : -i) + optionLength) % optionLength;
879
+ if (!optionsRef.current[index].disabled) {
880
+ highlightedValue = optionsRef.current[index].value;
881
+ break;
882
+ }
883
+ }
884
+ setInternalState((prevState) => ({
885
+ ...prevState,
886
+ highlightedValue
887
+ }));
888
+ };
889
+ useEffect6(() => {
890
+ if (!internalState.highlightedValue) return;
891
+ const highlighted = optionsRef.current.find((value2) => value2.value === internalState.highlightedValue);
892
+ if (highlighted) {
893
+ highlighted.ref.current.scrollIntoView({ behavior: "instant", block: "nearest" });
894
+ } else {
895
+ console.error(`SelectRoot: Could not find highlighted value (${internalState.highlightedValue})`);
896
+ }
897
+ }, [internalState.highlightedValue]);
898
+ const contextValue = {
899
+ state,
900
+ config,
901
+ item: {
902
+ register: registerItem,
903
+ unregister: unregisterItem,
904
+ toggleSelection,
905
+ highlightItem,
906
+ moveHighlightedIndex
907
+ },
908
+ trigger: {
909
+ ref: triggerRef,
910
+ register: registerTrigger,
911
+ unregister: unregisterTrigger,
912
+ toggleOpen
913
+ }
914
+ };
915
+ return /* @__PURE__ */ jsx5(SelectContext.Provider, { value: contextValue, children });
916
+ };
917
+ var SelectOption = forwardRef3(
918
+ function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
919
+ const { state, config, item, trigger } = useSelectContext();
920
+ const { register, unregister, toggleSelection, highlightItem } = item;
921
+ const itemRef = useRef2(null);
922
+ iconAppearance ??= config.iconAppearance;
923
+ useEffect6(() => {
924
+ register({
925
+ value,
926
+ disabled,
927
+ ref: itemRef
928
+ });
929
+ return () => unregister(value);
930
+ }, [value, disabled, register, unregister, children]);
931
+ const isHighlighted = state.highlightedValue === value;
932
+ const isSelected = state.value.includes(value);
933
+ return /* @__PURE__ */ jsxs4(
934
+ "li",
935
+ {
936
+ ...restProps,
937
+ ref: (node) => {
938
+ itemRef.current = node;
939
+ if (typeof ref === "function") ref(node);
940
+ else if (ref) ref.current = node;
941
+ },
942
+ id: value,
943
+ role: "option",
944
+ "aria-disabled": disabled,
945
+ "aria-selected": isSelected,
946
+ "data-highlighted": isHighlighted ? "" : void 0,
947
+ "data-selected": isSelected ? "" : void 0,
948
+ "data-disabled": disabled ? "" : void 0,
949
+ className: clsx4(
950
+ "flex-row-1 items-center px-2 py-1 rounded-md",
951
+ "data-highlighted:bg-primary/20",
952
+ "data-disabled:text-disabled data-disabled:cursor-not-allowed",
953
+ "not-data-disabled:cursor-pointer",
954
+ className
955
+ ),
956
+ onClick: (event) => {
957
+ if (!disabled) {
958
+ toggleSelection(value);
959
+ if (!config.isMultiSelect) {
960
+ trigger.toggleOpen(false);
961
+ }
962
+ restProps.onClick?.(event);
963
+ }
964
+ },
965
+ onMouseEnter: (event) => {
966
+ if (!disabled) {
967
+ highlightItem(value);
968
+ restProps.onMouseEnter?.(event);
969
+ }
970
+ },
971
+ children: [
972
+ iconAppearance === "left" && /* @__PURE__ */ jsx5(
973
+ CheckIcon,
974
+ {
975
+ className: clsx4("w-4 h-4", { "opacity-0": !isSelected || disabled }),
976
+ "aria-hidden": true
977
+ }
978
+ ),
979
+ children ?? value,
980
+ iconAppearance === "right" && /* @__PURE__ */ jsx5(
981
+ CheckIcon,
982
+ {
983
+ className: clsx4("w-4 h-4", { "opacity-0": !isSelected || disabled }),
984
+ "aria-hidden": true
985
+ }
986
+ )
987
+ ]
988
+ }
989
+ );
990
+ }
991
+ );
992
+ var defaultSelectButtonTranslation = {
993
+ en: {
994
+ clickToSelect: "Click to select"
995
+ },
996
+ de: {
997
+ clickToSelect: "Zum ausw\xE4hlen dr\xFCcken"
998
+ }
999
+ };
1000
+ var SelectButton = forwardRef3(function SelectButton2({ placeholder, selectedDisplay, ...props }, ref) {
1001
+ const translation = useTranslation([defaultSelectButtonTranslation]);
1002
+ const { state, trigger } = useSelectContext();
1003
+ const { register, unregister, toggleOpen } = trigger;
1004
+ const innerRef = useRef2(null);
1005
+ useImperativeHandle(ref, () => innerRef.current);
1006
+ useEffect6(() => {
1007
+ register(innerRef);
1008
+ return () => unregister();
1009
+ }, [register, unregister]);
1010
+ const disabled = !!props?.disabled || !!state.disabled;
1011
+ const invalid = state.invalid;
1012
+ const hasValue = state.value.length > 0;
1013
+ return /* @__PURE__ */ jsxs4(
1014
+ "button",
1015
+ {
1016
+ ...props,
1017
+ ref: innerRef,
1018
+ id: state.id,
1019
+ className: clsx4(
1020
+ "flex-row-2 items-center justify-between bg-input-background text-input-text rounded-md px-2.5 py-2.5",
1021
+ "data-placeholder:text-description",
1022
+ props.className
1023
+ ),
1024
+ onClick: () => toggleOpen(!state.isOpen),
1025
+ onKeyDown: (event) => {
1026
+ switch (event.key) {
1027
+ case "ArrowDown":
1028
+ toggleOpen(true, { highlightStartPosition: "first" });
1029
+ break;
1030
+ case "ArrowUp":
1031
+ toggleOpen(true, { highlightStartPosition: "last" });
1032
+ break;
1033
+ }
1034
+ },
1035
+ "data-placeholder": !hasValue ? "" : void 0,
1036
+ "data-disabled": disabled ? "" : void 0,
1037
+ "data-invalid": invalid ? "" : void 0,
1038
+ "aria-invalid": invalid,
1039
+ "aria-disabled": disabled,
1040
+ "aria-haspopup": "listbox",
1041
+ "aria-expanded": state.isOpen,
1042
+ "aria-controls": state.isOpen ? `${state.id}-listbox` : void 0,
1043
+ children: [
1044
+ hasValue ? selectedDisplay?.(state.value) ?? state.value.join(", ") : placeholder ?? translation("clickToSelect"),
1045
+ /* @__PURE__ */ jsx5(ExpansionIcon, { isExpanded: state.isOpen })
1046
+ ]
1047
+ }
1048
+ );
1049
+ });
1050
+ var SelectChipDisplay = forwardRef3(function SelectChipDisplay2({ ...props }, ref) {
1051
+ const { state, trigger, item } = useSelectContext();
1052
+ const { register, unregister, toggleOpen } = trigger;
1053
+ const innerRef = useRef2(null);
1054
+ useImperativeHandle(ref, () => innerRef.current);
1055
+ useEffect6(() => {
1056
+ register(innerRef);
1057
+ return () => unregister();
1058
+ }, [register, unregister]);
1059
+ const disabled = !!props?.disabled || !!state.disabled;
1060
+ const invalid = state.invalid;
1061
+ return /* @__PURE__ */ jsxs4(
1062
+ "div",
1063
+ {
1064
+ ...props,
1065
+ ref: innerRef,
1066
+ className: clsx4(
1067
+ "flex flex-wrap flex-row gap-2 items-center bg-input-background text-input-text rounded-md px-2.5 py-2.5",
1068
+ props.className
1069
+ ),
1070
+ "data-disabled": disabled ? "" : void 0,
1071
+ "data-invalid": invalid ? "" : void 0,
1072
+ "aria-invalid": invalid,
1073
+ "aria-disabled": disabled,
1074
+ children: [
1075
+ state.value.map((value) => /* @__PURE__ */ jsxs4(Chip, { className: "gap-x-2", children: [
1076
+ value,
1077
+ /* @__PURE__ */ jsx5(
1078
+ "button",
1079
+ {
1080
+ onClick: () => {
1081
+ item.toggleSelection(value, false);
1082
+ },
1083
+ 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",
1084
+ children: /* @__PURE__ */ jsx5(XIcon, {})
1085
+ }
1086
+ )
1087
+ ] }, value)),
1088
+ /* @__PURE__ */ jsx5(
1089
+ IconButton,
1090
+ {
1091
+ id: state.id,
1092
+ onClick: () => toggleOpen(),
1093
+ onKeyDown: (event) => {
1094
+ switch (event.key) {
1095
+ case "ArrowDown":
1096
+ toggleOpen(true, { highlightStartPosition: "first" });
1097
+ break;
1098
+ case "ArrowUp":
1099
+ toggleOpen(true, { highlightStartPosition: "last" });
1100
+ }
1101
+ },
1102
+ size: "small",
1103
+ color: "neutral",
1104
+ "aria-invalid": invalid,
1105
+ "aria-disabled": disabled,
1106
+ "aria-haspopup": "listbox",
1107
+ "aria-expanded": state.isOpen,
1108
+ "aria-controls": state.isOpen ? `${state.id}-listbox` : void 0,
1109
+ children: /* @__PURE__ */ jsx5(Plus, {})
1110
+ }
1111
+ )
1112
+ ]
1113
+ }
1114
+ );
1115
+ });
1116
+ var SelectContent = forwardRef3(
1117
+ function SelectContent2({
1118
+ alignment,
1119
+ orientation = "vertical",
1120
+ ...props
1121
+ }, ref) {
1122
+ const innerRef = useRef2(null);
1123
+ useImperativeHandle(ref, () => innerRef.current);
1124
+ const { trigger, state, config, item } = useSelectContext();
1125
+ const position = useFloatingElement({
1126
+ active: state.isOpen,
1127
+ anchorRef: trigger.ref,
1128
+ containerRef: innerRef,
1129
+ ...alignment
1130
+ });
1131
+ useFocusTrap({
1132
+ container: innerRef,
1133
+ active: state.isOpen && !!position
1134
+ });
1135
+ return createPortal(
1136
+ /* @__PURE__ */ jsxs4(Fragment, { children: [
1137
+ /* @__PURE__ */ jsx5(
1138
+ "div",
1139
+ {
1140
+ hidden: !state.isOpen,
1141
+ onClick: () => trigger.toggleOpen(false),
1142
+ className: clsx4("fixed w-screen h-screen inset-0")
1143
+ }
1144
+ ),
1145
+ /* @__PURE__ */ jsx5(
1146
+ "ul",
1147
+ {
1148
+ ...props,
1149
+ id: `${state.id}-listbox`,
1150
+ ref: innerRef,
1151
+ hidden: !state.isOpen,
1152
+ onKeyDown: (event) => {
1153
+ switch (event.key) {
1154
+ case "Escape":
1155
+ trigger.toggleOpen(false);
1156
+ event.preventDefault();
1157
+ event.stopPropagation();
1158
+ break;
1159
+ case match(orientation, {
1160
+ vertical: "ArrowDown",
1161
+ horizontal: "ArrowUp"
1162
+ }):
1163
+ item.moveHighlightedIndex(1);
1164
+ event.preventDefault();
1165
+ break;
1166
+ case match(orientation, {
1167
+ vertical: "ArrowUp",
1168
+ horizontal: "ArrowDown"
1169
+ }):
1170
+ item.moveHighlightedIndex(-1);
1171
+ event.preventDefault();
1172
+ break;
1173
+ case "Home":
1174
+ event.preventDefault();
1175
+ break;
1176
+ case "End":
1177
+ event.preventDefault();
1178
+ break;
1179
+ case "Enter":
1180
+ // Fall through
1181
+ case " ":
1182
+ if (state.highlightedValue) {
1183
+ item.toggleSelection(state.highlightedValue);
1184
+ if (!config.isMultiSelect) {
1185
+ trigger.toggleOpen(false);
1186
+ }
1187
+ event.preventDefault();
1188
+ }
1189
+ break;
1190
+ }
1191
+ },
1192
+ className: clsx4("flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-style-within overflow-auto", props.className),
1193
+ style: {
1194
+ opacity: position ? void 0 : 0,
1195
+ position: "fixed",
1196
+ ...position
1197
+ },
1198
+ role: "listbox",
1199
+ "aria-multiselectable": config.isMultiSelect,
1200
+ "aria-orientation": orientation,
1201
+ tabIndex: position ? 0 : void 0,
1202
+ children: props.children
1203
+ }
1204
+ )
1205
+ ] }),
1206
+ document.body
1207
+ );
1208
+ }
1209
+ );
1210
+ var Select = forwardRef3(function Select2({
1211
+ children,
1212
+ contentPanelProps,
1213
+ buttonProps,
1214
+ ...props
1215
+ }, ref) {
1216
+ return /* @__PURE__ */ jsxs4(SelectRoot, { ...props, isMultiSelect: false, children: [
1217
+ /* @__PURE__ */ jsx5(
1218
+ SelectButton,
1219
+ {
1220
+ ref,
1221
+ ...buttonProps,
1222
+ selectedDisplay: (values) => {
1223
+ const value = values[0];
1224
+ if (!buttonProps?.selectedDisplay) return void 0;
1225
+ return buttonProps.selectedDisplay(value);
1226
+ }
1227
+ }
1228
+ ),
1229
+ /* @__PURE__ */ jsx5(SelectContent, { ...contentPanelProps, children })
1230
+ ] });
1231
+ });
1232
+ var SelectUncontrolled = forwardRef3(function SelectUncontrolled2({
1233
+ value: initialValue,
1234
+ onValueChanged,
1235
+ ...props
1236
+ }, ref) {
1237
+ const [value, setValue] = useState7(initialValue);
1238
+ useEffect6(() => {
1239
+ setValue(initialValue);
1240
+ }, [initialValue]);
1241
+ return /* @__PURE__ */ jsx5(
1242
+ Select,
1243
+ {
1244
+ ...props,
1245
+ ref,
1246
+ value,
1247
+ onValueChanged: (value2) => {
1248
+ setValue(value2);
1249
+ onValueChanged?.(value2);
1250
+ }
1251
+ }
1252
+ );
1253
+ });
1254
+ var MultiSelect = forwardRef3(function MultiSelect2({
1255
+ children,
1256
+ contentPanelProps,
1257
+ buttonProps,
1258
+ ...props
1259
+ }, ref) {
1260
+ return /* @__PURE__ */ jsxs4(SelectRoot, { ...props, isMultiSelect: true, children: [
1261
+ /* @__PURE__ */ jsx5(SelectButton, { ref, ...buttonProps }),
1262
+ /* @__PURE__ */ jsx5(SelectContent, { ...contentPanelProps, children })
1263
+ ] });
1264
+ });
1265
+ var MultiSelectUncontrolled = forwardRef3(function MultiSelectUncontrolled2({
1266
+ values: initialValues,
1267
+ onValuesChanged,
1268
+ ...props
1269
+ }, ref) {
1270
+ const [values, setValues] = useState7(initialValues);
1271
+ useEffect6(() => {
1272
+ setValues(initialValues);
1273
+ }, [initialValues]);
1274
+ return /* @__PURE__ */ jsx5(
1275
+ MultiSelect,
1276
+ {
1277
+ ...props,
1278
+ ref,
1279
+ values,
1280
+ onValuesChanged: (value) => {
1281
+ setValues(value);
1282
+ onValuesChanged?.(value);
1283
+ }
1284
+ }
1285
+ );
1286
+ });
1287
+ var MultiSelectChipDisplay = forwardRef3(function MultiSelectChipDisplay2({
1288
+ children,
1289
+ contentPanelProps,
1290
+ chipDisplayProps,
1291
+ ...props
1292
+ }, ref) {
1293
+ return /* @__PURE__ */ jsxs4(SelectRoot, { ...props, isMultiSelect: true, children: [
1294
+ /* @__PURE__ */ jsx5(SelectChipDisplay, { ref, ...chipDisplayProps }),
1295
+ /* @__PURE__ */ jsx5(SelectContent, { ...contentPanelProps, children })
1296
+ ] });
1297
+ });
1298
+ var MultiSelectChipDisplayUncontrolled = forwardRef3(function MultiSelectChipDisplayUncontrolled2({
1299
+ values: initialValues,
1300
+ onValuesChanged,
1301
+ ...props
1302
+ }, ref) {
1303
+ const [values, setValues] = useState7(initialValues);
1304
+ useEffect6(() => {
1305
+ setValues(initialValues);
1306
+ }, [initialValues]);
1307
+ return /* @__PURE__ */ jsx5(
1308
+ MultiSelectChipDisplay,
1309
+ {
1310
+ ...props,
1311
+ ref,
1312
+ values,
1313
+ onValuesChanged: (value) => {
1314
+ setValues(value);
1315
+ onValuesChanged?.(value);
1316
+ }
1317
+ }
1318
+ );
1319
+ });
1320
+
1321
+ // src/theming/useTheme.tsx
1322
+ import { useCallback as useCallback6 } from "react";
1323
+ import { useMemo } from "react";
1324
+ import { createContext as createContext3, useContext as useContext3, useEffect as useEffect7, useState as useState8 } from "react";
1325
+ import { jsx as jsx6 } from "react/jsx-runtime";
1326
+ var themes = ["light", "dark", "system"];
1327
+ var defaultThemeTypeTranslation = {
1328
+ en: {
1329
+ dark: "Dark",
1330
+ light: "Light",
1331
+ system: "System",
1332
+ theme: {
1333
+ one: "Theme",
1334
+ other: "Themes"
1335
+ }
1336
+ },
1337
+ de: {
1338
+ dark: "Dunkel",
1339
+ light: "Hell",
1340
+ system: "System",
1341
+ theme: {
1342
+ one: "Farbschema",
1343
+ other: "Farbschemas"
1344
+ }
1345
+ }
1346
+ };
1347
+ var ThemeUtil = {
1348
+ themes,
1349
+ translation: defaultThemeTypeTranslation
1350
+ };
1351
+ var ThemeContext = createContext3(null);
1352
+ var useTheme = () => {
1353
+ const context = useContext3(ThemeContext);
1354
+ if (!context) {
1355
+ throw new Error("useTheme must be used within ThemeContext. Try adding a ThemeProvider around your app.");
1356
+ }
1357
+ return context;
1358
+ };
1359
+
1360
+ // src/localization/defaults/form.ts
1361
+ var formTranslation = {
1362
+ en: {
1363
+ add: "Add",
1364
+ all: "All",
1365
+ apply: "Apply",
1366
+ back: "Back",
1367
+ cancel: "Cancel",
1368
+ change: "Change",
1369
+ clear: "Clear",
1370
+ click: "Click",
1371
+ clickToCopy: "Click to Copy",
1372
+ close: "Close",
1373
+ confirm: "Confirm",
1374
+ copy: "Copy",
1375
+ copied: "Copied",
1376
+ create: "Create",
1377
+ decline: "Decline",
1378
+ delete: "Delete",
1379
+ discard: "Discard",
1380
+ discardChanges: "Discard Changes",
1381
+ done: "Done",
1382
+ edit: "Edit",
1383
+ enterText: "Enter text here",
1384
+ error: "Error",
1385
+ exit: "Exit",
1386
+ fieldRequiredError: "This field is required.",
1387
+ invalidEmailError: "Please enter a valid email address.",
1388
+ less: "Less",
1389
+ loading: "Loading",
1390
+ maxLengthError: "Maximum length exceeded.",
1391
+ minLengthError: "Minimum length not met.",
1392
+ more: "More",
1393
+ next: "Next",
1394
+ no: "No",
1395
+ none: "None",
1396
+ nothingFound: "Nothing found",
1397
+ of: "of",
1398
+ optional: "Optional",
1399
+ pleaseWait: "Please wait...",
1400
+ previous: "Previous",
1401
+ remove: "Remove",
1402
+ required: "Required",
1403
+ reset: "Reset",
1404
+ save: "Save",
1405
+ saved: "Saved",
1406
+ search: "Search",
1407
+ select: "Select",
1408
+ selectOption: "Select an option",
1409
+ show: "Show",
1410
+ showMore: "Show more",
1411
+ showLess: "Show less",
1412
+ submit: "Submit",
1413
+ success: "Success",
1414
+ update: "Update",
1415
+ unsavedChanges: "Unsaved Changes",
1416
+ unsavedChangesSaveQuestion: "Do you want to save your changes?",
1417
+ yes: "Yes"
1418
+ },
1419
+ de: {
1420
+ add: "Hinzuf\xFCgen",
1421
+ all: "Alle",
1422
+ apply: "Anwenden",
1423
+ back: "Zur\xFCck",
1424
+ cancel: "Abbrechen",
1425
+ change: "\xC4ndern",
1426
+ clear: "L\xF6schen",
1427
+ click: "Klicken",
1428
+ clickToCopy: "Zum kopieren klicken",
1429
+ close: "Schlie\xDFen",
1430
+ confirm: "Best\xE4tigen",
1431
+ copy: "Kopieren",
1432
+ copied: "Kopiert",
1433
+ create: "Erstellen",
1434
+ decline: "Ablehnen",
1435
+ delete: "L\xF6schen",
1436
+ discard: "Verwerfen",
1437
+ discardChanges: "\xC4nderungen Verwerfen",
1438
+ done: "Fertig",
1439
+ edit: "Bearbeiten",
1440
+ enterText: "Text hier eingeben",
1441
+ error: "Fehler",
1442
+ exit: "Beenden",
1443
+ fieldRequiredError: "Dieses Feld ist erforderlich.",
1444
+ invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
1445
+ less: "Weniger",
1446
+ loading: "L\xE4dt",
1447
+ maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
1448
+ minLengthError: "Mindestl\xE4nge nicht erreicht.",
1449
+ more: "Mehr",
1450
+ next: "Weiter",
1451
+ no: "Nein",
1452
+ none: "Nichts",
1453
+ nothingFound: "Nichts gefunden",
1454
+ of: "von",
1455
+ optional: "Optional",
1456
+ pleaseWait: "Bitte warten...",
1457
+ previous: "Vorherige",
1458
+ remove: "Entfernen",
1459
+ required: "Erforderlich",
1460
+ reset: "Zur\xFCcksetzen",
1461
+ save: "Speichern",
1462
+ saved: "Gespeichert",
1463
+ search: "Suche",
1464
+ select: "Select",
1465
+ selectOption: "Option ausw\xE4hlen",
1466
+ show: "Anzeigen",
1467
+ showMore: "Mehr anzeigen",
1468
+ showLess: "Weniger anzeigen",
1469
+ submit: "Abschicken",
1470
+ success: "Erfolg",
1471
+ update: "Update",
1472
+ unsavedChanges: "Ungespeicherte \xC4nderungen",
1473
+ unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
1474
+ yes: "Ja"
1475
+ }
1476
+ };
1477
+
1478
+ // src/components/dialog/Dialog.tsx
1479
+ import { useRef as useRef4 } from "react";
1480
+ import clsx6 from "clsx";
1481
+ import { X } from "lucide-react";
1482
+
1483
+ // src/components/layout/FloatingContainer.tsx
1484
+ import { forwardRef as forwardRef4, useImperativeHandle as useImperativeHandle2, useRef as useRef3 } from "react";
1485
+ import { createPortal as createPortal2 } from "react-dom";
1486
+ import { clsx as clsx5 } from "clsx";
1487
+ import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
1488
+ var FloatingContainer = forwardRef4(function FloatingContainer2({
1489
+ children,
1490
+ backgroundOverlay,
1491
+ anchor,
1492
+ isPolling = false,
1493
+ pollingInterval = 100,
1494
+ verticalAlignment = "afterEnd",
1495
+ horizontalAlignment = "afterStart",
1496
+ screenPadding = 16,
1497
+ gap = 4,
1498
+ ...props
1499
+ }, forwardRef5) {
1500
+ const innerRef = useRef3(null);
1501
+ useImperativeHandle2(forwardRef5, () => innerRef.current);
1502
+ const position = useFloatingElement({
1503
+ active: !props.hidden,
1504
+ containerRef: innerRef,
1505
+ anchorRef: anchor,
1506
+ isPolling,
1507
+ pollingInterval,
1508
+ verticalAlignment,
1509
+ horizontalAlignment,
1510
+ gap,
1511
+ screenPadding
1512
+ });
1513
+ return createPortal2(
1514
+ /* @__PURE__ */ jsxs5(Fragment2, { children: [
1515
+ backgroundOverlay,
1516
+ /* @__PURE__ */ jsx7(
1517
+ "div",
1518
+ {
1519
+ ...props,
1520
+ ref: innerRef,
1521
+ style: {
1522
+ position: "fixed",
1523
+ overflow: "hidden",
1524
+ opacity: position ? void 0 : 0,
1525
+ // hide when position calculation isn't done yet
1526
+ transition: position ? `top ${pollingInterval}ms linear, left ${pollingInterval}ms linear` : void 0,
1527
+ ...position,
1528
+ ...props.style
1529
+ },
1530
+ className: clsx5("motion-safe:duration-100 motion-reduce:duration-0", props.className),
1531
+ children
1532
+ }
1533
+ )
1534
+ ] }),
1535
+ document.body
1536
+ );
1537
+ });
1538
+
1539
+ // src/hooks/useLogOnce.ts
1540
+ import { useEffect as useEffect8, useState as useState9 } from "react";
1541
+ var defaultOptions = {
1542
+ type: "warning"
1543
+ };
1544
+ var useLogOnce = (message, condition, options) => {
1545
+ const [hasLogged, setHasLogged] = useState9(false);
1546
+ const { type } = { ...defaultOptions, ...options };
1547
+ useEffect8(() => {
1548
+ if (!hasLogged && condition) {
1549
+ switch (type) {
1550
+ case "info":
1551
+ console.info(message);
1552
+ break;
1553
+ case "error":
1554
+ console.error(message);
1555
+ break;
1556
+ case "warning":
1557
+ console.warn(message);
1558
+ break;
1559
+ }
1560
+ setHasLogged(true);
1561
+ }
1562
+ }, [condition]);
1563
+ };
1564
+
1565
+ // src/components/dialog/Dialog.tsx
1566
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
1567
+ var Dialog = ({
1568
+ children,
1569
+ isOpen,
1570
+ titleElement,
1571
+ description,
1572
+ isModal = true,
1573
+ onClose,
1574
+ horizontalAlignment = "center",
1575
+ verticalAlignment = "center",
1576
+ className,
1577
+ backgroundClassName
1578
+ }) => {
1579
+ const translation = useTranslation([formTranslation]);
1580
+ const ref = useRef4(null);
1581
+ const onCloseWrapper = () => {
1582
+ if (!isModal) return;
1583
+ onClose?.();
1584
+ };
1585
+ useLogOnce("Dialog: onClose should be defined for modal dialogs", isModal && !onClose);
1586
+ useFocusTrap({
1587
+ container: ref,
1588
+ active: isOpen,
1589
+ focusFirst: true
1590
+ });
1591
+ if (!isOpen) return void 0;
1592
+ return /* @__PURE__ */ jsxs6(
1593
+ FloatingContainer,
1594
+ {
1595
+ ref,
1596
+ hidden: !isOpen,
1597
+ onKeyDown: (event) => {
1598
+ if (event.key === "Escape") {
1599
+ onCloseWrapper();
1600
+ }
1601
+ },
1602
+ horizontalAlignment,
1603
+ verticalAlignment,
1604
+ backgroundOverlay: /* @__PURE__ */ jsx8(
1605
+ "div",
1606
+ {
1607
+ className: clsx6(
1608
+ "fixed inset-0 h-screen w-screen bg-overlay-shadow",
1609
+ {
1610
+ "motion-safe:animate-fade-in animation-delay-3000": isOpen,
1611
+ "motion-safe:animate-fade-out": !isOpen
1612
+ },
1613
+ backgroundClassName
1614
+ ),
1615
+ hidden: !isOpen,
1616
+ "aria-hidden": true,
1617
+ onClick: onCloseWrapper
1618
+ }
1619
+ ),
1620
+ className: clsx6(
1621
+ "flex-col-2 p-4 bg-overlay-background text-overlay-text rounded-xl shadow-hw-bottom",
1622
+ {
1623
+ "motion-safe:animate-pop-in": isOpen,
1624
+ "motion-safe:animate-pop-out": !isOpen
1625
+ },
1626
+ className
1627
+ ),
1628
+ children: [
1629
+ /* @__PURE__ */ jsx8("div", { className: "typography-title-lg-semibold mr-8", children: titleElement }),
1630
+ /* @__PURE__ */ jsx8("div", { className: "text-description", children: description }),
1631
+ isModal && /* @__PURE__ */ jsx8(
1632
+ "div",
1633
+ {
1634
+ className: "absolute top-0 right-0",
1635
+ style: {
1636
+ paddingTop: "inherit",
1637
+ paddingRight: "inherit"
1638
+ },
1639
+ children: /* @__PURE__ */ jsx8(
1640
+ IconButton,
1641
+ {
1642
+ color: "neutral",
1643
+ size: "tiny",
1644
+ "aria-label": translation("close"),
1645
+ onClick: onCloseWrapper,
1646
+ children: /* @__PURE__ */ jsx8(X, {})
1647
+ }
1648
+ )
1649
+ }
1650
+ ),
1651
+ children
1652
+ ]
1653
+ }
1654
+ );
1655
+ };
1656
+
1657
+ // src/components/dialog/ThemeDialog.tsx
1658
+ import { MonitorCog, MoonIcon, SunIcon } from "lucide-react";
1659
+ import clsx7 from "clsx";
1660
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
1661
+ var ThemeIcon = ({ theme, className }) => {
1662
+ if (theme === "dark") {
1663
+ return /* @__PURE__ */ jsx9(MoonIcon, { className: clsx7("w-4 h-4", className) });
1664
+ } else if (theme === "light") {
1665
+ return /* @__PURE__ */ jsx9(SunIcon, { className: clsx7("w-4 h-4", className) });
1666
+ } else {
1667
+ return /* @__PURE__ */ jsx9(MonitorCog, { className: clsx7("w-4 h-4", className) });
1668
+ }
1669
+ };
1670
+ var defaultConfirmDialogTranslation = {
1671
+ en: {
1672
+ chooseTheme: "Choose your preferred color theme."
1673
+ },
1674
+ de: {
1675
+ chooseTheme: "W\xE4hle dein bevorzugtes Farbschema."
1676
+ }
1677
+ };
1678
+ var ThemeDialog = ({
1679
+ overwriteTranslation,
1680
+ onClose,
1681
+ titleOverwrite,
1682
+ descriptionOverwrite,
1683
+ ...props
1684
+ }) => {
1685
+ const { theme, setTheme } = useTheme();
1686
+ const translation = useTranslation([defaultConfirmDialogTranslation, formTranslation, ThemeUtil.translation], overwriteTranslation);
1687
+ return /* @__PURE__ */ jsx9(
1688
+ Dialog,
1689
+ {
1690
+ titleElement: titleOverwrite ?? translation("theme"),
1691
+ description: descriptionOverwrite ?? translation("chooseTheme"),
1692
+ onClose,
1693
+ ...props,
1694
+ children: /* @__PURE__ */ jsxs7("div", { className: "w-64", children: [
1695
+ /* @__PURE__ */ jsx9(
1696
+ Select,
1697
+ {
1698
+ value: theme,
1699
+ onValueChanged: (theme2) => setTheme(theme2),
1700
+ iconAppearance: "right",
1701
+ contentPanelProps: {
1702
+ className: "z-100"
1703
+ },
1704
+ buttonProps: {
1705
+ selectedDisplay: (value) => /* @__PURE__ */ jsxs7("div", { className: "flex-row-2 items-center", children: [
1706
+ /* @__PURE__ */ jsx9(ThemeIcon, { theme }),
1707
+ translation(value)
1708
+ ] }),
1709
+ className: "min-w-32"
1710
+ },
1711
+ children: ThemeUtil.themes.map((theme2) => /* @__PURE__ */ jsx9(SelectOption, { value: theme2, className: "gap-x-6 justify-between", children: /* @__PURE__ */ jsxs7("div", { className: "flex-row-2 items-center", children: [
1712
+ /* @__PURE__ */ jsx9(ThemeIcon, { theme: theme2 }),
1713
+ translation(theme2)
1714
+ ] }) }, theme2))
1715
+ }
1716
+ ),
1717
+ /* @__PURE__ */ jsx9("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ jsx9(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
1718
+ ] })
1719
+ }
1720
+ );
1721
+ };
1722
+ export {
1723
+ ThemeDialog
1724
+ };
1725
+ //# sourceMappingURL=ThemeDialog.mjs.map