grommet 2.51.0 → 2.53.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/DataChart/DataChart.js +9 -4
- package/components/DataTableColumns/DataTableColumns.js +47 -26
- package/components/DataTableColumns/index.d.ts +1 -0
- package/components/DataTableColumns/propTypes.js +1 -0
- package/components/DataTableColumns/stories/OrderColumns.stories.js +48 -0
- package/components/DataTableColumns/stories/SelectColumns.stories.js +48 -0
- package/components/List/List.js +6 -4
- package/components/Meter/Meter.js +3 -6
- 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/DataChart/DataChart.js +9 -4
- package/es6/components/DataTableColumns/DataTableColumns.js +47 -26
- package/es6/components/DataTableColumns/index.d.ts +1 -0
- package/es6/components/DataTableColumns/propTypes.js +1 -0
- package/es6/components/DataTableColumns/stories/OrderColumns.stories.js +44 -0
- package/es6/components/DataTableColumns/stories/SelectColumns.stories.js +44 -0
- package/es6/components/List/List.js +6 -4
- package/es6/components/Meter/Meter.js +3 -6
- package/es6/themes/base.d.ts +12 -1
- package/es6/themes/base.js +28 -1
- package/es6/utils/colors.js +29 -0
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/package.json +30 -30
- package/themes/base.d.ts +12 -1
- package/themes/base.js +28 -1
- package/utils/colors.js +29 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grommet",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.53.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"module": "es6/index.js",
|
|
6
6
|
"jsnext:main": "es6/index.js",
|
|
@@ -75,17 +75,17 @@
|
|
|
75
75
|
"@babel/preset-env": "^7.28.5",
|
|
76
76
|
"@babel/preset-react": "^7.28.5",
|
|
77
77
|
"@chromatic-com/storybook": "^3.2.6",
|
|
78
|
-
"@eslint/compat": "^
|
|
79
|
-
"@eslint/eslintrc": "^3.3.
|
|
80
|
-
"@eslint/js": "^9.
|
|
81
|
-
"@storybook/addon-a11y": "^8.6.
|
|
82
|
-
"@storybook/addon-storysource": "^8.6.
|
|
83
|
-
"@storybook/addon-toolbars": "^8.6.
|
|
78
|
+
"@eslint/compat": "^2.0.0",
|
|
79
|
+
"@eslint/eslintrc": "^3.3.3",
|
|
80
|
+
"@eslint/js": "^9.39.1",
|
|
81
|
+
"@storybook/addon-a11y": "^8.6.15",
|
|
82
|
+
"@storybook/addon-storysource": "^8.6.15",
|
|
83
|
+
"@storybook/addon-toolbars": "^8.6.15",
|
|
84
84
|
"@storybook/addon-webpack5-compiler-babel": "^3.0.6",
|
|
85
|
-
"@storybook/manager-api": "^8.6.
|
|
86
|
-
"@storybook/react": "^8.6.
|
|
87
|
-
"@storybook/react-webpack5": "^8.6.
|
|
88
|
-
"@storybook/source-loader": "^8.6.
|
|
85
|
+
"@storybook/manager-api": "^8.6.15",
|
|
86
|
+
"@storybook/react": "^8.6.15",
|
|
87
|
+
"@storybook/react-webpack5": "^8.6.15",
|
|
88
|
+
"@storybook/source-loader": "^8.6.15",
|
|
89
89
|
"@testing-library/dom": "^10.4.1",
|
|
90
90
|
"@testing-library/jest-dom": "^6.9.1",
|
|
91
91
|
"@testing-library/react": "^16.3.0",
|
|
@@ -93,24 +93,24 @@
|
|
|
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": "^
|
|
97
|
-
"@types/react": "^19.2.
|
|
98
|
-
"@types/react-dom": "^19.2.
|
|
99
|
-
"@types/styled-components": "^5.1.
|
|
96
|
+
"@types/node": "^25.0.1",
|
|
97
|
+
"@types/react": "^19.2.7",
|
|
98
|
+
"@types/react-dom": "^19.2.3",
|
|
99
|
+
"@types/styled-components": "^5.1.36",
|
|
100
100
|
"babel-core": "^7.0.0-bridge.0",
|
|
101
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.3.
|
|
106
|
+
"chromatic": "^13.3.3",
|
|
107
107
|
"clean-webpack-plugin": "^4.0.0",
|
|
108
108
|
"copy-webpack-plugin": "^13.0.1",
|
|
109
109
|
"copyfiles": "^2.4.1",
|
|
110
|
-
"core-js": "^3.
|
|
110
|
+
"core-js": "^3.47.0",
|
|
111
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",
|
|
@@ -118,38 +118,38 @@
|
|
|
118
118
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
119
119
|
"eslint-plugin-prettier": "^5.5.4",
|
|
120
120
|
"eslint-plugin-react": "^7.37.5",
|
|
121
|
-
"eslint-plugin-react-hooks": "7.0.
|
|
122
|
-
"eslint-plugin-testing-library": "^7.13.
|
|
121
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
122
|
+
"eslint-plugin-testing-library": "^7.13.6",
|
|
123
123
|
"fs-extra": "^11.3.2",
|
|
124
|
-
"globals": "^16.
|
|
124
|
+
"globals": "^16.5.0",
|
|
125
125
|
"grommet-theme-hpe": "^7.0.2",
|
|
126
126
|
"jest": "^30.2.0",
|
|
127
127
|
"jest-axe": "^10.0.0",
|
|
128
128
|
"jest-cli": "^30.2.0",
|
|
129
129
|
"jest-environment-jsdom": "^30.2.0",
|
|
130
130
|
"jest-styled-components": "7.0.5",
|
|
131
|
-
"jsdom": "^27.0
|
|
131
|
+
"jsdom": "^27.3.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.2.
|
|
136
|
+
"react": "^19.2.3",
|
|
137
137
|
"react-dev-utils": "^12.0.1",
|
|
138
|
-
"react-dom": "19.2.
|
|
139
|
-
"react-is": "19.2.
|
|
138
|
+
"react-dom": "^19.2.3",
|
|
139
|
+
"react-is": "^19.2.3",
|
|
140
140
|
"react-shadow": "^20.6.0",
|
|
141
141
|
"regenerator-runtime": "^0.14.1",
|
|
142
|
-
"simple-git": "^3.
|
|
143
|
-
"storybook": "^8.6.
|
|
142
|
+
"simple-git": "^3.30.0",
|
|
143
|
+
"storybook": "^8.6.15",
|
|
144
144
|
"styled-components": "^6.1.19",
|
|
145
145
|
"tarball-extract": "^0.0.6",
|
|
146
|
-
"testcafe": "^3.7.
|
|
146
|
+
"testcafe": "^3.7.4",
|
|
147
147
|
"testcafe-react-selectors": "^5.0.3",
|
|
148
148
|
"testcafe-reporter-xunit": "^2.2.3",
|
|
149
|
-
"ts-jest": "^29.4.
|
|
149
|
+
"ts-jest": "^29.4.6",
|
|
150
150
|
"ts-loader": "^9.5.4",
|
|
151
151
|
"typescript": "^5.9.3",
|
|
152
|
-
"webpack": "^5.
|
|
152
|
+
"webpack": "^5.103.0",
|
|
153
153
|
"webpack-cli": "^6.0.1",
|
|
154
154
|
"webpack-dev-server": "^5.2.2"
|
|
155
155
|
},
|
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;
|
|
@@ -461,6 +468,8 @@ export interface ThemeType {
|
|
|
461
468
|
variant?: string;
|
|
462
469
|
};
|
|
463
470
|
graph?: {
|
|
471
|
+
// remove in v3. Should have been removed in
|
|
472
|
+
// https://github.com/grommet/grommet/pull/3608/
|
|
464
473
|
colors?: GraphColorsType;
|
|
465
474
|
};
|
|
466
475
|
hover?: {
|
|
@@ -879,6 +888,7 @@ export interface ThemeType {
|
|
|
879
888
|
};
|
|
880
889
|
};
|
|
881
890
|
dataChart?: {
|
|
891
|
+
colors?: string[];
|
|
882
892
|
gap?: GapType;
|
|
883
893
|
granularity?: {
|
|
884
894
|
y?: {
|
|
@@ -1415,7 +1425,7 @@ export interface ThemeType {
|
|
|
1415
1425
|
color?: ColorType;
|
|
1416
1426
|
cursor?: string;
|
|
1417
1427
|
};
|
|
1418
|
-
gap
|
|
1428
|
+
gap?: GapType;
|
|
1419
1429
|
pinned?: {
|
|
1420
1430
|
background?: BackgroundType;
|
|
1421
1431
|
icon?: {
|
|
@@ -1466,6 +1476,7 @@ export interface ThemeType {
|
|
|
1466
1476
|
};
|
|
1467
1477
|
};
|
|
1468
1478
|
meter?: {
|
|
1479
|
+
background?: BackgroundType;
|
|
1469
1480
|
color?: ColorType;
|
|
1470
1481
|
colors?: GraphColorsType;
|
|
1471
1482
|
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
|
// },
|
|
@@ -1012,6 +1034,7 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
1012
1034
|
}
|
|
1013
1035
|
},
|
|
1014
1036
|
dataChart: {
|
|
1037
|
+
// colors: [],
|
|
1015
1038
|
gap: 'small',
|
|
1016
1039
|
// granularity: {
|
|
1017
1040
|
// y: {},
|
|
@@ -1599,6 +1622,10 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
1599
1622
|
}
|
|
1600
1623
|
},
|
|
1601
1624
|
meter: {
|
|
1625
|
+
background: {
|
|
1626
|
+
color: 'light-2',
|
|
1627
|
+
opacity: 'medium'
|
|
1628
|
+
},
|
|
1602
1629
|
color: 'graph-0'
|
|
1603
1630
|
// colors: [] || colors: ['graph-0', 'graph-1', 'graph-2', 'graph-3'],
|
|
1604
1631
|
// 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;
|