@chakra-ui/breakpoint-utils
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -25,2 +25,3 @@ "use strict"; | ||
arrayToObjectNotation: () => arrayToObjectNotation, | ||
breakpoints: () => breakpoints, | ||
isCustomBreakpoint: () => isCustomBreakpoint, | ||
@@ -30,2 +31,3 @@ isResponsiveObjectLike: () => isResponsiveObjectLike, | ||
objectToArrayNotation: () => objectToArrayNotation, | ||
px: () => px, | ||
toMediaQueryString: () => toMediaQueryString | ||
@@ -42,3 +44,10 @@ }); | ||
// src/responsive.ts | ||
var breakpoints = Object.freeze(["base", "sm", "md", "lg", "xl", "2xl"]); | ||
var breakpoints = Object.freeze([ | ||
"base", | ||
"sm", | ||
"md", | ||
"lg", | ||
"xl", | ||
"2xl" | ||
]); | ||
function mapResponsive(prop, mapper) { | ||
@@ -99,3 +108,3 @@ if (Array.isArray(prop)) { | ||
var sortByBreakpointValue = (a, b) => parseInt(a[1], 10) > parseInt(b[1], 10) ? 1 : -1; | ||
var sortBps = (breakpoints2) => Object.entries(breakpoints2).sort(sortByBreakpointValue); | ||
var sortBps = (breakpoints2) => Object.fromEntries(Object.entries(breakpoints2).sort(sortByBreakpointValue)); | ||
function normalize(breakpoints2) { | ||
@@ -185,2 +194,3 @@ const sorted = sortBps(breakpoints2); | ||
arrayToObjectNotation, | ||
breakpoints, | ||
isCustomBreakpoint, | ||
@@ -190,3 +200,4 @@ isResponsiveObjectLike, | ||
objectToArrayNotation, | ||
px, | ||
toMediaQueryString | ||
}); |
@@ -0,1 +1,2 @@ | ||
declare const breakpoints: readonly string[]; | ||
declare function mapResponsive(prop: any, mapper: (val: any) => any): any; | ||
@@ -14,2 +15,3 @@ declare function objectToArrayNotation(obj: Record<string, any>, bps?: readonly string[]): any[]; | ||
declare function px(value: number | string | null): string | null; | ||
declare function toMediaQueryString(min: string | null, max?: string): string; | ||
@@ -47,3 +49,4 @@ declare function analyzeBreakpoints(breakpoints: Record<string, any>): { | ||
} | null; | ||
declare type AnalyzeBreakpointsReturn = ReturnType<typeof analyzeBreakpoints>; | ||
export { analyzeBreakpoints, arrayToObjectNotation, isCustomBreakpoint, isResponsiveObjectLike, mapResponsive, objectToArrayNotation, toMediaQueryString }; | ||
export { AnalyzeBreakpointsReturn, analyzeBreakpoints, arrayToObjectNotation, breakpoints, isCustomBreakpoint, isResponsiveObjectLike, mapResponsive, objectToArrayNotation, px, toMediaQueryString }; |
@@ -8,3 +8,10 @@ // ../shared-utils/dist/index.esm.js | ||
// src/responsive.ts | ||
var breakpoints = Object.freeze(["base", "sm", "md", "lg", "xl", "2xl"]); | ||
var breakpoints = Object.freeze([ | ||
"base", | ||
"sm", | ||
"md", | ||
"lg", | ||
"xl", | ||
"2xl" | ||
]); | ||
function mapResponsive(prop, mapper) { | ||
@@ -65,3 +72,3 @@ if (Array.isArray(prop)) { | ||
var sortByBreakpointValue = (a, b) => parseInt(a[1], 10) > parseInt(b[1], 10) ? 1 : -1; | ||
var sortBps = (breakpoints2) => Object.entries(breakpoints2).sort(sortByBreakpointValue); | ||
var sortBps = (breakpoints2) => Object.fromEntries(Object.entries(breakpoints2).sort(sortByBreakpointValue)); | ||
function normalize(breakpoints2) { | ||
@@ -150,2 +157,3 @@ const sorted = sortBps(breakpoints2); | ||
arrayToObjectNotation, | ||
breakpoints, | ||
isCustomBreakpoint, | ||
@@ -155,3 +163,4 @@ isResponsiveObjectLike, | ||
objectToArrayNotation, | ||
px, | ||
toMediaQueryString | ||
}; |
{ | ||
"name": "@chakra-ui/breakpoint-utils", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "", | ||
@@ -32,3 +32,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@chakra-ui/shared-utils": "0.0.0-dev-20220820120308" | ||
"@chakra-ui/shared-utils": "2.0.1" | ||
}, | ||
@@ -35,0 +35,0 @@ "scripts": { |
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
15466
401