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