@mapbox/assembly 1.2.0 → 1.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapbox/assembly",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "A CSS framework",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -52,19 +52,19 @@
52
52
  "concat-with-sourcemaps": "^1.1.0",
53
53
  "cp-file": "^6.0.0",
54
54
  "csso": "^4.2.0",
55
- "globby": "^8.0.1",
55
+ "globby": "^10.0.0",
56
56
  "indent-string": "^3.1.0",
57
57
  "mkdirp": "^0.5.1",
58
- "optimize-js": "^1.0.2",
58
+ "optimize-js": "^1.0.3",
59
59
  "p-queue": "^2.4.2",
60
60
  "pify": "^3.0.0",
61
61
  "postcss": "^8.2.8",
62
62
  "postcss-custom-media": "^8.0.0",
63
- "postcss-custom-properties": "^7.0.0",
63
+ "postcss-custom-properties": "^12.1.8",
64
64
  "postcss-reporter": "^7.0.0",
65
65
  "strip-indent": "^2.0.0",
66
- "svgo": "^1.0.5",
67
- "svgstore": "^2.0.3",
66
+ "svgo": "^2.8.0",
67
+ "svgstore": "^3.0.1",
68
68
  "uglify-js": "^3.4.3"
69
69
  },
70
70
  "devDependencies": {
@@ -86,13 +86,13 @@
86
86
  "eslint-plugin-react": "^7.23.2",
87
87
  "execall": "^1.0.0",
88
88
  "gzip-size": "^5.0.0",
89
- "highlight.js": "^9.8.0",
89
+ "highlight.js": "^11.5.1",
90
90
  "husky": "^0.14.3",
91
91
  "jest": "^26.6.3",
92
92
  "lint-staged": "7.2.0",
93
93
  "lodash": "^4.17.21",
94
94
  "mime": "^2.3.1",
95
- "nodemon": "^1.17.5",
95
+ "nodemon": "^2.0.18",
96
96
  "npm-run-all": "^4.1.3",
97
97
  "postcss-discard-comments": "^4.0.0",
98
98
  "prettier": "1.13.7",
@@ -101,11 +101,11 @@
101
101
  "react": "^16.14.0",
102
102
  "react-dom": "^16.14.0",
103
103
  "react-helmet": "^6.1.0",
104
- "react-lowlight": "^2.0.0",
105
- "remark": "^9.0.0",
106
- "remark-react": "^4.0.3",
107
- "stylelint": "^9.3.0",
108
- "tap-spec": "^5.0.0",
104
+ "react-lowlight": "^3.0.0",
105
+ "remark": "^14.0.2",
106
+ "remark-react": "^9.0.1",
107
+ "stylelint": "^14.9.1",
108
+ "tap-spec": "^2.2.2",
109
109
  "tape": "^4.9.1",
110
110
  "xml2js": "^0.4.19"
111
111
  },
@@ -10,7 +10,7 @@ const postcss = require('postcss');
10
10
  const csso = require('csso');
11
11
  const reporter = require('postcss-reporter');
12
12
  const autoprefixer = require('autoprefixer');
13
- const initPostcssCustomProperties = require('postcss-custom-properties');
13
+ const postcssCustomProperties = require('postcss-custom-properties');
14
14
  const postcssCustomMedia = require('postcss-custom-media');
15
15
  const defaultVariables = require('../src/variables');
16
16
  const defaultMediaQueries = require('../src/media-queries');
