@codecademy/gamut-styles 16.1.3 → 16.1.4-alpha.6a1d33.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.
@@ -1,15 +1,21 @@
1
1
  import { pxRem } from '../styles/pxRem';
2
- export var fontAccent = "\"Suisse\", \"Apercu\", -apple-system, BlinkMacSystemFont,\n\"Segoe UI\", \"Roboto\", \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\",\n\"Helvetica Neue\", sans-serif";
3
- export var fontBase = "\"Apercu\", -apple-system, BlinkMacSystemFont, \"Segoe UI\",\n\"Roboto\", \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\nsans-serif";
4
- export var fontMonospace = "Monaco, Menlo, \"Ubuntu Mono\", \"Droid Sans Mono\", Consolas,\nmonospace";
5
- export var fontSystem = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Ubuntu\",\n\"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif";
6
- export var fontFamily = {
2
+ export const fontAccent = `"Suisse", "Apercu", -apple-system, BlinkMacSystemFont,
3
+ "Segoe UI", "Roboto", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
4
+ "Helvetica Neue", sans-serif`;
5
+ export const fontBase = `"Apercu", -apple-system, BlinkMacSystemFont, "Segoe UI",
6
+ "Roboto", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
7
+ sans-serif`;
8
+ export const fontMonospace = `Monaco, Menlo, "Ubuntu Mono", "Droid Sans Mono", Consolas,
9
+ monospace`;
10
+ export const fontSystem = `-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Ubuntu",
11
+ "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif`;
12
+ export const fontFamily = {
7
13
  accent: fontAccent,
8
14
  base: fontBase,
9
15
  monospace: fontMonospace,
10
16
  system: fontSystem
11
17
  };
12
- export var fontSize = {
18
+ export const fontSize = {
13
19
  64: pxRem(64),
14
20
  44: pxRem(44),
15
21
  34: pxRem(34),
@@ -20,12 +26,12 @@ export var fontSize = {
20
26
  16: pxRem(16),
21
27
  14: pxRem(14)
22
28
  };
23
- export var lineHeight = {
29
+ export const lineHeight = {
24
30
  base: 1.5,
25
31
  spacedTitle: 1.3,
26
32
  title: 1.2
27
33
  };
28
- export var fontWeight = {
34
+ export const fontWeight = {
29
35
  base: 400,
30
36
  title: 700,
31
37
  700: 700,
@@ -1,11 +1,5 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
1
  import { transformSize } from '@codecademy/variance';
8
- export var color = {
2
+ export const color = {
9
3
  color: {
10
4
  property: 'color',
11
5
  scale: 'colors'
@@ -49,7 +43,7 @@ export var color = {
49
43
  scale: 'colors'
50
44
  }
51
45
  };
52
- export var border = {
46
+ export const border = {
53
47
  // Border
54
48
  border: {
55
49
  property: 'border',
@@ -162,7 +156,7 @@ export var border = {
162
156
  property: 'borderBottomStyle'
163
157
  }
164
158
  };
165
- var selfAlignments = {
159
+ const selfAlignments = {
166
160
  justifySelf: {
167
161
  property: 'justifySelf'
168
162
  },
@@ -173,7 +167,7 @@ var selfAlignments = {
173
167
  property: 'gridArea'
174
168
  }
175
169
  };
176
- var alignments = _objectSpread({
170
+ const alignments = {
177
171
  justifyContent: {
178
172
  property: 'justifyContent'
179
173
  },
@@ -185,9 +179,10 @@ var alignments = _objectSpread({
185
179
  },
186
180
  alignContent: {
187
181
  property: 'alignContent'
188
- }
189
- }, selfAlignments);
190
- var flexItems = {
182
+ },
183
+ ...selfAlignments
184
+ };
185
+ const flexItems = {
191
186
  flexBasis: {
192
187
  property: 'flexBasis'
193
188
  },
@@ -201,7 +196,7 @@ var flexItems = {
201
196
  property: 'order'
202
197
  }
203
198
  };
204
- export var flex = _objectSpread(_objectSpread({
199
+ export const flex = {
205
200
  flexDirection: {
206
201
  property: 'flexDirection'
207
202
  },
@@ -210,9 +205,11 @@ export var flex = _objectSpread(_objectSpread({
210
205
  },
211
206
  flex: {
212
207
  property: 'flex'
213
- }
214
- }, alignments), flexItems);
215
- var gridItems = {
208
+ },
209
+ ...alignments,
210
+ ...flexItems
211
+ };
212
+ const gridItems = {
216
213
  gridColumn: {
217
214
  property: 'gridColumn'
218
215
  },
@@ -232,7 +229,7 @@ var gridItems = {
232
229
  property: 'gridRowEnd'
233
230
  }
234
231
  };
235
- export var grid = _objectSpread(_objectSpread({
232
+ export const grid = {
236
233
  gridAutoColumns: {
237
234
  property: 'gridAutoColumns'
238
235
  },
@@ -262,9 +259,11 @@ export var grid = _objectSpread(_objectSpread({
262
259
  columnGap: {
263
260
  property: 'columnGap',
264
261
  scale: 'spacing'
265
- }
266
- }, alignments), gridItems);
267
- export var background = {
262
+ },
263
+ ...alignments,
264
+ ...gridItems
265
+ };
266
+ export const background = {
268
267
  background: {
269
268
  property: 'background'
270
269
  },
@@ -281,7 +280,7 @@ export var background = {
281
280
  property: 'backgroundPosition'
282
281
  }
283
282
  };
284
- export var positioning = {
283
+ export const positioning = {
285
284
  position: {
286
285
  property: 'position'
287
286
  },
@@ -313,7 +312,7 @@ export var positioning = {
313
312
  property: 'opacity'
314
313
  }
315
314
  };
316
- export var shadows = {
315
+ export const shadows = {
317
316
  boxShadow: {
318
317
  property: 'boxShadow'
319
318
  },
@@ -321,7 +320,7 @@ export var shadows = {
321
320
  property: 'textShadow'
322
321
  }
323
322
  };
324
- export var layout = _objectSpread(_objectSpread(_objectSpread({
323
+ export const layout = {
325
324
  display: {
326
325
  property: 'display'
327
326
  },
@@ -365,9 +364,12 @@ export var layout = _objectSpread(_objectSpread(_objectSpread({
365
364
  },
366
365
  verticalAlign: {
367
366
  property: 'verticalAlign'
368
- }
369
- }, selfAlignments), gridItems), flexItems);
370
- export var typography = {
367
+ },
368
+ ...selfAlignments,
369
+ ...gridItems,
370
+ ...flexItems
371
+ };
372
+ export const typography = {
371
373
  fontFamily: {
372
374
  property: 'fontFamily',
373
375
  scale: 'fontFamily'
@@ -403,7 +405,7 @@ export var typography = {
403
405
  property: 'whiteSpace'
404
406
  }
405
407
  };
406
- export var margin = {
408
+ export const margin = {
407
409
  m: {
408
410
  property: 'margin',
409
411
  scale: 'spacing'
@@ -435,7 +437,7 @@ export var margin = {
435
437
  scale: 'spacing'
436
438
  }
437
439
  };
438
- export var padding = {
440
+ export const padding = {
439
441
  p: {
440
442
  property: 'padding',
441
443
  scale: 'spacing'
@@ -467,5 +469,19 @@ export var padding = {
467
469
  scale: 'spacing'
468
470
  }
469
471
  };
470
- export var space = _objectSpread(_objectSpread({}, margin), padding);
471
- export var all = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, typography), space), shadows), grid), flex), layout), positioning), border), background), color);
472
+ export const space = {
473
+ ...margin,
474
+ ...padding
475
+ };
476
+ export const all = {
477
+ ...typography,
478
+ ...space,
479
+ ...shadows,
480
+ ...grid,
481
+ ...flex,
482
+ ...layout,
483
+ ...positioning,
484
+ ...border,
485
+ ...background,
486
+ ...color
487
+ };
@@ -1,4 +1,3 @@
1
- import * as _system from './props';
2
- export { _system as system };
1
+ export * as system from './props';
3
2
  export { css, variant, states } from './props';
4
3
  export * from './utils';
@@ -2,22 +2,22 @@ import { variance } from '@codecademy/variance';
2
2
  import * as PROPERTIES from './config';
3
3
 
4
4
  /** General Prop Groups */
5
- export var typography = variance.create(PROPERTIES.typography);
6
- export var grid = variance.create(PROPERTIES.grid);
7
- export var flex = variance.create(PROPERTIES.flex);
8
- export var layout = variance.create(PROPERTIES.layout);
9
- export var positioning = variance.create(PROPERTIES.positioning);
10
- export var background = variance.create(PROPERTIES.background);
11
- export var color = variance.create(PROPERTIES.color);
12
- export var shadow = variance.create(PROPERTIES.shadows);
13
- export var space = variance.create(PROPERTIES.space);
14
- export var border = variance.create(PROPERTIES.border);
5
+ export const typography = variance.create(PROPERTIES.typography);
6
+ export const grid = variance.create(PROPERTIES.grid);
7
+ export const flex = variance.create(PROPERTIES.flex);
8
+ export const layout = variance.create(PROPERTIES.layout);
9
+ export const positioning = variance.create(PROPERTIES.positioning);
10
+ export const background = variance.create(PROPERTIES.background);
11
+ export const color = variance.create(PROPERTIES.color);
12
+ export const shadow = variance.create(PROPERTIES.shadows);
13
+ export const space = variance.create(PROPERTIES.space);
14
+ export const border = variance.create(PROPERTIES.border);
15
15
 
16
16
  /** Sub Groups */
17
- export var padding = variance.create(PROPERTIES.padding);
18
- export var margin = variance.create(PROPERTIES.margin);
17
+ export const padding = variance.create(PROPERTIES.padding);
18
+ export const margin = variance.create(PROPERTIES.margin);
19
19
 
20
20
  /** CSS */
21
- export var css = variance.createCss(PROPERTIES.all);
22
- export var variant = variance.createVariant(PROPERTIES.all);
23
- export var states = variance.createStates(PROPERTIES.all);
21
+ export const css = variance.createCss(PROPERTIES.all);
22
+ export const variant = variance.createVariant(PROPERTIES.all);
23
+ export const states = variance.createStates(PROPERTIES.all);
@@ -1,26 +1,18 @@
1
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- 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); }
4
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
- 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; }
7
1
  import isPropValid from '@emotion/is-prop-valid';
8
2
  import { all as allProps } from './config';
9
- var allPropnames = ['mode', 'variant'].concat(_toConsumableArray(Object.keys(allProps)));
3
+ const allPropnames = ['mode', 'variant', ...Object.keys(allProps)];
10
4
 
11
5
  /**
12
6
  * Emotion will not attempt to forward all system props - so this pre filters all possible exceptions to search agains
13
7
  * props like `color` and `width`.
14
8
  */
15
- var validPropnames = allPropnames.filter(isPropValid);
9
+ const validPropnames = allPropnames.filter(isPropValid);
16
10
  export function createStyledOptions() {
17
- var additional = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
11
+ let additional = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
18
12
  // Cache possible valid prop names to prevent searching a larger list.
19
- var additionalExclusions = additional.filter(isPropValid);
13
+ const additionalExclusions = additional.filter(isPropValid);
20
14
  return {
21
- shouldForwardProp: function shouldForwardProp(prop) {
22
- return isPropValid(prop) && !validPropnames.includes(prop) && !additionalExclusions.includes(prop);
23
- }
15
+ shouldForwardProp: prop => isPropValid(prop) && !validPropnames.includes(prop) && !additionalExclusions.includes(prop)
24
16
  };
25
17
  }
26
18
 
@@ -40,4 +32,4 @@ export function createStyledOptions() {
40
32
  * styled(Box)()
41
33
  *
42
34
  */
43
- export var styledOptions = Object.assign(createStyledOptions, createStyledOptions());
35
+ export const styledOptions = Object.assign(createStyledOptions, createStyledOptions());
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@codecademy/gamut-styles",
3
3
  "description": "Styleguide & Component library for codecademy.com",
4
- "version": "16.1.3",
4
+ "version": "16.1.4-alpha.6a1d33.0",
5
5
  "author": "Jake Hiller <jake@codecademy.com>",
6
- "main": "dist/index.js",
7
- "module": "dist/index.js",
6
+ "dependencies": {
7
+ "@codecademy/variance": "0.21.2-alpha.6a1d33.0",
8
+ "@emotion/is-prop-valid": "^1.1.0",
9
+ "polished": "^4.1.2"
10
+ },
8
11
  "files": [
9
12
  "dist",
10
13
  "core",
@@ -13,18 +16,9 @@
13
16
  "core.scss",
14
17
  "utils.scss"
15
18
  ],
16
- "scripts": {
17
- "build": "nx build @codecademy/gamut-styles"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "git@github.com:Codecademy/gamut.git"
22
- },
23
- "dependencies": {
24
- "@codecademy/variance": "0.21.1",
25
- "@emotion/is-prop-valid": "^1.1.0",
26
- "polished": "^4.1.2"
27
- },
19
+ "license": "MIT",
20
+ "main": "dist/index.js",
21
+ "module": "dist/index.js",
28
22
  "peerDependencies": {
29
23
  "@emotion/cache": "^11.4.0",
30
24
  "@emotion/react": "^11.4.0",
@@ -33,9 +27,12 @@
33
27
  "react": "^17.0.2 || ^18.2.0",
34
28
  "stylis": "^4.0.7"
35
29
  },
36
- "license": "MIT",
37
30
  "publishConfig": {
38
31
  "access": "public"
39
32
  },
40
- "gitHead": "baa23988e9eb59834cafd89bbfd7923dfe1039d9"
33
+ "repository": "git@github.com:Codecademy/gamut.git",
34
+ "scripts": {
35
+ "build": "nx build @codecademy/gamut-styles"
36
+ },
37
+ "gitHead": "18f61d5f7ddfbcac70bf7cd130922f31eef3593c"
41
38
  }