@codefast/ui 0.1.12 → 0.1.14

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 (287) hide show
  1. package/dist/chunk-5JGCIAX3.cjs +2 -0
  2. package/dist/chunk-5JGCIAX3.cjs.map +1 -0
  3. package/dist/chunk-AH3OBTDO.cjs +2 -0
  4. package/dist/chunk-AH3OBTDO.cjs.map +1 -0
  5. package/dist/chunk-CIMAEJ26.js +2 -0
  6. package/dist/chunk-CIMAEJ26.js.map +1 -0
  7. package/dist/chunk-EWFBUJ5V.cjs +2 -0
  8. package/dist/chunk-EWFBUJ5V.cjs.map +1 -0
  9. package/dist/chunk-FIU6XBX4.js +2 -0
  10. package/dist/chunk-FIU6XBX4.js.map +1 -0
  11. package/dist/chunk-FPCACNPX.cjs +2 -0
  12. package/dist/chunk-FPCACNPX.cjs.map +1 -0
  13. package/dist/chunk-K4DIHWHX.js +2 -0
  14. package/dist/chunk-K4DIHWHX.js.map +1 -0
  15. package/dist/chunk-LSBI35ZE.cjs +2 -0
  16. package/dist/chunk-LSBI35ZE.cjs.map +1 -0
  17. package/dist/chunk-O4CKTS5M.cjs +2 -0
  18. package/dist/chunk-O4CKTS5M.cjs.map +1 -0
  19. package/dist/chunk-O5EAJQGO.js +2 -0
  20. package/dist/chunk-O5EAJQGO.js.map +1 -0
  21. package/dist/chunk-ONMU2LFX.js +2 -0
  22. package/dist/chunk-ONMU2LFX.js.map +1 -0
  23. package/dist/chunk-SL4DH4JN.cjs +2 -0
  24. package/dist/chunk-SL4DH4JN.cjs.map +1 -0
  25. package/dist/chunk-SP6TA64U.js +2 -0
  26. package/dist/chunk-SP6TA64U.js.map +1 -0
  27. package/dist/chunk-V2GDHPHA.js +2 -0
  28. package/dist/chunk-V2GDHPHA.js.map +1 -0
  29. package/dist/chunk-YGPIWXWP.js +2 -0
  30. package/dist/chunk-YGPIWXWP.js.map +1 -0
  31. package/dist/chunk-YGWCQ264.cjs +2 -0
  32. package/dist/chunk-YGWCQ264.cjs.map +1 -0
  33. package/dist/components/accordion.cjs +1 -1
  34. package/dist/components/accordion.cjs.map +1 -1
  35. package/dist/components/accordion.js +1 -1
  36. package/dist/components/accordion.js.map +1 -1
  37. package/dist/components/alert-dialog.cjs +1 -1
  38. package/dist/components/alert-dialog.cjs.map +1 -1
  39. package/dist/components/alert-dialog.d.cts +1 -1
  40. package/dist/components/alert-dialog.d.ts +1 -1
  41. package/dist/components/alert-dialog.js +1 -1
  42. package/dist/components/alert-dialog.js.map +1 -1
  43. package/dist/components/badge.cjs +1 -1
  44. package/dist/components/badge.cjs.map +1 -1
  45. package/dist/components/badge.d.cts +98 -4
  46. package/dist/components/badge.d.ts +98 -4
  47. package/dist/components/badge.js +1 -1
  48. package/dist/components/badge.js.map +1 -1
  49. package/dist/components/breadcrumb.cjs +1 -1
  50. package/dist/components/breadcrumb.cjs.map +1 -1
  51. package/dist/components/breadcrumb.d.cts +1 -1
  52. package/dist/components/breadcrumb.d.ts +1 -1
  53. package/dist/components/breadcrumb.js +1 -1
  54. package/dist/components/breadcrumb.js.map +1 -1
  55. package/dist/components/button.cjs +1 -1
  56. package/dist/components/button.cjs.map +1 -1
  57. package/dist/components/button.d.cts +8 -176
  58. package/dist/components/button.d.ts +8 -176
  59. package/dist/components/button.js +1 -1
  60. package/dist/components/calendar.cjs +1 -1
  61. package/dist/components/calendar.cjs.map +1 -1
  62. package/dist/components/calendar.js +1 -1
  63. package/dist/components/calendar.js.map +1 -1
  64. package/dist/components/card.cjs +1 -1
  65. package/dist/components/card.cjs.map +1 -1
  66. package/dist/components/card.js +1 -1
  67. package/dist/components/card.js.map +1 -1
  68. package/dist/components/carousel.cjs +1 -1
  69. package/dist/components/carousel.cjs.map +1 -1
  70. package/dist/components/carousel.d.cts +7 -1
  71. package/dist/components/carousel.d.ts +7 -1
  72. package/dist/components/carousel.js +1 -1
  73. package/dist/components/carousel.js.map +1 -1
  74. package/dist/components/checkbox-cards.cjs +1 -1
  75. package/dist/components/checkbox-cards.cjs.map +1 -1
  76. package/dist/components/checkbox-cards.js +1 -1
  77. package/dist/components/checkbox-cards.js.map +1 -1
  78. package/dist/components/checkbox-group.cjs +1 -1
  79. package/dist/components/checkbox-group.cjs.map +1 -1
  80. package/dist/components/checkbox-group.js +1 -1
  81. package/dist/components/checkbox-group.js.map +1 -1
  82. package/dist/components/checkbox.cjs +1 -1
  83. package/dist/components/checkbox.cjs.map +1 -1
  84. package/dist/components/checkbox.js +1 -1
  85. package/dist/components/checkbox.js.map +1 -1
  86. package/dist/components/collapsible.cjs +1 -1
  87. package/dist/components/collapsible.cjs.map +1 -1
  88. package/dist/components/collapsible.js +1 -1
  89. package/dist/components/collapsible.js.map +1 -1
  90. package/dist/components/command.cjs +1 -1
  91. package/dist/components/command.cjs.map +1 -1
  92. package/dist/components/command.d.cts +9 -9
  93. package/dist/components/command.d.ts +9 -9
  94. package/dist/components/command.js +1 -1
  95. package/dist/components/command.js.map +1 -1
  96. package/dist/components/context-menu.cjs +1 -1
  97. package/dist/components/context-menu.cjs.map +1 -1
  98. package/dist/components/context-menu.js +1 -1
  99. package/dist/components/context-menu.js.map +1 -1
  100. package/dist/components/data-table.cjs +1 -1
  101. package/dist/components/data-table.cjs.map +1 -1
  102. package/dist/components/data-table.js +1 -1
  103. package/dist/components/data-table.js.map +1 -1
  104. package/dist/components/dialog.cjs +1 -1
  105. package/dist/components/dialog.cjs.map +1 -1
  106. package/dist/components/dialog.d.cts +1 -1
  107. package/dist/components/dialog.d.ts +1 -1
  108. package/dist/components/dialog.js +1 -1
  109. package/dist/components/drawer.cjs +1 -1
  110. package/dist/components/drawer.cjs.map +1 -1
  111. package/dist/components/drawer.d.cts +2 -4
  112. package/dist/components/drawer.d.ts +2 -4
  113. package/dist/components/drawer.js +1 -1
  114. package/dist/components/drawer.js.map +1 -1
  115. package/dist/components/dropdown-menu.cjs +1 -1
  116. package/dist/components/dropdown-menu.cjs.map +1 -1
  117. package/dist/components/dropdown-menu.d.cts +3 -1
  118. package/dist/components/dropdown-menu.d.ts +3 -1
  119. package/dist/components/dropdown-menu.js +1 -1
  120. package/dist/components/form.cjs +1 -1
  121. package/dist/components/form.cjs.map +1 -1
  122. package/dist/components/form.js +1 -1
  123. package/dist/components/form.js.map +1 -1
  124. package/dist/components/hover-card.cjs +1 -1
  125. package/dist/components/hover-card.cjs.map +1 -1
  126. package/dist/components/hover-card.js +1 -1
  127. package/dist/components/hover-card.js.map +1 -1
  128. package/dist/components/menubar.cjs +1 -1
  129. package/dist/components/menubar.cjs.map +1 -1
  130. package/dist/components/menubar.d.cts +3 -1
  131. package/dist/components/menubar.d.ts +3 -1
  132. package/dist/components/menubar.js +1 -1
  133. package/dist/components/menubar.js.map +1 -1
  134. package/dist/components/navigation-menu.cjs +1 -1
  135. package/dist/components/navigation-menu.cjs.map +1 -1
  136. package/dist/components/navigation-menu.d.cts +1 -4
  137. package/dist/components/navigation-menu.d.ts +1 -4
  138. package/dist/components/navigation-menu.js +1 -1
  139. package/dist/components/navigation-menu.js.map +1 -1
  140. package/dist/components/number-input.cjs +1 -1
  141. package/dist/components/number-input.cjs.map +1 -1
  142. package/dist/components/number-input.d.cts +1 -2
  143. package/dist/components/number-input.d.ts +1 -2
  144. package/dist/components/number-input.js +1 -1
  145. package/dist/components/number-input.js.map +1 -1
  146. package/dist/components/pagination.cjs +1 -1
  147. package/dist/components/pagination.cjs.map +1 -1
  148. package/dist/components/pagination.d.cts +1 -1
  149. package/dist/components/pagination.d.ts +1 -1
  150. package/dist/components/pagination.js +1 -1
  151. package/dist/components/pagination.js.map +1 -1
  152. package/dist/components/popover.cjs +1 -1
  153. package/dist/components/popover.cjs.map +1 -1
  154. package/dist/components/popover.js +1 -1
  155. package/dist/components/popover.js.map +1 -1
  156. package/dist/components/radio-cards.cjs +1 -1
  157. package/dist/components/radio-cards.cjs.map +1 -1
  158. package/dist/components/radio-cards.js +1 -1
  159. package/dist/components/radio-cards.js.map +1 -1
  160. package/dist/components/radio-group.cjs.map +1 -1
  161. package/dist/components/radio-group.js.map +1 -1
  162. package/dist/components/radio.cjs.map +1 -1
  163. package/dist/components/radio.js.map +1 -1
  164. package/dist/components/scroll-area.cjs +1 -1
  165. package/dist/components/scroll-area.cjs.map +1 -1
  166. package/dist/components/scroll-area.d.cts +24 -24
  167. package/dist/components/scroll-area.d.ts +24 -24
  168. package/dist/components/scroll-area.js +1 -1
  169. package/dist/components/scroll-area.js.map +1 -1
  170. package/dist/components/select.cjs +1 -1
  171. package/dist/components/select.cjs.map +1 -1
  172. package/dist/components/select.d.cts +7 -2
  173. package/dist/components/select.d.ts +7 -2
  174. package/dist/components/select.js +1 -1
  175. package/dist/components/separator.cjs +1 -1
  176. package/dist/components/separator.cjs.map +1 -1
  177. package/dist/components/separator.d.cts +2 -2
  178. package/dist/components/separator.d.ts +2 -2
  179. package/dist/components/separator.js +1 -1
  180. package/dist/components/separator.js.map +1 -1
  181. package/dist/components/sheet.cjs +1 -1
  182. package/dist/components/sheet.cjs.map +1 -1
  183. package/dist/components/sheet.d.cts +35 -35
  184. package/dist/components/sheet.d.ts +35 -35
  185. package/dist/components/sheet.js +1 -1
  186. package/dist/components/sheet.js.map +1 -1
  187. package/dist/components/skeleton.cjs +1 -1
  188. package/dist/components/skeleton.cjs.map +1 -1
  189. package/dist/components/skeleton.js +1 -1
  190. package/dist/components/skeleton.js.map +1 -1
  191. package/dist/components/slider.cjs +1 -1
  192. package/dist/components/slider.cjs.map +1 -1
  193. package/dist/components/slider.js +1 -1
  194. package/dist/components/slider.js.map +1 -1
  195. package/dist/components/spinner.cjs +1 -1
  196. package/dist/components/spinner.d.cts +2 -3
  197. package/dist/components/spinner.d.ts +2 -3
  198. package/dist/components/spinner.js +1 -1
  199. package/dist/components/switch.cjs +1 -1
  200. package/dist/components/switch.cjs.map +1 -1
  201. package/dist/components/switch.js +1 -1
  202. package/dist/components/switch.js.map +1 -1
  203. package/dist/components/table.cjs +1 -1
  204. package/dist/components/table.cjs.map +1 -1
  205. package/dist/components/table.js +1 -1
  206. package/dist/components/table.js.map +1 -1
  207. package/dist/components/tabs.cjs +1 -1
  208. package/dist/components/tabs.cjs.map +1 -1
  209. package/dist/components/tabs.js +1 -1
  210. package/dist/components/tabs.js.map +1 -1
  211. package/dist/components/text-input.cjs +1 -1
  212. package/dist/components/text-input.cjs.map +1 -1
  213. package/dist/components/text-input.d.cts +4 -148
  214. package/dist/components/text-input.d.ts +4 -148
  215. package/dist/components/text-input.js +1 -1
  216. package/dist/components/text-input.js.map +1 -1
  217. package/dist/components/textarea.cjs +1 -1
  218. package/dist/components/textarea.cjs.map +1 -1
  219. package/dist/components/textarea.d.cts +70 -1
  220. package/dist/components/textarea.d.ts +70 -1
  221. package/dist/components/textarea.js +1 -1
  222. package/dist/components/textarea.js.map +1 -1
  223. package/dist/components/toggle-group.cjs +1 -1
  224. package/dist/components/toggle-group.cjs.map +1 -1
  225. package/dist/components/toggle-group.d.cts +6 -4
  226. package/dist/components/toggle-group.d.ts +6 -4
  227. package/dist/components/toggle-group.js +1 -1
  228. package/dist/components/toggle-group.js.map +1 -1
  229. package/dist/components/toggle.cjs +1 -1
  230. package/dist/components/toggle.cjs.map +1 -1
  231. package/dist/components/toggle.d.cts +9 -78
  232. package/dist/components/toggle.d.ts +9 -78
  233. package/dist/components/toggle.js +1 -1
  234. package/dist/components/toggle.js.map +1 -1
  235. package/dist/components/tooltip.cjs +1 -1
  236. package/dist/components/tooltip.cjs.map +1 -1
  237. package/dist/components/tooltip.js +1 -1
  238. package/dist/components/tooltip.js.map +1 -1
  239. package/dist/styles/button-variants.cjs +2 -0
  240. package/dist/styles/button-variants.cjs.map +1 -0
  241. package/dist/styles/button-variants.d.cts +169 -0
  242. package/dist/styles/button-variants.d.ts +169 -0
  243. package/dist/styles/button-variants.js +2 -0
  244. package/dist/styles/button-variants.js.map +1 -0
  245. package/dist/styles/input-variants.cjs +2 -0
  246. package/dist/styles/input-variants.cjs.map +1 -0
  247. package/dist/styles/input-variants.d.cts +206 -0
  248. package/dist/styles/input-variants.d.ts +206 -0
  249. package/dist/styles/input-variants.js +2 -0
  250. package/dist/styles/input-variants.js.map +1 -0
  251. package/dist/styles/toggle-variants.cjs +2 -0
  252. package/dist/styles/toggle-variants.cjs.map +1 -0
  253. package/dist/styles/toggle-variants.d.cts +162 -0
  254. package/dist/styles/toggle-variants.d.ts +162 -0
  255. package/dist/styles/toggle-variants.js +2 -0
  256. package/dist/styles/toggle-variants.js.map +1 -0
  257. package/dist/styles.css +1 -1
  258. package/dist/styles.css.map +1 -1
  259. package/package.json +27 -15
  260. package/dist/chunk-3JEWSESW.js +0 -2
  261. package/dist/chunk-3JEWSESW.js.map +0 -1
  262. package/dist/chunk-45RTVSFM.cjs +0 -2
  263. package/dist/chunk-45RTVSFM.cjs.map +0 -1
  264. package/dist/chunk-5KZCIWAV.js +0 -2
  265. package/dist/chunk-5KZCIWAV.js.map +0 -1
  266. package/dist/chunk-5ZAKR3XH.cjs +0 -2
  267. package/dist/chunk-5ZAKR3XH.cjs.map +0 -1
  268. package/dist/chunk-6ZQPOY3K.js +0 -2
  269. package/dist/chunk-6ZQPOY3K.js.map +0 -1
  270. package/dist/chunk-7RRBAIQ7.cjs +0 -2
  271. package/dist/chunk-7RRBAIQ7.cjs.map +0 -1
  272. package/dist/chunk-BRPTDZJD.cjs +0 -2
  273. package/dist/chunk-BRPTDZJD.cjs.map +0 -1
  274. package/dist/chunk-EJGO273X.cjs +0 -2
  275. package/dist/chunk-EJGO273X.cjs.map +0 -1
  276. package/dist/chunk-MTBVDSX3.cjs +0 -2
  277. package/dist/chunk-MTBVDSX3.cjs.map +0 -1
  278. package/dist/chunk-OR7UIMKG.js +0 -2
  279. package/dist/chunk-OR7UIMKG.js.map +0 -1
  280. package/dist/chunk-P5HEZNFY.js +0 -2
  281. package/dist/chunk-P5HEZNFY.js.map +0 -1
  282. package/dist/chunk-U2N42HZL.js +0 -2
  283. package/dist/chunk-U2N42HZL.js.map +0 -1
  284. package/dist/chunk-UBXOV4I5.cjs +0 -2
  285. package/dist/chunk-UBXOV4I5.cjs.map +0 -1
  286. package/dist/chunk-Y3KLZDCA.js +0 -2
  287. package/dist/chunk-Y3KLZDCA.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkMTBVDSX3cjs = require('../chunk-MTBVDSX3.cjs');var _chunkEJGO273Xcjs = require('../chunk-EJGO273X.cjs');var _chunk7RRBAIQ7cjs = require('../chunk-7RRBAIQ7.cjs');require('../chunk-5ZAKR3XH.cjs');var _chunk4XRBMJ5Qcjs = require('../chunk-4XRBMJ5Q.cjs');var _reacticons = require('@radix-ui/react-icons');var _jsxruntime = require('react/jsx-runtime');function L({table:a}){return _jsxruntime.jsxs.call(void 0, _chunkEJGO273Xcjs.a,{children:[_jsxruntime.jsxs.call(void 0, _chunkEJGO273Xcjs.b,{className:_chunk7RRBAIQ7cjs.a.call(void 0, {className:"hidden h-8 lg:flex",size:"sm",variant:"outline"}),children:[_jsxruntime.jsx.call(void 0, _reacticons.MixerHorizontalIcon,{className:"size-4"}),"View"]}),_jsxruntime.jsxs.call(void 0, _chunkEJGO273Xcjs.h,{align:"end",className:"w-36",children:[_jsxruntime.jsx.call(void 0, _chunkEJGO273Xcjs.l,{children:"Toggle columns"}),_jsxruntime.jsx.call(void 0, _chunkEJGO273Xcjs.m,{}),a.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>_jsxruntime.jsx.call(void 0, _chunkEJGO273Xcjs.j,{checked:n.getIsVisible(),className:"capitalize",onCheckedChange:o=>{n.toggleVisibility(!!o)},children:n.id},n.id))]})]})}function B({table:a,className:n,...o}){return _jsxruntime.jsxs.call(void 0, "div",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "flex items-center justify-between px-2",n),...o,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, _chunkMTBVDSX3cjs.a,{value:String(a.getState().pagination.pageSize),onValueChange:i=>{a.setPageSize(Number(i))},children:[_jsxruntime.jsx.call(void 0, _chunkMTBVDSX3cjs.d,{className:"w-18 h-8",children:_jsxruntime.jsx.call(void 0, _chunkMTBVDSX3cjs.c,{placeholder:a.getState().pagination.pageSize})}),_jsxruntime.jsx.call(void 0, _chunkMTBVDSX3cjs.g,{side:"top",children:[10,20,30,40,50].map(i=>_jsxruntime.jsx.call(void 0, _chunkMTBVDSX3cjs.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, _chunk7RRBAIQ7cjs.b,{className:"hidden lg:flex",disabled:!a.getCanPreviousPage(),size:"icon-xs",variant:"outline",onClick:()=>{a.setPageIndex(0)},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, _chunk7RRBAIQ7cjs.b,{disabled:!a.getCanPreviousPage(),size:"icon-xs",variant:"outline",onClick:()=>{a.previousPage()},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, _chunk7RRBAIQ7cjs.b,{disabled:!a.getCanNextPage(),size:"icon-xs",variant:"outline",onClick:()=>{a.nextPage()},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, _chunk7RRBAIQ7cjs.b,{className:"hidden lg:flex",disabled:!a.getCanNextPage(),size:"icon-xs",variant:"outline",onClick:()=>{a.setPageIndex(a.getPageCount()-1)},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 E({column:a,title:n,className:o}){return a.getCanSort()?_jsxruntime.jsx.call(void 0, "div",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "flex items-center space-x-2",o),children:_jsxruntime.jsxs.call(void 0, _chunkEJGO273Xcjs.a,{children:[_jsxruntime.jsx.call(void 0, _chunkEJGO273Xcjs.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, _chunk7RRBAIQ7cjs.b,{className:"data-[state=open]:bg-accent -ml-3",size:"xs",variant:"ghost",children:[_jsxruntime.jsx.call(void 0, "span",{children:n}),_jsxruntime.jsx.call(void 0, R,{sorted:a.getIsSorted()})]})}),_jsxruntime.jsxs.call(void 0, _chunkEJGO273Xcjs.h,{align:"start",children:[_jsxruntime.jsxs.call(void 0, _chunkEJGO273Xcjs.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, _chunkEJGO273Xcjs.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, _chunkEJGO273Xcjs.m,{}),_jsxruntime.jsxs.call(void 0, _chunkEJGO273Xcjs.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:o,children:n})}function R({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 = E; exports.DataTablePagination = B; exports.DataTableViewOptions = L;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkEWFBUJ5Vcjs = require('../chunk-EWFBUJ5V.cjs');var _chunkFPCACNPXcjs = require('../chunk-FPCACNPX.cjs');var _chunkYGWCQ264cjs = require('../chunk-YGWCQ264.cjs');require('../chunk-SL4DH4JN.cjs');var _chunkLSBI35ZEcjs = require('../chunk-LSBI35ZE.cjs');var _chunk4XRBMJ5Qcjs = require('../chunk-4XRBMJ5Q.cjs');var _reacticons = require('@radix-ui/react-icons');var _jsxruntime = require('react/jsx-runtime');function B({table:a}){return _jsxruntime.jsxs.call(void 0, _chunkFPCACNPXcjs.a,{children:[_jsxruntime.jsxs.call(void 0, _chunkFPCACNPXcjs.b,{className:_chunkLSBI35ZEcjs.a.call(void 0, {size:"xs",variant:"outline"}),children:[_jsxruntime.jsx.call(void 0, _reacticons.MixerHorizontalIcon,{className:"size-4"}),"View"]}),_jsxruntime.jsxs.call(void 0, _chunkFPCACNPXcjs.h,{align:"end",className:"w-36",children:[_jsxruntime.jsx.call(void 0, _chunkFPCACNPXcjs.l,{children:"Toggle columns"}),_jsxruntime.jsx.call(void 0, _chunkFPCACNPXcjs.m,{}),a.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>_jsxruntime.jsx.call(void 0, _chunkFPCACNPXcjs.j,{checked:n.getIsVisible(),className:"capitalize",onCheckedChange:o=>{n.toggleVisibility(!!o)},children:n.id},n.id))]})]})}function E({table:a,className:n,...o}){return _jsxruntime.jsxs.call(void 0, "div",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "flex flex-wrap items-center justify-between gap-4 px-2",n),...o,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"text-muted-foreground min-w-max 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 grow flex-wrap items-center justify-between gap-4 md:justify-end md:gap-x-6 lg:gap-x-8",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-wrap items-center gap-x-2 gap-y-4",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-sm font-medium",children:"Rows per page"}),_jsxruntime.jsxs.call(void 0, _chunkEWFBUJ5Vcjs.a,{value:String(a.getState().pagination.pageSize),onValueChange:i=>{a.setPageSize(Number(i))},children:[_jsxruntime.jsx.call(void 0, _chunkEWFBUJ5Vcjs.d,{className:"w-18 h-8",children:_jsxruntime.jsx.call(void 0, _chunkEWFBUJ5Vcjs.c,{placeholder:a.getState().pagination.pageSize})}),_jsxruntime.jsx.call(void 0, _chunkEWFBUJ5Vcjs.g,{side:"top",children:[10,20,30,40,50].map(i=>_jsxruntime.jsx.call(void 0, _chunkEWFBUJ5Vcjs.i,{value:String(i),children:i},i))})]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-wrap 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 flex-wrap items-center gap-x-2 gap-y-4",children:[_jsxruntime.jsxs.call(void 0, _chunkYGWCQ264cjs.a,{icon:!0,className:"max-md:hidden",disabled:!a.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{a.setPageIndex(0)},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, _chunkYGWCQ264cjs.a,{icon:!0,disabled:!a.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{a.previousPage()},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, _chunkYGWCQ264cjs.a,{icon:!0,disabled:!a.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{a.nextPage()},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, _chunkYGWCQ264cjs.a,{icon:!0,className:"max-md:hidden",disabled:!a.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{a.setPageIndex(a.getPageCount()-1)},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 G({column:a,title:n,className:o}){return a.getCanSort()?_jsxruntime.jsx.call(void 0, "div",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "flex flex-wrap items-center gap-x-2 gap-y-4",o),children:_jsxruntime.jsxs.call(void 0, _chunkFPCACNPXcjs.a,{children:[_jsxruntime.jsx.call(void 0, _chunkFPCACNPXcjs.b,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _chunkYGWCQ264cjs.a,{className:"data-[state=open]:bg-accent",size:"xs",suffix:_jsxruntime.jsx.call(void 0, R,{sorted:a.getIsSorted()}),variant:"ghost",children:n})}),_jsxruntime.jsxs.call(void 0, _chunkFPCACNPXcjs.h,{align:"start",children:[_jsxruntime.jsxs.call(void 0, _chunkFPCACNPXcjs.i,{onClick:()=>{a.toggleSorting(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ChevronUpIcon,{className:"text-muted-foreground"}),"Asc"]}),_jsxruntime.jsxs.call(void 0, _chunkFPCACNPXcjs.i,{onClick:()=>{a.toggleSorting(!0)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ArrowDownIcon,{className:"text-muted-foreground"}),"Desc"]}),_jsxruntime.jsx.call(void 0, _chunkFPCACNPXcjs.m,{}),_jsxruntime.jsxs.call(void 0, _chunkFPCACNPXcjs.i,{onClick:()=>{a.toggleVisibility(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.EyeNoneIcon,{className:"text-muted-foreground"}),"Hide"]})]})]})}):_jsxruntime.jsx.call(void 0, "div",{className:o,children:n})}function R({sorted:a}){switch(a){case"desc":return _jsxruntime.jsx.call(void 0, _reacticons.ArrowDownIcon,{});case"asc":return _jsxruntime.jsx.call(void 0, _reacticons.ChevronUpIcon,{});default:return _jsxruntime.jsx.call(void 0, _reacticons.CaretSortIcon,{})}}exports.DataTableColumnHeader = G; exports.DataTablePagination = E; exports.DataTableViewOptions = B;
2
2
  //# sourceMappingURL=data-table.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/components/data-table.cjs","../../src/components/data-table.tsx"],"names":["DataTableViewOptions","table","jsxs","DropdownMenu","DropdownMenuTrigger","buttonVariants","jsx","MixerHorizontalIcon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","column","DropdownMenuCheckboxItem","value","DataTablePagination","className","props","cn","Select","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","Button","DoubleArrowLeftIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowRightIcon","DataTableColumnHeader","title","SortIcon","DropdownMenuItem","ArrowUpIcon","ArrowDownIcon","EyeNoneIcon","sorted","CaretSortIcon"],"mappings":"AAAA,qFAAY,CAAC,yDAA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A,uBAAC6B,CAAA,CAAY,SAAA,CAAU,wCAAA,CAAyC,CAAA,CAAE,MAAA,CAAA,CAEpE,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAxCO7B,6BAAAA,KAAC,CAAA,CAAI,SAAA,CAAWS,CAAAA,CAAY,QAAA,CAAAe,CAAAA,CAAM,CA0C7C,CAEA,SAASC,CAAAA,CAAS,CAAE,MAAA,CAAAK,CAAO,CAAA,CAAoE,CAC7F,MAAA,CAAQA,CAAAA,CAAQ,CACd,IAAK,MAAA,CACH,OAAO9B,6BAAAA,yBAAC4B,CAAA,CAAc,SAAA,CAAU,aAAA,CAAc,CAAA,CAGhD,IAAK,KAAA,CACH,OAAO5B,6BAAAA,uBAAC2B,CAAA,CAAY,SAAA,CAAU,aAAA,CAAc,CAAA,CAG9C,OAAA,CACE,OAAO3B,6BAAAA,yBAAC+B,CAAA,CAAc,SAAA,CAAU,aAAA,CAAc,CAClD,CACF,CAAA,qGAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/components/data-table.cjs","sourcesContent":[null,"'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 type * as ReactTable from '@tanstack/react-table';\nimport { cn } from '@/lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/dropdown-menu';\nimport { Button, buttonVariants } from '@/components/button';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/select';\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\n className={buttonVariants({ className: 'hidden h-8 lg:flex', size: 'sm', variant: 'outline' })}\n >\n <MixerHorizontalIcon className=\"size-4\" />\n View\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 checked={column.getIsVisible()}\n className=\"capitalize\"\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 className=\"hidden lg:flex\"\n disabled={!table.getCanPreviousPage()}\n size=\"icon-xs\"\n variant=\"outline\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n disabled={!table.getCanPreviousPage()}\n size=\"icon-xs\"\n variant=\"outline\"\n onClick={() => {\n table.previousPage();\n }}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n disabled={!table.getCanNextPage()}\n size=\"icon-xs\"\n variant=\"outline\"\n onClick={() => {\n table.nextPage();\n }}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n className=\"hidden lg:flex\"\n disabled={!table.getCanNextPage()}\n size=\"icon-xs\"\n variant=\"outline\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\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 className=\"data-[state=open]:bg-accent -ml-3\" size=\"xs\" variant=\"ghost\">\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\n case 'asc': {\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n }\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
+ {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/components/data-table.cjs","../../src/components/data-table.tsx"],"names":["DataTableViewOptions","table","jsxs","DropdownMenu","DropdownMenuTrigger","buttonVariants","jsx","MixerHorizontalIcon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","column","DropdownMenuCheckboxItem","value","DataTablePagination","className","props","cn","Select","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","Button","DoubleArrowLeftIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowRightIcon","DataTableColumnHeader","title","SortIcon","DropdownMenuItem","ChevronUpIcon","ArrowDownIcon","EyeNoneIcon","sorted","CaretSortIcon"],"mappings":"AAAA,qFAAY,CAAC,yDAAqE,yDAAoF,yDAA0C,iCAA8B,yDAA0C,yDAA0C,mDCa3T,+CA2BD,SAHGA,CAAAA,CAA4B,CAAE,KAAA,CAAAC,CAAM,CAAA,CAAwD,CACnG,OACEC,8BAAAA,mBAACC,CAAA,CACC,QAAA,CAAA,CAAAD,8BAAAA,mBAACE,CAAA,CAAoB,SAAA,CAAWC,iCAAAA,CAAiB,IAAA,CAAM,IAAA,CAAM,OAAA,CAAS,SAAU,CAAC,CAAA,CAC/E,QAAA,CAAA,CAAAC,6BAAAA,+BAACC,CAAA,CAAoB,SAAA,CAAU,QAAA,CAAS,CAAA,CAAE,MAAA,CAAA,CAE5C,CAAA,CACAL,8BAAAA,mBAACM,CAAA,CAAoB,KAAA,CAAM,KAAA,CAAM,SAAA,CAAU,MAAA,CACzC,QAAA,CAAA,CAAAF,6BAAAA,mBAACG,CAAA,CAAkB,QAAA,CAAA,gBAAA,CAAc,CAAA,CACjCH,6BAAAA,mBAACI,CAAA,CAAA,CAAsB,CAAA,CACtBT,CAAAA,CACE,aAAA,CAAc,CAAA,CACd,MAAA,CAAQU,CAAAA,EAAW,OAAOA,CAAAA,CAAO,UAAA,CAAe,GAAA,EAAeA,CAAAA,CAAO,UAAA,CAAW,CAAC,CAAA,CAClF,GAAA,CAAKA,CAAAA,EACJL,6BAAAA,mBAACM,CAAA,CAEC,OAAA,CAASD,CAAAA,CAAO,YAAA,CAAa,CAAA,CAC7B,SAAA,CAAU,YAAA,CACV,eAAA,CAAkBE,CAAAA,EAAU,CAC1BF,CAAAA,CAAO,gBAAA,CAAiB,CAAA,CAAQE,CAAM,CACxC,CAAA,CAEC,QAAA,CAAAF,CAAAA,CAAO,EAAA,CAAA,CAPHA,CAAAA,CAAO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AAA,CACA5B,6BAAAA,mBAACI,CAAA,CAAA,CAAsB,CAAA,CACvBR,8BAAAA,mBAAC8B,CAAA,CACC,OAAA,CAAS,CAAA,CAAA,EAAM,CACbrB,CAAAA,CAAO,gBAAA,CAAiB,CAAA,CAAK,CAC/B,CAAA,CAEA,QAAA,CAAA,CAAAL,6BAAAA,uBAAC6B,CAAA,CAAY,SAAA,CAAU,uBAAA,CAAwB,CAAA,CAAE,MAAA,CAAA,CAEnD,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CA7CO7B,6BAAAA,KAAC,CAAA,CAAI,SAAA,CAAWS,CAAAA,CAAY,QAAA,CAAAe,CAAAA,CAAM,CA+C7C,CAEA,SAASC,CAAAA,CAAS,CAAE,MAAA,CAAAK,CAAO,CAAA,CAAoE,CAC7F,MAAA,CAAQA,CAAAA,CAAQ,CACd,IAAK,MAAA,CACH,OAAO9B,6BAAAA,yBAAC4B,CAAA,CAAA,CAAc,CAAA,CAGxB,IAAK,KAAA,CACH,OAAO5B,6BAAAA,yBAAC2B,CAAA,CAAA,CAAc,CAAA,CAGxB,OAAA,CACE,OAAO3B,6BAAAA,yBAAC+B,CAAA,CAAA,CAAc,CAC1B,CACF,CAAA,qGAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/components/data-table.cjs","sourcesContent":[null,"'use client';\n\nimport * as React from 'react';\nimport {\n ArrowDownIcon,\n CaretSortIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n ChevronUpIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from '@radix-ui/react-icons';\nimport type * as ReactTable from '@tanstack/react-table';\nimport { cn } from '@/lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/dropdown-menu';\nimport { Button } from '@/components/button';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/select';\nimport { buttonVariants } from '@/styles/button-variants';\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 className={buttonVariants({ size: 'xs', variant: 'outline' })}>\n <MixerHorizontalIcon className=\"size-4\" />\n View\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 <DropdownMenuCheckboxItem\n key={column.id}\n checked={column.getIsVisible()}\n className=\"capitalize\"\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\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 flex-wrap items-center justify-between gap-4 px-2', className)} {...props}>\n <div className=\"text-muted-foreground min-w-max flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n\n <div className=\"flex grow flex-wrap items-center justify-between gap-4 md:justify-end md:gap-x-6 lg:gap-x-8\">\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-4\">\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 flex-wrap items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-4\">\n <Button\n icon\n className=\"max-md:hidden\"\n disabled={!table.getCanPreviousPage()}\n size=\"xs\"\n variant=\"outline\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n icon\n disabled={!table.getCanPreviousPage()}\n size=\"xs\"\n variant=\"outline\"\n onClick={() => {\n table.previousPage();\n }}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n icon\n disabled={!table.getCanNextPage()}\n size=\"xs\"\n variant=\"outline\"\n onClick={() => {\n table.nextPage();\n }}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n icon\n className=\"max-md:hidden\"\n disabled={!table.getCanNextPage()}\n size=\"xs\"\n variant=\"outline\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\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 flex-wrap items-center gap-x-2 gap-y-4', className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n className=\"data-[state=open]:bg-accent\"\n size=\"xs\"\n suffix={<SortIcon sorted={column.getIsSorted()} />}\n variant=\"ghost\"\n >\n {title}\n </Button>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(false);\n }}\n >\n <ChevronUpIcon className=\"text-muted-foreground\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(true);\n }}\n >\n <ArrowDownIcon className=\"text-muted-foreground\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n column.toggleVisibility(false);\n }}\n >\n <EyeNoneIcon className=\"text-muted-foreground\" />\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 />;\n }\n\n case 'asc': {\n return <ChevronUpIcon />;\n }\n\n default:\n return <CaretSortIcon />;\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 f,c as T,d as x,g as w,i as C}from"../chunk-6ZQPOY3K.js";import{a as c,b as d,h as m,i as r,j as u,l as D,m as g}from"../chunk-Y3KLZDCA.js";import{a as p,b as s}from"../chunk-P5HEZNFY.js";import"../chunk-U2N42HZL.js";import{a as l}from"../chunk-VRBUDJBH.js";import{ArrowDownIcon as N,ArrowUpIcon as v,CaretSortIcon as S,ChevronLeftIcon as P,ChevronRightIcon as b,DoubleArrowLeftIcon as M,DoubleArrowRightIcon as I,EyeNoneIcon as h,MixerHorizontalIcon as z}from"@radix-ui/react-icons";import{jsx as e,jsxs as t}from"react/jsx-runtime";function L({table:a}){return t(c,{children:[t(d,{className:p({className:"hidden h-8 lg:flex",size:"sm",variant:"outline"}),children:[e(z,{className:"size-4"}),"View"]}),t(m,{align:"end",className:"w-36",children:[e(D,{children:"Toggle columns"}),e(g,{}),a.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>e(u,{checked:n.getIsVisible(),className:"capitalize",onCheckedChange:o=>{n.toggleVisibility(!!o)},children:n.id},n.id))]})]})}function B({table:a,className:n,...o}){return t("div",{className:l("flex items-center justify-between px-2",n),...o,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(f,{value:String(a.getState().pagination.pageSize),onValueChange:i=>{a.setPageSize(Number(i))},children:[e(x,{className:"w-18 h-8",children:e(T,{placeholder:a.getState().pagination.pageSize})}),e(w,{side:"top",children:[10,20,30,40,50].map(i=>e(C,{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(s,{className:"hidden lg:flex",disabled:!a.getCanPreviousPage(),size:"icon-xs",variant:"outline",onClick:()=>{a.setPageIndex(0)},children:[e("span",{className:"sr-only",children:"Go to first page"}),e(M,{className:"size-4"})]}),t(s,{disabled:!a.getCanPreviousPage(),size:"icon-xs",variant:"outline",onClick:()=>{a.previousPage()},children:[e("span",{className:"sr-only",children:"Go to previous page"}),e(P,{className:"size-4"})]}),t(s,{disabled:!a.getCanNextPage(),size:"icon-xs",variant:"outline",onClick:()=>{a.nextPage()},children:[e("span",{className:"sr-only",children:"Go to next page"}),e(b,{className:"size-4"})]}),t(s,{className:"hidden lg:flex",disabled:!a.getCanNextPage(),size:"icon-xs",variant:"outline",onClick:()=>{a.setPageIndex(a.getPageCount()-1)},children:[e("span",{className:"sr-only",children:"Go to last page"}),e(I,{className:"size-4"})]})]})]})]})}function E({column:a,title:n,className:o}){return a.getCanSort()?e("div",{className:l("flex items-center space-x-2",o),children:t(c,{children:[e(d,{asChild:!0,children:t(s,{className:"data-[state=open]:bg-accent -ml-3",size:"xs",variant:"ghost",children:[e("span",{children:n}),e(R,{sorted:a.getIsSorted()})]})}),t(m,{align:"start",children:[t(r,{onClick:()=>{a.toggleSorting(!1)},children:[e(v,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Asc"]}),t(r,{onClick:()=>{a.toggleSorting(!0)},children:[e(N,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Desc"]}),e(g,{}),t(r,{onClick:()=>{a.toggleVisibility(!1)},children:[e(h,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Hide"]})]})]})}):e("div",{className:o,children:n})}function R({sorted:a}){switch(a){case"desc":return e(N,{className:"ml-2 size-4"});case"asc":return e(v,{className:"ml-2 size-4"});default:return e(S,{className:"ml-2 size-4"})}}export{E as DataTableColumnHeader,B as DataTablePagination,L as DataTableViewOptions};
1
+ "use client";import{a as D,c as x,d as w,g as T,i as C}from"../chunk-O5EAJQGO.js";import{a as c,b as d,h as g,i as r,j as u,l as f,m as p}from"../chunk-SP6TA64U.js";import{a as s}from"../chunk-ONMU2LFX.js";import"../chunk-K4DIHWHX.js";import{a as m}from"../chunk-YGPIWXWP.js";import{a as l}from"../chunk-VRBUDJBH.js";import{ArrowDownIcon as v,CaretSortIcon as S,ChevronLeftIcon as b,ChevronRightIcon as P,ChevronUpIcon as N,DoubleArrowLeftIcon as M,DoubleArrowRightIcon as I,EyeNoneIcon as y,MixerHorizontalIcon as h}from"@radix-ui/react-icons";import{jsx as e,jsxs as t}from"react/jsx-runtime";function B({table:a}){return t(c,{children:[t(d,{className:m({size:"xs",variant:"outline"}),children:[e(h,{className:"size-4"}),"View"]}),t(g,{align:"end",className:"w-36",children:[e(f,{children:"Toggle columns"}),e(p,{}),a.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>e(u,{checked:n.getIsVisible(),className:"capitalize",onCheckedChange:o=>{n.toggleVisibility(!!o)},children:n.id},n.id))]})]})}function E({table:a,className:n,...o}){return t("div",{className:l("flex flex-wrap items-center justify-between gap-4 px-2",n),...o,children:[t("div",{className:"text-muted-foreground min-w-max flex-1 text-sm",children:[a.getFilteredSelectedRowModel().rows.length," of ",a.getFilteredRowModel().rows.length," row(s) selected."]}),t("div",{className:"flex grow flex-wrap items-center justify-between gap-4 md:justify-end md:gap-x-6 lg:gap-x-8",children:[t("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-4",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(w,{className:"w-18 h-8",children:e(x,{placeholder:a.getState().pagination.pageSize})}),e(T,{side:"top",children:[10,20,30,40,50].map(i=>e(C,{value:String(i),children:i},i))})]})]}),t("div",{className:"flex flex-wrap items-center justify-center text-sm font-medium",children:["Page ",a.getState().pagination.pageIndex+1," of ",a.getPageCount()]}),t("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-4",children:[t(s,{icon:!0,className:"max-md:hidden",disabled:!a.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{a.setPageIndex(0)},children:[e("span",{className:"sr-only",children:"Go to first page"}),e(M,{className:"size-4"})]}),t(s,{icon:!0,disabled:!a.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{a.previousPage()},children:[e("span",{className:"sr-only",children:"Go to previous page"}),e(b,{className:"size-4"})]}),t(s,{icon:!0,disabled:!a.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{a.nextPage()},children:[e("span",{className:"sr-only",children:"Go to next page"}),e(P,{className:"size-4"})]}),t(s,{icon:!0,className:"max-md:hidden",disabled:!a.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{a.setPageIndex(a.getPageCount()-1)},children:[e("span",{className:"sr-only",children:"Go to last page"}),e(I,{className:"size-4"})]})]})]})]})}function G({column:a,title:n,className:o}){return a.getCanSort()?e("div",{className:l("flex flex-wrap items-center gap-x-2 gap-y-4",o),children:t(c,{children:[e(d,{asChild:!0,children:e(s,{className:"data-[state=open]:bg-accent",size:"xs",suffix:e(R,{sorted:a.getIsSorted()}),variant:"ghost",children:n})}),t(g,{align:"start",children:[t(r,{onClick:()=>{a.toggleSorting(!1)},children:[e(N,{className:"text-muted-foreground"}),"Asc"]}),t(r,{onClick:()=>{a.toggleSorting(!0)},children:[e(v,{className:"text-muted-foreground"}),"Desc"]}),e(p,{}),t(r,{onClick:()=>{a.toggleVisibility(!1)},children:[e(y,{className:"text-muted-foreground"}),"Hide"]})]})]})}):e("div",{className:o,children:n})}function R({sorted:a}){switch(a){case"desc":return e(v,{});case"asc":return e(N,{});default:return e(S,{})}}export{G as DataTableColumnHeader,E as DataTablePagination,B as DataTableViewOptions};
2
2
  //# sourceMappingURL=data-table.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/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 type * as ReactTable from '@tanstack/react-table';\nimport { cn } from '@/lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/dropdown-menu';\nimport { Button, buttonVariants } from '@/components/button';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/select';\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\n className={buttonVariants({ className: 'hidden h-8 lg:flex', size: 'sm', variant: 'outline' })}\n >\n <MixerHorizontalIcon className=\"size-4\" />\n View\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 checked={column.getIsVisible()}\n className=\"capitalize\"\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 className=\"hidden lg:flex\"\n disabled={!table.getCanPreviousPage()}\n size=\"icon-xs\"\n variant=\"outline\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n disabled={!table.getCanPreviousPage()}\n size=\"icon-xs\"\n variant=\"outline\"\n onClick={() => {\n table.previousPage();\n }}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n disabled={!table.getCanNextPage()}\n size=\"icon-xs\"\n variant=\"outline\"\n onClick={() => {\n table.nextPage();\n }}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n className=\"hidden lg:flex\"\n disabled={!table.getCanNextPage()}\n size=\"icon-xs\"\n variant=\"outline\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\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 className=\"data-[state=open]:bg-accent -ml-3\" size=\"xs\" variant=\"ghost\">\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\n case 'asc': {\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n }\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 DataTable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pC,EAACkC,EAAA,CAAc,UAAU,cAAc,EAGhD,IAAK,MACH,OAAOlC,EAACiC,EAAA,CAAY,UAAU,cAAc,EAG9C,QACE,OAAOjC,EAACqC,EAAA,CAAc,UAAU,cAAc,CAClD,CACF","names":["ArrowDownIcon","ArrowUpIcon","CaretSortIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowLeftIcon","DoubleArrowRightIcon","EyeNoneIcon","MixerHorizontalIcon","jsx","jsxs","DataTableViewOptions","table","DropdownMenu","DropdownMenuTrigger","buttonVariants","MixerHorizontalIcon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","column","DropdownMenuCheckboxItem","value","DataTablePagination","className","props","cn","Select","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","Button","DoubleArrowLeftIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowRightIcon","DataTableColumnHeader","title","SortIcon","DropdownMenuItem","ArrowUpIcon","ArrowDownIcon","EyeNoneIcon","sorted","CaretSortIcon"]}
