import type { Meta, StoryObj } from '@storybook/react-vite'; import { IconEye, IconEyeOff, IconSearch } from '@tabler/icons-react'; import * as React from 'react'; import { type ComponentMatrixCellProps, Story } from './_internal/Story'; import { Button } from './Button'; import { InputGroup } from './InputGroup'; const meta = { component: InputGroup, parameters: { layout: 'fullscreen', }, title: 'components/InputGroup', } satisfies Meta; export default meta; type StoryDefinition = StoryObj; const STATE_COLUMNS = [ { key: 'default', label: 'Default' }, { key: 'disabled', label: 'Disabled' }, { key: 'invalid', label: 'Invalid' }, ]; const PATTERN_ROWS = [ { description: 'Leading icon addon', key: 'search', label: 'Search', }, { description: 'Trailing visibility toggle', key: 'password', label: 'Password', }, { description: 'Leading text addon', key: 'currency', label: 'Currency', }, { description: 'Trailing text addon', key: 'domain', label: 'Domain', }, ]; function InputGroupMatrixCell({ column, row }: ComponentMatrixCellProps) { const inputProps = { 'aria-invalid': column.key === 'invalid' || undefined, disabled: column.key === 'disabled', }; if (row.key === 'search') { return ( ); } if (row.key === 'password') { return ( ); } if (row.key === 'currency') { return ( $ ); } if (row.key === 'domain') { return ( .dev ); } return null; } function PasswordInputGroupCell({ disabled, invalid, }: { disabled?: boolean; invalid?: boolean; }) { const [showPassword, setShowPassword] = React.useState(false); return ( ); } export const All: StoryDefinition = { render: () => ( ), };