grommet 2.25.1 → 2.25.2
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/components/Anchor/Anchor.js +14 -1
- package/components/Button/Button.js +82 -9
- package/components/Button/StyledButtonKind.js +9 -3
- package/components/Button/index.d.ts +1 -1
- package/components/Button/propTypes.js +1 -1
- package/components/DataChart/DataChart.js +11 -13
- package/components/DataChart/XAxis.js +29 -18
- package/components/DataTable/DataTable.js +13 -9
- package/components/DataTable/buildState.js +2 -2
- package/components/DataTable/index.d.ts +4 -1
- package/components/DataTable/stories/SpaceX.js +3 -1
- package/components/DataTable/stories/SpaceXUngrouped.js +6 -2
- package/components/Form/Form.js +72 -4
- package/components/FormField/FormField.js +4 -1
- package/components/Grommet/Grommet.js +7 -2
- package/components/Grommet/index.d.ts +1 -0
- package/components/Grommet/propTypes.js +2 -1
- package/components/Heading/Heading.js +4 -2
- package/components/Heading/StyledHeading.js +1 -1
- package/components/Heading/index.d.ts +1 -0
- package/components/Heading/propTypes.js +2 -1
- package/components/Layer/LayerContainer.js +18 -0
- package/components/Menu/Menu.js +7 -4
- package/components/Menu/stories/CustomThemed/Themed.tsx +6 -0
- package/components/Meter/Circle.js +5 -1
- package/components/PageHeader/PageHeader.js +22 -13
- package/components/PageHeader/index.d.ts +10 -1
- package/components/PageHeader/propTypes.js +1 -0
- package/components/PageHeader/stories/Size.js +55 -0
- package/components/Select/SelectContainer.js +77 -44
- package/components/Select/stories/Clear.js +7 -1
- package/components/Select/utils.js +1 -0
- package/components/Spinner/Spinner.js +1 -0
- package/components/Tab/Tab.js +1 -1
- package/components/Tabs/Tabs.js +9 -1
- package/contexts/AnalyticsContext/AnalyticsContext.js +65 -0
- package/contexts/AnalyticsContext/index.d.ts +7 -0
- package/contexts/AnalyticsContext/index.js +11 -0
- package/contexts/index.js +8 -0
- package/es6/components/Anchor/Anchor.js +14 -2
- package/es6/components/Button/Button.js +83 -11
- package/es6/components/Button/StyledButtonKind.js +9 -3
- package/es6/components/Button/index.d.ts +1 -1
- package/es6/components/Button/propTypes.js +1 -1
- package/es6/components/DataChart/DataChart.js +11 -13
- package/es6/components/DataChart/XAxis.js +29 -19
- package/es6/components/DataTable/DataTable.js +13 -9
- package/es6/components/DataTable/buildState.js +2 -2
- package/es6/components/DataTable/index.d.ts +4 -1
- package/es6/components/DataTable/stories/SpaceX.js +3 -1
- package/es6/components/DataTable/stories/SpaceXUngrouped.js +6 -2
- package/es6/components/Form/Form.js +70 -4
- package/es6/components/FormField/FormField.js +4 -1
- package/es6/components/Grommet/Grommet.js +6 -2
- package/es6/components/Grommet/index.d.ts +1 -0
- package/es6/components/Grommet/propTypes.js +2 -1
- package/es6/components/Heading/Heading.js +4 -2
- package/es6/components/Heading/StyledHeading.js +1 -1
- package/es6/components/Heading/index.d.ts +1 -0
- package/es6/components/Heading/propTypes.js +2 -1
- package/es6/components/Layer/LayerContainer.js +17 -0
- package/es6/components/Menu/Menu.js +7 -4
- package/es6/components/Menu/stories/CustomThemed/Themed.tsx +6 -0
- package/es6/components/Meter/Circle.js +5 -1
- package/es6/components/PageHeader/PageHeader.js +24 -14
- package/es6/components/PageHeader/index.d.ts +10 -1
- package/es6/components/PageHeader/propTypes.js +1 -0
- package/es6/components/PageHeader/stories/Size.js +43 -0
- package/es6/components/Select/SelectContainer.js +76 -45
- package/es6/components/Select/stories/Clear.js +7 -1
- package/es6/components/Select/utils.js +1 -0
- package/es6/components/Spinner/Spinner.js +1 -0
- package/es6/components/Tab/Tab.js +1 -1
- package/es6/components/Tabs/Tabs.js +8 -1
- package/es6/contexts/AnalyticsContext/AnalyticsContext.js +47 -0
- package/es6/contexts/AnalyticsContext/index.d.ts +7 -0
- package/es6/contexts/AnalyticsContext/index.js +1 -0
- package/es6/contexts/index.js +1 -0
- package/es6/themes/base.d.ts +40 -8
- package/es6/themes/base.js +43 -0
- package/es6/utils/mixins.js +3 -0
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/package.json +36 -30
- package/themes/base.d.ts +40 -8
- package/themes/base.js +43 -0
- package/tools/pack.js +20 -13
- package/tools/release-stable.js +2 -4
- package/utils/mixins.js +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grommet",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"module": "es6/index.js",
|
|
6
6
|
"jsnext:main": "es6/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"node": ">= 14"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"build": "webpack --mode production && babel ./src/js/ --out-dir ./dist --ignore '**/**/__tests__' --ignore 'src/**/portal.js' && copyfiles -u 2 \"src/js/**/**/*.*\" -e \"src/js/**/**/*.js\" -e \"src/js/**/**/*.js.snap\" \"./dist\" && cross-env BABEL_ENV=es6 babel ./src/js/ --out-dir ./dist/es6 --ignore '**/**/__tests__' --ignore 'src/**/portal.js' && copyfiles -u 2 \"src/js/**/**/*.*\" -e \"src/js/**/**/*.js\" -e \"src/js/**/**/*.js.snap\" \"./dist/es6\"",
|
|
31
|
+
"build": "webpack --mode production && babel ./src/js/ --out-dir ./dist --ignore '**/**/__tests__' --ignore './e2e' --ignore 'src/**/portal.js' && copyfiles -u 2 \"src/js/**/**/*.*\" -e \"src/js/**/**/*.js\" -e \"src/js/**/**/*.js.snap\" \"./dist\" && cross-env BABEL_ENV=es6 babel ./src/js/ --out-dir ./dist/es6 --ignore '**/**/__tests__' --ignore 'src/**/portal.js' && copyfiles -u 2 \"src/js/**/**/*.*\" -e \"src/js/**/**/*.js\" -e \"src/js/**/**/*.js.snap\" \"./dist/es6\"",
|
|
32
32
|
"release-stable": "babel-node ./tools/release-stable",
|
|
33
33
|
"lint": "eslint src",
|
|
34
34
|
"lint-fix": "eslint src --fix",
|
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
"test-calendar-dateinput": "jest ./src/js/components/Calendar/__tests__/Calendar-test.tsx ./src/js/components/DateInput/__tests__/DateInput-test.tsx",
|
|
41
41
|
"pack": "babel-node ./tools/pack",
|
|
42
42
|
"storybook": "cross-env NODE_ENV=development start-storybook -p 9001 -c storybook",
|
|
43
|
+
"start": "webpack serve --config ./e2e/webpack.config.js --mode development",
|
|
44
|
+
"test-e2e": "testcafe chrome:headless e2e/tests",
|
|
43
45
|
"build-storybook": "build-storybook -c storybook -o storybook-static",
|
|
44
46
|
"prettier": "pretty-quick --staged",
|
|
45
47
|
"chromatic": "chromatic -t 9q99in2ygnh"
|
|
@@ -50,24 +52,27 @@
|
|
|
50
52
|
"styled-components": ">= 5.1"
|
|
51
53
|
},
|
|
52
54
|
"dependencies": {
|
|
55
|
+
"@testing-library/testcafe": "^4.4.1",
|
|
53
56
|
"grommet-icons": "^4.7.0",
|
|
54
57
|
"hoist-non-react-statics": "^3.2.0",
|
|
55
58
|
"markdown-to-jsx": "^7.1.5",
|
|
56
|
-
"prop-types": "^15.8.1"
|
|
59
|
+
"prop-types": "^15.8.1",
|
|
60
|
+
"testcafe": "^1.20.1",
|
|
61
|
+
"testcafe-react-selectors": "^5.0.2"
|
|
57
62
|
},
|
|
58
63
|
"devDependencies": {
|
|
59
|
-
"@babel/cli": "^7.18.
|
|
60
|
-
"@babel/core": "^7.18.
|
|
61
|
-
"@babel/eslint-parser": "^7.18.
|
|
62
|
-
"@babel/node": "^7.18.
|
|
64
|
+
"@babel/cli": "^7.18.9",
|
|
65
|
+
"@babel/core": "^7.18.9",
|
|
66
|
+
"@babel/eslint-parser": "^7.18.9",
|
|
67
|
+
"@babel/node": "^7.18.9",
|
|
63
68
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
64
69
|
"@babel/plugin-proposal-do-expressions": "^7.18.6",
|
|
65
|
-
"@babel/plugin-proposal-export-default-from": "^7.18.
|
|
66
|
-
"@babel/plugin-proposal-logical-assignment-operators": "^7.18.
|
|
70
|
+
"@babel/plugin-proposal-export-default-from": "^7.18.9",
|
|
71
|
+
"@babel/plugin-proposal-logical-assignment-operators": "^7.18.9",
|
|
67
72
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
68
|
-
"@babel/plugin-proposal-optional-chaining": "^7.18.
|
|
69
|
-
"@babel/plugin-proposal-pipeline-operator": "^7.18.
|
|
70
|
-
"@babel/preset-env": "^7.18.
|
|
73
|
+
"@babel/plugin-proposal-optional-chaining": "^7.18.9",
|
|
74
|
+
"@babel/plugin-proposal-pipeline-operator": "^7.18.9",
|
|
75
|
+
"@babel/preset-env": "^7.18.9",
|
|
71
76
|
"@babel/preset-react": "^7.18.6",
|
|
72
77
|
"@storybook/addon-a11y": "6.4.22",
|
|
73
78
|
"@storybook/addon-storysource": "6.4.22",
|
|
@@ -75,36 +80,36 @@
|
|
|
75
80
|
"@storybook/addons": "6.4.22",
|
|
76
81
|
"@storybook/react": "6.4.22",
|
|
77
82
|
"@storybook/source-loader": "6.4.22",
|
|
78
|
-
"@testing-library/dom": "
|
|
83
|
+
"@testing-library/dom": "8.14.0",
|
|
79
84
|
"@testing-library/jest-dom": "^5.16.4",
|
|
80
85
|
"@testing-library/react": "^13.3.0",
|
|
81
|
-
"@testing-library/user-event": "
|
|
82
|
-
"@types/jest": "^28.1.
|
|
86
|
+
"@testing-library/user-event": "14.2.1",
|
|
87
|
+
"@types/jest": "^28.1.6",
|
|
83
88
|
"@types/jest-axe": "^3.5.4",
|
|
84
|
-
"@types/node": "^18.
|
|
85
|
-
"@types/react": "^18.0.
|
|
86
|
-
"@types/react-dom": "^18.0.
|
|
89
|
+
"@types/node": "^18.6.2",
|
|
90
|
+
"@types/react": "^18.0.15",
|
|
91
|
+
"@types/react-dom": "^18.0.6",
|
|
87
92
|
"@types/styled-components": "^5.1.25",
|
|
88
93
|
"babel-core": "^7.0.0-bridge.0",
|
|
89
|
-
"babel-jest": "
|
|
94
|
+
"babel-jest": "28.1.2",
|
|
90
95
|
"babel-loader": "^8.2.5",
|
|
91
96
|
"babel-plugin-styled-components": "2.0.6",
|
|
92
97
|
"babel-plugin-transform-imports": "^2.0.0",
|
|
93
98
|
"bundlesize2": "^0.0.31",
|
|
94
|
-
"chromatic": "^6.
|
|
99
|
+
"chromatic": "^6.7.2",
|
|
95
100
|
"clean-webpack-plugin": "^4.0.0",
|
|
96
101
|
"copy-webpack-plugin": "^5.0.4",
|
|
97
102
|
"copyfiles": "^2.4.1",
|
|
98
|
-
"core-js": "^3.
|
|
103
|
+
"core-js": "^3.24.0",
|
|
99
104
|
"cross-env": "^7.0.3",
|
|
100
105
|
"del": "^6.1.1",
|
|
101
106
|
"elliptic": "^6.5.4",
|
|
102
|
-
"eslint": "^8.
|
|
107
|
+
"eslint": "^8.20.0",
|
|
103
108
|
"eslint-config-airbnb": "^19.0.4",
|
|
104
109
|
"eslint-config-prettier": "^8.5.0",
|
|
105
110
|
"eslint-plugin-babel": "^5.3.1",
|
|
106
111
|
"eslint-plugin-import": "^2.26.0",
|
|
107
|
-
"eslint-plugin-jsx-a11y": "^6.6.
|
|
112
|
+
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
108
113
|
"eslint-plugin-prettier": "^4.1.0",
|
|
109
114
|
"eslint-plugin-react": "^7.30.1",
|
|
110
115
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
@@ -113,11 +118,11 @@
|
|
|
113
118
|
"grommet-theme-aruba": "^0.1.2",
|
|
114
119
|
"grommet-theme-dxc": "^0.1.2",
|
|
115
120
|
"grommet-theme-hp": "^0.1.2",
|
|
116
|
-
"grommet-theme-hpe": "^3.2.
|
|
117
|
-
"jest": "
|
|
121
|
+
"grommet-theme-hpe": "^3.2.1",
|
|
122
|
+
"jest": "28.1.2",
|
|
118
123
|
"jest-axe": "^6.0.0",
|
|
119
|
-
"jest-cli": "
|
|
120
|
-
"jest-environment-jsdom": "
|
|
124
|
+
"jest-cli": "28.1.2",
|
|
125
|
+
"jest-environment-jsdom": "28.1.2",
|
|
121
126
|
"jest-styled-components": "7.0.5",
|
|
122
127
|
"jsdom": "^20.0.0",
|
|
123
128
|
"postcss": "^8.4.14",
|
|
@@ -133,11 +138,12 @@
|
|
|
133
138
|
"simple-git": "^3.10.0",
|
|
134
139
|
"styled-components": "^5.3.5",
|
|
135
140
|
"tarball-extract": "^0.0.6",
|
|
136
|
-
"ts-jest": "^28.0.
|
|
141
|
+
"ts-jest": "^28.0.7",
|
|
137
142
|
"ts-loader": "^8.4.0",
|
|
138
143
|
"typescript": "^4.7.4",
|
|
139
144
|
"webpack": "^4.44.2",
|
|
140
|
-
"webpack-cli": "^4.8.0"
|
|
145
|
+
"webpack-cli": "^4.8.0",
|
|
146
|
+
"webpack-dev-server": "^4.9.3"
|
|
141
147
|
},
|
|
142
148
|
"jest": {
|
|
143
149
|
"globals": {
|
|
@@ -196,7 +202,7 @@
|
|
|
196
202
|
"bundlesize": [
|
|
197
203
|
{
|
|
198
204
|
"path": "./dist/grommet.min.js",
|
|
199
|
-
"maxSize": "
|
|
205
|
+
"maxSize": "134 kB"
|
|
200
206
|
}
|
|
201
207
|
],
|
|
202
208
|
"keywords": [
|
package/themes/base.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ import { Anchor } from '../components/Anchor';
|
|
|
32
32
|
import { Box } from '../components/Box';
|
|
33
33
|
import { Text, TextProps } from '../components/Text';
|
|
34
34
|
import { LayerPositionType, LayerProps } from '../components/Layer';
|
|
35
|
-
import { DropProps } from '../components/Drop';
|
|
35
|
+
import { DropProps, DropType } from '../components/Drop';
|
|
36
36
|
import {
|
|
37
37
|
AreasType,
|
|
38
38
|
GridColumnsType,
|
|
@@ -141,16 +141,19 @@ interface ButtonKindType {
|
|
|
141
141
|
| {
|
|
142
142
|
color?: ColorType;
|
|
143
143
|
width?: string;
|
|
144
|
+
radius?: string;
|
|
144
145
|
}
|
|
145
146
|
| boolean;
|
|
146
147
|
color?: ColorType;
|
|
147
148
|
font?: {
|
|
148
149
|
weight?: number | string;
|
|
149
150
|
};
|
|
151
|
+
icon?: React.ReactNode | Icon;
|
|
150
152
|
padding?: {
|
|
151
153
|
vertical?: string;
|
|
152
154
|
horizontal?: string;
|
|
153
155
|
};
|
|
156
|
+
reverse?: boolean;
|
|
154
157
|
extend?: ExtendType;
|
|
155
158
|
}
|
|
156
159
|
|
|
@@ -195,7 +198,13 @@ interface ButtonType {
|
|
|
195
198
|
secondary?: ButtonKindType;
|
|
196
199
|
})
|
|
197
200
|
| { [key: string]: ButtonKindType };
|
|
198
|
-
disabled?:
|
|
201
|
+
disabled?:
|
|
202
|
+
| (ButtonKindType & {
|
|
203
|
+
default?: ButtonKindType;
|
|
204
|
+
primary?: ButtonKindType;
|
|
205
|
+
secondary?: ButtonKindType;
|
|
206
|
+
})
|
|
207
|
+
| ({ [key: string]: ButtonKindType } & { opacity?: OpacityType });
|
|
199
208
|
hover?:
|
|
200
209
|
| (ButtonKindType & {
|
|
201
210
|
default?: ButtonKindType;
|
|
@@ -232,6 +241,7 @@ interface ButtonType {
|
|
|
232
241
|
};
|
|
233
242
|
};
|
|
234
243
|
};
|
|
244
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
235
245
|
transition?: {
|
|
236
246
|
timing?: string;
|
|
237
247
|
duration?: number;
|
|
@@ -368,11 +378,12 @@ export interface ThemeType {
|
|
|
368
378
|
color?: ColorType;
|
|
369
379
|
size?: string;
|
|
370
380
|
};
|
|
371
|
-
shadow?:
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
381
|
+
shadow?:
|
|
382
|
+
| string
|
|
383
|
+
| {
|
|
384
|
+
color?: ColorType;
|
|
385
|
+
size?: string;
|
|
386
|
+
};
|
|
376
387
|
};
|
|
377
388
|
font?: {
|
|
378
389
|
face?: string;
|
|
@@ -771,6 +782,9 @@ export interface ThemeType {
|
|
|
771
782
|
margin?: MarginType;
|
|
772
783
|
pad?: PadType;
|
|
773
784
|
};
|
|
785
|
+
checkBox: {
|
|
786
|
+
pad: PadType;
|
|
787
|
+
};
|
|
774
788
|
disabled?: {
|
|
775
789
|
background?: BackgroundType;
|
|
776
790
|
border?: {
|
|
@@ -1025,7 +1039,8 @@ export interface ThemeType {
|
|
|
1025
1039
|
};
|
|
1026
1040
|
menu?: {
|
|
1027
1041
|
background?: BackgroundType;
|
|
1028
|
-
|
|
1042
|
+
item?: ButtonType;
|
|
1043
|
+
drop?: DropType;
|
|
1029
1044
|
extend?: ExtendType;
|
|
1030
1045
|
group?: {
|
|
1031
1046
|
container?: BoxProps;
|
|
@@ -1163,6 +1178,23 @@ export interface ThemeType {
|
|
|
1163
1178
|
};
|
|
1164
1179
|
subtitle?: ParagraphProps;
|
|
1165
1180
|
title?: HeadingProps;
|
|
1181
|
+
size?: {
|
|
1182
|
+
small?: {
|
|
1183
|
+
pad?: PadType;
|
|
1184
|
+
subtitle?: ParagraphProps;
|
|
1185
|
+
title?: ParagraphProps;
|
|
1186
|
+
};
|
|
1187
|
+
medium?: {
|
|
1188
|
+
pad?: PadType;
|
|
1189
|
+
subtitle?: ParagraphProps;
|
|
1190
|
+
title?: ParagraphProps;
|
|
1191
|
+
};
|
|
1192
|
+
large?: {
|
|
1193
|
+
pad?: PadType;
|
|
1194
|
+
subtitle?: ParagraphProps;
|
|
1195
|
+
title?: ParagraphProps;
|
|
1196
|
+
};
|
|
1197
|
+
};
|
|
1166
1198
|
small?: {
|
|
1167
1199
|
areas?: AreasType;
|
|
1168
1200
|
columns?: GridColumnsType;
|
package/themes/base.js
CHANGED
|
@@ -557,10 +557,12 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
557
557
|
// font: {
|
|
558
558
|
// weight: undefined,
|
|
559
559
|
// },
|
|
560
|
+
// icon: undefined,
|
|
560
561
|
// padding: {
|
|
561
562
|
// vertical: undefined,
|
|
562
563
|
// horizontal: undefined,
|
|
563
564
|
// },
|
|
565
|
+
// reverse: undefined,
|
|
564
566
|
// extend: undefined,
|
|
565
567
|
// },
|
|
566
568
|
// primary: {
|
|
@@ -570,10 +572,12 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
570
572
|
// background: undefined,
|
|
571
573
|
// border: undefined,
|
|
572
574
|
// color: undefined,
|
|
575
|
+
// icon: undefined,
|
|
573
576
|
// padding: {
|
|
574
577
|
// vertical: undefined,
|
|
575
578
|
// horizontal: undefined,
|
|
576
579
|
// },
|
|
580
|
+
// reverse: undefined,
|
|
577
581
|
// extend: undefined,
|
|
578
582
|
// },
|
|
579
583
|
// secondary: {
|
|
@@ -583,20 +587,24 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
583
587
|
// background: undefined,
|
|
584
588
|
// border: undefined,
|
|
585
589
|
// color: undefined,
|
|
590
|
+
// icon: undefined,
|
|
586
591
|
// padding: {
|
|
587
592
|
// vertical: undefined,
|
|
588
593
|
// horizontal: undefined,
|
|
589
594
|
// },
|
|
595
|
+
// reverse: undefined,
|
|
590
596
|
// extend: undefined,
|
|
591
597
|
// },
|
|
592
598
|
// option: {
|
|
593
599
|
// background: undefined,
|
|
594
600
|
// border: undefined,
|
|
595
601
|
// color: undefined,
|
|
602
|
+
// icon: undefined,
|
|
596
603
|
// padding: {
|
|
597
604
|
// vertical: undefined,
|
|
598
605
|
// horizontal: undefined,
|
|
599
606
|
// },
|
|
607
|
+
// reverse: undefined,
|
|
600
608
|
// extend: undefined,
|
|
601
609
|
// },
|
|
602
610
|
active: {
|
|
@@ -985,6 +993,9 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
985
993
|
position: 'inner',
|
|
986
994
|
side: 'bottom'
|
|
987
995
|
},
|
|
996
|
+
// checkBox: {
|
|
997
|
+
// pad: undefined,
|
|
998
|
+
// },
|
|
988
999
|
content: {
|
|
989
1000
|
// margin: undefined,
|
|
990
1001
|
pad: 'small'
|
|
@@ -1172,6 +1183,7 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
1172
1183
|
},
|
|
1173
1184
|
menu: {
|
|
1174
1185
|
// background: undefined,
|
|
1186
|
+
// item: undefined,
|
|
1175
1187
|
// extend: undefined,
|
|
1176
1188
|
drop: {
|
|
1177
1189
|
align: {
|
|
@@ -1468,6 +1480,37 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
1468
1480
|
margin: 'none',
|
|
1469
1481
|
fill: true
|
|
1470
1482
|
},
|
|
1483
|
+
size: {
|
|
1484
|
+
small: {
|
|
1485
|
+
pad: {
|
|
1486
|
+
top: 'medium',
|
|
1487
|
+
bottom: 'small'
|
|
1488
|
+
},
|
|
1489
|
+
subtitle: {
|
|
1490
|
+
size: 'small'
|
|
1491
|
+
},
|
|
1492
|
+
title: {
|
|
1493
|
+
size: 'small'
|
|
1494
|
+
}
|
|
1495
|
+
},
|
|
1496
|
+
// medium: {
|
|
1497
|
+
// // pad: undefined,
|
|
1498
|
+
// // subtitle: {},
|
|
1499
|
+
// // title: {},
|
|
1500
|
+
// },
|
|
1501
|
+
large: {
|
|
1502
|
+
pad: {
|
|
1503
|
+
top: 'xlarge',
|
|
1504
|
+
bottom: 'large'
|
|
1505
|
+
},
|
|
1506
|
+
subtitle: {
|
|
1507
|
+
size: 'large'
|
|
1508
|
+
},
|
|
1509
|
+
title: {
|
|
1510
|
+
size: 'large'
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
},
|
|
1471
1514
|
small: {
|
|
1472
1515
|
areas: [['parent', 'parent'], ['title', 'actions'], ['subtitle', 'actions']],
|
|
1473
1516
|
columns: [['small', 'flex'], 'auto'],
|
package/tools/pack.js
CHANGED
|
@@ -33,14 +33,20 @@ try {
|
|
|
33
33
|
|
|
34
34
|
fs.renameSync(
|
|
35
35
|
path.resolve(__dirname, `../${tarballName}`),
|
|
36
|
-
path.resolve(
|
|
36
|
+
path.resolve(
|
|
37
|
+
__dirname,
|
|
38
|
+
`../${json.name}-${json.version}-src-with-dependecies.tgz`,
|
|
39
|
+
),
|
|
37
40
|
);
|
|
38
41
|
|
|
39
|
-
const dependencies = fs.readdirSync(
|
|
42
|
+
const dependencies = fs.readdirSync(
|
|
43
|
+
path.resolve(__dirname, '../tmp/package/node_modules'),
|
|
44
|
+
);
|
|
40
45
|
|
|
41
46
|
dependencies.forEach((dependency) => {
|
|
42
47
|
const dependencyPackageJSON = path.resolve(
|
|
43
|
-
__dirname,
|
|
48
|
+
__dirname,
|
|
49
|
+
`../node_modules/${dependency}/package.json`,
|
|
44
50
|
);
|
|
45
51
|
if (fs.existsSync(dependencyPackageJSON)) {
|
|
46
52
|
const contents = fs.readFileSync(dependencyPackageJSON);
|
|
@@ -61,18 +67,18 @@ try {
|
|
|
61
67
|
});
|
|
62
68
|
|
|
63
69
|
const dependencyLicense = path.resolve(
|
|
64
|
-
__dirname,
|
|
70
|
+
__dirname,
|
|
71
|
+
`../${json.name}-${json.version}-licenses.json`,
|
|
65
72
|
);
|
|
66
73
|
|
|
67
74
|
// write dependency license map
|
|
68
|
-
fs.writeFileSync(dependencyLicense, JSON.stringify(
|
|
69
|
-
licenseMap, null, 2)
|
|
70
|
-
);
|
|
75
|
+
fs.writeFileSync(dependencyLicense, JSON.stringify(licenseMap, null, 2));
|
|
71
76
|
|
|
72
77
|
// revert original package.json
|
|
73
|
-
fs.writeFileSync(
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
fs.writeFileSync(
|
|
79
|
+
packageJSON,
|
|
80
|
+
`${JSON.stringify(JSON.parse(packageJSONAsString), null, 2)}\n`,
|
|
81
|
+
);
|
|
76
82
|
|
|
77
83
|
del.sync(['./tmp']);
|
|
78
84
|
});
|
|
@@ -81,7 +87,8 @@ try {
|
|
|
81
87
|
console.log(e);
|
|
82
88
|
|
|
83
89
|
// revert original package.json
|
|
84
|
-
fs.writeFileSync(
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
fs.writeFileSync(
|
|
91
|
+
packageJSON,
|
|
92
|
+
`${JSON.stringify(JSON.parse(packageJSONAsString), null, 2)}\n`,
|
|
93
|
+
);
|
|
87
94
|
}
|
package/tools/release-stable.js
CHANGED
|
@@ -3,9 +3,7 @@ import fs from 'fs-extra';
|
|
|
3
3
|
import git from 'simple-git/promise';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
|
|
6
|
-
const repoURL = `https://${
|
|
7
|
-
process.env.GH_TOKEN
|
|
8
|
-
}@github.com/grommet/grommet.git`;
|
|
6
|
+
const repoURL = `https://${process.env.GH_TOKEN}@github.com/grommet/grommet.git`;
|
|
9
7
|
const localFolder = path.resolve('.tmp/grommet');
|
|
10
8
|
const localDist = path.resolve('dist');
|
|
11
9
|
|
|
@@ -20,7 +18,7 @@ if (process.env.CI) {
|
|
|
20
18
|
.then(() => git(localFolder).add(['--all', '.']))
|
|
21
19
|
.then(() => git(localFolder).commit('stable updated'))
|
|
22
20
|
.then(() => git(localFolder).push('origin', 'stable'))
|
|
23
|
-
.catch(err => console.error('failed: ', err));
|
|
21
|
+
.catch((err) => console.error('failed: ', err));
|
|
24
22
|
});
|
|
25
23
|
} else {
|
|
26
24
|
console.warn(
|
package/utils/mixins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.parseMetricToNum = exports.getAvailableAtBadge = exports.fontSize = exports.findAllByType = exports.breakpointStyle = void 0;
|
|
4
|
+
exports.parseMetricToNum = exports.getAvailableAtBadge = exports.fontSize = exports.findAllByType = exports.edgeToNum = exports.breakpointStyle = void 0;
|
|
5
5
|
|
|
6
6
|
var _styledComponents = require("styled-components");
|
|
7
7
|
|
|
@@ -17,6 +17,12 @@ var parseMetricToNum = function parseMetricToNum(metric) {
|
|
|
17
17
|
|
|
18
18
|
exports.parseMetricToNum = parseMetricToNum;
|
|
19
19
|
|
|
20
|
+
var edgeToNum = function edgeToNum(size, theme) {
|
|
21
|
+
return size ? parseMetricToNum(theme.global.edgeSize[size] || size) : 0;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.edgeToNum = edgeToNum;
|
|
25
|
+
|
|
20
26
|
var fontSize = function fontSize(size, lineHeight) {
|
|
21
27
|
return (0, _styledComponents.css)(["font-size:", ";line-height:", ";"], function (props) {
|
|
22
28
|
return parseMetricToNum(size) / parseMetricToNum(props.theme.global.font.size) * 1 + "rem";
|