@automattic/jetpack-components 0.55.8 → 0.55.10

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 (52) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/components/action-button/index.jsx +1 -1
  3. package/components/admin-page/index.tsx +1 -1
  4. package/components/admin-section/basic/index.tsx +1 -1
  5. package/components/admin-section/hero/index.tsx +1 -1
  6. package/components/alert/index.tsx +6 -6
  7. package/components/automattic-byline-logo/index.tsx +1 -1
  8. package/components/automattic-for-agencies-logo/index.tsx +3 -3
  9. package/components/automattic-icon-logo/index.tsx +4 -4
  10. package/components/boost-score-graph/day-highlight-plugin.ts +1 -1
  11. package/components/boost-score-graph/get-date-format.ts +3 -3
  12. package/components/boost-score-graph/index.tsx +5 -5
  13. package/components/boost-score-graph/tooltips-plugin.ts +2 -2
  14. package/components/boost-score-graph/uplot-line-chart.tsx +8 -8
  15. package/components/boost-score-graph/use-boost-score-transform.ts +1 -1
  16. package/components/boost-score-graph/use-resize.ts +1 -1
  17. package/components/button/index.tsx +1 -1
  18. package/components/chip/index.tsx +4 -4
  19. package/components/decorative-card/index.tsx +1 -1
  20. package/components/dialog/index.tsx +6 -6
  21. package/components/donut-meter/index.tsx +1 -1
  22. package/components/global-notices/global-notices.tsx +1 -1
  23. package/components/global-notices/use-global-notices.ts +1 -1
  24. package/components/icon-tooltip/index.tsx +1 -1
  25. package/components/icons/index.tsx +3 -3
  26. package/components/indeterminate-progress-bar/index.tsx +1 -1
  27. package/components/jetpack-footer/index.tsx +1 -1
  28. package/components/layout/col/index.tsx +2 -2
  29. package/components/layout/container/index.tsx +1 -1
  30. package/components/layout/use-breakpoint-match/index.ts +3 -3
  31. package/components/notice/index.tsx +8 -8
  32. package/components/number-format/index.ts +2 -2
  33. package/components/number-slider/index.tsx +1 -1
  34. package/components/pricing-card/index.tsx +2 -2
  35. package/components/product-offer/icons-card.tsx +2 -2
  36. package/components/product-offer/index.tsx +1 -1
  37. package/components/product-offer/product-offer-header.tsx +1 -1
  38. package/components/product-price/index.tsx +1 -1
  39. package/components/product-price/price.tsx +2 -2
  40. package/components/progress-bar/index.tsx +1 -1
  41. package/components/qr-code/index.tsx +1 -1
  42. package/components/record-meter-bar/index.tsx +1 -1
  43. package/components/stat-card/index.tsx +1 -1
  44. package/components/text/index.tsx +7 -7
  45. package/components/theme-provider/index.tsx +2 -2
  46. package/components/upsell-banner/index.tsx +1 -1
  47. package/lib/locale/index.ts +2 -2
  48. package/package.json +4 -4
  49. package/tools/get-product-checkout-url/index.ts +4 -4
  50. package/tools/get-site-admin-url/index.ts +1 -1
  51. package/tools/jp-redirect/index.ts +7 -7
  52. package/tools/pricing-utils/index.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [0.55.10] - 2024-08-23
