// =============================================================================
// The two Figma media variants
// =============================================================================
export const WithImage: Story = {
args: {
title: 'Card Title',
description: 'Card Description',
imageSrc: AVATAR_SRC,
imageAlt: 'Acme Corp',
status: { label: 'Status' },
menuGroups: SAMPLE_MENU,
},
}
export const WithIcon: Story = {
args: {
title: 'Card Title',
description: 'Card Description',
icon: ,
status: { label: 'Status' },
menuGroups: SAMPLE_MENU,
},
}
// =============================================================================
// Optional-element permutations
// =============================================================================
export const WithoutStatus: Story = {
args: {
title: 'Card Title',
description: 'Card Description',
icon: ,
menuGroups: SAMPLE_MENU,
},
}
export const WithoutDescription: Story = {
args: {
title: 'Card Title',
imageSrc: AVATAR_SRC,
imageAlt: 'Acme Corp',
status: { label: 'Status' },
menuGroups: SAMPLE_MENU,
},
}
export const WithoutMenu: Story = {
args: {
title: 'Card Title',
description: 'Card Description',
icon: ,
status: { label: 'Status' },
},
}
export const Clickable: Story = {
args: {
title: 'Card Title',
description: 'Click anywhere on the row',
imageSrc: AVATAR_SRC,
imageAlt: 'Acme Corp',
status: { label: 'Online' },
menuGroups: SAMPLE_MENU,
onClick: () => {
// eslint-disable-next-line no-console
console.log('[story] card clicked')
},
},
}
export const StatusVariants: Story = {
parameters: {
docs: {
description: {
story:
'The `status.variant` maps to the shared `Tag` palette — `success` (default), `warning`, `error`, `grey`.',
},
},
},
render: () => (
}
status={{ label: 'Online', variant: 'success' }}
menuGroups={SAMPLE_MENU}
/>
}
status={{ label: 'Degraded', variant: 'warning' }}
menuGroups={SAMPLE_MENU}
/>
}
status={{ label: 'Offline', variant: 'error' }}
menuGroups={SAMPLE_MENU}
/>
}
status={{ label: 'Archived', variant: 'grey' }}
menuGroups={SAMPLE_MENU}
/>
),
}
export const LongContentTruncates: Story = {
args: {
title: 'Some Really Long Card Title That Should Truncate Cleanly Without Wrapping',
description:
'An equally long description line that also truncates instead of pushing the status pill and overflow menu off the card',
imageSrc: AVATAR_SRC,
imageAlt: 'Acme Corp',
status: { label: 'Status' },
menuGroups: SAMPLE_MENU,
},
}