@uselets/ui 1.16.1 → 1.18.0

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 (844) hide show
  1. package/README.md +2 -1
  2. package/dist/accordion-BCo2odjy.js +2 -0
  3. package/dist/accordion-BCo2odjy.js.map +1 -0
  4. package/dist/accordion-DtSr3uiA.d.ts +15 -0
  5. package/dist/alert-CJRgRQVF.js +2 -0
  6. package/dist/alert-CJRgRQVF.js.map +1 -0
  7. package/dist/alert-dialog-B_nAiD4Y.js +2 -0
  8. package/dist/alert-dialog-B_nAiD4Y.js.map +1 -0
  9. package/dist/alert-dialog-Bf41-OnT.d.ts +34 -0
  10. package/dist/alert-eivgSC_S.d.ts +18 -0
  11. package/dist/anchor-DCOyn0Xa.d.ts +15 -0
  12. package/dist/anchor-srhmShjN.js +2 -0
  13. package/dist/anchor-srhmShjN.js.map +1 -0
  14. package/dist/area-chart-DdDy8Vm3.js +2 -0
  15. package/dist/area-chart-DdDy8Vm3.js.map +1 -0
  16. package/dist/area-chart-F_4ZL20j.d.ts +40 -0
  17. package/dist/avatar-2ZS3Tx76.d.ts +21 -0
  18. package/dist/avatar-CFUwrOwG.js +2 -0
  19. package/dist/avatar-CFUwrOwG.js.map +1 -0
  20. package/dist/badge-BqpQcDFd.d.ts +16 -0
  21. package/dist/badge-Cuq_DqRS.js +2 -0
  22. package/dist/badge-Cuq_DqRS.js.map +1 -0
  23. package/dist/badge-DEgLmZYC.js +2 -0
  24. package/dist/badge-DEgLmZYC.js.map +1 -0
  25. package/dist/badge-gkezuSZY.d.ts +19 -0
  26. package/dist/bar-chart-DIgSnh_j.js +2 -0
  27. package/dist/bar-chart-DIgSnh_j.js.map +1 -0
  28. package/dist/bar-chart-DRrrfMQR.d.ts +42 -0
  29. package/dist/breadcrumb-CqNDAI8V.js +2 -0
  30. package/dist/breadcrumb-CqNDAI8V.js.map +1 -0
  31. package/dist/breadcrumb-DZFS9htN.d.ts +22 -0
  32. package/dist/button-BNGy28pv.d.ts +17 -0
  33. package/dist/button-CQbH5Glc.d.ts +19 -0
  34. package/dist/button-DGewx2nE.js +2 -0
  35. package/dist/button-DGewx2nE.js.map +1 -0
  36. package/dist/button-group-DRgqsyjS.d.ts +18 -0
  37. package/dist/button-group-WJ5LeouK.js +2 -0
  38. package/dist/button-group-WJ5LeouK.js.map +1 -0
  39. package/dist/button-oI3hbOgp.js +2 -0
  40. package/dist/button-oI3hbOgp.js.map +1 -0
  41. package/dist/calendar-C1GgjzIA.d.ts +17 -0
  42. package/dist/calendar-CW1kGXom.js +2 -0
  43. package/dist/calendar-CW1kGXom.js.map +1 -0
  44. package/dist/card-Bx6iiocl.js +2 -0
  45. package/dist/card-Bx6iiocl.js.map +1 -0
  46. package/dist/card-pWjtkTKw.d.ts +22 -0
  47. package/dist/carousel-C6e4eRJD.d.ts +43 -0
  48. package/dist/carousel-D0OTImO7.js +2 -0
  49. package/dist/carousel-D0OTImO7.js.map +1 -0
  50. package/dist/center-CFQDr205.d.ts +13 -0
  51. package/dist/center-Dl1rnq7S.js +2 -0
  52. package/dist/center-Dl1rnq7S.js.map +1 -0
  53. package/dist/chart-Ci4V8B8v.js +8 -0
  54. package/dist/chart-Ci4V8B8v.js.map +1 -0
  55. package/dist/checkbox-DPvW_m7k.js +2 -0
  56. package/dist/checkbox-DPvW_m7k.js.map +1 -0
  57. package/dist/checkbox-y0XBdH4a.d.ts +21 -0
  58. package/dist/code-A6JERAsm.js +2 -0
  59. package/dist/code-A6JERAsm.js.map +1 -0
  60. package/dist/code-Cqoacc61.d.ts +8 -0
  61. package/dist/collapsible-BH8BqfTd.js +2 -0
  62. package/dist/collapsible-BH8BqfTd.js.map +1 -0
  63. package/dist/collapsible-CLSCZ630.d.ts +12 -0
  64. package/dist/color-DJvQFSl5.d.ts +19 -0
  65. package/dist/color-Don4qaht.js +2 -0
  66. package/dist/color-Don4qaht.js.map +1 -0
  67. package/dist/combobox-DkCRXUxd.d.ts +51 -0
  68. package/dist/combobox-fNAIovsN.js +2 -0
  69. package/dist/combobox-fNAIovsN.js.map +1 -0
  70. package/dist/command-0wTb46Ym.js +2 -0
  71. package/dist/command-0wTb46Ym.js.map +1 -0
  72. package/dist/command-D4pNOx0J.d.ts +31 -0
  73. package/dist/components/accordion.d.ts +2 -15
  74. package/dist/components/accordion.js +1 -2
  75. package/dist/components/accordion.spec.d.ts +1 -0
  76. package/dist/components/accordion.spec.js +2 -0
  77. package/dist/components/accordion.spec.js.map +1 -0
  78. package/dist/components/alert-dialog.d.ts +2 -34
  79. package/dist/components/alert-dialog.js +1 -2
  80. package/dist/components/alert-dialog.spec.d.ts +1 -0
  81. package/dist/components/alert-dialog.spec.js +2 -0
  82. package/dist/components/alert-dialog.spec.js.map +1 -0
  83. package/dist/components/alert.d.ts +2 -18
  84. package/dist/components/alert.js +1 -2
  85. package/dist/components/alert.spec.d.ts +1 -0
  86. package/dist/components/alert.spec.js +2 -0
  87. package/dist/components/alert.spec.js.map +1 -0
  88. package/dist/components/anchor.d.ts +2 -15
  89. package/dist/components/anchor.js +1 -2
  90. package/dist/components/anchor.spec.d.ts +1 -0
  91. package/dist/components/anchor.spec.js +2 -0
  92. package/dist/components/anchor.spec.js.map +1 -0
  93. package/dist/components/area-chart.d.ts +2 -40
  94. package/dist/components/area-chart.js +1 -2
  95. package/dist/components/area-chart.spec.d.ts +1 -0
  96. package/dist/components/area-chart.spec.js +2 -0
  97. package/dist/components/area-chart.spec.js.map +1 -0
  98. package/dist/components/avatar.d.ts +2 -21
  99. package/dist/components/avatar.js +1 -2
  100. package/dist/components/avatar.spec.d.ts +1 -0
  101. package/dist/components/avatar.spec.js +2 -0
  102. package/dist/components/avatar.spec.js.map +1 -0
  103. package/dist/components/badge.d.ts +2 -16
  104. package/dist/components/badge.js +1 -2
  105. package/dist/components/badge.spec.d.ts +1 -0
  106. package/dist/components/badge.spec.js +2 -0
  107. package/dist/components/badge.spec.js.map +1 -0
  108. package/dist/components/bar-chart.d.ts +2 -42
  109. package/dist/components/bar-chart.js +1 -2
  110. package/dist/components/bar-chart.spec.d.ts +1 -0
  111. package/dist/components/bar-chart.spec.js +2 -0
  112. package/dist/components/bar-chart.spec.js.map +1 -0
  113. package/dist/components/breadcrumb.d.ts +2 -22
  114. package/dist/components/breadcrumb.js +1 -2
  115. package/dist/components/breadcrumb.spec.d.ts +1 -0
  116. package/dist/components/breadcrumb.spec.js +2 -0
  117. package/dist/components/breadcrumb.spec.js.map +1 -0
  118. package/dist/components/button-group.d.ts +2 -18
  119. package/dist/components/button-group.js +1 -2
  120. package/dist/components/button-group.spec.d.ts +1 -0
  121. package/dist/components/button-group.spec.js +2 -0
  122. package/dist/components/button-group.spec.js.map +1 -0
  123. package/dist/components/button.d.ts +2 -17
  124. package/dist/components/button.js +1 -2
  125. package/dist/components/button.spec.d.ts +1 -0
  126. package/dist/components/button.spec.js +2 -0
  127. package/dist/components/button.spec.js.map +1 -0
  128. package/dist/components/calendar.d.ts +2 -17
  129. package/dist/components/calendar.js +1 -2
  130. package/dist/components/calendar.spec.d.ts +1 -0
  131. package/dist/components/calendar.spec.js +2 -0
  132. package/dist/components/calendar.spec.js.map +1 -0
  133. package/dist/components/card.d.ts +2 -22
  134. package/dist/components/card.js +1 -2
  135. package/dist/components/card.spec.d.ts +1 -0
  136. package/dist/components/card.spec.js +2 -0
  137. package/dist/components/card.spec.js.map +1 -0
  138. package/dist/components/carousel.d.ts +2 -43
  139. package/dist/components/carousel.js +1 -2
  140. package/dist/components/carousel.spec.js +1 -93
  141. package/dist/components/carousel.spec.js.map +1 -1
  142. package/dist/components/center.d.ts +2 -13
  143. package/dist/components/center.js +1 -2
  144. package/dist/components/center.spec.d.ts +1 -0
  145. package/dist/components/center.spec.js +2 -0
  146. package/dist/components/center.spec.js.map +1 -0
  147. package/dist/components/chart.js +1 -8
  148. package/dist/components/chart.spec.d.ts +1 -0
  149. package/dist/components/chart.spec.js +2 -0
  150. package/dist/components/chart.spec.js.map +1 -0
  151. package/dist/components/checkbox.d.ts +2 -21
  152. package/dist/components/checkbox.js +1 -2
  153. package/dist/components/checkbox.spec.d.ts +1 -0
  154. package/dist/components/checkbox.spec.js +2 -0
  155. package/dist/components/checkbox.spec.js.map +1 -0
  156. package/dist/components/code.d.ts +2 -8
  157. package/dist/components/code.js +1 -2
  158. package/dist/components/code.spec.d.ts +1 -0
  159. package/dist/components/code.spec.js +2 -0
  160. package/dist/components/code.spec.js.map +1 -0
  161. package/dist/components/collapsible.d.ts +2 -12
  162. package/dist/components/collapsible.js +1 -2
  163. package/dist/components/collapsible.spec.d.ts +1 -0
  164. package/dist/components/collapsible.spec.js +2 -0
  165. package/dist/components/collapsible.spec.js.map +1 -0
  166. package/dist/components/combobox.d.ts +2 -51
  167. package/dist/components/combobox.js +1 -2
  168. package/dist/components/combobox.spec.d.ts +1 -0
  169. package/dist/components/combobox.spec.js +2 -0
  170. package/dist/components/combobox.spec.js.map +1 -0
  171. package/dist/components/command.d.ts +2 -31
  172. package/dist/components/command.js +1 -2
  173. package/dist/components/command.spec.d.ts +1 -0
  174. package/dist/components/command.spec.js +2 -0
  175. package/dist/components/command.spec.js.map +1 -0
  176. package/dist/components/container.d.ts +2 -12
  177. package/dist/components/container.js +1 -2
  178. package/dist/components/container.spec.d.ts +1 -0
  179. package/dist/components/container.spec.js +2 -0
  180. package/dist/components/container.spec.js.map +1 -0
  181. package/dist/components/data-table.d.ts +2 -111
  182. package/dist/components/data-table.js +1 -2
  183. package/dist/components/data-table.spec.d.ts +1 -0
  184. package/dist/components/data-table.spec.js +2 -0
  185. package/dist/components/data-table.spec.js.map +1 -0
  186. package/dist/components/date-range-picker.d.ts +3 -55
  187. package/dist/components/date-range-picker.js +1 -2
  188. package/dist/components/date-range-picker.spec.d.ts +1 -0
  189. package/dist/components/date-range-picker.spec.js +2 -0
  190. package/dist/components/date-range-picker.spec.js.map +1 -0
  191. package/dist/components/dialog.d.ts +2 -42
  192. package/dist/components/dialog.js +1 -2
  193. package/dist/components/dialog.spec.d.ts +1 -0
  194. package/dist/components/dialog.spec.js +2 -0
  195. package/dist/components/dialog.spec.js.map +1 -0
  196. package/dist/components/donut-chart.d.ts +2 -13
  197. package/dist/components/donut-chart.js +1 -2
  198. package/dist/components/donut-chart.spec.d.ts +1 -0
  199. package/dist/components/donut-chart.spec.js +2 -0
  200. package/dist/components/donut-chart.spec.js.map +1 -0
  201. package/dist/components/drawer.d.ts +2 -43
  202. package/dist/components/drawer.js +1 -2
  203. package/dist/components/drawer.spec.d.ts +1 -0
  204. package/dist/components/drawer.spec.js +2 -0
  205. package/dist/components/drawer.spec.js.map +1 -0
  206. package/dist/components/dropdown-menu.d.ts +2 -48
  207. package/dist/components/dropdown-menu.js +1 -2
  208. package/dist/components/dropdown-menu.spec.d.ts +1 -0
  209. package/dist/components/dropdown-menu.spec.js +2 -0
  210. package/dist/components/dropdown-menu.spec.js.map +1 -0
  211. package/dist/components/dropzone.d.ts +2 -102
  212. package/dist/components/dropzone.js +1 -2
  213. package/dist/components/dropzone.spec.d.ts +1 -0
  214. package/dist/components/dropzone.spec.js +2 -0
  215. package/dist/components/dropzone.spec.js.map +1 -0
  216. package/dist/components/empty.d.ts +2 -21
  217. package/dist/components/empty.js +1 -2
  218. package/dist/components/empty.spec.d.ts +1 -0
  219. package/dist/components/empty.spec.js +2 -0
  220. package/dist/components/empty.spec.js.map +1 -0
  221. package/dist/components/field.d.ts +2 -39
  222. package/dist/components/field.js +1 -2
  223. package/dist/components/field.spec.js +1 -1
  224. package/dist/components/field.spec.js.map +1 -1
  225. package/dist/components/flex.d.ts +2 -16
  226. package/dist/components/flex.js +1 -2
  227. package/dist/components/flex.spec.d.ts +1 -0
  228. package/dist/components/flex.spec.js +2 -0
  229. package/dist/components/flex.spec.js.map +1 -0
  230. package/dist/components/grid.d.ts +2 -20
  231. package/dist/components/grid.js +1 -2
  232. package/dist/components/grid.spec.d.ts +1 -0
  233. package/dist/components/grid.spec.js +2 -0
  234. package/dist/components/grid.spec.js.map +1 -0
  235. package/dist/components/group.d.ts +2 -15
  236. package/dist/components/group.js +1 -2
  237. package/dist/components/group.spec.d.ts +1 -0
  238. package/dist/components/group.spec.js +2 -0
  239. package/dist/components/group.spec.js.map +1 -0
  240. package/dist/components/heading.d.ts +2 -14
  241. package/dist/components/heading.js +1 -2
  242. package/dist/components/heading.spec.d.ts +1 -0
  243. package/dist/components/heading.spec.js +2 -0
  244. package/dist/components/heading.spec.js.map +1 -0
  245. package/dist/components/hover-card.d.ts +2 -13
  246. package/dist/components/hover-card.js +1 -2
  247. package/dist/components/hover-card.spec.d.ts +1 -0
  248. package/dist/components/hover-card.spec.js +2 -0
  249. package/dist/components/hover-card.spec.js.map +1 -0
  250. package/dist/components/input-group.d.ts +2 -26
  251. package/dist/components/input-group.js +1 -2
  252. package/dist/components/input-group.spec.d.ts +1 -0
  253. package/dist/components/input-group.spec.js +2 -0
  254. package/dist/components/input-group.spec.js.map +1 -0
  255. package/dist/components/input-otp.d.ts +2 -19
  256. package/dist/components/input-otp.js +1 -2
  257. package/dist/components/input-otp.spec.d.ts +1 -0
  258. package/dist/components/input-otp.spec.js +2 -0
  259. package/dist/components/input-otp.spec.js.map +1 -0
  260. package/dist/components/input.d.ts +2 -8
  261. package/dist/components/input.js +1 -2
  262. package/dist/components/input.spec.d.ts +1 -0
  263. package/dist/components/input.spec.js +2 -0
  264. package/dist/components/input.spec.js.map +1 -0
  265. package/dist/components/kbd.d.ts +2 -10
  266. package/dist/components/kbd.js +1 -2
  267. package/dist/components/kbd.spec.d.ts +1 -0
  268. package/dist/components/kbd.spec.js +2 -0
  269. package/dist/components/kbd.spec.js.map +1 -0
  270. package/dist/components/label.d.ts +2 -9
  271. package/dist/components/label.js +1 -2
  272. package/dist/components/label.spec.d.ts +1 -0
  273. package/dist/components/label.spec.js +2 -0
  274. package/dist/components/label.spec.js.map +1 -0
  275. package/dist/components/list.d.ts +2 -25
  276. package/dist/components/list.js +1 -2
  277. package/dist/components/list.spec.d.ts +1 -0
  278. package/dist/components/list.spec.js +2 -0
  279. package/dist/components/list.spec.js.map +1 -0
  280. package/dist/components/logo.d.ts +2 -0
  281. package/dist/components/logo.js +1 -0
  282. package/dist/components/logo.spec.d.ts +1 -0
  283. package/dist/components/logo.spec.js +2 -0
  284. package/dist/components/logo.spec.js.map +1 -0
  285. package/dist/components/marker.d.ts +2 -18
  286. package/dist/components/marker.js +1 -2
  287. package/dist/components/marker.spec.d.ts +1 -0
  288. package/dist/components/marker.spec.js +2 -0
  289. package/dist/components/marker.spec.js.map +1 -0
  290. package/dist/components/mask-input.d.ts +2 -16
  291. package/dist/components/mask-input.js +1 -2
  292. package/dist/components/mask-input.spec.d.ts +1 -0
  293. package/dist/components/mask-input.spec.js +2 -0
  294. package/dist/components/mask-input.spec.js.map +1 -0
  295. package/dist/components/native-select.d.ts +2 -14
  296. package/dist/components/native-select.js +1 -2
  297. package/dist/components/native-select.spec.d.ts +1 -0
  298. package/dist/components/native-select.spec.js +2 -0
  299. package/dist/components/native-select.spec.js.map +1 -0
  300. package/dist/components/navigation-menu.d.ts +2 -26
  301. package/dist/components/navigation-menu.js +1 -2
  302. package/dist/components/navigation-menu.spec.d.ts +1 -0
  303. package/dist/components/navigation-menu.spec.js +2 -0
  304. package/dist/components/navigation-menu.spec.js.map +1 -0
  305. package/dist/components/number-field.d.ts +2 -35
  306. package/dist/components/number-field.js +1 -2
  307. package/dist/components/number-field.spec.d.ts +1 -0
  308. package/dist/components/number-field.spec.js +2 -0
  309. package/dist/components/number-field.spec.js.map +1 -0
  310. package/dist/components/pagination.d.ts +2 -27
  311. package/dist/components/pagination.js +1 -2
  312. package/dist/components/pagination.spec.d.ts +1 -0
  313. package/dist/components/pagination.spec.js +2 -0
  314. package/dist/components/pagination.spec.js.map +1 -0
  315. package/dist/components/phone-input.d.ts +2 -13
  316. package/dist/components/phone-input.js +1 -2
  317. package/dist/components/phone-input.spec.d.ts +1 -0
  318. package/dist/components/phone-input.spec.js +2 -0
  319. package/dist/components/phone-input.spec.js.map +1 -0
  320. package/dist/components/pie-chart.d.ts +2 -42
  321. package/dist/components/pie-chart.js +1 -2
  322. package/dist/components/pie-chart.spec.d.ts +1 -0
  323. package/dist/components/pie-chart.spec.js +2 -0
  324. package/dist/components/pie-chart.spec.js.map +1 -0
  325. package/dist/components/popover.d.ts +2 -21
  326. package/dist/components/popover.js +1 -2
  327. package/dist/components/popover.spec.d.ts +1 -0
  328. package/dist/components/popover.spec.js +2 -0
  329. package/dist/components/popover.spec.js.map +1 -0
  330. package/dist/components/progress.d.ts +2 -14
  331. package/dist/components/progress.js +1 -2
  332. package/dist/components/progress.spec.d.ts +1 -0
  333. package/dist/components/progress.spec.js +2 -0
  334. package/dist/components/progress.spec.js.map +1 -0
  335. package/dist/components/radio-group.d.ts +2 -25
  336. package/dist/components/radio-group.js +1 -2
  337. package/dist/components/radio-group.spec.d.ts +1 -0
  338. package/dist/components/radio-group.spec.js +2 -0
  339. package/dist/components/radio-group.spec.js.map +1 -0
  340. package/dist/components/resizable.d.ts +2 -14
  341. package/dist/components/resizable.js +1 -2
  342. package/dist/components/resizable.spec.d.ts +1 -0
  343. package/dist/components/resizable.spec.js +2 -0
  344. package/dist/components/resizable.spec.js.map +1 -0
  345. package/dist/components/ring-progress.d.ts +2 -17
  346. package/dist/components/ring-progress.js +1 -2
  347. package/dist/components/ring-progress.spec.d.ts +1 -0
  348. package/dist/components/ring-progress.spec.js +2 -0
  349. package/dist/components/ring-progress.spec.js.map +1 -0
  350. package/dist/components/scroll-area.d.ts +2 -11
  351. package/dist/components/scroll-area.js +1 -2
  352. package/dist/components/scroll-area.spec.d.ts +1 -0
  353. package/dist/components/scroll-area.spec.js +2 -0
  354. package/dist/components/scroll-area.spec.js.map +1 -0
  355. package/dist/components/select.d.ts +2 -29
  356. package/dist/components/select.js +1 -2
  357. package/dist/components/select.spec.d.ts +1 -0
  358. package/dist/components/select.spec.js +2 -0
  359. package/dist/components/select.spec.js.map +1 -0
  360. package/dist/components/separator.d.ts +2 -9
  361. package/dist/components/separator.js +1 -2
  362. package/dist/components/separator.spec.d.ts +1 -0
  363. package/dist/components/separator.spec.js +2 -0
  364. package/dist/components/separator.spec.js.map +1 -0
  365. package/dist/components/sidebar.d.ts +2 -96
  366. package/dist/components/sidebar.js +1 -2
  367. package/dist/components/sidebar.spec.d.ts +1 -0
  368. package/dist/components/sidebar.spec.js +2 -0
  369. package/dist/components/sidebar.spec.js.map +1 -0
  370. package/dist/components/simple-grid.d.ts +2 -14
  371. package/dist/components/simple-grid.js +1 -2
  372. package/dist/components/simple-grid.spec.d.ts +1 -0
  373. package/dist/components/simple-grid.spec.js +2 -0
  374. package/dist/components/simple-grid.spec.js.map +1 -0
  375. package/dist/components/skeleton.d.ts +2 -10
  376. package/dist/components/skeleton.js +1 -2
  377. package/dist/components/skeleton.spec.js +1 -1
  378. package/dist/components/skeleton.spec.js.map +1 -1
  379. package/dist/components/slider.d.ts +2 -9
  380. package/dist/components/slider.js +1 -2
  381. package/dist/components/slider.spec.d.ts +1 -0
  382. package/dist/components/slider.spec.js +2 -0
  383. package/dist/components/slider.spec.js.map +1 -0
  384. package/dist/components/sonner.d.ts +2 -8
  385. package/dist/components/sonner.js +1 -2
  386. package/dist/components/sonner.spec.d.ts +1 -0
  387. package/dist/components/sonner.spec.js +2 -0
  388. package/dist/components/sonner.spec.js.map +1 -0
  389. package/dist/components/spinner.d.ts +2 -12
  390. package/dist/components/spinner.js +1 -2
  391. package/dist/components/spinner.spec.d.ts +1 -0
  392. package/dist/components/spinner.spec.js +2 -0
  393. package/dist/components/spinner.spec.js.map +1 -0
  394. package/dist/components/stack.d.ts +2 -14
  395. package/dist/components/stack.js +1 -2
  396. package/dist/components/stack.spec.d.ts +1 -0
  397. package/dist/components/stack.spec.js +2 -0
  398. package/dist/components/stack.spec.js.map +1 -0
  399. package/dist/components/stepper.d.ts +2 -71
  400. package/dist/components/stepper.js +1 -2
  401. package/dist/components/stepper.spec.d.ts +1 -0
  402. package/dist/components/stepper.spec.js +2 -0
  403. package/dist/components/stepper.spec.js.map +1 -0
  404. package/dist/components/switch.d.ts +2 -17
  405. package/dist/components/switch.js +1 -2
  406. package/dist/components/switch.spec.d.ts +1 -0
  407. package/dist/components/switch.spec.js +2 -0
  408. package/dist/components/switch.spec.js.map +1 -0
  409. package/dist/components/table.d.ts +2 -33
  410. package/dist/components/table.js +1 -2
  411. package/dist/components/table.spec.d.ts +1 -0
  412. package/dist/components/table.spec.js +2 -0
  413. package/dist/components/table.spec.js.map +1 -0
  414. package/dist/components/tabs.d.ts +2 -21
  415. package/dist/components/tabs.js +1 -2
  416. package/dist/components/tabs.spec.d.ts +1 -0
  417. package/dist/components/tabs.spec.js +2 -0
  418. package/dist/components/tabs.spec.js.map +1 -0
  419. package/dist/components/text.d.ts +2 -14
  420. package/dist/components/text.js +1 -2
  421. package/dist/components/text.spec.d.ts +1 -0
  422. package/dist/components/text.spec.js +2 -0
  423. package/dist/components/text.spec.js.map +1 -0
  424. package/dist/components/textarea.d.ts +2 -8
  425. package/dist/components/textarea.js +1 -2
  426. package/dist/components/textarea.spec.d.ts +1 -0
  427. package/dist/components/textarea.spec.js +2 -0
  428. package/dist/components/textarea.spec.js.map +1 -0
  429. package/dist/components/theme.d.ts +2 -22
  430. package/dist/components/theme.js +1 -2
  431. package/dist/components/theme.spec.d.ts +1 -0
  432. package/dist/components/theme.spec.js +2 -0
  433. package/dist/components/theme.spec.js.map +1 -0
  434. package/dist/components/timeline.d.ts +2 -61
  435. package/dist/components/timeline.js +1 -2
  436. package/dist/components/timeline.spec.d.ts +1 -0
  437. package/dist/components/timeline.spec.js +2 -0
  438. package/dist/components/timeline.spec.js.map +1 -0
  439. package/dist/components/toggle-group.d.ts +2 -16
  440. package/dist/components/toggle-group.js +1 -2
  441. package/dist/components/toggle-group.spec.d.ts +1 -0
  442. package/dist/components/toggle-group.spec.js +2 -0
  443. package/dist/components/toggle-group.spec.js.map +1 -0
  444. package/dist/components/toggle.d.ts +2 -15
  445. package/dist/components/toggle.js +1 -2
  446. package/dist/components/toggle.spec.d.ts +1 -0
  447. package/dist/components/toggle.spec.js +2 -0
  448. package/dist/components/toggle.spec.js.map +1 -0
  449. package/dist/components/tooltip.d.ts +2 -21
  450. package/dist/components/tooltip.js +1 -2
  451. package/dist/components/tooltip.spec.d.ts +1 -0
  452. package/dist/components/tooltip.spec.js +2 -0
  453. package/dist/components/tooltip.spec.js.map +1 -0
  454. package/dist/components/unstyled-button.d.ts +2 -10
  455. package/dist/components/unstyled-button.js +1 -2
  456. package/dist/components/unstyled-button.spec.d.ts +1 -0
  457. package/dist/components/unstyled-button.spec.js +2 -0
  458. package/dist/components/unstyled-button.spec.js.map +1 -0
  459. package/dist/components/visibility.d.ts +2 -17
  460. package/dist/components/visibility.js +1 -2
  461. package/dist/components/visibility.spec.d.ts +1 -0
  462. package/dist/components/visibility.spec.js +2 -0
  463. package/dist/components/visibility.spec.js.map +1 -0
  464. package/dist/compose-refs-DUtp7lGn.js +2 -0
  465. package/dist/compose-refs-DUtp7lGn.js.map +1 -0
  466. package/dist/compose-refs-GP3zdokU.d.ts +8 -0
  467. package/dist/container-B8-lt-oX.d.ts +12 -0
  468. package/dist/container-CikeKdez.js +2 -0
  469. package/dist/container-CikeKdez.js.map +1 -0
  470. package/dist/data-table-BT75MSO9.d.ts +111 -0
  471. package/dist/data-table-DcyKClKz.js +2 -0
  472. package/dist/data-table-DcyKClKz.js.map +1 -0
  473. package/dist/date-range-picker-BngvCWcR.d.ts +55 -0
  474. package/dist/date-range-picker-CJVpTZdT.js +2 -0
  475. package/dist/date-range-picker-CJVpTZdT.js.map +1 -0
  476. package/dist/dialog-B7I4Ky1i.js +2 -0
  477. package/dist/dialog-B7I4Ky1i.js.map +1 -0
  478. package/dist/dialog-Ej7pnact.d.ts +42 -0
  479. package/dist/donut-chart-BDJR8TXh.d.ts +13 -0
  480. package/dist/donut-chart-BHU4kDE6.js +2 -0
  481. package/dist/donut-chart-BHU4kDE6.js.map +1 -0
  482. package/dist/drawer-BO4mP6y1.js +2 -0
  483. package/dist/drawer-BO4mP6y1.js.map +1 -0
  484. package/dist/drawer-DUfJzrKE.d.ts +43 -0
  485. package/dist/dropdown-menu-CVDIf0Rd.d.ts +48 -0
  486. package/dist/dropdown-menu-zRuQQS5S.js +2 -0
  487. package/dist/dropdown-menu-zRuQQS5S.js.map +1 -0
  488. package/dist/dropzone-43h3L9Ko.d.ts +102 -0
  489. package/dist/dropzone-BLZkZThJ.js +2 -0
  490. package/dist/dropzone-BLZkZThJ.js.map +1 -0
  491. package/dist/empty-BhKsDYZ5.js +2 -0
  492. package/dist/empty-BhKsDYZ5.js.map +1 -0
  493. package/dist/empty-D8ZiTCVK.d.ts +21 -0
  494. package/dist/field-C209yHO9.d.ts +39 -0
  495. package/dist/field-DzR-XrO7.js +2 -0
  496. package/dist/field-DzR-XrO7.js.map +1 -0
  497. package/dist/flex-BC4Diiy4.js +2 -0
  498. package/dist/flex-BC4Diiy4.js.map +1 -0
  499. package/dist/flex-aJXipTAz.d.ts +16 -0
  500. package/dist/grid-B3He1bGe.js +2 -0
  501. package/dist/grid-B3He1bGe.js.map +1 -0
  502. package/dist/grid-D_aEANA7.d.ts +20 -0
  503. package/dist/group-B6n_lMc4.js +2 -0
  504. package/dist/group-B6n_lMc4.js.map +1 -0
  505. package/dist/group-DBtx8eSe.d.ts +15 -0
  506. package/dist/heading-BTXl4JfI.d.ts +14 -0
  507. package/dist/heading-DaxKLVRm.js +2 -0
  508. package/dist/heading-DaxKLVRm.js.map +1 -0
  509. package/dist/hooks/use-breakpoint-value.d.ts +2 -8
  510. package/dist/hooks/use-breakpoint-value.js +1 -2
  511. package/dist/hooks/use-breakpoint-value.spec.js +34 -1
  512. package/dist/hooks/use-breakpoint-value.spec.js.map +1 -1
  513. package/dist/hooks/use-breakpoint.d.ts +2 -8
  514. package/dist/hooks/use-breakpoint.js +1 -2
  515. package/dist/hooks/use-breakpoint.spec.js +1 -1
  516. package/dist/hooks/use-breakpoint.spec.js.map +1 -1
  517. package/dist/hooks/use-disclosure.d.ts +2 -22
  518. package/dist/hooks/use-disclosure.js +1 -2
  519. package/dist/hooks/use-disclosure.spec.js +1 -1
  520. package/dist/hooks/use-disclosure.spec.js.map +1 -1
  521. package/dist/hooks/use-document-visibility.d.ts +2 -6
  522. package/dist/hooks/use-document-visibility.js +1 -2
  523. package/dist/hooks/use-document-visibility.spec.js +1 -1
  524. package/dist/hooks/use-document-visibility.spec.js.map +1 -1
  525. package/dist/hooks/use-hotkeys.spec.js +1 -1
  526. package/dist/hooks/use-idle.d.ts +2 -13
  527. package/dist/hooks/use-idle.js +1 -2
  528. package/dist/hooks/use-idle.spec.js +1 -1
  529. package/dist/hooks/use-idle.spec.js.map +1 -1
  530. package/dist/hooks/use-interval.d.ts +2 -24
  531. package/dist/hooks/use-interval.js +1 -2
  532. package/dist/hooks/use-interval.spec.js +1 -1
  533. package/dist/hooks/use-local-storage.d.ts +2 -16
  534. package/dist/hooks/use-local-storage.js +1 -2
  535. package/dist/hooks/use-local-storage.spec.js +1 -1
  536. package/dist/hooks/use-local-storage.spec.js.map +1 -1
  537. package/dist/hooks/use-mask.d.ts +2 -8
  538. package/dist/hooks/use-mask.js +1 -2
  539. package/dist/hooks/use-mask.spec.d.ts +1 -0
  540. package/dist/hooks/use-mask.spec.js +2 -0
  541. package/dist/hooks/use-mask.spec.js.map +1 -0
  542. package/dist/hooks/use-mobile.d.ts +2 -6
  543. package/dist/hooks/use-mobile.js +1 -2
  544. package/dist/hooks/use-mobile.spec.js +1 -1
  545. package/dist/hover-card-C3yz2zQi.d.ts +13 -0
  546. package/dist/hover-card-Dc8yLsm-.js +2 -0
  547. package/dist/hover-card-Dc8yLsm-.js.map +1 -0
  548. package/dist/index.d.ts +94 -93
  549. package/dist/index.js +1 -1
  550. package/dist/input-CI3RPXz0.d.ts +8 -0
  551. package/dist/input-Cmjl8YdK.js +2 -0
  552. package/dist/input-Cmjl8YdK.js.map +1 -0
  553. package/dist/input-group-CBn36aMg.d.ts +26 -0
  554. package/dist/input-group-DsO2W3Lw.js +2 -0
  555. package/dist/input-group-DsO2W3Lw.js.map +1 -0
  556. package/dist/input-otp-CzfRHf2V.js +2 -0
  557. package/dist/input-otp-CzfRHf2V.js.map +1 -0
  558. package/dist/input-otp-gIEkdiIC.d.ts +19 -0
  559. package/dist/kbd-BTl3AgkY.js +2 -0
  560. package/dist/kbd-BTl3AgkY.js.map +1 -0
  561. package/dist/kbd-DELCQBD0.d.ts +10 -0
  562. package/dist/label-BQDEej_c.js +2 -0
  563. package/dist/label-BQDEej_c.js.map +1 -0
  564. package/dist/label-KZl6I5Ey.d.ts +9 -0
  565. package/dist/lib/badge.d.ts +2 -19
  566. package/dist/lib/badge.js +1 -2
  567. package/dist/lib/badge.spec.d.ts +1 -0
  568. package/dist/lib/badge.spec.js +2 -0
  569. package/dist/lib/badge.spec.js.map +1 -0
  570. package/dist/lib/button.d.ts +2 -19
  571. package/dist/lib/button.js +1 -2
  572. package/dist/lib/button.spec.d.ts +1 -0
  573. package/dist/lib/button.spec.js +2 -0
  574. package/dist/lib/button.spec.js.map +1 -0
  575. package/dist/lib/color.d.ts +2 -19
  576. package/dist/lib/color.js +1 -2
  577. package/dist/lib/color.spec.d.ts +1 -0
  578. package/dist/lib/color.spec.js +2 -0
  579. package/dist/lib/color.spec.js.map +1 -0
  580. package/dist/lib/compose-refs.d.ts +2 -8
  581. package/dist/lib/compose-refs.js +1 -2
  582. package/dist/lib/compose-refs.spec.d.ts +1 -0
  583. package/dist/lib/compose-refs.spec.js +2 -0
  584. package/dist/lib/compose-refs.spec.js.map +1 -0
  585. package/dist/lib/progress.d.ts +2 -19
  586. package/dist/lib/progress.js +1 -2
  587. package/dist/lib/progress.spec.d.ts +1 -0
  588. package/dist/lib/progress.spec.js +2 -0
  589. package/dist/lib/progress.spec.js.map +1 -0
  590. package/dist/lib/utils.d.ts +2 -8
  591. package/dist/lib/utils.js +1 -2
  592. package/dist/lib/utils.spec.d.ts +1 -0
  593. package/dist/lib/utils.spec.js +2 -0
  594. package/dist/lib/utils.spec.js.map +1 -0
  595. package/dist/list-BbCg-ndB.js +2 -0
  596. package/dist/list-BbCg-ndB.js.map +1 -0
  597. package/dist/list-DMa2j1rk.d.ts +25 -0
  598. package/dist/logo-B0v9bNJH.js +2 -0
  599. package/dist/logo-B0v9bNJH.js.map +1 -0
  600. package/dist/logo-Buo7sqqn.d.ts +69 -0
  601. package/dist/marker-4_EnMIHk.js +2 -0
  602. package/dist/marker-4_EnMIHk.js.map +1 -0
  603. package/dist/marker-C4wLa1c0.d.ts +18 -0
  604. package/dist/mask-input-B4R5K1h6.d.ts +16 -0
  605. package/dist/mask-input-ssK7U_Pl.js +2 -0
  606. package/dist/mask-input-ssK7U_Pl.js.map +1 -0
  607. package/dist/native-select-BVmdMkHY.d.ts +14 -0
  608. package/dist/native-select-DZW3Y7nq.js +2 -0
  609. package/dist/native-select-DZW3Y7nq.js.map +1 -0
  610. package/dist/navigation-menu-B6drNL1-.js +2 -0
  611. package/dist/navigation-menu-B6drNL1-.js.map +1 -0
  612. package/dist/navigation-menu-siQVRMUF.d.ts +26 -0
  613. package/dist/number-field-IdgO_BUa.d.ts +35 -0
  614. package/dist/number-field-rEMfZa6A.js +2 -0
  615. package/dist/number-field-rEMfZa6A.js.map +1 -0
  616. package/dist/pagination-BZ3xMXsy.d.ts +27 -0
  617. package/dist/pagination-gnUKddCN.js +2 -0
  618. package/dist/pagination-gnUKddCN.js.map +1 -0
  619. package/dist/phone-input-By5lNF03.d.ts +13 -0
  620. package/dist/phone-input-D72tVPWH.js +2 -0
  621. package/dist/phone-input-D72tVPWH.js.map +1 -0
  622. package/dist/pie-chart-CvG27kFN.d.ts +42 -0
  623. package/dist/pie-chart-S4nMKbsW.js +2 -0
  624. package/dist/pie-chart-S4nMKbsW.js.map +1 -0
  625. package/dist/popover-BtX3tX8M.js +2 -0
  626. package/dist/popover-BtX3tX8M.js.map +1 -0
  627. package/dist/popover-DchAqyKn.d.ts +21 -0
  628. package/dist/progress-DeXRCHUw.d.ts +19 -0
  629. package/dist/progress-QvpY7tiy.js +2 -0
  630. package/dist/progress-QvpY7tiy.js.map +1 -0
  631. package/dist/progress-icFwrvnE.js +2 -0
  632. package/dist/progress-icFwrvnE.js.map +1 -0
  633. package/dist/progress-mEAw9ZhK.d.ts +14 -0
  634. package/dist/radio-group-BNbepK_U.d.ts +25 -0
  635. package/dist/radio-group-DM8n0XPS.js +2 -0
  636. package/dist/radio-group-DM8n0XPS.js.map +1 -0
  637. package/dist/{react.esm-D5AipFQb.js → react.esm-BkhVXJ8s.js} +2 -2
  638. package/dist/{react.esm-D5AipFQb.js.map → react.esm-BkhVXJ8s.js.map} +1 -1
  639. package/dist/resizable-DMQG3xF_.d.ts +14 -0
  640. package/dist/resizable-Dbg7r7nF.js +2 -0
  641. package/dist/resizable-Dbg7r7nF.js.map +1 -0
  642. package/dist/ring-progress-65ccdTQQ.d.ts +17 -0
  643. package/dist/ring-progress-Bfqq_HHA.js +2 -0
  644. package/dist/ring-progress-Bfqq_HHA.js.map +1 -0
  645. package/dist/scroll-area-DFcj5q66.d.ts +11 -0
  646. package/dist/scroll-area-DKS4QPHg.js +2 -0
  647. package/dist/scroll-area-DKS4QPHg.js.map +1 -0
  648. package/dist/select-BoYp-Xyc.d.ts +29 -0
  649. package/dist/select-C3QYNv4t.js +2 -0
  650. package/dist/select-C3QYNv4t.js.map +1 -0
  651. package/dist/separator-BsRLiqWE.d.ts +9 -0
  652. package/dist/separator-CCMmbXL0.js +2 -0
  653. package/dist/separator-CCMmbXL0.js.map +1 -0
  654. package/dist/sidebar-B5bEgDy5.js +2 -0
  655. package/dist/sidebar-B5bEgDy5.js.map +1 -0
  656. package/dist/sidebar-D7HQlj5O.d.ts +96 -0
  657. package/dist/simple-grid-9EryoUWI.js +2 -0
  658. package/dist/simple-grid-9EryoUWI.js.map +1 -0
  659. package/dist/simple-grid-B2zjpwZ3.d.ts +14 -0
  660. package/dist/skeleton-Cn3zBJRe.js +2 -0
  661. package/dist/skeleton-Cn3zBJRe.js.map +1 -0
  662. package/dist/skeleton-Co8pevj-.d.ts +10 -0
  663. package/dist/skills/uselets-ui/references/component-catalog.md +3 -0
  664. package/dist/slider-CC-gQawq.js +2 -0
  665. package/dist/slider-CC-gQawq.js.map +1 -0
  666. package/dist/slider-DmZ1YfLg.d.ts +9 -0
  667. package/dist/sonner-Binx8JJ2.d.ts +8 -0
  668. package/dist/sonner-DrKqhTDI.js +2 -0
  669. package/dist/sonner-DrKqhTDI.js.map +1 -0
  670. package/dist/spinner-Dz63Ltq-.d.ts +12 -0
  671. package/dist/spinner-ntLrcDLN.js +2 -0
  672. package/dist/spinner-ntLrcDLN.js.map +1 -0
  673. package/dist/stack-BbLllsqk.js +2 -0
  674. package/dist/stack-BbLllsqk.js.map +1 -0
  675. package/dist/stack-WiND8Dxq.d.ts +14 -0
  676. package/dist/stepper-BQ-59_UO.js +2 -0
  677. package/dist/stepper-BQ-59_UO.js.map +1 -0
  678. package/dist/stepper-DK5_o7RG.d.ts +71 -0
  679. package/dist/styles/max.css +11 -11
  680. package/dist/switch-DjdOGECT.js +2 -0
  681. package/dist/switch-DjdOGECT.js.map +1 -0
  682. package/dist/switch-OtBakZHc.d.ts +17 -0
  683. package/dist/table-CuE0Aenj.js +2 -0
  684. package/dist/table-CuE0Aenj.js.map +1 -0
  685. package/dist/table-qIAtG7Y5.d.ts +33 -0
  686. package/dist/tabs-BgWxTTah.d.ts +21 -0
  687. package/dist/tabs-DK9-RHkP.js +2 -0
  688. package/dist/tabs-DK9-RHkP.js.map +1 -0
  689. package/dist/text-CKFZ9Xsj.d.ts +14 -0
  690. package/dist/text-Kg1xuinT.js +2 -0
  691. package/dist/text-Kg1xuinT.js.map +1 -0
  692. package/dist/textarea-C8zrf9Rz.js +2 -0
  693. package/dist/textarea-C8zrf9Rz.js.map +1 -0
  694. package/dist/textarea-Cr9_P-bV.d.ts +8 -0
  695. package/dist/theme-BwEhfTyl.d.ts +22 -0
  696. package/dist/theme-DZJ_cJYp.js +2 -0
  697. package/dist/theme-DZJ_cJYp.js.map +1 -0
  698. package/dist/timeline-BDY3YzeJ.d.ts +61 -0
  699. package/dist/timeline-pBm0t1tb.js +2 -0
  700. package/dist/timeline-pBm0t1tb.js.map +1 -0
  701. package/dist/toggle-DJJkcqDy.js +2 -0
  702. package/dist/toggle-DJJkcqDy.js.map +1 -0
  703. package/dist/toggle-group-C3iNDYqI.d.ts +16 -0
  704. package/dist/toggle-group-D0OIpZN-.js +2 -0
  705. package/dist/toggle-group-D0OIpZN-.js.map +1 -0
  706. package/dist/toggle-jc8s_Z3T.d.ts +15 -0
  707. package/dist/tooltip-BZjnEqw5.d.ts +21 -0
  708. package/dist/tooltip-CNUNWZvs.js +2 -0
  709. package/dist/tooltip-CNUNWZvs.js.map +1 -0
  710. package/dist/unstyled-button-C-Zs4Qv2.d.ts +10 -0
  711. package/dist/unstyled-button-lGbDJA55.js +2 -0
  712. package/dist/unstyled-button-lGbDJA55.js.map +1 -0
  713. package/dist/use-breakpoint-D6YACz8C.js +2 -0
  714. package/dist/use-breakpoint-D6YACz8C.js.map +1 -0
  715. package/dist/use-breakpoint-DDuQFekj.d.ts +8 -0
  716. package/dist/use-breakpoint-value-BDjKflDX.js +2 -0
  717. package/dist/use-breakpoint-value-BDjKflDX.js.map +1 -0
  718. package/dist/use-breakpoint-value-CRbHqGAu.d.ts +8 -0
  719. package/dist/use-disclosure-CNaFpYFQ.d.ts +22 -0
  720. package/dist/use-disclosure-Cr405eRD.js +2 -0
  721. package/dist/use-disclosure-Cr405eRD.js.map +1 -0
  722. package/dist/use-document-visibility-CoWjCswu.js +2 -0
  723. package/dist/use-document-visibility-CoWjCswu.js.map +1 -0
  724. package/dist/use-document-visibility-DIzUN4tB.d.ts +6 -0
  725. package/dist/use-idle-Bsi10VE9.d.ts +13 -0
  726. package/dist/use-idle-DgheJlxd.js +2 -0
  727. package/dist/use-idle-DgheJlxd.js.map +1 -0
  728. package/dist/use-interval-B1aNo3tA.js +2 -0
  729. package/dist/use-interval-B1aNo3tA.js.map +1 -0
  730. package/dist/use-interval-CJVmE_lC.d.ts +24 -0
  731. package/dist/use-local-storage-CJBqB1GC.js +2 -0
  732. package/dist/use-local-storage-CJBqB1GC.js.map +1 -0
  733. package/dist/use-local-storage-Cmq4PWJc.d.ts +16 -0
  734. package/dist/use-mask-DBvFShXA.js +2 -0
  735. package/dist/use-mask-DBvFShXA.js.map +1 -0
  736. package/dist/use-mask-DRJVVcdh.d.ts +8 -0
  737. package/dist/use-mobile-BYwiljVq.d.ts +6 -0
  738. package/dist/use-mobile-OMmp56u2.js +2 -0
  739. package/dist/use-mobile-OMmp56u2.js.map +1 -0
  740. package/dist/utils-DGsdoA5l.d.ts +8 -0
  741. package/dist/utils-DP9KtG7I.js +2 -0
  742. package/dist/utils-DP9KtG7I.js.map +1 -0
  743. package/dist/visibility-_3zV3l-A.d.ts +17 -0
  744. package/dist/visibility-twHwe9Xp.js +2 -0
  745. package/dist/visibility-twHwe9Xp.js.map +1 -0
  746. package/package.json +10 -8
  747. package/skills/uselets-ui/references/component-catalog.md +3 -0
  748. package/dist/components/accordion.js.map +0 -1
  749. package/dist/components/alert-dialog.js.map +0 -1
  750. package/dist/components/alert.js.map +0 -1
  751. package/dist/components/anchor.js.map +0 -1
  752. package/dist/components/area-chart.js.map +0 -1
  753. package/dist/components/avatar.js.map +0 -1
  754. package/dist/components/badge.js.map +0 -1
  755. package/dist/components/bar-chart.js.map +0 -1
  756. package/dist/components/breadcrumb.js.map +0 -1
  757. package/dist/components/button-group.js.map +0 -1
  758. package/dist/components/button.js.map +0 -1
  759. package/dist/components/calendar.js.map +0 -1
  760. package/dist/components/card.js.map +0 -1
  761. package/dist/components/carousel.js.map +0 -1
  762. package/dist/components/center.js.map +0 -1
  763. package/dist/components/chart.js.map +0 -1
  764. package/dist/components/checkbox.js.map +0 -1
  765. package/dist/components/code.js.map +0 -1
  766. package/dist/components/collapsible.js.map +0 -1
  767. package/dist/components/combobox.js.map +0 -1
  768. package/dist/components/command.js.map +0 -1
  769. package/dist/components/container.js.map +0 -1
  770. package/dist/components/data-table.js.map +0 -1
  771. package/dist/components/date-range-picker.js.map +0 -1
  772. package/dist/components/dialog.js.map +0 -1
  773. package/dist/components/donut-chart.js.map +0 -1
  774. package/dist/components/drawer.js.map +0 -1
  775. package/dist/components/dropdown-menu.js.map +0 -1
  776. package/dist/components/dropzone.js.map +0 -1
  777. package/dist/components/empty.js.map +0 -1
  778. package/dist/components/field.js.map +0 -1
  779. package/dist/components/flex.js.map +0 -1
  780. package/dist/components/grid.js.map +0 -1
  781. package/dist/components/group.js.map +0 -1
  782. package/dist/components/heading.js.map +0 -1
  783. package/dist/components/hover-card.js.map +0 -1
  784. package/dist/components/input-group.js.map +0 -1
  785. package/dist/components/input-otp.js.map +0 -1
  786. package/dist/components/input.js.map +0 -1
  787. package/dist/components/kbd.js.map +0 -1
  788. package/dist/components/label.js.map +0 -1
  789. package/dist/components/list.js.map +0 -1
  790. package/dist/components/marker.js.map +0 -1
  791. package/dist/components/mask-input.js.map +0 -1
  792. package/dist/components/native-select.js.map +0 -1
  793. package/dist/components/navigation-menu.js.map +0 -1
  794. package/dist/components/number-field.js.map +0 -1
  795. package/dist/components/pagination.js.map +0 -1
  796. package/dist/components/phone-input.js.map +0 -1
  797. package/dist/components/pie-chart.js.map +0 -1
  798. package/dist/components/popover.js.map +0 -1
  799. package/dist/components/progress.js.map +0 -1
  800. package/dist/components/radio-group.js.map +0 -1
  801. package/dist/components/resizable.js.map +0 -1
  802. package/dist/components/ring-progress.js.map +0 -1
  803. package/dist/components/scroll-area.js.map +0 -1
  804. package/dist/components/select.js.map +0 -1
  805. package/dist/components/separator.js.map +0 -1
  806. package/dist/components/sidebar.js.map +0 -1
  807. package/dist/components/simple-grid.js.map +0 -1
  808. package/dist/components/skeleton.js.map +0 -1
  809. package/dist/components/slider.js.map +0 -1
  810. package/dist/components/sonner.js.map +0 -1
  811. package/dist/components/spinner.js.map +0 -1
  812. package/dist/components/stack.js.map +0 -1
  813. package/dist/components/stepper.js.map +0 -1
  814. package/dist/components/switch.js.map +0 -1
  815. package/dist/components/table.js.map +0 -1
  816. package/dist/components/tabs.js.map +0 -1
  817. package/dist/components/text.js.map +0 -1
  818. package/dist/components/textarea.js.map +0 -1
  819. package/dist/components/theme.js.map +0 -1
  820. package/dist/components/timeline.js.map +0 -1
  821. package/dist/components/toggle-group.js.map +0 -1
  822. package/dist/components/toggle.js.map +0 -1
  823. package/dist/components/tooltip.js.map +0 -1
  824. package/dist/components/unstyled-button.js.map +0 -1
  825. package/dist/components/visibility.js.map +0 -1
  826. package/dist/hooks/use-breakpoint-value.js.map +0 -1
  827. package/dist/hooks/use-breakpoint.js.map +0 -1
  828. package/dist/hooks/use-disclosure.js.map +0 -1
  829. package/dist/hooks/use-document-visibility.js.map +0 -1
  830. package/dist/hooks/use-idle.js.map +0 -1
  831. package/dist/hooks/use-interval.js.map +0 -1
  832. package/dist/hooks/use-local-storage.js.map +0 -1
  833. package/dist/hooks/use-mask.js.map +0 -1
  834. package/dist/hooks/use-mobile.js.map +0 -1
  835. package/dist/lib/badge.js.map +0 -1
  836. package/dist/lib/button.js.map +0 -1
  837. package/dist/lib/color.js.map +0 -1
  838. package/dist/lib/compose-refs.js.map +0 -1
  839. package/dist/lib/progress.js.map +0 -1
  840. package/dist/lib/utils.js.map +0 -1
  841. package/dist/magic-string.es-oADFB1hu.js +0 -15
  842. package/dist/magic-string.es-oADFB1hu.js.map +0 -1
  843. package/dist/utils-Cj3IZeiu.js +0 -37
  844. package/dist/utils-Cj3IZeiu.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"donut-chart.spec.js","names":[],"sources":["../../src/components/donut-chart.spec.tsx"],"sourcesContent":["import { render, screen } from '@testing-library/react'\n\nimport { DonutChart } from './donut-chart'\nimport type { PieChartDatum } from './pie-chart'\n\nbeforeAll(() => {\n vi.stubGlobal(\n 'ResizeObserver',\n class {\n observe() {}\n unobserve() {}\n disconnect() {}\n }\n )\n Object.defineProperty(HTMLElement.prototype, 'offsetWidth', { configurable: true, value: 500 })\n Object.defineProperty(HTMLElement.prototype, 'offsetHeight', { configurable: true, value: 300 })\n // jsdom's getBoundingClientRect always returns zeros, which leaves recharts' ResponsiveContainer\n // stuck reporting a non-positive size and refusing to render its children (the actual chart SVG).\n // Stubbing it to match offsetWidth/offsetHeight above lets the real recharts markup mount.\n HTMLElement.prototype.getBoundingClientRect = () =>\n ({\n width: 500,\n height: 300,\n top: 0,\n left: 0,\n right: 500,\n bottom: 300,\n x: 0,\n y: 0,\n toJSON() {}\n }) as DOMRect\n})\n\nconst data: PieChartDatum[] = [\n { name: 'chrome', value: 275 },\n { name: 'safari', value: 200 },\n { name: 'firefox', value: 187 }\n]\n\n// The rendered <path class=\"recharts-sector\"> draws its outer and (when present) inner arc as\n// two \"A radius,radius,...\" commands in its `d` attribute, in that order. Reading them back out\n// lets us verify DonutChart's thickness -> innerRadius math against what recharts actually drew,\n// instead of duplicating (and risking drifting from) the component's own calculation.\nfunction sectorArcRadii(container: HTMLElement) {\n const d = container.querySelector('.recharts-sector')?.getAttribute('d') ?? ''\n return [...d.matchAll(/A\\s*([\\d.]+),/g)].map((match) => Number(match[1]))\n}\n\ndescribe('DonutChart', () => {\n it('renders with data-slot=\"donut-chart\" on the chart wrapper', () => {\n const { container } = render(<DonutChart data={data} />)\n\n expect(container.querySelector('[data-slot=\"donut-chart\"]')).not.toBeNull()\n })\n\n it('accepts a data array without throwing', () => {\n expect(() => render(<DonutChart data={data} />)).not.toThrow()\n })\n\n it('renders one recharts pie sector per data entry', () => {\n const { container } = render(<DonutChart data={data} />)\n\n expect(container.querySelectorAll('.recharts-pie-sector').length).toBe(data.length)\n })\n\n it('carves out a hollow inner radius using the default thickness of 0.35', () => {\n // animationDuration=0 disables the entrance animation so recharts paints the sector's full\n // <path> geometry on the very first (synchronous) render instead of an empty starting frame.\n const { container } = render(<DonutChart data={data} outerRadius={100} animationDuration={0} />)\n\n const [outerRadius, innerRadius] = sectorArcRadii(container) as [number, number]\n expect(outerRadius).toBe(100)\n expect(innerRadius).toBeCloseTo(65)\n })\n\n it.each([\n { thickness: 0, expectedRatio: 1 },\n { thickness: 0.5, expectedRatio: 0.5 },\n { thickness: 0.9, expectedRatio: 0.1 }\n ])(\n 'derives innerRadius from a numeric outerRadius as outerRadius * (1 - thickness) (thickness=$thickness)',\n ({ thickness, expectedRatio }) => {\n const { container } = render(\n <DonutChart data={data} outerRadius={100} thickness={thickness} animationDuration={0} />\n )\n\n const [outerRadius, innerRadius] = sectorArcRadii(container) as [number, number]\n expect(outerRadius).toBe(100)\n expect(innerRadius).toBeCloseTo(100 * expectedRatio)\n }\n )\n\n it('clamps a thickness below 0 to a ratio of 1 (fully hollow up to the outer radius)', () => {\n const { container } = render(<DonutChart data={data} outerRadius={100} thickness={-1} animationDuration={0} />)\n\n const [outerRadius, innerRadius] = sectorArcRadii(container) as [number, number]\n expect(outerRadius).toBe(100)\n expect(innerRadius).toBeCloseTo(100)\n })\n\n it.each([1, 2])(\n 'clamps a thickness of %d or more to a ratio of 0, collapsing the inner radius to a single arc',\n (thickness) => {\n const { container } = render(\n <DonutChart data={data} outerRadius={100} thickness={thickness} animationDuration={0} />\n )\n\n // A ring with innerRadius 0 is a plain pie slice: only the outer arc is drawn.\n expect(sectorArcRadii(container)).toHaveLength(1)\n }\n )\n\n it('derives a proportional innerRadius when outerRadius is a percentage string', () => {\n const { container } = render(<DonutChart data={data} outerRadius=\"50%\" thickness={0.5} animationDuration={0} />)\n\n const [outerRadius, innerRadius] = sectorArcRadii(container) as [number, number]\n expect(innerRadius / outerRadius).toBeCloseTo(0.5)\n })\n\n it('falls back to the raw outerRadius value when it does not match the percentage pattern', () => {\n expect(() => render(<DonutChart data={data} outerRadius=\"fill\" animationDuration={0} />)).not.toThrow()\n })\n\n it('renders a tooltip wrapper by default and omits it when withTooltip is false', () => {\n const { container: withTooltip } = render(<DonutChart data={data} />)\n expect(withTooltip.querySelectorAll('.recharts-tooltip-wrapper').length).toBe(1)\n\n const { container: withoutTooltip } = render(<DonutChart data={data} withTooltip={false} />)\n expect(withoutTooltip.querySelectorAll('.recharts-tooltip-wrapper').length).toBe(0)\n })\n\n it('omits the legend by default and renders it when withLegend is true', async () => {\n const { container: withoutLegend } = render(<DonutChart data={data} />)\n expect(withoutLegend.querySelectorAll('.recharts-legend-wrapper').length).toBe(0)\n\n const { container: withLegend } = render(<DonutChart data={data} withLegend />)\n expect(withLegend.querySelectorAll('.recharts-legend-wrapper').length).toBe(1)\n // Recharts registers a pie's legend payload through an internal store update that lands\n // a render pass after the initial mount, so the item labels need an async query to appear.\n expect((await screen.findAllByText('chrome')).length).toBeGreaterThan(0)\n })\n\n it('omits slice labels by default and renders them when withLabels is true', () => {\n // See the animationDuration note above: labels are also withheld while a pie is animating in.\n const { container: withoutLabels } = render(<DonutChart data={data} animationDuration={0} />)\n expect(withoutLabels.querySelectorAll('.recharts-pie-label-text').length).toBe(0)\n\n const { container: withLabels } = render(<DonutChart data={data} withLabels animationDuration={0} />)\n expect(withLabels.querySelectorAll('.recharts-pie-label-text').length).toBe(data.length)\n })\n\n it('does not throw when withTotal and a custom totalLabel are enabled', () => {\n expect(() => render(<DonutChart data={data} withTotal totalLabel=\"Sum\" />)).not.toThrow()\n })\n})\n"],"mappings":"mLAKA,cAAgB,CACd,GAAG,WACD,iBACA,KAAM,CACJ,SAAU,CAAC,CACX,WAAY,CAAC,CACb,YAAa,CAAC,CAChB,CACF,EACA,OAAO,eAAe,YAAY,UAAW,cAAe,CAAE,aAAc,GAAM,MAAO,GAAI,CAAC,EAC9F,OAAO,eAAe,YAAY,UAAW,eAAgB,CAAE,aAAc,GAAM,MAAO,GAAI,CAAC,EAI/F,YAAY,UAAU,2BACnB,CACC,MAAO,IACP,OAAQ,IACR,IAAK,EACL,KAAM,EACN,MAAO,IACP,OAAQ,IACR,EAAG,EACH,EAAG,EACH,QAAS,CAAC,CACZ,EACJ,CAAC,EAED,MAAM,EAAwB,CAC5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bS2b.js";
