From 8df6efee994af5e328d8684d9ba623bf248cd125 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Fri, 20 Dec 2024 17:26:18 +0100 Subject: [PATCH] Add explicit menu props for better TypeScript perf --- packages/components/src/menu/stories/index.story.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/components/src/menu/stories/index.story.tsx b/packages/components/src/menu/stories/index.story.tsx index 384fd67693348..7796b41c3003f 100644 --- a/packages/components/src/menu/stories/index.story.tsx +++ b/packages/components/src/menu/stories/index.story.tsx @@ -20,6 +20,7 @@ import Button from '../../button'; import Modal from '../../modal'; import { createSlotFill, Provider as SlotFillProvider } from '../../slot-fill'; import { ContextSystemProvider } from '../../context'; +import type { MenuProps } from '../types'; const meta = { id: 'components-experimental-menu', @@ -183,7 +184,7 @@ export const WithSubmenu: Story = { }; export const WithCheckboxes: Story = { - render: function WithCheckboxes( props ) { + render: function WithCheckboxes( props: MenuProps ) { const [ isAChecked, setAChecked ] = useState( false ); const [ isBChecked, setBChecked ] = useState( true ); const [ multipleCheckboxesValue, setMultipleCheckboxesValue ] = @@ -329,7 +330,7 @@ export const WithCheckboxes: Story = { }; export const WithRadios: Story = { - render: function WithRadios( props ) { + render: function WithRadios( props: MenuProps ) { const [ radioValue, setRadioValue ] = useState( 'two' ); const onRadioChange: React.ComponentProps< typeof Menu.RadioItem @@ -404,7 +405,7 @@ const modalOnTopOfMenuPopover = css` // For more examples with `Modal`, check https://ariakit.org/examples/menu-wordpress-modal export const WithModals: Story = { - render: function WithModals( props ) { + render: function WithModals( props: MenuProps ) { const [ isOuterModalOpen, setOuterModalOpen ] = useState( false ); const [ isInnerModalOpen, setInnerModalOpen ] = useState( false );