@codefast/ui 0.0.8 → 0.0.9

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 (377) hide show
  1. package/dist/accordion.d.mts +5 -1
  2. package/dist/accordion.d.ts +5 -1
  3. package/dist/accordion.js.map +1 -1
  4. package/dist/accordion.mjs.map +1 -1
  5. package/dist/alert-dialog.d.mts +12 -3
  6. package/dist/alert-dialog.d.ts +12 -3
  7. package/dist/alert-dialog.js +3 -3
  8. package/dist/alert-dialog.js.map +1 -1
  9. package/dist/alert-dialog.mjs +1 -1
  10. package/dist/alert-dialog.mjs.map +1 -1
  11. package/dist/alert.d.mts +10 -5
  12. package/dist/alert.d.ts +10 -5
  13. package/dist/alert.js +22 -18
  14. package/dist/alert.js.map +1 -1
  15. package/dist/alert.mjs +22 -18
  16. package/dist/alert.mjs.map +1 -1
  17. package/dist/aspect-ratio.d.mts +2 -1
  18. package/dist/aspect-ratio.d.ts +2 -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 +4 -1
  22. package/dist/avatar.d.ts +4 -1
  23. package/dist/avatar.js.map +1 -1
  24. package/dist/avatar.mjs.map +1 -1
  25. package/dist/badge.d.mts +5 -2
  26. package/dist/badge.d.ts +5 -2
  27. package/dist/badge.js.map +1 -1
  28. package/dist/badge.mjs.map +1 -1
  29. package/dist/blockquote.d.mts +5 -4
  30. package/dist/blockquote.d.ts +5 -4
  31. package/dist/blockquote.js +6 -4
  32. package/dist/blockquote.js.map +1 -1
  33. package/dist/blockquote.mjs +6 -4
  34. package/dist/blockquote.mjs.map +1 -1
  35. package/dist/box.d.mts +1 -1
  36. package/dist/box.d.ts +1 -1
  37. package/dist/box.js.map +1 -1
  38. package/dist/box.mjs.map +1 -1
  39. package/dist/breadcrumb.d.mts +18 -11
  40. package/dist/breadcrumb.d.ts +18 -11
  41. package/dist/breadcrumb.js +49 -39
  42. package/dist/breadcrumb.js.map +1 -1
  43. package/dist/breadcrumb.mjs +49 -39
  44. package/dist/breadcrumb.mjs.map +1 -1
  45. package/dist/button.d.mts +3 -2
  46. package/dist/button.d.ts +3 -2
  47. package/dist/button.js +2 -2
  48. package/dist/button.mjs +1 -1
  49. package/dist/calendar.d.mts +3 -2
  50. package/dist/calendar.d.ts +3 -2
  51. package/dist/calendar.js +3 -3
  52. package/dist/calendar.js.map +1 -1
  53. package/dist/calendar.mjs +1 -1
  54. package/dist/calendar.mjs.map +1 -1
  55. package/dist/card.d.mts +13 -7
  56. package/dist/card.d.ts +13 -7
  57. package/dist/card.js +47 -37
  58. package/dist/card.js.map +1 -1
  59. package/dist/card.mjs +47 -37
  60. package/dist/card.mjs.map +1 -1
  61. package/dist/carousel.d.mts +13 -8
  62. package/dist/carousel.d.ts +13 -8
  63. package/dist/carousel.js +63 -57
  64. package/dist/carousel.js.map +1 -1
  65. package/dist/carousel.mjs +62 -56
  66. package/dist/carousel.mjs.map +1 -1
  67. package/dist/checkbox.d.mts +2 -1
  68. package/dist/checkbox.d.ts +2 -1
  69. package/dist/checkbox.js.map +1 -1
  70. package/dist/checkbox.mjs.map +1 -1
  71. package/dist/{chunk-OCLLX7EY.js → chunk-3BDLWZ3W.js} +1 -1
  72. package/dist/chunk-3BDLWZ3W.js.map +1 -0
  73. package/dist/{chunk-2D7SRYKN.js → chunk-43YGVOCO.js} +1 -1
  74. package/dist/chunk-43YGVOCO.js.map +1 -0
  75. package/dist/{chunk-EIHWTXQ4.mjs → chunk-AJLEALVP.mjs} +1 -1
  76. package/dist/chunk-AJLEALVP.mjs.map +1 -0
  77. package/dist/{chunk-LDYBRDAY.js → chunk-D6NQEMTJ.js} +1 -1
  78. package/dist/chunk-D6NQEMTJ.js.map +1 -0
  79. package/dist/{chunk-KW5FJ62U.mjs → chunk-FATZHRHR.mjs} +1 -1
  80. package/dist/chunk-FATZHRHR.mjs.map +1 -0
  81. package/dist/{chunk-RTKEO347.js → chunk-GRKABVK4.js} +1 -1
  82. package/dist/chunk-GRKABVK4.js.map +1 -0
  83. package/dist/{chunk-U2WDUCW3.js → chunk-JOJW7BBY.js} +1 -1
  84. package/dist/{chunk-U2WDUCW3.js.map → chunk-JOJW7BBY.js.map} +1 -1
  85. package/dist/{chunk-ESWGFN3R.mjs → chunk-KV4VL2ZF.mjs} +1 -1
  86. package/dist/chunk-KV4VL2ZF.mjs.map +1 -0
  87. package/dist/{chunk-T52N6ZBP.mjs → chunk-MJDKD2K4.mjs} +1 -1
  88. package/dist/{chunk-T52N6ZBP.mjs.map → chunk-MJDKD2K4.mjs.map} +1 -1
  89. package/dist/{chunk-EDVCMWDT.mjs → chunk-NCEN3XBK.mjs} +1 -1
  90. package/dist/chunk-NCEN3XBK.mjs.map +1 -0
  91. package/dist/{chunk-PTD4AMHI.mjs → chunk-PIU627A3.mjs} +1 -1
  92. package/dist/chunk-PIU627A3.mjs.map +1 -0
  93. package/dist/{chunk-5GHZ6EXI.js → chunk-PKB2G726.js} +1 -1
  94. package/dist/{chunk-5GHZ6EXI.js.map → chunk-PKB2G726.js.map} +1 -1
  95. package/dist/code.d.mts +5 -4
  96. package/dist/code.d.ts +5 -4
  97. package/dist/code.js +6 -4
  98. package/dist/code.js.map +1 -1
  99. package/dist/code.mjs +6 -4
  100. package/dist/code.mjs.map +1 -1
  101. package/dist/collapsible.d.mts +4 -1
  102. package/dist/collapsible.d.ts +4 -1
  103. package/dist/collapsible.js.map +1 -1
  104. package/dist/collapsible.mjs.map +1 -1
  105. package/dist/command.d.mts +14 -3
  106. package/dist/command.d.ts +14 -3
  107. package/dist/command.js +6 -3
  108. package/dist/command.js.map +1 -1
  109. package/dist/command.mjs +5 -2
  110. package/dist/command.mjs.map +1 -1
  111. package/dist/container.d.mts +5 -4
  112. package/dist/container.d.ts +5 -4
  113. package/dist/container.js +6 -4
  114. package/dist/container.js.map +1 -1
  115. package/dist/container.mjs +6 -4
  116. package/dist/container.mjs.map +1 -1
  117. package/dist/context-menu.d.mts +26 -11
  118. package/dist/context-menu.d.ts +26 -11
  119. package/dist/context-menu.js.map +1 -1
  120. package/dist/context-menu.mjs.map +1 -1
  121. package/dist/data-table.d.mts +10 -7
  122. package/dist/data-table.d.ts +10 -7
  123. package/dist/data-table.js +25 -25
  124. package/dist/data-table.js.map +1 -1
  125. package/dist/data-table.mjs +3 -3
  126. package/dist/data-table.mjs.map +1 -1
  127. package/dist/dialog.d.mts +11 -3
  128. package/dist/dialog.d.ts +11 -3
  129. package/dist/dialog.js +2 -2
  130. package/dist/dialog.mjs +1 -1
  131. package/dist/drawer.d.mts +12 -4
  132. package/dist/drawer.d.ts +12 -4
  133. package/dist/drawer.js.map +1 -1
  134. package/dist/drawer.mjs.map +1 -1
  135. package/dist/dropdown-menu.d.mts +25 -11
  136. package/dist/dropdown-menu.d.ts +25 -11
  137. package/dist/dropdown-menu.js +2 -2
  138. package/dist/dropdown-menu.mjs +1 -1
  139. package/dist/em.d.mts +5 -4
  140. package/dist/em.d.ts +5 -4
  141. package/dist/em.js +6 -4
  142. package/dist/em.js.map +1 -1
  143. package/dist/em.mjs +6 -4
  144. package/dist/em.mjs.map +1 -1
  145. package/dist/form.d.mts +14 -6
  146. package/dist/form.d.ts +14 -6
  147. package/dist/form.js +26 -22
  148. package/dist/form.js.map +1 -1
  149. package/dist/form.mjs +25 -21
  150. package/dist/form.mjs.map +1 -1
  151. package/dist/heading.d.mts +6 -5
  152. package/dist/heading.d.ts +6 -5
  153. package/dist/heading.js +6 -4
  154. package/dist/heading.js.map +1 -1
  155. package/dist/heading.mjs +6 -4
  156. package/dist/heading.mjs.map +1 -1
  157. package/dist/hover-card.d.mts +4 -1
  158. package/dist/hover-card.d.ts +4 -1
  159. package/dist/hover-card.js.map +1 -1
  160. package/dist/hover-card.mjs.map +1 -1
  161. package/dist/input-otp.d.mts +12 -32
  162. package/dist/input-otp.d.ts +12 -32
  163. package/dist/input-otp.js +30 -22
  164. package/dist/input-otp.js.map +1 -1
  165. package/dist/input-otp.mjs +29 -21
  166. package/dist/input-otp.mjs.map +1 -1
  167. package/dist/input.d.mts +6 -3
  168. package/dist/input.d.ts +6 -3
  169. package/dist/input.js +13 -11
  170. package/dist/input.js.map +1 -1
  171. package/dist/input.mjs +13 -11
  172. package/dist/input.mjs.map +1 -1
  173. package/dist/kbd.d.mts +5 -4
  174. package/dist/kbd.d.ts +5 -4
  175. package/dist/kbd.js +16 -14
  176. package/dist/kbd.js.map +1 -1
  177. package/dist/kbd.mjs +16 -14
  178. package/dist/kbd.mjs.map +1 -1
  179. package/dist/label.d.mts +2 -1
  180. package/dist/label.d.ts +2 -1
  181. package/dist/label.js +2 -2
  182. package/dist/label.mjs +1 -1
  183. package/dist/menubar.d.mts +27 -12
  184. package/dist/menubar.d.ts +27 -12
  185. package/dist/menubar.js.map +1 -1
  186. package/dist/menubar.mjs.map +1 -1
  187. package/dist/navigation-menu.d.mts +9 -1
  188. package/dist/navigation-menu.d.ts +9 -1
  189. package/dist/navigation-menu.js.map +1 -1
  190. package/dist/navigation-menu.mjs.map +1 -1
  191. package/dist/pagination.d.mts +13 -7
  192. package/dist/pagination.d.ts +13 -7
  193. package/dist/pagination.js +5 -3
  194. package/dist/pagination.js.map +1 -1
  195. package/dist/pagination.mjs +4 -2
  196. package/dist/pagination.mjs.map +1 -1
  197. package/dist/popover.d.mts +6 -1
  198. package/dist/popover.d.ts +6 -1
  199. package/dist/popover.js.map +1 -1
  200. package/dist/popover.mjs.map +1 -1
  201. package/dist/pre.d.mts +5 -4
  202. package/dist/pre.d.ts +5 -4
  203. package/dist/pre.js +6 -4
  204. package/dist/pre.js.map +1 -1
  205. package/dist/pre.mjs +6 -4
  206. package/dist/pre.mjs.map +1 -1
  207. package/dist/progress.d.mts +2 -1
  208. package/dist/progress.d.ts +2 -1
  209. package/dist/progress.js +1 -1
  210. package/dist/progress.js.map +1 -1
  211. package/dist/progress.mjs +1 -1
  212. package/dist/progress.mjs.map +1 -1
  213. package/dist/quote.d.mts +5 -4
  214. package/dist/quote.d.ts +5 -4
  215. package/dist/quote.js +6 -4
  216. package/dist/quote.js.map +1 -1
  217. package/dist/quote.mjs +6 -4
  218. package/dist/quote.mjs.map +1 -1
  219. package/dist/radio-group.d.mts +3 -1
  220. package/dist/radio-group.d.ts +3 -1
  221. package/dist/radio-group.js.map +1 -1
  222. package/dist/radio-group.mjs.map +1 -1
  223. package/dist/resizable.d.mts +4 -4
  224. package/dist/resizable.d.ts +4 -4
  225. package/dist/resizable.js +1 -1
  226. package/dist/resizable.js.map +1 -1
  227. package/dist/resizable.mjs +1 -1
  228. package/dist/resizable.mjs.map +1 -1
  229. package/dist/scroll-area.d.mts +4 -2
  230. package/dist/scroll-area.d.ts +4 -2
  231. package/dist/scroll-area.js +6 -6
  232. package/dist/scroll-area.js.map +1 -1
  233. package/dist/scroll-area.mjs +6 -6
  234. package/dist/scroll-area.mjs.map +1 -1
  235. package/dist/section.d.mts +5 -4
  236. package/dist/section.d.ts +5 -4
  237. package/dist/section.js +6 -4
  238. package/dist/section.js.map +1 -1
  239. package/dist/section.mjs +6 -4
  240. package/dist/section.mjs.map +1 -1
  241. package/dist/select.d.mts +11 -1
  242. package/dist/select.d.ts +11 -1
  243. package/dist/select.js +2 -2
  244. package/dist/select.mjs +1 -1
  245. package/dist/separator.d.mts +2 -1
  246. package/dist/separator.d.ts +2 -1
  247. package/dist/separator.js.map +1 -1
  248. package/dist/separator.mjs.map +1 -1
  249. package/dist/sheet.d.mts +18 -8
  250. package/dist/sheet.d.ts +18 -8
  251. package/dist/sheet.js.map +1 -1
  252. package/dist/sheet.mjs.map +1 -1
  253. package/dist/skeleton.d.mts +3 -2
  254. package/dist/skeleton.d.ts +3 -2
  255. package/dist/skeleton.js +1 -4
  256. package/dist/skeleton.js.map +1 -1
  257. package/dist/skeleton.mjs +1 -4
  258. package/dist/skeleton.mjs.map +1 -1
  259. package/dist/slider.d.mts +2 -1
  260. package/dist/slider.d.ts +2 -1
  261. package/dist/slider.js.map +1 -1
  262. package/dist/slider.mjs.map +1 -1
  263. package/dist/sonner.d.mts +1 -1
  264. package/dist/sonner.d.ts +1 -1
  265. package/dist/sonner.js.map +1 -1
  266. package/dist/sonner.mjs.map +1 -1
  267. package/dist/strong.d.mts +5 -4
  268. package/dist/strong.d.ts +5 -4
  269. package/dist/strong.js +6 -4
  270. package/dist/strong.js.map +1 -1
  271. package/dist/strong.mjs +6 -4
  272. package/dist/strong.mjs.map +1 -1
  273. package/dist/switch.d.mts +2 -1
  274. package/dist/switch.d.ts +2 -1
  275. package/dist/switch.js.map +1 -1
  276. package/dist/switch.mjs.map +1 -1
  277. package/dist/table.d.mts +17 -9
  278. package/dist/table.d.ts +17 -9
  279. package/dist/table.js +75 -58
  280. package/dist/table.js.map +1 -1
  281. package/dist/table.mjs +75 -58
  282. package/dist/table.mjs.map +1 -1
  283. package/dist/tabs.d.mts +5 -1
  284. package/dist/tabs.d.ts +5 -1
  285. package/dist/tabs.js.map +1 -1
  286. package/dist/tabs.mjs.map +1 -1
  287. package/dist/text.d.mts +1 -1
  288. package/dist/text.d.ts +1 -1
  289. package/dist/text.js.map +1 -1
  290. package/dist/text.mjs.map +1 -1
  291. package/dist/textarea.d.mts +3 -2
  292. package/dist/textarea.d.ts +3 -2
  293. package/dist/textarea.js +15 -13
  294. package/dist/textarea.js.map +1 -1
  295. package/dist/textarea.mjs +15 -13
  296. package/dist/textarea.mjs.map +1 -1
  297. package/dist/toggle-group.d.mts +4 -2
  298. package/dist/toggle-group.d.ts +4 -2
  299. package/dist/toggle-group.js +2 -2
  300. package/dist/toggle-group.js.map +1 -1
  301. package/dist/toggle-group.mjs +1 -1
  302. package/dist/toggle-group.mjs.map +1 -1
  303. package/dist/toggle.d.mts +2 -1
  304. package/dist/toggle.d.ts +2 -1
  305. package/dist/toggle.js +2 -2
  306. package/dist/toggle.mjs +1 -1
  307. package/dist/tooltip.d.mts +6 -1
  308. package/dist/tooltip.d.ts +6 -1
  309. package/dist/tooltip.js.map +1 -1
  310. package/dist/tooltip.mjs.map +1 -1
  311. package/package.json +6 -6
  312. package/src/accordion.tsx +17 -4
  313. package/src/alert-dialog.tsx +26 -7
  314. package/src/alert.tsx +35 -25
  315. package/src/aspect-ratio.tsx +2 -1
  316. package/src/avatar.tsx +13 -3
  317. package/src/badge.tsx +6 -3
  318. package/src/blockquote.tsx +11 -10
  319. package/src/box.tsx +1 -1
  320. package/src/breadcrumb.tsx +70 -60
  321. package/src/button.tsx +4 -2
  322. package/src/calendar.tsx +3 -2
  323. package/src/card.tsx +59 -52
  324. package/src/carousel.tsx +76 -72
  325. package/src/checkbox.tsx +3 -2
  326. package/src/code.tsx +10 -8
  327. package/src/collapsible.tsx +11 -1
  328. package/src/command.tsx +47 -10
  329. package/src/container.tsx +10 -10
  330. package/src/context-menu.tsx +52 -16
  331. package/src/data-table.tsx +23 -11
  332. package/src/dialog.tsx +21 -5
  333. package/src/drawer.tsx +28 -6
  334. package/src/dropdown-menu.tsx +51 -15
  335. package/src/em.tsx +10 -8
  336. package/src/form.tsx +55 -38
  337. package/src/heading.tsx +11 -11
  338. package/src/hover-card.tsx +12 -2
  339. package/src/input-otp.tsx +45 -33
  340. package/src/input.tsx +17 -15
  341. package/src/kbd.tsx +19 -17
  342. package/src/label.tsx +3 -2
  343. package/src/menubar.tsx +48 -17
  344. package/src/navigation-menu.tsx +25 -5
  345. package/src/pagination.tsx +21 -9
  346. package/src/popover.tsx +18 -2
  347. package/src/pre.tsx +10 -8
  348. package/src/progress.tsx +4 -3
  349. package/src/quote.tsx +10 -8
  350. package/src/radio-group.tsx +10 -3
  351. package/src/resizable.tsx +2 -1
  352. package/src/scroll-area.tsx +18 -11
  353. package/src/section.tsx +10 -10
  354. package/src/select.tsx +27 -7
  355. package/src/separator.tsx +3 -2
  356. package/src/sheet.tsx +23 -5
  357. package/src/skeleton.tsx +3 -5
  358. package/src/slider.tsx +3 -2
  359. package/src/sonner.tsx +1 -1
  360. package/src/strong.tsx +10 -8
  361. package/src/switch.tsx +3 -2
  362. package/src/table.tsx +90 -78
  363. package/src/tabs.tsx +17 -4
  364. package/src/text.tsx +1 -1
  365. package/src/textarea.tsx +16 -16
  366. package/src/toggle-group.tsx +14 -4
  367. package/src/toggle.tsx +3 -2
  368. package/src/tooltip.tsx +12 -2
  369. package/dist/chunk-2D7SRYKN.js.map +0 -1
  370. package/dist/chunk-EDVCMWDT.mjs.map +0 -1
  371. package/dist/chunk-EIHWTXQ4.mjs.map +0 -1
  372. package/dist/chunk-ESWGFN3R.mjs.map +0 -1
  373. package/dist/chunk-KW5FJ62U.mjs.map +0 -1
  374. package/dist/chunk-LDYBRDAY.js.map +0 -1
  375. package/dist/chunk-OCLLX7EY.js.map +0 -1
  376. package/dist/chunk-PTD4AMHI.mjs.map +0 -1
  377. package/dist/chunk-RTKEO347.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/data-table.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type * as ReactTable from \"@tanstack/react-table\";\nimport {\n ArrowDownIcon,\n ArrowUpIcon,\n CaretSortIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from \"@radix-ui/react-icons\";\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"./dropdown-menu\";\nimport { Button } from \"./button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"./select\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\nfunction DataTableViewOptions<TData>({\n table,\n}: {\n table: ReactTable.Table<TData>;\n}): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"ml-auto hidden h-8 lg:flex\"\n >\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-[150px]\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter(\n (column) =>\n typeof column.accessorFn !== \"undefined\" && column.getCanHide(),\n )\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n className=\"capitalize\"\n checked={column.getIsVisible()}\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTablePagination\n * -------------------------------------------------------------------------- */\n\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement> & {\n table: ReactTable.Table<TData>;\n}): React.JSX.Element {\n return (\n <div\n className={cn(\"flex items-center justify-between px-2\", className)}\n {...props}\n >\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of{\" \"}\n {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={`${table.getState().pagination.pageSize}`}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50].map((pageSize) => (\n <SelectItem key={pageSize} value={`${pageSize}`}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of{\" \"}\n {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.previousPage();\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.nextPage();\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <DoubleArrowRightIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableColumnHeader\n * -------------------------------------------------------------------------- */\n\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: React.HTMLAttributes<HTMLDivElement> & {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}): React.JSX.Element {\n if (!column.getCanSort()) {\n return <div className={cn(className)}>{title}</div>;\n }\n\n return (\n <div className={cn(\"flex items-center space-x-2\", className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"xs\"\n className=\"data-[state=open]:bg-accent -ml-3\"\n >\n <span>{title}</span>\n {column.getIsSorted() === \"desc\" ? (\n <ArrowDownIcon className=\"ml-2 size-4\" />\n ) : column.getIsSorted() === \"asc\" ? (\n <ArrowUpIcon className=\"ml-2 size-4\" />\n ) : (\n <CaretSortIcon className=\"ml-2 size-4\" />\n )}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(false);\n }}\n >\n <ArrowUpIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(true);\n }}\n >\n <ArrowDownIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n column.toggleVisibility(false);\n }}\n >\n <EyeNoneIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Hide\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { DataTableViewOptions, DataTablePagination, DataTableColumnHeader };\n\nexport * from \"@tanstack/react-table\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAgPP,cAAc;AAhNN,SAKE,KALF;AARR,SAAS,qBAA4B;AAAA,EACnC;AACF,GAEsB;AACpB,SACE,qBAAC,gBACC;AAAA,wBAAC,uBAAoB,SAAO,MAC1B;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,WAAU;AAAA,QAEV;AAAA,8BAAC,uBAAoB,WAAU,eAAc;AAAA,UAAE;AAAA;AAAA;AAAA,IAEjD,GACF;AAAA,IACA,qBAAC,uBAAoB,OAAM,OAAM,WAAU,aACzC;AAAA,0BAAC,qBAAkB,4BAAc;AAAA,MACjC,oBAAC,yBAAsB;AAAA,MACtB,MACE,cAAc,EAC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;AACb,mBAAO,iBAAiB,KAAK;AAAA,UAC/B;AAAA,UAEA;AAAA,gCAAC,eAAY,WAAU,0CAAyC;AAAA,YAAE;AAAA;AAAA;AAAA,MAEpE;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/data-table.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type * as ReactTable from \"@tanstack/react-table\";\nimport {\n ArrowDownIcon,\n ArrowUpIcon,\n CaretSortIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from \"@radix-ui/react-icons\";\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"./dropdown-menu\";\nimport { Button } from \"./button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"./select\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\nfunction DataTableViewOptions<TData>({\n table,\n}: DataTableViewOptionsProps<TData>): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"ml-auto hidden h-8 lg:flex\"\n >\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-[150px]\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter(\n (column) =>\n typeof column.accessorFn !== \"undefined\" && column.getCanHide(),\n )\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n className=\"capitalize\"\n checked={column.getIsVisible()}\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTablePagination\n * -------------------------------------------------------------------------- */\n\ninterface DataTablePaginationProps<TData>\n extends React.HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: DataTablePaginationProps<TData>): React.JSX.Element {\n return (\n <div\n className={cn(\"flex items-center justify-between px-2\", className)}\n {...props}\n >\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of{\" \"}\n {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={`${table.getState().pagination.pageSize}`}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50].map((pageSize) => (\n <SelectItem key={pageSize} value={`${pageSize}`}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of{\" \"}\n {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.previousPage();\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.nextPage();\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <DoubleArrowRightIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableColumnHeader\n * -------------------------------------------------------------------------- */\n\ninterface DataTableColumnHeaderProps<TData, TValue>\n extends React.HTMLAttributes<HTMLDivElement> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: DataTableColumnHeaderProps<TData, TValue>): React.JSX.Element {\n if (!column.getCanSort()) {\n return <div className={cn(className)}>{title}</div>;\n }\n\n return (\n <div className={cn(\"flex items-center space-x-2\", className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"xs\"\n className=\"data-[state=open]:bg-accent -ml-3\"\n >\n <span>{title}</span>\n {column.getIsSorted() === \"desc\" ? (\n <ArrowDownIcon className=\"ml-2 size-4\" />\n ) : column.getIsSorted() === \"asc\" ? (\n <ArrowUpIcon className=\"ml-2 size-4\" />\n ) : (\n <CaretSortIcon className=\"ml-2 size-4\" />\n )}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(false);\n }}\n >\n <ArrowUpIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(true);\n }}\n >\n <ArrowDownIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n column.toggleVisibility(false);\n }}\n >\n <EyeNoneIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Hide\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DataTableViewOptions,\n DataTablePagination,\n DataTableColumnHeader,\n type DataTableViewOptionsProps,\n type DataTablePaginationProps,\n type DataTableColumnHeaderProps,\n};\n\nexport * from \"@tanstack/react-table\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA4PP,cAAc;AA3NN,SAKE,KALF;AANR,SAAS,qBAA4B;AAAA,EACnC;AACF,GAAwD;AACtD,SACE,qBAAC,gBACC;AAAA,wBAAC,uBAAoB,SAAO,MAC1B;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,WAAU;AAAA,QAEV;AAAA,8BAAC,uBAAoB,WAAU,eAAc;AAAA,UAAE;AAAA;AAAA;AAAA,IAEjD,GACF;AAAA,IACA,qBAAC,uBAAoB,OAAM,OAAM,WAAU,aACzC;AAAA,0BAAC,qBAAkB,4BAAc;AAAA,MACjC,oBAAC,yBAAsB;AAAA,MACtB,MACE,cAAc,EACd;AAAA,QACC,CAAC,WACC,OAAO,OAAO,eAAe,eAAe,OAAO,WAAW;AAAA,MAClE,EACC,IAAI,CAAC,WAAW;AACf,eACE;AAAA,UAAC;AAAA;AAAA,Y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,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
