New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@yamada-ui/use-token

Package Overview
Dependencies
Maintainers
1
Versions
939
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yamada-ui/use-token - npm Package Compare versions

Comparing version 0.0.0-dev-20231008103811 to 0.0.0-dev-20231009175554

2

dist/index.d.ts
import * as _yamada_ui_core from '@yamada-ui/core';
declare const useToken: <Y extends string | number = string, M extends "animations" | "blurs" | "borders" | "breakpoints" | "colors" | "colorSchemes" | "fonts" | "fontSizes" | "fontWeights" | "gradients" | "layerStyles" | "letterSpacings" | "lineHeights" | "radii" | "shadows" | "sizes" | "spaces" | "textStyles" | "transitionDuration" | "transitionEasing" | "transitionProperty" | "zIndices" = "animations" | "blurs" | "borders" | "breakpoints" | "colors" | "colorSchemes" | "fonts" | "fontSizes" | "fontWeights" | "gradients" | "layerStyles" | "letterSpacings" | "lineHeights" | "radii" | "shadows" | "sizes" | "spaces" | "textStyles" | "transitionDuration" | "transitionEasing" | "transitionProperty" | "zIndices">(name: M, path: number | _yamada_ui_core.GeneratedTheme[M] | undefined) => Y | undefined;
declare const useToken: <Y extends string | number = string, M extends "animations" | "blurs" | "borders" | "breakpoints" | "colors" | "fonts" | "fontSizes" | "fontWeights" | "gradients" | "layerStyles" | "letterSpacings" | "lineHeights" | "radii" | "shadows" | "sizes" | "spaces" | "textStyles" | "transitionDuration" | "transitionEasing" | "transitionProperty" | "zIndices" = "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 | _yamada_ui_core.GeneratedTheme[M] | undefined) => Y | undefined;
export { useToken };

@@ -30,2 +30,3 @@ "use client"

var useToken = (name, path) => {
var _a, _b, _c;
const { theme } = (0, import_core.useTheme)();

@@ -43,8 +44,32 @@ const { colorMode } = (0, import_core.useColorMode)();

name = "transitions.easing";
const value = (0, import_utils.getMemoizedObject)(theme, `${name}.${path}`);
if ((0, import_utils.isArray)(value)) {
const [lightValue, darkValue] = value;
return colorMode === "light" ? lightValue : darkValue;
let value = (0, import_utils.getMemoizedObject)(theme, `${name}.${path}`);
if (!(0, import_utils.isUndefined)(value)) {
if ((0, import_utils.isArray)(value)) {
const [lightValue, darkValue] = value;
return colorMode === "light" ? lightValue : darkValue;
} else {
return value;
}
} else {
return value;
value = (0, import_utils.getMemoizedObject)(theme, `semantics.${name}.${path}`);
if ((0, import_utils.isArray)(value)) {
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]
];
} else {
value = (_c = (0, import_utils.getMemoizedObject)(theme, `${name}.${value}`)) != null ? _c : value;
}
if ((0, import_utils.isArray)(value)) {
const [lightValue, darkValue] = value;
value = colorMode === "light" ? lightValue : darkValue;
if ((0, import_utils.isArray)(value)) {
const [lightValue2, darkValue2] = value;
return colorMode === "light" ? lightValue2 : darkValue2;
} else {
return value;
}
} else {
return value;
}
}

@@ -51,0 +76,0 @@ };

{
"name": "@yamada-ui/use-token",
"version": "0.0.0-dev-20231008103811",
"version": "0.0.0-dev-20231009175554",
"description": "Yamada UI useToken custom hook",

@@ -27,4 +27,4 @@ "keywords": [

"dependencies": {
"@yamada-ui/core": "0.0.0-dev-20231008103811",
"@yamada-ui/utils": "0.2.1"
"@yamada-ui/core": "0.0.0-dev-20231009175554",
"@yamada-ui/utils": "0.0.0-dev-20231009175554"
},

@@ -31,0 +31,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc