@chakra-ui/styled-system
Advanced tools
Comparing version 1.11.0 to 1.11.1
# Change Log | ||
## 1.11.1 | ||
### Patch Changes | ||
- [`d9d66a9e8`](https://github.com/chakra-ui/chakra-ui/commit/d9d66a9e876f076ffd1c8bb531fd03e9074d325f) | ||
[#4048](https://github.com/chakra-ui/chakra-ui/pull/4048) Thanks | ||
[@mcha-dev](https://github.com/mcha-dev)! - fixed boolean condition affecting | ||
bgImage url | ||
## 1.11.0 | ||
@@ -4,0 +13,0 @@ |
@@ -5,6 +5,5 @@ "use strict"; | ||
var _exportNames = { | ||
tokenToCSSVar: true, | ||
WithCSSVar: true | ||
tokenToCSSVar: true | ||
}; | ||
exports.WithCSSVar = exports.tokenToCSSVar = void 0; | ||
exports.tokenToCSSVar = void 0; | ||
@@ -68,6 +67,2 @@ var _config = require("./config"); | ||
exports.tokenToCSSVar = _createTransform.tokenToCSSVar; | ||
var _types = require("./utils/types"); | ||
exports.WithCSSVar = _types.WithCSSVar; | ||
//# sourceMappingURL=index.js.map |
@@ -5,3 +5,3 @@ "use strict"; | ||
exports.parseGradient = parseGradient; | ||
exports.gradientTransform = void 0; | ||
exports.gradientTransform = exports.globalSet = void 0; | ||
@@ -40,2 +40,3 @@ function _wrapRegExp(re, groups) { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); var _super = RegExp.prototype; var _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = _RegExp.call(this, re, flags); _groups.set(_this, groups || _groups.get(re)); return _this; } _inherits(BabelRegExp, _RegExp); BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) result.groups = buildGroups(result, this); return result; }; BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if (typeof substitution === "string") { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { return "$" + groups[name]; })); } else if (typeof substitution === "function") { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = []; args.push.apply(args, arguments); if (typeof args[args.length - 1] !== "object") { args.push(buildGroups(args, _this)); } return substitution.apply(this, args); }); } else { return _super[Symbol.replace].call(this, str, substitution); } }; function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { groups[name] = result[g[name]]; return groups; }, Object.create(null)); } return _wrapRegExp.apply(this, arguments); } | ||
var globalSet = new Set(["none", "-moz-initial", "inherit", "initial", "revert", "unset"]); | ||
exports.globalSet = globalSet; | ||
@@ -42,0 +43,0 @@ var trimSpace = function trimSpace(str) { |
@@ -86,3 +86,7 @@ "use strict"; | ||
bgImage: function bgImage(value) { | ||
return (0, _utils.isString)(value) && !value.startsWith("url") ? "url(" + value + ")" : value; | ||
if (value == null) return value; | ||
var prevent = isCSSFunction(value) || _parseGradient.globalSet.has(value); | ||
return !prevent ? "url(" + value + ")" : value; | ||
}, | ||
@@ -114,2 +118,6 @@ outline: function outline(value) { | ||
exports.transformFunctions = transformFunctions; | ||
var isCSSFunction = function isCSSFunction(value) { | ||
return (0, _utils.isString)(value) && value.includes("(") && value.includes(")"); | ||
}; | ||
//# sourceMappingURL=transform-functions.js.map |
@@ -8,3 +8,2 @@ export * from "./config"; | ||
export { tokenToCSSVar } from "./utils/create-transform"; | ||
export { WithCSSVar } from "./utils/types"; | ||
//# sourceMappingURL=index.js.map |
@@ -32,3 +32,3 @@ function _wrapRegExp(re, groups) { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); var _super = RegExp.prototype; var _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = _RegExp.call(this, re, flags); _groups.set(_this, groups || _groups.get(re)); return _this; } _inherits(BabelRegExp, _RegExp); BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) result.groups = buildGroups(result, this); return result; }; BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if (typeof substitution === "string") { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { return "$" + groups[name]; })); } else if (typeof substitution === "function") { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = []; args.push.apply(args, arguments); if (typeof args[args.length - 1] !== "object") { args.push(buildGroups(args, _this)); } return substitution.apply(this, args); }); } else { return _super[Symbol.replace].call(this, str, substitution); } }; function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { groups[name] = result[g[name]]; return groups; }, Object.create(null)); } return _wrapRegExp.apply(this, arguments); } | ||
var valueSet = new Set(Object.values(directionMap)); | ||
var globalSet = new Set(["none", "-moz-initial", "inherit", "initial", "revert", "unset"]); | ||
export var globalSet = new Set(["none", "-moz-initial", "inherit", "initial", "revert", "unset"]); | ||
@@ -35,0 +35,0 @@ var trimSpace = str => str.trim(); |
import { isCssVar, isNumber, isString } from "@chakra-ui/utils"; | ||
import { backdropFilterTemplate, filterTemplate, getRingTemplate, getTransformGpuTemplate, getTransformTemplate, flexDirectionTemplate } from "./templates"; | ||
import { gradientTransform } from "./parse-gradient"; | ||
import { gradientTransform, globalSet } from "./parse-gradient"; | ||
@@ -84,3 +84,5 @@ var analyzeCSSValue = value => { | ||
bgImage(value) { | ||
return isString(value) && !value.startsWith("url") ? "url(" + value + ")" : value; | ||
if (value == null) return value; | ||
var prevent = isCSSFunction(value) || globalSet.has(value); | ||
return !prevent ? "url(" + value + ")" : value; | ||
}, | ||
@@ -114,2 +116,6 @@ | ||
}; | ||
var isCSSFunction = value => { | ||
return isString(value) && value.includes("(") && value.includes(")"); | ||
}; | ||
//# sourceMappingURL=transform-functions.js.map |
@@ -10,3 +10,3 @@ export * from "./config"; | ||
export declare type OmitSpaceXY<T> = Omit<T, "spaceX" | "spaceY">; | ||
export { WithCSSVar } from "./utils/types"; | ||
export type { WithCSSVar } from "./utils/types"; | ||
//# sourceMappingURL=index.d.ts.map |
import { Dict } from "@chakra-ui/utils"; | ||
import { Transform } from "./types"; | ||
export declare const globalSet: Set<string>; | ||
export declare function parseGradient(value: string | null | undefined, theme: Dict): string | null | undefined; | ||
export declare const gradientTransform: Transform; | ||
//# sourceMappingURL=parse-gradient.d.ts.map |
{ | ||
"name": "@chakra-ui/styled-system", | ||
"version": "1.11.0", | ||
"version": "1.11.1", | ||
"description": "Style function for css-in-js building component libraries", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
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
1006190
7528