2
- import { Dialog } from "radix-ui";
3
- import { VariantProps } from "class-variance-authority";
4
- import * as React from "react";
5
- //#region src/components/drawer.d.ts
6
- declare const drawerContentVariants: (props?: ({
7
- direction?: "bottom" | "left" | "right" | "top" | null | undefined;
8
- size?: "2xl" | "3xl" | "full" | "lg" | "md" | "sm" | "xl" | null | undefined;
9
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
- type DrawerDirection = NonNullable<VariantProps<typeof drawerContentVariants>['direction']>;
11
- type DrawerSize = NonNullable<VariantProps<typeof drawerContentVariants>['size']>;
12
- type DrawerProps = React.ComponentProps<typeof Dialog.Root> & {
13
- size?: DrawerSize;
14
- direction?: DrawerDirection;
15
- dismissible?: boolean;
16
- };
17
- type DrawerTriggerProps = React.ComponentProps<typeof Dialog.Trigger>;
18
- type DrawerPortalProps = React.ComponentProps<typeof Dialog.Portal>;
19
- type DrawerCloseProps = React.ComponentProps<typeof Dialog.Close>;
20
- type DrawerOverlayProps = React.ComponentProps<typeof Dialog.Overlay>;
21
- type DrawerContentProps = React.ComponentProps<typeof Dialog.Content> & {
22
- showCloseButton?: boolean;
23
- overlayProps?: DrawerOverlayProps;
24
- };
25
- type DrawerHeaderProps = React.ComponentProps<'div'>;
26
- type DrawerBodyProps = React.ComponentProps<'div'>;
27
- type DrawerFooterProps = React.ComponentProps<'div'>;
28
- type DrawerTitleProps = React.ComponentProps<typeof Dialog.Title>;
29
- type DrawerDescriptionProps = React.ComponentProps<typeof Dialog.Description>;
30
- declare function Drawer({ size, direction, dismissible, ...props }: DrawerProps): React.JSX.Element;
31
- declare function DrawerTrigger({ ...props }: DrawerTriggerProps): React.JSX.Element;
32
- declare function DrawerPortal({ ...props }: DrawerPortalProps): React.JSX.Element;
33
- declare function DrawerClose({ ...props }: DrawerCloseProps): React.JSX.Element;
34
- declare function DrawerOverlay({ className, ...props }: DrawerOverlayProps): React.JSX.Element;
35
- declare function DrawerContent({ className, children, showCloseButton, overlayProps, ...props }: DrawerContentProps): React.JSX.Element;
36
- declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element;
37
- declare function DrawerBody({ className, ...props }: DrawerBodyProps): React.JSX.Element;
38
- declare function DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element;
39
- declare function DrawerTitle({ className, ...props }: DrawerTitleProps): React.JSX.Element;
40
- declare function DrawerDescription({ className, ...props }: DrawerDescriptionProps): React.JSX.Element;
41
- //#endregion
42
- export { Drawer, DrawerBody, DrawerBodyProps, DrawerClose, DrawerCloseProps, DrawerContent, DrawerContentProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerOverlay, DrawerOverlayProps, DrawerPortal, DrawerPortalProps, DrawerProps, DrawerTitle, DrawerTitleProps, DrawerTrigger, DrawerTriggerProps };
43
- //# sourceMappingURL=drawer.d.ts.map
1
+ import { S as DrawerTriggerProps, _ as DrawerPortalProps, a as DrawerCloseProps, b as DrawerTitleProps, c as DrawerDescription, d as DrawerFooterProps, f as DrawerHeader, g as DrawerPortal, h as DrawerOverlayProps, i as DrawerClose, l as DrawerDescriptionProps, m as DrawerOverlay, n as DrawerBody, o as DrawerContent, p as DrawerHeaderProps, r as DrawerBodyProps, s as DrawerContentProps, t as Drawer, u as DrawerFooter, v as DrawerProps, x as DrawerTrigger, y as DrawerTitle } from "../drawer-DUfJzrKE.js";
2
+ export { Drawer, DrawerBody, DrawerBodyProps, DrawerClose, DrawerCloseProps, DrawerContent, DrawerContentProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerOverlay, DrawerOverlayProps, DrawerPortal, DrawerPortalProps, DrawerProps, DrawerTitle, DrawerTitleProps, DrawerTrigger, DrawerTriggerProps };
@@ -1,2 +1 @@
1
- import"../rolldown-runtime-Bdj-bS2b.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{IconX as n}from"@tabler/icons-react";import{Dialog as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";import*as s from"react";const c=o([`bg-background flex h-auto flex-col text-sm fixed z-50 outline-none duration-200`,`data-open:animate-in data-closed:animate-out`],{variants:{direction:{top:`inset-x-0 top-0 rounded-b-xl border-b data-closed:slide-out-to-top data-open:slide-in-from-top-10`,right:`inset-y-0 right-0 rounded-l-xl border-l data-closed:slide-out-to-right data-open:slide-in-from-right-10`,bottom:`inset-x-0 bottom-0 rounded-t-xl border-t data-closed:slide-out-to-bottom data-open:slide-in-from-bottom-10`,left:`inset-y-0 left-0 rounded-r-xl border-r data-closed:slide-out-to-left data-open:slide-in-from-left-10`},size:{sm:``,md:``,lg:``,xl:``,"2xl":``,"3xl":``,full:``}},compoundVariants:[{direction:[`left`,`right`],size:`sm`,className:`w-3/4 sm:max-w-sm`},{direction:[`left`,`right`],size:`md`,className:`w-4/5 sm:max-w-md`},{direction:[`left`,`right`],size:`lg`,className:`w-[90%] sm:max-w-lg`},{direction:[`left`,`right`],size:`xl`,className:`w-[90%] sm:max-w-195`},{direction:[`left`,`right`],size:`2xl`,className:`w-[90%] sm:max-w-240`},{direction:[`left`,`right`],size:`3xl`,className:`w-[90%] sm:max-w-300`},{direction:[`left`,`right`],size:`full`,className:`w-full`},{direction:`top`,size:`sm`,className:`mb-24 h-full max-h-96`},{direction:`top`,size:`md`,className:`mb-20 h-full max-h-112`},{direction:`top`,size:`lg`,className:`mb-12 h-full max-h-128`},{direction:`top`,size:`xl`,className:`mb-12 h-full max-h-195`},{direction:`top`,size:`2xl`,className:`mb-12 h-full max-h-240`},{direction:`top`,size:`3xl`,className:`mb-12 h-full max-h-300`},{direction:`top`,size:`full`,className:`mb-0 h-full`},{direction:`bottom`,size:`sm`,className:`mt-24 h-full max-h-96`},{direction:`bottom`,size:`md`,className:`mt-20 h-full max-h-112`},{direction:`bottom`,size:`lg`,className:`mt-12 h-full max-h-128`},{direction:`bottom`,size:`xl`,className:`mt-12 h-full max-h-195`},{direction:`bottom`,size:`2xl`,className:`mt-12 h-full max-h-240`},{direction:`bottom`,size:`3xl`,className:`mt-12 h-full max-h-300`},{direction:`bottom`,size:`full`,className:`mt-0 h-full`}],defaultVariants:{direction:`right`,size:`md`}}),l=s.createContext({size:`md`,direction:`right`,dismissible:!0});function Drawer({size:e=`md`,direction:t=`right`,dismissible:n=!0,...a}){let o=s.useMemo(()=>({size:e,direction:t,dismissible:n}),[e,t,n]);return i(l.Provider,{value:o,children:i(r.Root,{"data-slot":`drawer`,...a})})}function DrawerTrigger({...e}){return i(r.Trigger,{"data-slot":`drawer-trigger`,...e})}function DrawerPortal({...e}){return i(r.Portal,{"data-slot":`drawer-portal`,...e})}function DrawerClose({...e}){return i(r.Close,{"data-slot":`drawer-close`,...e})}function DrawerOverlay({className:t,...n}){return i(r.Overlay,{"data-slot":`drawer-overlay`,className:e(`bg-black/10 fixed inset-0 z-50`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0`,`supports-backdrop-filter:backdrop-blur-xs`,t),...n})}function DrawerContent({className:o,children:u,showCloseButton:d=!0,overlayProps:f,...p}){let{size:m,direction:h,dismissible:g}=s.useContext(l);return a(DrawerPortal,{children:[i(DrawerOverlay,{...f}),a(r.Content,{"data-slot":`drawer-content`,className:e(c({size:m,direction:h}),o),...p,onEscapeKeyDown:e=>{g||e.preventDefault(),p.onEscapeKeyDown?.(e)},onInteractOutside:e=>{g||e.preventDefault(),p.onInteractOutside?.(e)},children:[u,d&&i(DrawerClose,{asChild:!0,children:a(t,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[i(n,{}),i(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function DrawerHeader({className:t,...n}){let{direction:r}=s.useContext(l);return i(`div`,{"data-slot":`drawer-header`,className:e(`p-4 flex flex-col gap-0.5 md:gap-0.5`,(r===`top`||r===`bottom`)&&`text-center md:text-left`,t),...n})}function DrawerBody({className:t,...n}){return i(`div`,{"data-slot":`drawer-body`,className:e(`px-4 pb-4 flex-1 min-h-0 overflow-y-auto`,t),...n})}function DrawerFooter({className:t,...n}){return i(`div`,{"data-slot":`drawer-footer`,className:e(`gap-2 p-4 mt-auto flex flex-col sm:flex-row sm:justify-end`,t),...n})}function DrawerTitle({className:t,...n}){return i(r.Title,{"data-slot":`drawer-title`,className:e(`text-foreground text-base font-medium`,t),...n})}function DrawerDescription({className:t,...n}){return i(r.Description,{"data-slot":`drawer-description`,className:e(`text-muted-foreground text-sm`,t),...n})}export{Drawer,DrawerBody,DrawerClose,DrawerContent,DrawerDescription,DrawerFooter,DrawerHeader,DrawerOverlay,DrawerPortal,DrawerTitle,DrawerTrigger};
2
- //# sourceMappingURL=drawer.js.map
1
+ import{a as e,c as t,d as n,i as r,l as i,n as a,o,r as s,s as c,t as l,u}from"../drawer-BO4mP6y1.js";export{l as Drawer,a as DrawerBody,s as DrawerClose,r as DrawerContent,e as DrawerDescription,o as DrawerFooter,c as DrawerHeader,t as DrawerOverlay,i as DrawerPortal,u as DrawerTitle,n as DrawerTrigger};
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,2 @@
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{a as e,d as t,i as n,n as r,o as i,r as a,s as o,t as s,u as c}from"../drawer-BO4mP6y1.js";import{a as l,n as u,o as d,r as f}from"../react.esm-BkhVXJ8s.js";import{jsx as p,jsxs as m}from"react/jsx-runtime";function renderBasicDrawer(l={}){return f(m(s,{children:[p(t,{children:`Open drawer`}),m(n,{...l,children:[m(o,{children:[p(c,{children:`Settings`}),p(e,{children:`Manage your preferences`})]}),p(r,{children:`Body content`}),p(i,{children:p(a,{children:`Cancel`})})]})]}))}describe(`Drawer`,()=>{it(`is closed until the trigger is activated, then opens the dialog`,async()=>{renderBasicDrawer(),expect(l.queryByRole(`dialog`)).toBeNull(),u.click(l.getByText(`Open drawer`));let e=await l.findByRole(`dialog`);expect(e.getAttribute(`data-slot`)).toBe(`drawer-content`)}),it(`closes when the built-in close button is clicked`,async()=>{renderBasicDrawer(),u.click(l.getByText(`Open drawer`)),await l.findByRole(`dialog`),u.click(l.getByRole(`button`,{name:`Close`})),await d(()=>expect(l.queryByRole(`dialog`)).toBeNull())}),it(`hides the close button when showCloseButton is false`,async()=>{renderBasicDrawer({showCloseButton:!1}),u.click(l.getByText(`Open drawer`)),await l.findByRole(`dialog`),expect(l.queryByRole(`button`,{name:`Close`})).toBeNull()}),it(`renders the title and description with their data-slot and default classes`,async()=>{renderBasicDrawer(),u.click(l.getByText(`Open drawer`));let e=await l.findByText(`Settings`),t=l.getByText(`Manage your preferences`);expect(e.getAttribute(`data-slot`)).toBe(`drawer-title`),expect(e.className).toContain(`text-base`),expect(t.getAttribute(`data-slot`)).toBe(`drawer-description`),expect(t.className).toContain(`text-muted-foreground`)}),it(`renders the body and footer with their data-slot`,async()=>{renderBasicDrawer(),u.click(l.getByText(`Open drawer`));let e=await l.findByText(`Body content`);expect(e.getAttribute(`data-slot`)).toBe(`drawer-body`),expect(l.getByText(`Cancel`).closest(`[data-slot="drawer-footer"]`)).not.toBeNull()}),it(`applies the default right/md direction and size classes to the content`,async()=>{renderBasicDrawer(),u.click(l.getByText(`Open drawer`));let e=await l.findByRole(`dialog`);expect(e.className).toContain(`inset-y-0`),expect(e.className).toContain(`right-0`),expect(e.className).toContain(`w-4/5`),expect(e.className).toContain(`sm:max-w-md`)}),it(`applies compound variant classes for a non-default direction and size`,async()=>{f(m(s,{direction:`top`,size:`lg`,children:[p(t,{children:`Open`}),p(n,{children:p(c,{children:`Top drawer`})})]})),u.click(l.getByText(`Open`));let e=await l.findByRole(`dialog`);expect(e.className).toContain(`inset-x-0`),expect(e.className).toContain(`top-0`),expect(e.className).toContain(`mb-12`),expect(e.className).toContain(`max-h-128`)}),it(`applies text-center classes to the header for horizontal (top/bottom) directions`,async()=>{f(m(s,{direction:`bottom`,children:[p(t,{children:`Open`}),p(n,{children:p(o,{children:`Header content`})})]})),u.click(l.getByText(`Open`));let e=await l.findByText(`Header content`);expect(e.getAttribute(`data-slot`)).toBe(`drawer-header`),expect(e.className).toContain(`text-center`)}),it(`does not apply text-center classes to the header for left/right directions`,async()=>{renderBasicDrawer(),u.click(l.getByText(`Open drawer`));let e=(await l.findByText(`Settings`)).closest(`[data-slot="drawer-header"]`);expect(e.className).not.toContain(`text-center`)}),it(`renders the overlay with its data-slot and forwards overlayProps`,async()=>{let{container:e}=renderBasicDrawer({overlayProps:{"data-testid":`custom-overlay`}});u.click(l.getByText(`Open drawer`)),await l.findByRole(`dialog`);let t=e.ownerDocument.querySelector(`[data-slot="drawer-overlay"]`);expect(t).not.toBeNull(),expect(t?.className).toContain(`fixed`),expect(l.getByTestId(`custom-overlay`)).toBe(t)}),it(`closes on Escape when dismissible (the default)`,async()=>{f(m(s,{children:[p(t,{children:`Open`}),p(n,{children:p(c,{children:`Dismissible`})})]})),u.click(l.getByText(`Open`));let e=await l.findByRole(`dialog`);u.keyDown(e,{key:`Escape`,code:`Escape`}),await d(()=>expect(l.queryByRole(`dialog`)).toBeNull())}),it(`ignores Escape when dismissible is false`,async()=>{f(m(s,{dismissible:!1,children:[p(t,{children:`Open`}),p(n,{children:p(c,{children:`Non dismissible`})})]})),u.click(l.getByText(`Open`));let e=await l.findByRole(`dialog`);u.keyDown(e,{key:`Escape`,code:`Escape`}),expect(l.getByRole(`dialog`)).not.toBeNull()})});
2
+ //# sourceMappingURL=drawer.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawer.spec.js","names":["waitFor"],"sources":["../../src/components/drawer.spec.tsx"],"sourcesContent":["import { fireEvent, render, screen, waitFor } from '@testing-library/react'\n\nimport {\n Drawer,\n DrawerBody,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerTitle,\n DrawerTrigger\n} from './drawer'\n\nfunction renderBasicDrawer(contentProps: Partial<React.ComponentProps<typeof DrawerContent>> = {}) {\n return render(\n <Drawer>\n <DrawerTrigger>Open drawer</DrawerTrigger>\n <DrawerContent {...contentProps}>\n <DrawerHeader>\n <DrawerTitle>Settings</DrawerTitle>\n <DrawerDescription>Manage your preferences</DrawerDescription>\n </DrawerHeader>\n <DrawerBody>Body content</DrawerBody>\n <DrawerFooter>\n <DrawerClose>Cancel</DrawerClose>\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n )\n}\n\ndescribe('Drawer', () => {\n it('is closed until the trigger is activated, then opens the dialog', async () => {\n renderBasicDrawer()\n\n expect(screen.queryByRole('dialog')).toBeNull()\n\n fireEvent.click(screen.getByText('Open drawer'))\n\n const dialog = await screen.findByRole('dialog')\n expect(dialog.getAttribute('data-slot')).toBe('drawer-content')\n })\n\n it('closes when the built-in close button is clicked', async () => {\n renderBasicDrawer()\n fireEvent.click(screen.getByText('Open drawer'))\n await screen.findByRole('dialog')\n\n fireEvent.click(screen.getByRole('button', { name: 'Close' }))\n\n await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull())\n })\n\n it('hides the close button when showCloseButton is false', async () => {\n renderBasicDrawer({ showCloseButton: false })\n fireEvent.click(screen.getByText('Open drawer'))\n\n await screen.findByRole('dialog')\n expect(screen.queryByRole('button', { name: 'Close' })).toBeNull()\n })\n\n it('renders the title and description with their data-slot and default classes', async () => {\n renderBasicDrawer()\n fireEvent.click(screen.getByText('Open drawer'))\n\n const title = await screen.findByText('Settings')\n const description = screen.getByText('Manage your preferences')\n\n expect(title.getAttribute('data-slot')).toBe('drawer-title')\n expect(title.className).toContain('text-base')\n expect(description.getAttribute('data-slot')).toBe('drawer-description')\n expect(description.className).toContain('text-muted-foreground')\n })\n\n it('renders the body and footer with their data-slot', async () => {\n renderBasicDrawer()\n fireEvent.click(screen.getByText('Open drawer'))\n\n const body = await screen.findByText('Body content')\n expect(body.getAttribute('data-slot')).toBe('drawer-body')\n expect(screen.getByText('Cancel').closest('[data-slot=\"drawer-footer\"]')).not.toBeNull()\n })\n\n it('applies the default right/md direction and size classes to the content', async () => {\n renderBasicDrawer()\n fireEvent.click(screen.getByText('Open drawer'))\n\n const dialog = await screen.findByRole('dialog')\n expect(dialog.className).toContain('inset-y-0')\n expect(dialog.className).toContain('right-0')\n expect(dialog.className).toContain('w-4/5')\n expect(dialog.className).toContain('sm:max-w-md')\n })\n\n it('applies compound variant classes for a non-default direction and size', async () => {\n render(\n <Drawer direction=\"top\" size=\"lg\">\n <DrawerTrigger>Open</DrawerTrigger>\n <DrawerContent>\n <DrawerTitle>Top drawer</DrawerTitle>\n </DrawerContent>\n </Drawer>\n )\n fireEvent.click(screen.getByText('Open'))\n\n const dialog = await screen.findByRole('dialog')\n expect(dialog.className).toContain('inset-x-0')\n expect(dialog.className).toContain('top-0')\n expect(dialog.className).toContain('mb-12')\n expect(dialog.className).toContain('max-h-128')\n })\n\n it('applies text-center classes to the header for horizontal (top/bottom) directions', async () => {\n render(\n <Drawer direction=\"bottom\">\n <DrawerTrigger>Open</DrawerTrigger>\n <DrawerContent>\n <DrawerHeader>Header content</DrawerHeader>\n </DrawerContent>\n </Drawer>\n )\n fireEvent.click(screen.getByText('Open'))\n\n const header = await screen.findByText('Header content')\n expect(header.getAttribute('data-slot')).toBe('drawer-header')\n expect(header.className).toContain('text-center')\n })\n\n it('does not apply text-center classes to the header for left/right directions', async () => {\n renderBasicDrawer()\n fireEvent.click(screen.getByText('Open drawer'))\n\n const title = await screen.findByText('Settings')\n const header = title.closest('[data-slot=\"drawer-header\"]') as HTMLElement\n expect(header.className).not.toContain('text-center')\n })\n\n it('renders the overlay with its data-slot and forwards overlayProps', async () => {\n const { container } = renderBasicDrawer({ overlayProps: { 'data-testid': 'custom-overlay' } as never })\n fireEvent.click(screen.getByText('Open drawer'))\n\n await screen.findByRole('dialog')\n const overlay = container.ownerDocument.querySelector('[data-slot=\"drawer-overlay\"]')\n expect(overlay).not.toBeNull()\n expect(overlay?.className).toContain('fixed')\n expect(screen.getByTestId('custom-overlay')).toBe(overlay)\n })\n\n it('closes on Escape when dismissible (the default)', async () => {\n render(\n <Drawer>\n <DrawerTrigger>Open</DrawerTrigger>\n <DrawerContent>\n <DrawerTitle>Dismissible</DrawerTitle>\n </DrawerContent>\n </Drawer>\n )\n fireEvent.click(screen.getByText('Open'))\n const dialog = await screen.findByRole('dialog')\n\n fireEvent.keyDown(dialog, { key: 'Escape', code: 'Escape' })\n\n await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull())\n })\n\n it('ignores Escape when dismissible is false', async () => {\n render(\n <Drawer dismissible={false}>\n <DrawerTrigger>Open</DrawerTrigger>\n <DrawerContent>\n <DrawerTitle>Non dismissible</DrawerTitle>\n </DrawerContent>\n </Drawer>\n )\n fireEvent.click(screen.getByText('Open'))\n const dialog = await screen.findByRole('dialog')\n\n fireEvent.keyDown(dialog, { key: 'Escape', code: 'Escape' })\n\n expect(screen.getByRole('dialog')).not.toBeNull()\n })\n})\n"],"mappings":"8PAcA,SAAS,kBAAkB,EAAoE,CAAC,EAAG,CACjG,OAAO,EACL,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAe,aAA0B,CAAA,EACzC,EAAC,EAAD,CAAe,GAAI,EAAnB,SAAA,CACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAa,UAAqB,CAAA,EAClC,EAAC,EAAD,CAAA,SAAmB,yBAA0C,CAAA,CACjD,CAAA,CAAA,EACd,EAAC,EAAD,CAAA,SAAY,cAAwB,CAAA,EACpC,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAA,SAAa,QAAmB,CAAA,CACpB,CAAA,CACD,CACT,CAAA,CAAA,CAAA,CAAA,CACV,CACF,CAEA,SAAS,aAAgB,CACvB,GAAG,kEAAmE,SAAY,CAChF,kBAAkB,EAElB,OAAO,EAAO,YAAY,QAAQ,CAAC,CAAC,CAAC,SAAS,EAE9C,EAAU,MAAM,EAAO,UAAU,aAAa,CAAC,EAE/C,IAAM,EAAS,MAAM,EAAO,WAAW,QAAQ,EAC/C,OAAO,EAAO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AClC,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAA,SAAa,iBAA4B,CAAA,CAC5B,CAAA,CACT,CACV,CAAA,CAAA,EACA,EAAU,MAAM,EAAO,UAAU,MAAM,CAAC,EACxC,IAAM,EAAS,MAAM,EAAO,WAAW,QAAQ,EAE/C,EAAU,QAAQ,EAAQ,CAAE,IAAK,SAAU,KAAM,QAAS,CAAC,EAE3D,OAAO,EAAO,UAAU,QAAQ,CAAC,CAAC,CAAC,IAAI,SAAS,CAClD,CAAC,CACH,CAAC"}
@@ -1,48 +1,2 @@
1
- import { n as __name } from "../rolldown-runtime-Bdj-bS2b.js";
2
- import { DropdownMenu as DropdownMenu$1 } from "radix-ui";
3
- import * as React from "react";
4
- //#region src/components/dropdown-menu.d.ts
5
- type DropdownMenuProps = React.ComponentProps<typeof DropdownMenu$1.Root>;
6
- type DropdownMenuPortalProps = React.ComponentProps<typeof DropdownMenu$1.Portal>;
7
- type DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenu$1.Trigger>;
8
- type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenu$1.Content>;
9
- type DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenu$1.Group>;
10
- type DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenu$1.Item> & {
11
- inset?: boolean;
12
- variant?: 'default' | 'destructive';
13
- };
14
- type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof DropdownMenu$1.CheckboxItem> & {
15
- inset?: boolean;
16
- };
17
- type DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenu$1.RadioGroup>;
18
- type DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenu$1.RadioItem> & {
19
- inset?: boolean;
20
- };
21
- type DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenu$1.Label> & {
22
- inset?: boolean;
23
- };
24
- type DropdownMenuSeparatorProps = React.ComponentProps<typeof DropdownMenu$1.Separator>;
25
- type DropdownMenuShortcutProps = React.ComponentProps<'span'>;
26
- type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenu$1.Sub>;
27
- type DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenu$1.SubTrigger> & {
28
- inset?: boolean;
29
- };
30
- type DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenu$1.SubContent>;
31
- declare function DropdownMenu({ ...props }: DropdownMenuProps): React.JSX.Element;
32
- declare function DropdownMenuPortal({ ...props }: DropdownMenuPortalProps): React.JSX.Element;
33
- declare function DropdownMenuTrigger({ ...props }: DropdownMenuTriggerProps): React.JSX.Element;
34
- declare function DropdownMenuContent({ className, align, sideOffset, ...props }: DropdownMenuContentProps): React.JSX.Element;
35
- declare function DropdownMenuGroup({ ...props }: DropdownMenuGroupProps): React.JSX.Element;
36
- declare function DropdownMenuItem({ className, inset, variant, ...props }: DropdownMenuItemProps): React.JSX.Element;
37
- declare function DropdownMenuCheckboxItem({ className, children, inset, ...props }: DropdownMenuCheckboxItemProps): React.JSX.Element;
38
- declare function DropdownMenuRadioGroup({ ...props }: DropdownMenuRadioGroupProps): React.JSX.Element;
39
- declare function DropdownMenuRadioItem({ className, children, inset, ...props }: DropdownMenuRadioItemProps): React.JSX.Element;
40
- declare function DropdownMenuLabel({ className, inset, ...props }: DropdownMenuLabelProps): React.JSX.Element;
41
- declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): React.JSX.Element;
42
- declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): React.JSX.Element;
43
- declare function DropdownMenuSub({ ...props }: DropdownMenuSubProps): React.JSX.Element;
44
- declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: DropdownMenuSubTriggerProps): React.JSX.Element;
45
- declare function DropdownMenuSubContent({ className, ...props }: DropdownMenuSubContentProps): React.JSX.Element;
46
- //#endregion
47
- export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps };
48
- //# sourceMappingURL=dropdown-menu.d.ts.map
1
+ import { A as DropdownMenuTriggerProps, C as DropdownMenuSub, D as DropdownMenuSubTrigger, E as DropdownMenuSubProps, O as DropdownMenuSubTriggerProps, S as DropdownMenuShortcutProps, T as DropdownMenuSubContentProps, _ as DropdownMenuRadioItem, a as DropdownMenuContentProps, b as DropdownMenuSeparatorProps, c as DropdownMenuItem, d as DropdownMenuLabelProps, f as DropdownMenuPortal, g as DropdownMenuRadioGroupProps, h as DropdownMenuRadioGroup, i as DropdownMenuContent, k as DropdownMenuTrigger, l as DropdownMenuItemProps, m as DropdownMenuProps, n as DropdownMenuCheckboxItem, o as DropdownMenuGroup, p as DropdownMenuPortalProps, r as DropdownMenuCheckboxItemProps, s as DropdownMenuGroupProps, t as DropdownMenu, u as DropdownMenuLabel, v as DropdownMenuRadioItemProps, w as DropdownMenuSubContent, x as DropdownMenuShortcut, y as DropdownMenuSeparator } from "../dropdown-menu-CVDIf0Rd.js";
2
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps };
@@ -1,2 +1 @@
1
- import"../rolldown-runtime-Bdj-bS2b.js";import{cn as e}from"../lib/utils.js";import{IconCheck as t,IconChevronRight as n}from"@tabler/icons-react";import{DropdownMenu as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";function DropdownMenu({...e}){return i(r.Root,{"data-slot":`dropdown-menu`,...e})}function DropdownMenuPortal({...e}){return i(r.Portal,{"data-slot":`dropdown-menu-portal`,...e})}function DropdownMenuTrigger({...e}){return i(r.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function DropdownMenuContent({className:t,align:n=`start`,sideOffset:a=4,...o}){return i(DropdownMenuPortal,{children:i(r.Content,{"data-slot":`dropdown-menu-content`,align:n,sideOffset:a,className:e(`relative z-50 w-(--radix-dropdown-menu-trigger-width) min-w-32 max-h-(--radix-dropdown-menu-content-available-height)`,`origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1`,`bg-popover/70 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100`,`data-[state=closed]:overflow-hidden`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,`before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]`,`before:backdrop-blur-2xl before:backdrop-saturate-150`,`**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10`,`**:data-[slot$=-separator]:bg-foreground/5`,`**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!`,`**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!`,`**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!`,`animate-none!`,t),...o})})}function DropdownMenuGroup({...e}){return i(r.Group,{"data-slot":`dropdown-menu-group`,...e})}function DropdownMenuItem({className:t,inset:n,variant:a=`default`,...o}){return i(r.Item,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":a,className:e(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground`,`data-inset:pl-7`,`data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive`,`dark:data-[variant=destructive]:focus:bg-destructive/20`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`data-[variant=destructive]:*:[svg]:text-destructive`,t),...o})}function DropdownMenuCheckboxItem({className:n,children:o,inset:s,...c}){return a(r.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":s,className:e(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground`,`data-inset:pl-7`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,n),...c,children:[i(`span`,{"data-slot":`dropdown-menu-checkbox-item-indicator`,className:`pointer-events-none absolute right-2 flex items-center justify-center`,children:i(r.ItemIndicator,{children:i(t,{})})}),o]})}function DropdownMenuRadioGroup({...e}){return i(r.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function DropdownMenuRadioItem({className:n,children:o,inset:s,...c}){return a(r.RadioItem,{"data-slot":`dropdown-menu-radio-item`,"data-inset":s,className:e(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground`,`data-inset:pl-7`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,n),...c,children:[i(`span`,{"data-slot":`dropdown-menu-radio-item-indicator`,className:`pointer-events-none absolute right-2 flex items-center justify-center`,children:i(r.ItemIndicator,{children:i(t,{})})}),o]})}function DropdownMenuLabel({className:t,inset:n,...a}){return i(r.Label,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:e(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,t),...a})}function DropdownMenuSeparator({className:t,...n}){return i(r.Separator,{"data-slot":`dropdown-menu-separator`,className:e(`bg-border -mx-1 my-1 h-px`,t),...n})}function DropdownMenuShortcut({className:t,...n}){return i(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground`,t),...n})}function DropdownMenuSub({...e}){return i(r.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function DropdownMenuSubTrigger({className:t,inset:o,children:s,...c}){return a(r.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":o,className:e(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground`,`data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t),...c,children:[s,i(n,{className:`ml-auto`})]})}function DropdownMenuSubContent({className:t,...n}){return i(r.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:e(`relative z-50 min-w-24 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg p-1`,`bg-popover/70 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,`before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]`,`before:backdrop-blur-2xl before:backdrop-saturate-150`,`**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10`,`**:data-[slot$=-separator]:bg-foreground/5`,`**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!`,`**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!`,`**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!`,`animate-none!`,t),...n})}export{DropdownMenu,DropdownMenuCheckboxItem,DropdownMenuContent,DropdownMenuGroup,DropdownMenuItem,DropdownMenuLabel,DropdownMenuPortal,DropdownMenuRadioGroup,DropdownMenuRadioItem,DropdownMenuSeparator,DropdownMenuShortcut,DropdownMenuSub,DropdownMenuSubContent,DropdownMenuSubTrigger,DropdownMenuTrigger};
2
- //# sourceMappingURL=dropdown-menu.js.map
1
+ import{a as e,c as t,d as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"../dropdown-menu-zRuQQS5S.js";export{p as DropdownMenu,c as DropdownMenuCheckboxItem,d as DropdownMenuContent,a as DropdownMenuGroup,e as DropdownMenuItem,l as DropdownMenuLabel,f as DropdownMenuPortal,t as DropdownMenuRadioGroup,o as DropdownMenuRadioItem,m as DropdownMenuSeparator,n as DropdownMenuShortcut,r as DropdownMenuSub,u as DropdownMenuSubContent,s as DropdownMenuSubTrigger,i as DropdownMenuTrigger};
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,2 @@
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{a as e,c as t,d as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,t as f,u as p}from"../dropdown-menu-zRuQQS5S.js";import{a as m,n as h,o as g,r as _}from"../react.esm-BkhVXJ8s.js";import{jsx as v,jsxs as y}from"react/jsx-runtime";function openMenu(e){h.pointerDown(e,{button:0,ctrlKey:!1})}describe(`DropdownMenu`,()=>{it(`is closed until the trigger is activated`,async()=>{_(y(f,{children:[v(i,{children:`Open menu`}),v(d,{children:v(e,{children:`Profile`})})]})),expect(m.queryByRole(`menu`)).toBeNull(),openMenu(m.getByText(`Open menu`));let t=await m.findByRole(`menu`);expect(t.getAttribute(`data-slot`)).toBe(`dropdown-menu-content`)}),describe(`DropdownMenuItem`,()=>{it(`calls onSelect and closes the menu when an item is chosen`,async()=>{let t=vi.fn();_(y(f,{children:[v(i,{children:`Open`}),v(d,{children:v(e,{onSelect:t,children:`Profile`})})]})),openMenu(m.getByText(`Open`));let n=await m.findByRole(`menuitem`,{name:`Profile`});h.click(n),expect(t).toHaveBeenCalledTimes(1),await g(()=>expect(m.queryByRole(`menu`)).toBeNull())}),it(`does not call onSelect for a disabled item`,async()=>{let t=vi.fn();_(y(f,{defaultOpen:!0,children:[v(i,{children:`Open`}),v(d,{children:v(e,{disabled:!0,onSelect:t,children:`Disabled`})})]}));let n=await m.findByRole(`menuitem`,{name:`Disabled`});expect(n.getAttribute(`data-disabled`)).not.toBeNull(),h.click(n),expect(t).not.toHaveBeenCalled()}),it(`exposes inset and destructive variant as data attributes`,async()=>{_(y(f,{defaultOpen:!0,children:[v(i,{children:`Open`}),v(d,{children:v(e,{inset:!0,variant:`destructive`,children:`Delete`})})]}));let t=await m.findByRole(`menuitem`,{name:`Delete`});expect(t.getAttribute(`data-inset`)).toBe(`true`),expect(t.getAttribute(`data-variant`)).toBe(`destructive`)})}),describe(`DropdownMenuCheckboxItem`,()=>{it(`reports the toggled checked state when clicked`,async()=>{let e=vi.fn();_(y(f,{defaultOpen:!0,children:[v(i,{children:`Open`}),v(d,{children:v(c,{checked:!1,onCheckedChange:e,children:`Show sidebar`})})]}));let t=await m.findByRole(`menuitemcheckbox`,{name:`Show sidebar`});expect(t.getAttribute(`aria-checked`)).toBe(`false`),h.click(t),expect(e).toHaveBeenCalledWith(!0)})}),describe(`DropdownMenuRadioGroup`,()=>{it(`reports the selected value when a different radio item is chosen`,async()=>{let e=vi.fn();_(y(f,{defaultOpen:!0,children:[v(i,{children:`Open`}),v(d,{children:y(t,{value:`list`,onValueChange:e,children:[v(o,{value:`list`,children:`List`}),v(o,{value:`grid`,children:`Grid`})]})})]}));let n=await m.findByRole(`menuitemradio`,{name:`List`}),r=m.getByRole(`menuitemradio`,{name:`Grid`});expect(n.getAttribute(`aria-checked`)).toBe(`true`),expect(r.getAttribute(`aria-checked`)).toBe(`false`),h.click(r),expect(e).toHaveBeenCalledWith(`grid`)})}),describe(`DropdownMenuSub`,()=>{it(`opens the submenu and selects an item within it`,async()=>{let t=vi.fn();_(y(f,{defaultOpen:!0,children:[v(i,{children:`Open`}),v(d,{children:y(r,{children:[v(s,{children:`More tools`}),v(u,{children:v(e,{onSelect:t,children:`Extensions`})})]})})]}));let n=await m.findByRole(`menuitem`,{name:`More tools`});h.click(n);let a=await m.findByRole(`menuitem`,{name:`Extensions`});h.click(a),expect(t).toHaveBeenCalledTimes(1)})}),it(`renders a group, label, separator and shortcut with their data-slots`,async()=>{_(y(f,{defaultOpen:!0,children:[v(i,{children:`Open`}),v(d,{children:y(a,{children:[v(l,{inset:!0,children:`Actions`}),v(p,{}),y(e,{children:[`Copy`,v(n,{children:`⌘C`})]})]})})]})),await m.findByText(`Actions`),expect(document.querySelector(`[data-slot="dropdown-menu-group"]`)).not.toBeNull();let t=document.querySelector(`[data-slot="dropdown-menu-label"]`);expect(t?.getAttribute(`data-inset`)).toBe(`true`),expect(document.querySelector(`[data-slot="dropdown-menu-separator"]`)).not.toBeNull();let r=m.getByText(`⌘C`);expect(r.getAttribute(`data-slot`)).toBe(`dropdown-menu-shortcut`)})});
2
+ //# sourceMappingURL=dropdown-menu.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-menu.spec.js","names":["waitFor"],"sources":["../../src/components/dropdown-menu.spec.tsx"],"sourcesContent":["import { fireEvent, render, screen, waitFor } from '@testing-library/react'\n\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger\n} from './dropdown-menu'\n\nfunction openMenu(trigger: HTMLElement) {\n fireEvent.pointerDown(trigger, { button: 0, ctrlKey: false })\n}\n\ndescribe('DropdownMenu', () => {\n it('is closed until the trigger is activated', async () => {\n render(\n <DropdownMenu>\n <DropdownMenuTrigger>Open menu</DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem>Profile</DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n\n expect(screen.queryByRole('menu')).toBeNull()\n\n openMenu(screen.getByText('Open menu'))\n\n const menu = await screen.findByRole('menu')\n expect(menu.getAttribute('data-slot')).toBe('dropdown-menu-content')\n })\n\n describe('DropdownMenuItem', () => {\n it('calls onSelect and closes the menu when an item is chosen', async () => {\n const handleSelect = vi.fn()\n render(\n <DropdownMenu>\n <DropdownMenuTrigger>Open</DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem onSelect={handleSelect}>Profile</DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n\n openMenu(screen.getByText('Open'))\n const item = await screen.findByRole('menuitem', { name: 'Profile' })\n\n fireEvent.click(item)\n\n expect(handleSelect).toHaveBeenCalledTimes(1)\n await waitFor(() => expect(screen.queryByRole('menu')).toBeNull())\n })\n\n it('does not call onSelect for a disabled item', async () => {\n const handleSelect = vi.fn()\n render(\n <DropdownMenu defaultOpen>\n <DropdownMenuTrigger>Open</DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem disabled onSelect={handleSelect}>\n Disabled\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n\n const item = await screen.findByRole('menuitem', { name: 'Disabled' })\n expect(item.getAttribute('data-disabled')).not.toBeNull()\n\n fireEvent.click(item)\n\n expect(handleSelect).not.toHaveBeenCalled()\n })\n\n it('exposes inset and destructive variant as data attributes', async () => {\n render(\n <DropdownMenu defaultOpen>\n <DropdownMenuTrigger>Open</DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem inset variant=\"destructive\">\n Delete\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n\n const item = await screen.findByRole('menuitem', { name: 'Delete' })\n expect(item.getAttribute('data-inset')).toBe('true')\n expect(item.getAttribute('data-variant')).toBe('destructive')\n })\n })\n\n describe('DropdownMenuCheckboxItem', () => {\n it('reports the toggled checked state when clicked', async () => {\n const handleCheckedChange = vi.fn()\n render(\n <DropdownMenu defaultOpen>\n <DropdownMenuTrigger>Open</DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuCheckboxItem checked={false} onCheckedChange={handleCheckedChange}>\n Show sidebar\n </DropdownMenuCheckboxItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n\n const checkboxItem = await screen.findByRole('menuitemcheckbox', { name: 'Show sidebar' })\n expect(checkboxItem.getAttribute('aria-checked')).toBe('false')\n\n fireEvent.click(checkboxItem)\n\n expect(handleCheckedChange).toHaveBeenCalledWith(true)\n })\n })\n\n describe('DropdownMenuRadioGroup', () => {\n it('reports the selected value when a different radio item is chosen', async () => {\n const handleValueChange = vi.fn()\n render(\n <DropdownMenu defaultOpen>\n <DropdownMenuTrigger>Open</DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuRadioGroup value=\"list\" onValueChange={handleValueChange}>\n <DropdownMenuRadioItem value=\"list\">List</DropdownMenuRadioItem>\n <DropdownMenuRadioItem value=\"grid\">Grid</DropdownMenuRadioItem>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n\n const listItem = await screen.findByRole('menuitemradio', { name: 'List' })\n const gridItem = screen.getByRole('menuitemradio', { name: 'Grid' })\n expect(listItem.getAttribute('aria-checked')).toBe('true')\n expect(gridItem.getAttribute('aria-checked')).toBe('false')\n\n fireEvent.click(gridItem)\n\n expect(handleValueChange).toHaveBeenCalledWith('grid')\n })\n })\n\n describe('DropdownMenuSub', () => {\n it('opens the submenu and selects an item within it', async () => {\n const handleSelect = vi.fn()\n render(\n <DropdownMenu defaultOpen>\n <DropdownMenuTrigger>Open</DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuSub>\n <DropdownMenuSubTrigger>More tools</DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n <DropdownMenuItem onSelect={handleSelect}>Extensions</DropdownMenuItem>\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n\n const subTrigger = await screen.findByRole('menuitem', { name: 'More tools' })\n fireEvent.click(subTrigger)\n\n const subItem = await screen.findByRole('menuitem', { name: 'Extensions' })\n fireEvent.click(subItem)\n\n expect(handleSelect).toHaveBeenCalledTimes(1)\n })\n })\n\n it('renders a group, label, separator and shortcut with their data-slots', async () => {\n render(\n <DropdownMenu defaultOpen>\n <DropdownMenuTrigger>Open</DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuGroup>\n <DropdownMenuLabel inset>Actions</DropdownMenuLabel>\n <DropdownMenuSeparator />\n <DropdownMenuItem>\n Copy\n <DropdownMenuShortcut>⌘C</DropdownMenuShortcut>\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n\n await screen.findByText('Actions')\n\n // DropdownMenuContent renders into a portal (document.body), not into the local render\n // container, so query the document directly for these slots.\n expect(document.querySelector('[data-slot=\"dropdown-menu-group\"]')).not.toBeNull()\n const label = document.querySelector('[data-slot=\"dropdown-menu-label\"]')\n expect(label?.getAttribute('data-inset')).toBe('true')\n expect(document.querySelector('[data-slot=\"dropdown-menu-separator\"]')).not.toBeNull()\n\n const shortcut = screen.getByText('⌘C')\n expect(shortcut.getAttribute('data-slot')).toBe('dropdown-menu-shortcut')\n })\n})\n"],"mappings":"wSAmBA,SAAS,SAAS,EAAsB,CACtC,EAAU,YAAY,EAAS,CAAE,OAAQ,EAAG,QAAS,EAAM,CAAC,CAC9D,CAEA,SAAS,mBAAsB,CAC7B,GAAG,2CAA4C,SAAY,CACzD,EACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAqB,WAA8B,CAAA,EACnD,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAA,SAAkB,SAAyB,CAAA,CACxB,CAAA,CACT,CAAA,CAAA,CAChB,EAEA,OAAO,EAAO,YAAY,MAAM,CAAC,CAAC,CAAC,SAAS,EAE5C,SAAS,EAAO,UAAU,WAAW,CAAC,EAEtC,IAAM,EAAO,MAAM,EAAO,WAAW,MAAM,EAC3C,OAAO,EAAK,aAAa,WAAW,CAAC,CAAC,CAAC,KAAK,uBAAuB,CACrE,CAAC,EAED,SAAS,uBAA0B,CACjC,GAAG,4DAA6D,SAAY,CAC1E,IAAM,EAAe,GAAG,GAAG,EAC3B,EACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAqB,MAAyB,CAAA,EAC9C,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAkB,SAAU,EAAc,SAAA,SAAyB,CAAA,CA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Ac,mCAAmC,EACxE,OAAO,GAAO,aAAa,YAAY,CAAC,CAAC,CAAC,KAAK,MAAM,EACrD,OAAO,SAAS,cAAc,uCAAuC,CAAC,CAAC,CAAC,IAAI,SAAS,EAErF,IAAM,EAAW,EAAO,UAAU,IAAI,EACtC,OAAO,EAAS,aAAa,WAAW,CAAC,CAAC,CAAC,KAAK,wBAAwB,CAC1E,CAAC,CACH,CAAC"}
@@ -1,102 +1,2 @@
1
- import { n as __name } from "../rolldown-runtime-Bdj-bS2b.js";
2
- import { ButtonProps } from "./button.js";
3
- import * as React from "react";
4
- import { Accept, ErrorCode, FileError, useDropzone as useDropzone$1 } from "react-dropzone";
5
- //#region src/components/dropzone.d.ts
6
- type DropzoneUploadResult<TUploadResult, TUploadError> = {
7
- status: 'error';
8
- error: TUploadError;
9
- } | {
10
- status: 'success';
11
- result: TUploadResult;
12
- };
13
- type DropzoneFileStatus<TUploadResult, TUploadError> = {
14
- id: string;
15
- fileName: string;
16
- file: File;
17
- tries: number;
18
- } & ({
19
- status: 'pending';
20
- error?: undefined;
21
- message?: undefined;
22
- result?: undefined;
23
- } | {
24
- status: 'error';
25
- error: TUploadError;
26
- message?: string;
27
- result?: undefined;
28
- } | {
29
- status: 'success';
30
- result: TUploadResult;
31
- error?: undefined;
32
- message?: undefined;
33
- });
34
- type FileStatus<TUploadResult, TUploadError> = DropzoneFileStatus<TUploadResult, TUploadError>;
35
- type DropzoneValidation = {
36
- accept?: Accept;
37
- minSize?: number;
38
- maxSize?: number;
39
- maxFiles?: number;
40
- };
41
- type UseDropzoneProps<TUploadResult, TUploadError = string> = {
42
- onDropFile: (file: File) => Promise<DropzoneUploadResult<TUploadResult, TUploadError>>;
43
- onRemoveFile?: (id: string) => void | Promise<void>;
44
- onFileUploaded?: (result: TUploadResult) => void;
45
- onFileUploadError?: (error: TUploadError) => void;
46
- onAllUploaded?: () => void;
47
- onRootError?: (error: string | undefined) => void;
48
- shapeUploadError?: (error: TUploadError) => string | undefined;
49
- maxRetryCount?: number;
50
- autoRetry?: boolean;
51
- validation?: DropzoneValidation;
52
- shiftOnMaxFiles?: boolean;
53
- };
54
- interface UseDropzoneReturn<TUploadResult, TUploadError> {
55
- getRootProps: ReturnType<typeof useDropzone$1>['getRootProps'];
56
- getInputProps: ReturnType<typeof useDropzone$1>['getInputProps'];
57
- open: () => void;
58
- onRemoveFile: (id: string) => Promise<void>;
59
- onRetry: (id: string) => Promise<void>;
60
- canRetry: (id: string) => boolean;
61
- fileStatuses: DropzoneFileStatus<TUploadResult, TUploadError>[];
62
- isInvalid: boolean;
63
- isDragActive: boolean;
64
- rootError: string | undefined;
65
- inputId: string;
66
- rootMessageId: string;
67
- rootDescriptionId: string;
68
- getFileMessageId: (id: string) => string;
69
- }
70
- type DropzoneProps<TUploadResult, TUploadError> = React.PropsWithChildren<UseDropzoneReturn<TUploadResult, TUploadError>>;
71
- type DropzoneAreaProps = React.ComponentProps<'div'>;
72
- type DropzoneDescriptionProps = React.ComponentProps<'p'>;
73
- type DropzoneFileListProps = React.ComponentProps<'ol'>;
74
- type DropzoneFileListItemProps<TUploadResult, TUploadError> = React.ComponentProps<'li'> & {
75
- file: DropzoneFileStatus<TUploadResult, TUploadError>;
76
- };
77
- type DropzoneFileMessageProps = React.ComponentProps<'p'>;
78
- type DropzoneMessageProps = React.ComponentProps<'p'>;
79
- type DropzoneRemoveFileProps = ButtonProps;
80
- type DropzoneRetryFileProps = ButtonProps;
81
- type DropzoneTriggerProps = ButtonProps;
82
- type InfiniteProgressProps = React.ComponentProps<'div'> & {
83
- status: 'pending' | 'success' | 'error';
84
- };
85
- declare function useDropzone<TUploadResult, TUploadError = string>(props: UseDropzoneProps<TUploadResult, TUploadError>): UseDropzoneReturn<TUploadResult, TUploadError>;
86
- declare function Dropzone<TUploadResult, TUploadError>({ children, ...dropzone }: DropzoneProps<TUploadResult, TUploadError>): React.JSX.Element;
87
- declare namespace Dropzone {
88
- var displayName: string;
89
- }
90
- declare const DropzoneArea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
91
- declare const DropzoneDescription: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
92
- declare const DropzoneFileList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
93
- declare const DropzoneFileListItem: React.ForwardRefExoticComponent<Omit<DropzoneFileListItemProps<unknown, unknown>, "ref"> & React.RefAttributes<HTMLLIElement>>;
94
- declare const DropzoneFileMessage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
95
- declare const DropzoneMessage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
96
- declare const DropzoneRemoveFile: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
97
- declare const DropzoneRetryFile: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
98
- declare const DropzoneTrigger: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
99
- declare const InfiniteProgress: React.ForwardRefExoticComponent<Omit<InfiniteProgressProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
100
- //#endregion
101
- export { Dropzone, DropzoneArea, DropzoneAreaProps, DropzoneDescription, DropzoneDescriptionProps, DropzoneFileList, DropzoneFileListItem, DropzoneFileListItemProps, DropzoneFileListProps, DropzoneFileMessage, DropzoneFileMessageProps, DropzoneFileStatus, DropzoneMessage, DropzoneMessageProps, DropzoneProps, DropzoneRemoveFile, DropzoneRemoveFileProps, DropzoneRetryFile, DropzoneRetryFileProps, DropzoneTrigger, DropzoneTriggerProps, DropzoneUploadResult, DropzoneValidation, ErrorCode, type FileError, FileStatus, InfiniteProgress, InfiniteProgressProps, UseDropzoneProps, UseDropzoneReturn, useDropzone };
102
- //# sourceMappingURL=dropzone.d.ts.map
1
+ import { A as UseDropzoneReturn, C as DropzoneValidation, D as InfiniteProgress, E as FileStatus, O as InfiniteProgressProps, S as DropzoneUploadResult, T as FileError, _ as DropzoneRemoveFileProps, a as DropzoneDescriptionProps, b as DropzoneTrigger, c as DropzoneFileListItemProps, d as DropzoneFileMessageProps, f as DropzoneFileStatus, g as DropzoneRemoveFile, h as DropzoneProps, i as DropzoneDescription, j as useDropzone, k as UseDropzoneProps, l as DropzoneFileListProps, m as DropzoneMessageProps, n as DropzoneArea, o as DropzoneFileList, p as DropzoneMessage, r as DropzoneAreaProps, s as DropzoneFileListItem, t as Dropzone, u as DropzoneFileMessage, v as DropzoneRetryFile, w as ErrorCode, x as DropzoneTriggerProps, y as DropzoneRetryFileProps } from "../dropzone-43h3L9Ko.js";
2
+ export { Dropzone, DropzoneArea, DropzoneAreaProps, DropzoneDescription, DropzoneDescriptionProps, DropzoneFileList, DropzoneFileListItem, DropzoneFileListItemProps, DropzoneFileListProps, DropzoneFileMessage, DropzoneFileMessageProps, DropzoneFileStatus, DropzoneMessage, DropzoneMessageProps, DropzoneProps, DropzoneRemoveFile, DropzoneRemoveFileProps, DropzoneRetryFile, DropzoneRetryFileProps, DropzoneTrigger, DropzoneTriggerProps, DropzoneUploadResult, DropzoneValidation, ErrorCode, type FileError, FileStatus, InfiniteProgress, InfiniteProgressProps, UseDropzoneProps, UseDropzoneReturn, useDropzone };
@@ -1,2 +1 @@
1
- import"../rolldown-runtime-Bdj-bS2b.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{composeRefs as n}from"../lib/compose-refs.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import*as a from"react";import{ErrorCode as o,useDropzone as s}from"react-dropzone";const c=[o.FileInvalidType,o.FileTooLarge,o.FileTooSmall,o.TooManyFiles],l=new Set(c),u={pending:`indeterminate`,success:`100%`,error:`error`},d=a.createContext(null),f=a.createContext(null);function fileStatusReducer(e,t){switch(t.type){case`add`:return[...e,{id:t.id,fileName:t.fileName,file:t.file,status:`pending`,tries:1}];case`remove`:return e.filter(e=>e.id!==t.id);case`update-status`:return e.map(e=>e.id===t.id?t.status===`pending`?{...e,status:`pending`,error:void 0,message:void 0,result:void 0,tries:e.tries+1}:t.status===`error`?{...e,status:`error`,error:t.error,message:t.message,result:void 0}:{...e,status:`success`,result:t.result,error:void 0,message:void 0}:e)}}function formatAcceptedTypes(e){if(!e)return;let t=Object.entries(e).flatMap(([e,t])=>t.length>0?t:[e]);return t.length>0?t.join(`, `):void 0}function getDropzoneErrorCodes(e){let t=e.flatMap(e=>e.errors.map(e=>e.code).filter(e=>l.has(e)));return Array.from(new Set(t))}function getRootError(e,t){let n=e.flatMap(e=>{switch(e){case`file-invalid-type`:{let e=formatAcceptedTypes(t.accept);return e?[`only ${e} files are allowed`]:[`this file type is not allowed`]}case`file-too-large`:return t.maxSize?[`max size is ${(t.maxSize/(1024*1024)).toFixed(2)} MB`]:[`this file is too large`];case`file-too-small`:return t.minSize?[`min size is ${(t.minSize/(1024*1024)).toFixed(2)} MB`]:[`this file is too small`];case`too-many-files`:return t.maxFiles?[`max ${t.maxFiles} files`]:[`too many files`];default:return[]}});if(n.length===0)return`Unable to add the selected files`;let[r,...i]=n;return`${r.charAt(0).toUpperCase()}${r.slice(1)}${i.length>0?`, ${i.join(`, `)}`:``}`}function getRejectionMessage(e,t){let n=getDropzoneErrorCodes(e);return n.length>0?getRootError(n,t):e[0]?.errors[0]?.message??`Unable to add the selected files`}function getUploadErrorMessage(e,t){if(t){let n=t(e);if(n!==void 0)return n}if(typeof e==`string`)return e;if(e instanceof Error)return e.message}function useDropzoneContext(){let e=a.useContext(d);if(!e)throw Error(`Dropzone components must be used within a Dropzone.`);return e}function useDropzoneFileListContext(){let e=a.useContext(f);if(!e)throw Error(`Dropzone file actions must be used within a DropzoneFileListItem.`);return e}function useDropzone(e){let{onDropFile:t,onRemoveFile:n,shapeUploadError:r,onFileUploaded:i,onFileUploadError:c,onAllUploaded:l,onRootError:u,maxRetryCount:d,autoRetry:f=!1,validation:p,shiftOnMaxFiles:m=!1}=e,h=a.useId(),g=`${h}-message`,_=`${h}-description`,[v,y]=a.useState(void 0),b=a.useCallback(e=>{y(e),u?.(e)},[u]),[x,S]=a.useReducer(fileStatusReducer,[]),C=a.useCallback(e=>`${h}-${e}-message`,[h]),w=a.useMemo(()=>v!==void 0||x.some(e=>e.status===`error`),[x,v]),T=a.useCallback(async(e,n,a=0)=>{try{let o=await t(e);if(o.status===`error`){if(f&&a<(d??1/0))return S({type:`update-status`,id:n,status:`pending`}),T(e,n,a+1);S({type:`update-status`,id:n,status:`error`,error:o.error,message:getUploadErrorMessage(o.error,r)}),c?.(o.error);return}S({type:`update-status`,id:n,status:`success`,result:o.result}),i?.(o.result)}catch(e){let t=e;S({type:`update-status`,id:n,status:`error`,error:t,message:getUploadErrorMessage(t,r)}),c?.(t)}},[f,t,d,c,i,r]),E=a.useCallback(async e=>{await n?.(e),S({type:`remove`,id:e})},[n]),D=a.useCallback(e=>{let t=x.find(t=>t.id===e);return t?.status===`error`&&t.tries<=(d??1/0)},[x,d]),O=a.useCallback(async e=>{if(!D(e))return;let t=x.find(t=>t.id===e);t?.status===`error`&&(S({type:`update-status`,id:e,status:`pending`}),await T(t.file,e))},[D,x,T]),k=s({accept:p?.accept,minSize:p?.minSize,maxSize:p?.maxSize,maxFiles:p?.maxFiles,noClick:!0,noKeyboard:!0,onDropAccepted:async e=>{b(void 0);let t=e,n=p?.maxFiles??1/0,r=Number.isFinite(n)?Math.max(x.length+e.length-n,0):0;if(r>0)if(m){let n=x.slice(0,Math.min(r,x.length));await Promise.all(n.map(e=>E(e.id)));let i=r-n.length;i>0&&(t=e.slice(i))}else{b(getRootError([o.TooManyFiles],p??{}));let r=Math.max(n-x.length,0);t=e.slice(0,r)}t.length!==0&&(await Promise.all(t.map(async e=>{let t=crypto.randomUUID();S({type:`add`,id:t,fileName:e.name,file:e}),await T(e,t)})),l?.())},onDropRejected:e=>{b(getRejectionMessage(e,p??{}))}});return{getRootProps:k.getRootProps,getInputProps:k.getInputProps,open:k.open,onRemoveFile:E,onRetry:O,canRetry:D,fileStatuses:x,isInvalid:w,isDragActive:k.isDragActive,rootError:v,inputId:h,rootMessageId:g,rootDescriptionId:_,getFileMessageId:C}}function Dropzone({children:e,...t}){return r(d.Provider,{value:t,children:e})}const p=a.forwardRef(({className:t,children:a,...o},s)=>{let c=useDropzoneContext(),l=[c.rootDescriptionId,c.isInvalid?c.rootMessageId:void 0].filter(Boolean).join(` `)||void 0,{ref:u,...d}=c.getRootProps({...o,"data-slot":`dropzone-area`,"aria-describedby":l,"aria-invalid":c.isInvalid||void 0,className:e(`flex min-h-44 flex-col items-center justify-center gap-4 rounded-xl border border-dashed border-input bg-muted/20 px-6 py-8 text-center transition-colors`,c.isDragActive&&`border-primary bg-primary/5`,c.isInvalid&&`border-destructive bg-destructive/5`,t)}),f=c.getInputProps({id:c.inputId,className:`sr-only`,"aria-describedby":l,"aria-invalid":c.isInvalid,tabIndex:-1});return i(`div`,{...d,ref:n(s,u),children:[r(`input`,{...f}),a]})}),m=a.forwardRef(({className:t,...n},i)=>r(`p`,{ref:i,id:useDropzoneContext().rootDescriptionId,"data-slot":`dropzone-description`,className:e(`text-sm text-muted-foreground`,t),...n})),h=a.forwardRef(({className:t,...n},i)=>(useDropzoneContext(),r(`ol`,{ref:i,"data-slot":`dropzone-file-list`,className:e(`space-y-3`,t),...n}))),g=a.forwardRef(({className:t,file:n,children:i,...o},s)=>{let c=useDropzoneContext(),l=c.getFileMessageId(n.id),u=n.status===`error`,d=c.canRetry(n.id),p=a.useMemo(()=>({onRemoveFile:()=>c.onRemoveFile(n.id),onRetry:()=>c.onRetry(n.id),fileStatus:n,canRetry:d,dropzoneId:c.inputId,messageId:l}),[d,c,n,l]);return r(f.Provider,{value:p,children:r(`li`,{ref:s,"data-slot":`dropzone-file-item`,"data-status":n.status,"aria-describedby":u?l:void 0,className:e(`rounded-xl border bg-card px-4 py-3 shadow-xs`,n.status===`error`&&`border-destructive/50`,t),...o,children:i})})}),_=a.forwardRef(({className:t,children:n,...i},a)=>{let o=useDropzoneFileListContext(),s=o.fileStatus.status===`error`?o.fileStatus.message??String(o.fileStatus.error):n;return r(`p`,{ref:a,id:o.messageId,"data-slot":`dropzone-file-message`,className:e(`min-h-5 text-[0.8rem] font-medium`,o.fileStatus.status===`error`&&`text-destructive`,t),...i,children:s})}),v=a.forwardRef(({className:t,children:n,...i},a)=>{let o=useDropzoneContext(),s=o.rootError??n;return r(`p`,{ref:a,id:o.rootMessageId,"data-slot":`dropzone-message`,className:e(`min-h-5 text-[0.8rem] font-medium text-destructive`,t),...i,children:s})}),y=a.forwardRef(({className:n,onClick:i,size:o=`icon-sm`,type:s=`button`,variant:c=`ghost`,...l},u)=>{let d=useDropzoneFileListContext(),f=a.useCallback(e=>{i?.(e),!e.defaultPrevented&&d.onRemoveFile()},[d,i]);return r(t,{ref:u,"data-slot":`dropzone-remove-file`,className:e(n),onClick:f,size:o,type:s,variant:c,...l})}),b=a.forwardRef(({className:n,disabled:i,onClick:o,size:s=`icon-sm`,type:c=`button`,variant:l=`ghost`,...u},d)=>{let f=useDropzoneFileListContext(),p=i||!f.canRetry,m=a.useCallback(e=>{o?.(e),!(e.defaultPrevented||p)&&f.onRetry()},[f,p,o]);return r(t,{ref:d,"data-slot":`dropzone-retry-file`,className:e(n),disabled:p,onClick:m,size:s,type:c,variant:l,...u})}),x=a.forwardRef(({className:n,onClick:i,size:o=`sm`,type:s=`button`,variant:c=`subtle`,...l},u)=>{let d=useDropzoneContext(),f=[d.rootDescriptionId,d.isInvalid?d.rootMessageId:void 0].filter(Boolean).join(` `)||void 0,p=a.useCallback(e=>{i?.(e),!e.defaultPrevented&&d.open()},[d,i]);return r(t,{ref:u,"aria-controls":d.inputId,"aria-describedby":f,"aria-invalid":d.isInvalid||void 0,"data-slot":`dropzone-trigger`,className:e(n),onClick:p,size:o,type:s,variant:c,...l})}),S=a.forwardRef(({className:t,status:n,...i},a)=>{let o=n===`success`||n===`error`,s=n===`error`;return r(`div`,{ref:a,"aria-valuemax":100,"aria-valuemin":0,"aria-valuetext":u[n],"data-slot":`dropzone-progress`,"data-status":n,role:`progressbar`,className:e(`relative h-2 w-full overflow-hidden rounded-full bg-muted`,t),...i,children:r(`div`,{className:e(`h-full w-full rounded-full bg-primary transition-transform`,o?`translate-x-0`:`animate-infinite-progress`,s&&`bg-destructive`)})})});Dropzone.displayName=`Dropzone`,p.displayName=`DropzoneArea`,m.displayName=`DropzoneDescription`,h.displayName=`DropzoneFileList`,g.displayName=`DropzoneFileListItem`,_.displayName=`DropzoneFileMessage`,v.displayName=`DropzoneMessage`,y.displayName=`DropzoneRemoveFile`,b.displayName=`DropzoneRetryFile`,x.displayName=`DropzoneTrigger`,S.displayName=`InfiniteProgress`;export{Dropzone,p as DropzoneArea,m as DropzoneDescription,h as DropzoneFileList,g as DropzoneFileListItem,_ as DropzoneFileMessage,v as DropzoneMessage,y as DropzoneRemoveFile,b as DropzoneRetryFile,x as DropzoneTrigger,o as ErrorCode,S as InfiniteProgress,useDropzone};
2
- //# sourceMappingURL=dropzone.js.map
1
+ import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"../dropzone-BLZkZThJ.js";export{d as Dropzone,o as DropzoneArea,l as DropzoneDescription,i as DropzoneFileList,e as DropzoneFileListItem,s as DropzoneFileMessage,u as DropzoneMessage,t as DropzoneRemoveFile,a as DropzoneRetryFile,f as DropzoneTrigger,n as ErrorCode,r as InfiniteProgress,c as useDropzone};
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,2 @@
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{a as e,c as t,f as n,i as r,l as i,n as a,o,p as s,r as c,s as l,t as u,u as d}from"../dropzone-BLZkZThJ.js";import{a as f,n as p,o as m,r as h}from"../react.esm-BkhVXJ8s.js";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{createRef as v}from"react";function defaultOnDropFile(e){return Promise.resolve({status:`success`,result:e.name})}function DropzoneHarness(n){let f=s(n);return _(u,{...f,children:[_(a,{"data-testid":`dropzone-area`,children:[g(d,{children:`Upload files`}),g(c,{children:`PNG files up to 5MB`})]}),g(l,{}),g(r,{children:f.fileStatuses.map(n=>_(e,{file:n,children:[g(`span`,{children:n.fileName}),g(o,{}),g(i,{children:`Retry`}),g(t,{children:`Remove`})]},n.id))})]})}function renderDropzone(e={}){return h(g(DropzoneHarness,{onDropFile:defaultOnDropFile,...e}))}function getFileInput(e){return e.querySelector(`input[type="file"]`)}describe(`Dropzone`,()=>{it(`renders the trigger, description, and a hidden file input wired to the dropzone`,()=>{let{container:e}=renderDropzone();expect(f.getByRole(`button`,{name:`Upload files`})).toBeTruthy(),expect(f.getByText(`PNG files up to 5MB`)).toBeTruthy();let t=getFileInput(e);expect(t).not.toBeNull(),expect(t.className).toContain(`sr-only`)}),it(`forwards the ref on DropzoneArea to the underlying DOM node`,()=>{let e=v();function Harness(){return g(u,{...s({onDropFile:defaultOnDropFile}),children:g(a,{ref:e,"data-testid":`dropzone-area`})})}h(g(Harness,{})),expect(e.current).toBeInstanceOf(HTMLDivElement),expect(e.current).toBe(f.getByTestId(`dropzone-area`))}),it(`throws when a Dropzone subcomponent is rendered outside a Dropzone provider`,()=>{expect(()=>h(g(a,{}))).toThrow(`Dropzone components must be used within a Dropzone.`)}),it(`throws when a file-item action is rendered outside a DropzoneFileListItem`,()=>{function Harness(){return g(u,{...s({onDropFile:defaultOnDropFile}),children:g(t,{})})}expect(()=>h(g(Harness,{}))).toThrow(`Dropzone file actions must be used within a DropzoneFileListItem.`)}),describe(`accepted files`,()=>{it(`adds an accepted file and reports success through onFileUploaded`,async()=>{let e=vi.fn(),{container:t}=renderDropzone({onFileUploaded:e}),n=getFileInput(t),r=new File([`content`],`photo.png`,{type:`image/png`});p.change(n,{target:{files:[r]}}),await f.findByText(`photo.png`),await m(()=>expect(e).toHaveBeenCalledWith(`photo.png`));let i=t.querySelector(`[data-slot="dropzone-file-item"]`);expect(i?.getAttribute(`data-status`)).toBe(`success`)})}),describe(`rejected files`,()=>{it(`rejects a file with an invalid type without crashing and surfaces the allowed types`,async()=>{let e=vi.fn(),{container:t}=renderDropzone({validation:{accept:{"image/png":[`.png`]}},onRootError:e}),n=getFileInput(t),r=new File([`not an image`],`notes.txt`,{type:`text/plain`});p.change(n,{target:{files:[r]}}),await m(()=>expect(e).toHaveBeenCalled()),expect(await f.findByText(/only \.png files are allowed/i)).toBeTruthy();let i=t.querySelector(`[data-slot="dropzone-area"]`);expect(i?.getAttribute(`aria-invalid`)).toBe(`true`)}),it(`rejects a file exceeding maxSize without crashing and surfaces the size limit`,async()=>{let e=vi.fn(),{container:t}=renderDropzone({validation:{maxSize:10},onRootError:e}),n=getFileInput(t),r=new File([new Uint8Array(1024)],`large.png`,{type:`image/png`});p.change(n,{target:{files:[r]}}),await m(()=>expect(e).toHaveBeenCalled()),expect(await f.findByText(/max size is 0\.00 MB/i)).toBeTruthy()})}),describe(`DropzoneTrigger`,()=>{it(`opens the native file picker when clicked`,()=>{let e=vi.spyOn(HTMLInputElement.prototype,`click`);renderDropzone(),p.click(f.getByRole(`button`,{name:`Upload files`})),expect(e).toHaveBeenCalled(),e.mockRestore()}),it(`does not open the file picker when the click is prevented`,()=>{let e=vi.spyOn(HTMLInputElement.prototype,`click`);function Harness(){return _(u,{...s({onDropFile:defaultOnDropFile}),children:[g(a,{}),g(d,{onClick:e=>e.preventDefault(),children:`Upload`})]})}h(g(Harness,{})),p.click(f.getByRole(`button`,{name:`Upload`})),expect(e).not.toHaveBeenCalled(),e.mockRestore()})}),describe(`DropzoneRetryFile and DropzoneRemoveFile`,()=>{it(`retries an errored upload and eventually reports success`,async()=>{let e=0,t=vi.fn(async t=>(e+=1,e===1?{status:`error`,error:`network-error`}:{status:`success`,result:t.name})),n=vi.fn(),{container:r}=renderDropzone({onDropFile:t,onFileUploaded:n}),i=getFileInput(r),a=new File([`data`],`report.pdf`,{type:`application/pdf`});p.change(i,{target:{files:[a]}}),await f.findByText(`report.pdf`),expect(await f.findByText(`network-error`)).toBeTruthy(),p.click(f.getByRole(`button`,{name:`Retry`})),await m(()=>{let e=r.querySelector(`[data-slot="dropzone-file-item"]`);expect(e?.getAttribute(`data-status`)).toBe(`success`)}),expect(n).toHaveBeenCalledWith(`report.pdf`),expect(f.getByRole(`button`,{name:`Retry`}).hasAttribute(`disabled`)).toBe(!0)}),it(`removes a file from the list when the remove button is clicked`,async()=>{let e=vi.fn(),{container:t}=renderDropzone({onRemoveFile:e}),n=getFileInput(t),r=new File([`data`],`image.png`,{type:`image/png`});p.change(n,{target:{files:[r]}}),await f.findByText(`image.png`),p.click(f.getByRole(`button`,{name:`Remove`})),await m(()=>expect(f.queryByText(`image.png`)).toBeNull()),expect(e).toHaveBeenCalledTimes(1)})}),describe(`InfiniteProgress`,()=>{it(`reflects the pending, error, and success statuses on the progressbar`,()=>{let{rerender:e}=h(g(n,{status:`pending`})),t=f.getByRole(`progressbar`);expect(t.getAttribute(`aria-valuetext`)).toBe(`indeterminate`),expect(t.getAttribute(`data-status`)).toBe(`pending`),e(g(n,{status:`error`})),expect(f.getByRole(`progressbar`).getAttribute(`aria-valuetext`)).toBe(`error`),e(g(n,{status:`success`})),expect(f.getByRole(`progressbar`).getAttribute(`aria-valuetext`)).toBe(`100%`)}),it(`forwards the ref to the progressbar element`,()=>{let e=v();h(g(n,{ref:e,status:`pending`})),expect(e.current).toBe(f.getByRole(`progressbar`))})})});
2
+ //# sourceMappingURL=dropzone.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropzone.spec.js","names":["waitFor"],"sources":["../../src/components/dropzone.spec.tsx"],"sourcesContent":["import { createRef } from 'react'\n\nimport { fireEvent, render, screen, waitFor } from '@testing-library/react'\n\nimport {\n Dropzone,\n DropzoneArea,\n DropzoneDescription,\n DropzoneFileList,\n DropzoneFileListItem,\n DropzoneFileMessage,\n DropzoneMessage,\n DropzoneRemoveFile,\n DropzoneRetryFile,\n DropzoneTrigger,\n InfiniteProgress,\n type UseDropzoneProps,\n useDropzone\n} from './dropzone'\n\ntype HarnessResult = string\ntype HarnessError = string\n\nfunction defaultOnDropFile(file: File) {\n return Promise.resolve({ status: 'success' as const, result: file.name })\n}\n\nfunction DropzoneHarness(props: UseDropzoneProps<HarnessResult, HarnessError>) {\n const dropzone = useDropzone<HarnessResult, HarnessError>(props)\n\n return (\n <Dropzone {...dropzone}>\n <DropzoneArea data-testid=\"dropzone-area\">\n <DropzoneTrigger>Upload files</DropzoneTrigger>\n <DropzoneDescription>PNG files up to 5MB</DropzoneDescription>\n </DropzoneArea>\n <DropzoneMessage />\n <DropzoneFileList>\n {dropzone.fileStatuses.map((file) => (\n <DropzoneFileListItem key={file.id} file={file}>\n <span>{file.fileName}</span>\n <DropzoneFileMessage />\n <DropzoneRetryFile>Retry</DropzoneRetryFile>\n <DropzoneRemoveFile>Remove</DropzoneRemoveFile>\n </DropzoneFileListItem>\n ))}\n </DropzoneFileList>\n </Dropzone>\n )\n}\n\nfunction renderDropzone(props: Partial<UseDropzoneProps<HarnessResult, HarnessError>> = {}) {\n return render(<DropzoneHarness onDropFile={defaultOnDropFile} {...props} />)\n}\n\nfunction getFileInput(container: HTMLElement) {\n return container.querySelector('input[type=\"file\"]') as HTMLInputElement\n}\n\ndescribe('Dropzone', () => {\n it('renders the trigger, description, and a hidden file input wired to the dropzone', () => {\n const { container } = renderDropzone()\n\n expect(screen.getByRole('button', { name: 'Upload files' })).toBeTruthy()\n expect(screen.getByText('PNG files up to 5MB')).toBeTruthy()\n\n const input = getFileInput(container)\n expect(input).not.toBeNull()\n expect(input.className).toContain('sr-only')\n })\n\n it('forwards the ref on DropzoneArea to the underlying DOM node', () => {\n const ref = createRef<HTMLDivElement>()\n\n function Harness() {\n const dropzone = useDropzone<HarnessResult, HarnessError>({ onDropFile: defaultOnDropFile })\n return (\n <Dropzone {...dropzone}>\n <DropzoneArea ref={ref} data-testid=\"dropzone-area\" />\n </Dropzone>\n )\n }\n\n render(<Harness />)\n\n expect(ref.current).toBeInstanceOf(HTMLDivElement)\n expect(ref.current).toBe(screen.getByTestId('dropzone-area'))\n })\n\n it('throws when a Dropzone subcomponent is rendered outside a Dropzone provider', () => {\n expect(() => render(<DropzoneArea />)).toThrow('Dropzone components must be used within a Dropzone.')\n })\n\n it('throws when a file-item action is rendered outside a DropzoneFileListItem', () => {\n function Harness() {\n const dropzone = useDropzone<HarnessResult, HarnessError>({ onDropFile: defaultOnDropFile })\n return (\n <Dropzone {...dropzone}>\n <DropzoneRemoveFile />\n </Dropzone>\n )\n }\n\n expect(() => render(<Harness />)).toThrow('Dropzone file actions must be used within a DropzoneFileListItem.')\n })\n\n describe('accepted files', () => {\n it('adds an accepted file and reports success through onFileUploaded', async () => {\n const onFileUploaded = vi.fn()\n const { container } = renderDropzone({ onFileUploaded })\n\n const input = getFileInput(container)\n const file = new File(['content'], 'photo.png', { type: 'image/png' })\n\n fireEvent.change(input, { target: { files: [file] } })\n\n await screen.findByText('photo.png')\n\n await waitFor(() => expect(onFileUploaded).toHaveBeenCalledWith('photo.png'))\n\n const fileItem = container.querySelector('[data-slot=\"dropzone-file-item\"]')\n expect(fileItem?.getAttribute('data-status')).toBe('success')\n })\n })\n\n describe('rejected files', () => {\n it('rejects a file with an invalid type without crashing and surfaces the allowed types', async () => {\n const onRootError = vi.fn()\n const { container } = renderDropzone({\n validation: { accept: { 'image/png': ['.png'] } },\n onRootError\n })\n\n const input = getFileInput(container)\n const invalidFile = new File(['not an image'], 'notes.txt', { type: 'text/plain' })\n\n fireEvent.change(input, { target: { files: [invalidFile] } })\n\n await waitFor(() => expect(onRootError).toHaveBeenCalled())\n expect(await screen.findByText(/only \\.png files are allowed/i)).toBeTruthy()\n\n const area = container.querySelector('[data-slot=\"dropzone-area\"]')\n expect(area?.getAttribute('aria-invalid')).toBe('true')\n })\n\n it('rejects a file exceeding maxSize without crashing and surfaces the size limit', async () => {\n const onRootError = vi.fn()\n const { container } = renderDropzone({\n validation: { maxSize: 10 },\n onRootError\n })\n\n const input = getFileInput(container)\n const largeFile = new File([new Uint8Array(1024)], 'large.png', { type: 'image/png' })\n\n fireEvent.change(input, { target: { files: [largeFile] } })\n\n await waitFor(() => expect(onRootError).toHaveBeenCalled())\n expect(await screen.findByText(/max size is 0\\.00 MB/i)).toBeTruthy()\n })\n })\n\n describe('DropzoneTrigger', () => {\n it('opens the native file picker when clicked', () => {\n const clickSpy = vi.spyOn(HTMLInputElement.prototype, 'click')\n renderDropzone()\n\n fireEvent.click(screen.getByRole('button', { name: 'Upload files' }))\n\n expect(clickSpy).toHaveBeenCalled()\n clickSpy.mockRestore()\n })\n\n it('does not open the file picker when the click is prevented', () => {\n const clickSpy = vi.spyOn(HTMLInputElement.prototype, 'click')\n\n function Harness() {\n const dropzone = useDropzone<HarnessResult, HarnessError>({ onDropFile: defaultOnDropFile })\n return (\n <Dropzone {...dropzone}>\n <DropzoneArea />\n <DropzoneTrigger onClick={(event) => event.preventDefault()}>Upload</DropzoneTrigger>\n </Dropzone>\n )\n }\n\n render(<Harness />)\n fireEvent.click(screen.getByRole('button', { name: 'Upload' }))\n\n expect(clickSpy).not.toHaveBeenCalled()\n clickSpy.mockRestore()\n })\n })\n\n describe('DropzoneRetryFile and DropzoneRemoveFile', () => {\n it('retries an errored upload and eventually reports success', async () => {\n let callCount = 0\n const onDropFile = vi.fn(async (file: File) => {\n callCount += 1\n if (callCount === 1) {\n return { status: 'error' as const, error: 'network-error' }\n }\n return { status: 'success' as const, result: file.name }\n })\n const onFileUploaded = vi.fn()\n\n const { container } = renderDropzone({ onDropFile, onFileUploaded })\n const input = getFileInput(container)\n const file = new File(['data'], 'report.pdf', { type: 'application/pdf' })\n\n fireEvent.change(input, { target: { files: [file] } })\n\n await screen.findByText('report.pdf')\n expect(await screen.findByText('network-error')).toBeTruthy()\n\n fireEvent.click(screen.getByRole('button', { name: 'Retry' }))\n\n await waitFor(() => {\n const fileItem = container.querySelector('[data-slot=\"dropzone-file-item\"]')\n expect(fileItem?.getAttribute('data-status')).toBe('success')\n })\n\n expect(onFileUploaded).toHaveBeenCalledWith('report.pdf')\n expect(screen.getByRole('button', { name: 'Retry' }).hasAttribute('disabled')).toBe(true)\n })\n\n it('removes a file from the list when the remove button is clicked', async () => {\n const onRemoveFile = vi.fn()\n const { container } = renderDropzone({ onRemoveFile })\n\n const input = getFileInput(container)\n const file = new File(['data'], 'image.png', { type: 'image/png' })\n\n fireEvent.change(input, { target: { files: [file] } })\n await screen.findByText('image.png')\n\n fireEvent.click(screen.getByRole('button', { name: 'Remove' }))\n\n await waitFor(() => expect(screen.queryByText('image.png')).toBeNull())\n expect(onRemoveFile).toHaveBeenCalledTimes(1)\n })\n })\n\n describe('InfiniteProgress', () => {\n it('reflects the pending, error, and success statuses on the progressbar', () => {\n const { rerender } = render(<InfiniteProgress status=\"pending\" />)\n\n const progress = screen.getByRole('progressbar')\n expect(progress.getAttribute('aria-valuetext')).toBe('indeterminate')\n expect(progress.getAttribute('data-status')).toBe('pending')\n\n rerender(<InfiniteProgress status=\"error\" />)\n expect(screen.getByRole('progressbar').getAttribute('aria-valuetext')).toBe('error')\n\n rerender(<InfiniteProgress status=\"success\" />)\n expect(screen.getByRole('progressbar').getAttribute('aria-valuetext')).toBe('100%')\n })\n\n it('forwards the ref to the progressbar element', () => {\n const ref = createRef<HTMLDivElement>()\n render(<InfiniteProgress ref={ref} status=\"pending\" />)\n\n expect(ref.current).toBe(screen.getByRole('progressbar'))\n })\n })\n})\n"],"mappings":"kTAuBA,SAAS,kBAAkB,EAAY,CAC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AAA,CAAC,EAC9C,OAAO,EAAO,UAAU,aAAa,CAAC,CAAC,aAAa,gBAAgB,CAAC,CAAC,CAAC,KAAK,MAAM,CACpF,CAAC,EAED,GAAG,kDAAqD,CACtD,IAAM,EAAM,EAA0B,EACtC,EAAO,EAAC,EAAD,CAAuB,MAAK,OAAO,SAAW,CAAA,CAAC,EAEtD,OAAO,EAAI,OAAO,CAAC,CAAC,KAAK,EAAO,UAAU,aAAa,CAAC,CAC1D,CAAC,CACH,CAAC,CACH,CAAC"}
@@ -1,21 +1,2 @@
1
- import { n as __name } from "../rolldown-runtime-Bdj-bS2b.js";
2
- import { VariantProps } from "class-variance-authority";
3
- //#region src/components/empty.d.ts
4
- type EmptyProps = React.ComponentProps<'div'>;
5
- type EmptyHeaderProps = React.ComponentProps<'div'>;
6
- type EmptyMediaProps = React.ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>;
7
- type EmptyTitleProps = React.ComponentProps<'div'>;
8
- type EmptyDescriptionProps = React.ComponentProps<'p'>;
9
- type EmptyContentProps = React.ComponentProps<'div'>;
10
- declare function Empty({ className, ...props }: EmptyProps): import("react").JSX.Element;
11
- declare function EmptyHeader({ className, ...props }: EmptyHeaderProps): import("react").JSX.Element;
12
- declare const emptyMediaVariants: (props?: ({
13
- variant?: "default" | "icon" | null | undefined;
14
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
15
- declare function EmptyMedia({ className, variant, ...props }: EmptyMediaProps): import("react").JSX.Element;
16
- declare function EmptyTitle({ className, ...props }: EmptyTitleProps): import("react").JSX.Element;
17
- declare function EmptyDescription({ className, ...props }: EmptyDescriptionProps): import("react").JSX.Element;
18
- declare function EmptyContent({ className, ...props }: EmptyContentProps): import("react").JSX.Element;
19
- //#endregion
20
- export { Empty, EmptyContent, EmptyContentProps, EmptyDescription, EmptyDescriptionProps, EmptyHeader, EmptyHeaderProps, EmptyMedia, EmptyMediaProps, EmptyProps, EmptyTitle, EmptyTitleProps };
21
- //# sourceMappingURL=empty.d.ts.map
1
+ import { a as EmptyDescriptionProps, c as EmptyMedia, d as EmptyTitle, f as EmptyTitleProps, i as EmptyDescription, l as EmptyMediaProps, n as EmptyContent, o as EmptyHeader, r as EmptyContentProps, s as EmptyHeaderProps, t as Empty, u as EmptyProps } from "../empty-D8ZiTCVK.js";
2
+ export { Empty, EmptyContent, EmptyContentProps, EmptyDescription, EmptyDescriptionProps, EmptyHeader, EmptyHeaderProps, EmptyMedia, EmptyMediaProps, EmptyProps, EmptyTitle, EmptyTitleProps };
@@ -1,2 +1 @@
1
- import"../rolldown-runtime-Bdj-bS2b.js";import{cn as e}from"../lib/utils.js";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";function Empty({className:n,...r}){return t(`div`,{"data-slot":`empty`,className:e(`gap-4 rounded-xl border-dashed p-6 flex w-full min-w-0 flex-1 flex-col items-center justify-center text-center text-balance`,n),...r})}function EmptyHeader({className:n,...r}){return t(`div`,{"data-slot":`empty-header`,className:e(`gap-2 flex max-w-sm flex-col items-center`,n),...r})}const r=n(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`bg-muted text-foreground flex size-8 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function EmptyMedia({className:n,variant:i=`default`,...a}){return t(`div`,{"data-slot":`empty-icon`,"data-variant":i,className:e(r({variant:i,className:n})),...a})}function EmptyTitle({className:n,...r}){return t(`div`,{"data-slot":`empty-title`,className:e(`text-sm font-medium tracking-tight`,n),...r})}function EmptyDescription({className:n,...r}){return t(`div`,{"data-slot":`empty-description`,className:e(`text-sm/relaxed text-muted-foreground [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,n),...r})}function EmptyContent({className:n,...r}){return t(`div`,{"data-slot":`empty-content`,className:e(`gap-2.5 text-sm flex w-full max-w-sm min-w-0 flex-col items-center text-balance`,n),...r})}export{Empty,EmptyContent,EmptyDescription,EmptyHeader,EmptyMedia,EmptyTitle};
2
- //# sourceMappingURL=empty.js.map
1
+ import{a as e,i as t,n,o as r,r as i,t as a}from"../empty-BhKsDYZ5.js";export{a as Empty,n as EmptyContent,i as EmptyDescription,t as EmptyHeader,e as EmptyMedia,r as EmptyTitle};
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,2 @@
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{a as e,i as t,n,o as r,r as i,t as a}from"../empty-BhKsDYZ5.js";import{a as o,r as s}from"../react.esm-BkhVXJ8s.js";import{jsx as c,jsxs as l}from"react/jsx-runtime";describe(`Empty`,()=>{it(`renders the root container with its data-slot and base classes`,()=>{let{container:e}=s(c(a,{children:`No results`})),t=e.querySelector(`[data-slot="empty"]`);expect(t).not.toBeNull(),expect(t?.className).toContain(`flex`),expect(t?.className).toContain(`rounded-xl`),expect(t?.textContent).toBe(`No results`)}),it(`renders EmptyHeader with its data-slot`,()=>{let{container:e}=s(c(t,{children:`Header`})),n=e.querySelector(`[data-slot="empty-header"]`);expect(n).not.toBeNull(),expect(n?.className).toContain(`flex-col`)}),it(`renders EmptyMedia with the default variant`,()=>{let{container:t}=s(c(e,{children:`icon`})),n=t.querySelector(`[data-slot="empty-icon"]`);expect(n?.getAttribute(`data-variant`)).toBe(`default`),expect(n?.className).toContain(`bg-transparent`)}),it(`renders EmptyMedia with the icon variant classes`,()=>{let{container:t}=s(c(e,{variant:`icon`,children:`icon`})),n=t.querySelector(`[data-slot="empty-icon"]`);expect(n?.getAttribute(`data-variant`)).toBe(`icon`),expect(n?.className).toContain(`bg-muted`),expect(n?.className).toContain(`rounded-lg`)}),it(`renders EmptyTitle with its data-slot`,()=>{s(c(r,{children:`Nothing here`}));let e=o.getByText(`Nothing here`);expect(e.getAttribute(`data-slot`)).toBe(`empty-title`),expect(e.className).toContain(`font-medium`)}),it(`renders EmptyDescription with its data-slot`,()=>{s(c(i,{children:`Try adjusting your filters`}));let e=o.getByText(`Try adjusting your filters`);expect(e.getAttribute(`data-slot`)).toBe(`empty-description`),expect(e.className).toContain(`text-muted-foreground`)}),it(`renders EmptyContent with its data-slot`,()=>{let{container:e}=s(c(n,{children:c(`button`,{type:`button`,children:`Retry`})})),t=e.querySelector(`[data-slot="empty-content"]`);expect(t).not.toBeNull(),expect(o.getByRole(`button`,{name:`Retry`})).not.toBeNull()}),it(`composes a full empty state with header, media, title, description and content`,()=>{let{container:u}=s(l(a,{children:[l(t,{children:[c(e,{variant:`icon`,children:`*`}),c(r,{children:`No projects`}),c(i,{children:`Create your first project to get started`})]}),c(n,{children:c(`button`,{type:`button`,children:`Create project`})})]})),d=u.querySelector(`[data-slot="empty"]`);expect(d?.querySelector(`[data-slot="empty-header"]`)).not.toBeNull(),expect(d?.querySelector(`[data-slot="empty-icon"]`)).not.toBeNull(),expect(o.getByText(`No projects`)).not.toBeNull(),expect(o.getByText(`Create your first project to get started`)).not.toBeNull(),expect(d?.querySelector(`[data-slot="empty-content"]`)).not.toBeNull()}),it(`merges custom className with the base classes`,()=>{let{container:e}=s(c(a,{className:`my-custom-class`,children:`Content`})),t=e.querySelector(`[data-slot="empty"]`);expect(t?.className).toContain(`my-custom-class`),expect(t?.className).toContain(`flex`)})});
2
+ //# sourceMappingURL=empty.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty.spec.js","names":[],"sources":["../../src/components/empty.spec.tsx"],"sourcesContent":["import { render, screen } from '@testing-library/react'\n\nimport { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from './empty'\n\ndescribe('Empty', () => {\n it('renders the root container with its data-slot and base classes', () => {\n const { container } = render(<Empty>No results</Empty>)\n\n const empty = container.querySelector('[data-slot=\"empty\"]')\n expect(empty).not.toBeNull()\n expect(empty?.className).toContain('flex')\n expect(empty?.className).toContain('rounded-xl')\n expect(empty?.textContent).toBe('No results')\n })\n\n it('renders EmptyHeader with its data-slot', () => {\n const { container } = render(<EmptyHeader>Header</EmptyHeader>)\n const header = container.querySelector('[data-slot=\"empty-header\"]')\n\n expect(header).not.toBeNull()\n expect(header?.className).toContain('flex-col')\n })\n\n it('renders EmptyMedia with the default variant', () => {\n const { container } = render(<EmptyMedia>icon</EmptyMedia>)\n const media = container.querySelector('[data-slot=\"empty-icon\"]')\n\n expect(media?.getAttribute('data-variant')).toBe('default')\n expect(media?.className).toContain('bg-transparent')\n })\n\n it('renders EmptyMedia with the icon variant classes', () => {\n const { container } = render(<EmptyMedia variant=\"icon\">icon</EmptyMedia>)\n const media = container.querySelector('[data-slot=\"empty-icon\"]')\n\n expect(media?.getAttribute('data-variant')).toBe('icon')\n expect(media?.className).toContain('bg-muted')\n expect(media?.className).toContain('rounded-lg')\n })\n\n it('renders EmptyTitle with its data-slot', () => {\n render(<EmptyTitle>Nothing here</EmptyTitle>)\n const title = screen.getByText('Nothing here')\n\n expect(title.getAttribute('data-slot')).toBe('empty-title')\n expect(title.className).toContain('font-medium')\n })\n\n it('renders EmptyDescription with its data-slot', () => {\n render(<EmptyDescription>Try adjusting your filters</EmptyDescription>)\n const description = screen.getByText('Try adjusting your filters')\n\n expect(description.getAttribute('data-slot')).toBe('empty-description')\n expect(description.className).toContain('text-muted-foreground')\n })\n\n it('renders EmptyContent with its data-slot', () => {\n const { container } = render(\n <EmptyContent>\n <button type=\"button\">Retry</button>\n </EmptyContent>\n )\n const content = container.querySelector('[data-slot=\"empty-content\"]')\n\n expect(content).not.toBeNull()\n expect(screen.getByRole('button', { name: 'Retry' })).not.toBeNull()\n })\n\n it('composes a full empty state with header, media, title, description and content', () => {\n const { container } = render(\n <Empty>\n <EmptyHeader>\n <EmptyMedia variant=\"icon\">*</EmptyMedia>\n <EmptyTitle>No projects</EmptyTitle>\n <EmptyDescription>Create your first project to get started</EmptyDescription>\n </EmptyHeader>\n <EmptyContent>\n <button type=\"button\">Create project</button>\n </EmptyContent>\n </Empty>\n )\n\n const root = container.querySelector('[data-slot=\"empty\"]')\n expect(root?.querySelector('[data-slot=\"empty-header\"]')).not.toBeNull()\n expect(root?.querySelector('[data-slot=\"empty-icon\"]')).not.toBeNull()\n expect(screen.getByText('No projects')).not.toBeNull()\n expect(screen.getByText('Create your first project to get started')).not.toBeNull()\n expect(root?.querySelector('[data-slot=\"empty-content\"]')).not.toBeNull()\n })\n\n it('merges custom className with the base classes', () => {\n const { container } = render(<Empty className=\"my-custom-class\">Content</Empty>)\n const empty = container.querySelector('[data-slot=\"empty\"]')\n\n expect(empty?.className).toContain('my-custom-class')\n expect(empty?.className).toContain('flex')\n })\n})\n"],"mappings":"qNAIA,SAAS,YAAe,CACtB,GAAG,qEAAwE,CACzE,GAAM,CAAE,aAAc,EAAO,EAAC,EAAD,CAAA,SAAO,YAAiB,CAAA,CAAC,EAEhD,EAAQ,EAAU,cAAc,qBAAqB,EAC3D,OAAO,CAAK,CAAC,CAAC,IAAI,SAAS,EAC3B,OAAO,GAAO,SAAS,CAAC,CAAC,UAAU,MAAM,EACzC,OAAO,GAAO,SAAS,CAAC,CAAC,UAAU,YAAY,EAC/C,OAAO,GAAO,WAAW,CAAC,CAAC,KAAK,YAAY,CAC9C,CAAC,EAED,GAAG,6CAAgD,CACjD,GAAM,CAAE,aAAc,EAAO,EAAC,EAAD,CAAA,SAAa,QAAmB,CAAA,CAAC,EACxD,EAAS,EAAU,cAAc,4BAA4B,EAEnE,OAAO,CAAM,CAAC,CAAC,IAAI,SAAS,EAC5B,OAAO,GAAQ,SAAS,CAAC,CAAC,UAAU,UAAU,CAChD,CAAC,EAED,GAAG,kDAAqD,CACtD,GAAM,CAAE,aAAc,EAAO,EAAC,EAAD,CAAA,SAAY,MAAgB,CAAA,CAAC,EACpD,EAAQ,EAAU,cAAc,0BAA0B,EAEhE,OAAO,GAAO,aAAa,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,EAC1D,OAAO,GAAO,SAAS,CAAC,CAAC,UAAU,gBAAgB,CACrD,CAAC,EAED,GAAG,uDAA0D,CAC3D,GAAM,CAAE,aA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D,CAAA,SAAY,aAAuB,CAAA,EACnC,EAAC,EAAD,CAAA,SAAkB,0CAA0D,CAAA,CACjE,CAAA,CAAA,EACb,EAAC,EAAD,CAAA,SACE,EAAC,SAAD,CAAQ,KAAK,SAAS,SAAA,gBAAsB,CAAA,CAChC,CAAA,CACT,CAAA,CAAA,CACT,EAEM,EAAO,EAAU,cAAc,qBAAqB,EAC1D,OAAO,GAAM,cAAc,4BAA4B,CAAC,CAAC,CAAC,IAAI,SAAS,EACvE,OAAO,GAAM,cAAc,0BAA0B,CAAC,CAAC,CAAC,IAAI,SAAS,EACrE,OAAO,EAAO,UAAU,aAAa,CAAC,CAAC,CAAC,IAAI,SAAS,EACrD,OAAO,EAAO,UAAU,0CAA0C,CAAC,CAAC,CAAC,IAAI,SAAS,EAClF,OAAO,GAAM,cAAc,6BAA6B,CAAC,CAAC,CAAC,IAAI,SAAS,CAC1E,CAAC,EAED,GAAG,oDAAuD,CACxD,GAAM,CAAE,aAAc,EAAO,EAAC,EAAD,CAAO,UAAU,kBAAkB,SAAA,SAAc,CAAA,CAAC,EACzE,EAAQ,EAAU,cAAc,qBAAqB,EAE3D,OAAO,GAAO,SAAS,CAAC,CAAC,UAAU,iBAAiB,EACpD,OAAO,GAAO,SAAS,CAAC,CAAC,UAAU,MAAM,CAC3C,CAAC,CACH,CAAC"}
@@ -1,39 +1,2 @@
1
- import { n as __name } from "../rolldown-runtime-Bdj-bS2b.js";
2
- import { Label } from "./label.js";
3
- import { VariantProps } from "class-variance-authority";
4
- //#region src/components/field.d.ts
5
- type FieldSetProps = React.ComponentProps<'fieldset'>;
6
- type FieldLegendProps = React.ComponentProps<'legend'> & {
7
- variant?: 'legend' | 'label';
8
- };
9
- type FieldGroupProps = React.ComponentProps<'div'>;
10
- type FieldContentProps = React.ComponentProps<'div'>;
11
- type FieldLabelProps = React.ComponentProps<typeof Label>;
12
- type FieldTitleProps = React.ComponentProps<'div'>;
13
- type FieldDescriptionProps = React.ComponentProps<'p'>;
14
- type FieldSeparatorProps = React.ComponentProps<'div'> & {
15
- children?: React.ReactNode;
16
- };
17
- type FieldErrorProps = React.ComponentProps<'div'> & {
18
- errors?: Array<{
19
- message?: string;
20
- } | undefined>;
21
- };
22
- declare function useFieldControlId(id?: string): string | undefined;
23
- declare function FieldSet({ className, ...props }: FieldSetProps): import("react").JSX.Element;
24
- declare function FieldLegend({ className, variant, ...props }: FieldLegendProps): import("react").JSX.Element;
25
- declare function FieldGroup({ className, ...props }: FieldGroupProps): import("react").JSX.Element;
26
- declare const fieldVariants: (props?: ({
27
- orientation?: "horizontal" | "responsive" | "vertical" | null | undefined;
28
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
29
- type FieldProps = React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>;
30
- declare function Field({ className, orientation, ...props }: FieldProps): import("react").JSX.Element;
31
- declare function FieldContent({ className, ...props }: FieldContentProps): import("react").JSX.Element;
32
- declare function FieldLabel({ className, htmlFor, ...props }: FieldLabelProps): import("react").JSX.Element;
33
- declare function FieldTitle({ className, ...props }: FieldTitleProps): import("react").JSX.Element;
34
- declare function FieldDescription({ className, ...props }: FieldDescriptionProps): import("react").JSX.Element;
35
- declare function FieldSeparator({ children, className, ...props }: FieldSeparatorProps): import("react").JSX.Element;
36
- declare function FieldError({ className, children, errors, ...props }: FieldErrorProps): import("react").JSX.Element | null;
37
- //#endregion
38
- export { Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps, useFieldControlId };
39
- //# sourceMappingURL=field.d.ts.map
1
+ import { _ as FieldSet, a as FieldDescriptionProps, b as FieldTitleProps, c as FieldGroup, d as FieldLabelProps, f as FieldLegend, g as FieldSeparatorProps, h as FieldSeparator, i as FieldDescription, l as FieldGroupProps, m as FieldProps, n as FieldContent, o as FieldError, p as FieldLegendProps, r as FieldContentProps, s as FieldErrorProps, t as Field, u as FieldLabel, v as FieldSetProps, x as useFieldControlId, y as FieldTitle } from "../field-C209yHO9.js";
2
+ export { Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps, useFieldControlId };