import type { Meta, StoryObj } from '@storybook/react-webpack5'; import { userEvent, within } from 'storybook/test'; import { useRtlDiffI18n, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator'; import Field from '../../Field/Field'; import PhoneNumberInput from '..'; export default { component: PhoneNumberInput, title: 'Forms/PhoneNumberInput/Tests/RTL Diff', tags: ['!autodocs', '!manifest'], } satisfies Meta; type Story = StoryObj; export const Sizes: Story = { render: () => ( <> {}} /> {}} /> {}} /> {}} /> ), ...withRTLDiff({ renderAs: 'iframe', fixedRows: { heights: [7, 6, 8] } }), }; export const DropdownOpen: Story = { render: () => { const i18n = useRtlDiffI18n(); return ( {}} /> ); }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const trigger = canvas.queryByRole('combobox'); if (!trigger) return; await userEvent.click(trigger); }, ...withRTLDiff({ renderAs: 'iframe', hAlign: 'center', i18n: { searchPlaceholder: { en: 'Country code', ar: 'رمز الدولة' } }, }), };