@helpwave/hightide 0.1.46 → 0.1.48

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 (785) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.mts +2014 -0
  3. package/dist/index.d.ts +2014 -113
  4. package/dist/index.js +1619 -1359
  5. package/dist/index.js.map +1 -1
  6. package/dist/{components/index.js → index.mjs} +1216 -410
  7. package/dist/index.mjs.map +1 -0
  8. package/dist/style/globals.css +24 -0
  9. package/package.json +3 -5
  10. package/dist/coloring/index.cjs +0 -85
  11. package/dist/coloring/index.cjs.map +0 -1
  12. package/dist/coloring/index.d.cts +0 -2
  13. package/dist/coloring/index.d.ts +0 -2
  14. package/dist/coloring/index.js +0 -48
  15. package/dist/coloring/index.js.map +0 -1
  16. package/dist/coloring/shading.cjs +0 -81
  17. package/dist/coloring/shading.cjs.map +0 -1
  18. package/dist/coloring/shading.d.cts +0 -5
  19. package/dist/coloring/shading.d.ts +0 -5
  20. package/dist/coloring/shading.js +0 -47
  21. package/dist/coloring/shading.js.map +0 -1
  22. package/dist/coloring/types.cjs +0 -30
  23. package/dist/coloring/types.cjs.map +0 -1
  24. package/dist/coloring/types.d.cts +0 -13
  25. package/dist/coloring/types.d.ts +0 -13
  26. package/dist/coloring/types.js +0 -6
  27. package/dist/coloring/types.js.map +0 -1
  28. package/dist/components/branding/HelpwaveBadge.cjs +0 -140
  29. package/dist/components/branding/HelpwaveBadge.cjs.map +0 -1
  30. package/dist/components/branding/HelpwaveBadge.d.cts +0 -13
  31. package/dist/components/branding/HelpwaveBadge.d.ts +0 -13
  32. package/dist/components/branding/HelpwaveBadge.js +0 -104
  33. package/dist/components/branding/HelpwaveBadge.js.map +0 -1
  34. package/dist/components/branding/index.cjs +0 -140
  35. package/dist/components/branding/index.cjs.map +0 -1
  36. package/dist/components/branding/index.d.cts +0 -3
  37. package/dist/components/branding/index.d.ts +0 -3
  38. package/dist/components/branding/index.js +0 -104
  39. package/dist/components/branding/index.js.map +0 -1
  40. package/dist/components/date/DatePicker.cjs +0 -1318
  41. package/dist/components/date/DatePicker.cjs.map +0 -1
  42. package/dist/components/date/DatePicker.d.cts +0 -26
  43. package/dist/components/date/DatePicker.d.ts +0 -26
  44. package/dist/components/date/DatePicker.js +0 -1283
  45. package/dist/components/date/DatePicker.js.map +0 -1
  46. package/dist/components/date/DayPicker.cjs +0 -261
  47. package/dist/components/date/DayPicker.cjs.map +0 -1
  48. package/dist/components/date/DayPicker.d.cts +0 -20
  49. package/dist/components/date/DayPicker.d.ts +0 -20
  50. package/dist/components/date/DayPicker.js +0 -224
  51. package/dist/components/date/DayPicker.js.map +0 -1
  52. package/dist/components/date/TimeDisplay.cjs +0 -638
  53. package/dist/components/date/TimeDisplay.cjs.map +0 -1
  54. package/dist/components/date/TimeDisplay.d.cts +0 -13
  55. package/dist/components/date/TimeDisplay.d.ts +0 -13
  56. package/dist/components/date/TimeDisplay.js +0 -612
  57. package/dist/components/date/TimeDisplay.js.map +0 -1
  58. package/dist/components/date/TimePicker.cjs +0 -237
  59. package/dist/components/date/TimePicker.cjs.map +0 -1
  60. package/dist/components/date/TimePicker.d.cts +0 -15
  61. package/dist/components/date/TimePicker.d.ts +0 -15
  62. package/dist/components/date/TimePicker.js +0 -202
  63. package/dist/components/date/TimePicker.js.map +0 -1
  64. package/dist/components/date/YearMonthPicker.cjs +0 -536
  65. package/dist/components/date/YearMonthPicker.cjs.map +0 -1
  66. package/dist/components/date/YearMonthPicker.d.cts +0 -15
  67. package/dist/components/date/YearMonthPicker.d.ts +0 -15
  68. package/dist/components/date/YearMonthPicker.js +0 -501
  69. package/dist/components/date/YearMonthPicker.js.map +0 -1
  70. package/dist/components/date/index.cjs +0 -1556
  71. package/dist/components/date/index.cjs.map +0 -1
  72. package/dist/components/date/index.d.cts +0 -7
  73. package/dist/components/date/index.d.ts +0 -7
  74. package/dist/components/date/index.js +0 -1512
  75. package/dist/components/date/index.js.map +0 -1
  76. package/dist/components/dialog/ConfirmDialog.cjs +0 -1165
  77. package/dist/components/dialog/ConfirmDialog.cjs.map +0 -1
  78. package/dist/components/dialog/ConfirmDialog.d.cts +0 -29
  79. package/dist/components/dialog/ConfirmDialog.d.ts +0 -29
  80. package/dist/components/dialog/ConfirmDialog.js +0 -1129
  81. package/dist/components/dialog/ConfirmDialog.js.map +0 -1
  82. package/dist/components/dialog/Dialog.cjs +0 -1108
  83. package/dist/components/dialog/Dialog.cjs.map +0 -1
  84. package/dist/components/dialog/Dialog.d.cts +0 -27
  85. package/dist/components/dialog/Dialog.d.ts +0 -27
  86. package/dist/components/dialog/Dialog.js +0 -1075
  87. package/dist/components/dialog/Dialog.js.map +0 -1
  88. package/dist/components/dialog/DiscardChangesDialog.cjs +0 -1192
  89. package/dist/components/dialog/DiscardChangesDialog.cjs.map +0 -1
  90. package/dist/components/dialog/DiscardChangesDialog.d.cts +0 -18
  91. package/dist/components/dialog/DiscardChangesDialog.d.ts +0 -18
  92. package/dist/components/dialog/DiscardChangesDialog.js +0 -1156
  93. package/dist/components/dialog/DiscardChangesDialog.js.map +0 -1
  94. package/dist/components/dialog/InputDialog.cjs +0 -1369
  95. package/dist/components/dialog/InputDialog.cjs.map +0 -1
  96. package/dist/components/dialog/InputDialog.d.cts +0 -17
  97. package/dist/components/dialog/InputDialog.d.ts +0 -17
  98. package/dist/components/dialog/InputDialog.js +0 -1333
  99. package/dist/components/dialog/InputDialog.js.map +0 -1
  100. package/dist/components/dialog/LanguageDialog.cjs +0 -2149
  101. package/dist/components/dialog/LanguageDialog.cjs.map +0 -1
  102. package/dist/components/dialog/LanguageDialog.d.cts +0 -16
  103. package/dist/components/dialog/LanguageDialog.d.ts +0 -16
  104. package/dist/components/dialog/LanguageDialog.js +0 -2124
  105. package/dist/components/dialog/LanguageDialog.js.map +0 -1
  106. package/dist/components/dialog/ThemeDialog.cjs +0 -2188
  107. package/dist/components/dialog/ThemeDialog.cjs.map +0 -1
  108. package/dist/components/dialog/ThemeDialog.d.cts +0 -16
  109. package/dist/components/dialog/ThemeDialog.d.ts +0 -16
  110. package/dist/components/dialog/ThemeDialog.js +0 -2163
  111. package/dist/components/dialog/ThemeDialog.js.map +0 -1
  112. package/dist/components/dialog/index.cjs +0 -2516
  113. package/dist/components/dialog/index.cjs.map +0 -1
  114. package/dist/components/dialog/index.d.cts +0 -11
  115. package/dist/components/dialog/index.d.ts +0 -11
  116. package/dist/components/dialog/index.js +0 -2486
  117. package/dist/components/dialog/index.js.map +0 -1
  118. package/dist/components/form/FormElementWrapper.cjs +0 -167
  119. package/dist/components/form/FormElementWrapper.cjs.map +0 -1
  120. package/dist/components/form/FormElementWrapper.d.cts +0 -35
  121. package/dist/components/form/FormElementWrapper.d.ts +0 -35
  122. package/dist/components/form/FormElementWrapper.js +0 -133
  123. package/dist/components/form/FormElementWrapper.js.map +0 -1
  124. package/dist/components/form/index.cjs +0 -169
  125. package/dist/components/form/index.cjs.map +0 -1
  126. package/dist/components/form/index.d.cts +0 -5
  127. package/dist/components/form/index.d.ts +0 -5
  128. package/dist/components/form/index.js +0 -133
  129. package/dist/components/form/index.js.map +0 -1
  130. package/dist/components/icons-and-geometry/Avatar.cjs +0 -670
  131. package/dist/components/icons-and-geometry/Avatar.cjs.map +0 -1
  132. package/dist/components/icons-and-geometry/Avatar.d.cts +0 -36
  133. package/dist/components/icons-and-geometry/Avatar.d.ts +0 -36
  134. package/dist/components/icons-and-geometry/Avatar.js +0 -663
  135. package/dist/components/icons-and-geometry/Avatar.js.map +0 -1
  136. package/dist/components/icons-and-geometry/Circle.cjs +0 -61
  137. package/dist/components/icons-and-geometry/Circle.cjs.map +0 -1
  138. package/dist/components/icons-and-geometry/Circle.d.cts +0 -10
  139. package/dist/components/icons-and-geometry/Circle.d.ts +0 -10
  140. package/dist/components/icons-and-geometry/Circle.js +0 -27
  141. package/dist/components/icons-and-geometry/Circle.js.map +0 -1
  142. package/dist/components/icons-and-geometry/HelpwaveLogo.cjs +0 -98
  143. package/dist/components/icons-and-geometry/HelpwaveLogo.cjs.map +0 -1
  144. package/dist/components/icons-and-geometry/HelpwaveLogo.d.cts +0 -14
  145. package/dist/components/icons-and-geometry/HelpwaveLogo.d.ts +0 -14
  146. package/dist/components/icons-and-geometry/HelpwaveLogo.js +0 -74
  147. package/dist/components/icons-and-geometry/HelpwaveLogo.js.map +0 -1
  148. package/dist/components/icons-and-geometry/Ring.cjs +0 -333
  149. package/dist/components/icons-and-geometry/Ring.cjs.map +0 -1
  150. package/dist/components/icons-and-geometry/Ring.d.cts +0 -35
  151. package/dist/components/icons-and-geometry/Ring.d.ts +0 -35
  152. package/dist/components/icons-and-geometry/Ring.js +0 -296
  153. package/dist/components/icons-and-geometry/Ring.js.map +0 -1
  154. package/dist/components/icons-and-geometry/Tag.cjs +0 -2945
  155. package/dist/components/icons-and-geometry/Tag.cjs.map +0 -1
  156. package/dist/components/icons-and-geometry/Tag.d.cts +0 -16
  157. package/dist/components/icons-and-geometry/Tag.d.ts +0 -16
  158. package/dist/components/icons-and-geometry/Tag.js +0 -2940
  159. package/dist/components/icons-and-geometry/Tag.js.map +0 -1
  160. package/dist/components/icons-and-geometry/index.cjs +0 -3950
  161. package/dist/components/icons-and-geometry/index.cjs.map +0 -1
  162. package/dist/components/icons-and-geometry/index.d.cts +0 -7
  163. package/dist/components/icons-and-geometry/index.d.ts +0 -7
  164. package/dist/components/icons-and-geometry/index.js +0 -3934
  165. package/dist/components/icons-and-geometry/index.js.map +0 -1
  166. package/dist/components/index.cjs +0 -15692
  167. package/dist/components/index.cjs.map +0 -1
  168. package/dist/components/index.d.cts +0 -78
  169. package/dist/components/index.d.ts +0 -78
  170. package/dist/components/index.js.map +0 -1
  171. package/dist/components/layout/Carousel.cjs +0 -1128
  172. package/dist/components/layout/Carousel.cjs.map +0 -1
  173. package/dist/components/layout/Carousel.d.cts +0 -35
  174. package/dist/components/layout/Carousel.d.ts +0 -35
  175. package/dist/components/layout/Carousel.js +0 -1103
  176. package/dist/components/layout/Carousel.js.map +0 -1
  177. package/dist/components/layout/Chip.cjs +0 -123
  178. package/dist/components/layout/Chip.cjs.map +0 -1
  179. package/dist/components/layout/Chip.d.cts +0 -31
  180. package/dist/components/layout/Chip.d.ts +0 -31
  181. package/dist/components/layout/Chip.js +0 -87
  182. package/dist/components/layout/Chip.js.map +0 -1
  183. package/dist/components/layout/DividerInserter.cjs +0 -59
  184. package/dist/components/layout/DividerInserter.cjs.map +0 -1
  185. package/dist/components/layout/DividerInserter.d.cts +0 -15
  186. package/dist/components/layout/DividerInserter.d.ts +0 -15
  187. package/dist/components/layout/DividerInserter.js +0 -25
  188. package/dist/components/layout/DividerInserter.js.map +0 -1
  189. package/dist/components/layout/Expandable.cjs +0 -171
  190. package/dist/components/layout/Expandable.cjs.map +0 -1
  191. package/dist/components/layout/Expandable.d.cts +0 -67
  192. package/dist/components/layout/Expandable.d.ts +0 -67
  193. package/dist/components/layout/Expandable.js +0 -135
  194. package/dist/components/layout/Expandable.js.map +0 -1
  195. package/dist/components/layout/FAQSection.cjs +0 -421
  196. package/dist/components/layout/FAQSection.cjs.map +0 -1
  197. package/dist/components/layout/FAQSection.d.cts +0 -26
  198. package/dist/components/layout/FAQSection.d.ts +0 -26
  199. package/dist/components/layout/FAQSection.js +0 -387
  200. package/dist/components/layout/FAQSection.js.map +0 -1
  201. package/dist/components/layout/FloatingContainer.cjs +0 -220
  202. package/dist/components/layout/FloatingContainer.cjs.map +0 -1
  203. package/dist/components/layout/FloatingContainer.d.cts +0 -38
  204. package/dist/components/layout/FloatingContainer.d.ts +0 -38
  205. package/dist/components/layout/FloatingContainer.js +0 -196
  206. package/dist/components/layout/FloatingContainer.js.map +0 -1
  207. package/dist/components/layout/ListBox.cjs +0 -339
  208. package/dist/components/layout/ListBox.cjs.map +0 -1
  209. package/dist/components/layout/ListBox.d.cts +0 -44
  210. package/dist/components/layout/ListBox.d.ts +0 -44
  211. package/dist/components/layout/ListBox.js +0 -300
  212. package/dist/components/layout/ListBox.js.map +0 -1
  213. package/dist/components/layout/MarkdownInterpreter.cjs +0 -260
  214. package/dist/components/layout/MarkdownInterpreter.cjs.map +0 -1
  215. package/dist/components/layout/MarkdownInterpreter.d.cts +0 -28
  216. package/dist/components/layout/MarkdownInterpreter.d.ts +0 -28
  217. package/dist/components/layout/MarkdownInterpreter.js +0 -235
  218. package/dist/components/layout/MarkdownInterpreter.js.map +0 -1
  219. package/dist/components/layout/ScrollArea.cjs +0 -1252
  220. package/dist/components/layout/ScrollArea.cjs.map +0 -1
  221. package/dist/components/layout/ScrollArea.d.cts +0 -15
  222. package/dist/components/layout/ScrollArea.d.ts +0 -15
  223. package/dist/components/layout/ScrollArea.js +0 -1216
  224. package/dist/components/layout/ScrollArea.js.map +0 -1
  225. package/dist/components/layout/TextImage.cjs +0 -657
  226. package/dist/components/layout/TextImage.cjs.map +0 -1
  227. package/dist/components/layout/TextImage.d.cts +0 -19
  228. package/dist/components/layout/TextImage.d.ts +0 -19
  229. package/dist/components/layout/TextImage.js +0 -623
  230. package/dist/components/layout/TextImage.js.map +0 -1
  231. package/dist/components/layout/VerticalDivider.cjs +0 -80
  232. package/dist/components/layout/VerticalDivider.cjs.map +0 -1
  233. package/dist/components/layout/VerticalDivider.d.cts +0 -15
  234. package/dist/components/layout/VerticalDivider.d.ts +0 -15
  235. package/dist/components/layout/VerticalDivider.js +0 -56
  236. package/dist/components/layout/VerticalDivider.js.map +0 -1
  237. package/dist/components/layout/index.cjs +0 -3434
  238. package/dist/components/layout/index.cjs.map +0 -1
  239. package/dist/components/layout/index.d.cts +0 -15
  240. package/dist/components/layout/index.d.ts +0 -15
  241. package/dist/components/layout/index.js +0 -3387
  242. package/dist/components/layout/index.js.map +0 -1
  243. package/dist/components/loading-states/ErrorComponent.cjs +0 -622
  244. package/dist/components/loading-states/ErrorComponent.cjs.map +0 -1
  245. package/dist/components/loading-states/ErrorComponent.d.cts +0 -12
  246. package/dist/components/loading-states/ErrorComponent.d.ts +0 -12
  247. package/dist/components/loading-states/ErrorComponent.js +0 -588
  248. package/dist/components/loading-states/ErrorComponent.js.map +0 -1
  249. package/dist/components/loading-states/LoadingAndErrorComponent.cjs +0 -67
  250. package/dist/components/loading-states/LoadingAndErrorComponent.cjs.map +0 -1
  251. package/dist/components/loading-states/LoadingAndErrorComponent.d.cts +0 -20
  252. package/dist/components/loading-states/LoadingAndErrorComponent.d.ts +0 -20
  253. package/dist/components/loading-states/LoadingAndErrorComponent.js +0 -43
  254. package/dist/components/loading-states/LoadingAndErrorComponent.js.map +0 -1
  255. package/dist/components/loading-states/LoadingAnimation.cjs +0 -694
  256. package/dist/components/loading-states/LoadingAnimation.cjs.map +0 -1
  257. package/dist/components/loading-states/LoadingAnimation.d.cts +0 -12
  258. package/dist/components/loading-states/LoadingAnimation.d.ts +0 -12
  259. package/dist/components/loading-states/LoadingAnimation.js +0 -658
  260. package/dist/components/loading-states/LoadingAnimation.js.map +0 -1
  261. package/dist/components/loading-states/LoadingButton.cjs +0 -257
  262. package/dist/components/loading-states/LoadingButton.cjs.map +0 -1
  263. package/dist/components/loading-states/LoadingButton.d.cts +0 -10
  264. package/dist/components/loading-states/LoadingButton.d.ts +0 -10
  265. package/dist/components/loading-states/LoadingButton.js +0 -223
  266. package/dist/components/loading-states/LoadingButton.js.map +0 -1
  267. package/dist/components/loading-states/LoadingContainer.cjs +0 -34
  268. package/dist/components/loading-states/LoadingContainer.cjs.map +0 -1
  269. package/dist/components/loading-states/LoadingContainer.d.cts +0 -8
  270. package/dist/components/loading-states/LoadingContainer.d.ts +0 -8
  271. package/dist/components/loading-states/LoadingContainer.js +0 -10
  272. package/dist/components/loading-states/LoadingContainer.js.map +0 -1
  273. package/dist/components/loading-states/ProgressIndicator.cjs +0 -83
  274. package/dist/components/loading-states/ProgressIndicator.cjs.map +0 -1
  275. package/dist/components/loading-states/ProgressIndicator.d.cts +0 -24
  276. package/dist/components/loading-states/ProgressIndicator.d.ts +0 -24
  277. package/dist/components/loading-states/ProgressIndicator.js +0 -59
  278. package/dist/components/loading-states/ProgressIndicator.js.map +0 -1
  279. package/dist/components/loading-states/index.cjs +0 -966
  280. package/dist/components/loading-states/index.cjs.map +0 -1
  281. package/dist/components/loading-states/index.d.cts +0 -9
  282. package/dist/components/loading-states/index.d.ts +0 -9
  283. package/dist/components/loading-states/index.js +0 -925
  284. package/dist/components/loading-states/index.js.map +0 -1
  285. package/dist/components/navigation/BreadCrumb.cjs +0 -3516
  286. package/dist/components/navigation/BreadCrumb.cjs.map +0 -1
  287. package/dist/components/navigation/BreadCrumb.d.cts +0 -20
  288. package/dist/components/navigation/BreadCrumb.d.ts +0 -20
  289. package/dist/components/navigation/BreadCrumb.js +0 -3511
  290. package/dist/components/navigation/BreadCrumb.js.map +0 -1
  291. package/dist/components/navigation/Navigation.cjs +0 -4041
  292. package/dist/components/navigation/Navigation.cjs.map +0 -1
  293. package/dist/components/navigation/Navigation.d.cts +0 -21
  294. package/dist/components/navigation/Navigation.d.ts +0 -21
  295. package/dist/components/navigation/Navigation.js +0 -4035
  296. package/dist/components/navigation/Navigation.js.map +0 -1
  297. package/dist/components/navigation/Pagination.cjs +0 -1007
  298. package/dist/components/navigation/Pagination.cjs.map +0 -1
  299. package/dist/components/navigation/Pagination.d.cts +0 -16
  300. package/dist/components/navigation/Pagination.d.ts +0 -16
  301. package/dist/components/navigation/Pagination.js +0 -973
  302. package/dist/components/navigation/Pagination.js.map +0 -1
  303. package/dist/components/navigation/StepperBar.cjs +0 -903
  304. package/dist/components/navigation/StepperBar.cjs.map +0 -1
  305. package/dist/components/navigation/StepperBar.d.cts +0 -23
  306. package/dist/components/navigation/StepperBar.d.ts +0 -23
  307. package/dist/components/navigation/StepperBar.js +0 -868
  308. package/dist/components/navigation/StepperBar.js.map +0 -1
  309. package/dist/components/navigation/index.cjs +0 -5035
  310. package/dist/components/navigation/index.cjs.map +0 -1
  311. package/dist/components/navigation/index.d.cts +0 -6
  312. package/dist/components/navigation/index.d.ts +0 -6
  313. package/dist/components/navigation/index.js +0 -5023
  314. package/dist/components/navigation/index.js.map +0 -1
  315. package/dist/components/properties/CheckboxProperty.cjs +0 -1736
  316. package/dist/components/properties/CheckboxProperty.cjs.map +0 -1
  317. package/dist/components/properties/CheckboxProperty.d.cts +0 -14
  318. package/dist/components/properties/CheckboxProperty.d.ts +0 -14
  319. package/dist/components/properties/CheckboxProperty.js +0 -1702
  320. package/dist/components/properties/CheckboxProperty.js.map +0 -1
  321. package/dist/components/properties/DateProperty.cjs +0 -1119
  322. package/dist/components/properties/DateProperty.cjs.map +0 -1
  323. package/dist/components/properties/DateProperty.d.cts +0 -16
  324. package/dist/components/properties/DateProperty.d.ts +0 -16
  325. package/dist/components/properties/DateProperty.js +0 -1085
  326. package/dist/components/properties/DateProperty.js.map +0 -1
  327. package/dist/components/properties/MultiSelectProperty.cjs +0 -2058
  328. package/dist/components/properties/MultiSelectProperty.cjs.map +0 -1
  329. package/dist/components/properties/MultiSelectProperty.d.cts +0 -14
  330. package/dist/components/properties/MultiSelectProperty.d.ts +0 -14
  331. package/dist/components/properties/MultiSelectProperty.js +0 -2035
  332. package/dist/components/properties/MultiSelectProperty.js.map +0 -1
  333. package/dist/components/properties/NumberProperty.cjs +0 -1125
  334. package/dist/components/properties/NumberProperty.cjs.map +0 -1
  335. package/dist/components/properties/NumberProperty.d.cts +0 -16
  336. package/dist/components/properties/NumberProperty.d.ts +0 -16
  337. package/dist/components/properties/NumberProperty.js +0 -1091
  338. package/dist/components/properties/NumberProperty.js.map +0 -1
  339. package/dist/components/properties/PropertyBase.cjs +0 -875
  340. package/dist/components/properties/PropertyBase.cjs.map +0 -1
  341. package/dist/components/properties/PropertyBase.d.cts +0 -22
  342. package/dist/components/properties/PropertyBase.d.ts +0 -22
  343. package/dist/components/properties/PropertyBase.js +0 -841
  344. package/dist/components/properties/PropertyBase.js.map +0 -1
  345. package/dist/components/properties/SelectProperty.cjs +0 -2058
  346. package/dist/components/properties/SelectProperty.cjs.map +0 -1
  347. package/dist/components/properties/SelectProperty.d.cts +0 -16
  348. package/dist/components/properties/SelectProperty.d.ts +0 -16
  349. package/dist/components/properties/SelectProperty.js +0 -2035
  350. package/dist/components/properties/SelectProperty.js.map +0 -1
  351. package/dist/components/properties/TextProperty.cjs +0 -1033
  352. package/dist/components/properties/TextProperty.cjs.map +0 -1
  353. package/dist/components/properties/TextProperty.d.cts +0 -15
  354. package/dist/components/properties/TextProperty.d.ts +0 -15
  355. package/dist/components/properties/TextProperty.js +0 -999
  356. package/dist/components/properties/TextProperty.js.map +0 -1
  357. package/dist/components/properties/index.cjs +0 -3383
  358. package/dist/components/properties/index.cjs.map +0 -1
  359. package/dist/components/properties/index.d.cts +0 -9
  360. package/dist/components/properties/index.d.ts +0 -9
  361. package/dist/components/properties/index.js +0 -3352
  362. package/dist/components/properties/index.js.map +0 -1
  363. package/dist/components/table/FillerRowElement.cjs +0 -36
  364. package/dist/components/table/FillerRowElement.cjs.map +0 -1
  365. package/dist/components/table/FillerRowElement.d.cts +0 -8
  366. package/dist/components/table/FillerRowElement.d.ts +0 -8
  367. package/dist/components/table/FillerRowElement.js +0 -12
  368. package/dist/components/table/FillerRowElement.js.map +0 -1
  369. package/dist/components/table/Filter.cjs +0 -41
  370. package/dist/components/table/Filter.cjs.map +0 -1
  371. package/dist/components/table/Filter.d.cts +0 -5
  372. package/dist/components/table/Filter.d.ts +0 -5
  373. package/dist/components/table/Filter.js +0 -17
  374. package/dist/components/table/Filter.js.map +0 -1
  375. package/dist/components/table/Table.cjs +0 -2678
  376. package/dist/components/table/Table.cjs.map +0 -1
  377. package/dist/components/table/Table.d.cts +0 -42
  378. package/dist/components/table/Table.d.ts +0 -42
  379. package/dist/components/table/Table.js +0 -2649
  380. package/dist/components/table/Table.js.map +0 -1
  381. package/dist/components/table/TableCell.cjs +0 -37
  382. package/dist/components/table/TableCell.cjs.map +0 -1
  383. package/dist/components/table/TableCell.d.cts +0 -9
  384. package/dist/components/table/TableCell.d.ts +0 -9
  385. package/dist/components/table/TableCell.js +0 -13
  386. package/dist/components/table/TableCell.js.map +0 -1
  387. package/dist/components/table/TableFilterButton.cjs +0 -1269
  388. package/dist/components/table/TableFilterButton.cjs.map +0 -1
  389. package/dist/components/table/TableFilterButton.d.cts +0 -11
  390. package/dist/components/table/TableFilterButton.d.ts +0 -11
  391. package/dist/components/table/TableFilterButton.js +0 -1233
  392. package/dist/components/table/TableFilterButton.js.map +0 -1
  393. package/dist/components/table/TableSortButton.cjs +0 -206
  394. package/dist/components/table/TableSortButton.cjs.map +0 -1
  395. package/dist/components/table/TableSortButton.d.cts +0 -15
  396. package/dist/components/table/TableSortButton.d.ts +0 -15
  397. package/dist/components/table/TableSortButton.js +0 -172
  398. package/dist/components/table/TableSortButton.js.map +0 -1
  399. package/dist/components/table/index.cjs +0 -2690
  400. package/dist/components/table/index.cjs.map +0 -1
  401. package/dist/components/table/index.d.cts +0 -10
  402. package/dist/components/table/index.d.ts +0 -10
  403. package/dist/components/table/index.js +0 -2654
  404. package/dist/components/table/index.js.map +0 -1
  405. package/dist/components/user-action/Button.cjs +0 -308
  406. package/dist/components/user-action/Button.cjs.map +0 -1
  407. package/dist/components/user-action/Button.d.cts +0 -104
  408. package/dist/components/user-action/Button.d.ts +0 -104
  409. package/dist/components/user-action/Button.js +0 -268
  410. package/dist/components/user-action/Button.js.map +0 -1
  411. package/dist/components/user-action/Checkbox.cjs +0 -878
  412. package/dist/components/user-action/Checkbox.cjs.map +0 -1
  413. package/dist/components/user-action/Checkbox.d.cts +0 -25
  414. package/dist/components/user-action/Checkbox.d.ts +0 -25
  415. package/dist/components/user-action/Checkbox.js +0 -843
  416. package/dist/components/user-action/Checkbox.js.map +0 -1
  417. package/dist/components/user-action/CopyToClipboardWrapper.cjs +0 -695
  418. package/dist/components/user-action/CopyToClipboardWrapper.cjs.map +0 -1
  419. package/dist/components/user-action/CopyToClipboardWrapper.d.cts +0 -30
  420. package/dist/components/user-action/CopyToClipboardWrapper.d.ts +0 -30
  421. package/dist/components/user-action/CopyToClipboardWrapper.js +0 -671
  422. package/dist/components/user-action/CopyToClipboardWrapper.js.map +0 -1
  423. package/dist/components/user-action/DateAndTimePicker.cjs +0 -1492
  424. package/dist/components/user-action/DateAndTimePicker.cjs.map +0 -1
  425. package/dist/components/user-action/DateAndTimePicker.d.cts +0 -25
  426. package/dist/components/user-action/DateAndTimePicker.d.ts +0 -25
  427. package/dist/components/user-action/DateAndTimePicker.js +0 -1458
  428. package/dist/components/user-action/DateAndTimePicker.js.map +0 -1
  429. package/dist/components/user-action/Label.cjs +0 -53
  430. package/dist/components/user-action/Label.cjs.map +0 -1
  431. package/dist/components/user-action/Label.d.cts +0 -14
  432. package/dist/components/user-action/Label.d.ts +0 -14
  433. package/dist/components/user-action/Label.js +0 -19
  434. package/dist/components/user-action/Label.js.map +0 -1
  435. package/dist/components/user-action/Menu.cjs +0 -282
  436. package/dist/components/user-action/Menu.cjs.map +0 -1
  437. package/dist/components/user-action/Menu.d.cts +0 -35
  438. package/dist/components/user-action/Menu.d.ts +0 -35
  439. package/dist/components/user-action/Menu.js +0 -247
  440. package/dist/components/user-action/Menu.js.map +0 -1
  441. package/dist/components/user-action/ScrollPicker.cjs +0 -301
  442. package/dist/components/user-action/ScrollPicker.cjs.map +0 -1
  443. package/dist/components/user-action/ScrollPicker.d.cts +0 -15
  444. package/dist/components/user-action/ScrollPicker.d.ts +0 -15
  445. package/dist/components/user-action/ScrollPicker.js +0 -267
  446. package/dist/components/user-action/ScrollPicker.js.map +0 -1
  447. package/dist/components/user-action/SearchBar.cjs +0 -956
  448. package/dist/components/user-action/SearchBar.cjs.map +0 -1
  449. package/dist/components/user-action/SearchBar.d.cts +0 -13
  450. package/dist/components/user-action/SearchBar.d.ts +0 -13
  451. package/dist/components/user-action/SearchBar.js +0 -920
  452. package/dist/components/user-action/SearchBar.js.map +0 -1
  453. package/dist/components/user-action/Textarea.cjs +0 -231
  454. package/dist/components/user-action/Textarea.cjs.map +0 -1
  455. package/dist/components/user-action/Textarea.d.cts +0 -41
  456. package/dist/components/user-action/Textarea.d.ts +0 -41
  457. package/dist/components/user-action/Textarea.js +0 -195
  458. package/dist/components/user-action/Textarea.js.map +0 -1
  459. package/dist/components/user-action/Tooltip.cjs +0 -139
  460. package/dist/components/user-action/Tooltip.cjs.map +0 -1
  461. package/dist/components/user-action/Tooltip.d.cts +0 -37
  462. package/dist/components/user-action/Tooltip.d.ts +0 -37
  463. package/dist/components/user-action/Tooltip.js +0 -113
  464. package/dist/components/user-action/Tooltip.js.map +0 -1
  465. package/dist/components/user-action/index.cjs +0 -4564
  466. package/dist/components/user-action/index.cjs.map +0 -1
  467. package/dist/components/user-action/index.d.cts +0 -26
  468. package/dist/components/user-action/index.d.ts +0 -26
  469. package/dist/components/user-action/index.js +0 -4503
  470. package/dist/components/user-action/index.js.map +0 -1
  471. package/dist/components/user-action/input/Input.cjs +0 -260
  472. package/dist/components/user-action/input/Input.cjs.map +0 -1
  473. package/dist/components/user-action/input/Input.d.cts +0 -37
  474. package/dist/components/user-action/input/Input.d.ts +0 -37
  475. package/dist/components/user-action/input/Input.js +0 -225
  476. package/dist/components/user-action/input/Input.js.map +0 -1
  477. package/dist/components/user-action/input/InsideLabelInput.cjs +0 -312
  478. package/dist/components/user-action/input/InsideLabelInput.cjs.map +0 -1
  479. package/dist/components/user-action/input/InsideLabelInput.d.cts +0 -20
  480. package/dist/components/user-action/input/InsideLabelInput.d.ts +0 -20
  481. package/dist/components/user-action/input/InsideLabelInput.js +0 -277
  482. package/dist/components/user-action/input/InsideLabelInput.js.map +0 -1
  483. package/dist/components/user-action/input/ToggleableInput.cjs +0 -315
  484. package/dist/components/user-action/input/ToggleableInput.cjs.map +0 -1
  485. package/dist/components/user-action/input/ToggleableInput.d.cts +0 -22
  486. package/dist/components/user-action/input/ToggleableInput.d.ts +0 -22
  487. package/dist/components/user-action/input/ToggleableInput.js +0 -280
  488. package/dist/components/user-action/input/ToggleableInput.js.map +0 -1
  489. package/dist/components/user-action/input/index.cjs +0 -403
  490. package/dist/components/user-action/input/index.cjs.map +0 -1
  491. package/dist/components/user-action/input/index.d.cts +0 -6
  492. package/dist/components/user-action/input/index.d.ts +0 -6
  493. package/dist/components/user-action/input/index.js +0 -362
  494. package/dist/components/user-action/input/index.js.map +0 -1
  495. package/dist/components/user-action/select/Select.cjs +0 -1970
  496. package/dist/components/user-action/select/Select.cjs.map +0 -1
  497. package/dist/components/user-action/select/Select.d.cts +0 -104
  498. package/dist/components/user-action/select/Select.d.ts +0 -104
  499. package/dist/components/user-action/select/Select.js +0 -1937
  500. package/dist/components/user-action/select/Select.js.map +0 -1
  501. package/dist/components/user-action/select/index.cjs +0 -1972
  502. package/dist/components/user-action/select/index.cjs.map +0 -1
  503. package/dist/components/user-action/select/index.d.cts +0 -4
  504. package/dist/components/user-action/select/index.d.ts +0 -4
  505. package/dist/components/user-action/select/index.js +0 -1937
  506. package/dist/components/user-action/select/index.js.map +0 -1
  507. package/dist/components/utils/FocusTrap.cjs +0 -252
  508. package/dist/components/utils/FocusTrap.cjs.map +0 -1
  509. package/dist/components/utils/FocusTrap.d.cts +0 -28
  510. package/dist/components/utils/FocusTrap.d.ts +0 -28
  511. package/dist/components/utils/FocusTrap.js +0 -229
  512. package/dist/components/utils/FocusTrap.js.map +0 -1
  513. package/dist/components/utils/Transition.cjs +0 -74
  514. package/dist/components/utils/Transition.cjs.map +0 -1
  515. package/dist/components/utils/Transition.d.cts +0 -26
  516. package/dist/components/utils/Transition.d.ts +0 -26
  517. package/dist/components/utils/Transition.js +0 -50
  518. package/dist/components/utils/Transition.js.map +0 -1
  519. package/dist/components/utils/index.cjs +0 -302
  520. package/dist/components/utils/index.cjs.map +0 -1
  521. package/dist/components/utils/index.d.cts +0 -4
  522. package/dist/components/utils/index.d.ts +0 -4
  523. package/dist/components/utils/index.js +0 -275
  524. package/dist/components/utils/index.js.map +0 -1
  525. package/dist/hooks/focus/index.cjs +0 -379
  526. package/dist/hooks/focus/index.cjs.map +0 -1
  527. package/dist/hooks/focus/index.d.cts +0 -6
  528. package/dist/hooks/focus/index.d.ts +0 -6
  529. package/dist/hooks/focus/index.js +0 -339
  530. package/dist/hooks/focus/index.js.map +0 -1
  531. package/dist/hooks/focus/useFocusGuards.cjs +0 -74
  532. package/dist/hooks/focus/useFocusGuards.cjs.map +0 -1
  533. package/dist/hooks/focus/useFocusGuards.d.cts +0 -3
  534. package/dist/hooks/focus/useFocusGuards.d.ts +0 -3
  535. package/dist/hooks/focus/useFocusGuards.js +0 -50
  536. package/dist/hooks/focus/useFocusGuards.js.map +0 -1
  537. package/dist/hooks/focus/useFocusManagement.cjs +0 -84
  538. package/dist/hooks/focus/useFocusManagement.cjs.map +0 -1
  539. package/dist/hooks/focus/useFocusManagement.d.cts +0 -9
  540. package/dist/hooks/focus/useFocusManagement.d.ts +0 -9
  541. package/dist/hooks/focus/useFocusManagement.js +0 -60
  542. package/dist/hooks/focus/useFocusManagement.js.map +0 -1
  543. package/dist/hooks/focus/useFocusOnceVisible.cjs +0 -60
  544. package/dist/hooks/focus/useFocusOnceVisible.cjs.map +0 -1
  545. package/dist/hooks/focus/useFocusOnceVisible.d.cts +0 -5
  546. package/dist/hooks/focus/useFocusOnceVisible.d.ts +0 -5
  547. package/dist/hooks/focus/useFocusOnceVisible.js +0 -26
  548. package/dist/hooks/focus/useFocusOnceVisible.js.map +0 -1
  549. package/dist/hooks/focus/useFocusTrap.cjs +0 -233
  550. package/dist/hooks/focus/useFocusTrap.cjs.map +0 -1
  551. package/dist/hooks/focus/useFocusTrap.d.cts +0 -16
  552. package/dist/hooks/focus/useFocusTrap.d.ts +0 -16
  553. package/dist/hooks/focus/useFocusTrap.js +0 -210
  554. package/dist/hooks/focus/useFocusTrap.js.map +0 -1
  555. package/dist/hooks/focus/useIsMounted.cjs +0 -43
  556. package/dist/hooks/focus/useIsMounted.cjs.map +0 -1
  557. package/dist/hooks/focus/useIsMounted.d.cts +0 -3
  558. package/dist/hooks/focus/useIsMounted.d.ts +0 -3
  559. package/dist/hooks/focus/useIsMounted.js +0 -20
  560. package/dist/hooks/focus/useIsMounted.js.map +0 -1
  561. package/dist/hooks/index.cjs +0 -1530
  562. package/dist/hooks/index.cjs.map +0 -1
  563. package/dist/hooks/index.d.cts +0 -18
  564. package/dist/hooks/index.d.ts +0 -18
  565. package/dist/hooks/index.js +0 -1477
  566. package/dist/hooks/index.js.map +0 -1
  567. package/dist/hooks/useDelay.cjs +0 -67
  568. package/dist/hooks/useDelay.cjs.map +0 -1
  569. package/dist/hooks/useDelay.d.cts +0 -12
  570. package/dist/hooks/useDelay.d.ts +0 -12
  571. package/dist/hooks/useDelay.js +0 -43
  572. package/dist/hooks/useDelay.js.map +0 -1
  573. package/dist/hooks/useFloatingElement.cjs +0 -162
  574. package/dist/hooks/useFloatingElement.cjs.map +0 -1
  575. package/dist/hooks/useFloatingElement.d.cts +0 -22
  576. package/dist/hooks/useFloatingElement.d.ts +0 -22
  577. package/dist/hooks/useFloatingElement.js +0 -139
  578. package/dist/hooks/useFloatingElement.js.map +0 -1
  579. package/dist/hooks/useHoverState.cjs +0 -71
  580. package/dist/hooks/useHoverState.cjs.map +0 -1
  581. package/dist/hooks/useHoverState.d.cts +0 -42
  582. package/dist/hooks/useHoverState.d.ts +0 -42
  583. package/dist/hooks/useHoverState.js +0 -47
  584. package/dist/hooks/useHoverState.js.map +0 -1
  585. package/dist/hooks/useLocalStorage.cjs +0 -97
  586. package/dist/hooks/useLocalStorage.cjs.map +0 -1
  587. package/dist/hooks/useLocalStorage.d.cts +0 -17
  588. package/dist/hooks/useLocalStorage.d.ts +0 -17
  589. package/dist/hooks/useLocalStorage.js +0 -74
  590. package/dist/hooks/useLocalStorage.js.map +0 -1
  591. package/dist/hooks/useLogOnce.cjs +0 -53
  592. package/dist/hooks/useLogOnce.cjs.map +0 -1
  593. package/dist/hooks/useLogOnce.d.cts +0 -7
  594. package/dist/hooks/useLogOnce.d.ts +0 -7
  595. package/dist/hooks/useLogOnce.js +0 -29
  596. package/dist/hooks/useLogOnce.js.map +0 -1
  597. package/dist/hooks/useOutsideClick.cjs +0 -47
  598. package/dist/hooks/useOutsideClick.cjs.map +0 -1
  599. package/dist/hooks/useOutsideClick.d.cts +0 -5
  600. package/dist/hooks/useOutsideClick.d.ts +0 -5
  601. package/dist/hooks/useOutsideClick.js +0 -23
  602. package/dist/hooks/useOutsideClick.js.map +0 -1
  603. package/dist/hooks/useOverwritableState.cjs +0 -49
  604. package/dist/hooks/useOverwritableState.cjs.map +0 -1
  605. package/dist/hooks/useOverwritableState.d.cts +0 -5
  606. package/dist/hooks/useOverwritableState.d.ts +0 -5
  607. package/dist/hooks/useOverwritableState.js +0 -25
  608. package/dist/hooks/useOverwritableState.js.map +0 -1
  609. package/dist/hooks/usePopoverPosition.cjs +0 -81
  610. package/dist/hooks/usePopoverPosition.cjs.map +0 -1
  611. package/dist/hooks/usePopoverPosition.d.cts +0 -15
  612. package/dist/hooks/usePopoverPosition.d.ts +0 -15
  613. package/dist/hooks/usePopoverPosition.js +0 -57
  614. package/dist/hooks/usePopoverPosition.js.map +0 -1
  615. package/dist/hooks/useRerender.cjs +0 -33
  616. package/dist/hooks/useRerender.cjs.map +0 -1
  617. package/dist/hooks/useRerender.d.cts +0 -5
  618. package/dist/hooks/useRerender.d.ts +0 -5
  619. package/dist/hooks/useRerender.js +0 -9
  620. package/dist/hooks/useRerender.js.map +0 -1
  621. package/dist/hooks/useResizeCallbackWrapper.cjs +0 -38
  622. package/dist/hooks/useResizeCallbackWrapper.cjs.map +0 -1
  623. package/dist/hooks/useResizeCallbackWrapper.d.cts +0 -11
  624. package/dist/hooks/useResizeCallbackWrapper.d.ts +0 -11
  625. package/dist/hooks/useResizeCallbackWrapper.js +0 -14
  626. package/dist/hooks/useResizeCallbackWrapper.js.map +0 -1
  627. package/dist/hooks/useSearch.cjs +0 -95
  628. package/dist/hooks/useSearch.cjs.map +0 -1
  629. package/dist/hooks/useSearch.d.cts +0 -22
  630. package/dist/hooks/useSearch.d.ts +0 -22
  631. package/dist/hooks/useSearch.js +0 -71
  632. package/dist/hooks/useSearch.js.map +0 -1
  633. package/dist/hooks/useValidators.cjs +0 -687
  634. package/dist/hooks/useValidators.cjs.map +0 -1
  635. package/dist/hooks/useValidators.d.cts +0 -16
  636. package/dist/hooks/useValidators.d.ts +0 -16
  637. package/dist/hooks/useValidators.js +0 -660
  638. package/dist/hooks/useValidators.js.map +0 -1
  639. package/dist/i18n/LocaleProvider.cjs +0 -202
  640. package/dist/i18n/LocaleProvider.cjs.map +0 -1
  641. package/dist/i18n/LocaleProvider.d.cts +0 -23
  642. package/dist/i18n/LocaleProvider.d.ts +0 -23
  643. package/dist/i18n/LocaleProvider.js +0 -175
  644. package/dist/i18n/LocaleProvider.js.map +0 -1
  645. package/dist/i18n/index.cjs +0 -761
  646. package/dist/i18n/index.cjs.map +0 -1
  647. package/dist/i18n/index.d.cts +0 -8
  648. package/dist/i18n/index.d.ts +0 -8
  649. package/dist/i18n/index.js +0 -727
  650. package/dist/i18n/index.js.map +0 -1
  651. package/dist/i18n/translations.cjs +0 -507
  652. package/dist/i18n/translations.cjs.map +0 -1
  653. package/dist/i18n/translations.d.cts +0 -189
  654. package/dist/i18n/translations.d.ts +0 -189
  655. package/dist/i18n/translations.js +0 -482
  656. package/dist/i18n/translations.js.map +0 -1
  657. package/dist/i18n/useHightideTranslation.cjs +0 -618
  658. package/dist/i18n/useHightideTranslation.cjs.map +0 -1
  659. package/dist/i18n/useHightideTranslation.d.cts +0 -21
  660. package/dist/i18n/useHightideTranslation.d.ts +0 -21
  661. package/dist/i18n/useHightideTranslation.js +0 -591
  662. package/dist/i18n/useHightideTranslation.js.map +0 -1
  663. package/dist/i18n/util.cjs +0 -49
  664. package/dist/i18n/util.cjs.map +0 -1
  665. package/dist/i18n/util.d.cts +0 -15
  666. package/dist/i18n/util.d.ts +0 -15
  667. package/dist/i18n/util.js +0 -23
  668. package/dist/i18n/util.js.map +0 -1
  669. package/dist/index.cjs +0 -16470
  670. package/dist/index.cjs.map +0 -1
  671. package/dist/index.d.cts +0 -113
  672. package/dist/storybook/helper.cjs +0 -61
  673. package/dist/storybook/helper.cjs.map +0 -1
  674. package/dist/storybook/helper.d.cts +0 -17
  675. package/dist/storybook/helper.d.ts +0 -17
  676. package/dist/storybook/helper.js +0 -37
  677. package/dist/storybook/helper.js.map +0 -1
  678. package/dist/theming/index.cjs +0 -190
  679. package/dist/theming/index.cjs.map +0 -1
  680. package/dist/theming/index.d.cts +0 -3
  681. package/dist/theming/index.d.ts +0 -3
  682. package/dist/theming/index.js +0 -161
  683. package/dist/theming/index.js.map +0 -1
  684. package/dist/theming/useTheme.cjs +0 -188
  685. package/dist/theming/useTheme.cjs.map +0 -1
  686. package/dist/theming/useTheme.d.cts +0 -26
  687. package/dist/theming/useTheme.d.ts +0 -26
  688. package/dist/theming/useTheme.js +0 -161
  689. package/dist/theming/useTheme.js.map +0 -1
  690. package/dist/utils/array.cjs +0 -172
  691. package/dist/utils/array.cjs.map +0 -1
  692. package/dist/utils/array.d.cts +0 -34
  693. package/dist/utils/array.d.ts +0 -34
  694. package/dist/utils/array.js +0 -142
  695. package/dist/utils/array.js.map +0 -1
  696. package/dist/utils/bagFunctions.cjs +0 -38
  697. package/dist/utils/bagFunctions.cjs.map +0 -1
  698. package/dist/utils/bagFunctions.d.cts +0 -15
  699. package/dist/utils/bagFunctions.d.ts +0 -15
  700. package/dist/utils/bagFunctions.js +0 -14
  701. package/dist/utils/bagFunctions.js.map +0 -1
  702. package/dist/utils/builder.cjs +0 -33
  703. package/dist/utils/builder.cjs.map +0 -1
  704. package/dist/utils/builder.d.cts +0 -8
  705. package/dist/utils/builder.d.ts +0 -8
  706. package/dist/utils/builder.js +0 -9
  707. package/dist/utils/builder.js.map +0 -1
  708. package/dist/utils/date.cjs +0 -193
  709. package/dist/utils/date.cjs.map +0 -1
  710. package/dist/utils/date.d.cts +0 -30
  711. package/dist/utils/date.d.ts +0 -30
  712. package/dist/utils/date.js +0 -156
  713. package/dist/utils/date.js.map +0 -1
  714. package/dist/utils/easeFunctions.cjs +0 -63
  715. package/dist/utils/easeFunctions.cjs.map +0 -1
  716. package/dist/utils/easeFunctions.d.cts +0 -11
  717. package/dist/utils/easeFunctions.d.ts +0 -11
  718. package/dist/utils/easeFunctions.js +0 -37
  719. package/dist/utils/easeFunctions.js.map +0 -1
  720. package/dist/utils/emailValidation.cjs +0 -32
  721. package/dist/utils/emailValidation.cjs.map +0 -1
  722. package/dist/utils/emailValidation.d.cts +0 -3
  723. package/dist/utils/emailValidation.d.ts +0 -3
  724. package/dist/utils/emailValidation.js +0 -8
  725. package/dist/utils/emailValidation.js.map +0 -1
  726. package/dist/utils/index.cjs +0 -562
  727. package/dist/utils/index.cjs.map +0 -1
  728. package/dist/utils/index.d.cts +0 -16
  729. package/dist/utils/index.d.ts +0 -16
  730. package/dist/utils/index.js +0 -502
  731. package/dist/utils/index.js.map +0 -1
  732. package/dist/utils/loopingArray.cjs +0 -96
  733. package/dist/utils/loopingArray.cjs.map +0 -1
  734. package/dist/utils/loopingArray.d.cts +0 -25
  735. package/dist/utils/loopingArray.d.ts +0 -25
  736. package/dist/utils/loopingArray.js +0 -72
  737. package/dist/utils/loopingArray.js.map +0 -1
  738. package/dist/utils/match.cjs +0 -32
  739. package/dist/utils/match.cjs.map +0 -1
  740. package/dist/utils/match.d.cts +0 -3
  741. package/dist/utils/match.d.ts +0 -3
  742. package/dist/utils/match.js +0 -8
  743. package/dist/utils/match.js.map +0 -1
  744. package/dist/utils/math.cjs +0 -33
  745. package/dist/utils/math.cjs.map +0 -1
  746. package/dist/utils/math.d.cts +0 -3
  747. package/dist/utils/math.d.ts +0 -3
  748. package/dist/utils/math.js +0 -9
  749. package/dist/utils/math.js.map +0 -1
  750. package/dist/utils/noop.cjs +0 -30
  751. package/dist/utils/noop.cjs.map +0 -1
  752. package/dist/utils/noop.d.cts +0 -3
  753. package/dist/utils/noop.d.ts +0 -3
  754. package/dist/utils/noop.js +0 -6
  755. package/dist/utils/noop.js.map +0 -1
  756. package/dist/utils/resolveSetState.cjs +0 -32
  757. package/dist/utils/resolveSetState.cjs.map +0 -1
  758. package/dist/utils/resolveSetState.d.cts +0 -5
  759. package/dist/utils/resolveSetState.d.ts +0 -5
  760. package/dist/utils/resolveSetState.js +0 -8
  761. package/dist/utils/resolveSetState.js.map +0 -1
  762. package/dist/utils/simpleSearch.cjs +0 -59
  763. package/dist/utils/simpleSearch.cjs.map +0 -1
  764. package/dist/utils/simpleSearch.d.cts +0 -50
  765. package/dist/utils/simpleSearch.d.ts +0 -50
  766. package/dist/utils/simpleSearch.js +0 -32
  767. package/dist/utils/simpleSearch.js.map +0 -1
  768. package/dist/utils/storage.cjs +0 -63
  769. package/dist/utils/storage.cjs.map +0 -1
  770. package/dist/utils/storage.d.cts +0 -16
  771. package/dist/utils/storage.d.ts +0 -16
  772. package/dist/utils/storage.js +0 -38
  773. package/dist/utils/storage.js.map +0 -1
  774. package/dist/utils/typing.cjs +0 -18
  775. package/dist/utils/typing.cjs.map +0 -1
  776. package/dist/utils/typing.d.cts +0 -8
  777. package/dist/utils/typing.d.ts +0 -8
  778. package/dist/utils/typing.js +0 -1
  779. package/dist/utils/typing.js.map +0 -1
  780. package/dist/utils/writeToClipboard.cjs +0 -33
  781. package/dist/utils/writeToClipboard.cjs.map +0 -1
  782. package/dist/utils/writeToClipboard.d.cts +0 -3
  783. package/dist/utils/writeToClipboard.d.ts +0 -3
  784. package/dist/utils/writeToClipboard.js +0 -10
  785. package/dist/utils/writeToClipboard.js.map +0 -1
