Skip to content

Commit da8b47d

Browse files
committed
[wordpress__edit-post] Use latest @wordpress/components types
1 parent 55dbe81 commit da8b47d

9 files changed

Lines changed: 19 additions & 19 deletions

types/wordpress__edit-post/components/block-settings-menu/plugin-block-settings-menu-item.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Dashicon } from "@wordpress/components";
2-
import { ComponentType, JSX, MouseEventHandler } from "react";
2+
import { ComponentProps, ComponentType, JSX, MouseEventHandler } from "react";
33

44
declare namespace PluginBlockSettingsMenuItem {
55
interface Props {
@@ -13,7 +13,7 @@ declare namespace PluginBlockSettingsMenuItem {
1313
* A dashicon slug, or a custom JSX element.
1414
* @defaultValue `"admin-plugins"`
1515
*/
16-
icon?: JSX.Element | Dashicon.Icon | undefined;
16+
icon?: JSX.Element | ComponentProps<typeof Dashicon>["icon"] | undefined;
1717
/**
1818
* The menu item text.
1919
*/

types/wordpress__edit-post/components/header/plugin-more-menu-item.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Dashicon, MenuItem } from "@wordpress/components";
2-
import { ComponentType, JSX, ReactNode } from "react";
2+
import { ComponentProps, ComponentType, JSX, ReactNode } from "react";
33

44
declare namespace PluginMoreMenuItem {
5-
interface Props extends Omit<MenuItem.Props, "href"> {
5+
interface Props extends Omit<ComponentProps<typeof MenuItem>, "href" | "icon"> {
66
children: ReactNode;
77
/**
88
* When `href` is provided then the menu item is represented as an anchor rather than
@@ -13,7 +13,7 @@ declare namespace PluginMoreMenuItem {
1313
* A Dashicon slug or a custom JSX element to be rendered to the left of the menu item
1414
* label.
1515
*/
16-
icon?: Dashicon.Icon | JSX.Element | undefined;
16+
icon?: ComponentProps<typeof Dashicon>["icon"] | JSX.Element | undefined;
1717
/**
1818
* The callback function to be executed when the user clicks the menu item.
1919
*/

types/wordpress__edit-post/components/header/plugin-sidebar-more-menu-item.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Dashicon } from "@wordpress/components";
2-
import { ComponentType, JSX, ReactNode } from "react";
2+
import { ComponentProps, ComponentType, JSX, ReactNode } from "react";
33

44
declare namespace PluginSidebarMoreMenuItem {
55
interface Props {
@@ -13,7 +13,7 @@ declare namespace PluginSidebarMoreMenuItem {
1313
* A Dashicon slug or a custom JSX element to be rendered to the left of the menu item
1414
* label.
1515
*/
16-
icon?: Dashicon.Icon | JSX.Element | undefined;
16+
icon?: ComponentProps<typeof Dashicon>["icon"] | JSX.Element | undefined;
1717
}
1818
}
1919

types/wordpress__edit-post/components/sidebar/plugin-document-setting-panel.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Dashicon, Slot } from "@wordpress/components";
2-
import { FC, JSX, ReactNode } from "react";
2+
import { ComponentProps, FC, JSX, ReactNode } from "react";
33

44
declare namespace PluginDocumentSettingPanel {
55
interface Props {
@@ -20,7 +20,7 @@ declare namespace PluginDocumentSettingPanel {
2020
* A Dashicon slug or a custom JSX element to be rendered when the sidebar is pinned to
2121
* toolbar.
2222
*/
23-
icon?: Dashicon.Icon | JSX.Element | undefined;
23+
icon?: ComponentProps<typeof Dashicon>["icon"] | JSX.Element | undefined;
2424
}
2525
}
2626

@@ -43,7 +43,7 @@ declare namespace PluginDocumentSettingPanel {
4343
*/
4444
declare const PluginDocumentSettingPanel: {
4545
(props: PluginDocumentSettingPanel.Props): JSX.Element;
46-
Slot: FC<Omit<Slot.Props, "name">>;
46+
Slot: FC<Omit<ComponentProps<typeof Slot>, "name">>;
4747
};
4848

4949
export default PluginDocumentSettingPanel;

types/wordpress__edit-post/components/sidebar/plugin-post-publish-panel.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Slot } from "@wordpress/components";
2-
import { FC, JSX, ReactNode } from "react";
2+
import { ComponentProps, FC, JSX, ReactNode } from "react";
33

44
declare namespace PluginPostPublishPanel {
55
interface Props {
@@ -42,7 +42,7 @@ declare namespace PluginPostPublishPanel {
4242
*/
4343
declare const PluginPostPublishPanel: {
4444
(props: PluginPostPublishPanel.Props): JSX.Element;
45-
Slot: FC<Omit<Slot.Props, "name">>;
45+
Slot: FC<Omit<ComponentProps<typeof Slot>, "name">>;
4646
};
4747

4848
export default PluginPostPublishPanel;

types/wordpress__edit-post/components/sidebar/plugin-post-status-info.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Slot } from "@wordpress/components";
2-
import { FC, JSX, ReactNode } from "react";
2+
import { ComponentProps, FC, JSX, ReactNode } from "react";
33

44
declare namespace PluginPostStatusInfo {
55
interface Props {
@@ -29,7 +29,7 @@ declare namespace PluginPostStatusInfo {
2929
*/
3030
declare const PluginPostStatusInfo: {
3131
(props: PluginPostStatusInfo.Props): JSX.Element;
32-
Slot: FC<Omit<Slot.Props, "name">>;
32+
Slot: FC<Omit<ComponentProps<typeof Slot>, "name">>;
3333
};
3434

3535
export default PluginPostStatusInfo;

types/wordpress__edit-post/components/sidebar/plugin-pre-publish-panel.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Slot } from "@wordpress/components";
2-
import { FC, JSX, ReactNode } from "react";
2+
import { ComponentProps, FC, JSX, ReactNode } from "react";
33

44
declare namespace PluginPrePublishPanel {
55
interface Props {
@@ -42,7 +42,7 @@ declare namespace PluginPrePublishPanel {
4242
*/
4343
declare const PluginPrePublishPanel: {
4444
(props: PluginPrePublishPanel.Props): JSX.Element;
45-
Slot: FC<Omit<Slot.Props, "name">>;
45+
Slot: FC<Omit<ComponentProps<typeof Slot>, "name">>;
4646
};
4747

4848
export default PluginPrePublishPanel;

types/wordpress__edit-post/components/sidebar/plugin-sidebar.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Dashicon } from "@wordpress/components";
2-
import { ComponentType, JSX, ReactNode } from "react";
2+
import { ComponentProps, ComponentType, JSX, ReactNode } from "react";
33

44
declare namespace PluginSidebar {
55
interface Props {
@@ -12,7 +12,7 @@ declare namespace PluginSidebar {
1212
* A Dashicon slug or a custom JSX element to be rendered when the sidebar is pinned to
1313
* toolbar.
1414
*/
15-
icon?: Dashicon.Icon | JSX.Element | undefined;
15+
icon?: ComponentProps<typeof Dashicon>["icon"] | JSX.Element | undefined;
1616
/**
1717
* Whether to allow to pin sidebar to toolbar.
1818
* @defaultValue `true`

types/wordpress__edit-post/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"dependencies": {
99
"@types/react": "*",
10-
"@types/wordpress__components": "*",
10+
"@wordpress/components": "^27.3.0",
1111
"@wordpress/data": "^9.13.0",
1212
"@wordpress/element": "^5.0.0"
1313
},

0 commit comments

Comments
 (0)