@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.
- package/dist/AssetProvider.js +14 -16
- package/dist/Background.js +28 -45
- package/dist/ColorMode.js +69 -76
- package/dist/GamutProvider.js +19 -19
- package/dist/cache/createEmotionCache.js +11 -26
- package/dist/cache/stylisPlugins/focusVisible.js +4 -4
- package/dist/globals/Reboot.js +4 -6
- package/dist/globals/Typography.js +18 -20
- package/dist/globals/Variables.js +11 -19
- package/dist/remoteAssets/fonts.js +8 -8
- package/dist/styles/boxShadow.js +10 -20
- package/dist/styles/fontSmoothing.js +5 -7
- package/dist/styles/noSelect.js +1 -1
- package/dist/styles/pxRem.js +3 -3
- package/dist/styles/responsive.js +4 -6
- package/dist/styles/screenReaderOnly.js +2 -2
- package/dist/styles/transitionConcat.js +4 -4
- package/dist/themes/admin.js +1 -1
- package/dist/themes/core.js +13 -11
- package/dist/themes/platform.js +1 -1
- package/dist/utilities/themed.js +4 -2
- package/dist/variables/colors.js +19 -18
- package/dist/variables/deprecated-colors.js +17 -16
- package/dist/variables/elements.js +1 -1
- package/dist/variables/responsive.js +4 -6
- package/dist/variables/spacing.js +1 -1
- package/dist/variables/timing.js +5 -5
- package/dist/variables/typography.js +14 -8
- package/dist/variance/config.js +47 -31
- package/dist/variance/index.js +1 -2
- package/dist/variance/props.js +15 -15
- package/dist/variance/utils.js +6 -14
- package/package.json +14 -17
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { pxRem } from '../styles/pxRem';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
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
|
|
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
|
|
29
|
+
export const lineHeight = {
|
|
24
30
|
base: 1.5,
|
|
25
31
|
spacedTitle: 1.3,
|
|
26
32
|
title: 1.2
|
|
27
33
|
};
|
|
28
|
-
export
|
|
34
|
+
export const fontWeight = {
|
|
29
35
|
base: 400,
|
|
30
36
|
title: 700,
|
|
31
37
|
700: 700,
|
package/dist/variance/config.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
190
|
-
|
|
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
|
|
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
|
-
|
|
215
|
-
|
|
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
|
|
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
|
-
|
|
267
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
370
|
-
|
|
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
|
|
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
|
|
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
|
|
471
|
-
|
|
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
|
+
};
|
package/dist/variance/index.js
CHANGED
package/dist/variance/props.js
CHANGED
|
@@ -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
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
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
|
|
18
|
-
export
|
|
17
|
+
export const padding = variance.create(PROPERTIES.padding);
|
|
18
|
+
export const margin = variance.create(PROPERTIES.margin);
|
|
19
19
|
|
|
20
20
|
/** CSS */
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
21
|
+
export const css = variance.createCss(PROPERTIES.all);
|
|
22
|
+
export const variant = variance.createVariant(PROPERTIES.all);
|
|
23
|
+
export const states = variance.createStates(PROPERTIES.all);
|
package/dist/variance/utils.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
9
|
+
const validPropnames = allPropnames.filter(isPropValid);
|
|
16
10
|
export function createStyledOptions() {
|
|
17
|
-
|
|
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
|
-
|
|
13
|
+
const additionalExclusions = additional.filter(isPropValid);
|
|
20
14
|
return {
|
|
21
|
-
shouldForwardProp:
|
|
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
|
|
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.
|
|
4
|
+
"version": "16.1.4-alpha.6a1d33.0",
|
|
5
5
|
"author": "Jake Hiller <jake@codecademy.com>",
|
|
6
|
-
"
|
|
7
|
-
|
|
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
|
-
"
|
|
17
|
-
|
|
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
|
-
"
|
|
33
|
+
"repository": "git@github.com:Codecademy/gamut.git",
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "nx build @codecademy/gamut-styles"
|
|
36
|
+
},
|
|
37
|
+
"gitHead": "18f61d5f7ddfbcac70bf7cd130922f31eef3593c"
|
|
41
38
|
}
|