= async ({ canvasElement, step }) => {
await step('titles and values stay inside separate shared columns', async () => {
await assertSharedColumnBoundary(canvasElement);
});
};
export const HORIZONTAL_RIGHT_ALIGNED: Story = {
name: 'HORIZONTAL_RIGHT_ALIGNED',
render: () => (
),
play: verifySharedColumnBoundary,
};
const layouts: DefinitionListLayout[] = [
'VERTICAL_TWO_COLUMN',
'VERTICAL_ONE_COLUMN',
'HORIZONTAL_JUSTIFIED',
'HORIZONTAL_LEFT_ALIGNED',
'HORIZONTAL_RIGHT_ALIGNED',
];
export const RTLDiff: Story = {
render: () => {
const i18n = useRtlDiffI18n();
const rtlDefinitions: DefinitionListDefinition[] = [
{ key: 'name', title: i18n.fullName, value: i18n.customerName },
{ key: 'amount', title: i18n.amountSent, value: i18n.amountValue },
{ key: 'status', title: i18n.transferStatus, value: i18n.statusValue },
];
const rtlDefinitionsWithAction: DefinitionListDefinition[] = [
{ key: 'name', title: i18n.fullName, value: i18n.customerName },
{
key: 'amount',
title: i18n.amountSent,
value: i18n.amountValue,
action: { label: i18n.editAction },
},
{
key: 'status',
title: i18n.transferStatus,
value: i18n.statusValue,
action: { label: i18n.viewDetailsAction },
},
];
return (
{layouts.map((layout) => (
))}
{layouts.map((layout) => (
{layout} {i18n.withActionButtons}
))}
);
},
...withRTLDiff({
fixedRows: { heights: 'auto' },
i18n: {
fullName: { en: 'Full name', ar: 'الاسم الكامل' },
customerName: { en: 'Alice Smith', ar: 'أليس سميث' },
amountSent: { en: 'Amount sent', ar: 'المبلغ المُرسل' },
amountValue: { en: '1,234.56 GBP', ar: '1,234.56 جنيه إسترليني' },
transferStatus: { en: 'Transfer status', ar: 'حالة التحويل' },
statusValue: { en: 'Completed successfully', ar: 'اكتمل بنجاح' },
editAction: { en: 'Edit', ar: 'تعديل' },
viewDetailsAction: { en: 'View details', ar: 'عرض التفاصيل' },
withActionButtons: { en: 'with action buttons', ar: 'مع أزرار الإجراءات' },
},
}),
};