@dub/ui 0.0.0

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 (397) hide show
  1. package/.turbo/turbo-build.log +129 -0
  2. package/dist/accordion.d.ts +9 -0
  3. package/dist/accordion.mjs +2 -0
  4. package/dist/avatar.d.ts +15 -0
  5. package/dist/avatar.mjs +2 -0
  6. package/dist/background/index.css +1 -0
  7. package/dist/background/index.d.ts +5 -0
  8. package/dist/background/index.mjs +2 -0
  9. package/dist/background.d.ts +5 -0
  10. package/dist/background.mjs +2 -0
  11. package/dist/badge.d.ts +12 -0
  12. package/dist/badge.mjs +2 -0
  13. package/dist/blur-image.d.ts +6 -0
  14. package/dist/blur-image.mjs +2 -0
  15. package/dist/button.css +1 -0
  16. package/dist/button.d.ts +13 -0
  17. package/dist/button.mjs +2 -0
  18. package/dist/chunk-244OSE43.mjs +2 -0
  19. package/dist/chunk-25PGVVAM.mjs +2 -0
  20. package/dist/chunk-2CR6AI65.mjs +2 -0
  21. package/dist/chunk-2KZFWJJX.mjs +2 -0
  22. package/dist/chunk-2O5K4D5Q.mjs +2 -0
  23. package/dist/chunk-2SFV6FGR.mjs +2 -0
  24. package/dist/chunk-2TGXECZQ.mjs +2 -0
  25. package/dist/chunk-2ZQKPJ36.mjs +2 -0
  26. package/dist/chunk-33QWEDY7.mjs +8 -0
  27. package/dist/chunk-3GU5I4KI.mjs +2 -0
  28. package/dist/chunk-3Q6B4UEP.mjs +2 -0
  29. package/dist/chunk-3S3WMTNJ.mjs +2 -0
  30. package/dist/chunk-3YDMSFPQ.mjs +2 -0
  31. package/dist/chunk-3ZOR7HDE.mjs +2 -0
  32. package/dist/chunk-4555QYZ6.mjs +2 -0
  33. package/dist/chunk-46KYE2TK.mjs +2 -0
  34. package/dist/chunk-4B27GTB4.mjs +3 -0
  35. package/dist/chunk-4JKAA2S4.mjs +2 -0
  36. package/dist/chunk-4JXT2OCG.mjs +2 -0
  37. package/dist/chunk-4OESW4SN.mjs +2 -0
  38. package/dist/chunk-4QDUUMAW.mjs +2 -0
  39. package/dist/chunk-4XBYRIVX.mjs +2 -0
  40. package/dist/chunk-4ZSCYPP2.mjs +2 -0
  41. package/dist/chunk-56D4WGXU.mjs +2 -0
  42. package/dist/chunk-56DTUGDB.mjs +2 -0
  43. package/dist/chunk-5A2BHTHD.mjs +2 -0
  44. package/dist/chunk-5EWSH7PD.mjs +2 -0
  45. package/dist/chunk-5JYRCHLM.mjs +2 -0
  46. package/dist/chunk-5SGX2GJA.mjs +2 -0
  47. package/dist/chunk-5UODCYNT.mjs +2 -0
  48. package/dist/chunk-5VNTIKQZ.mjs +2 -0
  49. package/dist/chunk-5WZZBGKJ.mjs +2 -0
  50. package/dist/chunk-6C6ANQBQ.mjs +2 -0
  51. package/dist/chunk-6DKNMNDW.mjs +2 -0
  52. package/dist/chunk-6GJY5OO4.mjs +2 -0
  53. package/dist/chunk-6KTUEBPU.mjs +2 -0
  54. package/dist/chunk-6S57E6BS.mjs +2 -0
  55. package/dist/chunk-6TNUMRJD.mjs +3 -0
  56. package/dist/chunk-7AQLFQZX.mjs +2 -0
  57. package/dist/chunk-7FBJXRA5.mjs +2 -0
  58. package/dist/chunk-7FTHTS2N.mjs +2 -0
  59. package/dist/chunk-7GWUKTP3.mjs +2 -0
  60. package/dist/chunk-7HABTH45.mjs +2 -0
  61. package/dist/chunk-7JAMW2DV.mjs +2 -0
  62. package/dist/chunk-7LB36OSM.mjs +2 -0
  63. package/dist/chunk-7O2ZOJNB.mjs +2 -0
  64. package/dist/chunk-7QQZYSZX.mjs +2 -0
  65. package/dist/chunk-7RM43KIQ.mjs +2 -0
  66. package/dist/chunk-7UOWPARW.mjs +2 -0
  67. package/dist/chunk-A3PUDJ7V.mjs +1 -0
  68. package/dist/chunk-AACJEMFS.mjs +2 -0
  69. package/dist/chunk-ABLQYIFT.mjs +2 -0
  70. package/dist/chunk-AUBFB4SI.mjs +2 -0
  71. package/dist/chunk-AUVV5HUC.mjs +2 -0
  72. package/dist/chunk-AZD2JXYJ.mjs +2 -0
  73. package/dist/chunk-B3VKF2VA.mjs +2 -0
  74. package/dist/chunk-B4HABAR3.mjs +2 -0
  75. package/dist/chunk-B6VWIQYU.mjs +3 -0
  76. package/dist/chunk-BHTYGPAI.mjs +2 -0
  77. package/dist/chunk-BZJK6BT5.mjs +2 -0
  78. package/dist/chunk-C33FCZ32.mjs +2 -0
  79. package/dist/chunk-C3ZLFBBA.mjs +1 -0
  80. package/dist/chunk-C4PESNHJ.mjs +2 -0
  81. package/dist/chunk-C5IOO5UD.mjs +2 -0
  82. package/dist/chunk-CBHHIJGG.mjs +2 -0
  83. package/dist/chunk-CCKZ5QDB.mjs +2 -0
  84. package/dist/chunk-CFCHBBAJ.mjs +2 -0
  85. package/dist/chunk-D2Q6GSHJ.mjs +2 -0
  86. package/dist/chunk-D3NFRR3I.mjs +2 -0
  87. package/dist/chunk-DG5QULNJ.mjs +2 -0
  88. package/dist/chunk-DHJFK2S6.mjs +2 -0
  89. package/dist/chunk-DIJAPN4A.mjs +2 -0
  90. package/dist/chunk-DMNL3RKY.mjs +2 -0
  91. package/dist/chunk-DNZ5INSW.mjs +2 -0
  92. package/dist/chunk-DOE7DSDC.mjs +2 -0
  93. package/dist/chunk-E2TMZ3II.mjs +2 -0
  94. package/dist/chunk-E5ZJGOXG.mjs +2 -0
  95. package/dist/chunk-ECNXBGSQ.mjs +2 -0
  96. package/dist/chunk-EFQSHW3O.mjs +2 -0
  97. package/dist/chunk-EGZBNRFB.mjs +2 -0
  98. package/dist/chunk-EHYVEIOL.mjs +2 -0
  99. package/dist/chunk-EL4XTTMC.mjs +2 -0
  100. package/dist/chunk-EY55E5DB.mjs +2 -0
  101. package/dist/chunk-F6OPUNTW.mjs +2 -0
  102. package/dist/chunk-F6RVKSBN.mjs +2 -0
  103. package/dist/chunk-FMOY54OP.mjs +2 -0
  104. package/dist/chunk-FMUX4F5B.mjs +2 -0
  105. package/dist/chunk-FR336PIX.mjs +2 -0
  106. package/dist/chunk-G4PPRIHO.mjs +2 -0
  107. package/dist/chunk-GA4JDGWI.mjs +2 -0
  108. package/dist/chunk-GF6NH2NZ.mjs +2 -0
  109. package/dist/chunk-GFMXORYG.mjs +2 -0
  110. package/dist/chunk-GR726Z6I.mjs +2 -0
  111. package/dist/chunk-GRAJLMHF.mjs +2 -0
  112. package/dist/chunk-GSQUGPJ2.mjs +2 -0
  113. package/dist/chunk-GVANYQ67.mjs +1 -0
  114. package/dist/chunk-GVCIDQOF.mjs +2 -0
  115. package/dist/chunk-GXDFY5X2.mjs +2 -0
  116. package/dist/chunk-HCV274NJ.mjs +2 -0
  117. package/dist/chunk-HFY7GEA4.mjs +2 -0
  118. package/dist/chunk-HI3TSQ5W.mjs +2 -0
  119. package/dist/chunk-HMVFMHDB.mjs +2 -0
  120. package/dist/chunk-HNCJ4TJR.mjs +2 -0
  121. package/dist/chunk-HRN3EQEB.mjs +2 -0
  122. package/dist/chunk-I23BSUWS.mjs +2 -0
  123. package/dist/chunk-I57LZ6JE.mjs +2 -0
  124. package/dist/chunk-IG7XYDDR.mjs +2 -0
  125. package/dist/chunk-IHPV7RPK.mjs +2 -0
  126. package/dist/chunk-IJBZR4LN.mjs +8 -0
  127. package/dist/chunk-IJKZ5HB5.mjs +2 -0
  128. package/dist/chunk-IK4XBUOE.mjs +2 -0
  129. package/dist/chunk-ITDAQXDS.mjs +1 -0
  130. package/dist/chunk-IWV22LBB.mjs +2 -0
  131. package/dist/chunk-IY2HG3NK.mjs +8 -0
  132. package/dist/chunk-IYAB6FPB.mjs +2 -0
  133. package/dist/chunk-IZXIJLTW.mjs +2 -0
  134. package/dist/chunk-J5SA2VPW.mjs +3 -0
  135. package/dist/chunk-J63GHRZH.mjs +2 -0
  136. package/dist/chunk-JBL2DUF5.mjs +2 -0
  137. package/dist/chunk-JEJ4EWU7.mjs +2 -0
  138. package/dist/chunk-JIFH2LYE.mjs +3 -0
  139. package/dist/chunk-JJNAD6S4.mjs +3 -0
  140. package/dist/chunk-JLET4OCX.mjs +3 -0
  141. package/dist/chunk-JORK4T7Q.mjs +2 -0
  142. package/dist/chunk-JP7IWWG3.mjs +2 -0
  143. package/dist/chunk-JVM44TKC.mjs +2 -0
  144. package/dist/chunk-KBSQGAWB.mjs +2 -0
  145. package/dist/chunk-KDGZ6H77.mjs +2 -0
  146. package/dist/chunk-KF5NIC53.mjs +2 -0
  147. package/dist/chunk-KKCOE2RH.mjs +2 -0
  148. package/dist/chunk-KMHFLT2M.mjs +2 -0
  149. package/dist/chunk-KNYITJKS.mjs +2 -0
  150. package/dist/chunk-KQEO6U4W.mjs +2 -0
  151. package/dist/chunk-KQFL4H7A.mjs +2 -0
  152. package/dist/chunk-KUSH4SR2.mjs +2 -0
  153. package/dist/chunk-KVVEZANZ.mjs +2 -0
  154. package/dist/chunk-KWZ4DBE4.mjs +2 -0
  155. package/dist/chunk-L5KPIGCR.mjs +2 -0
  156. package/dist/chunk-L6UWBEZE.mjs +2 -0
  157. package/dist/chunk-LAQSQMES.mjs +2 -0
  158. package/dist/chunk-LFMW2GVW.mjs +3 -0
  159. package/dist/chunk-LRCJQIJG.mjs +2 -0
  160. package/dist/chunk-M4Q2EF5G.mjs +2 -0
  161. package/dist/chunk-MCXA7VY2.mjs +2 -0
  162. package/dist/chunk-MKKBN6XG.mjs +2 -0
  163. package/dist/chunk-MN57ZXBI.mjs +2 -0
  164. package/dist/chunk-MO5Z5S7B.mjs +2 -0
  165. package/dist/chunk-MOPBLS6N.mjs +2 -0
  166. package/dist/chunk-MURAUI3W.mjs +2 -0
  167. package/dist/chunk-MYBLDYMF.mjs +2 -0
  168. package/dist/chunk-MYKWMBLF.mjs +2 -0
  169. package/dist/chunk-N7BNEQPU.mjs +2 -0
  170. package/dist/chunk-NA4EVPAY.mjs +2 -0
  171. package/dist/chunk-NEH5H6FT.mjs +8 -0
  172. package/dist/chunk-NFAXHR5T.mjs +2 -0
  173. package/dist/chunk-NHHVF35L.mjs +2 -0
  174. package/dist/chunk-NJKAWDPD.mjs +2 -0
  175. package/dist/chunk-NPDJHIVO.mjs +2 -0
  176. package/dist/chunk-NSWEINWF.mjs +2 -0
  177. package/dist/chunk-NWB2AZNS.mjs +2 -0
  178. package/dist/chunk-NX47KGRW.mjs +2 -0
  179. package/dist/chunk-NYBTLOVB.mjs +3 -0
  180. package/dist/chunk-O55CBIBG.mjs +8 -0
  181. package/dist/chunk-OGAYDFMV.mjs +2 -0
  182. package/dist/chunk-OI77O6SL.mjs +2 -0
  183. package/dist/chunk-OIU4BN7T.mjs +2 -0
  184. package/dist/chunk-OJXGRTYX.mjs +2 -0
  185. package/dist/chunk-OKOSJ4DF.mjs +2 -0
  186. package/dist/chunk-OLQNYINM.mjs +2 -0
  187. package/dist/chunk-OMIP4OG5.mjs +2 -0
  188. package/dist/chunk-OTLHHZOF.mjs +2 -0
  189. package/dist/chunk-OX66FZYY.mjs +2 -0
  190. package/dist/chunk-OXANJWH4.mjs +2 -0
  191. package/dist/chunk-OYEGFR5W.mjs +2 -0
  192. package/dist/chunk-PGXM347Z.mjs +2 -0
  193. package/dist/chunk-PIEMQYVU.mjs +2 -0
  194. package/dist/chunk-PISF5LGD.mjs +2 -0
  195. package/dist/chunk-PMAKRWPB.mjs +2 -0
  196. package/dist/chunk-PPNWHWNQ.mjs +2 -0
  197. package/dist/chunk-PPR7AQWS.mjs +2 -0
  198. package/dist/chunk-PRUCD3QQ.mjs +2 -0
  199. package/dist/chunk-PVPFL6D6.mjs +2 -0
  200. package/dist/chunk-Q64KZRX2.mjs +2 -0
  201. package/dist/chunk-QDT2R7NG.mjs +2 -0
  202. package/dist/chunk-QLD74AUU.mjs +2 -0
  203. package/dist/chunk-QP2EHAF7.mjs +2 -0
  204. package/dist/chunk-QS3K2BUJ.mjs +2 -0
  205. package/dist/chunk-QTY5FUJ3.mjs +2 -0
  206. package/dist/chunk-QXM65Z6A.mjs +2 -0
  207. package/dist/chunk-QZJO3GBP.mjs +2 -0
  208. package/dist/chunk-RF3BM6RY.mjs +2 -0
  209. package/dist/chunk-RF6IPNCO.mjs +2 -0
  210. package/dist/chunk-RF757N25.mjs +3 -0
  211. package/dist/chunk-RQBEORWD.mjs +2 -0
  212. package/dist/chunk-RRZDOFPB.mjs +2 -0
  213. package/dist/chunk-RT4DYHL4.mjs +2 -0
  214. package/dist/chunk-RWND7PHS.mjs +2 -0
  215. package/dist/chunk-S7GVW42L.mjs +2 -0
  216. package/dist/chunk-SGDLNADF.mjs +2 -0
  217. package/dist/chunk-SJHDGCSL.mjs +2 -0
  218. package/dist/chunk-SN3ZPBNA.mjs +2 -0
  219. package/dist/chunk-SRB37H2M.mjs +2 -0
  220. package/dist/chunk-SVXEWZS2.mjs +2 -0
  221. package/dist/chunk-SWY5WJTL.mjs +2 -0
  222. package/dist/chunk-T2HLWVVR.mjs +3 -0
  223. package/dist/chunk-T4YFARK5.mjs +2 -0
  224. package/dist/chunk-TEYRN5YH.mjs +2 -0
  225. package/dist/chunk-TFO3ND3W.mjs +2 -0
  226. package/dist/chunk-TLCO7PTI.mjs +2 -0
  227. package/dist/chunk-TN7DEVEE.mjs +2 -0
  228. package/dist/chunk-TNTITL6S.mjs +3 -0
  229. package/dist/chunk-TRZ3KXED.mjs +8 -0
  230. package/dist/chunk-TSU5QRYZ.mjs +2 -0
  231. package/dist/chunk-TTICNZG7.mjs +2 -0
  232. package/dist/chunk-U7OUT2WV.mjs +1 -0
  233. package/dist/chunk-UBZTDYQG.mjs +2 -0
  234. package/dist/chunk-UEZD34PU.mjs +2 -0
  235. package/dist/chunk-UQPZMB6C.mjs +2 -0
  236. package/dist/chunk-UTIBO7SO.mjs +2 -0
  237. package/dist/chunk-UVSGUIBW.mjs +8 -0
  238. package/dist/chunk-VAQHITBV.mjs +2 -0
  239. package/dist/chunk-VBY3N2TS.mjs +3 -0
  240. package/dist/chunk-VE55VEAS.mjs +2 -0
  241. package/dist/chunk-VFWL5XAA.mjs +2 -0
  242. package/dist/chunk-VIDJ5SRV.mjs +2 -0
  243. package/dist/chunk-W2MLKAZN.mjs +2 -0
  244. package/dist/chunk-W65Y5YRU.mjs +2 -0
  245. package/dist/chunk-W6R5YWL6.mjs +2 -0
  246. package/dist/chunk-WB7VZJZA.mjs +2 -0
  247. package/dist/chunk-WDSNVW3W.mjs +2 -0
  248. package/dist/chunk-WURMVTJP.mjs +2 -0
  249. package/dist/chunk-WWM6WQCY.mjs +2 -0
  250. package/dist/chunk-X2XFCFUL.mjs +2 -0
  251. package/dist/chunk-X374ODLH.mjs +2 -0
  252. package/dist/chunk-X7ADEEVD.mjs +8 -0
  253. package/dist/chunk-XE5CT2M3.mjs +2 -0
  254. package/dist/chunk-XE5QS5VD.mjs +8 -0
  255. package/dist/chunk-XHGXSXB3.mjs +2 -0
  256. package/dist/chunk-XQ47XIIO.mjs +2 -0
  257. package/dist/chunk-XYVV643U.mjs +8 -0
  258. package/dist/chunk-XZMMZD3Z.mjs +2 -0
  259. package/dist/chunk-XZSQWDME.mjs +2 -0
  260. package/dist/chunk-YBWQTHOI.mjs +2 -0
  261. package/dist/chunk-YOWYEBY3.mjs +2 -0
  262. package/dist/chunk-YQXTW7IL.mjs +2 -0
  263. package/dist/chunk-YVROMH7J.mjs +2 -0
  264. package/dist/chunk-YVVQMYLM.mjs +2 -0
  265. package/dist/chunk-Z46XMMXR.mjs +2 -0
  266. package/dist/chunk-Z4MSMGYC.mjs +2 -0
  267. package/dist/chunk-Z5P2KHPP.mjs +2 -0
  268. package/dist/chunk-ZGUSKAF7.mjs +2 -0
  269. package/dist/chunk-ZMZG5IED.mjs +8 -0
  270. package/dist/chunk-ZNLJMM2N.mjs +2 -0
  271. package/dist/chunk-ZSF6CHQK.mjs +2 -0
  272. package/dist/chunk-ZXOXZAH4.mjs +2 -0
  273. package/dist/copy-button.css +1 -0
  274. package/dist/copy-button.d.ts +8 -0
  275. package/dist/copy-button.mjs +2 -0
  276. package/dist/footer.css +1 -0
  277. package/dist/footer.d.ts +5 -0
  278. package/dist/footer.mjs +2 -0
  279. package/dist/form.css +1 -0
  280. package/dist/form.d.ts +14 -0
  281. package/dist/form.mjs +2 -0
  282. package/dist/google-b9019ca9.d.ts +7 -0
  283. package/dist/grid-AJXQWCY6.svg +5 -0
  284. package/dist/icon-menu.d.ts +10 -0
  285. package/dist/icon-menu.mjs +2 -0
  286. package/dist/icons/copy.d.ts +7 -0
  287. package/dist/icons/copy.mjs +2 -0
  288. package/dist/icons/expanding-arrow.d.ts +7 -0
  289. package/dist/icons/expanding-arrow.mjs +2 -0
  290. package/dist/icons/facebook.d.ts +8 -0
  291. package/dist/icons/facebook.mjs +2 -0
  292. package/dist/icons/github.d.ts +7 -0
  293. package/dist/icons/github.mjs +2 -0
  294. package/dist/icons/google.d.ts +7 -0
  295. package/dist/icons/google.mjs +2 -0
  296. package/dist/icons/index.css +1 -0
  297. package/dist/icons/index.d.ts +16 -0
  298. package/dist/icons/index.mjs +2 -0
  299. package/dist/icons/linkedin.d.ts +8 -0
  300. package/dist/icons/linkedin.mjs +2 -0
  301. package/dist/icons/loading-circle.d.ts +7 -0
  302. package/dist/icons/loading-circle.mjs +2 -0
  303. package/dist/icons/loading-dots.css +1 -0
  304. package/dist/icons/loading-dots.d.ts +5 -0
  305. package/dist/icons/loading-dots.mjs +2 -0
  306. package/dist/icons/loading-spinner.css +1 -0
  307. package/dist/icons/loading-spinner.d.ts +7 -0
  308. package/dist/icons/loading-spinner.mjs +2 -0
  309. package/dist/icons/logo.d.ts +7 -0
  310. package/dist/icons/logo.mjs +2 -0
  311. package/dist/icons/logotype.d.ts +7 -0
  312. package/dist/icons/logotype.mjs +2 -0
  313. package/dist/icons/photo.d.ts +7 -0
  314. package/dist/icons/photo.mjs +2 -0
  315. package/dist/icons/tick.d.ts +7 -0
  316. package/dist/icons/tick.mjs +2 -0
  317. package/dist/icons/twitter.d.ts +7 -0
  318. package/dist/icons/twitter.mjs +2 -0
  319. package/dist/icons/unsplash.d.ts +7 -0
  320. package/dist/icons/unsplash.mjs +2 -0
  321. package/dist/index.css +1 -0
  322. package/dist/index.d.ts +128 -0
  323. package/dist/index.mjs +2 -0
  324. package/dist/link-preview.css +1 -0
  325. package/dist/link-preview.d.ts +7 -0
  326. package/dist/link-preview.mjs +2 -0
  327. package/dist/max-width-wrapper.d.ts +9 -0
  328. package/dist/max-width-wrapper.mjs +2 -0
  329. package/dist/modal.d.ts +14 -0
  330. package/dist/modal.mjs +2 -0
  331. package/dist/nav-mobile.css +1 -0
  332. package/dist/nav-mobile.d.ts +5 -0
  333. package/dist/nav-mobile.mjs +2 -0
  334. package/dist/nav.css +1 -0
  335. package/dist/nav.d.ts +9 -0
  336. package/dist/nav.mjs +2 -0
  337. package/dist/number-tooltip.d.ts +12 -0
  338. package/dist/number-tooltip.mjs +2 -0
  339. package/dist/number.d.ts +12 -0
  340. package/dist/number.mjs +2 -0
  341. package/dist/popover.d.ts +13 -0
  342. package/dist/popover.mjs +2 -0
  343. package/dist/switch.d.ts +14 -0
  344. package/dist/switch.mjs +2 -0
  345. package/dist/tab-select.d.ts +9 -0
  346. package/dist/tab-select.mjs +2 -0
  347. package/dist/tooltip.d.ts +32 -0
  348. package/dist/tooltip.mjs +2 -0
  349. package/package.json +65 -0
  350. package/postcss.config.js +9 -0
  351. package/src/accordion.tsx +60 -0
  352. package/src/avatar.tsx +47 -0
  353. package/src/background.tsx +71 -0
  354. package/src/badge.tsx +33 -0
  355. package/src/button.tsx +60 -0
  356. package/src/content.ts +230 -0
  357. package/src/copy-button.tsx +39 -0
  358. package/src/footer.tsx +203 -0
  359. package/src/form.tsx +77 -0
  360. package/src/hooks/index.ts +5 -0
  361. package/src/hooks/use-current-anchor.ts +65 -0
  362. package/src/hooks/use-intersection-observer.ts +41 -0
  363. package/src/hooks/use-local-storage.ts +24 -0
  364. package/src/hooks/use-media-query.ts +46 -0
  365. package/src/hooks/use-scroll.ts +21 -0
  366. package/src/icon-menu.tsx +15 -0
  367. package/src/icons/copy.tsx +18 -0
  368. package/src/icons/expanding-arrow.tsx +39 -0
  369. package/src/icons/facebook.tsx +23 -0
  370. package/src/icons/github.tsx +14 -0
  371. package/src/icons/google.tsx +12 -0
  372. package/src/icons/index.tsx +22 -0
  373. package/src/icons/linkedin.tsx +22 -0
  374. package/src/icons/loading-circle.tsx +25 -0
  375. package/src/icons/loading-dots.css +40 -0
  376. package/src/icons/loading-dots.tsx +13 -0
  377. package/src/icons/loading-spinner.tsx +34 -0
  378. package/src/icons/logo.tsx +29 -0
  379. package/src/icons/logotype.tsx +51 -0
  380. package/src/icons/photo.tsx +20 -0
  381. package/src/icons/tick.tsx +18 -0
  382. package/src/icons/twitter.tsx +31 -0
  383. package/src/icons/unsplash.tsx +17 -0
  384. package/src/index.tsx +35 -0
  385. package/src/link-preview.tsx +111 -0
  386. package/src/max-width-wrapper.tsx +21 -0
  387. package/src/modal.tsx +102 -0
  388. package/src/nav-mobile.tsx +108 -0
  389. package/src/nav.tsx +205 -0
  390. package/src/popover.tsx +61 -0
  391. package/src/styles.css +3 -0
  392. package/src/switch.tsx +60 -0
  393. package/src/tab-select.tsx +27 -0
  394. package/src/tooltip.tsx +184 -0
  395. package/tailwind.config.ts +9 -0
  396. package/tsconfig.json +5 -0
  397. package/tsup.config.ts +15 -0
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ declare function MaxWidthWrapper({ className, children, }: {
5
+ className?: string;
6
+ children: ReactNode;
7
+ }): react_jsx_runtime.JSX.Element;
8
+
9
+ export { MaxWidthWrapper };
@@ -0,0 +1,2 @@
1
+ "use client"
2
+ import{a}from"./chunk-PPNWHWNQ.mjs";export{a as MaxWidthWrapper};
@@ -0,0 +1,14 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Dispatch, SetStateAction } from 'react';
3
+
4
+ declare function Modal({ children, className, dialogOnly, showModal, setShowModal, onClose, preventDefaultClose, }: {
5
+ children: React.ReactNode;
6
+ className?: string;
7
+ dialogOnly?: boolean;
8
+ showModal?: boolean;
9
+ setShowModal?: Dispatch<SetStateAction<boolean>>;
10
+ onClose?: () => void;
11
+ preventDefaultClose?: boolean;
12
+ }): react_jsx_runtime.JSX.Element;
13
+
14
+ export { Modal };
package/dist/modal.mjs ADDED
@@ -0,0 +1,2 @@
1
+ "use client"
2
+ import{a}from"./chunk-B4HABAR3.mjs";import"./chunk-NHHVF35L.mjs";export{a as Modal};
@@ -0,0 +1 @@
1
+ .loading-dots{display:inline-flex;align-items:center}.loading-dots .spacer{margin-right:2px}.loading-dots span{animation-name:blink;animation-duration:1.4s;animation-iteration-count:infinite;animation-fill-mode:both;width:5px;height:5px;border-radius:50%;display:inline-block;margin:0 1px}.loading-dots span:nth-of-type(2){animation-delay:.2s}.loading-dots span:nth-of-type(3){animation-delay:.4s}@keyframes blink{0%{opacity:.2}20%{opacity:1}to{opacity:.2}}
@@ -0,0 +1,5 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function NavMobile(): react_jsx_runtime.JSX.Element;
4
+
5
+ export { NavMobile };
@@ -0,0 +1,2 @@
1
+ "use client"
2
+ import{a}from"./chunk-B3VKF2VA.mjs";import"./chunk-5WZZBGKJ.mjs";import"./chunk-J63GHRZH.mjs";import"./chunk-PPNWHWNQ.mjs";import"./chunk-NHHVF35L.mjs";import"./chunk-U7OUT2WV.mjs";import"./chunk-EHYVEIOL.mjs";import"./chunk-JLET4OCX.mjs";import"./chunk-GSQUGPJ2.mjs";import"./chunk-5EWSH7PD.mjs";import"./chunk-6DKNMNDW.mjs";import"./chunk-XZSQWDME.mjs";import"./chunk-PPR7AQWS.mjs";import"./chunk-QP2EHAF7.mjs";import"./chunk-WURMVTJP.mjs";import"./chunk-2TGXECZQ.mjs";import"./chunk-Z5P2KHPP.mjs";import"./chunk-EY55E5DB.mjs";import"./chunk-MURAUI3W.mjs";import"./chunk-T4YFARK5.mjs";import"./chunk-OYEGFR5W.mjs";export{a as NavMobile};
package/dist/nav.css ADDED
@@ -0,0 +1 @@
1
+ .loading-dots{display:inline-flex;align-items:center}.loading-dots .spacer{margin-right:2px}.loading-dots span{animation-name:blink;animation-duration:1.4s;animation-iteration-count:infinite;animation-fill-mode:both;width:5px;height:5px;border-radius:50%;display:inline-block;margin:0 1px}.loading-dots span:nth-of-type(2){animation-delay:.2s}.loading-dots span:nth-of-type(3){animation-delay:.4s}@keyframes blink{0%{opacity:.2}20%{opacity:1}to{opacity:.2}}
package/dist/nav.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare const navItems: {
4
+ name: string;
5
+ slug: string;
6
+ }[];
7
+ declare function Nav(): react_jsx_runtime.JSX.Element;
8
+
9
+ export { Nav, navItems };
package/dist/nav.mjs ADDED
@@ -0,0 +1,2 @@
1
+ "use client"
2
+ import{a,b}from"./chunk-5WZZBGKJ.mjs";import"./chunk-J63GHRZH.mjs";import"./chunk-PPNWHWNQ.mjs";import"./chunk-NHHVF35L.mjs";import"./chunk-U7OUT2WV.mjs";import"./chunk-EHYVEIOL.mjs";import"./chunk-JLET4OCX.mjs";import"./chunk-GSQUGPJ2.mjs";import"./chunk-5EWSH7PD.mjs";import"./chunk-6DKNMNDW.mjs";import"./chunk-XZSQWDME.mjs";import"./chunk-PPR7AQWS.mjs";import"./chunk-QP2EHAF7.mjs";import"./chunk-WURMVTJP.mjs";import"./chunk-2TGXECZQ.mjs";import"./chunk-Z5P2KHPP.mjs";import"./chunk-EY55E5DB.mjs";import"./chunk-MURAUI3W.mjs";import"./chunk-T4YFARK5.mjs";import"./chunk-OYEGFR5W.mjs";export{b as Nav,a as navItems};
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { ReactNode } from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ declare function NumberTooltip({ value, unit, children, lastClicked, }: {
6
+ value?: number | null;
7
+ unit?: string;
8
+ children: ReactNode;
9
+ lastClicked?: Date | null;
10
+ }): string | number | boolean | react_jsx_runtime.JSX.Element | Iterable<ReactNode> | React.PromiseLikeOfReactNode | null | undefined;
11
+
12
+ export { NumberTooltip };
@@ -0,0 +1,2 @@
1
+ "use client"
2
+ import{a}from"./chunk-AACJEMFS.mjs";import"./chunk-2ZQKPJ36.mjs";import"./chunk-NHHVF35L.mjs";import"./chunk-AUBFB4SI.mjs";export{a as NumberTooltip};
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { ReactNode } from 'react';
4
+
5
+ declare function Number({ value, unit, children, lastClicked, }: {
6
+ value?: number | null;
7
+ unit?: string;
8
+ children: ReactNode;
9
+ lastClicked?: Date | null;
10
+ }): string | number | boolean | Iterable<ReactNode> | React.PromiseLikeOfReactNode | react_jsx_runtime.JSX.Element | null | undefined;
11
+
12
+ export { Number };
@@ -0,0 +1,2 @@
1
+ "use client"
2
+ import{a}from"./chunk-KQFL4H7A.mjs";import"./chunk-2ZQKPJ36.mjs";import"./chunk-NHHVF35L.mjs";import"./chunk-AUBFB4SI.mjs";export{a as Number};
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, Dispatch, SetStateAction } from 'react';
3
+
4
+ declare function Popover({ children, content, align, openPopover, setOpenPopover, mobileOnly, }: {
5
+ children: ReactNode;
6
+ content: ReactNode | string;
7
+ align?: "center" | "start" | "end";
8
+ openPopover: boolean;
9
+ setOpenPopover: Dispatch<SetStateAction<boolean>>;
10
+ mobileOnly?: boolean;
11
+ }): react_jsx_runtime.JSX.Element;
12
+
13
+ export { Popover };
@@ -0,0 +1,2 @@
1
+ "use client"
2
+ import{a}from"./chunk-FMUX4F5B.mjs";import"./chunk-NHHVF35L.mjs";export{a as Popover};
@@ -0,0 +1,14 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Dispatch, SetStateAction, ReactNode } from 'react';
3
+
4
+ declare function Switch({ fn, trackDimensions, thumbDimensions, thumbTranslate, checked, disabled, disabledTooltip, }: {
5
+ fn: Dispatch<SetStateAction<boolean>> | (() => void);
6
+ trackDimensions?: string;
7
+ thumbDimensions?: string;
8
+ thumbTranslate?: string;
9
+ checked?: boolean;
10
+ disabled?: boolean;
11
+ disabledTooltip?: string | ReactNode;
12
+ }): react_jsx_runtime.JSX.Element;
13
+
14
+ export { Switch };
@@ -0,0 +1,2 @@
1
+ "use client"
2
+ import{a}from"./chunk-Q64KZRX2.mjs";import"./chunk-MO5Z5S7B.mjs";import"./chunk-NHHVF35L.mjs";export{a as Switch};
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function TabSelect({ options, selected, selectAction, }: {
4
+ options: string[];
5
+ selected: string;
6
+ selectAction: (option: string) => void;
7
+ }): react_jsx_runtime.JSX.Element;
8
+
9
+ export { TabSelect };
@@ -0,0 +1,2 @@
1
+ "use client"
2
+ import{a}from"./chunk-SN3ZPBNA.mjs";export{a as TabSelect};
@@ -0,0 +1,32 @@
1
+ import * as React from 'react';
2
+ import { ReactNode } from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ declare function Tooltip({ children, content, fullWidth, }: {
6
+ children: ReactNode;
7
+ content: ReactNode | string;
8
+ fullWidth?: boolean;
9
+ }): react_jsx_runtime.JSX.Element;
10
+ declare function TooltipContent({ title, cta, href, target, onClick, }: {
11
+ title: string;
12
+ cta?: string;
13
+ href?: string;
14
+ target?: string;
15
+ onClick?: () => void;
16
+ }): react_jsx_runtime.JSX.Element;
17
+ declare function SimpleTooltipContent({ title, cta, href, }: {
18
+ title: string;
19
+ cta: string;
20
+ href: string;
21
+ }): react_jsx_runtime.JSX.Element;
22
+ declare function InfoTooltip({ content }: {
23
+ content: ReactNode | string;
24
+ }): react_jsx_runtime.JSX.Element;
25
+ declare function NumberTooltip({ value, unit, children, lastClicked, }: {
26
+ value?: number | null;
27
+ unit?: string;
28
+ children: ReactNode;
29
+ lastClicked?: Date | null;
30
+ }): string | number | boolean | react_jsx_runtime.JSX.Element | Iterable<ReactNode> | React.PromiseLikeOfReactNode | null | undefined;
31
+
32
+ export { InfoTooltip, NumberTooltip, SimpleTooltipContent, Tooltip, TooltipContent };
@@ -0,0 +1,2 @@
1
+ "use client"
2
+ import{a,b,c,d,e}from"./chunk-MO5Z5S7B.mjs";import"./chunk-NHHVF35L.mjs";export{d as InfoTooltip,e as NumberTooltip,c as SimpleTooltipContent,a as Tooltip,b as TooltipContent};
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@dub/ui",
3
+ "description": "UI components for Dub.co",
4
+ "version": "0.0.0",
5
+ "sideEffects": [
6
+ "**/*.css"
7
+ ],
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": "./dist",
11
+ "./styles.css": "./dist/index.css"
12
+ },
13
+ "scripts": {
14
+ "build": "tsup",
15
+ "lint": "eslint src/",
16
+ "dev": "tsup --watch",
17
+ "check-types": "tsc --noEmit"
18
+ },
19
+ "peerDependencies": {
20
+ "react": "^18.2.0",
21
+ "next": "13.5.4",
22
+ "@vercel/analytics": "^1.0.0"
23
+ },
24
+ "devDependencies": {
25
+ "@types/react": "^18.2.5",
26
+ "autoprefixer": "^10.4.16",
27
+ "postcss": "^8.4.31",
28
+ "react": "^18.2.0",
29
+ "next": "13.5.4",
30
+ "tailwind-config": "workspace:*",
31
+ "tailwindcss": "^3.3.3",
32
+ "tsconfig": "workspace:*",
33
+ "tsup": "^6.1.3",
34
+ "typescript": "^5.1.6"
35
+ },
36
+ "dependencies": {
37
+ "@radix-ui/react-accordion": "^1.0.1",
38
+ "@radix-ui/react-dialog": "1.0.3",
39
+ "@radix-ui/react-navigation-menu": "^1.1.2",
40
+ "@radix-ui/react-popover": "1.0.5",
41
+ "@radix-ui/react-switch": "^1.0.1",
42
+ "@radix-ui/react-tooltip": "^1.0.2",
43
+ "class-variance-authority": "^0.7.0",
44
+ "@dub/utils": "workspace:*",
45
+ "lucide-react": "^0.284.0",
46
+ "sonner": "^0.5.0",
47
+ "swr": "^2.1.5",
48
+ "use-debounce": "^8.0.4",
49
+ "vaul": "^0.6.8"
50
+ },
51
+ "author": "Steven Tey <stevensteel97@gmail.com>",
52
+ "homepage": "https://dub.co",
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/steven-tey/dub.git"
56
+ },
57
+ "bugs": {
58
+ "url": "https://github.com/steven-tey/dub/issues"
59
+ },
60
+ "keywords": [
61
+ "dub",
62
+ "dub.co",
63
+ "ui"
64
+ ]
65
+ }
@@ -0,0 +1,9 @@
1
+ // If you want to use other PostCSS plugins, see the following:
2
+ // https://tailwindcss.com/docs/using-with-preprocessors
3
+
4
+ module.exports = {
5
+ plugins: {
6
+ tailwindcss: {},
7
+ autoprefixer: {},
8
+ },
9
+ };
@@ -0,0 +1,60 @@
1
+ import * as AccordionPrimitive from "@radix-ui/react-accordion";
2
+ import { cn } from "@dub/utils";
3
+ import { ChevronDown } from "lucide-react";
4
+ import * as React from "react";
5
+
6
+ const Accordion = AccordionPrimitive.Root;
7
+
8
+ const AccordionItem = React.forwardRef<
9
+ React.ElementRef<typeof AccordionPrimitive.Item>,
10
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
11
+ >(({ className, ...props }, ref) => (
12
+ <AccordionPrimitive.Item
13
+ ref={ref}
14
+ className={cn(
15
+ "border-b border-b-slate-200 py-3 last:border-none",
16
+ className,
17
+ )}
18
+ {...props}
19
+ />
20
+ ));
21
+ AccordionItem.displayName = "AccordionItem";
22
+
23
+ const AccordionTrigger = React.forwardRef<
24
+ React.ElementRef<typeof AccordionPrimitive.Trigger>,
25
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
26
+ >(({ className, children, ...props }, ref) => (
27
+ <AccordionPrimitive.Header className="flex">
28
+ <AccordionPrimitive.Trigger
29
+ ref={ref}
30
+ className={cn(
31
+ "flex flex-1 items-center justify-between font-medium transition-all sm:text-lg [&[data-state=open]>svg]:rotate-180",
32
+ className,
33
+ )}
34
+ {...props}
35
+ >
36
+ {children}
37
+ <ChevronDown className="h-5 w-5 transition-transform duration-300" />
38
+ </AccordionPrimitive.Trigger>
39
+ </AccordionPrimitive.Header>
40
+ ));
41
+ AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
42
+
43
+ const AccordionContent = React.forwardRef<
44
+ React.ElementRef<typeof AccordionPrimitive.Content>,
45
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
46
+ >(({ className, children, ...props }, ref) => (
47
+ <AccordionPrimitive.Content
48
+ ref={ref}
49
+ className={cn(
50
+ "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm text-gray-500 transition-all sm:text-base",
51
+ className,
52
+ )}
53
+ {...props}
54
+ >
55
+ {children}
56
+ </AccordionPrimitive.Content>
57
+ ));
58
+ AccordionContent.displayName = AccordionPrimitive.Content.displayName;
59
+
60
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
package/src/avatar.tsx ADDED
@@ -0,0 +1,47 @@
1
+ import { cn } from "@dub/utils";
2
+
3
+ export function Avatar({
4
+ user = {},
5
+ className,
6
+ }: {
7
+ user?: {
8
+ name?: string | null | undefined;
9
+ email?: string | null | undefined;
10
+ image?: string | null | undefined;
11
+ };
12
+ className?: string;
13
+ }) {
14
+ if (!user) {
15
+ return (
16
+ <div
17
+ className={cn(
18
+ "h-10 w-10 animate-pulse rounded-full border border-gray-300 bg-gray-100",
19
+ className,
20
+ )}
21
+ />
22
+ );
23
+ }
24
+
25
+ return (
26
+ <img
27
+ alt={`Avatar for ${user?.name || user?.email}`}
28
+ src={
29
+ user?.image ||
30
+ `https://avatars.dicebear.com/api/micah/${user?.email}.svg`
31
+ }
32
+ className={cn("h-10 w-10 rounded-full border border-gray-300", className)}
33
+ draggable={false}
34
+ />
35
+ );
36
+ }
37
+
38
+ export function TokenAvatar({ id }: { id: string }) {
39
+ return (
40
+ <img
41
+ src={`https://api.dicebear.com/7.x/shapes/svg?seed=${id}`}
42
+ alt="avatar"
43
+ className="h-10 w-10 rounded-full"
44
+ draggable={false}
45
+ />
46
+ );
47
+ }
@@ -0,0 +1,71 @@
1
+ "use client";
2
+
3
+ import { SHOW_BACKGROUND_SEGMENTS } from "@dub/utils";
4
+ import { useSelectedLayoutSegment } from "next/navigation";
5
+
6
+ export function Background() {
7
+ let segment;
8
+ try {
9
+ segment = useSelectedLayoutSegment();
10
+ } catch (e) {
11
+ // this is for /welcome which is still on /pages router
12
+ }
13
+
14
+ return !segment || SHOW_BACKGROUND_SEGMENTS.includes(segment) ? (
15
+ <div style={styles.backgroundMain}>
16
+ <div style={styles.backgroundMainBefore} />
17
+ <div style={styles.backgroundMainAfter} />
18
+ <div style={styles.backgroundContent} />
19
+ </div>
20
+ ) : null;
21
+ }
22
+
23
+ const styles: { [key: string]: React.CSSProperties } = {
24
+ backgroundMain: {
25
+ width: "100vw",
26
+ minHeight: "100vh",
27
+ position: "fixed",
28
+ zIndex: -1,
29
+ display: "flex",
30
+ justifyContent: "center",
31
+ padding: "120px 24px 160px 24px",
32
+ pointerEvents: "none",
33
+ },
34
+ backgroundMainBefore: {
35
+ background: "radial-gradient(circle, rgba(2, 0, 36, 0) 0, #fafafa 100%)",
36
+ position: "absolute",
37
+ content: '""',
38
+ zIndex: 2,
39
+ width: "100%",
40
+ height: "100%",
41
+ top: 0,
42
+ },
43
+ backgroundMainAfter: {
44
+ content: '""',
45
+ backgroundImage: "url(https://d2vwwcvoksz7ty.cloudfront.net/grid.svg)",
46
+ zIndex: 1,
47
+ position: "absolute",
48
+ width: "100%",
49
+ height: "100%",
50
+ top: 0,
51
+ opacity: 0.4,
52
+ filter: "invert(1)",
53
+ },
54
+ backgroundContent: {
55
+ zIndex: 3,
56
+ width: "100%",
57
+ maxWidth: "640px",
58
+ backgroundImage: `radial-gradient(at 27% 37%, hsla(215, 98%, 61%, 1) 0px, transparent 0%),
59
+ radial-gradient(at 97% 21%, hsla(125, 98%, 72%, 1) 0px, transparent 50%),
60
+ radial-gradient(at 52% 99%, hsla(354, 98%, 61%, 1) 0px, transparent 50%),
61
+ radial-gradient(at 10% 29%, hsla(256, 96%, 67%, 1) 0px, transparent 50%),
62
+ radial-gradient(at 97% 96%, hsla(38, 60%, 74%, 1) 0px, transparent 50%),
63
+ radial-gradient(at 33% 50%, hsla(222, 67%, 73%, 1) 0px, transparent 50%),
64
+ radial-gradient(at 79% 53%, hsla(343, 68%, 79%, 1) 0px, transparent 50%)`,
65
+ position: "absolute",
66
+ height: "100%",
67
+ filter: "blur(100px) saturate(150%)",
68
+ top: "80px",
69
+ opacity: 0.15,
70
+ },
71
+ };
package/src/badge.tsx ADDED
@@ -0,0 +1,33 @@
1
+ import { cva, type VariantProps } from "class-variance-authority";
2
+ import { cn } from "@dub/utils";
3
+
4
+ const badgeVariants = cva(
5
+ "max-w-fit rounded-full border px-2 py-px text-xs font-medium capitalize",
6
+ {
7
+ variants: {
8
+ variant: {
9
+ default: "border-gray-400 text-gray-500",
10
+ violet: "border-violet-600 bg-violet-600 text-white",
11
+ blue: "border-blue-500 bg-blue-500 text-white",
12
+ black: "border-black bg-black text-white",
13
+ gray: "border-gray-400 bg-gray-400 text-white",
14
+ neutral: "border-gray-400 text-gray-500",
15
+ },
16
+ },
17
+ defaultVariants: {
18
+ variant: "neutral",
19
+ },
20
+ },
21
+ );
22
+
23
+ interface BadgeProps
24
+ extends React.HTMLAttributes<HTMLSpanElement>,
25
+ VariantProps<typeof badgeVariants> {}
26
+
27
+ function Badge({ className, variant, ...props }: BadgeProps) {
28
+ return (
29
+ <span className={cn(badgeVariants({ variant }), className)} {...props} />
30
+ );
31
+ }
32
+
33
+ export { Badge, badgeVariants };
package/src/button.tsx ADDED
@@ -0,0 +1,60 @@
1
+ "use client";
2
+
3
+ import { cn } from "@dub/utils";
4
+ import { ReactNode } from "react";
5
+ import { LoadingSpinner } from "./icons";
6
+ import { Tooltip } from "./tooltip";
7
+
8
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
9
+ text: string;
10
+ variant?: "primary" | "secondary" | "success" | "danger";
11
+ loading?: boolean;
12
+ icon?: ReactNode;
13
+ disabledTooltip?: string | ReactNode;
14
+ }
15
+
16
+ export function Button({
17
+ text,
18
+ variant = "primary",
19
+ loading,
20
+ icon,
21
+ disabledTooltip,
22
+ ...props
23
+ }: ButtonProps) {
24
+ if (disabledTooltip) {
25
+ return (
26
+ <Tooltip content={disabledTooltip} fullWidth>
27
+ <div className="flex h-10 w-full cursor-not-allowed items-center justify-center rounded-md border border-gray-200 bg-gray-100 px-4 text-sm text-gray-400 transition-all focus:outline-none">
28
+ <p>{text}</p>
29
+ </div>
30
+ </Tooltip>
31
+ );
32
+ }
33
+ return (
34
+ <button
35
+ // if onClick is passed, it's a "button" type, otherwise it's being used in a form, hence "submit"
36
+ type={props.onClick ? "button" : "submit"}
37
+ className={cn(
38
+ "flex h-10 w-full items-center justify-center space-x-2 rounded-md border px-4 text-sm transition-all focus:outline-none",
39
+ props.disabled || loading
40
+ ? "cursor-not-allowed border-gray-200 bg-gray-100 text-gray-400"
41
+ : {
42
+ "border-black bg-black text-white hover:bg-white hover:text-black":
43
+ variant === "primary",
44
+ "border-gray-200 bg-white text-gray-500 hover:border-black hover:text-black":
45
+ variant === "secondary",
46
+ "border-blue-500 bg-blue-500 text-white hover:bg-white hover:text-blue-500":
47
+ variant === "success",
48
+ "border-red-500 bg-red-500 text-white hover:bg-white hover:text-red-500":
49
+ variant === "danger",
50
+ },
51
+ props.className,
52
+ )}
53
+ disabled={props.disabled || loading}
54
+ {...props}
55
+ >
56
+ {loading ? <LoadingSpinner /> : icon ? icon : null}
57
+ <p>{text}</p>
58
+ </button>
59
+ );
60
+ }