@codefast/ui 0.0.9 → 0.0.11

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 (434) hide show
  1. package/dist/accordion.d.mts +7 -7
  2. package/dist/accordion.d.ts +7 -7
  3. package/dist/accordion.js +42 -32
  4. package/dist/accordion.js.map +1 -1
  5. package/dist/accordion.mjs +42 -32
  6. package/dist/accordion.mjs.map +1 -1
  7. package/dist/alert-dialog.d.mts +12 -12
  8. package/dist/alert-dialog.d.ts +12 -12
  9. package/dist/alert-dialog.js +47 -75
  10. package/dist/alert-dialog.js.map +1 -1
  11. package/dist/alert-dialog.mjs +47 -75
  12. package/dist/alert-dialog.mjs.map +1 -1
  13. package/dist/alert.js +5 -30
  14. package/dist/alert.js.map +1 -1
  15. package/dist/alert.mjs +5 -30
  16. package/dist/alert.mjs.map +1 -1
  17. package/dist/aspect-ratio.d.mts +1 -1
  18. package/dist/aspect-ratio.d.ts +1 -1
  19. package/dist/aspect-ratio.js.map +1 -1
  20. package/dist/aspect-ratio.mjs.map +1 -1
  21. package/dist/avatar.d.mts +6 -6
  22. package/dist/avatar.d.ts +6 -6
  23. package/dist/avatar.js +3 -16
  24. package/dist/avatar.js.map +1 -1
  25. package/dist/avatar.mjs +3 -16
  26. package/dist/avatar.mjs.map +1 -1
  27. package/dist/badge.js +1 -5
  28. package/dist/badge.js.map +1 -1
  29. package/dist/badge.mjs +1 -5
  30. package/dist/badge.mjs.map +1 -1
  31. package/dist/blockquote.js +4 -6
  32. package/dist/blockquote.js.map +1 -1
  33. package/dist/blockquote.mjs +4 -6
  34. package/dist/blockquote.mjs.map +1 -1
  35. package/dist/box.js +4 -6
  36. package/dist/box.js.map +1 -1
  37. package/dist/box.mjs +4 -6
  38. package/dist/box.mjs.map +1 -1
  39. package/dist/breadcrumb.js +30 -67
  40. package/dist/breadcrumb.js.map +1 -1
  41. package/dist/breadcrumb.mjs +30 -67
  42. package/dist/breadcrumb.mjs.map +1 -1
  43. package/dist/button.d.mts +1 -0
  44. package/dist/button.d.ts +1 -0
  45. package/dist/button.js +3 -2
  46. package/dist/button.mjs +2 -1
  47. package/dist/calendar.js +7 -19
  48. package/dist/calendar.js.map +1 -1
  49. package/dist/calendar.mjs +6 -18
  50. package/dist/calendar.mjs.map +1 -1
  51. package/dist/card.js +8 -55
  52. package/dist/card.js.map +1 -1
  53. package/dist/card.mjs +8 -55
  54. package/dist/card.mjs.map +1 -1
  55. package/dist/carousel.js +58 -64
  56. package/dist/carousel.js.map +1 -1
  57. package/dist/carousel.mjs +57 -63
  58. package/dist/carousel.mjs.map +1 -1
  59. package/dist/checkbox-cards.d.mts +15 -0
  60. package/dist/checkbox-cards.d.ts +15 -0
  61. package/dist/checkbox-cards.js +56 -0
  62. package/dist/checkbox-cards.js.map +1 -0
  63. package/dist/checkbox-cards.mjs +56 -0
  64. package/dist/checkbox-cards.mjs.map +1 -0
  65. package/dist/checkbox-group.d.mts +13 -0
  66. package/dist/checkbox-group.d.ts +13 -0
  67. package/dist/checkbox-group.js +44 -0
  68. package/dist/checkbox-group.js.map +1 -0
  69. package/dist/checkbox-group.mjs +44 -0
  70. package/dist/checkbox-group.mjs.map +1 -0
  71. package/dist/checkbox-group.primitive.d.mts +38 -0
  72. package/dist/checkbox-group.primitive.d.ts +38 -0
  73. package/dist/checkbox-group.primitive.js +19 -0
  74. package/dist/checkbox-group.primitive.js.map +1 -0
  75. package/dist/checkbox-group.primitive.mjs +19 -0
  76. package/dist/checkbox-group.primitive.mjs.map +1 -0
  77. package/dist/checkbox.d.mts +2 -2
  78. package/dist/checkbox.d.ts +2 -2
  79. package/dist/checkbox.js +5 -1
  80. package/dist/checkbox.js.map +1 -1
  81. package/dist/checkbox.mjs +5 -1
  82. package/dist/checkbox.mjs.map +1 -1
  83. package/dist/chunk-3ZZ3SRTJ.js +148 -0
  84. package/dist/chunk-3ZZ3SRTJ.js.map +1 -0
  85. package/dist/{chunk-MJDKD2K4.mjs → chunk-6J6VPUBP.mjs} +9 -10
  86. package/dist/chunk-6J6VPUBP.mjs.map +1 -0
  87. package/dist/{chunk-PKB2G726.js → chunk-7S4DOWLB.js} +9 -10
  88. package/dist/chunk-7S4DOWLB.js.map +1 -0
  89. package/dist/{chunk-JOJW7BBY.js → chunk-BWCO2ZQQ.js} +29 -8
  90. package/dist/chunk-BWCO2ZQQ.js.map +1 -0
  91. package/dist/chunk-EWS3N4OZ.mjs +148 -0
  92. package/dist/chunk-EWS3N4OZ.mjs.map +1 -0
  93. package/dist/{chunk-PIU627A3.mjs → chunk-FGI3JA75.mjs} +1 -1
  94. package/dist/chunk-FGI3JA75.mjs.map +1 -0
  95. package/dist/{chunk-GRKABVK4.js → chunk-IVYGBU4G.js} +1 -1
  96. package/dist/chunk-IVYGBU4G.js.map +1 -0
  97. package/dist/chunk-IXEJO7ZP.js +86 -0
  98. package/dist/chunk-IXEJO7ZP.js.map +1 -0
  99. package/dist/chunk-JULVZPCS.mjs +120 -0
  100. package/dist/chunk-JULVZPCS.mjs.map +1 -0
  101. package/dist/chunk-LNSEYAPJ.js +121 -0
  102. package/dist/chunk-LNSEYAPJ.js.map +1 -0
  103. package/dist/chunk-MDSPK3M6.js +54 -0
  104. package/dist/chunk-MDSPK3M6.js.map +1 -0
  105. package/dist/chunk-MOJNV3XZ.js +120 -0
  106. package/dist/chunk-MOJNV3XZ.js.map +1 -0
  107. package/dist/chunk-OK63Q6EJ.mjs +121 -0
  108. package/dist/chunk-OK63Q6EJ.mjs.map +1 -0
  109. package/dist/chunk-V2254PQL.mjs +54 -0
  110. package/dist/chunk-V2254PQL.mjs.map +1 -0
  111. package/dist/chunk-WFXEFJRB.mjs +77 -0
  112. package/dist/chunk-WFXEFJRB.mjs.map +1 -0
  113. package/dist/chunk-XCKLBP2V.mjs +86 -0
  114. package/dist/chunk-XCKLBP2V.mjs.map +1 -0
  115. package/dist/code.js +4 -6
  116. package/dist/code.js.map +1 -1
  117. package/dist/code.mjs +4 -6
  118. package/dist/code.mjs.map +1 -1
  119. package/dist/collapsible.d.mts +3 -3
  120. package/dist/collapsible.d.ts +3 -3
  121. package/dist/collapsible.js.map +1 -1
  122. package/dist/collapsible.mjs.map +1 -1
  123. package/dist/command.d.mts +11 -10
  124. package/dist/command.d.ts +11 -10
  125. package/dist/command.js +10 -44
  126. package/dist/command.js.map +1 -1
  127. package/dist/command.mjs +10 -44
  128. package/dist/command.mjs.map +1 -1
  129. package/dist/container.js +4 -6
  130. package/dist/container.js.map +1 -1
  131. package/dist/container.mjs +4 -6
  132. package/dist/container.mjs.map +1 -1
  133. package/dist/context-menu.d.mts +18 -18
  134. package/dist/context-menu.d.ts +18 -18
  135. package/dist/context-menu.js +108 -124
  136. package/dist/context-menu.js.map +1 -1
  137. package/dist/context-menu.mjs +109 -125
  138. package/dist/context-menu.mjs.map +1 -1
  139. package/dist/data-table.d.mts +1 -1
  140. package/dist/data-table.d.ts +1 -1
  141. package/dist/data-table.js +131 -149
  142. package/dist/data-table.js.map +1 -1
  143. package/dist/data-table.mjs +120 -138
  144. package/dist/data-table.mjs.map +1 -1
  145. package/dist/dialog.d.mts +9 -9
  146. package/dist/dialog.d.ts +9 -9
  147. package/dist/dialog.js +2 -2
  148. package/dist/dialog.mjs +1 -1
  149. package/dist/drawer.d.mts +2 -2
  150. package/dist/drawer.d.ts +2 -2
  151. package/dist/drawer.js +30 -63
  152. package/dist/drawer.js.map +1 -1
  153. package/dist/drawer.mjs +30 -63
  154. package/dist/drawer.mjs.map +1 -1
  155. package/dist/dropdown-menu.d.mts +16 -16
  156. package/dist/dropdown-menu.d.ts +16 -16
  157. package/dist/dropdown-menu.js +2 -2
  158. package/dist/dropdown-menu.mjs +1 -1
  159. package/dist/em.js +4 -6
  160. package/dist/em.js.map +1 -1
  161. package/dist/em.mjs +4 -6
  162. package/dist/em.mjs.map +1 -1
  163. package/dist/form.js +23 -54
  164. package/dist/form.js.map +1 -1
  165. package/dist/form.mjs +23 -54
  166. package/dist/form.mjs.map +1 -1
  167. package/dist/heading.js +4 -6
  168. package/dist/heading.js.map +1 -1
  169. package/dist/heading.mjs +4 -6
  170. package/dist/heading.mjs.map +1 -1
  171. package/dist/hover-card.d.mts +4 -4
  172. package/dist/hover-card.d.ts +4 -4
  173. package/dist/hover-card.js +15 -13
  174. package/dist/hover-card.js.map +1 -1
  175. package/dist/hover-card.mjs +15 -13
  176. package/dist/hover-card.mjs.map +1 -1
  177. package/dist/input-otp.js +32 -37
  178. package/dist/input-otp.js.map +1 -1
  179. package/dist/input-otp.mjs +32 -37
  180. package/dist/input-otp.mjs.map +1 -1
  181. package/dist/input.js +10 -14
  182. package/dist/input.js.map +1 -1
  183. package/dist/input.mjs +10 -14
  184. package/dist/input.mjs.map +1 -1
  185. package/dist/kbd.js +14 -16
  186. package/dist/kbd.js.map +1 -1
  187. package/dist/kbd.mjs +14 -16
  188. package/dist/kbd.mjs.map +1 -1
  189. package/dist/label.d.mts +2 -2
  190. package/dist/label.d.ts +2 -2
  191. package/dist/label.js +2 -2
  192. package/dist/label.mjs +1 -1
  193. package/dist/menubar.d.mts +21 -21
  194. package/dist/menubar.d.ts +21 -21
  195. package/dist/menubar.js +73 -93
  196. package/dist/menubar.js.map +1 -1
  197. package/dist/menubar.mjs +74 -94
  198. package/dist/menubar.mjs.map +1 -1
  199. package/dist/navigation-menu.d.mts +16 -16
  200. package/dist/navigation-menu.d.ts +16 -16
  201. package/dist/navigation-menu.js +89 -93
  202. package/dist/navigation-menu.js.map +1 -1
  203. package/dist/navigation-menu.mjs +89 -93
  204. package/dist/navigation-menu.mjs.map +1 -1
  205. package/dist/pagination.js +19 -58
  206. package/dist/pagination.js.map +1 -1
  207. package/dist/pagination.mjs +19 -58
  208. package/dist/pagination.mjs.map +1 -1
  209. package/dist/popover.d.mts +7 -7
  210. package/dist/popover.d.ts +7 -7
  211. package/dist/popover.js +16 -21
  212. package/dist/popover.js.map +1 -1
  213. package/dist/popover.mjs +16 -21
  214. package/dist/popover.mjs.map +1 -1
  215. package/dist/pre.js +4 -6
  216. package/dist/pre.js.map +1 -1
  217. package/dist/pre.mjs +4 -6
  218. package/dist/pre.mjs.map +1 -1
  219. package/dist/progress.d.mts +2 -2
  220. package/dist/progress.d.ts +2 -2
  221. package/dist/progress.js +1 -4
  222. package/dist/progress.js.map +1 -1
  223. package/dist/progress.mjs +1 -4
  224. package/dist/progress.mjs.map +1 -1
  225. package/dist/quote.js +4 -6
  226. package/dist/quote.js.map +1 -1
  227. package/dist/quote.mjs +4 -6
  228. package/dist/quote.mjs.map +1 -1
  229. package/dist/radio-cards.d.mts +9 -0
  230. package/dist/radio-cards.d.ts +9 -0
  231. package/dist/radio-cards.js +36 -0
  232. package/dist/radio-cards.js.map +1 -0
  233. package/dist/radio-cards.mjs +36 -0
  234. package/dist/radio-cards.mjs.map +1 -0
  235. package/dist/radio-group.d.mts +4 -4
  236. package/dist/radio-group.d.ts +4 -4
  237. package/dist/radio-group.js +3 -9
  238. package/dist/radio-group.js.map +1 -1
  239. package/dist/radio-group.mjs +3 -9
  240. package/dist/radio-group.mjs.map +1 -1
  241. package/dist/radio.d.mts +8 -0
  242. package/dist/radio.d.ts +8 -0
  243. package/dist/radio.js +35 -0
  244. package/dist/radio.js.map +1 -0
  245. package/dist/radio.mjs +35 -0
  246. package/dist/radio.mjs.map +1 -0
  247. package/dist/resizable.d.mts +2 -2
  248. package/dist/resizable.d.ts +2 -2
  249. package/dist/resizable.js +3 -5
  250. package/dist/resizable.js.map +1 -1
  251. package/dist/resizable.mjs +3 -5
  252. package/dist/resizable.mjs.map +1 -1
  253. package/dist/scroll-area.d.mts +4 -4
  254. package/dist/scroll-area.d.ts +4 -4
  255. package/dist/scroll-area.js +23 -29
  256. package/dist/scroll-area.js.map +1 -1
  257. package/dist/scroll-area.mjs +23 -29
  258. package/dist/scroll-area.mjs.map +1 -1
  259. package/dist/section.js +4 -6
  260. package/dist/section.js.map +1 -1
  261. package/dist/section.mjs +4 -6
  262. package/dist/section.mjs.map +1 -1
  263. package/dist/segmented.d.mts +22 -0
  264. package/dist/segmented.d.ts +22 -0
  265. package/dist/segmented.js +126 -0
  266. package/dist/segmented.js.map +1 -0
  267. package/dist/segmented.mjs +126 -0
  268. package/dist/segmented.mjs.map +1 -0
  269. package/dist/select.d.mts +17 -17
  270. package/dist/select.d.ts +17 -17
  271. package/dist/select.js +2 -2
  272. package/dist/select.mjs +1 -1
  273. package/dist/separator.d.mts +2 -2
  274. package/dist/separator.d.ts +2 -2
  275. package/dist/separator.js +1 -5
  276. package/dist/separator.js.map +1 -1
  277. package/dist/separator.mjs +1 -5
  278. package/dist/separator.mjs.map +1 -1
  279. package/dist/sheet.d.mts +9 -9
  280. package/dist/sheet.d.ts +9 -9
  281. package/dist/sheet.js +35 -76
  282. package/dist/sheet.js.map +1 -1
  283. package/dist/sheet.mjs +35 -76
  284. package/dist/sheet.mjs.map +1 -1
  285. package/dist/skeleton.js +1 -7
  286. package/dist/skeleton.js.map +1 -1
  287. package/dist/skeleton.mjs +1 -7
  288. package/dist/skeleton.mjs.map +1 -1
  289. package/dist/slider.d.mts +2 -2
  290. package/dist/slider.d.ts +2 -2
  291. package/dist/slider.js +10 -5
  292. package/dist/slider.js.map +1 -1
  293. package/dist/slider.mjs +10 -5
  294. package/dist/slider.mjs.map +1 -1
  295. package/dist/sonner.js +1 -6
  296. package/dist/sonner.js.map +1 -1
  297. package/dist/sonner.mjs +1 -6
  298. package/dist/sonner.mjs.map +1 -1
  299. package/dist/spinner.d.mts +8 -0
  300. package/dist/spinner.d.ts +8 -0
  301. package/dist/spinner.js +8 -0
  302. package/dist/spinner.js.map +1 -0
  303. package/dist/spinner.mjs +8 -0
  304. package/dist/spinner.mjs.map +1 -0
  305. package/dist/strong.js +4 -6
  306. package/dist/strong.js.map +1 -1
  307. package/dist/strong.mjs +4 -6
  308. package/dist/strong.mjs.map +1 -1
  309. package/dist/styles.css +1 -1
  310. package/dist/styles.css.map +1 -1
  311. package/dist/switch.d.mts +2 -2
  312. package/dist/switch.d.ts +2 -2
  313. package/dist/switch.js +2 -1
  314. package/dist/switch.js.map +1 -1
  315. package/dist/switch.mjs +2 -1
  316. package/dist/switch.mjs.map +1 -1
  317. package/dist/table.js +22 -80
  318. package/dist/table.js.map +1 -1
  319. package/dist/table.mjs +22 -80
  320. package/dist/table.mjs.map +1 -1
  321. package/dist/tabs.d.mts +7 -7
  322. package/dist/tabs.d.ts +7 -7
  323. package/dist/tabs.js +4 -2
  324. package/dist/tabs.js.map +1 -1
  325. package/dist/tabs.mjs +4 -2
  326. package/dist/tabs.mjs.map +1 -1
  327. package/dist/text.js +4 -6
  328. package/dist/text.js.map +1 -1
  329. package/dist/text.mjs +4 -6
  330. package/dist/text.mjs.map +1 -1
  331. package/dist/textarea.js +14 -15
  332. package/dist/textarea.js.map +1 -1
  333. package/dist/textarea.mjs +14 -15
  334. package/dist/textarea.mjs.map +1 -1
  335. package/dist/toggle-group.d.mts +2 -2
  336. package/dist/toggle-group.d.ts +2 -2
  337. package/dist/toggle-group.js +41 -34
  338. package/dist/toggle-group.js.map +1 -1
  339. package/dist/toggle-group.mjs +40 -33
  340. package/dist/toggle-group.mjs.map +1 -1
  341. package/dist/toggle.d.mts +2 -2
  342. package/dist/toggle.d.ts +2 -2
  343. package/dist/toggle.js +2 -2
  344. package/dist/toggle.mjs +1 -1
  345. package/dist/tooltip.d.mts +7 -7
  346. package/dist/tooltip.d.ts +7 -7
  347. package/dist/tooltip.js +15 -20
  348. package/dist/tooltip.js.map +1 -1
  349. package/dist/tooltip.mjs +15 -20
  350. package/dist/tooltip.mjs.map +1 -1
  351. package/package.json +43 -6
  352. package/src/accordion.tsx +53 -43
  353. package/src/alert-dialog.tsx +73 -92
  354. package/src/alert.tsx +24 -41
  355. package/src/aspect-ratio.tsx +2 -1
  356. package/src/avatar.tsx +19 -36
  357. package/src/badge.tsx +3 -7
  358. package/src/blockquote.tsx +9 -8
  359. package/src/box.tsx +7 -6
  360. package/src/breadcrumb.tsx +54 -63
  361. package/src/button.tsx +42 -16
  362. package/src/calendar.tsx +6 -22
  363. package/src/card.tsx +40 -56
  364. package/src/carousel.tsx +95 -81
  365. package/src/checkbox-cards.tsx +68 -0
  366. package/src/checkbox-group.primitive.tsx +199 -0
  367. package/src/checkbox-group.tsx +57 -0
  368. package/src/checkbox.tsx +10 -6
  369. package/src/code.tsx +8 -6
  370. package/src/collapsible.tsx +4 -3
  371. package/src/command.tsx +53 -90
  372. package/src/container.tsx +8 -6
  373. package/src/context-menu.tsx +163 -175
  374. package/src/data-table.tsx +26 -43
  375. package/src/dialog.tsx +58 -77
  376. package/src/drawer.tsx +48 -78
  377. package/src/dropdown-menu.tsx +143 -154
  378. package/src/em.tsx +8 -6
  379. package/src/form.tsx +61 -86
  380. package/src/heading.tsx +8 -6
  381. package/src/hover-card.tsx +22 -20
  382. package/src/input-otp.tsx +50 -48
  383. package/src/input.tsx +14 -15
  384. package/src/kbd.tsx +18 -16
  385. package/src/label.tsx +5 -5
  386. package/src/menubar.tsx +133 -149
  387. package/src/navigation-menu.tsx +110 -114
  388. package/src/pagination.tsx +26 -48
  389. package/src/popover.tsx +29 -31
  390. package/src/pre.tsx +8 -6
  391. package/src/progress.tsx +6 -9
  392. package/src/quote.tsx +8 -6
  393. package/src/radio-cards.tsx +50 -0
  394. package/src/radio-group.tsx +14 -24
  395. package/src/radio.tsx +44 -0
  396. package/src/resizable.tsx +5 -7
  397. package/src/scroll-area.tsx +29 -40
  398. package/src/section.tsx +8 -6
  399. package/src/segmented.tsx +176 -0
  400. package/src/select.tsx +106 -115
  401. package/src/separator.tsx +7 -14
  402. package/src/sheet.tsx +50 -76
  403. package/src/skeleton.tsx +2 -6
  404. package/src/slider.tsx +12 -10
  405. package/src/sonner.tsx +3 -7
  406. package/src/spinner.tsx +71 -0
  407. package/src/strong.tsx +8 -6
  408. package/src/switch.tsx +7 -6
  409. package/src/table.tsx +60 -82
  410. package/src/tabs.tsx +20 -18
  411. package/src/text.tsx +8 -8
  412. package/src/textarea.tsx +16 -14
  413. package/src/toggle-group.tsx +59 -58
  414. package/src/toggle.tsx +14 -13
  415. package/src/tooltip.tsx +28 -30
  416. package/dist/chunk-3BDLWZ3W.js +0 -158
  417. package/dist/chunk-3BDLWZ3W.js.map +0 -1
  418. package/dist/chunk-43YGVOCO.js +0 -135
  419. package/dist/chunk-43YGVOCO.js.map +0 -1
  420. package/dist/chunk-AJLEALVP.mjs +0 -112
  421. package/dist/chunk-AJLEALVP.mjs.map +0 -1
  422. package/dist/chunk-D6NQEMTJ.js +0 -112
  423. package/dist/chunk-D6NQEMTJ.js.map +0 -1
  424. package/dist/chunk-FATZHRHR.mjs +0 -56
  425. package/dist/chunk-FATZHRHR.mjs.map +0 -1
  426. package/dist/chunk-GRKABVK4.js.map +0 -1
  427. package/dist/chunk-JOJW7BBY.js.map +0 -1
  428. package/dist/chunk-KV4VL2ZF.mjs +0 -135
  429. package/dist/chunk-KV4VL2ZF.mjs.map +0 -1
  430. package/dist/chunk-MJDKD2K4.mjs.map +0 -1
  431. package/dist/chunk-NCEN3XBK.mjs +0 -158
  432. package/dist/chunk-NCEN3XBK.mjs.map +0 -1
  433. package/dist/chunk-PIU627A3.mjs.map +0 -1
  434. package/dist/chunk-PKB2G726.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/drawer.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAatC,cAkCA,YAlCA;AALJ,SAAS,OAAO;AAAA,EACd,wBAAwB;AAAA,EACxB,GAAG;AACL,GAAmC;AACjC,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAOA,IAAM,gBAAgB,gBAAgB;AAOtC,IAAM,cAAc,gBAAgB;AASpC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QACpC,qBAAC,gBAAgB,QAAhB,EACC;AAAA,sBAAC,gBAAgB,SAAhB,EAAwB,WAAU,kCAAiC;AAAA,EACpE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,SAAI,WAAU,oDAAmD;AAAA,QACjE;AAAA;AAAA;AAAA,EACH;AAAA,GACF,CACD;AACD,cAAc,cAAc;AAO5B,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAAyC;AACvC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,6CAA6C,SAAS;AAAA,MACnE,GAAG;AAAA;AAAA,EACN;AAEJ;AAOA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAAyC;AACvC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,mCAAmC,SAAS;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AASA,IAAM,cAAoB,iBAGxB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,YAAY,cAAc,gBAAgB,MAAM;AAShD,IAAM,oBAA0B,iBAG9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,kBAAkB,cAAc,gBAAgB,YAAY","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\nfunction Drawer({\n shouldScaleBackground = true,\n ...props\n}: DrawerProps): React.JSX.Element {\n return (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentProps<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentProps<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Content\n>;\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n DrawerContentProps\n>(({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-[100px] rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n));\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\nfunction DrawerHeader({\n className,\n ...props\n}: DrawerHeaderProps): React.JSX.Element {\n return (\n <div\n className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\nfunction DrawerFooter({\n className,\n ...props\n}: DrawerFooterProps): React.JSX.Element {\n return (\n <div\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Title\n>;\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n DrawerTitleProps\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Description\n>;\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n DrawerDescriptionProps\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"]}
1
+ {"version":3,"sources":["../src/drawer.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAUjC,cA4BH,YA5BG;AADT,SAAS,OAAO,EAAE,wBAAwB,MAAM,GAAG,MAAM,GAAmC;AAC1F,SAAO,oBAAC,gBAAgB,MAAhB,EAAqB,uBAA+C,GAAG,OAAO;AACxF;AAOA,IAAM,gBAAgB,gBAAgB;AAOtC,IAAM,cAAc,gBAAgB;AASpC,IAAM,gBAAsB;AAAA,EAC1B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC,qBAAC,gBAAgB,QAAhB,EACC;AAAA,wBAAC,gBAAgB,SAAhB,EAAwB,WAAU,kCAAiC;AAAA,IACpE;AAAA,MAAC,gBAAgB;AAAA,MAAhB;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEJ;AAAA,8BAAC,SAAI,WAAU,oDAAmD;AAAA,UACjE;AAAA;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAEA,cAAc,cAAc;AAQ5B,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAyC;AACnF,SAAO,oBAAC,SAAI,WAAW,GAAG,6CAA6C,SAAS,GAAI,GAAG,OAAO;AAChG;AAQA,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAyC;AACnF,SAAO,oBAAC,SAAI,WAAW,GAAG,mCAAmC,SAAS,GAAI,GAAG,OAAO;AACtF;AASA,IAAM,cAAoB,iBAAiD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACnG;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,qDAAqD,SAAS;AAAA,IAC3E,GAAG;AAAA;AACN,CACD;AAED,YAAY,cAAc,gBAAgB,MAAM;AAShD,IAAM,oBAA0B;AAAA,EAC9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,gBAAgB,aAAhB,EAA4B,KAAU,WAAW,GAAG,iCAAiC,SAAS,GAAI,GAAG,OAAO;AAEjH;AAEA,kBAAkB,cAAc,gBAAgB,YAAY","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\n\nfunction Drawer({ shouldScaleBackground = true, ...props }: DrawerProps): React.JSX.Element {\n return <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;\ntype DrawerContentProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>;\n\nconst DrawerContent = React.forwardRef<DrawerContentElement, DrawerContentProps>(\n ({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-[100px] rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n ),\n);\n\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element {\n return <div className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element {\n return <div className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>;\n\nconst DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\n\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionElement = React.ElementRef<typeof DrawerPrimitive.Description>;\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>;\n\nconst DrawerDescription = React.forwardRef<DrawerDescriptionElement, DrawerDescriptionProps>(\n ({ className, ...props }, ref) => (\n <DrawerPrimitive.Description ref={ref} className={cn(\"text-muted-foreground text-sm\", className)} {...props} />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"]}
package/dist/drawer.mjs CHANGED
@@ -7,83 +7,50 @@ import {
7
7
  import * as React from "react";
8
8
  import { Drawer as DrawerPrimitive } from "vaul";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
- function Drawer({
11
- shouldScaleBackground = true,
12
- ...props
13
- }) {
14
- return /* @__PURE__ */ jsx(
15
- DrawerPrimitive.Root,
16
- {
17
- shouldScaleBackground,
18
- ...props
19
- }
20
- );
10
+ function Drawer({ shouldScaleBackground = true, ...props }) {
11
+ return /* @__PURE__ */ jsx(DrawerPrimitive.Root, { shouldScaleBackground, ...props });
21
12
  }
22
13
  var DrawerTrigger = DrawerPrimitive.Trigger;
23
14
  var DrawerClose = DrawerPrimitive.Close;
24
- var DrawerContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DrawerPrimitive.Portal, { children: [
25
- /* @__PURE__ */ jsx(DrawerPrimitive.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
26
- /* @__PURE__ */ jsxs(
27
- DrawerPrimitive.Content,
28
- {
29
- ref,
30
- className: cn(
31
- "bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border",
32
- className
33
- ),
34
- ...props,
35
- children: [
36
- /* @__PURE__ */ jsx("div", { className: "bg-muted mx-auto mt-4 h-2 w-[100px] rounded-full" }),
37
- children
38
- ]
39
- }
40
- )
41
- ] }));
15
+ var DrawerContent = React.forwardRef(
16
+ ({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DrawerPrimitive.Portal, { children: [
17
+ /* @__PURE__ */ jsx(DrawerPrimitive.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
18
+ /* @__PURE__ */ jsxs(
19
+ DrawerPrimitive.Content,
20
+ {
21
+ ref,
22
+ className: cn(
23
+ "bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border",
24
+ className
25
+ ),
26
+ ...props,
27
+ children: [
28
+ /* @__PURE__ */ jsx("div", { className: "bg-muted mx-auto mt-4 h-2 w-[100px] rounded-full" }),
29
+ children
30
+ ]
31
+ }
32
+ )
33
+ ] })
34
+ );
42
35
  DrawerContent.displayName = "DrawerContent";
43
- function DrawerHeader({
44
- className,
45
- ...props
46
- }) {
47
- return /* @__PURE__ */ jsx(
48
- "div",
49
- {
50
- className: cn("grid gap-1.5 p-4 text-center sm:text-left", className),
51
- ...props
52
- }
53
- );
36
+ function DrawerHeader({ className, ...props }) {
37
+ return /* @__PURE__ */ jsx("div", { className: cn("grid gap-1.5 p-4 text-center sm:text-left", className), ...props });
54
38
  }
55
- function DrawerFooter({
56
- className,
57
- ...props
58
- }) {
59
- return /* @__PURE__ */ jsx(
60
- "div",
61
- {
62
- className: cn("mt-auto flex flex-col gap-2 p-4", className),
63
- ...props
64
- }
65
- );
39
+ function DrawerFooter({ className, ...props }) {
40
+ return /* @__PURE__ */ jsx("div", { className: cn("mt-auto flex flex-col gap-2 p-4", className), ...props });
66
41
  }
67
42
  var DrawerTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
68
43
  DrawerPrimitive.Title,
69
44
  {
70
45
  ref,
71
- className: cn(
72
- "text-lg font-semibold leading-none tracking-tight",
73
- className
74
- ),
46
+ className: cn("text-lg font-semibold leading-none tracking-tight", className),
75
47
  ...props
76
48
  }
77
49
  ));
78
50
  DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
79
- var DrawerDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
80
- DrawerPrimitive.Description,
81
- {
82
- ref,
83
- className: cn("text-muted-foreground text-sm", className),
84
- ...props
85
- }
86
- ));
51
+ var DrawerDescription = React.forwardRef(
52
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(DrawerPrimitive.Description, { ref, className: cn("text-muted-foreground text-sm", className), ...props })
53
+ );
87
54
  DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
88
55
  export {
89
56
  Drawer,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\nfunction Drawer({\n shouldScaleBackground = true,\n ...props\n}: DrawerProps): React.JSX.Element {\n return (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentProps<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentProps<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Content\n>;\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n DrawerContentProps\n>(({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-[100px] rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n));\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\nfunction DrawerHeader({\n className,\n ...props\n}: DrawerHeaderProps): React.JSX.Element {\n return (\n <div\n className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\nfunction DrawerFooter({\n className,\n ...props\n}: DrawerFooterProps): React.JSX.Element {\n return (\n <div\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Title\n>;\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n DrawerTitleProps\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Description\n>;\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n DrawerDescriptionProps\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAatC,cAkCA,YAlCA;AALJ,SAAS,OAAO;AAAA,EACd,wBAAwB;AAAA,EACxB,GAAG;AACL,GAAmC;AACjC,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAOA,IAAM,gBAAgB,gBAAgB;AAOtC,IAAM,cAAc,gBAAgB;AASpC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QACpC,qBAAC,gBAAgB,QAAhB,EACC;AAAA,sBAAC,gBAAgB,SAAhB,EAAwB,WAAU,kCAAiC;AAAA,EACpE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,SAAI,WAAU,oDAAmD;AAAA,QACjE;AAAA;AAAA;AAAA,EACH;AAAA,GACF,CACD;AACD,cAAc,cAAc;AAO5B,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAAyC;AACvC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,6CAA6C,SAAS;AAAA,MACnE,GAAG;AAAA;AAAA,EACN;AAEJ;AAOA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAAyC;AACvC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,mCAAmC,SAAS;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AASA,IAAM,cAAoB,iBAGxB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,YAAY,cAAc,gBAAgB,MAAM;AAShD,IAAM,oBAA0B,iBAG9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,kBAAkB,cAAc,gBAAgB,YAAY;","names":[]}
1
+ {"version":3,"sources":["../src/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\n\nfunction Drawer({ shouldScaleBackground = true, ...props }: DrawerProps): React.JSX.Element {\n return <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;\ntype DrawerContentProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>;\n\nconst DrawerContent = React.forwardRef<DrawerContentElement, DrawerContentProps>(\n ({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-[100px] rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n ),\n);\n\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element {\n return <div className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element {\n return <div className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>;\n\nconst DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\n\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionElement = React.ElementRef<typeof DrawerPrimitive.Description>;\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>;\n\nconst DrawerDescription = React.forwardRef<DrawerDescriptionElement, DrawerDescriptionProps>(\n ({ className, ...props }, ref) => (\n <DrawerPrimitive.Description ref={ref} className={cn(\"text-muted-foreground text-sm\", className)} {...props} />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAUjC,cA4BH,YA5BG;AADT,SAAS,OAAO,EAAE,wBAAwB,MAAM,GAAG,MAAM,GAAmC;AAC1F,SAAO,oBAAC,gBAAgB,MAAhB,EAAqB,uBAA+C,GAAG,OAAO;AACxF;AAOA,IAAM,gBAAgB,gBAAgB;AAOtC,IAAM,cAAc,gBAAgB;AASpC,IAAM,gBAAsB;AAAA,EAC1B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC,qBAAC,gBAAgB,QAAhB,EACC;AAAA,wBAAC,gBAAgB,SAAhB,EAAwB,WAAU,kCAAiC;AAAA,IACpE;AAAA,MAAC,gBAAgB;AAAA,MAAhB;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEJ;AAAA,8BAAC,SAAI,WAAU,oDAAmD;AAAA,UACjE;AAAA;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAEA,cAAc,cAAc;AAQ5B,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAyC;AACnF,SAAO,oBAAC,SAAI,WAAW,GAAG,6CAA6C,SAAS,GAAI,GAAG,OAAO;AAChG;AAQA,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAyC;AACnF,SAAO,oBAAC,SAAI,WAAW,GAAG,mCAAmC,SAAS,GAAI,GAAG,OAAO;AACtF;AASA,IAAM,cAAoB,iBAAiD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACnG;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,qDAAqD,SAAS;AAAA,IAC3E,GAAG;AAAA;AACN,CACD;AAED,YAAY,cAAc,gBAAgB,MAAM;AAShD,IAAM,oBAA0B;AAAA,EAC9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,gBAAgB,aAAhB,EAA4B,KAAU,WAAW,GAAG,iCAAiC,SAAS,GAAI,GAAG,OAAO;AAEjH;AAEA,kBAAkB,cAAc,gBAAgB,YAAY;","names":[]}
@@ -1,38 +1,38 @@
1
1
  import * as React from 'react';
2
2
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
3
 
4
- type DropdownMenuProps = DropdownMenuPrimitive.DropdownMenuProps;
4
+ type DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>;
5
5
  declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
6
- type DropdownMenuTriggerProps = DropdownMenuPrimitive.DropdownMenuTriggerProps;
6
+ type DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>;
7
7
  declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
8
- type DropdownMenuGroupProps = DropdownMenuPrimitive.DropdownMenuGroupProps;
8
+ type DropdownMenuGroupProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>;
9
9
  declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
10
- type DropdownMenuSubProps = DropdownMenuPrimitive.DropdownMenuSubProps;
10
+ type DropdownMenuSubProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Sub>;
11
11
  declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
12
- type DropdownMenuRadioGroupProps = DropdownMenuPrimitive.DropdownMenuRadioGroupProps;
12
+ type DropdownMenuRadioGroupProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup>;
13
13
  declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
14
- interface DropdownMenuSubTriggerProps extends DropdownMenuPrimitive.DropdownMenuSubTriggerProps {
14
+ interface DropdownMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> {
15
15
  inset?: boolean;
16
16
  }
17
17
  declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
18
18
  type DropdownMenuSubContentProps = DropdownMenuPrimitive.DropdownMenuSubContentProps;
19
19
  declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
20
- type DropdownMenuContentProps = DropdownMenuPrimitive.DropdownMenuContentProps;
21
- declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
22
- interface DropdownMenuItemProps extends DropdownMenuPrimitive.DropdownMenuItemProps {
20
+ type DropdownMenuContentProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>;
21
+ declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
22
+ interface DropdownMenuItemProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {
23
23
  inset?: boolean;
24
24
  }
25
25
  declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>>;
26
- type DropdownMenuCheckboxItemProps = DropdownMenuPrimitive.DropdownMenuCheckboxItemProps;
27
- declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
28
- type DropdownMenuRadioItemProps = DropdownMenuPrimitive.DropdownMenuRadioItemProps;
29
- declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
30
- interface DropdownMenuLabelProps extends DropdownMenuPrimitive.DropdownMenuLabelProps {
26
+ type DropdownMenuCheckboxItemProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>;
27
+ declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
28
+ type DropdownMenuRadioItemProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>;
29
+ declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
30
+ interface DropdownMenuLabelProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {
31
31
  inset?: boolean;
32
32
  }
33
33
  declare const DropdownMenuLabel: React.ForwardRefExoticComponent<DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
34
- type DropdownMenuSeparatorProps = DropdownMenuPrimitive.DropdownMenuSeparatorProps;
35
- declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
34
+ type DropdownMenuSeparatorProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>;
35
+ declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
36
36
  type DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
37
37
  declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): React.JSX.Element;
38
38
 
@@ -1,38 +1,38 @@
1
1
  import * as React from 'react';
2
2
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
3
 
4
- type DropdownMenuProps = DropdownMenuPrimitive.DropdownMenuProps;
4
+ type DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>;
5
5
  declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
6
- type DropdownMenuTriggerProps = DropdownMenuPrimitive.DropdownMenuTriggerProps;
6
+ type DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>;
7
7
  declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
8
- type DropdownMenuGroupProps = DropdownMenuPrimitive.DropdownMenuGroupProps;
8
+ type DropdownMenuGroupProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>;
9
9
  declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
10
- type DropdownMenuSubProps = DropdownMenuPrimitive.DropdownMenuSubProps;
10
+ type DropdownMenuSubProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Sub>;
11
11
  declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
12
- type DropdownMenuRadioGroupProps = DropdownMenuPrimitive.DropdownMenuRadioGroupProps;
12
+ type DropdownMenuRadioGroupProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup>;
13
13
  declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
14
- interface DropdownMenuSubTriggerProps extends DropdownMenuPrimitive.DropdownMenuSubTriggerProps {
14
+ interface DropdownMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> {
15
15
  inset?: boolean;
16
16
  }
17
17
  declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
18
18
  type DropdownMenuSubContentProps = DropdownMenuPrimitive.DropdownMenuSubContentProps;
19
19
  declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
20
- type DropdownMenuContentProps = DropdownMenuPrimitive.DropdownMenuContentProps;
21
- declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
22
- interface DropdownMenuItemProps extends DropdownMenuPrimitive.DropdownMenuItemProps {
20
+ type DropdownMenuContentProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>;
21
+ declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
22
+ interface DropdownMenuItemProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {
23
23
  inset?: boolean;
24
24
  }
25
25
  declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>>;
26
- type DropdownMenuCheckboxItemProps = DropdownMenuPrimitive.DropdownMenuCheckboxItemProps;
27
- declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
28
- type DropdownMenuRadioItemProps = DropdownMenuPrimitive.DropdownMenuRadioItemProps;
29
- declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
30
- interface DropdownMenuLabelProps extends DropdownMenuPrimitive.DropdownMenuLabelProps {
26
+ type DropdownMenuCheckboxItemProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>;
27
+ declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
28
+ type DropdownMenuRadioItemProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>;
29
+ declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
30
+ interface DropdownMenuLabelProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {
31
31
  inset?: boolean;
32
32
  }
33
33
  declare const DropdownMenuLabel: React.ForwardRefExoticComponent<DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
34
- type DropdownMenuSeparatorProps = DropdownMenuPrimitive.DropdownMenuSeparatorProps;
35
- declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
34
+ type DropdownMenuSeparatorProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>;
35
+ declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
36
36
  type DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
37
37
  declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): React.JSX.Element;
38
38
 
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- var _chunk3BDLWZ3Wjs = require('./chunk-3BDLWZ3W.js');
17
+ var _chunk3ZZ3SRTJjs = require('./chunk-3ZZ3SRTJ.js');
18
18
  require('./chunk-G3NP7M2N.js');
19
19
 
20
20
 
@@ -31,5 +31,5 @@ require('./chunk-G3NP7M2N.js');
31
31
 
32
32
 
33
33
 
34
- exports.DropdownMenu = _chunk3BDLWZ3Wjs.DropdownMenu; exports.DropdownMenuCheckboxItem = _chunk3BDLWZ3Wjs.DropdownMenuCheckboxItem; exports.DropdownMenuContent = _chunk3BDLWZ3Wjs.DropdownMenuContent; exports.DropdownMenuGroup = _chunk3BDLWZ3Wjs.DropdownMenuGroup; exports.DropdownMenuItem = _chunk3BDLWZ3Wjs.DropdownMenuItem; exports.DropdownMenuLabel = _chunk3BDLWZ3Wjs.DropdownMenuLabel; exports.DropdownMenuRadioGroup = _chunk3BDLWZ3Wjs.DropdownMenuRadioGroup; exports.DropdownMenuRadioItem = _chunk3BDLWZ3Wjs.DropdownMenuRadioItem; exports.DropdownMenuSeparator = _chunk3BDLWZ3Wjs.DropdownMenuSeparator; exports.DropdownMenuShortcut = _chunk3BDLWZ3Wjs.DropdownMenuShortcut; exports.DropdownMenuSub = _chunk3BDLWZ3Wjs.DropdownMenuSub; exports.DropdownMenuSubContent = _chunk3BDLWZ3Wjs.DropdownMenuSubContent; exports.DropdownMenuSubTrigger = _chunk3BDLWZ3Wjs.DropdownMenuSubTrigger; exports.DropdownMenuTrigger = _chunk3BDLWZ3Wjs.DropdownMenuTrigger;
34
+ exports.DropdownMenu = _chunk3ZZ3SRTJjs.DropdownMenu; exports.DropdownMenuCheckboxItem = _chunk3ZZ3SRTJjs.DropdownMenuCheckboxItem; exports.DropdownMenuContent = _chunk3ZZ3SRTJjs.DropdownMenuContent; exports.DropdownMenuGroup = _chunk3ZZ3SRTJjs.DropdownMenuGroup; exports.DropdownMenuItem = _chunk3ZZ3SRTJjs.DropdownMenuItem; exports.DropdownMenuLabel = _chunk3ZZ3SRTJjs.DropdownMenuLabel; exports.DropdownMenuRadioGroup = _chunk3ZZ3SRTJjs.DropdownMenuRadioGroup; exports.DropdownMenuRadioItem = _chunk3ZZ3SRTJjs.DropdownMenuRadioItem; exports.DropdownMenuSeparator = _chunk3ZZ3SRTJjs.DropdownMenuSeparator; exports.DropdownMenuShortcut = _chunk3ZZ3SRTJjs.DropdownMenuShortcut; exports.DropdownMenuSub = _chunk3ZZ3SRTJjs.DropdownMenuSub; exports.DropdownMenuSubContent = _chunk3ZZ3SRTJjs.DropdownMenuSubContent; exports.DropdownMenuSubTrigger = _chunk3ZZ3SRTJjs.DropdownMenuSubTrigger; exports.DropdownMenuTrigger = _chunk3ZZ3SRTJjs.DropdownMenuTrigger;
35
35
  //# sourceMappingURL=dropdown-menu.js.map
@@ -14,7 +14,7 @@ import {
14
14
  DropdownMenuSubContent,
15
15
  DropdownMenuSubTrigger,
16
16
  DropdownMenuTrigger
17
- } from "./chunk-NCEN3XBK.mjs";
17
+ } from "./chunk-EWS3N4OZ.mjs";
18
18
  import "./chunk-UG3URV2Z.mjs";
19
19
  export {
20
20
  DropdownMenu,
package/dist/em.js CHANGED
@@ -2,12 +2,10 @@
2
2
  var _react = require('react'); var React = _interopRequireWildcard(_react);
3
3
  var _reactslot = require('@radix-ui/react-slot');
4
4
  var _jsxruntime = require('react/jsx-runtime');
5
- var Em = React.forwardRef(
6
- ({ asChild, ...props }, ref) => {
7
- const Comp = asChild ? _reactslot.Slot : "em";
8
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Comp, { ref, ...props });
9
- }
10
- );
5
+ var Em = React.forwardRef(({ asChild, ...props }, ref) => {
6
+ const Component = asChild ? _reactslot.Slot : "em";
7
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component, { ref, ...props });
8
+ });
11
9
  Em.displayName = "Em";
12
10
 
13
11
 
package/dist/em.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/em.tsx"],"names":[],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAaV;AAJX,IAAM,KAAW;AAAA,EACf,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ;AAC9B,UAAM,OAAO,UAAU,OAAO;AAE9B,WAAO,oBAAC,QAAK,KAAW,GAAG,OAAO;AAAA,EACpC;AACF;AACA,GAAG,cAAc","sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ninterface EmProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\nconst Em = React.forwardRef<HTMLElement, EmProps>(\n ({ asChild, ...props }, ref) => {\n const Comp = asChild ? Slot : \"em\";\n\n return <Comp ref={ref} {...props} />;\n },\n);\nEm.displayName = \"Em\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"]}
1
+ {"version":3,"sources":["../src/em.tsx"],"names":[],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAeZ;AAHT,IAAM,KAAW,iBAA+B,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ;AAC9E,QAAM,YAAY,UAAU,OAAO;AAEnC,SAAO,oBAAC,aAAU,KAAW,GAAG,OAAO;AACzC,CAAC;AAED,GAAG,cAAc","sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ntype EmElement = HTMLElement;\n\ninterface EmProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nconst Em = React.forwardRef<EmElement, EmProps>(({ asChild, ...props }, ref) => {\n const Component = asChild ? Slot : \"em\";\n\n return <Component ref={ref} {...props} />;\n});\n\nEm.displayName = \"Em\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"]}
package/dist/em.mjs CHANGED
@@ -2,12 +2,10 @@
2
2
  import * as React from "react";
3
3
  import { Slot } from "@radix-ui/react-slot";
4
4
  import { jsx } from "react/jsx-runtime";
5
- var Em = React.forwardRef(
6
- ({ asChild, ...props }, ref) => {
7
- const Comp = asChild ? Slot : "em";
8
- return /* @__PURE__ */ jsx(Comp, { ref, ...props });
9
- }
10
- );
5
+ var Em = React.forwardRef(({ asChild, ...props }, ref) => {
6
+ const Component = asChild ? Slot : "em";
7
+ return /* @__PURE__ */ jsx(Component, { ref, ...props });
8
+ });
11
9
  Em.displayName = "Em";
12
10
  export {
13
11
  Em
package/dist/em.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/em.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ninterface EmProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\nconst Em = React.forwardRef<HTMLElement, EmProps>(\n ({ asChild, ...props }, ref) => {\n const Comp = asChild ? Slot : \"em\";\n\n return <Comp ref={ref} {...props} />;\n },\n);\nEm.displayName = \"Em\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAaV;AAJX,IAAM,KAAW;AAAA,EACf,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ;AAC9B,UAAM,OAAO,UAAU,OAAO;AAE9B,WAAO,oBAAC,QAAK,KAAW,GAAG,OAAO;AAAA,EACpC;AACF;AACA,GAAG,cAAc;","names":[]}
1
+ {"version":3,"sources":["../src/em.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ntype EmElement = HTMLElement;\n\ninterface EmProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nconst Em = React.forwardRef<EmElement, EmProps>(({ asChild, ...props }, ref) => {\n const Component = asChild ? Slot : \"em\";\n\n return <Component ref={ref} {...props} />;\n});\n\nEm.displayName = \"Em\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAeZ;AAHT,IAAM,KAAW,iBAA+B,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ;AAC9E,QAAM,YAAY,UAAU,OAAO;AAEnC,SAAO,oBAAC,aAAU,KAAW,GAAG,OAAO;AACzC,CAAC;AAED,GAAG,cAAc;","names":[]}
package/dist/form.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
2
2
 
3
- var _chunkGRKABVK4js = require('./chunk-GRKABVK4.js');
3
+ var _chunkIVYGBU4Gjs = require('./chunk-IVYGBU4G.js');
4
4
 
5
5
 
6
6
  var _chunkG3NP7M2Njs = require('./chunk-G3NP7M2N.js');
@@ -14,20 +14,16 @@ var _reactslot = require('@radix-ui/react-slot');
14
14
 
15
15
  var _reacthookform = require('react-hook-form');
16
16
  var _jsxruntime = require('react/jsx-runtime');
17
- var FormItemContext = React.createContext(
18
- {}
19
- );
20
- var FormFieldContext = React.createContext(
21
- {}
22
- );
17
+ var FormFieldContext = React.createContext(null);
18
+ var FormItemContext = React.createContext(null);
23
19
  var useFormField = () => {
24
20
  const fieldContext = React.useContext(FormFieldContext);
25
21
  const itemContext = React.useContext(FormItemContext);
26
22
  const { getFieldState, formState } = _reacthookform.useFormContext.call(void 0, );
27
- const fieldState = getFieldState(fieldContext.name, formState);
28
- if (!fieldContext) {
23
+ if (!fieldContext || !itemContext) {
29
24
  throw new Error("useFormField should be used within <FormField>");
30
25
  }
26
+ const fieldState = getFieldState(fieldContext.name, formState);
31
27
  const { id } = itemContext;
32
28
  return {
33
29
  id,
@@ -42,24 +38,14 @@ var Form = _reacthookform.FormProvider;
42
38
  function FormField({ ...props }) {
43
39
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacthookform.Controller, { ...props }) });
44
40
  }
45
- var FormItem = React.forwardRef(
46
- ({ className, ...props }, ref) => {
47
- const id = React.useId();
48
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref, className: _chunkG3NP7M2Njs.cn.call(void 0, "space-y-2", className), ...props }) });
49
- }
50
- );
41
+ var FormItem = React.forwardRef(({ className, ...props }, ref) => {
42
+ const id = React.useId();
43
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref, className: _chunkG3NP7M2Njs.cn.call(void 0, "space-y-2", className), ...props }) });
44
+ });
51
45
  FormItem.displayName = "FormItem";
52
46
  var FormLabel = React.forwardRef(({ className, ...props }, ref) => {
53
47
  const { error, formItemId } = useFormField();
54
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
55
- _chunkGRKABVK4js.Label,
56
- {
57
- ref,
58
- className: _chunkG3NP7M2Njs.cn.call(void 0, error && "text-destructive", className),
59
- htmlFor: formItemId,
60
- ...props
61
- }
62
- );
48
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkIVYGBU4Gjs.Label, { ref, className: _chunkG3NP7M2Njs.cn.call(void 0, error && "text-destructive", className), htmlFor: formItemId, ...props });
63
49
  });
64
50
  FormLabel.displayName = "FormLabel";
65
51
  var FormControl = React.forwardRef(({ ...props }, ref) => {
@@ -76,38 +62,21 @@ var FormControl = React.forwardRef(({ ...props }, ref) => {
76
62
  );
77
63
  });
78
64
  FormControl.displayName = "FormControl";
79
- var FormDescription = React.forwardRef(({ className, ...props }, ref) => {
80
- const { formDescriptionId } = useFormField();
81
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
82
- "p",
83
- {
84
- ref,
85
- id: formDescriptionId,
86
- className: _chunkG3NP7M2Njs.cn.call(void 0, "text-muted-foreground text-[0.8rem]", className),
87
- ...props
88
- }
89
- );
90
- });
91
- FormDescription.displayName = "FormDescription";
92
- var FormMessage = React.forwardRef(
93
- ({ className, children, ...props }, ref) => {
94
- const { error, formMessageId } = useFormField();
95
- const body = error ? String(error.message) : children;
96
- if (!body) {
97
- return null;
98
- }
99
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
100
- "p",
101
- {
102
- ref,
103
- id: formMessageId,
104
- className: _chunkG3NP7M2Njs.cn.call(void 0, "text-destructive text-[0.8rem] font-medium", className),
105
- ...props,
106
- children: body
107
- }
108
- );
65
+ var FormDescription = React.forwardRef(
66
+ ({ className, ...props }, ref) => {
67
+ const { formDescriptionId } = useFormField();
68
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { ref, id: formDescriptionId, className: _chunkG3NP7M2Njs.cn.call(void 0, "text-muted-foreground text-[0.8rem]", className), ...props });
109
69
  }
110
70
  );
71
+ FormDescription.displayName = "FormDescription";
72
+ var FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
73
+ const { error, formMessageId } = useFormField();
74
+ const body = error ? String(error.message) : children;
75
+ if (!body) {
76
+ return null;
77
+ }
78
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { ref, id: formMessageId, className: _chunkG3NP7M2Njs.cn.call(void 0, "text-destructive text-[0.8rem] font-medium", className), ...props, children: body });
79
+ });
111
80
  FormMessage.displayName = "FormMessage";
112
81
 
113
82
 
package/dist/form.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/form.tsx"],"names":[],"mappings":";;;;;;;;AAAA,YAAY,WAAW;AAEvB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EAKA;AAAA,EACA;AAAA,OACK;AAsFD;AA1EN,IAAM,kBAAwB;AAAA,EAC5B,CAAC;AACH;AAaA,IAAM,mBAAyB;AAAA,EAC7B,CAAC;AACH;AAEA,IAAM,eAAe,MAWhB;AACH,QAAM,eAAqB,iBAAW,gBAAgB;AACtD,QAAM,cAAoB,iBAAW,eAAe;AACpD,QAAM,EAAE,eAAe,UAAU,IAAI,eAAe;AAEpD,QAAM,aAAa,cAAc,aAAa,MAAM,SAAS;AAE7D,MAAI,CAAC,cAAc;AACjB,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AAEA,QAAM,EAAE,GAAG,IAAI;AAEf,SAAO;AAAA,IACL;AAAA,IACA,MAAM,aAAa;AAAA,IACnB,YAAY,aAAa,EAAE;AAAA,IAC3B,mBAAmB,yBAAyB,EAAE;AAAA,IAC9C,eAAe,qBAAqB,EAAE;AAAA,IACtC,GAAG;AAAA,EACL;AACF;AAOA,IAAM,OAAO;AAUb,SAAS,UAGP,EAAE,GAAG,MAAM,GAA2D;AACtE,SACE,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,EAAE,MAAM,MAAM,KAAK,GACnD,8BAAC,cAAY,GAAG,OAAO,GACzB;AAEJ;AAOA,IAAM,WAAiB;AAAA,EACrB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAChC,UAAM,KAAW,YAAM;AAEvB,WACE,oBAAC,gBAAgB,UAAhB,EAAyB,OAAO,EAAE,GAAG,GACpC,8BAAC,SAAI,KAAU,WAAW,GAAG,aAAa,SAAS,GAAI,GAAG,OAAO,GACnE;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;AASvB,IAAM,YAAkB,iBAGtB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM,EAAE,OAAO,WAAW,IAAI,aAAa;AAE3C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,SAAS,oBAAoB,SAAS;AAAA,MACpD,SAAS;AAAA,MACR,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,UAAU,cAAc;AAOxB,IAAM,cAAoB,iBAGxB,CAAC,EAAE,GAAG,MAAM,GAAG,QAAQ;AACvB,QAAM,EAAE,OAAO,YAAY,mBAAmB,cAAc,IAC1D,aAAa;AAEf,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,oBACE,CAAC,QAAQ,oBAAoB,GAAG,iBAAiB,IAAI,aAAa;AAAA,MAEpE,gBAAc,QAAQ,KAAK;AAAA,MAC1B,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,YAAY,cAAc;AAO1B,IAAM,kBAAwB,iBAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM,EAAE,kBAAkB,IAAI,aAAa;AAE3C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,WAAW,GAAG,uCAAuC,SAAS;AAAA,MAC7D,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,gBAAgB,cAAc;AAO9B,IAAM,cAAoB;AAAA,EACxB,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAAQ;AAC1C,UAAM,EAAE,OAAO,cAAc,IAAI,aAAa;AAC9C,UAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,IAAI;AAE7C,QAAI,CAAC,MAAM;AACT,aAAO;AAAA,IACT;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,IAAI;AAAA,QACJ,WAAW,GAAG,8CAA8C,SAAS;AAAA,QACpE,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,YAAY,cAAc","sourcesContent":["import * as React from \"react\";\nimport type * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n} from \"react-hook-form\";\nimport { cn } from \"./utils\";\nimport { Label } from \"./label\";\n\n/* -----------------------------------------------------------------------------\n * Context: FormItemContext\n * -------------------------------------------------------------------------- */\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue,\n);\n\n/* -----------------------------------------------------------------------------\n * Context: FormFieldContext\n * -------------------------------------------------------------------------- */\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue,\n);\n\nconst useFormField = (): {\n invalid: boolean;\n isDirty: boolean;\n isTouched: boolean;\n isValidating: boolean;\n error?: FieldError | undefined;\n id: string;\n name: string;\n formItemId: string;\n formDescriptionId: string;\n formMessageId: string;\n} => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `form-item-${id}`,\n formDescriptionId: `form-item-description-${id}`,\n formMessageId: `form-item-message-${id}`,\n ...fieldState,\n };\n};\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\ntype FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = ControllerProps<TFieldValues, TName>;\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\nconst FormItem = React.forwardRef<HTMLDivElement, FormItemProps>(\n ({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n );\n },\n);\nFormItem.displayName = \"FormItem\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\ntype FormLabelProps = React.ComponentPropsWithoutRef<\n typeof LabelPrimitive.Root\n>;\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n FormLabelProps\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\nFormLabel.displayName = \"FormLabel\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n FormControlProps\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } =\n useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={Boolean(error)}\n {...props}\n />\n );\n});\nFormControl.displayName = \"FormControl\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n FormDescriptionProps\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-muted-foreground text-[0.8rem]\", className)}\n {...props}\n />\n );\n});\nFormDescription.displayName = \"FormDescription\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\nconst FormMessage = React.forwardRef<HTMLParagraphElement, FormMessageProps>(\n ({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-destructive text-[0.8rem] font-medium\", className)}\n {...props}\n >\n {body}\n </p>\n );\n },\n);\nFormMessage.displayName = \"FormMessage\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n type FormProps,\n type FormItemProps,\n type FormLabelProps,\n type FormControlProps,\n type FormDescriptionProps,\n type FormMessageProps,\n type FormFieldProps,\n};\n"]}
1
+ {"version":3,"sources":["../src/form.tsx"],"names":[],"mappings":";;;;;;;;AAAA,YAAY,WAAW;AAEvB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EAKA;AAAA,EACA;AAAA,OACK;AA+ED;AA5DN,IAAM,mBAAyB,oBAA4C,IAAI;AAE/E,IAAM,kBAAwB,oBAA2C,IAAI;AAE7E,IAAM,eAAe,MAWhB;AACH,QAAM,eAAqB,iBAAW,gBAAgB;AACtD,QAAM,cAAoB,iBAAW,eAAe;AACpD,QAAM,EAAE,eAAe,UAAU,IAAI,eAAe;AAEpD,MAAI,CAAC,gBAAgB,CAAC,aAAa;AACjC,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AAEA,QAAM,aAAa,cAAc,aAAa,MAAM,SAAS;AAE7D,QAAM,EAAE,GAAG,IAAI;AAEf,SAAO;AAAA,IACL;AAAA,IACA,MAAM,aAAa;AAAA,IACnB,YAAY,aAAa,EAAE;AAAA,IAC3B,mBAAmB,yBAAyB,EAAE;AAAA,IAC9C,eAAe,qBAAqB,EAAE;AAAA,IACtC,GAAG;AAAA,EACL;AACF;AAOA,IAAM,OAAO;AAWb,SAAS,UAGP,EAAE,GAAG,MAAM,GAA2D;AACtE,SACE,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,EAAE,MAAM,MAAM,KAAK,GACnD,8BAAC,cAAY,GAAG,OAAO,GACzB;AAEJ;AASA,IAAM,WAAiB,iBAA2C,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClG,QAAM,KAAW,YAAM;AAEvB,SACE,oBAAC,gBAAgB,UAAhB,EAAyB,OAAO,EAAE,GAAG,GACpC,8BAAC,SAAI,KAAU,WAAW,GAAG,aAAa,SAAS,GAAI,GAAG,OAAO,GACnE;AAEJ,CAAC;AAED,SAAS,cAAc;AASvB,IAAM,YAAkB,iBAA6C,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AACrG,QAAM,EAAE,OAAO,WAAW,IAAI,aAAa;AAE3C,SAAO,oBAAC,SAAM,KAAU,WAAW,GAAG,SAAS,oBAAoB,SAAS,GAAG,SAAS,YAAa,GAAG,OAAO;AACjH,CAAC;AAED,UAAU,cAAc;AASxB,IAAM,cAAoB,iBAAiD,CAAC,EAAE,GAAG,MAAM,GAAG,QAAQ;AAChG,QAAM,EAAE,OAAO,YAAY,mBAAmB,cAAc,IAAI,aAAa;AAE7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,oBAAkB,CAAC,QAAQ,oBAAoB,GAAG,iBAAiB,IAAI,aAAa;AAAA,MACpF,gBAAc,QAAQ,KAAK;AAAA,MAC1B,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AAED,YAAY,cAAc;AAS1B,IAAM,kBAAwB;AAAA,EAC5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAChC,UAAM,EAAE,kBAAkB,IAAI,aAAa;AAE3C,WACE,oBAAC,OAAE,KAAU,IAAI,mBAAmB,WAAW,GAAG,uCAAuC,SAAS,GAAI,GAAG,OAAO;AAAA,EAEpH;AACF;AAEA,gBAAgB,cAAc;AAS9B,IAAM,cAAoB,iBAAiD,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAAQ;AACrH,QAAM,EAAE,OAAO,cAAc,IAAI,aAAa;AAC9C,QAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,IAAI;AAE7C,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,SACE,oBAAC,OAAE,KAAU,IAAI,eAAe,WAAW,GAAG,8CAA8C,SAAS,GAAI,GAAG,OACzG,gBACH;AAEJ,CAAC;AAED,YAAY,cAAc","sourcesContent":["import * as React from \"react\";\nimport type * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n} from \"react-hook-form\";\nimport { cn } from \"./utils\";\nimport { Label } from \"./label\";\n\n/* -----------------------------------------------------------------------------\n * Context: Form\n * -------------------------------------------------------------------------- */\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst useFormField = (): {\n invalid: boolean;\n isDirty: boolean;\n isTouched: boolean;\n isValidating: boolean;\n error?: FieldError | undefined;\n id: string;\n name: string;\n formItemId: string;\n formDescriptionId: string;\n formMessageId: string;\n} => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext || !itemContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `form-item-${id}`,\n formDescriptionId: `form-item-description-${id}`,\n formMessageId: `form-item-message-${id}`,\n ...fieldState,\n };\n};\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\ntype FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = ControllerProps<TFieldValues, TName>;\n\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\ntype FormItemElement = HTMLDivElement;\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst FormItem = React.forwardRef<FormItemElement, FormItemProps>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n );\n});\n\nFormItem.displayName = \"FormItem\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\ntype FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return <Label ref={ref} className={cn(error && \"text-destructive\", className)} htmlFor={formItemId} {...props} />;\n});\n\nFormLabel.displayName = \"FormLabel\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\ntype FormControlElement = React.ElementRef<typeof Slot>;\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\n\nconst FormControl = React.forwardRef<FormControlElement, FormControlProps>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={Boolean(error)}\n {...props}\n />\n );\n});\n\nFormControl.displayName = \"FormControl\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\ntype FormDescriptionElement = HTMLParagraphElement;\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormDescription = React.forwardRef<FormDescriptionElement, FormDescriptionProps>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p ref={ref} id={formDescriptionId} className={cn(\"text-muted-foreground text-[0.8rem]\", className)} {...props} />\n );\n },\n);\n\nFormDescription.displayName = \"FormDescription\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\ntype FormMessageElement = HTMLParagraphElement;\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p ref={ref} id={formMessageId} className={cn(\"text-destructive text-[0.8rem] font-medium\", className)} {...props}>\n {body}\n </p>\n );\n});\n\nFormMessage.displayName = \"FormMessage\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n type FormProps,\n type FormItemProps,\n type FormLabelProps,\n type FormControlProps,\n type FormDescriptionProps,\n type FormMessageProps,\n type FormFieldProps,\n};\n"]}