@chakra-ui/c-color-mode
Advanced tools
Comparing version 0.1.0-alpha.3 to 0.1.0-alpha.5
@@ -31,4 +31,4 @@ "use strict"; | ||
* | ||
* @param light the light mode value | ||
* @param dark the dark mode value | ||
* @param lightValue the light mode value | ||
* @param darkValue the dark mode value | ||
* | ||
@@ -45,3 +45,3 @@ * @example | ||
function useColorModeValue(light, dark) { | ||
function useColorModeValue(lightValue, darkValue) { | ||
var _useColorMode = useColorMode(), | ||
@@ -52,3 +52,3 @@ colorMode = _useColorMode.colorMode; | ||
(0, _vue.watchEffect)(function () { | ||
modeValue.value = colorMode.value === 'dark' ? dark : light; | ||
modeValue.value = colorMode.value === 'dark' ? darkValue : lightValue; | ||
}); | ||
@@ -55,0 +55,0 @@ return modeValue; |
@@ -25,4 +25,4 @@ import { inject, isRef, ref, watchEffect } from 'vue'; | ||
* | ||
* @param light the light mode value | ||
* @param dark the dark mode value | ||
* @param lightValue the light mode value | ||
* @param darkValue the dark mode value | ||
* | ||
@@ -36,3 +36,3 @@ * @example | ||
export function useColorModeValue(light, dark) { | ||
export function useColorModeValue(lightValue, darkValue) { | ||
var { | ||
@@ -43,3 +43,3 @@ colorMode | ||
watchEffect(() => { | ||
modeValue.value = colorMode.value === 'dark' ? dark : light; | ||
modeValue.value = colorMode.value === 'dark' ? darkValue : lightValue; | ||
}); | ||
@@ -46,0 +46,0 @@ return modeValue; |
@@ -1,9 +0,9 @@ | ||
import { ColorMode } from './color-mode.utils'; | ||
export type { ColorMode }; | ||
import { ColorModeRef } from './color-mode.utils'; | ||
export type { ColorModeRef }; | ||
export interface ColorModeOptions { | ||
initialColorMode?: ColorMode; | ||
initialColorMode?: ColorModeRef; | ||
useSystemColorMode?: boolean; | ||
} | ||
export declare type ColorModeContext = { | ||
colorMode: ColorMode; | ||
colorMode: ColorModeRef; | ||
toggleColorMode: () => void; | ||
@@ -16,4 +16,4 @@ }; | ||
* | ||
* @param light the light mode value | ||
* @param dark the dark mode value | ||
* @param lightValue the light mode value | ||
* @param darkValue the dark mode value | ||
* | ||
@@ -26,2 +26,2 @@ * @example | ||
*/ | ||
export declare function useColorModeValue<TLight = unknown, TDark = unknown>(light: TLight, dark: TDark): import("vue").Ref<any>; | ||
export declare function useColorModeValue<TLight = unknown, TDark = unknown>(lightValue: TLight, darkValue: TDark): import("vue").Ref<any>; |
import { Ref } from 'vue'; | ||
export declare type ColorMode = Ref<'light' | 'dark'>; | ||
export declare type ColorModeRef = Ref<'light' | 'dark'>; | ||
/** | ||
@@ -13,3 +13,3 @@ * Function to add/remove class from `body` based on color mode | ||
export declare const darkQuery: string; | ||
export declare function getColorScheme(fallback?: ColorMode): "light" | "dark"; | ||
export declare function getColorScheme(fallback?: ColorModeRef): "light" | "dark"; | ||
/** | ||
@@ -22,3 +22,3 @@ * Adds system os color mode listener, and run the callback | ||
get: () => "light" | "dark"; | ||
set: (mode: ColorMode) => void; | ||
set: (mode: ColorModeRef) => void; | ||
}; |
@@ -1,7 +0,7 @@ | ||
import { ColorMode } from './color-mode.utils'; | ||
import { ColorModeRef } from './color-mode.utils'; | ||
export declare const storageKey = "chakra-ui-color-mode"; | ||
declare type MaybeColorMode = ColorMode['value'] | undefined; | ||
declare type MaybeColorMode = ColorModeRef['value'] | undefined; | ||
export interface StorageManager { | ||
get(init?: ColorMode['value']): MaybeColorMode; | ||
set(value: ColorMode['value']): void; | ||
get(init?: ColorModeRef['value']): MaybeColorMode; | ||
set(value: ColorModeRef['value']): void; | ||
type: 'cookie' | 'localStorage'; | ||
@@ -8,0 +8,0 @@ } |
{ | ||
"name": "@chakra-ui/c-color-mode", | ||
"version": "0.1.0-alpha.3", | ||
"version": "0.1.0-alpha.5", | ||
"main": "dist/cjs/index.js", | ||
@@ -42,4 +42,4 @@ "module": "dist/esm/index.js", | ||
"devDependencies": { | ||
"vue": "^3.0.11" | ||
"vue": "^3.1.4" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35427
21
1