From 37f34672b3b3a1010c4cc402bf707a43a421f4e9 Mon Sep 17 00:00:00 2001 From: mayank1513 Date: Sun, 22 Dec 2024 08:10:50 +0000 Subject: [PATCH] upgrade deps && docs --- docs/functions/client_core_core.Core.html | 2 +- docs/functions/client_core_no-fouc.noFOUCScript.html | 2 +- docs/functions/client_switch_switch.Switch.html | 2 +- docs/functions/hooks_use-mode.useMode.html | 2 +- docs/functions/utils.useStore.html | 2 +- docs/interfaces/client_core_core.CoreProps.html | 8 ++++---- docs/interfaces/client_switch_switch.SwitchProps.html | 8 ++++---- docs/interfaces/hooks_use-mode.UseModeYeild.html | 4 ++-- docs/interfaces/utils.Store.html | 4 ++-- docs/types/utils.ColorSchemePreference.html | 2 +- docs/types/utils.ResolvedScheme.html | 2 +- docs/variables/constants.DARK.html | 2 +- docs/variables/constants.LIGHT.html | 2 +- docs/variables/constants.SYSTEM.html | 2 +- docs/variables/constants.modes.html | 2 +- 15 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/functions/client_core_core.Core.html b/docs/functions/client_core_core.Core.html index 94f8dc6d..9e961a86 100644 --- a/docs/functions/client_core_core.Core.html +++ b/docs/functions/client_core_core.Core.html @@ -9,4 +9,4 @@
export const Core = ({ t = "none", nonce = "", k = "o" }: CoreProps) => {
const isWindowDefined = typeof window != "undefined";
// handle client side exceptions when script is not run. <- for client side apps like vite or CRA
if (isWindowDefined && !window.q) noFOUCScript(k, t, nonce);

const [{ m, s }, setThemeState] = useStore();

if (!updateDOM && isWindowDefined) {
// store global functions to local variables to avoid any interference
[media, updateDOM] = [q, u];
/** Updating media: prefers-color-scheme*/
media.addEventListener("change", () =>
setThemeState(state => ({ ...state, s: media.matches ? DARK : LIGHT })),
);
/** Sync the tabs */
addEventListener("storage", (e: StorageEvent): void => {
e.key === k && setThemeState(state => ({ ...state, m: e.newValue as ColorSchemePreference }));
});
}
updateDOM?.(m, s);

return <Script {...{ n: nonce, k, t }} />;
};
-
+
diff --git a/docs/functions/client_core_no-fouc.noFOUCScript.html b/docs/functions/client_core_no-fouc.noFOUCScript.html index fd58e2ec..9be520e6 100644 --- a/docs/functions/client_core_no-fouc.noFOUCScript.html +++ b/docs/functions/client_core_no-fouc.noFOUCScript.html @@ -1,2 +1,2 @@ noFOUCScript | React18 Loaders

function to be injected in script tag for avoiding FOUC

-
  • Parameters

    • storageKey: string
    • themeTransition: string
    • nonce: string

    Returns void

