@helpwave/hightide 0.1.24 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (602) hide show
  1. package/README.md +1 -1
  2. package/dist/components/branding/HelpwaveBadge.d.mts +4 -5
  3. package/dist/components/branding/HelpwaveBadge.d.ts +4 -5
  4. package/dist/components/branding/HelpwaveBadge.js +46 -87
  5. package/dist/components/branding/HelpwaveBadge.js.map +1 -1
  6. package/dist/components/branding/HelpwaveBadge.mjs +46 -89
  7. package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
  8. package/dist/components/date/DatePicker.d.mts +1 -1
  9. package/dist/components/date/DatePicker.d.ts +1 -1
  10. package/dist/components/date/DatePicker.js +106 -60
  11. package/dist/components/date/DatePicker.js.map +1 -1
  12. package/dist/components/date/DatePicker.mjs +107 -61
  13. package/dist/components/date/DatePicker.mjs.map +1 -1
  14. package/dist/components/date/DayPicker.d.mts +1 -1
  15. package/dist/components/date/DayPicker.d.ts +1 -1
  16. package/dist/components/date/DayPicker.js +3 -3
  17. package/dist/components/date/DayPicker.js.map +1 -1
  18. package/dist/components/date/DayPicker.mjs +3 -3
  19. package/dist/components/date/DayPicker.mjs.map +1 -1
  20. package/dist/components/date/TimeDisplay.js.map +1 -1
  21. package/dist/components/date/TimeDisplay.mjs.map +1 -1
  22. package/dist/components/date/TimePicker.js +2 -2
  23. package/dist/components/date/TimePicker.js.map +1 -1
  24. package/dist/components/date/TimePicker.mjs +2 -2
  25. package/dist/components/date/TimePicker.mjs.map +1 -1
  26. package/dist/components/date/YearMonthPicker.js +84 -36
  27. package/dist/components/date/YearMonthPicker.js.map +1 -1
  28. package/dist/components/date/YearMonthPicker.mjs +85 -37
  29. package/dist/components/date/YearMonthPicker.mjs.map +1 -1
  30. package/dist/components/{dialogs → dialog}/ConfirmDialog.d.mts +9 -8
  31. package/dist/components/{dialogs → dialog}/ConfirmDialog.d.ts +9 -8
  32. package/dist/components/dialog/ConfirmDialog.js +938 -0
  33. package/dist/components/dialog/ConfirmDialog.js.map +1 -0
  34. package/dist/components/dialog/ConfirmDialog.mjs +902 -0
  35. package/dist/components/dialog/ConfirmDialog.mjs.map +1 -0
  36. package/dist/components/dialog/Dialog.d.mts +27 -0
  37. package/dist/components/dialog/Dialog.d.ts +27 -0
  38. package/dist/components/dialog/Dialog.js +879 -0
  39. package/dist/components/dialog/Dialog.js.map +1 -0
  40. package/dist/components/dialog/Dialog.mjs +845 -0
  41. package/dist/components/dialog/Dialog.mjs.map +1 -0
  42. package/dist/components/dialog/DiscardChangesDialog.d.mts +24 -0
  43. package/dist/components/dialog/DiscardChangesDialog.d.ts +24 -0
  44. package/dist/components/dialog/DiscardChangesDialog.js +966 -0
  45. package/dist/components/dialog/DiscardChangesDialog.js.map +1 -0
  46. package/dist/components/dialog/DiscardChangesDialog.mjs +930 -0
  47. package/dist/components/dialog/DiscardChangesDialog.mjs.map +1 -0
  48. package/dist/components/dialog/InputDialog.d.mts +22 -0
  49. package/dist/components/dialog/InputDialog.d.ts +22 -0
  50. package/dist/components/dialog/InputDialog.js +1139 -0
  51. package/dist/components/dialog/InputDialog.js.map +1 -0
  52. package/dist/components/dialog/InputDialog.mjs +1103 -0
  53. package/dist/components/dialog/InputDialog.mjs.map +1 -0
  54. package/dist/components/dialog/LanguageDialog.d.mts +25 -0
  55. package/dist/components/dialog/LanguageDialog.d.ts +25 -0
  56. package/dist/components/dialog/LanguageDialog.js +1684 -0
  57. package/dist/components/dialog/LanguageDialog.js.map +1 -0
  58. package/dist/components/dialog/LanguageDialog.mjs +1658 -0
  59. package/dist/components/dialog/LanguageDialog.mjs.map +1 -0
  60. package/dist/components/dialog/ThemeDialog.d.mts +26 -0
  61. package/dist/components/dialog/ThemeDialog.d.ts +26 -0
  62. package/dist/components/dialog/ThemeDialog.js +1715 -0
  63. package/dist/components/dialog/ThemeDialog.js.map +1 -0
  64. package/dist/components/dialog/ThemeDialog.mjs +1689 -0
  65. package/dist/components/dialog/ThemeDialog.mjs.map +1 -0
  66. package/dist/components/dialog/index.d.mts +17 -0
  67. package/dist/components/dialog/index.d.ts +17 -0
  68. package/dist/components/dialog/index.js +2062 -0
  69. package/dist/components/dialog/index.js.map +1 -0
  70. package/dist/components/dialog/index.mjs +2031 -0
  71. package/dist/components/dialog/index.mjs.map +1 -0
  72. package/dist/components/form/FormElementWrapper.d.mts +29 -0
  73. package/dist/components/form/FormElementWrapper.d.ts +29 -0
  74. package/dist/components/form/FormElementWrapper.js +98 -0
  75. package/dist/components/form/FormElementWrapper.js.map +1 -0
  76. package/dist/components/form/FormElementWrapper.mjs +64 -0
  77. package/dist/components/form/FormElementWrapper.mjs.map +1 -0
  78. package/dist/components/icons-and-geometry/Avatar.js +498 -2886
  79. package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
  80. package/dist/components/icons-and-geometry/Avatar.mjs +490 -2878
  81. package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
  82. package/dist/components/icons-and-geometry/{Helpwave.d.mts → HelpwaveLogo.d.mts} +3 -3
  83. package/dist/components/icons-and-geometry/{Helpwave.d.ts → HelpwaveLogo.d.ts} +3 -3
  84. package/dist/components/icons-and-geometry/{Helpwave.js → HelpwaveLogo.js} +21 -22
  85. package/dist/components/icons-and-geometry/HelpwaveLogo.js.map +1 -0
  86. package/dist/components/icons-and-geometry/{Helpwave.mjs → HelpwaveLogo.mjs} +17 -18
  87. package/dist/components/icons-and-geometry/HelpwaveLogo.mjs.map +1 -0
  88. package/dist/components/icons-and-geometry/Ring.js +1 -1
  89. package/dist/components/icons-and-geometry/Ring.js.map +1 -1
  90. package/dist/components/icons-and-geometry/Ring.mjs +1 -1
  91. package/dist/components/icons-and-geometry/Ring.mjs.map +1 -1
  92. package/dist/components/icons-and-geometry/Tag.js +8 -20
  93. package/dist/components/icons-and-geometry/Tag.js.map +1 -1
  94. package/dist/components/icons-and-geometry/Tag.mjs +8 -20
  95. package/dist/components/icons-and-geometry/Tag.mjs.map +1 -1
  96. package/dist/components/layout-and-navigation/BreadCrumb.js +667 -22
  97. package/dist/components/layout-and-navigation/BreadCrumb.js.map +1 -1
  98. package/dist/components/layout-and-navigation/BreadCrumb.mjs +667 -22
  99. package/dist/components/layout-and-navigation/BreadCrumb.mjs.map +1 -1
  100. package/dist/components/layout-and-navigation/Carousel.js +52 -53
  101. package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
  102. package/dist/components/layout-and-navigation/Carousel.mjs +52 -53
  103. package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
  104. package/dist/components/layout-and-navigation/Chip.d.mts +8 -5
  105. package/dist/components/layout-and-navigation/Chip.d.ts +8 -5
  106. package/dist/components/layout-and-navigation/Chip.js +17 -4
  107. package/dist/components/layout-and-navigation/Chip.js.map +1 -1
  108. package/dist/components/layout-and-navigation/Chip.mjs +17 -4
  109. package/dist/components/layout-and-navigation/Chip.mjs.map +1 -1
  110. package/dist/components/layout-and-navigation/Expandable.d.mts +13 -10
  111. package/dist/components/layout-and-navigation/Expandable.d.ts +13 -10
  112. package/dist/components/layout-and-navigation/Expandable.js +18 -5
  113. package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
  114. package/dist/components/layout-and-navigation/Expandable.mjs +19 -6
  115. package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
  116. package/dist/components/layout-and-navigation/FAQSection.js +21 -8
  117. package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
  118. package/dist/components/layout-and-navigation/FAQSection.mjs +22 -9
  119. package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
  120. package/dist/components/layout-and-navigation/FloatingContainer.d.mts +38 -0
  121. package/dist/components/layout-and-navigation/FloatingContainer.d.ts +38 -0
  122. package/dist/components/layout-and-navigation/FloatingContainer.js +219 -0
  123. package/dist/components/layout-and-navigation/FloatingContainer.js.map +1 -0
  124. package/dist/components/layout-and-navigation/FloatingContainer.mjs +195 -0
  125. package/dist/components/layout-and-navigation/FloatingContainer.mjs.map +1 -0
  126. package/dist/components/layout-and-navigation/ListBox.d.mts +44 -0
  127. package/dist/components/layout-and-navigation/ListBox.d.ts +44 -0
  128. package/dist/components/layout-and-navigation/ListBox.js +329 -0
  129. package/dist/components/layout-and-navigation/ListBox.js.map +1 -0
  130. package/dist/components/layout-and-navigation/ListBox.mjs +290 -0
  131. package/dist/components/layout-and-navigation/ListBox.mjs.map +1 -0
  132. package/dist/components/layout-and-navigation/Pagination.js +142 -230
  133. package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
  134. package/dist/components/layout-and-navigation/Pagination.mjs +137 -225
  135. package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
  136. package/dist/components/layout-and-navigation/ScrollArea.d.mts +15 -0
  137. package/dist/components/layout-and-navigation/ScrollArea.d.ts +15 -0
  138. package/dist/components/layout-and-navigation/ScrollArea.js +1252 -0
  139. package/dist/components/layout-and-navigation/ScrollArea.js.map +1 -0
  140. package/dist/components/layout-and-navigation/ScrollArea.mjs +1216 -0
  141. package/dist/components/layout-and-navigation/ScrollArea.mjs.map +1 -0
  142. package/dist/components/layout-and-navigation/StepperBar.js +67 -30
  143. package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
  144. package/dist/components/layout-and-navigation/StepperBar.mjs +67 -30
  145. package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
  146. package/dist/components/layout-and-navigation/TextImage.js +3 -1
  147. package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
  148. package/dist/components/layout-and-navigation/TextImage.mjs +3 -1
  149. package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
  150. package/dist/components/loading-states/ErrorComponent.js.map +1 -1
  151. package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
  152. package/dist/components/loading-states/LoadingAndErrorComponent.d.mts +1 -1
  153. package/dist/components/loading-states/LoadingAndErrorComponent.d.ts +1 -1
  154. package/dist/components/loading-states/LoadingAnimation.js +18 -17
  155. package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
  156. package/dist/components/loading-states/LoadingAnimation.mjs +18 -17
  157. package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
  158. package/dist/components/loading-states/LoadingButton.js +81 -47
  159. package/dist/components/loading-states/LoadingButton.js.map +1 -1
  160. package/dist/components/loading-states/LoadingButton.mjs +81 -47
  161. package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
  162. package/dist/components/properties/CheckboxProperty.js +929 -153
  163. package/dist/components/properties/CheckboxProperty.js.map +1 -1
  164. package/dist/components/properties/CheckboxProperty.mjs +936 -160
  165. package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
  166. package/dist/components/properties/DateProperty.js +191 -241
  167. package/dist/components/properties/DateProperty.js.map +1 -1
  168. package/dist/components/properties/DateProperty.mjs +184 -234
  169. package/dist/components/properties/DateProperty.mjs.map +1 -1
  170. package/dist/components/properties/MultiSelectProperty.d.mts +5 -10
  171. package/dist/components/properties/MultiSelectProperty.d.ts +5 -10
  172. package/dist/components/properties/MultiSelectProperty.js +1193 -1189
  173. package/dist/components/properties/MultiSelectProperty.js.map +1 -1
  174. package/dist/components/properties/MultiSelectProperty.mjs +1207 -1193
  175. package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
  176. package/dist/components/properties/NumberProperty.js +193 -244
  177. package/dist/components/properties/NumberProperty.js.map +1 -1
  178. package/dist/components/properties/NumberProperty.mjs +186 -237
  179. package/dist/components/properties/NumberProperty.mjs.map +1 -1
  180. package/dist/components/properties/PropertyBase.js +91 -56
  181. package/dist/components/properties/PropertyBase.js.map +1 -1
  182. package/dist/components/properties/PropertyBase.mjs +91 -56
  183. package/dist/components/properties/PropertyBase.mjs.map +1 -1
  184. package/dist/components/properties/SelectProperty.d.mts +5 -8
  185. package/dist/components/properties/SelectProperty.d.ts +5 -8
  186. package/dist/components/properties/SelectProperty.js +1102 -897
  187. package/dist/components/properties/SelectProperty.js.map +1 -1
  188. package/dist/components/properties/SelectProperty.mjs +1107 -892
  189. package/dist/components/properties/SelectProperty.mjs.map +1 -1
  190. package/dist/components/properties/TextProperty.js +139 -147
  191. package/dist/components/properties/TextProperty.js.map +1 -1
  192. package/dist/components/properties/TextProperty.mjs +142 -150
  193. package/dist/components/properties/TextProperty.mjs.map +1 -1
  194. package/dist/components/table/Table.js +1639 -991
  195. package/dist/components/table/Table.js.map +1 -1
  196. package/dist/components/table/Table.mjs +1645 -997
  197. package/dist/components/table/Table.mjs.map +1 -1
  198. package/dist/components/table/TableFilterButton.js +156 -244
  199. package/dist/components/table/TableFilterButton.js.map +1 -1
  200. package/dist/components/table/TableFilterButton.mjs +145 -233
  201. package/dist/components/table/TableFilterButton.mjs.map +1 -1
  202. package/dist/components/table/TableSortButton.js +44 -46
  203. package/dist/components/table/TableSortButton.js.map +1 -1
  204. package/dist/components/table/TableSortButton.mjs +44 -46
  205. package/dist/components/table/TableSortButton.mjs.map +1 -1
  206. package/dist/components/user-action/Button.d.mts +17 -13
  207. package/dist/components/user-action/Button.d.ts +17 -13
  208. package/dist/components/user-action/Button.js +80 -87
  209. package/dist/components/user-action/Button.js.map +1 -1
  210. package/dist/components/user-action/Button.mjs +80 -87
  211. package/dist/components/user-action/Button.mjs.map +1 -1
  212. package/dist/components/user-action/Checkbox.d.mts +9 -25
  213. package/dist/components/user-action/Checkbox.d.ts +9 -25
  214. package/dist/components/user-action/Checkbox.js +794 -78
  215. package/dist/components/user-action/Checkbox.js.map +1 -1
  216. package/dist/components/user-action/Checkbox.mjs +795 -79
  217. package/dist/components/user-action/Checkbox.mjs.map +1 -1
  218. package/dist/components/user-action/CopyToClipboardWrapper.js +3 -1
  219. package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
  220. package/dist/components/user-action/CopyToClipboardWrapper.mjs +3 -1
  221. package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
  222. package/dist/components/user-action/DateAndTimePicker.d.mts +1 -1
  223. package/dist/components/user-action/DateAndTimePicker.d.ts +1 -1
  224. package/dist/components/user-action/DateAndTimePicker.js +108 -60
  225. package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
  226. package/dist/components/user-action/DateAndTimePicker.mjs +109 -61
  227. package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
  228. package/dist/components/user-action/Label.d.mts +6 -8
  229. package/dist/components/user-action/Label.d.ts +6 -8
  230. package/dist/components/user-action/Label.js +4 -6
  231. package/dist/components/user-action/Label.js.map +1 -1
  232. package/dist/components/user-action/Label.mjs +4 -6
  233. package/dist/components/user-action/Label.mjs.map +1 -1
  234. package/dist/components/user-action/Menu.d.mts +2 -2
  235. package/dist/components/user-action/Menu.d.ts +2 -2
  236. package/dist/components/user-action/Menu.js +1 -1
  237. package/dist/components/user-action/Menu.js.map +1 -1
  238. package/dist/components/user-action/Menu.mjs +1 -1
  239. package/dist/components/user-action/Menu.mjs.map +1 -1
  240. package/dist/components/user-action/ScrollPicker.js +8 -6
  241. package/dist/components/user-action/ScrollPicker.js.map +1 -1
  242. package/dist/components/user-action/ScrollPicker.mjs +8 -6
  243. package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
  244. package/dist/components/user-action/SearchBar.d.mts +1 -2
  245. package/dist/components/user-action/SearchBar.d.ts +1 -2
  246. package/dist/components/user-action/SearchBar.js +131 -219
  247. package/dist/components/user-action/SearchBar.js.map +1 -1
  248. package/dist/components/user-action/SearchBar.mjs +124 -212
  249. package/dist/components/user-action/SearchBar.mjs.map +1 -1
  250. package/dist/components/user-action/Textarea.d.mts +22 -11
  251. package/dist/components/user-action/Textarea.d.ts +22 -11
  252. package/dist/components/user-action/Textarea.js +101 -92
  253. package/dist/components/user-action/Textarea.js.map +1 -1
  254. package/dist/components/user-action/Textarea.mjs +100 -92
  255. package/dist/components/user-action/Textarea.mjs.map +1 -1
  256. package/dist/components/user-action/input/Input.d.mts +37 -0
  257. package/dist/components/user-action/input/Input.d.ts +37 -0
  258. package/dist/components/user-action/input/Input.js +244 -0
  259. package/dist/components/user-action/input/Input.js.map +1 -0
  260. package/dist/components/user-action/input/Input.mjs +209 -0
  261. package/dist/components/user-action/input/Input.mjs.map +1 -0
  262. package/dist/components/user-action/input/InsideLabelInput.d.mts +20 -0
  263. package/dist/components/user-action/input/InsideLabelInput.d.ts +20 -0
  264. package/dist/components/user-action/input/InsideLabelInput.js +295 -0
  265. package/dist/components/user-action/input/InsideLabelInput.js.map +1 -0
  266. package/dist/components/user-action/input/InsideLabelInput.mjs +260 -0
  267. package/dist/components/user-action/input/InsideLabelInput.mjs.map +1 -0
  268. package/dist/components/user-action/input/ToggleableInput.d.mts +22 -0
  269. package/dist/components/user-action/input/ToggleableInput.d.ts +22 -0
  270. package/dist/components/user-action/{Input.js → input/ToggleableInput.js} +136 -171
  271. package/dist/components/user-action/input/ToggleableInput.js.map +1 -0
  272. package/dist/components/user-action/input/ToggleableInput.mjs +264 -0
  273. package/dist/components/user-action/input/ToggleableInput.mjs.map +1 -0
  274. package/dist/components/user-action/select/Select.d.mts +98 -0
  275. package/dist/components/user-action/select/Select.d.ts +98 -0
  276. package/dist/components/user-action/select/Select.js +1354 -0
  277. package/dist/components/user-action/select/Select.js.map +1 -0
  278. package/dist/components/user-action/select/Select.mjs +1320 -0
  279. package/dist/components/user-action/select/Select.mjs.map +1 -0
  280. package/dist/components/utils/FocusTrap.d.mts +28 -0
  281. package/dist/components/utils/FocusTrap.d.ts +28 -0
  282. package/dist/components/utils/FocusTrap.js +252 -0
  283. package/dist/components/utils/FocusTrap.js.map +1 -0
  284. package/dist/components/utils/FocusTrap.mjs +229 -0
  285. package/dist/components/utils/FocusTrap.mjs.map +1 -0
  286. package/dist/components/utils/Transition.d.mts +26 -0
  287. package/dist/components/utils/Transition.d.ts +26 -0
  288. package/dist/components/utils/Transition.js +74 -0
  289. package/dist/components/utils/Transition.js.map +1 -0
  290. package/dist/components/utils/Transition.mjs +50 -0
  291. package/dist/components/utils/Transition.mjs.map +1 -0
  292. package/dist/hooks/focus/useFocusGuards.d.mts +3 -0
  293. package/dist/hooks/focus/useFocusGuards.d.ts +3 -0
  294. package/dist/hooks/focus/useFocusGuards.js +74 -0
  295. package/dist/hooks/focus/useFocusGuards.js.map +1 -0
  296. package/dist/hooks/focus/useFocusGuards.mjs +50 -0
  297. package/dist/hooks/focus/useFocusGuards.mjs.map +1 -0
  298. package/dist/hooks/{useFocusManagement.js → focus/useFocusManagement.js} +1 -1
  299. package/dist/hooks/focus/useFocusManagement.js.map +1 -0
  300. package/dist/hooks/{useFocusManagement.mjs → focus/useFocusManagement.mjs} +1 -1
  301. package/dist/hooks/focus/useFocusManagement.mjs.map +1 -0
  302. package/dist/hooks/{useFocusOnceVisible.js → focus/useFocusOnceVisible.js} +1 -1
  303. package/dist/hooks/focus/useFocusOnceVisible.js.map +1 -0
  304. package/dist/hooks/{useFocusOnceVisible.mjs → focus/useFocusOnceVisible.mjs} +1 -1
  305. package/dist/hooks/focus/useFocusOnceVisible.mjs.map +1 -0
  306. package/dist/hooks/focus/useFocusTrap.d.mts +16 -0
  307. package/dist/hooks/focus/useFocusTrap.d.ts +16 -0
  308. package/dist/hooks/focus/useFocusTrap.js +233 -0
  309. package/dist/hooks/focus/useFocusTrap.js.map +1 -0
  310. package/dist/hooks/focus/useFocusTrap.mjs +210 -0
  311. package/dist/hooks/focus/useFocusTrap.mjs.map +1 -0
  312. package/dist/hooks/focus/useIsMounted.d.mts +3 -0
  313. package/dist/hooks/focus/useIsMounted.d.ts +3 -0
  314. package/dist/hooks/focus/useIsMounted.js +43 -0
  315. package/dist/hooks/focus/useIsMounted.js.map +1 -0
  316. package/dist/hooks/focus/useIsMounted.mjs +20 -0
  317. package/dist/hooks/focus/useIsMounted.mjs.map +1 -0
  318. package/dist/hooks/useFloatingElement.d.mts +22 -0
  319. package/dist/hooks/useFloatingElement.d.ts +22 -0
  320. package/dist/hooks/useFloatingElement.js +162 -0
  321. package/dist/hooks/useFloatingElement.js.map +1 -0
  322. package/dist/hooks/useFloatingElement.mjs +139 -0
  323. package/dist/hooks/useFloatingElement.mjs.map +1 -0
  324. package/dist/hooks/useLocalStorage.js +2 -2
  325. package/dist/hooks/useLocalStorage.js.map +1 -1
  326. package/dist/hooks/useLocalStorage.mjs +2 -2
  327. package/dist/hooks/useLocalStorage.mjs.map +1 -1
  328. package/dist/hooks/useLogOnce.d.mts +3 -4
  329. package/dist/hooks/useLogOnce.d.ts +3 -4
  330. package/dist/hooks/useLogOnce.js +5 -5
  331. package/dist/hooks/useLogOnce.js.map +1 -1
  332. package/dist/hooks/useLogOnce.mjs +5 -5
  333. package/dist/hooks/useLogOnce.mjs.map +1 -1
  334. package/dist/hooks/useRerender.d.mts +2 -2
  335. package/dist/hooks/useRerender.d.ts +2 -2
  336. package/dist/hooks/useSearch.d.mts +2 -2
  337. package/dist/hooks/useSearch.d.ts +2 -2
  338. package/dist/hooks/useSearch.js +1 -1
  339. package/dist/hooks/useSearch.js.map +1 -1
  340. package/dist/hooks/useSearch.mjs +1 -1
  341. package/dist/hooks/useSearch.mjs.map +1 -1
  342. package/dist/localization/LanguageProvider.d.mts +2 -2
  343. package/dist/localization/LanguageProvider.d.ts +2 -2
  344. package/dist/localization/LanguageProvider.js +2 -2
  345. package/dist/localization/LanguageProvider.js.map +1 -1
  346. package/dist/localization/LanguageProvider.mjs +2 -2
  347. package/dist/localization/LanguageProvider.mjs.map +1 -1
  348. package/dist/localization/defaults/form.d.mts +1 -0
  349. package/dist/localization/defaults/form.d.ts +1 -0
  350. package/dist/localization/defaults/form.js +2 -0
  351. package/dist/localization/defaults/form.js.map +1 -1
  352. package/dist/localization/defaults/form.mjs +2 -0
  353. package/dist/localization/defaults/form.mjs.map +1 -1
  354. package/dist/localization/useTranslation.js.map +1 -1
  355. package/dist/localization/useTranslation.mjs.map +1 -1
  356. package/dist/storybook/helper.d.mts +17 -0
  357. package/dist/storybook/helper.d.ts +17 -0
  358. package/dist/storybook/helper.js +61 -0
  359. package/dist/storybook/helper.js.map +1 -0
  360. package/dist/storybook/helper.mjs +37 -0
  361. package/dist/storybook/helper.mjs.map +1 -0
  362. package/dist/{css → style}/globals.css +994 -456
  363. package/dist/{css → style}/uncompiled/globals.css +75 -13
  364. package/dist/{css → style}/uncompiled/theme/colors-component.css +18 -4
  365. package/dist/{css → style}/uncompiled/theme/colors-semantic.css +2 -9
  366. package/dist/style/uncompiled/typography.css +171 -0
  367. package/dist/{css → style}/uncompiled/utitlity/animation.css +54 -42
  368. package/dist/{css → style}/uncompiled/utitlity/index.css +2 -1
  369. package/dist/{css → style}/uncompiled/utitlity/shadow.css +5 -1
  370. package/dist/style/uncompiled/utitlity/sizing.css +29 -0
  371. package/dist/theming/useTheme.d.mts +2 -2
  372. package/dist/theming/useTheme.d.ts +2 -2
  373. package/dist/theming/useTheme.js +4 -4
  374. package/dist/theming/useTheme.js.map +1 -1
  375. package/dist/theming/useTheme.mjs +4 -4
  376. package/dist/theming/useTheme.mjs.map +1 -1
  377. package/dist/{util → utils}/array.d.mts +1 -0
  378. package/dist/{util → utils}/array.d.ts +1 -0
  379. package/dist/{util → utils}/array.js +15 -2
  380. package/dist/utils/array.js.map +1 -0
  381. package/dist/{util → utils}/array.mjs +15 -2
  382. package/dist/utils/array.mjs.map +1 -0
  383. package/dist/utils/bagFunctions.d.mts +15 -0
  384. package/dist/utils/bagFunctions.d.ts +15 -0
  385. package/dist/{util/PropsWithFunctionChildren.js → utils/bagFunctions.js} +5 -5
  386. package/dist/utils/bagFunctions.js.map +1 -0
  387. package/dist/{util/PropsWithFunctionChildren.mjs → utils/bagFunctions.mjs} +2 -2
  388. package/dist/utils/bagFunctions.mjs.map +1 -0
  389. package/dist/{util → utils}/builder.js +1 -1
  390. package/dist/utils/builder.js.map +1 -0
  391. package/dist/{util → utils}/builder.mjs +1 -1
  392. package/dist/utils/builder.mjs.map +1 -0
  393. package/dist/{util → utils}/date.js +3 -3
  394. package/dist/utils/date.js.map +1 -0
  395. package/dist/{util → utils}/date.mjs +2 -2
  396. package/dist/utils/date.mjs.map +1 -0
  397. package/dist/{util → utils}/easeFunctions.js +5 -4
  398. package/dist/utils/easeFunctions.js.map +1 -0
  399. package/dist/{util → utils}/easeFunctions.mjs +4 -3
  400. package/dist/utils/easeFunctions.mjs.map +1 -0
  401. package/dist/{util → utils}/emailValidation.js +1 -1
  402. package/dist/utils/emailValidation.js.map +1 -0
  403. package/dist/{util → utils}/emailValidation.mjs +1 -1
  404. package/dist/utils/emailValidation.mjs.map +1 -0
  405. package/dist/{util → utils}/loopingArray.js +1 -1
  406. package/dist/utils/loopingArray.js.map +1 -0
  407. package/dist/{util → utils}/loopingArray.mjs +1 -1
  408. package/dist/utils/loopingArray.mjs.map +1 -0
  409. package/dist/utils/match.d.mts +3 -0
  410. package/dist/utils/match.d.ts +3 -0
  411. package/dist/utils/match.js +32 -0
  412. package/dist/utils/match.js.map +1 -0
  413. package/dist/utils/match.mjs +8 -0
  414. package/dist/utils/match.mjs.map +1 -0
  415. package/dist/utils/math.d.mts +3 -0
  416. package/dist/utils/math.d.ts +3 -0
  417. package/dist/{util → utils}/math.js +3 -2
  418. package/dist/utils/math.js.map +1 -0
  419. package/dist/utils/math.mjs +9 -0
  420. package/dist/utils/math.mjs.map +1 -0
  421. package/dist/{util → utils}/noop.js +1 -1
  422. package/dist/utils/noop.js.map +1 -0
  423. package/dist/utils/noop.mjs +6 -0
  424. package/dist/utils/noop.mjs.map +1 -0
  425. package/dist/{util → utils}/resolveSetState.js +1 -1
  426. package/dist/utils/resolveSetState.js.map +1 -0
  427. package/dist/{util → utils}/resolveSetState.mjs +1 -1
  428. package/dist/utils/resolveSetState.mjs.map +1 -0
  429. package/dist/{util → utils}/simpleSearch.js +1 -1
  430. package/dist/utils/simpleSearch.js.map +1 -0
  431. package/dist/{util → utils}/simpleSearch.mjs +1 -1
  432. package/dist/utils/simpleSearch.mjs.map +1 -0
  433. package/dist/{util → utils}/storage.js +1 -1
  434. package/dist/utils/storage.js.map +1 -0
  435. package/dist/{util → utils}/storage.mjs +1 -1
  436. package/dist/utils/storage.mjs.map +1 -0
  437. package/dist/{util → utils}/writeToClipboard.js +2 -1
  438. package/dist/utils/writeToClipboard.js.map +1 -0
  439. package/dist/{util → utils}/writeToClipboard.mjs +3 -1
  440. package/dist/utils/writeToClipboard.mjs.map +1 -0
  441. package/package.json +8 -8
  442. package/dist/components/dialogs/ConfirmDialog.js +0 -677
  443. package/dist/components/dialogs/ConfirmDialog.js.map +0 -1
  444. package/dist/components/dialogs/ConfirmDialog.mjs +0 -641
  445. package/dist/components/dialogs/ConfirmDialog.mjs.map +0 -1
  446. package/dist/components/icons-and-geometry/Helpwave.js.map +0 -1
  447. package/dist/components/icons-and-geometry/Helpwave.mjs.map +0 -1
  448. package/dist/components/layout-and-navigation/Overlay.d.mts +0 -67
  449. package/dist/components/layout-and-navigation/Overlay.d.ts +0 -67
  450. package/dist/components/layout-and-navigation/Overlay.js +0 -705
  451. package/dist/components/layout-and-navigation/Overlay.js.map +0 -1
  452. package/dist/components/layout-and-navigation/Overlay.mjs +0 -668
  453. package/dist/components/layout-and-navigation/Overlay.mjs.map +0 -1
  454. package/dist/components/layout-and-navigation/SearchableList.d.mts +0 -24
  455. package/dist/components/layout-and-navigation/SearchableList.d.ts +0 -24
  456. package/dist/components/layout-and-navigation/SearchableList.js +0 -761
  457. package/dist/components/layout-and-navigation/SearchableList.js.map +0 -1
  458. package/dist/components/layout-and-navigation/SearchableList.mjs +0 -727
  459. package/dist/components/layout-and-navigation/SearchableList.mjs.map +0 -1
  460. package/dist/components/layout-and-navigation/Tile.d.mts +0 -27
  461. package/dist/components/layout-and-navigation/Tile.d.ts +0 -27
  462. package/dist/components/layout-and-navigation/Tile.js +0 -96
  463. package/dist/components/layout-and-navigation/Tile.js.map +0 -1
  464. package/dist/components/layout-and-navigation/Tile.mjs +0 -61
  465. package/dist/components/layout-and-navigation/Tile.mjs.map +0 -1
  466. package/dist/components/modals/ConfirmModal.d.mts +0 -33
  467. package/dist/components/modals/ConfirmModal.d.ts +0 -33
  468. package/dist/components/modals/ConfirmModal.js +0 -690
  469. package/dist/components/modals/ConfirmModal.js.map +0 -1
  470. package/dist/components/modals/ConfirmModal.mjs +0 -654
  471. package/dist/components/modals/ConfirmModal.mjs.map +0 -1
  472. package/dist/components/modals/DiscardChangesModal.d.mts +0 -20
  473. package/dist/components/modals/DiscardChangesModal.d.ts +0 -20
  474. package/dist/components/modals/DiscardChangesModal.js +0 -720
  475. package/dist/components/modals/DiscardChangesModal.js.map +0 -1
  476. package/dist/components/modals/DiscardChangesModal.mjs +0 -684
  477. package/dist/components/modals/DiscardChangesModal.mjs.map +0 -1
  478. package/dist/components/modals/InputModal.d.mts +0 -21
  479. package/dist/components/modals/InputModal.d.ts +0 -21
  480. package/dist/components/modals/InputModal.js +0 -979
  481. package/dist/components/modals/InputModal.js.map +0 -1
  482. package/dist/components/modals/InputModal.mjs +0 -943
  483. package/dist/components/modals/InputModal.mjs.map +0 -1
  484. package/dist/components/modals/LanguageModal.d.mts +0 -21
  485. package/dist/components/modals/LanguageModal.d.ts +0 -21
  486. package/dist/components/modals/LanguageModal.js +0 -1474
  487. package/dist/components/modals/LanguageModal.js.map +0 -1
  488. package/dist/components/modals/LanguageModal.mjs +0 -1438
  489. package/dist/components/modals/LanguageModal.mjs.map +0 -1
  490. package/dist/components/modals/ThemeModal.d.mts +0 -21
  491. package/dist/components/modals/ThemeModal.d.ts +0 -21
  492. package/dist/components/modals/ThemeModal.js +0 -1503
  493. package/dist/components/modals/ThemeModal.js.map +0 -1
  494. package/dist/components/modals/ThemeModal.mjs +0 -1467
  495. package/dist/components/modals/ThemeModal.mjs.map +0 -1
  496. package/dist/components/user-action/Input.d.mts +0 -77
  497. package/dist/components/user-action/Input.d.ts +0 -77
  498. package/dist/components/user-action/Input.js.map +0 -1
  499. package/dist/components/user-action/Input.mjs +0 -298
  500. package/dist/components/user-action/Input.mjs.map +0 -1
  501. package/dist/components/user-action/MultiSelect.d.mts +0 -42
  502. package/dist/components/user-action/MultiSelect.d.ts +0 -42
  503. package/dist/components/user-action/MultiSelect.js +0 -1445
  504. package/dist/components/user-action/MultiSelect.js.map +0 -1
  505. package/dist/components/user-action/MultiSelect.mjs +0 -1410
  506. package/dist/components/user-action/MultiSelect.mjs.map +0 -1
  507. package/dist/components/user-action/Select.d.mts +0 -41
  508. package/dist/components/user-action/Select.d.ts +0 -41
  509. package/dist/components/user-action/Select.js +0 -1242
  510. package/dist/components/user-action/Select.js.map +0 -1
  511. package/dist/components/user-action/Select.mjs +0 -1207
  512. package/dist/components/user-action/Select.mjs.map +0 -1
  513. package/dist/components/user-action/ToggleableInput.d.mts +0 -37
  514. package/dist/components/user-action/ToggleableInput.d.ts +0 -37
  515. package/dist/components/user-action/ToggleableInput.js +0 -192
  516. package/dist/components/user-action/ToggleableInput.js.map +0 -1
  517. package/dist/components/user-action/ToggleableInput.mjs +0 -157
  518. package/dist/components/user-action/ToggleableInput.mjs.map +0 -1
  519. package/dist/css/uncompiled/textstyles.css +0 -69
  520. package/dist/hooks/useFocusManagement.js.map +0 -1
  521. package/dist/hooks/useFocusManagement.mjs.map +0 -1
  522. package/dist/hooks/useFocusOnceVisible.js.map +0 -1
  523. package/dist/hooks/useFocusOnceVisible.mjs.map +0 -1
  524. package/dist/index.d.mts +0 -103
  525. package/dist/index.d.ts +0 -103
  526. package/dist/index.js +0 -12595
  527. package/dist/index.js.map +0 -1
  528. package/dist/index.mjs +0 -12432
  529. package/dist/index.mjs.map +0 -1
  530. package/dist/util/PropsWithFunctionChildren.d.mts +0 -14
  531. package/dist/util/PropsWithFunctionChildren.d.ts +0 -14
  532. package/dist/util/PropsWithFunctionChildren.js.map +0 -1
  533. package/dist/util/PropsWithFunctionChildren.mjs.map +0 -1
  534. package/dist/util/array.js.map +0 -1
  535. package/dist/util/array.mjs.map +0 -1
  536. package/dist/util/builder.js.map +0 -1
  537. package/dist/util/builder.mjs.map +0 -1
  538. package/dist/util/date.js.map +0 -1
  539. package/dist/util/date.mjs.map +0 -1
  540. package/dist/util/easeFunctions.js.map +0 -1
  541. package/dist/util/easeFunctions.mjs.map +0 -1
  542. package/dist/util/emailValidation.js.map +0 -1
  543. package/dist/util/emailValidation.mjs.map +0 -1
  544. package/dist/util/loopingArray.js.map +0 -1
  545. package/dist/util/loopingArray.mjs.map +0 -1
  546. package/dist/util/math.d.mts +0 -3
  547. package/dist/util/math.d.ts +0 -3
  548. package/dist/util/math.js.map +0 -1
  549. package/dist/util/math.mjs +0 -8
  550. package/dist/util/math.mjs.map +0 -1
  551. package/dist/util/news.d.mts +0 -101
  552. package/dist/util/news.d.ts +0 -101
  553. package/dist/util/news.js +0 -76
  554. package/dist/util/news.js.map +0 -1
  555. package/dist/util/news.mjs +0 -49
  556. package/dist/util/news.mjs.map +0 -1
  557. package/dist/util/noop.js.map +0 -1
  558. package/dist/util/noop.mjs +0 -6
  559. package/dist/util/noop.mjs.map +0 -1
  560. package/dist/util/resolveSetState.js.map +0 -1
  561. package/dist/util/resolveSetState.mjs.map +0 -1
  562. package/dist/util/simpleSearch.js.map +0 -1
  563. package/dist/util/simpleSearch.mjs.map +0 -1
  564. package/dist/util/storage.js.map +0 -1
  565. package/dist/util/storage.mjs.map +0 -1
  566. package/dist/util/types.d.mts +0 -3
  567. package/dist/util/types.d.ts +0 -3
  568. package/dist/util/types.js +0 -18
  569. package/dist/util/types.js.map +0 -1
  570. package/dist/util/types.mjs +0 -1
  571. package/dist/util/types.mjs.map +0 -1
  572. package/dist/util/writeToClipboard.js.map +0 -1
  573. package/dist/util/writeToClipboard.mjs.map +0 -1
  574. /package/dist/hooks/{useFocusManagement.d.mts → focus/useFocusManagement.d.mts} +0 -0
  575. /package/dist/hooks/{useFocusManagement.d.ts → focus/useFocusManagement.d.ts} +0 -0
  576. /package/dist/hooks/{useFocusOnceVisible.d.mts → focus/useFocusOnceVisible.d.mts} +0 -0
  577. /package/dist/hooks/{useFocusOnceVisible.d.ts → focus/useFocusOnceVisible.d.ts} +0 -0
  578. /package/dist/{css → style}/uncompiled/theme/colors-basic.css +0 -0
  579. /package/dist/{css → style}/uncompiled/theme/index.css +0 -0
  580. /package/dist/{css → style}/uncompiled/theme/variants.css +0 -0
  581. /package/dist/{css → style}/uncompiled/utitlity/borderradius.css +0 -0
  582. /package/dist/{css → style}/uncompiled/utitlity/general.css +0 -0
  583. /package/dist/{util → utils}/builder.d.mts +0 -0
  584. /package/dist/{util → utils}/builder.d.ts +0 -0
  585. /package/dist/{util → utils}/date.d.mts +0 -0
  586. /package/dist/{util → utils}/date.d.ts +0 -0
  587. /package/dist/{util → utils}/easeFunctions.d.mts +0 -0
  588. /package/dist/{util → utils}/easeFunctions.d.ts +0 -0
  589. /package/dist/{util → utils}/emailValidation.d.mts +0 -0
  590. /package/dist/{util → utils}/emailValidation.d.ts +0 -0
  591. /package/dist/{util → utils}/loopingArray.d.mts +0 -0
  592. /package/dist/{util → utils}/loopingArray.d.ts +0 -0
  593. /package/dist/{util → utils}/noop.d.mts +0 -0
  594. /package/dist/{util → utils}/noop.d.ts +0 -0
  595. /package/dist/{util → utils}/resolveSetState.d.mts +0 -0
  596. /package/dist/{util → utils}/resolveSetState.d.ts +0 -0
  597. /package/dist/{util → utils}/simpleSearch.d.mts +0 -0
  598. /package/dist/{util → utils}/simpleSearch.d.ts +0 -0
  599. /package/dist/{util → utils}/storage.d.mts +0 -0
  600. /package/dist/{util → utils}/storage.d.ts +0 -0
  601. /package/dist/{util → utils}/writeToClipboard.d.mts +0 -0
  602. /package/dist/{util → utils}/writeToClipboard.d.ts +0 -0
