From 7568008b4d67645f44b03f02bcd77fe04a516242 Mon Sep 17 00:00:00 2001 From: mayank1513 Date: Tue, 17 Dec 2024 16:20:54 +0000 Subject: [PATCH] upgrade deps && docs --- ...color-switch_color-switch.ColorSwitch.html | 2 +- ...e_force-color-scheme.ForceColorScheme.html | 2 +- ...nt_force-theme_force-theme.ForceTheme.html | 2 +- .../client_switcher_switcher.Switcher.html | 2 +- ...switcher_theme-switcher.ThemeSwitcher.html | 2 +- docs/functions/hooks_use-theme.useTheme.html | 2 +- ...-switch_color-switch.ColorSwitchProps.html | 6 +-- ...her_theme-switcher.ThemeSwitcherProps.html | 14 ++--- .../hooks_use-theme.UseThemeYield.html | 6 +-- docs/types/types.ColorSchemeType.html | 2 +- docs/types/types.ResolvedColorSchemeType.html | 2 +- lib/package.json | 2 +- packages/shared/package.json | 2 +- pnpm-lock.yaml | 51 +++++-------------- 14 files changed, 37 insertions(+), 60 deletions(-) diff --git a/docs/functions/client_color-switch_color-switch.ColorSwitch.html b/docs/functions/client_color-switch_color-switch.ColorSwitch.html index 647edff0..f17962b6 100644 --- a/docs/functions/client_color-switch_color-switch.ColorSwitch.html +++ b/docs/functions/client_color-switch_color-switch.ColorSwitch.html @@ -6,4 +6,4 @@
<ColorSwitch size={20} skipSystem />
 
-
+
diff --git a/docs/functions/client_force-color-scheme_force-color-scheme.ForceColorScheme.html b/docs/functions/client_force-color-scheme_force-color-scheme.ForceColorScheme.html index d18966de..54dff096 100644 --- a/docs/functions/client_force-color-scheme_force-color-scheme.ForceColorScheme.html +++ b/docs/functions/client_force-color-scheme_force-color-scheme.ForceColorScheme.html @@ -1,2 +1,2 @@ ForceColorScheme | Nextjs Themes

Force color scheme on a page

-
+
diff --git a/docs/functions/client_force-theme_force-theme.ForceTheme.html b/docs/functions/client_force-theme_force-theme.ForceTheme.html index 9d7dafe9..bbc82678 100644 --- a/docs/functions/client_force-theme_force-theme.ForceTheme.html +++ b/docs/functions/client_force-theme_force-theme.ForceTheme.html @@ -1,2 +1,2 @@ ForceTheme | Nextjs Themes

Force theme on a page

-
  • Parameters

    • props: { targetSelector?: string; theme: string }

    Returns null

+
diff --git a/docs/functions/client_switcher_switcher.Switcher.html b/docs/functions/client_switcher_switcher.Switcher.html index cbaa5e35..fe525edd 100644 --- a/docs/functions/client_switcher_switcher.Switcher.html +++ b/docs/functions/client_switcher_switcher.Switcher.html @@ -3,4 +3,4 @@
<Switcher targetSelector="#container1" />
 
-
+
diff --git a/docs/functions/client_theme-switcher_theme-switcher.ThemeSwitcher.html b/docs/functions/client_theme-switcher_theme-switcher.ThemeSwitcher.html index 24b361dc..78df9b1d 100644 --- a/docs/functions/client_theme-switcher_theme-switcher.ThemeSwitcher.html +++ b/docs/functions/client_theme-switcher_theme-switcher.ThemeSwitcher.html @@ -3,4 +3,4 @@
<ThemeSwitcher [...props] />
 
-
+
diff --git a/docs/functions/hooks_use-theme.useTheme.html b/docs/functions/hooks_use-theme.useTheme.html index 93798145..594d5bbd 100644 --- a/docs/functions/hooks_use-theme.useTheme.html +++ b/docs/functions/hooks_use-theme.useTheme.html @@ -1,4 +1,4 @@ useTheme | Nextjs Themes
const [] = useTheme(options);
 
