@os-design/utils
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -0,1 +1,2 @@ | ||
export { default as ellipsis } from './ellipsis'; | ||
export { default as m } from './media'; | ||
@@ -2,0 +3,0 @@ export { default as omitProps } from './omitProps'; |
@@ -6,2 +6,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ellipsis_1 = require("./ellipsis"); | ||
exports.ellipsis = ellipsis_1.default; | ||
var media_1 = require("./media"); | ||
@@ -8,0 +10,0 @@ exports.m = media_1.default; |
interface Breakpoints { | ||
xxs: number; | ||
xs: number; | ||
@@ -9,7 +10,10 @@ sm: number; | ||
} | ||
declare type Media = { | ||
[key in keyof Breakpoints]: string; | ||
declare type Media<T> = { | ||
[key in keyof T]: string; | ||
}; | ||
declare const m: Media; | ||
declare const m: { | ||
min: Media<Pick<Breakpoints, "xs" | "sm" | "md" | "lg" | "xl" | "xxl">>; | ||
max: Media<Pick<Breakpoints, "xxs" | "xs" | "sm" | "md" | "lg" | "xl">>; | ||
}; | ||
export default m; | ||
//# sourceMappingURL=media.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const breakpoints = { | ||
const minBreakpoints = { | ||
xs: 480, | ||
@@ -11,7 +11,23 @@ sm: 576, | ||
}; | ||
const m = Object.keys(breakpoints).reduce((res, key) => { | ||
res[key] = `@media (min-width: ${breakpoints[key]}px)`; | ||
const maxBreakpoints = { | ||
xxs: minBreakpoints.xs - 1, | ||
xs: minBreakpoints.sm - 1, | ||
sm: minBreakpoints.md - 1, | ||
md: minBreakpoints.lg - 1, | ||
lg: minBreakpoints.xl - 1, | ||
xl: minBreakpoints.xxl - 1, | ||
}; | ||
const min = Object.keys(minBreakpoints).reduce((res, key) => { | ||
res[key] = `@media (min-width: ${minBreakpoints[key]}px)`; | ||
return res; | ||
}, {}); | ||
const max = Object.keys(maxBreakpoints).reduce((res, key) => { | ||
res[key] = `@media (max-width: ${maxBreakpoints[key]}px)`; | ||
return res; | ||
}, {}); | ||
const m = { | ||
min, | ||
max, | ||
}; | ||
exports.default = m; | ||
//# sourceMappingURL=media.js.map |
{ | ||
"name": "@os-design/utils", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"license": "MIT", | ||
@@ -24,3 +24,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "b0835a8f592ae7aac5ebb68a8fec3a2e541c6558" | ||
"gitHead": "1f82c7f88f8e722481bc0b58fb8aff9f25bb37b6" | ||
} |
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
10814
30
124