@@ -0,0 +1,2062 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/dialog/index.ts
30
+ var dialog_exports = {};
31
+ __export(dialog_exports, {
32
+ ConfirmDialog: () => ConfirmDialog,
33
+ Dialog: () => Dialog,
34
+ DiscardChangesDialog: () => DiscardChangesDialog,
35
+ InputDialog: () => InputDialog,
36
+ LanguageDialog: () => LanguageDialog,
37
+ ThemeDialog: () => ThemeDialog
38
+ });
39
+ module.exports = __toCommonJS(dialog_exports);
40
+
41
+ // src/components/user-action/Button.tsx
42
+ var import_react = require("react");
43
+ var import_clsx = __toESM(require("clsx"));
44
+ var import_jsx_runtime = require("react/jsx-runtime");
45
+ var ButtonColorUtil = {
46
+ solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
47
+ text: ["primary", "negative", "neutral"],
48
+ outline: ["primary"]
49
+ };
50
+ var IconButtonUtil = {
51
+ icon: [...ButtonColorUtil.solid, "transparent"]
52
+ };
53
+ var paddingMapping = {
54
+ small: "btn-sm",
55
+ medium: "btn-md",
56
+ large: "btn-lg"
57
+ };
58
+ var iconPaddingMapping = {
59
+ tiny: "icon-btn-xs",
60
+ small: "icon-btn-sm",
61
+ medium: "icon-btn-md",
62
+ large: "icon-btn-lg"
63
+ };
64
+ var ButtonUtil = {
65
+ paddingMapping,
66
+ iconPaddingMapping
67
+ };
68
+ var SolidButton = (0, import_react.forwardRef)(function SolidButton2({
69
+ children,
70
+ color = "primary",
71
+ size = "medium",
72
+ startIcon,
73
+ endIcon,
74
+ onClick,
75
+ className,
76
+ ...restProps
77
+ }, ref) {
78
+ const colorClasses = {
79
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
80
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
81
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
82
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
83
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
84
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
85
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text"
86
+ }[color];
87
+ const iconColorClasses = {
88
+ primary: "not-group-disabled:text-button-solid-primary-icon",
89
+ secondary: "not-group-disabled:text-button-solid-secondary-icon",
90
+ tertiary: "not-group-disabled:text-button-solid-tertiary-icon",
91
+ positive: "not-group-disabled:text-button-solid-positive-icon",
92
+ warning: "not-group-disabled:text-button-solid-warning-icon",
93
+ negative: "not-group-disabled:text-button-solid-negative-icon",
94
+ neutral: "not-group-disabled:text-button-solid-neutral-icon"
95
+ }[color];
96
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
97
+ "button",
98
+ {
99
+ ref,
100
+ onClick,
101
+ className: (0, import_clsx.default)(
102
+ "group font-semibold",
103
+ colorClasses,
104
+ "not-disabled:hover:brightness-90",
105
+ "disabled:text-disabled-text disabled:bg-disabled-background",
106
+ ButtonUtil.paddingMapping[size],
107
+ className
108
+ ),
109
+ ...restProps,
110
+ children: [
111
+ startIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
112
+ "span",
113
+ {
114
+ className: (0, import_clsx.default)(
115
+ iconColorClasses,
116
+ "group-disabled:text-disabled-icon"
117
+ ),
118
+ children: startIcon
119
+ }
120
+ ),
121
+ children,
122
+ endIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
123
+ "span",
124
+ {
125
+ className: (0, import_clsx.default)(
126
+ iconColorClasses,
127
+ "group-disabled:text-disabled-icon"
128
+ ),
129
+ children: endIcon
130
+ }
131
+ )
132
+ ]
133
+ }
134
+ );
135
+ });
136
+ var IconButton = (0, import_react.forwardRef)(function IconButton2({
137
+ children,
138
+ color = "primary",
139
+ size = "medium",
140
+ className,
141
+ ...restProps
142
+ }, ref) {
143
+ const colorClasses = {
144
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
145
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
146
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
147
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
148
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
149
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
150
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text",
151
+ transparent: "not-disabled:bg-transparent"
152
+ }[color];
153
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
154
+ "button",
155
+ {
156
+ ref,
157
+ className: (0, import_clsx.default)(
158
+ colorClasses,
159
+ "not-disabled:hover:brightness-90",
160
+ "disabled:text-disabled-text",
161
+ {
162
+ "disabled:bg-disabled-background": color !== "transparent",
163
+ "disabled:opacity-70": color === "transparent",
164
+ "not-disabled:hover:bg-button-text-hover-background": color === "transparent"
165
+ },
166
+ ButtonUtil.iconPaddingMapping[size],
167
+ className
168
+ ),
169
+ ...restProps,
170
+ children
171
+ }
172
+ );
173
+ });
174
+
175
+ // src/localization/LanguageProvider.tsx
176
+ var import_react3 = require("react");
177
+
178
+ // src/hooks/useLocalStorage.ts
179
+ var import_react2 = require("react");
180
+
181
+ // src/localization/util.ts
182
+ var languages = ["en", "de"];
183
+ var languagesLocalNames = {
184
+ en: "English",
185
+ de: "Deutsch"
186
+ };
187
+ var DEFAULT_LANGUAGE = "en";
188
+ var LanguageUtil = {
189
+ languages,
190
+ DEFAULT_LANGUAGE,
191
+ languagesLocalNames
192
+ };
193
+
194
+ // src/localization/LanguageProvider.tsx
195
+ var import_jsx_runtime2 = require("react/jsx-runtime");
196
+ var LanguageContext = (0, import_react3.createContext)({
197
+ language: LanguageUtil.DEFAULT_LANGUAGE,
198
+ setLanguage: (v) => v
199
+ });
200
+ var useLanguage = () => (0, import_react3.useContext)(LanguageContext);
201
+
202
+ // src/localization/useTranslation.ts
203
+ var TranslationPluralCount = {
204
+ zero: 0,
205
+ one: 1,
206
+ two: 2,
207
+ few: 3,
208
+ many: 11,
209
+ other: -1
210
+ };
211
+ var useTranslation = (translations, overwriteTranslation = {}) => {
212
+ const { language: languageProp, translation: overwrite } = overwriteTranslation;
213
+ const { language: inferredLanguage } = useLanguage();
214
+ const usedLanguage = languageProp ?? inferredLanguage;
215
+ const usedTranslations = [...translations];
216
+ if (overwrite) {
217
+ usedTranslations.push(overwrite);
218
+ }
219
+ return (key, options) => {
220
+ const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options };
221
+ try {
222
+ for (let i = translations.length - 1; i >= 0; i--) {
223
+ const translation = translations[i];
224
+ const localizedTranslation = translation[usedLanguage];
225
+ if (!localizedTranslation) {
226
+ continue;
227
+ }
228
+ const value = localizedTranslation[key];
229
+ if (!value) {
230
+ continue;
231
+ }
232
+ let forProcessing;
233
+ if (typeof value !== "string") {
234
+ if (count === TranslationPluralCount.zero && value?.zero) {
235
+ forProcessing = value.zero;
236
+ } else if (count === TranslationPluralCount.one && value?.one) {
237
+ forProcessing = value.one;
238
+ } else if (count === TranslationPluralCount.two && value?.two) {
239
+ forProcessing = value.two;
240
+ } else if (TranslationPluralCount.few <= count && count < TranslationPluralCount.many && value?.few) {
241
+ forProcessing = value.few;
242
+ } else if (count > TranslationPluralCount.many && value?.many) {
243
+ forProcessing = value.many;
244
+ } else {
245
+ forProcessing = value.other;
246
+ }
247
+ } else {
248
+ forProcessing = value;
249
+ }
250
+ forProcessing = forProcessing.replace(/\{\{(\w+)}}/g, (_, placeholder) => {
251
+ return replacements[placeholder] ?? `{{key:${placeholder}}}`;
252
+ });
253
+ return forProcessing;
254
+ }
255
+ } catch (e) {
256
+ console.error(e);
257
+ }
258
+ return `{{${usedLanguage}:${key}}}`;
259
+ };
260
+ };
261
+
262
+ // src/components/dialog/ConfirmDialog.tsx
263
+ var import_clsx4 = __toESM(require("clsx"));
264
+
265
+ // src/components/dialog/Dialog.tsx
266
+ var import_react9 = require("react");
267
+ var import_clsx3 = __toESM(require("clsx"));
268
+ var import_lucide_react = require("lucide-react");
269
+
270
+ // src/localization/defaults/form.ts
271
+ var formTranslation = {
272
+ en: {
273
+ add: "Add",
274
+ all: "All",
275
+ apply: "Apply",
276
+ back: "Back",
277
+ cancel: "Cancel",
278
+ change: "Change",
279
+ clear: "Clear",
280
+ click: "Click",
281
+ clickToCopy: "Click to Copy",
282
+ close: "Close",
283
+ confirm: "Confirm",
284
+ copy: "Copy",
285
+ copied: "Copied",
286
+ create: "Create",
287
+ decline: "Decline",
288
+ delete: "Delete",
289
+ discard: "Discard",
290
+ discardChanges: "Discard Changes",
291
+ done: "Done",
292
+ edit: "Edit",
293
+ enterText: "Enter text here",
294
+ error: "Error",
295
+ exit: "Exit",
296
+ fieldRequiredError: "This field is required.",
297
+ invalidEmailError: "Please enter a valid email address.",
298
+ less: "Less",
299
+ loading: "Loading",
300
+ maxLengthError: "Maximum length exceeded.",
301
+ minLengthError: "Minimum length not met.",
302
+ more: "More",
303
+ next: "Next",
304
+ no: "No",
305
+ none: "None",
306
+ nothingFound: "Nothing found",
307
+ of: "of",
308
+ optional: "Optional",
309
+ pleaseWait: "Please wait...",
310
+ previous: "Previous",
311
+ remove: "Remove",
312
+ required: "Required",
313
+ reset: "Reset",
314
+ save: "Save",
315
+ saved: "Saved",
316
+ search: "Search",
317
+ select: "Select",
318
+ selectOption: "Select an option",
319
+ show: "Show",
320
+ showMore: "Show more",
321
+ showLess: "Show less",
322
+ submit: "Submit",
323
+ success: "Success",
324
+ update: "Update",
325
+ unsavedChanges: "Unsaved Changes",
326
+ unsavedChangesSaveQuestion: "Do you want to save your changes?",
327
+ yes: "Yes"
328
+ },
329
+ de: {
330
+ add: "Hinzuf\xFCgen",
331
+ all: "Alle",
332
+ apply: "Anwenden",
333
+ back: "Zur\xFCck",
334
+ cancel: "Abbrechen",
335
+ change: "\xC4ndern",
336
+ clear: "L\xF6schen",
337
+ click: "Klicken",
338
+ clickToCopy: "Zum kopieren klicken",
339
+ close: "Schlie\xDFen",
340
+ confirm: "Best\xE4tigen",
341
+ copy: "Kopieren",
342
+ copied: "Kopiert",
343
+ create: "Erstellen",
344
+ decline: "Ablehnen",
345
+ delete: "L\xF6schen",
346
+ discard: "Verwerfen",
347
+ discardChanges: "\xC4nderungen Verwerfen",
348
+ done: "Fertig",
349
+ edit: "Bearbeiten",
350
+ enterText: "Text hier eingeben",
351
+ error: "Fehler",
352
+ exit: "Beenden",
353
+ fieldRequiredError: "Dieses Feld ist erforderlich.",
354
+ invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
355
+ less: "Weniger",
356
+ loading: "L\xE4dt",
357
+ maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
358
+ minLengthError: "Mindestl\xE4nge nicht erreicht.",
359
+ more: "Mehr",
360
+ next: "Weiter",
361
+ no: "Nein",
362
+ none: "Nichts",
363
+ nothingFound: "Nichts gefunden",
364
+ of: "von",
365
+ optional: "Optional",
366
+ pleaseWait: "Bitte warten...",
367
+ previous: "Vorherige",
368
+ remove: "Entfernen",
369
+ required: "Erforderlich",
370
+ reset: "Zur\xFCcksetzen",
371
+ save: "Speichern",
372
+ saved: "Gespeichert",
373
+ search: "Suche",
374
+ select: "Select",
375
+ selectOption: "Option ausw\xE4hlen",
376
+ show: "Anzeigen",
377
+ showMore: "Mehr anzeigen",
378
+ showLess: "Weniger anzeigen",
379
+ submit: "Abschicken",
380
+ success: "Erfolg",
381
+ update: "Update",
382
+ unsavedChanges: "Ungespeicherte \xC4nderungen",
383
+ unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
384
+ yes: "Ja"
385
+ }
386
+ };
387
+
388
+ // src/components/layout-and-navigation/FloatingContainer.tsx
389
+ var import_react6 = require("react");
390
+ var import_react_dom = require("react-dom");
391
+ var import_clsx2 = require("clsx");
392
+
393
+ // src/hooks/useFloatingElement.ts
394
+ var import_react5 = require("react");
395
+
396
+ // src/utils/math.ts
397
+ var clamp = (value, range = [0, 1]) => {
398
+ const [min, max] = range;
399
+ return Math.min(Math.max(value, min), max);
400
+ };
401
+
402
+ // src/hooks/focus/useIsMounted.ts
403
+ var import_react4 = require("react");
404
+ var isClient = typeof window !== "undefined" && typeof document !== "undefined";
405
+ var useIsomorphicEffect = isClient ? import_react4.useLayoutEffect : import_react4.useEffect;
406
+ var useIsMounted = () => {
407
+ const [isMounted, setIsMounted] = (0, import_react4.useState)(false);
408
+ useIsomorphicEffect(() => {
409
+ setIsMounted(true);
410
+ return () => {
411
+ setIsMounted(false);
412
+ };
413
+ }, []);
414
+ return isMounted;
415
+ };
416
+
417
+ // src/hooks/useFloatingElement.ts
418
+ function calculatePosition({
419
+ windowRect,
420
+ containerRect,
421
+ anchorRect,
422
+ options
423
+ }) {
424
+ const { verticalAlignment, horizontalAlignment, gap, screenPadding } = options;
425
+ const windowWidth = windowRect.width;
426
+ const windowHeight = windowRect.height;
427
+ const maxWidth = windowWidth - 2 * screenPadding;
428
+ const maxHeight = windowHeight - 2 * screenPadding;
429
+ const width = Math.min(containerRect.width, maxWidth);
430
+ const height = Math.min(containerRect.height, maxHeight);
431
+ const leftSuggestion = {
432
+ beforeStart: anchorRect.left - width - gap,
433
+ afterStart: anchorRect.left,
434
+ center: anchorRect.left + anchorRect.width / 2 - width / 2,
435
+ beforeEnd: anchorRect.right - width,
436
+ afterEnd: anchorRect.right + gap
437
+ }[horizontalAlignment];
438
+ const topSuggestion = {
439
+ beforeStart: anchorRect.top - height - gap,
440
+ afterStart: anchorRect.top,
441
+ center: anchorRect.top + anchorRect.height / 2 - height / 2,
442
+ beforeEnd: anchorRect.bottom - height,
443
+ afterEnd: anchorRect.bottom + gap
444
+ }[verticalAlignment];
445
+ const left = clamp(leftSuggestion, [
446
+ screenPadding,
447
+ windowWidth - screenPadding - width
448
+ ]);
449
+ const top = clamp(topSuggestion, [
450
+ screenPadding,
451
+ windowHeight - screenPadding - height
452
+ ]);
453
+ return {
454
+ left,
455
+ top,
456
+ maxWidth,
457
+ maxHeight
458
+ };
459
+ }
460
+ function useFloatingElement({
461
+ active = true,
462
+ windowRef,
463
+ anchorRef,
464
+ containerRef,
465
+ isPolling = false,
466
+ pollingInterval = 100,
467
+ verticalAlignment = "afterEnd",
468
+ horizontalAlignment = "afterStart",
469
+ screenPadding = 16,
470
+ gap = 4
471
+ }) {
472
+ const [style, setStyle] = (0, import_react5.useState)();
473
+ const isMounted = useIsMounted();
474
+ const calculate = (0, import_react5.useCallback)(() => {
475
+ const containerRect = containerRef.current.getBoundingClientRect();
476
+ const windowRect = windowRef?.current.getBoundingClientRect() ?? {
477
+ top: 0,
478
+ bottom: window.innerHeight,
479
+ left: 0,
480
+ right: window.innerWidth,
481
+ width: window.innerWidth,
482
+ height: window.innerHeight
483
+ };
484
+ const anchorElement = anchorRef?.current;
485
+ if (anchorRef && !anchorElement) {
486
+ console.warn("FloatingContainer anchor provided, but its value is undefined");
487
+ }
488
+ const anchorRect = anchorElement?.getBoundingClientRect() ?? windowRect;
489
+ const calculateProps = {
490
+ windowRect,
491
+ anchorRect,
492
+ containerRect,
493
+ options: {
494
+ horizontalAlignment,
495
+ verticalAlignment,
496
+ screenPadding,
497
+ gap
498
+ }
499
+ };
500
+ setStyle(calculatePosition(calculateProps));
501
+ }, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef]);
502
+ const height = containerRef.current?.getBoundingClientRect().height;
503
+ const width = containerRef.current?.getBoundingClientRect().width;
504
+ (0, import_react5.useEffect)(() => {
505
+ if (active && isMounted) {
506
+ calculate();
507
+ } else {
508
+ setStyle(void 0);
509
+ }
510
+ }, [calculate, active, isMounted, height, width]);
511
+ (0, import_react5.useEffect)(() => {
512
+ window.addEventListener("resize", calculate);
513
+ let timeout;
514
+ if (isPolling) {
515
+ timeout = setInterval(calculate, pollingInterval);
516
+ }
517
+ return () => {
518
+ window.removeEventListener("resize", calculate);
519
+ if (timeout) {
520
+ clearInterval(timeout);
521
+ }
522
+ };
523
+ }, [calculate, isPolling, pollingInterval]);
524
+ return style;
525
+ }
526
+
527
+ // src/components/layout-and-navigation/FloatingContainer.tsx
528
+ var import_jsx_runtime3 = require("react/jsx-runtime");
529
+ var FloatingContainer = (0, import_react6.forwardRef)(function FloatingContainer2({
530
+ children,
531
+ backgroundOverlay,
532
+ anchor,
533
+ isPolling = false,
534
+ pollingInterval = 100,
535
+ verticalAlignment = "afterEnd",
536
+ horizontalAlignment = "afterStart",
537
+ screenPadding = 16,
538
+ gap = 4,
539
+ ...props
540
+ }, forwardRef6) {
541
+ const innerRef = (0, import_react6.useRef)(null);
542
+ (0, import_react6.useImperativeHandle)(forwardRef6, () => innerRef.current);
543
+ const position = useFloatingElement({
544
+ active: !props.hidden,
545
+ containerRef: innerRef,
546
+ anchorRef: anchor,
547
+ isPolling,
548
+ pollingInterval,
549
+ verticalAlignment,
550
+ horizontalAlignment,
551
+ gap,
552
+ screenPadding
553
+ });
554
+ return (0, import_react_dom.createPortal)(
555
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
556
+ backgroundOverlay,
557
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
558
+ "div",
559
+ {
560
+ ...props,
561
+ ref: innerRef,
562
+ style: {
563
+ position: "fixed",
564
+ overflow: "hidden",
565
+ opacity: position ? void 0 : 0,
566
+ // hide when position calculation isn't done yet
567
+ transition: position ? `top ${pollingInterval}ms linear, left ${pollingInterval}ms linear` : void 0,
568
+ ...position,
569
+ ...props.style
570
+ },
571
+ className: (0, import_clsx2.clsx)("motion-safe:duration-100 motion-reduce:duration-0", props.className),
572
+ children
573
+ }
574
+ )
575
+ ] }),
576
+ document.body
577
+ );
578
+ });
579
+
580
+ // src/hooks/focus/useFocusTrap.ts
581
+ var import_react7 = require("react");
582
+ var createFocusGuard = () => {
583
+ const div = document.createElement("div");
584
+ Object.assign(div.style, {
585
+ opacity: "0",
586
+ outline: "none",
587
+ boxShadow: "none",
588
+ position: "fixed",
589
+ pointerEvents: "none",
590
+ touchAction: "none"
591
+ });
592
+ div.tabIndex = 0;
593
+ div.setAttribute("data-hw-focus-guard", "");
594
+ document.body.appendChild(div);
595
+ return div;
596
+ };
597
+ function getContainedFocusableElements(element) {
598
+ return element?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
599
+ }
600
+ var FocusTrapService = class {
601
+ constructor() {
602
+ // The last entry is always the active one
603
+ this.listeners = [];
604
+ this.onFocusIn = (event) => {
605
+ const active = this.getActive();
606
+ if (!active || !active.container.current) return;
607
+ const { container } = active;
608
+ if (!container.current.contains(event.target)) {
609
+ this.focusElement();
610
+ }
611
+ };
612
+ }
613
+ getActive() {
614
+ if (this.listeners.length === 0) return void 0;
615
+ return this.listeners[this.listeners.length - 1];
616
+ }
617
+ focusElement() {
618
+ const active = this.getActive();
619
+ if (!active) return;
620
+ const { container, initialFocusElement } = active;
621
+ const containerElement = container.current;
622
+ if (initialFocusElement?.current) {
623
+ initialFocusElement.current.focus();
624
+ } else {
625
+ const elements = getContainedFocusableElements(containerElement);
626
+ if (elements && elements.length > 0) {
627
+ const first = elements.item(0);
628
+ first.focus();
629
+ } else {
630
+ containerElement.focus();
631
+ }
632
+ }
633
+ }
634
+ removeGuards() {
635
+ document.querySelectorAll("[data-hw-focus-guard]").forEach((node) => node.remove());
636
+ }
637
+ addGuards() {
638
+ document.body.insertAdjacentElement("afterbegin", createFocusGuard());
639
+ document.body.insertAdjacentElement("beforeend", createFocusGuard());
640
+ }
641
+ activate() {
642
+ document.addEventListener("focusin", this.onFocusIn);
643
+ this.addGuards();
644
+ }
645
+ deactivate() {
646
+ document.removeEventListener("focusin", this.onFocusIn);
647
+ this.removeGuards();
648
+ }
649
+ register(listener) {
650
+ this.listeners.push(listener);
651
+ if (this.listeners.length === 1) {
652
+ this.activate();
653
+ }
654
+ const active = listener;
655
+ this.listeners.forEach((listener2) => {
656
+ const { focus, pause } = listener2;
657
+ if (listener2 === active) {
658
+ focus();
659
+ } else {
660
+ pause();
661
+ }
662
+ });
663
+ }
664
+ unregister(id) {
665
+ const index = this.listeners.findIndex((trap) => trap.id === id);
666
+ if (index !== -1) {
667
+ const isActive = index === this.listeners.length - 1;
668
+ const listener = this.listeners[index];
669
+ this.listeners = this.listeners.filter((listener2) => listener2.id !== id);
670
+ if (isActive) {
671
+ this.deactivate();
672
+ listener.focusLast();
673
+ const active = this.getActive();
674
+ this.listeners.forEach((listener2) => {
675
+ const { pause, unpause } = listener2;
676
+ if (listener2 === active) {
677
+ unpause();
678
+ } else {
679
+ pause();
680
+ }
681
+ });
682
+ if (this.listeners.length > 0) {
683
+ this.activate();
684
+ }
685
+ }
686
+ } else {
687
+ console.warn(`Unable to unregister id ${id}: not found`);
688
+ }
689
+ }
690
+ };
691
+ var service = new FocusTrapService();
692
+ var useFocusTrap = ({
693
+ container,
694
+ active = true,
695
+ initialFocus,
696
+ focusFirst = true
697
+ }) => {
698
+ const lastFocusRef = (0, import_react7.useRef)(null);
699
+ const [paused, setPaused] = (0, import_react7.useState)(false);
700
+ const isMounted = useIsMounted();
701
+ const id = (0, import_react7.useId)();
702
+ const focusElement = (0, import_react7.useCallback)(() => {
703
+ const containerElement = container.current;
704
+ if (initialFocus?.current) {
705
+ initialFocus.current.focus();
706
+ } else {
707
+ const elements = getContainedFocusableElements(containerElement);
708
+ if (elements && elements.length > 0) {
709
+ const first = elements.item(0);
710
+ first.focus();
711
+ } else {
712
+ containerElement.focus();
713
+ }
714
+ }
715
+ }, [container, initialFocus]);
716
+ (0, import_react7.useEffect)(() => {
717
+ if (active && isMounted) {
718
+ let pause = function() {
719
+ setPaused(true);
720
+ }, unpause = function() {
721
+ setPaused(false);
722
+ if (!container.current.contains(document.activeElement)) {
723
+ focusElement();
724
+ }
725
+ }, focus = function() {
726
+ focusElement();
727
+ setPaused(false);
728
+ }, focusLast = function() {
729
+ lastFocusRef.current?.focus();
730
+ };
731
+ if (!lastFocusRef.current) {
732
+ lastFocusRef.current = document.activeElement;
733
+ }
734
+ service.register({ id, pause, focus, focusLast, unpause, container, initialFocusElement: initialFocus });
735
+ return () => {
736
+ service.unregister(id);
737
+ lastFocusRef.current = void 0;
738
+ };
739
+ }
740
+ }, [active, container, focusElement, id, initialFocus, isMounted]);
741
+ (0, import_react7.useEffect)(() => {
742
+ if (active && !paused && isMounted) {
743
+ let onKeyDown = function(event) {
744
+ const key = event.key;
745
+ const elements = getContainedFocusableElements(containerElement);
746
+ const active2 = document.activeElement;
747
+ const index = [...elements].findIndex((value) => value === active2);
748
+ if (index === -1 || event.altKey || event.ctrlKey || event.metaKey) {
749
+ return;
750
+ }
751
+ if (key === "Tab") {
752
+ const next = event.shiftKey ? -1 : 1;
753
+ const nextIndex = (index + next + elements.length) % elements.length;
754
+ const nextElement = elements[nextIndex];
755
+ nextElement.focus();
756
+ event.preventDefault();
757
+ }
758
+ };
759
+ const containerElement = container.current;
760
+ containerElement.addEventListener("keydown", onKeyDown);
761
+ return () => {
762
+ containerElement.removeEventListener("keydown", onKeyDown);
763
+ };
764
+ }
765
+ }, [active, paused, isMounted, container, initialFocus, focusFirst, focusElement]);
766
+ };
767
+
768
+ // src/hooks/useLogOnce.ts
769
+ var import_react8 = require("react");
770
+ var defaultOptions = {
771
+ type: "warning"
772
+ };
773
+ var useLogOnce = (message, condition, options) => {
774
+ const [hasLogged, setHasLogged] = (0, import_react8.useState)(false);
775
+ const { type } = { ...defaultOptions, ...options };
776
+ (0, import_react8.useEffect)(() => {
777
+ if (!hasLogged && condition) {
778
+ switch (type) {
779
+ case "info":
780
+ console.info(message);
781
+ break;
782
+ case "error":
783
+ console.error(message);
784
+ break;
785
+ case "warning":
786
+ console.warn(message);
787
+ break;
788
+ }
789
+ setHasLogged(true);
790
+ }
791
+ }, [condition]);
792
+ };
793
+
794
+ // src/components/dialog/Dialog.tsx
795
+ var import_jsx_runtime4 = require("react/jsx-runtime");
796
+ var Dialog = ({
797
+ children,
798
+ isOpen,
799
+ titleElement,
800
+ description,
801
+ isModal = true,
802
+ onClose,
803
+ horizontalAlignment = "center",
804
+ verticalAlignment = "center",
805
+ className,
806
+ backgroundClassName
807
+ }) => {
808
+ const translation = useTranslation([formTranslation]);
809
+ const ref = (0, import_react9.useRef)(null);
810
+ const onCloseWrapper = () => {
811
+ if (!isModal) return;
812
+ onClose?.();
813
+ };
814
+ useLogOnce("Dialog: onClose should be defined for modal dialogs", isModal && !onClose);
815
+ useFocusTrap({
816
+ container: ref,
817
+ active: isOpen,
818
+ focusFirst: true
819
+ });
820
+ if (!isOpen) return void 0;
821
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
822
+ FloatingContainer,
823
+ {
824
+ ref,
825
+ hidden: !isOpen,
826
+ onKeyDown: (event) => {
827
+ if (event.key === "Escape") {
828
+ onCloseWrapper();
829
+ }
830
+ },
831
+ horizontalAlignment,
832
+ verticalAlignment,
833
+ backgroundOverlay: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
834
+ "div",
835
+ {
836
+ className: (0, import_clsx3.default)(
837
+ "fixed inset-0 h-screen w-screen bg-overlay-shadow",
838
+ {
839
+ "motion-safe:animate-fade-in animation-delay-3000": isOpen,
840
+ "motion-safe:animate-fade-out": !isOpen
841
+ },
842
+ backgroundClassName
843
+ ),
844
+ hidden: !isOpen,
845
+ "aria-hidden": true,
846
+ onClick: onCloseWrapper
847
+ }
848
+ ),
849
+ className: (0, import_clsx3.default)(
850
+ "flex-col-2 p-4 bg-overlay-background text-overlay-text rounded-xl shadow-hw-bottom",
851
+ {
852
+ "motion-safe:animate-pop-in": isOpen,
853
+ "motion-safe:animate-pop-out": !isOpen
854
+ },
855
+ className
856
+ ),
857
+ children: [
858
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "typography-title-lg-semibold mr-8", children: titleElement }),
859
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "text-description", children: description }),
860
+ isModal && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
861
+ "div",
862
+ {
863
+ className: "absolute top-0 right-0",
864
+ style: {
865
+ paddingTop: "inherit",
866
+ paddingRight: "inherit"
867
+ },
868
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
869
+ IconButton,
870
+ {
871
+ color: "neutral",
872
+ size: "tiny",
873
+ "aria-label": translation("close"),
874
+ onClick: onCloseWrapper,
875
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.X, {})
876
+ }
877
+ )
878
+ }
879
+ ),
880
+ children
881
+ ]
882
+ }
883
+ );
884
+ };
885
+
886
+ // src/components/dialog/ConfirmDialog.tsx
887
+ var import_jsx_runtime5 = require("react/jsx-runtime");
888
+ var ConfirmDialog = ({
889
+ overwriteTranslation,
890
+ children,
891
+ onCancel,
892
+ onConfirm,
893
+ onDecline,
894
+ confirmType = "positive",
895
+ buttonOverwrites,
896
+ className,
897
+ ...restProps
898
+ }) => {
899
+ const translation = useTranslation([formTranslation], overwriteTranslation);
900
+ const mapping = {
901
+ neutral: "neutral",
902
+ negative: "negative",
903
+ positive: "positive",
904
+ primary: "primary"
905
+ };
906
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Dialog, { ...restProps, onClose: onCancel, className: (0, import_clsx4.default)("justify-between", className), children: [
907
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex-col-2 grow", children }),
908
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex-row-4 mt-3 justify-end", children: [
909
+ onCancel && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
910
+ SolidButton,
911
+ {
912
+ color: buttonOverwrites?.[0].color ?? "neutral",
913
+ onClick: onCancel,
914
+ disabled: buttonOverwrites?.[0].disabled ?? false,
915
+ children: buttonOverwrites?.[0].text ?? translation("cancel")
916
+ }
917
+ ),
918
+ onDecline && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
919
+ SolidButton,
920
+ {
921
+ color: buttonOverwrites?.[1].color ?? "negative",
922
+ onClick: onDecline,
923
+ disabled: buttonOverwrites?.[1].disabled ?? false,
924
+ children: buttonOverwrites?.[1].text ?? translation("decline")
925
+ }
926
+ ),
927
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
928
+ SolidButton,
929
+ {
930
+ color: buttonOverwrites?.[2].color ?? mapping[confirmType],
931
+ onClick: onConfirm,
932
+ disabled: buttonOverwrites?.[2].disabled ?? false,
933
+ children: buttonOverwrites?.[2].text ?? translation("confirm")
934
+ }
935
+ )
936
+ ] })
937
+ ] });
938
+ };
939
+
940
+ // src/components/dialog/DiscardChangesDialog.tsx
941
+ var import_jsx_runtime6 = require("react/jsx-runtime");
942
+ var DiscardChangesDialog = ({
943
+ overwriteTranslation,
944
+ children,
945
+ onCancel,
946
+ onSave,
947
+ onDontSave,
948
+ titleOverwrite,
949
+ descriptionOverwrite,
950
+ ...props
951
+ }) => {
952
+ const translation = useTranslation([formTranslation], overwriteTranslation);
953
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
954
+ ConfirmDialog,
955
+ {
956
+ ...props,
957
+ titleElement: titleOverwrite ?? translation("unsavedChanges"),
958
+ description: descriptionOverwrite ?? translation("unsavedChangesSaveQuestion"),
959
+ onConfirm: onSave,
960
+ onCancel,
961
+ onDecline: onDontSave,
962
+ buttonOverwrites: [{ text: translation("cancel") }, { text: translation("discardChanges") }, { text: translation("save") }],
963
+ children
964
+ }
965
+ );
966
+ };
967
+
968
+ // src/components/user-action/input/Input.tsx
969
+ var import_react12 = require("react");
970
+ var import_clsx5 = __toESM(require("clsx"));
971
+
972
+ // src/hooks/useDelay.ts
973
+ var import_react10 = require("react");
974
+ var defaultOptions2 = {
975
+ delay: 3e3,
976
+ disabled: false
977
+ };
978
+ function useDelay(options) {
979
+ const [timer, setTimer] = (0, import_react10.useState)(void 0);
980
+ const { delay, disabled } = {
981
+ ...defaultOptions2,
982
+ ...options
983
+ };
984
+ const clearTimer = () => {
985
+ clearTimeout(timer);
986
+ setTimer(void 0);
987
+ };
988
+ const restartTimer = (onDelayFinish) => {
989
+ if (disabled) {
990
+ return;
991
+ }
992
+ clearTimeout(timer);
993
+ setTimer(setTimeout(() => {
994
+ onDelayFinish();
995
+ setTimer(void 0);
996
+ }, delay));
997
+ };
998
+ (0, import_react10.useEffect)(() => {
999
+ return () => {
1000
+ clearTimeout(timer);
1001
+ };
1002
+ }, [timer]);
1003
+ (0, import_react10.useEffect)(() => {
1004
+ if (disabled) {
1005
+ clearTimeout(timer);
1006
+ setTimer(void 0);
1007
+ }
1008
+ }, [disabled, timer]);
1009
+ return { restartTimer, clearTimer, hasActiveTimer: !!timer };
1010
+ }
1011
+
1012
+ // src/hooks/focus/useFocusManagement.ts
1013
+ var import_react11 = require("react");
1014
+ function useFocusManagement() {
1015
+ const getFocusableElements = (0, import_react11.useCallback)(() => {
1016
+ return Array.from(
1017
+ document.querySelectorAll(
1018
+ 'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
1019
+ )
1020
+ ).filter(
1021
+ (el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
1022
+ );
1023
+ }, []);
1024
+ const getNextFocusElement = (0, import_react11.useCallback)(() => {
1025
+ const elements = getFocusableElements();
1026
+ if (elements.length === 0) {
1027
+ return void 0;
1028
+ }
1029
+ let nextElement = elements[0];
1030
+ if (document.activeElement instanceof HTMLElement) {
1031
+ const currentIndex = elements.indexOf(document.activeElement);
1032
+ nextElement = elements[(currentIndex + 1) % elements.length];
1033
+ }
1034
+ return nextElement;
1035
+ }, [getFocusableElements]);
1036
+ const focusNext = (0, import_react11.useCallback)(() => {
1037
+ const nextElement = getNextFocusElement();
1038
+ nextElement?.focus();
1039
+ }, [getNextFocusElement]);
1040
+ const getPreviousFocusElement = (0, import_react11.useCallback)(() => {
1041
+ const elements = getFocusableElements();
1042
+ if (elements.length === 0) {
1043
+ return void 0;
1044
+ }
1045
+ let previousElement = elements[0];
1046
+ if (document.activeElement instanceof HTMLElement) {
1047
+ const currentIndex = elements.indexOf(document.activeElement);
1048
+ if (currentIndex === 0) {
1049
+ previousElement = elements[elements.length - 1];
1050
+ } else {
1051
+ previousElement = elements[currentIndex - 1];
1052
+ }
1053
+ }
1054
+ return previousElement;
1055
+ }, [getFocusableElements]);
1056
+ const focusPrevious = (0, import_react11.useCallback)(() => {
1057
+ const previousElement = getPreviousFocusElement();
1058
+ if (previousElement) previousElement.focus();
1059
+ }, [getPreviousFocusElement]);
1060
+ return {
1061
+ getFocusableElements,
1062
+ getNextFocusElement,
1063
+ getPreviousFocusElement,
1064
+ focusNext,
1065
+ focusPrevious
1066
+ };
1067
+ }
1068
+
1069
+ // src/components/user-action/input/Input.tsx
1070
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1071
+ var defaultEditCompleteOptions = {
1072
+ allowEnterComplete: false,
1073
+ onBlur: true,
1074
+ afterDelay: true,
1075
+ delay: 2500
1076
+ };
1077
+ var Input = (0, import_react12.forwardRef)(function Input2({
1078
+ value,
1079
+ onChange,
1080
+ onChangeText,
1081
+ onEditCompleted,
1082
+ editCompleteOptions,
1083
+ disabled = false,
1084
+ invalid = false,
1085
+ defaultStyle = true,
1086
+ className,
1087
+ ...props
1088
+ }, forwardedRef) {
1089
+ const {
1090
+ onBlur: allowEditCompleteOnBlur,
1091
+ afterDelay,
1092
+ delay,
1093
+ allowEnterComplete
1094
+ } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
1095
+ const {
1096
+ restartTimer,
1097
+ clearTimer
1098
+ } = useDelay({ delay, disabled: !afterDelay });
1099
+ const innerRef = (0, import_react12.useRef)(null);
1100
+ (0, import_react12.useImperativeHandle)(forwardedRef, () => innerRef.current);
1101
+ const { focusNext } = useFocusManagement();
1102
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1103
+ "input",
1104
+ {
1105
+ ...props,
1106
+ ref: innerRef,
1107
+ value,
1108
+ disabled,
1109
+ className: defaultStyle ? (0, import_clsx5.default)(
1110
+ "px-2.5 py-1.75 rounded-md border-1 text-sm",
1111
+ {
1112
+ "bg-input-background text-input-text hover:border-primary focus:border-primary": !disabled && !invalid,
1113
+ "bg-on-negative text-negative border-negative-border hover:border-negative-border-hover focus-visible:ring-negative-border": !disabled && invalid,
1114
+ "bg-disabled-background text-disabled-text border-disabled-border": disabled
1115
+ },
1116
+ className
1117
+ ) : className,
1118
+ onKeyDown: (event) => {
1119
+ props.onKeyDown?.(event);
1120
+ if (!allowEnterComplete) {
1121
+ return;
1122
+ }
1123
+ if (event.key === "Enter" && !event.shiftKey) {
1124
+ event.preventDefault();
1125
+ innerRef.current?.blur();
1126
+ onEditCompleted?.(event.target.value);
1127
+ focusNext();
1128
+ }
1129
+ },
1130
+ onBlur: (event) => {
1131
+ props.onBlur?.(event);
1132
+ if (allowEditCompleteOnBlur) {
1133
+ onEditCompleted?.(event.target.value);
1134
+ clearTimer();
1135
+ }
1136
+ },
1137
+ onChange: (event) => {
1138
+ onChange?.(event);
1139
+ const value2 = event.target.value;
1140
+ restartTimer(() => {
1141
+ innerRef.current?.blur();
1142
+ onEditCompleted?.(value2);
1143
+ });
1144
+ onChangeText?.(value2);
1145
+ },
1146
+ "aria-invalid": props["aria-invalid"] ?? invalid,
1147
+ "aria-disabled": props["aria-disabled"] ?? disabled
1148
+ }
1149
+ );
1150
+ });
1151
+
1152
+ // src/components/dialog/InputDialog.tsx
1153
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1154
+ var InputDialog = ({
1155
+ inputs,
1156
+ buttonOverwrites,
1157
+ ...props
1158
+ }) => {
1159
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1160
+ ConfirmDialog,
1161
+ {
1162
+ buttonOverwrites,
1163
+ ...props,
1164
+ children: inputs.map((inputProps, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Input, { ...inputProps }, `input ${index}`))
1165
+ }
1166
+ );
1167
+ };
1168
+
1169
+ // src/components/user-action/select/Select.tsx
1170
+ var import_react14 = require("react");
1171
+ var import_clsx8 = __toESM(require("clsx"));
1172
+
1173
+ // src/components/layout-and-navigation/Expandable.tsx
1174
+ var import_react13 = require("react");
1175
+ var import_lucide_react2 = require("lucide-react");
1176
+ var import_clsx6 = __toESM(require("clsx"));
1177
+
1178
+ // src/utils/noop.ts
1179
+ var noop = () => void 0;
1180
+
1181
+ // src/components/layout-and-navigation/Expandable.tsx
1182
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1183
+ var ExpansionIcon = ({ isExpanded, className }) => {
1184
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1185
+ import_lucide_react2.ChevronDown,
1186
+ {
1187
+ "aria-hidden": true,
1188
+ className: (0, import_clsx6.default)(
1189
+ "min-w-6 w-6 min-h-6 h-6 transition-transform motion-safe:duration-200 motion-reduce:duration-0 ease-in-out",
1190
+ { "rotate-180": isExpanded },
1191
+ className
1192
+ )
1193
+ }
1194
+ );
1195
+ };
1196
+ var Expandable = (0, import_react13.forwardRef)(function Expandable2({
1197
+ children,
1198
+ id: providedId,
1199
+ label,
1200
+ icon,
1201
+ isExpanded = false,
1202
+ onChange = noop,
1203
+ clickOnlyOnHeader = true,
1204
+ disabled = false,
1205
+ className,
1206
+ headerClassName,
1207
+ contentClassName,
1208
+ contentExpandedClassName
1209
+ }, ref) {
1210
+ const defaultIcon = (0, import_react13.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
1211
+ icon ??= defaultIcon;
1212
+ const generatedId = (0, import_react13.useId)();
1213
+ const id = providedId ?? generatedId;
1214
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1215
+ "div",
1216
+ {
1217
+ ref,
1218
+ onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
1219
+ className: (0, import_clsx6.default)(
1220
+ "flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm",
1221
+ { "cursor-pointer": !clickOnlyOnHeader && !disabled },
1222
+ className
1223
+ ),
1224
+ children: [
1225
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1226
+ "button",
1227
+ {
1228
+ onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
1229
+ className: (0, import_clsx6.default)(
1230
+ "flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
1231
+ {
1232
+ "group-hover:brightness-97": !isExpanded,
1233
+ "hover:brightness-97": isExpanded && !disabled,
1234
+ "cursor-pointer": clickOnlyOnHeader && !disabled
1235
+ },
1236
+ headerClassName
1237
+ ),
1238
+ "aria-expanded": isExpanded,
1239
+ "aria-controls": `${id}-content`,
1240
+ "aria-disabled": disabled ?? void 0,
1241
+ children: [
1242
+ label,
1243
+ icon(isExpanded)
1244
+ ]
1245
+ }
1246
+ ),
1247
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1248
+ "div",
1249
+ {
1250
+ id: `${id}-content`,
1251
+ className: (0, import_clsx6.default)(
1252
+ "flex-col-2 px-4 transition-all duration-300 ease-in-out",
1253
+ {
1254
+ [(0, import_clsx6.default)("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
1255
+ "max-h-0 opacity-0 overflow-hidden": !isExpanded
1256
+ },
1257
+ contentClassName
1258
+ ),
1259
+ role: "region",
1260
+ children
1261
+ }
1262
+ )
1263
+ ]
1264
+ }
1265
+ );
1266
+ });
1267
+ var ExpandableUncontrolled = (0, import_react13.forwardRef)(function ExpandableUncontrolled2({
1268
+ isExpanded,
1269
+ onChange = noop,
1270
+ ...props
1271
+ }, ref) {
1272
+ const [usedIsExpanded, setUsedIsExpanded] = (0, import_react13.useState)(isExpanded);
1273
+ (0, import_react13.useEffect)(() => {
1274
+ setUsedIsExpanded(isExpanded);
1275
+ }, [isExpanded]);
1276
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1277
+ Expandable,
1278
+ {
1279
+ ...props,
1280
+ ref,
1281
+ isExpanded: usedIsExpanded,
1282
+ onChange: (value) => {
1283
+ onChange(value);
1284
+ setUsedIsExpanded(value);
1285
+ }
1286
+ }
1287
+ );
1288
+ });
1289
+
1290
+ // src/utils/match.ts
1291
+ var match = (key, values) => {
1292
+ return values[key];
1293
+ };
1294
+
1295
+ // src/components/user-action/select/Select.tsx
1296
+ var import_lucide_react3 = require("lucide-react");
1297
+
1298
+ // src/components/layout-and-navigation/Chip.tsx
1299
+ var import_clsx7 = __toESM(require("clsx"));
1300
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1301
+ var Chip = ({
1302
+ children,
1303
+ trailingIcon,
1304
+ color = "default",
1305
+ size = "md",
1306
+ icon = false,
1307
+ variant = "normal",
1308
+ className = "",
1309
+ ...restProps
1310
+ }) => {
1311
+ const colorMapping = {
1312
+ default: "text-tag-default-text bg-tag-default-background",
1313
+ dark: "text-tag-dark-text bg-tag-dark-background",
1314
+ red: "text-tag-red-text bg-tag-red-background",
1315
+ yellow: "text-tag-yellow-text bg-tag-yellow-background",
1316
+ green: "text-tag-green-text bg-tag-green-background",
1317
+ blue: "text-tag-blue-text bg-tag-blue-background",
1318
+ pink: "text-tag-pink-text bg-tag-pink-background",
1319
+ orange: "text-tag-orange-text bg-tag-orange-background"
1320
+ }[color];
1321
+ const colorMappingIcon = {
1322
+ default: "text-tag-default-icon",
1323
+ dark: "text-tag-dark-icon",
1324
+ red: "text-tag-red-icon",
1325
+ yellow: "text-tag-yellow-icon",
1326
+ green: "text-tag-green-icon",
1327
+ blue: "text-tag-blue-icon",
1328
+ pink: "text-tag-pink-icon",
1329
+ orange: "text-tag-orange-icon"
1330
+ }[color];
1331
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1332
+ "div",
1333
+ {
1334
+ ...restProps,
1335
+ className: (0, import_clsx7.default)(
1336
+ `flex-row-0 w-fit font-semibold`,
1337
+ colorMapping,
1338
+ !icon ? {
1339
+ "px-1 py-0.5": size === "sm",
1340
+ "px-2 py-1": size === "md",
1341
+ "px-4 py-2": size === "lg"
1342
+ } : {
1343
+ "p-0.5": size === "sm",
1344
+ "p-1": size === "md",
1345
+ "p-2": size === "lg"
1346
+ },
1347
+ {
1348
+ "rounded-md": variant === "normal",
1349
+ "rounded-full": variant === "fullyRounded"
1350
+ },
1351
+ className
1352
+ ),
1353
+ children: [
1354
+ children,
1355
+ trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
1356
+ ]
1357
+ }
1358
+ );
1359
+ };
1360
+
1361
+ // src/components/user-action/select/Select.tsx
1362
+ var import_react_dom2 = require("react-dom");
1363
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1364
+ var defaultToggleOpenOptions = {
1365
+ highlightStartPosition: "first"
1366
+ };
1367
+ var SelectContext = (0, import_react14.createContext)(null);
1368
+ function useSelectContext() {
1369
+ const ctx = (0, import_react14.useContext)(SelectContext);
1370
+ if (!ctx) {
1371
+ throw new Error("SelectContext must be used within a ListBoxPrimitive");
1372
+ }
1373
+ return ctx;
1374
+ }
1375
+ var SelectRoot = ({
1376
+ children,
1377
+ id,
1378
+ value,
1379
+ onValueChanged,
1380
+ values,
1381
+ onValuesChanged,
1382
+ isOpen = false,
1383
+ disabled = false,
1384
+ invalid = false,
1385
+ isMultiSelect = false
1386
+ }) => {
1387
+ const optionsRef = (0, import_react14.useRef)([]);
1388
+ const triggerRef = (0, import_react14.useRef)(null);
1389
+ const generatedId = (0, import_react14.useId)();
1390
+ const usedId = id ?? generatedId;
1391
+ const [internalState, setInternalState] = (0, import_react14.useState)({
1392
+ isOpen
1393
+ });
1394
+ const state = {
1395
+ ...internalState,
1396
+ id: usedId,
1397
+ disabled,
1398
+ invalid,
1399
+ value: isMultiSelect ? values ?? [] : [value].filter(Boolean),
1400
+ isMultiSelect
1401
+ };
1402
+ const registerItem = (0, import_react14.useCallback)((item) => {
1403
+ optionsRef.current.push(item);
1404
+ optionsRef.current.sort((a, b) => {
1405
+ const aEl = a.ref.current;
1406
+ const bEl = b.ref.current;
1407
+ if (!aEl || !bEl) return 0;
1408
+ return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
1409
+ });
1410
+ }, []);
1411
+ const unregisterItem = (0, import_react14.useCallback)((value2) => {
1412
+ optionsRef.current = optionsRef.current.filter((i) => i.value !== value2);
1413
+ }, []);
1414
+ const toggleSelection = (value2, isSelected) => {
1415
+ if (disabled) {
1416
+ return;
1417
+ }
1418
+ const option = optionsRef.current.find((i) => i.value === value2);
1419
+ if (!option) {
1420
+ console.error(`SelectOption with value: ${value2} not found`);
1421
+ return;
1422
+ }
1423
+ let newValue;
1424
+ if (isMultiSelect) {
1425
+ const isSelectedBefore = state.value.includes(value2);
1426
+ const isSelectedAfter = isSelected ?? !isSelectedBefore;
1427
+ if (!isSelectedAfter) {
1428
+ newValue = state.value.filter((v) => v !== value2);
1429
+ } else {
1430
+ newValue = [...state.value, value2];
1431
+ }
1432
+ } else {
1433
+ newValue = [value2];
1434
+ }
1435
+ if (!isMultiSelect) {
1436
+ onValueChanged?.(newValue[0]);
1437
+ } else {
1438
+ onValuesChanged?.(newValue);
1439
+ }
1440
+ setInternalState((prevState) => ({
1441
+ ...prevState,
1442
+ highlightedValue: value2
1443
+ }));
1444
+ };
1445
+ const highlightItem = (value2) => {
1446
+ if (disabled) {
1447
+ return;
1448
+ }
1449
+ setInternalState((prevState) => ({
1450
+ ...prevState,
1451
+ highlightedValue: value2
1452
+ }));
1453
+ };
1454
+ const registerTrigger = (0, import_react14.useCallback)((ref) => {
1455
+ triggerRef.current = ref.current;
1456
+ }, []);
1457
+ const unregisterTrigger = (0, import_react14.useCallback)(() => {
1458
+ triggerRef.current = null;
1459
+ }, []);
1460
+ const toggleOpen = (isOpen2, options) => {
1461
+ const { highlightStartPosition } = { ...defaultToggleOpenOptions, ...options };
1462
+ let highlightedIndex;
1463
+ if (highlightStartPosition === "first") {
1464
+ highlightedIndex = optionsRef.current.findIndex((option) => !option.disabled);
1465
+ } else {
1466
+ highlightedIndex = optionsRef.current.length - 1 - [...optionsRef.current].reverse().findIndex((option) => !option.disabled);
1467
+ }
1468
+ if (highlightedIndex === -1 || highlightedIndex === optionsRef.current.length) {
1469
+ highlightedIndex = 0;
1470
+ }
1471
+ setInternalState((prevState) => ({
1472
+ ...prevState,
1473
+ isOpen: isOpen2 ?? !prevState.isOpen,
1474
+ highlightedValue: optionsRef.current[highlightedIndex].value
1475
+ }));
1476
+ };
1477
+ const moveHighlightedIndex = (delta) => {
1478
+ let highlightedIndex = optionsRef.current.findIndex((value2) => value2.value === internalState.highlightedValue);
1479
+ if (highlightedIndex === -1) {
1480
+ highlightedIndex = 0;
1481
+ }
1482
+ const optionLength = optionsRef.current.length;
1483
+ const startIndex = (highlightedIndex + delta % optionLength + optionLength) % optionLength;
1484
+ const isForward = delta >= 0;
1485
+ let highlightedValue = optionsRef.current[startIndex].value;
1486
+ for (let i = 0; i < optionsRef.current.length; i++) {
1487
+ const index = (startIndex + (isForward ? i : -i) + optionLength) % optionLength;
1488
+ if (!optionsRef.current[index].disabled) {
1489
+ highlightedValue = optionsRef.current[index].value;
1490
+ break;
1491
+ }
1492
+ }
1493
+ setInternalState((prevState) => ({
1494
+ ...prevState,
1495
+ highlightedValue
1496
+ }));
1497
+ };
1498
+ (0, import_react14.useEffect)(() => {
1499
+ if (!internalState.highlightedValue) return;
1500
+ const highlighted = optionsRef.current.find((value2) => value2.value === internalState.highlightedValue);
1501
+ if (highlighted) {
1502
+ highlighted.ref.current.scrollIntoView({ behavior: "instant", block: "nearest" });
1503
+ } else {
1504
+ console.error(`SelectRoot: Could not find highlighted value (${internalState.highlightedValue})`);
1505
+ }
1506
+ }, [internalState.highlightedValue]);
1507
+ const contextValue = {
1508
+ state,
1509
+ item: {
1510
+ register: registerItem,
1511
+ unregister: unregisterItem,
1512
+ toggleSelection,
1513
+ highlightItem,
1514
+ moveHighlightedIndex
1515
+ },
1516
+ trigger: {
1517
+ ref: triggerRef,
1518
+ register: registerTrigger,
1519
+ unregister: unregisterTrigger,
1520
+ toggleOpen
1521
+ }
1522
+ };
1523
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectContext.Provider, { value: contextValue, children });
1524
+ };
1525
+ var SelectOption = (0, import_react14.forwardRef)(
1526
+ function SelectOption2({ value, disabled = false, children, className, ...restProps }, ref) {
1527
+ const { state, item, trigger } = useSelectContext();
1528
+ const { register, unregister, toggleSelection, highlightItem } = item;
1529
+ const itemRef = (0, import_react14.useRef)(null);
1530
+ (0, import_react14.useEffect)(() => {
1531
+ register({
1532
+ value,
1533
+ disabled,
1534
+ ref: itemRef
1535
+ });
1536
+ return () => unregister(value);
1537
+ }, [value, disabled, register, unregister, children]);
1538
+ const isHighlighted = state.highlightedValue === value;
1539
+ const isSelected = state.value.includes(value);
1540
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1541
+ "li",
1542
+ {
1543
+ ...restProps,
1544
+ ref: (node) => {
1545
+ itemRef.current = node;
1546
+ if (typeof ref === "function") ref(node);
1547
+ else if (ref) ref.current = node;
1548
+ },
1549
+ id: value,
1550
+ role: "option",
1551
+ "aria-disabled": disabled,
1552
+ "aria-selected": isSelected,
1553
+ "data-highlighted": isHighlighted ? "" : void 0,
1554
+ "data-selected": isSelected ? "" : void 0,
1555
+ "data-disabled": disabled ? "" : void 0,
1556
+ className: (0, import_clsx8.default)(
1557
+ "flex-row-1 items-center px-2 py-1 rounded-md",
1558
+ "data-highlighted:bg-primary/20",
1559
+ "data-disabled:text-disabled data-disabled:cursor-not-allowed",
1560
+ "not-data-disabled:cursor-pointer",
1561
+ className
1562
+ ),
1563
+ onClick: (event) => {
1564
+ if (!disabled) {
1565
+ toggleSelection(value);
1566
+ if (!state.isMultiSelect) {
1567
+ trigger.toggleOpen(false);
1568
+ }
1569
+ restProps.onClick?.(event);
1570
+ }
1571
+ },
1572
+ onMouseEnter: (event) => {
1573
+ if (!disabled) {
1574
+ highlightItem(value);
1575
+ restProps.onMouseEnter?.(event);
1576
+ }
1577
+ },
1578
+ children: [
1579
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1580
+ import_lucide_react3.CheckIcon,
1581
+ {
1582
+ className: (0, import_clsx8.default)("w-4 h-4", { "opacity-0": !isSelected || disabled }),
1583
+ "aria-hidden": true
1584
+ }
1585
+ ),
1586
+ children ?? value
1587
+ ]
1588
+ }
1589
+ );
1590
+ }
1591
+ );
1592
+ var defaultSelectButtonTranslation = {
1593
+ en: {
1594
+ clickToSelect: "Click to select"
1595
+ },
1596
+ de: {
1597
+ clickToSelect: "Zum ausw\xE4hlen dr\xFCcken"
1598
+ }
1599
+ };
1600
+ var SelectButton = (0, import_react14.forwardRef)(function SelectButton2({ placeholder, selectedDisplay, ...props }, ref) {
1601
+ const translation = useTranslation([defaultSelectButtonTranslation]);
1602
+ const { state, trigger } = useSelectContext();
1603
+ const { register, unregister, toggleOpen } = trigger;
1604
+ const innerRef = (0, import_react14.useRef)(null);
1605
+ (0, import_react14.useImperativeHandle)(ref, () => innerRef.current);
1606
+ (0, import_react14.useEffect)(() => {
1607
+ register(innerRef);
1608
+ return () => unregister();
1609
+ }, [register, unregister]);
1610
+ const disabled = !!props?.disabled || !!state.disabled;
1611
+ const invalid = state.invalid;
1612
+ const hasValue = state.value.length > 0;
1613
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1614
+ "button",
1615
+ {
1616
+ ...props,
1617
+ ref: innerRef,
1618
+ id: state.id,
1619
+ className: (0, import_clsx8.default)(
1620
+ "flex-row-2 items-center justify-between bg-input-background text-input-text rounded-md px-2.5 py-2.5",
1621
+ "data-placeholder:text-description",
1622
+ props.className
1623
+ ),
1624
+ onClick: () => toggleOpen(!state.isOpen),
1625
+ onKeyDown: (event) => {
1626
+ switch (event.key) {
1627
+ case "ArrowDown":
1628
+ toggleOpen(true, { highlightStartPosition: "first" });
1629
+ break;
1630
+ case "ArrowUp":
1631
+ toggleOpen(true, { highlightStartPosition: "last" });
1632
+ break;
1633
+ }
1634
+ },
1635
+ "data-placeholder": !hasValue ? "" : void 0,
1636
+ "data-disabled": disabled ? "" : void 0,
1637
+ "data-invalid": invalid ? "" : void 0,
1638
+ "aria-invalid": invalid,
1639
+ "aria-disabled": disabled,
1640
+ "aria-haspopup": "listbox",
1641
+ "aria-expanded": state.isOpen,
1642
+ "aria-controls": state.isOpen ? `${state.id}-listbox` : void 0,
1643
+ children: [
1644
+ hasValue ? selectedDisplay?.(state.value) ?? state.value.join(", ") : placeholder ?? translation("clickToSelect"),
1645
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ExpansionIcon, { isExpanded: state.isOpen })
1646
+ ]
1647
+ }
1648
+ );
1649
+ });
1650
+ var SelectChipDisplay = (0, import_react14.forwardRef)(function SelectChipDisplay2({ ...props }, ref) {
1651
+ const { state, trigger, item } = useSelectContext();
1652
+ const { register, unregister, toggleOpen } = trigger;
1653
+ const innerRef = (0, import_react14.useRef)(null);
1654
+ (0, import_react14.useImperativeHandle)(ref, () => innerRef.current);
1655
+ (0, import_react14.useEffect)(() => {
1656
+ register(innerRef);
1657
+ return () => unregister();
1658
+ }, [register, unregister]);
1659
+ const disabled = !!props?.disabled || !!state.disabled;
1660
+ const invalid = state.invalid;
1661
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1662
+ "div",
1663
+ {
1664
+ ...props,
1665
+ ref: innerRef,
1666
+ className: (0, import_clsx8.default)(
1667
+ "flex flex-wrap flex-row gap-2 items-center bg-input-background text-input-text rounded-md px-2.5 py-2.5",
1668
+ props.className
1669
+ ),
1670
+ "data-disabled": disabled ? "" : void 0,
1671
+ "data-invalid": invalid ? "" : void 0,
1672
+ "aria-invalid": invalid,
1673
+ "aria-disabled": disabled,
1674
+ children: [
1675
+ state.value.map((value) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Chip, { className: "gap-x-2", children: [
1676
+ value,
1677
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1678
+ "button",
1679
+ {
1680
+ onClick: () => {
1681
+ item.toggleSelection(value, false);
1682
+ },
1683
+ 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",
1684
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.XIcon, {})
1685
+ }
1686
+ )
1687
+ ] }, value)),
1688
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1689
+ IconButton,
1690
+ {
1691
+ id: state.id,
1692
+ onClick: () => toggleOpen(),
1693
+ onKeyDown: (event) => {
1694
+ switch (event.key) {
1695
+ case "ArrowDown":
1696
+ toggleOpen(true, { highlightStartPosition: "first" });
1697
+ break;
1698
+ case "ArrowUp":
1699
+ toggleOpen(true, { highlightStartPosition: "last" });
1700
+ }
1701
+ },
1702
+ size: "small",
1703
+ color: "neutral",
1704
+ "aria-invalid": invalid,
1705
+ "aria-disabled": disabled,
1706
+ "aria-haspopup": "listbox",
1707
+ "aria-expanded": state.isOpen,
1708
+ "aria-controls": state.isOpen ? `${state.id}-listbox` : void 0,
1709
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.Plus, {})
1710
+ }
1711
+ )
1712
+ ]
1713
+ }
1714
+ );
1715
+ });
1716
+ var SelectContent = (0, import_react14.forwardRef)(
1717
+ function SelectContent2({
1718
+ alignment,
1719
+ orientation = "vertical",
1720
+ ...props
1721
+ }, ref) {
1722
+ const innerRef = (0, import_react14.useRef)(null);
1723
+ (0, import_react14.useImperativeHandle)(ref, () => innerRef.current);
1724
+ const { trigger, state, item } = useSelectContext();
1725
+ const position = useFloatingElement({
1726
+ active: state.isOpen,
1727
+ anchorRef: trigger.ref,
1728
+ containerRef: innerRef,
1729
+ ...alignment
1730
+ });
1731
+ useFocusTrap({
1732
+ container: innerRef,
1733
+ active: state.isOpen && !!position
1734
+ });
1735
+ return (0, import_react_dom2.createPortal)(
1736
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1737
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1738
+ "div",
1739
+ {
1740
+ hidden: !state.isOpen,
1741
+ onClick: () => trigger.toggleOpen(false),
1742
+ className: (0, import_clsx8.default)("fixed w-screen h-screen inset-0")
1743
+ }
1744
+ ),
1745
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1746
+ "ul",
1747
+ {
1748
+ ...props,
1749
+ id: `${state.id}-listbox`,
1750
+ ref: innerRef,
1751
+ hidden: !state.isOpen,
1752
+ onKeyDown: (event) => {
1753
+ switch (event.key) {
1754
+ case "Escape":
1755
+ trigger.toggleOpen(false);
1756
+ event.preventDefault();
1757
+ event.stopPropagation();
1758
+ break;
1759
+ case match(orientation, {
1760
+ vertical: "ArrowDown",
1761
+ horizontal: "ArrowUp"
1762
+ }):
1763
+ item.moveHighlightedIndex(1);
1764
+ event.preventDefault();
1765
+ break;
1766
+ case match(orientation, {
1767
+ vertical: "ArrowUp",
1768
+ horizontal: "ArrowDown"
1769
+ }):
1770
+ item.moveHighlightedIndex(-1);
1771
+ event.preventDefault();
1772
+ break;
1773
+ case "Home":
1774
+ event.preventDefault();
1775
+ break;
1776
+ case "End":
1777
+ event.preventDefault();
1778
+ break;
1779
+ case "Enter":
1780
+ // Fall through
1781
+ case " ":
1782
+ if (state.highlightedValue) {
1783
+ item.toggleSelection(state.highlightedValue);
1784
+ if (!state.isMultiSelect) {
1785
+ trigger.toggleOpen(false);
1786
+ }
1787
+ event.preventDefault();
1788
+ }
1789
+ break;
1790
+ }
1791
+ },
1792
+ className: (0, import_clsx8.default)("flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-style-within overflow-auto", props.className),
1793
+ style: {
1794
+ opacity: position ? void 0 : 0,
1795
+ position: "fixed",
1796
+ ...position
1797
+ },
1798
+ role: "listbox",
1799
+ "aria-multiselectable": state.isMultiSelect,
1800
+ "aria-orientation": orientation,
1801
+ tabIndex: position ? 0 : void 0,
1802
+ children: props.children
1803
+ }
1804
+ )
1805
+ ] }),
1806
+ document.body
1807
+ );
1808
+ }
1809
+ );
1810
+ var Select = (0, import_react14.forwardRef)(function Select2({
1811
+ children,
1812
+ contentPanelProps,
1813
+ buttonProps,
1814
+ ...props
1815
+ }, ref) {
1816
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(SelectRoot, { ...props, isMultiSelect: false, children: [
1817
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1818
+ SelectButton,
1819
+ {
1820
+ ref,
1821
+ ...buttonProps,
1822
+ selectedDisplay: (values) => {
1823
+ const value = values[0];
1824
+ if (!buttonProps?.selectedDisplay) return void 0;
1825
+ return buttonProps.selectedDisplay(value);
1826
+ }
1827
+ }
1828
+ ),
1829
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectContent, { ...contentPanelProps, children })
1830
+ ] });
1831
+ });
1832
+ var SelectUncontrolled = (0, import_react14.forwardRef)(function SelectUncontrolled2({
1833
+ value: initialValue,
1834
+ onValueChanged,
1835
+ ...props
1836
+ }, ref) {
1837
+ const [value, setValue] = (0, import_react14.useState)(initialValue);
1838
+ (0, import_react14.useEffect)(() => {
1839
+ setValue(initialValue);
1840
+ }, [initialValue]);
1841
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1842
+ Select,
1843
+ {
1844
+ ...props,
1845
+ ref,
1846
+ value,
1847
+ onValueChanged: (value2) => {
1848
+ setValue(value2);
1849
+ onValueChanged?.(value2);
1850
+ }
1851
+ }
1852
+ );
1853
+ });
1854
+ var MultiSelect = (0, import_react14.forwardRef)(function MultiSelect2({
1855
+ children,
1856
+ contentPanelProps,
1857
+ buttonProps,
1858
+ ...props
1859
+ }, ref) {
1860
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(SelectRoot, { ...props, isMultiSelect: true, children: [
1861
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectButton, { ref, ...buttonProps }),
1862
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectContent, { ...contentPanelProps, children })
1863
+ ] });
1864
+ });
1865
+ var MultiSelectUncontrolled = (0, import_react14.forwardRef)(function MultiSelectUncontrolled2({
1866
+ values: initialValues,
1867
+ onValuesChanged,
1868
+ ...props
1869
+ }, ref) {
1870
+ const [values, setValues] = (0, import_react14.useState)(initialValues);
1871
+ (0, import_react14.useEffect)(() => {
1872
+ setValues(initialValues);
1873
+ }, [initialValues]);
1874
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1875
+ MultiSelect,
1876
+ {
1877
+ ...props,
1878
+ ref,
1879
+ values,
1880
+ onValuesChanged: (value) => {
1881
+ setValues(value);
1882
+ onValuesChanged?.(value);
1883
+ }
1884
+ }
1885
+ );
1886
+ });
1887
+ var MultiSelectChipDisplay = (0, import_react14.forwardRef)(function MultiSelectChipDisplay2({
1888
+ children,
1889
+ contentPanelProps,
1890
+ chipDisplayProps,
1891
+ ...props
1892
+ }, ref) {
1893
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(SelectRoot, { ...props, isMultiSelect: true, children: [
1894
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectChipDisplay, { ref, ...chipDisplayProps }),
1895
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectContent, { ...contentPanelProps, children })
1896
+ ] });
1897
+ });
1898
+ var MultiSelectChipDisplayUncontrolled = (0, import_react14.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
1899
+ values: initialValues,
1900
+ onValuesChanged,
1901
+ ...props
1902
+ }, ref) {
1903
+ const [values, setValues] = (0, import_react14.useState)(initialValues);
1904
+ (0, import_react14.useEffect)(() => {
1905
+ setValues(initialValues);
1906
+ }, [initialValues]);
1907
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1908
+ MultiSelectChipDisplay,
1909
+ {
1910
+ ...props,
1911
+ ref,
1912
+ values,
1913
+ onValuesChanged: (value) => {
1914
+ setValues(value);
1915
+ onValuesChanged?.(value);
1916
+ }
1917
+ }
1918
+ );
1919
+ });
1920
+
1921
+ // src/components/dialog/LanguageDialog.tsx
1922
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1923
+ var defaultLanguageDialogTranslation = {
1924
+ en: {
1925
+ language: "Language",
1926
+ chooseLanguage: "Choose your language",
1927
+ done: "Done",
1928
+ ...LanguageUtil.languagesLocalNames
1929
+ },
1930
+ de: {
1931
+ language: "Sprache",
1932
+ chooseLanguage: "W\xE4hle deine bevorzugte Sprache",
1933
+ done: "Fertig",
1934
+ ...LanguageUtil.languagesLocalNames
1935
+ }
1936
+ };
1937
+ var LanguageDialog = ({
1938
+ overwriteTranslation,
1939
+ onClose,
1940
+ titleOverwrite,
1941
+ descriptionOverwrite,
1942
+ ...props
1943
+ }) => {
1944
+ const { language, setLanguage } = useLanguage();
1945
+ const translation = useTranslation([defaultLanguageDialogTranslation], overwriteTranslation);
1946
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1947
+ Dialog,
1948
+ {
1949
+ titleElement: titleOverwrite ?? translation("language"),
1950
+ description: descriptionOverwrite ?? translation("chooseLanguage"),
1951
+ onClose,
1952
+ ...props,
1953
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "w-64", children: [
1954
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1955
+ Select,
1956
+ {
1957
+ value: language,
1958
+ onValueChanged: (language2) => setLanguage(language2),
1959
+ contentPanelProps: { className: "z-100" },
1960
+ buttonProps: {
1961
+ selectedDisplay: (value) => translation(value)
1962
+ },
1963
+ children: LanguageUtil.languages.map((language2) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectOption, { value: language2, children: translation(language2) }, language2))
1964
+ }
1965
+ ),
1966
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SolidButton, { color: "positive", onClick: onClose, children: translation("done") }) })
1967
+ ] })
1968
+ }
1969
+ );
1970
+ };
1971
+
1972
+ // src/theming/useTheme.tsx
1973
+ var import_react15 = require("react");
1974
+ var import_react16 = require("react");
1975
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1976
+ var themes = ["light", "dark", "system"];
1977
+ var defaultThemeTypeTranslation = {
1978
+ en: {
1979
+ dark: "Dark",
1980
+ light: "Light",
1981
+ system: "System",
1982
+ theme: {
1983
+ one: "Theme",
1984
+ other: "Themes"
1985
+ }
1986
+ },
1987
+ de: {
1988
+ dark: "Dunkel",
1989
+ light: "Hell",
1990
+ system: "System",
1991
+ theme: {
1992
+ one: "Farbschema",
1993
+ other: "Farbschemas"
1994
+ }
1995
+ }
1996
+ };
1997
+ var ThemeUtil = {
1998
+ themes,
1999
+ translation: defaultThemeTypeTranslation
2000
+ };
2001
+ var ThemeContext = (0, import_react16.createContext)({
2002
+ theme: "light",
2003
+ setTheme: noop
2004
+ });
2005
+ var useTheme = () => (0, import_react16.useContext)(ThemeContext);
2006
+
2007
+ // src/components/dialog/ThemeDialog.tsx
2008
+ var import_jsx_runtime14 = require("react/jsx-runtime");
2009
+ var defaultConfirmDialogTranslation = {
2010
+ en: {
2011
+ chooseTheme: "Choose your preferred theme"
2012
+ },
2013
+ de: {
2014
+ chooseTheme: "W\xE4hle dein bevorzugtes Farbschema"
2015
+ }
2016
+ };
2017
+ var ThemeDialog = ({
2018
+ overwriteTranslation,
2019
+ onClose,
2020
+ titleOverwrite,
2021
+ descriptionOverwrite,
2022
+ ...props
2023
+ }) => {
2024
+ const { theme, setTheme } = useTheme();
2025
+ const translation = useTranslation([defaultConfirmDialogTranslation, formTranslation, ThemeUtil.translation], overwriteTranslation);
2026
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2027
+ Dialog,
2028
+ {
2029
+ titleElement: titleOverwrite ?? translation("theme"),
2030
+ description: descriptionOverwrite ?? translation("chooseTheme"),
2031
+ onClose,
2032
+ ...props,
2033
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w-64", children: [
2034
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2035
+ Select,
2036
+ {
2037
+ value: theme,
2038
+ onValueChanged: (theme2) => setTheme(theme2),
2039
+ contentPanelProps: {
2040
+ className: "z-100"
2041
+ },
2042
+ buttonProps: {
2043
+ selectedDisplay: (value) => translation(value)
2044
+ },
2045
+ children: ThemeUtil.themes.map((theme2) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectOption, { value: theme2, children: translation(theme2) }, theme2))
2046
+ }
2047
+ ),
2048
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
2049
+ ] })
2050
+ }
2051
+ );
2052
+ };
2053
+ // Annotate the CommonJS export names for ESM import in node:
2054
+ 0 && (module.exports = {
2055
+ ConfirmDialog,
2056
+ Dialog,
2057
+ DiscardChangesDialog,
2058
+ InputDialog,
2059
+ LanguageDialog,
2060
+ ThemeDialog
2061
+ });
2062
+ //# sourceMappingURL=index.js.map