@chakra-ui/media-query
Advanced tools
Comparing version 1.0.0-rc.4 to 1.0.0-rc.5
@@ -6,2 +6,10 @@ # Change Log | ||
# 1.0.0-rc.5 (2020-09-27) | ||
**Note:** Version bump only for package @chakra-ui/media-query | ||
# 1.0.0-rc.4 (2020-09-25) | ||
@@ -8,0 +16,0 @@ |
@@ -66,3 +66,3 @@ "use strict"; | ||
var getBreakpoint = function getBreakpoint(theme, value) { | ||
return (0, _utils.get)(theme, "breakpoints." + value, value); | ||
return (0, _utils.memoizedGet)(theme, "breakpoints." + value, value); | ||
}; | ||
@@ -69,0 +69,0 @@ |
@@ -31,3 +31,3 @@ "use strict"; | ||
var obj = (0, _utils.isArray)(values) ? Object.fromEntries(Object.entries((0, _utils.arrayToObjectNotation)(values, breakpoints)).map(function (_ref) { | ||
var obj = (0, _utils.isArray)(values) ? (0, _utils.fromEntries)(Object.entries((0, _utils.arrayToObjectNotation)(values, breakpoints)).map(function (_ref) { | ||
var _ = _ref[0], | ||
@@ -37,5 +37,4 @@ value = _ref[1]; | ||
})) : values; | ||
var closest = (0, _mediaQuery.getClosestValue)(obj, breakpoint); | ||
return closest; | ||
return (0, _mediaQuery.getClosestValue)(obj, breakpoint); | ||
} | ||
//# sourceMappingURL=use-breakpoint-value.js.map |
import { useMediaQuery } from "./use-media-query"; | ||
import * as React from "react"; | ||
import { useTheme } from "@chakra-ui/system"; | ||
import { get, __DEV__ } from "@chakra-ui/utils"; | ||
import { memoizedGet as get, __DEV__ } from "@chakra-ui/utils"; | ||
@@ -6,0 +6,0 @@ /** |
import { getClosestValue } from "./media-query.utils"; | ||
import { useBreakpoint } from "./use-breakpoint"; | ||
import { isArray, arrayToObjectNotation } from "@chakra-ui/utils"; | ||
import { isArray, arrayToObjectNotation, fromEntries } from "@chakra-ui/utils"; | ||
import { useTheme } from "@chakra-ui/system"; | ||
@@ -23,9 +23,8 @@ /** | ||
var obj = isArray(values) ? Object.fromEntries(Object.entries(arrayToObjectNotation(values, breakpoints)).map((_ref) => { | ||
var obj = isArray(values) ? fromEntries(Object.entries(arrayToObjectNotation(values, breakpoints)).map((_ref) => { | ||
var [_, value] = _ref; | ||
return [value, value]; | ||
})) : values; | ||
var closest = getClosestValue(obj, breakpoint); | ||
return closest; | ||
return getClosestValue(obj, breakpoint); | ||
} | ||
//# sourceMappingURL=use-breakpoint-value.js.map |
@@ -1,1 +0,1 @@ | ||
export declare function getClosestValue(values: any, breakpoint: string): any; | ||
export declare function getClosestValue<T = any>(values: Record<string, T>, breakpoint: string): T | undefined; |
@@ -8,2 +8,2 @@ /** | ||
*/ | ||
export declare function useBreakpointValue<T = any>(values: Record<string, T> | T[]): any; | ||
export declare function useBreakpointValue<T = any>(values: Record<string, T> | T[]): T | undefined; |
{ | ||
"name": "@chakra-ui/media-query", | ||
"version": "1.0.0-rc.4", | ||
"version": "1.0.0-rc.5", | ||
"description": "A React hook for changing properties or visibility of a component based on css media query", | ||
@@ -49,8 +49,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@chakra-ui/utils": "1.0.0-rc.4", | ||
"@chakra-ui/utils": "1.0.0-rc.5", | ||
"calculate-measurement": "0.1.0" | ||
}, | ||
"devDependencies": { | ||
"@chakra-ui/system": "1.0.0-rc.4", | ||
"@chakra-ui/test-utils": "1.0.0-rc.4", | ||
"@chakra-ui/system": "1.0.0-rc.5", | ||
"@chakra-ui/test-utils": "1.0.0-rc.5", | ||
"jest-matchmedia-mock": "^1.0.1" | ||
@@ -63,3 +63,3 @@ }, | ||
}, | ||
"gitHead": "830b8587c572a4c20d6b56b256accd6686255819" | ||
"gitHead": "b5c8482b778b19f27ea1d6c8ab6d5ed39c664afa" | ||
} |
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
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
71867
688
+ Added@chakra-ui/utils@1.0.0-rc.5(transitive)
- Removed@chakra-ui/utils@1.0.0-rc.4(transitive)
Updated@chakra-ui/utils@1.0.0-rc.5