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