import { Meta, StoryObj } from '@storybook/react-webpack5';
import { Flag } from '@wise/art';
import { lorem10 } from '../../test-utils';
import { ListItem } from '../ListItem';
import List from '../../list';
import {
SB_LIST_ITEM_ADDITIONAL_INFO as INFO,
SB_LIST_ITEM_CONTROLS as CONTROLS,
} from '../_stories/subcomponents';
import { disableControls } from '../_stories/helpers';
import type { ListItemAvatarLayoutProps } from './ListItemAvatarLayout';
export default {
component: ListItem.AvatarLayout,
title: 'Content/ListItem/ListItem.AvatarLayout',
args: {
avatars: [{ asset: }, { asset: }],
orientation: 'horizontal',
size: 48,
},
argTypes: {
avatars: {
description: 'Array of avatar objects with asset and optional styling properties',
table: {
type: { summary: 'SingleAvatarType[]' },
},
},
orientation: {
control: 'inline-radio',
options: ['horizontal', 'diagonal'],
description: 'Layout orientation for multiple avatars',
},
size: {
control: 'select',
options: [24, 32, 40, 48, 56, 72],
description: 'Size of the avatar layout',
},
},
} satisfies Meta;
type Story = StoryObj;
export const Playground: Story = {
render: (args: ListItemAvatarLayoutProps) => {
return (
}
control={CONTROLS.iconButton}
additionalInfo={INFO.nonInteractive}
/>
);
},
};
/**
* AvatarLayout supports two orientations: horizontal (default) and diagonal.
* Please refer to the [design documentation](https://wise.design/components/avatar#double) for more details.
*/
export const Orientations: Story = {
argTypes: disableControls()(['orientation']),
render: (args) => {
return (
}
control={CONTROLS.iconButton}
/>
}
control={CONTROLS.iconButton}
/>
);
},
};
/**
* AvatarLayout supports various sizes to fit different list item contexts.
*/
export const Sizes: Story = {
parameters: {
docs: {
canvas: {
sourceState: 'hidden',
},
},
},
argTypes: disableControls()(['size', 'orientation']),
render: (args) => {
const sizes = [24, 32, 40, 48, 56, 72] as const;
const orientations = ['horizontal', 'diagonal'] as const;
return (
{orientations.map((orientation) =>
sizes.map((size) => (
}
control={CONTROLS.iconButton}
/>
)),
)}
);
},
};