grommet 2.25.0 → 2.25.1

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.
Files changed (47) hide show
  1. package/components/Calendar/Calendar.js +232 -292
  2. package/components/Calendar/utils.js +16 -129
  3. package/components/Chart/calcs.js +44 -27
  4. package/components/Chart/stories/Scan.js +11 -9
  5. package/components/Chart/stories/data.js +16 -17
  6. package/components/CheckBox/CheckBox.js +3 -2
  7. package/components/DataChart/DataChart.js +3 -15
  8. package/components/DataChart/Detail.js +18 -11
  9. package/components/DataChart/stories/Pad.js +54 -0
  10. package/components/DateInput/DateInput.js +60 -68
  11. package/components/DateInput/utils.js +30 -5
  12. package/components/FileInput/FileInput.js +2 -1
  13. package/components/FileInput/StyledFileInput.js +1 -1
  14. package/components/Form/Form.js +6 -1
  15. package/components/FormField/FormField.js +25 -28
  16. package/components/Image/Image.js +4 -2
  17. package/components/Menu/index.d.ts +2 -2
  18. package/components/Select/SelectContainer.js +24 -36
  19. package/components/Tabs/Tabs.js +2 -1
  20. package/components/Video/StyledVideo.js +2 -2
  21. package/es6/components/Calendar/Calendar.js +230 -292
  22. package/es6/components/Calendar/utils.js +13 -114
  23. package/es6/components/Chart/calcs.js +44 -27
  24. package/es6/components/Chart/stories/Scan.js +10 -9
  25. package/es6/components/Chart/stories/data.js +16 -17
  26. package/es6/components/CheckBox/CheckBox.js +3 -2
  27. package/es6/components/DataChart/DataChart.js +4 -15
  28. package/es6/components/DataChart/Detail.js +20 -10
  29. package/es6/components/DataChart/stories/Pad.js +42 -0
  30. package/es6/components/DateInput/DateInput.js +57 -64
  31. package/es6/components/DateInput/utils.js +29 -7
  32. package/es6/components/FileInput/FileInput.js +2 -1
  33. package/es6/components/FileInput/StyledFileInput.js +1 -1
  34. package/es6/components/Form/Form.js +6 -1
  35. package/es6/components/FormField/FormField.js +25 -29
  36. package/es6/components/Image/Image.js +4 -2
  37. package/es6/components/Menu/index.d.ts +2 -2
  38. package/es6/components/Select/SelectContainer.js +25 -37
  39. package/es6/components/Tabs/Tabs.js +2 -1
  40. package/es6/components/Video/StyledVideo.js +2 -2
  41. package/es6/themes/base.d.ts +13 -27
  42. package/es6/themes/base.js +6 -1
  43. package/grommet.min.js +1 -1
  44. package/grommet.min.js.map +1 -1
  45. package/package.json +44 -42
  46. package/themes/base.d.ts +13 -27
  47. package/themes/base.js +6 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grommet",
3
- "version": "2.25.0",
3
+ "version": "2.25.1",
4
4
  "main": "index.js",
5
5
  "module": "es6/index.js",
6
6
  "jsnext:main": "es6/index.js",
@@ -32,10 +32,12 @@
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",
41
43
  "build-storybook": "build-storybook -c storybook -o storybook-static",
@@ -54,86 +56,86 @@
54
56
  "prop-types": "^15.8.1"
55
57
  },