package/dist/dialog.d.mts CHANGED
@@ -1,13 +1,21 @@
1
1
  import * as React from 'react';
2
2
  import * as DialogPrimitive from '@radix-ui/react-dialog';
3
3
 
4
+ type DialogProps = DialogPrimitive.DialogProps;
4
5
  declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
6
+ type DialogTriggerProps = DialogPrimitive.DialogTriggerProps;
5
7
  declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
8
+ type DialogCloseProps = DialogPrimitive.DialogCloseProps;
6
9
  declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
10
+ type DialogContentProps = DialogPrimitive.DialogContentProps;
7
11
  declare const DialogContent: React.ForwardRefExoticComponent<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>>;
8
- declare function DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
9
- declare function DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
12
+ type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;
13
+ declare function DialogHeader({ className, ...props }: DialogHeaderProps): React.JSX.Element;
14
+ type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
15
+ declare function DialogFooter({ className, ...props }: DialogFooterProps): React.JSX.Element;
16
+ type DialogTitleProps = DialogPrimitive.DialogTitleProps;
10
17
  declare const DialogTitle: React.ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
18
+ type DialogDescriptionProps = DialogPrimitive.DialogDescriptionProps;
11
19
  declare const DialogDescription: React.ForwardRefExoticComponent<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
