@invisionag/iris-tools
Advanced tools
Comparing version 4.1.29 to 4.1.30
@@ -126,23 +126,18 @@ module.exports = | ||
const shadowColor = injixo_["color"].typography200; | ||
const shadowOpacity = 0.25; | ||
const boxShadowSmall = `0 0.0675em 0.125em ${Object(external_polished_["rgba"])(shadowColor, shadowOpacity)}`; | ||
const boxShadowLarge = `0 0.25em 0.5em ${Object(external_polished_["rgba"])(shadowColor, shadowOpacity)}, ${boxShadowSmall}`; | ||
const boxShadow = (size = 'large', withActiveState = false) => { | ||
var shadowColor = injixo_["color"].typography200; | ||
var shadowOpacity = 0.25; | ||
var boxShadowSmall = "0 0.0675em 0.125em ".concat(Object(external_polished_["rgba"])(shadowColor, shadowOpacity)); | ||
var boxShadowLarge = "0 0.25em 0.5em ".concat(Object(external_polished_["rgba"])(shadowColor, shadowOpacity), ", ").concat(boxShadowSmall); | ||
var box_shadow_boxShadow = function boxShadow() { | ||
var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'large'; | ||
var withActiveState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
if (!iris_settings_["settings"].shadow) return ''; | ||
const shadowStyling = `box-shadow: ${size === 'large' ? boxShadowLarge : boxShadowSmall};`; | ||
const activeStyling = withActiveState ? ` | ||
&:active { | ||
${shadowStyling} | ||
} | ||
` : ''; | ||
return ` | ||
${activeStyling} | ||
${shadowStyling} | ||
`; | ||
var shadowStyling = "box-shadow: ".concat(size === 'large' ? boxShadowLarge : boxShadowSmall, ";"); | ||
var activeStyling = withActiveState ? "\n &:active {\n ".concat(shadowStyling, "\n }\n ") : ''; | ||
return "\n ".concat(activeStyling, "\n ").concat(shadowStyling, "\n "); | ||
}; | ||
/* harmony default export */ var box_shadow = ({ | ||
boxShadowSmall, | ||
boxShadowLarge, | ||
boxShadow | ||
boxShadowSmall: boxShadowSmall, | ||
boxShadowLarge: boxShadowLarge, | ||
boxShadow: box_shadow_boxShadow | ||
}); | ||
@@ -152,8 +147,8 @@ // CONCATENATED MODULE: ./packages/tools/src/px-to-rem.js | ||
const getValue = value => { | ||
const pattern = new RegExp(/\^px/, 'ig'); | ||
const match = pattern.exec(value); | ||
var getValue = function getValue(value) { | ||
var pattern = new RegExp(/\^px/, 'ig'); | ||
var match = pattern.exec(value); | ||
if (!match) { | ||
throw new Error(`${value} needs to be a pixel value`); | ||
throw new Error("".concat(value, " needs to be a pixel value")); | ||
} | ||
@@ -164,57 +159,18 @@ | ||
/* harmony default export */ var px_to_rem = (value => { | ||
if (!getValue(value)) throw new Error(`${value} needs to be a pixel value`); | ||
/* harmony default export */ var px_to_rem = (function (value) { | ||
if (!getValue(value)) throw new Error("".concat(value, " needs to be a pixel value")); | ||
return parseInt(value, 10) / iris_settings_["settings"].basePx; | ||
}); | ||
// CONCATENATED MODULE: ./packages/tools/src/equal-size-siblings.js | ||
/* harmony default export */ var equal_size_siblings = (() => ` | ||
/* one item */ | ||
&:nth-child(1):nth-last-child(1) { | ||
width: 100%; | ||
} | ||
/* two items */ | ||
&:nth-child(1):nth-last-child(2), | ||
&:nth-child(2):nth-last-child(1) { | ||
width: 50%; | ||
} | ||
/* three items */ | ||
&:nth-child(1):nth-last-child(3), | ||
&:nth-child(2):nth-last-child(2), | ||
&:nth-child(3):nth-last-child(1) { | ||
width: 33.3333%; | ||
} | ||
/* four items */ | ||
&:nth-child(1):nth-last-child(4), | ||
&:nth-child(2):nth-last-child(3), | ||
&:nth-child(3):nth-last-child(2), | ||
&:nth-child(4):nth-last-child(1) { | ||
width: 25%; | ||
} | ||
/* five items */ | ||
&:nth-child(1):nth-last-child(5), | ||
&:nth-child(2):nth-last-child(4), | ||
&:nth-child(3):nth-last-child(3), | ||
&:nth-child(4):nth-last-child(2), | ||
&:nth-child(5):nth-last-child(1) { | ||
width: 20%; | ||
} | ||
/* six items */ | ||
&:nth-child(1):nth-last-child(6), | ||
&:nth-child(2):nth-last-child(5), | ||
&:nth-child(3):nth-last-child(4), | ||
&:nth-child(4):nth-last-child(3), | ||
&:nth-child(5):nth-last-child(2), | ||
&:nth-child(6):nth-last-child(1) { | ||
width: 16.66%; | ||
} | ||
`); | ||
/* harmony default export */ var equal_size_siblings = (function () { | ||
return "\n /* one item */\n &:nth-child(1):nth-last-child(1) {\n width: 100%;\n }\n\n /* two items */\n &:nth-child(1):nth-last-child(2),\n &:nth-child(2):nth-last-child(1) {\n width: 50%;\n }\n\n /* three items */\n &:nth-child(1):nth-last-child(3),\n &:nth-child(2):nth-last-child(2),\n &:nth-child(3):nth-last-child(1) {\n width: 33.3333%;\n }\n\n /* four items */\n &:nth-child(1):nth-last-child(4),\n &:nth-child(2):nth-last-child(3),\n &:nth-child(3):nth-last-child(2),\n &:nth-child(4):nth-last-child(1) {\n width: 25%;\n }\n\n /* five items */\n &:nth-child(1):nth-last-child(5),\n &:nth-child(2):nth-last-child(4),\n &:nth-child(3):nth-last-child(3),\n &:nth-child(4):nth-last-child(2),\n &:nth-child(5):nth-last-child(1) {\n width: 20%;\n }\n\n /* six items */\n &:nth-child(1):nth-last-child(6),\n &:nth-child(2):nth-last-child(5),\n &:nth-child(3):nth-last-child(4),\n &:nth-child(4):nth-last-child(3),\n &:nth-child(5):nth-last-child(2),\n &:nth-child(6):nth-last-child(1) {\n width: 16.66%;\n }\n"; | ||
}); | ||
// CONCATENATED MODULE: ./packages/tools/src/extractUnit.js | ||
const reverseString = v => v.split('').reverse().join(''); | ||
var reverseString = function reverseString(v) { | ||
return v.split('').reverse().join(''); | ||
}; | ||
const hasNoUnit = v => !!v.match(/^\d/); | ||
var hasNoUnit = function hasNoUnit(v) { | ||
return !!v.match(/^\d/); | ||
}; | ||
@@ -225,3 +181,3 @@ function extractUnit(v) { | ||
if (hasNoUnit(reverseString(v))) return ''; | ||
const matches = reverseString(v).match(/.+?(?=\d)/); | ||
var matches = reverseString(v).match(/.+?(?=\d)/); | ||
if (!matches || matches.length < 1) return ''; | ||
@@ -238,9 +194,13 @@ return reverseString(matches[0]); | ||
function calc(value, calculation = v => v) { | ||
function calc(value) { | ||
var calculation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (v) { | ||
return v; | ||
}; | ||
if (typeof value === 'string') { | ||
const unit = src_extractUnit(value); | ||
const unitlessValue = parseFloat(value); // eslint-disable-next-line no-restricted-globals | ||
var unit = src_extractUnit(value); | ||
var unitlessValue = parseFloat(value); // eslint-disable-next-line no-restricted-globals | ||
if (isNaN(unitlessValue)) return ''; | ||
return `${calculation(parseFloat(value))}${unit}`; | ||
return "".concat(calculation(parseFloat(value))).concat(unit); | ||
} | ||
@@ -253,3 +213,3 @@ | ||
// CONCATENATED MODULE: ./packages/tools/src/index.js | ||
/* concated harmony reexport boxShadow */__webpack_require__.d(__webpack_exports__, "boxShadow", function() { return boxShadow; }); | ||
/* concated harmony reexport boxShadow */__webpack_require__.d(__webpack_exports__, "boxShadow", function() { return box_shadow_boxShadow; }); | ||
/* concated harmony reexport boxShadowLarge */__webpack_require__.d(__webpack_exports__, "boxShadowLarge", function() { return boxShadowLarge; }); | ||
@@ -270,3 +230,3 @@ /* concated harmony reexport boxShadowSmall */__webpack_require__.d(__webpack_exports__, "boxShadowSmall", function() { return boxShadowSmall; }); | ||
/* harmony default export */ var src = __webpack_exports__["default"] = ({ | ||
boxShadow: boxShadow, | ||
boxShadow: box_shadow_boxShadow, | ||
boxShadowLarge: boxShadowLarge, | ||
@@ -273,0 +233,0 @@ boxShadowSmall: boxShadowSmall, |
{ | ||
"name": "@invisionag/iris-tools", | ||
"version": "4.1.29", | ||
"version": "4.1.30", | ||
"main": "dist/index.js", | ||
@@ -9,6 +9,6 @@ "license": "MIT", | ||
"@invisionag/beacon-tokens": "^0.0.15", | ||
"@invisionag/iris-settings": "^6.1.30", | ||
"@invisionag/iris-settings": "^6.1.31", | ||
"polished": "^3.4.1" | ||
}, | ||
"gitHead": "3bbf8d39b7b9d568ec075c8f0b1a250ab257d6e1" | ||
"gitHead": "139c5585420d1f9079cfe3154a63695dfabcf4d9" | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
20799
0
366