1
+ {"version":3,"sources":["../../src/components/data-table.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n ArrowDownIcon,\n CaretSortIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n ChevronUpIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from '@radix-ui/react-icons';\nimport type * as ReactTable from '@tanstack/react-table';\nimport { cn } from '@/lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/dropdown-menu';\nimport { Button } from '@/components/button';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/select';\nimport { buttonVariants } from '@/styles/button-variants';\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 className={buttonVariants({ size: 'xs', variant: 'outline' })}>\n <MixerHorizontalIcon className=\"size-4\" />\n View\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 <DropdownMenuCheckboxItem\n key={column.id}\n checked={column.getIsVisible()}\n className=\"capitalize\"\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\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 flex-wrap items-center justify-between gap-4 px-2', className)} {...props}>\n <div className=\"text-muted-foreground min-w-max flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n\n <div className=\"flex grow flex-wrap items-center justify-between gap-4 md:justify-end md:gap-x-6 lg:gap-x-8\">\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-4\">\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 flex-wrap items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-4\">\n <Button\n icon\n className=\"max-md:hidden\"\n disabled={!table.getCanPreviousPage()}\n size=\"xs\"\n variant=\"outline\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n icon\n disabled={!table.getCanPreviousPage()}\n size=\"xs\"\n variant=\"outline\"\n onClick={() => {\n table.previousPage();\n }}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n icon\n disabled={!table.getCanNextPage()}\n size=\"xs\"\n variant=\"outline\"\n onClick={() => {\n table.nextPage();\n }}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n icon\n className=\"max-md:hidden\"\n disabled={!table.getCanNextPage()}\n size=\"xs\"\n variant=\"outline\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\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 flex-wrap items-center gap-x-2 gap-y-4', className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n className=\"data-[state=open]:bg-accent\"\n size=\"xs\"\n suffix={<SortIcon sorted={column.getIsSorted()} />}\n variant=\"ghost\"\n >\n {title}\n </Button>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(false);\n }}\n >\n <ChevronUpIcon className=\"text-muted-foreground\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(true);\n }}\n >\n <ArrowDownIcon className=\"text-muted-foreground\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n column.toggleVisibility(false);\n }}\n >\n <EyeNoneIcon className=\"text-muted-foreground\" />\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 />;\n }\n\n case 'asc': {\n return <ChevronUpIcon />;\n }\n\n default:\n return <CaretSortIcon />;\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":"6TAGA,OACE,iBAAAA,EACA,iBAAAC,EACA,mBAAAC,EACA,oBAAAC,EACA,iBAAAC,EACA,uBAAAC,EACA,wBAAAC,EACA,eAAAC,EACA,uBAAAC,MACK,wBA2BD,OACE,OAAAC,EADF,QAAAC,MAAA,oBAHN,SAASC,EAA4B,CAAE,MAAAC,CAAM,EAAwD,CACnG,OACEF,EAACG,EAAA,CACC,UAAAH,EAACI,EAAA,CAAoB,UAAWC,EAAe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EAAO,WAAW,EAKrBX,EAAC,OAAI,UAAWiB,EAAG,8CAA+CF,CAAS,EACzE,SAAAd,EAACG,EAAA,CACC,UAAAJ,EAACK,EAAA,CAAoB,QAAO,GAC1B,SAAAL,EAACwB,EAAA,CACC,UAAU,8BACV,KAAK,KACL,OAAQxB,EAAC+B,EAAA,CAAS,OAAQpB,EAAO,YAAY,EAAG,EAChD,QAAQ,QAEP,SAAAmB,EACH,EACF,EAEA7B,EAACO,EAAA,CAAoB,MAAM,QACzB,UAAAP,EAAC+B,EAAA,CACC,QAAS,IAAM,CACbrB,EAAO,cAAc,EAAK,CAC5B,EAEA,UAAAX,EAACiC,EAAA,CAAc,UAAU,wBAAwB,EAAE,OAErD,EACAhC,EAAC+B,EAAA,CACC,QAAS,IAAM,CACbrB,EAAO,cAAc,EAAI,CAC3B,EAEA,UAAAX,EAACkC,EAAA,CAAc,UAAU,wBAAwB,EAAE,QAErD,EACAlC,EAACU,EAAA,EAAsB,EACvBT,EAAC+B,EAAA,CACC,QAAS,IAAM,CACbrB,EAAO,iBAAiB,EAAK,CAC/B,EAEA,UAAAX,EAACmC,EAAA,CAAY,UAAU,wBAAwB,EAAE,QAEnD,GACF,GACF,EACF,EA7COnC,EAAC,OAAI,UAAWe,EAAY,SAAAe,EAAM,CA+C7C,CAEA,SAASC,EAAS,CAAE,OAAAK,CAAO,EAAoE,CAC7F,OAAQA,EAAQ,CACd,IAAK,OACH,OAAOpC,EAACkC,EAAA,EAAc,EAGxB,IAAK,MACH,OAAOlC,EAACiC,EAAA,EAAc,EAGxB,QACE,OAAOjC,EAACqC,EAAA,EAAc,CAC1B,CACF","names":["ArrowDownIcon","CaretSortIcon","ChevronLeftIcon","ChevronRightIcon","ChevronUpIcon","DoubleArrowLeftIcon","DoubleArrowRightIcon","EyeNoneIcon","MixerHorizontalIcon","jsx","jsxs","DataTableViewOptions","table","DropdownMenu","DropdownMenuTrigger","buttonVariants","MixerHorizontalIcon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","column","DropdownMenuCheckboxItem","value","DataTablePagination","className","props","cn","Select","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","Button","DoubleArrowLeftIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowRightIcon","DataTableColumnHeader","title","SortIcon","DropdownMenuItem","ChevronUpIcon","ArrowDownIcon","EyeNoneIcon","sorted","CaretSortIcon"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkBRPTDZJDcjs = require('../chunk-BRPTDZJD.cjs');require('../chunk-7RRBAIQ7.cjs');require('../chunk-5ZAKR3XH.cjs');require('../chunk-4XRBMJ5Q.cjs');exports.Dialog = _chunkBRPTDZJDcjs.a; exports.DialogBody = _chunkBRPTDZJDcjs.e; exports.DialogClose = _chunkBRPTDZJDcjs.i; exports.DialogContent = _chunkBRPTDZJDcjs.c; exports.DialogDescription = _chunkBRPTDZJDcjs.h; exports.DialogFooter = _chunkBRPTDZJDcjs.f; exports.DialogHeader = _chunkBRPTDZJDcjs.d; exports.DialogTitle = _chunkBRPTDZJDcjs.g; exports.DialogTrigger = _chunkBRPTDZJDcjs.b;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkAH3OBTDOcjs = require('../chunk-AH3OBTDO.cjs');require('../chunk-LSBI35ZE.cjs');require('../chunk-4XRBMJ5Q.cjs');exports.Dialog = _chunkAH3OBTDOcjs.a; exports.DialogBody = _chunkAH3OBTDOcjs.e; exports.DialogClose = _chunkAH3OBTDOcjs.i; exports.DialogContent = _chunkAH3OBTDOcjs.c; exports.DialogDescription = _chunkAH3OBTDOcjs.h; exports.DialogFooter = _chunkAH3OBTDOcjs.f; exports.DialogHeader = _chunkAH3OBTDOcjs.d; exports.DialogTitle = _chunkAH3OBTDOcjs.g; exports.DialogTrigger = _chunkAH3OBTDOcjs.b;
2
2
  //# sourceMappingURL=dialog.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/components/dialog.cjs"],"names":[],"mappings":"AAAA,qFAAY,CAAC,yDAAoD,iCAA8B,iCAA8B,iCAA8B,wYAAuK","file":"/home/runner/work/codefast/codefast/packages/ui/dist/components/dialog.cjs"}
1
+ {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/components/dialog.cjs"],"names":[],"mappings":"AAAA,qFAAY,CAAC,yDAAoD,iCAA8B,iCAA8B,wYAAuK","file":"/home/runner/work/codefast/codefast/packages/ui/dist/components/dialog.cjs"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as DialogPrimitive from '@radix-ui/react-dialog';
3
- import { ButtonVariantsProps } from './button.cjs';
3
+ import { ButtonVariantsProps } from '../styles/button-variants.cjs';
4
4
  import 'tailwind-variants';
5
5
  import 'tailwind-variants/dist/config.js';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as DialogPrimitive from '@radix-ui/react-dialog';
3
- import { ButtonVariantsProps } from './button.js';
3
+ import { ButtonVariantsProps } from '../styles/button-variants.js';
4
4
  import 'tailwind-variants';
5
5
  import 'tailwind-variants/dist/config.js';
6
6
 
@@ -1,2 +1,2 @@
1
- "use client";import{a,b,c,d,e,f,g,h,i}from"../chunk-5KZCIWAV.js";import"../chunk-P5HEZNFY.js";import"../chunk-U2N42HZL.js";import"../chunk-VRBUDJBH.js";export{a as Dialog,e as DialogBody,i as DialogClose,c as DialogContent,h as DialogDescription,f as DialogFooter,d as DialogHeader,g as DialogTitle,b as DialogTrigger};
1
+ "use client";import{a,b,c,d,e,f,g,h,i}from"../chunk-CIMAEJ26.js";import"../chunk-YGPIWXWP.js";import"../chunk-VRBUDJBH.js";export{a as Dialog,e as DialogBody,i as DialogClose,c as DialogContent,h as DialogDescription,f as DialogFooter,d as DialogHeader,g as DialogTitle,b as DialogTrigger};
2
2
  //# sourceMappingURL=dialog.js.map
@@ -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; } }"use client";var _chunk7RRBAIQ7cjs = require('../chunk-7RRBAIQ7.cjs');require('../chunk-5ZAKR3XH.cjs');var _chunk4XRBMJ5Qcjs = require('../chunk-4XRBMJ5Q.cjs');var _react = require('react'); var n = _interopRequireWildcard(_react);var _vaul = require('vaul');var _jsxruntime = require('react/jsx-runtime');function R({shouldScaleBackground:e=!0,...r}){return _jsxruntime.jsx.call(void 0, _vaul.Drawer.Root,{shouldScaleBackground:e,...r})}var u=_vaul.Drawer.Trigger,D= exports.DrawerContent =n.forwardRef(({children:e,className:r,...a},s)=>_jsxruntime.jsxs.call(void 0, _vaul.Drawer.Portal,{children:[_jsxruntime.jsx.call(void 0, _vaul.Drawer.Overlay,{className:"fixed inset-0 z-50 bg-black/80"}),_jsxruntime.jsxs.call(void 0, _vaul.Drawer.Content,{ref:s,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border",r),...a,children:[_jsxruntime.jsx.call(void 0, "div",{className:"bg-muted mx-auto mt-4 h-2 w-24 rounded-full"}),e]})]}));D.displayName="DrawerContent";function C({className:e,...r}){return _jsxruntime.jsx.call(void 0, "div",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "grid gap-1.5 p-4 text-center sm:text-left",e),...r})}function v({className:e,...r}){return _jsxruntime.jsx.call(void 0, "main",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "overflow-auto px-4 py-2",e),...r})}function g({className:e,...r}){return _jsxruntime.jsx.call(void 0, "div",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "mt-auto flex flex-col-reverse gap-2 p-4",e),...r})}var w=n.forwardRef(({className:e,...r},a)=>_jsxruntime.jsx.call(void 0, _vaul.Drawer.Title,{ref:a,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "text-lg font-semibold leading-none tracking-tight",e),...r}));w.displayName=_vaul.Drawer.Title.displayName;var c=n.forwardRef(({className:e,...r},a)=>_jsxruntime.jsx.call(void 0, _vaul.Drawer.Description,{ref:a,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "text-muted-foreground text-sm",e),...r}));c.displayName=_vaul.Drawer.Description.displayName;var f=n.forwardRef(({className:e,size:r,variant:a="outline",...s},m)=>_jsxruntime.jsx.call(void 0, _vaul.Drawer.Close,{ref:m,className:_chunk7RRBAIQ7cjs.a.call(void 0, {className:e,size:r,variant:a}),...s}));f.displayName=_vaul.Drawer.Close.displayName;exports.Drawer = R; exports.DrawerBody = v; exports.DrawerClose = f; exports.DrawerContent = D; exports.DrawerDescription = c; exports.DrawerFooter = g; exports.DrawerHeader = C; exports.DrawerTitle = w; exports.DrawerTrigger = u;
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; } }"use client";var _chunkLSBI35ZEcjs = require('../chunk-LSBI35ZE.cjs');var _chunk4XRBMJ5Qcjs = require('../chunk-4XRBMJ5Q.cjs');var _react = require('react'); var n = _interopRequireWildcard(_react);var _vaul = require('vaul');var _jsxruntime = require('react/jsx-runtime');function R({shouldScaleBackground:e=!0,...r}){return _jsxruntime.jsx.call(void 0, _vaul.Drawer.Root,{shouldScaleBackground:e,...r})}var u=_vaul.Drawer.Trigger,D= exports.DrawerContent =n.forwardRef(({children:e,className:r,...a},s)=>_jsxruntime.jsxs.call(void 0, _vaul.Drawer.Portal,{children:[_jsxruntime.jsx.call(void 0, _vaul.Drawer.Overlay,{className:"fixed inset-0 z-50 bg-black/80"}),_jsxruntime.jsxs.call(void 0, _vaul.Drawer.Content,{ref:s,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border",r),...a,children:[_jsxruntime.jsx.call(void 0, "div",{className:"bg-muted mx-auto mt-4 h-2 w-24 rounded-full"}),e]})]}));D.displayName="DrawerContent";function C({className:e,...r}){return _jsxruntime.jsx.call(void 0, "div",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "grid gap-1.5 p-4 text-center sm:text-left",e),...r})}function v({className:e,...r}){return _jsxruntime.jsx.call(void 0, "main",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "overflow-auto px-4 py-2",e),...r})}function g({className:e,...r}){return _jsxruntime.jsx.call(void 0, "div",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "mt-auto flex flex-col-reverse gap-2 p-4",e),...r})}var w=n.forwardRef(({className:e,...r},a)=>_jsxruntime.jsx.call(void 0, _vaul.Drawer.Title,{ref:a,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "text-lg font-semibold leading-none tracking-tight",e),...r}));w.displayName=_vaul.Drawer.Title.displayName;var c=n.forwardRef(({className:e,...r},a)=>_jsxruntime.jsx.call(void 0, _vaul.Drawer.Description,{ref:a,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "text-muted-foreground text-sm",e),...r}));c.displayName=_vaul.Drawer.Description.displayName;var f=n.forwardRef(({className:e,size:r,variant:a="outline",...s},m)=>_jsxruntime.jsx.call(void 0, _vaul.Drawer.Close,{ref:m,className:_chunkLSBI35ZEcjs.a.call(void 0, {className:e,size:r,variant:a}),...s}));f.displayName=_vaul.Drawer.Close.displayName;exports.Drawer = R; exports.DrawerBody = v; exports.DrawerClose = f; exports.DrawerContent = D; exports.DrawerDescription = c; exports.DrawerFooter = g; exports.DrawerHeader = C; exports.DrawerTitle = w; exports.DrawerTrigger = u;
2
2
  //# sourceMappingURL=drawer.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/components/drawer.cjs","../../src/components/drawer.tsx"],"names":["Drawer","shouldScaleBackground","props","jsx","DrawerPrimitive","DrawerTrigger","DrawerContent","children","className","forwardedRef","jsxs","cn","DrawerHeader","DrawerBody","DrawerFooter","DrawerTitle","DrawerDescription","DrawerClose","size","variant","buttonVariants"],"mappings":"AAAA,uWAAY,CAAC,yDAAyC,iCAA8B,yDAA0C,uECEvG,4BACmB,+CAWjC,SADAA,CAAAA,CAAO,CAAE,qBAAA,CAAAC,CAAAA,CAAwB,CAAA,CAAA,CAAM,GAAGC,CAAM,CAAA,CAAmC,CAC1F,OAAOC,6BAAAA,YAACC,CAAgB,IAAA,CAAhB,CAAqB,qBAAA,CAAuBH,CAAAA,CAAwB,GAAGC,CAAAA,CAAO,CACxF,CAOA,IAAMG,CAAAA,CAAgBD,YAAAA,CAAgB,OAAA,CAShCE,CAAAA,yBAAsB,CAAA,CAAA,UAAA,CAC1B,CAAC,CAAE,QAAA,CAAAC,CAAAA,CAAU,SAAA,CAAAC,CAAAA,CAAW,GAAGN,CAAM,CAAA,CAAGO,CAAAA,CAAAA,EAClCC,8BAAAA,YAACN,CAAgB,MAAA,CAAhB,CACC,QAAA,CAAA,CAAAD,6BAAAA,YAACC,CAAgB,OAAA,CAAhB,CAAwB,SAAA,CAAU,gCAAA,CAAiC,CAAA,CACpEM,8BAAAA,YAACN,CAAgB,OAAA,CAAhB,CACC,GAAA,CAAKK,CAAAA,CACL,SAAA,CAAWE,iCAAAA,4FACT,CACAH,CACF,CAAA,CACC,GAAGN,CAAAA,CAEJ,QAAA,CAAA,CAAAC,6BAAAA,KAAC,CAAA,CAAI,SAAA,CAAU,6CAAA,CAA8C,CAAA,CAC5DI,CAAAA,CAAAA,CACH,CAAA,CAAA,CACF,CAEJ,CAAA,CAEAD,CAAAA,CAAc,WAAA,CAAc,eAAA,CAQ5B,SAASM,CAAAA,CAAa,CAAE,SAAA,CAAAJ,CAAAA,CAAW,GAAGN,CAA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CAAcZ,YAAAA,CAAgB,WAAA,CAAY,WAAA,CAa5D,IAAMa,CAAAA,CAAoB,CAAA,CAAA,UAAA,CACxB,CAAC,CAAE,SAAA,CAAAT,CAAAA,CAAW,IAAA,CAAAU,CAAAA,CAAM,OAAA,CAAAC,CAAAA,CAAU,SAAA,CAAW,GAAGjB,CAAM,CAAA,CAAGO,CAAAA,CAAAA,EACnDN,6BAAAA,YAACC,CAAgB,KAAA,CAAhB,CAAsB,GAAA,CAAKK,CAAAA,CAAc,SAAA,CAAWW,iCAAAA,CAAiB,SAAA,CAAAZ,CAAAA,CAAW,IAAA,CAAAU,CAAAA,CAAM,OAAA,CAAAC,CAAQ,CAAC,CAAA,CAAI,GAAGjB,CAAAA,CAAO,CAElH,CAAA,CAEAe,CAAAA,CAAY,WAAA,CAAcb,YAAAA,CAAgB,KAAA,CAAM,WAAA,CAAA,sOAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/components/drawer.cjs","sourcesContent":[null,"'use client';\n\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport { cn } from '@/lib/utils';\nimport { buttonVariants, type ButtonVariantsProps } from '@/components/button';\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: 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 }, forwardedRef) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={forwardedRef}\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: DrawerBody\n * -------------------------------------------------------------------------- */\n\ntype DrawerBodyProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerBody({ className, ...props }: DrawerBodyProps): React.JSX.Element {\n return <main className={cn('overflow-auto px-4 py-2', 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-reverse 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 }, forwardedRef) => (\n <DrawerPrimitive.Title\n ref={forwardedRef}\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 }, forwardedRef) => (\n <DrawerPrimitive.Description\n ref={forwardedRef}\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseElement = React.ElementRef<typeof DrawerPrimitive.Close>;\n\ninterface DrawerCloseProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close> {\n size?: ButtonVariantsProps['size'];\n variant?: ButtonVariantsProps['variant'];\n}\n\nconst DrawerClose = React.forwardRef<DrawerCloseElement, DrawerCloseProps>(\n ({ className, size, variant = 'outline', ...props }, forwardedRef) => (\n <DrawerPrimitive.Close ref={forwardedRef} className={buttonVariants({ className, size, variant })} {...props} />\n ),\n);\n\nDrawerClose.displayName = DrawerPrimitive.Close.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerBody,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerBodyProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"]}
1
+ {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/components/drawer.cjs","../../src/components/drawer.tsx"],"names":["Drawer","shouldScaleBackground","props","jsx","DrawerPrimitive","DrawerTrigger","DrawerContent","children","className","forwardedRef","jsxs","cn","DrawerHeader","DrawerBody","DrawerFooter","DrawerTitle","DrawerDescription","DrawerClose","size","variant","buttonVariants"],"mappings":"AAAA,uWAAY,CAAC,yDAAyC,yDAA0C,uECEzE,4BACmB,+CAWjC,SADAA,CAAAA,CAAO,CAAE,qBAAA,CAAAC,CAAAA,CAAwB,CAAA,CAAA,CAAM,GAAGC,CAAM,CAAA,CAAmC,CAC1F,OAAOC,6BAAAA,YAACC,CAAgB,IAAA,CAAhB,CAAqB,qBAAA,CAAuBH,CAAAA,CAAwB,GAAGC,CAAAA,CAAO,CACxF,CAOA,IAAMG,CAAAA,CAAgBD,YAAAA,CAAgB,OAAA,CAShCE,CAAAA,yBAAsB,CAAA,CAAA,UAAA,CAC1B,CAAC,CAAE,QAAA,CAAAC,CAAAA,CAAU,SAAA,CAAAC,CAAAA,CAAW,GAAGN,CAAM,CAAA,CAAGO,CAAAA,CAAAA,EAClCC,8BAAAA,YAACN,CAAgB,MAAA,CAAhB,CACC,QAAA,CAAA,CAAAD,6BAAAA,YAACC,CAAgB,OAAA,CAAhB,CAAwB,SAAA,CAAU,gCAAA,CAAiC,CAAA,CACpEM,8BAAAA,YAACN,CAAgB,OAAA,CAAhB,CACC,GAAA,CAAKK,CAAAA,CACL,SAAA,CAAWE,iCAAAA,4FACT,CACAH,CACF,CAAA,CACC,GAAGN,CAAAA,CAEJ,QAAA,CAAA,CAAAC,6BAAAA,KAAC,CAAA,CAAI,SAAA,CAAU,6CAAA,CAA8C,CAAA,CAC5DI,CAAAA,CAAAA,CACH,CAAA,CAAA,CACF,CAEJ,CAAA,CAEAD,CAAAA,CAAc,WAAA,CAAc,eAAA,CAQ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,CACvD,GAAGN,CAAAA,CACN,CAEJ,CAAA,CAEAc,CAAAA,CAAkB,WAAA,CAAcZ,YAAAA,CAAgB,WAAA,CAAY,WAAA,CAa5D,IAAMa,CAAAA,CAAoB,CAAA,CAAA,UAAA,CACxB,CAAC,CAAE,SAAA,CAAAT,CAAAA,CAAW,IAAA,CAAAU,CAAAA,CAAM,OAAA,CAAAC,CAAAA,CAAU,SAAA,CAAW,GAAGjB,CAAM,CAAA,CAAGO,CAAAA,CAAAA,EACnDN,6BAAAA,YAACC,CAAgB,KAAA,CAAhB,CAAsB,GAAA,CAAKK,CAAAA,CAAc,SAAA,CAAWW,iCAAAA,CAAiB,SAAA,CAAAZ,CAAAA,CAAW,IAAA,CAAAU,CAAAA,CAAM,OAAA,CAAAC,CAAQ,CAAC,CAAA,CAAI,GAAGjB,CAAAA,CAAO,CAElH,CAAA,CAEAe,CAAAA,CAAY,WAAA,CAAcb,YAAAA,CAAgB,KAAA,CAAM,WAAA,CAAA,sOAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/components/drawer.cjs","sourcesContent":[null,"'use client';\n\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport { cn } from '@/lib/utils';\nimport { buttonVariants, type ButtonVariantsProps } from '@/styles/button-variants';\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: 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 }, forwardedRef) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={forwardedRef}\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: DrawerBody\n * -------------------------------------------------------------------------- */\n\ntype DrawerBodyProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerBody({ className, ...props }: DrawerBodyProps): React.JSX.Element {\n return <main className={cn('overflow-auto px-4 py-2', 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-reverse 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 }, forwardedRef) => (\n <DrawerPrimitive.Title\n ref={forwardedRef}\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 }, forwardedRef) => (\n <DrawerPrimitive.Description\n ref={forwardedRef}\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseElement = React.ElementRef<typeof DrawerPrimitive.Close>;\n\ninterface DrawerCloseProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close> {\n size?: ButtonVariantsProps['size'];\n variant?: ButtonVariantsProps['variant'];\n}\n\nconst DrawerClose = React.forwardRef<DrawerCloseElement, DrawerCloseProps>(\n ({ className, size, variant = 'outline', ...props }, forwardedRef) => (\n <DrawerPrimitive.Close ref={forwardedRef} className={buttonVariants({ className, size, variant })} {...props} />\n ),\n);\n\nDrawerClose.displayName = DrawerPrimitive.Close.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerBody,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerBodyProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  import * as DialogPrimitive from '@radix-ui/react-dialog';
2
2
  import * as React from 'react';
3
3
  import { Drawer as Drawer$1 } from 'vaul';
4
- import { ButtonVariantsProps } from './button.cjs';
4
+ import { ButtonVariantsProps } from '../styles/button-variants.cjs';
5
5
  import 'tailwind-variants';
6
6
  import 'tailwind-variants/dist/config.js';
7
7
 
@@ -10,9 +10,7 @@ declare function Drawer({ shouldScaleBackground, ...props }: DrawerProps): React
10
10
  type DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Trigger>;
11
11
  declare const DrawerTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
12
12
  type DrawerContentProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Content>;
13
- declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
14
- onAnimationEnd?: (open: boolean) => void;
15
- } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
14
  type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;
17
15
  declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element;
18
16
  type DrawerBodyProps = React.HTMLAttributes<HTMLDivElement>;
@@ -1,7 +1,7 @@
1
1
  import * as DialogPrimitive from '@radix-ui/react-dialog';
2
2
  import * as React from 'react';
3
3
  import { Drawer as Drawer$1 } from 'vaul';
4
- import { ButtonVariantsProps } from './button.js';
4
+ import { ButtonVariantsProps } from '../styles/button-variants.js';
5
5
  import 'tailwind-variants';
6
6
  import 'tailwind-variants/dist/config.js';
7
7
 
@@ -10,9 +10,7 @@ declare function Drawer({ shouldScaleBackground, ...props }: DrawerProps): React
10
10
  type DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Trigger>;
11
11
  declare const DrawerTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
12
12
  type DrawerContentProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Content>;
13
- declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
14
- onAnimationEnd?: (open: boolean) => void;
15
- } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
14
  type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;
17
15
  declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element;
18
16
  type DrawerBodyProps = React.HTMLAttributes<HTMLDivElement>;
@@ -1,2 +1,2 @@
1
- "use client";import{a as p}from"../chunk-P5HEZNFY.js";import"../chunk-U2N42HZL.js";import{a as i}from"../chunk-VRBUDJBH.js";import*as n from"react";import{Drawer as t}from"vaul";import{jsx as o,jsxs as l}from"react/jsx-runtime";function R({shouldScaleBackground:e=!0,...r}){return o(t.Root,{shouldScaleBackground:e,...r})}var u=t.Trigger,D=n.forwardRef(({children:e,className:r,...a},s)=>l(t.Portal,{children:[o(t.Overlay,{className:"fixed inset-0 z-50 bg-black/80"}),l(t.Content,{ref:s,className:i("bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border",r),...a,children:[o("div",{className:"bg-muted mx-auto mt-4 h-2 w-24 rounded-full"}),e]})]}));D.displayName="DrawerContent";function C({className:e,...r}){return o("div",{className:i("grid gap-1.5 p-4 text-center sm:text-left",e),...r})}function v({className:e,...r}){return o("main",{className:i("overflow-auto px-4 py-2",e),...r})}function g({className:e,...r}){return o("div",{className:i("mt-auto flex flex-col-reverse gap-2 p-4",e),...r})}var w=n.forwardRef(({className:e,...r},a)=>o(t.Title,{ref:a,className:i("text-lg font-semibold leading-none tracking-tight",e),...r}));w.displayName=t.Title.displayName;var c=n.forwardRef(({className:e,...r},a)=>o(t.Description,{ref:a,className:i("text-muted-foreground text-sm",e),...r}));c.displayName=t.Description.displayName;var f=n.forwardRef(({className:e,size:r,variant:a="outline",...s},m)=>o(t.Close,{ref:m,className:p({className:e,size:r,variant:a}),...s}));f.displayName=t.Close.displayName;export{R as Drawer,v as DrawerBody,f as DrawerClose,D as DrawerContent,c as DrawerDescription,g as DrawerFooter,C as DrawerHeader,w as DrawerTitle,u as DrawerTrigger};
1
+ "use client";import{a as p}from"../chunk-YGPIWXWP.js";import{a as i}from"../chunk-VRBUDJBH.js";import*as n from"react";import{Drawer as t}from"vaul";import{jsx as o,jsxs as l}from"react/jsx-runtime";function R({shouldScaleBackground:e=!0,...r}){return o(t.Root,{shouldScaleBackground:e,...r})}var u=t.Trigger,D=n.forwardRef(({children:e,className:r,...a},s)=>l(t.Portal,{children:[o(t.Overlay,{className:"fixed inset-0 z-50 bg-black/80"}),l(t.Content,{ref:s,className:i("bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border",r),...a,children:[o("div",{className:"bg-muted mx-auto mt-4 h-2 w-24 rounded-full"}),e]})]}));D.displayName="DrawerContent";function C({className:e,...r}){return o("div",{className:i("grid gap-1.5 p-4 text-center sm:text-left",e),...r})}function v({className:e,...r}){return o("main",{className:i("overflow-auto px-4 py-2",e),...r})}function g({className:e,...r}){return o("div",{className:i("mt-auto flex flex-col-reverse gap-2 p-4",e),...r})}var w=n.forwardRef(({className:e,...r},a)=>o(t.Title,{ref:a,className:i("text-lg font-semibold leading-none tracking-tight",e),...r}));w.displayName=t.Title.displayName;var c=n.forwardRef(({className:e,...r},a)=>o(t.Description,{ref:a,className:i("text-muted-foreground text-sm",e),...r}));c.displayName=t.Description.displayName;var f=n.forwardRef(({className:e,size:r,variant:a="outline",...s},m)=>o(t.Close,{ref:m,className:p({className:e,size:r,variant:a}),...s}));f.displayName=t.Close.displayName;export{R as Drawer,v as DrawerBody,f as DrawerClose,D as DrawerContent,c as DrawerDescription,g as DrawerFooter,C as DrawerHeader,w as DrawerTitle,u as DrawerTrigger};
2
2
  //# sourceMappingURL=drawer.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/drawer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport { cn } from '@/lib/utils';\nimport { buttonVariants, type ButtonVariantsProps } from '@/components/button';\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: 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 }, forwardedRef) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={forwardedRef}\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: DrawerBody\n * -------------------------------------------------------------------------- */\n\ntype DrawerBodyProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerBody({ className, ...props }: DrawerBodyProps): React.JSX.Element {\n return <main className={cn('overflow-auto px-4 py-2', 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-reverse 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 }, forwardedRef) => (\n <DrawerPrimitive.Title\n ref={forwardedRef}\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 }, forwardedRef) => (\n <DrawerPrimitive.Description\n ref={forwardedRef}\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseElement = React.ElementRef<typeof DrawerPrimitive.Close>;\n\ninterface DrawerCloseProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close> {\n size?: ButtonVariantsProps['size'];\n variant?: ButtonVariantsProps['variant'];\n}\n\nconst DrawerClose = React.forwardRef<DrawerCloseElement, DrawerCloseProps>(\n ({ className, size, variant = 'outline', ...props }, forwardedRef) => (\n <DrawerPrimitive.Close ref={forwardedRef} className={buttonVariants({ className, size, variant })} {...props} />\n ),\n);\n\nDrawerClose.displayName = DrawerPrimitive.Close.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerBody,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerBodyProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"],"mappings":"4HAEA,UAAYA,MAAW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E,UAAAP,EAAW,GAAGL,CAAM,EAAGM,IACxBV,EAACK,EAAgB,YAAhB,CACC,IAAKK,EACL,UAAWC,EAAG,gCAAiCF,CAAS,EACvD,GAAGL,EACN,CAEJ,EAEAY,EAAkB,YAAcX,EAAgB,YAAY,YAa5D,IAAMY,EAAoB,aACxB,CAAC,CAAE,UAAAR,EAAW,KAAAS,EAAM,QAAAC,EAAU,UAAW,GAAGf,CAAM,EAAGM,IACnDV,EAACK,EAAgB,MAAhB,CAAsB,IAAKK,EAAc,UAAWU,EAAe,CAAE,UAAAX,EAAW,KAAAS,EAAM,QAAAC,CAAQ,CAAC,EAAI,GAAGf,EAAO,CAElH,EAEAa,EAAY,YAAcZ,EAAgB,MAAM","names":["React","DrawerPrimitive","jsx","jsxs","Drawer","shouldScaleBackground","props","DrawerPrimitive","DrawerTrigger","DrawerContent","children","className","forwardedRef","cn","DrawerHeader","DrawerBody","DrawerFooter","DrawerTitle","DrawerDescription","DrawerClose","size","variant","buttonVariants"]}
1
+ {"version":3,"sources":["../../src/components/drawer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport { cn } from '@/lib/utils';\nimport { buttonVariants, type ButtonVariantsProps } from '@/styles/button-variants';\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: 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 }, forwardedRef) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={forwardedRef}\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: DrawerBody\n * -------------------------------------------------------------------------- */\n\ntype DrawerBodyProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerBody({ className, ...props }: DrawerBodyProps): React.JSX.Element {\n return <main className={cn('overflow-auto px-4 py-2', 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-reverse 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 }, forwardedRef) => (\n <DrawerPrimitive.Title\n ref={forwardedRef}\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 }, forwardedRef) => (\n <DrawerPrimitive.Description\n ref={forwardedRef}\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseElement = React.ElementRef<typeof DrawerPrimitive.Close>;\n\ninterface DrawerCloseProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close> {\n size?: ButtonVariantsProps['size'];\n variant?: ButtonVariantsProps['variant'];\n}\n\nconst DrawerClose = React.forwardRef<DrawerCloseElement, DrawerCloseProps>(\n ({ className, size, variant = 'outline', ...props }, forwardedRef) => (\n <DrawerPrimitive.Close ref={forwardedRef} className={buttonVariants({ className, size, variant })} {...props} />\n ),\n);\n\nDrawerClose.displayName = DrawerPrimitive.Close.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerBody,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerBodyProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"],"mappings":"+FAEA,UAAYA,MAAW,QACvB,OAAS,UAAUC,MAAuB,OAWjC,cAAAC,EAqBH,QAAAC,MArBG,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,QAShCE,EAAsB,aAC1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGL,CAAM,EAAGM,IAClCT,EAACI,EAAgB,OAAhB,CACC,UAAAL,EAACK,EAAgB,QAAhB,CAAwB,UAAU,iCAAiC,EACpEJ,EAACI,EAAgB,QAAhB,CACC,IAAKK,EACL,UAAWC,EACT,6FACAF,CACF,EACC,GAAGL,EAEJ,UAAAJ,EAAC,OAAI,UAAU,8CAA8C,EAC5DQ,GACH,GACF,CAEJ,EAEAD,EAAc,YAAc,gBAQ5B,SAASK,EAAa,CAAE,UAAAH,EAAW,GAAGL,CAAM,EAAyC,CACnF,OAAOJ,EAAC,OAAI,UAAWW,EAAG,4CAA6CF,CAAS,EAAI,GAAGL,EAAO,CAChG,CAQA,SAASS,EAAW,CAAE,UAAAJ,EAAW,GAAGL,CAAM,EAAuC,CAC/E,OAAOJ,EAAC,QAAK,UAAWW,EAAG,0BAA2BF,CAAS,EAAI,GAAGL,EAAO,CAC/E,CAQA,SAASU,EAAa,CAAE,UAAAL,EAAW,GAAGL,CAAM,EAAyC,CACnF,OAAOJ,EAAC,OAAI,UAAWW,EAAG,0CAA2CF,CAAS,EAAI,GAAGL,EAAO,CAC9F,CASA,IAAMW,EAAoB,aAAiD,CAAC,CAAE,UAAAN,EAAW,GAAGL,CAAM,EAAGM,IACnGV,EAACK,EAAgB,MAAhB,CACC,IAAKK,EACL,UAAWC,EAAG,oDAAqDF,CAAS,EAC3E,GAAGL,EACN,CACD,EAEDW,EAAY,YAAcV,EAAgB,MAAM,YAShD,IAAMW,EAA0B,aAC9B,CAAC,CAAE,UAAAP,EAAW,GAAGL,CAAM,EAAGM,IACxBV,EAACK,EAAgB,YAAhB,CACC,IAAKK,EACL,UAAWC,EAAG,gCAAiCF,CAAS,EACvD,GAAGL,EACN,CAEJ,EAEAY,EAAkB,YAAcX,EAAgB,YAAY,YAa5D,IAAMY,EAAoB,aACxB,CAAC,CAAE,UAAAR,EAAW,KAAAS,EAAM,QAAAC,EAAU,UAAW,GAAGf,CAAM,EAAGM,IACnDV,EAACK,EAAgB,MAAhB,CAAsB,IAAKK,EAAc,UAAWU,EAAe,CAAE,UAAAX,EAAW,KAAAS,EAAM,QAAAC,CAAQ,CAAC,EAAI,GAAGf,EAAO,CAElH,EAEAa,EAAY,YAAcZ,EAAgB,MAAM","names":["React","DrawerPrimitive","jsx","jsxs","Drawer","shouldScaleBackground","props","DrawerPrimitive","DrawerTrigger","DrawerContent","children","className","forwardedRef","cn","DrawerHeader","DrawerBody","DrawerFooter","DrawerTitle","DrawerDescription","DrawerClose","size","variant","buttonVariants"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkEJGO273Xcjs = require('../chunk-EJGO273X.cjs');require('../chunk-4XRBMJ5Q.cjs');exports.DropdownMenu = _chunkEJGO273Xcjs.a; exports.DropdownMenuCheckboxItem = _chunkEJGO273Xcjs.j; exports.DropdownMenuContent = _chunkEJGO273Xcjs.h; exports.DropdownMenuGroup = _chunkEJGO273Xcjs.c; exports.DropdownMenuItem = _chunkEJGO273Xcjs.i; exports.DropdownMenuLabel = _chunkEJGO273Xcjs.l; exports.DropdownMenuRadioGroup = _chunkEJGO273Xcjs.e; exports.DropdownMenuRadioItem = _chunkEJGO273Xcjs.k; exports.DropdownMenuSeparator = _chunkEJGO273Xcjs.m; exports.DropdownMenuShortcut = _chunkEJGO273Xcjs.n; exports.DropdownMenuSub = _chunkEJGO273Xcjs.d; exports.DropdownMenuSubContent = _chunkEJGO273Xcjs.g; exports.DropdownMenuSubTrigger = _chunkEJGO273Xcjs.f; exports.DropdownMenuTrigger = _chunkEJGO273Xcjs.b;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkFPCACNPXcjs = require('../chunk-FPCACNPX.cjs');require('../chunk-4XRBMJ5Q.cjs');exports.DropdownMenu = _chunkFPCACNPXcjs.a; exports.DropdownMenuArrow = _chunkFPCACNPXcjs.o; exports.DropdownMenuCheckboxItem = _chunkFPCACNPXcjs.j; exports.DropdownMenuContent = _chunkFPCACNPXcjs.h; exports.DropdownMenuGroup = _chunkFPCACNPXcjs.c; exports.DropdownMenuItem = _chunkFPCACNPXcjs.i; exports.DropdownMenuLabel = _chunkFPCACNPXcjs.l; exports.DropdownMenuRadioGroup = _chunkFPCACNPXcjs.e; exports.DropdownMenuRadioItem = _chunkFPCACNPXcjs.k; exports.DropdownMenuSeparator = _chunkFPCACNPXcjs.m; exports.DropdownMenuShortcut = _chunkFPCACNPXcjs.n; exports.DropdownMenuSub = _chunkFPCACNPXcjs.d; exports.DropdownMenuSubContent = _chunkFPCACNPXcjs.g; exports.DropdownMenuSubTrigger = _chunkFPCACNPXcjs.f; exports.DropdownMenuTrigger = _chunkFPCACNPXcjs.b;
2
2
  //# sourceMappingURL=dropdown-menu.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/components/dropdown-menu.cjs"],"names":[],"mappings":"AAAA,qFAAY,CAAC,yDAA8D,iCAA8B,0sBAAuW","file":"/home/runner/work/codefast/codefast/packages/ui/dist/components/dropdown-menu.cjs"}
1
+ {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/components/dropdown-menu.cjs"],"names":[],"mappings":"AAAA,qFAAY,CAAC,yDAAgE,iCAA8B,2vBAA8X","file":"/home/runner/work/codefast/codefast/packages/ui/dist/components/dropdown-menu.cjs"}
@@ -35,5 +35,7 @@ type DropdownMenuSeparatorProps = React.ComponentPropsWithoutRef<typeof Dropdown
35
35
  declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
36
36
  type DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
37
37
  declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): React.JSX.Element;
38
+ type DropdownMenuArrowProps = DropdownMenuPrimitive.DropdownMenuArrowProps;
39
+ declare const DropdownMenuArrow: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuArrowProps & React.RefAttributes<SVGSVGElement>>;
38
40
 
39
- export { DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
41
+ export { DropdownMenu, DropdownMenuArrow, type DropdownMenuArrowProps, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
@@ -35,5 +35,7 @@ type DropdownMenuSeparatorProps = React.ComponentPropsWithoutRef<typeof Dropdown
35
35
  declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
36
36
  type DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
37
37
  declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): React.JSX.Element;
38
+ type DropdownMenuArrowProps = DropdownMenuPrimitive.DropdownMenuArrowProps;
39
+ declare const DropdownMenuArrow: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuArrowProps & React.RefAttributes<SVGSVGElement>>;
38
40
 
39
- export { DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
41
+ export { DropdownMenu, DropdownMenuArrow, type DropdownMenuArrowProps, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
@@ -1,2 +1,2 @@
1
- "use client";import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../chunk-Y3KLZDCA.js";import"../chunk-VRBUDJBH.js";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,o}from"../chunk-SP6TA64U.js";import"../chunk-VRBUDJBH.js";export{a as DropdownMenu,o as DropdownMenuArrow,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.js.map
@@ -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 _chunkISHID3OHcjs = require('../chunk-ISHID3OH.cjs');var _chunk4XRBMJ5Qcjs = require('../chunk-4XRBMJ5Q.cjs');var _react = require('react'); var i = _interopRequireWildcard(_react);var _reactslot = require('@radix-ui/react-slot');var _reacthookform = require('react-hook-form');var _reactcontext = require('@radix-ui/react-context');var _jsxruntime = require('react/jsx-runtime');var B=_reacthookform.FormProvider,y="FormField",[I,W]=_reactcontext.createContextScope.call(void 0, y),[x,P]=I(y);function d(o,r){let{id:e}=V(o,r);return{formDescriptionId:`form-item-description-${e}`,formItemId:`form-item-${e}`,formMessageId:`form-item-message-${e}`,id:e}}function G(o){let{__scopeFormField:r,...e}=o;return _jsxruntime.jsx.call(void 0, x,{name:e.name,scope:r,children:_jsxruntime.jsx.call(void 0, _reacthookform.Controller,{...e})})}var M="FormItem",[L,V]=I(M),S= exports.FormItem =i.forwardRef(({__scopeFormField:o,className:r,...e},m)=>{let t=i.useId();return _jsxruntime.jsx.call(void 0, L,{id:t,scope:o,children:_jsxruntime.jsx.call(void 0, "div",{ref:m,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "space-y-2",r),...e})})});S.displayName=M;var R="FormLabel",b= exports.FormLabel =i.forwardRef(({__scopeFormField:o,className:r,...e},m)=>{let{formItemId:t}=d(p,o),{name:l}=P(R,o),{errors:s}=_reacthookform.useFormState.call(void 0, {name:l});return _jsxruntime.jsx.call(void 0, _chunkISHID3OHcjs.a,{ref:m,className:_chunk4XRBMJ5Qcjs.a.call(void 0, s[l]&&"text-destructive",r),htmlFor:t,...e})});b.displayName=R;var E="FormControl",D= exports.FormControl =i.forwardRef(({__scopeFormField:o,...r},e)=>{let{formItemId:m,formDescriptionId:t,formMessageId:l}=d(p,o),{name:s}=P(E,o),{errors:n}=_reacthookform.useFormState.call(void 0, {name:s});return _jsxruntime.jsx.call(void 0, _reactslot.Slot,{ref:e,"aria-describedby":n[s]?`${t} ${l}`:t,"aria-invalid":!!n[s],id:m,...r})});D.displayName=E;var v="FormDescription",h= exports.FormDescription =i.forwardRef(({__scopeFormField:o,className:r,...e},m)=>{let{formDescriptionId:t}=d(p,o);return _jsxruntime.jsx.call(void 0, "p",{ref:m,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "text-muted-foreground text-xs",r),id:t,...e})});h.displayName=v;var p="FormMessage",A= exports.FormMessage =i.forwardRef(({__scopeFormField:o,children:r,className:e,...m},t)=>{let{formMessageId:l}=d(p,o),{name:s}=P(p,o),{errors:n}=_reacthookform.useFormState.call(void 0, {name:s}),f=_optionalChain([n, 'access', _ => _[s], 'optionalAccess', _2 => _2.message])?String(n[s].message):r;return f?_jsxruntime.jsx.call(void 0, "p",{ref:t,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "text-xs",_optionalChain([n, 'access', _3 => _3[s], 'optionalAccess', _4 => _4.message])?"text-destructive font-medium":"text-muted-foreground",e),id:l,...m,children:f}):null});A.displayName=p;exports.Form = B; exports.FormControl = D; exports.FormDescription = h; exports.FormField = G; exports.FormItem = S; exports.FormLabel = b; exports.FormMessage = A; exports.createFormFieldScope = W;
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 _chunkISHID3OHcjs = require('../chunk-ISHID3OH.cjs');var _chunk4XRBMJ5Qcjs = require('../chunk-4XRBMJ5Q.cjs');var _react = require('react'); var a = _interopRequireWildcard(_react);var _reactslot = require('@radix-ui/react-slot');var _reacthookform = require('react-hook-form');var _reactcontext = require('@radix-ui/react-context');var _lodash = require('lodash');var _jsxruntime = require('react/jsx-runtime');var J=_reacthookform.FormProvider,y="FormField",[I,X]=_reactcontext.createContextScope.call(void 0, y),[V,M]=I(y);function F(o,r){let{id:e}=S(o,r);return{formDescriptionId:`form-item-description-${e}`,formItemId:`form-item-${e}`,formMessageId:`form-item-message-${e}`,id:e}}function k(o){let{__scopeFormField:r,...e}=o;return _jsxruntime.jsx.call(void 0, V,{name:e.name,scope:r,children:_jsxruntime.jsx.call(void 0, _reacthookform.Controller,{...e})})}var R="FormItem",[x,S]=I(R),b= exports.FormItem =a.forwardRef(({__scopeFormField:o,className:r,...e},t)=>{let s=a.useId();return _jsxruntime.jsx.call(void 0, x,{id:s,scope:o,children:_jsxruntime.jsx.call(void 0, "div",{ref:t,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "space-y-2",r),...e})})});b.displayName=R;var D="FormLabel",h= exports.FormLabel =a.forwardRef(({__scopeFormField:o,...r},e)=>{let{formItemId:t}=F(l,o);return _jsxruntime.jsx.call(void 0, _chunkISHID3OHcjs.a,{ref:e,htmlFor:t,...r})});h.displayName=D;var E="FormControl",v= exports.FormControl =a.forwardRef(({__scopeFormField:o,...r},e)=>{let{formItemId:t,formDescriptionId:s,formMessageId:d}=F(l,o),{name:i}=M(E,o),{errors:n}=_reacthookform.useFormState.call(void 0, {name:i});return _jsxruntime.jsx.call(void 0, _reactslot.Slot,{ref:e,"aria-describedby":n[i]?`${s} ${d}`:s,"aria-invalid":!!n[i],id:t,...r})});v.displayName=E;var _="FormDescription",A= exports.FormDescription =a.forwardRef(({__scopeFormField:o,className:r,...e},t)=>{let{formDescriptionId:s}=F(l,o);return _jsxruntime.jsx.call(void 0, "p",{ref:t,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "text-muted-foreground text-xs",r),id:s,...e})});A.displayName=_;var l="FormMessage",H= exports.FormMessage =a.forwardRef(({__scopeFormField:o,children:r,className:e,...t},s)=>{let{formMessageId:d}=F(l,o),{name:i}=M(l,o),{errors:n}=_reacthookform.useFormState.call(void 0, {name:i}),c=_lodash.result.call(void 0, n,i),P=_optionalChain([c, 'optionalAccess', _2 => _2.message])?String(c.message):r;return P?_jsxruntime.jsx.call(void 0, "p",{ref:s,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "text-xs",_optionalChain([c, 'optionalAccess', _3 => _3.message])?"text-destructive font-medium":"text-muted-foreground",e),id:d,...t,children:P}):null});H.displayName=l;exports.Form = J; exports.FormControl = v; exports.FormDescription = A; exports.FormField = k; exports.FormItem = b; exports.FormLabel = h; exports.FormMessage = H; exports.createFormFieldScope = X;
2
2
  //# sourceMappingURL=form.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/components/form.cjs","../../src/components/form.tsx"],"names":["Form","FormProvider","FORM_FIELD_NAME","createFormFieldContext","createFormFieldScope","createContextScope","FormFieldProvider","useFormFieldContext","useFormItem","consumerName","scope","id","useFormItemContext"],"mappings":"AAAA,22BAAY,CAAC,yDAAyC,yDAA0C,uECEzE,iDACF,gDAQd,uDAEwC,+CA8DzC,IArDAA,CAAAA,CAAOC,2BAAAA,CAMPC,CAAAA,CAAkB,WAAA,CAIlB,CAACC,CAAAA,CAAwBC,CAAoB,CAAA,CAAIC,8CAAAA,CAAkC,CAAA,CASnF,CAACC,CAAAA,CAAmBC,CAAmB,CAAA,CAAIJ,CAAAA,CAA8CD,CAAe,CAAA,CAE9G,SAASM,CAAAA,CACPC,CAAAA,CACAC,CAAAA,CAMA,CACA,GAAM,CAAE,EAAA,CAAAC,CAAG,CAAA,CAAIC,CAAAA,CAAmBH,CAAAA,CAAcC,CAAK,CAAA,CAErD,MAAO,CACL,iBAAA,CAAmB,CAAA,sBAAA,EAAyBC,CAAE,CAAA,CAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/components/form.cjs","sourcesContent":[null,"'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormState,\n} from 'react-hook-form';\nimport type * as LabelPrimitive from '@radix-ui/react-label';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport { cn } from '@/lib/utils';\nimport { Label } from '@/components/label';\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\nconst FORM_FIELD_NAME = 'FormField';\n\ntype ScopedProps<P> = P & { __scopeFormField?: Scope };\n\nconst [createFormFieldContext, createFormFieldScope] = createContextScope(FORM_FIELD_NAME);\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\nconst [FormFieldProvider, useFormFieldContext] = createFormFieldContext<FormFieldContextValue>(FORM_FIELD_NAME);\n\nfunction useFormItem(\n consumerName: string,\n scope: Scope,\n): {\n formDescriptionId: string;\n formItemId: string;\n formMessageId: string;\n id: string;\n} {\n const { id } = useFormItemContext(consumerName, scope);\n\n return {\n formDescriptionId: `form-item-description-${id}`,\n formItemId: `form-item-${id}`,\n formMessageId: `form-item-message-${id}`,\n id,\n };\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>(formFieldProps: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n const { __scopeFormField, ...props } = formFieldProps as ScopedProps<FormFieldProps<TFieldValues, TName>>;\n\n return (\n <FormFieldProvider name={props.name} scope={__scopeFormField}>\n <Controller {...props} />\n </FormFieldProvider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\nconst FORM_ITEM_NAME = 'FormItem';\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst [FormItemProvider, useFormItemContext] = createFormFieldContext<FormItemContextValue>(FORM_ITEM_NAME);\n\ntype FormItemElement = HTMLDivElement;\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst FormItem = React.forwardRef<FormItemElement, FormItemProps>(\n ({ __scopeFormField, className, ...props }: ScopedProps<FormItemProps>, forwardedRef) => {\n const id = React.useId();\n\n return (\n <FormItemProvider id={id} scope={__scopeFormField}>\n <div ref={forwardedRef} className={cn('space-y-2', className)} {...props} />\n </FormItemProvider>\n );\n },\n);\n\nFormItem.displayName = FORM_ITEM_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\nconst FORM_LABEL_NAME = 'FormLabel';\n\ntype FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(\n ({ __scopeFormField, className, ...props }: ScopedProps<FormLabelProps>, forwardedRef) => {\n const { formItemId } = useFormItem(FORM_MESSAGE_NAME, __scopeFormField);\n const { name } = useFormFieldContext(FORM_LABEL_NAME, __scopeFormField);\n const { errors } = useFormState({ name });\n\n return (\n <Label\n ref={forwardedRef}\n className={cn(errors[name] && 'text-destructive', className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n },\n);\n\nFormLabel.displayName = FORM_LABEL_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\nconst FORM_CONTROL_NAME = 'FormControl';\n\ntype FormControlElement = React.ElementRef<typeof Slot>;\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\n\nconst FormControl = React.forwardRef<FormControlElement, FormControlProps>(\n ({ __scopeFormField, ...props }: ScopedProps<FormControlProps>, forwardedRef) => {\n const { formItemId, formDescriptionId, formMessageId } = useFormItem(FORM_MESSAGE_NAME, __scopeFormField);\n const { name } = useFormFieldContext(FORM_CONTROL_NAME, __scopeFormField);\n const { errors } = useFormState({ name });\n\n return (\n <Slot\n ref={forwardedRef}\n aria-describedby={!errors[name] ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={Boolean(errors[name])}\n id={formItemId}\n {...props}\n />\n );\n },\n);\n\nFormControl.displayName = FORM_CONTROL_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\nconst FORM_DESCRIPTION_NAME = 'FormDescription';\n\ntype FormDescriptionElement = HTMLParagraphElement;\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormDescription = React.forwardRef<FormDescriptionElement, FormDescriptionProps>(\n ({ __scopeFormField, className, ...props }: ScopedProps<FormDescriptionProps>, forwardedRef) => {\n const { formDescriptionId } = useFormItem(FORM_MESSAGE_NAME, __scopeFormField);\n\n return (\n <p\n ref={forwardedRef}\n className={cn('text-muted-foreground text-xs', className)}\n id={formDescriptionId}\n {...props}\n />\n );\n },\n);\n\nFormDescription.displayName = FORM_DESCRIPTION_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\nconst FORM_MESSAGE_NAME = 'FormMessage';\n\ntype FormMessageElement = HTMLParagraphElement;\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(\n ({ __scopeFormField, children, className, ...props }: ScopedProps<FormMessageProps>, forwardedRef) => {\n const { formMessageId } = useFormItem(FORM_MESSAGE_NAME, __scopeFormField);\n const { name } = useFormFieldContext(FORM_MESSAGE_NAME, __scopeFormField);\n const { errors } = useFormState({ name });\n const body = errors[name]?.message ? String(errors[name].message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={forwardedRef}\n className={cn(\n 'text-xs',\n errors[name]?.message ? 'text-destructive font-medium' : 'text-muted-foreground',\n className,\n )}\n id={formMessageId}\n {...props}\n >\n {body}\n </p>\n );\n },\n);\n\nFormMessage.displayName = FORM_MESSAGE_NAME;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n createFormFieldScope,\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":["/home/runner/work/codefast/codefast/packages/ui/dist/components/form.cjs","../../src/components/form.tsx"],"names":["Form","FormProvider","FORM_FIELD_NAME","createFormFieldContext","createFormFieldScope","createContextScope","FormFieldProvider","useFormFieldContext","useFormItem","consumerName","scope","id","useFormItemContext"],"mappings":"AAAA,22BAAY,CAAC,yDAAyC,yDAA0C,uECEzE,iDACF,gDASd,uDAEwC,gCACxB,+CA8DjB,IArDAA,CAAAA,CAAOC,2BAAAA,CAMPC,CAAAA,CAAkB,WAAA,CAIlB,CAACC,CAAAA,CAAwBC,CAAoB,CAAA,CAAIC,8CAAAA,CAAkC,CAAA,CASnF,CAACC,CAAAA,CAAmBC,CAAmB,CAAA,CAAIJ,CAAAA,CAA8CD,CAAe,CAAA,CAE9G,SAASM,CAAAA,CACPC,CAAAA,CACAC,CAAAA,CAMA,CACA,GAAM,CAAE,EAAA,CAAAC,CAAG,CAAA,CAAIC,CAAAA,CAAmBH,CAAAA,CAAcC,CAAK,CAAA,CAErD,MAAO,CACL,iBAAA,CAAmB,CAAA,sBAAA,EAAyBC,CAAE,CAAA,CAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/components/form.cjs","sourcesContent":[null,"'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n FormProvider,\n type GlobalError,\n useFormState,\n} from 'react-hook-form';\nimport type * as LabelPrimitive from '@radix-ui/react-label';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport { result } from 'lodash';\nimport { cn } from '@/lib/utils';\nimport { Label } from '@/components/label';\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\nconst FORM_FIELD_NAME = 'FormField';\n\ntype ScopedProps<P> = P & { __scopeFormField?: Scope };\n\nconst [createFormFieldContext, createFormFieldScope] = createContextScope(FORM_FIELD_NAME);\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\nconst [FormFieldProvider, useFormFieldContext] = createFormFieldContext<FormFieldContextValue>(FORM_FIELD_NAME);\n\nfunction useFormItem(\n consumerName: string,\n scope: Scope,\n): {\n formDescriptionId: string;\n formItemId: string;\n formMessageId: string;\n id: string;\n} {\n const { id } = useFormItemContext(consumerName, scope);\n\n return {\n formDescriptionId: `form-item-description-${id}`,\n formItemId: `form-item-${id}`,\n formMessageId: `form-item-message-${id}`,\n id,\n };\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>(formFieldProps: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n const { __scopeFormField, ...props } = formFieldProps as ScopedProps<FormFieldProps<TFieldValues, TName>>;\n\n return (\n <FormFieldProvider name={props.name} scope={__scopeFormField}>\n <Controller {...props} />\n </FormFieldProvider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\nconst FORM_ITEM_NAME = 'FormItem';\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst [FormItemProvider, useFormItemContext] = createFormFieldContext<FormItemContextValue>(FORM_ITEM_NAME);\n\ntype FormItemElement = HTMLDivElement;\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst FormItem = React.forwardRef<FormItemElement, FormItemProps>(\n ({ __scopeFormField, className, ...props }: ScopedProps<FormItemProps>, forwardedRef) => {\n const id = React.useId();\n\n return (\n <FormItemProvider id={id} scope={__scopeFormField}>\n <div ref={forwardedRef} className={cn('space-y-2', className)} {...props} />\n </FormItemProvider>\n );\n },\n);\n\nFormItem.displayName = FORM_ITEM_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\nconst FORM_LABEL_NAME = 'FormLabel';\n\ntype FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(\n ({ __scopeFormField, ...props }: ScopedProps<FormLabelProps>, forwardedRef) => {\n const { formItemId } = useFormItem(FORM_MESSAGE_NAME, __scopeFormField);\n\n return <Label ref={forwardedRef} htmlFor={formItemId} {...props} />;\n },\n);\n\nFormLabel.displayName = FORM_LABEL_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\nconst FORM_CONTROL_NAME = 'FormControl';\n\ntype FormControlElement = React.ElementRef<typeof Slot>;\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\n\nconst FormControl = React.forwardRef<FormControlElement, FormControlProps>(\n ({ __scopeFormField, ...props }: ScopedProps<FormControlProps>, forwardedRef) => {\n const { formItemId, formDescriptionId, formMessageId } = useFormItem(FORM_MESSAGE_NAME, __scopeFormField);\n const { name } = useFormFieldContext(FORM_CONTROL_NAME, __scopeFormField);\n const { errors } = useFormState({ name });\n\n return (\n <Slot\n ref={forwardedRef}\n aria-describedby={!errors[name] ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={Boolean(errors[name])}\n id={formItemId}\n {...props}\n />\n );\n },\n);\n\nFormControl.displayName = FORM_CONTROL_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\nconst FORM_DESCRIPTION_NAME = 'FormDescription';\n\ntype FormDescriptionElement = HTMLParagraphElement;\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormDescription = React.forwardRef<FormDescriptionElement, FormDescriptionProps>(\n ({ __scopeFormField, className, ...props }: ScopedProps<FormDescriptionProps>, forwardedRef) => {\n const { formDescriptionId } = useFormItem(FORM_MESSAGE_NAME, __scopeFormField);\n\n return (\n <p\n ref={forwardedRef}\n className={cn('text-muted-foreground text-xs', className)}\n id={formDescriptionId}\n {...props}\n />\n );\n },\n);\n\nFormDescription.displayName = FORM_DESCRIPTION_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\nconst FORM_MESSAGE_NAME = 'FormMessage';\n\ntype FormMessageElement = HTMLParagraphElement;\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(\n ({ __scopeFormField, children, className, ...props }: ScopedProps<FormMessageProps>, forwardedRef) => {\n const { formMessageId } = useFormItem(FORM_MESSAGE_NAME, __scopeFormField);\n const { name } = useFormFieldContext(FORM_MESSAGE_NAME, __scopeFormField);\n const { errors } = useFormState({ name });\n const error = result<GlobalError | null>(errors, name);\n const body = error?.message ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={forwardedRef}\n className={cn('text-xs', error?.message ? 'text-destructive font-medium' : 'text-muted-foreground', className)}\n id={formMessageId}\n {...props}\n >\n {body}\n </p>\n );\n },\n);\n\nFormMessage.displayName = FORM_MESSAGE_NAME;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n createFormFieldScope,\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 u}from"../chunk-YHZ3FJ6Z.js";import{a as F}from"../chunk-VRBUDJBH.js";import*as i from"react";import{Slot as T}from"@radix-ui/react-slot";import{Controller as g,FormProvider as C,useFormState as c}from"react-hook-form";import{createContextScope as N}from"@radix-ui/react-context";import{jsx as a}from"react/jsx-runtime";var B=C,y="FormField",[I,W]=N(y),[x,P]=I(y);function d(o,r){let{id:e}=V(o,r);return{formDescriptionId:`form-item-description-${e}`,formItemId:`form-item-${e}`,formMessageId:`form-item-message-${e}`,id:e}}function G(o){let{__scopeFormField:r,...e}=o;return a(x,{name:e.name,scope:r,children:a(g,{...e})})}var M="FormItem",[L,V]=I(M),S=i.forwardRef(({__scopeFormField:o,className:r,...e},m)=>{let t=i.useId();return a(L,{id:t,scope:o,children:a("div",{ref:m,className:F("space-y-2",r),...e})})});S.displayName=M;var R="FormLabel",b=i.forwardRef(({__scopeFormField:o,className:r,...e},m)=>{let{formItemId:t}=d(p,o),{name:l}=P(R,o),{errors:s}=c({name:l});return a(u,{ref:m,className:F(s[l]&&"text-destructive",r),htmlFor:t,...e})});b.displayName=R;var E="FormControl",D=i.forwardRef(({__scopeFormField:o,...r},e)=>{let{formItemId:m,formDescriptionId:t,formMessageId:l}=d(p,o),{name:s}=P(E,o),{errors:n}=c({name:s});return a(T,{ref:e,"aria-describedby":n[s]?`${t} ${l}`:t,"aria-invalid":!!n[s],id:m,...r})});D.displayName=E;var v="FormDescription",h=i.forwardRef(({__scopeFormField:o,className:r,...e},m)=>{let{formDescriptionId:t}=d(p,o);return a("p",{ref:m,className:F("text-muted-foreground text-xs",r),id:t,...e})});h.displayName=v;var p="FormMessage",A=i.forwardRef(({__scopeFormField:o,children:r,className:e,...m},t)=>{let{formMessageId:l}=d(p,o),{name:s}=P(p,o),{errors:n}=c({name:s}),f=n[s]?.message?String(n[s].message):r;return f?a("p",{ref:t,className:F("text-xs",n[s]?.message?"text-destructive font-medium":"text-muted-foreground",e),id:l,...m,children:f}):null});A.displayName=p;export{B as Form,D as FormControl,h as FormDescription,G as FormField,S as FormItem,b as FormLabel,A as FormMessage,W as createFormFieldScope};
1
+ "use client";import{a as f}from"../chunk-YHZ3FJ6Z.js";import{a as p}from"../chunk-VRBUDJBH.js";import*as a from"react";import{Slot as T}from"@radix-ui/react-slot";import{Controller as g,FormProvider as C,useFormState as u}from"react-hook-form";import{createContextScope as L}from"@radix-ui/react-context";import{result as N}from"lodash";import{jsx as m}from"react/jsx-runtime";var J=C,y="FormField",[I,X]=L(y),[V,M]=I(y);function F(o,r){let{id:e}=S(o,r);return{formDescriptionId:`form-item-description-${e}`,formItemId:`form-item-${e}`,formMessageId:`form-item-message-${e}`,id:e}}function k(o){let{__scopeFormField:r,...e}=o;return m(V,{name:e.name,scope:r,children:m(g,{...e})})}var R="FormItem",[x,S]=I(R),b=a.forwardRef(({__scopeFormField:o,className:r,...e},t)=>{let s=a.useId();return m(x,{id:s,scope:o,children:m("div",{ref:t,className:p("space-y-2",r),...e})})});b.displayName=R;var D="FormLabel",h=a.forwardRef(({__scopeFormField:o,...r},e)=>{let{formItemId:t}=F(l,o);return m(f,{ref:e,htmlFor:t,...r})});h.displayName=D;var E="FormControl",v=a.forwardRef(({__scopeFormField:o,...r},e)=>{let{formItemId:t,formDescriptionId:s,formMessageId:d}=F(l,o),{name:i}=M(E,o),{errors:n}=u({name:i});return m(T,{ref:e,"aria-describedby":n[i]?`${s} ${d}`:s,"aria-invalid":!!n[i],id:t,...r})});v.displayName=E;var _="FormDescription",A=a.forwardRef(({__scopeFormField:o,className:r,...e},t)=>{let{formDescriptionId:s}=F(l,o);return m("p",{ref:t,className:p("text-muted-foreground text-xs",r),id:s,...e})});A.displayName=_;var l="FormMessage",H=a.forwardRef(({__scopeFormField:o,children:r,className:e,...t},s)=>{let{formMessageId:d}=F(l,o),{name:i}=M(l,o),{errors:n}=u({name:i}),c=N(n,i),P=c?.message?String(c.message):r;return P?m("p",{ref:s,className:p("text-xs",c?.message?"text-destructive font-medium":"text-muted-foreground",e),id:d,...t,children:P}):null});H.displayName=l;export{J as Form,v as FormControl,A as FormDescription,k as FormField,b as FormItem,h as FormLabel,H as FormMessage,X as createFormFieldScope};
2
2
  //# sourceMappingURL=form.js.map