@aesthetic/system
Advanced tools
Comparing version 0.9.2 to 0.9.3
@@ -1,7 +0,1 @@ | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
// Bundled with Packemon: https://packemon.dev | ||
@@ -240,3 +234,5 @@ // Platform: browser, Support: stable, Format: esm | ||
this.design = design; | ||
this.tokens = _objectSpread(_objectSpread({}, design.tokens), tokens); | ||
this.tokens = { ...design.tokens, | ||
...tokens | ||
}; | ||
} | ||
@@ -249,6 +245,7 @@ /** | ||
extend(tokens, options = {}) { | ||
return new Theme(_objectSpread({ | ||
return new Theme({ | ||
contrast: this.contrast, | ||
scheme: this.scheme | ||
}, options), deepMerge(this.tokens, tokens), this.design); | ||
scheme: this.scheme, | ||
...options | ||
}, deepMerge(this.tokens, tokens), this.design); | ||
} | ||
@@ -299,5 +296,5 @@ /** | ||
this.name = name; | ||
this.tokens = _objectSpread(_objectSpread({}, tokens), {}, { | ||
this.tokens = { ...tokens, | ||
depth: DEPTHS | ||
}); | ||
}; | ||
this.rootLineHeight = tokens.typography.rootLineHeight; | ||
@@ -304,0 +301,0 @@ this.rootTextSize = Number.parseFloat(tokens.typography.rootTextSize); // Pre-compiled for the chosen type, no need to calculate manually |
@@ -5,8 +5,2 @@ // Bundled with Packemon: https://packemon.dev | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
const utils = require('@aesthetic/utils'); | ||
@@ -244,3 +238,5 @@ | ||
this.design = design; | ||
this.tokens = _objectSpread(_objectSpread({}, design.tokens), tokens); | ||
this.tokens = { ...design.tokens, | ||
...tokens | ||
}; | ||
} | ||
@@ -253,6 +249,7 @@ /** | ||
extend(tokens, options = {}) { | ||
return new Theme(_objectSpread({ | ||
return new Theme({ | ||
contrast: this.contrast, | ||
scheme: this.scheme | ||
}, options), utils.deepMerge(this.tokens, tokens), this.design); | ||
scheme: this.scheme, | ||
...options | ||
}, utils.deepMerge(this.tokens, tokens), this.design); | ||
} | ||
@@ -303,5 +300,5 @@ /** | ||
this.name = name; | ||
this.tokens = _objectSpread(_objectSpread({}, tokens), {}, { | ||
this.tokens = { ...tokens, | ||
depth: DEPTHS | ||
}); | ||
}; | ||
this.rootLineHeight = tokens.typography.rootLineHeight; | ||
@@ -308,0 +305,0 @@ this.rootTextSize = Number.parseFloat(tokens.typography.rootTextSize); // Pre-compiled for the chosen type, no need to calculate manually |
@@ -46,6 +46,6 @@ // Bundled with Packemon: https://packemon.dev | ||
} = {}) { | ||
const prefersDarkScheme = matchColorScheme?.('dark'); | ||
const prefersLightScheme = matchColorScheme?.('light'); | ||
const prefersHighContrast = matchContrastLevel?.('high'); | ||
const prefersLowContrast = matchContrastLevel?.('low'); | ||
const prefersDarkScheme = matchColorScheme === null || matchColorScheme === void 0 ? void 0 : matchColorScheme('dark'); | ||
const prefersLightScheme = matchColorScheme === null || matchColorScheme === void 0 ? void 0 : matchColorScheme('light'); | ||
const prefersHighContrast = matchContrastLevel === null || matchContrastLevel === void 0 ? void 0 : matchContrastLevel('high'); | ||
const prefersLowContrast = matchContrastLevel === null || matchContrastLevel === void 0 ? void 0 : matchContrastLevel('low'); | ||
const schemeCheckOrder = []; | ||
@@ -52,0 +52,0 @@ |
{ | ||
"name": "@aesthetic/system", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"description": "Web based building blocks for the Aesthetic design system.", | ||
@@ -38,4 +38,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@aesthetic/types": "^0.6.2", | ||
"@aesthetic/utils": "^0.8.1" | ||
"@aesthetic/types": "^0.6.3", | ||
"@aesthetic/utils": "^0.8.2" | ||
}, | ||
@@ -49,3 +49,3 @@ "packemon": { | ||
}, | ||
"gitHead": "1d7a8aee700f68a11bd98c7a3b3d45d2ef3f789c" | ||
"gitHead": "171d7f79a70658036a8b945c2a004d6fa802f5c2" | ||
} |
175858
4338
Updated@aesthetic/types@^0.6.3
Updated@aesthetic/utils@^0.8.2