@codefast/ui 0.0.50 → 0.0.52

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 (281) hide show
  1. package/dist/{chunk-ZTEJNUH6.js → chunk-46W6RAYD.js} +1 -1
  2. package/dist/chunk-46W6RAYD.js.map +1 -0
  3. package/dist/{chunk-CERSQE5J.js → chunk-4JHGPRLG.js} +1 -1
  4. package/dist/chunk-4JHGPRLG.js.map +1 -0
  5. package/dist/{chunk-I6QCJDIF.mjs → chunk-5RENVAXH.mjs} +1 -1
  6. package/dist/chunk-5RENVAXH.mjs.map +1 -0
  7. package/dist/{chunk-47CSACCM.mjs → chunk-7ABWX5CF.mjs} +2 -2
  8. package/dist/chunk-7ABWX5CF.mjs.map +1 -0
  9. package/dist/{chunk-XHNT6PVI.mjs → chunk-BM5KYF6Y.mjs} +1 -1
  10. package/dist/chunk-BM5KYF6Y.mjs.map +1 -0
  11. package/dist/{chunk-P5AV3QU7.mjs → chunk-BNKSZEF2.mjs} +1 -1
  12. package/dist/chunk-BNKSZEF2.mjs.map +1 -0
  13. package/dist/{chunk-SDGUDONZ.js → chunk-DCDB56BO.js} +1 -1
  14. package/dist/chunk-DCDB56BO.js.map +1 -0
  15. package/dist/{chunk-6FL3EBDQ.mjs → chunk-HMD2ZU33.mjs} +1 -1
  16. package/dist/chunk-HMD2ZU33.mjs.map +1 -0
  17. package/dist/{chunk-JOBEKA4M.mjs → chunk-K63K4LTH.mjs} +2 -2
  18. package/dist/chunk-K63K4LTH.mjs.map +1 -0
  19. package/dist/{chunk-VXPAGNPJ.js → chunk-LJSD47ZL.js} +1 -1
  20. package/dist/chunk-LJSD47ZL.js.map +1 -0
  21. package/dist/{chunk-GDMHMSJ2.mjs → chunk-MFYACCZV.mjs} +1 -1
  22. package/dist/chunk-MFYACCZV.mjs.map +1 -0
  23. package/dist/{chunk-LG7ACTRE.js → chunk-PRCS3RWN.js} +1 -1
  24. package/dist/chunk-PRCS3RWN.js.map +1 -0
  25. package/dist/{chunk-OP6Q7VT5.js → chunk-RHFF4JNH.js} +1 -1
  26. package/dist/chunk-RHFF4JNH.js.map +1 -0
  27. package/dist/{chunk-SCPFGC2X.js → chunk-SCXRD727.js} +1 -1
  28. package/dist/chunk-SCXRD727.js.map +1 -0
  29. package/dist/{chunk-X3LRJQM3.js → chunk-VZVI3OHH.js} +2 -2
  30. package/dist/chunk-VZVI3OHH.js.map +1 -0
  31. package/dist/{chunk-UYRRHPPH.js → chunk-X4BEEJEW.js} +2 -2
  32. package/dist/chunk-X4BEEJEW.js.map +1 -0
  33. package/dist/{chunk-PWF46YXQ.mjs → chunk-Y2GMHG3Z.mjs} +1 -1
  34. package/dist/chunk-Y2GMHG3Z.mjs.map +1 -0
  35. package/dist/{chunk-MU2MZ434.mjs → chunk-ZIB4ZTST.mjs} +1 -1
  36. package/dist/chunk-ZIB4ZTST.mjs.map +1 -0
  37. package/dist/plugin/animate.plugin.js +1 -1
  38. package/dist/plugin/animate.plugin.mjs +1 -1
  39. package/dist/react/accordion.js.map +1 -1
  40. package/dist/react/accordion.mjs.map +1 -1
  41. package/dist/react/alert-dialog.js +1 -1
  42. package/dist/react/alert-dialog.js.map +1 -1
  43. package/dist/react/alert-dialog.mjs +1 -1
  44. package/dist/react/alert-dialog.mjs.map +1 -1
  45. package/dist/react/alert.js.map +1 -1
  46. package/dist/react/alert.mjs.map +1 -1
  47. package/dist/react/aspect-ratio.d.mts +1 -1
  48. package/dist/react/aspect-ratio.d.ts +1 -1
  49. package/dist/react/aspect-ratio.js.map +1 -1
  50. package/dist/react/aspect-ratio.mjs.map +1 -1
  51. package/dist/react/avatar.js.map +1 -1
  52. package/dist/react/avatar.mjs.map +1 -1
  53. package/dist/react/badge.js.map +1 -1
  54. package/dist/react/badge.mjs.map +1 -1
  55. package/dist/react/blockquote.js.map +1 -1
  56. package/dist/react/blockquote.mjs.map +1 -1
  57. package/dist/react/box.js.map +1 -1
  58. package/dist/react/box.mjs.map +1 -1
  59. package/dist/react/breadcrumb.js.map +1 -1
  60. package/dist/react/breadcrumb.mjs.map +1 -1
  61. package/dist/react/button.js +1 -1
  62. package/dist/react/button.mjs +1 -1
  63. package/dist/react/calendar.js +1 -1
  64. package/dist/react/calendar.js.map +1 -1
  65. package/dist/react/calendar.mjs +1 -1
  66. package/dist/react/calendar.mjs.map +1 -1
  67. package/dist/react/card.js.map +1 -1
  68. package/dist/react/card.mjs.map +1 -1
  69. package/dist/react/carousel.js +1 -1
  70. package/dist/react/carousel.js.map +1 -1
  71. package/dist/react/carousel.mjs +1 -1
  72. package/dist/react/carousel.mjs.map +1 -1
  73. package/dist/react/checkbox-cards.js +1 -1
  74. package/dist/react/checkbox-cards.js.map +1 -1
  75. package/dist/react/checkbox-cards.mjs +1 -1
  76. package/dist/react/checkbox-cards.mjs.map +1 -1
  77. package/dist/react/checkbox-group.js +1 -1
  78. package/dist/react/checkbox-group.js.map +1 -1
  79. package/dist/react/checkbox-group.mjs +1 -1
  80. package/dist/react/checkbox-group.mjs.map +1 -1
  81. package/dist/react/checkbox-group.primitive.js +1 -1
  82. package/dist/react/checkbox-group.primitive.mjs +1 -1
  83. package/dist/react/checkbox.js.map +1 -1
  84. package/dist/react/checkbox.mjs.map +1 -1
  85. package/dist/react/code.js.map +1 -1
  86. package/dist/react/code.mjs.map +1 -1
  87. package/dist/react/collapsible.js.map +1 -1
  88. package/dist/react/collapsible.mjs.map +1 -1
  89. package/dist/react/command.d.mts +8 -8
  90. package/dist/react/command.d.ts +8 -8
  91. package/dist/react/command.js +1 -1
  92. package/dist/react/command.js.map +1 -1
  93. package/dist/react/command.mjs +1 -1
  94. package/dist/react/command.mjs.map +1 -1
  95. package/dist/react/container.js.map +1 -1
  96. package/dist/react/container.mjs.map +1 -1
  97. package/dist/react/context-menu.js.map +1 -1
  98. package/dist/react/context-menu.mjs.map +1 -1
  99. package/dist/react/data-table.d.mts +1 -1
  100. package/dist/react/data-table.d.ts +1 -1
  101. package/dist/react/data-table.js +1 -1
  102. package/dist/react/data-table.js.map +1 -1
  103. package/dist/react/data-table.mjs +1 -1
  104. package/dist/react/data-table.mjs.map +1 -1
  105. package/dist/react/dialog.js +1 -1
  106. package/dist/react/dialog.mjs +1 -1
  107. package/dist/react/drawer.js.map +1 -1
  108. package/dist/react/drawer.mjs.map +1 -1
  109. package/dist/react/dropdown-menu.js +1 -1
  110. package/dist/react/dropdown-menu.mjs +1 -1
  111. package/dist/react/em.js.map +1 -1
  112. package/dist/react/em.mjs.map +1 -1
  113. package/dist/react/form.js +1 -1
  114. package/dist/react/form.js.map +1 -1
  115. package/dist/react/form.mjs +1 -1
  116. package/dist/react/form.mjs.map +1 -1
  117. package/dist/react/heading.js.map +1 -1
  118. package/dist/react/heading.mjs.map +1 -1
  119. package/dist/react/hover-card.js.map +1 -1
  120. package/dist/react/hover-card.mjs.map +1 -1
  121. package/dist/react/input-otp.js.map +1 -1
  122. package/dist/react/input-otp.mjs.map +1 -1
  123. package/dist/react/input.js.map +1 -1
  124. package/dist/react/input.mjs.map +1 -1
  125. package/dist/react/kbd.js.map +1 -1
  126. package/dist/react/kbd.mjs.map +1 -1
  127. package/dist/react/label.js +1 -1
  128. package/dist/react/label.mjs +1 -1
  129. package/dist/react/menubar.js.map +1 -1
  130. package/dist/react/menubar.mjs.map +1 -1
  131. package/dist/react/navigation-menu.js.map +1 -1
  132. package/dist/react/navigation-menu.mjs.map +1 -1
  133. package/dist/react/pagination.js +1 -1
  134. package/dist/react/pagination.js.map +1 -1
  135. package/dist/react/pagination.mjs +1 -1
  136. package/dist/react/pagination.mjs.map +1 -1
  137. package/dist/react/popover.js.map +1 -1
  138. package/dist/react/popover.mjs.map +1 -1
  139. package/dist/react/pre.js.map +1 -1
  140. package/dist/react/pre.mjs.map +1 -1
  141. package/dist/react/progress.js.map +1 -1
  142. package/dist/react/progress.mjs.map +1 -1
  143. package/dist/react/quote.js.map +1 -1
  144. package/dist/react/quote.mjs.map +1 -1
  145. package/dist/react/radio-cards.js.map +1 -1
  146. package/dist/react/radio-cards.mjs.map +1 -1
  147. package/dist/react/radio-group.js.map +1 -1
  148. package/dist/react/radio-group.mjs.map +1 -1
  149. package/dist/react/radio.js.map +1 -1
  150. package/dist/react/radio.mjs.map +1 -1
  151. package/dist/react/resizable.js.map +1 -1
  152. package/dist/react/resizable.mjs.map +1 -1
  153. package/dist/react/scroll-area.js.map +1 -1
  154. package/dist/react/scroll-area.mjs.map +1 -1
  155. package/dist/react/section.js.map +1 -1
  156. package/dist/react/section.mjs.map +1 -1
  157. package/dist/react/select.js +1 -1
  158. package/dist/react/select.mjs +1 -1
  159. package/dist/react/separator.js.map +1 -1
  160. package/dist/react/separator.mjs.map +1 -1
  161. package/dist/react/sheet.js +1 -1
  162. package/dist/react/sheet.js.map +1 -1
  163. package/dist/react/sheet.mjs +1 -1
  164. package/dist/react/sheet.mjs.map +1 -1
  165. package/dist/react/skeleton.js.map +1 -1
  166. package/dist/react/skeleton.mjs.map +1 -1
  167. package/dist/react/slider.js.map +1 -1
  168. package/dist/react/slider.mjs.map +1 -1
  169. package/dist/react/sonner.js.map +1 -1
  170. package/dist/react/sonner.mjs.map +1 -1
  171. package/dist/react/spinner.js +1 -1
  172. package/dist/react/spinner.mjs +1 -1
  173. package/dist/react/strong.js.map +1 -1
  174. package/dist/react/strong.mjs.map +1 -1
  175. package/dist/react/switch.js.map +1 -1
  176. package/dist/react/switch.mjs.map +1 -1
  177. package/dist/react/table.js.map +1 -1
  178. package/dist/react/table.mjs.map +1 -1
  179. package/dist/react/tabs.js.map +1 -1
  180. package/dist/react/tabs.mjs.map +1 -1
  181. package/dist/react/text.js.map +1 -1
  182. package/dist/react/text.mjs.map +1 -1
  183. package/dist/react/textarea.js.map +1 -1
  184. package/dist/react/textarea.mjs.map +1 -1
  185. package/dist/react/toggle-group.js +1 -1
  186. package/dist/react/toggle-group.js.map +1 -1
  187. package/dist/react/toggle-group.mjs +1 -1
  188. package/dist/react/toggle-group.mjs.map +1 -1
  189. package/dist/react/toggle.js +1 -1
  190. package/dist/react/toggle.mjs +1 -1
  191. package/dist/react/tooltip.js.map +1 -1
  192. package/dist/react/tooltip.mjs.map +1 -1
  193. package/dist/styles.css.map +1 -1
  194. package/dist/tailwind.config.js +1 -1
  195. package/dist/tailwind.config.js.map +1 -1
  196. package/dist/tailwind.config.mjs +1 -1
  197. package/dist/tailwind.config.mjs.map +1 -1
  198. package/package.json +6 -6
  199. package/plugin/animate.plugin.ts +2 -5
  200. package/src/react/accordion.tsx +36 -60
  201. package/src/react/alert-dialog.tsx +57 -125
  202. package/src/react/alert.tsx +16 -42
  203. package/src/react/aspect-ratio.tsx +2 -4
  204. package/src/react/avatar.tsx +15 -43
  205. package/src/react/badge.tsx +3 -8
  206. package/src/react/blockquote.tsx +5 -8
  207. package/src/react/box.tsx +4 -6
  208. package/src/react/breadcrumb.tsx +17 -50
  209. package/src/react/button.tsx +5 -20
  210. package/src/react/calendar.tsx +5 -22
  211. package/src/react/card.tsx +22 -56
  212. package/src/react/carousel.tsx +20 -76
  213. package/src/react/checkbox-cards.tsx +28 -55
  214. package/src/react/checkbox-group.primitive.tsx +24 -78
  215. package/src/react/checkbox-group.tsx +26 -49
  216. package/src/react/checkbox.tsx +15 -19
  217. package/src/react/code.tsx +4 -6
  218. package/src/react/collapsible.tsx +19 -29
  219. package/src/react/command.tsx +69 -134
  220. package/src/react/container.tsx +5 -9
  221. package/src/react/context-menu.tsx +146 -224
  222. package/src/react/data-table.tsx +16 -44
  223. package/src/react/dialog.tsx +45 -90
  224. package/src/react/drawer.tsx +44 -91
  225. package/src/react/dropdown-menu.tsx +126 -194
  226. package/src/react/em.tsx +4 -6
  227. package/src/react/form.tsx +49 -84
  228. package/src/react/heading.tsx +4 -6
  229. package/src/react/hover-card.tsx +22 -38
  230. package/src/react/input-otp.tsx +26 -37
  231. package/src/react/input.tsx +6 -16
  232. package/src/react/kbd.tsx +14 -16
  233. package/src/react/label.tsx +11 -12
  234. package/src/react/menubar.tsx +129 -208
  235. package/src/react/navigation-menu.tsx +105 -147
  236. package/src/react/pagination.tsx +18 -50
  237. package/src/react/popover.tsx +25 -40
  238. package/src/react/pre.tsx +4 -6
  239. package/src/react/progress.tsx +15 -22
  240. package/src/react/quote.tsx +4 -6
  241. package/src/react/radio-cards.tsx +7 -27
  242. package/src/react/radio-group.tsx +7 -27
  243. package/src/react/radio.tsx +14 -18
  244. package/src/react/resizable.tsx +2 -7
  245. package/src/react/scroll-area.tsx +30 -52
  246. package/src/react/section.tsx +4 -6
  247. package/src/react/select.tsx +108 -161
  248. package/src/react/separator.tsx +3 -12
  249. package/src/react/sheet.tsx +21 -71
  250. package/src/react/skeleton.tsx +1 -6
  251. package/src/react/slider.tsx +20 -27
  252. package/src/react/sonner.tsx +2 -4
  253. package/src/react/spinner.tsx +2 -7
  254. package/src/react/strong.tsx +4 -6
  255. package/src/react/switch.tsx +12 -14
  256. package/src/react/table.tsx +37 -82
  257. package/src/react/tabs.tsx +34 -44
  258. package/src/react/text.tsx +5 -8
  259. package/src/react/textarea.tsx +12 -14
  260. package/src/react/toggle-group.tsx +16 -57
  261. package/src/react/toggle.tsx +8 -15
  262. package/src/react/tooltip.tsx +24 -39
  263. package/tailwind.config.ts +2 -2
  264. package/dist/chunk-47CSACCM.mjs.map +0 -1
  265. package/dist/chunk-6FL3EBDQ.mjs.map +0 -1
  266. package/dist/chunk-CERSQE5J.js.map +0 -1
  267. package/dist/chunk-GDMHMSJ2.mjs.map +0 -1
  268. package/dist/chunk-I6QCJDIF.mjs.map +0 -1
  269. package/dist/chunk-JOBEKA4M.mjs.map +0 -1
  270. package/dist/chunk-LG7ACTRE.js.map +0 -1
  271. package/dist/chunk-MU2MZ434.mjs.map +0 -1
  272. package/dist/chunk-OP6Q7VT5.js.map +0 -1
  273. package/dist/chunk-P5AV3QU7.mjs.map +0 -1
  274. package/dist/chunk-PWF46YXQ.mjs.map +0 -1
  275. package/dist/chunk-SCPFGC2X.js.map +0 -1
  276. package/dist/chunk-SDGUDONZ.js.map +0 -1
  277. package/dist/chunk-UYRRHPPH.js.map +0 -1
  278. package/dist/chunk-VXPAGNPJ.js.map +0 -1
  279. package/dist/chunk-X3LRJQM3.js.map +0 -1
  280. package/dist/chunk-XHNT6PVI.mjs.map +0 -1
  281. package/dist/chunk-ZTEJNUH6.js.map +0 -1
