@codecademy/variance 1.0.0-alpha.f6cb5a.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/core.d.ts +5 -5
  2. package/dist/core.js +152 -163
  3. package/dist/createTheme/createTheme.d.ts +7 -0
  4. package/dist/createTheme/createTheme.js +118 -150
  5. package/dist/createTheme/createTheme.test.js +50 -62
  6. package/dist/createTheme/types.d.ts +7 -7
  7. package/dist/createTheme/types.js +1 -0
  8. package/dist/getPropertyMode/getPropertyMode.d.ts +2 -0
  9. package/dist/getPropertyMode/getPropertyMode.js +3 -0
  10. package/dist/getPropertyMode/getPropertyMode.test.js +15 -0
  11. package/dist/getPropertyMode/index.d.ts +1 -0
  12. package/dist/getPropertyMode/index.js +1 -0
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.js +2 -1
  15. package/dist/scales/createScale.js +1 -3
  16. package/dist/scales/createScaleLookup.d.ts +2 -2
  17. package/dist/scales/createScaleLookup.js +9 -17
  18. package/dist/transforms/transformSize.js +9 -31
  19. package/dist/types/config.d.ts +18 -14
  20. package/dist/types/config.js +1 -0
  21. package/dist/types/properties.d.ts +14 -5
  22. package/dist/types/properties.js +1 -0
  23. package/dist/types/props.d.ts +27 -8
  24. package/dist/types/props.js +1 -0
  25. package/dist/types/theme.d.ts +6 -0
  26. package/dist/types/theme.js +1 -0
  27. package/dist/types/utils.d.ts +3 -3
  28. package/dist/types/utils.js +1 -0
  29. package/dist/utils/flattenScale.d.ts +5 -5
  30. package/dist/utils/flattenScale.js +24 -13
  31. package/dist/utils/getStaticProperties.js +3 -6
  32. package/dist/utils/propNames.js +42 -39
  33. package/dist/utils/responsive.d.ts +5 -5
  34. package/dist/utils/responsive.js +60 -69
  35. package/dist/utils/serializeTokens.d.ts +2 -2
  36. package/dist/utils/serializeTokens.js +34 -26
  37. package/package.json +19 -31
  38. package/CHANGELOG.md +0 -325
  39. package/LICENSE +0 -21
  40. package/babel.config.js +0 -5
  41. package/dist/core.js.map +0 -1
  42. package/dist/createTheme/createTheme.js.map +0 -1
  43. package/dist/createTheme/createTheme.test.d.ts +0 -1
  44. package/dist/createTheme/createTheme.test.js.map +0 -1
  45. package/dist/createTheme/index.js.map +0 -1
  46. package/dist/createTheme/types.js.map +0 -1
  47. package/dist/index.js.map +0 -1
  48. package/dist/scales/createScale.js.map +0 -1
  49. package/dist/scales/createScaleLookup.js.map +0 -1
  50. package/dist/transforms/index.js.map +0 -1
  51. package/dist/transforms/transformSize.js.map +0 -1
  52. package/dist/types/config.js.map +0 -1
  53. package/dist/types/properties.js.map +0 -1
  54. package/dist/types/props.js.map +0 -1
  55. package/dist/types/theme.js.map +0 -1
  56. package/dist/types/utils.js.map +0 -1
  57. package/dist/utils/__fixtures__/testConfig.js +0 -153
  58. package/dist/utils/__fixtures__/testConfig.js.map +0 -1
  59. package/dist/utils/flattenScale.js.map +0 -1
  60. package/dist/utils/getStaticProperties.js.map +0 -1
  61. package/dist/utils/propNames.js.map +0 -1
  62. package/dist/utils/responsive.js.map +0 -1
  63. package/dist/utils/serializeTokens.js.map +0 -1
  64. package/jest.config.js +0 -1
  65. package/tsconfig.base.json +0 -3
@@ -1,91 +1,82 @@
1
- function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
1
+ import intersection from 'lodash/intersection';
2
+ import omit from 'lodash/omit';
3
+ const BREAKPOINT_KEYS = ['_', 'xs', 'sm', 'md', 'lg', 'xl', 'c_base', 'c_xs', 'c_sm', 'c_md', 'c_lg', 'c_xl'];
2
4
 