12
20
 
13
- export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
21
+ export { Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps };
package/dist/dialog.d.ts CHANGED
@@ -1,13 +1,21 @@
1
1
  import * as React from 'react';
2
2
  import * as DialogPrimitive from '@radix-ui/react-dialog';
3
3
 
4
+ type DialogProps = DialogPrimitive.DialogProps;
4
5
  declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
6
+ type DialogTriggerProps = DialogPrimitive.DialogTriggerProps;
5
7
  declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
8
+ type DialogCloseProps = DialogPrimitive.DialogCloseProps;
6
9
  declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
10
+ type DialogContentProps = DialogPrimitive.DialogContentProps;
7
11
  declare const DialogContent: React.ForwardRefExoticComponent<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>>;
8
- declare function DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
9
- declare function DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
12
+ type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;
13
+ declare function DialogHeader({ className, ...props }: DialogHeaderProps): React.JSX.Element;
14
+ type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
15
+ declare function DialogFooter({ className, ...props }: DialogFooterProps): React.JSX.Element;
16
+ type DialogTitleProps = DialogPrimitive.DialogTitleProps;
10
17
  declare const DialogTitle: React.ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
18
+ type DialogDescriptionProps = DialogPrimitive.DialogDescriptionProps;
11
19
  declare const DialogDescription: React.ForwardRefExoticComponent<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
