@codefast/ui 0.1.46 → 0.1.48

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 (195) hide show
  1. package/dist/{chunk-TIDJ4IXN.js → chunk-24TJIVWR.js} +2 -2
  2. package/dist/chunk-24TJIVWR.js.map +1 -0
  3. package/dist/{chunk-5EOCDFOA.js → chunk-2ETHQRHT.js} +1 -1
  4. package/dist/{chunk-5EOCDFOA.js.map → chunk-2ETHQRHT.js.map} +1 -1
  5. package/dist/{chunk-SE67MHSM.cjs → chunk-2U4H7AXC.cjs} +1 -1
  6. package/dist/{chunk-SE67MHSM.cjs.map → chunk-2U4H7AXC.cjs.map} +1 -1
  7. package/dist/chunk-2XO4KTBF.js +4 -0
  8. package/dist/chunk-2XO4KTBF.js.map +1 -0
  9. package/dist/chunk-3SJHSQTX.cjs +4 -0
  10. package/dist/chunk-3SJHSQTX.cjs.map +1 -0
  11. package/dist/{chunk-GKLXJ6JZ.js → chunk-3TOWLKUY.js} +2 -2
  12. package/dist/{chunk-4SNJ7GUK.cjs → chunk-3TS74A2W.cjs} +2 -2
  13. package/dist/{chunk-4SNJ7GUK.cjs.map → chunk-3TS74A2W.cjs.map} +1 -1
  14. package/dist/{chunk-XT5YE5R2.js → chunk-432ZMHFM.js} +1 -1
  15. package/dist/{chunk-XT5YE5R2.js.map → chunk-432ZMHFM.js.map} +1 -1
  16. package/dist/{chunk-DW3EYXPU.js → chunk-5I7UA4HT.js} +2 -2
  17. package/dist/{chunk-ID2R45SP.js → chunk-5LM6T7Z5.js} +2 -2
  18. package/dist/{chunk-EMTBWZS5.js → chunk-7KTCYDVV.js} +1 -1
  19. package/dist/chunk-7KTCYDVV.js.map +1 -0
  20. package/dist/{chunk-X42QLXWG.cjs → chunk-7R4FFNVE.cjs} +1 -1
  21. package/dist/chunk-7R4FFNVE.cjs.map +1 -0
  22. package/dist/chunk-A5RTV4IE.js +2 -0
  23. package/dist/chunk-A5RTV4IE.js.map +1 -0
  24. package/dist/{chunk-D5NE25K4.cjs → chunk-B5V32KRW.cjs} +1 -1
  25. package/dist/{chunk-D5NE25K4.cjs.map → chunk-B5V32KRW.cjs.map} +1 -1
  26. package/dist/{chunk-5AMKXKNG.cjs → chunk-BCWKI4D5.cjs} +1 -1
  27. package/dist/{chunk-5AMKXKNG.cjs.map → chunk-BCWKI4D5.cjs.map} +1 -1
  28. package/dist/{chunk-UZVJRS6A.cjs → chunk-D3EC6HWN.cjs} +1 -1
  29. package/dist/{chunk-UZVJRS6A.cjs.map → chunk-D3EC6HWN.cjs.map} +1 -1
  30. package/dist/{chunk-6K73VTHO.cjs → chunk-DH7PAQN6.cjs} +1 -1
  31. package/dist/{chunk-6K73VTHO.cjs.map → chunk-DH7PAQN6.cjs.map} +1 -1
  32. package/dist/{chunk-HRZK3CQ7.cjs → chunk-DIYHARQU.cjs} +1 -1
  33. package/dist/{chunk-HRZK3CQ7.cjs.map → chunk-DIYHARQU.cjs.map} +1 -1
  34. package/dist/{chunk-R33J2GFB.cjs → chunk-DQBQF25F.cjs} +2 -2
  35. package/dist/{chunk-R33J2GFB.cjs.map → chunk-DQBQF25F.cjs.map} +1 -1
  36. package/dist/{chunk-WWXKOWL5.cjs → chunk-FINPFQTZ.cjs} +2 -2
  37. package/dist/{chunk-WWXKOWL5.cjs.map → chunk-FINPFQTZ.cjs.map} +1 -1
  38. package/dist/{chunk-A4ES3QAG.js → chunk-GND6Q575.js} +1 -1
  39. package/dist/{chunk-A4ES3QAG.js.map → chunk-GND6Q575.js.map} +1 -1
  40. package/dist/{chunk-UY4UMO62.cjs → chunk-GWSYICGK.cjs} +1 -1
  41. package/dist/chunk-GWSYICGK.cjs.map +1 -0
  42. package/dist/{chunk-H4LRGPZE.js → chunk-I5F5NVBQ.js} +1 -1
  43. package/dist/{chunk-H4LRGPZE.js.map → chunk-I5F5NVBQ.js.map} +1 -1
  44. package/dist/{chunk-CESXUMO5.cjs → chunk-I6LNZ6KP.cjs} +1 -1
  45. package/dist/chunk-I6LNZ6KP.cjs.map +1 -0
  46. package/dist/{chunk-JMWX562R.cjs → chunk-IPRXHJQ5.cjs} +2 -2
  47. package/dist/{chunk-JMWX562R.cjs.map → chunk-IPRXHJQ5.cjs.map} +1 -1
  48. package/dist/{chunk-GGYAR4OZ.cjs → chunk-JF2OKUYD.cjs} +1 -1
  49. package/dist/chunk-JF2OKUYD.cjs.map +1 -0
  50. package/dist/{chunk-G5JHC5KL.js → chunk-JMYWGU6A.js} +1 -1
  51. package/dist/chunk-JMYWGU6A.js.map +1 -0
  52. package/dist/{chunk-GE4JWO3I.cjs → chunk-KZJA37DU.cjs} +1 -1
  53. package/dist/chunk-KZJA37DU.cjs.map +1 -0
  54. package/dist/{chunk-4JGHSI6R.js → chunk-L75DLRYU.js} +1 -1
  55. package/dist/{chunk-4JGHSI6R.js.map → chunk-L75DLRYU.js.map} +1 -1
  56. package/dist/{chunk-QOFZCBXJ.js → chunk-LGRBBJSZ.js} +1 -1
  57. package/dist/{chunk-QOFZCBXJ.js.map → chunk-LGRBBJSZ.js.map} +1 -1
  58. package/dist/{chunk-26S2QXC7.js → chunk-MO7TQSRR.js} +1 -1
  59. package/dist/{chunk-26S2QXC7.js.map → chunk-MO7TQSRR.js.map} +1 -1
  60. package/dist/{chunk-JYWXLD4K.js → chunk-MYT23AOL.js} +2 -2
  61. package/dist/{chunk-QZNLFVJH.js → chunk-NPOAOTIH.js} +2 -2
  62. package/dist/{chunk-T35I2SOF.js → chunk-OH3BXT6D.js} +1 -1
  63. package/dist/chunk-OH3BXT6D.js.map +1 -0
  64. package/dist/{chunk-ZI7RJRUO.cjs → chunk-OKI5PENP.cjs} +2 -2
  65. package/dist/{chunk-ZI7RJRUO.cjs.map → chunk-OKI5PENP.cjs.map} +1 -1
  66. package/dist/{chunk-H5UMT3XD.js → chunk-P5ZHKPJ3.js} +1 -1
  67. package/dist/chunk-P5ZHKPJ3.js.map +1 -0
  68. package/dist/{chunk-FEFWHSO2.js → chunk-PCKCN7MO.js} +2 -2
  69. package/dist/{chunk-7F3GJBN7.cjs → chunk-PEQRNG2R.cjs} +1 -1
  70. package/dist/chunk-PEQRNG2R.cjs.map +1 -0
  71. package/dist/{chunk-YEXZOAP7.js → chunk-Q3UBBFLY.js} +1 -1
  72. package/dist/chunk-Q3UBBFLY.js.map +1 -0
  73. package/dist/{chunk-7BV7KHES.js → chunk-QEIZTAWS.js} +2 -2
  74. package/dist/{chunk-P4ZI73OW.cjs → chunk-R5235IUC.cjs} +2 -2
  75. package/dist/{chunk-P4ZI73OW.cjs.map → chunk-R5235IUC.cjs.map} +1 -1
  76. package/dist/{chunk-GDDLLNIC.cjs → chunk-SDGFNHJP.cjs} +2 -2
  77. package/dist/{chunk-GDDLLNIC.cjs.map → chunk-SDGFNHJP.cjs.map} +1 -1
  78. package/dist/{chunk-4VQTYHQU.js → chunk-UL2FIEEV.js} +1 -1
  79. package/dist/chunk-UL2FIEEV.js.map +1 -0
  80. package/dist/chunk-VA36YONO.cjs +2 -0
  81. package/dist/chunk-VA36YONO.cjs.map +1 -0
  82. package/dist/{chunk-J2RBV45Z.cjs → chunk-VBE6D4FZ.cjs} +1 -1
  83. package/dist/chunk-VBE6D4FZ.cjs.map +1 -0
  84. package/dist/{chunk-54U6NKNG.js → chunk-VPA4U2FS.js} +1 -1
  85. package/dist/chunk-VPA4U2FS.js.map +1 -0
  86. package/dist/{chunk-LRJWDHBO.cjs → chunk-W7777KAF.cjs} +1 -1
  87. package/dist/{chunk-LRJWDHBO.cjs.map → chunk-W7777KAF.cjs.map} +1 -1
  88. package/dist/{chunk-LWL25GQK.js → chunk-WLRNKE5B.js} +1 -1
  89. package/dist/{chunk-LWL25GQK.js.map → chunk-WLRNKE5B.js.map} +1 -1
  90. package/dist/{chunk-UMQEKWWU.js → chunk-XVSKGP3O.js} +1 -1
  91. package/dist/chunk-XVSKGP3O.js.map +1 -0
  92. package/dist/{chunk-YIKHBOHK.cjs → chunk-XWRE723Z.cjs} +1 -1
  93. package/dist/chunk-XWRE723Z.cjs.map +1 -0
  94. package/dist/{chunk-E6I2SA6E.cjs → chunk-YB2W76VX.cjs} +1 -1
  95. package/dist/{chunk-E6I2SA6E.cjs.map → chunk-YB2W76VX.cjs.map} +1 -1
  96. package/dist/{chunk-55AJ7WQD.cjs → chunk-YORY32TX.cjs} +1 -1
  97. package/dist/chunk-YORY32TX.cjs.map +1 -0
  98. package/dist/{chunk-MYTMAPSH.js → chunk-YTSBANYY.js} +1 -1
  99. package/dist/chunk-YTSBANYY.js.map +1 -0
  100. package/dist/{chunk-UWLNRXT2.cjs → chunk-Z7U5IONC.cjs} +2 -2
  101. package/dist/{chunk-UWLNRXT2.cjs.map → chunk-Z7U5IONC.cjs.map} +1 -1
  102. package/dist/components/alert-dialog.cjs +1 -1
  103. package/dist/components/alert-dialog.js +1 -1
  104. package/dist/components/blockquote.cjs +1 -1
  105. package/dist/components/blockquote.js +1 -1
  106. package/dist/components/box.cjs +1 -1
  107. package/dist/components/box.js +1 -1
  108. package/dist/components/breadcrumb.cjs +1 -1
  109. package/dist/components/breadcrumb.js +1 -1
  110. package/dist/components/button.cjs +1 -1
  111. package/dist/components/button.js +1 -1
  112. package/dist/components/carousel.cjs +1 -1
  113. package/dist/components/carousel.js +1 -1
  114. package/dist/components/chart.cjs +1 -1
  115. package/dist/components/chart.js +1 -1
  116. package/dist/components/code.cjs +1 -1
  117. package/dist/components/code.js +1 -1
  118. package/dist/components/command.cjs +1 -1
  119. package/dist/components/command.js +1 -1
  120. package/dist/components/container.cjs +1 -1
  121. package/dist/components/container.js +1 -1
  122. package/dist/components/context-menu.cjs +1 -1
  123. package/dist/components/context-menu.js +1 -1
  124. package/dist/components/data-table.cjs +1 -1
  125. package/dist/components/data-table.js +1 -1
  126. package/dist/components/dialog.cjs +1 -1
  127. package/dist/components/dialog.js +1 -1
  128. package/dist/components/dropdown-menu.cjs +1 -1
  129. package/dist/components/dropdown-menu.js +1 -1
  130. package/dist/components/em.cjs +1 -1
  131. package/dist/components/em.js +1 -1
  132. package/dist/components/number-input.cjs +1 -1
  133. package/dist/components/number-input.js +1 -1
  134. package/dist/components/password-input.cjs +1 -1
  135. package/dist/components/password-input.js +1 -1
  136. package/dist/components/pre.cjs +1 -1
  137. package/dist/components/pre.js +1 -1
  138. package/dist/components/quote.cjs +1 -1
  139. package/dist/components/quote.js +1 -1
  140. package/dist/components/radio.cjs +1 -1
  141. package/dist/components/radio.js +1 -1
  142. package/dist/components/search-input.cjs +1 -1
  143. package/dist/components/search-input.js +1 -1
  144. package/dist/components/separator.cjs +1 -1
  145. package/dist/components/separator.js +1 -1
  146. package/dist/components/sheet.cjs +1 -1
  147. package/dist/components/sheet.js +1 -1
  148. package/dist/components/sidebar.cjs +2 -0
  149. package/dist/components/sidebar.cjs.map +1 -0
  150. package/dist/components/sidebar.d.cts +155 -0
  151. package/dist/components/sidebar.d.ts +155 -0
  152. package/dist/components/sidebar.js +2 -0
  153. package/dist/components/sidebar.js.map +1 -0
  154. package/dist/components/spinner.cjs +1 -1
  155. package/dist/components/spinner.js +1 -1
  156. package/dist/components/text-input.cjs +1 -1
  157. package/dist/components/text-input.js +1 -1
  158. package/dist/components/text.cjs +1 -1
  159. package/dist/components/text.js +1 -1
  160. package/dist/index.cjs +1 -1
  161. package/dist/index.cjs.map +1 -1
  162. package/dist/index.d.cts +1 -0
  163. package/dist/index.d.ts +1 -0
  164. package/dist/index.js +1 -1
  165. package/package.json +19 -17
  166. package/dist/chunk-4VQTYHQU.js.map +0 -1
  167. package/dist/chunk-54U6NKNG.js.map +0 -1
  168. package/dist/chunk-55AJ7WQD.cjs.map +0 -1
  169. package/dist/chunk-7F3GJBN7.cjs.map +0 -1
  170. package/dist/chunk-CESXUMO5.cjs.map +0 -1
  171. package/dist/chunk-DWGSQAGA.js +0 -4
  172. package/dist/chunk-DWGSQAGA.js.map +0 -1
  173. package/dist/chunk-EMTBWZS5.js.map +0 -1
  174. package/dist/chunk-G5JHC5KL.js.map +0 -1
  175. package/dist/chunk-GE4JWO3I.cjs.map +0 -1
  176. package/dist/chunk-GGYAR4OZ.cjs.map +0 -1
  177. package/dist/chunk-H5UMT3XD.js.map +0 -1
  178. package/dist/chunk-J2RBV45Z.cjs.map +0 -1
  179. package/dist/chunk-MYTMAPSH.js.map +0 -1
  180. package/dist/chunk-SU25A7H6.cjs +0 -4
  181. package/dist/chunk-SU25A7H6.cjs.map +0 -1
  182. package/dist/chunk-T35I2SOF.js.map +0 -1
  183. package/dist/chunk-TIDJ4IXN.js.map +0 -1
  184. package/dist/chunk-UMQEKWWU.js.map +0 -1
  185. package/dist/chunk-UY4UMO62.cjs.map +0 -1
  186. package/dist/chunk-X42QLXWG.cjs.map +0 -1
  187. package/dist/chunk-YEXZOAP7.js.map +0 -1
  188. package/dist/chunk-YIKHBOHK.cjs.map +0 -1
  189. /package/dist/{chunk-GKLXJ6JZ.js.map → chunk-3TOWLKUY.js.map} +0 -0
  190. /package/dist/{chunk-DW3EYXPU.js.map → chunk-5I7UA4HT.js.map} +0 -0
  191. /package/dist/{chunk-ID2R45SP.js.map → chunk-5LM6T7Z5.js.map} +0 -0
  192. /package/dist/{chunk-JYWXLD4K.js.map → chunk-MYT23AOL.js.map} +0 -0
  193. /package/dist/{chunk-QZNLFVJH.js.map → chunk-NPOAOTIH.js.map} +0 -0
  194. /package/dist/{chunk-FEFWHSO2.js.map → chunk-PCKCN7MO.js.map} +0 -0
  195. /package/dist/{chunk-7BV7KHES.js.map → chunk-QEIZTAWS.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-YEXZOAP7.js";import{a as s}from"./chunk-EVRI6TWT.js";import{forwardRef as c}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var d=c(({children:t,className:u,variant:a,size:f,icon:i,inside:m,disabled:B,loading:e,prefix:x,suffix:b,loaderPosition:p="prefix",spinner:r,...y},N)=>l("button",{ref:N,className:s({className:u,icon:i,inside:m,size:f,variant:a}),disabled:e||B,type:"button",...y,children:[e&&p==="prefix"?r||n(o,{}):x,typeof t=="string"?n("span",{className:"truncate",children:t}):t,e&&p==="suffix"?r||n(o,{}):b]}));d.displayName="Button";export{d as a};
2
- //# sourceMappingURL=chunk-TIDJ4IXN.js.map
1
+ import{a as o}from"./chunk-Q3UBBFLY.js";import{a as s}from"./chunk-EVRI6TWT.js";import{forwardRef as c}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var d=c(({children:t,className:u,variant:a,size:f,icon:i,inside:m,disabled:B,loading:e,prefix:x,suffix:b,loaderPosition:p="prefix",spinner:r,...y},N)=>l("button",{ref:N,className:s({className:u,icon:i,inside:m,size:f,variant:a}),disabled:e||B,type:"button",...y,children:[e&&p==="prefix"?r||n(o,{}):x,typeof t=="string"?n("span",{className:"truncate",children:t}):t,e&&p==="suffix"?r||n(o,{}):b]}));d.displayName="Button";export{d as a};
2
+ //# sourceMappingURL=chunk-24TJIVWR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/button.tsx"],"names":["forwardRef","jsx","jsxs","Button","children","className","variant","size","icon","inside","disabled","loading","prefix","suffix","loaderPosition","spinner","props","forwardedRef","buttonVariants","Spinner"],"mappings":"gFAAA,OAAoC,cAAAA,MAAkC,QAqClE,OAauD,OAAAC,EAbvD,QAAAC,MAAA,oBAnBJ,IAAMC,EAASH,EACb,CACE,CACE,SAAAI,EACA,UAAAC,EACA,QAAAC,EACA,KAAAC,EACA,KAAAC,EACA,OAAAC,EACA,SAAAC,EACA,QAAAC,EACA,OAAAC,EACA,OAAAC,EACA,eAAAC,EAAiB,SACjB,QAAAC,EACA,GAAGC,CACL,EACAC,IAEAf,EAAC,UACC,IAAKe,EACL,UAAWC,EAAe,CACxB,UAAAb,EACA,KAAAG,EACA,OAAAC,EACA,KAAAF,EACA,QAAAD,CACF,CAAC,EACD,SAAUK,GAAWD,EACrB,KAAK,SACJ,GAAGM,EAEH,UAAAL,GAAWG,IAAmB,SAAWC,GAAWd,EAACkB,EAAA,EAAQ,EAAKP,EAClE,OAAOR,GAAa,SAAWH,EAAC,QAAK,UAAU,WAAY,SAAAG,EAAS,EAAUA,EAC9EO,GAAWG,IAAmB,SAAWC,GAAWd,EAACkB,EAAA,EAAQ,EAAKN,GACrE,CAEJ,EAEAV,EAAO,YAAc","sourcesContent":["import { type ButtonHTMLAttributes, forwardRef, type ReactNode } from 'react';\n\nimport { Spinner } from '@/components/spinner';\nimport { buttonVariants, type ButtonVariantsProps } from '@/styles/button-variants';\n\n/* -----------------------------------------------------------------------------\n * Component: Button\n * -------------------------------------------------------------------------- */\n\ntype ButtonElement = HTMLButtonElement;\ninterface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'prefix'>, ButtonVariantsProps {\n loaderPosition?: 'prefix' | 'suffix';\n loading?: boolean;\n prefix?: ReactNode;\n spinner?: ReactNode;\n suffix?: ReactNode;\n}\n\nconst Button = forwardRef<ButtonElement, ButtonProps>(\n (\n {\n children,\n className,\n variant,\n size,\n icon,\n inside,\n disabled,\n loading,\n prefix,\n suffix,\n loaderPosition = 'prefix',\n spinner,\n ...props\n },\n forwardedRef,\n ) => (\n <button\n ref={forwardedRef}\n className={buttonVariants({\n className,\n icon,\n inside,\n size,\n variant,\n })}\n disabled={loading || disabled}\n type=\"button\"\n {...props}\n >\n {loading && loaderPosition === 'prefix' ? spinner || <Spinner /> : prefix}\n {typeof children === 'string' ? <span className=\"truncate\">{children}</span> : children}\n {loading && loaderPosition === 'suffix' ? spinner || <Spinner /> : suffix}\n </button>\n ),\n);\n\nButton.displayName = 'Button';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Button, type ButtonProps };\n"]}
@@ -1,2 +1,2 @@
1
1
  import{Slot as o}from"@radix-ui/react-slot";import{forwardRef as r}from"react";import{jsx as p}from"react/jsx-runtime";var n=r(({asChild:e,...t},m)=>p(e?o:"em",{ref:m,...t}));n.displayName="Em";export{n as a};
2
- //# sourceMappingURL=chunk-5EOCDFOA.js.map
2
+ //# sourceMappingURL=chunk-2ETHQRHT.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/em.tsx"],"names":["Slot","forwardRef","jsx","Em","asChild","props","forwardedRef"],"mappings":"AAAA,OAAS,QAAAA,MAAY,uBACrB,OAAS,cAAAC,MAAuC,QAevC,cAAAC,MAAA,oBAHT,IAAMC,EAAKF,EAA+B,CAAC,CAAE,QAAAG,EAAS,GAAGC,CAAM,EAAGC,IAGzDJ,EAFWE,EAAUJ,EAAO,KAE3B,CAAU,IAAKM,EAAe,GAAGD,EAAO,CACjD,EAEDF,EAAG,YAAc","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { forwardRef, type HTMLAttributes } from 'react';\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ntype EmElement = HTMLElement;\n\ninterface EmProps extends HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nconst Em = forwardRef<EmElement, EmProps>(({ asChild, ...props }, forwardedRef) => {\n const Component = asChild ? Slot : 'em';\n\n return <Component ref={forwardedRef} {...props} />;\n});\n\nEm.displayName = 'Em';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"]}
1
+ {"version":3,"sources":["../src/components/em.tsx"],"names":["Slot","forwardRef","jsx","Em","asChild","props","forwardedRef"],"mappings":"AAAA,OAAS,QAAAA,MAAY,uBACrB,OAAS,cAAAC,MAAuC,QAcvC,cAAAC,MAAA,oBAHT,IAAMC,EAAKF,EAA+B,CAAC,CAAE,QAAAG,EAAS,GAAGC,CAAM,EAAGC,IAGzDJ,EAFWE,EAAUJ,EAAO,KAE3B,CAAU,IAAKM,EAAe,GAAGD,EAAO,CACjD,EAEDF,EAAG,YAAc","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { forwardRef, type HTMLAttributes } from 'react';\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ntype EmElement = HTMLElement;\ninterface EmProps extends HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nconst Em = forwardRef<EmElement, EmProps>(({ asChild, ...props }, forwardedRef) => {\n const Component = asChild ? Slot : 'em';\n\n return <Component ref={forwardedRef} {...props} />;\n});\n\nEm.displayName = 'Em';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"]}
@@ -1,2 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _reactslot = require('@radix-ui/react-slot');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var p=_react.forwardRef.call(void 0, ({asChild:e,...r},t)=>_jsxruntime.jsx.call(void 0, e?_reactslot.Slot:"pre",{ref:t,...r}));p.displayName="Pre";exports.a = p;
2
- //# sourceMappingURL=chunk-SE67MHSM.cjs.map
2
+ //# sourceMappingURL=chunk-2U4H7AXC.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/pre.tsx"],"names":["Pre","forwardRef","asChild","props","forwardedRef","jsx","Slot"],"mappings":"AAAA,0HAAqB,8BAC2B,+CAevC,IAHHA,CAAAA,CAAMC,+BAAAA,CAAkC,CAAE,OAAA,CAAAC,CAAAA,CAAS,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAG5DC,6BAAAA,CAFWH,CAAUI,eAAAA,CAAO,KAAA,CAE3B,CAAU,GAAA,CAAKF,CAAAA,CAAe,GAAGD,CAAAA,CAAO,CACjD,CAAA,CAEDH,CAAAA,CAAI,WAAA,CAAc,KAAA,CAAA,cAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-SE67MHSM.cjs","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { forwardRef, type HTMLAttributes } from 'react';\n\n/* -----------------------------------------------------------------------------\n * Component: Pre\n * -------------------------------------------------------------------------- */\n\ntype PreElement = HTMLPreElement;\n\ninterface PreProps extends HTMLAttributes<HTMLPreElement> {\n asChild?: boolean;\n}\n\nconst Pre = forwardRef<PreElement, PreProps>(({ asChild, ...props }, forwardedRef) => {\n const Component = asChild ? Slot : 'pre';\n\n return <Component ref={forwardedRef} {...props} />;\n});\n\nPre.displayName = 'Pre';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Pre, type PreProps };\n"]}
1
+ {"version":3,"sources":["../src/components/pre.tsx"],"names":["Pre","forwardRef","asChild","props","forwardedRef","jsx","Slot"],"mappings":"AAAA,0HAAqB,8BAC2B,+CAcvC,IAHHA,CAAAA,CAAMC,+BAAAA,CAAkC,CAAE,OAAA,CAAAC,CAAAA,CAAS,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAG5DC,6BAAAA,CAFWH,CAAUI,eAAAA,CAAO,KAAA,CAE3B,CAAU,GAAA,CAAKF,CAAAA,CAAe,GAAGD,CAAAA,CAAO,CACjD,CAAA,CAEDH,CAAAA,CAAI,WAAA,CAAc,KAAA,CAAA,cAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-2U4H7AXC.cjs","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { forwardRef, type HTMLAttributes } from 'react';\n\n/* -----------------------------------------------------------------------------\n * Component: Pre\n * -------------------------------------------------------------------------- */\n\ntype PreElement = HTMLPreElement;\ninterface PreProps extends HTMLAttributes<HTMLPreElement> {\n asChild?: boolean;\n}\n\nconst Pre = forwardRef<PreElement, PreProps>(({ asChild, ...props }, forwardedRef) => {\n const Component = asChild ? Slot : 'pre';\n\n return <Component ref={forwardedRef} {...props} />;\n});\n\nPre.displayName = 'Pre';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Pre, type PreProps };\n"]}
@@ -0,0 +1,4 @@
1
+ "use client";import{a as d}from"./chunk-VPYH6JWS.js";import{createContext as M,forwardRef as x,useContext as H,useId as K,useMemo as k}from"react";import*as f from"recharts";import{Fragment as X,jsx as i,jsxs as g}from"react/jsx-runtime";var N={light:"",dark:".dark"},_=M(null);function w(){let e=H(_);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}var $=x(({children:e,className:n,config:t,id:o,...a},l)=>{let s=K(),c=`chart-${o||s.replace(/:/g,"")}`;return i(_.Provider,{value:{config:t},children:g("div",{ref:l,className:d("flex aspect-video justify-center text-xs","[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground","[&_.recharts-cartesian-grid_line]:stroke-border/50","[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border","[&_.recharts-dot]:stroke-transparent","[&_.recharts-layer]:outline-none","[&_.recharts-polar-grid_]:stroke-border","[&_.recharts-radial-bar-background-sector]:fill-muted","[&_.recharts-reference-line_]:stroke-border","[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted","[&_.recharts-sector]:outline-none","[&_.recharts-sector]:stroke-transparent","[&_.recharts-surface]:outline-none",n),"data-chart":c,...a,children:[i(I,{config:t,id:c}),i(f.ResponsiveContainer,{children:e})]})})});$.displayName="Chart";function I({id:e,config:n}){let t=k(()=>J(e,n),[e,n]);return i("style",{dangerouslySetInnerHTML:{__html:t}})}var Q=f.Tooltip,O=x(({active:e,className:n,color:t,formatter:o,hideIndicator:a=!1,hideLabel:l=!1,indicator:s="dot",label:c,labelClassName:p,labelFormatter:h,labelKey:y,nameKey:E,payload:u},j)=>{let{config:m}=w(),R=k(()=>{if(l||!u?.length)return null;let[r]=u;if(!r)return null;let P=`${y||r.dataKey||r.name||"value"}`,b=T(m,r,P),C=!y&&typeof c=="string"?m[c]?.label||c:b?.label;return h?i("div",{className:d("font-medium",p),children:h(C,u)}):C?i("div",{className:d("font-medium",p),children:C}):null},[m,l,c,p,h,y,u]);if(!e||!u?.length)return null;let v=u.length===1&&s!=="dot";return g("div",{ref:j,className:d("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",n),children:[v?null:R,i("div",{className:"grid gap-1.5",children:u.map((r,P)=>{let b=`${E||r.name||r.dataKey||"value"}`,C=T(m,r,b),S=t||r.payload.fill||r.color;return i("div",{className:d("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",s==="dot"&&"items-center"),children:o&&r.value!==void 0&&r.name?o(r.value,r.name,r,P,r.payload):g(X,{children:[C?.icon?i(C.icon,{}):!a&&i("div",{className:d("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":s==="dot","w-1":s==="line","w-0 border-[1.5px] border-dashed bg-transparent":s==="dashed","my-0.5":v&&s==="dashed"}),style:{"--color-bg":S,"--color-border":S}}),g("div",{className:d("flex flex-1 justify-between leading-none",v?"items-end":"items-center"),children:[g("div",{className:"grid gap-1.5",children:[v?R:null,i("span",{className:"text-muted-foreground",children:C?.label||r.name})]}),r.value?i("span",{className:"text-foreground font-mono font-medium tabular-nums",children:r.value.toLocaleString()}):null]})]})},r.dataKey)})})]})});O.displayName="ChartTooltipContent";var U=f.Legend,D=x(({className:e,hideIcon:n=!1,nameKey:t,payload:o,verticalAlign:a="bottom"},l)=>{let{config:s}=w();return o?.length?i("div",{ref:l,className:d("flex items-center justify-center gap-4",a==="top"?"pb-3":"pt-3",e),children:o.map(c=>{let p="value";t?p=t:c.dataKey&&(p=String(c.dataKey));let h=T(s,c,p);return g("div",{className:d("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:size-3"),children:[h?.icon&&!n?i(h.icon,{}):i("div",{className:"size-2 shrink-0 rounded",style:{backgroundColor:c.color}}),h?.label]},String(c.value))})}):null});D.displayName="ChartLegendContent";function T(e,n,t){if(!L(n))return;let o="payload"in n&&L(n.payload)?n.payload:void 0,a=V(n,o,t);return a in e?e[a]:e[t]}function L(e){return typeof e=="object"&&e!==null}function V(e,n,t){return t in e&&typeof e[t]=="string"?e[t]:n&&t in n&&typeof n[t]=="string"?n[t]:t}function z(e,n,t){let o=[];return o.push(`${N[e]} [data-chart=${n}] {`),t.forEach(([a,l])=>{let s=l.theme?.[e]||l.color;s&&o.push(` --color-${a}: ${s};`)}),o.push("}"),o.join(`
2
+ `)}function J(e,n){let t=Object.entries(n).filter(([a,{theme:l,color:s}])=>l||s),o=[];return Object.keys(N).forEach(a=>{let l=z(a,e,t);o.push(l)}),o.join(`
3
+ `)}export{$ as a,I as b,Q as c,O as d,U as e,D as f};
4
+ //# sourceMappingURL=chunk-2XO4KTBF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/chart.tsx"],"names":["createContext","forwardRef","useContext","useId","useMemo","RechartsPrimitive","Fragment","jsx","jsxs","THEMES","ChartContext","useChart","context","ChartContainer","children","className","config","id","props","ref","uniqueId","chartId","cn","ChartStyle","cssString","generateCSS","ChartTooltip","ChartTooltipContent","active","color","formatter","hideIndicator","hideLabel","indicator","label","labelClassName","labelFormatter","labelKey","nameKey","payload","tooltipLabel","item","key","itemConfig","getPayloadConfigFromPayload","value","nestLabel","index","indicatorColor","ChartLegend","ChartLegendContent","hideIcon","verticalAlign","isValidObject","nestedPayload","configLabelKey","getConfigLabelKey","obj","generateThemeCSS","theme","configEntries","rules","themeOrColorConfig","_","allRules","themeCSS"],"mappings":"wCAEA,OAGE,iBAAAA,EAEA,cAAAC,EAGA,cAAAC,EACA,SAAAC,EACA,WAAAC,MACK,QACP,UAAYC,MAAuB,WA6D3B,OAmJU,YAAAC,EA9HR,OAAAC,EArBF,QAAAC,MAAA,oBAxDR,IAAMC,EAAS,CACb,MAAO,GACP,KAAM,OACR,EAwBMC,EAAeV,EAAwC,IAAI,EAEjE,SAASW,GAA8B,CACrC,IAAMC,EAAUV,EAAWQ,CAAY,EAEvC,GAAI,CAACE,EACH,MAAM,IAAI,MAAM,mDAAmD,EAGrE,OAAOA,CACT,CAYA,IAAMC,EAAiBZ,EACrB,CAAC,CAAE,SAAAa,EAAU,UAAAC,EAAW,OAAAC,EAAQ,GAAAC,EAAI,GAAG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Content":["'use client';\n\nimport {\n type ComponentProps,\n type ComponentType,\n createContext,\n type CSSProperties,\n forwardRef,\n type JSX,\n type ReactNode,\n useContext,\n useId,\n useMemo,\n} from 'react';\nimport * as RechartsPrimitive from 'recharts';\nimport { type NameType, type Payload, type ValueType } from 'recharts/types/component/DefaultTooltipContent';\n\nimport { cn } from '@/lib/utils';\n\nconst THEMES = {\n light: '',\n dark: '.dark',\n} as const;\n\ntype Theme = keyof typeof THEMES;\n\ntype ChartConfig = {\n [k in string]: {\n icon?: ComponentType;\n label?: ReactNode;\n } & (\n | {\n color?: string;\n theme?: never;\n }\n | {\n theme: Record<Theme, string>;\n color?: never;\n }\n );\n};\n\ninterface ChartContextProps {\n config: ChartConfig;\n}\n\nconst ChartContext = createContext<ChartContextProps | null>(null);\n\nfunction useChart(): ChartContextProps {\n const context = useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: Chart\n * -------------------------------------------------------------------------- */\n\ntype ChartContainerElement = HTMLDivElement;\ninterface ChartContainerProps extends ComponentProps<'div'> {\n children: ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n config: ChartConfig;\n}\n\nconst ChartContainer = forwardRef<ChartContainerElement, ChartContainerProps>(\n ({ children, className, config, id, ...props }, ref) => {\n const uniqueId = useId();\n const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n ref={ref}\n className={cn(\n 'flex aspect-video justify-center text-xs',\n '[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground',\n '[&_.recharts-cartesian-grid_line]:stroke-border/50',\n '[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border',\n '[&_.recharts-dot]:stroke-transparent',\n '[&_.recharts-layer]:outline-none',\n '[&_.recharts-polar-grid_]:stroke-border',\n '[&_.recharts-radial-bar-background-sector]:fill-muted',\n '[&_.recharts-reference-line_]:stroke-border',\n '[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted',\n '[&_.recharts-sector]:outline-none',\n '[&_.recharts-sector]:stroke-transparent',\n '[&_.recharts-surface]:outline-none',\n className,\n )}\n data-chart={chartId}\n {...props}\n >\n <ChartStyle config={config} id={chartId} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n },\n);\n\nChartContainer.displayName = 'Chart';\n\n/* -----------------------------------------------------------------------------\n * Component: ChartStyle\n * -------------------------------------------------------------------------- */\n\ninterface ChartStyleProps {\n config: ChartConfig;\n id: string;\n}\n\nfunction ChartStyle({ id, config }: ChartStyleProps): JSX.Element | null {\n const cssString = useMemo(() => generateCSS(id, config), [id, config]);\n\n return <style dangerouslySetInnerHTML={{ __html: cssString }} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltip\n * -------------------------------------------------------------------------- */\n\ntype ChartTooltipProps = ComponentProps<typeof RechartsPrimitive.Tooltip>;\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltipContent\n * -------------------------------------------------------------------------- */\n\ntype ChartTooltipContentElement = HTMLDivElement;\ninterface ChartTooltipContentProps\n extends ComponentProps<typeof RechartsPrimitive.Tooltip>,\n Omit<ComponentProps<'div'>, 'content'> {\n hideIndicator?: boolean;\n hideLabel?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n labelKey?: string;\n nameKey?: string;\n}\n\nconst ChartTooltipContent = forwardRef<ChartTooltipContentElement, ChartTooltipContentProps>(\n (\n {\n active,\n className,\n color,\n formatter,\n hideIndicator = false,\n hideLabel = false,\n indicator = 'dot',\n label,\n labelClassName,\n labelFormatter,\n labelKey,\n nameKey,\n payload,\n },\n ref,\n ) => {\n const { config } = useChart();\n\n const tooltipLabel = useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n\n if (!item) {\n return null;\n }\n\n const key = `${labelKey || item.dataKey || item.name || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value = !labelKey && typeof label === 'string' ? config[label]?.label || label : itemConfig?.label;\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>;\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n }, [config, hideLabel, label, labelClassName, labelFormatter, labelKey, payload]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n ref={ref}\n className={cn(\n 'border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload.map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || (item.payload as { fill?: string }).fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload as Payload<ValueType, NameType>[])\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n })}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center',\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value ? (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n ) : null}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n },\n);\n\nChartTooltipContent.displayName = 'ChartTooltipContent';\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegend\n * -------------------------------------------------------------------------- */\n\ntype ChartLegendProps = ComponentProps<typeof RechartsPrimitive.Legend>;\nconst ChartLegend = RechartsPrimitive.Legend;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegendContent\n * -------------------------------------------------------------------------- */\n\ntype ChartLegendContent = HTMLDivElement;\ninterface ChartLegendContentProps\n extends ComponentProps<'div'>,\n Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> {\n hideIcon?: boolean;\n nameKey?: string;\n}\n\nconst ChartLegendContent = forwardRef<HTMLDivElement, ChartLegendContentProps>(\n ({ className, hideIcon = false, nameKey, payload, verticalAlign = 'bottom' }, ref) => {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}\n >\n {payload.map((item) => {\n let key = 'value';\n\n if (nameKey) {\n key = nameKey;\n } else if (item.dataKey) {\n key = String(item.dataKey);\n }\n\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={String(item.value)}\n className={cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:size-3')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"size-2 shrink-0 rounded\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n },\n);\n\nChartLegendContent.displayName = 'ChartLegendContent';\n\n/* -----------------------------------------------------------------------------\n * Helpers\n * -------------------------------------------------------------------------- */\n\n/**\n * Extracts and returns the appropriate configuration object from\n * the payload based on the specified key.\n *\n * @param config - The chart configuration object that contains various\n * settings.\n * @param payload - The payload object that might contain nested payload data.\n * @param key - The key used to retrieve the specific configuration from the\n * chart config.\n * @returns Returns a configuration object with optional properties `icon`,\n * `label`, `color` or `theme`, or `undefined` if the payload is invalid or\n * no configuration is found for the provided key.\n */\nfunction getPayloadConfigFromPayload(\n config: ChartConfig,\n payload: unknown,\n key: string,\n):\n | ({\n icon?: ComponentType;\n label?: ReactNode;\n } & {\n color?: string;\n theme?: never;\n })\n | ({\n icon?: ComponentType;\n label?: ReactNode;\n } & {\n theme: Record<Theme, string>;\n color?: never;\n })\n | undefined {\n if (!isValidObject(payload)) {\n return undefined;\n }\n\n const nestedPayload = 'payload' in payload && isValidObject(payload.payload) ? payload.payload : undefined;\n\n const configLabelKey = getConfigLabelKey(payload, nestedPayload, key);\n\n return configLabelKey in config ? config[configLabelKey] : config[key];\n}\n\n/**\n * Checks if the provided value is a valid object.\n *\n * @param obj - The value to check.\n * @returns - Returns true if the value is an object and not null, false\n * otherwise.\n */\nfunction isValidObject(obj: unknown): obj is Record<string, unknown> {\n return typeof obj === 'object' && obj !== null;\n}\n\n/**\n * Retrieves the configuration label key from either the payload or\n * nestedPayload. If the key exists in the payload and is a string, the\n * corresponding value is returned. Otherwise, if the key exists in the\n * nestedPayload and is a string, its value is returned. If the key is not\n * found as a string in either object, the key itself is returned.\n *\n * @param payload - The primary payload containing key-value pairs.\n * @param nestedPayload - An optional nested payload containing additional\n * key-value pairs.\n * @param key - The key to search for within the payload and nestedPayload.\n *\n * @returns The string value associated with the key if found; otherwise, the\n * key itself.\n */\nfunction getConfigLabelKey(\n payload: Record<string, unknown>,\n nestedPayload: Record<string, unknown> | undefined,\n key: string,\n): string {\n if (key in payload && typeof payload[key] === 'string') {\n return payload[key];\n }\n\n if (nestedPayload && key in nestedPayload && typeof nestedPayload[key] === 'string') {\n return nestedPayload[key];\n }\n\n return key;\n}\n\n/**\n * Generates CSS for a specified theme and chart configuration.\n *\n * @param theme - The theme to be used (for example, 'light', 'dark').\n * @param id - The unique identifier of the chart.\n * @param configEntries - A list of configuration entries, each containing a\n * key and a chart configuration.\n * @returns The generated CSS as a string.\n */\nfunction generateThemeCSS(theme: Theme, id: string, configEntries: [string, ChartConfig[string]][]): string {\n const rules: string[] = [];\n\n rules.push(`${THEMES[theme]} [data-chart=${id}] {`);\n\n configEntries.forEach(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme] || itemConfig.color;\n\n if (color) {\n rules.push(` --color-${key}: ${color};`);\n }\n });\n\n rules.push('}');\n\n return rules.join('\\n');\n}\n\n/**\n * Generates CSS styles for a chart based on the provided configuration and\n * themes.\n *\n * @param id - The unique identifier for the chart element.\n * @param config - Configuration object for the chart. This includes theme and\n * color settings.\n * @returns A string containing the generated CSS rules.\n */\nfunction generateCSS(id: string, config: ChartConfig): string {\n const themeOrColorConfig = Object.entries(config).filter(([_, { theme, color }]) => theme || color);\n\n const allRules: string[] = [];\n\n Object.keys(THEMES).forEach((theme) => {\n const themeCSS = generateThemeCSS(theme as Theme, id, themeOrColorConfig);\n\n allRules.push(themeCSS);\n });\n\n return allRules.join('\\n');\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n type ChartContainerProps,\n type ChartLegendContentProps,\n type ChartLegendProps,\n type ChartStyleProps,\n type ChartTooltipContentProps,\n type ChartTooltipProps,\n};\n"]}
@@ -0,0 +1,4 @@
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 _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _react = require('react');var _recharts = require('recharts'); var f = _interopRequireWildcard(_recharts);var _jsxruntime = require('react/jsx-runtime');var N={light:"",dark:".dark"},_=_react.createContext.call(void 0, null);function w(){let e=_react.useContext.call(void 0, _);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}var $=_react.forwardRef.call(void 0, ({children:e,className:n,config:t,id:o,...a},l)=>{let s=_react.useId.call(void 0, ),c=`chart-${o||s.replace(/:/g,"")}`;return _jsxruntime.jsx.call(void 0, _.Provider,{value:{config:t},children:_jsxruntime.jsxs.call(void 0, "div",{ref:l,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex aspect-video justify-center text-xs","[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground","[&_.recharts-cartesian-grid_line]:stroke-border/50","[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border","[&_.recharts-dot]:stroke-transparent","[&_.recharts-layer]:outline-none","[&_.recharts-polar-grid_]:stroke-border","[&_.recharts-radial-bar-background-sector]:fill-muted","[&_.recharts-reference-line_]:stroke-border","[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted","[&_.recharts-sector]:outline-none","[&_.recharts-sector]:stroke-transparent","[&_.recharts-surface]:outline-none",n),"data-chart":c,...a,children:[_jsxruntime.jsx.call(void 0, I,{config:t,id:c}),_jsxruntime.jsx.call(void 0, f.ResponsiveContainer,{children:e})]})})});$.displayName="Chart";function I({id:e,config:n}){let t=_react.useMemo.call(void 0, ()=>J(e,n),[e,n]);return _jsxruntime.jsx.call(void 0, "style",{dangerouslySetInnerHTML:{__html:t}})}var G=f.Tooltip,O= exports.d =_react.forwardRef.call(void 0, ({active:e,className:n,color:t,formatter:o,hideIndicator:a=!1,hideLabel:l=!1,indicator:s="dot",label:c,labelClassName:p,labelFormatter:h,labelKey:y,nameKey:E,payload:u},j)=>{let{config:m}=w(),R=_react.useMemo.call(void 0, ()=>{if(l||!_optionalChain([u, 'optionalAccess', _2 => _2.length]))return null;let[r]=u;if(!r)return null;let P=`${y||r.dataKey||r.name||"value"}`,b=T(m,r,P),C=!y&&typeof c=="string"?_optionalChain([m, 'access', _3 => _3[c], 'optionalAccess', _4 => _4.label])||c:_optionalChain([b, 'optionalAccess', _5 => _5.label]);return h?_jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "font-medium",p),children:h(C,u)}):C?_jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "font-medium",p),children:C}):null},[m,l,c,p,h,y,u]);if(!e||!_optionalChain([u, 'optionalAccess', _6 => _6.length]))return null;let v=u.length===1&&s!=="dot";return _jsxruntime.jsxs.call(void 0, "div",{ref:j,className:_chunkDD6AVCRHcjs.a.call(void 0, "border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",n),children:[v?null:R,_jsxruntime.jsx.call(void 0, "div",{className:"grid gap-1.5",children:u.map((r,P)=>{let b=`${E||r.name||r.dataKey||"value"}`,C=T(m,r,b),S=t||r.payload.fill||r.color;return _jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",s==="dot"&&"items-center"),children:o&&r.value!==void 0&&r.name?o(r.value,r.name,r,P,r.payload):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_optionalChain([C, 'optionalAccess', _7 => _7.icon])?_jsxruntime.jsx.call(void 0, C.icon,{}):!a&&_jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":s==="dot","w-1":s==="line","w-0 border-[1.5px] border-dashed bg-transparent":s==="dashed","my-0.5":v&&s==="dashed"}),style:{"--color-bg":S,"--color-border":S}}),_jsxruntime.jsxs.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "flex flex-1 justify-between leading-none",v?"items-end":"items-center"),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"grid gap-1.5",children:[v?R:null,_jsxruntime.jsx.call(void 0, "span",{className:"text-muted-foreground",children:_optionalChain([C, 'optionalAccess', _8 => _8.label])||r.name})]}),r.value?_jsxruntime.jsx.call(void 0, "span",{className:"text-foreground font-mono font-medium tabular-nums",children:r.value.toLocaleString()}):null]})]})},r.dataKey)})})]})});O.displayName="ChartTooltipContent";var Q=f.Legend,D= exports.f =_react.forwardRef.call(void 0, ({className:e,hideIcon:n=!1,nameKey:t,payload:o,verticalAlign:a="bottom"},l)=>{let{config:s}=w();return _optionalChain([o, 'optionalAccess', _9 => _9.length])?_jsxruntime.jsx.call(void 0, "div",{ref:l,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex items-center justify-center gap-4",a==="top"?"pb-3":"pt-3",e),children:o.map(c=>{let p="value";t?p=t:c.dataKey&&(p=String(c.dataKey));let h=T(s,c,p);return _jsxruntime.jsxs.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:size-3"),children:[_optionalChain([h, 'optionalAccess', _10 => _10.icon])&&!n?_jsxruntime.jsx.call(void 0, h.icon,{}):_jsxruntime.jsx.call(void 0, "div",{className:"size-2 shrink-0 rounded",style:{backgroundColor:c.color}}),_optionalChain([h, 'optionalAccess', _11 => _11.label])]},String(c.value))})}):null});D.displayName="ChartLegendContent";function T(e,n,t){if(!L(n))return;let o="payload"in n&&L(n.payload)?n.payload:void 0,a=V(n,o,t);return a in e?e[a]:e[t]}function L(e){return typeof e=="object"&&e!==null}function V(e,n,t){return t in e&&typeof e[t]=="string"?e[t]:n&&t in n&&typeof n[t]=="string"?n[t]:t}function z(e,n,t){let o=[];return o.push(`${N[e]} [data-chart=${n}] {`),t.forEach(([a,l])=>{let s=_optionalChain([l, 'access', _12 => _12.theme, 'optionalAccess', _13 => _13[e]])||l.color;s&&o.push(` --color-${a}: ${s};`)}),o.push("}"),o.join(`
2
+ `)}function J(e,n){let t=Object.entries(n).filter(([a,{theme:l,color:s}])=>l||s),o=[];return Object.keys(N).forEach(a=>{let l=z(a,e,t);o.push(l)}),o.join(`
3
+ `)}exports.a = $; exports.b = I; exports.c = G; exports.d = O; exports.e = Q; exports.f = D;
4
+ //# sourceMappingURL=chunk-3SJHSQTX.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-3SJHSQTX.cjs","../src/components/chart.tsx"],"names":["RechartsPrimitive","createContext","useChart","ChartContainer","children","className","id","ref","uniqueId","useId","chartId","jsx","ChartContext"],"mappings":"AAAA,22BAAY,CAAC,wDCKX,8BASUA,gFAgNM,+CA1MhB,IACA,CAAA,CAAA,CAAA,KAAM,CAAA,EACR,CAAA,IAwBqBC,CAAwC,OAE7D,CAAA,CAAA,CAAA,CAAA,kCAAA,IAASC,CAA8B,CACrC,SAAuC,CAAA,CAEvC,CAAA,CAAA,IACE,CAAA,CAAA,+BAAA,CAAA,CAAM,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,MAAM,IAAA,KAAA,CAAA,mDAgBpB,CAAA,CAAMC,OACD,CAAA,CAAA,IAAA,CAAA,CAAAC,+BAAAA,CAAU,CAAA,QAAAC,CAAAA,CAAW,CAAA,SAAQ,CAAA,CAAAC,CAAAA,MAAa,CAAGC,CAAAA,CAAAA,EAAQ,CACtD,CAAA,CAAA,GAAMC,CAAWC,CAAAA,CAAM,CAAA,CACjBC,EAAU,CAAA,IAAA,CAAA,CAAA,0BAAA,CAASJ,CAAAA,CAAME,CAAAA,CAAS,MAAA,EAAQ,CAAA,EAAA,CAAA,CAAM,OAEtD,CAAA,IAAA,CACEG,EAACC,CAAAA,CAAa,CAAA;AAoZG;AACvB","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-3SJHSQTX.cjs","sourcesContent":[null,"'use client';\n\nimport {\n type ComponentProps,\n type ComponentType,\n createContext,\n type CSSProperties,\n forwardRef,\n type JSX,\n type ReactNode,\n useContext,\n useId,\n useMemo,\n} from 'react';\nimport * as RechartsPrimitive from 'recharts';\nimport { type NameType, type Payload, type ValueType } from 'recharts/types/component/DefaultTooltipContent';\n\nimport { cn } from '@/lib/utils';\n\nconst THEMES = {\n light: '',\n dark: '.dark',\n} as const;\n\ntype Theme = keyof typeof THEMES;\n\ntype ChartConfig = {\n [k in string]: {\n icon?: ComponentType;\n label?: ReactNode;\n } & (\n | {\n color?: string;\n theme?: never;\n }\n | {\n theme: Record<Theme, string>;\n color?: never;\n }\n );\n};\n\ninterface ChartContextProps {\n config: ChartConfig;\n}\n\nconst ChartContext = createContext<ChartContextProps | null>(null);\n\nfunction useChart(): ChartContextProps {\n const context = useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: Chart\n * -------------------------------------------------------------------------- */\n\ntype ChartContainerElement = HTMLDivElement;\ninterface ChartContainerProps extends ComponentProps<'div'> {\n children: ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n config: ChartConfig;\n}\n\nconst ChartContainer = forwardRef<ChartContainerElement, ChartContainerProps>(\n ({ children, className, config, id, ...props }, ref) => {\n const uniqueId = useId();\n const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n ref={ref}\n className={cn(\n 'flex aspect-video justify-center text-xs',\n '[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground',\n '[&_.recharts-cartesian-grid_line]:stroke-border/50',\n '[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border',\n '[&_.recharts-dot]:stroke-transparent',\n '[&_.recharts-layer]:outline-none',\n '[&_.recharts-polar-grid_]:stroke-border',\n '[&_.recharts-radial-bar-background-sector]:fill-muted',\n '[&_.recharts-reference-line_]:stroke-border',\n '[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted',\n '[&_.recharts-sector]:outline-none',\n '[&_.recharts-sector]:stroke-transparent',\n '[&_.recharts-surface]:outline-none',\n className,\n )}\n data-chart={chartId}\n {...props}\n >\n <ChartStyle config={config} id={chartId} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n },\n);\n\nChartContainer.displayName = 'Chart';\n\n/* -----------------------------------------------------------------------------\n * Component: ChartStyle\n * -------------------------------------------------------------------------- */\n\ninterface ChartStyleProps {\n config: ChartConfig;\n id: string;\n}\n\nfunction ChartStyle({ id, config }: ChartStyleProps): JSX.Element | null {\n const cssString = useMemo(() => generateCSS(id, config), [id, config]);\n\n return <style dangerouslySetInnerHTML={{ __html: cssString }} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltip\n * -------------------------------------------------------------------------- */\n\ntype ChartTooltipProps = ComponentProps<typeof RechartsPrimitive.Tooltip>;\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltipContent\n * -------------------------------------------------------------------------- */\n\ntype ChartTooltipContentElement = HTMLDivElement;\ninterface ChartTooltipContentProps\n extends ComponentProps<typeof RechartsPrimitive.Tooltip>,\n Omit<ComponentProps<'div'>, 'content'> {\n hideIndicator?: boolean;\n hideLabel?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n labelKey?: string;\n nameKey?: string;\n}\n\nconst ChartTooltipContent = forwardRef<ChartTooltipContentElement, ChartTooltipContentProps>(\n (\n {\n active,\n className,\n color,\n formatter,\n hideIndicator = false,\n hideLabel = false,\n indicator = 'dot',\n label,\n labelClassName,\n labelFormatter,\n labelKey,\n nameKey,\n payload,\n },\n ref,\n ) => {\n const { config } = useChart();\n\n const tooltipLabel = useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n\n if (!item) {\n return null;\n }\n\n const key = `${labelKey || item.dataKey || item.name || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value = !labelKey && typeof label === 'string' ? config[label]?.label || label : itemConfig?.label;\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>;\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n }, [config, hideLabel, label, labelClassName, labelFormatter, labelKey, payload]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n ref={ref}\n className={cn(\n 'border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload.map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || (item.payload as { fill?: string }).fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload as Payload<ValueType, NameType>[])\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n })}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center',\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value ? (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n ) : null}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n },\n);\n\nChartTooltipContent.displayName = 'ChartTooltipContent';\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegend\n * -------------------------------------------------------------------------- */\n\ntype ChartLegendProps = ComponentProps<typeof RechartsPrimitive.Legend>;\nconst ChartLegend = RechartsPrimitive.Legend;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegendContent\n * -------------------------------------------------------------------------- */\n\ntype ChartLegendContent = HTMLDivElement;\ninterface ChartLegendContentProps\n extends ComponentProps<'div'>,\n Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> {\n hideIcon?: boolean;\n nameKey?: string;\n}\n\nconst ChartLegendContent = forwardRef<HTMLDivElement, ChartLegendContentProps>(\n ({ className, hideIcon = false, nameKey, payload, verticalAlign = 'bottom' }, ref) => {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}\n >\n {payload.map((item) => {\n let key = 'value';\n\n if (nameKey) {\n key = nameKey;\n } else if (item.dataKey) {\n key = String(item.dataKey);\n }\n\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={String(item.value)}\n className={cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:size-3')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"size-2 shrink-0 rounded\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n },\n);\n\nChartLegendContent.displayName = 'ChartLegendContent';\n\n/* -----------------------------------------------------------------------------\n * Helpers\n * -------------------------------------------------------------------------- */\n\n/**\n * Extracts and returns the appropriate configuration object from\n * the payload based on the specified key.\n *\n * @param config - The chart configuration object that contains various\n * settings.\n * @param payload - The payload object that might contain nested payload data.\n * @param key - The key used to retrieve the specific configuration from the\n * chart config.\n * @returns Returns a configuration object with optional properties `icon`,\n * `label`, `color` or `theme`, or `undefined` if the payload is invalid or\n * no configuration is found for the provided key.\n */\nfunction getPayloadConfigFromPayload(\n config: ChartConfig,\n payload: unknown,\n key: string,\n):\n | ({\n icon?: ComponentType;\n label?: ReactNode;\n } & {\n color?: string;\n theme?: never;\n })\n | ({\n icon?: ComponentType;\n label?: ReactNode;\n } & {\n theme: Record<Theme, string>;\n color?: never;\n })\n | undefined {\n if (!isValidObject(payload)) {\n return undefined;\n }\n\n const nestedPayload = 'payload' in payload && isValidObject(payload.payload) ? payload.payload : undefined;\n\n const configLabelKey = getConfigLabelKey(payload, nestedPayload, key);\n\n return configLabelKey in config ? config[configLabelKey] : config[key];\n}\n\n/**\n * Checks if the provided value is a valid object.\n *\n * @param obj - The value to check.\n * @returns - Returns true if the value is an object and not null, false\n * otherwise.\n */\nfunction isValidObject(obj: unknown): obj is Record<string, unknown> {\n return typeof obj === 'object' && obj !== null;\n}\n\n/**\n * Retrieves the configuration label key from either the payload or\n * nestedPayload. If the key exists in the payload and is a string, the\n * corresponding value is returned. Otherwise, if the key exists in the\n * nestedPayload and is a string, its value is returned. If the key is not\n * found as a string in either object, the key itself is returned.\n *\n * @param payload - The primary payload containing key-value pairs.\n * @param nestedPayload - An optional nested payload containing additional\n * key-value pairs.\n * @param key - The key to search for within the payload and nestedPayload.\n *\n * @returns The string value associated with the key if found; otherwise, the\n * key itself.\n */\nfunction getConfigLabelKey(\n payload: Record<string, unknown>,\n nestedPayload: Record<string, unknown> | undefined,\n key: string,\n): string {\n if (key in payload && typeof payload[key] === 'string') {\n return payload[key];\n }\n\n if (nestedPayload && key in nestedPayload && typeof nestedPayload[key] === 'string') {\n return nestedPayload[key];\n }\n\n return key;\n}\n\n/**\n * Generates CSS for a specified theme and chart configuration.\n *\n * @param theme - The theme to be used (for example, 'light', 'dark').\n * @param id - The unique identifier of the chart.\n * @param configEntries - A list of configuration entries, each containing a\n * key and a chart configuration.\n * @returns The generated CSS as a string.\n */\nfunction generateThemeCSS(theme: Theme, id: string, configEntries: [string, ChartConfig[string]][]): string {\n const rules: string[] = [];\n\n rules.push(`${THEMES[theme]} [data-chart=${id}] {`);\n\n configEntries.forEach(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme] || itemConfig.color;\n\n if (color) {\n rules.push(` --color-${key}: ${color};`);\n }\n });\n\n rules.push('}');\n\n return rules.join('\\n');\n}\n\n/**\n * Generates CSS styles for a chart based on the provided configuration and\n * themes.\n *\n * @param id - The unique identifier for the chart element.\n * @param config - Configuration object for the chart. This includes theme and\n * color settings.\n * @returns A string containing the generated CSS rules.\n */\nfunction generateCSS(id: string, config: ChartConfig): string {\n const themeOrColorConfig = Object.entries(config).filter(([_, { theme, color }]) => theme || color);\n\n const allRules: string[] = [];\n\n Object.keys(THEMES).forEach((theme) => {\n const themeCSS = generateThemeCSS(theme as Theme, id, themeOrColorConfig);\n\n allRules.push(themeCSS);\n });\n\n return allRules.join('\\n');\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n type ChartContainerProps,\n type ChartLegendContentProps,\n type ChartLegendProps,\n type ChartStyleProps,\n type ChartTooltipContentProps,\n type ChartTooltipProps,\n};\n"]}
@@ -1,2 +1,2 @@
1
- "use client";import{a as D,c as x,d as w,g as T,i as C}from"./chunk-SQURQUD2.js";import{a as c,b as g,h as p,i,j as m,l as f,m as d}from"./chunk-T35I2SOF.js";import{a as o}from"./chunk-TIDJ4IXN.js";import{a as u}from"./chunk-EVRI6TWT.js";import{a as l}from"./chunk-VPYH6JWS.js";import{CaretSortIcon as N,ChevronDownIcon as v,ChevronLeftIcon as S,ChevronRightIcon as P,ChevronUpIcon as b,DoubleArrowLeftIcon as M,DoubleArrowRightIcon as I,EyeNoneIcon as h,MixerHorizontalIcon as y}from"@radix-ui/react-icons";import{Fragment as k,jsx as e,jsxs as a}from"react/jsx-runtime";function X({table:t}){return a(c,{children:[a(g,{className:u({size:"xs",variant:"outline"}),children:[e(y,{className:"size-4"}),"View"]}),a(p,{align:"end",className:"w-36",children:[e(f,{children:"Toggle columns"}),e(d,{}),t.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>e(m,{checked:n.getIsVisible(),className:"capitalize",onCheckedChange:r=>{n.toggleVisibility(!!r)},children:n.id},n.id))]})]})}function G({table:t,className:n,...r}){return a("div",{className:l("flex flex-wrap items-center justify-between gap-4 px-2",n),...r,children:[a("div",{className:"text-muted-foreground min-w-max flex-1 text-sm",children:[t.getFilteredSelectedRowModel().rows.length," of ",t.getFilteredRowModel().rows.length," row(s) selected."]}),a("div",{className:"flex grow flex-wrap items-center justify-between gap-4 md:justify-end md:gap-x-6 lg:gap-x-8",children:[a("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"}),a(D,{value:String(t.getState().pagination.pageSize),onValueChange:s=>{t.setPageSize(Number(s))},children:[e(w,{className:"w-18 h-8",children:e(x,{placeholder:t.getState().pagination.pageSize})}),e(T,{side:"top",children:[10,20,30,40,50].map(s=>e(C,{value:String(s),children:s},s))})]})]}),a("div",{className:"flex flex-wrap items-center justify-center text-sm font-medium",children:["Page ",t.getState().pagination.pageIndex+1," of ",t.getPageCount()]}),a("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-4",children:[a(o,{icon:!0,className:"max-md:hidden",disabled:!t.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{t.setPageIndex(0)},children:[e("span",{className:"sr-only",children:"Go to first page"}),e(M,{className:"size-4"})]}),a(o,{icon:!0,disabled:!t.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{t.previousPage()},children:[e("span",{className:"sr-only",children:"Go to previous page"}),e(S,{className:"size-4"})]}),a(o,{icon:!0,disabled:!t.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{t.nextPage()},children:[e("span",{className:"sr-only",children:"Go to next page"}),e(P,{className:"size-4"})]}),a(o,{icon:!0,className:"max-md:hidden",disabled:!t.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{t.setPageIndex(t.getPageCount()-1)},children:[e("span",{className:"sr-only",children:"Go to last page"}),e(I,{className:"size-4"})]})]})]})]})}function O({column:t,title:n}){return t.getCanSort()?a(c,{children:[e(g,{asChild:!0,children:e(o,{className:l("text-muted-foreground p-0","hover:bg-transparent","data-[state=open]:text-accent-foreground","focus-visible:text-accent-foreground focus-visible:bg-transparent focus-visible:outline-0"),size:"xs",suffix:e(V,{sorted:t.getIsSorted()}),variant:"ghost",children:n})}),a(p,{align:"start",children:[a(i,{onClick:()=>{t.toggleSorting(!1)},children:[e(b,{className:"text-muted-foreground"}),"Asc"]}),a(i,{onClick:()=>{t.toggleSorting(!0)},children:[e(v,{className:"text-muted-foreground"}),"Desc"]}),e(d,{}),a(i,{onClick:()=>{t.toggleVisibility(!1)},children:[e(h,{className:"text-muted-foreground"}),"Hide"]})]})]}):e(k,{children:n})}function V({sorted:t}){switch(t){case"desc":return e(v,{});case"asc":return e(b,{});default:return e(N,{})}}export{X as a,G as b,O as c};
2
- //# sourceMappingURL=chunk-GKLXJ6JZ.js.map
1
+ "use client";import{a as D,c as x,d as w,g as T,i as C}from"./chunk-SQURQUD2.js";import{a as c,b as g,h as p,i,j as m,l as f,m as d}from"./chunk-OH3BXT6D.js";import{a as o}from"./chunk-24TJIVWR.js";import{a as u}from"./chunk-EVRI6TWT.js";import{a as l}from"./chunk-VPYH6JWS.js";import{CaretSortIcon as N,ChevronDownIcon as v,ChevronLeftIcon as S,ChevronRightIcon as P,ChevronUpIcon as b,DoubleArrowLeftIcon as M,DoubleArrowRightIcon as I,EyeNoneIcon as h,MixerHorizontalIcon as y}from"@radix-ui/react-icons";import{Fragment as k,jsx as e,jsxs as a}from"react/jsx-runtime";function X({table:t}){return a(c,{children:[a(g,{className:u({size:"xs",variant:"outline"}),children:[e(y,{className:"size-4"}),"View"]}),a(p,{align:"end",className:"w-36",children:[e(f,{children:"Toggle columns"}),e(d,{}),t.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>e(m,{checked:n.getIsVisible(),className:"capitalize",onCheckedChange:r=>{n.toggleVisibility(!!r)},children:n.id},n.id))]})]})}function G({table:t,className:n,...r}){return a("div",{className:l("flex flex-wrap items-center justify-between gap-4 px-2",n),...r,children:[a("div",{className:"text-muted-foreground min-w-max flex-1 text-sm",children:[t.getFilteredSelectedRowModel().rows.length," of ",t.getFilteredRowModel().rows.length," row(s) selected."]}),a("div",{className:"flex grow flex-wrap items-center justify-between gap-4 md:justify-end md:gap-x-6 lg:gap-x-8",children:[a("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"}),a(D,{value:String(t.getState().pagination.pageSize),onValueChange:s=>{t.setPageSize(Number(s))},children:[e(w,{className:"w-18 h-8",children:e(x,{placeholder:t.getState().pagination.pageSize})}),e(T,{side:"top",children:[10,20,30,40,50].map(s=>e(C,{value:String(s),children:s},s))})]})]}),a("div",{className:"flex flex-wrap items-center justify-center text-sm font-medium",children:["Page ",t.getState().pagination.pageIndex+1," of ",t.getPageCount()]}),a("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-4",children:[a(o,{icon:!0,className:"max-md:hidden",disabled:!t.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{t.setPageIndex(0)},children:[e("span",{className:"sr-only",children:"Go to first page"}),e(M,{className:"size-4"})]}),a(o,{icon:!0,disabled:!t.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{t.previousPage()},children:[e("span",{className:"sr-only",children:"Go to previous page"}),e(S,{className:"size-4"})]}),a(o,{icon:!0,disabled:!t.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{t.nextPage()},children:[e("span",{className:"sr-only",children:"Go to next page"}),e(P,{className:"size-4"})]}),a(o,{icon:!0,className:"max-md:hidden",disabled:!t.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{t.setPageIndex(t.getPageCount()-1)},children:[e("span",{className:"sr-only",children:"Go to last page"}),e(I,{className:"size-4"})]})]})]})]})}function O({column:t,title:n}){return t.getCanSort()?a(c,{children:[e(g,{asChild:!0,children:e(o,{className:l("text-muted-foreground p-0","hover:bg-transparent","data-[state=open]:text-accent-foreground","focus-visible:text-accent-foreground focus-visible:bg-transparent focus-visible:outline-0"),size:"xs",suffix:e(V,{sorted:t.getIsSorted()}),variant:"ghost",children:n})}),a(p,{align:"start",children:[a(i,{onClick:()=>{t.toggleSorting(!1)},children:[e(b,{className:"text-muted-foreground"}),"Asc"]}),a(i,{onClick:()=>{t.toggleSorting(!0)},children:[e(v,{className:"text-muted-foreground"}),"Desc"]}),e(d,{}),a(i,{onClick:()=>{t.toggleVisibility(!1)},children:[e(h,{className:"text-muted-foreground"}),"Hide"]})]})]}):e(k,{children:n})}function V({sorted:t}){switch(t){case"desc":return e(v,{});case"asc":return e(b,{});default:return e(N,{})}}export{X as a,G as b,O as c};
2
+ //# sourceMappingURL=chunk-3TOWLKUY.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkV2AN2A7Ccjs = require('./chunk-V2AN2A7C.cjs');var _chunk55AJ7WQDcjs = require('./chunk-55AJ7WQD.cjs');var _chunkWWXKOWL5cjs = require('./chunk-WWXKOWL5.cjs');var _chunkKF7Y7B3Gcjs = require('./chunk-KF7Y7B3G.cjs');var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _reacticons = require('@radix-ui/react-icons');var _jsxruntime = require('react/jsx-runtime');function J({table:t}){return _jsxruntime.jsxs.call(void 0, _chunk55AJ7WQDcjs.a,{children:[_jsxruntime.jsxs.call(void 0, _chunk55AJ7WQDcjs.b,{className:_chunkKF7Y7B3Gcjs.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, _chunk55AJ7WQDcjs.h,{align:"end",className:"w-36",children:[_jsxruntime.jsx.call(void 0, _chunk55AJ7WQDcjs.l,{children:"Toggle columns"}),_jsxruntime.jsx.call(void 0, _chunk55AJ7WQDcjs.m,{}),t.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>_jsxruntime.jsx.call(void 0, _chunk55AJ7WQDcjs.j,{checked:n.getIsVisible(),className:"capitalize",onCheckedChange:r=>{n.toggleVisibility(!!r)},children:n.id},n.id))]})]})}function X({table:t,className:n,...r}){return _jsxruntime.jsxs.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "flex flex-wrap items-center justify-between gap-4 px-2",n),...r,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"text-muted-foreground min-w-max flex-1 text-sm",children:[t.getFilteredSelectedRowModel().rows.length," of ",t.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, _chunkV2AN2A7Ccjs.a,{value:String(t.getState().pagination.pageSize),onValueChange:s=>{t.setPageSize(Number(s))},children:[_jsxruntime.jsx.call(void 0, _chunkV2AN2A7Ccjs.d,{className:"w-18 h-8",children:_jsxruntime.jsx.call(void 0, _chunkV2AN2A7Ccjs.c,{placeholder:t.getState().pagination.pageSize})}),_jsxruntime.jsx.call(void 0, _chunkV2AN2A7Ccjs.g,{side:"top",children:[10,20,30,40,50].map(s=>_jsxruntime.jsx.call(void 0, _chunkV2AN2A7Ccjs.i,{value:String(s),children:s},s))})]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-wrap items-center justify-center text-sm font-medium",children:["Page ",t.getState().pagination.pageIndex+1," of ",t.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, _chunkWWXKOWL5cjs.a,{icon:!0,className:"max-md:hidden",disabled:!t.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{t.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, _chunkWWXKOWL5cjs.a,{icon:!0,disabled:!t.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{t.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, _chunkWWXKOWL5cjs.a,{icon:!0,disabled:!t.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{t.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, _chunkWWXKOWL5cjs.a,{icon:!0,className:"max-md:hidden",disabled:!t.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{t.setPageIndex(t.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:t,title:n}){return t.getCanSort()?_jsxruntime.jsxs.call(void 0, _chunk55AJ7WQDcjs.a,{children:[_jsxruntime.jsx.call(void 0, _chunk55AJ7WQDcjs.b,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _chunkWWXKOWL5cjs.a,{className:_chunkDD6AVCRHcjs.a.call(void 0, "text-muted-foreground p-0","hover:bg-transparent","data-[state=open]:text-accent-foreground","focus-visible:text-accent-foreground focus-visible:bg-transparent focus-visible:outline-0"),size:"xs",suffix:_jsxruntime.jsx.call(void 0, V,{sorted:t.getIsSorted()}),variant:"ghost",children:n})}),_jsxruntime.jsxs.call(void 0, _chunk55AJ7WQDcjs.h,{align:"start",children:[_jsxruntime.jsxs.call(void 0, _chunk55AJ7WQDcjs.i,{onClick:()=>{t.toggleSorting(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ChevronUpIcon,{className:"text-muted-foreground"}),"Asc"]}),_jsxruntime.jsxs.call(void 0, _chunk55AJ7WQDcjs.i,{onClick:()=>{t.toggleSorting(!0)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ChevronDownIcon,{className:"text-muted-foreground"}),"Desc"]}),_jsxruntime.jsx.call(void 0, _chunk55AJ7WQDcjs.m,{}),_jsxruntime.jsxs.call(void 0, _chunk55AJ7WQDcjs.i,{onClick:()=>{t.toggleVisibility(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.EyeNoneIcon,{className:"text-muted-foreground"}),"Hide"]})]})]}):_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:n})}function V({sorted:t}){switch(t){case"desc":return _jsxruntime.jsx.call(void 0, _reacticons.ChevronDownIcon,{});case"asc":return _jsxruntime.jsx.call(void 0, _reacticons.ChevronUpIcon,{});default:return _jsxruntime.jsx.call(void 0, _reacticons.CaretSortIcon,{})}}exports.a = J; exports.b = X; exports.c = G;
2
- //# sourceMappingURL=chunk-4SNJ7GUK.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkV2AN2A7Ccjs = require('./chunk-V2AN2A7C.cjs');var _chunkYORY32TXcjs = require('./chunk-YORY32TX.cjs');var _chunkFINPFQTZcjs = require('./chunk-FINPFQTZ.cjs');var _chunkKF7Y7B3Gcjs = require('./chunk-KF7Y7B3G.cjs');var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _reacticons = require('@radix-ui/react-icons');var _jsxruntime = require('react/jsx-runtime');function J({table:t}){return _jsxruntime.jsxs.call(void 0, _chunkYORY32TXcjs.a,{children:[_jsxruntime.jsxs.call(void 0, _chunkYORY32TXcjs.b,{className:_chunkKF7Y7B3Gcjs.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, _chunkYORY32TXcjs.h,{align:"end",className:"w-36",children:[_jsxruntime.jsx.call(void 0, _chunkYORY32TXcjs.l,{children:"Toggle columns"}),_jsxruntime.jsx.call(void 0, _chunkYORY32TXcjs.m,{}),t.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>_jsxruntime.jsx.call(void 0, _chunkYORY32TXcjs.j,{checked:n.getIsVisible(),className:"capitalize",onCheckedChange:r=>{n.toggleVisibility(!!r)},children:n.id},n.id))]})]})}function X({table:t,className:n,...r}){return _jsxruntime.jsxs.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "flex flex-wrap items-center justify-between gap-4 px-2",n),...r,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"text-muted-foreground min-w-max flex-1 text-sm",children:[t.getFilteredSelectedRowModel().rows.length," of ",t.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, _chunkV2AN2A7Ccjs.a,{value:String(t.getState().pagination.pageSize),onValueChange:s=>{t.setPageSize(Number(s))},children:[_jsxruntime.jsx.call(void 0, _chunkV2AN2A7Ccjs.d,{className:"w-18 h-8",children:_jsxruntime.jsx.call(void 0, _chunkV2AN2A7Ccjs.c,{placeholder:t.getState().pagination.pageSize})}),_jsxruntime.jsx.call(void 0, _chunkV2AN2A7Ccjs.g,{side:"top",children:[10,20,30,40,50].map(s=>_jsxruntime.jsx.call(void 0, _chunkV2AN2A7Ccjs.i,{value:String(s),children:s},s))})]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-wrap items-center justify-center text-sm font-medium",children:["Page ",t.getState().pagination.pageIndex+1," of ",t.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, _chunkFINPFQTZcjs.a,{icon:!0,className:"max-md:hidden",disabled:!t.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{t.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, _chunkFINPFQTZcjs.a,{icon:!0,disabled:!t.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{t.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, _chunkFINPFQTZcjs.a,{icon:!0,disabled:!t.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{t.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, _chunkFINPFQTZcjs.a,{icon:!0,className:"max-md:hidden",disabled:!t.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{t.setPageIndex(t.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:t,title:n}){return t.getCanSort()?_jsxruntime.jsxs.call(void 0, _chunkYORY32TXcjs.a,{children:[_jsxruntime.jsx.call(void 0, _chunkYORY32TXcjs.b,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _chunkFINPFQTZcjs.a,{className:_chunkDD6AVCRHcjs.a.call(void 0, "text-muted-foreground p-0","hover:bg-transparent","data-[state=open]:text-accent-foreground","focus-visible:text-accent-foreground focus-visible:bg-transparent focus-visible:outline-0"),size:"xs",suffix:_jsxruntime.jsx.call(void 0, V,{sorted:t.getIsSorted()}),variant:"ghost",children:n})}),_jsxruntime.jsxs.call(void 0, _chunkYORY32TXcjs.h,{align:"start",children:[_jsxruntime.jsxs.call(void 0, _chunkYORY32TXcjs.i,{onClick:()=>{t.toggleSorting(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ChevronUpIcon,{className:"text-muted-foreground"}),"Asc"]}),_jsxruntime.jsxs.call(void 0, _chunkYORY32TXcjs.i,{onClick:()=>{t.toggleSorting(!0)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ChevronDownIcon,{className:"text-muted-foreground"}),"Desc"]}),_jsxruntime.jsx.call(void 0, _chunkYORY32TXcjs.m,{}),_jsxruntime.jsxs.call(void 0, _chunkYORY32TXcjs.i,{onClick:()=>{t.toggleVisibility(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.EyeNoneIcon,{className:"text-muted-foreground"}),"Hide"]})]})]}):_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:n})}function V({sorted:t}){switch(t){case"desc":return _jsxruntime.jsx.call(void 0, _reacticons.ChevronDownIcon,{});case"asc":return _jsxruntime.jsx.call(void 0, _reacticons.ChevronUpIcon,{});default:return _jsxruntime.jsx.call(void 0, _reacticons.CaretSortIcon,{})}}exports.a = J; exports.b = X; exports.c = G;
2
+ //# sourceMappingURL=chunk-3TS74A2W.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-4SNJ7GUK.cjs","../src/components/data-table.tsx"],"names":["jsxs","DropdownMenu","DropdownMenuTrigger","buttonVariants","jsx","MixerHorizontalIcon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuCheckboxItem","column","DataTablePagination","className","cn","table","SelectTrigger","SelectValue","pageSize","SelectItem","Button","DataTableColumnHeader","DropdownMenuItem","ChevronUpIcon","ChevronDownIcon","DropdownMenuSeparator","EyeNoneIcon","Fragment","title","SortIcon","sorted"],"mappings":"AAAA,qFAAY,CAAC,wDAAoE,wDAA8E,wDAAyC,wDAAyC,wDCG/O,mDAgLS,+CA5I4B,SACrC,CAAA,CAAA,CAAA,KACEA,CAACC,CAAAA,CAAA,CACC,CAAA,OAAA,8BAAA,mBAAAD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OAGrB,6BAAA,2BAAA,CAAA,CACH,CAAA,CAAA,CAAA,IAAOxB,KAAC,CAAc,OAGxB,6BAAA,yBACE,CAAA,CAAA,CAAA,CAAA,CAAA,OAAQ,CAAc,OAE5B,6BAAA,yBAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,4CAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-4SNJ7GUK.cjs","sourcesContent":[null,"'use client';\n\nimport {\n CaretSortIcon,\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n ChevronUpIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from '@radix-ui/react-icons';\nimport { type HTMLAttributes, type JSX } from 'react';\n\nimport { Button } from '@/components/button';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/dropdown-menu';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/select';\nimport { cn } from '@/lib/utils';\nimport { buttonVariants } from '@/styles/button-variants';\n\nimport type * as ReactTable from '@tanstack/react-table';\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): 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 HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTablePagination<TData>({ table, className, ...props }: DataTablePaginationProps<TData>): 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> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\n\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n}: DataTableColumnHeaderProps<TData, TValue>): JSX.Element {\n if (!column.getCanSort()) {\n return <>{title}</>;\n }\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n className={cn(\n 'text-muted-foreground p-0',\n 'hover:bg-transparent',\n 'data-[state=open]:text-accent-foreground',\n 'focus-visible:text-accent-foreground focus-visible:bg-transparent focus-visible:outline-0',\n )}\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 <ChevronDownIcon 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 );\n}\n\nfunction SortIcon({ sorted }: { sorted: false | ReactTable.SortDirection }): JSX.Element {\n switch (sorted) {\n case 'desc': {\n return <ChevronDownIcon />;\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 DataTableColumnHeader,\n DataTablePagination,\n DataTableViewOptions,\n type DataTableColumnHeaderProps,\n type DataTablePaginationProps,\n type DataTableViewOptionsProps,\n};\n"]}
1
+ {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-3TS74A2W.cjs","../src/components/data-table.tsx"],"names":["jsxs","DropdownMenu","DropdownMenuTrigger","buttonVariants","jsx","MixerHorizontalIcon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuCheckboxItem","column","DataTablePagination","className","cn","table","SelectTrigger","SelectValue","pageSize","SelectItem","Button","DataTableColumnHeader","DropdownMenuItem","ChevronUpIcon","ChevronDownIcon","DropdownMenuSeparator","EyeNoneIcon","Fragment","title","SortIcon","sorted"],"mappings":"AAAA,qFAAY,CAAC,wDAAoE,wDAA8E,wDAAyC,wDAAyC,wDCG/O,mDAgLS,+CA5I4B,SACrC,CAAA,CAAA,CAAA,KACEA,CAACC,CAAAA,CAAA,CACC,CAAA,OAAA,8BAAA,mBAAAD,CAACE,CAAAA,QAAoB,CAAA,CAAA,8BAAA,mBAAWC,CAAe,CAAE,SAAM,CAAM,iCAAA,CAAA,IAAA,CAAS,IAAA,CAAA,OACpE,CAAA,SAAAC,CAAAA,CAACC,CAAAA,QAAoB,CAAA,CAAA,6B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A,CAAA,CAAA,CAAA,4CAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-3TS74A2W.cjs","sourcesContent":[null,"'use client';\n\nimport {\n CaretSortIcon,\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n ChevronUpIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from '@radix-ui/react-icons';\nimport { type HTMLAttributes, type JSX } from 'react';\n\nimport { Button } from '@/components/button';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/dropdown-menu';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/select';\nimport { cn } from '@/lib/utils';\nimport { buttonVariants } from '@/styles/button-variants';\n\nimport type * as ReactTable from '@tanstack/react-table';\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): 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 HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTablePagination<TData>({ table, className, ...props }: DataTablePaginationProps<TData>): 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> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\n\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n}: DataTableColumnHeaderProps<TData, TValue>): JSX.Element {\n if (!column.getCanSort()) {\n return <>{title}</>;\n }\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n className={cn(\n 'text-muted-foreground p-0',\n 'hover:bg-transparent',\n 'data-[state=open]:text-accent-foreground',\n 'focus-visible:text-accent-foreground focus-visible:bg-transparent focus-visible:outline-0',\n )}\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 <ChevronDownIcon 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 );\n}\n\nfunction SortIcon({ sorted }: { sorted: false | ReactTable.SortDirection }): JSX.Element {\n switch (sorted) {\n case 'desc': {\n return <ChevronDownIcon />;\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 DataTableColumnHeader,\n DataTablePagination,\n DataTableViewOptions,\n type DataTableColumnHeaderProps,\n type DataTablePaginationProps,\n type DataTableViewOptionsProps,\n};\n"]}
@@ -1,2 +1,2 @@
1
1
  import{a as o}from"./chunk-VPYH6JWS.js";import*as a from"@radix-ui/react-separator";import{forwardRef as p}from"react";import{tv as l}from"tailwind-variants";import{jsx as i}from"react/jsx-runtime";var f=l({base:"bg-muted relative flex shrink-0 items-center",defaultVariants:{align:"center",orientation:"horizontal"},variants:{align:{start:"justify-start",center:"justify-center",end:"justify-end"},orientation:{horizontal:"h-px w-full",vertical:"h-full w-px flex-col"}}}),S=p(({className:e,orientation:t,align:r,decorative:n=!0,...s},m)=>i(a.Root,{ref:m,className:f({align:r,orientation:t,className:e}),decorative:n,orientation:t,...s}));S.displayName=a.Root.displayName;var y=p(({className:e,...t},r)=>i("div",{ref:r,className:o("bg-background text-muted-foreground absolute mx-2 px-2 text-sm",e),...t}));y.displayName="SeparatorItem";export{S as a,y as b};
2
- //# sourceMappingURL=chunk-XT5YE5R2.js.map
2
+ //# sourceMappingURL=chunk-432ZMHFM.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/separator.tsx"],"names":["SeparatorPrimitive","forwardRef","tv","jsx","separatorVariants","Separator","className","orientation","align","decorative","props","forwardedRef","SeparatorItem","cn"],"mappings":"wCAAA,UAAYA,MAAwB,4BACpC,OAA2D,cAAAC,MAAuC,QAClG,OAAS,MAAAC,MAA6B,oBAyClC,cAAAC,MAAA,oBAjCJ,IAAMC,EAAoBF,EAAG,CAC3B,KAAM,+CACN,gBAAiB,CACf,MAAO,SACP,YAAa,YACf,EACA,SAAU,CACR,MAAO,CACL,MAAO,gBACP,OAAQ,iBACR,IAAK,aACP,EACA,YAAa,CACX,WAAY,cACZ,SAAU,sBACZ,CACF,CACF,CAAC,EAcKG,EAAYJ,EAChB,CAAC,CAAE,UAAAK,EAAW,YAAAC,EAAa,MAAAC,EAAO,WAAAC,EAAa,GAAM,GAAGC,CAAM,EAAGC,IAC/DR,EAAoB,OAAnB,CACC,IAAKQ,EACL,UAAWP,EAAkB,CAAE,MAAAI,EAAO,YAAAD,EAAa,UAAAD,CAAU,CAAC,EAC9D,WAAYG,EACZ,YAAaF,EACZ,GAAGG,EACN,CAEJ,EAEAL,EAAU,YAAiC,OAAK,YAShD,IAAMO,EAAgBX,EAAqD,CAAC,CAAE,UAAAK,EAAW,GAAGI,CAAM,EAAGC,IACnGR,EAAC,OACC,IAAKQ,EACL,UAAWE,EAAG,iEAAkEP,CAAS,EACxF,GAAGI,EACN,CACD,EAEDE,EAAc,YAAc","sourcesContent":["import * as SeparatorPrimitive from '@radix-ui/react-separator';\nimport { type ComponentPropsWithoutRef, type ComponentRef, forwardRef, type HTMLAttributes } from 'react';\nimport { tv, type VariantProps } from 'tailwind-variants';\n\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Variant: Separator\n * -------------------------------------------------------------------------- */\n\nconst separatorVariants = tv({\n base: 'bg-muted relative flex shrink-0 items-center',\n defaultVariants: {\n align: 'center',\n orientation: 'horizontal',\n },\n variants: {\n align: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n },\n orientation: {\n horizontal: 'h-px w-full',\n vertical: 'h-full w-px flex-col',\n },\n },\n});\n\ntype SeparatorVariantsProps = VariantProps<typeof separatorVariants>;\n\n/* -----------------------------------------------------------------------------\n * Component: Separator\n * -------------------------------------------------------------------------- */\n\ntype SeparatorElement = ComponentRef<typeof SeparatorPrimitive.Root>;\n\ninterface SeparatorProps\n extends ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>,\n Omit<SeparatorVariantsProps, 'orientation'> {}\n\nconst Separator = forwardRef<SeparatorElement, SeparatorProps>(\n ({ className, orientation, align, decorative = true, ...props }, forwardedRef) => (\n <SeparatorPrimitive.Root\n ref={forwardedRef}\n className={separatorVariants({ align, orientation, className })}\n decorative={decorative}\n orientation={orientation}\n {...props}\n />\n ),\n);\n\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SeparatorItem\n * -------------------------------------------------------------------------- */\n\ntype SeparatorItemElement = HTMLDivElement;\ntype SeparatorItemProps = HTMLAttributes<HTMLDivElement>;\n\nconst SeparatorItem = forwardRef<SeparatorItemElement, SeparatorItemProps>(({ className, ...props }, forwardedRef) => (\n <div\n ref={forwardedRef}\n className={cn('bg-background text-muted-foreground absolute mx-2 px-2 text-sm', className)}\n {...props}\n />\n));\n\nSeparatorItem.displayName = 'SeparatorItem';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Separator, SeparatorItem, type SeparatorProps };\n"]}
1
+ {"version":3,"sources":["../src/components/separator.tsx"],"names":["SeparatorPrimitive","forwardRef","tv","jsx","separatorVariants","Separator","className","orientation","align","decorative","props","forwardedRef","SeparatorItem","cn"],"mappings":"wCAAA,UAAYA,MAAwB,4BACpC,OAA2D,cAAAC,MAAuC,QAClG,OAAS,MAAAC,MAA6B,oBAwClC,cAAAC,MAAA,oBAhCJ,IAAMC,EAAoBF,EAAG,CAC3B,KAAM,+CACN,gBAAiB,CACf,MAAO,SACP,YAAa,YACf,EACA,SAAU,CACR,MAAO,CACL,MAAO,gBACP,OAAQ,iBACR,IAAK,aACP,EACA,YAAa,CACX,WAAY,cACZ,SAAU,sBACZ,CACF,CACF,CAAC,EAaKG,EAAYJ,EAChB,CAAC,CAAE,UAAAK,EAAW,YAAAC,EAAa,MAAAC,EAAO,WAAAC,EAAa,GAAM,GAAGC,CAAM,EAAGC,IAC/DR,EAAoB,OAAnB,CACC,IAAKQ,EACL,UAAWP,EAAkB,CAAE,MAAAI,EAAO,YAAAD,EAAa,UAAAD,CAAU,CAAC,EAC9D,WAAYG,EACZ,YAAaF,EACZ,GAAGG,EACN,CAEJ,EAEAL,EAAU,YAAiC,OAAK,YAShD,IAAMO,EAAgBX,EAAqD,CAAC,CAAE,UAAAK,EAAW,GAAGI,CAAM,EAAGC,IACnGR,EAAC,OACC,IAAKQ,EACL,UAAWE,EAAG,iEAAkEP,CAAS,EACxF,GAAGI,EACN,CACD,EAEDE,EAAc,YAAc","sourcesContent":["import * as SeparatorPrimitive from '@radix-ui/react-separator';\nimport { type ComponentPropsWithoutRef, type ComponentRef, forwardRef, type HTMLAttributes } from 'react';\nimport { tv, type VariantProps } from 'tailwind-variants';\n\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Variant: Separator\n * -------------------------------------------------------------------------- */\n\nconst separatorVariants = tv({\n base: 'bg-muted relative flex shrink-0 items-center',\n defaultVariants: {\n align: 'center',\n orientation: 'horizontal',\n },\n variants: {\n align: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n },\n orientation: {\n horizontal: 'h-px w-full',\n vertical: 'h-full w-px flex-col',\n },\n },\n});\n\ntype SeparatorVariantsProps = VariantProps<typeof separatorVariants>;\n\n/* -----------------------------------------------------------------------------\n * Component: Separator\n * -------------------------------------------------------------------------- */\n\ntype SeparatorElement = ComponentRef<typeof SeparatorPrimitive.Root>;\ninterface SeparatorProps\n extends ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>,\n Omit<SeparatorVariantsProps, 'orientation'> {}\n\nconst Separator = forwardRef<SeparatorElement, SeparatorProps>(\n ({ className, orientation, align, decorative = true, ...props }, forwardedRef) => (\n <SeparatorPrimitive.Root\n ref={forwardedRef}\n className={separatorVariants({ align, orientation, className })}\n decorative={decorative}\n orientation={orientation}\n {...props}\n />\n ),\n);\n\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SeparatorItem\n * -------------------------------------------------------------------------- */\n\ntype SeparatorItemElement = HTMLDivElement;\ntype SeparatorItemProps = HTMLAttributes<HTMLDivElement>;\n\nconst SeparatorItem = forwardRef<SeparatorItemElement, SeparatorItemProps>(({ className, ...props }, forwardedRef) => (\n <div\n ref={forwardedRef}\n className={cn('bg-background text-muted-foreground absolute mx-2 px-2 text-sm', className)}\n {...props}\n />\n));\n\nSeparatorItem.displayName = 'SeparatorItem';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Separator, SeparatorItem, type SeparatorProps };\n"]}
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-7MCTR55I.js";import{a as m}from"./chunk-YEXZOAP7.js";import{a as o}from"./chunk-EVRI6TWT.js";import{a as n}from"./chunk-VPYH6JWS.js";import*as e from"@codefast-ui/number-input";import{ChevronDownIcon as D,ChevronUpIcon as w}from"@radix-ui/react-icons";import{forwardRef as k}from"react";import{jsx as t,jsxs as p}from"react/jsx-runtime";var{root:E,input:L}=i(),O=k(({ariaDecrementLabel:u,ariaIncrementLabel:a,className:s,defaultValue:d,disabled:l,formatOptions:f,id:c,inputSize:r,loaderPosition:b,loading:I,max:N,min:v,onChange:P,prefix:h,readOnly:C,spinner:y,step:R,suffix:g,value:x,...V},B)=>p(e.Root,{ariaDecrementLabel:u,ariaIncrementLabel:a,className:E({inputSize:r,className:["pr-0",s]}),defaultValue:d,disabled:l,formatOptions:f,id:c,loaderPosition:b,loading:I,max:N,min:v,prefix:h,readOnly:C,spinner:y||t(m,{}),step:R,suffix:g,value:x,onChange:P,children:[t(e.Item,{ref:B,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",className:L({inputSize:r}),inputMode:"numeric",spellCheck:"false",...V}),p("div",{className:n("peer-focus:divide-ring peer-focus:border-l-ring","divide-input border-input order-last ml-auto grid h-full shrink-0 divide-y overflow-hidden rounded-r-[calc(theme(borderRadius.md)-1px)] border-l transition"),children:[t(e.IncrementButton,{className:o({className:"h-full rounded-none rounded-tr-[calc(theme(borderRadius.md)-1px)]",icon:!0,variant:"ghost",size:r}),children:t(w,{})}),t(e.DecrementButton,{className:o({className:"h-full rounded-none rounded-br-[calc(theme(borderRadius.md)-1px)]",icon:!0,variant:"ghost",size:r}),children:t(D,{})})]})]}));O.displayName="NumberInput";export{O as a};
2
- //# sourceMappingURL=chunk-DW3EYXPU.js.map
1
+ import{a as i}from"./chunk-7MCTR55I.js";import{a as m}from"./chunk-Q3UBBFLY.js";import{a as o}from"./chunk-EVRI6TWT.js";import{a as n}from"./chunk-VPYH6JWS.js";import*as e from"@codefast-ui/number-input";import{ChevronDownIcon as D,ChevronUpIcon as w}from"@radix-ui/react-icons";import{forwardRef as k}from"react";import{jsx as t,jsxs as p}from"react/jsx-runtime";var{root:E,input:L}=i(),O=k(({ariaDecrementLabel:u,ariaIncrementLabel:a,className:s,defaultValue:d,disabled:l,formatOptions:f,id:c,inputSize:r,loaderPosition:b,loading:I,max:N,min:v,onChange:P,prefix:h,readOnly:C,spinner:y,step:R,suffix:g,value:x,...V},B)=>p(e.Root,{ariaDecrementLabel:u,ariaIncrementLabel:a,className:E({inputSize:r,className:["pr-0",s]}),defaultValue:d,disabled:l,formatOptions:f,id:c,loaderPosition:b,loading:I,max:N,min:v,prefix:h,readOnly:C,spinner:y||t(m,{}),step:R,suffix:g,value:x,onChange:P,children:[t(e.Item,{ref:B,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",className:L({inputSize:r}),inputMode:"numeric",spellCheck:"false",...V}),p("div",{className:n("peer-focus:divide-ring peer-focus:border-l-ring","divide-input border-input order-last ml-auto grid h-full shrink-0 divide-y overflow-hidden rounded-r-[calc(theme(borderRadius.md)-1px)] border-l transition"),children:[t(e.IncrementButton,{className:o({className:"h-full rounded-none rounded-tr-[calc(theme(borderRadius.md)-1px)]",icon:!0,variant:"ghost",size:r}),children:t(w,{})}),t(e.DecrementButton,{className:o({className:"h-full rounded-none rounded-br-[calc(theme(borderRadius.md)-1px)]",icon:!0,variant:"ghost",size:r}),children:t(D,{})})]})]}));O.displayName="NumberInput";export{O as a};
2
+ //# sourceMappingURL=chunk-5I7UA4HT.js.map
@@ -1,2 +1,2 @@
1
- "use client";import{a as d}from"./chunk-TIDJ4IXN.js";import{a as i}from"./chunk-VPYH6JWS.js";import{createContextScope as g}from"@radix-ui/react-context";import{ArrowLeftIcon as B,ArrowRightIcon as D}from"@radix-ui/react-icons";import U from"embla-carousel-react";import{forwardRef as y,useCallback as f,useEffect as S,useState as b}from"react";import{jsx as s}from"react/jsx-runtime";var x="Carousel",[_,$]=g(x),[O,v]=_(x),z=y(({__scopeCarousel:l,children:a,orientation:o,opts:r,setApi:t,plugins:u,className:p,...c},C)=>{let[m,e]=U({...r,axis:o==="vertical"?"y":"x"},u),[R,H]=b(!1),[I,h]=b(!1),P=f(n=>{n&&(H(n.canScrollPrev()),h(n.canScrollNext()))},[]),E=f(()=>{e?.scrollPrev()},[e]),N=f(()=>{e?.scrollNext()},[e]),w=f(n=>{n.key==="ArrowLeft"?(n.preventDefault(),E()):n.key==="ArrowRight"&&(n.preventDefault(),N())},[E,N]);return S(()=>{!e||!t||t(e)},[e,t]),S(()=>{if(e)return P(e),e.on("reInit",P),e.on("select",P),()=>{e.off("select",P)}},[e,P]),s(O,{api:e,canScrollNext:I,canScrollPrev:R,carouselRef:m,opts:r,orientation:o??(r?.axis==="y"?"vertical":"horizontal"),scope:l,scrollNext:N,scrollPrev:E,children:s("div",{ref:C,"aria-roledescription":"carousel",className:i("relative",p),role:"region",onKeyDownCapture:w,...c,children:a})})});z.displayName=x;var T="CarouselContent",k=y(({__scopeCarousel:l,className:a,classNames:o,...r},t)=>{let{carouselRef:u,orientation:p}=v(T,l);return s("div",{ref:u,className:i("overflow-hidden",o?.wrapper),children:s("div",{ref:t,className:i("flex",p==="horizontal"?"-ml-4":"-mt-4 flex-col",o?.content,a),...r})})});k.displayName=T;var L="CarouselItem",K=y(({__scopeCarousel:l,className:a,...o},r)=>{let{orientation:t}=v(L,l);return s("div",{ref:r,"aria-roledescription":"slide",className:i("min-w-0 shrink-0 grow-0 basis-full",t==="horizontal"?"pl-4":"pt-4",a),role:"group",...o})});K.displayName=L;var A="CarouselPrevious",V=y(({__scopeCarousel:l,className:a,icon:o=!0,size:r="sm",variant:t="outline",...u},p)=>{let{orientation:c,scrollPrev:C,canScrollPrev:m}=v(A,l);return s(d,{ref:p,className:i("absolute",c==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",a),disabled:!m,icon:o,prefix:s(B,{}),size:r,variant:t,onClick:C,...u,children:s("span",{className:"sr-only",children:"Previous slide"})})});V.displayName=A;var M="CarouselNext",X=y(({__scopeCarousel:l,className:a,icon:o=!0,size:r="sm",variant:t="outline",...u},p)=>{let{orientation:c,scrollNext:C,canScrollNext:m}=v(M,l);return s(d,{ref:p,className:i("absolute",c==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",a),disabled:!m,icon:o,prefix:s(D,{}),size:r,variant:t,onClick:C,...u,children:s("span",{className:"sr-only",children:"Next slide"})})});X.displayName=M;export{$ as a,z as b,k as c,K as d,V as e,X as f};
2
- //# sourceMappingURL=chunk-ID2R45SP.js.map
1
+ "use client";import{a as d}from"./chunk-24TJIVWR.js";import{a as i}from"./chunk-VPYH6JWS.js";import{createContextScope as g}from"@radix-ui/react-context";import{ArrowLeftIcon as B,ArrowRightIcon as D}from"@radix-ui/react-icons";import U from"embla-carousel-react";import{forwardRef as y,useCallback as f,useEffect as S,useState as b}from"react";import{jsx as s}from"react/jsx-runtime";var x="Carousel",[_,$]=g(x),[O,v]=_(x),z=y(({__scopeCarousel:l,children:a,orientation:o,opts:r,setApi:t,plugins:u,className:p,...c},C)=>{let[m,e]=U({...r,axis:o==="vertical"?"y":"x"},u),[R,H]=b(!1),[I,h]=b(!1),P=f(n=>{n&&(H(n.canScrollPrev()),h(n.canScrollNext()))},[]),E=f(()=>{e?.scrollPrev()},[e]),N=f(()=>{e?.scrollNext()},[e]),w=f(n=>{n.key==="ArrowLeft"?(n.preventDefault(),E()):n.key==="ArrowRight"&&(n.preventDefault(),N())},[E,N]);return S(()=>{!e||!t||t(e)},[e,t]),S(()=>{if(e)return P(e),e.on("reInit",P),e.on("select",P),()=>{e.off("select",P)}},[e,P]),s(O,{api:e,canScrollNext:I,canScrollPrev:R,carouselRef:m,opts:r,orientation:o??(r?.axis==="y"?"vertical":"horizontal"),scope:l,scrollNext:N,scrollPrev:E,children:s("div",{ref:C,"aria-roledescription":"carousel",className:i("relative",p),role:"region",onKeyDownCapture:w,...c,children:a})})});z.displayName=x;var T="CarouselContent",k=y(({__scopeCarousel:l,className:a,classNames:o,...r},t)=>{let{carouselRef:u,orientation:p}=v(T,l);return s("div",{ref:u,className:i("overflow-hidden",o?.wrapper),children:s("div",{ref:t,className:i("flex",p==="horizontal"?"-ml-4":"-mt-4 flex-col",o?.content,a),...r})})});k.displayName=T;var L="CarouselItem",K=y(({__scopeCarousel:l,className:a,...o},r)=>{let{orientation:t}=v(L,l);return s("div",{ref:r,"aria-roledescription":"slide",className:i("min-w-0 shrink-0 grow-0 basis-full",t==="horizontal"?"pl-4":"pt-4",a),role:"group",...o})});K.displayName=L;var A="CarouselPrevious",V=y(({__scopeCarousel:l,className:a,icon:o=!0,size:r="sm",variant:t="outline",...u},p)=>{let{orientation:c,scrollPrev:C,canScrollPrev:m}=v(A,l);return s(d,{ref:p,className:i("absolute",c==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",a),disabled:!m,icon:o,prefix:s(B,{}),size:r,variant:t,onClick:C,...u,children:s("span",{className:"sr-only",children:"Previous slide"})})});V.displayName=A;var M="CarouselNext",X=y(({__scopeCarousel:l,className:a,icon:o=!0,size:r="sm",variant:t="outline",...u},p)=>{let{orientation:c,scrollNext:C,canScrollNext:m}=v(M,l);return s(d,{ref:p,className:i("absolute",c==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",a),disabled:!m,icon:o,prefix:s(D,{}),size:r,variant:t,onClick:C,...u,children:s("span",{className:"sr-only",children:"Next slide"})})});X.displayName=M;export{$ as a,z as b,k as c,K as d,V as e,X as f};
2
+ //# sourceMappingURL=chunk-5LM6T7Z5.js.map
@@ -1,2 +1,2 @@
1
1
  import{Slot as a}from"@radix-ui/react-slot";import{forwardRef as o}from"react";import{jsx as s}from"react/jsx-runtime";var n=o(({as:e="p",asChild:t,...r},p)=>s(t?a:e,{ref:p,...r}));n.displayName="Text";export{n as a};
2
- //# sourceMappingURL=chunk-EMTBWZS5.js.map
2
+ //# sourceMappingURL=chunk-7KTCYDVV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/text.tsx"],"names":["Slot","forwardRef","jsx","Text","Tag","asChild","props","forwardedRef"],"mappings":"AAAA,OAAS,QAAAA,MAAY,uBACrB,OAAS,cAAAC,MAAuC,QAsBvC,cAAAC,MAAA,oBAHT,IAAMC,EAAOF,EAAmC,CAAC,CAAE,GAAIG,EAAM,IAAK,QAAAC,EAAS,GAAGC,CAAM,EAAGC,IAG9EL,EAFWG,EAAUL,EAAOI,EAE3B,CAAU,IAAKG,EAAe,GAAGD,EAAO,CACjD,EAEDH,EAAK,YAAc","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { forwardRef, type HTMLAttributes } from 'react';\n\n/* -----------------------------------------------------------------------------\n * Component: Text\n * -------------------------------------------------------------------------- */\n\ntype TextElement = HTMLParagraphElement;\ninterface TextParagraphProps extends HTMLAttributes<HTMLParagraphElement> {\n as?: 'p';\n}\n\ninterface TextSpanProps extends HTMLAttributes<HTMLSpanElement> {\n as: 'span';\n}\n\ntype TextProps = (TextParagraphProps | TextSpanProps) & {\n asChild?: boolean;\n};\n\nconst Text = forwardRef<TextElement, TextProps>(({ as: Tag = 'p', asChild, ...props }, forwardedRef) => {\n const Component = asChild ? Slot : Tag;\n\n return <Component ref={forwardedRef} {...props} />;\n});\n\nText.displayName = 'Text';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Text, type TextProps };\n"]}
@@ -1,2 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _reactvisuallyhidden = require('@radix-ui/react-visually-hidden');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var e=8,u= exports.a =_react.forwardRef.call(void 0, ({children:r,className:s,loading:o=!0,...p},l)=>{if(!o)return r;let a=_jsxruntime.jsx.call(void 0, "span",{ref:l,className:_chunkDD6AVCRHcjs.a.call(void 0, "relative flex size-4 items-center justify-center opacity-60",s),...p,children:Array.from({length:e},(b,t)=>_jsxruntime.jsx.call(void 0, "span",{className:"before:fade-out-25 before:animate-out before:animate-repeat-infinite before:animate-delay-[var(--spinner-delay)] before:animate-duration-[var(--spinner-duration)] absolute h-full rotate-[var(--spinner-rotate)] before:block before:h-1/3 before:w-full before:rounded-full before:bg-current",style:{width:`${(100/e).toString()}%`,"--spinner-delay":`-${((e-t)*100).toString()}ms`,"--spinner-rotate":`${(360/e*t).toString()}deg`,"--spinner-duration":`${(e*100).toString()}ms`}},t))});return r===void 0?a:_jsxruntime.jsxs.call(void 0, "span",{className:"relative",children:[_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":!0,className:"invisible contents",children:r}),_jsxruntime.jsx.call(void 0, _reactvisuallyhidden.VisuallyHidden,{children:r}),_jsxruntime.jsx.call(void 0, "span",{className:"absolute inset-0 flex items-center justify-center",children:a})]})});u.displayName="Spinner";exports.a = u;
2
- //# sourceMappingURL=chunk-X42QLXWG.cjs.map
2
+ //# sourceMappingURL=chunk-7R4FFNVE.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-7R4FFNVE.cjs","../src/components/spinner.tsx"],"names":["spinnerCount","Spinner","forwardRef","children","className","loading","props","forwardedRef","spinner","jsx","cn","_","i"],"mappings":"AAAA,iIAAwC,sECAT,8BACqC,+CA4B1D,IApBJA,CAAAA,CAAe,CAAA,CAOfC,CAAAA,aAAUC,+BAAAA,CACb,CAAE,QAAA,CAAAC,CAAAA,CAAU,SAAA,CAAAC,CAAAA,CAAW,OAAA,CAAAC,CAAAA,CAAU,CAAA,CAAA,CAAM,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAAiB,CACnE,EAAA,CAAI,CAACF,CAAAA,CACH,OAAOF,CAAAA,CAGT,IAAMK,CAAAA,CACJC,6BAAAA,MAAC,CAAA,CACC,GAAA,CAAKF,CAAAA,CACL,SAAA,CAAWG,iCAAAA,6DAAG,CAA+DN,CAAS,CAAA,CACrF,GAAGE,CAAAA,CAEH,QAAA,CAAA,KAAA,CAAM,IAAA,CAAK,CAAE,MAAA,CAAQN,CAAa,CAAA,CAAG,CAACW,CAAAA,CAAGC,CAAAA,CAAAA,EACxCH,6BAAAA,MAAC,CAAA,CAEC,SAAA,CAAU,iSAAA,CACV,KAAA,CACE,CACE,KAAA,CAAO,CAAA,EAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-7R4FFNVE.cjs","sourcesContent":[null,"import { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport { type CSSProperties, forwardRef, type HTMLAttributes } from 'react';\n\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Spinner\n * -------------------------------------------------------------------------- */\n\nconst spinnerCount = 8;\n\ntype SpinnerElement = HTMLSpanElement;\ninterface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {\n loading?: boolean;\n}\n\nconst Spinner = forwardRef<SpinnerElement, SpinnerProps>(\n ({ children, className, loading = true, ...props }, forwardedRef) => {\n if (!loading) {\n return children;\n }\n\n const spinner = (\n <span\n ref={forwardedRef}\n className={cn('relative flex size-4 items-center justify-center opacity-60', className)}\n {...props}\n >\n {Array.from({ length: spinnerCount }, (_, i) => (\n <span\n key={i}\n className=\"before:fade-out-25 before:animate-out before:animate-repeat-infinite before:animate-delay-[var(--spinner-delay)] before:animate-duration-[var(--spinner-duration)] absolute h-full rotate-[var(--spinner-rotate)] before:block before:h-1/3 before:w-full before:rounded-full before:bg-current\"\n style={\n {\n width: `${(100 / spinnerCount).toString()}%`,\n '--spinner-delay': `-${((spinnerCount - i) * 100).toString()}ms`,\n '--spinner-rotate': `${((360 / spinnerCount) * i).toString()}deg`,\n '--spinner-duration': `${(spinnerCount * 100).toString()}ms`,\n } as CSSProperties\n }\n />\n ))}\n </span>\n );\n\n if (children === undefined) {\n return spinner;\n }\n\n return (\n <span className=\"relative\">\n <span aria-hidden className=\"invisible contents\">\n {children}\n </span>\n <VisuallyHidden>{children}</VisuallyHidden>\n <span className=\"absolute inset-0 flex items-center justify-center\">{spinner}</span>\n </span>\n );\n },\n);\n\nSpinner.displayName = 'Spinner';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Spinner, type SpinnerProps };\n"]}
@@ -0,0 +1,2 @@
1
+ "use client";import{a as _,b as k,c as A,d as D}from"./chunk-CTKVRKDK.js";import{a as H}from"./chunk-NPOAOTIH.js";import{a as N}from"./chunk-432ZMHFM.js";import{a as T,c as I,g as B,h as L}from"./chunk-MO7TQSRR.js";import{a as P}from"./chunk-NSTXYMJD.js";import{a as w}from"./chunk-24TJIVWR.js";import{a as o}from"./chunk-VPYH6JWS.js";import{useMediaQuery as V}from"@codefast/hooks";import{Slot as v}from"@radix-ui/react-slot";import{VisuallyHidden as F}from"@radix-ui/react-visually-hidden";import{PanelLeftIcon as $}from"lucide-react";import{createContext as U,forwardRef as n,useCallback as G,useContext as W,useEffect as j,useMemo as R,useState as z}from"react";import{tv as q}from"tailwind-variants";import{jsx as r,jsxs as f}from"react/jsx-runtime";var Q="sidebar:state",X=60*60*24*7,Y="16rem",J="18rem",Z="3rem",ee="b",te=768,O=U(null);function M(){let t=W(O);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}var ae=n(({defaultOpen:t=!0,open:e,onOpenChange:a,className:i,style:d,children:s,...c},S)=>{let p=V(`(max-width: ${te-1}px)`),[m,b]=z(!1),[h,E]=z(t),g=e??h,x=G(l=>{let u=typeof l=="function"?l(g):l;a?a(u):E(u),document.cookie=`${Q}=${u}; path=/; max-age=${X}`},[a,g]),y=G(()=>{p?b(l=>!l):x(l=>!l)},[p,x,b]);j(()=>{let l=u=>{u.key===ee&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),y())};return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[y]);let C=g?"expanded":"collapsed",K=R(()=>({state:C,open:g,setOpen:x,isMobile:p,openMobile:m,setOpenMobile:b,toggleSidebar:y}),[C,g,x,p,m,b,y]);return r(O.Provider,{value:K,children:r(_,{delayDuration:0,children:r("div",{ref:S,className:o("group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex min-h-svh w-full",i),style:{"--sidebar-width":Y,"--sidebar-width-icon":Z,...d},...c,children:s})})})});ae.displayName="SidebarProvider";var re=n(({side:t="left",variant:e="sidebar",collapsible:a="offcanvas",className:i,children:d,...s},c)=>{let{isMobile:S,state:p,openMobile:m,setOpenMobile:b}=M();return a==="none"?r("div",{ref:c,className:o("bg-sidebar text-sidebar-foreground flex h-full w-[--sidebar-width] flex-col",i),...s,children:d}):S?r(T,{open:m,onOpenChange:b,...s,children:f(I,{className:"bg-sidebar text-sidebar-foreground w-[--sidebar-width] p-0 [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar",side:t,style:{"--sidebar-width":J},children:[f(F,{children:[r(B,{children:"Sidebar"}),r(L,{children:"Press escape to close the sidebar"})]}),r("div",{className:"flex h-full w-full flex-col",children:d})]})}):f("div",{ref:c,className:"text-sidebar-foreground group peer hidden md:block","data-collapsible":p==="collapsed"?a:"","data-side":t,"data-state":p,"data-variant":e,children:[r("div",{className:o("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),r("div",{className:o("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...s,children:r("div",{className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow","data-sidebar":"sidebar",children:d})})]})});re.displayName="Sidebar";var oe=n(({className:t,onClick:e,...a},i)=>{let{toggleSidebar:d}=M();return f(w,{ref:i,icon:!0,className:o("",t),"data-sidebar":"trigger",size:"xxs",variant:"ghost",onClick:s=>{e?.(s),d()},...a,children:[r($,{}),r("span",{className:"sr-only",children:"Toggle Sidebar"})]})});oe.displayName="SidebarTrigger";var ne=n(({className:t,...e},a)=>{let{toggleSidebar:i}=M();return r("button",{ref:a,"aria-label":"Toggle Sidebar",className:o("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:hover:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),"data-sidebar":"rail",tabIndex:-1,title:"Toggle Sidebar",type:"button",onClick:i,...e})});ne.displayName="SidebarRail";var ie=n(({className:t,...e},a)=>r("main",{ref:a,className:o("bg-background relative flex min-h-svh flex-1 flex-col","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",t),...e}));ie.displayName="SidebarInset";var de=n(({className:t,...e},a)=>r(H,{ref:a,className:o("bg-background focus-visible:ring-sidebar-ring h-8 w-full shadow-none focus-visible:ring-2",t),"data-sidebar":"input",...e}));de.displayName="SidebarInput";var se=n(({className:t,...e},a)=>r("div",{ref:a,className:o("flex flex-col gap-2 p-2",t),"data-sidebar":"header",...e}));se.displayName="SidebarHeader";var le=n(({className:t,...e},a)=>r("div",{ref:a,className:o("flex flex-col gap-2 p-2",t),"data-sidebar":"footer",...e}));le.displayName="SidebarFooter";var pe=n(({className:t,...e},a)=>r(N,{ref:a,className:o("bg-sidebar-border mx-2 w-auto",t),"data-sidebar":"separator",...e}));pe.displayName="SidebarSeparator";var be=n(({className:t,...e},a)=>r("div",{ref:a,className:o("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),"data-sidebar":"content",...e}));be.displayName="SidebarContent";var ue=n(({className:t,...e},a)=>r("div",{ref:a,className:o("relative flex w-full min-w-0 flex-col p-2",t),"data-sidebar":"group",...e}));ue.displayName="SidebarGroup";var ce=n(({className:t,asChild:e=!1,...a},i)=>r(e?v:"div",{ref:i,className:o("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),"data-sidebar":"group-label",...a}));ce.displayName="SidebarGroupLabel";var me=n(({className:t,asChild:e=!1,...a},i)=>r(e?v:"button",{ref:i,className:o("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),"data-sidebar":"group-action",...a}));me.displayName="SidebarGroupAction";var fe=n(({className:t,...e},a)=>r("div",{ref:a,className:o("w-full text-sm",t),"data-sidebar":"group-content",...e}));fe.displayName="SidebarGroupContent";var Se=n(({className:t,...e},a)=>r("ul",{ref:a,className:o("flex w-full min-w-0 flex-col gap-1",t),"data-sidebar":"menu",...e}));Se.displayName="SidebarMenu";var ge=n(({className:t,...e},a)=>r("li",{ref:a,className:o("group/menu-item relative",t),"data-sidebar":"menu-item",...e}));ge.displayName="SidebarMenuItem";var ve=q({base:"peer/menu-button ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none transition-[width,height,padding] focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:font-medium group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),he=n(({asChild:t=!1,isActive:e=!1,variant:a="default",size:i="default",tooltip:d,className:s,...c},S)=>{let p=t?v:"button",{isMobile:m,state:b}=M(),h=r(p,{ref:S,className:o(ve({variant:a,size:i}),s),"data-active":e,"data-sidebar":"menu-button","data-size":i,...c});return d?f(k,{children:[r(A,{asChild:!0,children:h}),r(D,{align:"center",hidden:b!=="collapsed"||m,side:"right",...typeof d=="string"?{children:d}:d})]}):h});he.displayName="SidebarMenuButton";var xe=n(({className:t,asChild:e=!1,showOnHover:a=!1,...i},d)=>r(e?v:"button",{ref:d,className:o("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t),"data-sidebar":"menu-action",...i}));xe.displayName="SidebarMenuAction";var ye=n(({className:t,...e},a)=>r("div",{ref:a,className:o("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),"data-sidebar":"menu-badge",...e}));ye.displayName="SidebarMenuBadge";var Me=n(({className:t,showIcon:e=!1,...a},i)=>{let d=R(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return f("div",{ref:i,className:o("flex h-8 items-center gap-2 rounded-md px-2",t),"data-sidebar":"menu-skeleton",...a,children:[e?r(P,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}):null,r(P,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":d}})]})});Me.displayName="SidebarMenuSkeleton";var Pe=n(({className:t,...e},a)=>r("ul",{ref:a,className:o("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),"data-sidebar":"menu-sub",...e}));Pe.displayName="SidebarMenuSub";var Ee=n(({...t},e)=>r("li",{ref:e,...t}));Ee.displayName="SidebarMenuSubItem";var Ce=n(({asChild:t=!1,size:e="md",isActive:a,className:i,...d},s)=>r(t?v:"a",{ref:s,className:o("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",i),"data-active":a,"data-sidebar":"menu-sub-button","data-size":e,...d}));Ce.displayName="SidebarMenuSubButton";export{M as a,ae as b,re as c,oe as d,ne as e,ie as f,de as g,se as h,le as i,pe as j,be as k,ue as l,ce as m,me as n,fe as o,Se as p,ge as q,he as r,xe as s,ye as t,Me as u,Pe as v,Ee as w,Ce as x};
2
+ //# sourceMappingURL=chunk-A5RTV4IE.js.map