@@ -102,11 +102,13 @@ function buildCss(options) {
102
102
  ? Object.assign({}, defaultMediaQueries, options.mediaQueries)
103
103
  : defaultMediaQueries;
104
104
 
105
- const customProperties = initPostcssCustomProperties({
105
+ const customProperties = postcssCustomProperties({
106
106
  preserve: false,
107
- warnings: true
107
+ warnings: true,
108
+ importFrom: {
109
+ customProperties: variableDefinitions
110
+ }
108
111
  });
109
- customProperties.setVariables(variableDefinitions);
110
112
 
111
113
  const postcssPlugins = [
112
114
  customProperties,
@@ -5,18 +5,19 @@ const _ = require('lodash');
5
5
  const fs = require('fs');
6
6
  const pify = require('pify');
7
7
  const path = require('path');
8
- const SVGO = require('svgo');
8
+ const { optimize } = require('svgo');
9
9
 
10
10
  const svgDir = path.join(__dirname, '../src/svgs');
11
- const svgo = new SVGO({
11
+ const options = {
12
12
  plugins: [
13
13
  {
14
- removeAttrs: {
14
+ name: 'removeAttrs',
15
+ params: {
15
16
  attrs: 'path:(fill|color|style|width|height|overflow)'
16
17
  }
17
18
  }
18
19
  ]
19
- });
20
+ };
20
21
 
21
22
  const baseJsTemplate = options => {
22
23
  return `
@@ -50,7 +51,7 @@ function processSvgFile(filename) {
50
51
 
51
52
  return pify(fs.readFile)(filename, 'utf8')
52
53
  .then(content => {
53
- return svgo.optimize(content);
54
+ return optimize(content, options);
54
55
  })
55
56
  .then(optimizedContent => {
56
57
  spriteItems.push({
package/src/layout.css CHANGED
@@ -51,6 +51,7 @@
51
51
  .col--auto {
52
52
  width: auto !important;
53
53
  flex: auto;
54
+ flex-basis: 0;
54
55
  }
55
56
 
56
57
  /**
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ <svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M7.6,3.5c0,0.1,0,0.2-0.1,0.2s-0.1,0-0.2-0.1L6.5,1.9c0-0.1,0-0.2,0.1-0.2s0.1,0,0.2,0.1L7.6,3.5L7.6,3.5z"/>
4
+ <path d="M10.3,3.4l0.8-1.7c0.1-0.1,0.1-0.1,0.2-0.1c0.1,0,0.1,0.1,0.1,0.2l-0.8,1.7c-0.1,0.1-0.1,0.1-0.2,0.1&#xA;&#x9;C10.3,3.6,10.3,3.5,10.3,3.4L10.3,3.4z"/>
5
+ <path d="M15.1,11.2c0,0.5-0.4,0.9-0.8,0.9c-0.5,0-0.8-0.4-0.8-0.9V7.4c0-0.5,0.4-0.9,0.8-0.9c0.5,0,0.8,0.4,0.8,0.9&#xA;&#x9;V11.2z"/>
6
+ <path d="M4.4,11.3c0,0.5-0.4,0.9-0.8,0.9c-0.5,0-0.8-0.4-0.8-0.9V7.5c0-0.5,0.4-0.9,0.8-0.9c0.5,0,0.8,0.4,0.8,0.9&#xA;&#x9;V11.3z"/>
7
+ <path d="M5,7v6.4C5,13.7,5.3,14,5.6,14h0.8v1.7c0,0.5,0.3,0.9,0.8,0.9c0.4,0,0.8-0.4,0.8-0.9V14h2v1.6c0,0.5,0.3,0.9,0.8,0.9&#xA;&#x9;c0.4,0,0.8-0.4,0.8-0.9V14h0.8c0.3,0,0.6-0.3,0.6-0.6V7H5z"/>
8
+ <path d="M10.8,4.7c-0.2,0-0.3-0.2-0.3-0.3c0-0.2,0.1-0.3,0.3-0.3s0.3,0.2,0.3,0.3C11.1,4.6,10.9,4.7,10.8,4.7L10.8,4.7&#xA;&#x9;z M7.2,4.7C7,4.7,6.9,4.5,6.9,4.4c0-0.2,0.1-0.3,0.3-0.3c0.2,0,0.3,0.2,0.3,0.3C7.5,4.6,7.3,4.7,7.2,4.7L7.2,4.7z M9,2.5&#xA;&#x9;c-2.1,0-3.8,1.6-4,3.7h8C12.7,4.1,11,2.5,9,2.5L9,2.5z"/>
9
+ </svg>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ <svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M3.4,9.2C3.5,8.1,3.8,6.9,4.9,6c0.9-0.7,1.8-0.8,2.9-0.5c1.4,0.5,1,0.5,2.4,0c1.5-0.6,3,0,3.7,0.8&#xA; c0.1,0.2,0.2,0.3,0,0.4c-1.8,1.3-1.6,3.9,0.3,5c0.2,0.1,0.3,0.2,0.2,0.4c-0.4,1-1,1.9-1.7,2.7c-0.5,0.5-1.1,0.7-1.8,0.4&#xA; c-0.1,0-0.3-0.1-0.4-0.1C9.6,15,8.8,15,8,15.3c-0.3,0.1-0.5,0.2-0.8,0.3c-0.4,0.1-0.8-0.1-1.1-0.4c-0.7-0.5-1.1-1.2-1.5-1.9&#xA; C3.9,12.2,3.4,10.6,3.4,9.2"/>
4
+ <path d="M11.6,2.5c0,1.2-1,2.4-2,2.7C9,5.3,8.8,5.2,8.9,4.6c0.2-1.2,1.2-2.2,2.5-2.5c0.2,0,0.2,0,0.2,0.2&#xA; C11.6,2.3,11.6,2.4,11.6,2.5"/>
5
+ </svg>
@@ -1,115 +1,115 @@
1
1
  {
2
- "gray-dark": "#1a2224",
3
- "gray-deep": "#4D5255",
4
- "gray": "#757D82",
5
- "gray-light": "#C7CACC",
6
- "gray-lighter": "#E4E6E7",
7
- "gray-faint": "#F7F8F8",
8
-
9
- "pink-dark": "#800C3C",
10
- "pink-deep": "#BA1258",
11
- "pink": "#FA428F",
12
- "pink-light": "#FABDD6",
13
- "pink-lighter": "#FCD4E4",
14
- "pink-faint": "#FDEEF4",
15
-
16
- "red-dark": "#741806",
17
- "red-deep": "#B6290D",
18
- "red": "#EB3814",
19
- "red-light": "#F8C4B9",
20
- "red-lighter": "#FED7CD",
21
- "red-faint": "#FDEBE7",
22
-
23
- "orange-dark": "#773503",
24
- "orange-deep": "#AE4B04",
25
- "orange": "#E46707",
26
- "orange-light": "#FCC295",
27
- "orange-lighter": "#FEDEC5",
28
- "orange-faint": "#FFF3EB",
29
-
30
- "yellow-dark": "#625204",
31
- "yellow-deep": "#8E740B",
32
- "yellow": "#F3E444",
33
- "yellow-light": "#FAF29E",
34
- "yellow-lighter": "#FBF7D0",
35
- "yellow-faint": "#FDFBE7",
36
-
37
- "green-dark": "#13582F",
38
- "green-deep": "#1F7A43",
39
- "green": "#2AA75C",
40
- "green-light": "#AAE1C0",
41
- "green-lighter": "#D3F0DE",
42
- "green-faint": "#EAFBF1",
43
-
44
- "blue-dark": "#072E64",
45
- "blue-deep": "#0B428E",
46
- "blue": "#0F71FA",
47
- "blue-light": "#91B7EE",
48
- "blue-lighter": "#C8DAF4",
49
- "blue-faint": "#E8F1FC",
50
-
51
- "purple-dark": "#512392",
52
- "purple-deep": "#6E2FC6",
53
- "purple": "#9669D5",
54
- "purple-light": "#DBCEED",
55
- "purple-lighter": "#E7E0F1",
56
- "purple-faint": "#F3F1F6",
57
-
58
- "darken5": "rgba(26, 34, 36, 0.05)",
59
- "darken10": "rgba(26, 34, 36, 0.1)",
60
- "darken25": "rgba(26, 34, 36, 0.25)",
61
- "darken50": "rgba(26, 34, 36, 0.5)",
62
- "darken75": "rgba(26, 34, 36, 0.75)",
63
-
64
- "lighten5": "rgba(255, 255, 255, 0.05)",
65
- "lighten10": "rgba(255, 255, 255, 0.1)",
66
- "lighten25": "rgba(255, 255, 255, 0.25)",
67
- "lighten50": "rgba(255, 255, 255, 0.5)",
68
- "lighten75": "rgba(255, 255, 255, 0.75)",
69
-
70
- "black": "#000",
71
- "white": "#fff",
72
- "transparent": "transparent",
73
-
74
- "disabled10": "rgba(158, 163, 167, 0.1)",
75
- "disabled25": "rgba(158, 163, 167, 0.25)",
76
- "disabled75": "rgba(158, 163, 167, 0.75)",
77
-
78
- "border-radius": "4px",
79
- "border-radius-bold": "8px",
80
- "border-radius-full": "9999px",
81
-
82
- "transition": "0.125s",
83
-
84
- "focus-shadow": "0 0 0 3px rgba(137, 199, 216, 0.65)",
85
-
86
- "font-size-h1": "36px",
87
- "font-size-h2": "30px",
88
- "font-size-h3": "24px",
89
- "font-size-h4": "20px",
90
- "font-size-h5": "16px",
91
-
92
- "line-height-h1": "45px",
93
- "line-height-h2": "36px",
94
- "line-height-h3": "30px",
95
- "line-height-h4": "25px",
96
- "line-height-h5": "20px",
97
-
98
- "font-size-xl": "30px",
99
- "font-size-l": "20px",
100
- "font-size-m": "16px",
101
- "font-size-ms": "14px",
102
- "font-size-s": "12px",
103
- "font-size-xs": "10px",
104
-
105
- "line-height-xl": "45px",
106
- "line-height-l": "30px",
107
- "line-height-m": "24px",
108
- "line-height-ms": "21px",
109
- "line-height-s": "18px",
110
- "line-height-xs": "15px",
111
-
112
- "font-stack-base": "'Open Sans', sans-serif",
113
- "font-stack-mono":
2
+ "--gray-dark": "#1a2224",
3
+ "--gray-deep": "#4D5255",
4
+ "--gray": "#757D82",
5
+ "--gray-light": "#C7CACC",
6
+ "--gray-lighter": "#E4E6E7",
7
+ "--gray-faint": "#F7F8F8",
8
+
9
+ "--pink-dark": "#800C3C",
10
+ "--pink-deep": "#BA1258",
11
+ "--pink": "#FA428F",
12
+ "--pink-light": "#FABDD6",
13
+ "--pink-lighter": "#FCD4E4",
14
+ "--pink-faint": "#FDEEF4",
15
+
16
+ "--red-dark": "#741806",
17
+ "--red-deep": "#B6290D",
18
+ "--red": "#EB3814",
19
+ "--red-light": "#F8C4B9",
20
+ "--red-lighter": "#FED7CD",
21
+ "--red-faint": "#FDEBE7",
22
+
23
+ "--orange-dark": "#773503",
24
+ "--orange-deep": "#AE4B04",
25
+ "--orange": "#E46707",
26
+ "--orange-light": "#FCC295",
27
+ "--orange-lighter": "#FEDEC5",
28
+ "--orange-faint": "#FFF3EB",
29
+
30
+ "--yellow-dark": "#625204",
31
+ "--yellow-deep": "#8E740B",
32
+ "--yellow": "#F3E444",
33
+ "--yellow-light": "#FAF29E",
34
+ "--yellow-lighter": "#FBF7D0",
35
+ "--yellow-faint": "#FDFBE7",
36
+
37
+ "--green-dark": "#13582F",
38
+ "--green-deep": "#1F7A43",
39
+ "--green": "#2AA75C",
40
+ "--green-light": "#AAE1C0",
41
+ "--green-lighter": "#D3F0DE",
42
+ "--green-faint": "#EAFBF1",
43
+
44
+ "--blue-dark": "#072E64",
45
+ "--blue-deep": "#0B428E",
46
+ "--blue": "#0F71FA",
47
+ "--blue-light": "#91B7EE",
48
+ "--blue-lighter": "#C8DAF4",
49
+ "--blue-faint": "#E8F1FC",
50
+
51
+ "--purple-dark": "#512392",
52
+ "--purple-deep": "#6E2FC6",
53
+ "--purple": "#9669D5",
54
+ "--purple-light": "#DBCEED",
55
+ "--purple-lighter": "#E7E0F1",
56
+ "--purple-faint": "#F3F1F6",
57
+
58
+ "--darken5": "rgba(26, 34, 36, 0.05)",
59
+ "--darken10": "rgba(26, 34, 36, 0.1)",
60
+ "--darken25": "rgba(26, 34, 36, 0.25)",
61
+ "--darken50": "rgba(26, 34, 36, 0.5)",
62
+ "--darken75": "rgba(26, 34, 36, 0.75)",
63
+
64
+ "--lighten5": "rgba(255, 255, 255, 0.05)",
65
+ "--lighten10": "rgba(255, 255, 255, 0.1)",
66
+ "--lighten25": "rgba(255, 255, 255, 0.25)",
67
+ "--lighten50": "rgba(255, 255, 255, 0.5)",
68
+ "--lighten75": "rgba(255, 255, 255, 0.75)",
69
+
70
+ "--black": "#000",
71
+ "--white": "#fff",
72
+ "--transparent": "transparent",
73
+
74
+ "--disabled10": "rgba(158, 163, 167, 0.1)",
75
+ "--disabled25": "rgba(158, 163, 167, 0.25)",
76
+ "--disabled75": "rgba(158, 163, 167, 0.75)",
77
+
78
+ "--border-radius": "4px",
79
+ "--border-radius-bold": "8px",
80
+ "--border-radius-full": "9999px",
81
+
82
+ "--transition": "0.125s",
83
+
84
+ "--focus-shadow": "0 0 0 3px rgba(137, 199, 216, 0.65)",
85
+
86
+ "--font-size-h1": "36px",
87
+ "--font-size-h2": "30px",
88
+ "--font-size-h3": "24px",
89
+ "--font-size-h4": "20px",
90
+ "--font-size-h5": "16px",
91
+
92
+ "--line-height-h1": "45px",
93
+ "--line-height-h2": "36px",
94
+ "--line-height-h3": "30px",
95
+ "--line-height-h4": "25px",
96
+ "--line-height-h5": "20px",
97
+
98
+ "--font-size-xl": "30px",
99
+ "--font-size-l": "20px",
100
+ "--font-size-m": "16px",
101
+ "--font-size-ms": "14px",
102
+ "--font-size-s": "12px",
103
+ "--font-size-xs": "10px",
104
+
105
+ "--line-height-xl": "45px",
106
+ "--line-height-l": "30px",
107
+ "--line-height-m": "24px",
108
+ "--line-height-ms": "21px",
109
+ "--line-height-s": "18px",
110
+ "--line-height-xs": "15px",
111
+
112
+ "--font-stack-base": "'Open Sans', sans-serif",
113
+ "--font-stack-mono":
114
114
  "'Menlo', 'Bitstream Vera Sans Mono', 'Monaco', 'Consolas', monospace"
115
115
  }