@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.
- package/.turbo/turbo-build.log +129 -0
- package/dist/accordion.d.ts +9 -0
- package/dist/accordion.mjs +2 -0
- package/dist/avatar.d.ts +15 -0
- package/dist/avatar.mjs +2 -0
- package/dist/background/index.css +1 -0
- package/dist/background/index.d.ts +5 -0
- package/dist/background/index.mjs +2 -0
- package/dist/background.d.ts +5 -0
- package/dist/background.mjs +2 -0
- package/dist/badge.d.ts +12 -0
- package/dist/badge.mjs +2 -0
- package/dist/blur-image.d.ts +6 -0
- package/dist/blur-image.mjs +2 -0
- package/dist/button.css +1 -0
- package/dist/button.d.ts +13 -0
- package/dist/button.mjs +2 -0
- package/dist/chunk-244OSE43.mjs +2 -0
- package/dist/chunk-25PGVVAM.mjs +2 -0
- package/dist/chunk-2CR6AI65.mjs +2 -0
- package/dist/chunk-2KZFWJJX.mjs +2 -0
- package/dist/chunk-2O5K4D5Q.mjs +2 -0
- package/dist/chunk-2SFV6FGR.mjs +2 -0
- package/dist/chunk-2TGXECZQ.mjs +2 -0
- package/dist/chunk-2ZQKPJ36.mjs +2 -0
- package/dist/chunk-33QWEDY7.mjs +8 -0
- package/dist/chunk-3GU5I4KI.mjs +2 -0
- package/dist/chunk-3Q6B4UEP.mjs +2 -0
- package/dist/chunk-3S3WMTNJ.mjs +2 -0
- package/dist/chunk-3YDMSFPQ.mjs +2 -0
- package/dist/chunk-3ZOR7HDE.mjs +2 -0
- package/dist/chunk-4555QYZ6.mjs +2 -0
- package/dist/chunk-46KYE2TK.mjs +2 -0
- package/dist/chunk-4B27GTB4.mjs +3 -0
- package/dist/chunk-4JKAA2S4.mjs +2 -0
- package/dist/chunk-4JXT2OCG.mjs +2 -0
- package/dist/chunk-4OESW4SN.mjs +2 -0
- package/dist/chunk-4QDUUMAW.mjs +2 -0
- package/dist/chunk-4XBYRIVX.mjs +2 -0
- package/dist/chunk-4ZSCYPP2.mjs +2 -0
- package/dist/chunk-56D4WGXU.mjs +2 -0
- package/dist/chunk-56DTUGDB.mjs +2 -0
- package/dist/chunk-5A2BHTHD.mjs +2 -0
- package/dist/chunk-5EWSH7PD.mjs +2 -0
- package/dist/chunk-5JYRCHLM.mjs +2 -0
- package/dist/chunk-5SGX2GJA.mjs +2 -0
- package/dist/chunk-5UODCYNT.mjs +2 -0
- package/dist/chunk-5VNTIKQZ.mjs +2 -0
- package/dist/chunk-5WZZBGKJ.mjs +2 -0
- package/dist/chunk-6C6ANQBQ.mjs +2 -0
- package/dist/chunk-6DKNMNDW.mjs +2 -0
- package/dist/chunk-6GJY5OO4.mjs +2 -0
- package/dist/chunk-6KTUEBPU.mjs +2 -0
- package/dist/chunk-6S57E6BS.mjs +2 -0
- package/dist/chunk-6TNUMRJD.mjs +3 -0
- package/dist/chunk-7AQLFQZX.mjs +2 -0
- package/dist/chunk-7FBJXRA5.mjs +2 -0
- package/dist/chunk-7FTHTS2N.mjs +2 -0
- package/dist/chunk-7GWUKTP3.mjs +2 -0
- package/dist/chunk-7HABTH45.mjs +2 -0
- package/dist/chunk-7JAMW2DV.mjs +2 -0
- package/dist/chunk-7LB36OSM.mjs +2 -0
- package/dist/chunk-7O2ZOJNB.mjs +2 -0
- package/dist/chunk-7QQZYSZX.mjs +2 -0
- package/dist/chunk-7RM43KIQ.mjs +2 -0
- package/dist/chunk-7UOWPARW.mjs +2 -0
- package/dist/chunk-A3PUDJ7V.mjs +1 -0
- package/dist/chunk-AACJEMFS.mjs +2 -0
- package/dist/chunk-ABLQYIFT.mjs +2 -0
- package/dist/chunk-AUBFB4SI.mjs +2 -0
- package/dist/chunk-AUVV5HUC.mjs +2 -0
- package/dist/chunk-AZD2JXYJ.mjs +2 -0
- package/dist/chunk-B3VKF2VA.mjs +2 -0
- package/dist/chunk-B4HABAR3.mjs +2 -0
- package/dist/chunk-B6VWIQYU.mjs +3 -0
- package/dist/chunk-BHTYGPAI.mjs +2 -0
- package/dist/chunk-BZJK6BT5.mjs +2 -0
- package/dist/chunk-C33FCZ32.mjs +2 -0
- package/dist/chunk-C3ZLFBBA.mjs +1 -0
- package/dist/chunk-C4PESNHJ.mjs +2 -0
- package/dist/chunk-C5IOO5UD.mjs +2 -0
- package/dist/chunk-CBHHIJGG.mjs +2 -0
- package/dist/chunk-CCKZ5QDB.mjs +2 -0
- package/dist/chunk-CFCHBBAJ.mjs +2 -0
- package/dist/chunk-D2Q6GSHJ.mjs +2 -0
- package/dist/chunk-D3NFRR3I.mjs +2 -0
- package/dist/chunk-DG5QULNJ.mjs +2 -0
- package/dist/chunk-DHJFK2S6.mjs +2 -0
- package/dist/chunk-DIJAPN4A.mjs +2 -0
- package/dist/chunk-DMNL3RKY.mjs +2 -0
- package/dist/chunk-DNZ5INSW.mjs +2 -0
- package/dist/chunk-DOE7DSDC.mjs +2 -0
- package/dist/chunk-E2TMZ3II.mjs +2 -0
- package/dist/chunk-E5ZJGOXG.mjs +2 -0
- package/dist/chunk-ECNXBGSQ.mjs +2 -0
- package/dist/chunk-EFQSHW3O.mjs +2 -0
- package/dist/chunk-EGZBNRFB.mjs +2 -0
- package/dist/chunk-EHYVEIOL.mjs +2 -0
- package/dist/chunk-EL4XTTMC.mjs +2 -0
- package/dist/chunk-EY55E5DB.mjs +2 -0
- package/dist/chunk-F6OPUNTW.mjs +2 -0
- package/dist/chunk-F6RVKSBN.mjs +2 -0
- package/dist/chunk-FMOY54OP.mjs +2 -0
- package/dist/chunk-FMUX4F5B.mjs +2 -0
- package/dist/chunk-FR336PIX.mjs +2 -0
- package/dist/chunk-G4PPRIHO.mjs +2 -0
- package/dist/chunk-GA4JDGWI.mjs +2 -0
- package/dist/chunk-GF6NH2NZ.mjs +2 -0
- package/dist/chunk-GFMXORYG.mjs +2 -0
- package/dist/chunk-GR726Z6I.mjs +2 -0
- package/dist/chunk-GRAJLMHF.mjs +2 -0
- package/dist/chunk-GSQUGPJ2.mjs +2 -0
- package/dist/chunk-GVANYQ67.mjs +1 -0
- package/dist/chunk-GVCIDQOF.mjs +2 -0
- package/dist/chunk-GXDFY5X2.mjs +2 -0
- package/dist/chunk-HCV274NJ.mjs +2 -0
- package/dist/chunk-HFY7GEA4.mjs +2 -0
- package/dist/chunk-HI3TSQ5W.mjs +2 -0
- package/dist/chunk-HMVFMHDB.mjs +2 -0
- package/dist/chunk-HNCJ4TJR.mjs +2 -0
- package/dist/chunk-HRN3EQEB.mjs +2 -0
- package/dist/chunk-I23BSUWS.mjs +2 -0
- package/dist/chunk-I57LZ6JE.mjs +2 -0
- package/dist/chunk-IG7XYDDR.mjs +2 -0
- package/dist/chunk-IHPV7RPK.mjs +2 -0
- package/dist/chunk-IJBZR4LN.mjs +8 -0
- package/dist/chunk-IJKZ5HB5.mjs +2 -0
- package/dist/chunk-IK4XBUOE.mjs +2 -0
- package/dist/chunk-ITDAQXDS.mjs +1 -0
- package/dist/chunk-IWV22LBB.mjs +2 -0
- package/dist/chunk-IY2HG3NK.mjs +8 -0
- package/dist/chunk-IYAB6FPB.mjs +2 -0
- package/dist/chunk-IZXIJLTW.mjs +2 -0
- package/dist/chunk-J5SA2VPW.mjs +3 -0
- package/dist/chunk-J63GHRZH.mjs +2 -0
- package/dist/chunk-JBL2DUF5.mjs +2 -0
- package/dist/chunk-JEJ4EWU7.mjs +2 -0
- package/dist/chunk-JIFH2LYE.mjs +3 -0
- package/dist/chunk-JJNAD6S4.mjs +3 -0
- package/dist/chunk-JLET4OCX.mjs +3 -0
- package/dist/chunk-JORK4T7Q.mjs +2 -0
- package/dist/chunk-JP7IWWG3.mjs +2 -0
- package/dist/chunk-JVM44TKC.mjs +2 -0
- package/dist/chunk-KBSQGAWB.mjs +2 -0
- package/dist/chunk-KDGZ6H77.mjs +2 -0
- package/dist/chunk-KF5NIC53.mjs +2 -0
- package/dist/chunk-KKCOE2RH.mjs +2 -0
- package/dist/chunk-KMHFLT2M.mjs +2 -0
- package/dist/chunk-KNYITJKS.mjs +2 -0
- package/dist/chunk-KQEO6U4W.mjs +2 -0
- package/dist/chunk-KQFL4H7A.mjs +2 -0
- package/dist/chunk-KUSH4SR2.mjs +2 -0
- package/dist/chunk-KVVEZANZ.mjs +2 -0
- package/dist/chunk-KWZ4DBE4.mjs +2 -0
- package/dist/chunk-L5KPIGCR.mjs +2 -0
- package/dist/chunk-L6UWBEZE.mjs +2 -0
- package/dist/chunk-LAQSQMES.mjs +2 -0
- package/dist/chunk-LFMW2GVW.mjs +3 -0
- package/dist/chunk-LRCJQIJG.mjs +2 -0
- package/dist/chunk-M4Q2EF5G.mjs +2 -0
- package/dist/chunk-MCXA7VY2.mjs +2 -0
- package/dist/chunk-MKKBN6XG.mjs +2 -0
- package/dist/chunk-MN57ZXBI.mjs +2 -0
- package/dist/chunk-MO5Z5S7B.mjs +2 -0
- package/dist/chunk-MOPBLS6N.mjs +2 -0
- package/dist/chunk-MURAUI3W.mjs +2 -0
- package/dist/chunk-MYBLDYMF.mjs +2 -0
- package/dist/chunk-MYKWMBLF.mjs +2 -0
- package/dist/chunk-N7BNEQPU.mjs +2 -0
- package/dist/chunk-NA4EVPAY.mjs +2 -0
- package/dist/chunk-NEH5H6FT.mjs +8 -0
- package/dist/chunk-NFAXHR5T.mjs +2 -0
- package/dist/chunk-NHHVF35L.mjs +2 -0
- package/dist/chunk-NJKAWDPD.mjs +2 -0
- package/dist/chunk-NPDJHIVO.mjs +2 -0
- package/dist/chunk-NSWEINWF.mjs +2 -0
- package/dist/chunk-NWB2AZNS.mjs +2 -0
- package/dist/chunk-NX47KGRW.mjs +2 -0
- package/dist/chunk-NYBTLOVB.mjs +3 -0
- package/dist/chunk-O55CBIBG.mjs +8 -0
- package/dist/chunk-OGAYDFMV.mjs +2 -0
- package/dist/chunk-OI77O6SL.mjs +2 -0
- package/dist/chunk-OIU4BN7T.mjs +2 -0
- package/dist/chunk-OJXGRTYX.mjs +2 -0
- package/dist/chunk-OKOSJ4DF.mjs +2 -0
- package/dist/chunk-OLQNYINM.mjs +2 -0
- package/dist/chunk-OMIP4OG5.mjs +2 -0
- package/dist/chunk-OTLHHZOF.mjs +2 -0
- package/dist/chunk-OX66FZYY.mjs +2 -0
- package/dist/chunk-OXANJWH4.mjs +2 -0
- package/dist/chunk-OYEGFR5W.mjs +2 -0
- package/dist/chunk-PGXM347Z.mjs +2 -0
- package/dist/chunk-PIEMQYVU.mjs +2 -0
- package/dist/chunk-PISF5LGD.mjs +2 -0
- package/dist/chunk-PMAKRWPB.mjs +2 -0
- package/dist/chunk-PPNWHWNQ.mjs +2 -0
- package/dist/chunk-PPR7AQWS.mjs +2 -0
- package/dist/chunk-PRUCD3QQ.mjs +2 -0
- package/dist/chunk-PVPFL6D6.mjs +2 -0
- package/dist/chunk-Q64KZRX2.mjs +2 -0
- package/dist/chunk-QDT2R7NG.mjs +2 -0
- package/dist/chunk-QLD74AUU.mjs +2 -0
- package/dist/chunk-QP2EHAF7.mjs +2 -0
- package/dist/chunk-QS3K2BUJ.mjs +2 -0
- package/dist/chunk-QTY5FUJ3.mjs +2 -0
- package/dist/chunk-QXM65Z6A.mjs +2 -0
- package/dist/chunk-QZJO3GBP.mjs +2 -0
- package/dist/chunk-RF3BM6RY.mjs +2 -0
- package/dist/chunk-RF6IPNCO.mjs +2 -0
- package/dist/chunk-RF757N25.mjs +3 -0
- package/dist/chunk-RQBEORWD.mjs +2 -0
- package/dist/chunk-RRZDOFPB.mjs +2 -0
- package/dist/chunk-RT4DYHL4.mjs +2 -0
- package/dist/chunk-RWND7PHS.mjs +2 -0
- package/dist/chunk-S7GVW42L.mjs +2 -0
- package/dist/chunk-SGDLNADF.mjs +2 -0
- package/dist/chunk-SJHDGCSL.mjs +2 -0
- package/dist/chunk-SN3ZPBNA.mjs +2 -0
- package/dist/chunk-SRB37H2M.mjs +2 -0
- package/dist/chunk-SVXEWZS2.mjs +2 -0
- package/dist/chunk-SWY5WJTL.mjs +2 -0
- package/dist/chunk-T2HLWVVR.mjs +3 -0
- package/dist/chunk-T4YFARK5.mjs +2 -0
- package/dist/chunk-TEYRN5YH.mjs +2 -0
- package/dist/chunk-TFO3ND3W.mjs +2 -0
- package/dist/chunk-TLCO7PTI.mjs +2 -0
- package/dist/chunk-TN7DEVEE.mjs +2 -0
- package/dist/chunk-TNTITL6S.mjs +3 -0
- package/dist/chunk-TRZ3KXED.mjs +8 -0
- package/dist/chunk-TSU5QRYZ.mjs +2 -0
- package/dist/chunk-TTICNZG7.mjs +2 -0
- package/dist/chunk-U7OUT2WV.mjs +1 -0
- package/dist/chunk-UBZTDYQG.mjs +2 -0
- package/dist/chunk-UEZD34PU.mjs +2 -0
- package/dist/chunk-UQPZMB6C.mjs +2 -0
- package/dist/chunk-UTIBO7SO.mjs +2 -0
- package/dist/chunk-UVSGUIBW.mjs +8 -0
- package/dist/chunk-VAQHITBV.mjs +2 -0
- package/dist/chunk-VBY3N2TS.mjs +3 -0
- package/dist/chunk-VE55VEAS.mjs +2 -0
- package/dist/chunk-VFWL5XAA.mjs +2 -0
- package/dist/chunk-VIDJ5SRV.mjs +2 -0
- package/dist/chunk-W2MLKAZN.mjs +2 -0
- package/dist/chunk-W65Y5YRU.mjs +2 -0
- package/dist/chunk-W6R5YWL6.mjs +2 -0
- package/dist/chunk-WB7VZJZA.mjs +2 -0
- package/dist/chunk-WDSNVW3W.mjs +2 -0
- package/dist/chunk-WURMVTJP.mjs +2 -0
- package/dist/chunk-WWM6WQCY.mjs +2 -0
- package/dist/chunk-X2XFCFUL.mjs +2 -0
- package/dist/chunk-X374ODLH.mjs +2 -0
- package/dist/chunk-X7ADEEVD.mjs +8 -0
- package/dist/chunk-XE5CT2M3.mjs +2 -0
- package/dist/chunk-XE5QS5VD.mjs +8 -0
- package/dist/chunk-XHGXSXB3.mjs +2 -0
- package/dist/chunk-XQ47XIIO.mjs +2 -0
- package/dist/chunk-XYVV643U.mjs +8 -0
- package/dist/chunk-XZMMZD3Z.mjs +2 -0
- package/dist/chunk-XZSQWDME.mjs +2 -0
- package/dist/chunk-YBWQTHOI.mjs +2 -0
- package/dist/chunk-YOWYEBY3.mjs +2 -0
- package/dist/chunk-YQXTW7IL.mjs +2 -0
- package/dist/chunk-YVROMH7J.mjs +2 -0
- package/dist/chunk-YVVQMYLM.mjs +2 -0
- package/dist/chunk-Z46XMMXR.mjs +2 -0
- package/dist/chunk-Z4MSMGYC.mjs +2 -0
- package/dist/chunk-Z5P2KHPP.mjs +2 -0
- package/dist/chunk-ZGUSKAF7.mjs +2 -0
- package/dist/chunk-ZMZG5IED.mjs +8 -0
- package/dist/chunk-ZNLJMM2N.mjs +2 -0
- package/dist/chunk-ZSF6CHQK.mjs +2 -0
- package/dist/chunk-ZXOXZAH4.mjs +2 -0
- package/dist/copy-button.css +1 -0
- package/dist/copy-button.d.ts +8 -0
- package/dist/copy-button.mjs +2 -0
- package/dist/footer.css +1 -0
- package/dist/footer.d.ts +5 -0
- package/dist/footer.mjs +2 -0
- package/dist/form.css +1 -0
- package/dist/form.d.ts +14 -0
- package/dist/form.mjs +2 -0
- package/dist/google-b9019ca9.d.ts +7 -0
- package/dist/grid-AJXQWCY6.svg +5 -0
- package/dist/icon-menu.d.ts +10 -0
- package/dist/icon-menu.mjs +2 -0
- package/dist/icons/copy.d.ts +7 -0
- package/dist/icons/copy.mjs +2 -0
- package/dist/icons/expanding-arrow.d.ts +7 -0
- package/dist/icons/expanding-arrow.mjs +2 -0
- package/dist/icons/facebook.d.ts +8 -0
- package/dist/icons/facebook.mjs +2 -0
- package/dist/icons/github.d.ts +7 -0
- package/dist/icons/github.mjs +2 -0
- package/dist/icons/google.d.ts +7 -0
- package/dist/icons/google.mjs +2 -0
- package/dist/icons/index.css +1 -0
- package/dist/icons/index.d.ts +16 -0
- package/dist/icons/index.mjs +2 -0
- package/dist/icons/linkedin.d.ts +8 -0
- package/dist/icons/linkedin.mjs +2 -0
- package/dist/icons/loading-circle.d.ts +7 -0
- package/dist/icons/loading-circle.mjs +2 -0
- package/dist/icons/loading-dots.css +1 -0
- package/dist/icons/loading-dots.d.ts +5 -0
- package/dist/icons/loading-dots.mjs +2 -0
- package/dist/icons/loading-spinner.css +1 -0
- package/dist/icons/loading-spinner.d.ts +7 -0
- package/dist/icons/loading-spinner.mjs +2 -0
- package/dist/icons/logo.d.ts +7 -0
- package/dist/icons/logo.mjs +2 -0
- package/dist/icons/logotype.d.ts +7 -0
- package/dist/icons/logotype.mjs +2 -0
- package/dist/icons/photo.d.ts +7 -0
- package/dist/icons/photo.mjs +2 -0
- package/dist/icons/tick.d.ts +7 -0
- package/dist/icons/tick.mjs +2 -0
- package/dist/icons/twitter.d.ts +7 -0
- package/dist/icons/twitter.mjs +2 -0
- package/dist/icons/unsplash.d.ts +7 -0
- package/dist/icons/unsplash.mjs +2 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +128 -0
- package/dist/index.mjs +2 -0
- package/dist/link-preview.css +1 -0
- package/dist/link-preview.d.ts +7 -0
- package/dist/link-preview.mjs +2 -0
- package/dist/max-width-wrapper.d.ts +9 -0
- package/dist/max-width-wrapper.mjs +2 -0
- package/dist/modal.d.ts +14 -0
- package/dist/modal.mjs +2 -0
- package/dist/nav-mobile.css +1 -0
- package/dist/nav-mobile.d.ts +5 -0
- package/dist/nav-mobile.mjs +2 -0
- package/dist/nav.css +1 -0
- package/dist/nav.d.ts +9 -0
- package/dist/nav.mjs +2 -0
- package/dist/number-tooltip.d.ts +12 -0
- package/dist/number-tooltip.mjs +2 -0
- package/dist/number.d.ts +12 -0
- package/dist/number.mjs +2 -0
- package/dist/popover.d.ts +13 -0
- package/dist/popover.mjs +2 -0
- package/dist/switch.d.ts +14 -0
- package/dist/switch.mjs +2 -0
- package/dist/tab-select.d.ts +9 -0
- package/dist/tab-select.mjs +2 -0
- package/dist/tooltip.d.ts +32 -0
- package/dist/tooltip.mjs +2 -0
- package/package.json +65 -0
- package/postcss.config.js +9 -0
- package/src/accordion.tsx +60 -0
- package/src/avatar.tsx +47 -0
- package/src/background.tsx +71 -0
- package/src/badge.tsx +33 -0
- package/src/button.tsx +60 -0
- package/src/content.ts +230 -0
- package/src/copy-button.tsx +39 -0
- package/src/footer.tsx +203 -0
- package/src/form.tsx +77 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/use-current-anchor.ts +65 -0
- package/src/hooks/use-intersection-observer.ts +41 -0
- package/src/hooks/use-local-storage.ts +24 -0
- package/src/hooks/use-media-query.ts +46 -0
- package/src/hooks/use-scroll.ts +21 -0
- package/src/icon-menu.tsx +15 -0
- package/src/icons/copy.tsx +18 -0
- package/src/icons/expanding-arrow.tsx +39 -0
- package/src/icons/facebook.tsx +23 -0
- package/src/icons/github.tsx +14 -0
- package/src/icons/google.tsx +12 -0
- package/src/icons/index.tsx +22 -0
- package/src/icons/linkedin.tsx +22 -0
- package/src/icons/loading-circle.tsx +25 -0
- package/src/icons/loading-dots.css +40 -0
- package/src/icons/loading-dots.tsx +13 -0
- package/src/icons/loading-spinner.tsx +34 -0
- package/src/icons/logo.tsx +29 -0
- package/src/icons/logotype.tsx +51 -0
- package/src/icons/photo.tsx +20 -0
- package/src/icons/tick.tsx +18 -0
- package/src/icons/twitter.tsx +31 -0
- package/src/icons/unsplash.tsx +17 -0
- package/src/index.tsx +35 -0
- package/src/link-preview.tsx +111 -0
- package/src/max-width-wrapper.tsx +21 -0
- package/src/modal.tsx +102 -0
- package/src/nav-mobile.tsx +108 -0
- package/src/nav.tsx +205 -0
- package/src/popover.tsx +61 -0
- package/src/styles.css +3 -0
- package/src/switch.tsx +60 -0
- package/src/tab-select.tsx +27 -0
- package/src/tooltip.tsx +184 -0
- package/tailwind.config.ts +9 -0
- package/tsconfig.json +5 -0
- 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 };
|
package/dist/modal.d.ts
ADDED
|
@@ -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 @@
|
|
|
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,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
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 };
|
package/dist/number.d.ts
ADDED
|
@@ -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 };
|
package/dist/number.mjs
ADDED
|
@@ -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 };
|
package/dist/popover.mjs
ADDED
package/dist/switch.d.ts
ADDED
|
@@ -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 };
|
package/dist/switch.mjs
ADDED
|
@@ -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,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 };
|
package/dist/tooltip.mjs
ADDED
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,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
|
+
}
|