Skip to content

Commit

Permalink
upgrade deps && docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Nov 7, 2024
1 parent 0390027 commit d943b6a
Show file tree
Hide file tree
Showing 23 changed files with 117 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
<pre><code class="ts"><span class="hl-3">export</span><span class="hl-1"> </span><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-0">ColorSwitch</span><span class="hl-1"> = ({ </span><span class="hl-4">targetId</span><span class="hl-1">, </span><span class="hl-4">skipSystem</span><span class="hl-1">, </span><span class="hl-4">size</span><span class="hl-1">, ...</span><span class="hl-4">props</span><span class="hl-1"> }: </span><span class="hl-8">ColorSwitchProps</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><br/><span class="hl-1"> </span><span class="hl-13">setColorSchemePreference</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">resolvedColorScheme</span><span class="hl-1">: </span><span class="hl-13">rcs</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">colorSchemePreference</span><span class="hl-1">: </span><span class="hl-13">csp</span><span class="hl-1">,</span><br/><span class="hl-1"> } = </span><span class="hl-0">useTheme</span><span class="hl-1">(</span><span class="hl-4">targetId</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-0">toggleColorScheme</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-3">switch</span><span class="hl-1"> (</span><span class="hl-4">csp</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">case</span><span class="hl-1"> </span><span class="hl-2">&quot;dark&quot;</span><span class="hl-1">:</span><br/><span class="hl-1"> </span><span class="hl-0">setColorSchemePreference</span><span class="hl-1">(</span><span class="hl-2">&quot;light&quot;</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-3">break</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-3">case</span><span class="hl-1"> </span><span class="hl-2">&quot;light&quot;</span><span class="hl-1">:</span><br/><span class="hl-1"> </span><span class="hl-0">setColorSchemePreference</span><span class="hl-1">(</span><span class="hl-4">skipSystem</span><span class="hl-1"> ? </span><span class="hl-2">&quot;dark&quot;</span><span class="hl-1"> : </span><span class="hl-2">&quot;system&quot;</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-3">break</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-3">case</span><span class="hl-1"> </span><span class="hl-2">&quot;system&quot;</span><span class="hl-1">:</span><br/><span class="hl-1"> </span><span class="hl-3">default</span><span class="hl-1">:</span><br/><span class="hl-1"> </span><span class="hl-0">setColorSchemePreference</span><span class="hl-1">(</span><span class="hl-2">&quot;dark&quot;</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-3">break</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-3">return</span><span class="hl-1"> (</span><br/><span class="hl-1"> &lt;</span><span class="hl-4">button</span><br/><span class="hl-1"> </span><span class="hl-4">className</span><span class="hl-1">={</span><span class="hl-4">[</span><span class="hl-2">&quot;nthul--color-switch&quot;</span><span class="hl-4">, rcs, csp </span><span class="hl-1">===</span><span class="hl-4"> </span><span class="hl-2">&quot;system&quot;</span><span class="hl-4"> </span><span class="hl-1">?</span><span class="hl-4"> </span><span class="hl-2">&quot;system&quot;</span><span class="hl-4"> </span><span class="hl-1">:</span><span class="hl-4"> </span><span class="hl-2">&quot;&quot;</span><span class="hl-4">].join(&quot; &quot;)}</span><br/><span class="hl-4"> data-testid=&quot;color-switch&quot;</span><br/><span class="hl-4"> {...props}</span><br/><span class="hl-4"> onClick={toggleColorScheme}</span><br/><span class="hl-4"> </span><span class="hl-5">// @ts-expect-error -- setting custom attribute</span><br/><span class="hl-4"> style={{ &quot;--size&quot;:</span><span class="hl-1"> </span><span class="hl-2">`</span><span class="hl-6">${</span><span class="hl-4">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-4">type</span><span class="hl-1">=</span><span class="hl-2">&quot;button&quot;</span><br/><span class="hl-1"> /&gt;</span><br/><span class="hl-1"> );</span><br/><span class="hl-1">};</span>
</code><button type="button">Copy</button></pre>

</div></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="ColorSwitch" class="tsd-anchor"></a><span class="tsd-kind-call-signature">Color<wbr/>Switch</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Element</span><a href="#ColorSwitch" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">__namedParameters</span>: <a href="../interfaces/client_color_switch_color_switch._internal_.ColorSwitchProps.html" class="tsd-signature-type tsd-kind-interface">ColorSwitchProps</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Element</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/react18-tools/nextjs-themes-ultra/blob/13d3dfa6a229945ee2368e87e5a99dcc4a2521b2/lib/src/client/color-switch/color-switch.tsx#L30">client/color-switch/color-switch.tsx:30</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-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"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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="../modules.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></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="ColorSwitch" class="tsd-anchor"></a><span class="tsd-kind-call-signature">Color<wbr/>Switch</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Element</span><a href="#ColorSwitch" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">__namedParameters</span>: <a href="../interfaces/client_color_switch_color_switch._internal_.ColorSwitchProps.html" class="tsd-signature-type tsd-kind-interface">ColorSwitchProps</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Element</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/react18-tools/nextjs-themes-ultra/blob/039002709b98992052d03b9f3b0fce2dfe7dd9a2/lib/src/client/color-switch/color-switch.tsx#L30">client/color-switch/color-switch.tsx:30</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-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"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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="../modules.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 d943b6a

Please sign in to comment.