grommet 2.25.0 → 2.25.3
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 +81 -8
- package/components/Button/StyledButtonKind.js +9 -3
- package/components/Button/index.d.ts +1 -1
- package/components/Button/propTypes.js +1 -1
- package/components/Calendar/Calendar.js +232 -292
- package/components/Calendar/utils.js +16 -129
- package/components/Chart/calcs.js +44 -27
- package/components/Chart/stories/Scan.js +11 -9
- package/components/Chart/stories/data.js +16 -17
- package/components/CheckBox/CheckBox.js +3 -2
- package/components/DataChart/DataChart.js +14 -28
- package/components/DataChart/Detail.js +18 -11
- package/components/DataChart/XAxis.js +29 -18
- package/components/DataChart/stories/Pad.js +54 -0
- 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/DateInput/DateInput.js +60 -68
- package/components/DateInput/utils.js +30 -5
- package/components/FileInput/FileInput.js +2 -1
- package/components/FileInput/StyledFileInput.js +1 -1
- package/components/Form/Form.js +78 -5
- package/components/FormField/FormField.js +29 -29
- 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/Image/Image.js +4 -2
- package/components/Layer/LayerContainer.js +25 -0
- package/components/List/List.js +17 -0
- package/components/Menu/Menu.js +7 -4
- package/components/Menu/index.d.ts +2 -2
- 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 +96 -75
- 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 +11 -2
- package/components/Video/StyledVideo.js +2 -2
- 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 +15 -3
- 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/Calendar/Calendar.js +230 -292
- package/es6/components/Calendar/utils.js +13 -114
- package/es6/components/Chart/calcs.js +44 -27
- package/es6/components/Chart/stories/Scan.js +10 -9
- package/es6/components/Chart/stories/data.js +16 -17
- package/es6/components/CheckBox/CheckBox.js +3 -2
- package/es6/components/DataChart/DataChart.js +15 -28
- package/es6/components/DataChart/Detail.js +20 -10
- package/es6/components/DataChart/XAxis.js +29 -19
- package/es6/components/DataChart/stories/Pad.js +42 -0
- 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/DateInput/DateInput.js +57 -64
- package/es6/components/DateInput/utils.js +29 -7
- package/es6/components/FileInput/FileInput.js +2 -1
- package/es6/components/FileInput/StyledFileInput.js +1 -1
- package/es6/components/Form/Form.js +76 -5
- package/es6/components/FormField/FormField.js +29 -30
- 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/Image/Image.js +4 -2
- package/es6/components/Layer/LayerContainer.js +24 -0
- package/es6/components/List/List.js +16 -0
- package/es6/components/Menu/Menu.js +7 -4
- package/es6/components/Menu/index.d.ts +2 -2
- 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 +96 -77
- 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 +10 -2
- package/es6/components/Video/StyledVideo.js +2 -2
- 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 +51 -33
- package/es6/themes/base.js +49 -1
- package/es6/utils/DOM.js +4 -0
- package/es6/utils/mixins.js +3 -0
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/package.json +56 -48
- package/themes/base.d.ts +51 -33
- package/themes/base.js +49 -1
- package/tools/pack.js +20 -13
- package/tools/release-stable.js +2 -4
- package/utils/DOM.js +9 -2
- 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.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"module": "es6/index.js",
|
|
6
6
|
"jsnext:main": "es6/index.js",
|
|
@@ -28,16 +28,20 @@
|
|
|
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",
|
|
35
|
-
"test": "jest --runInBand",
|
|
36
|
-
"test-update": "jest --updateSnapshot",
|
|
35
|
+
"test": "jest --runInBand && yarn test-timezones",
|
|
36
|
+
"test-update": "jest --updateSnapshot && yarn test-timezones",
|
|
37
37
|
"test-watch": "jest --watchAll",
|
|
38
38
|
"test-bundlesize": "bundlesize",
|
|
39
|
+
"test-timezones": "TZ=Australia/Brisbane yarn test-calendar-dateinput --coverage=false && TZ=America/Los_Angeles yarn test-calendar-dateinput --coverage=false && TZ=Europe/Madrid yarn test-calendar-dateinput --coverage=false",
|
|
40
|
+
"test-calendar-dateinput": "jest ./src/js/components/Calendar/__tests__/Calendar-test.tsx ./src/js/components/DateInput/__tests__/DateInput-test.tsx",
|
|
39
41
|
"pack": "babel-node ./tools/pack",
|
|
40
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",
|
|
41
45
|
"build-storybook": "build-storybook -c storybook -o storybook-static",
|
|
42
46
|
"prettier": "pretty-quick --staged",
|
|
43
47
|
"chromatic": "chromatic -t 9q99in2ygnh"
|
|
@@ -54,88 +58,92 @@
|
|
|
54
58
|
"prop-types": "^15.8.1"
|
|
55
59
|
},
|
|
56
60
|
"devDependencies": {
|
|
57
|
-
"@babel/cli": "^7.
|
|
58
|
-
"@babel/core": "^7.18.
|
|
59
|
-
"@babel/eslint-parser": "^7.18.
|
|
60
|
-
"@babel/node": "^7.
|
|
61
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
62
|
-
"@babel/plugin-proposal-do-expressions": "^7.
|
|
63
|
-
"@babel/plugin-proposal-export-default-from": "^7.
|
|
64
|
-
"@babel/plugin-proposal-logical-assignment-operators": "^7.
|
|
65
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.
|
|
66
|
-
"@babel/plugin-proposal-optional-chaining": "^7.
|
|
67
|
-
"@babel/plugin-proposal-pipeline-operator": "^7.18.
|
|
68
|
-
"@babel/preset-env": "^7.18.
|
|
69
|
-
"@babel/preset-react": "^7.
|
|
61
|
+
"@babel/cli": "^7.18.9",
|
|
62
|
+
"@babel/core": "^7.18.9",
|
|
63
|
+
"@babel/eslint-parser": "^7.18.9",
|
|
64
|
+
"@babel/node": "^7.18.9",
|
|
65
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
66
|
+
"@babel/plugin-proposal-do-expressions": "^7.18.6",
|
|
67
|
+
"@babel/plugin-proposal-export-default-from": "^7.18.9",
|
|
68
|
+
"@babel/plugin-proposal-logical-assignment-operators": "^7.18.9",
|
|
69
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
70
|
+
"@babel/plugin-proposal-optional-chaining": "^7.18.9",
|
|
71
|
+
"@babel/plugin-proposal-pipeline-operator": "^7.18.9",
|
|
72
|
+
"@babel/preset-env": "^7.18.9",
|
|
73
|
+
"@babel/preset-react": "^7.18.6",
|
|
70
74
|
"@storybook/addon-a11y": "6.4.22",
|
|
71
75
|
"@storybook/addon-storysource": "6.4.22",
|
|
72
76
|
"@storybook/addon-toolbars": "6.4.22",
|
|
73
77
|
"@storybook/addons": "6.4.22",
|
|
74
78
|
"@storybook/react": "6.4.22",
|
|
75
79
|
"@storybook/source-loader": "6.4.22",
|
|
76
|
-
"@testing-library/dom": "
|
|
80
|
+
"@testing-library/dom": "8.14.0",
|
|
77
81
|
"@testing-library/jest-dom": "^5.16.4",
|
|
78
82
|
"@testing-library/react": "^13.3.0",
|
|
79
|
-
"@testing-library/
|
|
80
|
-
"@
|
|
81
|
-
"@types/jest
|
|
82
|
-
"@types/
|
|
83
|
-
"@types/
|
|
84
|
-
"@types/react
|
|
83
|
+
"@testing-library/testcafe": "^4.4.1",
|
|
84
|
+
"@testing-library/user-event": "14.2.1",
|
|
85
|
+
"@types/jest": "^28.1.6",
|
|
86
|
+
"@types/jest-axe": "^3.5.4",
|
|
87
|
+
"@types/node": "^18.6.2",
|
|
88
|
+
"@types/react": "^18.0.15",
|
|
89
|
+
"@types/react-dom": "^18.0.6",
|
|
85
90
|
"@types/styled-components": "^5.1.25",
|
|
86
91
|
"babel-core": "^7.0.0-bridge.0",
|
|
87
|
-
"babel-jest": "28.1.
|
|
92
|
+
"babel-jest": "28.1.2",
|
|
88
93
|
"babel-loader": "^8.2.5",
|
|
89
94
|
"babel-plugin-styled-components": "2.0.6",
|
|
90
95
|
"babel-plugin-transform-imports": "^2.0.0",
|
|
91
|
-
"
|
|
92
|
-
"chromatic": "^6.
|
|
96
|
+
"bundlesize2": "^0.0.31",
|
|
97
|
+
"chromatic": "^6.7.2",
|
|
93
98
|
"clean-webpack-plugin": "^4.0.0",
|
|
94
99
|
"copy-webpack-plugin": "^5.0.4",
|
|
95
100
|
"copyfiles": "^2.4.1",
|
|
96
|
-
"core-js": "^3.
|
|
101
|
+
"core-js": "^3.24.0",
|
|
97
102
|
"cross-env": "^7.0.3",
|
|
98
103
|
"del": "^6.1.1",
|
|
99
104
|
"elliptic": "^6.5.4",
|
|
100
|
-
"eslint": "^8.
|
|
105
|
+
"eslint": "^8.20.0",
|
|
101
106
|
"eslint-config-airbnb": "^19.0.4",
|
|
102
107
|
"eslint-config-prettier": "^8.5.0",
|
|
103
108
|
"eslint-plugin-babel": "^5.3.1",
|
|
104
109
|
"eslint-plugin-import": "^2.26.0",
|
|
105
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
106
|
-
"eslint-plugin-prettier": "^4.
|
|
107
|
-
"eslint-plugin-react": "^7.
|
|
108
|
-
"eslint-plugin-react-hooks": "^4.
|
|
110
|
+
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
111
|
+
"eslint-plugin-prettier": "^4.1.0",
|
|
112
|
+
"eslint-plugin-react": "^7.30.1",
|
|
113
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
109
114
|
"eslint-plugin-testing-library": "^5.5.1",
|
|
110
115
|
"fs-extra": "^10.1.0",
|
|
111
116
|
"grommet-theme-aruba": "^0.1.2",
|
|
112
117
|
"grommet-theme-dxc": "^0.1.2",
|
|
113
118
|
"grommet-theme-hp": "^0.1.2",
|
|
114
|
-
"grommet-theme-hpe": "^3.1
|
|
115
|
-
"jest": "28.1.
|
|
119
|
+
"grommet-theme-hpe": "^3.2.1",
|
|
120
|
+
"jest": "28.1.2",
|
|
116
121
|
"jest-axe": "^6.0.0",
|
|
117
|
-
"jest-cli": "28.1.
|
|
118
|
-
"jest-environment-jsdom": "28.1.
|
|
122
|
+
"jest-cli": "28.1.2",
|
|
123
|
+
"jest-environment-jsdom": "28.1.2",
|
|
119
124
|
"jest-styled-components": "7.0.5",
|
|
120
|
-
"jsdom": "^
|
|
121
|
-
"postcss": "^8.4.
|
|
125
|
+
"jsdom": "^20.0.0",
|
|
126
|
+
"postcss": "^8.4.14",
|
|
122
127
|
"pre-commit": "^1.2.2",
|
|
123
|
-
"prettier": "^2.
|
|
128
|
+
"prettier": "^2.7.1",
|
|
124
129
|
"pretty-quick": "^3.1.3",
|
|
125
|
-
"react": "^18.
|
|
130
|
+
"react": "^18.2.0",
|
|
126
131
|
"react-dev-utils": "^12.0.1",
|
|
127
|
-
"react-dom": "^18.
|
|
128
|
-
"react-is": "^18.
|
|
132
|
+
"react-dom": "^18.2.0",
|
|
133
|
+
"react-is": "^18.2.0",
|
|
129
134
|
"regenerator-runtime": "^0.13.9",
|
|
130
135
|
"require-reload": "^0.2.2",
|
|
131
|
-
"simple-git": "^3.
|
|
136
|
+
"simple-git": "^3.10.0",
|
|
132
137
|
"styled-components": "^5.3.5",
|
|
133
138
|
"tarball-extract": "^0.0.6",
|
|
134
|
-
"
|
|
139
|
+
"testcafe": "^2.0.0",
|
|
140
|
+
"testcafe-react-selectors": "^5.0.2",
|
|
141
|
+
"ts-jest": "^28.0.7",
|
|
135
142
|
"ts-loader": "^8.4.0",
|
|
136
|
-
"typescript": "^4.7.
|
|
143
|
+
"typescript": "^4.7.4",
|
|
137
144
|
"webpack": "^4.44.2",
|
|
138
|
-
"webpack-cli": "^4.8.0"
|
|
145
|
+
"webpack-cli": "^4.8.0",
|
|
146
|
+
"webpack-dev-server": "^4.9.3"
|
|
139
147
|
},
|
|
140
148
|
"jest": {
|
|
141
149
|
"globals": {
|
|
@@ -194,7 +202,7 @@
|
|
|
194
202
|
"bundlesize": [
|
|
195
203
|
{
|
|
196
204
|
"path": "./dist/grommet.min.js",
|
|
197
|
-
"maxSize": "
|
|
205
|
+
"maxSize": "134 kB"
|
|
198
206
|
}
|
|
199
207
|
],
|
|
200
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;
|
|
@@ -242,6 +252,15 @@ interface FormFieldLabelType extends TextProps {
|
|
|
242
252
|
requiredIndicator?: boolean | JSX.Element | string;
|
|
243
253
|
}
|
|
244
254
|
|
|
255
|
+
type DigitalTexts =
|
|
256
|
+
| 'xsmall'
|
|
257
|
+
| 'small'
|
|
258
|
+
| 'medium'
|
|
259
|
+
| 'large'
|
|
260
|
+
| 'xlarge'
|
|
261
|
+
| 'xxlarge'
|
|
262
|
+
| string;
|
|
263
|
+
|
|
245
264
|
export interface ThemeType {
|
|
246
265
|
global?: {
|
|
247
266
|
active?: {
|
|
@@ -359,10 +378,12 @@ export interface ThemeType {
|
|
|
359
378
|
color?: ColorType;
|
|
360
379
|
size?: string;
|
|
361
380
|
};
|
|
362
|
-
shadow?:
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
381
|
+
shadow?:
|
|
382
|
+
| string
|
|
383
|
+
| {
|
|
384
|
+
color?: ColorType;
|
|
385
|
+
size?: string;
|
|
386
|
+
};
|
|
366
387
|
};
|
|
367
388
|
font?: {
|
|
368
389
|
face?: string;
|
|
@@ -517,7 +538,7 @@ export interface ThemeType {
|
|
|
517
538
|
};
|
|
518
539
|
};
|
|
519
540
|
card?: {
|
|
520
|
-
container?: BoxProps;
|
|
541
|
+
container?: BoxProps | { extend?: ExtendType };
|
|
521
542
|
hover?: {
|
|
522
543
|
container?: {
|
|
523
544
|
elevation?: ElevationType;
|
|
@@ -626,31 +647,7 @@ export interface ThemeType {
|
|
|
626
647
|
};
|
|
627
648
|
digital?: {
|
|
628
649
|
text?: {
|
|
629
|
-
|
|
630
|
-
size?: string;
|
|
631
|
-
height?: number;
|
|
632
|
-
};
|
|
633
|
-
small?: {
|
|
634
|
-
size?: string;
|
|
635
|
-
height?: number;
|
|
636
|
-
};
|
|
637
|
-
medium?: {
|
|
638
|
-
size?: string;
|
|
639
|
-
height?: number;
|
|
640
|
-
};
|
|
641
|
-
large?: {
|
|
642
|
-
size?: string;
|
|
643
|
-
height?: number;
|
|
644
|
-
};
|
|
645
|
-
xlarge?: {
|
|
646
|
-
size?: string;
|
|
647
|
-
height?: number;
|
|
648
|
-
};
|
|
649
|
-
xxlarge?: {
|
|
650
|
-
size?: string;
|
|
651
|
-
height?: number;
|
|
652
|
-
};
|
|
653
|
-
[key: string]: {
|
|
650
|
+
[key in DigitalTexts]: {
|
|
654
651
|
size?: string;
|
|
655
652
|
height?: number;
|
|
656
653
|
};
|
|
@@ -785,6 +782,9 @@ export interface ThemeType {
|
|
|
785
782
|
margin?: MarginType;
|
|
786
783
|
pad?: PadType;
|
|
787
784
|
};
|
|
785
|
+
checkBox: {
|
|
786
|
+
pad: PadType;
|
|
787
|
+
};
|
|
788
788
|
disabled?: {
|
|
789
789
|
background?: BackgroundType;
|
|
790
790
|
border?: {
|
|
@@ -1039,7 +1039,8 @@ export interface ThemeType {
|
|
|
1039
1039
|
};
|
|
1040
1040
|
menu?: {
|
|
1041
1041
|
background?: BackgroundType;
|
|
1042
|
-
|
|
1042
|
+
item?: ButtonType;
|
|
1043
|
+
drop?: DropType;
|
|
1043
1044
|
extend?: ExtendType;
|
|
1044
1045
|
group?: {
|
|
1045
1046
|
container?: BoxProps;
|
|
@@ -1177,6 +1178,23 @@ export interface ThemeType {
|
|
|
1177
1178
|
};
|
|
1178
1179
|
subtitle?: ParagraphProps;
|
|
1179
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
|
+
};
|
|
1180
1198
|
small?: {
|
|
1181
1199
|
areas?: AreasType;
|
|
1182
1200
|
columns?: GridColumnsType;
|
package/themes/base.js
CHANGED
|
@@ -266,7 +266,12 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
266
266
|
}
|
|
267
267
|
},
|
|
268
268
|
// The time to wait after the user stopped typing, measured in ms.
|
|
269
|
-
|
|
269
|
+
// A half second (500ms) debounce can be a helpful starting point.
|
|
270
|
+
// You want to give the user time to fill out a field, but capture
|
|
271
|
+
// their attention before they move on past it. 2 second (2000ms)
|
|
272
|
+
// might be too long depending on how fast people type, and 200ms
|
|
273
|
+
// would be an eye blink
|
|
274
|
+
debounceDelay: 500,
|
|
270
275
|
drop: {
|
|
271
276
|
// intelligentMargin: undefined,
|
|
272
277
|
background: {
|
|
@@ -552,10 +557,12 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
552
557
|
// font: {
|
|
553
558
|
// weight: undefined,
|
|
554
559
|
// },
|
|
560
|
+
// icon: undefined,
|
|
555
561
|
// padding: {
|
|
556
562
|
// vertical: undefined,
|
|
557
563
|
// horizontal: undefined,
|
|
558
564
|
// },
|
|
565
|
+
// reverse: undefined,
|
|
559
566
|
// extend: undefined,
|
|
560
567
|
// },
|
|
561
568
|
// primary: {
|
|
@@ -565,10 +572,12 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
565
572
|
// background: undefined,
|
|
566
573
|
// border: undefined,
|
|
567
574
|
// color: undefined,
|
|
575
|
+
// icon: undefined,
|
|
568
576
|
// padding: {
|
|
569
577
|
// vertical: undefined,
|
|
570
578
|
// horizontal: undefined,
|
|
571
579
|
// },
|
|
580
|
+
// reverse: undefined,
|
|
572
581
|
// extend: undefined,
|
|
573
582
|
// },
|
|
574
583
|
// secondary: {
|
|
@@ -578,20 +587,24 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
578
587
|
// background: undefined,
|
|
579
588
|
// border: undefined,
|
|
580
589
|
// color: undefined,
|
|
590
|
+
// icon: undefined,
|
|
581
591
|
// padding: {
|
|
582
592
|
// vertical: undefined,
|
|
583
593
|
// horizontal: undefined,
|
|
584
594
|
// },
|
|
595
|
+
// reverse: undefined,
|
|
585
596
|
// extend: undefined,
|
|
586
597
|
// },
|
|
587
598
|
// option: {
|
|
588
599
|
// background: undefined,
|
|
589
600
|
// border: undefined,
|
|
590
601
|
// color: undefined,
|
|
602
|
+
// icon: undefined,
|
|
591
603
|
// padding: {
|
|
592
604
|
// vertical: undefined,
|
|
593
605
|
// horizontal: undefined,
|
|
594
606
|
// },
|
|
607
|
+
// reverse: undefined,
|
|
595
608
|
// extend: undefined,
|
|
596
609
|
// },
|
|
597
610
|
active: {
|
|
@@ -980,6 +993,9 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
980
993
|
position: 'inner',
|
|
981
994
|
side: 'bottom'
|
|
982
995
|
},
|
|
996
|
+
// checkBox: {
|
|
997
|
+
// pad: undefined,
|
|
998
|
+
// },
|
|
983
999
|
content: {
|
|
984
1000
|
// margin: undefined,
|
|
985
1001
|
pad: 'small'
|
|
@@ -1167,6 +1183,7 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
1167
1183
|
},
|
|
1168
1184
|
menu: {
|
|
1169
1185
|
// background: undefined,
|
|
1186
|
+
// item: undefined,
|
|
1170
1187
|
// extend: undefined,
|
|
1171
1188
|
drop: {
|
|
1172
1189
|
align: {
|
|
@@ -1463,6 +1480,37 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
1463
1480
|
margin: 'none',
|
|
1464
1481
|
fill: true
|
|
1465
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
|
+
},
|
|
1466
1514
|
small: {
|
|
1467
1515
|
areas: [['parent', 'parent'], ['title', 'actions'], ['subtitle', 'actions']],
|
|
1468
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/DOM.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.shouldKeepFocus = exports.setFocusWithoutScroll = exports.makeNodeUnfocusable = exports.makeNodeFocusable = exports.isNodeBeforeScroll = exports.isNodeAfterScroll = exports.isFocusable = exports.getNewContainer = exports.getFirstFocusableDescendant = exports.findVisibleParent = exports.findScrollParents = exports.findScrollParent = exports.containsFocus = void 0;
|
|
4
|
+
exports.shouldKeepFocus = exports.setFocusWithoutScroll = exports.makeNodeUnfocusable = exports.makeNodeFocusable = exports.isNodeBeforeScroll = exports.isNodeAfterScroll = exports.isFocusable = exports.getNewContainer = exports.getFirstFocusableDescendant = exports.findVisibleParent = exports.findScrollParents = exports.findScrollParent = exports.findButtonParent = exports.containsFocus = void 0;
|
|
5
5
|
|
|
6
6
|
var findScrollParent = function findScrollParent(element, horizontal) {
|
|
7
7
|
var result;
|
|
@@ -242,4 +242,11 @@ var isNodeBeforeScroll = function isNodeBeforeScroll(node, target) {
|
|
|
242
242
|
return top <= targetTop;
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
-
exports.isNodeBeforeScroll = isNodeBeforeScroll;
|
|
245
|
+
exports.isNodeBeforeScroll = isNodeBeforeScroll;
|
|
246
|
+
|
|
247
|
+
var findButtonParent = function findButtonParent(element) {
|
|
248
|
+
if (element && element.nodeName !== 'BUTTON' && element.nodeName !== 'A') return findButtonParent(element.parentElement);
|
|
249
|
+
return element;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
exports.findButtonParent = findButtonParent;
|
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";
|