import type { Meta, StoryObj } from '@storybook/react-vite' import { Person } from './Person' /** A face beside a name — never a key. */ const meta = { title: 'Components/Person', component: Person, args: { name: 'Ana Duarte', size: 20 }, } satisfies Meta export default meta type Story = StoryObj export const Named: Story = {} /** With their picture — here an inline SVG, as Avatar's own story uses, so the story needs nothing from anywhere. */ export const WithPicture: Story = { args: { picture: 'data:image/svg+xml;utf8,', }, } /** Nobody has published a name: the silhouette and the em dash, muted — the same mark a property with no value uses. */ export const Unnamed: Story = { args: { name: undefined }, } /** Where the unnamed person is *you*, pass a word instead of the dash. */ export const OwnFallback: Story = { args: { name: undefined, fallback: 'Anonymous' }, // axe color-contrast is off here until PLAN.md stage 0.10 is ruled: // the fallback name is muted text, 3.94:1 on --bg-base in signal (AA 4.5:1). parameters: { a11y: { config: { rules: [{ id: 'color-contrast', enabled: false }] } } }, } /** The text size is where it sits: the box around it sets the words, `size` sets the face. */ export const Sizes: Story = { parameters: { controls: { disable: true } }, render: () => (
), } /** A narrow spot: the name truncates, the face never does. */ export const Truncating: Story = { decorators: [(Story) =>
], args: { name: 'Ana Duarte de Almeida e Costa' }, }