@yamada-ui/use-token
Advanced tools
Comparing version 1.1.27-next-20241005235555 to 1.1.27-next-20241008193728
import { Theme, StyledTheme, ColorMode } from '@yamada-ui/core'; | ||
type OmittedTheme = Omit<Theme, "components" | "colorSchemes" | "themeSchemes">; | ||
type OmittedTheme = Omit<Theme, "colorSchemes" | "components" | "themeSchemes">; | ||
/** | ||
@@ -9,5 +9,5 @@ * `useToken` is a custom hook for retrieving tokens from the theme. | ||
*/ | ||
declare const useToken: <Y extends string | number = string, M extends keyof OmittedTheme = "animations" | "blurs" | "borders" | "breakpoints" | "colors" | "fonts" | "fontSizes" | "fontWeights" | "gradients" | "layerStyles" | "letterSpacings" | "lineHeights" | "radii" | "shadows" | "sizes" | "spaces" | "textStyles" | "transitionDuration" | "transitionEasing" | "transitionProperty" | "zIndices">(name: M, path: Theme[M] | number | undefined) => Y | undefined; | ||
declare const getToken: <Y extends string | number = string, M extends keyof OmittedTheme = "animations" | "blurs" | "borders" | "breakpoints" | "colors" | "fonts" | "fontSizes" | "fontWeights" | "gradients" | "layerStyles" | "letterSpacings" | "lineHeights" | "radii" | "shadows" | "sizes" | "spaces" | "textStyles" | "transitionDuration" | "transitionEasing" | "transitionProperty" | "zIndices">(name: M, path: Theme[M] | number | undefined) => (theme: StyledTheme, colorMode: ColorMode) => Y | undefined; | ||
declare const useToken: <Y extends number | string = string, M extends keyof OmittedTheme = "animations" | "blurs" | "borders" | "breakpoints" | "colors" | "fonts" | "fontSizes" | "fontWeights" | "gradients" | "layerStyles" | "letterSpacings" | "lineHeights" | "radii" | "shadows" | "sizes" | "spaces" | "textStyles" | "transitionDuration" | "transitionEasing" | "transitionProperty" | "zIndices">(name: M, path: number | Theme[M] | undefined) => Y | undefined; | ||
declare const getToken: <Y extends number | string = string, M extends keyof OmittedTheme = "animations" | "blurs" | "borders" | "breakpoints" | "colors" | "fonts" | "fontSizes" | "fontWeights" | "gradients" | "layerStyles" | "letterSpacings" | "lineHeights" | "radii" | "shadows" | "sizes" | "spaces" | "textStyles" | "transitionDuration" | "transitionEasing" | "transitionProperty" | "zIndices">(name: M, path: number | Theme[M] | undefined) => (theme: StyledTheme, colorMode: ColorMode) => Y | undefined; | ||
export { getToken, useToken }; |
@@ -40,3 +40,3 @@ "use client" | ||
var getToken = (name, path) => (theme, colorMode) => { | ||
var _a, _b, _c; | ||
var _a; | ||
if (name === "layerStyles") name = "styles.layerStyles"; | ||
@@ -59,7 +59,7 @@ if (name === "textStyles") name = "styles.textStyles"; | ||
value = [ | ||
(_a = (0, import_utils.getMemoizedObject)(theme, `${name}.${value[0]}`)) != null ? _a : value[0], | ||
(_b = (0, import_utils.getMemoizedObject)(theme, `${name}.${value[1]}`)) != null ? _b : value[1] | ||
(0, import_utils.getMemoizedObject)(theme, `${name}.${value[0]}`, value[0]), | ||
(0, import_utils.getMemoizedObject)(theme, `${name}.${value[1]}`, value[1]) | ||
]; | ||
} else { | ||
value = (_c = (0, import_utils.getMemoizedObject)(theme, `${name}.${value}`)) != null ? _c : value; | ||
value = (_a = (0, import_utils.getMemoizedObject)(theme, `${name}.${value}`)) != null ? _a : value; | ||
} | ||
@@ -66,0 +66,0 @@ if ((0, import_utils.isArray)(value)) { |
{ | ||
"name": "@yamada-ui/use-token", | ||
"version": "1.1.27-next-20241005235555", | ||
"version": "1.1.27-next-20241008193728", | ||
"description": "Yamada UI useToken custom hook", | ||
@@ -28,4 +28,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@yamada-ui/utils": "1.5.2", | ||
"@yamada-ui/core": "1.15.2-next-20241005235555" | ||
"@yamada-ui/core": "1.15.2-next-20241008193728", | ||
"@yamada-ui/utils": "1.5.3-next-20241008193728" | ||
}, | ||
@@ -32,0 +32,0 @@ "devDependencies": { |
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
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
18658
+ Added@babel/code-frame@7.25.7(transitive)
+ Added@babel/generator@7.25.7(transitive)
+ Added@babel/helper-module-imports@7.25.7(transitive)
+ Added@babel/helper-string-parser@7.25.7(transitive)
+ Added@babel/helper-validator-identifier@7.25.7(transitive)
+ Added@babel/highlight@7.25.7(transitive)
+ Added@babel/parser@7.25.8(transitive)
+ Added@babel/runtime@7.25.7(transitive)
+ Added@babel/template@7.25.7(transitive)
+ Added@babel/traverse@7.25.7(transitive)
+ Added@babel/types@7.25.8(transitive)
+ Added@yamada-ui/core@1.15.2-next-20241008193728(transitive)
+ Added@yamada-ui/portal@1.0.23-next-20241008193728(transitive)
+ Added@yamada-ui/utils@1.5.3-next-20241008193728(transitive)
+ Addedto-fast-properties@2.0.0(transitive)
- Removed@babel/code-frame@7.25.9(transitive)
- Removed@babel/generator@7.25.9(transitive)
- Removed@babel/helper-module-imports@7.25.9(transitive)
- Removed@babel/helper-string-parser@7.25.9(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@babel/highlight@7.25.9(transitive)
- Removed@babel/parser@7.25.9(transitive)
- Removed@babel/runtime@7.25.9(transitive)
- Removed@babel/template@7.25.9(transitive)
- Removed@babel/traverse@7.25.9(transitive)
- Removed@babel/types@7.25.9(transitive)
- Removed@yamada-ui/core@1.15.2-next-20241005235555(transitive)
- Removed@yamada-ui/portal@1.0.23-next-20241005235555(transitive)
- Removed@yamada-ui/utils@1.5.2(transitive)