import type { Meta, StoryObj } from '@storybook/react-webpack5'; import { Search } from '@transferwise/icons'; import { useRef, useState } from 'react'; import { Button } from '..'; import { Field } from '../field/Field'; import { Input } from './Input'; import { Flag } from '@wise/art'; import { InputGroup } from './InputGroup'; import AvatarView from '../avatarView'; import PhoneNumberInput from '../phoneNumberInput'; export default { component: InputGroup, title: 'Forms/InputGroup', } satisfies Meta; type Story = StoryObj; export const WithPrefix: Story = { render: (args) => , args: { disabled: false, }, }; function InputGroupWithPrefix(args: NonNullable) { return ( , initialContentWidth: 24, }} > ); } export const WithSuffix: Story = { render: (args) => , args: { disabled: false, }, decorators: [ (Story) => ( ), ], }; function InputGroupWithSuffix(args: NonNullable) { const ref = useRef(null); const [value, setValue] = useState('Text value'); return ( { await navigator.clipboard.writeText(value); if (ref.current != null) { ref.current.focus({ preventScroll: true }); ref.current.select(); } }} > Copy ), interactive: true, padding: 'sm', }} > setValue(event.currentTarget.value)} /> ); } export const PhoneNumberWithPrefix: Story = { render: (args) => , args: { disabled: false, }, }; function PhoneNumberInputGroupWithPrefix(args: NonNullable) { return ( ), }} > {}} /> ); }