From 0401a75cd2e892aed9babbc2e9975d0b06228056 Mon Sep 17 00:00:00 2001 From: chad1008 <13856531+chad1008@users.noreply.github.com> Date: Tue, 7 Feb 2023 11:42:02 -0500 Subject: [PATCH 01/24] Rename to `.tsx` and remove `@ts-nocheck` --- .../src/circular-option-picker/{index.js => index.tsx} | 1 - 1 file changed, 1 deletion(-) rename packages/components/src/circular-option-picker/{index.js => index.tsx} (99%) diff --git a/packages/components/src/circular-option-picker/index.js b/packages/components/src/circular-option-picker/index.tsx similarity index 99% rename from packages/components/src/circular-option-picker/index.js rename to packages/components/src/circular-option-picker/index.tsx index f41813906fcab..14fddb98cf08c 100644 --- a/packages/components/src/circular-option-picker/index.js +++ b/packages/components/src/circular-option-picker/index.tsx @@ -1,4 +1,3 @@ -// @ts-nocheck /** * External dependencies */ From d184d7b55f544a20e9248c46144fa518d1e7a326 Mon Sep 17 00:00:00 2001 From: chad1008 <13856531+chad1008@users.noreply.github.com> Date: Wed, 8 Feb 2023 11:10:56 -0500 Subject: [PATCH 02/24] Add `types.ts` file --- packages/components/src/circular-option-picker/types.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/components/src/circular-option-picker/types.ts diff --git a/packages/components/src/circular-option-picker/types.ts b/packages/components/src/circular-option-picker/types.ts new file mode 100644 index 0000000000000..e69de29bb2d1d From fd9dd87e4d5a2e61248f51bf9e815a0326cc8341 Mon Sep 17 00:00:00 2001 From: chad1008 <13856531+chad1008@users.noreply.github.com> Date: Wed, 8 Feb 2023 11:11:31 -0500 Subject: [PATCH 03/24] Add `CircularOptionPickerProps` --- .../src/circular-option-picker/index.tsx | 5 +++- .../src/circular-option-picker/types.ts | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/packages/components/src/circular-option-picker/index.tsx b/packages/components/src/circular-option-picker/index.tsx index 14fddb98cf08c..caf1a9fc08209 100644 --- a/packages/components/src/circular-option-picker/index.tsx +++ b/packages/components/src/circular-option-picker/index.tsx @@ -14,6 +14,7 @@ import { Icon, check } from '@wordpress/icons'; import Button from '../button'; import Dropdown from '../dropdown'; import Tooltip from '../tooltip'; +import type { CircularOptionPickerProps } from './types'; function Option( props ) { const { @@ -92,7 +93,9 @@ function ButtonAction( props ) { ); } -export default function CircularOptionPicker( props ) { +export default function CircularOptionPicker( + props: CircularOptionPickerProps +) { const { actions, className, options, children } = props; return (
Date: Wed, 8 Feb 2023 11:54:14 -0500 Subject: [PATCH 04/24] Add `ButtonAction` typing --- packages/components/src/circular-option-picker/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/components/src/circular-option-picker/index.tsx b/packages/components/src/circular-option-picker/index.tsx index caf1a9fc08209..239c4d1a13c8a 100644 --- a/packages/components/src/circular-option-picker/index.tsx +++ b/packages/components/src/circular-option-picker/index.tsx @@ -15,6 +15,8 @@ import Button from '../button'; import Dropdown from '../dropdown'; import Tooltip from '../tooltip'; import type { CircularOptionPickerProps } from './types'; +import type { WordPressComponentProps } from '../ui/context'; +import type { ButtonAsButtonProps } from '../button/types'; function Option( props ) { const { @@ -77,8 +79,11 @@ function DropdownLinkAction( props ) { ); } -function ButtonAction( props ) { - const { className, children, ...additionalProps } = props; +function ButtonAction( { + className, + children, + ...additionalProps +}: WordPressComponentProps< ButtonAsButtonProps, 'button', false > ) { return (