+
diff --git a/docs/functions/client_switch_switch.Switch.html b/docs/functions/client_switch_switch.Switch.html index 23117246..d753a5d6 100644 --- a/docs/functions/client_switch_switch.Switch.html +++ b/docs/functions/client_switch_switch.Switch.html @@ -8,4 +8,4 @@
export const Switch = ({
tag: Tag = "button",
size = 24,
skipSystem,
children,
...tagProps
}: SwitchProps) => {
const [{ m, s }, setState] = useStore();
const n = modes.length - (skipSystem ? 1 : 0);
/** toggle mode */
tagProps.onClick = () =>
setState({
s,
m: modes[(modes.indexOf(m) + 1) % n],
});

const className = styles.switch;
const style = { "--size": `${size}px` };

if (!children) {
tagProps.className += " " + className;
tagProps.style = { ...tagProps.style, ...style };
}

return (
// @ts-expect-error -- too complex types
<Tag suppressHydrationWarning {...tagProps} data-testid="switch">
{/* @ts-expect-error -> we are setting the CSS variable */}
{children && <div {...{ className, style }} />}
{children}
</Tag>
);
};
-
+
diff --git a/docs/functions/hooks_use-mode.useMode.html b/docs/functions/hooks_use-mode.useMode.html index 3c1c6efb..d55f078d 100644 --- a/docs/functions/hooks_use-mode.useMode.html +++ b/docs/functions/hooks_use-mode.useMode.html @@ -8,4 +8,4 @@
export const useMode = (): UseModeYeild => {
const [{ m, s }, setState] = useStore();
/** Set user preference */
return {
mode: m,
systemMode: s,
resolvedMode: (m === SYSTEM ? s : m) as ResolvedScheme,
setMode: (m: ColorSchemePreference) => setState({ s, m }),
};
};
-
+
diff --git a/docs/functions/utils.useStore.html b/docs/functions/utils.useStore.html index 806d4c29..d38e5aa8 100644 --- a/docs/functions/utils.useStore.html +++ b/docs/functions/utils.useStore.html @@ -1,2 +1,2 @@ useStore | React18 Loaders

local abstaction of RGS to avoid multiple imports

-
+
diff --git a/docs/interfaces/client_core_core.CoreProps.html b/docs/interfaces/client_core_core.CoreProps.html index 14adcb9d..2d0e5948 100644 --- a/docs/interfaces/client_core_core.CoreProps.html +++ b/docs/interfaces/client_core_core.CoreProps.html @@ -1,16 +1,16 @@ -CoreProps | React18 Loaders
interface CoreProps {
    k?: string;
    nonce?: string;
    t?: string;
}

Properties

k? +CoreProps | React18 Loaders
interface CoreProps {
    k?: string;
    nonce?: string;
    t?: string;
}

Properties

Properties

k?: string

storageKey

'o'
 
-
nonce?: string

The nonce value for your Content Security Policy.

+
nonce?: string

The nonce value for your Content Security Policy.

''
 
-
t?: string

themeTransition: force apply CSS transition property to all the elements during theme switching. E.g., all .3s

+
t?: string

themeTransition: force apply CSS transition property to all the elements during theme switching. E.g., all .3s

'none'
 
-
+
diff --git a/docs/interfaces/client_switch_switch.SwitchProps.html b/docs/interfaces/client_switch_switch.SwitchProps.html index 40c5719f..f72e25b3 100644 --- a/docs/interfaces/client_switch_switch.SwitchProps.html +++ b/docs/interfaces/client_switch_switch.SwitchProps.html @@ -1,10 +1,10 @@ -SwitchProps | React18 Loaders
interface SwitchProps {
    size?: number;
    skipSystem?: boolean;
    tag?: "button" | "div";
}

Hierarchy

Properties

size? +SwitchProps | React18 Loaders
interface SwitchProps {
    size?: number;
    skipSystem?: boolean;
    tag?: "button" | "div";
}

Hierarchy

Properties

size?: number

Diameter of the color switch

-
skipSystem?: boolean

Skip system colorScheme while toggling

-
tag?: "button" | "div"

html tag

+
skipSystem?: boolean

Skip system colorScheme while toggling

+
tag?: "button" | "div"

html tag

'button'
 
-
+
diff --git a/docs/interfaces/hooks_use-mode.UseModeYeild.html b/docs/interfaces/hooks_use-mode.UseModeYeild.html index d4b8050d..1797a9e0 100644 --- a/docs/interfaces/hooks_use-mode.UseModeYeild.html +++ b/docs/interfaces/hooks_use-mode.UseModeYeild.html @@ -1,5 +1,5 @@ -UseModeYeild | React18 Loaders
interface UseModeYeild {
    mode: ColorSchemePreference;
    resolvedMode: ResolvedScheme;
    setMode: (mode: ColorSchemePreference) => void;
    systemMode: ResolvedScheme;
}

Properties

