grommet 2.50.0 → 2.52.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/stories/Gap.stories.js +6 -0
- package/components/Box/Box.js +19 -0
- package/components/Button/Button.js +10 -1
- package/components/Calendar/Calendar.js +8 -5
- package/components/Grommet/index.d.ts +3 -0
- package/components/Grommet/propTypes.js +3 -0
- package/components/List/List.js +6 -4
- package/components/Meter/Meter.js +3 -6
- package/components/Select/Select.js +1 -0
- package/components/Select/SelectContainer.js +19 -2
- package/components/Select/index.d.ts +6 -1
- package/components/Select/propTypes.js +4 -1
- package/components/SelectMultiple/SelectMultipleContainer.js +11 -2
- package/components/SelectMultiple/index.d.ts +1 -0
- package/components/SelectMultiple/propTypes.js +1 -0
- package/es6/components/Anchor/stories/Gap.stories.js +6 -0
- package/es6/components/Box/Box.js +19 -0
- package/es6/components/Button/Button.js +10 -1
- package/es6/components/Calendar/Calendar.js +8 -5
- package/es6/components/Grommet/index.d.ts +3 -0
- package/es6/components/Grommet/propTypes.js +3 -0
- package/es6/components/List/List.js +6 -4
- package/es6/components/Meter/Meter.js +3 -6
- package/es6/components/Select/Select.js +1 -0
- package/es6/components/Select/SelectContainer.js +20 -3
- package/es6/components/Select/index.d.ts +6 -1
- package/es6/components/Select/propTypes.js +4 -1
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +11 -2
- package/es6/components/SelectMultiple/index.d.ts +1 -0
- package/es6/components/SelectMultiple/propTypes.js +1 -0
- package/es6/languages/default.json +3 -0
- package/es6/themes/base.d.ts +9 -0
- package/es6/themes/base.js +27 -1
- package/es6/utils/colors.js +29 -0
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +3 -0
- package/package.json +43 -43
- package/themes/base.d.ts +9 -0
- package/themes/base.js +27 -1
- package/utils/colors.js +29 -0
package/languages/default.json
CHANGED
|
@@ -166,7 +166,9 @@
|
|
|
166
166
|
"upper": "Upper Bounds"
|
|
167
167
|
},
|
|
168
168
|
"select": {
|
|
169
|
+
"optionsA11y": "list of options",
|
|
169
170
|
"multiple": "multiple",
|
|
171
|
+
"searchA11y": "Search options",
|
|
170
172
|
"selected": "; Selected: {currentSelectedValue}"
|
|
171
173
|
},
|
|
172
174
|
"selectMultiple": {
|
|
@@ -174,6 +176,7 @@
|
|
|
174
176
|
"clearAllA11y": "{selected} options selected. Clear all?",
|
|
175
177
|
"open": "Open drop",
|
|
176
178
|
"optionNotSelected": "{optionLabel} not selected",
|
|
179
|
+
"optionsA11y": "list of options",
|
|
177
180
|
"optionSelected": "{optionLabel} selected",
|
|
178
181
|
"search": "Search to filter options",
|
|
179
182
|
"selectAll": "Select All",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grommet",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.52.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"module": "es6/index.js",
|
|
6
6
|
"jsnext:main": "es6/index.js",
|
|
@@ -54,30 +54,30 @@
|
|
|
54
54
|
"styled-components": "^5.1.0 || ^6.0.0"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@emotion/is-prop-valid": "^1.
|
|
58
|
-
"grommet-icons": "^4.
|
|
57
|
+
"@emotion/is-prop-valid": "^1.4.0",
|
|
58
|
+
"grommet-icons": "^4.14.0",
|
|
59
59
|
"markdown-to-jsx": "7.4.4",
|
|
60
60
|
"prop-types": "^15.8.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@babel/cli": "^7.28.
|
|
64
|
-
"@babel/core": "^7.28.
|
|
65
|
-
"@babel/eslint-parser": "^7.28.
|
|
63
|
+
"@babel/cli": "^7.28.3",
|
|
64
|
+
"@babel/core": "^7.28.5",
|
|
65
|
+
"@babel/eslint-parser": "^7.28.5",
|
|
66
66
|
"@babel/node": "^7.28.0",
|
|
67
67
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
68
|
-
"@babel/plugin-proposal-do-expressions": "^7.28.
|
|
68
|
+
"@babel/plugin-proposal-do-expressions": "^7.28.3",
|
|
69
69
|
"@babel/plugin-proposal-export-default-from": "^7.27.1",
|
|
70
70
|
"@babel/plugin-proposal-pipeline-operator": "^7.27.1",
|
|
71
71
|
"@babel/plugin-transform-class-properties": "^7.27.1",
|
|
72
|
-
"@babel/plugin-transform-logical-assignment-operators": "^7.
|
|
72
|
+
"@babel/plugin-transform-logical-assignment-operators": "^7.28.5",
|
|
73
73
|
"@babel/plugin-transform-nullish-coalescing-operator": "^7.27.1",
|
|
74
|
-
"@babel/plugin-transform-optional-chaining": "^7.
|
|
75
|
-
"@babel/preset-env": "^7.28.
|
|
76
|
-
"@babel/preset-react": "^7.
|
|
74
|
+
"@babel/plugin-transform-optional-chaining": "^7.28.5",
|
|
75
|
+
"@babel/preset-env": "^7.28.5",
|
|
76
|
+
"@babel/preset-react": "^7.28.5",
|
|
77
77
|
"@chromatic-com/storybook": "^3.2.6",
|
|
78
|
-
"@eslint/compat": "^
|
|
78
|
+
"@eslint/compat": "^2.0.0",
|
|
79
79
|
"@eslint/eslintrc": "^3.3.1",
|
|
80
|
-
"@eslint/js": "^9.
|
|
80
|
+
"@eslint/js": "^9.39.1",
|
|
81
81
|
"@storybook/addon-a11y": "^8.6.14",
|
|
82
82
|
"@storybook/addon-storysource": "^8.6.14",
|
|
83
83
|
"@storybook/addon-toolbars": "^8.6.14",
|
|
@@ -87,69 +87,69 @@
|
|
|
87
87
|
"@storybook/react-webpack5": "^8.6.14",
|
|
88
88
|
"@storybook/source-loader": "^8.6.14",
|
|
89
89
|
"@testing-library/dom": "^10.4.1",
|
|
90
|
-
"@testing-library/jest-dom": "^6.
|
|
90
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
91
91
|
"@testing-library/react": "^16.3.0",
|
|
92
92
|
"@testing-library/testcafe": "^5.0.1",
|
|
93
93
|
"@testing-library/user-event": "^14.6.1",
|
|
94
94
|
"@types/jest": "^30.0.0",
|
|
95
95
|
"@types/jest-axe": "^3.5.9",
|
|
96
|
-
"@types/node": "^24.1
|
|
97
|
-
"@types/react": "^19.
|
|
98
|
-
"@types/react-dom": "^19.
|
|
99
|
-
"@types/styled-components": "^5.1.
|
|
96
|
+
"@types/node": "^24.10.1",
|
|
97
|
+
"@types/react": "^19.2.4",
|
|
98
|
+
"@types/react-dom": "^19.2.3",
|
|
99
|
+
"@types/styled-components": "^5.1.35",
|
|
100
100
|
"babel-core": "^7.0.0-bridge.0",
|
|
101
|
-
"babel-jest": "^30.
|
|
101
|
+
"babel-jest": "^30.2.0",
|
|
102
102
|
"babel-loader": "^10.0.0",
|
|
103
103
|
"babel-plugin-styled-components": "^2.1.4",
|
|
104
104
|
"babel-plugin-transform-imports": "^2.0.0",
|
|
105
105
|
"bundlesize2": "^0.0.35",
|
|
106
|
-
"chromatic": "^13.
|
|
106
|
+
"chromatic": "^13.3.3",
|
|
107
107
|
"clean-webpack-plugin": "^4.0.0",
|
|
108
|
-
"copy-webpack-plugin": "^
|
|
108
|
+
"copy-webpack-plugin": "^13.0.1",
|
|
109
109
|
"copyfiles": "^2.4.1",
|
|
110
|
-
"core-js": "^3.
|
|
111
|
-
"cross-env": "^
|
|
110
|
+
"core-js": "^3.46.0",
|
|
111
|
+
"cross-env": "^10.1.0",
|
|
112
112
|
"del": "^6.1.1",
|
|
113
|
-
"eslint": "^9.
|
|
113
|
+
"eslint": "^9.39.1",
|
|
114
114
|
"eslint-config-airbnb": "^19.0.4",
|
|
115
115
|
"eslint-config-prettier": "^10.1.8",
|
|
116
116
|
"eslint-plugin-babel": "^5.3.1",
|
|
117
117
|
"eslint-plugin-import": "^2.32.0",
|
|
118
118
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
119
|
-
"eslint-plugin-prettier": "^5.5.
|
|
119
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
120
120
|
"eslint-plugin-react": "^7.37.5",
|
|
121
|
-
"eslint-plugin-react-hooks": "
|
|
122
|
-
"eslint-plugin-testing-library": "^7.
|
|
123
|
-
"fs-extra": "^11.3.
|
|
124
|
-
"globals": "^16.
|
|
125
|
-
"grommet-theme-hpe": "^7.0.
|
|
126
|
-
"jest": "^30.
|
|
121
|
+
"eslint-plugin-react-hooks": "7.0.0",
|
|
122
|
+
"eslint-plugin-testing-library": "^7.13.4",
|
|
123
|
+
"fs-extra": "^11.3.2",
|
|
124
|
+
"globals": "^16.5.0",
|
|
125
|
+
"grommet-theme-hpe": "^7.0.2",
|
|
126
|
+
"jest": "^30.2.0",
|
|
127
127
|
"jest-axe": "^10.0.0",
|
|
128
|
-
"jest-cli": "^30.
|
|
129
|
-
"jest-environment-jsdom": "^30.
|
|
128
|
+
"jest-cli": "^30.2.0",
|
|
129
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
130
130
|
"jest-styled-components": "7.0.5",
|
|
131
|
-
"jsdom": "^
|
|
131
|
+
"jsdom": "^27.2.0",
|
|
132
132
|
"postcss": "^8.5.6",
|
|
133
133
|
"pre-commit": "^1.2.2",
|
|
134
134
|
"prettier": "^2.8.8",
|
|
135
135
|
"pretty-quick": "^4.2.2",
|
|
136
|
-
"react": "19.
|
|
136
|
+
"react": "19.2.0",
|
|
137
137
|
"react-dev-utils": "^12.0.1",
|
|
138
|
-
"react-dom": "19.
|
|
139
|
-
"react-is": "19.
|
|
138
|
+
"react-dom": "19.2.0",
|
|
139
|
+
"react-is": "19.2.0",
|
|
140
140
|
"react-shadow": "^20.6.0",
|
|
141
141
|
"regenerator-runtime": "^0.14.1",
|
|
142
|
-
"simple-git": "^3.
|
|
142
|
+
"simple-git": "^3.30.0",
|
|
143
143
|
"storybook": "^8.6.14",
|
|
144
144
|
"styled-components": "^6.1.19",
|
|
145
145
|
"tarball-extract": "^0.0.6",
|
|
146
146
|
"testcafe": "^3.7.2",
|
|
147
147
|
"testcafe-react-selectors": "^5.0.3",
|
|
148
148
|
"testcafe-reporter-xunit": "^2.2.3",
|
|
149
|
-
"ts-jest": "^29.4.
|
|
150
|
-
"ts-loader": "^9.5.
|
|
151
|
-
"typescript": "^5.
|
|
152
|
-
"webpack": "^5.
|
|
149
|
+
"ts-jest": "^29.4.5",
|
|
150
|
+
"ts-loader": "^9.5.4",
|
|
151
|
+
"typescript": "^5.9.3",
|
|
152
|
+
"webpack": "^5.102.1",
|
|
153
153
|
"webpack-cli": "^6.0.1",
|
|
154
154
|
"webpack-dev-server": "^5.2.2"
|
|
155
155
|
},
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
"bundlesize": [
|
|
214
214
|
{
|
|
215
215
|
"path": "./dist/grommet.min.js",
|
|
216
|
-
"maxSize": "
|
|
216
|
+
"maxSize": "192 kB"
|
|
217
217
|
}
|
|
218
218
|
],
|
|
219
219
|
"keywords": [
|
package/themes/base.d.ts
CHANGED
|
@@ -356,6 +356,13 @@ export interface ThemeType {
|
|
|
356
356
|
}
|
|
357
357
|
| undefined;
|
|
358
358
|
};
|
|
359
|
+
deprecated?: {
|
|
360
|
+
backgrounds?: { name: string; message?: string }[];
|
|
361
|
+
colors?: { name: string; message?: string }[];
|
|
362
|
+
button?: {
|
|
363
|
+
kind?: { name: string; message?: string }[];
|
|
364
|
+
};
|
|
365
|
+
};
|
|
359
366
|
deviceBreakpoints?: {
|
|
360
367
|
phone?: string;
|
|
361
368
|
tablet?: string;
|
|
@@ -1466,6 +1473,7 @@ export interface ThemeType {
|
|
|
1466
1473
|
};
|
|
1467
1474
|
};
|
|
1468
1475
|
meter?: {
|
|
1476
|
+
background?: BackgroundType;
|
|
1469
1477
|
color?: ColorType;
|
|
1470
1478
|
colors?: GraphColorsType;
|
|
1471
1479
|
extend?: ExtendType;
|
|
@@ -1928,6 +1936,7 @@ export interface ThemeType {
|
|
|
1928
1936
|
down?: React.ReactNode | Icon;
|
|
1929
1937
|
up?: React.ReactNode | Icon;
|
|
1930
1938
|
margin?: MarginType;
|
|
1939
|
+
search?: React.ReactNode | Icon;
|
|
1931
1940
|
};
|
|
1932
1941
|
listbox?: {
|
|
1933
1942
|
extend?: ExtendType;
|
package/themes/base.js
CHANGED
|
@@ -237,6 +237,28 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
237
237
|
// might be too long depending on how fast people type, and 200ms
|
|
238
238
|
// would be an eye blink
|
|
239
239
|
debounceDelay: 500,
|
|
240
|
+
// deprecated: {
|
|
241
|
+
// backgrounds: [
|
|
242
|
+
// {
|
|
243
|
+
// name: string,
|
|
244
|
+
// message: string,
|
|
245
|
+
// },
|
|
246
|
+
// ],
|
|
247
|
+
// colors: [
|
|
248
|
+
// {
|
|
249
|
+
// name: string,
|
|
250
|
+
// message: string,
|
|
251
|
+
// },
|
|
252
|
+
// ],
|
|
253
|
+
// button: {
|
|
254
|
+
// kind: [
|
|
255
|
+
// {
|
|
256
|
+
// name: string,
|
|
257
|
+
// message: string,
|
|
258
|
+
// },
|
|
259
|
+
// ],
|
|
260
|
+
// },
|
|
261
|
+
// },
|
|
240
262
|
drop: {
|
|
241
263
|
// intelligentMargin: undefined,
|
|
242
264
|
background: {
|
|
@@ -373,7 +395,7 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
373
395
|
}
|
|
374
396
|
},
|
|
375
397
|
// icon: {
|
|
376
|
-
//
|
|
398
|
+
// extend: undefined,
|
|
377
399
|
// matchSize: undefined,
|
|
378
400
|
// size: undefined,
|
|
379
401
|
// },
|
|
@@ -1599,6 +1621,10 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
1599
1621
|
}
|
|
1600
1622
|
},
|
|
1601
1623
|
meter: {
|
|
1624
|
+
background: {
|
|
1625
|
+
color: 'light-2',
|
|
1626
|
+
opacity: 'medium'
|
|
1627
|
+
},
|
|
1602
1628
|
color: 'graph-0'
|
|
1603
1629
|
// colors: [] || colors: ['graph-0', 'graph-1', 'graph-2', 'graph-3'],
|
|
1604
1630
|
// extend: undefined,
|
package/utils/colors.js
CHANGED
|
@@ -2,10 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.normalizeColor = exports.getRGBArray = exports.getRGBA = exports.colorIsDark = exports.canExtractRGBArray = void 0;
|
|
5
|
+
// Track which deprecated colors have already been warned about
|
|
6
|
+
var warnedColors = new Set();
|
|
7
|
+
var checkColorDeprecation = function checkColorDeprecation(color, theme, dark) {
|
|
8
|
+
var _theme$global$depreca;
|
|
9
|
+
if ((_theme$global$depreca = theme.global.deprecated) != null && _theme$global$depreca.colors && process.env.NODE_ENV !== 'production') {
|
|
10
|
+
var colorKey = color;
|
|
11
|
+
if (typeof color === 'object') {
|
|
12
|
+
if (dark === true || dark === undefined && theme.dark) colorKey = color.dark;else colorKey = color.light;
|
|
13
|
+
}
|
|
14
|
+
if (!warnedColors.has(colorKey)) {
|
|
15
|
+
var deprecatedColor;
|
|
16
|
+
if (typeof color === 'string') {
|
|
17
|
+
deprecatedColor = theme.global.deprecated.colors.find(function (item) {
|
|
18
|
+
return item.name === color;
|
|
19
|
+
});
|
|
20
|
+
} else if (typeof color === 'object') {
|
|
21
|
+
deprecatedColor = theme.global.deprecated.colors.find(function (item) {
|
|
22
|
+
return item.name === color.light || item.name === color.dark;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
if (deprecatedColor) {
|
|
26
|
+
warnedColors.add(colorKey);
|
|
27
|
+
console.warn(deprecatedColor.message || colorKey + " is deprecated.");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
5
33
|
// Returns the specific color that should be used according to the theme.
|
|
6
34
|
// If 'dark' is supplied, it takes precedence over 'theme.dark'.
|
|
7
35
|
// Can return undefined.
|
|
8
36
|
var _normalizeColor = exports.normalizeColor = function normalizeColor(color, theme, dark) {
|
|
37
|
+
checkColorDeprecation(color, theme, dark);
|
|
9
38
|
var colorSpec = theme.global && theme.global.colors[color] !== undefined ? theme.global.colors[color] : color;
|
|
10
39
|
// If the color has a light or dark object, use that
|
|
11
40
|
var result = colorSpec;
|