3
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
-
9
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
-
11
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
- 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; }
14
-
15
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
16
-
17
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
18
-
19
- import { intersection, omit } from 'lodash';
20
- var BREAKPOINT_KEYS = ['_', 'xs', 'sm', 'md', 'lg', 'xl'];
21
5
  /**
22
6
  * Destructures the themes breakpoints into an ordered structure to traverse
23
7
  */
24
-
25
- export var parseBreakpoints = function parseBreakpoints(breakpoints) {
8
+ export const parseBreakpoints = breakpoints => {
26
9
  if (breakpoints === undefined) return null;
27
-
28
- var _ref = breakpoints !== null && breakpoints !== void 0 ? breakpoints : {},
29
- xs = _ref.xs,
30
- sm = _ref.sm,
31
- md = _ref.md,
32
- lg = _ref.lg,
33
- xl = _ref.xl; // Ensure order for mapping
34
-
35
-
10
+ const {
11
+ xs,
12
+ sm,
13
+ md,
14
+ lg,
15
+ xl,
16
+ c_base,
17
+ c_xs,
18
+ c_sm,
19
+ c_md,
20
+ c_lg,
21
+ c_xl
22
+ } = breakpoints ?? {};
23
+
24
+ // Ensure order for mapping - media queries first, then container queries
36
25
  return {
37
26
  map: breakpoints,
38
- array: [xs, sm, md, lg, xl]
27
+ array: [xs, sm, md, lg, xl, c_base, c_xs, c_sm, c_md, c_lg, c_xl]
39
28
  };
40
29
  };
41
- export var isMediaArray = function isMediaArray(val) {
42
- return Array.isArray(val);
43
- };
44
- export var isMediaMap = function isMediaMap(val) {
45
- return intersection(Object.keys(val), BREAKPOINT_KEYS).length > 0;
46
- };
47
- export var objectParser = function objectParser(value, props, config, breakpoints) {
48
- var styles = {};
49
- var styleFn = config.styleFn,
50
- prop = config.prop;
51
-
52
- var _ = value._,
53
- rest = _objectWithoutProperties(value, ["_"]); // the keyof 'base' is base styles
54
-
55
-
56
- if (_) Object.assign(styles, styleFn(_, prop, props)); // Map over remaining keys and merge the corresponding breakpoint styles
30
+ export const isMediaArray = val => Array.isArray(val);
31
+ export const isMediaMap = val => intersection(Object.keys(val), BREAKPOINT_KEYS).length > 0;
32
+ export const objectParser = (value, props, config, breakpoints) => {
33
+ const styles = {};
34
+ const {
35
+ styleFn,
36
+ prop
37
+ } = config;
38
+ const {
39
+ _,
40
+ ...rest
41
+ } = value;
42
+ // the keyof 'base' is base styles
43
+ if (_) Object.assign(styles, styleFn(_, prop, props));
44
+
45
+ // Map over remaining keys and merge the corresponding breakpoint styles
57
46
  // for that property.
58
-
59
- Object.keys(breakpoints).forEach(function (breakpointKey) {
60
- var bpStyles = rest[breakpointKey];
47
+ Object.keys(breakpoints).forEach(breakpointKey => {
48
+ const bpStyles = rest[breakpointKey];
61
49
  if (typeof bpStyles === 'undefined') return;
62
- Object.assign(styles, _defineProperty({}, breakpoints[breakpointKey], styleFn(bpStyles, prop, props)));
50
+ Object.assign(styles, {
51
+ [breakpoints[breakpointKey]]: styleFn(bpStyles, prop, props)
52
+ });
63
53
  });
64
54
  return styles;
65
55
  };
66
- export var arrayParser = function arrayParser(value, props, config, breakpoints) {
67
- var styles = {};
68
- var styleFn = config.styleFn,
69
- prop = config.prop;
70
-
71
- var _value = _toArray(value),
72
- _ = _value[0],
73
- rest = _value.slice(1); // the first index is base styles
74
-
75
-
76
- if (_) Object.assign(styles, styleFn(_, prop, props)); // Map over each value in the array and merge the corresponding breakpoint styles
56
+ export const arrayParser = (value, props, config, breakpoints) => {
57
+ const styles = {};
58
+ const {
59
+ styleFn,
60
+ prop
61
+ } = config;
62
+ const [_, ...rest] = value;
63
+ // the first index is base styles
64
+ if (_) Object.assign(styles, styleFn(_, prop, props));
65
+
66
+ // Map over each value in the array and merge the corresponding breakpoint styles
77
67
  // for that property.
78
-
79
- rest.forEach(function (val, i) {
80
- var breakpointKey = breakpoints[i];
68
+ rest.forEach((val, i) => {
69
+ const breakpointKey = breakpoints[i];
81
70
  if (!breakpointKey || typeof val === 'undefined') return;
82
- Object.assign(styles, _defineProperty({}, breakpointKey, styleFn(val, prop, props)));
71
+ Object.assign(styles, {
72
+ [breakpointKey]: styleFn(val, prop, props)
73
+ });
83
74
  });
84
75
  return styles;
85
76
  };
86
- export var orderBreakpoints = function orderBreakpoints(styles, breakpoints) {
87
- var orderedStyles = omit(styles, breakpoints);
88
- breakpoints.forEach(function (bp) {
77
+ export const orderBreakpoints = (styles, breakpoints) => {
78
+ const orderedStyles = omit(styles, breakpoints);
79
+ breakpoints.forEach(bp => {
89
80
  if (styles[bp]) {
90
81
  orderedStyles[bp] = styles[bp];
91
82
  }
@@ -3,10 +3,10 @@ import { CSSObject } from '../types/props';
3
3
  /**
4
4
  * Returns an type of any object with { key: 'var(--key) }
5
5
  */
6
- export declare type KeyAsVariable<T extends Record<string, any>, Prefix extends string> = {
6
+ export type KeyAsVariable<T extends Record<string, any>, Prefix extends string> = {
7
7
  [V in keyof T]: `var(--${Prefix}-${Extract<V, string>})`;
8
8
  };
9
- declare type SerializedTokensInput = Record<string, string | number | CSSObject | SerializedTokensInputRecursive>;
9
+ type SerializedTokensInput = Record<string, string | number | CSSObject | SerializedTokensInputRecursive>;
10
10
  interface SerializedTokensInputRecursive {
11
11
  [i: number]: SerializedTokensInput;
12
12
  [i: string]: SerializedTokensInput;
@@ -1,38 +1,46 @@
1
- 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; }
1
+ import isObject from 'lodash/isObject';
2
+ import merge from 'lodash/merge';
2
3
 
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ /**
5
+ * Returns an type of any object with { key: 'var(--key) }
6
+ */
4
7
 
5
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
-
7
- import { isObject, merge } from 'lodash';
8
-
9
- var templateBreakpoints = function templateBreakpoints(value, alias, theme) {
8
+ const templateBreakpoints = (value, alias, theme) => {
10
9
  if (isObject(value)) {
11
- var _ = value._,
12
- base = value.base,
13
- rest = _objectWithoutProperties(value, ["_", "base"]);
14
-
15
- var css = _defineProperty({}, alias, _ !== null && _ !== void 0 ? _ : base);
16
-
10
+ const {
11
+ _,
12
+ base,
13
+ ...rest
14
+ } = value;
15
+ const css = {
16
+ [alias]: _ ?? base
17
+ };
17
18
  if (theme) {
18
- var breakpoints = theme.breakpoints;
19
- Object.keys(breakpoints).forEach(function (key) {
20
- css[breakpoints[key]] = _defineProperty({}, alias, rest[key]);
19
+ const {
20
+ breakpoints
21
+ } = theme;
22
+ Object.keys(breakpoints).forEach(key => {
23
+ const breakpointValue = rest[key];
24
+ // Only create CSS rules for breakpoints that have defined values
25
+ if (breakpointValue !== undefined) {
26
+ css[breakpoints[key]] = {
27
+ [alias]: breakpointValue
28
+ };
29
+ }
21
30
  });
22
31
  }
23
-
24
32
  return css;
25
33
  }
26
-
27
- return _defineProperty({}, alias, value);
34
+ return {
35
+ [alias]: value
36
+ };
28
37
  };
29
-
30
- export var serializeTokens = function serializeTokens(tokens, prefix, theme) {
31
- var tokenReferences = {};
32
- var tokenVariables = {};
33
- Object.keys(tokens).forEach(function (key) {
34
- var varName = "--".concat(prefix, "-").concat(key);
35
- tokenReferences[key] = "var(".concat(varName, ")");
38
+ export const serializeTokens = (tokens, prefix, theme) => {
39
+ const tokenReferences = {};
40
+ const tokenVariables = {};
41
+ Object.keys(tokens).forEach(key => {
42
+ const varName = `--${prefix}-${key}`;
43
+ tokenReferences[key] = `var(${varName})`;
36
44
  merge(tokenVariables, templateBreakpoints(tokens[key], varName, theme));
37
45
  });
38
46
  return {
package/package.json CHANGED
@@ -1,47 +1,35 @@
1
1
  {
2
2
  "name": "@codecademy/variance",
3
3
  "description": "Constraint based CSS in JS for building scalable design systems",
4
- "version": "1.0.0-alpha.f6cb5a.0",
4
+ "version": "1.0.0",
5
+ "author": "codecaaron <aaron@codecademy.com>",
6
+ "dependencies": {
7
+ "csstype": "^3.0.7",
8
+ "lodash": "^4.17.23"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "homepage": "https://github.com/Codecademy/gamut/variance",
5
14
  "keywords": [
6
- "emotion",
7
15
  "css",
8
- "styles",
9
- "css-in-js"
16
+ "css-in-js",
17
+ "emotion",
18
+ "styles"
10
19
  ],
11
- "author": "codecaaron <aaron@codecademy.com>",
12
- "homepage": "https://github.com/Codecademy/gamut/variance",
13
20
  "license": "MIT",
14
21
  "main": "dist/index.js",
15
22
  "module": "dist/index.js",
16
- "types": "dist/index.d.ts",
17
- "publishConfig": {
18
- "access": "public"
19
- },
20
- "repository": {
21
- "type": "git",
22
- "url": "git+https://github.com/Codecademy/gamut.git"
23
- },
24
- "scripts": {
25
- "build:clean": "rm -rf ./dist",
26
- "build:compile": "tsc -b",
27
- "build:transpile": "babel ./src --out-dir ./dist --copy-files --extensions \".ts,.tsx\"",
28
- "build": "yarn build:clean && yarn build:compile && yarn build:transpile",
29
- "lernaBuildTask": "yarn build"
30
- },
31
23
  "peerDependencies": {
32
24
  "@emotion/react": "*",
33
25
  "typescript": ">=4.3.5"
34
26
  },
35
- "dependencies": {
36
- "csstype": "^3.0.7",
37
- "lodash": "^4.17.5"
27
+ "publishConfig": {
28
+ "access": "public"
38
29
  },
39
- "devDependencies": {
40
- "@emotion/jest": "^11.3.0",
41
- "@emotion/styled": "^11.3.0",
42
- "@types/react-test-renderer": "^17.0.1",
43
- "react": "17.0.2",
44
- "react-test-renderer": "17.0.2"
30
+ "repository": "Codecademy/gamut.git",
31
+ "scripts": {
32
+ "build": "nx build @codecademy/variance"
45
33
  },
46
- "gitHead": "ff424ba13fc62985621d93a45a2b4296dd2fbe5f"
34
+ "types": "dist/index.d.ts"
47
35
  }
package/CHANGELOG.md DELETED
@@ -1,325 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [1.0.0-alpha.f6cb5a.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.19.0...@codecademy/variance@1.0.0-alpha.f6cb5a.0) (2022-01-19)
7
-
8
-
9
- ### ⚠ BREAKING CHANGES
10
-
11
- * bumped React to 17
12
-
13
- ### Features
14
-
15
- * bumped React to 17 ([4d0d029](https://github.com/Codecademy/gamut/commit/4d0d029ce293d3c4a8331c625bcdcdce93235f2d))
16
-
17
-
18
-
19
- ## 0.19.0 (2021-10-26)
20
-
21
-
22
- ### Features
23
-
24
- * Add admin theme ([7090b30](https://github.com/Codecademy/gamut/commit/7090b303c5451113983e5345316a821ddfaaf1fc))
25
- * bump ESLint configs to latest ([4e3cf77](https://github.com/Codecademy/gamut/commit/4e3cf77928bdd69bce3eeca8a7f07439627b4f08))
26
- * **Anchor:** Variance Migration + ColorMode [GM-203] ([dd0058b](https://github.com/Codecademy/gamut/commit/dd0058b0ba96a2f8cca804884c2d2fcf66951ee4))
27
- * **Buttons:** ColorModes + Props + Refactor + Refs Oh My! [GM-211] [REACH-856] [GM-192] ([998c2cc](https://github.com/Codecademy/gamut/commit/998c2cc01945e8b675a01f60a38bc2a03250ac8e))
28
- * **ColorModes:** Base ColorMode support and serialization of color variables [GM-177] ([9f322b4](https://github.com/Codecademy/gamut/commit/9f322b4ed959e1245a18dbddb42f33be3e0d9356))
29
- * **LayoutGrid:** LayoutGrid conversion + Initial Variance Props [GM-81] ([14a753e](https://github.com/Codecademy/gamut/commit/14a753e2850bd381aa9f6819c5bac623b39e4036))
30
- * **Text:** Add more common utility variants / states as props GM-248 ([ae5d92b](https://github.com/Codecademy/gamut/commit/ae5d92b7091ba2786890eb1a5aecdf93123eb3b0))
31
- * **theme:** createTheme self containment ([87a203c](https://github.com/Codecademy/gamut/commit/87a203c56df8002406552208b8b5ffc55b228262)), closes [#666666](https://github.com/Codecademy/gamut/issues/666666) [#666666](https://github.com/Codecademy/gamut/issues/666666)
32
- * **variance:** Computed styles, and configurable CSSType narrowing [GM-233] ([ddb4091](https://github.com/Codecademy/gamut/commit/ddb40917fe41b0dc741d34f5c34ec6d0bf29dad1))
33
- * Navy scale + color alias changes GM-237 ([3c8a772](https://github.com/Codecademy/gamut/commit/3c8a772271492e0ecc8d724f296f0bfe5ef17112)), closes [#10162](https://github.com/Codecademy/gamut/issues/10162)
34
- * **ThemeBuilder:** TypeSafe theme construction + variable serialization [WEB-1401] ([e0a4c16](https://github.com/Codecademy/gamut/commit/e0a4c163e39b64c7d7290a325c900f05ae5ce4e4))
35
- * **variance:** states boolean toggle styles GM-233 ([a4fa8cf](https://github.com/Codecademy/gamut/commit/a4fa8cf473a1b22648fa480025630a9d1827f84d))
36
- * **Variance:** `css` - Standard CSS Property Passthrough + Selector System Props [WEB-1117] ([7dbb56d](https://github.com/Codecademy/gamut/commit/7dbb56dbc5e4feaf572ded6a27c3f63403df3e65))
37
- * **Variance:** base => _ for un scoped style [WEB-1381] ([2f9e8ba](https://github.com/Codecademy/gamut/commit/2f9e8ba3c472251f6ce71aed8e15e8a669b3588a))
38
- * **Variance:** Experimental MVP for internal use ([0d4d545](https://github.com/Codecademy/gamut/commit/0d4d5450d2a37a12349b632865341857969c9462))
39
- * **Variance:** Initial Props and Refactor Tests [WEB-1390] ([9f29489](https://github.com/Codecademy/gamut/commit/9f294894b49915ea0504749ecdca7e62d46d475e))
40
- * **Variance:** Static CSS Methods `css` and `variant` [WEB-1116] ([cbba228](https://github.com/Codecademy/gamut/commit/cbba228c89fce89026fb14e15a1ec157cf574082))
41
- * **Variance:** Use only the global emotion theme type (Stage 5: Acceptance) [WEB-1382] ([dff7044](https://github.com/Codecademy/gamut/commit/dff704492cd61a762ea315d86625ce78702347b9)), closes [/github.com/Codecademy/client-modules/blob/609bc7f3ab936d856225fb9885d0ae5afeac8b58/packages/variance/src/__tests__/localTheme.ts#L28-L29](https://github.com/Codecademy//github.com/Codecademy/client-modules/blob/609bc7f3ab936d856225fb9885d0ae5afeac8b58/packages/variance/src/__tests__/localTheme.ts/issues/L28-L29)
42
-
43
-
44
- ### Bug Fixes
45
-
46
- * **variance:** Ensure array scales always qualify for transformation ([64ef813](https://github.com/Codecademy/gamut/commit/64ef813d8224525c34e03ed66020753ad487cb1b))
47
- * **variance:** Fix theme computations and add more tests for prop behavior ([078f9db](https://github.com/Codecademy/gamut/commit/078f9dba4f49803c374db6b93eeba878dc3dd2ac))
48
- * Safe deep merge typings ([a190205](https://github.com/Codecademy/gamut/commit/a190205fff6a77cbdc7f9a2989aa824b36fac706))
49
- * Theme extension merge logic ([de3cbf2](https://github.com/Codecademy/gamut/commit/de3cbf25995b6be7769cbb92bc51d13e5f6a6695))
50
- * **Text:** Fontweight for body text and none scalar typings ([fe31fb2](https://github.com/Codecademy/gamut/commit/fe31fb239b9e958022585275025e976c6b559ddd))
51
- * **variance:** Fix static css mutability for `css` [GM-235] ([ab5dd04](https://github.com/Codecademy/gamut/commit/ab5dd04724e120eca3069a44cb22cb92aebc714a))
52
- * **Variance:** Add better prop sorting tests ([ee97906](https://github.com/Codecademy/gamut/commit/ee97906a04246629e1c0ccfd44cdf9131f9e821c))
53
-
54
-
55
-
56
- ### [0.18.1](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.18.0...@codecademy/variance@0.18.1) (2021-09-13)
57
-
58
- **Note:** Version bump only for package @codecademy/variance
59
-
60
-
61
-
62
-
63
-
64
- ## [0.18.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.17.4...@codecademy/variance@0.18.0) (2021-09-10)
65
-
66
-
67
- ### Features
68
-
69
- * bump ESLint configs to latest ([e0a201a](https://github.com/Codecademy/gamut/commit/e0a201abcc5f49718538d3d91af21cb37db4470e))
70
-
71
-
72
-
73
- ### [0.17.4](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.17.3...@codecademy/variance@0.17.4) (2021-08-30)
74
-
75
-
76
- ### Bug Fixes
77
-
78
- * **variance:** Fix theme computations and add more tests for prop behavior ([0cc017a](https://github.com/Codecademy/gamut/commit/0cc017ac3b6a519da9ee4d4d4488a9e0da9029a2))
79
-
80
-
81
-
82
- ### [0.17.3](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.17.2...@codecademy/variance@0.17.3) (2021-08-12)
83
-
84
-
85
- ### Bug Fixes
86
-
87
- * **variance:** Ensure array scales always qualify for transformation ([66f1760](https://github.com/Codecademy/gamut/commit/66f1760c85aa605bae89195801683faab01822e3))
88
-
89
-
90
-
91
- ### [0.17.2](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.17.1...@codecademy/variance@0.17.2) (2021-07-19)
92
-
93
-
94
- ### Bug Fixes
95
-
96
- * Safe deep merge typings ([541272c](https://github.com/Codecademy/gamut/commit/541272c424637c8699c16ef25e3fefb9b17041ea))
97
-
98
-
99
-
100
- ### [0.17.1](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.17.0...@codecademy/variance@0.17.1) (2021-07-16)
101
-
102
-
103
- ### Bug Fixes
104
-
105
- * Theme extension merge logic ([9b32463](https://github.com/Codecademy/gamut/commit/9b32463d044ead994b2c173bc07c5ebbd5511187))
106
-
107
-
108
-
109
- ## [0.17.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.16.0...@codecademy/variance@0.17.0) (2021-07-15)
110
-
111
-
112
- ### Features
113
-
114
- * Add admin theme ([c5f7bf9](https://github.com/Codecademy/gamut/commit/c5f7bf9faaf86b2aca3f8dffd67480d50999be7b))
115
-
116
-
117
-
118
- ## [0.16.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.15.0...@codecademy/variance@0.16.0) (2021-06-16)
119
-
120
-
121
- ### Features
122
-
123
- * **variance:** Computed styles, and configurable CSSType narrowing [GM-233] ([c258c19](https://github.com/Codecademy/gamut/commit/c258c19b7970b41361b6cfafe76e2a52b7b4c828))
124
-
125
-
126
-
127
- ## [0.15.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.14.0...@codecademy/variance@0.15.0) (2021-06-16)
128
-
129
-
130
- ### Features
131
-
132
- * **Text:** Add more common utility variants / states as props GM-248 ([85b541c](https://github.com/Codecademy/gamut/commit/85b541cbb85ef5c60b8012196680e1062d469ad1))
133
-
134
-
135
-
136
- ## [0.14.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.13.0...@codecademy/variance@0.14.0) (2021-06-10)
137
-
138
-
139
- ### Features
140
-
141
- * Navy scale + color alias changes GM-237 ([bf896dd](https://github.com/Codecademy/gamut/commit/bf896dd3fcf0435ef557694740d96df38d12173b)), closes [#10162](https://github.com/Codecademy/gamut/issues/10162)
142
-
143
-
144
-
145
- ## [0.13.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.12.1...@codecademy/variance@0.13.0) (2021-06-10)
146
-
147
-
148
- ### Features
149
-
150
- * **variance:** states boolean toggle styles GM-233 ([e463f0e](https://github.com/Codecademy/gamut/commit/e463f0e77802a3565ddda4de2e14050372923678))
151
-
152
-
153
-
154
- ### [0.12.1](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.12.0...@codecademy/variance@0.12.1) (2021-06-02)
155
-
156
-
157
- ### Bug Fixes
158
-
159
- * **variance:** Fix static css mutability for `css` [GM-235] ([5eab7d9](https://github.com/Codecademy/gamut/commit/5eab7d99865947002a545db0ff372454b09494d3))
160
-
161
-
162
-
163
- ## [0.12.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.11.2...@codecademy/variance@0.12.0) (2021-05-18)
164
-
165
-
166
- ### Features
167
-
168
- * **theme:** createTheme self containment ([59ddff7](https://github.com/Codecademy/gamut/commit/59ddff7224cd8e0972212dd6ba1696f40ccac835)), closes [#666666](https://github.com/Codecademy/gamut/issues/666666) [#666666](https://github.com/Codecademy/gamut/issues/666666)
169
-
170
-
171
-
172
- ### [0.11.2](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.11.1...@codecademy/variance@0.11.2) (2021-05-07)
173
-
174
- **Note:** Version bump only for package @codecademy/variance
175
-
176
-
177
-
178
-
179
-
180
- ### [0.11.1](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.11.0...@codecademy/variance@0.11.1) (2021-05-03)
181
-
182
- **Note:** Version bump only for package @codecademy/variance
183
-
184
-
185
-
186
-
187
-
188
- ## [0.11.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.10.1...@codecademy/variance@0.11.0) (2021-04-29)
189
-
190
-
191
- ### Features
192
-
193
- * **Buttons:** ColorModes + Props + Refactor + Refs Oh My! [GM-211] [REACH-856] [GM-192] ([c4643db](https://github.com/Codecademy/gamut/commit/c4643db64d3684319f8d5fc6f68d05197ec1f61e))
194
-
195
-
196
-
197
- ### [0.10.1](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.10.0...@codecademy/variance@0.10.1) (2021-04-27)
198
-
199
-
200
- ### Bug Fixes
201
-
202
- * **Text:** Fontweight for body text and none scalar typings ([aa113dc](https://github.com/Codecademy/gamut/commit/aa113dcaee4bffd7a23c9acf87308c32816f07fe))
203
-
204
-
205
-
206
- ## [0.10.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.9.0...@codecademy/variance@0.10.0) (2021-04-26)
207
-
208
-
209
- ### Features
210
-
211
- * **Anchor:** Variance Migration + ColorMode [GM-203] ([d5ae675](https://github.com/Codecademy/gamut/commit/d5ae6758c65a837066562eb0ed8b964176889148))
212
-
213
-
214
-
215
- ## [0.9.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.8.0...@codecademy/variance@0.9.0) (2021-04-15)
216
-
217
-
218
- ### Features
219
-
220
- * **LayoutGrid:** LayoutGrid conversion + Initial Variance Props [GM-81] ([2b51494](https://github.com/Codecademy/gamut/commit/2b514940871759b66f91aa1f333be558e1ee517a))
221
-
222
-
223
-
224
- ## [0.8.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.7.1...@codecademy/variance@0.8.0) (2021-04-15)
225
-
226
-
227
- ### Features
228
-
229
- * **ThemeBuilder:** TypeSafe theme construction + variable serialization [WEB-1401] ([8ccae3d](https://github.com/Codecademy/gamut/commit/8ccae3d2081df94525269e443ac1b335953597c7))
230
-
231
-
232
-
233
- ### [0.7.1](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.7.0...@codecademy/variance@0.7.1) (2021-04-09)
234
-
235
-
236
- ### Bug Fixes
237
-
238
- * **Variance:** Add better prop sorting tests ([c5e7d49](https://github.com/Codecademy/gamut/commit/c5e7d494930ff4cb1bd304d2d220148a0bbe2fad))
239
-
240
-
241
-
242
- ## [0.7.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.6.0...@codecademy/variance@0.7.0) (2021-04-08)
243
-
244
-
245
- ### Features
246
-
247
- * **ColorModes:** Base ColorMode support and serialization of color variables [GM-177] ([b588132](https://github.com/Codecademy/gamut/commit/b5881326ace09f0b1b7052f24e59ecb5b8326aef))
248
-
249
-
250
-
251
- ## [0.6.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.5.0...@codecademy/variance@0.6.0) (2021-04-06)
252
-
253
-
254
- ### Features
255
-
256
- * **Variance:** Initial Props and Refactor Tests [WEB-1390] ([e4b5177](https://github.com/Codecademy/gamut/commit/e4b5177544643fec274d20f37be594b140a4cba3))
257
-
258
-
259
-
260
- ## [0.5.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.4.0...@codecademy/variance@0.5.0) (2021-03-31)
261
-
262
-
263
- ### Features
264
-
265
- * **Variance:** Use only the global emotion theme type (Stage 5: Acceptance) [WEB-1382] ([e4215e9](https://github.com/Codecademy/gamut/commit/e4215e9aacb2092ed77cd530822c5389c7b47123)), closes [/github.com/Codecademy/gamut/blob/609bc7f3ab936d856225fb9885d0ae5afeac8b58/packages/variance/src/__tests__/localTheme.ts#L28-L29](https://github.com/Codecademy//github.com/Codecademy/gamut/blob/609bc7f3ab936d856225fb9885d0ae5afeac8b58/packages/variance/src/__tests__/localTheme.ts/issues/L28-L29)
266
-
267
-
268
-
269
- ## [0.4.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.3.0...@codecademy/variance@0.4.0) (2021-03-31)
270
-
271
-
272
- ### Features
273
-
274
- * **Variance:** base => _ for un scoped style [WEB-1381] ([f3d254c](https://github.com/Codecademy/gamut/commit/f3d254cccc3dc3cd074df070a51ed8a2ca232a74))
275
-
276
-
277
-
278
- ## [0.3.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.2.1...@codecademy/variance@0.3.0) (2021-03-31)
279
-
280
-
281
- ### Features
282
-
283
- * **Variance:** `css` - Standard CSS Property Passthrough + Selector System Props [WEB-1117] ([6c2c48d](https://github.com/Codecademy/gamut/commit/6c2c48dc96012bc685ca4ab93d189d1e39d266b1))
284
-
285
-
286
-
287
- ### [0.2.1](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.2.0...@codecademy/variance@0.2.1) (2021-03-30)
288
-
289
- **Note:** Version bump only for package @codecademy/variance
290
-
291
-
292
-
293
-
294
-
295
- ## [0.2.0](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.1.2...@codecademy/variance@0.2.0) (2021-03-30)
296
-
297
-
298
- ### Features
299
-
300
- * **Variance:** Static CSS Methods `css` and `variant` [WEB-1116] ([b9915f5](https://github.com/Codecademy/gamut/commit/b9915f54bc738d81e46cb84744a44e8bfbdd29a0))
301
-
302
-
303
-
304
- ### [0.1.2](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.1.1...@codecademy/variance@0.1.2) (2021-03-30)
305
-
306
- **Note:** Version bump only for package @codecademy/variance
307
-
308
-
309
-
310
-
311
-
312
- ### [0.1.1](https://github.com/Codecademy/gamut/compare/@codecademy/variance@0.1.0...@codecademy/variance@0.1.1) (2021-03-19)
313
-
314
- **Note:** Version bump only for package @codecademy/variance
315
-
316
-
317
-
318
-
319
-
320
- ## 0.1.0 (2021-03-02)
321
-
322
-
323
- ### Features
324
-
325
- * **Variance:** Experimental MVP for internal use ([4422f3d](https://github.com/Codecademy/gamut/commit/4422f3d340ce4e52f7f96f01c4dd01b88c1a677d))
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2016 Ryzac, Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/babel.config.js DELETED
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- presets: ['codecademy', '@babel/preset-typescript'],
3
- include: ['./src/**/*'],
4
- ignore: ['**/__tests__', './**/*.d.ts'],
5
- };