mode +UseModeYeild | React18 Loaders
interface UseModeYeild {
    mode: ColorSchemePreference;
    resolvedMode: ResolvedScheme;
    setMode: (mode: ColorSchemePreference) => void;
    systemMode: ResolvedScheme;
}

Properties

resolvedMode: ResolvedScheme
setMode: (mode: ColorSchemePreference) => void
systemMode: ResolvedScheme
+

Properties

resolvedMode: ResolvedScheme
setMode: (mode: ColorSchemePreference) => void
systemMode: ResolvedScheme
diff --git a/docs/interfaces/utils.Store.html b/docs/interfaces/utils.Store.html index a88e24e9..6aafa382 100644 --- a/docs/interfaces/utils.Store.html +++ b/docs/interfaces/utils.Store.html @@ -1,3 +1,3 @@ -Store | React18 Loaders
interface Store {
    m: ColorSchemePreference;
    s: ResolvedScheme;
}

Properties

m +Store | React18 Loaders
interface Store {
    m: ColorSchemePreference;
    s: ResolvedScheme;
}

Properties

m s -

Properties

+

Properties

diff --git a/docs/types/utils.ColorSchemePreference.html b/docs/types/utils.ColorSchemePreference.html index 531933a7..a598be9b 100644 --- a/docs/types/utils.ColorSchemePreference.html +++ b/docs/types/utils.ColorSchemePreference.html @@ -1 +1 @@ -ColorSchemePreference | React18 Loaders

Type Alias ColorSchemePreference

ColorSchemePreference: "system" | "dark" | ""
+ColorSchemePreference | React18 Loaders

Type Alias ColorSchemePreference

ColorSchemePreference: "system" | "dark" | ""
diff --git a/docs/types/utils.ResolvedScheme.html b/docs/types/utils.ResolvedScheme.html index 32c3f01c..11d00964 100644 --- a/docs/types/utils.ResolvedScheme.html +++ b/docs/types/utils.ResolvedScheme.html @@ -1 +1 @@ -ResolvedScheme | React18 Loaders

Type Alias ResolvedScheme

ResolvedScheme: "dark" | ""
+ResolvedScheme | React18 Loaders

Type Alias ResolvedScheme

ResolvedScheme: "dark" | ""
diff --git a/docs/variables/constants.DARK.html b/docs/variables/constants.DARK.html index d0c25591..5f8c4413 100644 --- a/docs/variables/constants.DARK.html +++ b/docs/variables/constants.DARK.html @@ -1 +1 @@ -DARK | React18 Loaders
DARK: ResolvedScheme = "dark"
+DARK | React18 Loaders
DARK: ResolvedScheme = "dark"
diff --git a/docs/variables/constants.LIGHT.html b/docs/variables/constants.LIGHT.html index 11e35c95..eb8ab873 100644 --- a/docs/variables/constants.LIGHT.html +++ b/docs/variables/constants.LIGHT.html @@ -1 +1 @@ -LIGHT | React18 Loaders
LIGHT: ResolvedScheme = ""
+LIGHT | React18 Loaders
LIGHT: ResolvedScheme = ""
diff --git a/docs/variables/constants.SYSTEM.html b/docs/variables/constants.SYSTEM.html index 8f364054..60a05453 100644 --- a/docs/variables/constants.SYSTEM.html +++ b/docs/variables/constants.SYSTEM.html @@ -1 +1 @@ -SYSTEM | React18 Loaders

Variable SYSTEMConst

SYSTEM: ColorSchemePreference = "system"
+SYSTEM | React18 Loaders

Variable SYSTEMConst

SYSTEM: ColorSchemePreference = "system"
diff --git a/docs/variables/constants.modes.html b/docs/variables/constants.modes.html index aa37f6bd..da47609e 100644 --- a/docs/variables/constants.modes.html +++ b/docs/variables/constants.modes.html @@ -1 +1 @@ -modes | React18 Loaders
modes: ColorSchemePreference[] = ...
+modes | React18 Loaders
modes: ColorSchemePreference[] = ...