Skip to content

Commit

Permalink
Add explicit menu props for better TypeScript perf
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Dec 22, 2024
1 parent 325e244 commit 8df6efe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/components/src/menu/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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 ] =
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 );

Expand Down

0 comments on commit 8df6efe

Please sign in to comment.