}
/>
diff --git a/projects/packages/forms/src/dashboard/components/table/index.js b/projects/packages/forms/src/dashboard/components/table/index.js
index 88a1c643fbff..9091eeb5aabc 100644
--- a/projects/packages/forms/src/dashboard/components/table/index.js
+++ b/projects/packages/forms/src/dashboard/components/table/index.js
@@ -2,7 +2,7 @@
* External dependencies
*/
import { createRef, useCallback, useEffect, useRef } from '@wordpress/element';
-import classnames from 'classnames';
+import clsx from 'clsx';
import { difference, forEach, includes, kebabCase, map, without } from 'lodash';
import { CSSTransition, TransitionGroup } from 'react-transition-group';
/**
@@ -55,8 +55,8 @@ const Table = ( {
setSelectedResponses( newState );
}, [ items, selectedResponses, setSelectedResponses ] );
- const classes = classnames( 'jp-forms__table', className );
- const checkboxClasses = classnames( 'jp-forms__table-checkbox', {
+ const classes = clsx( 'jp-forms__table', className );
+ const checkboxClasses = clsx( 'jp-forms__table-checkbox', {
'is-intermediate': selectedResponses.length !== 0 && selectedResponses.length !== items.length,
} );
@@ -75,7 +75,7 @@ const Table = ( {
) }
{ map( columns, ( { label, key } ) => {
- const headerClasses = classnames( 'jp-forms__table-cell', `is-${ kebabCase( key ) }` );
+ const headerClasses = clsx( 'jp-forms__table-cell', `is-${ kebabCase( key ) }` );
return (
diff --git a/projects/packages/forms/src/dashboard/components/table/item.js b/projects/packages/forms/src/dashboard/components/table/item.js
index a09c4f8aeac1..d149841a4adf 100644
--- a/projects/packages/forms/src/dashboard/components/table/item.js
+++ b/projects/packages/forms/src/dashboard/components/table/item.js
@@ -1,5 +1,5 @@
import { forwardRef, useCallback } from '@wordpress/element';
-import classnames from 'classnames';
+import clsx from 'clsx';
import { kebabCase, map } from 'lodash';
const stopPropagation = event => event.stopPropagation();
@@ -7,7 +7,7 @@ const stopPropagation = event => event.stopPropagation();
const TableItem = ( { columns, item, isSelected, onSelectChange }, ref ) => {
const handleChange = useCallback( () => onSelectChange( item.id ), [ item.id, onSelectChange ] );
- const classes = classnames( 'jp-forms__table-item', item.className, {
+ const classes = clsx( 'jp-forms__table-item', item.className, {
'is-active': ! item.isLoading && item.isActive,
'is-clickable': ! item.isLoading && item.onClick,
'is-loading': item.isLoading,
@@ -34,7 +34,7 @@ const TableItem = ( { columns, item, isSelected, onSelectChange }, ref ) => {
{ map( columns, ( { additionalClassNames, getValue, key }, index ) => {
const value = getValue ? getValue( item ) : item[ key ];
- const cellClasses = classnames(
+ const cellClasses = clsx(
'jp-forms__table-cell',
`is-${ kebabCase( key ) }`,
additionalClassNames
diff --git a/projects/packages/forms/src/dashboard/inbox/export-modal/csv.js b/projects/packages/forms/src/dashboard/inbox/export-modal/csv.js
index 556075ba2407..8a88aa54d45b 100644
--- a/projects/packages/forms/src/dashboard/inbox/export-modal/csv.js
+++ b/projects/packages/forms/src/dashboard/inbox/export-modal/csv.js
@@ -3,7 +3,7 @@
*/
import { useCallback } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
-import classnames from 'classnames';
+import clsx from 'clsx';
/**
* Internal dependencies
*/
@@ -28,7 +28,7 @@ const CSVExport = ( { onExport } ) => {
} );
}, [ onExport ] );
- const buttonClasses = classnames( 'button', 'export-button', 'export-csv', {
+ const buttonClasses = clsx( 'button', 'export-button', 'export-csv', {
'button-primary': ! isWpcom(),
} );
diff --git a/projects/packages/forms/src/dashboard/inbox/export-modal/google-drive.js b/projects/packages/forms/src/dashboard/inbox/export-modal/google-drive.js
index 5b0068970c06..fcc39859974a 100644
--- a/projects/packages/forms/src/dashboard/inbox/export-modal/google-drive.js
+++ b/projects/packages/forms/src/dashboard/inbox/export-modal/google-drive.js
@@ -3,7 +3,7 @@
*/
import { useCallback, useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
-import classnames from 'classnames';
+import clsx from 'clsx';
import { tap } from 'lodash';
/**
* Internal dependencies
@@ -51,7 +51,7 @@ const GoogleDriveExport = ( { onExport } ) => {
} );
}, [ onExport ] );
- const buttonClasses = classnames( 'button', 'export-button', 'export-gdrive', {
+ const buttonClasses = clsx( 'button', 'export-button', 'export-gdrive', {
'button-primary': ! isWpcom(),
} );
diff --git a/projects/packages/forms/src/dashboard/inbox/index.js b/projects/packages/forms/src/dashboard/inbox/index.js
index 9baf823d7d25..67816a7757b9 100644
--- a/projects/packages/forms/src/dashboard/inbox/index.js
+++ b/projects/packages/forms/src/dashboard/inbox/index.js
@@ -15,7 +15,7 @@ import {
} from '@wordpress/element';
import { __, _x } from '@wordpress/i18n';
import { arrowLeft } from '@wordpress/icons';
-import classnames from 'classnames';
+import clsx from 'clsx';
import { find, findIndex, includes, isEqual, join, keys, map, pick } from 'lodash';
import { useNavigate } from 'react-router-dom';
/**
@@ -252,7 +252,7 @@ const Inbox = () => {
const showBulkActionsMenu = !! selectedResponses.length && ! loading;
- const classes = classnames( 'jp-forms__inbox', {
+ const classes = clsx( 'jp-forms__inbox', {
'is-response-view': !! currentResponseId,
'is-response-animation-reverted': responseAnimationDirection < 0,
} );
diff --git a/projects/packages/forms/src/dashboard/inbox/response.js b/projects/packages/forms/src/dashboard/inbox/response.js
index a34d982dc14c..37f403139d9c 100644
--- a/projects/packages/forms/src/dashboard/inbox/response.js
+++ b/projects/packages/forms/src/dashboard/inbox/response.js
@@ -5,7 +5,7 @@ import { Button } from '@wordpress/components';
import { dateI18n, getSettings as getDateSettings } from '@wordpress/date';
import { useCallback, useEffect, useRef, useState } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
-import classnames from 'classnames';
+import clsx from 'clsx';
import { map } from 'lodash';
/**
* Internal dependencies
@@ -32,7 +32,7 @@ const InboxResponse = ( { loading, response } ) => {
setTimeout( () => setEmailCopied( false ), 3000 );
}, [ response, setEmailCopied ] );
- const titleClasses = classnames( 'jp-forms__inbox-response-title', {
+ const titleClasses = clsx( 'jp-forms__inbox-response-title', {
'is-email': response && ! response.author_name && response.author_email,
'is-ip': response && ! response.author_name && ! response.author_email,
'is-name': response && response.author_name,
diff --git a/projects/packages/my-jetpack/_inc/components/card/index.jsx b/projects/packages/my-jetpack/_inc/components/card/index.jsx
index 43d7b26d64a6..6043f1242b8e 100644
--- a/projects/packages/my-jetpack/_inc/components/card/index.jsx
+++ b/projects/packages/my-jetpack/_inc/components/card/index.jsx
@@ -1,5 +1,5 @@
import { Text } from '@automattic/jetpack-components';
-import classNames from 'classnames';
+import clsx from 'clsx';
import PropTypes from 'prop-types';
import React from 'react';
import styles from './style.module.scss';
@@ -7,7 +7,7 @@ import styles from './style.module.scss';
export const CardWrapper = props => {
const { children, className } = props;
- const containerClassName = classNames( styles.container, className );
+ const containerClassName = clsx( styles.container, className );
return
{ children }
;
};
diff --git a/projects/packages/my-jetpack/_inc/components/close-link/index.js b/projects/packages/my-jetpack/_inc/components/close-link/index.js
index df9fe73f9570..fd463db9ec9f 100644
--- a/projects/packages/my-jetpack/_inc/components/close-link/index.js
+++ b/projects/packages/my-jetpack/_inc/components/close-link/index.js
@@ -1,16 +1,12 @@
import { Icon, close } from '@wordpress/icons';
-import classNames from 'classnames';
+import clsx from 'clsx';
import React from 'react';
import { Link } from 'react-router-dom';
import styles from './styles.module.scss';
const CloseLink = ( { className, accessibleName } ) => {
return (
-
+
);
diff --git a/projects/packages/my-jetpack/_inc/components/connection-status-card/index.jsx b/projects/packages/my-jetpack/_inc/components/connection-status-card/index.jsx
index 69f56628997d..088c4e8af374 100644
--- a/projects/packages/my-jetpack/_inc/components/connection-status-card/index.jsx
+++ b/projects/packages/my-jetpack/_inc/components/connection-status-card/index.jsx
@@ -7,7 +7,7 @@ import {
import { useDispatch } from '@wordpress/data';
import { __, sprintf } from '@wordpress/i18n';
import { Icon, info, check } from '@wordpress/icons';
-import classNames from 'classnames';
+import clsx from 'clsx';
import PropTypes from 'prop-types';
import React, { useState, useCallback, useMemo } from 'react';
import useAnalytics from '../../hooks/use-analytics';
@@ -19,13 +19,13 @@ import styles from './styles.module.scss';
const ConnectionListItem = ( { text, actionText, onClick, status } ) => (
{ text }
@@ -157,7 +157,7 @@ const ConnectionStatusCard = props => {
diff --git a/projects/packages/my-jetpack/_inc/components/golden-token/tooltip/index.jsx b/projects/packages/my-jetpack/_inc/components/golden-token/tooltip/index.jsx
index ccbe555a4b2a..88c844ff0a17 100644
--- a/projects/packages/my-jetpack/_inc/components/golden-token/tooltip/index.jsx
+++ b/projects/packages/my-jetpack/_inc/components/golden-token/tooltip/index.jsx
@@ -2,7 +2,7 @@ import { Button, JetpackIcon } from '@automattic/jetpack-components';
import { Popover } from '@wordpress/components';
import { dateI18n } from '@wordpress/date';
import { __, sprintf } from '@wordpress/i18n';
-import classNames from 'classnames';
+import clsx from 'clsx';
import { useCallback, useState } from 'react';
import styles from './style.module.scss';
import './style.global.scss';
@@ -37,7 +37,7 @@ export function GoldenTokenTooltip( { productName, giftedDate } ) {
className: styles.container,
};
- const wrapperClassNames = classNames( styles.wrapper, 'golden-token-icon-tooltip' );
+ const wrapperClassNames = clsx( styles.wrapper, 'golden-token-icon-tooltip' );
return (
diff --git a/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx b/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx
index c741e1f4199d..02e44da80d94 100644
--- a/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx
+++ b/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx
@@ -14,7 +14,7 @@ import {
ActionButton,
} from '@automattic/jetpack-components';
import { __ } from '@wordpress/i18n';
-import classnames from 'classnames';
+import clsx from 'clsx';
import { useContext, useEffect, useLayoutEffect, useState } from 'react';
/*
* Internal dependencies
@@ -59,7 +59,7 @@ const GlobalNotice = ( { message, title, options } ) => {
return (
@@ -159,7 +159,7 @@ export default function MyJetpackScreen() {
) }
{ showFullJetpackStatsCard && (
diff --git a/projects/packages/my-jetpack/_inc/components/product-card/action-button.jsx b/projects/packages/my-jetpack/_inc/components/product-card/action-button.jsx
index d04ddb4f9c8d..5559cea3351c 100644
--- a/projects/packages/my-jetpack/_inc/components/product-card/action-button.jsx
+++ b/projects/packages/my-jetpack/_inc/components/product-card/action-button.jsx
@@ -1,7 +1,7 @@
import { Button } from '@automattic/jetpack-components';
import { __, sprintf } from '@wordpress/i18n';
import { Icon, chevronDown, external, check } from '@wordpress/icons';
-import cs from 'classnames';
+import clsx from 'clsx';
import { useCallback, useState, useEffect, useMemo, useRef } from 'react';
import { PRODUCT_STATUSES } from '../../constants';
import useProduct from '../../data/products/use-product';
@@ -297,7 +297,7 @@ const ActionButton = ( {
return (
<>
{ hasAdditionalActions && (