diff --git a/packages/docs-v2/.source/index.ts b/packages/docs-v2/.source/index.ts new file mode 100644 index 00000000..ec4513bb --- /dev/null +++ b/packages/docs-v2/.source/index.ts @@ -0,0 +1,174 @@ +// @ts-nocheck -- skip type checking +import * as docs_169 from "../content/docs/hooks/usewizard.mdx?collection=docs" +import * as docs_168 from "../content/docs/hooks/usewindowsize.mdx?collection=docs" +import * as docs_167 from "../content/docs/hooks/usewindowscroll.mdx?collection=docs" +import * as docs_166 from "../content/docs/hooks/usewindowfocus.mdx?collection=docs" +import * as docs_165 from "../content/docs/hooks/usewindowevent.mdx?collection=docs" +import * as docs_164 from "../content/docs/hooks/usewebsocket.mdx?collection=docs" +import * as docs_163 from "../content/docs/hooks/usewakelock.mdx?collection=docs" +import * as docs_162 from "../content/docs/hooks/usevisibility.mdx?collection=docs" +import * as docs_161 from "../content/docs/hooks/usevirtualkeyboard.mdx?collection=docs" +import * as docs_160 from "../content/docs/hooks/usevibrate.mdx?collection=docs" +import * as docs_159 from "../content/docs/hooks/useurlsearchparams.mdx?collection=docs" +import * as docs_158 from "../content/docs/hooks/useurlsearchparam.mdx?collection=docs" +import * as docs_157 from "../content/docs/hooks/useunmount.mdx?collection=docs" +import * as docs_156 from "../content/docs/hooks/usetoggle.mdx?collection=docs" +import * as docs_155 from "../content/docs/hooks/usetimer.mdx?collection=docs" +import * as docs_154 from "../content/docs/hooks/usetimeout.mdx?collection=docs" +import * as docs_153 from "../content/docs/hooks/usetime.mdx?collection=docs" +import * as docs_152 from "../content/docs/hooks/usethrottlevalue.mdx?collection=docs" +import * as docs_151 from "../content/docs/hooks/usethrottlestate.mdx?collection=docs" +import * as docs_150 from "../content/docs/hooks/usethrottleeffect.mdx?collection=docs" +import * as docs_149 from "../content/docs/hooks/usethrottlecallback.mdx?collection=docs" +import * as docs_148 from "../content/docs/hooks/usetextselection.mdx?collection=docs" +import * as docs_147 from "../content/docs/hooks/usetextdirection.mdx?collection=docs" +import * as docs_146 from "../content/docs/hooks/usetextareaautosize.mdx?collection=docs" +import * as docs_145 from "../content/docs/hooks/usestorage.mdx?collection=docs" +import * as docs_144 from "../content/docs/hooks/usestopwatch.mdx?collection=docs" +import * as docs_143 from "../content/docs/hooks/usesticky.mdx?collection=docs" +import * as docs_142 from "../content/docs/hooks/usestep.mdx?collection=docs" +import * as docs_141 from "../content/docs/hooks/usestatehistory.mdx?collection=docs" +import * as docs_140 from "../content/docs/hooks/usespeechsynthesis.mdx?collection=docs" +import * as docs_139 from "../content/docs/hooks/usespeechrecognition.mdx?collection=docs" +import * as docs_138 from "../content/docs/hooks/usesize.mdx?collection=docs" +import * as docs_137 from "../content/docs/hooks/useshare.mdx?collection=docs" +import * as docs_136 from "../content/docs/hooks/useshalloweffect.mdx?collection=docs" +import * as docs_135 from "../content/docs/hooks/useset.mdx?collection=docs" +import * as docs_134 from "../content/docs/hooks/usesessionstorage.mdx?collection=docs" +import * as docs_133 from "../content/docs/hooks/usescrollto.mdx?collection=docs" +import * as docs_132 from "../content/docs/hooks/usescrollintoview.mdx?collection=docs" +import * as docs_131 from "../content/docs/hooks/usescroll.mdx?collection=docs" +import * as docs_130 from "../content/docs/hooks/usescript.mdx?collection=docs" +import * as docs_129 from "../content/docs/hooks/userightclick.mdx?collection=docs" +import * as docs_128 from "../content/docs/hooks/useresizeobserver.mdx?collection=docs" +import * as docs_127 from "../content/docs/hooks/usererender.mdx?collection=docs" +import * as docs_126 from "../content/docs/hooks/userenderinfo.mdx?collection=docs" +import * as docs_125 from "../content/docs/hooks/userendercount.mdx?collection=docs" +import * as docs_124 from "../content/docs/hooks/userefstate.mdx?collection=docs" +import * as docs_123 from "../content/docs/hooks/userafstate.mdx?collection=docs" +import * as docs_122 from "../content/docs/hooks/useraf.mdx?collection=docs" +import * as docs_121 from "../content/docs/hooks/usequeue.mdx?collection=docs" +import * as docs_120 from "../content/docs/hooks/usequery.mdx?collection=docs" +import * as docs_119 from "../content/docs/hooks/useprogress.mdx?collection=docs" +import * as docs_118 from "../content/docs/hooks/useprevious.mdx?collection=docs" +import * as docs_117 from "../content/docs/hooks/usepreferredreducedmotion.mdx?collection=docs" +import * as docs_116 from "../content/docs/hooks/usepreferredlanguages.mdx?collection=docs" +import * as docs_115 from "../content/docs/hooks/usepreferreddark.mdx?collection=docs" +import * as docs_114 from "../content/docs/hooks/usepreferredcontrast.mdx?collection=docs" +import * as docs_113 from "../content/docs/hooks/usepreferredcolorscheme.mdx?collection=docs" +import * as docs_112 from "../content/docs/hooks/usepostmessage.mdx?collection=docs" +import * as docs_111 from "../content/docs/hooks/usepointerlock.mdx?collection=docs" +import * as docs_110 from "../content/docs/hooks/usepictureinpicture.mdx?collection=docs" +import * as docs_109 from "../content/docs/hooks/usepermission.mdx?collection=docs" +import * as docs_108 from "../content/docs/hooks/useperformanceobserver.mdx?collection=docs" +import * as docs_107 from "../content/docs/hooks/useparallax.mdx?collection=docs" +import * as docs_106 from "../content/docs/hooks/usepaint.mdx?collection=docs" +import * as docs_105 from "../content/docs/hooks/usepageleave.mdx?collection=docs" +import * as docs_104 from "../content/docs/hooks/useotpcredential.mdx?collection=docs" +import * as docs_103 from "../content/docs/hooks/useorientation.mdx?collection=docs" +import * as docs_102 from "../content/docs/hooks/useoptimistic.mdx?collection=docs" +import * as docs_101 from "../content/docs/hooks/useoperatingsystem.mdx?collection=docs" +import * as docs_100 from "../content/docs/hooks/useonline.mdx?collection=docs" +import * as docs_99 from "../content/docs/hooks/useonce.mdx?collection=docs" +import * as docs_98 from "../content/docs/hooks/useoffsetpagination.mdx?collection=docs" +import * as docs_97 from "../content/docs/hooks/useobject.mdx?collection=docs" +import * as docs_96 from "../content/docs/hooks/usenetwork.mdx?collection=docs" +import * as docs_95 from "../content/docs/hooks/usemutationobserver.mdx?collection=docs" +import * as docs_94 from "../content/docs/hooks/usemutation.mdx?collection=docs" +import * as docs_93 from "../content/docs/hooks/usemouse.mdx?collection=docs" +import * as docs_92 from "../content/docs/hooks/usemount.mdx?collection=docs" +import * as docs_91 from "../content/docs/hooks/usemergedref.mdx?collection=docs" +import * as docs_90 from "../content/docs/hooks/usememory.mdx?collection=docs" +import * as docs_89 from "../content/docs/hooks/usemediaquery.mdx?collection=docs" +import * as docs_88 from "../content/docs/hooks/usemediacontrols.mdx?collection=docs" +import * as docs_87 from "../content/docs/hooks/usemeasure.mdx?collection=docs" +import * as docs_86 from "../content/docs/hooks/usemap.mdx?collection=docs" +import * as docs_85 from "../content/docs/hooks/uselongpress.mdx?collection=docs" +import * as docs_84 from "../content/docs/hooks/uselogger.mdx?collection=docs" +import * as docs_83 from "../content/docs/hooks/uselockscroll.mdx?collection=docs" +import * as docs_82 from "../content/docs/hooks/uselockcallback.mdx?collection=docs" +import * as docs_81 from "../content/docs/hooks/uselocalstorage.mdx?collection=docs" +import * as docs_80 from "../content/docs/hooks/uselist.mdx?collection=docs" +import * as docs_79 from "../content/docs/hooks/useless.mdx?collection=docs" +import * as docs_78 from "../content/docs/hooks/uselatest.mdx?collection=docs" +import * as docs_77 from "../content/docs/hooks/uselastchanged.mdx?collection=docs" +import * as docs_76 from "../content/docs/hooks/usekeyspressed.mdx?collection=docs" +import * as docs_75 from "../content/docs/hooks/usekeypressevent.mdx?collection=docs" +import * as docs_74 from "../content/docs/hooks/usekeypress.mdx?collection=docs" +import * as docs_73 from "../content/docs/hooks/usekeyboard.mdx?collection=docs" +import * as docs_72 from "../content/docs/hooks/useisomorphiclayouteffect.mdx?collection=docs" +import * as docs_71 from "../content/docs/hooks/useisfirstrender.mdx?collection=docs" +import * as docs_70 from "../content/docs/hooks/useinterval.mdx?collection=docs" +import * as docs_69 from "../content/docs/hooks/useintersectionobserver.mdx?collection=docs" +import * as docs_68 from "../content/docs/hooks/useinfinitescroll.mdx?collection=docs" +import * as docs_67 from "../content/docs/hooks/useimage.mdx?collection=docs" +import * as docs_66 from "../content/docs/hooks/useidle.mdx?collection=docs" +import * as docs_65 from "../content/docs/hooks/usehover.mdx?collection=docs" +import * as docs_64 from "../content/docs/hooks/usehotkeys.mdx?collection=docs" +import * as docs_63 from "../content/docs/hooks/usehash.mdx?collection=docs" +import * as docs_62 from "../content/docs/hooks/usegeolocation.mdx?collection=docs" +import * as docs_61 from "../content/docs/hooks/usegamepad.mdx?collection=docs" +import * as docs_60 from "../content/docs/hooks/usefullscreen.mdx?collection=docs" +import * as docs_59 from "../content/docs/hooks/useful.mdx?collection=docs" +import * as docs_58 from "../content/docs/hooks/usefps.mdx?collection=docs" +import * as docs_57 from "../content/docs/hooks/usefocustrap.mdx?collection=docs" +import * as docs_56 from "../content/docs/hooks/usefocus.mdx?collection=docs" +import * as docs_55 from "../content/docs/hooks/usefiledialog.mdx?collection=docs" +import * as docs_54 from "../content/docs/hooks/usefield.mdx?collection=docs" +import * as docs_53 from "../content/docs/hooks/usefavicon.mdx?collection=docs" +import * as docs_52 from "../content/docs/hooks/useeyedropper.mdx?collection=docs" +import * as docs_51 from "../content/docs/hooks/useeventsource.mdx?collection=docs" +import * as docs_50 from "../content/docs/hooks/useeventlistener.mdx?collection=docs" +import * as docs_49 from "../content/docs/hooks/useevent.mdx?collection=docs" +import * as docs_48 from "../content/docs/hooks/usedropzone.mdx?collection=docs" +import * as docs_47 from "../content/docs/hooks/usedoubleclick.mdx?collection=docs" +import * as docs_46 from "../content/docs/hooks/usedocumentvisibility.mdx?collection=docs" +import * as docs_45 from "../content/docs/hooks/usedocumenttitle.mdx?collection=docs" +import * as docs_44 from "../content/docs/hooks/usedocumentevent.mdx?collection=docs" +import * as docs_43 from "../content/docs/hooks/usedisplaymedia.mdx?collection=docs" +import * as docs_42 from "../content/docs/hooks/usedisclosure.mdx?collection=docs" +import * as docs_41 from "../content/docs/hooks/usedidupdate.mdx?collection=docs" +import * as docs_40 from "../content/docs/hooks/usedevicepixelratio.mdx?collection=docs" +import * as docs_39 from "../content/docs/hooks/usedeviceorientation.mdx?collection=docs" +import * as docs_38 from "../content/docs/hooks/usedevicemotion.mdx?collection=docs" +import * as docs_37 from "../content/docs/hooks/usedefault.mdx?collection=docs" +import * as docs_36 from "../content/docs/hooks/usedebouncevalue.mdx?collection=docs" +import * as docs_35 from "../content/docs/hooks/usedebouncestate.mdx?collection=docs" +import * as docs_34 from "../content/docs/hooks/usedebounceeffect.mdx?collection=docs" +import * as docs_33 from "../content/docs/hooks/usedebouncecallback.mdx?collection=docs" +import * as docs_32 from "../content/docs/hooks/usecssvar.mdx?collection=docs" +import * as docs_31 from "../content/docs/hooks/usecounter.mdx?collection=docs" +import * as docs_30 from "../content/docs/hooks/usecopy.mdx?collection=docs" +import * as docs_29 from "../content/docs/hooks/usecookies.mdx?collection=docs" +import * as docs_28 from "../content/docs/hooks/usecookie.mdx?collection=docs" +import * as docs_27 from "../content/docs/hooks/usecontrollablestate.mdx?collection=docs" +import * as docs_26 from "../content/docs/hooks/useconst.mdx?collection=docs" +import * as docs_25 from "../content/docs/hooks/useclipboard.mdx?collection=docs" +import * as docs_24 from "../content/docs/hooks/useclickoutside.mdx?collection=docs" +import * as docs_23 from "../content/docs/hooks/usebrowserlanguage.mdx?collection=docs" +import * as docs_22 from "../content/docs/hooks/usebroadcastchannel.mdx?collection=docs" +import * as docs_21 from "../content/docs/hooks/usebreakpoints.mdx?collection=docs" +import * as docs_20 from "../content/docs/hooks/useboolean.mdx?collection=docs" +import * as docs_19 from "../content/docs/hooks/usebluetooth.mdx?collection=docs" +import * as docs_18 from "../content/docs/hooks/usebattery.mdx?collection=docs" +import * as docs_17 from "../content/docs/hooks/usebatchedcallback.mdx?collection=docs" +import * as docs_16 from "../content/docs/hooks/useautoscroll.mdx?collection=docs" +import * as docs_15 from "../content/docs/hooks/useaudio.mdx?collection=docs" +import * as docs_14 from "../content/docs/hooks/useasynceffect.mdx?collection=docs" +import * as docs_13 from "../content/docs/hooks/useasync.mdx?collection=docs" +import * as docs_12 from "../content/docs/hooks/useactiveelement.mdx?collection=docs" +import * as docs_11 from "../content/docs/(root)/target.mdx?collection=docs" +import * as docs_10 from "../content/docs/(root)/reactuse-json.mdx?collection=docs" +import * as docs_9 from "../content/docs/(root)/memoization.mdx?collection=docs" +import * as docs_8 from "../content/docs/(root)/installation.mdx?collection=docs" +import * as docs_7 from "../content/docs/(root)/index.mdx?collection=docs" +import * as docs_6 from "../content/docs/(root)/cli.mdx?collection=docs" +import * as docs_5 from "../content/docs/installation/vite.mdx?collection=docs" +import * as docs_4 from "../content/docs/installation/tanstack.mdx?collection=docs" +import * as docs_3 from "../content/docs/installation/tanstack-router.mdx?collection=docs" +import * as docs_2 from "../content/docs/installation/react-router.mdx?collection=docs" +import * as docs_1 from "../content/docs/installation/nextjs.mdx?collection=docs" +import * as docs_0 from "../content/docs/installation/manual.mdx?collection=docs" +import { _runtime } from "fumadocs-mdx/runtime/next" +import * as _source from "../source.config" +export const docs = _runtime.docs([{ info: {"path":"installation/manual.mdx","fullPath":"content/docs/installation/manual.mdx"}, data: docs_0 }, { info: {"path":"installation/nextjs.mdx","fullPath":"content/docs/installation/nextjs.mdx"}, data: docs_1 }, { info: {"path":"installation/react-router.mdx","fullPath":"content/docs/installation/react-router.mdx"}, data: docs_2 }, { info: {"path":"installation/tanstack-router.mdx","fullPath":"content/docs/installation/tanstack-router.mdx"}, data: docs_3 }, { info: {"path":"installation/tanstack.mdx","fullPath":"content/docs/installation/tanstack.mdx"}, data: docs_4 }, { info: {"path":"installation/vite.mdx","fullPath":"content/docs/installation/vite.mdx"}, data: docs_5 }, { info: {"path":"(root)/cli.mdx","fullPath":"content/docs/(root)/cli.mdx"}, data: docs_6 }, { info: {"path":"(root)/index.mdx","fullPath":"content/docs/(root)/index.mdx"}, data: docs_7 }, { info: {"path":"(root)/installation.mdx","fullPath":"content/docs/(root)/installation.mdx"}, data: docs_8 }, { info: {"path":"(root)/memoization.mdx","fullPath":"content/docs/(root)/memoization.mdx"}, data: docs_9 }, { info: {"path":"(root)/reactuse-json.mdx","fullPath":"content/docs/(root)/reactuse-json.mdx"}, data: docs_10 }, { info: {"path":"(root)/target.mdx","fullPath":"content/docs/(root)/target.mdx"}, data: docs_11 }, { info: {"path":"hooks/useactiveelement.mdx","fullPath":"content/docs/hooks/useactiveelement.mdx"}, data: docs_12 }, { info: {"path":"hooks/useasync.mdx","fullPath":"content/docs/hooks/useasync.mdx"}, data: docs_13 }, { info: {"path":"hooks/useasynceffect.mdx","fullPath":"content/docs/hooks/useasynceffect.mdx"}, data: docs_14 }, { info: {"path":"hooks/useaudio.mdx","fullPath":"content/docs/hooks/useaudio.mdx"}, data: docs_15 }, { info: {"path":"hooks/useautoscroll.mdx","fullPath":"content/docs/hooks/useautoscroll.mdx"}, data: docs_16 }, { info: {"path":"hooks/usebatchedcallback.mdx","fullPath":"content/docs/hooks/usebatchedcallback.mdx"}, data: docs_17 }, { info: {"path":"hooks/usebattery.mdx","fullPath":"content/docs/hooks/usebattery.mdx"}, data: docs_18 }, { info: {"path":"hooks/usebluetooth.mdx","fullPath":"content/docs/hooks/usebluetooth.mdx"}, data: docs_19 }, { info: {"path":"hooks/useboolean.mdx","fullPath":"content/docs/hooks/useboolean.mdx"}, data: docs_20 }, { info: {"path":"hooks/usebreakpoints.mdx","fullPath":"content/docs/hooks/usebreakpoints.mdx"}, data: docs_21 }, { info: {"path":"hooks/usebroadcastchannel.mdx","fullPath":"content/docs/hooks/usebroadcastchannel.mdx"}, data: docs_22 }, { info: {"path":"hooks/usebrowserlanguage.mdx","fullPath":"content/docs/hooks/usebrowserlanguage.mdx"}, data: docs_23 }, { info: {"path":"hooks/useclickoutside.mdx","fullPath":"content/docs/hooks/useclickoutside.mdx"}, data: docs_24 }, { info: {"path":"hooks/useclipboard.mdx","fullPath":"content/docs/hooks/useclipboard.mdx"}, data: docs_25 }, { info: {"path":"hooks/useconst.mdx","fullPath":"content/docs/hooks/useconst.mdx"}, data: docs_26 }, { info: {"path":"hooks/usecontrollablestate.mdx","fullPath":"content/docs/hooks/usecontrollablestate.mdx"}, data: docs_27 }, { info: {"path":"hooks/usecookie.mdx","fullPath":"content/docs/hooks/usecookie.mdx"}, data: docs_28 }, { info: {"path":"hooks/usecookies.mdx","fullPath":"content/docs/hooks/usecookies.mdx"}, data: docs_29 }, { info: {"path":"hooks/usecopy.mdx","fullPath":"content/docs/hooks/usecopy.mdx"}, data: docs_30 }, { info: {"path":"hooks/usecounter.mdx","fullPath":"content/docs/hooks/usecounter.mdx"}, data: docs_31 }, { info: {"path":"hooks/usecssvar.mdx","fullPath":"content/docs/hooks/usecssvar.mdx"}, data: docs_32 }, { info: {"path":"hooks/usedebouncecallback.mdx","fullPath":"content/docs/hooks/usedebouncecallback.mdx"}, data: docs_33 }, { info: {"path":"hooks/usedebounceeffect.mdx","fullPath":"content/docs/hooks/usedebounceeffect.mdx"}, data: docs_34 }, { info: {"path":"hooks/usedebouncestate.mdx","fullPath":"content/docs/hooks/usedebouncestate.mdx"}, data: docs_35 }, { info: {"path":"hooks/usedebouncevalue.mdx","fullPath":"content/docs/hooks/usedebouncevalue.mdx"}, data: docs_36 }, { info: {"path":"hooks/usedefault.mdx","fullPath":"content/docs/hooks/usedefault.mdx"}, data: docs_37 }, { info: {"path":"hooks/usedevicemotion.mdx","fullPath":"content/docs/hooks/usedevicemotion.mdx"}, data: docs_38 }, { info: {"path":"hooks/usedeviceorientation.mdx","fullPath":"content/docs/hooks/usedeviceorientation.mdx"}, data: docs_39 }, { info: {"path":"hooks/usedevicepixelratio.mdx","fullPath":"content/docs/hooks/usedevicepixelratio.mdx"}, data: docs_40 }, { info: {"path":"hooks/usedidupdate.mdx","fullPath":"content/docs/hooks/usedidupdate.mdx"}, data: docs_41 }, { info: {"path":"hooks/usedisclosure.mdx","fullPath":"content/docs/hooks/usedisclosure.mdx"}, data: docs_42 }, { info: {"path":"hooks/usedisplaymedia.mdx","fullPath":"content/docs/hooks/usedisplaymedia.mdx"}, data: docs_43 }, { info: {"path":"hooks/usedocumentevent.mdx","fullPath":"content/docs/hooks/usedocumentevent.mdx"}, data: docs_44 }, { info: {"path":"hooks/usedocumenttitle.mdx","fullPath":"content/docs/hooks/usedocumenttitle.mdx"}, data: docs_45 }, { info: {"path":"hooks/usedocumentvisibility.mdx","fullPath":"content/docs/hooks/usedocumentvisibility.mdx"}, data: docs_46 }, { info: {"path":"hooks/usedoubleclick.mdx","fullPath":"content/docs/hooks/usedoubleclick.mdx"}, data: docs_47 }, { info: {"path":"hooks/usedropzone.mdx","fullPath":"content/docs/hooks/usedropzone.mdx"}, data: docs_48 }, { info: {"path":"hooks/useevent.mdx","fullPath":"content/docs/hooks/useevent.mdx"}, data: docs_49 }, { info: {"path":"hooks/useeventlistener.mdx","fullPath":"content/docs/hooks/useeventlistener.mdx"}, data: docs_50 }, { info: {"path":"hooks/useeventsource.mdx","fullPath":"content/docs/hooks/useeventsource.mdx"}, data: docs_51 }, { info: {"path":"hooks/useeyedropper.mdx","fullPath":"content/docs/hooks/useeyedropper.mdx"}, data: docs_52 }, { info: {"path":"hooks/usefavicon.mdx","fullPath":"content/docs/hooks/usefavicon.mdx"}, data: docs_53 }, { info: {"path":"hooks/usefield.mdx","fullPath":"content/docs/hooks/usefield.mdx"}, data: docs_54 }, { info: {"path":"hooks/usefiledialog.mdx","fullPath":"content/docs/hooks/usefiledialog.mdx"}, data: docs_55 }, { info: {"path":"hooks/usefocus.mdx","fullPath":"content/docs/hooks/usefocus.mdx"}, data: docs_56 }, { info: {"path":"hooks/usefocustrap.mdx","fullPath":"content/docs/hooks/usefocustrap.mdx"}, data: docs_57 }, { info: {"path":"hooks/usefps.mdx","fullPath":"content/docs/hooks/usefps.mdx"}, data: docs_58 }, { info: {"path":"hooks/useful.mdx","fullPath":"content/docs/hooks/useful.mdx"}, data: docs_59 }, { info: {"path":"hooks/usefullscreen.mdx","fullPath":"content/docs/hooks/usefullscreen.mdx"}, data: docs_60 }, { info: {"path":"hooks/usegamepad.mdx","fullPath":"content/docs/hooks/usegamepad.mdx"}, data: docs_61 }, { info: {"path":"hooks/usegeolocation.mdx","fullPath":"content/docs/hooks/usegeolocation.mdx"}, data: docs_62 }, { info: {"path":"hooks/usehash.mdx","fullPath":"content/docs/hooks/usehash.mdx"}, data: docs_63 }, { info: {"path":"hooks/usehotkeys.mdx","fullPath":"content/docs/hooks/usehotkeys.mdx"}, data: docs_64 }, { info: {"path":"hooks/usehover.mdx","fullPath":"content/docs/hooks/usehover.mdx"}, data: docs_65 }, { info: {"path":"hooks/useidle.mdx","fullPath":"content/docs/hooks/useidle.mdx"}, data: docs_66 }, { info: {"path":"hooks/useimage.mdx","fullPath":"content/docs/hooks/useimage.mdx"}, data: docs_67 }, { info: {"path":"hooks/useinfinitescroll.mdx","fullPath":"content/docs/hooks/useinfinitescroll.mdx"}, data: docs_68 }, { info: {"path":"hooks/useintersectionobserver.mdx","fullPath":"content/docs/hooks/useintersectionobserver.mdx"}, data: docs_69 }, { info: {"path":"hooks/useinterval.mdx","fullPath":"content/docs/hooks/useinterval.mdx"}, data: docs_70 }, { info: {"path":"hooks/useisfirstrender.mdx","fullPath":"content/docs/hooks/useisfirstrender.mdx"}, data: docs_71 }, { info: {"path":"hooks/useisomorphiclayouteffect.mdx","fullPath":"content/docs/hooks/useisomorphiclayouteffect.mdx"}, data: docs_72 }, { info: {"path":"hooks/usekeyboard.mdx","fullPath":"content/docs/hooks/usekeyboard.mdx"}, data: docs_73 }, { info: {"path":"hooks/usekeypress.mdx","fullPath":"content/docs/hooks/usekeypress.mdx"}, data: docs_74 }, { info: {"path":"hooks/usekeypressevent.mdx","fullPath":"content/docs/hooks/usekeypressevent.mdx"}, data: docs_75 }, { info: {"path":"hooks/usekeyspressed.mdx","fullPath":"content/docs/hooks/usekeyspressed.mdx"}, data: docs_76 }, { info: {"path":"hooks/uselastchanged.mdx","fullPath":"content/docs/hooks/uselastchanged.mdx"}, data: docs_77 }, { info: {"path":"hooks/uselatest.mdx","fullPath":"content/docs/hooks/uselatest.mdx"}, data: docs_78 }, { info: {"path":"hooks/useless.mdx","fullPath":"content/docs/hooks/useless.mdx"}, data: docs_79 }, { info: {"path":"hooks/uselist.mdx","fullPath":"content/docs/hooks/uselist.mdx"}, data: docs_80 }, { info: {"path":"hooks/uselocalstorage.mdx","fullPath":"content/docs/hooks/uselocalstorage.mdx"}, data: docs_81 }, { info: {"path":"hooks/uselockcallback.mdx","fullPath":"content/docs/hooks/uselockcallback.mdx"}, data: docs_82 }, { info: {"path":"hooks/uselockscroll.mdx","fullPath":"content/docs/hooks/uselockscroll.mdx"}, data: docs_83 }, { info: {"path":"hooks/uselogger.mdx","fullPath":"content/docs/hooks/uselogger.mdx"}, data: docs_84 }, { info: {"path":"hooks/uselongpress.mdx","fullPath":"content/docs/hooks/uselongpress.mdx"}, data: docs_85 }, { info: {"path":"hooks/usemap.mdx","fullPath":"content/docs/hooks/usemap.mdx"}, data: docs_86 }, { info: {"path":"hooks/usemeasure.mdx","fullPath":"content/docs/hooks/usemeasure.mdx"}, data: docs_87 }, { info: {"path":"hooks/usemediacontrols.mdx","fullPath":"content/docs/hooks/usemediacontrols.mdx"}, data: docs_88 }, { info: {"path":"hooks/usemediaquery.mdx","fullPath":"content/docs/hooks/usemediaquery.mdx"}, data: docs_89 }, { info: {"path":"hooks/usememory.mdx","fullPath":"content/docs/hooks/usememory.mdx"}, data: docs_90 }, { info: {"path":"hooks/usemergedref.mdx","fullPath":"content/docs/hooks/usemergedref.mdx"}, data: docs_91 }, { info: {"path":"hooks/usemount.mdx","fullPath":"content/docs/hooks/usemount.mdx"}, data: docs_92 }, { info: {"path":"hooks/usemouse.mdx","fullPath":"content/docs/hooks/usemouse.mdx"}, data: docs_93 }, { info: {"path":"hooks/usemutation.mdx","fullPath":"content/docs/hooks/usemutation.mdx"}, data: docs_94 }, { info: {"path":"hooks/usemutationobserver.mdx","fullPath":"content/docs/hooks/usemutationobserver.mdx"}, data: docs_95 }, { info: {"path":"hooks/usenetwork.mdx","fullPath":"content/docs/hooks/usenetwork.mdx"}, data: docs_96 }, { info: {"path":"hooks/useobject.mdx","fullPath":"content/docs/hooks/useobject.mdx"}, data: docs_97 }, { info: {"path":"hooks/useoffsetpagination.mdx","fullPath":"content/docs/hooks/useoffsetpagination.mdx"}, data: docs_98 }, { info: {"path":"hooks/useonce.mdx","fullPath":"content/docs/hooks/useonce.mdx"}, data: docs_99 }, { info: {"path":"hooks/useonline.mdx","fullPath":"content/docs/hooks/useonline.mdx"}, data: docs_100 }, { info: {"path":"hooks/useoperatingsystem.mdx","fullPath":"content/docs/hooks/useoperatingsystem.mdx"}, data: docs_101 }, { info: {"path":"hooks/useoptimistic.mdx","fullPath":"content/docs/hooks/useoptimistic.mdx"}, data: docs_102 }, { info: {"path":"hooks/useorientation.mdx","fullPath":"content/docs/hooks/useorientation.mdx"}, data: docs_103 }, { info: {"path":"hooks/useotpcredential.mdx","fullPath":"content/docs/hooks/useotpcredential.mdx"}, data: docs_104 }, { info: {"path":"hooks/usepageleave.mdx","fullPath":"content/docs/hooks/usepageleave.mdx"}, data: docs_105 }, { info: {"path":"hooks/usepaint.mdx","fullPath":"content/docs/hooks/usepaint.mdx"}, data: docs_106 }, { info: {"path":"hooks/useparallax.mdx","fullPath":"content/docs/hooks/useparallax.mdx"}, data: docs_107 }, { info: {"path":"hooks/useperformanceobserver.mdx","fullPath":"content/docs/hooks/useperformanceobserver.mdx"}, data: docs_108 }, { info: {"path":"hooks/usepermission.mdx","fullPath":"content/docs/hooks/usepermission.mdx"}, data: docs_109 }, { info: {"path":"hooks/usepictureinpicture.mdx","fullPath":"content/docs/hooks/usepictureinpicture.mdx"}, data: docs_110 }, { info: {"path":"hooks/usepointerlock.mdx","fullPath":"content/docs/hooks/usepointerlock.mdx"}, data: docs_111 }, { info: {"path":"hooks/usepostmessage.mdx","fullPath":"content/docs/hooks/usepostmessage.mdx"}, data: docs_112 }, { info: {"path":"hooks/usepreferredcolorscheme.mdx","fullPath":"content/docs/hooks/usepreferredcolorscheme.mdx"}, data: docs_113 }, { info: {"path":"hooks/usepreferredcontrast.mdx","fullPath":"content/docs/hooks/usepreferredcontrast.mdx"}, data: docs_114 }, { info: {"path":"hooks/usepreferreddark.mdx","fullPath":"content/docs/hooks/usepreferreddark.mdx"}, data: docs_115 }, { info: {"path":"hooks/usepreferredlanguages.mdx","fullPath":"content/docs/hooks/usepreferredlanguages.mdx"}, data: docs_116 }, { info: {"path":"hooks/usepreferredreducedmotion.mdx","fullPath":"content/docs/hooks/usepreferredreducedmotion.mdx"}, data: docs_117 }, { info: {"path":"hooks/useprevious.mdx","fullPath":"content/docs/hooks/useprevious.mdx"}, data: docs_118 }, { info: {"path":"hooks/useprogress.mdx","fullPath":"content/docs/hooks/useprogress.mdx"}, data: docs_119 }, { info: {"path":"hooks/usequery.mdx","fullPath":"content/docs/hooks/usequery.mdx"}, data: docs_120 }, { info: {"path":"hooks/usequeue.mdx","fullPath":"content/docs/hooks/usequeue.mdx"}, data: docs_121 }, { info: {"path":"hooks/useraf.mdx","fullPath":"content/docs/hooks/useraf.mdx"}, data: docs_122 }, { info: {"path":"hooks/userafstate.mdx","fullPath":"content/docs/hooks/userafstate.mdx"}, data: docs_123 }, { info: {"path":"hooks/userefstate.mdx","fullPath":"content/docs/hooks/userefstate.mdx"}, data: docs_124 }, { info: {"path":"hooks/userendercount.mdx","fullPath":"content/docs/hooks/userendercount.mdx"}, data: docs_125 }, { info: {"path":"hooks/userenderinfo.mdx","fullPath":"content/docs/hooks/userenderinfo.mdx"}, data: docs_126 }, { info: {"path":"hooks/usererender.mdx","fullPath":"content/docs/hooks/usererender.mdx"}, data: docs_127 }, { info: {"path":"hooks/useresizeobserver.mdx","fullPath":"content/docs/hooks/useresizeobserver.mdx"}, data: docs_128 }, { info: {"path":"hooks/userightclick.mdx","fullPath":"content/docs/hooks/userightclick.mdx"}, data: docs_129 }, { info: {"path":"hooks/usescript.mdx","fullPath":"content/docs/hooks/usescript.mdx"}, data: docs_130 }, { info: {"path":"hooks/usescroll.mdx","fullPath":"content/docs/hooks/usescroll.mdx"}, data: docs_131 }, { info: {"path":"hooks/usescrollintoview.mdx","fullPath":"content/docs/hooks/usescrollintoview.mdx"}, data: docs_132 }, { info: {"path":"hooks/usescrollto.mdx","fullPath":"content/docs/hooks/usescrollto.mdx"}, data: docs_133 }, { info: {"path":"hooks/usesessionstorage.mdx","fullPath":"content/docs/hooks/usesessionstorage.mdx"}, data: docs_134 }, { info: {"path":"hooks/useset.mdx","fullPath":"content/docs/hooks/useset.mdx"}, data: docs_135 }, { info: {"path":"hooks/useshalloweffect.mdx","fullPath":"content/docs/hooks/useshalloweffect.mdx"}, data: docs_136 }, { info: {"path":"hooks/useshare.mdx","fullPath":"content/docs/hooks/useshare.mdx"}, data: docs_137 }, { info: {"path":"hooks/usesize.mdx","fullPath":"content/docs/hooks/usesize.mdx"}, data: docs_138 }, { info: {"path":"hooks/usespeechrecognition.mdx","fullPath":"content/docs/hooks/usespeechrecognition.mdx"}, data: docs_139 }, { info: {"path":"hooks/usespeechsynthesis.mdx","fullPath":"content/docs/hooks/usespeechsynthesis.mdx"}, data: docs_140 }, { info: {"path":"hooks/usestatehistory.mdx","fullPath":"content/docs/hooks/usestatehistory.mdx"}, data: docs_141 }, { info: {"path":"hooks/usestep.mdx","fullPath":"content/docs/hooks/usestep.mdx"}, data: docs_142 }, { info: {"path":"hooks/usesticky.mdx","fullPath":"content/docs/hooks/usesticky.mdx"}, data: docs_143 }, { info: {"path":"hooks/usestopwatch.mdx","fullPath":"content/docs/hooks/usestopwatch.mdx"}, data: docs_144 }, { info: {"path":"hooks/usestorage.mdx","fullPath":"content/docs/hooks/usestorage.mdx"}, data: docs_145 }, { info: {"path":"hooks/usetextareaautosize.mdx","fullPath":"content/docs/hooks/usetextareaautosize.mdx"}, data: docs_146 }, { info: {"path":"hooks/usetextdirection.mdx","fullPath":"content/docs/hooks/usetextdirection.mdx"}, data: docs_147 }, { info: {"path":"hooks/usetextselection.mdx","fullPath":"content/docs/hooks/usetextselection.mdx"}, data: docs_148 }, { info: {"path":"hooks/usethrottlecallback.mdx","fullPath":"content/docs/hooks/usethrottlecallback.mdx"}, data: docs_149 }, { info: {"path":"hooks/usethrottleeffect.mdx","fullPath":"content/docs/hooks/usethrottleeffect.mdx"}, data: docs_150 }, { info: {"path":"hooks/usethrottlestate.mdx","fullPath":"content/docs/hooks/usethrottlestate.mdx"}, data: docs_151 }, { info: {"path":"hooks/usethrottlevalue.mdx","fullPath":"content/docs/hooks/usethrottlevalue.mdx"}, data: docs_152 }, { info: {"path":"hooks/usetime.mdx","fullPath":"content/docs/hooks/usetime.mdx"}, data: docs_153 }, { info: {"path":"hooks/usetimeout.mdx","fullPath":"content/docs/hooks/usetimeout.mdx"}, data: docs_154 }, { info: {"path":"hooks/usetimer.mdx","fullPath":"content/docs/hooks/usetimer.mdx"}, data: docs_155 }, { info: {"path":"hooks/usetoggle.mdx","fullPath":"content/docs/hooks/usetoggle.mdx"}, data: docs_156 }, { info: {"path":"hooks/useunmount.mdx","fullPath":"content/docs/hooks/useunmount.mdx"}, data: docs_157 }, { info: {"path":"hooks/useurlsearchparam.mdx","fullPath":"content/docs/hooks/useurlsearchparam.mdx"}, data: docs_158 }, { info: {"path":"hooks/useurlsearchparams.mdx","fullPath":"content/docs/hooks/useurlsearchparams.mdx"}, data: docs_159 }, { info: {"path":"hooks/usevibrate.mdx","fullPath":"content/docs/hooks/usevibrate.mdx"}, data: docs_160 }, { info: {"path":"hooks/usevirtualkeyboard.mdx","fullPath":"content/docs/hooks/usevirtualkeyboard.mdx"}, data: docs_161 }, { info: {"path":"hooks/usevisibility.mdx","fullPath":"content/docs/hooks/usevisibility.mdx"}, data: docs_162 }, { info: {"path":"hooks/usewakelock.mdx","fullPath":"content/docs/hooks/usewakelock.mdx"}, data: docs_163 }, { info: {"path":"hooks/usewebsocket.mdx","fullPath":"content/docs/hooks/usewebsocket.mdx"}, data: docs_164 }, { info: {"path":"hooks/usewindowevent.mdx","fullPath":"content/docs/hooks/usewindowevent.mdx"}, data: docs_165 }, { info: {"path":"hooks/usewindowfocus.mdx","fullPath":"content/docs/hooks/usewindowfocus.mdx"}, data: docs_166 }, { info: {"path":"hooks/usewindowscroll.mdx","fullPath":"content/docs/hooks/usewindowscroll.mdx"}, data: docs_167 }, { info: {"path":"hooks/usewindowsize.mdx","fullPath":"content/docs/hooks/usewindowsize.mdx"}, data: docs_168 }, { info: {"path":"hooks/usewizard.mdx","fullPath":"content/docs/hooks/usewizard.mdx"}, data: docs_169 }], [{"info":{"path":"meta.json","fullPath":"content/docs/meta.json"},"data":{"root":true}}]) \ No newline at end of file diff --git a/packages/docs-v2/.source/source.config.mjs b/packages/docs-v2/.source/source.config.mjs new file mode 100644 index 00000000..3a4bf3fa --- /dev/null +++ b/packages/docs-v2/.source/source.config.mjs @@ -0,0 +1,85 @@ +// source.config.ts +import { defineConfig, defineDocs } from "fumadocs-mdx/config"; + +// lib/highlight-code.ts +import { LRUCache } from "lru-cache"; +import { codeToHtml } from "shiki"; +var highlightCache = new LRUCache({ + max: 500, + ttl: 1e3 * 60 * 60 + // 1 hour. +}); +var transformers = [ + { + code(node) { + if (node.tagName === "code") { + const raw = this.source; + node.properties["__raw__"] = raw; + if (raw.startsWith("npm install")) { + node.properties["__npm__"] = raw; + node.properties["__yarn__"] = raw.replace("npm install", "yarn add"); + node.properties["__pnpm__"] = raw.replace("npm install", "pnpm add"); + node.properties["__bun__"] = raw.replace("npm install", "bun add"); + } + if (raw.startsWith("npx create-")) { + node.properties["__npm__"] = raw; + node.properties["__yarn__"] = raw.replace( + "npx create-", + "yarn create " + ); + node.properties["__pnpm__"] = raw.replace( + "npx create-", + "pnpm create " + ); + node.properties["__bun__"] = raw.replace("npx", "bunx --bun"); + } + if (raw.startsWith("npm create")) { + node.properties["__npm__"] = raw; + node.properties["__yarn__"] = raw.replace("npm create", "yarn create"); + node.properties["__pnpm__"] = raw.replace("npm create", "pnpm create"); + node.properties["__bun__"] = raw.replace("npm create", "bun create"); + } + if (raw.startsWith("npx")) { + node.properties["__npm__"] = raw; + node.properties["__yarn__"] = raw.replace("npx", "yarn"); + node.properties["__pnpm__"] = raw.replace("npx", "pnpm dlx"); + node.properties["__bun__"] = raw.replace("npx", "bunx --bun"); + } + if (raw.startsWith("npm run")) { + node.properties["__npm__"] = raw; + node.properties["__yarn__"] = raw.replace("npm run", "yarn"); + node.properties["__pnpm__"] = raw.replace("npm run", "pnpm"); + node.properties["__bun__"] = raw.replace("npm run", "bun"); + } + } + } + } +]; + +// source.config.ts +import rehypePrettyCode from "rehype-pretty-code"; +var source_config_default = defineConfig({ + mdxOptions: { + rehypePlugins: (plugins) => { + plugins.shift(); + plugins.push([ + rehypePrettyCode, + { + theme: { + dark: "github-dark", + light: "github-light-default" + }, + transformers + } + ]); + return plugins; + } + } +}); +var docs = defineDocs({ + dir: "content/docs" +}); +export { + source_config_default as default, + docs +}; diff --git a/packages/docs-v2/app/(app)/(root)/page.tsx b/packages/docs-v2/app/(app)/(root)/page.tsx new file mode 100644 index 00000000..1935f731 --- /dev/null +++ b/packages/docs-v2/app/(app)/(root)/page.tsx @@ -0,0 +1,107 @@ +import { + PageActions, + PageHeader, + PageHeaderDescription, + PageHeaderHeading +} from '@/components/page-header'; +import { Button } from '@/components/ui/button'; +import { type Metadata } from 'next'; +import Image from 'next/image'; +import Link from 'next/link'; + +const title = 'reactuse'; + +const description = + 'Improve your react applications with our library 📦 designed for comfort and speed'; + +const cardsData = [ + { + title: 'Lightweight & Scalable', + details: + 'Hooks are lightweight and easy to use, making it simple to integrate into any project.', + icon: <> + }, + { + title: 'Clean & consistent', + details: 'Hooks follow a unified approach for consistency and maintainability.', + icon: <> + }, + { + title: 'Customizable', + details: 'Install and customize hooks effortlessly using our CLI', + icon: <> + }, + { + title: 'Large collection', + details: + 'Extensive collection of hooks for all your needs, from state management to browser APIs.', + icon: <> + }, + { + title: 'Tree shakable', + details: + 'The hooks are tree shakable, so you only import the hooks you need in your application.', + icon: <> + }, + { + title: 'Active community', + details: 'Join our active community on Github and help make reactuse even better.', + icon: <> + } +]; + +export const metadata: Metadata = { + title, + description +}; + +export default function IndexPage() { + return ( +
+ + {title} + {description} + + + + + +
+ {cardsData.map((card) => { + const Icon = card.icon; + return ( +
+
+
+
+

{card.title}

+

{card.details}

+
+ ); + })} +
+
+
Team & Contributors
+
+ +
+ SIBERIA CAN CODE +
SIBERIA CAN CODE
+
+ +
+
+
+
+ ); +} diff --git a/packages/docs-v2/app/(app)/layout.tsx b/packages/docs-v2/app/(app)/layout.tsx new file mode 100644 index 00000000..772b2913 --- /dev/null +++ b/packages/docs-v2/app/(app)/layout.tsx @@ -0,0 +1,13 @@ +import { SiteHeader } from "@/components/site-header" + +export default function AppLayout({ children }: { children: React.ReactNode }) { + return ( +
+ +
{children}
+
+ ) +} diff --git a/packages/docs-v2/app/docs/[[...slug]]/page.tsx b/packages/docs-v2/app/docs/[[...slug]]/page.tsx new file mode 100644 index 00000000..c4dd072c --- /dev/null +++ b/packages/docs-v2/app/docs/[[...slug]]/page.tsx @@ -0,0 +1,151 @@ +import Link from 'next/link'; +import { notFound } from 'next/navigation'; +import { mdxComponents } from '@/mdx-components'; +import { IconArrowLeft, IconArrowRight } from '@tabler/icons-react'; +import { findNeighbour } from 'fumadocs-core/page-tree'; + +import { source } from '@/lib/source'; +import { absoluteUrl } from '@/lib/utils'; +import { Button } from '@/ui/button'; +import { DocsCopyPage } from '@/components/docs-copy-page'; + +export const revalidate = false; +export const dynamic = 'force-static'; +export const dynamicParams = false; + +export function generateStaticParams() { + return source.generateParams(); +} + +export async function generateMetadata(props: { params: Promise<{ slug: string[] }> }) { + const params = await props.params; + const page = source.getPage(params.slug); + + if (!page) { + notFound(); + } + + const doc = page.data; + + if (!doc.title || !doc.description) { + notFound(); + } + + return { + title: doc.title, + description: doc.description, + twitter: { + card: 'summary_large_image', + title: doc.title, + description: doc.description, + images: [ + { + url: `/og?title=${encodeURIComponent( + doc.title + )}&description=${encodeURIComponent(doc.description)}` + } + ] + } + }; +} + +export default async function Page(props: { params: Promise<{ slug: string[] }> }) { + const params = await props.params; + const page = source.getPage(params.slug); + if (!page) { + notFound(); + } + + const doc = page.data; + const MDX = doc.body; + const isChangelog = params.slug?.[0] === 'changelog'; + const neighbours = isChangelog + ? { previous: null, next: null } + : findNeighbour(source.pageTree, page.url); + const raw = await page.data.getText('raw'); + + return ( +
+
+
+
+
+
+
+

+ {doc.title} +

+
+
+ +
+
+ {neighbours.previous && ( + + )} + {neighbours.next && ( + + )} +
+
+
+ {doc.description && ( +

+ {doc.description} +

+ )} +
+
+
+ {/* {params.slug && params.slug[0] === 'components' && params.slug[1] && params.slug[2] && ( + + )} */} + +
+
+ {neighbours.previous && ( + + )} + {neighbours.next && ( + + )} +
+
+
+
+
+
+
+ ); +} diff --git a/packages/docs-v2/app/docs/layout.tsx b/packages/docs-v2/app/docs/layout.tsx new file mode 100644 index 00000000..e614cb8d --- /dev/null +++ b/packages/docs-v2/app/docs/layout.tsx @@ -0,0 +1,33 @@ +// import { DocsLayout } from 'fumadocs-ui/layouts/docs'; +// import type { ReactNode } from 'react'; +// import { source } from '@/lib/source'; + +// export default function Layout({ children }: { children: ReactNode }) { +// return {children}; +// } + +import { source } from '@/lib/source'; +import { DocsSidebar } from '@/components/docs-sidebar'; +import { SidebarProvider } from '@/ui/sidebar'; +import { SiteHeader } from '@/components/site-header'; + +export default function DocsLayout({ children }: { children: React.ReactNode }) { + return ( + <> + +
+ + +
{children}
+
+
+ + ); +} diff --git a/packages/docs-v2/app/layout.tsx b/packages/docs-v2/app/layout.tsx new file mode 100644 index 00000000..0520efa7 --- /dev/null +++ b/packages/docs-v2/app/layout.tsx @@ -0,0 +1,22 @@ +import type { ReactNode } from 'react'; +import { ThemeProvider } from '@/components/theme-provider'; +import { TooltipProvider } from '@/ui/tooltip'; + +import { Geist } from 'next/font/google'; +import { cn } from '@/lib/utils'; + +import '@/styles/global.css'; + +const geist = Geist({ subsets: ['latin'], variable: '--font-sans' }); + +export default function Layout({ children }: { children: ReactNode }) { + return ( + + + + {children} + + + + ); +} diff --git a/packages/docs-v2/components.json b/packages/docs-v2/components.json new file mode 100644 index 00000000..c8563259 --- /dev/null +++ b/packages/docs-v2/components.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": true, + "tsx": true, + "tailwind": { + "css": "app/globals.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "iconLibrary": "lucide" +} diff --git a/packages/docs-v2/components/callout.tsx b/packages/docs-v2/components/callout.tsx new file mode 100644 index 00000000..13c8760b --- /dev/null +++ b/packages/docs-v2/components/callout.tsx @@ -0,0 +1,29 @@ +import { cn } from '@/lib/utils'; +import { Alert, AlertDescription, AlertTitle } from '@/ui/alert'; + +export function Callout({ + title, + children, + icon, + className, + variant = 'default', + ...props +}: React.ComponentProps & { + icon?: React.ReactNode; + variant?: 'default' | 'info' | 'warning'; +}) { + return ( + + {icon} + {title && {title}} + {children} + + ); +} diff --git a/packages/docs-v2/components/code-block-command.tsx b/packages/docs-v2/components/code-block-command.tsx new file mode 100644 index 00000000..1687e3ff --- /dev/null +++ b/packages/docs-v2/components/code-block-command.tsx @@ -0,0 +1,97 @@ +'use client'; + +import * as React from 'react'; +import { IconCheck, IconCopy, IconTerminal } from '@tabler/icons-react'; +import { copyToClipboardWithMeta } from '@/components/copy-button'; +import { Button } from '@/ui/button'; +import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/ui/tabs'; + +export function CodeBlockCommand({ + __npm__, + __yarn__, + __pnpm__, + __bun__ +}: React.ComponentProps<'pre'> & { + __npm__?: string; + __yarn__?: string; + __pnpm__?: string; + __bun__?: string; +}) { + const [hasCopied, setHasCopied] = React.useState(false); + + React.useEffect(() => { + if (hasCopied) { + const timer = setTimeout(() => setHasCopied(false), 2000); + return () => clearTimeout(timer); + } + }, [hasCopied]); + + const packageManager = 'pnpm'; + const tabs = React.useMemo(() => { + return { + pnpm: __pnpm__, + npm: __npm__, + yarn: __yarn__, + bun: __bun__ + }; + }, [__npm__, __pnpm__, __yarn__, __bun__]); + + const copyCommand = React.useCallback(() => { + const command = tabs[packageManager]; + + if (!command) { + return; + } + + copyToClipboardWithMeta(command); + setHasCopied(true); + }, [packageManager, tabs]); + + return ( +
+ +
+
+ +
+ + {Object.entries(tabs).map(([key]) => { + return ( + + {key} + + ); + })} + +
+
+ {Object.entries(tabs).map(([key, value]) => { + return ( + +
+                  
+                    {value}
+                  
+                
+
+ ); + })} +
+
+ +
+ ); +} diff --git a/packages/docs-v2/components/copy-button.tsx b/packages/docs-v2/components/copy-button.tsx new file mode 100644 index 00000000..0494b227 --- /dev/null +++ b/packages/docs-v2/components/copy-button.tsx @@ -0,0 +1,52 @@ +'use client'; + +import * as React from 'react'; +import { IconCheck, IconCopy } from '@tabler/icons-react'; + +import { cn } from '@/lib/utils'; +import { Button } from '@/ui/button'; + +export function copyToClipboardWithMeta(value: string) { + navigator.clipboard.writeText(value); +} + +export function CopyButton({ + value, + className, + variant = 'ghost', + ...props +}: React.ComponentProps & { + value: string; + src?: string; + tooltip?: string; +}) { + const [hasCopied, setHasCopied] = React.useState(false); + + React.useEffect(() => { + if (hasCopied) { + const timer = setTimeout(() => setHasCopied(false), 2000); + return () => clearTimeout(timer); + } + }, [hasCopied]); + + return ( + + ); +} diff --git a/packages/docs-v2/components/docs-copy-page.tsx b/packages/docs-v2/components/docs-copy-page.tsx new file mode 100644 index 00000000..76c5963b --- /dev/null +++ b/packages/docs-v2/components/docs-copy-page.tsx @@ -0,0 +1,158 @@ +'use client'; + +import { IconCheck, IconChevronDown, IconCopy } from '@tabler/icons-react'; + +import { useCopyToClipboard } from '@/hooks/use-copy-to-clipboard'; +import { Button } from '@/ui/button'; +import { Separator } from '@/ui/separator'; + +function getPromptUrl(baseURL: string, url: string) { + return `${baseURL}?q=${encodeURIComponent( + `I’m looking at this shadcn/ui documentation: ${url}. +Help me understand how to use it. Be ready to explain concepts, give examples, or help debug based on it. + ` + )}`; +} + +const menuItems = { + markdown: (url: string) => ( + + + + + View as Markdown + + ), + v0: (url: string) => ( + + + + + Open in v0 + + ), + chatgpt: (url: string) => ( + + + + + Open in ChatGPT + + ), + claude: (url: string) => ( + + + + + Open in Claude + + ), + scira: (url: string) => ( + + + + + + + + + + + Open in Scira + + ) +}; + +export function DocsCopyPage({ page, url }: { page: string; url: string }) { + const { copyToClipboard, isCopied } = useCopyToClipboard(); + + const trigger = ( + + ); + + return ( +
+ + +
+ ); +} diff --git a/packages/docs-v2/components/docs-sidebar.tsx b/packages/docs-v2/components/docs-sidebar.tsx new file mode 100644 index 00000000..98008770 --- /dev/null +++ b/packages/docs-v2/components/docs-sidebar.tsx @@ -0,0 +1,126 @@ +'use client'; + +import Link from 'next/link'; +import { usePathname } from 'next/navigation'; + +import { getCurrentBase, getPagesFromFolder } from '@/lib/page-tree'; +import type { source } from '@/lib/source'; +import { + Sidebar, + SidebarContent, + SidebarGroup, + SidebarGroupContent, + SidebarGroupLabel, + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem +} from '@/ui/sidebar'; + +const TOP_LEVEL_SECTIONS = [ + { name: 'Introduction', href: '/docs' }, + { + name: 'Installation', + href: '/docs/installation' + }, + { + name: 'reactuse.json', + href: '/docs/reactuse-json' + }, + { + name: 'CLI', + href: '/docs/cli' + }, + { + name: 'target', + href: '/docs/target' + }, + { + name: 'memoization', + href: '/docs/memoization' + } +]; + +const EXCLUDED_SECTIONS = ['Introduction']; + +export function DocsSidebar({ + tree, + ...props +}: React.ComponentProps & { tree: typeof source.pageTree }) { + const pathname = usePathname(); + const currentBase = getCurrentBase(pathname); + + return ( + +
+
+
+ + + + Sections + + + + {TOP_LEVEL_SECTIONS.map(({ name, href }) => { + return ( + + + + + {name} + + + + ); + })} + + + + {tree.children.map((item) => { + if (EXCLUDED_SECTIONS.includes((item.name as string) ?? '')) { + return null; + } + + return ( + + + {item.name} + + + {item.type === 'folder' && ( + + {getPagesFromFolder(item, currentBase).map((page) => { + return ( + + + + + {page.name} + + + + ); + })} + + )} + + + ); + })} +
+ + + ); +} diff --git a/packages/docs-v2/components/github-link.tsx b/packages/docs-v2/components/github-link.tsx new file mode 100644 index 00000000..3cd00172 --- /dev/null +++ b/packages/docs-v2/components/github-link.tsx @@ -0,0 +1,34 @@ +import * as React from 'react'; +import Link from 'next/link'; + +import { siteConfig } from '@/lib/config'; +import { Icons } from '@/components/icons'; +import { Button } from '@/ui/button'; +import { Skeleton } from '@/ui/skeleton'; + +export function GitHubLink() { + return ( + + ); +} + +async function StarsCount() { + const data = await fetch('https://api.github.com/repos/siberiacancode/reactuse', { + next: { revalidate: 86400 } + }); + const json = await data.json(); + + const formattedCount = + json.stargazers_count >= 1000 + ? `${Math.round(json.stargazers_count / 1000)}k` + : json.stargazers_count.toLocaleString(); + + return {formattedCount}; +} diff --git a/packages/docs-v2/components/hooks-list.tsx b/packages/docs-v2/components/hooks-list.tsx new file mode 100644 index 00000000..3b7ec9bf --- /dev/null +++ b/packages/docs-v2/components/hooks-list.tsx @@ -0,0 +1,27 @@ +import Link from 'next/link'; + +import { getPagesFromFolder, type PageTreeFolder } from '@/lib/page-tree'; + +export function HooksList({ + componentsFolder, + currentBase +}: { + componentsFolder: PageTreeFolder; + currentBase: string; +}) { + const list = getPagesFromFolder(componentsFolder, currentBase); + + return ( +
+ {list.map((component) => ( + + {component.name} + + ))} +
+ ); +} diff --git a/packages/docs-v2/components/icons.tsx b/packages/docs-v2/components/icons.tsx new file mode 100644 index 00000000..93dd6c75 --- /dev/null +++ b/packages/docs-v2/components/icons.tsx @@ -0,0 +1,217 @@ +import { FileIcon } from 'lucide-react'; + +type IconProps = React.HTMLAttributes; + +export const Icons = { + logo: (props: IconProps) => ( + + + + + + + + + + + + + + + + ), + twitter: (props: IconProps) => ( + + + + ), + gitHub: (props: IconProps) => ( + + + + ), + radix: (props: IconProps) => ( + + + + + + ), + aria: (props: IconProps) => ( + + + + ), + npm: (props: IconProps) => ( + + + + ), + yarn: (props: IconProps) => ( + + + + ), + pnpm: (props: IconProps) => ( + + + + ), + react: (props: IconProps) => ( + + + + ), + tailwind: (props: IconProps) => ( + + + + ), + google: (props: IconProps) => ( + + + + ), + apple: (props: IconProps) => ( + + + + ), + paypal: (props: IconProps) => ( + + + + ), + spinner: (props: IconProps) => ( + + + + ), + json: (props: IconProps) => ( + + + + ), + ts: (props: IconProps) => ( + + + + ), + css: (props: IconProps) => ( + + + + ), + bash: (props: IconProps) => ( + + + + ), + v0: (props: IconProps) => ( + + + + + ) +}; + +export function getIconForLanguageExtension(language: string) { + switch (language) { + case 'json': + return ; + case 'css': + return ; + case 'js': + case 'jsx': + case 'ts': + case 'tsx': + case 'typescript': + return ; + default: + return ; + } +} diff --git a/packages/docs-v2/components/mode-switcher.tsx b/packages/docs-v2/components/mode-switcher.tsx new file mode 100644 index 00000000..fe4f5e65 --- /dev/null +++ b/packages/docs-v2/components/mode-switcher.tsx @@ -0,0 +1,113 @@ +'use client'; + +import * as React from 'react'; +import Script from 'next/script'; +import { useTheme } from 'next-themes'; + +import { Button } from '@/ui/button'; +import { Kbd } from '@/ui/kbd'; +import { Tooltip, TooltipContent, TooltipTrigger } from '@/ui/tooltip'; + +export const DARK_MODE_FORWARD_TYPE = 'dark-mode-forward'; + +export function ModeSwitcher() { + const { setTheme, resolvedTheme } = useTheme(); + + const toggleTheme = React.useCallback(() => { + setTheme(resolvedTheme === 'dark' ? 'light' : 'dark'); + }, [resolvedTheme, setTheme]); + + React.useEffect(() => { + const down = (e: KeyboardEvent) => { + if ((e.key === 'd' || e.key === 'D') && !e.metaKey && !e.ctrlKey && !e.altKey) { + if ( + (e.target instanceof HTMLElement && e.target.isContentEditable) || + e.target instanceof HTMLInputElement || + e.target instanceof HTMLTextAreaElement || + e.target instanceof HTMLSelectElement + ) { + return; + } + + e.preventDefault(); + toggleTheme(); + } + }; + + document.addEventListener('keydown', down); + return () => document.removeEventListener('keydown', down); + }, [toggleTheme]); + + return ( + + + + + + Toggle Mode D + + + ); +} + +export function DarkModeScript() { + return ( +