12
20
 
13
- export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
21
+ export { Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps };
package/dist/dialog.js CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkLDYBRDAYjs = require('./chunk-LDYBRDAY.js');
11
+ var _chunkD6NQEMTJjs = require('./chunk-D6NQEMTJ.js');
12
12
  require('./chunk-G3NP7M2N.js');
13
13
 
14
14
 
@@ -19,5 +19,5 @@ require('./chunk-G3NP7M2N.js');
19
19
 
20
20
 
21
21
 
22
- exports.Dialog = _chunkLDYBRDAYjs.Dialog; exports.DialogClose = _chunkLDYBRDAYjs.DialogClose; exports.DialogContent = _chunkLDYBRDAYjs.DialogContent; exports.DialogDescription = _chunkLDYBRDAYjs.DialogDescription; exports.DialogFooter = _chunkLDYBRDAYjs.DialogFooter; exports.DialogHeader = _chunkLDYBRDAYjs.DialogHeader; exports.DialogTitle = _chunkLDYBRDAYjs.DialogTitle; exports.DialogTrigger = _chunkLDYBRDAYjs.DialogTrigger;
22
+ exports.Dialog = _chunkD6NQEMTJjs.Dialog; exports.DialogClose = _chunkD6NQEMTJjs.DialogClose; exports.DialogContent = _chunkD6NQEMTJjs.DialogContent; exports.DialogDescription = _chunkD6NQEMTJjs.DialogDescription; exports.DialogFooter = _chunkD6NQEMTJjs.DialogFooter; exports.DialogHeader = _chunkD6NQEMTJjs.DialogHeader; exports.DialogTitle = _chunkD6NQEMTJjs.DialogTitle; exports.DialogTrigger = _chunkD6NQEMTJjs.DialogTrigger;
23
23
  //# sourceMappingURL=dialog.js.map
