@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,1103 @@
1
+ // src/components/user-action/input/Input.tsx
2
+ import { forwardRef, useEffect as useEffect2, useImperativeHandle, useRef, useState as useState2 } from "react";
3
+ import clsx from "clsx";
4
+
5
+ // src/hooks/useDelay.ts
6
+ import { useEffect, useState } from "react";
7
+ var defaultOptions = {
8
+ delay: 3e3,
9
+ disabled: false
10
+ };
11
+ function useDelay(options) {
12
+ const [timer, setTimer] = useState(void 0);
13
+ const { delay, disabled } = {
14
+ ...defaultOptions,
15
+ ...options
16
+ };
17
+ const clearTimer = () => {
18
+ clearTimeout(timer);
19
+ setTimer(void 0);
20
+ };
21
+ const restartTimer = (onDelayFinish) => {
22
+ if (disabled) {
23
+ return;
24
+ }
25
+ clearTimeout(timer);
26
+ setTimer(setTimeout(() => {
27
+ onDelayFinish();
28
+ setTimer(void 0);
29
+ }, delay));
30
+ };
31
+ useEffect(() => {
32
+ return () => {
33
+ clearTimeout(timer);
34
+ };
35
+ }, [timer]);
36
+ useEffect(() => {
37
+ if (disabled) {
38
+ clearTimeout(timer);
39
+ setTimer(void 0);
40
+ }
41
+ }, [disabled, timer]);
42
+ return { restartTimer, clearTimer, hasActiveTimer: !!timer };
43
+ }
44
+
45
+ // src/hooks/focus/useFocusManagement.ts
46
+ import { useCallback } from "react";
47
+ function useFocusManagement() {
48
+ const getFocusableElements = useCallback(() => {
49
+ return Array.from(
50
+ document.querySelectorAll(
51
+ 'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
52
+ )
53
+ ).filter(
54
+ (el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
55
+ );
56
+ }, []);
57
+ const getNextFocusElement = useCallback(() => {
58
+ const elements = getFocusableElements();
59
+ if (elements.length === 0) {
60
+ return void 0;
61
+ }
62
+ let nextElement = elements[0];
63
+ if (document.activeElement instanceof HTMLElement) {
64
+ const currentIndex = elements.indexOf(document.activeElement);
65
+ nextElement = elements[(currentIndex + 1) % elements.length];
66
+ }
67
+ return nextElement;
68
+ }, [getFocusableElements]);
69
+ const focusNext = useCallback(() => {
70
+ const nextElement = getNextFocusElement();
71
+ nextElement?.focus();
72
+ }, [getNextFocusElement]);
73
+ const getPreviousFocusElement = useCallback(() => {
74
+ const elements = getFocusableElements();
75
+ if (elements.length === 0) {
76
+ return void 0;
77
+ }
78
+ let previousElement = elements[0];
79
+ if (document.activeElement instanceof HTMLElement) {
80
+ const currentIndex = elements.indexOf(document.activeElement);
81
+ if (currentIndex === 0) {
82
+ previousElement = elements[elements.length - 1];
83
+ } else {
84
+ previousElement = elements[currentIndex - 1];
85
+ }
86
+ }
87
+ return previousElement;
88
+ }, [getFocusableElements]);
89
+ const focusPrevious = useCallback(() => {
90
+ const previousElement = getPreviousFocusElement();
91
+ if (previousElement) previousElement.focus();
92
+ }, [getPreviousFocusElement]);
93
+ return {
94
+ getFocusableElements,
95
+ getNextFocusElement,
96
+ getPreviousFocusElement,
97
+ focusNext,
98
+ focusPrevious
99
+ };
100
+ }
101
+
102
+ // src/components/user-action/input/Input.tsx
103
+ import { jsx } from "react/jsx-runtime";
104
+ var defaultEditCompleteOptions = {
105
+ allowEnterComplete: false,
106
+ onBlur: true,
107
+ afterDelay: true,
108
+ delay: 2500
109
+ };
110
+ var Input = forwardRef(function Input2({
111
+ value,
112
+ onChange,
113
+ onChangeText,
114
+ onEditCompleted,
115
+ editCompleteOptions,
116
+ disabled = false,
117
+ invalid = false,
118
+ defaultStyle = true,
119
+ className,
120
+ ...props
121
+ }, forwardedRef) {
122
+ const {
123
+ onBlur: allowEditCompleteOnBlur,
124
+ afterDelay,
125
+ delay,
126
+ allowEnterComplete
127
+ } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
128
+ const {
129
+ restartTimer,
130
+ clearTimer
131
+ } = useDelay({ delay, disabled: !afterDelay });
132
+ const innerRef = useRef(null);
133
+ useImperativeHandle(forwardedRef, () => innerRef.current);
134
+ const { focusNext } = useFocusManagement();
135
+ return /* @__PURE__ */ jsx(
136
+ "input",
137
+ {
138
+ ...props,
139
+ ref: innerRef,
140
+ value,
141
+ disabled,
142
+ className: defaultStyle ? clsx(
143
+ "px-2.5 py-1.75 rounded-md border-1 text-sm",
144
+ {
145
+ "bg-input-background text-input-text hover:border-primary focus:border-primary": !disabled && !invalid,
146
+ "bg-on-negative text-negative border-negative-border hover:border-negative-border-hover focus-visible:ring-negative-border": !disabled && invalid,
147
+ "bg-disabled-background text-disabled-text border-disabled-border": disabled
148
+ },
149
+ className
150
+ ) : className,
151
+ onKeyDown: (event) => {
152
+ props.onKeyDown?.(event);
153
+ if (!allowEnterComplete) {
154
+ return;
155
+ }
156
+ if (event.key === "Enter" && !event.shiftKey) {
157
+ event.preventDefault();
158
+ innerRef.current?.blur();
159
+ onEditCompleted?.(event.target.value);
160
+ focusNext();
161
+ }
162
+ },
163
+ onBlur: (event) => {
164
+ props.onBlur?.(event);
165
+ if (allowEditCompleteOnBlur) {
166
+ onEditCompleted?.(event.target.value);
167
+ clearTimer();
168
+ }
169
+ },
170
+ onChange: (event) => {
171
+ onChange?.(event);
172
+ const value2 = event.target.value;
173
+ restartTimer(() => {
174
+ innerRef.current?.blur();
175
+ onEditCompleted?.(value2);
176
+ });
177
+ onChangeText?.(value2);
178
+ },
179
+ "aria-invalid": props["aria-invalid"] ?? invalid,
180
+ "aria-disabled": props["aria-disabled"] ?? disabled
181
+ }
182
+ );
183
+ });
184
+
185
+ // src/components/user-action/Button.tsx
186
+ import { forwardRef as forwardRef2 } from "react";
187
+ import clsx2 from "clsx";
188
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
189
+ var ButtonColorUtil = {
190
+ solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
191
+ text: ["primary", "negative", "neutral"],
192
+ outline: ["primary"]
193
+ };
194
+ var IconButtonUtil = {
195
+ icon: [...ButtonColorUtil.solid, "transparent"]
196
+ };
197
+ var paddingMapping = {
198
+ small: "btn-sm",
199
+ medium: "btn-md",
200
+ large: "btn-lg"
201
+ };
202
+ var iconPaddingMapping = {
203
+ tiny: "icon-btn-xs",
204
+ small: "icon-btn-sm",
205
+ medium: "icon-btn-md",
206
+ large: "icon-btn-lg"
207
+ };
208
+ var ButtonUtil = {
209
+ paddingMapping,
210
+ iconPaddingMapping
211
+ };
212
+ var SolidButton = forwardRef2(function SolidButton2({
213
+ children,
214
+ color = "primary",
215
+ size = "medium",
216
+ startIcon,
217
+ endIcon,
218
+ onClick,
219
+ className,
220
+ ...restProps
221
+ }, ref) {
222
+ const colorClasses = {
223
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
224
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
225
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
226
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
227
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
228
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
229
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text"
230
+ }[color];
231
+ const iconColorClasses = {
232
+ primary: "not-group-disabled:text-button-solid-primary-icon",
233
+ secondary: "not-group-disabled:text-button-solid-secondary-icon",
234
+ tertiary: "not-group-disabled:text-button-solid-tertiary-icon",
235
+ positive: "not-group-disabled:text-button-solid-positive-icon",
236
+ warning: "not-group-disabled:text-button-solid-warning-icon",
237
+ negative: "not-group-disabled:text-button-solid-negative-icon",
238
+ neutral: "not-group-disabled:text-button-solid-neutral-icon"
239
+ }[color];
240
+ return /* @__PURE__ */ jsxs(
241
+ "button",
242
+ {
243
+ ref,
244
+ onClick,
245
+ className: clsx2(
246
+ "group font-semibold",
247
+ colorClasses,
248
+ "not-disabled:hover:brightness-90",
249
+ "disabled:text-disabled-text disabled:bg-disabled-background",
250
+ ButtonUtil.paddingMapping[size],
251
+ className
252
+ ),
253
+ ...restProps,
254
+ children: [
255
+ startIcon && /* @__PURE__ */ jsx2(
256
+ "span",
257
+ {
258
+ className: clsx2(
259
+ iconColorClasses,
260
+ "group-disabled:text-disabled-icon"
261
+ ),
262
+ children: startIcon
263
+ }
264
+ ),
265
+ children,
266
+ endIcon && /* @__PURE__ */ jsx2(
267
+ "span",
268
+ {
269
+ className: clsx2(
270
+ iconColorClasses,
271
+ "group-disabled:text-disabled-icon"
272
+ ),
273
+ children: endIcon
274
+ }
275
+ )
276
+ ]
277
+ }
278
+ );
279
+ });
280
+ var IconButton = forwardRef2(function IconButton2({
281
+ children,
282
+ color = "primary",
283
+ size = "medium",
284
+ className,
285
+ ...restProps
286
+ }, ref) {
287
+ const colorClasses = {
288
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
289
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
290
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
291
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
292
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
293
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
294
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text",
295
+ transparent: "not-disabled:bg-transparent"
296
+ }[color];
297
+ return /* @__PURE__ */ jsx2(
298
+ "button",
299
+ {
300
+ ref,
301
+ className: clsx2(
302
+ colorClasses,
303
+ "not-disabled:hover:brightness-90",
304
+ "disabled:text-disabled-text",
305
+ {
306
+ "disabled:bg-disabled-background": color !== "transparent",
307
+ "disabled:opacity-70": color === "transparent",
308
+ "not-disabled:hover:bg-button-text-hover-background": color === "transparent"
309
+ },
310
+ ButtonUtil.iconPaddingMapping[size],
311
+ className
312
+ ),
313
+ ...restProps,
314
+ children
315
+ }
316
+ );
317
+ });
318
+
319
+ // src/localization/LanguageProvider.tsx
320
+ import { createContext, useContext, useEffect as useEffect3, useState as useState4 } from "react";
321
+
322
+ // src/hooks/useLocalStorage.ts
323
+ import { useCallback as useCallback2, useState as useState3 } from "react";
324
+
325
+ // src/localization/util.ts
326
+ var languages = ["en", "de"];
327
+ var languagesLocalNames = {
328
+ en: "English",
329
+ de: "Deutsch"
330
+ };
331
+ var DEFAULT_LANGUAGE = "en";
332
+ var LanguageUtil = {
333
+ languages,
334
+ DEFAULT_LANGUAGE,
335
+ languagesLocalNames
336
+ };
337
+
338
+ // src/localization/LanguageProvider.tsx
339
+ import { jsx as jsx3 } from "react/jsx-runtime";
340
+ var LanguageContext = createContext({
341
+ language: LanguageUtil.DEFAULT_LANGUAGE,
342
+ setLanguage: (v) => v
343
+ });
344
+ var useLanguage = () => useContext(LanguageContext);
345
+
346
+ // src/localization/useTranslation.ts
347
+ var TranslationPluralCount = {
348
+ zero: 0,
349
+ one: 1,
350
+ two: 2,
351
+ few: 3,
352
+ many: 11,
353
+ other: -1
354
+ };
355
+ var useTranslation = (translations, overwriteTranslation = {}) => {
356
+ const { language: languageProp, translation: overwrite } = overwriteTranslation;
357
+ const { language: inferredLanguage } = useLanguage();
358
+ const usedLanguage = languageProp ?? inferredLanguage;
359
+ const usedTranslations = [...translations];
360
+ if (overwrite) {
361
+ usedTranslations.push(overwrite);
362
+ }
363
+ return (key, options) => {
364
+ const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options };
365
+ try {
366
+ for (let i = translations.length - 1; i >= 0; i--) {
367
+ const translation = translations[i];
368
+ const localizedTranslation = translation[usedLanguage];
369
+ if (!localizedTranslation) {
370
+ continue;
371
+ }
372
+ const value = localizedTranslation[key];
373
+ if (!value) {
374
+ continue;
375
+ }
376
+ let forProcessing;
377
+ if (typeof value !== "string") {
378
+ if (count === TranslationPluralCount.zero && value?.zero) {
379
+ forProcessing = value.zero;
380
+ } else if (count === TranslationPluralCount.one && value?.one) {
381
+ forProcessing = value.one;
382
+ } else if (count === TranslationPluralCount.two && value?.two) {
383
+ forProcessing = value.two;
384
+ } else if (TranslationPluralCount.few <= count && count < TranslationPluralCount.many && value?.few) {
385
+ forProcessing = value.few;
386
+ } else if (count > TranslationPluralCount.many && value?.many) {
387
+ forProcessing = value.many;
388
+ } else {
389
+ forProcessing = value.other;
390
+ }
391
+ } else {
392
+ forProcessing = value;
393
+ }
394
+ forProcessing = forProcessing.replace(/\{\{(\w+)}}/g, (_, placeholder) => {
395
+ return replacements[placeholder] ?? `{{key:${placeholder}}}`;
396
+ });
397
+ return forProcessing;
398
+ }
399
+ } catch (e) {
400
+ console.error(e);
401
+ }
402
+ return `{{${usedLanguage}:${key}}}`;
403
+ };
404
+ };
405
+
406
+ // src/components/dialog/ConfirmDialog.tsx
407
+ import clsx5 from "clsx";
408
+
409
+ // src/components/dialog/Dialog.tsx
410
+ import { useRef as useRef4 } from "react";
411
+ import clsx4 from "clsx";
412
+ import { X } from "lucide-react";
413
+
414
+ // src/localization/defaults/form.ts
415
+ var formTranslation = {
416
+ en: {
417
+ add: "Add",
418
+ all: "All",
419
+ apply: "Apply",
420
+ back: "Back",
421
+ cancel: "Cancel",
422
+ change: "Change",
423
+ clear: "Clear",
424
+ click: "Click",
425
+ clickToCopy: "Click to Copy",
426
+ close: "Close",
427
+ confirm: "Confirm",
428
+ copy: "Copy",
429
+ copied: "Copied",
430
+ create: "Create",
431
+ decline: "Decline",
432
+ delete: "Delete",
433
+ discard: "Discard",
434
+ discardChanges: "Discard Changes",
435
+ done: "Done",
436
+ edit: "Edit",
437
+ enterText: "Enter text here",
438
+ error: "Error",
439
+ exit: "Exit",
440
+ fieldRequiredError: "This field is required.",
441
+ invalidEmailError: "Please enter a valid email address.",
442
+ less: "Less",
443
+ loading: "Loading",
444
+ maxLengthError: "Maximum length exceeded.",
445
+ minLengthError: "Minimum length not met.",
446
+ more: "More",
447
+ next: "Next",
448
+ no: "No",
449
+ none: "None",
450
+ nothingFound: "Nothing found",
451
+ of: "of",
452
+ optional: "Optional",
453
+ pleaseWait: "Please wait...",
454
+ previous: "Previous",
455
+ remove: "Remove",
456
+ required: "Required",
457
+ reset: "Reset",
458
+ save: "Save",
459
+ saved: "Saved",
460
+ search: "Search",
461
+ select: "Select",
462
+ selectOption: "Select an option",
463
+ show: "Show",
464
+ showMore: "Show more",
465
+ showLess: "Show less",
466
+ submit: "Submit",
467
+ success: "Success",
468
+ update: "Update",
469
+ unsavedChanges: "Unsaved Changes",
470
+ unsavedChangesSaveQuestion: "Do you want to save your changes?",
471
+ yes: "Yes"
472
+ },
473
+ de: {
474
+ add: "Hinzuf\xFCgen",
475
+ all: "Alle",
476
+ apply: "Anwenden",
477
+ back: "Zur\xFCck",
478
+ cancel: "Abbrechen",
479
+ change: "\xC4ndern",
480
+ clear: "L\xF6schen",
481
+ click: "Klicken",
482
+ clickToCopy: "Zum kopieren klicken",
483
+ close: "Schlie\xDFen",
484
+ confirm: "Best\xE4tigen",
485
+ copy: "Kopieren",
486
+ copied: "Kopiert",
487
+ create: "Erstellen",
488
+ decline: "Ablehnen",
489
+ delete: "L\xF6schen",
490
+ discard: "Verwerfen",
491
+ discardChanges: "\xC4nderungen Verwerfen",
492
+ done: "Fertig",
493
+ edit: "Bearbeiten",
494
+ enterText: "Text hier eingeben",
495
+ error: "Fehler",
496
+ exit: "Beenden",
497
+ fieldRequiredError: "Dieses Feld ist erforderlich.",
498
+ invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
499
+ less: "Weniger",
500
+ loading: "L\xE4dt",
501
+ maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
502
+ minLengthError: "Mindestl\xE4nge nicht erreicht.",
503
+ more: "Mehr",
504
+ next: "Weiter",
505
+ no: "Nein",
506
+ none: "Nichts",
507
+ nothingFound: "Nichts gefunden",
508
+ of: "von",
509
+ optional: "Optional",
510
+ pleaseWait: "Bitte warten...",
511
+ previous: "Vorherige",
512
+ remove: "Entfernen",
513
+ required: "Erforderlich",
514
+ reset: "Zur\xFCcksetzen",
515
+ save: "Speichern",
516
+ saved: "Gespeichert",
517
+ search: "Suche",
518
+ select: "Select",
519
+ selectOption: "Option ausw\xE4hlen",
520
+ show: "Anzeigen",
521
+ showMore: "Mehr anzeigen",
522
+ showLess: "Weniger anzeigen",
523
+ submit: "Abschicken",
524
+ success: "Erfolg",
525
+ update: "Update",
526
+ unsavedChanges: "Ungespeicherte \xC4nderungen",
527
+ unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
528
+ yes: "Ja"
529
+ }
530
+ };
531
+
532
+ // src/components/layout-and-navigation/FloatingContainer.tsx
533
+ import { forwardRef as forwardRef3, useImperativeHandle as useImperativeHandle2, useRef as useRef2 } from "react";
534
+ import { createPortal } from "react-dom";
535
+ import { clsx as clsx3 } from "clsx";
536
+
537
+ // src/hooks/useFloatingElement.ts
538
+ import { useCallback as useCallback3, useEffect as useEffect5, useState as useState6 } from "react";
539
+
540
+ // src/utils/math.ts
541
+ var clamp = (value, range = [0, 1]) => {
542
+ const [min, max] = range;
543
+ return Math.min(Math.max(value, min), max);
544
+ };
545
+
546
+ // src/hooks/focus/useIsMounted.ts
547
+ import { useEffect as useEffect4, useLayoutEffect, useState as useState5 } from "react";
548
+ var isClient = typeof window !== "undefined" && typeof document !== "undefined";
549
+ var useIsomorphicEffect = isClient ? useLayoutEffect : useEffect4;
550
+ var useIsMounted = () => {
551
+ const [isMounted, setIsMounted] = useState5(false);
552
+ useIsomorphicEffect(() => {
553
+ setIsMounted(true);
554
+ return () => {
555
+ setIsMounted(false);
556
+ };
557
+ }, []);
558
+ return isMounted;
559
+ };
560
+
561
+ // src/hooks/useFloatingElement.ts
562
+ function calculatePosition({
563
+ windowRect,
564
+ containerRect,
565
+ anchorRect,
566
+ options
567
+ }) {
568
+ const { verticalAlignment, horizontalAlignment, gap, screenPadding } = options;
569
+ const windowWidth = windowRect.width;
570
+ const windowHeight = windowRect.height;
571
+ const maxWidth = windowWidth - 2 * screenPadding;
572
+ const maxHeight = windowHeight - 2 * screenPadding;
573
+ const width = Math.min(containerRect.width, maxWidth);
574
+ const height = Math.min(containerRect.height, maxHeight);
575
+ const leftSuggestion = {
576
+ beforeStart: anchorRect.left - width - gap,
577
+ afterStart: anchorRect.left,
578
+ center: anchorRect.left + anchorRect.width / 2 - width / 2,
579
+ beforeEnd: anchorRect.right - width,
580
+ afterEnd: anchorRect.right + gap
581
+ }[horizontalAlignment];
582
+ const topSuggestion = {
583
+ beforeStart: anchorRect.top - height - gap,
584
+ afterStart: anchorRect.top,
585
+ center: anchorRect.top + anchorRect.height / 2 - height / 2,
586
+ beforeEnd: anchorRect.bottom - height,
587
+ afterEnd: anchorRect.bottom + gap
588
+ }[verticalAlignment];
589
+ const left = clamp(leftSuggestion, [
590
+ screenPadding,
591
+ windowWidth - screenPadding - width
592
+ ]);
593
+ const top = clamp(topSuggestion, [
594
+ screenPadding,
595
+ windowHeight - screenPadding - height
596
+ ]);
597
+ return {
598
+ left,
599
+ top,
600
+ maxWidth,
601
+ maxHeight
602
+ };
603
+ }
604
+ function useFloatingElement({
605
+ active = true,
606
+ windowRef,
607
+ anchorRef,
608
+ containerRef,
609
+ isPolling = false,
610
+ pollingInterval = 100,
611
+ verticalAlignment = "afterEnd",
612
+ horizontalAlignment = "afterStart",
613
+ screenPadding = 16,
614
+ gap = 4
615
+ }) {
616
+ const [style, setStyle] = useState6();
617
+ const isMounted = useIsMounted();
618
+ const calculate = useCallback3(() => {
619
+ const containerRect = containerRef.current.getBoundingClientRect();
620
+ const windowRect = windowRef?.current.getBoundingClientRect() ?? {
621
+ top: 0,
622
+ bottom: window.innerHeight,
623
+ left: 0,
624
+ right: window.innerWidth,
625
+ width: window.innerWidth,
626
+ height: window.innerHeight
627
+ };
628
+ const anchorElement = anchorRef?.current;
629
+ if (anchorRef && !anchorElement) {
630
+ console.warn("FloatingContainer anchor provided, but its value is undefined");
631
+ }
632
+ const anchorRect = anchorElement?.getBoundingClientRect() ?? windowRect;
633
+ const calculateProps = {
634
+ windowRect,
635
+ anchorRect,
636
+ containerRect,
637
+ options: {
638
+ horizontalAlignment,
639
+ verticalAlignment,
640
+ screenPadding,
641
+ gap
642
+ }
643
+ };
644
+ setStyle(calculatePosition(calculateProps));
645
+ }, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef]);
646
+ const height = containerRef.current?.getBoundingClientRect().height;
647
+ const width = containerRef.current?.getBoundingClientRect().width;
648
+ useEffect5(() => {
649
+ if (active && isMounted) {
650
+ calculate();
651
+ } else {
652
+ setStyle(void 0);
653
+ }
654
+ }, [calculate, active, isMounted, height, width]);
655
+ useEffect5(() => {
656
+ window.addEventListener("resize", calculate);
657
+ let timeout;
658
+ if (isPolling) {
659
+ timeout = setInterval(calculate, pollingInterval);
660
+ }
661
+ return () => {
662
+ window.removeEventListener("resize", calculate);
663
+ if (timeout) {
664
+ clearInterval(timeout);
665
+ }
666
+ };
667
+ }, [calculate, isPolling, pollingInterval]);
668
+ return style;
669
+ }
670
+
671
+ // src/components/layout-and-navigation/FloatingContainer.tsx
672
+ import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
673
+ var FloatingContainer = forwardRef3(function FloatingContainer2({
674
+ children,
675
+ backgroundOverlay,
676
+ anchor,
677
+ isPolling = false,
678
+ pollingInterval = 100,
679
+ verticalAlignment = "afterEnd",
680
+ horizontalAlignment = "afterStart",
681
+ screenPadding = 16,
682
+ gap = 4,
683
+ ...props
684
+ }, forwardRef4) {
685
+ const innerRef = useRef2(null);
686
+ useImperativeHandle2(forwardRef4, () => innerRef.current);
687
+ const position = useFloatingElement({
688
+ active: !props.hidden,
689
+ containerRef: innerRef,
690
+ anchorRef: anchor,
691
+ isPolling,
692
+ pollingInterval,
693
+ verticalAlignment,
694
+ horizontalAlignment,
695
+ gap,
696
+ screenPadding
697
+ });
698
+ return createPortal(
699
+ /* @__PURE__ */ jsxs2(Fragment, { children: [
700
+ backgroundOverlay,
701
+ /* @__PURE__ */ jsx4(
702
+ "div",
703
+ {
704
+ ...props,
705
+ ref: innerRef,
706
+ style: {
707
+ position: "fixed",
708
+ overflow: "hidden",
709
+ opacity: position ? void 0 : 0,
710
+ // hide when position calculation isn't done yet
711
+ transition: position ? `top ${pollingInterval}ms linear, left ${pollingInterval}ms linear` : void 0,
712
+ ...position,
713
+ ...props.style
714
+ },
715
+ className: clsx3("motion-safe:duration-100 motion-reduce:duration-0", props.className),
716
+ children
717
+ }
718
+ )
719
+ ] }),
720
+ document.body
721
+ );
722
+ });
723
+
724
+ // src/hooks/focus/useFocusTrap.ts
725
+ import { useCallback as useCallback4, useEffect as useEffect6, useId, useRef as useRef3, useState as useState7 } from "react";
726
+ var createFocusGuard = () => {
727
+ const div = document.createElement("div");
728
+ Object.assign(div.style, {
729
+ opacity: "0",
730
+ outline: "none",
731
+ boxShadow: "none",
732
+ position: "fixed",
733
+ pointerEvents: "none",
734
+ touchAction: "none"
735
+ });
736
+ div.tabIndex = 0;
737
+ div.setAttribute("data-hw-focus-guard", "");
738
+ document.body.appendChild(div);
739
+ return div;
740
+ };
741
+ function getContainedFocusableElements(element) {
742
+ return element?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
743
+ }
744
+ var FocusTrapService = class {
745
+ constructor() {
746
+ // The last entry is always the active one
747
+ this.listeners = [];
748
+ this.onFocusIn = (event) => {
749
+ const active = this.getActive();
750
+ if (!active || !active.container.current) return;
751
+ const { container } = active;
752
+ if (!container.current.contains(event.target)) {
753
+ this.focusElement();
754
+ }
755
+ };
756
+ }
757
+ getActive() {
758
+ if (this.listeners.length === 0) return void 0;
759
+ return this.listeners[this.listeners.length - 1];
760
+ }
761
+ focusElement() {
762
+ const active = this.getActive();
763
+ if (!active) return;
764
+ const { container, initialFocusElement } = active;
765
+ const containerElement = container.current;
766
+ if (initialFocusElement?.current) {
767
+ initialFocusElement.current.focus();
768
+ } else {
769
+ const elements = getContainedFocusableElements(containerElement);
770
+ if (elements && elements.length > 0) {
771
+ const first = elements.item(0);
772
+ first.focus();
773
+ } else {
774
+ containerElement.focus();
775
+ }
776
+ }
777
+ }
778
+ removeGuards() {
779
+ document.querySelectorAll("[data-hw-focus-guard]").forEach((node) => node.remove());
780
+ }
781
+ addGuards() {
782
+ document.body.insertAdjacentElement("afterbegin", createFocusGuard());
783
+ document.body.insertAdjacentElement("beforeend", createFocusGuard());
784
+ }
785
+ activate() {
786
+ document.addEventListener("focusin", this.onFocusIn);
787
+ this.addGuards();
788
+ }
789
+ deactivate() {
790
+ document.removeEventListener("focusin", this.onFocusIn);
791
+ this.removeGuards();
792
+ }
793
+ register(listener) {
794
+ this.listeners.push(listener);
795
+ if (this.listeners.length === 1) {
796
+ this.activate();
797
+ }
798
+ const active = listener;
799
+ this.listeners.forEach((listener2) => {
800
+ const { focus, pause } = listener2;
801
+ if (listener2 === active) {
802
+ focus();
803
+ } else {
804
+ pause();
805
+ }
806
+ });
807
+ }
808
+ unregister(id) {
809
+ const index = this.listeners.findIndex((trap) => trap.id === id);
810
+ if (index !== -1) {
811
+ const isActive = index === this.listeners.length - 1;
812
+ const listener = this.listeners[index];
813
+ this.listeners = this.listeners.filter((listener2) => listener2.id !== id);
814
+ if (isActive) {
815
+ this.deactivate();
816
+ listener.focusLast();
817
+ const active = this.getActive();
818
+ this.listeners.forEach((listener2) => {
819
+ const { pause, unpause } = listener2;
820
+ if (listener2 === active) {
821
+ unpause();
822
+ } else {
823
+ pause();
824
+ }
825
+ });
826
+ if (this.listeners.length > 0) {
827
+ this.activate();
828
+ }
829
+ }
830
+ } else {
831
+ console.warn(`Unable to unregister id ${id}: not found`);
832
+ }
833
+ }
834
+ };
835
+ var service = new FocusTrapService();
836
+ var useFocusTrap = ({
837
+ container,
838
+ active = true,
839
+ initialFocus,
840
+ focusFirst = true
841
+ }) => {
842
+ const lastFocusRef = useRef3(null);
843
+ const [paused, setPaused] = useState7(false);
844
+ const isMounted = useIsMounted();
845
+ const id = useId();
846
+ const focusElement = useCallback4(() => {
847
+ const containerElement = container.current;
848
+ if (initialFocus?.current) {
849
+ initialFocus.current.focus();
850
+ } else {
851
+ const elements = getContainedFocusableElements(containerElement);
852
+ if (elements && elements.length > 0) {
853
+ const first = elements.item(0);
854
+ first.focus();
855
+ } else {
856
+ containerElement.focus();
857
+ }
858
+ }
859
+ }, [container, initialFocus]);
860
+ useEffect6(() => {
861
+ if (active && isMounted) {
862
+ let pause = function() {
863
+ setPaused(true);
864
+ }, unpause = function() {
865
+ setPaused(false);
866
+ if (!container.current.contains(document.activeElement)) {
867
+ focusElement();
868
+ }
869
+ }, focus = function() {
870
+ focusElement();
871
+ setPaused(false);
872
+ }, focusLast = function() {
873
+ lastFocusRef.current?.focus();
874
+ };
875
+ if (!lastFocusRef.current) {
876
+ lastFocusRef.current = document.activeElement;
877
+ }
878
+ service.register({ id, pause, focus, focusLast, unpause, container, initialFocusElement: initialFocus });
879
+ return () => {
880
+ service.unregister(id);
881
+ lastFocusRef.current = void 0;
882
+ };
883
+ }
884
+ }, [active, container, focusElement, id, initialFocus, isMounted]);
885
+ useEffect6(() => {
886
+ if (active && !paused && isMounted) {
887
+ let onKeyDown = function(event) {
888
+ const key = event.key;
889
+ const elements = getContainedFocusableElements(containerElement);
890
+ const active2 = document.activeElement;
891
+ const index = [...elements].findIndex((value) => value === active2);
892
+ if (index === -1 || event.altKey || event.ctrlKey || event.metaKey) {
893
+ return;
894
+ }
895
+ if (key === "Tab") {
896
+ const next = event.shiftKey ? -1 : 1;
897
+ const nextIndex = (index + next + elements.length) % elements.length;
898
+ const nextElement = elements[nextIndex];
899
+ nextElement.focus();
900
+ event.preventDefault();
901
+ }
902
+ };
903
+ const containerElement = container.current;
904
+ containerElement.addEventListener("keydown", onKeyDown);
905
+ return () => {
906
+ containerElement.removeEventListener("keydown", onKeyDown);
907
+ };
908
+ }
909
+ }, [active, paused, isMounted, container, initialFocus, focusFirst, focusElement]);
910
+ };
911
+
912
+ // src/hooks/useLogOnce.ts
913
+ import { useEffect as useEffect7, useState as useState8 } from "react";
914
+ var defaultOptions2 = {
915
+ type: "warning"
916
+ };
917
+ var useLogOnce = (message, condition, options) => {
918
+ const [hasLogged, setHasLogged] = useState8(false);
919
+ const { type } = { ...defaultOptions2, ...options };
920
+ useEffect7(() => {
921
+ if (!hasLogged && condition) {
922
+ switch (type) {
923
+ case "info":
924
+ console.info(message);
925
+ break;
926
+ case "error":
927
+ console.error(message);
928
+ break;
929
+ case "warning":
930
+ console.warn(message);
931
+ break;
932
+ }
933
+ setHasLogged(true);
934
+ }
935
+ }, [condition]);
936
+ };
937
+
938
+ // src/components/dialog/Dialog.tsx
939
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
940
+ var Dialog = ({
941
+ children,
942
+ isOpen,
943
+ titleElement,
944
+ description,
945
+ isModal = true,
946
+ onClose,
947
+ horizontalAlignment = "center",
948
+ verticalAlignment = "center",
949
+ className,
950
+ backgroundClassName
951
+ }) => {
952
+ const translation = useTranslation([formTranslation]);
953
+ const ref = useRef4(null);
954
+ const onCloseWrapper = () => {
955
+ if (!isModal) return;
956
+ onClose?.();
957
+ };
958
+ useLogOnce("Dialog: onClose should be defined for modal dialogs", isModal && !onClose);
959
+ useFocusTrap({
960
+ container: ref,
961
+ active: isOpen,
962
+ focusFirst: true
963
+ });
964
+ if (!isOpen) return void 0;
965
+ return /* @__PURE__ */ jsxs3(
966
+ FloatingContainer,
967
+ {
968
+ ref,
969
+ hidden: !isOpen,
970
+ onKeyDown: (event) => {
971
+ if (event.key === "Escape") {
972
+ onCloseWrapper();
973
+ }
974
+ },
975
+ horizontalAlignment,
976
+ verticalAlignment,
977
+ backgroundOverlay: /* @__PURE__ */ jsx5(
978
+ "div",
979
+ {
980
+ className: clsx4(
981
+ "fixed inset-0 h-screen w-screen bg-overlay-shadow",
982
+ {
983
+ "motion-safe:animate-fade-in animation-delay-3000": isOpen,
984
+ "motion-safe:animate-fade-out": !isOpen
985
+ },
986
+ backgroundClassName
987
+ ),
988
+ hidden: !isOpen,
989
+ "aria-hidden": true,
990
+ onClick: onCloseWrapper
991
+ }
992
+ ),
993
+ className: clsx4(
994
+ "flex-col-2 p-4 bg-overlay-background text-overlay-text rounded-xl shadow-hw-bottom",
995
+ {
996
+ "motion-safe:animate-pop-in": isOpen,
997
+ "motion-safe:animate-pop-out": !isOpen
998
+ },
999
+ className
1000
+ ),
1001
+ children: [
1002
+ /* @__PURE__ */ jsx5("div", { className: "typography-title-lg-semibold mr-8", children: titleElement }),
1003
+ /* @__PURE__ */ jsx5("div", { className: "text-description", children: description }),
1004
+ isModal && /* @__PURE__ */ jsx5(
1005
+ "div",
1006
+ {
1007
+ className: "absolute top-0 right-0",
1008
+ style: {
1009
+ paddingTop: "inherit",
1010
+ paddingRight: "inherit"
1011
+ },
1012
+ children: /* @__PURE__ */ jsx5(
1013
+ IconButton,
1014
+ {
1015
+ color: "neutral",
1016
+ size: "tiny",
1017
+ "aria-label": translation("close"),
1018
+ onClick: onCloseWrapper,
1019
+ children: /* @__PURE__ */ jsx5(X, {})
1020
+ }
1021
+ )
1022
+ }
1023
+ ),
1024
+ children
1025
+ ]
1026
+ }
1027
+ );
1028
+ };
1029
+
1030
+ // src/components/dialog/ConfirmDialog.tsx
1031
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
1032
+ var ConfirmDialog = ({
1033
+ overwriteTranslation,
1034
+ children,
1035
+ onCancel,
1036
+ onConfirm,
1037
+ onDecline,
1038
+ confirmType = "positive",
1039
+ buttonOverwrites,
1040
+ className,
1041
+ ...restProps
1042
+ }) => {
1043
+ const translation = useTranslation([formTranslation], overwriteTranslation);
1044
+ const mapping = {
1045
+ neutral: "neutral",
1046
+ negative: "negative",
1047
+ positive: "positive",
1048
+ primary: "primary"
1049
+ };
1050
+ return /* @__PURE__ */ jsxs4(Dialog, { ...restProps, onClose: onCancel, className: clsx5("justify-between", className), children: [
1051
+ /* @__PURE__ */ jsx6("div", { className: "flex-col-2 grow", children }),
1052
+ /* @__PURE__ */ jsxs4("div", { className: "flex-row-4 mt-3 justify-end", children: [
1053
+ onCancel && /* @__PURE__ */ jsx6(
1054
+ SolidButton,
1055
+ {
1056
+ color: buttonOverwrites?.[0].color ?? "neutral",
1057
+ onClick: onCancel,
1058
+ disabled: buttonOverwrites?.[0].disabled ?? false,
1059
+ children: buttonOverwrites?.[0].text ?? translation("cancel")
1060
+ }
1061
+ ),
1062
+ onDecline && /* @__PURE__ */ jsx6(
1063
+ SolidButton,
1064
+ {
1065
+ color: buttonOverwrites?.[1].color ?? "negative",
1066
+ onClick: onDecline,
1067
+ disabled: buttonOverwrites?.[1].disabled ?? false,
1068
+ children: buttonOverwrites?.[1].text ?? translation("decline")
1069
+ }
1070
+ ),
1071
+ /* @__PURE__ */ jsx6(
1072
+ SolidButton,
1073
+ {
1074
+ color: buttonOverwrites?.[2].color ?? mapping[confirmType],
1075
+ onClick: onConfirm,
1076
+ disabled: buttonOverwrites?.[2].disabled ?? false,
1077
+ children: buttonOverwrites?.[2].text ?? translation("confirm")
1078
+ }
1079
+ )
1080
+ ] })
1081
+ ] });
1082
+ };
1083
+
1084
+ // src/components/dialog/InputDialog.tsx
1085
+ import { jsx as jsx7 } from "react/jsx-runtime";
1086
+ var InputDialog = ({
1087
+ inputs,
1088
+ buttonOverwrites,
1089
+ ...props
1090
+ }) => {
1091
+ return /* @__PURE__ */ jsx7(
1092
+ ConfirmDialog,
1093
+ {
1094
+ buttonOverwrites,
1095
+ ...props,
1096
+ children: inputs.map((inputProps, index) => /* @__PURE__ */ jsx7(Input, { ...inputProps }, `input ${index}`))
1097
+ }
1098
+ );
1099
+ };
1100
+ export {
1101
+ InputDialog
1102
+ };
1103
+ //# sourceMappingURL=InputDialog.mjs.map