@@ -4,7 +4,7 @@ import * as ReactTable from '@tanstack/react-table';
4
4
  interface DataTableViewOptionsProps<TData> {
5
5
  table: ReactTable.Table<TData>;
6
6
  }
7
- declare function DataTableViewOptions<TData>({ table, }: DataTableViewOptionsProps<TData>): React.JSX.Element;
7
+ declare function DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): React.JSX.Element;
8
8
  interface DataTablePaginationProps<TData> extends React.HTMLAttributes<HTMLDivElement> {
9
9
  table: ReactTable.Table<TData>;
10
10
  }
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkSDGUDONZjs = require('../chunk-SDGUDONZ.js');var _chunkOP6Q7VT5js = require('../chunk-OP6Q7VT5.js');var _chunkX3LRJQM3js = require('../chunk-X3LRJQM3.js');require('../chunk-ZTEJNUH6.js');var _chunkHQ4AUOQMjs = require('../chunk-HQ4AUOQM.js');var _reacticons = require('@radix-ui/react-icons');var _jsxruntime = require('react/jsx-runtime');function A({table:a}){return _jsxruntime.jsxs.call(void 0, _chunkOP6Q7VT5js.a,{children:[_jsxruntime.jsx.call(void 0, _chunkOP6Q7VT5js.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, _chunkX3LRJQM3js.b,{variant:"outline",size:"sm",className:"ml-auto hidden h-8 lg:flex",children:[_jsxruntime.jsx.call(void 0, _reacticons.MixerHorizontalIcon,{className:"mr-2 size-4"}),"View"]})}),_jsxruntime.jsxs.call(void 0, _chunkOP6Q7VT5js.h,{align:"end",className:"w-36",children:[_jsxruntime.jsx.call(void 0, _chunkOP6Q7VT5js.l,{children:"Toggle columns"}),_jsxruntime.jsx.call(void 0, _chunkOP6Q7VT5js.m,{}),a.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>_jsxruntime.jsx.call(void 0, _chunkOP6Q7VT5js.j,{className:"capitalize",checked:n.getIsVisible(),onCheckedChange:s=>{n.toggleVisibility(!!s)},children:n.id},n.id))]})]})}function B({table:a,className:n,...s}){return _jsxruntime.jsxs.call(void 0, "div",{className:_chunkHQ4AUOQMjs.b.call(void 0, "flex items-center justify-between px-2",n),...s,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"text-muted-foreground flex-1 text-sm",children:[a.getFilteredSelectedRowModel().rows.length," of"," ",a.getFilteredRowModel().rows.length," row(s) selected."]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-6 lg:space-x-8",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-2",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-sm font-medium",children:"Rows per page"}),_jsxruntime.jsxs.call(void 0, _chunkSDGUDONZjs.a,{value:String(a.getState().pagination.pageSize),onValueChange:i=>{a.setPageSize(Number(i))},children:[_jsxruntime.jsx.call(void 0, _chunkSDGUDONZjs.d,{className:"w-18 h-8",children:_jsxruntime.jsx.call(void 0, _chunkSDGUDONZjs.c,{placeholder:a.getState().pagination.pageSize})}),_jsxruntime.jsx.call(void 0, _chunkSDGUDONZjs.g,{side:"top",children:[10,20,30,40,50].map(i=>_jsxruntime.jsx.call(void 0, _chunkSDGUDONZjs.i,{value:String(i),children:i},i))})]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex w-28 items-center justify-center text-sm font-medium",children:["Page ",a.getState().pagination.pageIndex+1," of"," ",a.getPageCount()]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-2",children:[_jsxruntime.jsxs.call(void 0, _chunkX3LRJQM3js.b,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(0)},disabled:!a.getCanPreviousPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to first page"}),_jsxruntime.jsx.call(void 0, _reacticons.DoubleArrowLeftIcon,{className:"size-4"})]}),_jsxruntime.jsxs.call(void 0, _chunkX3LRJQM3js.b,{variant:"outline",size:"icon-xs",onClick:()=>{a.previousPage()},disabled:!a.getCanPreviousPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to previous page"}),_jsxruntime.jsx.call(void 0, _reacticons.ChevronLeftIcon,{className:"size-4"})]}),_jsxruntime.jsxs.call(void 0, _chunkX3LRJQM3js.b,{variant:"outline",size:"icon-xs",onClick:()=>{a.nextPage()},disabled:!a.getCanNextPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to next page"}),_jsxruntime.jsx.call(void 0, _reacticons.ChevronRightIcon,{className:"size-4"})]}),_jsxruntime.jsxs.call(void 0, _chunkX3LRJQM3js.b,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(a.getPageCount()-1)},disabled:!a.getCanNextPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to last page"}),_jsxruntime.jsx.call(void 0, _reacticons.DoubleArrowRightIcon,{className:"size-4"})]})]})]})]})}function L({column:a,title:n,className:s}){return a.getCanSort()?_jsxruntime.jsx.call(void 0, "div",{className:_chunkHQ4AUOQMjs.b.call(void 0, "flex items-center space-x-2",s),children:_jsxruntime.jsxs.call(void 0, _chunkOP6Q7VT5js.a,{children:[_jsxruntime.jsx.call(void 0, _chunkOP6Q7VT5js.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, _chunkX3LRJQM3js.b,{variant:"ghost",size:"xs",className:"data-[state=open]:bg-accent -ml-3",children:[_jsxruntime.jsx.call(void 0, "span",{children:n}),_jsxruntime.jsx.call(void 0, z,{sorted:a.getIsSorted()})]})}),_jsxruntime.jsxs.call(void 0, _chunkOP6Q7VT5js.h,{align:"start",children:[_jsxruntime.jsxs.call(void 0, _chunkOP6Q7VT5js.i,{onClick:()=>{a.toggleSorting(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ArrowUpIcon,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Asc"]}),_jsxruntime.jsxs.call(void 0, _chunkOP6Q7VT5js.i,{onClick:()=>{a.toggleSorting(!0)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ArrowDownIcon,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Desc"]}),_jsxruntime.jsx.call(void 0, _chunkOP6Q7VT5js.m,{}),_jsxruntime.jsxs.call(void 0, _chunkOP6Q7VT5js.i,{onClick:()=>{a.toggleVisibility(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.EyeNoneIcon,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Hide"]})]})]})}):_jsxruntime.jsx.call(void 0, "div",{className:s,children:n})}function z({sorted:a}){switch(a){case"desc":return _jsxruntime.jsx.call(void 0, _reacticons.ArrowDownIcon,{className:"ml-2 size-4"});case"asc":return _jsxruntime.jsx.call(void 0, _reacticons.ArrowUpIcon,{className:"ml-2 size-4"});default:return _jsxruntime.jsx.call(void 0, _reacticons.CaretSortIcon,{className:"ml-2 size-4"})}}exports.DataTableColumnHeader = L; exports.DataTablePagination = B; exports.DataTableViewOptions = A;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkDCDB56BOjs = require('../chunk-DCDB56BO.js');var _chunkRHFF4JNHjs = require('../chunk-RHFF4JNH.js');var _chunkVZVI3OHHjs = require('../chunk-VZVI3OHH.js');require('../chunk-46W6RAYD.js');var _chunkHQ4AUOQMjs = require('../chunk-HQ4AUOQM.js');var _reacticons = require('@radix-ui/react-icons');var _jsxruntime = require('react/jsx-runtime');function A({table:a}){return _jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.a,{children:[_jsxruntime.jsx.call(void 0, _chunkRHFF4JNHjs.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, _chunkVZVI3OHHjs.b,{variant:"outline",size:"sm",className:"ml-auto hidden h-8 lg:flex",children:[_jsxruntime.jsx.call(void 0, _reacticons.MixerHorizontalIcon,{className:"mr-2 size-4"}),"View"]})}),_jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.h,{align:"end",className:"w-36",children:[_jsxruntime.jsx.call(void 0, _chunkRHFF4JNHjs.l,{children:"Toggle columns"}),_jsxruntime.jsx.call(void 0, _chunkRHFF4JNHjs.m,{}),a.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>_jsxruntime.jsx.call(void 0, _chunkRHFF4JNHjs.j,{className:"capitalize",checked:n.getIsVisible(),onCheckedChange:s=>{n.toggleVisibility(!!s)},children:n.id},n.id))]})]})}function B({table:a,className:n,...s}){return _jsxruntime.jsxs.call(void 0, "div",{className:_chunkHQ4AUOQMjs.b.call(void 0, "flex items-center justify-between px-2",n),...s,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"text-muted-foreground flex-1 text-sm",children:[a.getFilteredSelectedRowModel().rows.length," of ",a.getFilteredRowModel().rows.length," row(s) selected."]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-6 lg:space-x-8",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-2",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-sm font-medium",children:"Rows per page"}),_jsxruntime.jsxs.call(void 0, _chunkDCDB56BOjs.a,{value:String(a.getState().pagination.pageSize),onValueChange:i=>{a.setPageSize(Number(i))},children:[_jsxruntime.jsx.call(void 0, _chunkDCDB56BOjs.d,{className:"w-18 h-8",children:_jsxruntime.jsx.call(void 0, _chunkDCDB56BOjs.c,{placeholder:a.getState().pagination.pageSize})}),_jsxruntime.jsx.call(void 0, _chunkDCDB56BOjs.g,{side:"top",children:[10,20,30,40,50].map(i=>_jsxruntime.jsx.call(void 0, _chunkDCDB56BOjs.i,{value:String(i),children:i},i))})]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex w-28 items-center justify-center text-sm font-medium",children:["Page ",a.getState().pagination.pageIndex+1," of ",a.getPageCount()]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-2",children:[_jsxruntime.jsxs.call(void 0, _chunkVZVI3OHHjs.b,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(0)},disabled:!a.getCanPreviousPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to first page"}),_jsxruntime.jsx.call(void 0, _reacticons.DoubleArrowLeftIcon,{className:"size-4"})]}),_jsxruntime.jsxs.call(void 0, _chunkVZVI3OHHjs.b,{variant:"outline",size:"icon-xs",onClick:()=>{a.previousPage()},disabled:!a.getCanPreviousPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to previous page"}),_jsxruntime.jsx.call(void 0, _reacticons.ChevronLeftIcon,{className:"size-4"})]}),_jsxruntime.jsxs.call(void 0, _chunkVZVI3OHHjs.b,{variant:"outline",size:"icon-xs",onClick:()=>{a.nextPage()},disabled:!a.getCanNextPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to next page"}),_jsxruntime.jsx.call(void 0, _reacticons.ChevronRightIcon,{className:"size-4"})]}),_jsxruntime.jsxs.call(void 0, _chunkVZVI3OHHjs.b,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(a.getPageCount()-1)},disabled:!a.getCanNextPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to last page"}),_jsxruntime.jsx.call(void 0, _reacticons.DoubleArrowRightIcon,{className:"size-4"})]})]})]})]})}function L({column:a,title:n,className:s}){return a.getCanSort()?_jsxruntime.jsx.call(void 0, "div",{className:_chunkHQ4AUOQMjs.b.call(void 0, "flex items-center space-x-2",s),children:_jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.a,{children:[_jsxruntime.jsx.call(void 0, _chunkRHFF4JNHjs.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, _chunkVZVI3OHHjs.b,{variant:"ghost",size:"xs",className:"data-[state=open]:bg-accent -ml-3",children:[_jsxruntime.jsx.call(void 0, "span",{children:n}),_jsxruntime.jsx.call(void 0, z,{sorted:a.getIsSorted()})]})}),_jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.h,{align:"start",children:[_jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.i,{onClick:()=>{a.toggleSorting(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ArrowUpIcon,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Asc"]}),_jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.i,{onClick:()=>{a.toggleSorting(!0)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ArrowDownIcon,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Desc"]}),_jsxruntime.jsx.call(void 0, _chunkRHFF4JNHjs.m,{}),_jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.i,{onClick:()=>{a.toggleVisibility(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.EyeNoneIcon,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Hide"]})]})]})}):_jsxruntime.jsx.call(void 0, "div",{className:s,children:n})}function z({sorted:a}){switch(a){case"desc":return _jsxruntime.jsx.call(void 0, _reacticons.ArrowDownIcon,{className:"ml-2 size-4"});case"asc":return _jsxruntime.jsx.call(void 0, _reacticons.ArrowUpIcon,{className:"ml-2 size-4"});default:return _jsxruntime.jsx.call(void 0, _reacticons.CaretSortIcon,{className:"ml-2 size-4"})}}exports.DataTableColumnHeader = L; exports.DataTablePagination = B; exports.DataTableViewOptions = A;
2
2
  //# sourceMappingURL=data-table.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/data-table.tsx"],"names":["ArrowDownIcon","ArrowUpIcon","CaretSortIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowLeftIcon","DoubleArrowRightIcon","EyeNoneIcon","MixerHorizontalIcon","jsx","jsxs","DataTableViewOptions","table","DropdownMenu","DropdownMenuTrigger","Button","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","column","DropdownMenuCheckboxItem","value","DataTablePagination","className","props","cn","Select","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","DataTableColumnHeader","title","SortIcon","DropdownMenuItem","sorted"],"mappings":"oRAIA,OACE,iBAAAA,EACA,eAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,oBAAAC,EACA,uBAAAC,EACA,wBAAAC,EACA,eAAAC,EACA,uBAAAC,MACK,wBAkCC,OAKE,OAAAC,EALF,QAAAC,MAAA,oBANR,SAASC,EAA4B,CACnC,MAAAC,CACF,EAAwD,CACtD,OACEF,EAACG,EAAA,CACC,UAAAJ,EAACK,EAAA,CAAoB,QAAO,GAC1B,SAAAJ,EAACK,EAAA,CACC,QAAQ,UACR,KAAK,KACL,UAAU,6BAEV,UAAAN,EAACD,EAAA,CAAoB,UAAU,cAAc,EAAE,QAEjD,EACF,EACAE,EAACM,EAAA,CAAoB,MAAM,MAAM,UAAU,OACzC,UAAAP,EAACQ,EAAA,CAAkB,0BAAc,EACjCR,EAACS,EAAA,EAAsB,EACtBN,EACE,cAAc,EACd,OACEO,GACC,OAAOA,EAAO,WAAe,KAAeA,EAAO,WAAW,CAClE,EACC,IAAKA,GAEFV,EAACW,EAAA,CAEC,UAAU,aACV,QAASD,EAAO,aAAa,EAC7B,gBAAkBE,GAAU,CAC1BF,EAAO,iBAAiB,EAAQE,CAAM,CACxC,EAEC,SAAAF,EAAO,IAPHA,EAAO,EAQd,CAEH,GACL,GACF,CAEJ,CAWA,SAASG,EAA2B,CAClC,MAAAV,EACA,UAAAW,EACA,GAAGC,CACL,EAAuD,CACrD,OACEd,EAAC,OACC,UAAWe,EAAG,yCAA0CF,CAAS,EAChE,GAAGC,EAEJ,UAAAd,EAAC,OAAI,UAAU,uCACZ,UAAAE,EAAM,4BAA4B,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E,QAEpE,GACF,GACF,EACF,EA5COE,EAAC,OAAI,UAAWc,EAAY,SAAAU,EAAM,CA8C7C,CAEA,SAASC,EAAS,CAChB,OAAAE,CACF,EAEsB,CACpB,OAAQA,EAAQ,CACd,IAAK,OACH,OAAO3B,EAACT,EAAA,CAAc,UAAU,cAAc,EAChD,IAAK,MACH,OAAOS,EAACR,EAAA,CAAY,UAAU,cAAc,EAC9C,QACE,OAAOQ,EAACP,EAAA,CAAc,UAAU,cAAc,CAClD,CACF","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 { cn } from '../lib/utils';\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';\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\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-36\">\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}\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={String(table.getState().pagination.pageSize)}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"w-18 h-8\">\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={String(pageSize)}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-28 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}\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={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 <SortIcon sorted={column.getIsSorted()} />\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\nfunction SortIcon({\n sorted,\n}: {\n sorted: false | ReactTable.SortDirection;\n}): React.JSX.Element {\n switch (sorted) {\n case 'desc':\n return <ArrowDownIcon className=\"ml-2 size-4\" />;\n case 'asc':\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n default:\n return <CaretSortIcon className=\"ml-2 size-4\" />;\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"]}
