Skip to content

Commit

Permalink
upgrade deps && docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Jun 10, 2024
1 parent 19ebba6 commit 90c4619
Show file tree
Hide file tree
Showing 24 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion docs/functions/client_core_core.Core.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/functions/client_switch_switch.Switch.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ <h4>Source</h4><ul>
</ul>
<pre><code class="language-typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-0">Switch</span><span class="hl-1"> = ({ </span><span class="hl-5">tag</span><span class="hl-1">: </span><span class="hl-5">Tag</span><span class="hl-1"> = </span><span class="hl-2">&quot;button&quot;</span><span class="hl-1">, </span><span class="hl-5">size</span><span class="hl-1"> = </span><span class="hl-16">24</span><span class="hl-1">, </span><span class="hl-5">skipSystem</span><span class="hl-1">, ...</span><span class="hl-5">props</span><span class="hl-1"> }: </span><span class="hl-8">SwitchProps</span><span class="hl-1">) </span><span class="hl-6">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">const</span><span class="hl-1"> [</span><span class="hl-13">state</span><span class="hl-1">, </span><span class="hl-13">setState</span><span class="hl-1">] = </span><span class="hl-0">useStore</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><br/><span class="hl-1"> </span><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-0">handleModeSwitch</span><span class="hl-1"> = () </span><span class="hl-6">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">let</span><span class="hl-1"> </span><span class="hl-5">index</span><span class="hl-1"> = </span><span class="hl-5">modes</span><span class="hl-1">.</span><span class="hl-0">indexOf</span><span class="hl-1">(</span><span class="hl-5">state</span><span class="hl-1">.</span><span class="hl-5">m</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-13">n</span><span class="hl-1"> = </span><span class="hl-5">modes</span><span class="hl-1">.</span><span class="hl-5">length</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-4">if</span><span class="hl-1"> (</span><span class="hl-5">skipSystem</span><span class="hl-1"> &amp;&amp; </span><span class="hl-5">index</span><span class="hl-1"> === </span><span class="hl-5">n</span><span class="hl-1"> - </span><span class="hl-16">1</span><span class="hl-1">) </span><span class="hl-5">index</span><span class="hl-1"> = </span><span class="hl-16">0</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">setState</span><span class="hl-1">({</span><br/><span class="hl-1"> ...</span><span class="hl-5">state</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">m:</span><span class="hl-1"> </span><span class="hl-5">modes</span><span class="hl-1">[(</span><span class="hl-5">index</span><span class="hl-1"> + </span><span class="hl-16">1</span><span class="hl-1">) % </span><span class="hl-5">n</span><span class="hl-1">],</span><br/><span class="hl-1"> });</span><br/><span class="hl-1"> };</span><br/><span class="hl-1"> </span><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-13">className</span><span class="hl-1"> = [</span><span class="hl-5">props</span><span class="hl-1">.</span><span class="hl-5">className</span><span class="hl-1">, </span><span class="hl-5">styles</span><span class="hl-1">[</span><span class="hl-2">&quot;switch&quot;</span><span class="hl-1">]].</span><span class="hl-0">filter</span><span class="hl-1">(</span><span class="hl-5">Boolean</span><span class="hl-1">).</span><span class="hl-0">join</span><span class="hl-1">(</span><span class="hl-2">&quot; &quot;</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-4">return</span><span class="hl-1"> (</span><br/><span class="hl-1"> &lt;</span><span class="hl-5">Tag</span><br/><span class="hl-1"> {...</span><span class="hl-5">props</span><span class="hl-1">}</span><br/><span class="hl-1"> </span><span class="hl-5">className</span><span class="hl-1">={</span><span class="hl-5">className</span><span class="hl-1">}</span><br/><span class="hl-1"> </span><span class="hl-3">// @ts-expect-error -&gt; we are setting the CSS variable</span><br/><span class="hl-1"> </span><span class="hl-5">style</span><span class="hl-1">={{ </span><span class="hl-2">&quot;--size&quot;</span><span class="hl-1">: </span><span class="hl-2">`</span><span class="hl-6">${</span><span class="hl-5">size</span><span class="hl-6">}</span><span class="hl-2">px`</span><span class="hl-1"> }}</span><br/><span class="hl-1"> </span><span class="hl-5">data</span><span class="hl-1">-</span><span class="hl-5">testid</span><span class="hl-1">=</span><span class="hl-2">&quot;switch&quot;</span><br/><span class="hl-1"> </span><span class="hl-3">// skipcq: JS-0417 -&gt; tradeoff between size and best practices</span><br/><span class="hl-1"> </span><span class="hl-5">onClick</span><span class="hl-1">={</span><span class="hl-5">handleModeSwitch</span><span class="hl-1">}</span><br/><span class="hl-1"> /&gt;</span><br/><span class="hl-1"> );</span><br/><span class="hl-1">}</span>
</code><button>Copy</button></pre>
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/react18-tools/nextjs-darkmode/blob/51b11784cbf0d82bd6851c04b23783addc974d8a/lib/src/client/switch/switch.tsx#L25">client/switch/switch.tsx:25</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>React18 Loaders</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/react18-tools/nextjs-darkmode/blob/19ebba66052a8043e36707d98ed8a3e7be9ce26d/lib/src/client/switch/switch.tsx#L25">client/switch/switch.tsx:25</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>React18 Loaders</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
2 changes: 1 addition & 1 deletion docs/functions/hooks_use_mode.useMode.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ <h4>Source</h4><ul>
</ul>
<pre><code class="language-typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-0">useMode</span><span class="hl-1"> = (): </span><span class="hl-8">UseModeYeild</span><span class="hl-1"> </span><span class="hl-6">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">const</span><span class="hl-1"> [{ </span><span class="hl-5">m</span><span class="hl-1">: </span><span class="hl-13">mode</span><span class="hl-1">, </span><span class="hl-5">s</span><span class="hl-1">: </span><span class="hl-13">systemMode</span><span class="hl-1"> }, </span><span class="hl-13">setState</span><span class="hl-1">] = </span><span class="hl-0">useStore</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><br/><span class="hl-1"> </span><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-0">setMode</span><span class="hl-1"> = (</span><span class="hl-5">m</span><span class="hl-1">: </span><span class="hl-8">ColorSchemePreference</span><span class="hl-1">) </span><span class="hl-6">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">setState</span><span class="hl-1">(</span><span class="hl-5">prev</span><span class="hl-1"> </span><span class="hl-6">=&gt;</span><span class="hl-1"> ({ ...</span><span class="hl-5">prev</span><span class="hl-1">, </span><span class="hl-5">m</span><span class="hl-1"> }));</span><br/><span class="hl-1"> };</span><br/><span class="hl-1"> </span><span class="hl-4">return</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">mode</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">systemMode</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">resolvedMode:</span><span class="hl-1"> (</span><span class="hl-5">mode</span><span class="hl-1"> === </span><span class="hl-13">SYSTEM</span><span class="hl-1"> ? </span><span class="hl-5">systemMode</span><span class="hl-1"> : </span><span class="hl-5">mode</span><span class="hl-1">) </span><span class="hl-4">as</span><span class="hl-1"> </span><span class="hl-8">ResolvedScheme</span><span class="hl-1">, </span><span class="hl-3">// resolvedMode is the actual mode that will be used</span><br/><span class="hl-1"> </span><span class="hl-5">setMode</span><span class="hl-1">,</span><br/><span class="hl-1"> };</span><br/><span class="hl-1">}</span>
</code><button>Copy</button></pre>
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/react18-tools/nextjs-darkmode/blob/51b11784cbf0d82bd6851c04b23783addc974d8a/lib/src/hooks/use-mode.ts#L21">hooks/use-mode.ts:21</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>React18 Loaders</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/react18-tools/nextjs-darkmode/blob/19ebba66052a8043e36707d98ed8a3e7be9ce26d/lib/src/hooks/use-mode.ts#L21">hooks/use-mode.ts:21</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>React18 Loaders</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
Loading

0 comments on commit 90c4619

Please sign in to comment.