-
+
diff --git a/docs/interfaces/client_color-switch_color-switch.ColorSwitchProps.html b/docs/interfaces/client_color-switch_color-switch.ColorSwitchProps.html index 505120aa..ca8fb293 100644 --- a/docs/interfaces/client_color-switch_color-switch.ColorSwitchProps.html +++ b/docs/interfaces/client_color-switch_color-switch.ColorSwitchProps.html @@ -1,6 +1,6 @@ -ColorSwitchProps | Nextjs Themes
interface ColorSwitchProps {
    size?: number;
    skipSystem?: boolean;
    targetSelector?: string;
}

Hierarchy

Properties

size? +ColorSwitchProps | Nextjs Themes
interface ColorSwitchProps {
    size?: number;
    skipSystem?: boolean;
    targetSelector?: string;
}

Hierarchy

Properties

size?: number

Diameter of the color switch

-
skipSystem?: boolean

Skip system colorScheme while toggling

-
targetSelector?: string
+
skipSystem?: boolean

Skip system colorScheme while toggling

+
targetSelector?: string
diff --git a/docs/interfaces/client_theme-switcher_theme-switcher.ThemeSwitcherProps.html b/docs/interfaces/client_theme-switcher_theme-switcher.ThemeSwitcherProps.html index 41d7c276..229acb1d 100644 --- a/docs/interfaces/client_theme-switcher_theme-switcher.ThemeSwitcherProps.html +++ b/docs/interfaces/client_theme-switcher_theme-switcher.ThemeSwitcherProps.html @@ -1,4 +1,4 @@ -ThemeSwitcherProps | Nextjs Themes
interface ThemeSwitcherProps {
    forcedColorScheme?: ColorSchemeType;
    forcedTheme?: string;
    nonce?: string;
    styles?: Record<string, string>;
    targetSelector?: string;
    themeTransition?: string;
}

Properties

forcedColorScheme? +ThemeSwitcherProps | Nextjs Themes
interface ThemeSwitcherProps {
    forcedColorScheme?: ColorSchemeType;
    forcedTheme?: string;
    nonce?: string;
    styles?: Record<string, string>;
    targetSelector?: string;
    themeTransition?: string;
}

Properties

forcedColorScheme?: ColorSchemeType

Forced color scheme for the current page

forcedTheme?: string

Forced theme name for the current page

+
forcedTheme?: string

Forced theme name for the current page

nonce?: string

The nonce value for your Content Security Policy.

-
styles?: Record<string, string>

Provide a styles object imported from CSS/SCSS modules if you are using these modules to define theme and color-scheme classes. +

nonce?: string

The nonce value for your Content Security Policy.

+
styles?: Record<string, string>

Provide a styles object imported from CSS/SCSS modules if you are using these modules to define theme and color-scheme classes. All classes applied to the target are modified using the styles object as follows: if (styles) classes = classes.map(cls => styles[cls] ?? cls);

-
targetSelector?: string

CSS selector for the target element to apply the theme. +

targetSelector?: string

CSS selector for the target element to apply the theme. Use this to specify a different target element than the default (html or documentElement). This is particularly useful for controlling the theme of different parts of the page independently.

-
themeTransition?: string

The transition property to enforce on all elements, preventing unwanted transitions during theme changes.

+
themeTransition?: string

The transition property to enforce on all elements, preventing unwanted transitions during theme changes.

'background .3s'
 
'none'
 
-
+
diff --git a/docs/interfaces/hooks_use-theme.UseThemeYield.html b/docs/interfaces/hooks_use-theme.UseThemeYield.html index e17e1db7..2a91d7b2 100644 --- a/docs/interfaces/hooks_use-theme.UseThemeYield.html +++ b/docs/interfaces/hooks_use-theme.UseThemeYield.html @@ -1,4 +1,4 @@ -UseThemeYield | Nextjs Themes
interface UseThemeYield {
    colorSchemePref: ColorSchemeType;
    darkTheme: string;
    lightTheme: string;
    resolvedColorScheme: ResolvedColorSchemeType;
    resolvedTheme: string;
    setColorSchemePref: (colorSchemePref: ColorSchemeType) => void;
    setDarkTheme: (darkTheme: string) => void;
    setForcedColorScheme: (forcedColorScheme: ColorSchemeType) => void;
    setForcedTheme: (forcedTheme: string) => void;
    setLightTheme: (lightTheme: string) => void;
    setTheme: (theme: string) => void;
    setThemeSet: (themeSet: { darkTheme: string; lightTheme: string }) => void;
    systemColorScheme: ResolvedColorSchemeType;
    theme: string;
    toggleColorScheme: (skipSystem?: boolean) => void;
}

