@automattic/jetpack-components 0.55.0 → 0.55.2

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,17 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [0.55.2] - 2024-07-26
6
+ ### Added
7
+ - Export button props type to be used elsewhere [#38549]
8
+
9
+ ## [0.55.1] - 2024-07-25
10
+ ### Added
11
+ - Added `className` prop to `Alert` component [#38450]
12
+
13
+ ### Changed
14
+ - React compatibility: Ensuring createRoot is not called more than once. [#38495]
15
+
5
16
  ## [0.55.0] - 2024-07-22
6
17
  ### Removed
7
18
  - Remove compatibility with WordPress 6.4. [#38386]
@@ -1091,6 +1102,8 @@
1091
1102
  ### Changed
1092
1103
  - Update node version requirement to 14.16.1
1093
1104
 
1105
+ [0.55.2]: https://github.com/Automattic/jetpack-components/compare/0.55.1...0.55.2
1106
+ [0.55.1]: https://github.com/Automattic/jetpack-components/compare/0.55.0...0.55.1
1094
1107
  [0.55.0]: https://github.com/Automattic/jetpack-components/compare/0.54.4...0.55.0
1095
1108
  [0.54.4]: https://github.com/Automattic/jetpack-components/compare/0.54.3...0.54.4
1096
1109
  [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/index.ts CHANGED
@@ -48,6 +48,7 @@ export { default as ToggleControl } from './components/toggle-control';
48
48
  export { default as numberFormat } from './components/number-format';
49
49
  export { default as QRCode } from './components/qr-code';
50
50
  export { default as Button } from './components/button';
51
+ export type { ButtonProps } from './components/button/types';
51
52
  export { default as LoadingPlaceholder } from './components/loading-placeholder';
52
53
  export { default as TermsOfService } from './components/terms-of-service';
53
54
  export { default as Chip } from './components/chip';
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.2",
4
4
  "description": "Jetpack Components Package",
5
5
  "author": "Automattic",
6
6
  "license": "GPL-2.0-or-later",