From 04e7405c3121a63f90d6be827d0aae3643be7890 Mon Sep 17 00:00:00 2001 From: mayank1513 Date: Mon, 16 Dec 2024 16:12:28 +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 61736300..dcefefc3 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, nonce, k = "o" }: CoreProps) => {
// handle client side exceptions when script is not run. <- for client side apps like vite or CRA
if (typeof window !== "undefined" && !window.m) noFOUCScript(k);

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

useEffect(() => {
// store global functions to local variables to avoid any interference
[media, updateDOM] = [m, 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 }));
});
}, []);

useEffect(() => {
const restoreTransitions = modifyTransition(t, nonce);
updateDOM(mode, systemMode);
restoreTransitions();
}, [systemMode, mode, t, nonce]);

return <Script {...{ n: nonce, k }} />;
};
-
+
diff --git a/docs/functions/client_core_no-fouc.noFOUCScript.html b/docs/functions/client_core_no-fouc.noFOUCScript.html index 190df6ee..a812e9c8 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

-
+
diff --git a/docs/functions/client_switch_switch.Switch.html b/docs/functions/client_switch_switch.Switch.html index 302e30ba..a1d93a70 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 24fddafd..4c33abe2 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 037cf2b1..2c0a9805 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 d78d2318..7980a7c7 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 fc9d2b16..8fc9d721 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 9f91fb06..d2484e6c 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 f9014ab9..963d8886 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 f60a0512..5b95ea14 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 a106cb28..10c10188 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 6120653f..f639a583 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 a91f2cde..3d0244f2 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 18660dfa..d615879e 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 5e9a8f4f..89d4d664 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[] = ...