@@ -1,4503 +0,0 @@
1
- // src/components/user-action/Button.tsx
2
- import { forwardRef } from "react";
3
- import clsx from "clsx";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
- var ButtonColorUtil = {
6
- solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
7
- text: ["primary", "negative", "neutral"],
8
- outline: ["primary"]
9
- };
10
- var IconButtonUtil = {
11
- icon: [...ButtonColorUtil.solid, "transparent"]
12
- };
13
- var paddingMapping = {
14
- none: "",
15
- small: "btn-sm",
16
- medium: "btn-md",
17
- large: "btn-lg"
18
- };
19
- var iconPaddingMapping = {
20
- none: "",
21
- tiny: "icon-btn-xs",
22
- small: "icon-btn-sm",
23
- medium: "icon-btn-md",
24
- large: "icon-btn-lg"
25
- };
26
- var ButtonUtil = {
27
- paddingMapping,
28
- iconPaddingMapping
29
- };
30
- var SolidButton = forwardRef(function SolidButton2({
31
- children,
32
- color = "primary",
33
- size = "medium",
34
- startIcon,
35
- endIcon,
36
- onClick,
37
- className,
38
- ...restProps
39
- }, ref) {
40
- const colorClasses = {
41
- primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
42
- secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
43
- tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
44
- positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
45
- warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
46
- negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
47
- neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text"
48
- }[color];
49
- const iconColorClasses = {
50
- primary: "not-group-disabled:text-button-solid-primary-icon",
51
- secondary: "not-group-disabled:text-button-solid-secondary-icon",
52
- tertiary: "not-group-disabled:text-button-solid-tertiary-icon",
53
- positive: "not-group-disabled:text-button-solid-positive-icon",
54
- warning: "not-group-disabled:text-button-solid-warning-icon",
55
- negative: "not-group-disabled:text-button-solid-negative-icon",
56
- neutral: "not-group-disabled:text-button-solid-neutral-icon"
57
- }[color];
58
- return /* @__PURE__ */ jsxs(
59
- "button",
60
- {
61
- ref,
62
- onClick,
63
- className: clsx(
64
- "group font-semibold",
65
- colorClasses,
66
- "not-disabled:hover:brightness-90",
67
- "disabled:text-disabled disabled:bg-disabled-background",
68
- ButtonUtil.paddingMapping[size],
69
- className
70
- ),
71
- ...restProps,
72
- children: [
73
- startIcon && /* @__PURE__ */ jsx(
74
- "span",
75
- {
76
- className: clsx(
77
- iconColorClasses,
78
- "group-disabled:text-disabled-icon"
79
- ),
80
- children: startIcon
81
- }
82
- ),
83
- children,
84
- endIcon && /* @__PURE__ */ jsx(
85
- "span",
86
- {
87
- className: clsx(
88
- iconColorClasses,
89
- "group-disabled:text-disabled-icon"
90
- ),
91
- children: endIcon
92
- }
93
- )
94
- ]
95
- }
96
- );
97
- });
98
- var OutlineButton = ({
99
- children,
100
- color = "primary",
101
- size = "medium",
102
- startIcon,
103
- endIcon,
104
- onClick,
105
- className,
106
- ...restProps
107
- }) => {
108
- const colorClasses = {
109
- primary: "not-disabled:border-button-outline-primary-text not-disabled:text-button-outline-primary-text"
110
- }[color];
111
- const iconColorClasses = {
112
- primary: "not-group-disabled:text-button-outline-primary-icon"
113
- }[color];
114
- return /* @__PURE__ */ jsxs(
115
- "button",
116
- {
117
- onClick,
118
- className: clsx(
119
- "group font-semibold bg-transparent border-2 ",
120
- "not-disabled:hover:brightness-80",
121
- colorClasses,
122
- "disabled:text-disabled disabled:border-disabled-outline",
123
- ButtonUtil.paddingMapping[size],
124
- className
125
- ),
126
- ...restProps,
127
- children: [
128
- startIcon && /* @__PURE__ */ jsx(
129
- "span",
130
- {
131
- className: clsx(
132
- iconColorClasses,
133
- "group-disabled:text-disabled-icon"
134
- ),
135
- children: startIcon
136
- }
137
- ),
138
- children,
139
- endIcon && /* @__PURE__ */ jsx(
140
- "span",
141
- {
142
- className: clsx(
143
- iconColorClasses,
144
- "group-disabled:text-disabled-icon"
145
- ),
146
- children: endIcon
147
- }
148
- )
149
- ]
150
- }
151
- );
152
- };
153
- var TextButton = ({
154
- children,
155
- color = "neutral",
156
- size = "medium",
157
- startIcon,
158
- endIcon,
159
- onClick,
160
- coloredHoverBackground = true,
161
- className,
162
- ...restProps
163
- }) => {
164
- const colorClasses = {
165
- primary: "not-disabled:bg-transparent not-disabled:text-button-text-primary-text not-disabled:focus-visible:outline-button-text-primary-text",
166
- negative: "not-disabled:bg-transparent not-disabled:text-button-text-negative-text not-disabled:focus-visible:outline-button-text-negative-text",
167
- neutral: "not-disabled:bg-transparent not-disabled:text-button-text-neutral-text not-disabled:focus-visible:outline-button-text-neutral-text"
168
- }[color];
169
- const backgroundColor = {
170
- primary: "not-disabled:hover:bg-button-text-primary-text/20 not-disabled:focus-visible:bg-button-text-primary-text/20",
171
- negative: "not-disabled:hover:bg-button-text-negative-text/20 not-disabled:focus-visible:bg-button-text-negative-text/20",
172
- neutral: "not-disabled:hover:bg-button-text-neutral-text/20 not-disabled:focus-visible:bg-button-text-neutral-text/20"
173
- }[color];
174
- const iconColorClasses = {
175
- primary: "not-group-disabled:text-button-text-primary-icon",
176
- negative: "not-group-disabled:text-button-text-negative-icon",
177
- neutral: "not-group-disabled:text-button-text-neutral-icon"
178
- }[color];
179
- return /* @__PURE__ */ jsxs(
180
- "button",
181
- {
182
- onClick,
183
- className: clsx(
184
- "group font-semibold",
185
- "disabled:text-disabled",
186
- colorClasses,
187
- {
188
- [backgroundColor]: coloredHoverBackground,
189
- "not-disabled:hover:bg-button-text-hover-background": !coloredHoverBackground
190
- },
191
- ButtonUtil.paddingMapping[size],
192
- className
193
- ),
194
- ...restProps,
195
- children: [
196
- startIcon && /* @__PURE__ */ jsx(
197
- "span",
198
- {
199
- className: clsx(
200
- iconColorClasses,
201
- "group-disabled:text-disabled-icon"
202
- ),
203
- children: startIcon
204
- }
205
- ),
206
- children,
207
- endIcon && /* @__PURE__ */ jsx(
208
- "span",
209
- {
210
- className: clsx(
211
- iconColorClasses,
212
- "group-disabled:text-disabled-icon"
213
- ),
214
- children: endIcon
215
- }
216
- )
217
- ]
218
- }
219
- );
220
- };
221
- var IconButton = forwardRef(function IconButton2({
222
- children,
223
- color = "primary",
224
- size = "medium",
225
- className,
226
- ...restProps
227
- }, ref) {
228
- const colorClasses = {
229
- primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
230
- secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
231
- tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
232
- positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
233
- warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
234
- negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
235
- neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text",
236
- transparent: "not-disabled:bg-transparent"
237
- }[color];
238
- return /* @__PURE__ */ jsx(
239
- "button",
240
- {
241
- ref,
242
- className: clsx(
243
- colorClasses,
244
- "not-disabled:hover:brightness-90",
245
- "disabled:text-disabled",
246
- {
247
- "disabled:bg-disabled-background": color !== "transparent",
248
- "disabled:opacity-70": color === "transparent",
249
- "not-disabled:hover:bg-button-text-hover-background": color === "transparent"
250
- },
251
- ButtonUtil.iconPaddingMapping[size],
252
- className
253
- ),
254
- ...restProps,
255
- children
256
- }
257
- );
258
- });
259
-
260
- // src/components/user-action/Checkbox.tsx
261
- import { Check, Minus } from "lucide-react";
262
- import clsx2 from "clsx";
263
-
264
- // node_modules/@radix-ui/react-checkbox/dist/index.mjs
265
- import * as React10 from "react";
266
-
267
- // node_modules/@radix-ui/react-compose-refs/dist/index.mjs
268
- import * as React from "react";
269
- function setRef(ref, value) {
270
- if (typeof ref === "function") {
271
- return ref(value);
272
- } else if (ref !== null && ref !== void 0) {
273
- ref.current = value;
274
- }
275
- }
276
- function composeRefs(...refs) {
277
- return (node) => {
278
- let hasCleanup = false;
279
- const cleanups = refs.map((ref) => {
280
- const cleanup = setRef(ref, node);
281
- if (!hasCleanup && typeof cleanup == "function") {
282
- hasCleanup = true;
283
- }
284
- return cleanup;
285
- });
286
- if (hasCleanup) {
287
- return () => {
288
- for (let i = 0; i < cleanups.length; i++) {
289
- const cleanup = cleanups[i];
290
- if (typeof cleanup == "function") {
291
- cleanup();
292
- } else {
293
- setRef(refs[i], null);
294
- }
295
- }
296
- };
297
- }
298
- };
299
- }
300
- function useComposedRefs(...refs) {
301
- return React.useCallback(composeRefs(...refs), refs);
302
- }
303
-
304
- // node_modules/@radix-ui/react-context/dist/index.mjs
305
- import * as React2 from "react";
306
- import { jsx as jsx2 } from "react/jsx-runtime";
307
- function createContextScope(scopeName, createContextScopeDeps = []) {
308
- let defaultContexts = [];
309
- function createContext32(rootComponentName, defaultContext) {
310
- const BaseContext = React2.createContext(defaultContext);
311
- const index = defaultContexts.length;
312
- defaultContexts = [...defaultContexts, defaultContext];
313
- const Provider = (props) => {
314
- const { scope, children, ...context } = props;
315
- const Context = scope?.[scopeName]?.[index] || BaseContext;
316
- const value = React2.useMemo(() => context, Object.values(context));
317
- return /* @__PURE__ */ jsx2(Context.Provider, { value, children });
318
- };
319
- Provider.displayName = rootComponentName + "Provider";
320
- function useContext22(consumerName, scope) {
321
- const Context = scope?.[scopeName]?.[index] || BaseContext;
322
- const context = React2.useContext(Context);
323
- if (context) return context;
324
- if (defaultContext !== void 0) return defaultContext;
325
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
326
- }
327
- return [Provider, useContext22];
328
- }
329
- const createScope = () => {
330
- const scopeContexts = defaultContexts.map((defaultContext) => {
331
- return React2.createContext(defaultContext);
332
- });
333
- return function useScope(scope) {
334
- const contexts = scope?.[scopeName] || scopeContexts;
335
- return React2.useMemo(
336
- () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
337
- [scope, contexts]
338
- );
339
- };
340
- };
341
- createScope.scopeName = scopeName;
342
- return [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)];
343
- }
344
- function composeContextScopes(...scopes) {
345
- const baseScope = scopes[0];
346
- if (scopes.length === 1) return baseScope;
347
- const createScope = () => {
348
- const scopeHooks = scopes.map((createScope2) => ({
349
- useScope: createScope2(),
350
- scopeName: createScope2.scopeName
351
- }));
352
- return function useComposedScopes(overrideScopes) {
353
- const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
354
- const scopeProps = useScope(overrideScopes);
355
- const currentScope = scopeProps[`__scope${scopeName}`];
356
- return { ...nextScopes2, ...currentScope };
357
- }, {});
358
- return React2.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
359
- };
360
- };
361
- createScope.scopeName = baseScope.scopeName;
362
- return createScope;
363
- }
364
-
365
- // node_modules/@radix-ui/primitive/dist/index.mjs
366
- function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
367
- return function handleEvent(event) {
368
- originalEventHandler?.(event);
369
- if (checkForDefaultPrevented === false || !event.defaultPrevented) {
370
- return ourEventHandler?.(event);
371
- }
372
- };
373
- }
374
-
375
- // node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
376
- import * as React4 from "react";
377
-
378
- // node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
379
- import * as React3 from "react";
380
- var useLayoutEffect2 = globalThis?.document ? React3.useLayoutEffect : () => {
381
- };
382
-
383
- // node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
384
- import * as React22 from "react";
385
- var useInsertionEffect = React4[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
386
- function useControllableState({
387
- prop,
388
- defaultProp,
389
- onChange = () => {
390
- },
391
- caller
392
- }) {
393
- const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
394
- defaultProp,
395
- onChange
396
- });
397
- const isControlled = prop !== void 0;
398
- const value = isControlled ? prop : uncontrolledProp;
399
- if (true) {
400
- const isControlledRef = React4.useRef(prop !== void 0);
401
- React4.useEffect(() => {
402
- const wasControlled = isControlledRef.current;
403
- if (wasControlled !== isControlled) {
404
- const from = wasControlled ? "controlled" : "uncontrolled";
405
- const to = isControlled ? "controlled" : "uncontrolled";
406
- console.warn(
407
- `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
408
- );
409
- }
410
- isControlledRef.current = isControlled;
411
- }, [isControlled, caller]);
412
- }
413
- const setValue = React4.useCallback(
414
- (nextValue) => {
415
- if (isControlled) {
416
- const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
417
- if (value2 !== prop) {
418
- onChangeRef.current?.(value2);
419
- }
420
- } else {
421
- setUncontrolledProp(nextValue);
422
- }
423
- },
424
- [isControlled, prop, setUncontrolledProp, onChangeRef]
425
- );
426
- return [value, setValue];
427
- }
428
- function useUncontrolledState({
429
- defaultProp,
430
- onChange
431
- }) {
432
- const [value, setValue] = React4.useState(defaultProp);
433
- const prevValueRef = React4.useRef(value);
434
- const onChangeRef = React4.useRef(onChange);
435
- useInsertionEffect(() => {
436
- onChangeRef.current = onChange;
437
- }, [onChange]);
438
- React4.useEffect(() => {
439
- if (prevValueRef.current !== value) {
440
- onChangeRef.current?.(value);
441
- prevValueRef.current = value;
442
- }
443
- }, [value, prevValueRef]);
444
- return [value, setValue, onChangeRef];
445
- }
446
- function isFunction(value) {
447
- return typeof value === "function";
448
- }
449
- var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
450
-
451
- // node_modules/@radix-ui/react-use-previous/dist/index.mjs
452
- import * as React5 from "react";
453
- function usePrevious(value) {
454
- const ref = React5.useRef({ value, previous: value });
455
- return React5.useMemo(() => {
456
- if (ref.current.value !== value) {
457
- ref.current.previous = ref.current.value;
458
- ref.current.value = value;
459
- }
460
- return ref.current.previous;
461
- }, [value]);
462
- }
463
-
464
- // node_modules/@radix-ui/react-use-size/dist/index.mjs
465
- import * as React6 from "react";
466
- function useSize(element) {
467
- const [size, setSize] = React6.useState(void 0);
468
- useLayoutEffect2(() => {
469
- if (element) {
470
- setSize({ width: element.offsetWidth, height: element.offsetHeight });
471
- const resizeObserver = new ResizeObserver((entries) => {
472
- if (!Array.isArray(entries)) {
473
- return;
474
- }
475
- if (!entries.length) {
476
- return;
477
- }
478
- const entry = entries[0];
479
- let width;
480
- let height;
481
- if ("borderBoxSize" in entry) {
482
- const borderSizeEntry = entry["borderBoxSize"];
483
- const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
484
- width = borderSize["inlineSize"];
485
- height = borderSize["blockSize"];
486
- } else {
487
- width = element.offsetWidth;
488
- height = element.offsetHeight;
489
- }
490
- setSize({ width, height });
491
- });
492
- resizeObserver.observe(element, { box: "border-box" });
493
- return () => resizeObserver.unobserve(element);
494
- } else {
495
- setSize(void 0);
496
- }
497
- }, [element]);
498
- return size;
499
- }
500
-
501
- // node_modules/@radix-ui/react-presence/dist/index.mjs
502
- import * as React23 from "react";
503
- import * as React7 from "react";
504
- function useStateMachine(initialState, machine) {
505
- return React7.useReducer((state, event) => {
506
- const nextState = machine[state][event];
507
- return nextState ?? state;
508
- }, initialState);
509
- }
510
- var Presence = (props) => {
511
- const { present, children } = props;
512
- const presence = usePresence(present);
513
- const child = typeof children === "function" ? children({ present: presence.isPresent }) : React23.Children.only(children);
514
- const ref = useComposedRefs(presence.ref, getElementRef(child));
515
- const forceMount = typeof children === "function";
516
- return forceMount || presence.isPresent ? React23.cloneElement(child, { ref }) : null;
517
- };
518
- Presence.displayName = "Presence";
519
- function usePresence(present) {
520
- const [node, setNode] = React23.useState();
521
- const stylesRef = React23.useRef(null);
522
- const prevPresentRef = React23.useRef(present);
523
- const prevAnimationNameRef = React23.useRef("none");
524
- const initialState = present ? "mounted" : "unmounted";
525
- const [state, send] = useStateMachine(initialState, {
526
- mounted: {
527
- UNMOUNT: "unmounted",
528
- ANIMATION_OUT: "unmountSuspended"
529
- },
530
- unmountSuspended: {
531
- MOUNT: "mounted",
532
- ANIMATION_END: "unmounted"
533
- },
534
- unmounted: {
535
- MOUNT: "mounted"
536
- }
537
- });
538
- React23.useEffect(() => {
539
- const currentAnimationName = getAnimationName(stylesRef.current);
540
- prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
541
- }, [state]);
542
- useLayoutEffect2(() => {
543
- const styles = stylesRef.current;
544
- const wasPresent = prevPresentRef.current;
545
- const hasPresentChanged = wasPresent !== present;
546
- if (hasPresentChanged) {
547
- const prevAnimationName = prevAnimationNameRef.current;
548
- const currentAnimationName = getAnimationName(styles);
549
- if (present) {
550
- send("MOUNT");
551
- } else if (currentAnimationName === "none" || styles?.display === "none") {
552
- send("UNMOUNT");
553
- } else {
554
- const isAnimating = prevAnimationName !== currentAnimationName;
555
- if (wasPresent && isAnimating) {
556
- send("ANIMATION_OUT");
557
- } else {
558
- send("UNMOUNT");
559
- }
560
- }
561
- prevPresentRef.current = present;
562
- }
563
- }, [present, send]);
564
- useLayoutEffect2(() => {
565
- if (node) {
566
- let timeoutId;
567
- const ownerWindow = node.ownerDocument.defaultView ?? window;
568
- const handleAnimationEnd = (event) => {
569
- const currentAnimationName = getAnimationName(stylesRef.current);
570
- const isCurrentAnimation = currentAnimationName.includes(event.animationName);
571
- if (event.target === node && isCurrentAnimation) {
572
- send("ANIMATION_END");
573
- if (!prevPresentRef.current) {
574
- const currentFillMode = node.style.animationFillMode;
575
- node.style.animationFillMode = "forwards";
576
- timeoutId = ownerWindow.setTimeout(() => {
577
- if (node.style.animationFillMode === "forwards") {
578
- node.style.animationFillMode = currentFillMode;
579
- }
580
- });
581
- }
582
- }
583
- };
584
- const handleAnimationStart = (event) => {
585
- if (event.target === node) {
586
- prevAnimationNameRef.current = getAnimationName(stylesRef.current);
587
- }
588
- };
589
- node.addEventListener("animationstart", handleAnimationStart);
590
- node.addEventListener("animationcancel", handleAnimationEnd);
591
- node.addEventListener("animationend", handleAnimationEnd);
592
- return () => {
593
- ownerWindow.clearTimeout(timeoutId);
594
- node.removeEventListener("animationstart", handleAnimationStart);
595
- node.removeEventListener("animationcancel", handleAnimationEnd);
596
- node.removeEventListener("animationend", handleAnimationEnd);
597
- };
598
- } else {
599
- send("ANIMATION_END");
600
- }
601
- }, [node, send]);
602
- return {
603
- isPresent: ["mounted", "unmountSuspended"].includes(state),
604
- ref: React23.useCallback((node2) => {
605
- stylesRef.current = node2 ? getComputedStyle(node2) : null;
606
- setNode(node2);
607
- }, [])
608
- };
609
- }
610
- function getAnimationName(styles) {
611
- return styles?.animationName || "none";
612
- }
613
- function getElementRef(element) {
614
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
615
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
616
- if (mayWarn) {
617
- return element.ref;
618
- }
619
- getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
620
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
621
- if (mayWarn) {
622
- return element.props.ref;
623
- }
624
- return element.props.ref || element.ref;
625
- }
626
-
627
- // node_modules/@radix-ui/react-primitive/dist/index.mjs
628
- import * as React9 from "react";
629
- import * as ReactDOM from "react-dom";
630
-
631
- // node_modules/@radix-ui/react-slot/dist/index.mjs
632
- import * as React8 from "react";
633
- import { Fragment as Fragment2, jsx as jsx3 } from "react/jsx-runtime";
634
- // @__NO_SIDE_EFFECTS__
635
- function createSlot(ownerName) {
636
- const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
637
- const Slot2 = React8.forwardRef((props, forwardedRef) => {
638
- const { children, ...slotProps } = props;
639
- const childrenArray = React8.Children.toArray(children);
640
- const slottable = childrenArray.find(isSlottable);
641
- if (slottable) {
642
- const newElement = slottable.props.children;
643
- const newChildren = childrenArray.map((child) => {
644
- if (child === slottable) {
645
- if (React8.Children.count(newElement) > 1) return React8.Children.only(null);
646
- return React8.isValidElement(newElement) ? newElement.props.children : null;
647
- } else {
648
- return child;
649
- }
650
- });
651
- return /* @__PURE__ */ jsx3(SlotClone, { ...slotProps, ref: forwardedRef, children: React8.isValidElement(newElement) ? React8.cloneElement(newElement, void 0, newChildren) : null });
652
- }
653
- return /* @__PURE__ */ jsx3(SlotClone, { ...slotProps, ref: forwardedRef, children });
654
- });
655
- Slot2.displayName = `${ownerName}.Slot`;
656
- return Slot2;
657
- }
658
- // @__NO_SIDE_EFFECTS__
659
- function createSlotClone(ownerName) {
660
- const SlotClone = React8.forwardRef((props, forwardedRef) => {
661
- const { children, ...slotProps } = props;
662
- if (React8.isValidElement(children)) {
663
- const childrenRef = getElementRef2(children);
664
- const props2 = mergeProps(slotProps, children.props);
665
- if (children.type !== React8.Fragment) {
666
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
667
- }
668
- return React8.cloneElement(children, props2);
669
- }
670
- return React8.Children.count(children) > 1 ? React8.Children.only(null) : null;
671
- });
672
- SlotClone.displayName = `${ownerName}.SlotClone`;
673
- return SlotClone;
674
- }
675
- var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
676
- function isSlottable(child) {
677
- return React8.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
678
- }
679
- function mergeProps(slotProps, childProps) {
680
- const overrideProps = { ...childProps };
681
- for (const propName in childProps) {
682
- const slotPropValue = slotProps[propName];
683
- const childPropValue = childProps[propName];
684
- const isHandler = /^on[A-Z]/.test(propName);
685
- if (isHandler) {
686
- if (slotPropValue && childPropValue) {
687
- overrideProps[propName] = (...args) => {
688
- const result = childPropValue(...args);
689
- slotPropValue(...args);
690
- return result;
691
- };
692
- } else if (slotPropValue) {
693
- overrideProps[propName] = slotPropValue;
694
- }
695
- } else if (propName === "style") {
696
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
697
- } else if (propName === "className") {
698
- overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
699
- }
700
- }
701
- return { ...slotProps, ...overrideProps };
702
- }
703
- function getElementRef2(element) {
704
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
705
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
706
- if (mayWarn) {
707
- return element.ref;
708
- }
709
- getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
710
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
711
- if (mayWarn) {
712
- return element.props.ref;
713
- }
714
- return element.props.ref || element.ref;
715
- }
716
-
717
- // node_modules/@radix-ui/react-primitive/dist/index.mjs
718
- import { jsx as jsx4 } from "react/jsx-runtime";
719
- var NODES = [
720
- "a",
721
- "button",
722
- "div",
723
- "form",
724
- "h2",
725
- "h3",
726
- "img",
727
- "input",
728
- "label",
729
- "li",
730
- "nav",
731
- "ol",
732
- "p",
733
- "select",
734
- "span",
735
- "svg",
736
- "ul"
737
- ];
738
- var Primitive = NODES.reduce((primitive, node) => {
739
- const Slot = createSlot(`Primitive.${node}`);
740
- const Node2 = React9.forwardRef((props, forwardedRef) => {
741
- const { asChild, ...primitiveProps } = props;
742
- const Comp = asChild ? Slot : node;
743
- if (typeof window !== "undefined") {
744
- window[Symbol.for("radix-ui")] = true;
745
- }
746
- return /* @__PURE__ */ jsx4(Comp, { ...primitiveProps, ref: forwardedRef });
747
- });
748
- Node2.displayName = `Primitive.${node}`;
749
- return { ...primitive, [node]: Node2 };
750
- }, {});
751
-
752
- // node_modules/@radix-ui/react-checkbox/dist/index.mjs
753
- import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
754
- var CHECKBOX_NAME = "Checkbox";
755
- var [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);
756
- var [CheckboxProviderImpl, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
757
- function CheckboxProvider(props) {
758
- const {
759
- __scopeCheckbox,
760
- checked: checkedProp,
761
- children,
762
- defaultChecked,
763
- disabled,
764
- form,
765
- name,
766
- onCheckedChange,
767
- required,
768
- value = "on",
769
- // @ts-expect-error
770
- internal_do_not_use_render
771
- } = props;
772
- const [checked, setChecked] = useControllableState({
773
- prop: checkedProp,
774
- defaultProp: defaultChecked ?? false,
775
- onChange: onCheckedChange,
776
- caller: CHECKBOX_NAME
777
- });
778
- const [control, setControl] = React10.useState(null);
779
- const [bubbleInput, setBubbleInput] = React10.useState(null);
780
- const hasConsumerStoppedPropagationRef = React10.useRef(false);
781
- const isFormControl = control ? !!form || !!control.closest("form") : (
782
- // We set this to true by default so that events bubble to forms without JS (SSR)
783
- true
784
- );
785
- const context = {
786
- checked,
787
- disabled,
788
- setChecked,
789
- control,
790
- setControl,
791
- name,
792
- form,
793
- value,
794
- hasConsumerStoppedPropagationRef,
795
- required,
796
- defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked,
797
- isFormControl,
798
- bubbleInput,
799
- setBubbleInput
800
- };
801
- return /* @__PURE__ */ jsx5(
802
- CheckboxProviderImpl,
803
- {
804
- scope: __scopeCheckbox,
805
- ...context,
806
- children: isFunction2(internal_do_not_use_render) ? internal_do_not_use_render(context) : children
807
- }
808
- );
809
- }
810
- var TRIGGER_NAME = "CheckboxTrigger";
811
- var CheckboxTrigger = React10.forwardRef(
812
- ({ __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }, forwardedRef) => {
813
- const {
814
- control,
815
- value,
816
- disabled,
817
- checked,
818
- required,
819
- setControl,
820
- setChecked,
821
- hasConsumerStoppedPropagationRef,
822
- isFormControl,
823
- bubbleInput
824
- } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);
825
- const composedRefs = useComposedRefs(forwardedRef, setControl);
826
- const initialCheckedStateRef = React10.useRef(checked);
827
- React10.useEffect(() => {
828
- const form = control?.form;
829
- if (form) {
830
- const reset = () => setChecked(initialCheckedStateRef.current);
831
- form.addEventListener("reset", reset);
832
- return () => form.removeEventListener("reset", reset);
833
- }
834
- }, [control, setChecked]);
835
- return /* @__PURE__ */ jsx5(
836
- Primitive.button,
837
- {
838
- type: "button",
839
- role: "checkbox",
840
- "aria-checked": isIndeterminate(checked) ? "mixed" : checked,
841
- "aria-required": required,
842
- "data-state": getState(checked),
843
- "data-disabled": disabled ? "" : void 0,
844
- disabled,
845
- value,
846
- ...checkboxProps,
847
- ref: composedRefs,
848
- onKeyDown: composeEventHandlers(onKeyDown, (event) => {
849
- if (event.key === "Enter") event.preventDefault();
850
- }),
851
- onClick: composeEventHandlers(onClick, (event) => {
852
- setChecked((prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked);
853
- if (bubbleInput && isFormControl) {
854
- hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
855
- if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
856
- }
857
- })
858
- }
859
- );
860
- }
861
- );
862
- CheckboxTrigger.displayName = TRIGGER_NAME;
863
- var Checkbox = React10.forwardRef(
864
- (props, forwardedRef) => {
865
- const {
866
- __scopeCheckbox,
867
- name,
868
- checked,
869
- defaultChecked,
870
- required,
871
- disabled,
872
- value,
873
- onCheckedChange,
874
- form,
875
- ...checkboxProps
876
- } = props;
877
- return /* @__PURE__ */ jsx5(
878
- CheckboxProvider,
879
- {
880
- __scopeCheckbox,
881
- checked,
882
- defaultChecked,
883
- disabled,
884
- required,
885
- onCheckedChange,
886
- name,
887
- form,
888
- value,
889
- internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxs2(Fragment3, { children: [
890
- /* @__PURE__ */ jsx5(
891
- CheckboxTrigger,
892
- {
893
- ...checkboxProps,
894
- ref: forwardedRef,
895
- __scopeCheckbox
896
- }
897
- ),
898
- isFormControl && /* @__PURE__ */ jsx5(
899
- CheckboxBubbleInput,
900
- {
901
- __scopeCheckbox
902
- }
903
- )
904
- ] })
905
- }
906
- );
907
- }
908
- );
909
- Checkbox.displayName = CHECKBOX_NAME;
910
- var INDICATOR_NAME = "CheckboxIndicator";
911
- var CheckboxIndicator = React10.forwardRef(
912
- (props, forwardedRef) => {
913
- const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
914
- const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);
915
- return /* @__PURE__ */ jsx5(
916
- Presence,
917
- {
918
- present: forceMount || isIndeterminate(context.checked) || context.checked === true,
919
- children: /* @__PURE__ */ jsx5(
920
- Primitive.span,
921
- {
922
- "data-state": getState(context.checked),
923
- "data-disabled": context.disabled ? "" : void 0,
924
- ...indicatorProps,
925
- ref: forwardedRef,
926
- style: { pointerEvents: "none", ...props.style }
927
- }
928
- )
929
- }
930
- );
931
- }
932
- );
933
- CheckboxIndicator.displayName = INDICATOR_NAME;
934
- var BUBBLE_INPUT_NAME = "CheckboxBubbleInput";
935
- var CheckboxBubbleInput = React10.forwardRef(
936
- ({ __scopeCheckbox, ...props }, forwardedRef) => {
937
- const {
938
- control,
939
- hasConsumerStoppedPropagationRef,
940
- checked,
941
- defaultChecked,
942
- required,
943
- disabled,
944
- name,
945
- value,
946
- form,
947
- bubbleInput,
948
- setBubbleInput
949
- } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox);
950
- const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);
951
- const prevChecked = usePrevious(checked);
952
- const controlSize = useSize(control);
953
- React10.useEffect(() => {
954
- const input = bubbleInput;
955
- if (!input) return;
956
- const inputProto = window.HTMLInputElement.prototype;
957
- const descriptor = Object.getOwnPropertyDescriptor(
958
- inputProto,
959
- "checked"
960
- );
961
- const setChecked = descriptor.set;
962
- const bubbles = !hasConsumerStoppedPropagationRef.current;
963
- if (prevChecked !== checked && setChecked) {
964
- const event = new Event("click", { bubbles });
965
- input.indeterminate = isIndeterminate(checked);
966
- setChecked.call(input, isIndeterminate(checked) ? false : checked);
967
- input.dispatchEvent(event);
968
- }
969
- }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);
970
- const defaultCheckedRef = React10.useRef(isIndeterminate(checked) ? false : checked);
971
- return /* @__PURE__ */ jsx5(
972
- Primitive.input,
973
- {
974
- type: "checkbox",
975
- "aria-hidden": true,
976
- defaultChecked: defaultChecked ?? defaultCheckedRef.current,
977
- required,
978
- disabled,
979
- name,
980
- value,
981
- form,
982
- ...props,
983
- tabIndex: -1,
984
- ref: composedRefs,
985
- style: {
986
- ...props.style,
987
- ...controlSize,
988
- position: "absolute",
989
- pointerEvents: "none",
990
- opacity: 0,
991
- margin: 0,
992
- // We transform because the input is absolutely positioned but we have
993
- // rendered it **after** the button. This pulls it back to sit on top
994
- // of the button.
995
- transform: "translateX(-100%)"
996
- }
997
- }
998
- );
999
- }
1000
- );
1001
- CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;
1002
- function isFunction2(value) {
1003
- return typeof value === "function";
1004
- }
1005
- function isIndeterminate(checked) {
1006
- return checked === "indeterminate";
1007
- }
1008
- function getState(checked) {
1009
- return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
1010
- }
1011
-
1012
- // src/hooks/useOverwritableState.ts
1013
- import { useEffect as useEffect5, useState as useState5 } from "react";
1014
-
1015
- // src/utils/resolveSetState.ts
1016
- function resolveSetState(action, prev) {
1017
- return typeof action === "function" ? action(prev) : action;
1018
- }
1019
-
1020
- // src/hooks/useOverwritableState.ts
1021
- var useOverwritableState = (initialValue, onChange) => {
1022
- const [state, setState] = useState5(initialValue);
1023
- useEffect5(() => {
1024
- setState(initialValue);
1025
- }, [initialValue]);
1026
- const onChangeWrapper = (action) => {
1027
- const resolved = resolveSetState(action, state);
1028
- setState(resolved);
1029
- onChange?.(state);
1030
- };
1031
- return [state, onChangeWrapper];
1032
- };
1033
-
1034
- // src/components/user-action/Checkbox.tsx
1035
- import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
1036
- var checkboxSizeMapping = {
1037
- sm: "size-5 border-1",
1038
- md: "size-6 border-1",
1039
- lg: "size-8 border-2"
1040
- };
1041
- var checkboxIconSizeMapping = {
1042
- sm: "size-4 stroke-3",
1043
- md: "size-5 stroke-3",
1044
- lg: "size-7 stroke-3"
1045
- };
1046
- var Checkbox2 = ({
1047
- disabled,
1048
- checked = false,
1049
- indeterminate = false,
1050
- onChange,
1051
- size = "md",
1052
- className = "",
1053
- ...props
1054
- }) => {
1055
- const usedSizeClass = checkboxSizeMapping[size];
1056
- const innerIconSize = checkboxIconSizeMapping[size];
1057
- return /* @__PURE__ */ jsx6(
1058
- Checkbox,
1059
- {
1060
- ...props,
1061
- disabled,
1062
- checked: indeterminate ? "indeterminate" : checked,
1063
- onCheckedChange: onChange,
1064
- className: clsx2(
1065
- usedSizeClass,
1066
- `flex-col-0 items-center justify-center rounded`,
1067
- {
1068
- "text-disabled border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
1069
- "hover:border-primary": !disabled,
1070
- "bg-input-background": !disabled && !checked,
1071
- "bg-primary/30 border-primary text-primary": !disabled && (checked || indeterminate)
1072
- },
1073
- className
1074
- ),
1075
- children: /* @__PURE__ */ jsxs3(CheckboxIndicator, { children: [
1076
- !checked && !indeterminate && /* @__PURE__ */ jsx6("div", { className: clsx2("bg-input-background", innerIconSize) }),
1077
- checked && !indeterminate && /* @__PURE__ */ jsx6(Check, { className: innerIconSize }),
1078
- indeterminate && /* @__PURE__ */ jsx6(Minus, { className: innerIconSize })
1079
- ] })
1080
- }
1081
- );
1082
- };
1083
- var CheckboxUncontrolled = ({
1084
- checked: initialChecked,
1085
- onChange,
1086
- ...props
1087
- }) => {
1088
- const [checked, setChecked] = useOverwritableState(initialChecked, onChange);
1089
- return /* @__PURE__ */ jsx6(
1090
- Checkbox2,
1091
- {
1092
- ...props,
1093
- checked,
1094
- onChange: setChecked
1095
- }
1096
- );
1097
- };
1098
-
1099
- // src/components/user-action/CopyToClipboardWrapper.tsx
1100
- import { useState as useState8 } from "react";
1101
- import { clsx as clsx3 } from "clsx";
1102
-
1103
- // src/utils/writeToClipboard.ts
1104
- var writeToClipboard = (text) => {
1105
- return navigator.clipboard.writeText(text);
1106
- };
1107
-
1108
- // src/components/user-action/CopyToClipboardWrapper.tsx
1109
- import { CheckIcon, Copy } from "lucide-react";
1110
-
1111
- // src/i18n/LocaleProvider.tsx
1112
- import { createContext as createContext2, useContext as useContext2, useEffect as useEffect6, useMemo as useMemo4, useState as useState7 } from "react";
1113
-
1114
- // src/hooks/useLocalStorage.ts
1115
- import { useCallback as useCallback4, useState as useState6 } from "react";
1116
-
1117
- // src/i18n/translations.ts
1118
- import { TranslationGen } from "@helpwave/internationalization";
1119
- var hightideTranslationLocales = ["de-DE", "en-US"];
1120
- var hightideTranslation = {
1121
- "de-DE": {
1122
- "add": `Hinzuf\xFCgen`,
1123
- "age": `Alter`,
1124
- "all": `Alle`,
1125
- "apply": `Anwenden`,
1126
- "back": `Zur\xFCck`,
1127
- "cancel": `Abbrechen`,
1128
- "carousel": `Karussell`,
1129
- "change": `\xC4ndern`,
1130
- "chooseLanguage": `W\xE4hle deine bevorzugte Sprache`,
1131
- "chooseSlide": `W\xE4hle die angezeigte Slide aus`,
1132
- "chooseTheme": `W\xE4hle dein bevorzugtes Farbschema.`,
1133
- "clear": `L\xF6schen`,
1134
- "click": `Klicken`,
1135
- "clickToCopy": `Zum kopieren klicken`,
1136
- "clickToSelect": `Zum Ausw\xE4hlen dr\xFCcken`,
1137
- "close": `Schlie\xDFen`,
1138
- "confirm": `Best\xE4tigen`,
1139
- "copied": `Kopiert`,
1140
- "copy": `Kopieren`,
1141
- "create": `Erstellen`,
1142
- "decline": `Ablehnen`,
1143
- "delete": `L\xF6schen`,
1144
- "discard": `Verwerfen`,
1145
- "discardChanges": `\xC4nderungen Verwerfen`,
1146
- "done": `Fertig`,
1147
- "edit": `Bearbeiten`,
1148
- "endDate": `Ende`,
1149
- "enterText": `Text hier eingeben`,
1150
- "entryDate": `Eintragsdatum`,
1151
- "error": `Fehler`,
1152
- "errorOccurred": `Ein Fehler ist aufgetreten`,
1153
- "exit": `Beenden`,
1154
- "fieldRequiredError": `Dieses Feld ist erforderlich.`,
1155
- "filter": `Filter`,
1156
- "gender": ({ gender }) => {
1157
- return TranslationGen.resolveSelect(gender, {
1158
- "male": `M\xE4nnlich`,
1159
- "female": `Weiblich`,
1160
- "other": `Divers`
1161
- });
1162
- },
1163
- "goodToSeeYou": `Sch\xF6n dich zu sehen`,
1164
- "identifier": `Identifikator`,
1165
- "invalidEmail": `Die E-Mail ist ung\xFCltig.`,
1166
- "invalidEmailError": `Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.`,
1167
- "language": `Sprache`,
1168
- "less": `Weniger`,
1169
- "loading": `L\xE4dt`,
1170
- "locale": `Locale`,
1171
- "max": `Max`,
1172
- "maxLengthError": `Maximale L\xE4nge \xFCberschritten.`,
1173
- "min": `Min`,
1174
- "minLengthError": `Mindestl\xE4nge nicht erreicht.`,
1175
- "more": `Mehr`,
1176
- "name": `Name`,
1177
- "next": `Weiter`,
1178
- "no": `Nein`,
1179
- "none": `Nichts`,
1180
- "notEmpty": `Das Feld darf nicht leer sein.`,
1181
- "nothingFound": `Nichts gefunden`,
1182
- "of": `von`,
1183
- "optional": `Optional`,
1184
- "outOfRangeNumber": ({ min, max }) => {
1185
- return `Der Wert muss zwischen ${min} und ${max} liegen.`;
1186
- },
1187
- "outOfRangeSelectionItems": ({ min, max }) => {
1188
- return `Es m\xFCssen zwischen ${min} und ${max} Elemente ausgew\xE4hlt werden.`;
1189
- },
1190
- "outOfRangeString": ({ min, max }) => {
1191
- return `Der Wert muss zwischen ${min} und ${max} Zeichen lang sein.`;
1192
- },
1193
- "pleaseWait": `Bitte warten...`,
1194
- "previous": `Vorherige`,
1195
- "remove": `Entfernen`,
1196
- "required": `Erforderlich`,
1197
- "reset": `Zur\xFCcksetzen`,
1198
- "save": `Speichern`,
1199
- "saved": `Gespeichert`,
1200
- "search": `Suche`,
1201
- "select": `Select`,
1202
- "selectOption": `Option ausw\xE4hlen`,
1203
- "show": `Anzeigen`,
1204
- "showLess": `Weniger anzeigen`,
1205
- "showMore": `Mehr anzeigen`,
1206
- "showSlide": ({ index }) => {
1207
- return `Zeige Slide ${index}`;
1208
- },
1209
- "slide": `Slide`,
1210
- "slideNavigation": `Slide Navigation`,
1211
- "slideOf": ({ index, length }) => {
1212
- return `Slide ${index} von ${length} slides`;
1213
- },
1214
- "startDate": `Start`,
1215
- "street": `Stra\xDFe`,
1216
- "submit": `Abschicken`,
1217
- "success": `Erfolg`,
1218
- "text": `Text`,
1219
- "themeMode": ({ theme }) => {
1220
- return TranslationGen.resolveSelect(theme, {
1221
- "dark": `Dunkel`,
1222
- "light": `Hell`,
1223
- "system": `System`
1224
- });
1225
- },
1226
- "themes": ({ count }) => {
1227
- return TranslationGen.resolveSelect(count, {
1228
- "=1": `Farbschema`,
1229
- "other": `Farbschemas`
1230
- });
1231
- },
1232
- "time.ago": `vor`,
1233
- "time.agoDays": ({ days }) => {
1234
- return `var ${days} Tagen`;
1235
- },
1236
- "time.april": `April`,
1237
- "time.august": `August`,
1238
- "time.century": ({ count }) => {
1239
- return TranslationGen.resolveSelect(count, {
1240
- "=1": `Jahrhundert`,
1241
- "other": `Jahrhunderte`
1242
- });
1243
- },
1244
- "time.day": ({ count }) => {
1245
- return TranslationGen.resolveSelect(count, {
1246
- "=1": `Tag`,
1247
- "other": `Tage`
1248
- });
1249
- },
1250
- "time.decade": ({ count }) => {
1251
- return TranslationGen.resolveSelect(count, {
1252
- "=1": `Jahrzehnt`,
1253
- "other": `Jahrzehnte`
1254
- });
1255
- },
1256
- "time.december": `December`,
1257
- "time.february": `Febuar`,
1258
- "time.hour": ({ count }) => {
1259
- return TranslationGen.resolveSelect(count, {
1260
- "=1": `Stunde`,
1261
- "other": `Stunden`
1262
- });
1263
- },
1264
- "time.in": `in`,
1265
- "time.inDays": ({ days }) => {
1266
- return `in ${days} Tagen`;
1267
- },
1268
- "time.january": `Januar`,
1269
- "time.july": `Juli`,
1270
- "time.june": `Juni`,
1271
- "time.march": `M\xE4rz`,
1272
- "time.may": `Mai`,
1273
- "time.microsecond": ({ count }) => {
1274
- return TranslationGen.resolveSelect(count, {
1275
- "=1": `Mikrosekunde`,
1276
- "other": `Mikrosekunden`
1277
- });
1278
- },
1279
- "time.millisecond": ({ count }) => {
1280
- return TranslationGen.resolveSelect(count, {
1281
- "=1": `Millisekunde`,
1282
- "other": `Millisekunden`
1283
- });
1284
- },
1285
- "time.minute": ({ count }) => {
1286
- return TranslationGen.resolveSelect(count, {
1287
- "=1": `Minute`,
1288
- "other": `Minuten`
1289
- });
1290
- },
1291
- "time.month": ({ count }) => {
1292
- return TranslationGen.resolveSelect(count, {
1293
- "=1": `Monat`,
1294
- "other": `Monate`
1295
- });
1296
- },
1297
- "time.monthName": ({ month }) => {
1298
- return TranslationGen.resolveSelect(month, {
1299
- "january": `Januar`,
1300
- "february": `Februar`,
1301
- "march": `M\xE4rz`,
1302
- "april": `April`,
1303
- "may": `Mai`,
1304
- "june": `Juni`,
1305
- "july": `Juli`,
1306
- "august": `August`,
1307
- "september": `September`,
1308
- "october": `Oktober`,
1309
- "november": `November`,
1310
- "december": `Dezember`,
1311
- "other": `Unbekannter Monat`
1312
- });
1313
- },
1314
- "time.nanosecond": ({ count }) => {
1315
- return TranslationGen.resolveSelect(count, {
1316
- "=1": `Nanosekunde`,
1317
- "other": `Nanosekunden`
1318
- });
1319
- },
1320
- "time.november": `November`,
1321
- "time.october": `October`,
1322
- "time.second": ({ count }) => {
1323
- return TranslationGen.resolveSelect(count, {
1324
- "=1": `Sekunde`,
1325
- "other": `Sekunden`
1326
- });
1327
- },
1328
- "time.september": `September`,
1329
- "time.today": `Heute`,
1330
- "time.tomorrow": `Morgen`,
1331
- "time.year": ({ count }) => {
1332
- return TranslationGen.resolveSelect(count, {
1333
- "=1": `Jahr`,
1334
- "other": `Jahre`
1335
- });
1336
- },
1337
- "time.yesterday": `Gestern`,
1338
- "tooFewSelectionItems": ({ min }) => {
1339
- return `Es m\xFCssen mindestens ${min} Elemente ausgew\xE4hlt werden.`;
1340
- },
1341
- "tooLong": ({ max }) => {
1342
- return `Der Wert darf h\xF6chstens ${max} Zeichen enthalten.`;
1343
- },
1344
- "tooManySelectionItems": ({ max }) => {
1345
- return `Es m\xFCssen maximal ${max} Elemente ausgew\xE4hlt werden.`;
1346
- },
1347
- "tooShort": ({ min }) => {
1348
- return `Der Wert muss mindestens ${min} Zeichen enthalten.`;
1349
- },
1350
- "unsavedChanges": `Ungespeicherte \xC4nderungen`,
1351
- "unsavedChangesSaveQuestion": `M\xF6chtest du die \xC4nderungen speichern?`,
1352
- "update": `Update`,
1353
- "value": `Wert`,
1354
- "welcome": `Willkommen`,
1355
- "yes": `Ja`
1356
- },
1357
- "en-US": {
1358
- "add": `Add`,
1359
- "age": `Age`,
1360
- "all": `All`,
1361
- "apply": `Apply`,
1362
- "back": `Back`,
1363
- "cancel": `Cancel`,
1364
- "carousel": `Carousel`,
1365
- "change": `Change`,
1366
- "chooseLanguage": `Choose your language`,
1367
- "chooseSlide": `Choose slide to display`,
1368
- "chooseTheme": `Choose your preferred color theme.`,
1369
- "clear": `Clear`,
1370
- "click": `Click`,
1371
- "clickToCopy": `Click to Copy`,
1372
- "clickToSelect": `Click to select`,
1373
- "close": `Close`,
1374
- "confirm": `Confirm`,
1375
- "copied": `Copied`,
1376
- "copy": `Copy`,
1377
- "create": `Create`,
1378
- "decline": `Decline`,
1379
- "delete": `Delete`,
1380
- "discard": `Discard`,
1381
- "discardChanges": `Discard Changes`,
1382
- "done": `Done`,
1383
- "edit": `Edit`,
1384
- "endDate": `End`,
1385
- "enterText": `Enter text here`,
1386
- "entryDate": `Entry Date`,
1387
- "error": `Error`,
1388
- "errorOccurred": `An error occurred`,
1389
- "exit": `Exit`,
1390
- "fieldRequiredError": `This field is required.`,
1391
- "filter": `Filter`,
1392
- "gender": ({ gender }) => {
1393
- return TranslationGen.resolveSelect(gender, {
1394
- "male": `Male`,
1395
- "female": `Female`,
1396
- "other": `Other`
1397
- });
1398
- },
1399
- "goodToSeeYou": `Good to see you`,
1400
- "identifier": `Identifier`,
1401
- "invalidEmail": `The email is not valid.`,
1402
- "invalidEmailError": `Please enter a valid email address.`,
1403
- "language": `Language`,
1404
- "less": `Less`,
1405
- "loading": `Loading`,
1406
- "locale": `Locale`,
1407
- "max": `Max`,
1408
- "maxLengthError": `Maximum length exceeded.`,
1409
- "min": `Min`,
1410
- "minLengthError": `Minimum length not met.`,
1411
- "more": `More`,
1412
- "name": `Name`,
1413
- "next": `Next`,
1414
- "no": `No`,
1415
- "none": `None`,
1416
- "notEmpty": `The field cannot be empty.`,
1417
- "nothingFound": `Nothing found`,
1418
- "of": `of`,
1419
- "optional": `Optional`,
1420
- "outOfRangeNumber": ({ min, max }) => {
1421
- return `The value must be between ${min} and ${max}.`;
1422
- },
1423
- "outOfRangeSelectionItems": ({ min, max }) => {
1424
- return `Between ${min} and ${max} items must be selected.`;
1425
- },
1426
- "outOfRangeString": ({ min, max }) => {
1427
- return `The value needs to have between ${min} and ${max} characters.`;
1428
- },
1429
- "pleaseWait": `Please wait...`,
1430
- "previous": `Previous`,
1431
- "remove": `Remove`,
1432
- "required": `Required`,
1433
- "reset": `Reset`,
1434
- "save": `Save`,
1435
- "saved": `Saved`,
1436
- "search": `Search`,
1437
- "select": `Select`,
1438
- "selectOption": `Select an option`,
1439
- "show": `Show`,
1440
- "showLess": `Show less`,
1441
- "showMore": `Show more`,
1442
- "showSlide": ({ index }) => {
1443
- return `Show Slide ${index}`;
1444
- },
1445
- "slide": `Slide`,
1446
- "slideNavigation": `Slide navigation`,
1447
- "slideOf": ({ index, length }) => {
1448
- return `Slide ${index} of ${length} slides`;
1449
- },
1450
- "startDate": `Start`,
1451
- "street": `Street`,
1452
- "submit": `Submit`,
1453
- "success": `Success`,
1454
- "text": `Text`,
1455
- "themeMode": ({ theme }) => {
1456
- return TranslationGen.resolveSelect(theme, {
1457
- "dark": `Dark`,
1458
- "light": `Light`,
1459
- "system": `System`
1460
- });
1461
- },
1462
- "themes": ({ count }) => {
1463
- return TranslationGen.resolveSelect(count, {
1464
- "=1": `Theme`,
1465
- "other": `Themes`
1466
- });
1467
- },
1468
- "time.ago": `ago`,
1469
- "time.agoDays": ({ days }) => {
1470
- return `days ${days} ago`;
1471
- },
1472
- "time.april": `April`,
1473
- "time.august": `August`,
1474
- "time.century": ({ count }) => {
1475
- return TranslationGen.resolveSelect(count, {
1476
- "=1": `Century`,
1477
- "other": `Centuries`
1478
- });
1479
- },
1480
- "time.day": ({ count }) => {
1481
- return TranslationGen.resolveSelect(count, {
1482
- "=1": `Day`,
1483
- "other": `Days`
1484
- });
1485
- },
1486
- "time.decade": ({ count }) => {
1487
- return TranslationGen.resolveSelect(count, {
1488
- "=1": `Decade`,
1489
- "other": `Decades`
1490
- });
1491
- },
1492
- "time.december": `December`,
1493
- "time.february": `Febuary`,
1494
- "time.hour": ({ count }) => {
1495
- return TranslationGen.resolveSelect(count, {
1496
- "=1": `Hour`,
1497
- "other": `Hours`
1498
- });
1499
- },
1500
- "time.in": `in`,
1501
- "time.inDays": ({ days }) => {
1502
- return `in ${days} days`;
1503
- },
1504
- "time.january": `January`,
1505
- "time.july": `July`,
1506
- "time.june": `June`,
1507
- "time.march": `March`,
1508
- "time.may": `May`,
1509
- "time.microsecond": ({ count }) => {
1510
- return TranslationGen.resolveSelect(count, {
1511
- "=1": `Microsecond`,
1512
- "other": `Microseconds`
1513
- });
1514
- },
1515
- "time.millisecond": ({ count }) => {
1516
- return TranslationGen.resolveSelect(count, {
1517
- "=1": `Millisecond`,
1518
- "other": `Milliseconds`
1519
- });
1520
- },
1521
- "time.minute": ({ count }) => {
1522
- return TranslationGen.resolveSelect(count, {
1523
- "=1": `Minute`,
1524
- "other": `Minutes`
1525
- });
1526
- },
1527
- "time.month": ({ count }) => {
1528
- return TranslationGen.resolveSelect(count, {
1529
- "=1": `Month`,
1530
- "other": `Months`
1531
- });
1532
- },
1533
- "time.monthName": ({ month }) => {
1534
- return TranslationGen.resolveSelect(month, {
1535
- "january": `January`,
1536
- "february": `February`,
1537
- "march": `March`,
1538
- "april": `April`,
1539
- "may": `May`,
1540
- "june": `June`,
1541
- "july": `July`,
1542
- "august": `August`,
1543
- "september": `September`,
1544
- "october": `October`,
1545
- "november": `November`,
1546
- "december": `December`,
1547
- "other": `Unknown Month`
1548
- });
1549
- },
1550
- "time.nanosecond": ({ count }) => {
1551
- return TranslationGen.resolveSelect(count, {
1552
- "=1": `Nanosecond`,
1553
- "other": `Nanoseconds`
1554
- });
1555
- },
1556
- "time.november": `November`,
1557
- "time.october": `October`,
1558
- "time.second": ({ count }) => {
1559
- return TranslationGen.resolveSelect(count, {
1560
- "=1": `Second`,
1561
- "other": `Seconds`
1562
- });
1563
- },
1564
- "time.september": `September`,
1565
- "time.today": `Today`,
1566
- "time.tomorrow": `Tomorrow`,
1567
- "time.year": ({ count }) => {
1568
- return TranslationGen.resolveSelect(count, {
1569
- "=1": `Year`,
1570
- "other": `Years`
1571
- });
1572
- },
1573
- "time.yesterday": `Yesterday`,
1574
- "tooFewSelectionItems": ({ min }) => {
1575
- return `Select at least ${min} items.`;
1576
- },
1577
- "tooLong": ({ max }) => {
1578
- return `The value requires less than ${max} characters.`;
1579
- },
1580
- "tooManySelectionItems": ({ max }) => {
1581
- return `Select at most ${max} items.`;
1582
- },
1583
- "tooShort": ({ min }) => {
1584
- return `The value requires at least ${min} characters.`;
1585
- },
1586
- "unsavedChanges": `Unsaved Changes`,
1587
- "unsavedChangesSaveQuestion": `Do you want to save your changes?`,
1588
- "update": `Update`,
1589
- "value": `Value`,
1590
- "welcome": `Welcome`,
1591
- "yes": `Yes`
1592
- }
1593
- };
1594
-
1595
- // src/i18n/util.ts
1596
- var localsNames = {
1597
- "en-US": "English (US)",
1598
- "de-DE": "Deutsch"
1599
- };
1600
- var DEFAULT_LOCALE = "en-US";
1601
- function localeToLanguage(locale) {
1602
- return locale.split("-")[0];
1603
- }
1604
- var LocalizationUtil = {
1605
- locals: hightideTranslationLocales,
1606
- localToLanguage: localeToLanguage,
1607
- DEFAULT_LOCALE,
1608
- languagesLocalNames: localsNames
1609
- };
1610
-
1611
- // src/i18n/LocaleProvider.tsx
1612
- import { jsx as jsx7 } from "react/jsx-runtime";
1613
- var LocaleContext = createContext2({
1614
- locale: LocalizationUtil.DEFAULT_LOCALE,
1615
- setLocale: (v) => v
1616
- });
1617
- var useLocale = () => {
1618
- const context = useContext2(LocaleContext);
1619
- if (!context) {
1620
- throw new Error("useLocale must be used within LocaleContext. Try adding a LocaleProvider around your app.");
1621
- }
1622
- return context;
1623
- };
1624
-
1625
- // src/i18n/useHightideTranslation.ts
1626
- import { combineTranslation, ICUUtil } from "@helpwave/internationalization";
1627
-
1628
- // src/utils/array.ts
1629
- var equalSizeGroups = (array, groupSize) => {
1630
- if (groupSize <= 0) {
1631
- console.warn(`group size should be greater than 0: groupSize = ${groupSize}`);
1632
- return [[...array]];
1633
- }
1634
- const groups = [];
1635
- for (let i = 0; i < array.length; i += groupSize) {
1636
- groups.push(array.slice(i, Math.min(i + groupSize, array.length)));
1637
- }
1638
- return groups;
1639
- };
1640
- var defaultRangeOptions = {
1641
- allowEmptyRange: false,
1642
- stepSize: 1,
1643
- exclusiveStart: false,
1644
- exclusiveEnd: true
1645
- };
1646
- var range = (endOrRange, options) => {
1647
- const { allowEmptyRange, stepSize, exclusiveStart, exclusiveEnd } = { ...defaultRangeOptions, ...options };
1648
- let start = 0;
1649
- let end;
1650
- if (typeof endOrRange === "number") {
1651
- end = endOrRange;
1652
- } else {
1653
- start = endOrRange[0];
1654
- end = endOrRange[1];
1655
- }
1656
- if (!exclusiveEnd) {
1657
- end -= 1;
1658
- }
1659
- if (exclusiveStart) {
1660
- start += 1;
1661
- }
1662
- if (end - 1 < start) {
1663
- if (!allowEmptyRange) {
1664
- console.warn(`range: end (${end}) < start (${start}) should be allowed explicitly, set options.allowEmptyRange to true`);
1665
- }
1666
- return [];
1667
- }
1668
- return Array.from({ length: end - start }, (_, index) => index * stepSize + start);
1669
- };
1670
- var closestMatch = (list, firstCloser) => {
1671
- return list.reduce((item1, item2) => {
1672
- return firstCloser(item1, item2) ? item1 : item2;
1673
- });
1674
- };
1675
- var getNeighbours = (list, item, neighbourDistance = 2) => {
1676
- const index = list.indexOf(item);
1677
- const totalItems = neighbourDistance * 2 + 1;
1678
- if (list.length < totalItems) {
1679
- console.warn("List is to short");
1680
- return list;
1681
- }
1682
- if (index === -1) {
1683
- console.error("item not found in list");
1684
- return list.splice(0, totalItems);
1685
- }
1686
- let start = index - neighbourDistance;
1687
- if (start < 0) {
1688
- start += list.length;
1689
- }
1690
- const end = (index + neighbourDistance + 1) % list.length;
1691
- const result = [];
1692
- let ignoreOnce = list.length === totalItems;
1693
- for (let i = start; i !== end || ignoreOnce; i = (i + 1) % list.length) {
1694
- result.push(list[i]);
1695
- if (end === i && ignoreOnce) {
1696
- ignoreOnce = false;
1697
- }
1698
- }
1699
- return result;
1700
- };
1701
- var moveItems = (list, move = 0) => {
1702
- const result = [];
1703
- let start = move;
1704
- if (start < 0) {
1705
- start = list.length - move;
1706
- }
1707
- start = start % list.length;
1708
- for (let i = 0; i < list.length; i++) {
1709
- result[i] = list[(i + start) % list.length];
1710
- }
1711
- return result;
1712
- };
1713
- function resolveSingleOrArray(value) {
1714
- if (Array.isArray(value)) {
1715
- return value;
1716
- } else if (value) {
1717
- return [value];
1718
- }
1719
- return [];
1720
- }
1721
- var ArrayUtil = {
1722
- unique: (list) => {
1723
- const seen = /* @__PURE__ */ new Set();
1724
- return list.filter((item) => {
1725
- if (seen.has(item)) {
1726
- return false;
1727
- }
1728
- seen.add(item);
1729
- return true;
1730
- });
1731
- },
1732
- difference: (list, removeList) => {
1733
- const remove = new Set(removeList);
1734
- return list.filter((item) => !remove.has(item));
1735
- },
1736
- moveItems,
1737
- resolveSingleOrArray
1738
- };
1739
-
1740
- // src/i18n/useHightideTranslation.ts
1741
- function useHightideTranslation(extensions, overwrites) {
1742
- const { locale: inferredLocale } = useLocale();
1743
- const locale = overwrites?.locale ?? inferredLocale;
1744
- const translationExtensions = ArrayUtil.resolveSingleOrArray(extensions);
1745
- return combineTranslation([
1746
- ...translationExtensions,
1747
- hightideTranslation
1748
- ], locale);
1749
- }
1750
-
1751
- // src/components/user-action/CopyToClipboardWrapper.tsx
1752
- import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
1753
- var CopyToClipboardWrapper = ({
1754
- children,
1755
- textToCopy,
1756
- tooltipClassName = "",
1757
- containerClassName = "",
1758
- position = "bottom",
1759
- zIndex = 10
1760
- }) => {
1761
- const translation = useHightideTranslation();
1762
- const [isShowingIndication, setIsShowingIndication] = useState8(false);
1763
- const [isShowingConfirmation, setIsShowingConfirmation] = useState8(false);
1764
- const positionClasses = {
1765
- top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
1766
- bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
1767
- left: `right-full top-1/2 -translate-y-1/2 mr-[6px]`,
1768
- right: `left-full top-1/2 -translate-y-1/2 ml-[6px]`
1769
- };
1770
- const triangleSize = 6;
1771
- const triangleClasses = {
1772
- top: `top-full left-1/2 -translate-x-1/2 border-t-tooltip-background border-l-transparent border-r-transparent`,
1773
- bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-tooltip-background border-l-transparent border-r-transparent`,
1774
- left: `left-full top-1/2 -translate-y-1/2 border-l-tooltip-background border-t-transparent border-b-transparent`,
1775
- right: `right-full top-1/2 -translate-y-1/2 border-r-tooltip-background border-t-transparent border-b-transparent`
1776
- };
1777
- const triangleStyle = {
1778
- top: { borderWidth: `${triangleSize}px ${triangleSize}px 0 ${triangleSize}px` },
1779
- bottom: { borderWidth: `0 ${triangleSize}px ${triangleSize}px ${triangleSize}px` },
1780
- left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
1781
- right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
1782
- };
1783
- return /* @__PURE__ */ jsxs4(
1784
- "div",
1785
- {
1786
- className: clsx3("relative inline-block cursor-copy", containerClassName),
1787
- onMouseEnter: () => {
1788
- setIsShowingIndication(true);
1789
- },
1790
- onMouseLeave: () => {
1791
- setIsShowingIndication(false);
1792
- setIsShowingConfirmation(false);
1793
- },
1794
- onClick: () => {
1795
- writeToClipboard(textToCopy).catch(console.error);
1796
- setIsShowingIndication(false);
1797
- setIsShowingConfirmation(true);
1798
- },
1799
- children: [
1800
- children,
1801
- /* @__PURE__ */ jsxs4(
1802
- "div",
1803
- {
1804
- className: clsx3(
1805
- `absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
1806
- shadow-around-md bg-tooltip-background cursor-default pointer-events-none`,
1807
- "transition-opacity duration-200",
1808
- positionClasses[position],
1809
- tooltipClassName
1810
- ),
1811
- style: {
1812
- zIndex,
1813
- opacity: isShowingIndication || isShowingConfirmation ? 1 : 0
1814
- },
1815
- children: [
1816
- isShowingConfirmation && /* @__PURE__ */ jsxs4("div", { className: "flex-row-1", children: [
1817
- /* @__PURE__ */ jsx8(CheckIcon, { size: 16, className: "text-positive" }),
1818
- translation("copied")
1819
- ] }),
1820
- isShowingIndication && /* @__PURE__ */ jsxs4("div", { className: "flex-row-1 text-description", children: [
1821
- /* @__PURE__ */ jsx8(Copy, { size: 16 }),
1822
- translation("clickToCopy")
1823
- ] }),
1824
- /* @__PURE__ */ jsx8(
1825
- "div",
1826
- {
1827
- className: clsx3(`absolute w-0 h-0`, triangleClasses[position]),
1828
- style: { ...triangleStyle[position], zIndex: zIndex + 1 }
1829
- }
1830
- )
1831
- ]
1832
- }
1833
- )
1834
- ]
1835
- }
1836
- );
1837
- };
1838
-
1839
- // src/components/user-action/DateAndTimePicker.tsx
1840
- import clsx9 from "clsx";
1841
-
1842
- // src/utils/date.ts
1843
- var monthsList = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
1844
- var weekDayList = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
1845
- var changeDuration = (date, duration, isAdding) => {
1846
- const {
1847
- years = 0,
1848
- months = 0,
1849
- days = 0,
1850
- hours = 0,
1851
- minutes = 0,
1852
- seconds = 0,
1853
- milliseconds = 0
1854
- } = duration;
1855
- if (years < 0) {
1856
- console.error(`Range error years must be greater than 0: received ${years}`);
1857
- return new Date(date);
1858
- }
1859
- if (months < 0 || months > 11) {
1860
- console.error(`Range error month must be 0 <= month <= 11: received ${months}`);
1861
- return new Date(date);
1862
- }
1863
- if (days < 0) {
1864
- console.error(`Range error days must be greater than 0: received ${days}`);
1865
- return new Date(date);
1866
- }
1867
- if (hours < 0 || hours > 23) {
1868
- console.error(`Range error hours must be 0 <= hours <= 23: received ${hours}`);
1869
- return new Date(date);
1870
- }
1871
- if (minutes < 0 || minutes > 59) {
1872
- console.error(`Range error minutes must be 0 <= minutes <= 59: received ${minutes}`);
1873
- return new Date(date);
1874
- }
1875
- if (seconds < 0 || seconds > 59) {
1876
- console.error(`Range error seconds must be 0 <= seconds <= 59: received ${seconds}`);
1877
- return new Date(date);
1878
- }
1879
- if (milliseconds < 0) {
1880
- console.error(`Range error seconds must be greater than 0: received ${milliseconds}`);
1881
- return new Date(date);
1882
- }
1883
- const multiplier = isAdding ? 1 : -1;
1884
- const newDate = new Date(date);
1885
- newDate.setFullYear(newDate.getFullYear() + multiplier * years);
1886
- newDate.setMonth(newDate.getMonth() + multiplier * months);
1887
- newDate.setDate(newDate.getDate() + multiplier * days);
1888
- newDate.setHours(newDate.getHours() + multiplier * hours);
1889
- newDate.setMinutes(newDate.getMinutes() + multiplier * minutes);
1890
- newDate.setSeconds(newDate.getSeconds() + multiplier * seconds);
1891
- newDate.setMilliseconds(newDate.getMilliseconds() + multiplier * milliseconds);
1892
- return newDate;
1893
- };
1894
- var addDuration = (date, duration) => {
1895
- return changeDuration(date, duration, true);
1896
- };
1897
- var subtractDuration = (date, duration) => {
1898
- return changeDuration(date, duration, false);
1899
- };
1900
- var isInTimeSpan = (value, startDate, endDate) => {
1901
- if (startDate && endDate) {
1902
- console.assert(startDate <= endDate);
1903
- return startDate <= value && value <= endDate;
1904
- } else if (startDate) {
1905
- return startDate <= value;
1906
- } else if (endDate) {
1907
- return endDate >= value;
1908
- } else {
1909
- return true;
1910
- }
1911
- };
1912
- var equalDate = (date1, date2) => {
1913
- return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();
1914
- };
1915
- var getWeeksForCalenderMonth = (date, weekStart, weeks = 6) => {
1916
- const month = date.getMonth();
1917
- const year = date.getFullYear();
1918
- const dayList = [];
1919
- let currentDate = new Date(year, month, 1);
1920
- const weekStartIndex = weekDayList.indexOf(weekStart);
1921
- while (currentDate.getDay() !== weekStartIndex) {
1922
- currentDate = subtractDuration(currentDate, { days: 1 });
1923
- }
1924
- while (dayList.length < 7 * weeks) {
1925
- const date2 = new Date(currentDate);
1926
- date2.setHours(date2.getHours(), date2.getMinutes());
1927
- dayList.push(date2);
1928
- currentDate = addDuration(currentDate, { days: 1 });
1929
- }
1930
- return equalSizeGroups(dayList, 7);
1931
- };
1932
-
1933
- // src/components/date/TimePicker.tsx
1934
- import { useEffect as useEffect7, useRef as useRef6 } from "react";
1935
- import { Scrollbars } from "react-custom-scrollbars-2";
1936
- import clsx4 from "clsx";
1937
- import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
1938
- var TimePicker = ({
1939
- time = /* @__PURE__ */ new Date(),
1940
- onChange,
1941
- is24HourFormat = true,
1942
- minuteIncrement = "5min",
1943
- maxHeight = 300,
1944
- className = ""
1945
- }) => {
1946
- const minuteRef = useRef6(null);
1947
- const hourRef = useRef6(null);
1948
- const isPM = time.getHours() >= 11;
1949
- const hours = is24HourFormat ? range(24) : range([1, 12], { exclusiveEnd: false });
1950
- let minutes = range(60);
1951
- useEffect7(() => {
1952
- const scrollToItem = () => {
1953
- if (minuteRef.current) {
1954
- const container = minuteRef.current.parentElement;
1955
- const hasOverflow = container.scrollHeight > maxHeight;
1956
- if (hasOverflow) {
1957
- minuteRef.current.scrollIntoView({
1958
- behavior: "instant",
1959
- block: "nearest"
1960
- });
1961
- }
1962
- }
1963
- };
1964
- scrollToItem();
1965
- }, [minuteRef, minuteRef.current]);
1966
- useEffect7(() => {
1967
- const scrollToItem = () => {
1968
- if (hourRef.current) {
1969
- const container = hourRef.current.parentElement;
1970
- const hasOverflow = container.scrollHeight > maxHeight;
1971
- if (hasOverflow) {
1972
- hourRef.current.scrollIntoView({
1973
- behavior: "instant",
1974
- block: "nearest"
1975
- });
1976
- }
1977
- }
1978
- };
1979
- scrollToItem();
1980
- }, [hourRef, hourRef.current]);
1981
- switch (minuteIncrement) {
1982
- case "5min":
1983
- minutes = minutes.filter((value) => value % 5 === 0);
1984
- break;
1985
- case "10min":
1986
- minutes = minutes.filter((value) => value % 10 === 0);
1987
- break;
1988
- case "15min":
1989
- minutes = minutes.filter((value) => value % 15 === 0);
1990
- break;
1991
- case "30min":
1992
- minutes = minutes.filter((value) => value % 30 === 0);
1993
- break;
1994
- }
1995
- const closestMinute = closestMatch(minutes, (item1, item2) => Math.abs(item1 - time.getMinutes()) < Math.abs(item2 - time.getMinutes()));
1996
- const style = (selected) => clsx4(
1997
- "chip-full hover:brightness-90 hover:bg-primary hover:text-on-primary rounded-md mr-3",
1998
- { "bg-primary text-on-primary": selected, "bg-white text-black": !selected }
1999
- );
2000
- const onChangeWrapper = (transformer) => {
2001
- const newDate = new Date(time);
2002
- transformer(newDate);
2003
- onChange?.(newDate);
2004
- };
2005
- return /* @__PURE__ */ jsxs5("div", { className: clsx4("flex-row-2 w-fit min-w-[150px] select-none", className), children: [
2006
- /* @__PURE__ */ jsx9(Scrollbars, { autoHeight: true, autoHeightMax: maxHeight, style: { height: "100%" }, children: /* @__PURE__ */ jsx9("div", { className: "flex-col-1 h-full", children: hours.map((hour) => {
2007
- const currentHour = hour === time.getHours() - (!is24HourFormat && isPM ? 12 : 0);
2008
- return /* @__PURE__ */ jsx9(
2009
- "button",
2010
- {
2011
- ref: currentHour ? hourRef : void 0,
2012
- className: style(currentHour),
2013
- onClick: () => onChangeWrapper((newDate) => newDate.setHours(hour + (!is24HourFormat && isPM ? 12 : 0))),
2014
- children: hour.toString().padStart(2, "0")
2015
- },
2016
- hour
2017
- );
2018
- }) }) }),
2019
- /* @__PURE__ */ jsx9(Scrollbars, { autoHeight: true, autoHeightMax: maxHeight, style: { height: "100%" }, children: /* @__PURE__ */ jsx9("div", { className: "flex-col-1 h-full", children: minutes.map((minute) => {
2020
- const currentMinute = minute === closestMinute;
2021
- return /* @__PURE__ */ jsx9(
2022
- "button",
2023
- {
2024
- ref: currentMinute ? minuteRef : void 0,
2025
- className: style(currentMinute),
2026
- onClick: () => onChangeWrapper((newDate) => newDate.setMinutes(minute)),
2027
- children: minute.toString().padStart(2, "0")
2028
- },
2029
- minute + minuteIncrement
2030
- );
2031
- }) }) }),
2032
- !is24HourFormat && /* @__PURE__ */ jsxs5("div", { className: "flex-col-1", children: [
2033
- /* @__PURE__ */ jsx9(
2034
- "button",
2035
- {
2036
- className: style(!isPM),
2037
- onClick: () => onChangeWrapper((newDate) => isPM && newDate.setHours(newDate.getHours() - 12)),
2038
- children: "AM"
2039
- }
2040
- ),
2041
- /* @__PURE__ */ jsx9(
2042
- "button",
2043
- {
2044
- className: style(isPM),
2045
- onClick: () => onChangeWrapper((newDate) => !isPM && newDate.setHours(newDate.getHours() + 12)),
2046
- children: "PM"
2047
- }
2048
- )
2049
- ] })
2050
- ] });
2051
- };
2052
-
2053
- // src/components/date/DatePicker.tsx
2054
- import { useEffect as useEffect10, useState as useState10 } from "react";
2055
- import { ArrowDown, ArrowUp, ChevronDown as ChevronDown2 } from "lucide-react";
2056
- import clsx8 from "clsx";
2057
-
2058
- // src/components/date/DayPicker.tsx
2059
- import clsx5 from "clsx";
2060
- import { useEffect as useEffect8, useState as useState9 } from "react";
2061
- import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
2062
- var DayPicker = ({
2063
- displayedMonth,
2064
- selected,
2065
- start,
2066
- end,
2067
- onChange,
2068
- weekStart = "monday",
2069
- markToday = true,
2070
- className = ""
2071
- }) => {
2072
- const { locale } = useLocale();
2073
- const month = displayedMonth.getMonth();
2074
- const weeks = getWeeksForCalenderMonth(displayedMonth, weekStart);
2075
- return /* @__PURE__ */ jsxs6("div", { className: clsx5("flex-col-1 min-w-[220px] select-none", className), children: [
2076
- /* @__PURE__ */ jsx10("div", { className: "flex-row-2 text-center", children: weeks[0].map((weekDay, index) => /* @__PURE__ */ jsx10("div", { className: "flex-1 font-semibold", children: new Intl.DateTimeFormat(locale, { weekday: "long" }).format(weekDay).substring(0, 2) }, index)) }),
2077
- weeks.map((week, index) => /* @__PURE__ */ jsx10("div", { className: "flex-row-2 text-center", children: week.map((date) => {
2078
- const isSelected = !!selected && equalDate(selected, date);
2079
- const isToday = equalDate(/* @__PURE__ */ new Date(), date);
2080
- const isSameMonth = date.getMonth() === month;
2081
- const isDayValid = isInTimeSpan(date, start, end);
2082
- return /* @__PURE__ */ jsx10(
2083
- "button",
2084
- {
2085
- disabled: !isDayValid,
2086
- className: clsx5(
2087
- "flex-1 rounded-full border-2",
2088
- {
2089
- "text-description": !isSameMonth && !isSelected && isDayValid,
2090
- "text-button-solid-neutral-text bg-button-solid-neutral-background": !isSelected && isSameMonth && isDayValid,
2091
- "text-button-solid-primary-text bg-button-solid-primary-background": isSelected && isDayValid,
2092
- "hover:brightness-90 hover:bg-button-solid-primary-background hover:text-button-solid-primary-text": isDayValid,
2093
- "text-disabled bg-disabled-background cursor-not-allowed": !isDayValid,
2094
- "border-secondary": isToday && markToday,
2095
- "border-transparent": !isToday || !markToday
2096
- }
2097
- ),
2098
- onClick: () => onChange?.(date),
2099
- children: date.getDate()
2100
- },
2101
- date.getDate()
2102
- );
2103
- }) }, index))
2104
- ] });
2105
- };
2106
-
2107
- // src/components/date/YearMonthPicker.tsx
2108
- import { useEffect as useEffect9, useRef as useRef7 } from "react";
2109
- import { Scrollbars as Scrollbars2 } from "react-custom-scrollbars-2";
2110
- import clsx7 from "clsx";
2111
-
2112
- // src/components/layout/Expandable.tsx
2113
- import { forwardRef as forwardRef5, useCallback as useCallback5, useId } from "react";
2114
- import { ChevronDown } from "lucide-react";
2115
- import clsx6 from "clsx";
2116
- import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
2117
- var ExpansionIcon = ({ isExpanded, className }) => {
2118
- return /* @__PURE__ */ jsx11(
2119
- ChevronDown,
2120
- {
2121
- "aria-hidden": true,
2122
- className: clsx6(
2123
- "min-w-6 w-6 min-h-6 h-6 transition-transform motion-safe:duration-200 motion-reduce:duration-0 ease-in-out",
2124
- { "rotate-180": isExpanded },
2125
- className
2126
- )
2127
- }
2128
- );
2129
- };
2130
- var Expandable = forwardRef5(function Expandable2({
2131
- children,
2132
- id: providedId,
2133
- label,
2134
- icon,
2135
- isExpanded = false,
2136
- onChange,
2137
- clickOnlyOnHeader = true,
2138
- disabled = false,
2139
- className,
2140
- headerClassName,
2141
- contentClassName,
2142
- contentExpandedClassName
2143
- }, ref) {
2144
- const defaultIcon = useCallback5((expanded) => /* @__PURE__ */ jsx11(ExpansionIcon, { isExpanded: expanded }), []);
2145
- icon ??= defaultIcon;
2146
- const generatedId = useId();
2147
- const id = providedId ?? generatedId;
2148
- return /* @__PURE__ */ jsxs7(
2149
- "div",
2150
- {
2151
- ref,
2152
- onClick: () => !clickOnlyOnHeader && !disabled && onChange?.(!isExpanded),
2153
- className: clsx6(
2154
- "flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm",
2155
- { "cursor-pointer": !clickOnlyOnHeader && !disabled },
2156
- className
2157
- ),
2158
- children: [
2159
- /* @__PURE__ */ jsxs7(
2160
- "button",
2161
- {
2162
- onClick: () => clickOnlyOnHeader && !disabled && onChange?.(!isExpanded),
2163
- className: clsx6(
2164
- "flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
2165
- {
2166
- "group-hover:brightness-97": !isExpanded,
2167
- "hover:brightness-97": isExpanded && !disabled,
2168
- "cursor-pointer": clickOnlyOnHeader && !disabled
2169
- },
2170
- headerClassName
2171
- ),
2172
- "aria-expanded": isExpanded,
2173
- "aria-controls": `${id}-content`,
2174
- "aria-disabled": disabled ?? void 0,
2175
- children: [
2176
- label,
2177
- icon(isExpanded)
2178
- ]
2179
- }
2180
- ),
2181
- /* @__PURE__ */ jsx11(
2182
- "div",
2183
- {
2184
- id: `${id}-content`,
2185
- className: clsx6(
2186
- "flex-col-2 px-4 transition-all duration-300 ease-in-out",
2187
- {
2188
- [clsx6("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
2189
- "max-h-0 opacity-0 overflow-hidden": !isExpanded
2190
- },
2191
- contentClassName
2192
- ),
2193
- role: "region",
2194
- children
2195
- }
2196
- )
2197
- ]
2198
- }
2199
- );
2200
- });
2201
- var ExpandableUncontrolled = forwardRef5(function ExpandableUncontrolled2({
2202
- isExpanded,
2203
- onChange,
2204
- ...props
2205
- }, ref) {
2206
- const [usedIsExpanded, setUsedIsExpanded] = useOverwritableState(isExpanded, onChange);
2207
- return /* @__PURE__ */ jsx11(
2208
- Expandable,
2209
- {
2210
- ...props,
2211
- ref,
2212
- isExpanded: usedIsExpanded,
2213
- onChange: setUsedIsExpanded
2214
- }
2215
- );
2216
- });
2217
-
2218
- // src/components/date/YearMonthPicker.tsx
2219
- import { jsx as jsx12 } from "react/jsx-runtime";
2220
- var YearMonthPicker = ({
2221
- displayedYearMonth = /* @__PURE__ */ new Date(),
2222
- start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
2223
- end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
2224
- onChange,
2225
- className = "",
2226
- maxHeight = 300,
2227
- showValueOpen = true
2228
- }) => {
2229
- const { locale } = useLocale();
2230
- const ref = useRef7(null);
2231
- useEffect9(() => {
2232
- const scrollToItem = () => {
2233
- if (ref.current) {
2234
- ref.current.scrollIntoView({
2235
- behavior: "instant",
2236
- block: "center"
2237
- });
2238
- }
2239
- };
2240
- scrollToItem();
2241
- }, [ref]);
2242
- if (end < start) {
2243
- console.error(`startYear: (${start}) less than endYear: (${end})`);
2244
- return null;
2245
- }
2246
- const years = range([start.getFullYear(), end.getFullYear()], { exclusiveEnd: false });
2247
- return /* @__PURE__ */ jsx12("div", { className: clsx7("flex-col-0 select-none", className), children: /* @__PURE__ */ jsx12(Scrollbars2, { autoHeight: true, autoHeightMax: maxHeight, style: { height: "100%" }, children: /* @__PURE__ */ jsx12("div", { className: "flex-col-1 mr-3", children: years.map((year) => {
2248
- const selectedYear = displayedYearMonth.getFullYear() === year;
2249
- return /* @__PURE__ */ jsx12(
2250
- ExpandableUncontrolled,
2251
- {
2252
- ref: (displayedYearMonth.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear()) === year ? ref : void 0,
2253
- label: /* @__PURE__ */ jsx12("span", { className: clsx7({ "text-primary font-bold": selectedYear }), children: year }),
2254
- isExpanded: showValueOpen && selectedYear,
2255
- contentClassName: "gap-y-1",
2256
- children: equalSizeGroups([...monthsList], 3).map((monthList, index) => /* @__PURE__ */ jsx12("div", { className: "flex-row-1", children: monthList.map((month) => {
2257
- const monthIndex = monthsList.indexOf(month);
2258
- const newDate = new Date(year, monthIndex);
2259
- const selectedMonth = selectedYear && monthIndex === displayedYearMonth.getMonth();
2260
- const firstOfMonth = new Date(year, monthIndex, 1);
2261
- const lastOfMonth = new Date(year, monthIndex, 1);
2262
- const isAfterStart = start === void 0 || start <= addDuration(subtractDuration(lastOfMonth, { days: 1 }), { months: 1 });
2263
- const isBeforeEnd = end === void 0 || firstOfMonth <= end;
2264
- const isValid = isAfterStart && isBeforeEnd;
2265
- return /* @__PURE__ */ jsx12(
2266
- SolidButton,
2267
- {
2268
- disabled: !isValid,
2269
- color: selectedMonth && isValid ? "primary" : "neutral",
2270
- className: "flex-1",
2271
- size: "small",
2272
- onClick: () => {
2273
- onChange?.(newDate);
2274
- },
2275
- children: new Intl.DateTimeFormat(locale, { month: "short" }).format(newDate)
2276
- },
2277
- month
2278
- );
2279
- }) }, index))
2280
- },
2281
- year
2282
- );
2283
- }) }) }) });
2284
- };
2285
-
2286
- // src/components/date/DatePicker.tsx
2287
- import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
2288
- var DatePicker = ({
2289
- value = /* @__PURE__ */ new Date(),
2290
- start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
2291
- end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
2292
- initialDisplay = "day",
2293
- onChange,
2294
- yearMonthPickerProps,
2295
- dayPickerProps,
2296
- className = ""
2297
- }) => {
2298
- const { locale } = useLocale();
2299
- const translation = useHightideTranslation();
2300
- const [displayedMonth, setDisplayedMonth] = useState10(value);
2301
- const [displayMode, setDisplayMode] = useState10(initialDisplay);
2302
- useEffect10(() => {
2303
- setDisplayedMonth(value);
2304
- }, [value]);
2305
- return /* @__PURE__ */ jsxs8("div", { className: clsx8("flex-col-4", className), children: [
2306
- /* @__PURE__ */ jsxs8("div", { className: "flex-row-2 items-center justify-between h-7", children: [
2307
- /* @__PURE__ */ jsxs8(
2308
- TextButton,
2309
- {
2310
- className: clsx8("flex-row-1 items-center cursor-pointer select-none", {
2311
- "text-disabled": displayMode !== "day"
2312
- }),
2313
- onClick: () => setDisplayMode(displayMode === "day" ? "yearMonth" : "day"),
2314
- children: [
2315
- `${new Intl.DateTimeFormat(LocalizationUtil.localToLanguage(locale), { month: "long" }).format(displayedMonth)} ${displayedMonth.getFullYear()}`,
2316
- /* @__PURE__ */ jsx13(ChevronDown2, { size: 16 })
2317
- ]
2318
- }
2319
- ),
2320
- displayMode === "day" && /* @__PURE__ */ jsxs8("div", { className: "flex-row-2 justify-end", children: [
2321
- /* @__PURE__ */ jsx13(
2322
- SolidButton,
2323
- {
2324
- size: "small",
2325
- color: "primary",
2326
- disabled: !isInTimeSpan(subtractDuration(displayedMonth, { months: 1 }), start, end),
2327
- onClick: () => {
2328
- setDisplayedMonth(subtractDuration(displayedMonth, { months: 1 }));
2329
- },
2330
- children: /* @__PURE__ */ jsx13(ArrowUp, { size: 20 })
2331
- }
2332
- ),
2333
- /* @__PURE__ */ jsx13(
2334
- SolidButton,
2335
- {
2336
- size: "small",
2337
- color: "primary",
2338
- disabled: !isInTimeSpan(addDuration(displayedMonth, { months: 1 }), start, end),
2339
- onClick: () => {
2340
- setDisplayedMonth(addDuration(displayedMonth, { months: 1 }));
2341
- },
2342
- children: /* @__PURE__ */ jsx13(ArrowDown, { size: 20 })
2343
- }
2344
- )
2345
- ] })
2346
- ] }),
2347
- displayMode === "yearMonth" ? /* @__PURE__ */ jsx13(
2348
- YearMonthPicker,
2349
- {
2350
- ...yearMonthPickerProps,
2351
- displayedYearMonth: value,
2352
- start,
2353
- end,
2354
- onChange: (newDate) => {
2355
- setDisplayedMonth(newDate);
2356
- setDisplayMode("day");
2357
- }
2358
- }
2359
- ) : /* @__PURE__ */ jsxs8("div", { children: [
2360
- /* @__PURE__ */ jsx13(
2361
- DayPicker,
2362
- {
2363
- ...dayPickerProps,
2364
- displayedMonth,
2365
- start,
2366
- end,
2367
- selected: value,
2368
- onChange: (date) => {
2369
- onChange?.(date);
2370
- }
2371
- }
2372
- ),
2373
- /* @__PURE__ */ jsx13("div", { className: "mt-2", children: /* @__PURE__ */ jsx13(
2374
- TextButton,
2375
- {
2376
- color: "primary",
2377
- onClick: () => {
2378
- const newDate = /* @__PURE__ */ new Date();
2379
- newDate.setHours(value.getHours(), value.getMinutes());
2380
- onChange(newDate);
2381
- },
2382
- children: translation("time.today")
2383
- }
2384
- ) })
2385
- ] })
2386
- ] });
2387
- };
2388
-
2389
- // src/components/user-action/DateAndTimePicker.tsx
2390
- import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
2391
- var DateTimePicker = ({
2392
- value = /* @__PURE__ */ new Date(),
2393
- start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
2394
- end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
2395
- mode = "dateTime",
2396
- onFinish,
2397
- onChange,
2398
- onRemove,
2399
- timePickerProps,
2400
- datePickerProps
2401
- }) => {
2402
- const translation = useHightideTranslation();
2403
- const useDate = mode === "dateTime" || mode === "date";
2404
- const useTime = mode === "dateTime" || mode === "time";
2405
- let dateDisplay;
2406
- let timeDisplay;
2407
- if (useDate) {
2408
- dateDisplay = /* @__PURE__ */ jsx14(
2409
- DatePicker,
2410
- {
2411
- ...datePickerProps,
2412
- className: "min-w-[320px] min-h-[250px]",
2413
- yearMonthPickerProps: { maxHeight: 218 },
2414
- value,
2415
- start,
2416
- end,
2417
- onChange
2418
- }
2419
- );
2420
- }
2421
- if (useTime) {
2422
- timeDisplay = /* @__PURE__ */ jsx14(
2423
- TimePicker,
2424
- {
2425
- ...timePickerProps,
2426
- className: clsx9("h-full", { "justify-between w-full": mode === "time" }),
2427
- maxHeight: 250,
2428
- time: value,
2429
- onChange
2430
- }
2431
- );
2432
- }
2433
- return /* @__PURE__ */ jsxs9("div", { className: "flex-col-2 w-fit", children: [
2434
- /* @__PURE__ */ jsxs9("div", { className: "flex-row-4", children: [
2435
- dateDisplay,
2436
- timeDisplay
2437
- ] }),
2438
- /* @__PURE__ */ jsx14("div", { className: "flex-row-2 justify-end", children: /* @__PURE__ */ jsxs9("div", { className: "flex-row-2 mt-1", children: [
2439
- /* @__PURE__ */ jsx14(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
2440
- /* @__PURE__ */ jsx14(
2441
- SolidButton,
2442
- {
2443
- size: "medium",
2444
- onClick: () => onFinish?.(value),
2445
- children: translation("change")
2446
- }
2447
- )
2448
- ] }) })
2449
- ] });
2450
- };
2451
-
2452
- // src/components/user-action/Label.tsx
2453
- import clsx10 from "clsx";
2454
- import { jsx as jsx15 } from "react/jsx-runtime";
2455
- var styleMapping = {
2456
- md: "typography-label-md color-label-text",
2457
- lg: "typography-label-lg color-label-text"
2458
- };
2459
- var Label = ({
2460
- children,
2461
- size = "md",
2462
- className,
2463
- ...props
2464
- }) => {
2465
- return /* @__PURE__ */ jsx15("label", { ...props, className: clsx10(styleMapping[size], className), children });
2466
- };
2467
-
2468
- // src/components/user-action/Menu.tsx
2469
- import { useEffect as useEffect13, useRef as useRef8, useState as useState12 } from "react";
2470
- import clsx11 from "clsx";
2471
-
2472
- // src/utils/bagFunctions.ts
2473
- var resolve = (children, bag) => {
2474
- if (typeof children === "function") {
2475
- return children(bag);
2476
- }
2477
- return children ?? void 0;
2478
- };
2479
- var BagFunctionUtil = {
2480
- resolve
2481
- };
2482
-
2483
- // src/components/user-action/Menu.tsx
2484
- import { createPortal } from "react-dom";
2485
-
2486
- // src/hooks/usePopoverPosition.ts
2487
- var defaultPopoverPositionOptions = {
2488
- edgePadding: 16,
2489
- outerGap: 4,
2490
- horizontalAlignment: "leftInside",
2491
- verticalAlignment: "bottomOutside",
2492
- disabled: false
2493
- };
2494
- var usePopoverPosition = (trigger, options) => {
2495
- const {
2496
- edgePadding,
2497
- outerGap,
2498
- verticalAlignment,
2499
- horizontalAlignment,
2500
- disabled
2501
- } = { ...defaultPopoverPositionOptions, ...options };
2502
- if (disabled || !trigger) {
2503
- return {};
2504
- }
2505
- const left = {
2506
- leftOutside: trigger.left - outerGap,
2507
- leftInside: trigger.left,
2508
- rightOutside: trigger.right + outerGap,
2509
- rightInside: trigger.right,
2510
- center: trigger.left + trigger.width / 2
2511
- }[horizontalAlignment];
2512
- const top = {
2513
- topOutside: trigger.top - outerGap,
2514
- topInside: trigger.top,
2515
- bottomOutside: trigger.bottom + outerGap,
2516
- bottomInside: trigger.bottom,
2517
- center: trigger.top + trigger.height / 2
2518
- }[verticalAlignment];
2519
- const translateX = {
2520
- leftOutside: "-100%",
2521
- leftInside: void 0,
2522
- rightOutside: void 0,
2523
- rightInside: "-100%",
2524
- center: "-50%"
2525
- }[horizontalAlignment];
2526
- const translateY = {
2527
- topOutside: "-100%",
2528
- topInside: void 0,
2529
- bottomOutside: void 0,
2530
- bottomInside: "-100%",
2531
- center: "-50%"
2532
- }[verticalAlignment];
2533
- return {
2534
- left: Math.max(left, edgePadding),
2535
- top: Math.max(top, edgePadding),
2536
- translate: [translateX ?? "0", translateY ?? "0"].join(" ")
2537
- };
2538
- };
2539
-
2540
- // src/hooks/useHoverState.ts
2541
- import { useEffect as useEffect11, useState as useState11 } from "react";
2542
- var defaultUseHoverStateProps = {
2543
- closingDelay: 200,
2544
- isDisabled: false
2545
- };
2546
- var useHoverState = (props = void 0) => {
2547
- const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
2548
- const [isHovered, setIsHovered] = useState11(false);
2549
- const [timer, setTimer] = useState11();
2550
- const onMouseEnter = () => {
2551
- if (isDisabled) {
2552
- return;
2553
- }
2554
- clearTimeout(timer);
2555
- setIsHovered(true);
2556
- };
2557
- const onMouseLeave = () => {
2558
- if (isDisabled) {
2559
- return;
2560
- }
2561
- setTimer(setTimeout(() => {
2562
- setIsHovered(false);
2563
- }, closingDelay));
2564
- };
2565
- useEffect11(() => {
2566
- if (timer) {
2567
- return () => {
2568
- clearTimeout(timer);
2569
- };
2570
- }
2571
- });
2572
- useEffect11(() => {
2573
- if (timer) {
2574
- clearTimeout(timer);
2575
- }
2576
- }, [isDisabled]);
2577
- return {
2578
- isHovered,
2579
- setIsHovered,
2580
- handlers: { onMouseEnter, onMouseLeave }
2581
- };
2582
- };
2583
-
2584
- // src/hooks/useOutsideClick.ts
2585
- import { useEffect as useEffect12 } from "react";
2586
- var useOutsideClick = (refs, handler) => {
2587
- useEffect12(() => {
2588
- const listener = (event) => {
2589
- if (event.target === null) return;
2590
- if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
2591
- return;
2592
- }
2593
- handler();
2594
- };
2595
- document.addEventListener("mousedown", listener);
2596
- document.addEventListener("touchstart", listener);
2597
- return () => {
2598
- document.removeEventListener("mousedown", listener);
2599
- document.removeEventListener("touchstart", listener);
2600
- };
2601
- }, [refs, handler]);
2602
- };
2603
-
2604
- // src/components/user-action/Menu.tsx
2605
- import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
2606
- var MenuItem = ({
2607
- children,
2608
- onClick,
2609
- alignment = "left",
2610
- isDisabled = false,
2611
- className
2612
- }) => /* @__PURE__ */ jsx16(
2613
- "div",
2614
- {
2615
- className: clsx11("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
2616
- "text-right": alignment === "right",
2617
- "text-left": alignment === "left",
2618
- "text-disabled cursor-not-allowed": isDisabled,
2619
- "text-menu-text hover:bg-primary/20": !isDisabled,
2620
- "cursor-pointer": !!onClick
2621
- }, className),
2622
- onClick,
2623
- children
2624
- }
2625
- );
2626
- function getScrollableParents(element) {
2627
- const scrollables = [];
2628
- let parent = element.parentElement;
2629
- while (parent) {
2630
- scrollables.push(parent);
2631
- parent = parent.parentElement;
2632
- }
2633
- return scrollables;
2634
- }
2635
- var Menu = ({
2636
- trigger,
2637
- children,
2638
- alignmentHorizontal = "leftInside",
2639
- alignmentVertical = "bottomOutside",
2640
- showOnHover = false,
2641
- disabled = false,
2642
- menuClassName = ""
2643
- }) => {
2644
- const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
2645
- const triggerRef = useRef8(null);
2646
- const menuRef = useRef8(null);
2647
- useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
2648
- const [isHidden, setIsHidden] = useState12(true);
2649
- const bag = {
2650
- isOpen,
2651
- close: () => setIsOpen(false),
2652
- toggleOpen: () => setIsOpen((prevState) => !prevState),
2653
- disabled
2654
- };
2655
- const menuPosition = usePopoverPosition(
2656
- triggerRef.current?.getBoundingClientRect(),
2657
- { verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
2658
- );
2659
- useEffect13(() => {
2660
- if (!isOpen) return;
2661
- const triggerEl = triggerRef.current;
2662
- if (!triggerEl) return;
2663
- const scrollableParents = getScrollableParents(triggerEl);
2664
- const close = () => setIsOpen(false);
2665
- scrollableParents.forEach((parent) => {
2666
- parent.addEventListener("scroll", close);
2667
- });
2668
- window.addEventListener("resize", close);
2669
- return () => {
2670
- scrollableParents.forEach((parent) => {
2671
- parent.removeEventListener("scroll", close);
2672
- });
2673
- window.removeEventListener("resize", close);
2674
- };
2675
- }, [isOpen, setIsOpen]);
2676
- useEffect13(() => {
2677
- if (isOpen) {
2678
- setIsHidden(false);
2679
- }
2680
- }, [isOpen]);
2681
- return /* @__PURE__ */ jsxs10(Fragment4, { children: [
2682
- trigger(bag, triggerRef),
2683
- createPortal(/* @__PURE__ */ jsx16(
2684
- "div",
2685
- {
2686
- ref: menuRef,
2687
- onClick: (e) => e.stopPropagation(),
2688
- className: clsx11(
2689
- "absolute rounded-md bg-menu-background text-menu-text shadow-around-lg shadow-strong z-[300]",
2690
- {
2691
- "animate-pop-in": isOpen,
2692
- "animate-pop-out": !isOpen,
2693
- "hidden": isHidden
2694
- },
2695
- menuClassName
2696
- ),
2697
- onAnimationEnd: () => {
2698
- if (!isOpen) {
2699
- setIsHidden(true);
2700
- }
2701
- },
2702
- style: {
2703
- ...menuPosition
2704
- },
2705
- children: BagFunctionUtil.resolve(children, bag)
2706
- }
2707
- ), document.body)
2708
- ] });
2709
- };
2710
-
2711
- // src/components/user-action/ScrollPicker.tsx
2712
- import { useCallback as useCallback6, useEffect as useEffect14, useState as useState13 } from "react";
2713
- import clsx12 from "clsx";
2714
-
2715
- // src/utils/math.ts
2716
- var clamp = (value, range2 = [0, 1]) => {
2717
- const [min, max] = range2;
2718
- return Math.min(Math.max(value, min), max);
2719
- };
2720
-
2721
- // src/components/user-action/ScrollPicker.tsx
2722
- import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
2723
- var up = 1;
2724
- var down = -1;
2725
- var ScrollPicker = ({
2726
- options,
2727
- mapping,
2728
- selected,
2729
- onChange,
2730
- disabled = false
2731
- }) => {
2732
- let selectedIndex = 0;
2733
- if (selected && options.indexOf(selected) !== -1) {
2734
- selectedIndex = options.indexOf(selected);
2735
- }
2736
- const [{
2737
- currentIndex,
2738
- transition,
2739
- items,
2740
- lastTimeStamp
2741
- }, setAnimation] = useState13({
2742
- targetIndex: selectedIndex,
2743
- currentIndex: disabled ? selectedIndex : 0,
2744
- velocity: 0,
2745
- animationVelocity: Math.floor(options.length / 2),
2746
- transition: 0,
2747
- items: options
2748
- });
2749
- const itemsShownCount = 5;
2750
- const shownItems = getNeighbours(range(items.length), currentIndex).map((index) => ({
2751
- name: mapping(items[index]),
2752
- index
2753
- }));
2754
- const itemHeight = 40;
2755
- const distance = 8;
2756
- const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
2757
- const getDirection = useCallback6((targetIndex, currentIndex2, transition2, length) => {
2758
- if (targetIndex === currentIndex2) {
2759
- return transition2 > 0 ? up : down;
2760
- }
2761
- let distanceForward = targetIndex - currentIndex2;
2762
- if (distanceForward < 0) {
2763
- distanceForward += length;
2764
- }
2765
- return distanceForward >= length / 2 ? down : up;
2766
- }, []);
2767
- const animate = useCallback6((timestamp, startTime) => {
2768
- setAnimation((prevState) => {
2769
- const {
2770
- targetIndex,
2771
- currentIndex: currentIndex2,
2772
- transition: transition2,
2773
- animationVelocity,
2774
- velocity,
2775
- items: items2,
2776
- lastScrollTimeStamp
2777
- } = prevState;
2778
- if (disabled) {
2779
- return { ...prevState, currentIndex: targetIndex, velocity: 0, lastTimeStamp: timestamp };
2780
- }
2781
- if (targetIndex === currentIndex2 && velocity === 0 && transition2 === 0 || !startTime) {
2782
- return { ...prevState, lastTimeStamp: timestamp };
2783
- }
2784
- const progress = (timestamp - startTime) / 1e3;
2785
- const direction = getDirection(targetIndex, currentIndex2, transition2, items2.length);
2786
- let newVelocity = velocity;
2787
- let usedVelocity;
2788
- let newCurrentIndex = currentIndex2;
2789
- const isAutoScrolling = velocity <= 10 && (!lastScrollTimeStamp || timestamp - lastScrollTimeStamp > 50);
2790
- const newLastScrollTimeStamp = velocity !== 0 ? timestamp : lastScrollTimeStamp;
2791
- if (isAutoScrolling) {
2792
- usedVelocity = direction * animationVelocity;
2793
- } else {
2794
- usedVelocity = velocity;
2795
- newVelocity = velocity * 0.5;
2796
- if (Math.abs(newVelocity) <= 0.05) {
2797
- newVelocity = 0;
2798
- }
2799
- }
2800
- let newTransition = transition2 + usedVelocity * progress;
2801
- const changeThreshold = 0.5;
2802
- while (newTransition >= changeThreshold) {
2803
- if (newCurrentIndex === targetIndex && newTransition >= changeThreshold && isAutoScrolling) {
2804
- newTransition = 0;
2805
- break;
2806
- }
2807
- newCurrentIndex = (currentIndex2 + 1) % items2.length;
2808
- newTransition -= 1;
2809
- }
2810
- if (newTransition >= changeThreshold) {
2811
- newTransition = 0;
2812
- }
2813
- while (newTransition <= -changeThreshold) {
2814
- if (newCurrentIndex === targetIndex && newTransition <= -changeThreshold && isAutoScrolling) {
2815
- newTransition = 0;
2816
- break;
2817
- }
2818
- newCurrentIndex = currentIndex2 === 0 ? items2.length - 1 : currentIndex2 - 1;
2819
- newTransition += 1;
2820
- }
2821
- let newTargetIndex = targetIndex;
2822
- if (!isAutoScrolling) {
2823
- newTargetIndex = newCurrentIndex;
2824
- }
2825
- if ((currentIndex2 !== newTargetIndex || newTargetIndex !== targetIndex) && newTargetIndex === newCurrentIndex) {
2826
- onChange?.(items2[newCurrentIndex]);
2827
- }
2828
- return {
2829
- targetIndex: newTargetIndex,
2830
- currentIndex: newCurrentIndex,
2831
- animationVelocity,
2832
- transition: newTransition,
2833
- velocity: newVelocity,
2834
- items: items2,
2835
- lastTimeStamp: timestamp,
2836
- lastScrollTimeStamp: newLastScrollTimeStamp
2837
- };
2838
- });
2839
- }, [disabled, getDirection, onChange]);
2840
- useEffect14(() => {
2841
- requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
2842
- });
2843
- const opacity = (transition2, index, itemsCount) => {
2844
- const max = 100;
2845
- const min = 0;
2846
- const distance2 = max - min;
2847
- let opacityValue = min;
2848
- const unitTransition = clamp(transition2 / 0.5);
2849
- if (index === 1 || index === itemsCount - 2) {
2850
- if (index === 1 && transition2 > 0) {
2851
- opacityValue += Math.floor(unitTransition * distance2);
2852
- }
2853
- if (index === itemsCount - 2 && transition2 < 0) {
2854
- opacityValue += Math.floor(unitTransition * distance2);
2855
- }
2856
- } else {
2857
- opacityValue = max;
2858
- }
2859
- return clamp(1 - opacityValue / max);
2860
- };
2861
- return /* @__PURE__ */ jsx17(
2862
- "div",
2863
- {
2864
- className: "relative overflow-hidden",
2865
- style: { height: containerHeight },
2866
- onWheel: (event) => {
2867
- if (event.deltaY !== 0) {
2868
- const deltaY = clamp(event.deltaY, [-itemHeight * 2 / 3, itemHeight * 2 / 3]);
2869
- setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + deltaY }));
2870
- }
2871
- },
2872
- children: /* @__PURE__ */ jsxs11("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
2873
- /* @__PURE__ */ jsx17(
2874
- "div",
2875
- {
2876
- className: "absolute z-[1] top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-full min-w-[40px] border border-divider/50 border-y-2 border-x-0 ",
2877
- style: { height: `${itemHeight}px` }
2878
- }
2879
- ),
2880
- /* @__PURE__ */ jsx17(
2881
- "div",
2882
- {
2883
- className: "flex-col-2 select-none",
2884
- style: {
2885
- transform: `translateY(${-transition * (distance + itemHeight)}px)`,
2886
- columnGap: `${distance}px`
2887
- },
2888
- children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ jsx17(
2889
- "div",
2890
- {
2891
- className: clsx12(
2892
- `flex-col-2 items-center justify-center rounded-md`,
2893
- {
2894
- "text-primary font-bold": currentIndex === index,
2895
- "text-on-background": currentIndex === index,
2896
- "cursor-pointer": !disabled,
2897
- "cursor-not-allowed": disabled
2898
- }
2899
- ),
2900
- style: {
2901
- opacity: currentIndex !== index ? opacity(transition, arrayIndex, shownItems.length) : void 0,
2902
- height: `${itemHeight}px`,
2903
- maxHeight: `${itemHeight}px`
2904
- },
2905
- onClick: () => !disabled && setAnimation((prevState) => ({ ...prevState, targetIndex: index })),
2906
- children: name
2907
- },
2908
- index
2909
- ))
2910
- }
2911
- )
2912
- ] })
2913
- }
2914
- );
2915
- };
2916
-
2917
- // src/components/user-action/input/Input.tsx
2918
- import { forwardRef as forwardRef6, useImperativeHandle, useRef as useRef9 } from "react";
2919
- import clsx13 from "clsx";
2920
-
2921
- // src/hooks/useDelay.ts
2922
- import { useEffect as useEffect15, useState as useState14 } from "react";
2923
- var defaultOptions = {
2924
- delay: 3e3,
2925
- disabled: false
2926
- };
2927
- function useDelay(options) {
2928
- const [timer, setTimer] = useState14(void 0);
2929
- const { delay, disabled } = {
2930
- ...defaultOptions,
2931
- ...options
2932
- };
2933
- const clearTimer = () => {
2934
- clearTimeout(timer);
2935
- setTimer(void 0);
2936
- };
2937
- const restartTimer = (onDelayFinish) => {
2938
- if (disabled) {
2939
- return;
2940
- }
2941
- clearTimeout(timer);
2942
- setTimer(setTimeout(() => {
2943
- onDelayFinish();
2944
- setTimer(void 0);
2945
- }, delay));
2946
- };
2947
- useEffect15(() => {
2948
- return () => {
2949
- clearTimeout(timer);
2950
- };
2951
- }, [timer]);
2952
- useEffect15(() => {
2953
- if (disabled) {
2954
- clearTimeout(timer);
2955
- setTimer(void 0);
2956
- }
2957
- }, [disabled, timer]);
2958
- return { restartTimer, clearTimer, hasActiveTimer: !!timer };
2959
- }
2960
-
2961
- // src/hooks/focus/useFocusManagement.ts
2962
- import { useCallback as useCallback7 } from "react";
2963
- function useFocusManagement() {
2964
- const getFocusableElements = useCallback7(() => {
2965
- return Array.from(
2966
- document.querySelectorAll(
2967
- 'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
2968
- )
2969
- ).filter(
2970
- (el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
2971
- );
2972
- }, []);
2973
- const getNextFocusElement = useCallback7(() => {
2974
- const elements = getFocusableElements();
2975
- if (elements.length === 0) {
2976
- return void 0;
2977
- }
2978
- let nextElement = elements[0];
2979
- if (document.activeElement instanceof HTMLElement) {
2980
- const currentIndex = elements.indexOf(document.activeElement);
2981
- nextElement = elements[(currentIndex + 1) % elements.length];
2982
- }
2983
- return nextElement;
2984
- }, [getFocusableElements]);
2985
- const focusNext = useCallback7(() => {
2986
- const nextElement = getNextFocusElement();
2987
- nextElement?.focus();
2988
- }, [getNextFocusElement]);
2989
- const getPreviousFocusElement = useCallback7(() => {
2990
- const elements = getFocusableElements();
2991
- if (elements.length === 0) {
2992
- return void 0;
2993
- }
2994
- let previousElement = elements[0];
2995
- if (document.activeElement instanceof HTMLElement) {
2996
- const currentIndex = elements.indexOf(document.activeElement);
2997
- if (currentIndex === 0) {
2998
- previousElement = elements[elements.length - 1];
2999
- } else {
3000
- previousElement = elements[currentIndex - 1];
3001
- }
3002
- }
3003
- return previousElement;
3004
- }, [getFocusableElements]);
3005
- const focusPrevious = useCallback7(() => {
3006
- const previousElement = getPreviousFocusElement();
3007
- if (previousElement) previousElement.focus();
3008
- }, [getPreviousFocusElement]);
3009
- return {
3010
- getFocusableElements,
3011
- getNextFocusElement,
3012
- getPreviousFocusElement,
3013
- focusNext,
3014
- focusPrevious
3015
- };
3016
- }
3017
-
3018
- // src/components/user-action/input/Input.tsx
3019
- import { jsx as jsx18 } from "react/jsx-runtime";
3020
- var defaultEditCompleteOptions = {
3021
- allowEnterComplete: false,
3022
- onBlur: true,
3023
- afterDelay: true,
3024
- delay: 2500
3025
- };
3026
- var Input = forwardRef6(function Input2({
3027
- value,
3028
- onChange,
3029
- onChangeText,
3030
- onEditCompleted,
3031
- editCompleteOptions,
3032
- disabled = false,
3033
- invalid = false,
3034
- defaultStyle = true,
3035
- className,
3036
- ...props
3037
- }, forwardedRef) {
3038
- const {
3039
- onBlur: allowEditCompleteOnBlur,
3040
- afterDelay,
3041
- delay,
3042
- allowEnterComplete
3043
- } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
3044
- const {
3045
- restartTimer,
3046
- clearTimer
3047
- } = useDelay({ delay, disabled: !afterDelay });
3048
- const innerRef = useRef9(null);
3049
- useImperativeHandle(forwardedRef, () => innerRef.current);
3050
- const { focusNext } = useFocusManagement();
3051
- return /* @__PURE__ */ jsx18(
3052
- "input",
3053
- {
3054
- ...props,
3055
- ref: innerRef,
3056
- value,
3057
- disabled,
3058
- className: defaultStyle ? clsx13(
3059
- "px-3 py-2 rounded-md text-sm h-10 border-2 border-transparent focus-style-none",
3060
- {
3061
- "bg-input-background text-input-text hover:border-primary focus:border-primary": !disabled && !invalid,
3062
- "bg-negative/20 text-negative hover:border-negative focus-visible:border-negative": !disabled && invalid,
3063
- "bg-disabled-background text-disabled border-disabled-border": disabled
3064
- },
3065
- className
3066
- ) : className,
3067
- onKeyDown: (event) => {
3068
- props.onKeyDown?.(event);
3069
- if (!allowEnterComplete) {
3070
- return;
3071
- }
3072
- if (event.key === "Enter" && !event.shiftKey) {
3073
- event.preventDefault();
3074
- innerRef.current?.blur();
3075
- onEditCompleted?.(event.target.value);
3076
- focusNext();
3077
- }
3078
- },
3079
- onBlur: (event) => {
3080
- props.onBlur?.(event);
3081
- if (allowEditCompleteOnBlur) {
3082
- onEditCompleted?.(event.target.value);
3083
- clearTimer();
3084
- }
3085
- },
3086
- onChange: (event) => {
3087
- onChange?.(event);
3088
- const value2 = event.target.value;
3089
- restartTimer(() => {
3090
- innerRef.current?.blur();
3091
- onEditCompleted?.(value2);
3092
- });
3093
- onChangeText?.(value2);
3094
- },
3095
- "aria-invalid": props["aria-invalid"] ?? invalid,
3096
- "aria-disabled": props["aria-disabled"] ?? disabled
3097
- }
3098
- );
3099
- });
3100
- var InputUncontrolled = ({
3101
- value = "",
3102
- onChangeText,
3103
- ...props
3104
- }) => {
3105
- const [usedValue, setUsedValue] = useOverwritableState(value, onChangeText);
3106
- return /* @__PURE__ */ jsx18(
3107
- Input,
3108
- {
3109
- ...props,
3110
- value: usedValue,
3111
- onChangeText: setUsedValue
3112
- }
3113
- );
3114
- };
3115
-
3116
- // src/components/user-action/SearchBar.tsx
3117
- import { Search } from "lucide-react";
3118
- import { clsx as clsx14 } from "clsx";
3119
- import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
3120
- var SearchBar = ({
3121
- placeholder,
3122
- onSearch,
3123
- disableOnSearch,
3124
- containerClassName,
3125
- ...inputProps
3126
- }) => {
3127
- const translation = useHightideTranslation();
3128
- return /* @__PURE__ */ jsxs12("div", { className: clsx14("flex-row-2 justify-between items-center", containerClassName), children: [
3129
- /* @__PURE__ */ jsx19(
3130
- Input,
3131
- {
3132
- ...inputProps,
3133
- placeholder: placeholder ?? translation("search")
3134
- }
3135
- ),
3136
- onSearch && /* @__PURE__ */ jsx19(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ jsx19(Search, { className: "w-full h-full" }) })
3137
- ] });
3138
- };
3139
-
3140
- // src/components/user-action/Textarea.tsx
3141
- import { forwardRef as forwardRef7, useId as useId2 } from "react";
3142
- import clsx15 from "clsx";
3143
- import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
3144
- var Textarea = forwardRef7(function Textarea2({
3145
- id,
3146
- onChange,
3147
- onChangeText,
3148
- onBlur,
3149
- onEditCompleted,
3150
- saveDelayOptions,
3151
- defaultStyle = true,
3152
- invalid = false,
3153
- disabled = false,
3154
- className,
3155
- ...props
3156
- }, ref) {
3157
- const { restartTimer, clearTimer } = useDelay(saveDelayOptions);
3158
- const onEditCompletedWrapper = (text) => {
3159
- onEditCompleted?.(text);
3160
- clearTimer();
3161
- };
3162
- return /* @__PURE__ */ jsx20(
3163
- "textarea",
3164
- {
3165
- ref,
3166
- id,
3167
- className: clsx15(
3168
- "resize-none w-full h-32 overflow-y-scroll",
3169
- "py-2 px-3 rounded-md border-2 border-transparent focus-style-none",
3170
- {
3171
- "bg-input-background text-input-text hover:border-primary focus:border-primary": !disabled && !invalid,
3172
- "bg-negative/20 text-negative hover:border-negative focus-visible:border-negative": invalid && !disabled && defaultStyle,
3173
- "text-disabled bg-disabled-background border-disabled-border": disabled && defaultStyle
3174
- },
3175
- className
3176
- ),
3177
- onChange: (event) => {
3178
- const value = event.target.value;
3179
- restartTimer(() => {
3180
- onEditCompletedWrapper(value);
3181
- });
3182
- onChange?.(event);
3183
- onChangeText?.(value);
3184
- },
3185
- onBlur: (event) => {
3186
- onBlur?.(event);
3187
- onEditCompletedWrapper(event.target.value);
3188
- },
3189
- disabled,
3190
- ...props
3191
- }
3192
- );
3193
- });
3194
- var TextareaUncontrolled = ({
3195
- value,
3196
- onChangeText,
3197
- ...props
3198
- }) => {
3199
- const [text, setText] = useOverwritableState(value, onChangeText);
3200
- return /* @__PURE__ */ jsx20(
3201
- Textarea,
3202
- {
3203
- ...props,
3204
- value: text,
3205
- onChangeText: setText
3206
- }
3207
- );
3208
- };
3209
- var TextareaWithHeadline = ({
3210
- id,
3211
- headline,
3212
- headlineProps,
3213
- disabled,
3214
- className,
3215
- containerClassName,
3216
- ...props
3217
- }) => {
3218
- const genId = useId2();
3219
- const usedId = id ?? genId;
3220
- return /* @__PURE__ */ jsxs13(
3221
- "div",
3222
- {
3223
- className: clsx15(
3224
- "group flex-col-3 border-2 rounded-lg",
3225
- {
3226
- "bg-input-background text-input-text hover:border-primary focus-within:border-primary": !disabled,
3227
- "border-disabled-border bg-disabled-background cursor-not-allowed": disabled
3228
- },
3229
- containerClassName
3230
- ),
3231
- children: [
3232
- headline && /* @__PURE__ */ jsx20(Label, { size: "md", ...headlineProps, htmlFor: usedId, children: headline }),
3233
- /* @__PURE__ */ jsx20(
3234
- Textarea,
3235
- {
3236
- ...props,
3237
- id: usedId,
3238
- className: clsx15(
3239
- "border-transparent focus:ring-0 focus-visible:ring-0 resize-none h-32",
3240
- className
3241
- ),
3242
- defaultStyle: false
3243
- }
3244
- )
3245
- ]
3246
- }
3247
- );
3248
- };
3249
-
3250
- // src/components/user-action/Tooltip.tsx
3251
- import { clsx as clsx16 } from "clsx";
3252
- import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
3253
- var Tooltip = ({
3254
- tooltip,
3255
- children,
3256
- animationDelay = 650,
3257
- tooltipClassName = "",
3258
- containerClassName = "",
3259
- position = "bottom",
3260
- zIndex = 10
3261
- }) => {
3262
- const { isHovered, handlers } = useHoverState();
3263
- const positionClasses = {
3264
- top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
3265
- bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
3266
- left: `right-full top-1/2 -translate-y-1/2 mr-[6px]`,
3267
- right: `left-full top-1/2 -translate-y-1/2 ml-[6px]`
3268
- };
3269
- const triangleSize = 6;
3270
- const triangleClasses = {
3271
- top: `top-full left-1/2 -translate-x-1/2 border-t-tooltip-background border-l-transparent border-r-transparent`,
3272
- bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-tooltip-background border-l-transparent border-r-transparent`,
3273
- left: `left-full top-1/2 -translate-y-1/2 border-l-tooltip-background border-t-transparent border-b-transparent`,
3274
- right: `right-full top-1/2 -translate-y-1/2 border-r-tooltip-background border-t-transparent border-b-transparent`
3275
- };
3276
- const triangleStyle = {
3277
- top: { borderWidth: `${triangleSize}px ${triangleSize}px 0 ${triangleSize}px` },
3278
- bottom: { borderWidth: `0 ${triangleSize}px ${triangleSize}px ${triangleSize}px` },
3279
- left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
3280
- right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
3281
- };
3282
- return /* @__PURE__ */ jsxs14(
3283
- "div",
3284
- {
3285
- className: clsx16("relative inline-block", containerClassName),
3286
- ...handlers,
3287
- children: [
3288
- children,
3289
- isHovered && /* @__PURE__ */ jsxs14(
3290
- "div",
3291
- {
3292
- className: clsx16(
3293
- `opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
3294
- animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,
3295
- positionClasses[position],
3296
- tooltipClassName
3297
- ),
3298
- style: { zIndex, animationDelay: animationDelay + "ms" },
3299
- children: [
3300
- tooltip,
3301
- /* @__PURE__ */ jsx21(
3302
- "div",
3303
- {
3304
- className: clsx16(`absolute w-0 h-0`, triangleClasses[position]),
3305
- style: { ...triangleStyle[position], zIndex: zIndex + 1 }
3306
- }
3307
- )
3308
- ]
3309
- }
3310
- )
3311
- ]
3312
- }
3313
- );
3314
- };
3315
-
3316
- // src/components/user-action/input/InsideLabelInput.tsx
3317
- import { useId as useId3 } from "react";
3318
- import { forwardRef as forwardRef8, useState as useState15 } from "react";
3319
- import clsx17 from "clsx";
3320
- import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
3321
- var InsideLabelInput = forwardRef8(function InsideLabelInput2({
3322
- id: customId,
3323
- label,
3324
- ...props
3325
- }, forwardedRef) {
3326
- const { value } = props;
3327
- const [isFocused, setIsFocused] = useState15(false);
3328
- const generatedId = useId3();
3329
- const id = customId ?? generatedId;
3330
- return /* @__PURE__ */ jsxs15("div", { className: clsx17("relative"), children: [
3331
- /* @__PURE__ */ jsx22(
3332
- Input,
3333
- {
3334
- ...props,
3335
- id,
3336
- className: clsx17("h-14 px-4 pb-2 py-6.5", props.className),
3337
- ref: forwardedRef,
3338
- "aria-labelledby": id + "-label",
3339
- onFocus: (event) => {
3340
- props.onFocus?.(event);
3341
- setIsFocused(true);
3342
- },
3343
- onBlur: (event) => {
3344
- props.onBlur?.(event);
3345
- setIsFocused(false);
3346
- }
3347
- }
3348
- ),
3349
- /* @__PURE__ */ jsx22(
3350
- "label",
3351
- {
3352
- id: id + "-label",
3353
- "aria-hidden": true,
3354
- "data-display": isFocused || !!value ? "small" : "full",
3355
- className: clsx17(
3356
- // margin left to account for the border which is ignored for absolute positions
3357
- "absolute left-4 ml-0.5 top-2 transition-all delay-25 pointer-events-none touch-none",
3358
- "data-[display=small]:top-2 data-[display=small]:h-force-4.5 data-[display=small]:typography-caption-sm data-[display=small]:overflow-y-hidden",
3359
- "data-[display=full]:top-1/2 data-[display=full]:-translate-y-1/2 data-[display=full]:typography-body-md"
3360
- ),
3361
- children: label
3362
- }
3363
- )
3364
- ] });
3365
- });
3366
- var InsideLabelInputUncontrolled = ({
3367
- value: initialValue,
3368
- ...props
3369
- }) => {
3370
- const [value, setValue] = useOverwritableState(initialValue, props.onChangeText);
3371
- return /* @__PURE__ */ jsx22(
3372
- InsideLabelInput,
3373
- {
3374
- ...props,
3375
- value,
3376
- onChangeText: setValue
3377
- }
3378
- );
3379
- };
3380
-
3381
- // src/components/user-action/input/ToggleableInput.tsx
3382
- import { forwardRef as forwardRef9, useEffect as useEffect16, useImperativeHandle as useImperativeHandle2, useRef as useRef10, useState as useState16 } from "react";
3383
- import { Pencil } from "lucide-react";
3384
- import clsx18 from "clsx";
3385
- import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
3386
- var ToggleableInput = forwardRef9(function ToggleableInput2({
3387
- value,
3388
- initialState = "display",
3389
- editCompleteOptions,
3390
- ...props
3391
- }, forwardedRef) {
3392
- const [isEditing, setIsEditing] = useState16(initialState !== "display");
3393
- const innerRef = useRef10(null);
3394
- useImperativeHandle2(forwardedRef, () => innerRef.current);
3395
- useEffect16(() => {
3396
- if (isEditing) {
3397
- innerRef.current?.focus();
3398
- }
3399
- }, [isEditing]);
3400
- return /* @__PURE__ */ jsxs16("div", { className: clsx18("relative flex-row-2", { "flex-1": isEditing }), children: [
3401
- /* @__PURE__ */ jsx23(
3402
- Input,
3403
- {
3404
- ...props,
3405
- ref: innerRef,
3406
- value,
3407
- onEditCompleted: (text) => {
3408
- props.onEditCompleted?.(text);
3409
- setIsEditing(false);
3410
- },
3411
- onFocus: (event) => {
3412
- props.onFocus?.(event);
3413
- setIsEditing(true);
3414
- event.target.select();
3415
- },
3416
- editCompleteOptions: {
3417
- ...editCompleteOptions,
3418
- allowEnterComplete: true
3419
- },
3420
- className: clsx18(`w-full ring-0 outline-0 decoration-primary underline-offset-4`, {
3421
- "underline": isEditing,
3422
- "text-transparent": !isEditing
3423
- }),
3424
- defaultStyle: false
3425
- }
3426
- ),
3427
- !isEditing && /* @__PURE__ */ jsxs16("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
3428
- /* @__PURE__ */ jsx23("span", { className: clsx18(" truncate"), children: value }),
3429
- /* @__PURE__ */ jsx23(Pencil, { className: clsx18(`size-force-4`, { "text-transparent": isEditing }) })
3430
- ] })
3431
- ] });
3432
- });
3433
- var ToggleableInputUncontrolled = ({
3434
- value: initialValue,
3435
- onChangeText,
3436
- ...restProps
3437
- }) => {
3438
- const [value, setValue] = useOverwritableState(initialValue, onChangeText);
3439
- return /* @__PURE__ */ jsx23(
3440
- ToggleableInput,
3441
- {
3442
- value,
3443
- onChangeText: setValue,
3444
- ...restProps
3445
- }
3446
- );
3447
- };
3448
-
3449
- // src/components/user-action/select/Select.tsx
3450
- import {
3451
- createContext as createContext3,
3452
- forwardRef as forwardRef10,
3453
- useCallback as useCallback10,
3454
- useContext as useContext3,
3455
- useEffect as useEffect20,
3456
- useId as useId5,
3457
- useImperativeHandle as useImperativeHandle3,
3458
- useMemo as useMemo5,
3459
- useRef as useRef12,
3460
- useState as useState20
3461
- } from "react";
3462
- import clsx20 from "clsx";
3463
-
3464
- // src/hooks/focus/useFocusTrap.ts
3465
- import { useCallback as useCallback8, useEffect as useEffect18, useId as useId4, useRef as useRef11, useState as useState18 } from "react";
3466
-
3467
- // src/hooks/focus/useIsMounted.ts
3468
- import { useEffect as useEffect17, useLayoutEffect as useLayoutEffect3, useState as useState17 } from "react";
3469
- var isClient = typeof window !== "undefined" && typeof document !== "undefined";
3470
- var useIsomorphicEffect = isClient ? useLayoutEffect3 : useEffect17;
3471
- var useIsMounted = () => {
3472
- const [isMounted, setIsMounted] = useState17(false);
3473
- useIsomorphicEffect(() => {
3474
- setIsMounted(true);
3475
- return () => {
3476
- setIsMounted(false);
3477
- };
3478
- }, []);
3479
- return isMounted;
3480
- };
3481
-
3482
- // src/hooks/focus/useFocusTrap.ts
3483
- var createFocusGuard = () => {
3484
- const div = document.createElement("div");
3485
- Object.assign(div.style, {
3486
- opacity: "0",
3487
- outline: "none",
3488
- boxShadow: "none",
3489
- position: "fixed",
3490
- pointerEvents: "none",
3491
- touchAction: "none"
3492
- });
3493
- div.tabIndex = 0;
3494
- div.setAttribute("data-hw-focus-guard", "");
3495
- document.body.appendChild(div);
3496
- return div;
3497
- };
3498
- function getContainedFocusableElements(element) {
3499
- return element?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
3500
- }
3501
- var FocusTrapService = class {
3502
- constructor() {
3503
- // The last entry is always the active one
3504
- this.listeners = [];
3505
- this.onFocusIn = (event) => {
3506
- const active = this.getActive();
3507
- if (!active || !active.container.current) return;
3508
- const { container } = active;
3509
- if (!container.current.contains(event.target)) {
3510
- this.focusElement();
3511
- }
3512
- };
3513
- }
3514
- getActive() {
3515
- if (this.listeners.length === 0) return void 0;
3516
- return this.listeners[this.listeners.length - 1];
3517
- }
3518
- focusElement() {
3519
- const active = this.getActive();
3520
- if (!active) return;
3521
- const { container, initialFocusElement } = active;
3522
- const containerElement = container.current;
3523
- if (initialFocusElement?.current) {
3524
- initialFocusElement.current.focus();
3525
- } else {
3526
- const elements = getContainedFocusableElements(containerElement);
3527
- if (elements && elements.length > 0) {
3528
- const first = elements.item(0);
3529
- first.focus();
3530
- } else {
3531
- containerElement.focus();
3532
- }
3533
- }
3534
- }
3535
- removeGuards() {
3536
- document.querySelectorAll("[data-hw-focus-guard]").forEach((node) => node.remove());
3537
- }
3538
- addGuards() {
3539
- document.body.insertAdjacentElement("afterbegin", createFocusGuard());
3540
- document.body.insertAdjacentElement("beforeend", createFocusGuard());
3541
- }
3542
- activate() {
3543
- document.addEventListener("focusin", this.onFocusIn);
3544
- this.addGuards();
3545
- }
3546
- deactivate() {
3547
- document.removeEventListener("focusin", this.onFocusIn);
3548
- this.removeGuards();
3549
- }
3550
- register(listener) {
3551
- this.listeners.push(listener);
3552
- if (this.listeners.length === 1) {
3553
- this.activate();
3554
- }
3555
- const active = listener;
3556
- this.listeners.forEach((listener2) => {
3557
- const { focus, pause } = listener2;
3558
- if (listener2 === active) {
3559
- focus();
3560
- } else {
3561
- pause();
3562
- }
3563
- });
3564
- }
3565
- unregister(id) {
3566
- const index = this.listeners.findIndex((trap) => trap.id === id);
3567
- if (index !== -1) {
3568
- const isActive = index === this.listeners.length - 1;
3569
- const listener = this.listeners[index];
3570
- this.listeners = this.listeners.filter((listener2) => listener2.id !== id);
3571
- if (isActive) {
3572
- this.deactivate();
3573
- listener.focusLast();
3574
- const active = this.getActive();
3575
- this.listeners.forEach((listener2) => {
3576
- const { pause, unpause } = listener2;
3577
- if (listener2 === active) {
3578
- unpause();
3579
- } else {
3580
- pause();
3581
- }
3582
- });
3583
- if (this.listeners.length > 0) {
3584
- this.activate();
3585
- }
3586
- }
3587
- } else {
3588
- console.warn(`Unable to unregister id ${id}: not found`);
3589
- }
3590
- }
3591
- };
3592
- var service = new FocusTrapService();
3593
- var useFocusTrap = ({
3594
- container,
3595
- active = true,
3596
- initialFocus,
3597
- focusFirst = true
3598
- }) => {
3599
- const lastFocusRef = useRef11(null);
3600
- const [paused, setPaused] = useState18(false);
3601
- const isMounted = useIsMounted();
3602
- const id = useId4();
3603
- const focusElement = useCallback8(() => {
3604
- const containerElement = container.current;
3605
- if (initialFocus?.current) {
3606
- initialFocus.current.focus();
3607
- } else {
3608
- const elements = getContainedFocusableElements(containerElement);
3609
- if (elements && elements.length > 0) {
3610
- const first = elements.item(0);
3611
- first.focus();
3612
- } else {
3613
- containerElement.focus();
3614
- }
3615
- }
3616
- }, [container, initialFocus]);
3617
- useEffect18(() => {
3618
- if (active && isMounted) {
3619
- let pause = function() {
3620
- setPaused(true);
3621
- }, unpause = function() {
3622
- setPaused(false);
3623
- if (!container.current.contains(document.activeElement)) {
3624
- focusElement();
3625
- }
3626
- }, focus = function() {
3627
- focusElement();
3628
- setPaused(false);
3629
- }, focusLast = function() {
3630
- lastFocusRef.current?.focus();
3631
- };
3632
- if (!lastFocusRef.current) {
3633
- lastFocusRef.current = document.activeElement;
3634
- }
3635
- service.register({ id, pause, focus, focusLast, unpause, container, initialFocusElement: initialFocus });
3636
- return () => {
3637
- service.unregister(id);
3638
- lastFocusRef.current = void 0;
3639
- };
3640
- }
3641
- }, [active, container, focusElement, id, initialFocus, isMounted]);
3642
- useEffect18(() => {
3643
- if (active && !paused && isMounted) {
3644
- let onKeyDown = function(event) {
3645
- const key = event.key;
3646
- const elements = getContainedFocusableElements(containerElement);
3647
- const active2 = document.activeElement;
3648
- const index = [...elements].findIndex((value) => value === active2);
3649
- if (index === -1 || event.altKey || event.ctrlKey || event.metaKey) {
3650
- return;
3651
- }
3652
- if (key === "Tab") {
3653
- const next = event.shiftKey ? -1 : 1;
3654
- const nextIndex = (index + next + elements.length) % elements.length;
3655
- const nextElement = elements[nextIndex];
3656
- nextElement.focus();
3657
- event.preventDefault();
3658
- }
3659
- };
3660
- const containerElement = container.current;
3661
- containerElement.addEventListener("keydown", onKeyDown);
3662
- return () => {
3663
- containerElement.removeEventListener("keydown", onKeyDown);
3664
- };
3665
- }
3666
- }, [active, paused, isMounted, container, initialFocus, focusFirst, focusElement]);
3667
- };
3668
-
3669
- // src/utils/match.ts
3670
- var match = (key, values) => {
3671
- return values[key];
3672
- };
3673
-
3674
- // src/components/user-action/select/Select.tsx
3675
- import { CheckIcon as CheckIcon2, Plus, XIcon } from "lucide-react";
3676
-
3677
- // src/components/layout/Chip.tsx
3678
- import clsx19 from "clsx";
3679
- import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
3680
- var Chip = ({
3681
- children,
3682
- trailingIcon,
3683
- color = "default",
3684
- size = "md",
3685
- icon = false,
3686
- variant = "normal",
3687
- className = "",
3688
- ...restProps
3689
- }) => {
3690
- const colorMapping = {
3691
- default: "text-tag-default-text bg-tag-default-background",
3692
- dark: "text-tag-dark-text bg-tag-dark-background",
3693
- red: "text-tag-red-text bg-tag-red-background",
3694
- yellow: "text-tag-yellow-text bg-tag-yellow-background",
3695
- green: "text-tag-green-text bg-tag-green-background",
3696
- blue: "text-tag-blue-text bg-tag-blue-background",
3697
- pink: "text-tag-pink-text bg-tag-pink-background",
3698
- orange: "text-tag-orange-text bg-tag-orange-background"
3699
- }[color];
3700
- const colorMappingIcon = {
3701
- default: "text-tag-default-icon",
3702
- dark: "text-tag-dark-icon",
3703
- red: "text-tag-red-icon",
3704
- yellow: "text-tag-yellow-icon",
3705
- green: "text-tag-green-icon",
3706
- blue: "text-tag-blue-icon",
3707
- pink: "text-tag-pink-icon",
3708
- orange: "text-tag-orange-icon"
3709
- }[color];
3710
- return /* @__PURE__ */ jsxs17(
3711
- "div",
3712
- {
3713
- ...restProps,
3714
- className: clsx19(
3715
- `flex-row-0 w-fit font-semibold`,
3716
- colorMapping,
3717
- !icon ? {
3718
- "px-1 py-0.5": size === "sm",
3719
- "px-2 py-1": size === "md",
3720
- "px-4 py-2": size === "lg"
3721
- } : {
3722
- "p-0.5": size === "sm",
3723
- "p-1": size === "md",
3724
- "p-2": size === "lg"
3725
- },
3726
- {
3727
- "rounded-md": variant === "normal",
3728
- "rounded-full": variant === "fullyRounded"
3729
- },
3730
- className
3731
- ),
3732
- children: [
3733
- children,
3734
- trailingIcon && /* @__PURE__ */ jsx24("span", { className: colorMappingIcon, children: trailingIcon })
3735
- ]
3736
- }
3737
- );
3738
- };
3739
-
3740
- // src/hooks/useFloatingElement.ts
3741
- import { useCallback as useCallback9, useEffect as useEffect19, useState as useState19 } from "react";
3742
- function calculatePosition({
3743
- windowRect,
3744
- containerRect,
3745
- anchorRect,
3746
- options
3747
- }) {
3748
- const { verticalAlignment, horizontalAlignment, gap, screenPadding } = options;
3749
- const windowWidth = windowRect.width;
3750
- const windowHeight = windowRect.height;
3751
- const maxWidth = windowWidth - 2 * screenPadding;
3752
- const maxHeight = windowHeight - 2 * screenPadding;
3753
- const width = Math.min(containerRect.width, maxWidth);
3754
- const height = Math.min(containerRect.height, maxHeight);
3755
- const leftSuggestion = {
3756
- beforeStart: anchorRect.left - width - gap,
3757
- afterStart: anchorRect.left,
3758
- center: anchorRect.left + anchorRect.width / 2 - width / 2,
3759
- beforeEnd: anchorRect.right - width,
3760
- afterEnd: anchorRect.right + gap
3761
- }[horizontalAlignment];
3762
- const topSuggestion = {
3763
- beforeStart: anchorRect.top - height - gap,
3764
- afterStart: anchorRect.top,
3765
- center: anchorRect.top + anchorRect.height / 2 - height / 2,
3766
- beforeEnd: anchorRect.bottom - height,
3767
- afterEnd: anchorRect.bottom + gap
3768
- }[verticalAlignment];
3769
- const left = clamp(leftSuggestion, [
3770
- screenPadding,
3771
- windowWidth - screenPadding - width
3772
- ]);
3773
- const top = clamp(topSuggestion, [
3774
- screenPadding,
3775
- windowHeight - screenPadding - height
3776
- ]);
3777
- return {
3778
- left,
3779
- top,
3780
- maxWidth,
3781
- maxHeight
3782
- };
3783
- }
3784
- function useFloatingElement({
3785
- active = true,
3786
- windowRef,
3787
- anchorRef,
3788
- containerRef,
3789
- isPolling = false,
3790
- pollingInterval = 100,
3791
- verticalAlignment = "afterEnd",
3792
- horizontalAlignment = "afterStart",
3793
- screenPadding = 16,
3794
- gap = 4
3795
- }) {
3796
- const [style, setStyle] = useState19();
3797
- const isMounted = useIsMounted();
3798
- const calculate = useCallback9(() => {
3799
- const containerRect = containerRef.current.getBoundingClientRect();
3800
- const windowRect = windowRef?.current.getBoundingClientRect() ?? {
3801
- top: 0,
3802
- bottom: window.innerHeight,
3803
- left: 0,
3804
- right: window.innerWidth,
3805
- width: window.innerWidth,
3806
- height: window.innerHeight
3807
- };
3808
- const anchorElement = anchorRef?.current;
3809
- if (anchorRef && !anchorElement) {
3810
- console.warn("FloatingContainer anchor provided, but its value is undefined");
3811
- }
3812
- const anchorRect = anchorElement?.getBoundingClientRect() ?? windowRect;
3813
- const calculateProps = {
3814
- windowRect,
3815
- anchorRect,
3816
- containerRect,
3817
- options: {
3818
- horizontalAlignment,
3819
- verticalAlignment,
3820
- screenPadding,
3821
- gap
3822
- }
3823
- };
3824
- setStyle(calculatePosition(calculateProps));
3825
- }, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef]);
3826
- const height = containerRef.current?.getBoundingClientRect().height;
3827
- const width = containerRef.current?.getBoundingClientRect().width;
3828
- useEffect19(() => {
3829
- if (active && isMounted) {
3830
- calculate();
3831
- } else {
3832
- setStyle(void 0);
3833
- }
3834
- }, [calculate, active, isMounted, height, width]);
3835
- useEffect19(() => {
3836
- window.addEventListener("resize", calculate);
3837
- let timeout;
3838
- if (isPolling) {
3839
- timeout = setInterval(calculate, pollingInterval);
3840
- }
3841
- return () => {
3842
- window.removeEventListener("resize", calculate);
3843
- if (timeout) {
3844
- clearInterval(timeout);
3845
- }
3846
- };
3847
- }, [calculate, isPolling, pollingInterval]);
3848
- return style;
3849
- }
3850
-
3851
- // src/components/user-action/select/Select.tsx
3852
- import { createPortal as createPortal2 } from "react-dom";
3853
- import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
3854
- var defaultToggleOpenOptions = {
3855
- highlightStartPositionBehavior: "first"
3856
- };
3857
- var SelectContext = createContext3(null);
3858
- function useSelectContext() {
3859
- const ctx = useContext3(SelectContext);
3860
- if (!ctx) {
3861
- throw new Error("SelectContext must be used within a ListBoxPrimitive");
3862
- }
3863
- return ctx;
3864
- }
3865
- var SelectRoot = ({
3866
- children,
3867
- id,
3868
- value,
3869
- onValueChanged,
3870
- values,
3871
- onValuesChanged,
3872
- isOpen = false,
3873
- disabled = false,
3874
- invalid = false,
3875
- isMultiSelect = false,
3876
- iconAppearance = "left"
3877
- }) => {
3878
- const triggerRef = useRef12(null);
3879
- const generatedId = useId5();
3880
- const usedId = id ?? generatedId;
3881
- const [internalState, setInternalState] = useState20({
3882
- isOpen,
3883
- options: []
3884
- });
3885
- const selectedValues = useMemo5(
3886
- () => isMultiSelect ? values ?? [] : [value].filter(Boolean),
3887
- [isMultiSelect, value, values]
3888
- );
3889
- const selectedOptions = useMemo5(
3890
- () => selectedValues.map((value2) => internalState.options.find((option) => value2 === option.value)).filter(Boolean),
3891
- [selectedValues, internalState.options]
3892
- );
3893
- const state = {
3894
- ...internalState,
3895
- id: usedId,
3896
- disabled,
3897
- invalid,
3898
- value: selectedValues,
3899
- selectedOptions
3900
- };
3901
- const config = {
3902
- isMultiSelect,
3903
- iconAppearance
3904
- };
3905
- const registerItem = useCallback10((item) => {
3906
- setInternalState((prev) => {
3907
- const updatedOptions = [...prev.options, item];
3908
- updatedOptions.sort((a, b) => {
3909
- const aEl = a.ref.current;
3910
- const bEl = b.ref.current;
3911
- if (!aEl || !bEl) return 0;
3912
- return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
3913
- });
3914
- return {
3915
- ...prev,
3916
- options: updatedOptions
3917
- };
3918
- });
3919
- }, []);
3920
- const unregisterItem = useCallback10((value2) => {
3921
- setInternalState((prev) => {
3922
- const updatedOptions = prev.options.filter((i) => i.value !== value2);
3923
- return {
3924
- ...prev,
3925
- options: updatedOptions
3926
- };
3927
- });
3928
- }, []);
3929
- const toggleSelection = (value2, isSelected) => {
3930
- if (disabled) {
3931
- return;
3932
- }
3933
- const option = state.options.find((i) => i.value === value2);
3934
- if (!option) {
3935
- console.error(`SelectOption with value: ${value2} not found`);
3936
- return;
3937
- }
3938
- let newValue;
3939
- if (isMultiSelect) {
3940
- const isSelectedBefore = state.value.includes(value2);
3941
- const isSelectedAfter = isSelected ?? !isSelectedBefore;
3942
- if (!isSelectedAfter) {
3943
- newValue = state.value.filter((v) => v !== value2);
3944
- } else {
3945
- newValue = [...state.value, value2];
3946
- }
3947
- } else {
3948
- newValue = [value2];
3949
- }
3950
- if (!isMultiSelect) {
3951
- onValueChanged?.(newValue[0]);
3952
- } else {
3953
- onValuesChanged?.(newValue);
3954
- }
3955
- setInternalState((prevState) => ({
3956
- ...prevState,
3957
- highlightedValue: value2
3958
- }));
3959
- };
3960
- const highlightItem = (value2) => {
3961
- if (disabled) {
3962
- return;
3963
- }
3964
- setInternalState((prevState) => ({
3965
- ...prevState,
3966
- highlightedValue: value2
3967
- }));
3968
- };
3969
- const registerTrigger = useCallback10((ref) => {
3970
- triggerRef.current = ref.current;
3971
- }, []);
3972
- const unregisterTrigger = useCallback10(() => {
3973
- triggerRef.current = null;
3974
- }, []);
3975
- const toggleOpen = (isOpen2, toggleOpenOptions) => {
3976
- const { highlightStartPositionBehavior } = { ...defaultToggleOpenOptions, ...toggleOpenOptions };
3977
- let firstSelectedValue;
3978
- let firstEnabledValue;
3979
- for (let i = 0; i < state.options.length; i++) {
3980
- const currentOption = state.options[highlightStartPositionBehavior === "first" ? i : state.options.length - i - 1];
3981
- if (!currentOption.disabled) {
3982
- if (!firstEnabledValue) {
3983
- firstEnabledValue = currentOption.value;
3984
- }
3985
- if (selectedValues.includes(currentOption.value)) {
3986
- firstSelectedValue = currentOption.value;
3987
- break;
3988
- }
3989
- }
3990
- }
3991
- setInternalState((prevState) => ({
3992
- ...prevState,
3993
- isOpen: isOpen2 ?? !prevState.isOpen,
3994
- highlightedValue: firstSelectedValue ?? firstEnabledValue
3995
- }));
3996
- };
3997
- const moveHighlightedIndex = (delta) => {
3998
- let highlightedIndex = state.options.findIndex((value2) => value2.value === internalState.highlightedValue);
3999
- if (highlightedIndex === -1) {
4000
- highlightedIndex = 0;
4001
- }
4002
- const optionLength = state.options.length;
4003
- const startIndex = (highlightedIndex + delta % optionLength + optionLength) % optionLength;
4004
- const isForward = delta >= 0;
4005
- let highlightedValue = state.options[startIndex].value;
4006
- for (let i = 0; i < state.options.length; i++) {
4007
- const index = (startIndex + (isForward ? i : -i) + optionLength) % optionLength;
4008
- if (!state.options[index].disabled) {
4009
- highlightedValue = state.options[index].value;
4010
- break;
4011
- }
4012
- }
4013
- setInternalState((prevState) => ({
4014
- ...prevState,
4015
- highlightedValue
4016
- }));
4017
- };
4018
- useEffect20(() => {
4019
- if (!internalState.highlightedValue) return;
4020
- const highlighted = internalState.options.find((value2) => value2.value === internalState.highlightedValue);
4021
- if (highlighted) {
4022
- highlighted.ref.current?.scrollIntoView({ behavior: "instant", block: "nearest" });
4023
- } else {
4024
- console.error(`SelectRoot: Could not find highlighted value (${internalState.highlightedValue})`);
4025
- }
4026
- }, [internalState.highlightedValue]);
4027
- const contextValue = {
4028
- state,
4029
- config,
4030
- item: {
4031
- register: registerItem,
4032
- unregister: unregisterItem,
4033
- toggleSelection,
4034
- highlightItem,
4035
- moveHighlightedIndex
4036
- },
4037
- trigger: {
4038
- ref: triggerRef,
4039
- register: registerTrigger,
4040
- unregister: unregisterTrigger,
4041
- toggleOpen
4042
- }
4043
- };
4044
- return /* @__PURE__ */ jsx25(SelectContext.Provider, { value: contextValue, children });
4045
- };
4046
- var SelectOption = forwardRef10(
4047
- function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
4048
- const { state, config, item, trigger } = useSelectContext();
4049
- const { register, unregister, toggleSelection, highlightItem } = item;
4050
- const itemRef = useRef12(null);
4051
- iconAppearance ??= config.iconAppearance;
4052
- const label = children ?? value;
4053
- useEffect20(() => {
4054
- register({
4055
- value,
4056
- label,
4057
- disabled,
4058
- ref: itemRef
4059
- });
4060
- return () => unregister(value);
4061
- }, [value, disabled, register, unregister, children, label]);
4062
- const isHighlighted = state.highlightedValue === value;
4063
- const isSelected = state.value.includes(value);
4064
- return /* @__PURE__ */ jsxs18(
4065
- "li",
4066
- {
4067
- ...restProps,
4068
- ref: (node) => {
4069
- itemRef.current = node;
4070
- if (typeof ref === "function") ref(node);
4071
- else if (ref) ref.current = node;
4072
- },
4073
- id: value,
4074
- role: "option",
4075
- "aria-disabled": disabled,
4076
- "aria-selected": isSelected,
4077
- "data-highlighted": isHighlighted ? "" : void 0,
4078
- "data-selected": isSelected ? "" : void 0,
4079
- "data-disabled": disabled ? "" : void 0,
4080
- className: clsx20(
4081
- "flex-row-1 items-center px-2 py-1 rounded-md",
4082
- "data-highlighted:bg-primary/20",
4083
- "data-disabled:text-disabled data-disabled:cursor-not-allowed",
4084
- "not-data-disabled:cursor-pointer",
4085
- className
4086
- ),
4087
- onClick: (event) => {
4088
- if (!disabled) {
4089
- toggleSelection(value);
4090
- if (!config.isMultiSelect) {
4091
- trigger.toggleOpen(false);
4092
- }
4093
- restProps.onClick?.(event);
4094
- }
4095
- },
4096
- onMouseEnter: (event) => {
4097
- if (!disabled) {
4098
- highlightItem(value);
4099
- restProps.onMouseEnter?.(event);
4100
- }
4101
- },
4102
- children: [
4103
- iconAppearance === "left" && /* @__PURE__ */ jsx25(
4104
- CheckIcon2,
4105
- {
4106
- className: clsx20("w-4 h-4", { "opacity-0": !isSelected || disabled }),
4107
- "aria-hidden": true
4108
- }
4109
- ),
4110
- label,
4111
- iconAppearance === "right" && /* @__PURE__ */ jsx25(
4112
- CheckIcon2,
4113
- {
4114
- className: clsx20("w-4 h-4", { "opacity-0": !isSelected || disabled }),
4115
- "aria-hidden": true
4116
- }
4117
- )
4118
- ]
4119
- }
4120
- );
4121
- }
4122
- );
4123
- var SelectButton = forwardRef10(function SelectButton2({ placeholder, selectedDisplay, ...props }, ref) {
4124
- const translation = useHightideTranslation();
4125
- const { state, trigger } = useSelectContext();
4126
- const { register, unregister, toggleOpen } = trigger;
4127
- const innerRef = useRef12(null);
4128
- useImperativeHandle3(ref, () => innerRef.current);
4129
- useEffect20(() => {
4130
- register(innerRef);
4131
- return () => unregister();
4132
- }, [register, unregister]);
4133
- const disabled = !!props?.disabled || !!state.disabled;
4134
- const invalid = state.invalid;
4135
- const hasValue = state.value.length > 0;
4136
- return /* @__PURE__ */ jsxs18(
4137
- "button",
4138
- {
4139
- ...props,
4140
- ref: innerRef,
4141
- id: state.id,
4142
- disabled,
4143
- onClick: (event) => {
4144
- props.onClick?.(event);
4145
- toggleOpen(!state.isOpen);
4146
- },
4147
- onKeyDown: (event) => {
4148
- props.onKeyDown?.(event);
4149
- switch (event.key) {
4150
- case "ArrowDown":
4151
- toggleOpen(true, { highlightStartPositionBehavior: "first" });
4152
- event.preventDefault();
4153
- event.stopPropagation();
4154
- break;
4155
- case "ArrowUp":
4156
- toggleOpen(true, { highlightStartPositionBehavior: "last" });
4157
- event.preventDefault();
4158
- event.stopPropagation();
4159
- break;
4160
- }
4161
- },
4162
- className: clsx20(
4163
- "flex-row-2 items-center justify-between rounded-md px-3 py-2",
4164
- {
4165
- "bg-input-background text-placeholder": !hasValue && !disabled && !invalid,
4166
- "bg-input-background text-input-text": hasValue && !disabled && !invalid,
4167
- "bg-negative/20": !disabled && invalid,
4168
- "text-placeholder": !hasValue && !disabled,
4169
- "text-negative": hasValue && !disabled && invalid,
4170
- "bg-disabled-background text-disabled": disabled
4171
- },
4172
- props.className
4173
- ),
4174
- "data-placeholder": !hasValue ? "" : void 0,
4175
- "data-disabled": disabled ? "" : void 0,
4176
- "data-invalid": invalid ? "" : void 0,
4177
- "aria-invalid": invalid,
4178
- "aria-disabled": disabled,
4179
- "aria-haspopup": "listbox",
4180
- "aria-expanded": state.isOpen,
4181
- "aria-controls": state.isOpen ? `${state.id}-listbox` : void 0,
4182
- children: [
4183
- hasValue ? selectedDisplay?.(state.value) ?? /* @__PURE__ */ jsx25("div", { className: clsx20("flex flex-wrap gap-x-1 gap-y-2"), children: state.selectedOptions.map(({ value, label }, index) => /* @__PURE__ */ jsxs18("span", { className: "flex-row-0", children: [
4184
- label,
4185
- index < state.value.length - 1 && /* @__PURE__ */ jsx25("span", { children: "," })
4186
- ] }, value)) }) : placeholder ?? translation("clickToSelect"),
4187
- /* @__PURE__ */ jsx25(
4188
- ExpansionIcon,
4189
- {
4190
- isExpanded: state.isOpen,
4191
- className: clsx20({
4192
- "text-input-text": !disabled && !invalid,
4193
- "text-negative": !disabled && invalid,
4194
- "text-disabled": disabled
4195
- })
4196
- }
4197
- )
4198
- ]
4199
- }
4200
- );
4201
- });
4202
- var SelectChipDisplay = forwardRef10(function SelectChipDisplay2({ ...props }, ref) {
4203
- const { state, trigger, item } = useSelectContext();
4204
- const { register, unregister, toggleOpen } = trigger;
4205
- const innerRef = useRef12(null);
4206
- useImperativeHandle3(ref, () => innerRef.current);
4207
- useEffect20(() => {
4208
- register(innerRef);
4209
- return () => unregister();
4210
- }, [register, unregister]);
4211
- const disabled = !!props?.disabled || !!state.disabled;
4212
- const invalid = state.invalid;
4213
- return /* @__PURE__ */ jsxs18(
4214
- "div",
4215
- {
4216
- ...props,
4217
- ref: innerRef,
4218
- className: clsx20(
4219
- "flex flex-wrap flex-row gap-2 items-center bg-input-background text-input-text rounded-md px-2.5 py-2.5",
4220
- props.className
4221
- ),
4222
- "data-disabled": disabled ? "" : void 0,
4223
- "data-invalid": invalid ? "" : void 0,
4224
- "aria-invalid": invalid,
4225
- "aria-disabled": disabled,
4226
- children: [
4227
- state.selectedOptions.map(({ value, label }) => /* @__PURE__ */ jsxs18(Chip, { className: "gap-x-2", children: [
4228
- label,
4229
- /* @__PURE__ */ jsx25(
4230
- TextButton,
4231
- {
4232
- onClick: () => {
4233
- item.toggleSelection(value, false);
4234
- },
4235
- size: "none",
4236
- color: "negative",
4237
- className: "flex-row-0 items-center px-0.5 py-0.5 w-6 h-6 rounded",
4238
- children: /* @__PURE__ */ jsx25(XIcon, { className: "w-5 h-5" })
4239
- }
4240
- )
4241
- ] }, value)),
4242
- /* @__PURE__ */ jsx25(
4243
- IconButton,
4244
- {
4245
- id: state.id,
4246
- onClick: () => toggleOpen(),
4247
- onKeyDown: (event) => {
4248
- switch (event.key) {
4249
- case "ArrowDown":
4250
- toggleOpen(true, { highlightStartPositionBehavior: "first" });
4251
- break;
4252
- case "ArrowUp":
4253
- toggleOpen(true, { highlightStartPositionBehavior: "last" });
4254
- }
4255
- },
4256
- size: "small",
4257
- color: "neutral",
4258
- "aria-invalid": invalid,
4259
- "aria-disabled": disabled,
4260
- "aria-haspopup": "listbox",
4261
- "aria-expanded": state.isOpen,
4262
- "aria-controls": state.isOpen ? `${state.id}-listbox` : void 0,
4263
- children: /* @__PURE__ */ jsx25(Plus, {})
4264
- }
4265
- )
4266
- ]
4267
- }
4268
- );
4269
- });
4270
- var SelectContent = forwardRef10(
4271
- function SelectContent2({
4272
- alignment,
4273
- orientation = "vertical",
4274
- containerClassName,
4275
- ...props
4276
- }, ref) {
4277
- const innerRef = useRef12(null);
4278
- useImperativeHandle3(ref, () => innerRef.current);
4279
- const { trigger, state, config, item } = useSelectContext();
4280
- const position = useFloatingElement({
4281
- active: state.isOpen,
4282
- anchorRef: trigger.ref,
4283
- containerRef: innerRef,
4284
- ...alignment
4285
- });
4286
- useFocusTrap({
4287
- container: innerRef,
4288
- active: state.isOpen && !!position
4289
- });
4290
- return createPortal2(
4291
- /* @__PURE__ */ jsxs18(
4292
- "div",
4293
- {
4294
- id: `select-container-${state.id}`,
4295
- className: clsx20("fixed inset-0 w-screen h-screen", containerClassName),
4296
- hidden: !state.isOpen,
4297
- children: [
4298
- /* @__PURE__ */ jsx25(
4299
- "div",
4300
- {
4301
- id: `select-background-${state.id}`,
4302
- onClick: () => trigger.toggleOpen(false),
4303
- className: clsx20("fixed inset-0 w-screen h-screen")
4304
- }
4305
- ),
4306
- /* @__PURE__ */ jsx25(
4307
- "ul",
4308
- {
4309
- ...props,
4310
- id: `${state.id}-listbox`,
4311
- ref: innerRef,
4312
- onKeyDown: (event) => {
4313
- switch (event.key) {
4314
- case "Escape":
4315
- trigger.toggleOpen(false);
4316
- event.preventDefault();
4317
- event.stopPropagation();
4318
- break;
4319
- case match(orientation, {
4320
- vertical: "ArrowDown",
4321
- horizontal: "ArrowUp"
4322
- }):
4323
- item.moveHighlightedIndex(1);
4324
- event.preventDefault();
4325
- break;
4326
- case match(orientation, {
4327
- vertical: "ArrowUp",
4328
- horizontal: "ArrowDown"
4329
- }):
4330
- item.moveHighlightedIndex(-1);
4331
- event.preventDefault();
4332
- break;
4333
- case "Home":
4334
- event.preventDefault();
4335
- break;
4336
- case "End":
4337
- event.preventDefault();
4338
- break;
4339
- case "Enter":
4340
- // Fall through
4341
- case " ":
4342
- if (state.highlightedValue) {
4343
- item.toggleSelection(state.highlightedValue);
4344
- if (!config.isMultiSelect) {
4345
- trigger.toggleOpen(false);
4346
- }
4347
- event.preventDefault();
4348
- }
4349
- break;
4350
- }
4351
- },
4352
- className: clsx20("flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-style-within overflow-auto", props.className),
4353
- style: {
4354
- opacity: position ? void 0 : 0,
4355
- position: "fixed",
4356
- ...position
4357
- },
4358
- role: "listbox",
4359
- "aria-multiselectable": config.isMultiSelect,
4360
- "aria-orientation": orientation,
4361
- tabIndex: position ? 0 : void 0,
4362
- children: props.children
4363
- }
4364
- )
4365
- ]
4366
- }
4367
- ),
4368
- document.body
4369
- );
4370
- }
4371
- );
4372
- var Select = forwardRef10(function Select2({
4373
- children,
4374
- contentPanelProps,
4375
- buttonProps,
4376
- ...props
4377
- }, ref) {
4378
- return /* @__PURE__ */ jsxs18(SelectRoot, { ...props, isMultiSelect: false, children: [
4379
- /* @__PURE__ */ jsx25(
4380
- SelectButton,
4381
- {
4382
- ref,
4383
- ...buttonProps,
4384
- selectedDisplay: (values) => {
4385
- const value = values[0];
4386
- if (!buttonProps?.selectedDisplay) return void 0;
4387
- return buttonProps.selectedDisplay(value);
4388
- }
4389
- }
4390
- ),
4391
- /* @__PURE__ */ jsx25(SelectContent, { ...contentPanelProps, children })
4392
- ] });
4393
- });
4394
- var SelectUncontrolled = forwardRef10(function SelectUncontrolled2({
4395
- value: initialValue,
4396
- onValueChanged,
4397
- ...props
4398
- }, ref) {
4399
- const [value, setValue] = useOverwritableState(initialValue, onValueChanged);
4400
- return /* @__PURE__ */ jsx25(
4401
- Select,
4402
- {
4403
- ...props,
4404
- ref,
4405
- value,
4406
- onValueChanged: setValue
4407
- }
4408
- );
4409
- });
4410
- var MultiSelect = forwardRef10(function MultiSelect2({
4411
- children,
4412
- contentPanelProps,
4413
- buttonProps,
4414
- ...props
4415
- }, ref) {
4416
- return /* @__PURE__ */ jsxs18(SelectRoot, { ...props, isMultiSelect: true, children: [
4417
- /* @__PURE__ */ jsx25(SelectButton, { ref, ...buttonProps }),
4418
- /* @__PURE__ */ jsx25(SelectContent, { ...contentPanelProps, children })
4419
- ] });
4420
- });
4421
- var MultiSelectUncontrolled = forwardRef10(function MultiSelectUncontrolled2({
4422
- values: initialValues,
4423
- onValuesChanged,
4424
- ...props
4425
- }, ref) {
4426
- const [values, setValues] = useOverwritableState(initialValues, onValuesChanged);
4427
- return /* @__PURE__ */ jsx25(
4428
- MultiSelect,
4429
- {
4430
- ...props,
4431
- ref,
4432
- values,
4433
- onValuesChanged: setValues
4434
- }
4435
- );
4436
- });
4437
- var MultiSelectChipDisplay = forwardRef10(function MultiSelectChipDisplay2({
4438
- children,
4439
- contentPanelProps,
4440
- chipDisplayProps,
4441
- ...props
4442
- }, ref) {
4443
- return /* @__PURE__ */ jsxs18(SelectRoot, { ...props, isMultiSelect: true, children: [
4444
- /* @__PURE__ */ jsx25(SelectChipDisplay, { ref, ...chipDisplayProps }),
4445
- /* @__PURE__ */ jsx25(SelectContent, { ...contentPanelProps, children })
4446
- ] });
4447
- });
4448
- var MultiSelectChipDisplayUncontrolled = forwardRef10(function MultiSelectChipDisplayUncontrolled2({
4449
- values: initialValues,
4450
- onValuesChanged,
4451
- ...props
4452
- }, ref) {
4453
- const [values, setValues] = useOverwritableState(initialValues, onValuesChanged);
4454
- return /* @__PURE__ */ jsx25(
4455
- MultiSelectChipDisplay,
4456
- {
4457
- ...props,
4458
- ref,
4459
- values,
4460
- onValuesChanged: setValues
4461
- }
4462
- );
4463
- });
4464
- export {
4465
- ButtonColorUtil,
4466
- ButtonUtil,
4467
- Checkbox2 as Checkbox,
4468
- CheckboxUncontrolled,
4469
- CopyToClipboardWrapper,
4470
- DateTimePicker,
4471
- IconButton,
4472
- IconButtonUtil,
4473
- Input,
4474
- InputUncontrolled,
4475
- InsideLabelInput,
4476
- InsideLabelInputUncontrolled,
4477
- Label,
4478
- Menu,
4479
- MenuItem,
4480
- MultiSelect,
4481
- MultiSelectChipDisplay,
4482
- MultiSelectChipDisplayUncontrolled,
4483
- MultiSelectUncontrolled,
4484
- OutlineButton,
4485
- ScrollPicker,
4486
- SearchBar,
4487
- Select,
4488
- SelectButton,
4489
- SelectChipDisplay,
4490
- SelectContent,
4491
- SelectOption,
4492
- SelectRoot,
4493
- SelectUncontrolled,
4494
- SolidButton,
4495
- TextButton,
4496
- Textarea,
4497
- TextareaUncontrolled,
4498
- TextareaWithHeadline,
4499
- ToggleableInput,
4500
- ToggleableInputUncontrolled,
4501
- Tooltip
4502
- };
4503
- //# sourceMappingURL=index.js.map