import type { Story, Meta } from '@storybook/react'; import { Avatar } from '../avatar'; import type { AvatarProps } from '../types'; export default { component: Avatar, title: 'Avatar', argTypes: { size: { description: 'Set the size of the avatar.', options: ['small', 'medium', 'large', 'xlarge'], control: { type: 'select' }, defaultValue: { summary: 'medium' } }, variant: { options: ['circular', 'rounded', 'square'], control: { type: 'select' }, defaultValue: 'circular' }, customSize: { description: 'Custom avatar size (in pixels, overrides the `size`).', control: { type: 'range', min: 16, max: 104, step: 8, reset: true } }, initials: { description: 'Text to be displayed inside the avatar.' }, backgroundColor: { description: 'Background color of the avatar.', control: { type: 'color' } }, color: { description: 'Color of the initials and icons.', control: { type: 'color' } }, src: { description: 'Avatar img to be displayed in case `emailVerified` is `true`.' }, emailVerified: { description: 'Whether to show pending icon or different props (deprecated, use the CustomIcon instead).', table: { defaultValue: { summary: true } } }, icon: { description: 'Icon to be displayed in case no image was supplied' }, className: { description: 'Custom class name in case you need to add custom styles to the component.' } } } as Meta; const Template: Story = args => { return ; }; export const Primary = Template.bind({}); Primary.args = { size: 'medium', initials: '', backgroundColor: '#F2F7FF', color: '#546491', emailVerified: true, src: 'https://i.pinimg.com/originals/e5/a9/e8/e5a9e877bcacdc5713d2a8f98412762d.png', icon: { src: '' }, style: {}, customSize: 0 }; export const UserInitials = Template.bind({}); UserInitials.args = { size: 'medium', initials: 'JK', backgroundColor: '#990099', color: '#FFFFFF', emailVerified: true, style: {} }; export const CustomStyle = Template.bind({}); CustomStyle.args = { size: 'xlarge', initials: 'DK', backgroundColor: '#CB5BCB', color: '#FFFFFF', src: '', emailVerified: true, style: { border: '12px solid #F2F7FF', width: '128px', height: '128px' } };