Skip to content

Commit

Permalink
Forms: Fix fatal error due to unexpected input type (#40183)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbradsha authored and matticbot committed Nov 18, 2024
1 parent 76fbf8a commit 3f9618b
Show file tree
Hide file tree
Showing 100 changed files with 2,536 additions and 305 deletions.
214 changes: 214 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,183 @@

### This is a list detailing changes for the Jetpack RNA Components package releases.

## [0.61.0-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Added
- Gridicon Component: Add support for help-outline icon.

## [0.60.0] - 2024-11-14
### Added
- Adds tooltips for each ThreatFixerButton state [#40111]

### Fixed
- Fixes the loading placeholder that didn't disappear when the price loads. [#40157]

## [0.59.0] - 2024-11-11
### Added
- Add ThreatsDataViews component [#39754]
- Components: add ref for container component [#39850]
- IconTooltip: add support for showing tooltip on hover. [#39916]

### Changed
- Add ToggleGroupControl to ThreatsDataViews for easily toggling between Active and Historical threats [#39901]
- Updated package dependencies. [#39999]
- Updated package dependencies. [#40000]
- Updated package dependencies. [#40060]

## [0.58.1] - 2024-11-04
### Added
- Enable test coverage. [#39961]

### Fixed
- Fix tooltip behavior. [#39879]

## [0.58.0] - 2024-10-15
### Added
- Add DiffViewer component [#39672]
- Add ThreatSeverityBadge component [#39758]

## [0.57.0] - 2024-10-14
### Added
- Add JetpackProtectLogo component. [#39703]
- Add MarkedLines component. [#39674]

## [0.56.3] - 2024-10-10
### Changed
- Components - getRedirectUrl: use file extension on import for linter to find definitions
- Updated package dependencies.

## [0.56.2] - 2024-10-07
### Changed
- Updated package dependencies. [#39594]

## [0.56.1] - 2024-10-02
### Changed
- Updated package dependencies. [#39610]

## [0.56.0] - 2024-09-25
### Added
- Added StatCard component export [#35739]

## [0.55.17] - 2024-09-18
### Changed
- Internal updates.

## [0.55.16] - 2024-09-16
### Changed
- Updated package dependencies. [#39332]

## [0.55.15] - 2024-09-10
### Changed
- Updated package dependencies. [#39302]

## [0.55.14] - 2024-09-09
### Changed
- Updated package dependencies. [#39278]

## [0.55.13] - 2024-09-05
### Changed
- Internal updates.

## [0.55.12] - 2024-09-05
### Changed
- Updated package dependencies. [#39176]

### Fixed
- ToggleControl: Update styles for WordPress/gutenberg#63490. [#39176]

## [0.55.11] - 2024-08-29
### Changed
- Updated package dependencies. [#39111]

## [0.55.10] - 2024-08-23
### Changed
- Internal updates.

## [0.55.9] - 2024-08-21
### Fixed
- Revert recent SVG image optimizations. [#38981]

## [0.55.8] - 2024-08-19
### Changed
- Updated package dependencies. [#38893]

### Fixed
- Lossless image optimization for images (should improve performance with no visible changes). [#38750]

## [0.55.7] - 2024-08-15
### Changed
- Updated package dependencies. [#38665]

## [0.55.6] - 2024-08-09
### Removed
- Tests: Removed react-test-renderer. [#38755]

## [0.55.5] - 2024-08-05
### Fixed
- Fixed TS types for Notice components by marking optional props as such [#38686]

## [0.55.4] - 2024-08-01
### Added
- Update Welcome Banner and set async site-only connection [#38534]

## [0.55.3] - 2024-07-30
### Changed
- React: Changing global JSX namespace to React.JSX [#38585]

## [0.55.2] - 2024-07-26
### Added
- Export button props type to be used elsewhere [#38549]

## [0.55.1] - 2024-07-25
### Added
- Added `className` prop to `Alert` component [#38450]

### Changed
- React compatibility: Ensuring createRoot is not called more than once. [#38495]

## [0.55.0] - 2024-07-22
### Removed
- Remove compatibility with WordPress 6.4. [#38386]

## [0.54.4] - 2024-07-18
### Changed
- Internal updates.

## [0.54.3] - 2024-07-03
### Changed
- Updated package dependencies. [#38132]

## [0.54.2] - 2024-06-25
### Added
- Added social preview for Threads [#38003]

## [0.54.1] - 2024-06-24
### Fixed
- Updated threads icon color [#37977]

## [0.54.0] - 2024-06-21
### Added
- Added Chip component [#37916]

## [0.53.10] - 2024-06-12
### Changed
- Updated package dependencies. [#37796]

## [0.53.9] - 2024-06-11
### Changed
- Updated package dependencies. [#37779]

## [0.53.8] - 2024-06-10
### Changed
- Change codebase to use clsx instead of classnames. [#37708]

## [0.53.7] - 2024-06-05
### Changed
- Updated package dependencies. [#37669]

## [0.53.6] - 2024-05-30
### Changed
- Connection: Update connection ToS messaging slightly [#37536]
Expand Down Expand Up @@ -1051,6 +1228,43 @@
### Changed
- Update node version requirement to 14.16.1

[0.61.0-alpha]: https://github.com/Automattic/jetpack-components/compare/0.60.0...0.61.0-alpha
[0.60.0]: https://github.com/Automattic/jetpack-components/compare/0.59.0...0.60.0
[0.59.0]: https://github.com/Automattic/jetpack-components/compare/0.58.1...0.59.0
[0.58.1]: https://github.com/Automattic/jetpack-components/compare/0.58.0...0.58.1
[0.58.0]: https://github.com/Automattic/jetpack-components/compare/0.57.0...0.58.0
[0.57.0]: https://github.com/Automattic/jetpack-components/compare/0.56.3...0.57.0
[0.56.3]: https://github.com/Automattic/jetpack-components/compare/0.56.2...0.56.3
[0.56.2]: https://github.com/Automattic/jetpack-components/compare/0.56.1...0.56.2
[0.56.1]: https://github.com/Automattic/jetpack-components/compare/0.56.0...0.56.1
[0.56.0]: https://github.com/Automattic/jetpack-components/compare/0.55.17...0.56.0
[0.55.17]: https://github.com/Automattic/jetpack-components/compare/0.55.16...0.55.17
[0.55.16]: https://github.com/Automattic/jetpack-components/compare/0.55.15...0.55.16
[0.55.15]: https://github.com/Automattic/jetpack-components/compare/0.55.14...0.55.15
[0.55.14]: https://github.com/Automattic/jetpack-components/compare/0.55.13...0.55.14
[0.55.13]: https://github.com/Automattic/jetpack-components/compare/0.55.12...0.55.13
[0.55.12]: https://github.com/Automattic/jetpack-components/compare/0.55.11...0.55.12
[0.55.11]: https://github.com/Automattic/jetpack-components/compare/0.55.10...0.55.11
[0.55.10]: https://github.com/Automattic/jetpack-components/compare/0.55.9...0.55.10
[0.55.9]: https://github.com/Automattic/jetpack-components/compare/0.55.8...0.55.9
[0.55.8]: https://github.com/Automattic/jetpack-components/compare/0.55.7...0.55.8
[0.55.7]: https://github.com/Automattic/jetpack-components/compare/0.55.6...0.55.7
[0.55.6]: https://github.com/Automattic/jetpack-components/compare/0.55.5...0.55.6
[0.55.5]: https://github.com/Automattic/jetpack-components/compare/0.55.4...0.55.5
[0.55.4]: https://github.com/Automattic/jetpack-components/compare/0.55.3...0.55.4
[0.55.3]: https://github.com/Automattic/jetpack-components/compare/0.55.2...0.55.3
[0.55.2]: https://github.com/Automattic/jetpack-components/compare/0.55.1...0.55.2
[0.55.1]: https://github.com/Automattic/jetpack-components/compare/0.55.0...0.55.1
[0.55.0]: https://github.com/Automattic/jetpack-components/compare/0.54.4...0.55.0
[0.54.4]: https://github.com/Automattic/jetpack-components/compare/0.54.3...0.54.4
[0.54.3]: https://github.com/Automattic/jetpack-components/compare/0.54.2...0.54.3
[0.54.2]: https://github.com/Automattic/jetpack-components/compare/0.54.1...0.54.2
[0.54.1]: https://github.com/Automattic/jetpack-components/compare/0.54.0...0.54.1
[0.54.0]: https://github.com/Automattic/jetpack-components/compare/0.53.10...0.54.0
[0.53.10]: https://github.com/Automattic/jetpack-components/compare/0.53.9...0.53.10
[0.53.9]: https://github.com/Automattic/jetpack-components/compare/0.53.8...0.53.9
[0.53.8]: https://github.com/Automattic/jetpack-components/compare/0.53.7...0.53.8
[0.53.7]: https://github.com/Automattic/jetpack-components/compare/0.53.6...0.53.7
[0.53.6]: https://github.com/Automattic/jetpack-components/compare/0.53.5...0.53.6
[0.53.5]: https://github.com/Automattic/jetpack-components/compare/0.53.4...0.53.5
[0.53.4]: https://github.com/Automattic/jetpack-components/compare/0.53.3...0.53.4
Expand Down
8 changes: 4 additions & 4 deletions components/action-button/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { Spinner } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import classNames from 'classnames';
import clsx from 'clsx';
import PropTypes from 'prop-types';
/**
* Internal dependencies
Expand All @@ -20,7 +20,7 @@ import styles from './style.module.scss';
* It is useful to async actions when the user has to wait the result of a request or process.
*
* @param {object} props - The properties.
* @returns {React.Component} The `ActionButton` component.
* @return {React.Component} The `ActionButton` component.
*/
const ActionButton = props => {
const {
Expand All @@ -40,7 +40,7 @@ const ActionButton = props => {
<>
{
<Button
className={ classNames( styles.button, 'jp-action-button--button', customClass ) }
className={ clsx( styles.button, 'jp-action-button--button', customClass ) }
label={ label }
onClick={ onClick }
variant="primary"
Expand All @@ -51,7 +51,7 @@ const ActionButton = props => {
}

{ displayError && (
<p className={ classNames( styles.error, 'jp-action-button__error' ) }>{ errorMessage }</p>
<p className={ clsx( styles.error, 'jp-action-button__error' ) }>{ errorMessage }</p>
) }
</>
);
Expand Down
6 changes: 3 additions & 3 deletions components/admin-page/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { __ } from '@wordpress/i18n';
import classNames from 'classnames';
import clsx from 'clsx';
import JetpackFooter from '../jetpack-footer';
import JetpackLogo from '../jetpack-logo';
import Col from '../layout/col';
Expand All @@ -14,7 +14,7 @@ import type React from 'react';
* All content must be passed as children wrapped in as many <AdminSection> elements as needed.
*
* @param {AdminPageProps} props - Component properties.
* @returns {React.ReactNode} AdminPage component.
* @return {React.ReactNode} AdminPage component.
*/
const AdminPage: React.FC< AdminPageProps > = ( {
children,
Expand All @@ -25,7 +25,7 @@ const AdminPage: React.FC< AdminPageProps > = ( {
showBackground = true,
header,
} ) => {
const rootClassName = classNames( styles[ 'admin-page' ], {
const rootClassName = clsx( styles[ 'admin-page' ], {
[ styles.background ]: showBackground,
} );

Expand Down
2 changes: 1 addition & 1 deletion components/admin-section/basic/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { AdminSectionBaseProps } from '../types';
* This is the wrapper component to build sections within your admin page.
*
* @param {AdminSectionBaseProps} props - Component properties.
* @returns {React.ReactNode} AdminSection component.
* @return {React.ReactNode} AdminSection component.
*/
const AdminSection: React.FC< AdminSectionBaseProps > = ( { children } ) => {
return <div className={ styles.section }>{ children }</div>;
Expand Down
2 changes: 1 addition & 1 deletion components/admin-section/hero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { AdminSectionBaseProps } from '../types';
* The wrapper component for a Hero Section to be used in admin pages.
*
* @param {AdminSectionBaseProps} props - Component properties.
* @returns {React.Component} AdminSectionHero component.
* @return {React.Component} AdminSectionHero component.
*/
const AdminSectionHero: React.FC< AdminSectionBaseProps > = ( { children } ) => {
return <div className={ styles[ 'section-hero' ] }>{ children }</div>;
Expand Down
1 change: 1 addition & 0 deletions components/admin-section/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export type AdminSectionBaseProps = {
* The section content
*/
children: React.ReactNode;
className?: string;
};
25 changes: 17 additions & 8 deletions components/alert/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Icon, warning, info, check } from '@wordpress/icons';
import classNames from 'classnames';
import clsx from 'clsx';
import React from 'react';
import styles from './style.module.scss';

Expand All @@ -12,6 +12,9 @@ type AlertProps = {

/** Children to be rendered inside the alert. */
children: React.ReactNode;

/** Wrapper class name */
className?: string;
};

const getIconByLevel = ( level: AlertProps[ 'level' ] ) => {
Expand All @@ -32,14 +35,20 @@ const getIconByLevel = ( level: AlertProps[ 'level' ] ) => {
/**
* Alert component
*
* @param {object} props - The component properties.
* @param {string} props.level - The alert level: error, warning, info, success.
* @param {boolean} props.showIcon - Whether to show the alert icon.
* @param {React.Component} props.children - The alert content.
* @returns {React.ReactElement} The `Alert` component.
* @param {object} props - The component properties.
* @param {string} props.level - The alert level: error, warning, info, success.
* @param {boolean} props.showIcon - Whether to show the alert icon.
* @param {string} props.className - The wrapper class name.
* @param {React.Component} props.children - The alert content.
* @return {React.ReactElement} The `Alert` component.
*/
const Alert: React.FC< AlertProps > = ( { level = 'warning', children, showIcon = true } ) => {
const classes = classNames( styles.container, styles[ `is-${ level }` ] );
const Alert: React.FC< AlertProps > = ( {
level = 'warning',
children,
showIcon = true,
className,
} ) => {
const classes = clsx( styles.container, styles[ `is-${ level }` ], className );

return (
<div className={ classes }>
Expand Down
6 changes: 3 additions & 3 deletions components/automattic-byline-logo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import clsx from 'clsx';
import React from 'react';
import { AutomatticBylineLogoProps } from './types';

/**
* Automattic "By line" Logo component.
*
* @param {AutomatticBylineLogoProps} props - Component properties.
* @returns {React.ReactNode} AutomatticBylineLogo component.
* @return {React.ReactNode} AutomatticBylineLogo component.
*/
const AutomatticBylineLogo: React.FC< AutomatticBylineLogoProps > = ( {
title = __( 'An Automattic Airline', 'jetpack' ),
Expand All @@ -24,7 +24,7 @@ const AutomatticBylineLogo: React.FC< AutomatticBylineLogoProps > = ( {
enableBackground="new 0 0 935 38.2"
aria-labelledby="jp-automattic-byline-logo-title"
height={ height }
className={ classnames( 'jp-automattic-byline-logo', className ) }
className={ clsx( 'jp-automattic-byline-logo', className ) }
{ ...otherProps }
>
<desc id="jp-automattic-byline-logo-title">{ title }</desc>
Expand Down
6 changes: 3 additions & 3 deletions components/automattic-for-agencies-logo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import React from 'react';
/**
* Automattic for Agencies Logo component
*
* @param {object} props - Component props
* @param {string} props.color - Color code for the logo text
* @returns {React.ReactElement} Component template
* @param {object} props - Component props
* @param {string} props.color - Color code for the logo text
* @return {React.ReactElement} Component template
*/
export default function AutomatticForAgenciesLogo( {
color = '#FFFFFF',
Expand Down
Loading

0 comments on commit 3f9618b

Please sign in to comment.