Properties

colorSchemePref +UseThemeYield | Nextjs Themes
interface UseThemeYield {
    colorSchemePref: ColorSchemeType;
    darkTheme: string;
    lightTheme: string;
    resolvedColorScheme: ResolvedColorSchemeType;
    resolvedTheme: string;
    setColorSchemePref: (colorSchemePref: ColorSchemeType) => void;
    setDarkTheme: (darkTheme: string) => void;
    setForcedColorScheme: (forcedColorScheme: ColorSchemeType) => void;
    setForcedTheme: (forcedTheme: string) => void;
    setLightTheme: (lightTheme: string) => void;
    setTheme: (theme: string) => void;
    setThemeSet: (themeSet: { darkTheme: string; lightTheme: string }) => void;
    systemColorScheme: ResolvedColorSchemeType;
    theme: string;
    toggleColorScheme: (skipSystem?: boolean) => void;
}

Properties

colorSchemePref: ColorSchemeType
darkTheme: string
lightTheme: string
resolvedColorScheme: ResolvedColorSchemeType
resolvedTheme: string
setColorSchemePref: (colorSchemePref: ColorSchemeType) => void
setDarkTheme: (darkTheme: string) => void
setForcedColorScheme: (forcedColorScheme: ColorSchemeType) => void
setForcedTheme: (forcedTheme: string) => void
setLightTheme: (lightTheme: string) => void
setTheme: (theme: string) => void

actions

-
setThemeSet: (themeSet: { darkTheme: string; lightTheme: string }) => void
systemColorScheme: ResolvedColorSchemeType
theme: string
toggleColorScheme: (skipSystem?: boolean) => void
+

Properties

colorSchemePref: ColorSchemeType
darkTheme: string
lightTheme: string
resolvedColorScheme: ResolvedColorSchemeType
resolvedTheme: string
setColorSchemePref: (colorSchemePref: ColorSchemeType) => void
setDarkTheme: (darkTheme: string) => void
setForcedColorScheme: (forcedColorScheme: ColorSchemeType) => void
setForcedTheme: (forcedTheme: string) => void
setLightTheme: (lightTheme: string) => void
setTheme: (theme: string) => void

actions

+
setThemeSet: (themeSet: { darkTheme: string; lightTheme: string }) => void
systemColorScheme: ResolvedColorSchemeType
theme: string
toggleColorScheme: (skipSystem?: boolean) => void
diff --git a/docs/types/types.ColorSchemeType.html b/docs/types/types.ColorSchemeType.html index 4c6fa3e0..86dfae84 100644 --- a/docs/types/types.ColorSchemeType.html +++ b/docs/types/types.ColorSchemeType.html @@ -1,2 +1,2 @@ ColorSchemeType | Nextjs Themes

Type Alias ColorSchemeType

ColorSchemeType: "" | "system" | "dark" | "light"

Types to be exposed to users

-
+
diff --git a/docs/types/types.ResolvedColorSchemeType.html b/docs/types/types.ResolvedColorSchemeType.html index 192e8c97..fb9c9055 100644 --- a/docs/types/types.ResolvedColorSchemeType.html +++ b/docs/types/types.ResolvedColorSchemeType.html @@ -1 +1 @@ -ResolvedColorSchemeType | Nextjs Themes

Type Alias ResolvedColorSchemeType

ResolvedColorSchemeType: "dark" | "light"
+ResolvedColorSchemeType | Nextjs Themes

Type Alias ResolvedColorSchemeType

