@automattic/jetpack-components 0.55.0 → 0.55.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [0.55.1] - 2024-07-25
6
+ ### Added
7
+ - Added `className` prop to `Alert` component [#38450]
8
+
9
+ ### Changed
10
+ - React compatibility: Ensuring createRoot is not called more than once. [#38495]
11
+
5
12
  ## [0.55.0] - 2024-07-22
6
13
  ### Removed
7
14
  - Remove compatibility with WordPress 6.4. [#38386]
@@ -1091,6 +1098,7 @@
1091
1098
  ### Changed
1092
1099
  - Update node version requirement to 14.16.1
1093
1100
 
1101
+ [0.55.1]: https://github.com/Automattic/jetpack-components/compare/0.55.0...0.55.1
1094
1102
  [0.55.0]: https://github.com/Automattic/jetpack-components/compare/0.54.4...0.55.0
1095
1103
  [0.54.4]: https://github.com/Automattic/jetpack-components/compare/0.54.3...0.54.4
1096
1104
  [0.54.3]: https://github.com/Automattic/jetpack-components/compare/0.54.2...0.54.3
@@ -12,6 +12,9 @@ type AlertProps = {
12
12
 
13
13
  /** Children to be rendered inside the alert. */
14
14
  children: React.ReactNode;
15
+
16
+ /** Wrapper class name */
17
+ className?: string;
15
18
  };
16
19
 
17
20
  const getIconByLevel = ( level: AlertProps[ 'level' ] ) => {
@@ -35,11 +38,17 @@ const getIconByLevel = ( level: AlertProps[ 'level' ] ) => {
35
38
  * @param {object} props - The component properties.
36
39
  * @param {string} props.level - The alert level: error, warning, info, success.
37
40
  * @param {boolean} props.showIcon - Whether to show the alert icon.
41
+ * @param {string} props.className - The wrapper class name.
38
42
  * @param {React.Component} props.children - The alert content.
39
43
  * @returns {React.ReactElement} The `Alert` component.
40
44
  */
41
- const Alert: React.FC< AlertProps > = ( { level = 'warning', children, showIcon = true } ) => {
42
- const classes = clsx( styles.container, styles[ `is-${ level }` ] );
45
+ const Alert: React.FC< AlertProps > = ( {
46
+ level = 'warning',
47
+ children,
48
+ showIcon = true,
49
+ className,
50
+ } ) => {
51
+ const classes = clsx( styles.container, styles[ `is-${ level }` ], className );
43
52
 
44
53
  return (
45
54
  <div className={ classes }>
@@ -22,8 +22,9 @@ export function tooltipsPlugin( periods ) {
22
22
  */
23
23
  function init( u: uPlot, _opts: object ) {
24
24
  container.classList.add( 'jb-score-tooltips-container' );
25
-
26
- reactDom = ReactDOM.createRoot( reactRoot );
25
+ if ( ! reactDom ) {
26
+ reactDom = ReactDOM.createRoot( reactRoot );
27
+ }
27
28
  reactRoot.style.position = 'absolute';
28
29
  reactRoot.style.bottom = -20 + 'px';
29
30
  reactRoot.style.translate = '-50% calc( 100% - 20px )';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-components",
3
- "version": "0.55.0",
3
+ "version": "0.55.1",
4
4
  "description": "Jetpack Components Package",
5
5
  "author": "Automattic",
6
6
  "license": "GPL-2.0-or-later",