@automattic/jetpack-components 0.53.1 → 0.53.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [0.53.3] - 2024-05-16
6
+ ### Added
7
+ - Social | Wired up confirmation UI with connect button [#37295]
8
+
9
+ ### Changed
10
+ - Updated package dependencies. [#37379]
11
+ - Updated package dependencies. [#37380]
12
+ - Updated package dependencies. [#37382]
13
+
14
+ ## [0.53.2] - 2024-05-13
15
+ ### Added
16
+ - Added --jp-gray-5 as an alias of --jp-gray to the theme [#37327]
17
+
18
+ ### Fixed
19
+ - Fixed notices z-index for global notices when modal is open [#37196]
20
+
5
21
  ## [0.53.1] - 2024-05-09
6
22
  ### Added
7
23
  - Added GlobalNotices component and useGlobalNotices hook [#37286]
@@ -1023,6 +1039,8 @@
1023
1039
  ### Changed
1024
1040
  - Update node version requirement to 14.16.1
1025
1041
 
1042
+ [0.53.3]: https://github.com/Automattic/jetpack-components/compare/0.53.2...0.53.3
1043
+ [0.53.2]: https://github.com/Automattic/jetpack-components/compare/0.53.1...0.53.2
1026
1044
  [0.53.1]: https://github.com/Automattic/jetpack-components/compare/0.53.0...0.53.1
1027
1045
  [0.53.0]: https://github.com/Automattic/jetpack-components/compare/0.52.1...0.53.0
1028
1046
  [0.52.1]: https://github.com/Automattic/jetpack-components/compare/0.52.0...0.52.1
@@ -26,11 +26,11 @@ const ActionButton = props => {
26
26
  const {
27
27
  label,
28
28
  onClick,
29
- isLoading,
29
+ isLoading = false,
30
30
  loadingText,
31
31
  isDisabled,
32
- displayError,
33
- errorMessage,
32
+ displayError = false,
33
+ errorMessage = __( 'An error occurred. Please try again.', 'jetpack' ),
34
34
  customClass,
35
35
  } = props;
36
36
 
@@ -72,10 +72,4 @@ ActionButton.propTypes = {
72
72
  errorMessage: PropTypes.oneOfType( [ PropTypes.string, PropTypes.element ] ),
73
73
  };
74
74
 
75
- ActionButton.defaultProps = {
76
- isLoading: false,
77
- displayError: false,
78
- errorMessage: __( 'An error occurred. Please try again.', 'jetpack' ),
79
- };
80
-
81
75
  export default ActionButton;
@@ -46,6 +46,7 @@ const ActionPopover = ( {
46
46
  const popoverProps = {
47
47
  ...otherPopoverProps,
48
48
  offset,
49
+ onClose,
49
50
  };
50
51
 
51
52
  const showSteps = Number.isFinite( step ) && Number.isFinite( totalSteps );
@@ -38,7 +38,7 @@ const getIconByLevel = ( level: AlertProps[ 'level' ] ) => {
38
38
  * @param {React.Component} props.children - The alert content.
39
39
  * @returns {React.ReactElement} The `Alert` component.
40
40
  */
41
- const Alert: React.FC< AlertProps > = ( { level, children, showIcon } ) => {
41
+ const Alert: React.FC< AlertProps > = ( { level = 'warning', children, showIcon = true } ) => {
42
42
  const classes = classNames( styles.container, styles[ `is-${ level }` ] );
43
43
 
44
44
  return (
@@ -53,9 +53,4 @@ const Alert: React.FC< AlertProps > = ( { level, children, showIcon } ) => {
53
53
  );
54
54
  };
55
55
 
56
- Alert.defaultProps = {
57
- level: 'warning',
58
- showIcon: true,
59
- };
60
-
61
56
  export default Alert;
@@ -6,6 +6,8 @@
6
6
  inset-block-start: auto; // top
7
7
  inset-block-end: 0; // bottom
8
8
  inset-inline: 0; // left and right
9
+ // Modals have 100000, so this needs to be above them
10
+ z-index: 100001;
9
11
 
10
12
  @include break-small {
11
13
  width: auto;
@@ -51,11 +51,11 @@ const getIconByLevel = ( level: NoticeProps[ 'level' ] ) => {
51
51
  * @returns {React.ReactElement} The `Notice` component.
52
52
  */
53
53
  const Notice: React.FC< NoticeProps > = ( {
54
- level,
54
+ level = 'info',
55
55
  title,
56
56
  children,
57
57
  actions,
58
- hideCloseButton,
58
+ hideCloseButton = false,
59
59
  onClose,
60
60
  } ) => {
61
61
  const classes = classNames( styles.container, styles[ `is-${ level }` ] );
@@ -90,9 +90,4 @@ const Notice: React.FC< NoticeProps > = ( {
90
90
  );
91
91
  };
92
92
 
93
- Notice.defaultProps = {
94
- level: 'info',
95
- hideCloseButton: false,
96
- };
97
-
98
93
  export default Notice;
@@ -47,7 +47,13 @@ const NumberSlider: React.FC< NumberSliderProps > = ( {
47
47
  const renderThumbCallback = renderThumb
48
48
  ? renderThumb
49
49
  : ( props, state ) => {
50
- return <div { ...props }>{ state.valueNow }</div>;
50
+ const { key, ...otherProps } = props;
51
+
52
+ return (
53
+ <div key={ key } { ...otherProps }>
54
+ { state.valueNow }
55
+ </div>
56
+ );
51
57
  };
52
58
 
53
59
  return (
@@ -3,23 +3,23 @@ import React from 'react';
3
3
 
4
4
  import './style.scss';
5
5
 
6
- const Spinner = props => {
7
- const className = props.className + ' jp-components-spinner';
6
+ const Spinner = ( { color = '#FFFFFF', className = '', size = 20 } ) => {
7
+ const theClassName = className + ' jp-components-spinner';
8
8
 
9
9
  const styleOuter = {
10
- width: props.size,
11
- height: props.size,
12
- fontSize: props.size, // allows border-width to be specified in em units
13
- borderTopColor: props.color,
10
+ width: size,
11
+ height: size,
12
+ fontSize: size, // allows border-width to be specified in em units
13
+ borderTopColor: color,
14
14
  };
15
15
 
16
16
  const styleInner = {
17
- borderTopColor: props.color,
18
- borderRightColor: props.color,
17
+ borderTopColor: color,
18
+ borderRightColor: color,
19
19
  };
20
20
 
21
21
  return (
22
- <div className={ className }>
22
+ <div className={ theClassName }>
23
23
  <div className="jp-components-spinner__outer" style={ styleOuter }>
24
24
  <div className="jp-components-spinner__inner" style={ styleInner } />
25
25
  </div>
@@ -36,10 +36,4 @@ Spinner.propTypes = {
36
36
  size: PropTypes.number,
37
37
  };
38
38
 
39
- Spinner.defaultProps = {
40
- color: '#FFFFFF',
41
- className: '',
42
- size: 20,
43
- };
44
-
45
39
  export default Spinner;
@@ -25,6 +25,7 @@ export const colors = {
25
25
  // Gray
26
26
  '--jp-gray': '#dcdcde',
27
27
  '--jp-gray-0': '#F6F7F7',
28
+ '--jp-gray-5': 'var(--jp-gray)',
28
29
  '--jp-gray-10': '#C3C4C7',
29
30
  '--jp-gray-20': '#A7AAAD',
30
31
  '--jp-gray-40': '#787C82',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-components",
3
- "version": "0.53.1",
3
+ "version": "0.53.3",
4
4
  "description": "Jetpack Components Package",
5
5
  "author": "Automattic",
6
6
  "license": "GPL-2.0-or-later",
@@ -15,17 +15,17 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@automattic/format-currency": "1.0.1",
18
- "@automattic/jetpack-boost-score-api": "^0.1.29",
18
+ "@automattic/jetpack-boost-score-api": "^0.1.30",
19
19
  "@babel/runtime": "^7",
20
- "@wordpress/browserslist-config": "5.39.0",
21
- "@wordpress/components": "27.4.0",
22
- "@wordpress/compose": "6.33.0",
23
- "@wordpress/data": "9.26.0",
24
- "@wordpress/date": "4.56.0",
25
- "@wordpress/element": "5.33.0",
26
- "@wordpress/i18n": "4.56.0",
27
- "@wordpress/icons": "9.47.0",
28
- "@wordpress/notices": "4.24.0",
20
+ "@wordpress/browserslist-config": "5.40.0",
21
+ "@wordpress/components": "27.5.0",
22
+ "@wordpress/compose": "6.34.0",
23
+ "@wordpress/data": "9.27.0",
24
+ "@wordpress/date": "4.57.0",
25
+ "@wordpress/element": "5.34.0",
26
+ "@wordpress/i18n": "4.57.0",
27
+ "@wordpress/icons": "9.48.0",
28
+ "@wordpress/notices": "4.25.0",
29
29
  "classnames": "2.3.2",
30
30
  "prop-types": "^15.7.2",
31
31
  "qrcode.react": "3.1.0",
@@ -35,15 +35,15 @@
35
35
  "uplot-react": "1.1.4"
36
36
  },
37
37
  "devDependencies": {
38
- "@automattic/jetpack-base-styles": "^0.6.24",
38
+ "@automattic/jetpack-base-styles": "^0.6.25",
39
39
  "@babel/core": "7.24.0",
40
40
  "@babel/preset-react": "7.23.3",
41
41
  "@jest/globals": "29.4.3",
42
42
  "@storybook/addon-actions": "8.0.9",
43
43
  "@storybook/blocks": "8.0.9",
44
44
  "@storybook/react": "8.0.9",
45
- "@testing-library/dom": "9.3.4",
46
- "@testing-library/react": "14.2.1",
45
+ "@testing-library/dom": "10.1.0",
46
+ "@testing-library/react": "15.0.7",
47
47
  "@testing-library/user-event": "14.5.2",
48
48
  "@types/jest": "29.5.12",
49
49
  "@types/qrcode.react": "1.0.5",
@@ -54,9 +54,9 @@
54
54
  "@types/testing-library__jest-dom": "5.14.9",
55
55
  "jest": "29.7.0",
56
56
  "jest-environment-jsdom": "29.7.0",
57
- "react": "18.2.0",
58
- "react-dom": "18.2.0",
59
- "react-test-renderer": "18.2.0",
57
+ "react": "18.3.1",
58
+ "react-dom": "18.3.1",
59
+ "react-test-renderer": "18.3.1",
60
60
  "require-from-string": "2.0.2",
61
61
  "resize-observer-polyfill": "1.5.1",
62
62
  "ts-dedent": "2.2.0",