ResolvedColorSchemeType: "dark" | "light"
diff --git a/lib/package.json b/lib/package.json index 93e26e57..87697cc3 100644 --- a/lib/package.json +++ b/lib/package.json @@ -134,7 +134,7 @@ "vitest": "^2.1.8" }, "dependencies": { - "r18gs": "2.0.1" + "r18gs": "2.1.0" }, "peerDependencies": { "@types/react": "16.8 - 19", diff --git a/packages/shared/package.json b/packages/shared/package.json index 5a79a4b4..4e340171 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -41,7 +41,7 @@ "@repo/scripts": "workspace:*", "nextjs-darkmode": "^1.0.7", "nextjs-themes": "workspace:*", - "r18gs": "^2.0.1", + "r18gs": "^2.1.0", "react-live": "^4.1.8", "react18-loaders": "^1.1.4" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 531868ab..78ebce5a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -65,7 +65,7 @@ importers: version: 15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0) nextjs-darkmode: specifier: ^1.0.7 - version: 1.0.7(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) + version: 1.0.7(@types/react@19.0.1)(react@19.0.0) nextjs-themes: specifier: workspace:* version: link:../../lib @@ -209,7 +209,7 @@ importers: version: 15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0) nextjs-darkmode: specifier: ^1.0.7 - version: 1.0.7(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) + version: 1.0.7(@types/react@19.0.1)(react@19.0.0) nextjs-themes: specifier: workspace:* version: link:../../lib @@ -291,8 +291,8 @@ importers: specifier: 10 - 15 version: 14.2.15(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0) r18gs: - specifier: 2.0.1 - version: 2.0.1(@types/react@19.0.1)(next@14.2.15(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) + specifier: 2.1.0 + version: 2.1.0(@types/react@19.0.1)(react@19.0.0) devDependencies: '@repo/eslint-config': specifier: workspace:* @@ -382,13 +382,13 @@ importers: version: 14.2.15(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0) nextjs-darkmode: specifier: ^1.0.7 - version: 1.0.7(@types/react@19.0.1)(next@14.2.15(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) + version: 1.0.7(@types/react@19.0.1)(react@19.0.0) nextjs-themes: specifier: workspace:* version: link:../../lib r18gs: - specifier: ^2.0.1 - version: 2.0.1(@types/react@19.0.1)(next@14.2.15(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) + specifier: ^2.1.0 + version: 2.1.0(@types/react@19.0.1)(react@19.0.0) react-live: specifier: ^4.1.8 version: 4.1.8(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -4146,15 +4146,11 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - r18gs@2.0.1: - resolution: {integrity: sha512-0J7r+jr5DCoSD2Aero5mx30BT/7z1QDEVBANlwwnuew0NiecKQOjWyPwF0R7ZbQU6qb5hcWPPSPmHykpAnN2xA==} + r18gs@2.1.0: + resolution: {integrity: sha512-OYUmx+QW8I1uy40+VFXsLhSOTlMPPlV2NsJppeYD+8VM6jYiFQOsgsdlPnuD9ocpQwi6hT4rr6+BM6AILh86+Q==} peerDependencies: '@types/react': 16.8 - 19 - next: '*' react: 16.8 - 19 - peerDependenciesMeta: - next: - optional: true react-dom@19.0.0: resolution: {integrity: sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==} @@ -8881,21 +8877,11 @@ snapshots: - '@babel/core' - babel-plugin-macros - nextjs-darkmode@1.0.7(@types/react@19.0.1)(next@14.2.15(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0): + nextjs-darkmode@1.0.7(@types/react@19.0.1)(react@19.0.0): dependencies: '@types/react': 19.0.1 - r18gs: 2.0.1(@types/react@19.0.1)(next@14.2.15(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) + r18gs: 2.1.0(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 - transitivePeerDependencies: - - next - - nextjs-darkmode@1.0.7(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0): - dependencies: - '@types/react': 19.0.1 - r18gs: 2.0.1(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) - react: 19.0.0 - transitivePeerDependencies: - - next no-case@3.0.4: dependencies: @@ -9355,19 +9341,10 @@ snapshots: queue-microtask@1.2.3: {} - r18gs@2.0.1(@types/react@19.0.1)(next@14.2.15(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0): + r18gs@2.1.0(@types/react@19.0.1)(react@19.0.0): dependencies: '@types/react': 19.0.1 react: 19.0.0 - optionalDependencies: - next: 14.2.15(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0) - - r18gs@2.0.1(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0): - dependencies: - '@types/react': 19.0.1 - react: 19.0.0 - optionalDependencies: - next: 15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0) react-dom@19.0.0(react@19.0.0): dependencies: @@ -9412,7 +9389,7 @@ snapshots: react18-loaders@1.1.4(@types/react@19.0.1)(next@14.2.15(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0): dependencies: '@types/react': 19.0.1 - r18gs: 2.0.1(@types/react@19.0.1)(next@14.2.15(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) + r18gs: 2.1.0(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 optionalDependencies: next: 14.2.15(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0) @@ -9420,7 +9397,7 @@ snapshots: react18-loaders@1.1.4(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0): dependencies: '@types/react': 19.0.1 - r18gs: 2.0.1(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) + r18gs: 2.1.0(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 optionalDependencies: next: 15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0)