56
58
  "devDependencies": {
57
- "@babel/cli": "^7.17.6",
59
+ "@babel/cli": "^7.18.6",
58
60
  "@babel/core": "^7.18.2",
59
61
  "@babel/eslint-parser": "^7.18.2",
60
- "@babel/node": "^7.16.8",
61
- "@babel/plugin-proposal-class-properties": "^7.16.7",
62
- "@babel/plugin-proposal-do-expressions": "^7.16.7",
63
- "@babel/plugin-proposal-export-default-from": "^7.16.7",
64
- "@babel/plugin-proposal-logical-assignment-operators": "^7.16.7",
65
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
66
- "@babel/plugin-proposal-optional-chaining": "^7.16.7",
67
- "@babel/plugin-proposal-pipeline-operator": "^7.18.2",
68
- "@babel/preset-env": "^7.18.2",
69
- "@babel/preset-react": "^7.16.7",
62
+ "@babel/node": "^7.18.6",
63
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
64
+ "@babel/plugin-proposal-do-expressions": "^7.18.6",
65
+ "@babel/plugin-proposal-export-default-from": "^7.18.6",
66
+ "@babel/plugin-proposal-logical-assignment-operators": "^7.18.6",
67
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
68
+ "@babel/plugin-proposal-optional-chaining": "^7.18.6",
69
+ "@babel/plugin-proposal-pipeline-operator": "^7.18.6",
70
+ "@babel/preset-env": "^7.18.6",
71
+ "@babel/preset-react": "^7.18.6",
70
72
  "@storybook/addon-a11y": "6.4.22",
71
73
  "@storybook/addon-storysource": "6.4.22",
72
74
  "@storybook/addon-toolbars": "6.4.22",
73
75
  "@storybook/addons": "6.4.22",
74
76
  "@storybook/react": "6.4.22",
75
77
  "@storybook/source-loader": "6.4.22",
76
- "@testing-library/dom": "^8.13.0",
78
+ "@testing-library/dom": "^8.14.0",
77
79
  "@testing-library/jest-dom": "^5.16.4",
78
80
  "@testing-library/react": "^13.3.0",
79
- "@testing-library/user-event": "^14.2.0",
80
- "@types/jest": "^27.5.1",
81
- "@types/jest-axe": "^3.5.3",
82
- "@types/node": "^17.0.40",
83
- "@types/react": "^18.0.12",
81
+ "@testing-library/user-event": "^14.2.1",
82
+ "@types/jest": "^28.1.4",
83
+ "@types/jest-axe": "^3.5.4",
84
+ "@types/node": "^18.0.0",
85
+ "@types/react": "^18.0.14",
84
86
  "@types/react-dom": "^18.0.5",
85
87
  "@types/styled-components": "^5.1.25",
86
88
  "babel-core": "^7.0.0-bridge.0",
87
- "babel-jest": "28.1.0",
89
+ "babel-jest": "^28.1.2",
88
90
  "babel-loader": "^8.2.5",
89
91
  "babel-plugin-styled-components": "2.0.6",
90
92
  "babel-plugin-transform-imports": "^2.0.0",
91
- "bundlesize": "^0.18.1",
92
- "chromatic": "^6.5.6",
93
+ "bundlesize2": "^0.0.31",
94
+ "chromatic": "^6.6.4",
93
95
  "clean-webpack-plugin": "^4.0.0",
94
96
  "copy-webpack-plugin": "^5.0.4",
95
97
  "copyfiles": "^2.4.1",
96
- "core-js": "^3.22.8",
98
+ "core-js": "^3.23.3",
97
99
  "cross-env": "^7.0.3",
98
100
  "del": "^6.1.1",
99
101
  "elliptic": "^6.5.4",
100
- "eslint": "^8.17.0",
102
+ "eslint": "^8.18.0",
101
103
  "eslint-config-airbnb": "^19.0.4",
102
104
  "eslint-config-prettier": "^8.5.0",
103
105
  "eslint-plugin-babel": "^5.3.1",
104
106
  "eslint-plugin-import": "^2.26.0",
105
- "eslint-plugin-jsx-a11y": "^6.5.1",
106
- "eslint-plugin-prettier": "^4.0.0",
107
- "eslint-plugin-react": "^7.29.4",
108
- "eslint-plugin-react-hooks": "^4.5.0",
107
+ "eslint-plugin-jsx-a11y": "^6.6.0",
108
+ "eslint-plugin-prettier": "^4.1.0",
109
+ "eslint-plugin-react": "^7.30.1",
110
+ "eslint-plugin-react-hooks": "^4.6.0",
109
111
  "eslint-plugin-testing-library": "^5.5.1",
110
112
  "fs-extra": "^10.1.0",
111
113
  "grommet-theme-aruba": "^0.1.2",
112
114
  "grommet-theme-dxc": "^0.1.2",
113
115
  "grommet-theme-hp": "^0.1.2",
114
- "grommet-theme-hpe": "^3.1.0",
115
- "jest": "28.1.0",
116
+ "grommet-theme-hpe": "^3.2.0",
117
+ "jest": "^28.1.2",
116
118
  "jest-axe": "^6.0.0",
117
- "jest-cli": "28.1.0",
118
- "jest-environment-jsdom": "28.1.0",
119
+ "jest-cli": "^28.1.2",
120
+ "jest-environment-jsdom": "^28.1.2",
119
121
  "jest-styled-components": "7.0.5",
120
- "jsdom": "^19.0.0",
121
- "postcss": "^8.4.12",
122
+ "jsdom": "^20.0.0",
123
+ "postcss": "^8.4.14",
122
124
  "pre-commit": "^1.2.2",
123
- "prettier": "^2.6.2",
125
+ "prettier": "^2.7.1",
124
126
  "pretty-quick": "^3.1.3",
125
- "react": "^18.1.0",
127
+ "react": "^18.2.0",
126
128
  "react-dev-utils": "^12.0.1",
127
- "react-dom": "^18.1.0",
128
- "react-is": "^18.1.0",
129
+ "react-dom": "^18.2.0",
130
+ "react-is": "^18.2.0",
129
131
  "regenerator-runtime": "^0.13.9",
130
132
  "require-reload": "^0.2.2",
131
- "simple-git": "^3.7.1",
133
+ "simple-git": "^3.10.0",
132
134
  "styled-components": "^5.3.5",
133
135
  "tarball-extract": "^0.0.6",
134
- "ts-jest": "^28.0.4",
136
+ "ts-jest": "^28.0.5",
135
137
  "ts-loader": "^8.4.0",
136
- "typescript": "^4.7.3",
138
+ "typescript": "^4.7.4",
137
139
  "webpack": "^4.44.2",
138
140
  "webpack-cli": "^4.8.0"
139
141
  },