1
+ {"version":3,"sources":["../../src/react/data-table.tsx"],"names":["ArrowDownIcon","ArrowUpIcon","CaretSortIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowLeftIcon","DoubleArrowRightIcon","EyeNoneIcon","MixerHorizontalIcon","jsx","jsxs","DataTableViewOptions","table","DropdownMenu","DropdownMenuTrigger","Button","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","column","DropdownMenuCheckboxItem","value","DataTablePagination","className","props","cn","Select","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","DataTableColumnHeader","title","SortIcon","DropdownMenuItem","sorted"],"mappings":"oRAGA,OACE,iBAAAA,EACA,eAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,oBAAAC,EACA,uBAAAC,EACA,wBAAAC,EACA,eAAAC,EACA,uBAAAC,MACK,wBA2BC,OACE,OAAAC,EADF,QAAAC,MAAA,oBAJR,SAASC,EAA4B,CAAE,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A,MAAAc,EACA,UAAAV,CACF,EAAiE,CAC/D,OAAKJ,EAAO,WAAW,EAKrBV,EAAC,OAAI,UAAWgB,EAAG,8BAA+BF,CAAS,EACzD,SAAAb,EAACG,EAAA,CACC,UAAAJ,EAACK,EAAA,CAAoB,QAAO,GAC1B,SAAAJ,EAACK,EAAA,CAAO,QAAQ,QAAQ,KAAK,KAAK,UAAU,oCAC1C,UAAAN,EAAC,QAAM,SAAAwB,EAAM,EACbxB,EAACyB,EAAA,CAAS,OAAQf,EAAO,YAAY,EAAG,GAC1C,EACF,EACAT,EAACM,EAAA,CAAoB,MAAM,QACzB,UAAAN,EAACyB,EAAA,CACC,QAAS,IAAM,CACbhB,EAAO,cAAc,EAAK,CAC5B,EAEA,UAAAV,EAACR,EAAA,CAAY,UAAU,yCAAyC,EAAE,OAEpE,EACAS,EAACyB,EAAA,CACC,QAAS,IAAM,CACbhB,EAAO,cAAc,EAAI,CAC3B,EAEA,UAAAV,EAACT,EAAA,CAAc,UAAU,yCAAyC,EAAE,QAEtE,EACAS,EAACS,EAAA,EAAsB,EACvBR,EAACyB,EAAA,CACC,QAAS,IAAM,CACbhB,EAAO,iBAAiB,EAAK,CAC/B,EAEA,UAAAV,EAACF,EAAA,CAAY,UAAU,yCAAyC,EAAE,QAEpE,GACF,GACF,EACF,EAxCOE,EAAC,OAAI,UAAWc,EAAY,SAAAU,EAAM,CA0C7C,CAEA,SAASC,EAAS,CAAE,OAAAE,CAAO,EAAoE,CAC7F,OAAQA,EAAQ,CACd,IAAK,OACH,OAAO3B,EAACT,EAAA,CAAc,UAAU,cAAc,EAEhD,IAAK,MACH,OAAOS,EAACR,EAAA,CAAY,UAAU,cAAc,EAE9C,QACE,OAAOQ,EAACP,EAAA,CAAc,UAAU,cAAc,CAClD,CACF","sourcesContent":["'use client';\n\nimport * as React from 'react';\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 { cn } from '../lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from './dropdown-menu';\nimport { Button } from './button';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './select';\nimport type * as ReactTable from '@tanstack/react-table';\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto hidden h-8 lg:flex\">\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-36\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((column) => typeof column.accessorFn !== 'undefined' && column.getCanHide())\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> extends React.HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: DataTablePaginationProps<TData>): React.JSX.Element {\n return (\n <div className={cn('flex items-center justify-between px-2', className)} {...props}>\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of {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={String(table.getState().pagination.pageSize)}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"w-18 h-8\">\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={String(pageSize)}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-28 items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {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> extends React.HTMLAttributes<HTMLDivElement> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\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={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 variant=\"ghost\" size=\"xs\" className=\"data-[state=open]:bg-accent -ml-3\">\n <span>{title}</span>\n <SortIcon sorted={column.getIsSorted()} />\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\nfunction SortIcon({ sorted }: { sorted: false | ReactTable.SortDirection }): React.JSX.Element {\n switch (sorted) {\n case 'desc':\n return <ArrowDownIcon className=\"ml-2 size-4\" />;\n\n case 'asc':\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n\n default:\n return <CaretSortIcon className=\"ml-2 size-4\" />;\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"]}
@@ -1,2 +1,2 @@
1
- "use client";import{a as D,c as f,d as T,g as x,i as w}from"../chunk-MU2MZ434.mjs";import{a as c,b as d,h as m,i as r,j as p,l as u,m as g}from"../chunk-XHNT6PVI.mjs";import{b as o}from"../chunk-47CSACCM.mjs";import"../chunk-P5AV3QU7.mjs";import{b as l}from"../chunk-LEUB3C3L.mjs";import{ArrowDownIcon as C,ArrowUpIcon as N,CaretSortIcon as v,ChevronLeftIcon as S,ChevronRightIcon as P,DoubleArrowLeftIcon as b,DoubleArrowRightIcon as M,EyeNoneIcon as I,MixerHorizontalIcon as h}from"@radix-ui/react-icons";import{jsx as e,jsxs as t}from"react/jsx-runtime";function A({table:a}){return t(c,{children:[e(d,{asChild:!0,children:t(o,{variant:"outline",size:"sm",className:"ml-auto hidden h-8 lg:flex",children:[e(h,{className:"mr-2 size-4"}),"View"]})}),t(m,{align:"end",className:"w-36",children:[e(u,{children:"Toggle columns"}),e(g,{}),a.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>e(p,{className:"capitalize",checked:n.getIsVisible(),onCheckedChange:s=>{n.toggleVisibility(!!s)},children:n.id},n.id))]})]})}function B({table:a,className:n,...s}){return t("div",{className:l("flex items-center justify-between px-2",n),...s,children:[t("div",{className:"text-muted-foreground flex-1 text-sm",children:[a.getFilteredSelectedRowModel().rows.length," of"," ",a.getFilteredRowModel().rows.length," row(s) selected."]}),t("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[t("div",{className:"flex items-center space-x-2",children:[e("p",{className:"text-sm font-medium",children:"Rows per page"}),t(D,{value:String(a.getState().pagination.pageSize),onValueChange:i=>{a.setPageSize(Number(i))},children:[e(T,{className:"w-18 h-8",children:e(f,{placeholder:a.getState().pagination.pageSize})}),e(x,{side:"top",children:[10,20,30,40,50].map(i=>e(w,{value:String(i),children:i},i))})]})]}),t("div",{className:"flex w-28 items-center justify-center text-sm font-medium",children:["Page ",a.getState().pagination.pageIndex+1," of"," ",a.getPageCount()]}),t("div",{className:"flex items-center space-x-2",children:[t(o,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(0)},disabled:!a.getCanPreviousPage(),children:[e("span",{className:"sr-only",children:"Go to first page"}),e(b,{className:"size-4"})]}),t(o,{variant:"outline",size:"icon-xs",onClick:()=>{a.previousPage()},disabled:!a.getCanPreviousPage(),children:[e("span",{className:"sr-only",children:"Go to previous page"}),e(S,{className:"size-4"})]}),t(o,{variant:"outline",size:"icon-xs",onClick:()=>{a.nextPage()},disabled:!a.getCanNextPage(),children:[e("span",{className:"sr-only",children:"Go to next page"}),e(P,{className:"size-4"})]}),t(o,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(a.getPageCount()-1)},disabled:!a.getCanNextPage(),children:[e("span",{className:"sr-only",children:"Go to last page"}),e(M,{className:"size-4"})]})]})]})]})}function L({column:a,title:n,className:s}){return a.getCanSort()?e("div",{className:l("flex items-center space-x-2",s),children:t(c,{children:[e(d,{asChild:!0,children:t(o,{variant:"ghost",size:"xs",className:"data-[state=open]:bg-accent -ml-3",children:[e("span",{children:n}),e(z,{sorted:a.getIsSorted()})]})}),t(m,{align:"start",children:[t(r,{onClick:()=>{a.toggleSorting(!1)},children:[e(N,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Asc"]}),t(r,{onClick:()=>{a.toggleSorting(!0)},children:[e(C,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Desc"]}),e(g,{}),t(r,{onClick:()=>{a.toggleVisibility(!1)},children:[e(I,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Hide"]})]})]})}):e("div",{className:s,children:n})}function z({sorted:a}){switch(a){case"desc":return e(C,{className:"ml-2 size-4"});case"asc":return e(N,{className:"ml-2 size-4"});default:return e(v,{className:"ml-2 size-4"})}}export{L as DataTableColumnHeader,B as DataTablePagination,A as DataTableViewOptions};
1
+ "use client";import{a as D,c as f,d as T,g as x,i as w}from"../chunk-ZIB4ZTST.mjs";import{a as c,b as d,h as m,i as r,j as p,l as u,m as g}from"../chunk-BM5KYF6Y.mjs";import{b as o}from"../chunk-7ABWX5CF.mjs";import"../chunk-BNKSZEF2.mjs";import{b as l}from"../chunk-LEUB3C3L.mjs";import{ArrowDownIcon as C,ArrowUpIcon as N,CaretSortIcon as v,ChevronLeftIcon as S,ChevronRightIcon as P,DoubleArrowLeftIcon as b,DoubleArrowRightIcon as M,EyeNoneIcon as I,MixerHorizontalIcon as h}from"@radix-ui/react-icons";import{jsx as e,jsxs as t}from"react/jsx-runtime";function A({table:a}){return t(c,{children:[e(d,{asChild:!0,children:t(o,{variant:"outline",size:"sm",className:"ml-auto hidden h-8 lg:flex",children:[e(h,{className:"mr-2 size-4"}),"View"]})}),t(m,{align:"end",className:"w-36",children:[e(u,{children:"Toggle columns"}),e(g,{}),a.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>e(p,{className:"capitalize",checked:n.getIsVisible(),onCheckedChange:s=>{n.toggleVisibility(!!s)},children:n.id},n.id))]})]})}function B({table:a,className:n,...s}){return t("div",{className:l("flex items-center justify-between px-2",n),...s,children:[t("div",{className:"text-muted-foreground flex-1 text-sm",children:[a.getFilteredSelectedRowModel().rows.length," of ",a.getFilteredRowModel().rows.length," row(s) selected."]}),t("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[t("div",{className:"flex items-center space-x-2",children:[e("p",{className:"text-sm font-medium",children:"Rows per page"}),t(D,{value:String(a.getState().pagination.pageSize),onValueChange:i=>{a.setPageSize(Number(i))},children:[e(T,{className:"w-18 h-8",children:e(f,{placeholder:a.getState().pagination.pageSize})}),e(x,{side:"top",children:[10,20,30,40,50].map(i=>e(w,{value:String(i),children:i},i))})]})]}),t("div",{className:"flex w-28 items-center justify-center text-sm font-medium",children:["Page ",a.getState().pagination.pageIndex+1," of ",a.getPageCount()]}),t("div",{className:"flex items-center space-x-2",children:[t(o,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(0)},disabled:!a.getCanPreviousPage(),children:[e("span",{className:"sr-only",children:"Go to first page"}),e(b,{className:"size-4"})]}),t(o,{variant:"outline",size:"icon-xs",onClick:()=>{a.previousPage()},disabled:!a.getCanPreviousPage(),children:[e("span",{className:"sr-only",children:"Go to previous page"}),e(S,{className:"size-4"})]}),t(o,{variant:"outline",size:"icon-xs",onClick:()=>{a.nextPage()},disabled:!a.getCanNextPage(),children:[e("span",{className:"sr-only",children:"Go to next page"}),e(P,{className:"size-4"})]}),t(o,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(a.getPageCount()-1)},disabled:!a.getCanNextPage(),children:[e("span",{className:"sr-only",children:"Go to last page"}),e(M,{className:"size-4"})]})]})]})]})}function L({column:a,title:n,className:s}){return a.getCanSort()?e("div",{className:l("flex items-center space-x-2",s),children:t(c,{children:[e(d,{asChild:!0,children:t(o,{variant:"ghost",size:"xs",className:"data-[state=open]:bg-accent -ml-3",children:[e("span",{children:n}),e(z,{sorted:a.getIsSorted()})]})}),t(m,{align:"start",children:[t(r,{onClick:()=>{a.toggleSorting(!1)},children:[e(N,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Asc"]}),t(r,{onClick:()=>{a.toggleSorting(!0)},children:[e(C,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Desc"]}),e(g,{}),t(r,{onClick:()=>{a.toggleVisibility(!1)},children:[e(I,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Hide"]})]})]})}):e("div",{className:s,children:n})}function z({sorted:a}){switch(a){case"desc":return e(C,{className:"ml-2 size-4"});case"asc":return e(N,{className:"ml-2 size-4"});default:return e(v,{className:"ml-2 size-4"})}}export{L as DataTableColumnHeader,B as DataTablePagination,A as DataTableViewOptions};
2
2
  //# sourceMappingURL=data-table.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/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 { cn } from '../lib/utils';\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';\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\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-36\">\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}\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={String(table.getState().pagination.pageSize)}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"w-18 h-8\">\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={String(pageSize)}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-28 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}\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={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 <SortIcon sorted={column.getIsSorted()} />\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\nfunction SortIcon({\n sorted,\n}: {\n sorted: false | ReactTable.SortDirection;\n}): React.JSX.Element {\n switch (sorted) {\n case 'desc':\n return <ArrowDownIcon className=\"ml-2 size-4\" />;\n case 'asc':\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n default:\n return <CaretSortIcon className=\"ml-2 size-4\" />;\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"],"mappings":"yRAIA,OACE,iBAAAA,EACA,eAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,oBAAAC,EACA,uBAAAC,EACA,wBAAAC,EACA,eAAAC,EACA,uBAAAC,MACK,wBAkCC,OAKE,OAAAC,EALF,QAAAC,MAAA,oBANR,SAASC,EAA4B,CACnC,MAAAC,CACF,EAAwD,CACtD,OACEF,EAACG,EAAA,CACC,UAAAJ,EAACK,EAAA,CAAoB,QAAO,GAC1B,SAAAJ,EAACK,EAAA,CACC,QAAQ,UACR,KAAK,KACL,UAAU,6BAEV,UAAAN,EAACO,EAAA,CAAoB,UAAU,cAAc,EAAE,QAEjD,EACF,EACAN,EAACO,EAAA,CAAoB,MAAM,MAAM,UAAU,OACzC,UAAAR,EAACS,EAAA,CAAkB,0BAAc,EACjCT,EAACU,EAAA,EAAsB,EACtBP,EACE,cAAc,EACd,OACEQ,GACC,OAAOA,EAAO,WAAe,KAAeA,EAAO,WAAW,CAClE,EACC,IAAKA,GAEFX,EAACY,EAAA,CAEC,UAAU,aACV,QAASD,EAAO,aAAa,EAC7B,gBAAkBE,GAAU,CAC1BF,EAAO,iBAAiB,EAAQE,CAAM,CACxC,EAEC,SAAAF,EAAO,IAPHA,EAAO,EAQd,CAEH,GACL,GACF,CAEJ,CAWA,SAASG,EAA2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X,EAACiC,EAAA,CAAc,UAAU,yCAAyC,EAAE,QAEtE,EACAjC,EAACU,EAAA,EAAsB,EACvBT,EAAC8B,EAAA,CACC,QAAS,IAAM,CACbpB,EAAO,iBAAiB,EAAK,CAC/B,EAEA,UAAAX,EAACkC,EAAA,CAAY,UAAU,yCAAyC,EAAE,QAEpE,GACF,GACF,EACF,EA5COlC,EAAC,OAAI,UAAWe,EAAY,SAAAc,EAAM,CA8C7C,CAEA,SAASC,EAAS,CAChB,OAAAK,CACF,EAEsB,CACpB,OAAQA,EAAQ,CACd,IAAK,OACH,OAAOnC,EAACiC,EAAA,CAAc,UAAU,cAAc,EAChD,IAAK,MACH,OAAOjC,EAACgC,EAAA,CAAY,UAAU,cAAc,EAC9C,QACE,OAAOhC,EAACoC,EAAA,CAAc,UAAU,cAAc,CAClD,CACF","names":["ArrowDownIcon","ArrowUpIcon","CaretSortIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowLeftIcon","DoubleArrowRightIcon","EyeNoneIcon","MixerHorizontalIcon","jsx","jsxs","DataTableViewOptions","table","DropdownMenu","DropdownMenuTrigger","Button","MixerHorizontalIcon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","column","DropdownMenuCheckboxItem","value","DataTablePagination","className","props","cn","Select","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","DoubleArrowLeftIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowRightIcon","DataTableColumnHeader","title","SortIcon","DropdownMenuItem","ArrowUpIcon","ArrowDownIcon","EyeNoneIcon","sorted","CaretSortIcon"]}
