grommet 2.30.0 → 2.31.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/components/Anchor/Anchor.js +3 -2
- package/components/Button/Badge.js +42 -43
- package/components/Button/Button.js +15 -12
- package/components/Button/StyledButton.js +4 -2
- package/components/Button/StyledButtonKind.js +5 -3
- package/components/Button/index.d.ts +2 -0
- package/components/Button/propTypes.js +1 -0
- package/components/CheckBox/index.d.ts +1 -1
- package/components/Data/DataForm.js +40 -34
- package/components/DataView/DataView.js +1 -1
- package/components/DateInput/DateInput.js +2 -1
- package/components/FormField/FormField.js +0 -1
- package/components/MaskedInput/MaskedInput.js +3 -2
- package/components/MaskedInput/StyledMaskedInput.js +2 -1
- package/components/Notification/Notification.js +7 -3
- package/components/PageHeader/PageHeader.js +6 -4
- package/components/Pagination/StyledPageControl.js +3 -1
- package/components/Paragraph/Paragraph.js +2 -2
- package/components/Paragraph/stories/All.js +5 -1
- package/components/SelectMultiple/SelectMultiple.js +11 -10
- package/components/SelectMultiple/SelectMultipleContainer.js +16 -13
- package/components/SelectMultiple/stories/Help.js +49 -0
- package/components/Text/Text.js +2 -2
- package/components/TextInput/StyledTextInput.js +2 -1
- package/components/TextInput/TextInput.js +3 -2
- package/es6/components/Anchor/Anchor.js +4 -3
- package/es6/components/Button/Badge.js +43 -44
- package/es6/components/Button/Button.js +16 -13
- package/es6/components/Button/StyledButton.js +5 -3
- package/es6/components/Button/StyledButtonKind.js +6 -4
- package/es6/components/Button/index.d.ts +2 -0
- package/es6/components/Button/propTypes.js +2 -1
- package/es6/components/CheckBox/index.d.ts +1 -1
- package/es6/components/Data/DataForm.js +40 -34
- package/es6/components/DataView/DataView.js +1 -1
- package/es6/components/DateInput/DateInput.js +2 -1
- package/es6/components/FormField/FormField.js +0 -1
- package/es6/components/MaskedInput/MaskedInput.js +4 -3
- package/es6/components/MaskedInput/StyledMaskedInput.js +2 -1
- package/es6/components/Notification/Notification.js +7 -3
- package/es6/components/PageHeader/PageHeader.js +6 -4
- package/es6/components/Pagination/StyledPageControl.js +3 -1
- package/es6/components/Paragraph/Paragraph.js +2 -2
- package/es6/components/Paragraph/stories/All.js +5 -1
- package/es6/components/SelectMultiple/SelectMultiple.js +11 -10
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +16 -13
- package/es6/components/SelectMultiple/stories/Help.js +42 -0
- package/es6/components/Text/Text.js +2 -2
- package/es6/components/TextInput/StyledTextInput.js +2 -1
- package/es6/components/TextInput/TextInput.js +4 -3
- package/es6/themes/base.d.ts +3 -0
- package/es6/themes/base.js +6 -0
- package/es6/utils/icon.js +7 -0
- package/es6/utils/index.js +1 -0
- package/es6/utils/styles.js +10 -0
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/package.json +30 -30
- package/themes/base.d.ts +3 -0
- package/themes/base.js +6 -0
- package/utils/icon.js +12 -0
- package/utils/index.js +6 -0
- package/utils/styles.js +12 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grommet",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.31.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"module": "es6/index.js",
|
|
6
6
|
"jsnext:main": "es6/index.js",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"styled-components": ">= 5.1"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"grommet-icons": "^4.
|
|
57
|
+
"grommet-icons": "^4.10.0",
|
|
58
58
|
"hoist-non-react-statics": "^3.2.0",
|
|
59
|
-
"markdown-to-jsx": "^7.
|
|
59
|
+
"markdown-to-jsx": "^7.2.0",
|
|
60
60
|
"prop-types": "^15.8.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@babel/cli": "^7.
|
|
64
|
-
"@babel/core": "^7.
|
|
63
|
+
"@babel/cli": "^7.21.0",
|
|
64
|
+
"@babel/core": "^7.21.0",
|
|
65
65
|
"@babel/eslint-parser": "^7.19.1",
|
|
66
66
|
"@babel/node": "^7.20.7",
|
|
67
67
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@babel/plugin-proposal-export-default-from": "^7.18.10",
|
|
70
70
|
"@babel/plugin-proposal-logical-assignment-operators": "^7.20.7",
|
|
71
71
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
72
|
-
"@babel/plugin-proposal-optional-chaining": "^7.
|
|
72
|
+
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
|
|
73
73
|
"@babel/plugin-proposal-pipeline-operator": "^7.18.9",
|
|
74
74
|
"@babel/preset-env": "^7.20.2",
|
|
75
75
|
"@babel/preset-react": "^7.18.6",
|
|
@@ -81,55 +81,55 @@
|
|
|
81
81
|
"@storybook/manager-webpack5": "6.5.15",
|
|
82
82
|
"@storybook/react": "6.5.15",
|
|
83
83
|
"@storybook/source-loader": "6.5.15",
|
|
84
|
-
"@testing-library/dom": "^
|
|
84
|
+
"@testing-library/dom": "^9.0.0",
|
|
85
85
|
"@testing-library/jest-dom": "^5.16.5",
|
|
86
|
-
"@testing-library/react": "^
|
|
86
|
+
"@testing-library/react": "^14.0.0",
|
|
87
87
|
"@testing-library/testcafe": "^5.0.0",
|
|
88
88
|
"@testing-library/user-event": "^14.4.3",
|
|
89
|
-
"@types/jest": "^29.
|
|
89
|
+
"@types/jest": "^29.4.0",
|
|
90
90
|
"@types/jest-axe": "^3.5.5",
|
|
91
|
-
"@types/node": "^18.
|
|
92
|
-
"@types/react": "^18.0.
|
|
93
|
-
"@types/react-dom": "^18.0.
|
|
91
|
+
"@types/node": "^18.14.4",
|
|
92
|
+
"@types/react": "^18.0.28",
|
|
93
|
+
"@types/react-dom": "^18.0.11",
|
|
94
94
|
"@types/styled-components": "^5.1.26",
|
|
95
95
|
"babel-core": "^7.0.0-bridge.0",
|
|
96
|
-
"babel-jest": "^29.3
|
|
96
|
+
"babel-jest": "^29.4.3",
|
|
97
97
|
"babel-loader": "^9.1.2",
|
|
98
98
|
"babel-plugin-styled-components": "2.0.6",
|
|
99
99
|
"babel-plugin-transform-imports": "^2.0.0",
|
|
100
100
|
"bundlesize2": "^0.0.31",
|
|
101
|
-
"chromatic": "^6.
|
|
101
|
+
"chromatic": "^6.17.1",
|
|
102
102
|
"clean-webpack-plugin": "^4.0.0",
|
|
103
103
|
"copy-webpack-plugin": "^11.0.0",
|
|
104
104
|
"copyfiles": "^2.4.1",
|
|
105
|
-
"core-js": "^3.
|
|
105
|
+
"core-js": "^3.29.0",
|
|
106
106
|
"cross-env": "^7.0.3",
|
|
107
107
|
"del": "^6.1.1",
|
|
108
108
|
"elliptic": "^6.5.4",
|
|
109
|
-
"eslint": "^8.
|
|
109
|
+
"eslint": "^8.35.0",
|
|
110
110
|
"eslint-config-airbnb": "^19.0.4",
|
|
111
111
|
"eslint-config-prettier": "^8.6.0",
|
|
112
112
|
"eslint-plugin-babel": "^5.3.1",
|
|
113
|
-
"eslint-plugin-import": "^2.27.
|
|
113
|
+
"eslint-plugin-import": "^2.27.5",
|
|
114
114
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
115
115
|
"eslint-plugin-prettier": "^4.2.1",
|
|
116
|
-
"eslint-plugin-react": "^7.32.
|
|
116
|
+
"eslint-plugin-react": "^7.32.2",
|
|
117
117
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
118
|
-
"eslint-plugin-testing-library": "^5.
|
|
118
|
+
"eslint-plugin-testing-library": "^5.10.2",
|
|
119
119
|
"fs-extra": "^11.1.0",
|
|
120
120
|
"grommet-theme-aruba": "^0.1.2",
|
|
121
121
|
"grommet-theme-dxc": "^0.1.2",
|
|
122
122
|
"grommet-theme-hp": "^0.1.2",
|
|
123
123
|
"grommet-theme-hpe": "^4.2.0",
|
|
124
|
-
"jest": "^29.3
|
|
124
|
+
"jest": "^29.4.3",
|
|
125
125
|
"jest-axe": "^7.0.0",
|
|
126
|
-
"jest-cli": "^29.3
|
|
127
|
-
"jest-environment-jsdom": "^29.3
|
|
126
|
+
"jest-cli": "^29.4.3",
|
|
127
|
+
"jest-environment-jsdom": "^29.4.3",
|
|
128
128
|
"jest-styled-components": "7.0.5",
|
|
129
|
-
"jsdom": "^21.
|
|
129
|
+
"jsdom": "^21.1.0",
|
|
130
130
|
"postcss": "^8.4.21",
|
|
131
131
|
"pre-commit": "^1.2.2",
|
|
132
|
-
"prettier": "^2.8.
|
|
132
|
+
"prettier": "^2.8.4",
|
|
133
133
|
"pretty-quick": "^3.1.3",
|
|
134
134
|
"react": "^18.2.0",
|
|
135
135
|
"react-dev-utils": "^12.0.1",
|
|
@@ -137,15 +137,15 @@
|
|
|
137
137
|
"react-is": "^18.2.0",
|
|
138
138
|
"regenerator-runtime": "^0.13.11",
|
|
139
139
|
"require-reload": "^0.2.2",
|
|
140
|
-
"simple-git": "^3.
|
|
141
|
-
"styled-components": "^5.3.
|
|
140
|
+
"simple-git": "^3.16.1",
|
|
141
|
+
"styled-components": "^5.3.8",
|
|
142
142
|
"tarball-extract": "^0.0.6",
|
|
143
|
-
"testcafe": "
|
|
143
|
+
"testcafe": "2.2.0",
|
|
144
144
|
"testcafe-react-selectors": "^5.0.2",
|
|
145
145
|
"testcafe-reporter-xunit": "^2.2.2",
|
|
146
|
-
"ts-jest": "^29.0.
|
|
146
|
+
"ts-jest": "^29.0.5",
|
|
147
147
|
"ts-loader": "^9.4.2",
|
|
148
|
-
"typescript": "^4.9.
|
|
148
|
+
"typescript": "^4.9.5",
|
|
149
149
|
"webpack": "^5.75.0",
|
|
150
150
|
"webpack-cli": "^5.0.1",
|
|
151
151
|
"webpack-dev-server": "^4.11.1"
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
"bundlesize": [
|
|
208
208
|
{
|
|
209
209
|
"path": "./dist/grommet.min.js",
|
|
210
|
-
"maxSize": "
|
|
210
|
+
"maxSize": "158 kB"
|
|
211
211
|
}
|
|
212
212
|
],
|
|
213
213
|
"keywords": [
|
package/themes/base.d.ts
CHANGED
|
@@ -164,6 +164,7 @@ interface ButtonKindType {
|
|
|
164
164
|
|
|
165
165
|
interface ButtonType {
|
|
166
166
|
badge?: {
|
|
167
|
+
align?: 'container';
|
|
167
168
|
container?: {
|
|
168
169
|
background?: BackgroundType;
|
|
169
170
|
pad?: PadType;
|
|
@@ -1028,6 +1029,8 @@ export interface ThemeType {
|
|
|
1028
1029
|
};
|
|
1029
1030
|
icon?: {
|
|
1030
1031
|
extend?: ExtendType;
|
|
1032
|
+
disableScaleDown?: boolean;
|
|
1033
|
+
matchSize?: boolean;
|
|
1031
1034
|
size?: {
|
|
1032
1035
|
small?: string;
|
|
1033
1036
|
medium?: string;
|
package/themes/base.js
CHANGED
|
@@ -356,6 +356,11 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
356
356
|
full: '100%'
|
|
357
357
|
}
|
|
358
358
|
},
|
|
359
|
+
// icon: {
|
|
360
|
+
// extennd: undefined,
|
|
361
|
+
// matchSize: undefined,
|
|
362
|
+
// size: undefined,
|
|
363
|
+
// },
|
|
359
364
|
accordion: {
|
|
360
365
|
panel: {
|
|
361
366
|
// border: {
|
|
@@ -470,6 +475,7 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
470
475
|
|
|
471
476
|
button: {
|
|
472
477
|
badge: {
|
|
478
|
+
// align: undefined,,
|
|
473
479
|
container: {
|
|
474
480
|
background: 'brand'
|
|
475
481
|
// pad: undefined,
|
package/utils/icon.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useSizedIcon = void 0;
|
|
5
|
+
var _react = require("react");
|
|
6
|
+
var useSizedIcon = function useSizedIcon(icon, size, theme) {
|
|
7
|
+
var _theme$icon;
|
|
8
|
+
return icon && theme != null && (_theme$icon = theme.icon) != null && _theme$icon.matchSize && !icon.props.size ? /*#__PURE__*/(0, _react.cloneElement)(icon, {
|
|
9
|
+
size: size
|
|
10
|
+
}) : icon;
|
|
11
|
+
};
|
|
12
|
+
exports.useSizedIcon = useSizedIcon;
|
package/utils/index.js
CHANGED
|
@@ -49,6 +49,12 @@ Object.keys(_graphics).forEach(function (key) {
|
|
|
49
49
|
if (key in exports && exports[key] === _graphics[key]) return;
|
|
50
50
|
exports[key] = _graphics[key];
|
|
51
51
|
});
|
|
52
|
+
var _icon = require("./icon");
|
|
53
|
+
Object.keys(_icon).forEach(function (key) {
|
|
54
|
+
if (key === "default" || key === "__esModule") return;
|
|
55
|
+
if (key in exports && exports[key] === _icon[key]) return;
|
|
56
|
+
exports[key] = _icon[key];
|
|
57
|
+
});
|
|
52
58
|
var _styles = require("./styles");
|
|
53
59
|
Object.keys(_styles).forEach(function (key) {
|
|
54
60
|
if (key === "default" || key === "__esModule") return;
|
package/utils/styles.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.widthStyle = exports.unfocusStyle = exports.textAlignStyle = exports.sizeStyle = exports.roundStyle = exports.plainInputStyle = exports.overflowStyle = exports.kindPartStyles = exports.inputStyle = exports.heightStyle = exports.getInputPadBySide = exports.genericStyles = exports.focusStyle = exports.fillStyle = exports.edgeStyle = exports.disabledStyle = exports.controlBorderStyle = exports.baseStyle = exports.alignStyle = exports.alignContentStyle = void 0;
|
|
4
|
+
exports.widthStyle = exports.unfocusStyle = exports.textAlignStyle = exports.sizeStyle = exports.roundStyle = exports.plainInputStyle = exports.overflowStyle = exports.kindPartStyles = exports.inputStyle = exports.inputPadForIcon = exports.heightStyle = exports.getInputPadBySide = exports.genericStyles = exports.focusStyle = exports.fillStyle = exports.edgeStyle = exports.disabledStyle = exports.controlBorderStyle = exports.baseStyle = exports.alignStyle = exports.alignContentStyle = void 0;
|
|
5
5
|
var _styledComponents = require("styled-components");
|
|
6
6
|
var _background = require("./background");
|
|
7
7
|
var _colors = require("./colors");
|
|
@@ -256,7 +256,18 @@ var inputStyle = (0, _styledComponents.css)(["box-sizing:border-box;", " font-fa
|
|
|
256
256
|
}, controlBorderStyle, placeholderStyle, function (props) {
|
|
257
257
|
return props.theme.global.input.extend;
|
|
258
258
|
});
|
|
259
|
+
|
|
260
|
+
// Apply padding on input to create space for icon.
|
|
261
|
+
// When theme.icon.matchSize is true, the space for the
|
|
262
|
+
// icon should equal the icon dimension + 12px (edgeSize.medium)
|
|
263
|
+
// to ensure there is reasonable space between the icon and value or placeholder
|
|
259
264
|
exports.inputStyle = inputStyle;
|
|
265
|
+
var inputPadForIcon = (0, _styledComponents.css)(["", ""], function (props) {
|
|
266
|
+
var _props$theme, _props$theme$icon, _props$theme$icon2, _props$theme$icon2$si;
|
|
267
|
+
var pad = (_props$theme = props.theme) != null && (_props$theme$icon = _props$theme.icon) != null && _props$theme$icon.matchSize ? (0, _mixins.parseMetricToNum)((_props$theme$icon2 = props.theme.icon) == null ? void 0 : (_props$theme$icon2$si = _props$theme$icon2.size) == null ? void 0 : _props$theme$icon2$si[(props == null ? void 0 : props.size) || 'medium']) + (0, _mixins.parseMetricToNum)(props.theme.global.edgeSize.medium) + "px" : props.theme.global.edgeSize.large;
|
|
268
|
+
return props.reverse ? "padding-right: " + pad + ";" : "padding-left: " + pad + ";";
|
|
269
|
+
});
|
|
270
|
+
exports.inputPadForIcon = inputPadForIcon;
|
|
260
271
|
var overflowStyle = function overflowStyle(overflowProp) {
|
|
261
272
|
if (typeof overflowProp === 'string') {
|
|
262
273
|
return (0, _styledComponents.css)(["overflow:", ";"], overflowProp);
|