package/themes/base.d.ts CHANGED
@@ -242,6 +242,15 @@ interface FormFieldLabelType extends TextProps {
242
242
  requiredIndicator?: boolean | JSX.Element | string;
243
243
  }
244
244
 
245
+ type DigitalTexts =
246
+ | 'xsmall'
247
+ | 'small'
248
+ | 'medium'
249
+ | 'large'
250
+ | 'xlarge'
251
+ | 'xxlarge'
252
+ | string;
253
+
245
254
  export interface ThemeType {
246
255
  global?: {
247
256
  active?: {
@@ -359,7 +368,8 @@ export interface ThemeType {
359
368
  color?: ColorType;
360
369
  size?: string;
361
370
  };
362
- shadow?: {
371
+ shadow?:
372
+ string | {
363
373
  color?: ColorType;
364
374
  size?: string;
365
375
  };
@@ -517,7 +527,7 @@ export interface ThemeType {
517
527
  };
518
528
  };
519
529
  card?: {
520
- container?: BoxProps;
530
+ container?: BoxProps | { extend?: ExtendType };
521
531
  hover?: {
522
532
  container?: {
523
533
  elevation?: ElevationType;
@@ -626,31 +636,7 @@ export interface ThemeType {
626
636
  };
627
637
  digital?: {
628
638
  text?: {
629
- xsmall?: {
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]: {
639
+ [key in DigitalTexts]: {
654
640
  size?: string;
655
641
  height?: number;
656
642
  };
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
- debounceDelay: 300,
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: {