package/dist/dialog.mjs CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  DialogHeader,
9
9
  DialogTitle,
10
10
  DialogTrigger
11
- } from "./chunk-EIHWTXQ4.mjs";
11
+ } from "./chunk-AJLEALVP.mjs";
12
12
  import "./chunk-UG3URV2Z.mjs";
13
13
  export {
14
14
  Dialog,
package/dist/drawer.d.mts CHANGED
@@ -2,15 +2,23 @@ import * as DialogPrimitive from '@radix-ui/react-dialog';
2
2
  import * as React from 'react';
3
3
  import { Drawer as Drawer$1 } from 'vaul';
4
4
 
5
- declare function Drawer({ shouldScaleBackground, ...props }: React.ComponentProps<typeof Drawer$1.Root>): React.JSX.Element;
5
+ type DrawerProps = React.ComponentProps<typeof Drawer$1.Root>;
6
+ declare function Drawer({ shouldScaleBackground, ...props }: DrawerProps): React.JSX.Element;
7
+ type DrawerTriggerProps = React.ComponentProps<typeof Drawer$1.Trigger>;
6
8
  declare const DrawerTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
9
+ type DrawerCloseProps = React.ComponentProps<typeof Drawer$1.Close>;
7
10
  declare const DrawerClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
11
+ type DrawerContentProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Content>;
8
12
  declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
9
13
  onAnimationEnd?: ((open: boolean) => void) | undefined;
10
14
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
- declare function DrawerHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
12
- declare function DrawerFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
15
+ type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;
16
+ declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element;
17
+ type DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;
18
+ declare function DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element;
19
+ type DrawerTitleProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Title>;
13
20
  declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
21
+ type DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Description>;
14
22
  declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
15
23
 
16
- export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
24
+ export { Drawer, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerProps, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps };
package/dist/drawer.d.ts CHANGED
@@ -2,15 +2,23 @@ import * as DialogPrimitive from '@radix-ui/react-dialog';
2
2
  import * as React from 'react';
3
3
  import { Drawer as Drawer$1 } from 'vaul';
4
4
 
5
- declare function Drawer({ shouldScaleBackground, ...props }: React.ComponentProps<typeof Drawer$1.Root>): React.JSX.Element;
5
+ type DrawerProps = React.ComponentProps<typeof Drawer$1.Root>;
6
+ declare function Drawer({ shouldScaleBackground, ...props }: DrawerProps): React.JSX.Element;
7
+ type DrawerTriggerProps = React.ComponentProps<typeof Drawer$1.Trigger>;
6
8
  declare const DrawerTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
9
+ type DrawerCloseProps = React.ComponentProps<typeof Drawer$1.Close>;
7
10
  declare const DrawerClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
11
+ type DrawerContentProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Content>;
8
12
  declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
9
13
  onAnimationEnd?: ((open: boolean) => void) | undefined;
10
14
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
- declare function DrawerHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
12
- declare function DrawerFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
15
+ type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;
16
+ declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element;
17
+ type DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;
18
+ declare function DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element;
19
+ type DrawerTitleProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Title>;
13
20
  declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
21
+ type DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Description>;
14
22
  declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
15
23
 
16
- export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
24
+ export { Drawer, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerProps, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/drawer.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAYtC,cA6BA,YA7BA;AALJ,SAAS,OAAO;AAAA,EACd,wBAAwB;AAAA,EACxB,GAAG;AACL,GAAyE;AACvE,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAMA,IAAM,gBAAgB,gBAAgB;AAMtC,IAAM,cAAc,gBAAgB;AAMpC,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;AAM5B,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAA4D;AAC1D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,6CAA6C,SAAS;AAAA,MACnE,GAAG;AAAA;AAAA,EACN;AAEJ;AAMA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAA4D;AAC1D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,mCAAmC,SAAS;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AAMA,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;AAMhD,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\nfunction Drawer({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element {\n return (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\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\nfunction DrawerHeader({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>): 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\nfunction DrawerFooter({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>): 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\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\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\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\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,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,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 +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\nfunction Drawer({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element {\n return (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\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\nfunction DrawerHeader({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>): 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\nfunction DrawerFooter({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>): 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\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\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\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\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};\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAYtC,cA6BA,YA7BA;AALJ,SAAS,OAAO;AAAA,EACd,wBAAwB;AAAA,EACxB,GAAG;AACL,GAAyE;AACvE,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAMA,IAAM,gBAAgB,gBAAgB;AAMtC,IAAM,cAAc,gBAAgB;AAMpC,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;AAM5B,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAA4D;AAC1D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,6CAA6C,SAAS;AAAA,MACnE,GAAG;AAAA;AAAA,EACN;AAEJ;AAMA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAA4D;AAC1D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,mCAAmC,SAAS;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AAMA,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;AAMhD,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>;\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,25 +1,39 @@
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
5
  declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
6
+ type DropdownMenuTriggerProps = DropdownMenuPrimitive.DropdownMenuTriggerProps;
5
7
  declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
8
+ type DropdownMenuGroupProps = DropdownMenuPrimitive.DropdownMenuGroupProps;
6
9
  declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
10
+ type DropdownMenuSubProps = DropdownMenuPrimitive.DropdownMenuSubProps;
7
11
  declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
12
+ type DropdownMenuRadioGroupProps = DropdownMenuPrimitive.DropdownMenuRadioGroupProps;
8
13
  declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
9
- declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & {
10
- inset?: boolean | undefined;
11
- } & React.RefAttributes<HTMLDivElement>>;
14
+ interface DropdownMenuSubTriggerProps extends DropdownMenuPrimitive.DropdownMenuSubTriggerProps {
15
+ inset?: boolean;
16
+ }
17
+ declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
18
+ type DropdownMenuSubContentProps = DropdownMenuPrimitive.DropdownMenuSubContentProps;
12
19
  declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
20
+ type DropdownMenuContentProps = DropdownMenuPrimitive.DropdownMenuContentProps;
13
21
  declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
14
- declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuItemProps & {
15
- inset?: boolean | undefined;
16
- } & React.RefAttributes<HTMLDivElement>>;
22
+ interface DropdownMenuItemProps extends DropdownMenuPrimitive.DropdownMenuItemProps {
23
+ inset?: boolean;
24
+ }
25
+ declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>>;
26
+ type DropdownMenuCheckboxItemProps = DropdownMenuPrimitive.DropdownMenuCheckboxItemProps;
17
27
  declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
28
+ type DropdownMenuRadioItemProps = DropdownMenuPrimitive.DropdownMenuRadioItemProps;
18
29
  declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
19
- declare const DropdownMenuLabel: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuLabelProps & {
20
- inset?: boolean | undefined;
21
- } & React.RefAttributes<HTMLDivElement>>;
30
+ interface DropdownMenuLabelProps extends DropdownMenuPrimitive.DropdownMenuLabelProps {
31
+ inset?: boolean;
32
+ }
33
+ declare const DropdownMenuLabel: React.ForwardRefExoticComponent<DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
34
+ type DropdownMenuSeparatorProps = DropdownMenuPrimitive.DropdownMenuSeparatorProps;
22
35
  declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
23
- declare function DropdownMenuShortcut({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
36
+ type DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
37
+ declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): React.JSX.Element;
24
38
 
25
- export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
39
+ export { DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
@@ -1,25 +1,39 @@
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
5
  declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
6
+ type DropdownMenuTriggerProps = DropdownMenuPrimitive.DropdownMenuTriggerProps;
5
7
  declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
8
+ type DropdownMenuGroupProps = DropdownMenuPrimitive.DropdownMenuGroupProps;
6
9
  declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
10
+ type DropdownMenuSubProps = DropdownMenuPrimitive.DropdownMenuSubProps;
7
11
  declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
12
+ type DropdownMenuRadioGroupProps = DropdownMenuPrimitive.DropdownMenuRadioGroupProps;
8
13
  declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
9
- declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & {
10
- inset?: boolean | undefined;
11
- } & React.RefAttributes<HTMLDivElement>>;
14
+ interface DropdownMenuSubTriggerProps extends DropdownMenuPrimitive.DropdownMenuSubTriggerProps {
15
+ inset?: boolean;
16
+ }
17
+ declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
18
+ type DropdownMenuSubContentProps = DropdownMenuPrimitive.DropdownMenuSubContentProps;
12
19
  declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
20
+ type DropdownMenuContentProps = DropdownMenuPrimitive.DropdownMenuContentProps;
13
21
  declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
14
- declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuItemProps & {
15
- inset?: boolean | undefined;
16
- } & React.RefAttributes<HTMLDivElement>>;
22
+ interface DropdownMenuItemProps extends DropdownMenuPrimitive.DropdownMenuItemProps {
23
+ inset?: boolean;
24
+ }
25
+ declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>>;
26
+ type DropdownMenuCheckboxItemProps = DropdownMenuPrimitive.DropdownMenuCheckboxItemProps;
17
27
  declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
28
+ type DropdownMenuRadioItemProps = DropdownMenuPrimitive.DropdownMenuRadioItemProps;
18
29
  declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
19
- declare const DropdownMenuLabel: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuLabelProps & {
20
- inset?: boolean | undefined;
21
- } & React.RefAttributes<HTMLDivElement>>;
30
+ interface DropdownMenuLabelProps extends DropdownMenuPrimitive.DropdownMenuLabelProps {
31
+ inset?: boolean;
32
+ }
33
+ declare const DropdownMenuLabel: React.ForwardRefExoticComponent<DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
34
+ type DropdownMenuSeparatorProps = DropdownMenuPrimitive.DropdownMenuSeparatorProps;
22
35
  declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
23
- declare function DropdownMenuShortcut({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
36
+ type DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
37
+ declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): React.JSX.Element;
24
38
 
25
- export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
39
+ export { DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- var _chunkOCLLX7EYjs = require('./chunk-OCLLX7EY.js');
17
+ var _chunk3BDLWZ3Wjs = require('./chunk-3BDLWZ3W.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 = _chunkOCLLX7EYjs.DropdownMenu; exports.DropdownMenuCheckboxItem = _chunkOCLLX7EYjs.DropdownMenuCheckboxItem; exports.DropdownMenuContent = _chunkOCLLX7EYjs.DropdownMenuContent; exports.DropdownMenuGroup = _chunkOCLLX7EYjs.DropdownMenuGroup; exports.DropdownMenuItem = _chunkOCLLX7EYjs.DropdownMenuItem; exports.DropdownMenuLabel = _chunkOCLLX7EYjs.DropdownMenuLabel; exports.DropdownMenuRadioGroup = _chunkOCLLX7EYjs.DropdownMenuRadioGroup; exports.DropdownMenuRadioItem = _chunkOCLLX7EYjs.DropdownMenuRadioItem; exports.DropdownMenuSeparator = _chunkOCLLX7EYjs.DropdownMenuSeparator; exports.DropdownMenuShortcut = _chunkOCLLX7EYjs.DropdownMenuShortcut; exports.DropdownMenuSub = _chunkOCLLX7EYjs.DropdownMenuSub; exports.DropdownMenuSubContent = _chunkOCLLX7EYjs.DropdownMenuSubContent; exports.DropdownMenuSubTrigger = _chunkOCLLX7EYjs.DropdownMenuSubTrigger; exports.DropdownMenuTrigger = _chunkOCLLX7EYjs.DropdownMenuTrigger;
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;
35
35
  //# sourceMappingURL=dropdown-menu.js.map
@@ -14,7 +14,7 @@ import {
14
14
  DropdownMenuSubContent,
15
15
  DropdownMenuSubTrigger,
16
16
  DropdownMenuTrigger
17
- } from "./chunk-EDVCMWDT.mjs";
17
+ } from "./chunk-NCEN3XBK.mjs";
18
18
  import "./chunk-UG3URV2Z.mjs";
19
19
  export {
20
20
  DropdownMenu,
package/dist/em.d.mts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
 
3
- declare const Em: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
4
- asChild?: boolean | undefined;
5
- } & React.RefAttributes<HTMLElement>>;
3
+ interface EmProps extends React.HTMLAttributes<HTMLElement> {
4
+ asChild?: boolean;
5
+ }
6
+ declare const Em: React.ForwardRefExoticComponent<EmProps & React.RefAttributes<HTMLElement>>;
6
7
 
7
- export { Em };
8
+ export { Em, type EmProps };
package/dist/em.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
 
3
- declare const Em: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
4
- asChild?: boolean | undefined;
5
- } & React.RefAttributes<HTMLElement>>;
3
+ interface EmProps extends React.HTMLAttributes<HTMLElement> {
4
+ asChild?: boolean;
5
+ }
6
+ declare const Em: React.ForwardRefExoticComponent<EmProps & React.RefAttributes<HTMLElement>>;
6
7
 
7
- export { Em };
8
+ export { Em, type EmProps };
package/dist/em.js CHANGED
@@ -2,10 +2,12 @@
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(({ asChild, ...props }, ref) => {
6
- const Comp = asChild ? _reactslot.Slot : "em";
7
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Comp, { ref, ...props });
8
- });
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
+ );
9
11
  Em.displayName = "Em";
10
12
 
11
13
 
package/dist/em.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/em.tsx"],"names":[],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAYZ;AANT,IAAM,KAAW,iBAGf,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ;AAChC,QAAM,OAAO,UAAU,OAAO;AAE9B,SAAO,oBAAC,QAAK,KAAW,GAAG,OAAO;AACpC,CAAC;AACD,GAAG,cAAc","sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\nconst Em = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement> & { asChild?: boolean }\n>(({ asChild, ...props }, ref) => {\n const Comp = asChild ? Slot : \"em\";\n\n return <Comp ref={ref} {...props} />;\n});\nEm.displayName = \"Em\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em };\n"]}
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"]}
package/dist/em.mjs CHANGED
@@ -2,10 +2,12 @@
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(({ asChild, ...props }, ref) => {
6
- const Comp = asChild ? Slot : "em";
7
- return /* @__PURE__ */ jsx(Comp, { ref, ...props });
8
- });
5
+ var Em = React.forwardRef(
6
+ ({ asChild, ...props }, ref) => {
7
+ const Comp = asChild ? Slot : "em";
8
+ return /* @__PURE__ */ jsx(Comp, { ref, ...props });
9
+ }
10
+ );
9
11
  Em.displayName = "Em";
10
12
  export {
11
13
  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\nconst Em = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement> & { asChild?: boolean }\n>(({ asChild, ...props }, ref) => {\n const Comp = asChild ? Slot : \"em\";\n\n return <Comp ref={ref} {...props} />;\n});\nEm.displayName = \"Em\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em };\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAYZ;AANT,IAAM,KAAW,iBAGf,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ;AAChC,QAAM,OAAO,UAAU,OAAO;AAE9B,SAAO,oBAAC,QAAK,KAAW,GAAG,OAAO;AACpC,CAAC;AACD,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\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":[]}
package/dist/form.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as _radix_ui_react_slot from '@radix-ui/react-slot';
2
+ import { Slot } from '@radix-ui/react-slot';
2
3
  import * as react_hook_form from 'react-hook-form';
3
- import { FieldError, FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
4
+ import { FieldError, FormProvider, FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
4
5
  import * as React from 'react';
5
6
  import * as LabelPrimitive from '@radix-ui/react-label';
6
7
 
@@ -16,12 +17,19 @@ declare const useFormField: () => {
16
17
  formDescriptionId: string;
17
18
  formMessageId: string;
18
19
  };
20
+ type FormProps = React.ComponentProps<typeof FormProvider>;
19
21
  declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = undefined>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
20
- declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>): React.JSX.Element;
21
- declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
22
+ type FormFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = ControllerProps<TFieldValues, TName>;
23
+ declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element;
24
+ type FormItemProps = React.HTMLAttributes<HTMLDivElement>;
25
+ declare const FormItem: React.ForwardRefExoticComponent<FormItemProps & React.RefAttributes<HTMLDivElement>>;
26
+ type FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;
22
27
  declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
28
+ type FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;
23
29
  declare const FormControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
24
- declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
25
- declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
30
+ type FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
31
+ declare const FormDescription: React.ForwardRefExoticComponent<FormDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
32
+ type FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;
33
+ declare const FormMessage: React.ForwardRefExoticComponent<FormMessageProps & React.RefAttributes<HTMLParagraphElement>>;
26
34
 
27
- export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
35
+ export { Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldProps, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, useFormField };
package/dist/form.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as _radix_ui_react_slot from '@radix-ui/react-slot';
2
+ import { Slot } from '@radix-ui/react-slot';
2
3
  import * as react_hook_form from 'react-hook-form';
3
- import { FieldError, FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
4
+ import { FieldError, FormProvider, FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
4
5
  import * as React from 'react';
5
6
  import * as LabelPrimitive from '@radix-ui/react-label';
6
7
 
@@ -16,12 +17,19 @@ declare const useFormField: () => {
16
17
  formDescriptionId: string;
17
18
  formMessageId: string;
18
19
  };
20
+ type FormProps = React.ComponentProps<typeof FormProvider>;
19
21
  declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = undefined>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
20
- declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>): React.JSX.Element;
21
- declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
22
+ type FormFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = ControllerProps<TFieldValues, TName>;
23
+ declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element;
24
+ type FormItemProps = React.HTMLAttributes<HTMLDivElement>;
25
+ declare const FormItem: React.ForwardRefExoticComponent<FormItemProps & React.RefAttributes<HTMLDivElement>>;
26
+ type FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;
22
27
  declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
28
+ type FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;
23
29
  declare const FormControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
24
- declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
25
- declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
30
+ type FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
31
+ declare const FormDescription: React.ForwardRefExoticComponent<FormDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
32
+ type FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;
33
+ declare const FormMessage: React.ForwardRefExoticComponent<FormMessageProps & React.RefAttributes<HTMLParagraphElement>>;
26
34
 
27
- export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
35
+ export { Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldProps, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, useFormField };