Skip to content

Commit b9c1839

Browse files
committed
upgrade deps && docs
1 parent a43f1db commit b9c1839

25 files changed

+34
-34
lines changed

docs/functions/client_core_core.Core.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/functions/client_switch_switch.Switch.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ <h4>Source</h4><ul>
66
</ul>
77
<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><br/><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><br/><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><br/><span class="hl-1"> </span><span class="hl-5">skipSystem</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">children</span><span class="hl-1">,</span><br/><span class="hl-1"> ...</span><span class="hl-5">props</span><br/><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-4">if</span><span class="hl-1"> (</span><span class="hl-5">children</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"> </span><span class="hl-3">// @ts-expect-error -- too complex types</span><br/><span class="hl-1"> &lt;</span><span class="hl-5">Tag</span><br/><span class="hl-1"> </span><span class="hl-5">suppressHydrationWarning</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">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</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">}&gt;</span><br/><span class="hl-1"> {</span><span class="hl-3">/* @ts-expect-error -&gt; we are setting the CSS variable */</span><span class="hl-1">}</span><br/><span class="hl-1"> &lt;</span><span class="hl-5">div</span><span class="hl-1"> </span><span class="hl-5">className</span><span class="hl-1">={styles.</span><span class="hl-5">switch</span><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"> }} /&gt;</span><br/><span class="hl-1"> {</span><span class="hl-5">children</span><span class="hl-1">}</span><br/><span class="hl-1"> &lt;/</span><span class="hl-5">Tag</span><span class="hl-1">&gt;</span><br/><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"> &lt;</span><span class="hl-5">Tag</span><br/><span class="hl-1"> </span><span class="hl-3">// Hydration warning is caused when the data from localStorage differs from the default data provided while rendering on server</span><br/><span class="hl-1"> </span><span class="hl-5">suppressHydrationWarning</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">[props.className, styles.switch].join(&quot; &quot;)}</span><br/><span class="hl-5"> </span><span class="hl-3">// @ts-expect-error -&gt; we are setting the CSS variable</span><br/><span class="hl-5"> style={{ &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>
88
</code><button>Copy</button></pre>
9-
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/react18-tools/nextjs-darkmode/blob/ba67ca2cf294f1e37a5919c5f8131af8d3935848/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>
9+
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/react18-tools/nextjs-darkmode/blob/a43f1db8aea633a314e1217d963979c9a7795b62/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>

0 commit comments

Comments
 (0)