1
+ {"version":3,"sources":["../../src/react/data-table.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\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 { cn } from '../lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from './dropdown-menu';\nimport { Button } from './button';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './select';\nimport type * as ReactTable from '@tanstack/react-table';\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto hidden h-8 lg:flex\">\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-36\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((column) => typeof column.accessorFn !== 'undefined' && column.getCanHide())\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> extends React.HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: DataTablePaginationProps<TData>): React.JSX.Element {\n return (\n <div className={cn('flex items-center justify-between px-2', className)} {...props}>\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of {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={String(table.getState().pagination.pageSize)}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"w-18 h-8\">\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={String(pageSize)}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-28 items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {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> extends React.HTMLAttributes<HTMLDivElement> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\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={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 variant=\"ghost\" size=\"xs\" className=\"data-[state=open]:bg-accent -ml-3\">\n <span>{title}</span>\n <SortIcon sorted={column.getIsSorted()} />\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\nfunction SortIcon({ sorted }: { sorted: false | ReactTable.SortDirection }): React.JSX.Element {\n switch (sorted) {\n case 'desc':\n return <ArrowDownIcon className=\"ml-2 size-4\" />;\n\n case 'asc':\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n\n default:\n return <CaretSortIcon className=\"ml-2 size-4\" />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DataTableViewOptions,\n DataTablePagination,\n DataTableColumnHeader,\n type DataTableViewOptionsProps,\n type DataTabl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CAAc,UAAU,cAAc,EAEhD,IAAK,MACH,OAAOjC,EAACgC,EAAA,CAAY,UAAU,cAAc,EAE9C,QACE,OAAOhC,EAACoC,EAAA,CAAc,UAAU,cAAc,CAClD,CACF","names":["ArrowDownIcon","ArrowUpIcon","CaretSortIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowLeftIcon","DoubleArrowRightIcon","EyeNoneIcon","MixerHorizontalIcon","jsx","jsxs","DataTableViewOptions","table","DropdownMenu","DropdownMenuTrigger","Button","MixerHorizontalIcon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","column","DropdownMenuCheckboxItem","value","DataTablePagination","className","props","cn","Select","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","DoubleArrowLeftIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowRightIcon","DataTableColumnHeader","title","SortIcon","DropdownMenuItem","ArrowUpIcon","ArrowDownIcon","EyeNoneIcon","sorted","CaretSortIcon"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkVXPAGNPJjs = require('../chunk-VXPAGNPJ.js');require('../chunk-HQ4AUOQM.js');exports.Dialog = _chunkVXPAGNPJjs.a; exports.DialogClose = _chunkVXPAGNPJjs.c; exports.DialogContent = _chunkVXPAGNPJjs.d; exports.DialogDescription = _chunkVXPAGNPJjs.h; exports.DialogFooter = _chunkVXPAGNPJjs.f; exports.DialogHeader = _chunkVXPAGNPJjs.e; exports.DialogTitle = _chunkVXPAGNPJjs.g; exports.DialogTrigger = _chunkVXPAGNPJjs.b;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkLJSD47ZLjs = require('../chunk-LJSD47ZL.js');require('../chunk-HQ4AUOQM.js');exports.Dialog = _chunkLJSD47ZLjs.a; exports.DialogClose = _chunkLJSD47ZLjs.c; exports.DialogContent = _chunkLJSD47ZLjs.d; exports.DialogDescription = _chunkLJSD47ZLjs.h; exports.DialogFooter = _chunkLJSD47ZLjs.f; exports.DialogHeader = _chunkLJSD47ZLjs.e; exports.DialogTitle = _chunkLJSD47ZLjs.g; exports.DialogTrigger = _chunkLJSD47ZLjs.b;
2
2
  //# sourceMappingURL=dialog.js.map
@@ -1,2 +1,2 @@
1
- "use client";import{a,b,c,d,e,f,g,h}from"../chunk-PWF46YXQ.mjs";import"../chunk-LEUB3C3L.mjs";export{a as Dialog,c as DialogClose,d as DialogContent,h as DialogDescription,f as DialogFooter,e as DialogHeader,g as DialogTitle,b as DialogTrigger};
1
+ "use client";import{a,b,c,d,e,f,g,h}from"../chunk-Y2GMHG3Z.mjs";import"../chunk-LEUB3C3L.mjs";export{a as Dialog,c as DialogClose,d as DialogContent,h as DialogDescription,f as DialogFooter,e as DialogHeader,g as DialogTitle,b as DialogTrigger};
2
2
  //# sourceMappingURL=dialog.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/drawer.tsx"],"names":["React","DrawerPrimitive","jsx","jsxs","Drawer","shouldScaleBackground","props","DrawerTrigger","DrawerClose","DrawerContent","children","className","ref","cn","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"],"mappings":"sDAEA,UAAYA,MAAW,QACvB,OAAS,UAAUC,MAAuB,OActC,cAAAC,EAwCA,QAAAC,MAxCA,oBALJ,SAASC,EAAO,CACd,sBAAAC,EAAwB,GACxB,GAAGC,CACL,EAAmC,CACjC,OACEJ,EAACD,EAAgB,KAAhB,CACC,sBAAuBI,EACtB,GAAGC,EACN,CAEJ,CASA,IAAMC,EAAgBN,EAAgB,QAShCO,EAAcP,EAAgB,MAW9BQ,EAAsB,aAG1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGL,CAAM,EAAGM,IACpCT,EAACF,EAAgB,OAAhB,CACC,UAAAC,EAACD,EAAgB,QAAhB,CAAwB,UAAU,iCAAiC,EACpEE,EAACF,EAAgB,QAAhB,CACC,IAAKW,EACL,UAAWC,EACT,6FACAF,CACF,EACC,GAAGL,EAEJ,UAAAJ,EAAC,OAAI,UAAU,8CAA8C,EAC5DQ,GACH,GACF,CACD,EAEDD,EAAc,YAAc,gBAQ5B,SAASK,EAAa,CACpB,UAAAH,EACA,GAAGL,CACL,EAAyC,CACvC,OACEJ,EAAC,OACC,UAAWW,EAAG,4CAA6CF,CAAS,EACnE,GAAGL,EACN,CAEJ,CAQA,SAASS,EAAa,CACpB,UAAAJ,EACA,GAAGL,CACL,EAAyC,CACvC,OACEJ,EAAC,OACC,UAAWW,EAAG,kCAAmCF,CAAS,EACzD,GAAGL,EACN,CAEJ,CAWA,IAAMU,EAAoB,aACxB,CAAC,CAAE,UAAAL,EAAW,GAAGL,CAAM,EAAGM,IACxBV,EAACD,EAAgB,MAAhB,CACC,IAAKW,EACL,UAAWC,EACT,oDACAF,CACF,EACC,GAAGL,EACN,CAEJ,EAEAU,EAAY,YAAcf,EAAgB,MAAM,YAahD,IAAMgB,EAA0B,aAG9B,CAAC,CAAE,UAAAN,EAAW,GAAGL,CAAM,EAAGM,IAC1BV,EAACD,EAAgB,YAAhB,CACC,IAAKW,EACL,UAAWC,EAAG,gCAAiCF,CAAS,EACvD,GAAGL,EACN,CACD,EAEDW,EAAkB,YAAchB,EAAgB,YAAY","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\n\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.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Trigger\n>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Close\n>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;\ntype DrawerContentProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Content\n>;\n\nconst DrawerContent = React.forwardRef<\n DrawerContentElement,\n DrawerContentProps\n>(({ children, className, ...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-xl border',\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-24 rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n));\n\nDrawerContent.displayName = 'DrawerContent';\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\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>;\n\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 DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Title\n>;\n\nconst DrawerTitle = React.forwardRef<DrawerTitleElement, 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 ),\n);\n\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionElement = React.ElementRef<\n typeof DrawerPrimitive.Description\n>;\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Description\n>;\n\nconst DrawerDescription = React.forwardRef<\n DrawerDescriptionElement,\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));\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"]}
1
+ {"version":3,"sources":["../../src/react/drawer.tsx"],"names":["React","DrawerPrimitive","jsx","jsxs","Drawer","shouldScaleBackground","props","DrawerTrigger","DrawerClose","DrawerContent","children","className","ref","cn","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"],"mappings":"sDAEA,UAAYA,MAAW,QACvB,OAAS,UAAUC,MAAuB,OAUjC,cAAAC,EA4BH,QAAAC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AAY","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\n\nfunction Drawer({ shouldScaleBackground = true, ...props }: DrawerProps): React.JSX.Element {\n return <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;\ntype DrawerContentProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>;\n\nconst DrawerContent = React.forwardRef<DrawerContentElement, DrawerContentProps>(\n ({ children, className, ...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-xl border',\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-24 rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n ),\n);\n\nDrawerContent.displayName = 'DrawerContent';\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element {\n return <div className={cn('grid gap-1.5 p-4 text-center sm:text-left', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element {\n return <div className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>;\n\nconst DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n));\n\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionElement = React.ElementRef<typeof DrawerPrimitive.Description>;\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>;\n\nconst DrawerDescription = React.forwardRef<DrawerDescriptionElement, DrawerDescriptionProps>(\n ({ className, ...props }, ref) => (\n <DrawerPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/drawer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\n\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.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Trigger\n>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Close\n>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;\ntype DrawerContentProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Content\n>;\n\nconst DrawerContent = React.forwardRef<\n DrawerContentElement,\n DrawerContentProps\n>(({ children, className, ...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-xl border',\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-24 rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n));\n\nDrawerContent.displayName = 'DrawerContent';\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\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>;\n\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 DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Title\n>;\n\nconst DrawerTitle = React.forwardRef<DrawerTitleElement, 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 ),\n);\n\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionElement = React.ElementRef<\n typeof DrawerPrimitive.Description\n>;\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Description\n>;\n\nconst DrawerDescription = React.forwardRef<\n DrawerDescriptionElement,\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));\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":"uDAEA,UAAYA,MAAW,QACvB,OAAS,UAAUC,MAAuB,OActC,cAAAC,EAwCA,QAAAC,MAxCA,oBALJ,SAASC,EAAO,CACd,sBAAAC,EAAwB,GACxB,GAAGC,CACL,EAAmC,CACjC,OACEJ,EAACK,EAAgB,KAAhB,CACC,sBAAuBF,EACtB,GAAGC,EACN,CAEJ,CASA,IAAME,EAAgBD,EAAgB,QAShCE,EAAcF,EAAgB,MAW9BG,EAAsB,aAG1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGN,CAAM,EAAGO,IACpCV,EAACI,EAAgB,OAAhB,CACC,UAAAL,EAACK,EAAgB,QAAhB,CAAwB,UAAU,iCAAiC,EACpEJ,EAACI,EAAgB,QAAhB,CACC,IAAKM,EACL,UAAWC,EACT,6FACAF,CACF,EACC,GAAGN,EAEJ,UAAAJ,EAAC,OAAI,UAAU,8CAA8C,EAC5DS,GACH,GACF,CACD,EAEDD,EAAc,YAAc,gBAQ5B,SAASK,EAAa,CACpB,UAAAH,EACA,GAAGN,CACL,EAAyC,CACvC,OACEJ,EAAC,OACC,UAAWY,EAAG,4CAA6CF,CAAS,EACnE,GAAGN,EACN,CAEJ,CAQA,SAASU,EAAa,CACpB,UAAAJ,EACA,GAAGN,CACL,EAAyC,CACvC,OACEJ,EAAC,OACC,UAAWY,EAAG,kCAAmCF,CAAS,EACzD,GAAGN,EACN,CAEJ,CAWA,IAAMW,EAAoB,aACxB,CAAC,CAAE,UAAAL,EAAW,GAAGN,CAAM,EAAGO,IACxBX,EAACK,EAAgB,MAAhB,CACC,IAAKM,EACL,UAAWC,EACT,oDACAF,CACF,EACC,GAAGN,EACN,CAEJ,EAEAW,EAAY,YAAcV,EAAgB,MAAM,YAahD,IAAMW,EAA0B,aAG9B,CAAC,CAAE,UAAAN,EAAW,GAAGN,CAAM,EAAGO,IAC1BX,EAACK,EAAgB,YAAhB,CACC,IAAKM,EACL,UAAWC,EAAG,gCAAiCF,CAAS,EACvD,GAAGN,EACN,CACD,EAEDY,EAAkB,YAAcX,EAAgB,YAAY","names":["React","DrawerPrimitive","jsx","jsxs","Drawer","shouldScaleBackground","props","DrawerPrimitive","DrawerTrigger","DrawerClose","DrawerContent","children","className","ref","cn","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"]}
1
+ {"version":3,"sources":["../../src/react/drawer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\n\nfunction Drawer({ shouldScaleBackground = true, ...props }: DrawerProps): React.JSX.Element {\n return <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;\ntype DrawerContentProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>;\n\nconst DrawerContent = React.forwardRef<DrawerContentElement, DrawerContentProps>(\n ({ children, className, ...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-xl border',\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-24 rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n ),\n);\n\nDrawerContent.displayName = 'DrawerContent';\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element {\n return <div className={cn('grid gap-1.5 p-4 text-center sm:text-left', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element {\n return <div className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>;\n\nconst DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n));\n\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionElement = React.ElementRef<typeof DrawerPrimitive.Description>;\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>;\n\nconst DrawerDescription = React.forwardRef<DrawerDescriptionElement, DrawerDescriptionProps>(\n ({ className, ...props }, ref) => (\n <DrawerPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"],"mappings":"uDAEA,UAAYA,MAAW,QACvB,OAAS,UAAUC,MAAuB,OAUjC,cAAAC,EA4BH,QAAAC,MA5BG,oBADT,SAASC,EAAO,CAAE,sBAAAC,EAAwB,GAAM,GAAGC,CAAM,EAAmC,CAC1F,OAAOJ,EAACK,EAAgB,KAAhB,CAAqB,sBAAuBF,EAAwB,GAAGC,EAAO,CACxF,CAOA,IAAME,EAAgBD,EAAgB,QAOhCE,EAAcF,EAAgB,MAS9BG,EAAsB,aAC1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGN,CAAM,EAAGO,IAClCV,EAACI,EAAgB,OAAhB,CACC,UAAAL,EAACK,EAAgB,QAAhB,CAAwB,UAAU,iCAAiC,EACpEJ,EAACI,EAAgB,QAAhB,CACC,IAAKM,EACL,UAAWC,EACT,6FACAF,CACF,EACC,GAAGN,EAEJ,UAAAJ,EAAC,OAAI,UAAU,8CAA8C,EAC5DS,GACH,GACF,CAEJ,EAEAD,EAAc,YAAc,gBAQ5B,SAASK,EAAa,CAAE,UAAAH,EAAW,GAAGN,CAAM,EAAyC,CACnF,OAAOJ,EAAC,OAAI,UAAWY,EAAG,4CAA6CF,CAAS,EAAI,GAAGN,EAAO,CAChG,CAQA,SAASU,EAAa,CAAE,UAAAJ,EAAW,GAAGN,CAAM,EAAyC,CACnF,OAAOJ,EAAC,OAAI,UAAWY,EAAG,kCAAmCF,CAAS,EAAI,GAAGN,EAAO,CACtF,CASA,IAAMW,EAAoB,aAAiD,CAAC,CAAE,UAAAL,EAAW,GAAGN,CAAM,EAAGO,IACnGX,EAACK,EAAgB,MAAhB,CACC,IAAKM,EACL,UAAWC,EAAG,oDAAqDF,CAAS,EAC3E,GAAGN,EACN,CACD,EAEDW,EAAY,YAAcV,EAAgB,MAAM,YAShD,IAAMW,EAA0B,aAC9B,CAAC,CAAE,UAAAN,EAAW,GAAGN,CAAM,EAAGO,IACxBX,EAACK,EAAgB,YAAhB,CAA4B,IAAKM,EAAK,UAAWC,EAAG,gCAAiCF,CAAS,EAAI,GAAGN,EAAO,CAEjH,EAEAY,EAAkB,YAAcX,EAAgB,YAAY","names":["React","DrawerPrimitive","jsx","jsxs","Drawer","shouldScaleBackground","props","DrawerPrimitive","DrawerTrigger","DrawerClose","DrawerContent","children","className","ref","cn","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkOP6Q7VT5js = require('../chunk-OP6Q7VT5.js');require('../chunk-HQ4AUOQM.js');exports.DropdownMenu = _chunkOP6Q7VT5js.a; exports.DropdownMenuCheckboxItem = _chunkOP6Q7VT5js.j; exports.DropdownMenuContent = _chunkOP6Q7VT5js.h; exports.DropdownMenuGroup = _chunkOP6Q7VT5js.c; exports.DropdownMenuItem = _chunkOP6Q7VT5js.i; exports.DropdownMenuLabel = _chunkOP6Q7VT5js.l; exports.DropdownMenuRadioGroup = _chunkOP6Q7VT5js.e; exports.DropdownMenuRadioItem = _chunkOP6Q7VT5js.k; exports.DropdownMenuSeparator = _chunkOP6Q7VT5js.m; exports.DropdownMenuShortcut = _chunkOP6Q7VT5js.n; exports.DropdownMenuSub = _chunkOP6Q7VT5js.d; exports.DropdownMenuSubContent = _chunkOP6Q7VT5js.g; exports.DropdownMenuSubTrigger = _chunkOP6Q7VT5js.f; exports.DropdownMenuTrigger = _chunkOP6Q7VT5js.b;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkRHFF4JNHjs = require('../chunk-RHFF4JNH.js');require('../chunk-HQ4AUOQM.js');exports.DropdownMenu = _chunkRHFF4JNHjs.a; exports.DropdownMenuCheckboxItem = _chunkRHFF4JNHjs.j; exports.DropdownMenuContent = _chunkRHFF4JNHjs.h; exports.DropdownMenuGroup = _chunkRHFF4JNHjs.c; exports.DropdownMenuItem = _chunkRHFF4JNHjs.i; exports.DropdownMenuLabel = _chunkRHFF4JNHjs.l; exports.DropdownMenuRadioGroup = _chunkRHFF4JNHjs.e; exports.DropdownMenuRadioItem = _chunkRHFF4JNHjs.k; exports.DropdownMenuSeparator = _chunkRHFF4JNHjs.m; exports.DropdownMenuShortcut = _chunkRHFF4JNHjs.n; exports.DropdownMenuSub = _chunkRHFF4JNHjs.d; exports.DropdownMenuSubContent = _chunkRHFF4JNHjs.g; exports.DropdownMenuSubTrigger = _chunkRHFF4JNHjs.f; exports.DropdownMenuTrigger = _chunkRHFF4JNHjs.b;
2
2
  //# sourceMappingURL=dropdown-menu.js.map
@@ -1,2 +1,2 @@
1
- "use client";import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../chunk-XHNT6PVI.mjs";import"../chunk-LEUB3C3L.mjs";export{a as DropdownMenu,j as DropdownMenuCheckboxItem,h as DropdownMenuContent,c as DropdownMenuGroup,i as DropdownMenuItem,l as DropdownMenuLabel,e as DropdownMenuRadioGroup,k as DropdownMenuRadioItem,m as DropdownMenuSeparator,n as DropdownMenuShortcut,d as DropdownMenuSub,g as DropdownMenuSubContent,f as DropdownMenuSubTrigger,b as DropdownMenuTrigger};
1
+ "use client";import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../chunk-BM5KYF6Y.mjs";import"../chunk-LEUB3C3L.mjs";export{a as DropdownMenu,j as DropdownMenuCheckboxItem,h as DropdownMenuContent,c as DropdownMenuGroup,i as DropdownMenuItem,l as DropdownMenuLabel,e as DropdownMenuRadioGroup,k as DropdownMenuRadioItem,m as DropdownMenuSeparator,n as DropdownMenuShortcut,d as DropdownMenuSub,g as DropdownMenuSubContent,f as DropdownMenuSubTrigger,b as DropdownMenuTrigger};
2
2
  //# sourceMappingURL=dropdown-menu.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/em.tsx"],"names":["React","Slot","jsx","Em","asChild","props","ref"],"mappings":"AAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBAgBV,cAAAC,MAAA,oBAJX,IAAMC,EAAW,aACf,CAAC,CAAE,QAAAC,EAAS,GAAGC,CAAM,EAAGC,IAGfJ,EAFWE,EAAUH,EAAO,KAE3B,CAAU,IAAKK,EAAM,GAAGD,EAAO,CAE3C,EAEAF,EAAG,YAAc","sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ntype EmElement = HTMLElement;\n\ninterface EmProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nconst Em = React.forwardRef<EmElement, EmProps>(\n ({ asChild, ...props }, ref) => {\n const Component = asChild ? Slot : 'em';\n\n return <Component ref={ref} {...props} />;\n },\n);\n\nEm.displayName = 'Em';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"]}
1
+ {"version":3,"sources":["../../src/react/em.tsx"],"names":["React","Slot","jsx","Em","asChild","props","ref"],"mappings":"AAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBAeZ,cAAAC,MAAA,oBAHT,IAAMC,EAAW,aAA+B,CAAC,CAAE,QAAAC,EAAS,GAAGC,CAAM,EAAGC,IAG/DJ,EAFWE,EAAUH,EAAO,KAE3B,CAAU,IAAKK,EAAM,GAAGD,EAAO,CACxC,EAEDF,EAAG,YAAc","sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ntype EmElement = HTMLElement;\n\ninterface EmProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nconst Em = React.forwardRef<EmElement, EmProps>(({ asChild, ...props }, ref) => {\n const Component = asChild ? Slot : 'em';\n\n return <Component ref={ref} {...props} />;\n});\n\nEm.displayName = 'Em';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/em.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ntype EmElement = HTMLElement;\n\ninterface EmProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nconst Em = React.forwardRef<EmElement, EmProps>(\n ({ asChild, ...props }, ref) => {\n const Component = asChild ? Slot : 'em';\n\n return <Component ref={ref} {...props} />;\n },\n);\n\nEm.displayName = 'Em';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"],"mappings":"AAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBAgBV,cAAAC,MAAA,oBAJX,IAAMC,EAAW,aACf,CAAC,CAAE,QAAAC,EAAS,GAAGC,CAAM,EAAGC,IAGfJ,EAFWE,EAAUH,EAAO,KAE3B,CAAU,IAAKK,EAAM,GAAGD,EAAO,CAE3C,EAEAF,EAAG,YAAc","names":["React","Slot","jsx","Em","asChild","props","ref"]}
1
+ {"version":3,"sources":["../../src/react/em.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ntype EmElement = HTMLElement;\n\ninterface EmProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nconst Em = React.forwardRef<EmElement, EmProps>(({ asChild, ...props }, ref) => {\n const Component = asChild ? Slot : 'em';\n\n return <Component ref={ref} {...props} />;\n});\n\nEm.displayName = 'Em';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"],"mappings":"AAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBAeZ,cAAAC,MAAA,oBAHT,IAAMC,EAAW,aAA+B,CAAC,CAAE,QAAAC,EAAS,GAAGC,CAAM,EAAGC,IAG/DJ,EAFWE,EAAUH,EAAO,KAE3B,CAAU,IAAKK,EAAM,GAAGD,EAAO,CACxC,EAEDF,EAAG,YAAc","names":["React","Slot","jsx","Em","asChild","props","ref"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";var _chunkLG7ACTREjs = require('../chunk-LG7ACTRE.js');var _chunkHQ4AUOQMjs = require('../chunk-HQ4AUOQM.js');var _react = require('react'); var t = _interopRequireWildcard(_react);var _reactslot = require('@radix-ui/react-slot');var _reacthookform = require('react-hook-form');var _jsxruntime = require('react/jsx-runtime');var p=t.createContext(null),c=t.createContext(null),n= exports.useFormField =()=>{let e=t.useContext(p),r=t.useContext(c),{getFieldState:o,formState:m}=_reacthookform.useFormContext.call(void 0, );if(!e||!r)throw new Error("useFormField should be used within <FormField>");let s=o(e.name,m),{id:i}=r;return{id:i,name:e.name,formItemId:`form-item-${i}`,formDescriptionId:`form-item-description-${i}`,formMessageId:`form-item-message-${i}`,...s}},b= exports.Form =_reacthookform.FormProvider;function h({...e}){return _jsxruntime.jsx.call(void 0, p.Provider,{value:{name:e.name},children:_jsxruntime.jsx.call(void 0, _reacthookform.Controller,{...e})})}var R=t.forwardRef(({className:e,...r},o)=>{let m=t.useId();return _jsxruntime.jsx.call(void 0, c.Provider,{value:{id:m},children:_jsxruntime.jsx.call(void 0, "div",{ref:o,className:_chunkHQ4AUOQMjs.b.call(void 0, "space-y-2",e),...r})})});R.displayName="FormItem";var g=t.forwardRef(({className:e,...r},o)=>{let{error:m,formItemId:s}=n();return _jsxruntime.jsx.call(void 0, _chunkLG7ACTREjs.a,{ref:o,className:_chunkHQ4AUOQMjs.b.call(void 0, m&&"text-destructive",e),htmlFor:s,...r})});g.displayName="FormLabel";var I=t.forwardRef(({...e},r)=>{let{error:o,formItemId:m,formDescriptionId:s,formMessageId:i}=n();return _jsxruntime.jsx.call(void 0, _reactslot.Slot,{ref:r,id:m,"aria-describedby":o?`${s} ${i}`:s,"aria-invalid":!!o,...e})});I.displayName="FormControl";var x=t.forwardRef(({className:e,...r},o)=>{let{formDescriptionId:m}=n();return _jsxruntime.jsx.call(void 0, "p",{ref:o,id:m,className:_chunkHQ4AUOQMjs.b.call(void 0, "text-muted-foreground text-xs",e),...r})});x.displayName="FormDescription";var C=t.forwardRef(({children:e,className:r,...o},m)=>{let{error:s,formMessageId:i}=n(),d=_optionalChain([s, 'optionalAccess', _ => _.message])?String(s.message):e;return d?_jsxruntime.jsx.call(void 0, "p",{ref:m,id:i,className:_chunkHQ4AUOQMjs.b.call(void 0, "text-destructive text-xs font-medium",r),...o,children:d}):null});C.displayName="FormMessage";exports.Form = b; exports.FormControl = I; exports.FormDescription = x; exports.FormField = h; exports.FormItem = R; exports.FormLabel = g; exports.FormMessage = C; exports.useFormField = n;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";var _chunkPRCS3RWNjs = require('../chunk-PRCS3RWN.js');var _chunkHQ4AUOQMjs = require('../chunk-HQ4AUOQM.js');var _react = require('react'); var t = _interopRequireWildcard(_react);var _reactslot = require('@radix-ui/react-slot');var _reacthookform = require('react-hook-form');var _jsxruntime = require('react/jsx-runtime');var p=t.createContext(null),c=t.createContext(null),n= exports.useFormField =()=>{let e=t.useContext(p),r=t.useContext(c),{getFieldState:o,formState:m}=_reacthookform.useFormContext.call(void 0, );if(!e||!r)throw new Error("useFormField should be used within <FormField>");let s=o(e.name,m),{id:i}=r;return{id:i,name:e.name,formItemId:`form-item-${i}`,formDescriptionId:`form-item-description-${i}`,formMessageId:`form-item-message-${i}`,...s}},b= exports.Form =_reacthookform.FormProvider;function h({...e}){return _jsxruntime.jsx.call(void 0, p.Provider,{value:{name:e.name},children:_jsxruntime.jsx.call(void 0, _reacthookform.Controller,{...e})})}var R=t.forwardRef(({className:e,...r},o)=>{let m=t.useId();return _jsxruntime.jsx.call(void 0, c.Provider,{value:{id:m},children:_jsxruntime.jsx.call(void 0, "div",{ref:o,className:_chunkHQ4AUOQMjs.b.call(void 0, "space-y-2",e),...r})})});R.displayName="FormItem";var g=t.forwardRef(({className:e,...r},o)=>{let{error:m,formItemId:s}=n();return _jsxruntime.jsx.call(void 0, _chunkPRCS3RWNjs.a,{ref:o,className:_chunkHQ4AUOQMjs.b.call(void 0, m&&"text-destructive",e),htmlFor:s,...r})});g.displayName="FormLabel";var I=t.forwardRef(({...e},r)=>{let{error:o,formItemId:m,formDescriptionId:s,formMessageId:i}=n();return _jsxruntime.jsx.call(void 0, _reactslot.Slot,{ref:r,id:m,"aria-describedby":o?`${s} ${i}`:s,"aria-invalid":!!o,...e})});I.displayName="FormControl";var x=t.forwardRef(({className:e,...r},o)=>{let{formDescriptionId:m}=n();return _jsxruntime.jsx.call(void 0, "p",{ref:o,id:m,className:_chunkHQ4AUOQMjs.b.call(void 0, "text-muted-foreground text-xs",e),...r})});x.displayName="FormDescription";var C=t.forwardRef(({children:e,className:r,...o},m)=>{let{error:s,formMessageId:i}=n(),d=_optionalChain([s, 'optionalAccess', _ => _.message])?String(s.message):e;return d?_jsxruntime.jsx.call(void 0, "p",{ref:m,id:i,className:_chunkHQ4AUOQMjs.b.call(void 0, "text-destructive text-xs font-medium",r),...o,children:d}):null});C.displayName="FormMessage";exports.Form = b; exports.FormControl = I; exports.FormDescription = x; exports.FormField = h; exports.FormItem = R; exports.FormLabel = g; exports.FormMessage = C; exports.useFormField = n;
2
2
  //# sourceMappingURL=form.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/form.tsx"],"names":["React","Slot","Controller","FormProvider","useFormContext","jsx","FormFieldContext","FormItemContext","useFormField","fieldContext","itemContext","getFieldState","formState","fieldState","id","Form","FormField","props","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","FormDescription","FormMessage","children","body"],"mappings":"+FAEA,UAAYA,MAAW,QAEvB,OAAS,QAAAC,MAAY,uBACrB,OACE,cAAAC,EAMA,gBAAAC,EAEA,kBAAAC,MACK,kBAiFD,cAAAC,MAAA,oBA9DN,IAAMC,EAAyB,gBAC7B,IACF,EAEMC,EAAwB,gBAA2C,IAAI,EAEvEC,EAAe,IAWhB,CACH,IAAMC,EAAqB,aAAWH,CAAgB,EAChDI,EAAoB,aAAWH,CAAe,EAC9C,CAAE,cAAAI,EAAe,UAAAC,CAAU,EAAIR,EAAe,EAEpD,GAAI,CAACK,GAAgB,CAACC,EACpB,MAAM,IAAI,MAAM,gDAAgD,EAGlE,IAAMG,EAAaF,EAAcF,EAAa,KAAMG,CAAS,EAEvD,CAAE,GAAAE,CAAG,EAAIJ,EAEf,MAAO,CACL,GAAAI,EACA,KAAML,EAAa,KACnB,WAAY,aAAaK,CAAE,GAC3B,kBAAmB,yBAAyBA,CAAE,GAC9C,cAAe,qBAAqBA,CAAE,GACtC,GAAGD,CACL,CACF,EAOME,EAAOZ,EAWb,SAASa,EAGP,CAAE,GAAGC,CAAM,EAA2D,CACtE,OACEZ,EAACC,EAAiB,SAAjB,CAA0B,MAAO,CAAE,KAAMW,EAAM,IAAK,EACnD,SAAAZ,EAACH,EAAA,CAAY,GAAGe,EAAO,EACzB,CAEJ,CASA,IAAMC,EAAiB,aACrB,CAAC,CAAE,UAAAC,EAAW,GAAGF,CAAM,EAAGG,IAAQ,CAChC,IAAMN,EAAW,QAAM,EAEvB,OACET,EAACE,EAAgB,SAAhB,CAAyB,MAAO,CAAE,GAAAO,CAAG,EACpC,SAAAT,EAAC,OA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Q,EACJ,UAAWP,EAAG,uCAAwCF,CAAS,EAC9D,GAAGF,EAEH,SAAAe,EACH,EAXO,IAaX,CACF,EAEAF,EAAY,YAAc","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type * as LabelPrimitive from '@radix-ui/react-label';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldErrorsImpl,\n type FieldPath,\n type FieldValues,\n FormProvider,\n type Merge,\n useFormContext,\n} from 'react-hook-form';\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\n\n/* -----------------------------------------------------------------------------\n * Context: Form\n * -------------------------------------------------------------------------- */\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(\n null,\n);\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst useFormField = (): {\n error?: FieldError | Merge<FieldError, FieldErrorsImpl> | undefined;\n formDescriptionId: string;\n formItemId: string;\n formMessageId: string;\n id: string;\n invalid: boolean;\n isDirty: boolean;\n isTouched: boolean;\n isValidating: boolean;\n name: string;\n} => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext || !itemContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `form-item-${id}`,\n formDescriptionId: `form-item-description-${id}`,\n formMessageId: `form-item-message-${id}`,\n ...fieldState,\n };\n};\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\ntype FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = ControllerProps<TFieldValues, TName>;\n\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\ntype FormItemElement = HTMLDivElement;\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst FormItem = React.forwardRef<FormItemElement, FormItemProps>(\n ({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('space-y-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n },\n);\n\nFormItem.displayName = 'FormItem';\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\ntype FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype FormLabelProps = React.ComponentPropsWithoutRef<\n typeof LabelPrimitive.Root\n>;\n\nconst FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(\n ({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n ref={ref}\n className={cn(error && 'text-destructive', className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n },\n);\n\nFormLabel.displayName = 'FormLabel';\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\ntype FormControlElement = React.ElementRef<typeof Slot>;\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\n\nconst FormControl = React.forwardRef<FormControlElement, FormControlProps>(\n ({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } =\n useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={Boolean(error)}\n {...props}\n />\n );\n },\n);\n\nFormControl.displayName = 'FormControl';\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\ntype FormDescriptionElement = HTMLParagraphElement;\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormDescription = React.forwardRef<\n FormDescriptionElement,\n FormDescriptionProps\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn('text-muted-foreground text-xs', className)}\n {...props}\n />\n );\n});\n\nFormDescription.displayName = 'FormDescription';\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\ntype FormMessageElement = HTMLParagraphElement;\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(\n ({ children, className, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error?.message ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn('text-destructive text-xs font-medium', className)}\n {...props}\n >\n {body}\n </p>\n );\n },\n);\n\nFormMessage.displayName = 'FormMessage';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n type FormProps,\n type FormItemProps,\n type FormLabelProps,\n type FormControlProps,\n type FormDescriptionProps,\n type FormMessageProps,\n type FormFieldProps,\n};\n"]}
1
+ {"version":3,"sources":["../../src/react/form.tsx"],"names":["React","Slot","Controller","FormProvider","useFormContext","jsx","FormFieldContext","FormItemContext","useFormField","fieldContext","itemContext","getFieldState","formState","fieldState","id","Form","FormField","props","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","FormDescription","FormMessage","children","body"],"mappings":"+FAEA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OACE,cAAAC,EAMA,gBAAAC,EAEA,kBAAAC,MACK,kBAgFD,cAAAC,MAAA,oBA5DN,IAAMC,EAAyB,gBAA4C,IAAI,EAEzEC,EAAwB,gBAA2C,IAAI,EAEvEC,EAAe,IAWhB,CACH,IAAMC,EAAqB,aAAWH,CAAgB,EAChDI,EAAoB,aAAWH,CAAe,EAC9C,CAAE,cAAAI,EAAe,UAAAC,CAAU,EAAIR,EAAe,EAEpD,GAAI,CAACK,GAAgB,CAACC,EACpB,MAAM,IAAI,MAAM,gDAAgD,EAGlE,IAAMG,EAAaF,EAAcF,EAAa,KAAMG,CAAS,EAEvD,CAAE,GAAAE,CAAG,EAAIJ,EAEf,MAAO,CACL,GAAAI,EACA,KAAML,EAAa,KACnB,WAAY,aAAaK,CAAE,GAC3B,kBAAmB,yBAAyBA,CAAE,GAC9C,cAAe,qBAAqBA,CAAE,GACtC,GAAGD,CACL,CACF,EAOME,EAAOZ,EAWb,SAASa,EAGP,CAAE,GAAGC,CAAM,EAA2D,CACtE,OACEZ,EAACC,EAAiB,SAAjB,CAA0B,MAAO,CAAE,KAAMW,EAAM,IAAK,EACnD,SAAAZ,EAACH,EAAA,CAAY,GAAGe,EAAO,EACzB,CAEJ,CASA,IAAMC,EAAiB,aAA2C,CAAC,CAAE,UAAAC,EAAW,GAAGF,CAAM,EAAGG,IAAQ,CAClG,IAAMN,EAAW,QAAM,EAEvB,OACET,EAACE,EAAgB,SAAhB,CAAyB,MAAO,CAAE,GAAAO,CAAG,EACpC,SAAAT,EAAC,OAAI,IAAKe,EAAK,UAAWC,EAAG,YAAaF,CAAS,EAAI,GAAGF,EAAO,EACnE,CAEJ,CAAC,EAEDC,EAAS,YAAc,WASvB,IAAMI,E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AY,YAAc","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldErrorsImpl,\n type FieldPath,\n type FieldValues,\n FormProvider,\n type Merge,\n useFormContext,\n} from 'react-hook-form';\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\nimport type * as LabelPrimitive from '@radix-ui/react-label';\n\n/* -----------------------------------------------------------------------------\n * Context: Form\n * -------------------------------------------------------------------------- */\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst useFormField = (): {\n error?: FieldError | Merge<FieldError, FieldErrorsImpl> | undefined;\n formDescriptionId: string;\n formItemId: string;\n formMessageId: string;\n id: string;\n invalid: boolean;\n isDirty: boolean;\n isTouched: boolean;\n isValidating: boolean;\n name: string;\n} => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext || !itemContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `form-item-${id}`,\n formDescriptionId: `form-item-description-${id}`,\n formMessageId: `form-item-message-${id}`,\n ...fieldState,\n };\n};\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\ntype FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = ControllerProps<TFieldValues, TName>;\n\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\ntype FormItemElement = HTMLDivElement;\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst FormItem = React.forwardRef<FormItemElement, FormItemProps>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('space-y-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n});\n\nFormItem.displayName = 'FormItem';\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\ntype FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return <Label ref={ref} className={cn(error && 'text-destructive', className)} htmlFor={formItemId} {...props} />;\n});\n\nFormLabel.displayName = 'FormLabel';\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\ntype FormControlElement = React.ElementRef<typeof Slot>;\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\n\nconst FormControl = React.forwardRef<FormControlElement, FormControlProps>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={Boolean(error)}\n {...props}\n />\n );\n});\n\nFormControl.displayName = 'FormControl';\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\ntype FormDescriptionElement = HTMLParagraphElement;\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormDescription = React.forwardRef<FormDescriptionElement, FormDescriptionProps>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return <p ref={ref} id={formDescriptionId} className={cn('text-muted-foreground text-xs', className)} {...props} />;\n },\n);\n\nFormDescription.displayName = 'FormDescription';\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\ntype FormMessageElement = HTMLParagraphElement;\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(({ children, className, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error?.message ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p ref={ref} id={formMessageId} className={cn('text-destructive text-xs font-medium', className)} {...props}>\n {body}\n </p>\n );\n});\n\nFormMessage.displayName = 'FormMessage';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n type FormProps,\n type FormItemProps,\n type FormLabelProps,\n type FormControlProps,\n type FormDescriptionProps,\n type FormMessageProps,\n type FormFieldProps,\n};\n"]}
@@ -1,2 +1,2 @@
1
- "use client";import{a as F}from"../chunk-6FL3EBDQ.mjs";import{b as a}from"../chunk-LEUB3C3L.mjs";import*as t from"react";import{Slot as u}from"@radix-ui/react-slot";import{Controller as f,FormProvider as P,useFormContext as y}from"react-hook-form";import{jsx as l}from"react/jsx-runtime";var p=t.createContext(null),c=t.createContext(null),n=()=>{let e=t.useContext(p),r=t.useContext(c),{getFieldState:o,formState:m}=y();if(!e||!r)throw new Error("useFormField should be used within <FormField>");let s=o(e.name,m),{id:i}=r;return{id:i,name:e.name,formItemId:`form-item-${i}`,formDescriptionId:`form-item-description-${i}`,formMessageId:`form-item-message-${i}`,...s}},b=P;function h({...e}){return l(p.Provider,{value:{name:e.name},children:l(f,{...e})})}var R=t.forwardRef(({className:e,...r},o)=>{let m=t.useId();return l(c.Provider,{value:{id:m},children:l("div",{ref:o,className:a("space-y-2",e),...r})})});R.displayName="FormItem";var g=t.forwardRef(({className:e,...r},o)=>{let{error:m,formItemId:s}=n();return l(F,{ref:o,className:a(m&&"text-destructive",e),htmlFor:s,...r})});g.displayName="FormLabel";var I=t.forwardRef(({...e},r)=>{let{error:o,formItemId:m,formDescriptionId:s,formMessageId:i}=n();return l(u,{ref:r,id:m,"aria-describedby":o?`${s} ${i}`:s,"aria-invalid":!!o,...e})});I.displayName="FormControl";var x=t.forwardRef(({className:e,...r},o)=>{let{formDescriptionId:m}=n();return l("p",{ref:o,id:m,className:a("text-muted-foreground text-xs",e),...r})});x.displayName="FormDescription";var C=t.forwardRef(({children:e,className:r,...o},m)=>{let{error:s,formMessageId:i}=n(),d=s?.message?String(s.message):e;return d?l("p",{ref:m,id:i,className:a("text-destructive text-xs font-medium",r),...o,children:d}):null});C.displayName="FormMessage";export{b as Form,I as FormControl,x as FormDescription,h as FormField,R as FormItem,g as FormLabel,C as FormMessage,n as useFormField};
1
+ "use client";import{a as F}from"../chunk-HMD2ZU33.mjs";import{b as a}from"../chunk-LEUB3C3L.mjs";import*as t from"react";import{Slot as u}from"@radix-ui/react-slot";import{Controller as f,FormProvider as P,useFormContext as y}from"react-hook-form";import{jsx as l}from"react/jsx-runtime";var p=t.createContext(null),c=t.createContext(null),n=()=>{let e=t.useContext(p),r=t.useContext(c),{getFieldState:o,formState:m}=y();if(!e||!r)throw new Error("useFormField should be used within <FormField>");let s=o(e.name,m),{id:i}=r;return{id:i,name:e.name,formItemId:`form-item-${i}`,formDescriptionId:`form-item-description-${i}`,formMessageId:`form-item-message-${i}`,...s}},b=P;function h({...e}){return l(p.Provider,{value:{name:e.name},children:l(f,{...e})})}var R=t.forwardRef(({className:e,...r},o)=>{let m=t.useId();return l(c.Provider,{value:{id:m},children:l("div",{ref:o,className:a("space-y-2",e),...r})})});R.displayName="FormItem";var g=t.forwardRef(({className:e,...r},o)=>{let{error:m,formItemId:s}=n();return l(F,{ref:o,className:a(m&&"text-destructive",e),htmlFor:s,...r})});g.displayName="FormLabel";var I=t.forwardRef(({...e},r)=>{let{error:o,formItemId:m,formDescriptionId:s,formMessageId:i}=n();return l(u,{ref:r,id:m,"aria-describedby":o?`${s} ${i}`:s,"aria-invalid":!!o,...e})});I.displayName="FormControl";var x=t.forwardRef(({className:e,...r},o)=>{let{formDescriptionId:m}=n();return l("p",{ref:o,id:m,className:a("text-muted-foreground text-xs",e),...r})});x.displayName="FormDescription";var C=t.forwardRef(({children:e,className:r,...o},m)=>{let{error:s,formMessageId:i}=n(),d=s?.message?String(s.message):e;return d?l("p",{ref:m,id:i,className:a("text-destructive text-xs font-medium",r),...o,children:d}):null});C.displayName="FormMessage";export{b as Form,I as FormControl,x as FormDescription,h as FormField,R as FormItem,g as FormLabel,C as FormMessage,n as useFormField};
2
2
  //# sourceMappingURL=form.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/form.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type * as LabelPrimitive from '@radix-ui/react-label';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldErrorsImpl,\n type FieldPath,\n type FieldValues,\n FormProvider,\n type Merge,\n useFormContext,\n} from 'react-hook-form';\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\n\n/* -----------------------------------------------------------------------------\n * Context: Form\n * -------------------------------------------------------------------------- */\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(\n null,\n);\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst useFormField = (): {\n error?: FieldError | Merge<FieldError, FieldErrorsImpl> | undefined;\n formDescriptionId: string;\n formItemId: string;\n formMessageId: string;\n id: string;\n invalid: boolean;\n isDirty: boolean;\n isTouched: boolean;\n isValidating: boolean;\n name: string;\n} => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext || !itemContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `form-item-${id}`,\n formDescriptionId: `form-item-description-${id}`,\n formMessageId: `form-item-message-${id}`,\n ...fieldState,\n };\n};\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\ntype FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = ControllerProps<TFieldValues, TName>;\n\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\ntype FormItemElement = HTMLDivElement;\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst FormItem = React.forwardRef<FormItemElement, FormItemProps>(\n ({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('space-y-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n },\n);\n\nFormItem.displayName = 'FormItem';\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\ntype FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype FormLabelProps = React.ComponentPropsWithoutRef<\n typeof LabelPrimitive.Root\n>;\n\nconst FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(\n ({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n ref={ref}\n className={cn(error && 'text-destructive', className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n },\n);\n\nFormLabel.displayName = 'FormLabel';\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\ntype FormControlElement = React.ElementRef<typeof Slot>;\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\n\nconst FormControl = React.forwardRef<FormControlElement, FormControlProps>(\n ({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } =\n useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={Boolean(error)}\n {...props}\n />\n );\n },\n);\n\nFormControl.displayName = 'FormControl';\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\ntype FormDescriptionElement = HTMLParagraphElement;\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormDescription = React.forwardRef<\n FormDescriptionElement,\n FormDescriptionProps\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn('text-muted-foreground text-xs', className)}\n {...props}\n />\n );\n});\n\nFormDescription.displayName = 'FormDescription';\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\ntype FormMessageElement = HTMLParagraphElement;\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(\n ({ children, className, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error?.message ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn('text-destructive text-xs font-medium', className)}\n {...props}\n >\n {body}\n </p>\n );\n },\n);\n\nFormMessage.displayName = 'FormMessage';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n type FormProps,\n type FormItemProps,\n type FormLabelProps,\n type FormControlProps,\n type FormDescriptionProps,\n type FormMessageProps,\n type FormFieldProps,\n};\n"],"mappings":"iGAEA,UAAYA,MAAW,QAEvB,OAAS,QAAAC,MAAY,uBACrB,OACE,cAAAC,EAMA,gBAAAC,EAEA,kBAAAC,MACK,kBAiFD,cAAAC,MAAA,oBA9DN,IAAMC,EAAyB,gBAC7B,IACF,EAEMC,EAAwB,gBAA2C,IAAI,EAEvEC,EAAe,IAWhB,CACH,IAAMC,EAAqB,aAAWH,CAAgB,EAChDI,EAAoB,aAAWH,CAAe,EAC9C,CAAE,cAAAI,EAAe,UAAAC,CAAU,EAAIC,EAAe,EAEpD,GAAI,CAACJ,GAAgB,CAACC,EACpB,MAAM,IAAI,MAAM,gDAAgD,EAGlE,IAAMI,EAAaH,EAAcF,EAAa,KAAMG,CAAS,EAEvD,CAAE,GAAAG,CAAG,EAAIL,EAEf,MAAO,CACL,GAAAK,EACA,KAAMN,EAAa,KACnB,WAAY,aAAaM,CAAE,GAC3B,kBAAmB,yBAAyBA,CAAE,GAC9C,cAAe,qBAAqBA,CAAE,GACtC,GAAGD,CACL,CACF,EAOME,EAAOC,EA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B,EACL,GAAIO,EACJ,UAAWN,EAAG,gCAAiCF,CAAS,EACvD,GAAGH,EACN,CAEJ,CAAC,EAEDc,EAAgB,YAAc,kBAS9B,IAAMC,EAAoB,aACxB,CAAC,CAAE,SAAAC,EAAU,UAAAb,EAAW,GAAGH,CAAM,EAAGI,IAAQ,CAC1C,GAAM,CAAE,MAAAG,EAAO,cAAAK,CAAc,EAAIvB,EAAa,EACxC4B,EAAOV,GAAO,QAAU,OAAOA,EAAM,OAAO,EAAIS,EAEtD,OAAKC,EAKH/B,EAAC,KACC,IAAKkB,EACL,GAAIQ,EACJ,UAAWP,EAAG,uCAAwCF,CAAS,EAC9D,GAAGH,EAEH,SAAAiB,EACH,EAXO,IAaX,CACF,EAEAF,EAAY,YAAc","names":["React","Slot","Controller","FormProvider","useFormContext","jsx","FormFieldContext","FormItemContext","useFormField","fieldContext","itemContext","getFieldState","formState","useFormContext","fieldState","id","Form","FormProvider","FormField","props","Controller","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body"]}
1
+ {"version":3,"sources":["../../src/react/form.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldErrorsImpl,\n type FieldPath,\n type FieldValues,\n FormProvider,\n type Merge,\n useFormContext,\n} from 'react-hook-form';\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\nimport type * as LabelPrimitive from '@radix-ui/react-label';\n\n/* -----------------------------------------------------------------------------\n * Context: Form\n * -------------------------------------------------------------------------- */\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst useFormField = (): {\n error?: FieldError | Merge<FieldError, FieldErrorsImpl> | undefined;\n formDescriptionId: string;\n formItemId: string;\n formMessageId: string;\n id: string;\n invalid: boolean;\n isDirty: boolean;\n isTouched: boolean;\n isValidating: boolean;\n name: string;\n} => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext || !itemContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `form-item-${id}`,\n formDescriptionId: `form-item-description-${id}`,\n formMessageId: `form-item-message-${id}`,\n ...fieldState,\n };\n};\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\ntype FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = ControllerProps<TFieldValues, TName>;\n\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\ntype FormItemElement = HTMLDivElement;\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst FormItem = React.forwardRef<FormItemElement, FormItemProps>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('space-y-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n});\n\nFormItem.displayName = 'FormItem';\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\ntype FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return <Label ref={ref} className={cn(error && 'text-destructive', className)} htmlFor={formItemId} {...props} />;\n});\n\nFormLabel.displayName = 'FormLabel';\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\ntype FormControlElement = React.ElementRef<typeof Slot>;\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\n\nconst FormControl = React.forwardRef<FormControlElement, FormControlProps>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={Boolean(error)}\n {...props}\n />\n );\n});\n\nFormControl.displayName = 'FormControl';\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\ntype FormDescriptionElement = HTMLParagraphElement;\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormDescription = React.forwardRef<FormDescriptionElement, FormDescriptionProps>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return <p ref={ref} id={formDescriptionId} className={cn('text-muted-foreground text-xs', className)} {...props} />;\n },\n);\n\nFormDescription.displayName = 'FormDescription';\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\ntype FormMessageElement = HTMLParagraphElement;\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(({ children, className, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error?.message ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p ref={ref} id={formMessageId} className={cn('text-destructive text-xs font-medium', className)} {...props}>\n {body}\n </p>\n );\n});\n\nFormMessage.displayName = 'FormMessage';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n type FormProps,\n type FormItemProps,\n type FormLabelProps,\n type FormControlProps,\n type FormDescriptionProps,\n type FormMessageProps,\n type FormFieldProps,\n};\n"],"mappings":"iGAEA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OACE,cAAAC,EAMA,gBAAAC,EAEA,kBAAAC,MACK,kBAgFD,cAAAC,MAAA,oBA5DN,IAAMC,EAAyB,gBAA4C,IAAI,EAEzEC,EAAwB,gBAA2C,IAAI,EAEvEC,EAAe,IAWhB,CACH,IAAMC,EAAqB,aAAWH,CAAgB,EAChDI,EAAoB,aAAWH,CAAe,EAC9C,CAAE,cAAAI,EAAe,UAAAC,CAAU,EAAIC,EAAe,EAEpD,GAAI,CAACJ,GAAgB,CAACC,EACpB,MAAM,IAAI,MAAM,gDAAgD,EAGlE,IAAMI,EAAaH,EAAcF,EAAa,KAAMG,CAAS,EAEvD,CAAE,GAAAG,CAAG,EAAIL,EAEf,MAAO,CACL,GAAAK,EACA,KAAMN,EAAa,KACnB,WAAY,aAAaM,CAAE,GAC3B,kBAAmB,yBAAyBA,CAAE,GAC9C,cAAe,qBAAqBA,CAAE,GACtC,GAAGD,CACL,CACF,EAOME,EAAOC,EAWb,SAASC,EAGP,CAAE,GAAGC,CAAM,EAA2D,CACtE,OACEd,EAACC,EAAiB,SAAjB,CAA0B,MAAO,CAAE,KAAMa,EAAM,IAAK,EACnD,SAAAd,EAACe,EAAA,CAAY,GAAGD,EAAO,EACzB,CAEJ,CASA,IAAME,EAAiB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GAAGH,CAAM,EAAGI,IAAQ,CACrH,GAAM,CAAE,MAAAG,EAAO,cAAAK,CAAc,EAAIvB,EAAa,EACxC4B,EAAOV,GAAO,QAAU,OAAOA,EAAM,OAAO,EAAIS,EAEtD,OAAKC,EAKH/B,EAAC,KAAE,IAAKkB,EAAK,GAAIQ,EAAe,UAAWP,EAAG,uCAAwCF,CAAS,EAAI,GAAGH,EACnG,SAAAiB,EACH,EANO,IAQX,CAAC,EAEDF,EAAY,YAAc","names":["React","Slot","Controller","FormProvider","useFormContext","jsx","FormFieldContext","FormItemContext","useFormField","fieldContext","itemContext","getFieldState","formState","useFormContext","fieldState","id","Form","FormProvider","FormField","props","Controller","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/heading.tsx"],"names":["React","Slot","jsx","Heading","asChild","Tag","props","ref"],"mappings":"AAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBAiBV,cAAAC,MAAA,oBAJX,IAAMC,EAAgB,aACpB,CAAC,CAAE,QAAAC,EAAS,GAAIC,EAAM,KAAM,GAAGC,CAAM,EAAGC,IAG/BL,EAFWE,EAAUH,EAAOI,EAE3B,CAAU,IAAKE,EAAM,GAAGD,EAAO,CAE3C,EAEAH,EAAQ,YAAc","sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\n/* -----------------------------------------------------------------------------\n * Component: Heading\n * -------------------------------------------------------------------------- */\n\ntype HeadingElement = HTMLHeadingElement;\n\ninterface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n asChild?: boolean;\n}\n\nconst Heading = React.forwardRef<HeadingElement, HeadingProps>(\n ({ asChild, as: Tag = 'h1', ...props }, ref) => {\n const Component = asChild ? Slot : Tag;\n\n return <Component ref={ref} {...props} />;\n },\n);\n\nHeading.displayName = 'Heading';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Heading, type HeadingProps };\n"]}
1
+ {"version":3,"sources":["../../src/react/heading.tsx"],"names":["React","Slot","jsx","Heading","asChild","Tag","props","ref"],"mappings":"AAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBAgBZ,cAAAC,MAAA,oBAHT,IAAMC,EAAgB,aAAyC,CAAC,CAAE,QAAAC,EAAS,GAAIC,EAAM,KAAM,GAAGC,CAAM,EAAGC,IAG9FL,EAFWE,EAAUH,EAAOI,EAE3B,CAAU,IAAKE,EAAM,GAAGD,EAAO,CACxC,EAEDH,EAAQ,YAAc","sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\n/* -----------------------------------------------------------------------------\n * Component: Heading\n * -------------------------------------------------------------------------- */\n\ntype HeadingElement = HTMLHeadingElement;\n\ninterface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n asChild?: boolean;\n}\n\nconst Heading = React.forwardRef<HeadingElement, HeadingProps>(({ asChild, as: Tag = 'h1', ...props }, ref) => {\n const Component = asChild ? Slot : Tag;\n\n return <Component ref={ref} {...props} />;\n});\n\nHeading.displayName = 'Heading';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Heading, type HeadingProps };\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/heading.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\n/* -----------------------------------------------------------------------------\n * Component: Heading\n * -------------------------------------------------------------------------- */\n\ntype HeadingElement = HTMLHeadingElement;\n\ninterface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n asChild?: boolean;\n}\n\nconst Heading = React.forwardRef<HeadingElement, HeadingProps>(\n ({ asChild, as: Tag = 'h1', ...props }, ref) => {\n const Component = asChild ? Slot : Tag;\n\n return <Component ref={ref} {...props} />;\n },\n);\n\nHeading.displayName = 'Heading';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Heading, type HeadingProps };\n"],"mappings":"AAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBAiBV,cAAAC,MAAA,oBAJX,IAAMC,EAAgB,aACpB,CAAC,CAAE,QAAAC,EAAS,GAAIC,EAAM,KAAM,GAAGC,CAAM,EAAGC,IAG/BL,EAFWE,EAAUH,EAAOI,EAE3B,CAAU,IAAKE,EAAM,GAAGD,EAAO,CAE3C,EAEAH,EAAQ,YAAc","names":["React","Slot","jsx","Heading","asChild","Tag","props","ref"]}
1
+ {"version":3,"sources":["../../src/react/heading.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\n/* -----------------------------------------------------------------------------\n * Component: Heading\n * -------------------------------------------------------------------------- */\n\ntype HeadingElement = HTMLHeadingElement;\n\ninterface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n asChild?: boolean;\n}\n\nconst Heading = React.forwardRef<HeadingElement, HeadingProps>(({ asChild, as: Tag = 'h1', ...props }, ref) => {\n const Component = asChild ? Slot : Tag;\n\n return <Component ref={ref} {...props} />;\n});\n\nHeading.displayName = 'Heading';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Heading, type HeadingProps };\n"],"mappings":"AAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBAgBZ,cAAAC,MAAA,oBAHT,IAAMC,EAAgB,aAAyC,CAAC,CAAE,QAAAC,EAAS,GAAIC,EAAM,KAAM,GAAGC,CAAM,EAAGC,IAG9FL,EAFWE,EAAUH,EAAOI,EAE3B,CAAU,IAAKE,EAAM,GAAGD,EAAO,CACxC,EAEDH,EAAQ,YAAc","names":["React","Slot","jsx","Heading","asChild","Tag","props","ref"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/hover-card.tsx"],"names":["React","HoverCardPrimitive","jsx","HoverCard","HoverCardTrigger","HoverCardContent","className","align","sideOffset","props","ref","cn","HoverCardArrow"],"mappings":"sDAEA,UAAYA,MAAW,QACvB,UAAYC,MAAwB,6BAmChC,cAAAC,MAAA,oBA3BJ,IAAMC,EAA+B,OAS/BC,EAAsC,UAatCC,EAAyB,aAG7B,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAQ,SAAU,WAAAC,EAAa,EAAG,GAAGC,CAAM,EAAGC,IAC5DR,EAAoB,SAAnB,CACC,SAAAA,EAAoB,UAAnB,CACC,IAAKQ,EACL,MAAOH,EACP,WAAYC,EACZ,UAAWG,EACT,gtBACAL,CACF,EACC,GAAGG,EACN,EACF,CACD,EAEDJ,EAAiB,YAAiC,UAAQ,YAW1D,IAAMO,EAAuB,aAG3B,CAAC,CAAE,UAAAN,EAAW,GAAGG,CAAM,EAAGC,IAC1BR,EAAoB,QAAnB,CACC,IAAKQ,EACL,UAAWC,EAAG,eAAgBL,CAAS,EACtC,GAAGG,EACN,CACD,EAEDG,EAAe,YAAiC,QAAM","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as HoverCardPrimitive from '@radix-ui/react-hover-card';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCard\n * -------------------------------------------------------------------------- */\n\ntype HoverCardProps = React.ComponentProps<typeof HoverCardPrimitive.Root>;\nconst HoverCard = HoverCardPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCardTrigger\n * -------------------------------------------------------------------------- */\n\ntype HoverCardTriggerProps = React.ComponentPropsWithoutRef<\n typeof HoverCardPrimitive.Trigger\n>;\nconst HoverCardTrigger = HoverCardPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCardContent\n * -------------------------------------------------------------------------- */\n\ntype HoverCardContentElement = React.ElementRef<\n typeof HoverCardPrimitive.Content\n>;\ntype HoverCardContentProps = React.ComponentPropsWithoutRef<\n typeof HoverCardPrimitive.Content\n>;\n\nconst HoverCardContent = React.forwardRef<\n HoverCardContentElement,\n HoverCardContentProps\n>(({ className, align = 'center', sideOffset = 6, ...props }, ref) => (\n <HoverCardPrimitive.Portal>\n <HoverCardPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 z-50 min-w-32 rounded-md border p-4 shadow-md',\n className,\n )}\n {...props}\n />\n </HoverCardPrimitive.Portal>\n));\n\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCardArrow\n * -------------------------------------------------------------------------- */\n\ntype HoverCardArrowElement = React.ElementRef<typeof HoverCardPrimitive.Arrow>;\ntype HoverCardArrowProps = React.ComponentPropsWithoutRef<\n typeof HoverCardPrimitive.Arrow\n>;\n\nconst HoverCardArrow = React.forwardRef<\n HoverCardArrowElement,\n HoverCardArrowProps\n>(({ className, ...props }, ref) => (\n <HoverCardPrimitive.Arrow\n ref={ref}\n className={cn('fill-popover', className)}\n {...props}\n />\n));\n\nHoverCardArrow.displayName = HoverCardPrimitive.Arrow.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n HoverCard,\n HoverCardTrigger,\n HoverCardContent,\n HoverCardArrow,\n type HoverCardProps,\n type HoverCardTriggerProps,\n type HoverCardContentProps,\n type HoverCardArrowProps,\n};\n"]}
1
+ {"version":3,"sources":["../../src/react/hover-card.tsx"],"names":["React","HoverCardPrimitive","jsx","HoverCard","HoverCardTrigger","HoverCardContent","className","align","sideOffset","props","ref","cn","HoverCardArrow"],"mappings":"sDAEA,UAAYA,MAAW,QACvB,UAAYC,MAAwB,6BA2B9B,cAAAC,MAAA,oBAnBN,IAAMC,EAA+B,OAO/BC,EAAsC,UAStCC,EAAyB,aAC7B,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAQ,SAAU,WAAAC,EAAa,EAAG,GAAGC,CAAM,EAAGC,IAC1DR,EAAoB,SAAnB,CACC,SAAAA,EAAoB,UAAnB,CACC,IAAKQ,EACL,MAAOH,EACP,WAAYC,EACZ,UAAWG,EACT,gtBACAL,CACF,EACC,GAAGG,EACN,EACF,CAEJ,EAEAJ,EAAiB,YAAiC,UAAQ,YAS1D,IAAMO,EAAuB,aAAuD,CAAC,CAAE,UAAAN,EAAW,GAAGG,CAAM,EAAGC,IAC5GR,EAAoB,QAAnB,CAAyB,IAAKQ,EAAK,UAAWC,EAAG,eAAgBL,CAAS,EAAI,GAAGG,EAAO,CAC1F,EAEDG,EAAe,YAAiC,QAAM","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as HoverCardPrimitive from '@radix-ui/react-hover-card';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCard\n * -------------------------------------------------------------------------- */\n\ntype HoverCardProps = React.ComponentProps<typeof HoverCardPrimitive.Root>;\nconst HoverCard = HoverCardPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCardTrigger\n * -------------------------------------------------------------------------- */\n\ntype HoverCardTriggerProps = React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Trigger>;\nconst HoverCardTrigger = HoverCardPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCardContent\n * -------------------------------------------------------------------------- */\n\ntype HoverCardContentElement = React.ElementRef<typeof HoverCardPrimitive.Content>;\ntype HoverCardContentProps = React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>;\n\nconst HoverCardContent = React.forwardRef<HoverCardContentElement, HoverCardContentProps>(\n ({ className, align = 'center', sideOffset = 6, ...props }, ref) => (\n <HoverCardPrimitive.Portal>\n <HoverCardPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 z-50 min-w-32 rounded-md border p-4 shadow-md',\n className,\n )}\n {...props}\n />\n </HoverCardPrimitive.Portal>\n ),\n);\n\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCardArrow\n * -------------------------------------------------------------------------- */\n\ntype HoverCardArrowElement = React.ElementRef<typeof HoverCardPrimitive.Arrow>;\ntype HoverCardArrowProps = React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Arrow>;\n\nconst HoverCardArrow = React.forwardRef<HoverCardArrowElement, HoverCardArrowProps>(({ className, ...props }, ref) => (\n <HoverCardPrimitive.Arrow ref={ref} className={cn('fill-popover', className)} {...props} />\n));\n\nHoverCardArrow.displayName = HoverCardPrimitive.Arrow.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n HoverCard,\n HoverCardTrigger,\n HoverCardContent,\n HoverCardArrow,\n type HoverCardProps,\n type HoverCardTriggerProps,\n type HoverCardContentProps,\n type HoverCardArrowProps,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/hover-card.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as HoverCardPrimitive from '@radix-ui/react-hover-card';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCard\n * -------------------------------------------------------------------------- */\n\ntype HoverCardProps = React.ComponentProps<typeof HoverCardPrimitive.Root>;\nconst HoverCard = HoverCardPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCardTrigger\n * -------------------------------------------------------------------------- */\n\ntype HoverCardTriggerProps = React.ComponentPropsWithoutRef<\n typeof HoverCardPrimitive.Trigger\n>;\nconst HoverCardTrigger = HoverCardPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCardContent\n * -------------------------------------------------------------------------- */\n\ntype HoverCardContentElement = React.ElementRef<\n typeof HoverCardPrimitive.Content\n>;\ntype HoverCardContentProps = React.ComponentPropsWithoutRef<\n typeof HoverCardPrimitive.Content\n>;\n\nconst HoverCardContent = React.forwardRef<\n HoverCardContentElement,\n HoverCardContentProps\n>(({ className, align = 'center', sideOffset = 6, ...props }, ref) => (\n <HoverCardPrimitive.Portal>\n <HoverCardPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 z-50 min-w-32 rounded-md border p-4 shadow-md',\n className,\n )}\n {...props}\n />\n </HoverCardPrimitive.Portal>\n));\n\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCardArrow\n * -------------------------------------------------------------------------- */\n\ntype HoverCardArrowElement = React.ElementRef<typeof HoverCardPrimitive.Arrow>;\ntype HoverCardArrowProps = React.ComponentPropsWithoutRef<\n typeof HoverCardPrimitive.Arrow\n>;\n\nconst HoverCardArrow = React.forwardRef<\n HoverCardArrowElement,\n HoverCardArrowProps\n>(({ className, ...props }, ref) => (\n <HoverCardPrimitive.Arrow\n ref={ref}\n className={cn('fill-popover', className)}\n {...props}\n />\n));\n\nHoverCardArrow.displayName = HoverCardPrimitive.Arrow.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n HoverCard,\n HoverCardTrigger,\n HoverCardContent,\n HoverCardArrow,\n type HoverCardProps,\n type HoverCardTriggerProps,\n type HoverCardContentProps,\n type HoverCardArrowProps,\n};\n"],"mappings":"uDAEA,UAAYA,MAAW,QACvB,UAAYC,MAAwB,6BAmChC,cAAAC,MAAA,oBA3BJ,IAAMC,EAA+B,OAS/BC,EAAsC,UAatCC,EAAyB,aAG7B,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAQ,SAAU,WAAAC,EAAa,EAAG,GAAGC,CAAM,EAAGC,IAC5DR,EAAoB,SAAnB,CACC,SAAAA,EAAoB,UAAnB,CACC,IAAKQ,EACL,MAAOH,EACP,WAAYC,EACZ,UAAWG,EACT,gtBACAL,CACF,EACC,GAAGG,EACN,EACF,CACD,EAEDJ,EAAiB,YAAiC,UAAQ,YAW1D,IAAMO,EAAuB,aAG3B,CAAC,CAAE,UAAAN,EAAW,GAAGG,CAAM,EAAGC,IAC1BR,EAAoB,QAAnB,CACC,IAAKQ,EACL,UAAWC,EAAG,eAAgBL,CAAS,EACtC,GAAGG,EACN,CACD,EAEDG,EAAe,YAAiC,QAAM","names":["React","HoverCardPrimitive","jsx","HoverCard","HoverCardTrigger","HoverCardContent","className","align","sideOffset","props","ref","cn","HoverCardArrow"]}
1
+ {"version":3,"sources":["../../src/react/hover-card.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as HoverCardPrimitive from '@radix-ui/react-hover-card';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCard\n * -------------------------------------------------------------------------- */\n\ntype HoverCardProps = React.ComponentProps<typeof HoverCardPrimitive.Root>;\nconst HoverCard = HoverCardPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCardTrigger\n * -------------------------------------------------------------------------- */\n\ntype HoverCardTriggerProps = React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Trigger>;\nconst HoverCardTrigger = HoverCardPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCardContent\n * -------------------------------------------------------------------------- */\n\ntype HoverCardContentElement = React.ElementRef<typeof HoverCardPrimitive.Content>;\ntype HoverCardContentProps = React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>;\n\nconst HoverCardContent = React.forwardRef<HoverCardContentElement, HoverCardContentProps>(\n ({ className, align = 'center', sideOffset = 6, ...props }, ref) => (\n <HoverCardPrimitive.Portal>\n <HoverCardPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 z-50 min-w-32 rounded-md border p-4 shadow-md',\n className,\n )}\n {...props}\n />\n </HoverCardPrimitive.Portal>\n ),\n);\n\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: HoverCardArrow\n * -------------------------------------------------------------------------- */\n\ntype HoverCardArrowElement = React.ElementRef<typeof HoverCardPrimitive.Arrow>;\ntype HoverCardArrowProps = React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Arrow>;\n\nconst HoverCardArrow = React.forwardRef<HoverCardArrowElement, HoverCardArrowProps>(({ className, ...props }, ref) => (\n <HoverCardPrimitive.Arrow ref={ref} className={cn('fill-popover', className)} {...props} />\n));\n\nHoverCardArrow.displayName = HoverCardPrimitive.Arrow.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n HoverCard,\n HoverCardTrigger,\n HoverCardContent,\n HoverCardArrow,\n type HoverCardProps,\n type HoverCardTriggerProps,\n type HoverCardContentProps,\n type HoverCardArrowProps,\n};\n"],"mappings":"uDAEA,UAAYA,MAAW,QACvB,UAAYC,MAAwB,6BA2B9B,cAAAC,MAAA,oBAnBN,IAAMC,EAA+B,OAO/BC,EAAsC,UAStCC,EAAyB,aAC7B,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAQ,SAAU,WAAAC,EAAa,EAAG,GAAGC,CAAM,EAAGC,IAC1DR,EAAoB,SAAnB,CACC,SAAAA,EAAoB,UAAnB,CACC,IAAKQ,EACL,MAAOH,EACP,WAAYC,EACZ,UAAWG,EACT,gtBACAL,CACF,EACC,GAAGG,EACN,EACF,CAEJ,EAEAJ,EAAiB,YAAiC,UAAQ,YAS1D,IAAMO,EAAuB,aAAuD,CAAC,CAAE,UAAAN,EAAW,GAAGG,CAAM,EAAGC,IAC5GR,EAAoB,QAAnB,CAAyB,IAAKQ,EAAK,UAAWC,EAAG,eAAgBL,CAAS,EAAI,GAAGG,EAAO,CAC1F,EAEDG,EAAe,YAAiC,QAAM","names":["React","HoverCardPrimitive","jsx","HoverCard","HoverCardTrigger","HoverCardContent","className","align","sideOffset","props","ref","cn","HoverCardArrow"]}