6
+ ### Changed
7
+ - Internal updates.
8
+
9
+ ## [0.55.9] - 2024-08-21
10
+ ### Fixed
11
+ - Revert recent SVG image optimizations. [#38981]
12
+
5
13
  ## [0.55.8] - 2024-08-19
6
14
  ### Changed
7
15
  - Updated package dependencies. [#38893]
@@ -1129,6 +1137,8 @@
1129
1137
  ### Changed
1130
1138
  - Update node version requirement to 14.16.1
1131
1139
 
1140
+ [0.55.10]: https://github.com/Automattic/jetpack-components/compare/0.55.9...0.55.10
1141
+ [0.55.9]: https://github.com/Automattic/jetpack-components/compare/0.55.8...0.55.9
1132
1142
  [0.55.8]: https://github.com/Automattic/jetpack-components/compare/0.55.7...0.55.8
1133
1143
  [0.55.7]: https://github.com/Automattic/jetpack-components/compare/0.55.6...0.55.7
1134
1144
  [0.55.6]: https://github.com/Automattic/jetpack-components/compare/0.55.5...0.55.6
@@ -20,7 +20,7 @@ import styles from './style.module.scss';
20
20
  * It is useful to async actions when the user has to wait the result of a request or process.
21
21
  *
22
22
  * @param {object} props - The properties.
23
- * @returns {React.Component} The `ActionButton` component.
23
+ * @return {React.Component} The `ActionButton` component.
24
24
  */
25
25
  const ActionButton = props => {
26
26
  const {
@@ -14,7 +14,7 @@ import type React from 'react';
14
14
  * All content must be passed as children wrapped in as many <AdminSection> elements as needed.
15
15
  *
16
16
  * @param {AdminPageProps} props - Component properties.
17
- * @returns {React.ReactNode} AdminPage component.
17
+ * @return {React.ReactNode} AdminPage component.
18
18
  */
19
19
  const AdminPage: React.FC< AdminPageProps > = ( {
20
20
  children,
@@ -6,7 +6,7 @@ import type { AdminSectionBaseProps } from '../types';
6
6
  * This is the wrapper component to build sections within your admin page.
7
7
  *
8
8
  * @param {AdminSectionBaseProps} props - Component properties.
9
- * @returns {React.ReactNode} AdminSection component.
9
+ * @return {React.ReactNode} AdminSection component.
10
10
  */
11
11
  const AdminSection: React.FC< AdminSectionBaseProps > = ( { children } ) => {
12
12
  return <div className={ styles.section }>{ children }</div>;
@@ -6,7 +6,7 @@ import type { AdminSectionBaseProps } from '../types';
6
6
  * The wrapper component for a Hero Section to be used in admin pages.
7
7
  *
8
8
  * @param {AdminSectionBaseProps} props - Component properties.
9
- * @returns {React.Component} AdminSectionHero component.
9
+ * @return {React.Component} AdminSectionHero component.
10
10
  */
11
11
  const AdminSectionHero: React.FC< AdminSectionBaseProps > = ( { children } ) => {
12
12
  return <div className={ styles[ 'section-hero' ] }>{ children }</div>;
@@ -35,12 +35,12 @@ const getIconByLevel = ( level: AlertProps[ 'level' ] ) => {
35
35
  /**
36
36
  * Alert component
37
37
  *
38
- * @param {object} props - The component properties.
39
- * @param {string} props.level - The alert level: error, warning, info, success.
40
- * @param {boolean} props.showIcon - Whether to show the alert icon.
41
- * @param {string} props.className - The wrapper class name.
42
- * @param {React.Component} props.children - The alert content.
43
- * @returns {React.ReactElement} The `Alert` component.
38
+ * @param {object} props - The component properties.
39
+ * @param {string} props.level - The alert level: error, warning, info, success.
40
+ * @param {boolean} props.showIcon - Whether to show the alert icon.
41
+ * @param {string} props.className - The wrapper class name.
42
+ * @param {React.Component} props.children - The alert content.
43
+ * @return {React.ReactElement} The `Alert` component.
44
44
  */
45
45
  const Alert: React.FC< AlertProps > = ( {
46
46
  level = 'warning',
@@ -7,7 +7,7 @@ import { AutomatticBylineLogoProps } from './types';
7
7
  * Automattic "By line" Logo component.
8
8
  *
9
9
  * @param {AutomatticBylineLogoProps} props - Component properties.
10
- * @returns {React.ReactNode} AutomatticBylineLogo component.
10
+ * @return {React.ReactNode} AutomatticBylineLogo component.
11
11
  */
12
12
  const AutomatticBylineLogo: React.FC< AutomatticBylineLogoProps > = ( {
13
13
  title = __( 'An Automattic Airline', 'jetpack' ),
@@ -4,9 +4,9 @@ import React from 'react';
4
4
  /**
5
5
  * Automattic for Agencies Logo component
6
6
  *
7
- * @param {object} props - Component props
8
- * @param {string} props.color - Color code for the logo text
9
- * @returns {React.ReactElement} Component template
7
+ * @param {object} props - Component props
8
+ * @param {string} props.color - Color code for the logo text
9
+ * @return {React.ReactElement} Component template
10
10
  */
11
11
  export default function AutomatticForAgenciesLogo( {
12
12
  color = '#FFFFFF',
@@ -4,10 +4,10 @@ import React from 'react';
4
4
  /**
5
5
  * Automattic Icon Logo component
6
6
  *
7
- * @param {object} props - Component props
8
- * @param {string} props.innerColor - Color code for the line in the middle of the logo.
9
- * @param {string} props.outerColor - Color code for the logo's outer
10
- * @returns {React.ReactElement} Component template
7
+ * @param {object} props - Component props
8
+ * @param {string} props.innerColor - Color code for the line in the middle of the logo.
9
+ * @param {string} props.outerColor - Color code for the logo's outer
10
+ * @return {React.ReactElement} Component template
11
11
  */
12
12
  export default function AutomatticIconLogo( {
13
13
  innerColor = '#00A3E0',
@@ -3,7 +3,7 @@ import uPlot from 'uplot';
3
3
  /**
4
4
  * Definition of the column highlight plugin.
5
5
  *
6
- * @returns {object} The uPlot plugin object with hooks.
6
+ * @return {object} The uPlot plugin object with hooks.
7
7
  */
8
8
  export function dayHighlightPlugin() {
9
9
  let overEl, highlightEl;
@@ -4,10 +4,10 @@ const MONTH_FORMAT = 'short';
4
4
  /**
5
5
  * Returns a formatted date based on the provided template and locale.
6
6
  *
7
- * @param {string} template - The template used to format the date.
8
- * @param {Date} date - The date object to be formatted.
7
+ * @param {string} template - The template used to format the date.
8
+ * @param {Date} date - The date object to be formatted.
9
9
  * @param {string} [locale='en'] - The locale code specifying the language and region to be used for formatting. Default 'en'.
10
- * @returns {string} The formatted date as a string.
10
+ * @return {string} The formatted date as a string.
11
11
  */
12
12
  export default function getDateFormat( template: string, date: Date, locale = 'en' ): string {
13
13
  let newDayMonthFormat;
@@ -40,11 +40,11 @@ export type ScoreGraphAlignedData = [
40
40
  /**
41
41
  * BoostScoreGraph component composed by the chart and the legend.
42
42
  *
43
- * @param {BoostScoreGraphProps} props - The props object for the BoostScoreGraph component.
44
- * @param {string} props.title - Title for the chart.
45
- * @param {Period[]} props.periods - The periods to display in the chart.
46
- * @param {boolean} [props.isLoading=false] - Whether the component is in a loading state.
47
- * @returns {React.ReactElement} The JSX element representing the BoostScoreGraph component, or null if loading.
43
+ * @param {BoostScoreGraphProps} props - The props object for the BoostScoreGraph component.
44
+ * @param {string} props.title - Title for the chart.
45
+ * @param {Period[]} props.periods - The periods to display in the chart.
46
+ * @param {boolean} [props.isLoading=false] - Whether the component is in a loading state.
47
+ * @return {React.ReactElement} The JSX element representing the BoostScoreGraph component, or null if loading.
48
48
  */
49
49
  export const BoostScoreGraph: FunctionComponent< BoostScoreGraphProps > = ( {
50
50
  periods = [],
@@ -7,7 +7,7 @@ import { Period } from '.';
7
7
  * Custom tooltips plugin for uPlot.
8
8
  *
9
9
  * @param {Period[]} periods - The periods to display in the tooltip.
10
- * @returns {object} The uPlot plugin object with hooks.
10
+ * @return {object} The uPlot plugin object with hooks.
11
11
  */
12
12
  export function tooltipsPlugin( periods ) {
13
13
  const reactRoot = document.createElement( 'div' );
@@ -17,7 +17,7 @@ export function tooltipsPlugin( periods ) {
17
17
  /**
18
18
  * Initializes the tooltips plugin.
19
19
  *
20
- * @param {uPlot} u - The uPlot instance.
20
+ * @param {uPlot} u - The uPlot instance.
21
21
  * @param {object} _opts - Options for the uPlot instance.
22
22
  */
23
23
  function init( u: uPlot, _opts: object ) {
@@ -33,7 +33,7 @@ interface UplotChartProps {
33
33
  *
34
34
  * @param {string} label - The label for the series.
35
35
  * @param {number} score - The last score for the series.
36
- * @returns {object} The series information object.
36
+ * @return {object} The series information object.
37
37
  */
38
38
  function createSerieInfo( label: string, score ) {
39
39
  const { spline } = uPlot.paths;
@@ -67,9 +67,9 @@ function createSerieInfo( label: string, score ) {
67
67
  /**
68
68
  * Get the color value based on the score.
69
69
  *
70
- * @param {number} score - The score to get the color for.
70
+ * @param {number} score - The score to get the color for.
71
71
  * @param {string} opacity - Whether to return a transparent color.
72
- * @returns {string} The color value.
72
+ * @return {string} The color value.
73
73
  */
74
74
  function getColor( score: number, opacity = 'FF' ) {
75
75
  let color = '#D63638'; // bad
@@ -86,11 +86,11 @@ function getColor( score: number, opacity = 'FF' ) {
86
86
  /**
87
87
  * UplotLineChart component.
88
88
  *
89
- * @param {object} props - The props object for the UplotLineChart component.
90
- * @param {{ startDate: number, endDate: number }} props.range - The date range of the chart.
91
- * @param {Period[]} props.periods - The periods to display in the chart.
92
- * @param {Annotation[]} props.annotations - The annotations to display in the chart.
93
- * @returns {React.Element} The JSX element representing the UplotLineChart component.
89
+ * @param {object} props - The props object for the UplotLineChart component.
90
+ * @param {{ startDate: number, endDate: number }} props.range - The date range of the chart.
91
+ * @param {Period[]} props.periods - The periods to display in the chart.
92
+ * @param {Annotation[]} props.annotations - The annotations to display in the chart.
93
+ * @return {React.Element} The JSX element representing the UplotLineChart component.
94
94
  */
95
95
  export default function UplotLineChart( { range, periods, annotations = [] }: UplotChartProps ) {
96
96
  const uplot = useRef< uPlot | null >( null );
@@ -18,7 +18,7 @@ const getPeriodDimension = function ( key: string, periods: Period[] ) {
18
18
  * Transforms an array of periods into an array of arrays, where the first array is the timestamps, and the rest are the values for each key
19
19
  *
20
20
  * @param {Period[]} periods - Array of periods to transform
21
- * @returns {ScoreGraphAlignedData | []} - Array of arrays, where the first array is the timestamps, and the rest are the values for each key
21
+ * @return {ScoreGraphAlignedData | []} - Array of arrays, where the first array is the timestamps, and the rest are the values for each key
22
22
  */
23
23
  export function useBoostScoreTransform( periods: Period[] ): ScoreGraphAlignedData | [] {
24
24
  return useMemo( () => {
@@ -7,7 +7,7 @@ const THROTTLE_DURATION = 400; // in ms
7
7
  /**
8
8
  * Custom hook to handle resizing of uPlot charts.
9
9
  *
10
- * @param {React.RefObject<uPlot>} uplotRef - The ref object for the uPlot instance.
10
+ * @param {React.RefObject<uPlot>} uplotRef - The ref object for the uPlot instance.
11
11
  * @param {React.RefObject<HTMLDivElement>} containerRef - The ref object for the container div.
12
12
  */
13
13
  export default function useResize(
@@ -16,7 +16,7 @@ import type { ButtonProps } from './types';
16
16
  * Button component
17
17
  *
18
18
  * @param {ButtonProps} props - Component Props
19
- * @returns {React.ReactNode} Rendered button
19
+ * @return {React.ReactNode} Rendered button
20
20
  */
21
21
  const Button = forwardRef< HTMLInputElement, ButtonProps >( ( props, ref ) => {
22
22
  const {
@@ -10,10 +10,10 @@ type ChipProps = {
10
10
  /**
11
11
  * Chip component
12
12
  *
13
- * @param {object} props - The component properties.
14
- * @param {string} props.type - The type new or info
15
- * @param {string} props.text - Chip text
16
- * @returns {React.ReactElement} The `Chip` component.
13
+ * @param {object} props - The component properties.
14
+ * @param {string} props.type - The type new or info
15
+ * @param {string} props.text - Chip text
16
+ * @return {React.ReactElement} The `Chip` component.
17
17
  */
18
18
  const Chip: React.FC< ChipProps > = ( { type = 'info', text } ) => {
19
19
  const classes = clsx( styles.chip, styles[ `is-${ type }` ] );
@@ -6,7 +6,7 @@ import './style.scss';
6
6
  * A decorative card used in the disconnection flow.
7
7
  *
8
8
  * @param {DecorativeCardProps} props - The properties.
9
- * @returns {React.ReactNode} - The DecorativeCard component.
9
+ * @return {React.ReactNode} - The DecorativeCard component.
10
10
  */
11
11
 
12
12
  const DecorativeCard: React.FC< DecorativeCardProps > = ( {
@@ -16,12 +16,12 @@ type DialogProps = {
16
16
  /**
17
17
  * Dialog component.
18
18
  *
19
- * @param {object} props - React component props.
20
- * @param {React.ReactNode} props.primary - Primary-section content.
21
- * @param {React.ReactNode} props.secondary - Secondary-section content.
22
- * @param {boolean} props.isTwoSections - Handle two sections layout when true.
23
- * @param {object} props.containerProps - Props to pass to the container component.
24
- * @returns {React.ReactNode} Rendered dialog
19
+ * @param {object} props - React component props.
20
+ * @param {React.ReactNode} props.primary - Primary-section content.
21
+ * @param {React.ReactNode} props.secondary - Secondary-section content.
22
+ * @param {boolean} props.isTwoSections - Handle two sections layout when true.
23
+ * @param {object} props.containerProps - Props to pass to the container component.
24
+ * @return {React.ReactNode} Rendered dialog
25
25
  */
26
26
  const Dialog: React.FC< DialogProps > = ( {
27
27
  primary,
@@ -72,7 +72,7 @@ const getAdaptiveType = ( percentage: number ) => {
72
72
  * Generate record meter donut bar
73
73
  *
74
74
  * @param {DonutMeterProps} props - Props
75
- * @returns {React.ReactElement} - JSX element
75
+ * @return {React.ReactElement} - JSX element
76
76
  */
77
77
  const DonutMeter: React.FC< DonutMeterProps > = ( {
78
78
  className = '',
@@ -11,7 +11,7 @@ export type GlobalNoticesProps = {
11
11
  *
12
12
  * @param {GlobalNoticesProps} props - Component props.
13
13
  *
14
- * @returns {import('react').ReactNode} The rendered notices list.
14
+ * @return {import('react').ReactNode} The rendered notices list.
15
15
  */
16
16
  export function GlobalNotices( { maxVisibleNotices = 3 }: GlobalNoticesProps ) {
17
17
  const { getNotices, removeNotice } = useGlobalNotices();
@@ -9,7 +9,7 @@ export type TGlobalNotices = ReturnType< NoticesStore[ 'getActions' ] > &
9
9
  /**
10
10
  * The global notices hook.
11
11
  *
12
- * @returns {TGlobalNotices} The global notices selectors and actions.
12
+ * @return {TGlobalNotices} The global notices selectors and actions.
13
13
  */
14
14
  export function useGlobalNotices(): TGlobalNotices {
15
15
  const actionCreators = useDispatch( noticesStore );
@@ -24,7 +24,7 @@ const placementsToPositions = ( placement: Placement ): Position => {
24
24
  * Generate Icon Tooltip
25
25
  *
26
26
  * @param {IconTooltipProps} props - Props
27
- * @returns {React.ReactElement} - JSX element
27
+ * @return {React.ReactElement} - JSX element
28
28
  */
29
29
  const IconTooltip: React.FC< IconTooltipProps > = ( {
30
30
  className = '',
@@ -9,7 +9,7 @@ import type React from 'react';
9
9
  * Icon Wrapper component.
10
10
  *
11
11
  * @param {BaseIconProps} props - Component props.
12
- * @returns {React.ReactNode} Icon Wrapper component.
12
+ * @return {React.ReactNode} Icon Wrapper component.
13
13
  */
14
14
  const IconWrapper: React.FC< BaseIconProps > = ( {
15
15
  className,
@@ -264,8 +264,8 @@ export type IconSlug = keyof IconsMap;
264
264
  /**
265
265
  * Return icon component by slug.
266
266
  *
267
- * @param {string} slug - Icon slug.
268
- * @returns {React.ComponentType<BaseIconProps>} Icon component.
267
+ * @param {string} slug - Icon slug.
268
+ * @return {React.ComponentType<BaseIconProps>} Icon component.
269
269
  */
270
270
  export function getIconBySlug< Slug extends IconSlug >( slug: Slug ): IconsMap[ Slug ] {
271
271
  if ( ! iconsMap[ slug ] ) {
@@ -14,7 +14,7 @@ import type React from 'react';
14
14
  * Indeterminate Progress Bar component
15
15
  *
16
16
  * @param {IndeterminateProgressBarProps} props - Component props.
17
- * @returns {React.ReactNode} - IndeterminateProgressBar react component.
17
+ * @return {React.ReactNode} - IndeterminateProgressBar react component.
18
18
  */
19
19
  const IndeterminateProgressBar: React.FC< IndeterminateProgressBarProps > = ( { className } ) => {
20
20
  return (
@@ -32,7 +32,7 @@ const ExternalIcon: React.FC = () => (
32
32
  * JetpackFooter component displays a tiny Jetpack logo with the product name on the left and the Automattic Airline "by line" on the right.
33
33
  *
34
34
  * @param {JetpackFooterProps} props - Component properties.
35
- * @returns {React.ReactNode} JetpackFooter component.
35
+ * @return {React.ReactNode} JetpackFooter component.
36
36
  */
37
37
  const JetpackFooter: React.FC< JetpackFooterProps > = ( {
38
38
  moduleName = __( 'Jetpack', 'jetpack' ),
@@ -11,8 +11,8 @@ const lgCols = Number( styles.lgCols );
11
11
  /**
12
12
  * The basic Col component.
13
13
  *
14
- * @param {ColProps} props - Component properties.
15
- * @returns {React.ReactElement} Col component.
14
+ * @param {ColProps} props - Component properties.
15
+ * @return {React.ReactElement} Col component.
16
16
  */
17
17
  const Col: React.FC< ColProps > = props => {
18
18
  const { children, tagName = 'div', className } = props;
@@ -8,7 +8,7 @@ import type React from 'react';
8
8
  * JP Container
9
9
  *
10
10
  * @param {ContainerProps} props - Component properties.
11
- * @returns {React.ReactElement} Container component.
11
+ * @return {React.ReactElement} Container component.
12
12
  */
13
13
  const Container: React.FC< ContainerProps > = ( {
14
14
  children,
@@ -39,9 +39,9 @@ const getMediaByOperator = (
39
39
  /**
40
40
  * Hook to match if current viewport is equal, greater or less than expected breakpoint
41
41
  *
42
- * @param {(Breakpoints | Array< Breakpoints >)} breakpointToMatch - An single breakpoint or list of breakpoints to match.
43
- * @param {(Operators | Array< Operators >)} operatorToMatch - An single operator or list of them. It should follow the same sequence than breakpoints.
44
- * @returns {Array<boolean>} - List of matches, following breakpoints sequence.
42
+ * @param {(Breakpoints | Array< Breakpoints >)} breakpointToMatch - An single breakpoint or list of breakpoints to match.
43
+ * @param {(Operators | Array< Operators >)} operatorToMatch - An single operator or list of them. It should follow the same sequence than breakpoints.
44
+ * @return {Array<boolean>} - List of matches, following breakpoints sequence.
45
45
  * @example
46
46
  *
47
47
  * ```es6
@@ -41,14 +41,14 @@ const getIconByLevel = ( level: NoticeProps[ 'level' ] ) => {
41
41
  /**
42
42
  * Notice component
43
43
  *
44
- * @param {object} props - The component properties.
45
- * @param {string} props.level - The notice level: error, warning, info, success.
46
- * @param {boolean} props.hideCloseButton - Whether to hide the close button.
47
- * @param {Function} props.onClose - The function to call when the close button is clicked.
48
- * @param {string} props.title - The title of the notice.
49
- * @param {React.ReactNode[]} props.actions - Actions to show across the bottom of the bar.
50
- * @param {React.Component} props.children - The notice content.
51
- * @returns {React.ReactElement} The `Notice` component.
44
+ * @param {object} props - The component properties.
45
+ * @param {string} props.level - The notice level: error, warning, info, success.
46
+ * @param {boolean} props.hideCloseButton - Whether to hide the close button.
47
+ * @param {Function} props.onClose - The function to call when the close button is clicked.
48
+ * @param {string} props.title - The title of the notice.
49
+ * @param {React.ReactNode[]} props.actions - Actions to show across the bottom of the bar.
50
+ * @param {React.Component} props.children - The notice content.
51
+ * @return {React.ReactElement} The `Notice` component.
52
52
  */
53
53
  const Notice: React.FC< NoticeProps > = ( {
54
54
  level = 'info',
@@ -3,9 +3,9 @@ import { getUserLocale } from '../../lib/locale';
3
3
  /**
4
4
  * Format a number using the locale in use by the user viewing the page.
5
5
  *
6
- * @param {number} number - The number to format.
6
+ * @param {number} number - The number to format.
7
7
  * @param {Intl.NumberFormatOptions} options - The format options
8
- * @returns {string} Formatted number.
8
+ * @return {string} Formatted number.
9
9
  */
10
10
  const numberFormat = ( number: number, options: Intl.NumberFormatOptions = {} ): string => {
11
11
  const locale = getUserLocale();
@@ -9,7 +9,7 @@ import './style.scss';
9
9
  * More support from the original ReactSlider component: https://zillow.github.io/react-slider/
10
10
  *
11
11
  * @param {NumberSliderProps} props - Props
12
- * @returns {React.ReactElement} - JSX element
12
+ * @return {React.ReactElement} - JSX element
13
13
  */
14
14
  const NumberSlider: React.FC< NumberSliderProps > = ( {
15
15
  className,
@@ -15,7 +15,7 @@ import './style.scss';
15
15
  * doesn't exist.
16
16
  *
17
17
  * @param {CurrencyObject} currencyObject -- A currency object returned from `getCurrencyObject`.
18
- * @returns {boolean} Whether or not to display the price decimal part.
18
+ * @return {boolean} Whether or not to display the price decimal part.
19
19
  */
20
20
  const showPriceDecimals = ( currencyObject: CurrencyObject ): boolean => {
21
21
  return currencyObject.fraction.indexOf( '00' ) === -1;
@@ -25,7 +25,7 @@ const showPriceDecimals = ( currencyObject: CurrencyObject ): boolean => {
25
25
  * The Pricing card component.
26
26
  *
27
27
  * @param {PricingCardProps} props -- The component props.
28
- * @returns {React.ReactNode} The rendered component.
28
+ * @return {React.ReactNode} The rendered component.
29
29
  */
30
30
  const PricingCard: React.FC< PricingCardProps > = ( {
31
31
  currencyCode = 'USD',
@@ -8,8 +8,8 @@ import { IconsCardProps } from './types';
8
8
  * Icons composition for a bundle product,
9
9
  * based on the list of supported products.
10
10
  *
11
- * @param {IconsCardProps} props - Component props.
12
- * @returns {React.ReactNode} Bundle product icons react component.
11
+ * @param {IconsCardProps} props - Component props.
12
+ * @return {React.ReactNode} Bundle product icons react component.
13
13
  */
14
14
  export const IconsCard: React.FC< IconsCardProps > = ( { products, icon, size = 24 } ) => {
15
15
  if ( icon ) {
@@ -16,7 +16,7 @@ import type React from 'react';
16
16
  * Product Detail component.
17
17
  *
18
18
  * @param {ProductOfferProps} props - Component props.
19
- * @returns {React.ReactNode} - ProductOffer react component.
19
+ * @return {React.ReactNode} - ProductOffer react component.
20
20
  */
21
21
  const ProductOffer: React.FC< ProductOfferProps > = ( {
22
22
  addProductUrl,
@@ -9,7 +9,7 @@ import type React from 'react';
9
9
  * Product Detail Card Header component.
10
10
  *
11
11
  * @param {ProductOfferHeaderProps} props - Component props.
12
- * @returns {React.ReactNode} ProductOfferHeader react component.
12
+ * @return {React.ReactNode} ProductOfferHeader react component.
13
13
  */
14
14
  export const ProductOfferHeader: React.FC< ProductOfferHeaderProps > = ( {
15
15
  title = __( 'Popular upgrade', 'jetpack' ),
@@ -16,7 +16,7 @@ import type React from 'react';
16
16
  * React component to render the price.
17
17
  *
18
18
  * @param {ProductPriceProps} props - Component props.
19
- * @returns {React.ReactNode} Price react component.
19
+ * @return {React.ReactNode} Price react component.
20
20
  */
21
21
  const ProductPrice: React.FC< ProductPriceProps > = ( {
22
22
  price,
@@ -8,8 +8,8 @@ import type React from 'react';
8
8
  /**
9
9
  * React component to render a Price composition.
10
10
  *
11
- * @param {PriceProps} props - Component props.
12
- * @returns {React.ReactNode} -Price react component.
11
+ * @param {PriceProps} props - Component props.
12
+ * @return {React.ReactNode} -Price react component.
13
13
  */
14
14
  export const Price: React.FC< PriceProps > = ( { value, currency, isOff, hidePriceFraction } ) => {
15
15
  const classNames = clsx( styles.price, 'product-price_price', {
@@ -13,7 +13,7 @@ import type React from 'react';
13
13
  * Progress Bar component
14
14
  *
15
15
  * @param {ProgressBarProps} props - Component props.
16
- * @returns {React.ReactNode} - ProgressBar react component.
16
+ * @return {React.ReactNode} - ProgressBar react component.
17
17
  */
18
18
  const ProgressBar: React.FC< ProgressBarProps > = ( {
19
19
  className,
@@ -49,7 +49,7 @@ export type QRCodeProps = {
49
49
  * Renders a QR Code.
50
50
  *
51
51
  * @param {QRCodeProps} props - Component props
52
- * @returns {React.ReactNode} - React component.
52
+ * @return {React.ReactNode} - React component.
53
53
  */
54
54
  const QRCode: React.FC< QRCodeProps > = ( {
55
55
  value = 'https://jetpack.com',
@@ -63,7 +63,7 @@ export type RecordMeterBarProps = {
63
63
  * Generate Record Meter bar
64
64
  *
65
65
  * @param {RecordMeterBarProps} props - Props
66
- * @returns {React.ReactElement} - JSX element
66
+ * @return {React.ReactElement} - JSX element
67
67
  */
68
68
  const RecordMeterBar: React.FC< RecordMeterBarProps > = ( {
69
69
  totalCount,
@@ -16,7 +16,7 @@ import type React from 'react';
16
16
  * StatCard component
17
17
  *
18
18
  * @param {StatCardProps} props - Component props.
19
- * @returns {React.ReactNode} - StatCard react component.
19
+ * @return {React.ReactNode} - StatCard react component.
20
20
  */
21
21
  const StatCard = ( { className, icon, label, value, variant = 'square' }: StatCardProps ) => {
22
22
  const formattedValue = numberFormat( value );
@@ -8,7 +8,7 @@ import type { H3Props, TextProps, TitleProps } from './types';
8
8
  * Text component.
9
9
  *
10
10
  * @param {TextProps} props - Component props.
11
- * @returns {React.ReactElement} - JSX.Element
11
+ * @return {React.ReactElement} - JSX.Element
12
12
  */
13
13
  const Text = forwardRef< HTMLElement, TextProps >(
14
14
  ( { variant = 'body', children, component, className, ...componentProps }, ref ) => {
@@ -45,8 +45,8 @@ export default Text;
45
45
  /**
46
46
  * Heading component - Medium size.
47
47
  *
48
- * @param {TextProps} props - Component props.
49
- * @returns {React.ReactElement} - JSX.Element
48
+ * @param {TextProps} props - Component props.
49
+ * @return {React.ReactElement} - JSX.Element
50
50
  */
51
51
  export const H2: React.FC< TextProps > = ( { children, ...componentProps } ) => (
52
52
  <Text variant="headline-medium" mb={ 3 } { ...componentProps }>
@@ -57,8 +57,8 @@ export const H2: React.FC< TextProps > = ( { children, ...componentProps } ) =>
57
57
  /**
58
58
  * Heading component - Small size,
59
59
  *
60
- * @param {H3Props} props - Component props.
61
- * @returns {React.ReactElement} - JSX.Element
60
+ * @param {H3Props} props - Component props.
61
+ * @return {React.ReactElement} - JSX.Element
62
62
  */
63
63
  export const H3: React.FC< H3Props > = ( { children, weight = 'bold', ...componentProps } ) => {
64
64
  const variant = `headline-small${
@@ -75,8 +75,8 @@ export const H3: React.FC< H3Props > = ( { children, weight = 'bold', ...compone
75
75
  /**
76
76
  * Title component, based on Text component.
77
77
  *
78
- * @param {TitleProps} props - Component props.
79
- * @returns {React.ReactElement} - JSX.Element
78
+ * @param {TitleProps} props - Component props.
79
+ * @return {React.ReactElement} - JSX.Element
80
80
  */
81
81
  export const Title: React.FC< TitleProps > = ( {
82
82
  children,
@@ -111,8 +111,8 @@ const setup = ( root: HTMLElement, id: string, withGlobalStyles?: boolean ) => {
111
111
  /**
112
112
  * ThemeProvider React component.
113
113
  *
114
- * @param {ThemeProviderProps} props - Component properties.
115
- * @returns {React.ReactNode} ThemeProvider component.
114
+ * @param {ThemeProviderProps} props - Component properties.
115
+ * @return {React.ReactNode} ThemeProvider component.
116
116
  */
117
117
  const ThemeProvider: React.FC< ThemeProviderProps > = ( {
118
118
  children = null,
@@ -13,7 +13,7 @@ import './style.scss';
13
13
  * - The secondary CTA is the first button, at the left position.
14
14
  *
15
15
  * @param {UpsellBannerProps} props - Component props.
16
- * @returns {React.ReactNode} - UpsellBanner component.
16
+ * @return {React.ReactNode} - UpsellBanner component.
17
17
  */
18
18
  const UpsellBanner: React.FC< UpsellBannerProps > = props => {
19
19
  const {
@@ -4,7 +4,7 @@ import { getSettings } from '@wordpress/date';
4
4
  * Clean up WP locale so it matches the format expected by browsers.
5
5
  *
6
6
  * @param {string} locale - Locale given by WordPress.
7
- * @returns {string} Browser-formatted locale.
7
+ * @return {string} Browser-formatted locale.
8
8
  */
9
9
  export const cleanLocale = ( locale: string ) => {
10
10
  const regex = /^([a-z]{2,3})(_[a-z]{2}|_[a-z][a-z0-9]{4,7})?(?:_.*)?$/i;
@@ -30,7 +30,7 @@ declare const global: typeof globalThis;
30
30
  /**
31
31
  * Current user locale, or browser locale as fallback.
32
32
  *
33
- * @returns {string} Formatted user locale (e.g. `en-US` or `fr-FR`).
33
+ * @return {string} Formatted user locale (e.g. `en-US` or `fr-FR`).
34
34
  */
35
35
  export const getUserLocale = () => {
36
36
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-components",
3
- "version": "0.55.8",
3
+ "version": "0.55.10",
4
4
  "description": "Jetpack Components Package",
5
5
  "author": "Automattic",
6
6
  "license": "GPL-2.0-or-later",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@automattic/format-currency": "1.0.1",
18
- "@automattic/jetpack-boost-score-api": "^0.1.34",
18
+ "@automattic/jetpack-boost-score-api": "^0.1.36",
19
19
  "@babel/runtime": "^7",
20
20
  "@wordpress/browserslist-config": "6.5.0",
21
21
  "@wordpress/components": "28.5.0",
@@ -30,12 +30,12 @@
30
30
  "prop-types": "^15.7.2",
31
31
  "qrcode.react": "3.1.0",
32
32
  "react-slider": "2.0.5",
33
- "social-logos": "^3.1.5",
33
+ "social-logos": "^3.1.7",
34
34
  "uplot": "1.6.24",
35
35
  "uplot-react": "1.1.4"
36
36
  },
37
37
  "devDependencies": {
38
- "@automattic/jetpack-base-styles": "^0.6.29",
38
+ "@automattic/jetpack-base-styles": "^0.6.30",
39
39
  "@babel/core": "7.24.7",
40
40
  "@babel/preset-react": "7.24.7",
41
41
  "@jest/globals": "29.4.3",
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Return the checkout URL for the given product.
3
3
  *
4
- * @param {string} productSlug - wpcom product slug.
5
- * @param {string} siteSuffix - Site suffix
6
- * @param {string} redirectUrl - Redirect URL used to define redirect_to
4
+ * @param {string} productSlug - wpcom product slug.
5
+ * @param {string} siteSuffix - Site suffix
6
+ * @param {string} redirectUrl - Redirect URL used to define redirect_to
7
7
  * @param {boolean} isUserConnected - True when the user is connected Jetpack
8
- * @returns {string} The Calypso checkout URL
8
+ * @return {string} The Calypso checkout URL
9
9
  */
10
10
  export default function getProductCheckoutUrl(
11
11
  productSlug: string,
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Returns the site admin URL.
3
3
  *
4
- * @returns {?string} The site admin URL or null if not available.
4
+ * @return {?string} The site admin URL or null if not available.
5
5
  */
6
6
  export default function getSiteAdminUrl() {
7
7
  return (
@@ -12,13 +12,13 @@ import { GetRedirectUrlArgs, QueryVars } from './types';
12
12
  * Note: if using full URL, query parameters and anchor must be passed in args. Any querystring of url fragment in the URL will be discarded.
13
13
  *
14
14
  * @since 0.2.0
15
- * @param {string} source - The URL handler registered in the server or the full destination URL (starting with https://).
16
- * @param {GetRedirectUrlArgs} args - Additional arguments to build the url.
17
- * This is not a complete list as any argument passed here
18
- * will be sent to as a query parameter to the Redirect server.
19
- * These parameters will not necessarily be passed over to the final destination URL.
20
- * If you want to add a parameter to the final destination URL, use the `query` argument.
21
- * @returns {string} The redirect URL
15
+ * @param {string} source - The URL handler registered in the server or the full destination URL (starting with https://).
16
+ * @param {GetRedirectUrlArgs} args - Additional arguments to build the url.
17
+ * This is not a complete list as any argument passed here
18
+ * will be sent to as a query parameter to the Redirect server.
19
+ * These parameters will not necessarily be passed over to the final destination URL.
20
+ * If you want to add a parameter to the final destination URL, use the `query` argument.
21
+ * @return {string} The redirect URL
22
22
  */
23
23
  export default function getRedirectUrl( source: string, args: GetRedirectUrlArgs = {} ) {
24
24
  const queryVars: QueryVars = {};
@@ -4,7 +4,7 @@ import { IntroOffer } from './types';
4
4
  * Returns whether an Introductory Offer is a first month trial
5
5
  *
6
6
  * @param {IntroOffer} introOffer - an intro offer object
7
- * @returns {boolean} Whether it's a first month trial or not
7
+ * @return {boolean} Whether it's a first month trial or not
8
8
  */
9
9
  export function isFirstMonthTrial( introOffer: IntroOffer ): boolean {
10
10
  return introOffer?.interval_count === 1 && introOffer?.interval_unit === 'month';