grommet 2.51.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grommet",
3
- "version": "2.51.0",
3
+ "version": "2.52.0",
4
4
  "main": "index.js",
5
5
  "module": "es6/index.js",
6
6
  "jsnext:main": "es6/index.js",
@@ -75,9 +75,9 @@
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": "^1.4.0",
78
+ "@eslint/compat": "^2.0.0",
79
79
  "@eslint/eslintrc": "^3.3.1",
80
- "@eslint/js": "^9.38.0",
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",
@@ -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": "^24.9.1",
97
- "@types/react": "^19.2.2",
98
- "@types/react-dom": "^19.2.2",
99
- "@types/styled-components": "^5.1.34",
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
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.1",
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
110
  "core-js": "^3.46.0",
111
111
  "cross-env": "^10.1.0",
112
112
  "del": "^6.1.1",
113
- "eslint": "^9.38.0",
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",
@@ -119,16 +119,16 @@
119
119
  "eslint-plugin-prettier": "^5.5.4",
120
120
  "eslint-plugin-react": "^7.37.5",
121
121
  "eslint-plugin-react-hooks": "7.0.0",
122
- "eslint-plugin-testing-library": "^7.13.3",
122
+ "eslint-plugin-testing-library": "^7.13.4",
123
123
  "fs-extra": "^11.3.2",
124
- "globals": "^16.4.0",
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.1",
131
+ "jsdom": "^27.2.0",
132
132
  "postcss": "^8.5.6",
133
133
  "pre-commit": "^1.2.2",
134
134
  "prettier": "^2.8.8",
@@ -139,7 +139,7 @@
139
139
  "react-is": "19.2.0",
140
140
  "react-shadow": "^20.6.0",
141
141
  "regenerator-runtime": "^0.14.1",
142
- "simple-git": "^3.28.0",
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",
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;
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
- // extennd: undefined,
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;