@automattic/jetpack-components 0.53.7 → 0.53.9
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 +10 -0
- package/components/action-button/index.jsx +3 -3
- package/components/admin-page/index.tsx +2 -2
- package/components/alert/index.tsx +2 -2
- package/components/automattic-byline-logo/index.tsx +2 -2
- package/components/boost-score-bar/index.tsx +3 -3
- package/components/button/index.tsx +3 -3
- package/components/contextual-upgrade-trigger/index.tsx +2 -2
- package/components/dialog/index.tsx +2 -2
- package/components/gridicon/index.tsx +2 -2
- package/components/icon-tooltip/index.tsx +3 -3
- package/components/icons/index.tsx +3 -3
- package/components/indeterminate-progress-bar/index.tsx +2 -2
- package/components/jetpack-footer/index.tsx +3 -3
- package/components/jetpack-logo/index.tsx +2 -2
- package/components/jetpack-search-logo/index.tsx +2 -2
- package/components/jetpack-vaultpress-backup-logo/index.tsx +2 -2
- package/components/jetpack-videopress-logo/index.tsx +2 -2
- package/components/layout/col/index.tsx +2 -2
- package/components/layout/container/index.tsx +2 -2
- package/components/loading-placeholder/index.tsx +2 -2
- package/components/notice/index.tsx +2 -2
- package/components/number-slider/index.tsx +2 -2
- package/components/pricing-table/index.tsx +7 -7
- package/components/product-offer/index.tsx +2 -2
- package/components/product-price/index.tsx +5 -5
- package/components/product-price/price.tsx +2 -2
- package/components/progress-bar/index.tsx +3 -5
- package/components/radio-control/index.tsx +2 -2
- package/components/record-meter-bar/index.tsx +2 -2
- package/components/stat-card/index.tsx +6 -6
- package/components/status/index.tsx +2 -2
- package/components/terms-of-service/index.tsx +2 -2
- package/components/testimonials/testimonial.tsx +2 -2
- package/components/text/index.tsx +2 -2
- package/components/toggle-control/index.tsx +2 -2
- package/package.json +5 -5
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.53.9] - 2024-06-11
|
|
6
|
+
### Changed
|
|
7
|
+
- Updated package dependencies. [#37779]
|
|
8
|
+
|
|
9
|
+
## [0.53.8] - 2024-06-10
|
|
10
|
+
### Changed
|
|
11
|
+
- Change codebase to use clsx instead of classnames. [#37708]
|
|
12
|
+
|
|
5
13
|
## [0.53.7] - 2024-06-05
|
|
6
14
|
### Changed
|
|
7
15
|
- Updated package dependencies. [#37669]
|
|
@@ -1055,6 +1063,8 @@
|
|
|
1055
1063
|
### Changed
|
|
1056
1064
|
- Update node version requirement to 14.16.1
|
|
1057
1065
|
|
|
1066
|
+
[0.53.9]: https://github.com/Automattic/jetpack-components/compare/0.53.8...0.53.9
|
|
1067
|
+
[0.53.8]: https://github.com/Automattic/jetpack-components/compare/0.53.7...0.53.8
|
|
1058
1068
|
[0.53.7]: https://github.com/Automattic/jetpack-components/compare/0.53.6...0.53.7
|
|
1059
1069
|
[0.53.6]: https://github.com/Automattic/jetpack-components/compare/0.53.5...0.53.6
|
|
1060
1070
|
[0.53.5]: https://github.com/Automattic/jetpack-components/compare/0.53.4...0.53.5
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Spinner } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import
|
|
6
|
+
import clsx from 'clsx';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
@@ -40,7 +40,7 @@ const ActionButton = props => {
|
|
|
40
40
|
<>
|
|
41
41
|
{
|
|
42
42
|
<Button
|
|
43
|
-
className={
|
|
43
|
+
className={ clsx( styles.button, 'jp-action-button--button', customClass ) }
|
|
44
44
|
label={ label }
|
|
45
45
|
onClick={ onClick }
|
|
46
46
|
variant="primary"
|
|
@@ -51,7 +51,7 @@ const ActionButton = props => {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
{ displayError && (
|
|
54
|
-
<p className={
|
|
54
|
+
<p className={ clsx( styles.error, 'jp-action-button__error' ) }>{ errorMessage }</p>
|
|
55
55
|
) }
|
|
56
56
|
</>
|
|
57
57
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import JetpackFooter from '../jetpack-footer';
|
|
4
4
|
import JetpackLogo from '../jetpack-logo';
|
|
5
5
|
import Col from '../layout/col';
|
|
@@ -25,7 +25,7 @@ const AdminPage: React.FC< AdminPageProps > = ( {
|
|
|
25
25
|
showBackground = true,
|
|
26
26
|
header,
|
|
27
27
|
} ) => {
|
|
28
|
-
const rootClassName =
|
|
28
|
+
const rootClassName = clsx( styles[ 'admin-page' ], {
|
|
29
29
|
[ styles.background ]: showBackground,
|
|
30
30
|
} );
|
|
31
31
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Icon, warning, info, check } from '@wordpress/icons';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import styles from './style.module.scss';
|
|
5
5
|
|
|
@@ -39,7 +39,7 @@ const getIconByLevel = ( level: AlertProps[ 'level' ] ) => {
|
|
|
39
39
|
* @returns {React.ReactElement} The `Alert` component.
|
|
40
40
|
*/
|
|
41
41
|
const Alert: React.FC< AlertProps > = ( { level = 'warning', children, showIcon = true } ) => {
|
|
42
|
-
const classes =
|
|
42
|
+
const classes = clsx( styles.container, styles[ `is-${ level }` ] );
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
45
|
<div className={ classes }>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { AutomatticBylineLogoProps } from './types';
|
|
5
5
|
|
|
@@ -24,7 +24,7 @@ const AutomatticBylineLogo: React.FC< AutomatticBylineLogoProps > = ( {
|
|
|
24
24
|
enableBackground="new 0 0 935 38.2"
|
|
25
25
|
aria-labelledby="jp-automattic-byline-logo-title"
|
|
26
26
|
height={ height }
|
|
27
|
-
className={
|
|
27
|
+
className={ clsx( 'jp-automattic-byline-logo', className ) }
|
|
28
28
|
{ ...otherProps }
|
|
29
29
|
>
|
|
30
30
|
<desc id="jp-automattic-byline-logo-title">{ title }</desc>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import Gridicon from '../gridicon';
|
|
4
4
|
import type { BoostScoreBarProps } from './types';
|
|
5
5
|
import type { FunctionComponent } from 'react';
|
|
@@ -50,7 +50,7 @@ export const BoostScoreBar: FunctionComponent< BoostScoreBarProps > = ( {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
|
-
<div className={
|
|
53
|
+
<div className={ clsx( 'jb-score-bar', `jb-score-bar--${ scoreBarType }` ) }>
|
|
54
54
|
<div className="jb-score-bar__label">
|
|
55
55
|
{ getIcon() }
|
|
56
56
|
<div>{ scoreBarType === 'desktop' ? desktopIconLabel : mobileIconLabel }</div>
|
|
@@ -58,7 +58,7 @@ export const BoostScoreBar: FunctionComponent< BoostScoreBarProps > = ( {
|
|
|
58
58
|
|
|
59
59
|
<div className="jb-score-bar__bounds">
|
|
60
60
|
<div
|
|
61
|
-
className={
|
|
61
|
+
className={ clsx( 'jb-score-bar__filler', getFillColor() ) }
|
|
62
62
|
style={ { width: `${ score }%` } }
|
|
63
63
|
>
|
|
64
64
|
{ isLoading ? (
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { Button as WPButton, Spinner, VisuallyHidden } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import { Icon, external } from '@wordpress/icons';
|
|
7
|
-
import
|
|
7
|
+
import clsx from 'clsx';
|
|
8
8
|
import React, { forwardRef } from 'react';
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
@@ -36,7 +36,7 @@ const Button = forwardRef< HTMLInputElement, ButtonProps >( ( props, ref ) => {
|
|
|
36
36
|
...componentProps
|
|
37
37
|
} = props;
|
|
38
38
|
|
|
39
|
-
const className =
|
|
39
|
+
const className = clsx( styles.button, propsClassName, {
|
|
40
40
|
[ styles.normal ]: size === 'normal',
|
|
41
41
|
[ styles.small ]: size === 'small',
|
|
42
42
|
[ styles.icon ]: Boolean( icon ),
|
|
@@ -73,7 +73,7 @@ const Button = forwardRef< HTMLInputElement, ButtonProps >( ( props, ref ) => {
|
|
|
73
73
|
<WPButton
|
|
74
74
|
target={ externalTarget }
|
|
75
75
|
variant={ variant }
|
|
76
|
-
className={
|
|
76
|
+
className={ clsx( className, { 'has-text': !! icon && hasChildren } ) }
|
|
77
77
|
icon={ ! isExternalLink ? icon : undefined }
|
|
78
78
|
iconSize={ iconSize }
|
|
79
79
|
disabled={ disabled }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Icon, arrowRight } from '@wordpress/icons';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import IconTooltip from '../icon-tooltip';
|
|
4
4
|
import Text from '../text';
|
|
5
5
|
import styles from './style.module.scss';
|
|
@@ -20,7 +20,7 @@ const ContextualUpgradeTrigger: React.FC< CutBaseProps > = ( {
|
|
|
20
20
|
Tag === 'a' ? { href, ...( openInNewTab && { target: '_blank' } ) } : { onClick };
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
|
-
<div className={
|
|
23
|
+
<div className={ clsx( styles.cut, className ) }>
|
|
24
24
|
<div>
|
|
25
25
|
<div>
|
|
26
26
|
<Text className={ styles.description }>{ description }</Text>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import clsx from 'clsx';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Col from '../layout/col';
|
|
4
4
|
import Container from '../layout/container';
|
|
@@ -38,7 +38,7 @@ const Dialog: React.FC< DialogProps > = ( {
|
|
|
38
38
|
*/
|
|
39
39
|
const hideSecondarySection = ! isTwoSections && isSmall;
|
|
40
40
|
|
|
41
|
-
const classNames =
|
|
41
|
+
const classNames = clsx( {
|
|
42
42
|
[ styles[ 'one-section-style' ] ]: ! isTwoSections,
|
|
43
43
|
[ styles[ 'is-viewport-small' ] ]: isSmall,
|
|
44
44
|
} );
|
|
@@ -6,7 +6,7 @@ It has been modified to work with Preact, and only includes the icons that we ne
|
|
|
6
6
|
!!! */
|
|
7
7
|
|
|
8
8
|
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import
|
|
9
|
+
import clsx from 'clsx';
|
|
10
10
|
import { Component } from 'react';
|
|
11
11
|
import './style.scss';
|
|
12
12
|
import { GridiconProps } from './types';
|
|
@@ -290,7 +290,7 @@ class Gridicon extends Component< GridiconProps > {
|
|
|
290
290
|
|
|
291
291
|
const icon = 'gridicons-' + this.props.icon;
|
|
292
292
|
|
|
293
|
-
const iconClass =
|
|
293
|
+
const iconClass = clsx( 'gridicon', icon, className, {
|
|
294
294
|
'needs-offset': this.needsOffset( icon, size ),
|
|
295
295
|
} );
|
|
296
296
|
const description = this.getSVGDescription( icon );
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Popover } from '@wordpress/components';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import React, { useCallback, useState } from 'react';
|
|
4
4
|
import Button from '../button';
|
|
5
5
|
import Gridicon from '../gridicon/index';
|
|
@@ -71,7 +71,7 @@ const IconTooltip: React.FC< IconTooltipProps > = ( {
|
|
|
71
71
|
|
|
72
72
|
const isAnchorWrapper = popoverAnchorStyle === 'wrapper';
|
|
73
73
|
|
|
74
|
-
const wrapperClassNames =
|
|
74
|
+
const wrapperClassNames = clsx( 'icon-tooltip-wrapper', className );
|
|
75
75
|
const iconShiftBySize = {
|
|
76
76
|
left: isAnchorWrapper ? 0 : -( POPOVER_HELPER_WIDTH / 2 - iconSize / 2 ) + 'px',
|
|
77
77
|
};
|
|
@@ -86,7 +86,7 @@ const IconTooltip: React.FC< IconTooltipProps > = ( {
|
|
|
86
86
|
</Button>
|
|
87
87
|
) }
|
|
88
88
|
<div
|
|
89
|
-
className={
|
|
89
|
+
className={ clsx( 'icon-tooltip-helper', { 'is-wide': wide } ) }
|
|
90
90
|
style={ iconShiftBySize }
|
|
91
91
|
>
|
|
92
92
|
{ ( isForcedToShow || isVisible ) && (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Path, SVG, G, Polygon } from '@wordpress/components';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import SocialLogo from 'social-logos';
|
|
4
4
|
import styles from './style.module.scss';
|
|
5
5
|
import { BaseIconProps } from './types';
|
|
@@ -20,7 +20,7 @@ const IconWrapper: React.FC< BaseIconProps > = ( {
|
|
|
20
20
|
children,
|
|
21
21
|
} ) => {
|
|
22
22
|
const iconProps = {
|
|
23
|
-
className:
|
|
23
|
+
className: clsx( styles.iconWrapper, className ),
|
|
24
24
|
width: size,
|
|
25
25
|
height: size,
|
|
26
26
|
viewBox,
|
|
@@ -282,7 +282,7 @@ export const SocialServiceIcon: React.FC< {
|
|
|
282
282
|
} > = ( { serviceName, className, iconSize } ) => {
|
|
283
283
|
return (
|
|
284
284
|
<SocialLogo
|
|
285
|
-
className={
|
|
285
|
+
className={ clsx( styles.socialIcon, styles[ serviceName ], className ) }
|
|
286
286
|
icon={ serviceName }
|
|
287
287
|
size={ iconSize || 24 }
|
|
288
288
|
/>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
@@ -19,7 +19,7 @@ import type React from 'react';
|
|
|
19
19
|
const IndeterminateProgressBar: React.FC< IndeterminateProgressBarProps > = ( { className } ) => {
|
|
20
20
|
return (
|
|
21
21
|
<div
|
|
22
|
-
className={
|
|
22
|
+
className={ clsx( className, styles[ 'indeterminate-progress-bar' ] ) }
|
|
23
23
|
aria-label={ __( 'Indeterminate Progress Bar', 'jetpack' ) }
|
|
24
24
|
/>
|
|
25
25
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useSelect } from '@wordpress/data';
|
|
2
2
|
import { __, _x } from '@wordpress/i18n';
|
|
3
3
|
import { Icon, external } from '@wordpress/icons';
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { getRedirectUrl } from '../..';
|
|
7
7
|
import { STORE_ID as CONNECTION_STORE_ID } from '../../../../js-packages/connection/state/store';
|
|
@@ -111,7 +111,7 @@ const JetpackFooter: React.FC< JetpackFooterProps > = ( {
|
|
|
111
111
|
|
|
112
112
|
return (
|
|
113
113
|
<footer
|
|
114
|
-
className={
|
|
114
|
+
className={ clsx(
|
|
115
115
|
'jp-dashboard-footer',
|
|
116
116
|
{
|
|
117
117
|
'is-sm': isSm,
|
|
@@ -143,7 +143,7 @@ const JetpackFooter: React.FC< JetpackFooterProps > = ( {
|
|
|
143
143
|
target={ item.target }
|
|
144
144
|
onClick={ item.onClick }
|
|
145
145
|
onKeyDown={ item.onKeyDown }
|
|
146
|
-
className={
|
|
146
|
+
className={ clsx( 'jp-dashboard-footer__menu-item', {
|
|
147
147
|
'is-external': isExternalLink,
|
|
148
148
|
} ) }
|
|
149
149
|
role={ item.role }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { JetpackLogoProps } from './types';
|
|
5
5
|
|
|
@@ -18,7 +18,7 @@ const JetpackLogo: React.FC< JetpackLogoProps > = ( {
|
|
|
18
18
|
x="0px"
|
|
19
19
|
y="0px"
|
|
20
20
|
viewBox={ viewBox }
|
|
21
|
-
className={
|
|
21
|
+
className={ clsx( 'jetpack-logo', className ) }
|
|
22
22
|
aria-labelledby="jetpack-logo-title"
|
|
23
23
|
height={ height }
|
|
24
24
|
{ ...otherProps }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { JetpackSearchLogoProps } from './types';
|
|
5
5
|
|
|
@@ -19,7 +19,7 @@ const JetpackSearchLogo: React.FC< JetpackSearchLogoProps > = ( {
|
|
|
19
19
|
x="0px"
|
|
20
20
|
y="0px"
|
|
21
21
|
viewBox="0 0 330 42"
|
|
22
|
-
className={
|
|
22
|
+
className={ clsx( 'jetpack-logo', className ) }
|
|
23
23
|
aria-labelledby="jetpack-logo-title"
|
|
24
24
|
{ ...otherProps }
|
|
25
25
|
>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { JetpackLogoProps } from './types';
|
|
5
5
|
|
|
@@ -17,7 +17,7 @@ const JetpackVaultPressBackupLogo: React.FC< JetpackLogoProps > = ( {
|
|
|
17
17
|
x="0px"
|
|
18
18
|
y="0px"
|
|
19
19
|
viewBox={ viewBox }
|
|
20
|
-
className={
|
|
20
|
+
className={ clsx( 'jetpack-vaultpress-backup-logo', className ) }
|
|
21
21
|
aria-labelledby="jetpack-vaultpress-backup-logo-title"
|
|
22
22
|
height={ height }
|
|
23
23
|
{ ...otherProps }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { JetpackLogoProps } from './types';
|
|
5
5
|
|
|
@@ -17,7 +17,7 @@ const JetpackVideoPressLogo: React.FC< JetpackLogoProps > = ( {
|
|
|
17
17
|
x="0px"
|
|
18
18
|
y="0px"
|
|
19
19
|
viewBox={ viewBox }
|
|
20
|
-
className={
|
|
20
|
+
className={ clsx( 'jetpack-videopress-logo', className ) }
|
|
21
21
|
aria-labelledby="jetpack-videopress-logo-title"
|
|
22
22
|
height={ height }
|
|
23
23
|
{ ...otherProps }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import clsx from 'clsx';
|
|
2
2
|
import { createElement } from 'react';
|
|
3
3
|
import { ColProps } from '../types';
|
|
4
4
|
import styles from './style.module.scss';
|
|
@@ -29,7 +29,7 @@ const Col: React.FC< ColProps > = props => {
|
|
|
29
29
|
const lgStart = Math.min( lgCols, typeof props.lg === 'object' ? props.lg.start : 0 ); // max of 12, if undefined = 0
|
|
30
30
|
const lgEnd = Math.min( lgCols, typeof props.lg === 'object' ? props.lg.end : 0 ); // max of 12, if undefined = 0
|
|
31
31
|
|
|
32
|
-
const colClassName =
|
|
32
|
+
const colClassName = clsx( className, {
|
|
33
33
|
// SM
|
|
34
34
|
[ styles[ `col-sm-${ sm }` ] ]: ! ( smStart && smEnd ),
|
|
35
35
|
[ styles[ `col-sm-${ smStart }-start` ] ]: smStart > 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import clsx from 'clsx';
|
|
2
2
|
import { createElement, useMemo } from 'react';
|
|
3
3
|
import { ContainerProps } from '../types';
|
|
4
4
|
import styles from './style.module.scss';
|
|
@@ -29,7 +29,7 @@ const Container: React.FC< ContainerProps > = ( {
|
|
|
29
29
|
};
|
|
30
30
|
}, [ horizontalGap, horizontalSpacing ] );
|
|
31
31
|
|
|
32
|
-
const containerClassName =
|
|
32
|
+
const containerClassName = clsx( className, styles.container, {
|
|
33
33
|
[ styles.fluid ]: fluid,
|
|
34
34
|
} );
|
|
35
35
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import clsx from 'clsx';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styles from './style.module.scss';
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ const LoadingPlaceholder = ( {
|
|
|
14
14
|
className?: string;
|
|
15
15
|
} ) => {
|
|
16
16
|
return (
|
|
17
|
-
<div className={
|
|
17
|
+
<div className={ clsx( styles.placeholder, className ) } style={ { width, height } }>
|
|
18
18
|
{ children }
|
|
19
19
|
</div>
|
|
20
20
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Icon, warning, info, check, close } from '@wordpress/icons';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import styles from './style.module.scss';
|
|
5
5
|
|
|
@@ -58,7 +58,7 @@ const Notice: React.FC< NoticeProps > = ( {
|
|
|
58
58
|
hideCloseButton = false,
|
|
59
59
|
onClose,
|
|
60
60
|
} ) => {
|
|
61
|
-
const classes =
|
|
61
|
+
const classes = clsx( styles.container, styles[ `is-${ level }` ] );
|
|
62
62
|
|
|
63
63
|
return (
|
|
64
64
|
<div className={ classes }>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import clsx from 'clsx';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import ReactSlider from 'react-slider';
|
|
4
4
|
import { NumberSliderProps } from './types';
|
|
@@ -24,7 +24,7 @@ const NumberSlider: React.FC< NumberSliderProps > = ( {
|
|
|
24
24
|
} ) => {
|
|
25
25
|
const [ isThumbHolding, setIsThumbHolding ] = React.useState( false );
|
|
26
26
|
|
|
27
|
-
const componentClassName =
|
|
27
|
+
const componentClassName = clsx( 'jp-components-number-slider', className, {
|
|
28
28
|
'jp-components-number-slider--is-holding': isThumbHolding,
|
|
29
29
|
} );
|
|
30
30
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __, sprintf } from '@wordpress/i18n';
|
|
2
2
|
import { Icon, check, closeSmall } from '@wordpress/icons';
|
|
3
|
-
import
|
|
3
|
+
import clsx from 'clsx';
|
|
4
4
|
import {
|
|
5
5
|
createContext,
|
|
6
6
|
useContext,
|
|
@@ -73,9 +73,9 @@ export const PricingTableItem: React.FC< PricingTableItemProps > = ( {
|
|
|
73
73
|
const defaultLabel = isLg ? labels.lg : labels.default;
|
|
74
74
|
|
|
75
75
|
return (
|
|
76
|
-
<div className={
|
|
76
|
+
<div className={ clsx( styles.item, styles.value ) }>
|
|
77
77
|
<Icon
|
|
78
|
-
className={
|
|
78
|
+
className={ clsx(
|
|
79
79
|
styles.icon,
|
|
80
80
|
showTick ? styles[ 'icon-check' ] : styles[ 'icon-cross' ]
|
|
81
81
|
) }
|
|
@@ -87,7 +87,7 @@ export const PricingTableItem: React.FC< PricingTableItemProps > = ( {
|
|
|
87
87
|
<IconTooltip
|
|
88
88
|
title={ tooltipTitle ? tooltipTitle : defaultTooltipTitle }
|
|
89
89
|
iconClassName={ styles[ 'popover-icon' ] }
|
|
90
|
-
className={
|
|
90
|
+
className={ clsx( styles.popover, tooltipClassName ) }
|
|
91
91
|
placement={ 'bottom-end' }
|
|
92
92
|
iconSize={ 14 }
|
|
93
93
|
offset={ 4 }
|
|
@@ -113,7 +113,7 @@ export const PricingTableColumn: React.FC< PricingTableColumnProps > = ( {
|
|
|
113
113
|
let index = 0;
|
|
114
114
|
|
|
115
115
|
return (
|
|
116
|
-
<div className={
|
|
116
|
+
<div className={ clsx( styles.card, { [ styles[ 'is-primary' ] ]: primary } ) }>
|
|
117
117
|
{ Children.map( children, child => {
|
|
118
118
|
const item = child as ReactElement<
|
|
119
119
|
PropsWithChildren< PricingTableHeaderProps | PricingTableItemProps >
|
|
@@ -141,7 +141,7 @@ const PricingTable: React.FC< PricingTableProps > = ( {
|
|
|
141
141
|
return (
|
|
142
142
|
<PricingTableContext.Provider value={ items }>
|
|
143
143
|
<div
|
|
144
|
-
className={
|
|
144
|
+
className={ clsx( styles.container, { [ styles[ 'is-viewport-large' ] ]: isLg } ) }
|
|
145
145
|
style={
|
|
146
146
|
{
|
|
147
147
|
'--rows': items.length + 1,
|
|
@@ -154,7 +154,7 @@ const PricingTable: React.FC< PricingTableProps > = ( {
|
|
|
154
154
|
{ isLg &&
|
|
155
155
|
items.map( ( item, i ) => (
|
|
156
156
|
<div
|
|
157
|
-
className={
|
|
157
|
+
className={ clsx( styles.item, {
|
|
158
158
|
[ styles[ 'last-feature' ] ]: i === items.length - 1,
|
|
159
159
|
} ) }
|
|
160
160
|
key={ i }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __, sprintf } from '@wordpress/i18n';
|
|
2
2
|
import { Icon, check } from '@wordpress/icons';
|
|
3
|
-
import
|
|
3
|
+
import clsx from 'clsx';
|
|
4
4
|
import Alert from '../alert';
|
|
5
5
|
import Button from '../button/index';
|
|
6
6
|
import { CheckmarkIcon } from '../icons/index';
|
|
@@ -49,7 +49,7 @@ const ProductOffer: React.FC< ProductOfferProps > = ( {
|
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
51
|
<div
|
|
52
|
-
className={
|
|
52
|
+
className={ clsx( styles.wrapper, className, {
|
|
53
53
|
[ styles[ 'is-bundle-card' ] ]: isBundle,
|
|
54
54
|
[ styles[ 'is-card' ] ]: isCard || isBundle, // is card when is bundle.
|
|
55
55
|
} ) }
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
6
|
/*
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
@@ -48,7 +48,7 @@ const ProductPrice: React.FC< ProductPriceProps > = ( {
|
|
|
48
48
|
return (
|
|
49
49
|
<>
|
|
50
50
|
<div className={ styles.container }>
|
|
51
|
-
<div className={
|
|
51
|
+
<div className={ clsx( styles[ 'price-container' ], 'product-price_container' ) }>
|
|
52
52
|
<Price
|
|
53
53
|
value={ offPrice ?? price }
|
|
54
54
|
currency={ currency }
|
|
@@ -64,7 +64,7 @@ const ProductPrice: React.FC< ProductPriceProps > = ( {
|
|
|
64
64
|
/>
|
|
65
65
|
) }
|
|
66
66
|
{ discountElt && (
|
|
67
|
-
<Text className={
|
|
67
|
+
<Text className={ clsx( styles[ 'promo-label' ], 'product-price_promo_label' ) }>
|
|
68
68
|
{ discountElt }
|
|
69
69
|
</Text>
|
|
70
70
|
) }
|
|
@@ -74,10 +74,10 @@ const ProductPrice: React.FC< ProductPriceProps > = ( {
|
|
|
74
74
|
{ children ? (
|
|
75
75
|
children
|
|
76
76
|
) : (
|
|
77
|
-
<Text className={
|
|
77
|
+
<Text className={ clsx( styles.legend, 'product-price_legend' ) }>{ legend }</Text>
|
|
78
78
|
) }
|
|
79
79
|
{ promoLabel && (
|
|
80
|
-
<Text className={
|
|
80
|
+
<Text className={ clsx( styles[ 'promo-label' ], 'product-price_promo_label' ) }>
|
|
81
81
|
{ promoLabel }
|
|
82
82
|
</Text>
|
|
83
83
|
) }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getCurrencyObject } from '@automattic/format-currency';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import Text from '../text';
|
|
4
4
|
import styles from './style.module.scss';
|
|
5
5
|
import type { PriceProps } from './types';
|
|
@@ -12,7 +12,7 @@ import type React from 'react';
|
|
|
12
12
|
* @returns {React.ReactNode} -Price react component.
|
|
13
13
|
*/
|
|
14
14
|
export const Price: React.FC< PriceProps > = ( { value, currency, isOff, hidePriceFraction } ) => {
|
|
15
|
-
const classNames =
|
|
15
|
+
const classNames = clsx( styles.price, 'product-price_price', {
|
|
16
16
|
[ styles[ 'is-not-off-price' ] ]: ! isOff,
|
|
17
17
|
} );
|
|
18
18
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
@@ -32,10 +32,8 @@ const ProgressBar: React.FC< ProgressBarProps > = ( {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<div
|
|
36
|
-
className={
|
|
37
|
-
>
|
|
38
|
-
<div className={ classnames( progressClassName, styles.progress ) } style={ style }></div>
|
|
35
|
+
<div className={ clsx( className, styles.wrapper, { [ styles.small ]: size === 'small' } ) }>
|
|
36
|
+
<div className={ clsx( progressClassName, styles.progress ) } style={ style }></div>
|
|
39
37
|
</div>
|
|
40
38
|
);
|
|
41
39
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RadioControl as WPRadioControl } from '@wordpress/components';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import styles from './styles.module.scss';
|
|
4
4
|
|
|
5
5
|
interface RadioControlProps {
|
|
@@ -41,7 +41,7 @@ const RadioControl: React.FC< RadioControlProps > = ( {
|
|
|
41
41
|
return (
|
|
42
42
|
<WPRadioControl
|
|
43
43
|
selected={ selected }
|
|
44
|
-
className={
|
|
44
|
+
className={ clsx( styles.radio, className ) }
|
|
45
45
|
disabled={ disabled }
|
|
46
46
|
help={ help }
|
|
47
47
|
label={ label }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
4
|
import numberFormat from '../number-format';
|
|
5
5
|
|
|
@@ -97,7 +97,7 @@ const RecordMeterBar: React.FC< RecordMeterBarProps > = ( {
|
|
|
97
97
|
}, [ items, sortByCount ] );
|
|
98
98
|
|
|
99
99
|
return (
|
|
100
|
-
<div className={
|
|
100
|
+
<div className={ clsx( 'record-meter-bar', className ) }>
|
|
101
101
|
<div className="record-meter-bar__items" aria-hidden="true">
|
|
102
102
|
{ itemsToRender.map( ( { count, label, backgroundColor } ) => {
|
|
103
103
|
const widthPercent = ( ( count / total ) * 100 ).toPrecision( 2 );
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { Tooltip } from '@wordpress/components';
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
@@ -26,19 +26,19 @@ const StatCard = ( { className, icon, label, value, variant = 'square' }: StatCa
|
|
|
26
26
|
} );
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
|
-
<div className={
|
|
30
|
-
<div className={
|
|
31
|
-
<div className={
|
|
29
|
+
<div className={ clsx( className, styles.wrapper, styles[ variant ] ) }>
|
|
30
|
+
<div className={ clsx( styles.icon ) }>{ icon }</div>
|
|
31
|
+
<div className={ clsx( styles.info ) }>
|
|
32
32
|
<Text className={ styles.label }>{ label }</Text>
|
|
33
33
|
{ variant === 'square' ? (
|
|
34
34
|
// @todo Switch to `placement` once WordPress 6.4 is the minimum.
|
|
35
35
|
<Tooltip text={ formattedValue } position="top center">
|
|
36
|
-
<Text variant="headline-small" className={
|
|
36
|
+
<Text variant="headline-small" className={ clsx( styles.value ) }>
|
|
37
37
|
{ compactValue }
|
|
38
38
|
</Text>
|
|
39
39
|
</Tooltip>
|
|
40
40
|
) : (
|
|
41
|
-
<Text variant="title-medium-semi-bold" className={
|
|
41
|
+
<Text variant="title-medium-semi-bold" className={ clsx( styles.value ) }>
|
|
42
42
|
{ formattedValue }
|
|
43
43
|
</Text>
|
|
44
44
|
) }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import Text from '../text';
|
|
4
4
|
import styles from './style.module.scss';
|
|
5
5
|
|
|
@@ -21,7 +21,7 @@ const Status = ( { className, label, status = 'inactive' }: StatusProps ): JSX.E
|
|
|
21
21
|
return (
|
|
22
22
|
<Text
|
|
23
23
|
variant="body-extra-small"
|
|
24
|
-
className={
|
|
24
|
+
className={ clsx(
|
|
25
25
|
styles.status,
|
|
26
26
|
{
|
|
27
27
|
[ styles[ `is-${ status }` ] ]: status,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createInterpolateElement } from '@wordpress/element';
|
|
2
2
|
import { __, sprintf } from '@wordpress/i18n';
|
|
3
|
-
import
|
|
3
|
+
import clsx from 'clsx';
|
|
4
4
|
import { getRedirectUrl } from '../../../components';
|
|
5
5
|
import Text from '../text';
|
|
6
6
|
import type { TermsOfServiceProps } from './types';
|
|
@@ -11,7 +11,7 @@ const TermsOfService: React.FC< TermsOfServiceProps > = ( {
|
|
|
11
11
|
multipleButtons,
|
|
12
12
|
agreeButtonLabel,
|
|
13
13
|
} ) => (
|
|
14
|
-
<Text className={
|
|
14
|
+
<Text className={ clsx( className, 'terms-of-service' ) }>
|
|
15
15
|
{ multipleButtons ? (
|
|
16
16
|
<MultipleButtonsText multipleButtonsLabels={ multipleButtons } />
|
|
17
17
|
) : (
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import clsx from 'clsx';
|
|
2
2
|
import type { TestimonialType } from './types';
|
|
3
3
|
|
|
4
4
|
import './style.scss';
|
|
5
5
|
|
|
6
6
|
const Testimonial: TestimonialType = ( { quote, author, profession, img, hidden } ) => {
|
|
7
7
|
return (
|
|
8
|
-
<div className={
|
|
8
|
+
<div className={ clsx( 'testimonial', hidden ? 'hidden' : 'show' ) } key={ author }>
|
|
9
9
|
<img className="testimonial__author-img" src={ img } alt={ author } />
|
|
10
10
|
|
|
11
11
|
<div className="testimonial__content">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import clsx from 'clsx';
|
|
2
2
|
import React, { useMemo, forwardRef } from 'react';
|
|
3
3
|
import { BOX_MODEL_VALUES, VARIANTS_MAPPING } from './constants';
|
|
4
4
|
import styles from './style.module.scss';
|
|
@@ -30,7 +30,7 @@ const Text = forwardRef< HTMLElement, TextProps >(
|
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
32
|
<Component
|
|
33
|
-
className={
|
|
33
|
+
className={ clsx( styles.reset, styles[ variant ], className, boxModelClasses ) }
|
|
34
34
|
{ ...componentProps }
|
|
35
35
|
>
|
|
36
36
|
{ children }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ToggleControl as WPToggleControl } from '@wordpress/components';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import styles from './styles.module.scss';
|
|
5
5
|
|
|
@@ -57,7 +57,7 @@ const ToggleControl: React.FC< ToggleControlProps > = ( {
|
|
|
57
57
|
return (
|
|
58
58
|
<WPToggleControl
|
|
59
59
|
checked={ showChecked }
|
|
60
|
-
className={
|
|
60
|
+
className={ clsx( styles.toggle, className, {
|
|
61
61
|
[ styles[ 'is-toggling' ] ]: toggling,
|
|
62
62
|
[ styles[ 'is-small' ] ]: size === 'small',
|
|
63
63
|
[ styles[ 'no-label' ] ]: ! label,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/jetpack-components",
|
|
3
|
-
"version": "0.53.
|
|
3
|
+
"version": "0.53.9",
|
|
4
4
|
"description": "Jetpack Components Package",
|
|
5
5
|
"author": "Automattic",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@wordpress/i18n": "5.0.0",
|
|
27
27
|
"@wordpress/icons": "10.0.0",
|
|
28
28
|
"@wordpress/notices": "5.0.0",
|
|
29
|
-
"
|
|
29
|
+
"clsx": "2.1.1",
|
|
30
30
|
"prop-types": "^15.7.2",
|
|
31
31
|
"qrcode.react": "3.1.0",
|
|
32
32
|
"react-slider": "2.0.5",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"@babel/core": "7.24.0",
|
|
40
40
|
"@babel/preset-react": "7.23.3",
|
|
41
41
|
"@jest/globals": "29.4.3",
|
|
42
|
-
"@storybook/addon-actions": "8.
|
|
43
|
-
"@storybook/blocks": "8.
|
|
44
|
-
"@storybook/react": "8.
|
|
42
|
+
"@storybook/addon-actions": "8.1.6",
|
|
43
|
+
"@storybook/blocks": "8.1.6",
|
|
44
|
+
"@storybook/react": "8.1.6",
|
|
45
45
|
"@testing-library/dom": "10.1.0",
|
|
46
46
|
"@testing-library/react": "15.0.7",
|
|
47
47
|
"@testing-library/user-event": "14.5.2",
|