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