import type { Meta, StoryObj } from '@storybook/react'; import { Search } from './search'; import React, { useState } from 'react'; const meta: Meta = { title: 'UI/Search', component: Search, render: args => , argTypes: { placeholder: { control: 'text' }, size: { control: 'select', options: ['sm', 'md', 'lg'], description: 'Size variant — matches Input sizing scale.', }, }, }; export default meta; type Story = StoryObj; export const Default: Story = { args: { placeholder: 'Search for anything...', }, render: args => { const [query, setQuery] = useState(''); return (
setQuery(e.target.value)} onClear={() => setQuery('')} />
); }, }; /** * Small size variant (h-8, 32px) — compact for toolbars and dense UIs. */ export const Small: Story = { args: { placeholder: 'Search...', size: 'sm', }, render: args => { const [query, setQuery] = useState(''); return (
setQuery(e.target.value)} onClear={() => setQuery('')} />
); }, }; /** * Large size variant (h-12, 48px) — prominent search fields. */ export const Large: Story = { args: { placeholder: 'Search documents, users, and more...', size: 'lg', }, render: args => { const [query, setQuery] = useState(''); return (
setQuery(e.target.value)} onClear={() => setQuery('')} />
); }, }; /** * Size comparison: sm, md (default), lg. */ export const Sizes: Story = { render: () => (

Small (sm)

Medium (md — default)

Large (lg)

), };