- update client and server dependencies within their ranges, keeping all playwright packages aligned at 1.63 - fix code flagged by react-hooks 7.1: refs written during render and synchronous setState in effects - add stories for the ui components that had none, with interaction tests, and cover all DescriptionList layouts - drop the unused mdx stories pattern - run the storybook tests as part of the pre-commit checks - bump version to 1.20.1
59 lines
1.4 KiB
TypeScript
59 lines
1.4 KiB
TypeScript
import React from 'react';
|
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
import { DescriptionList } from '../../src/ui/DescriptionList/DescriptionList';
|
|
|
|
const meta: Meta<typeof DescriptionList> = {
|
|
title: 'UI/DescriptionList',
|
|
component: DescriptionList,
|
|
parameters: { layout: 'centered' },
|
|
tags: ['autodocs'],
|
|
decorators: [
|
|
(Story) => (
|
|
<div style={{ width: 360 }}>
|
|
<Story />
|
|
</div>
|
|
),
|
|
],
|
|
argTypes: {
|
|
layout: { control: 'select', options: ['inline', 'compact', 'comfortable', 'grid'] },
|
|
},
|
|
};
|
|
export default meta;
|
|
type Story = StoryObj<typeof DescriptionList>;
|
|
|
|
const urlItems = [
|
|
{ term: 'ID_URL', detail: 'https://id.example.com/' },
|
|
{ term: 'CABINET_URL', detail: 'https://cabinet.example.com/messages' },
|
|
{ term: 'ADMIN_URL', detail: 'https://admin.example.com/' },
|
|
];
|
|
|
|
export const Inline: Story = {
|
|
args: { items: urlItems, layout: 'inline' },
|
|
};
|
|
|
|
export const Compact: Story = {
|
|
args: { items: urlItems, layout: 'compact' },
|
|
};
|
|
|
|
export const Comfortable: Story = {
|
|
args: { items: urlItems, layout: 'comfortable' },
|
|
};
|
|
|
|
export const Grid: Story = {
|
|
args: { items: urlItems, layout: 'grid' },
|
|
};
|
|
|
|
export const WithLinks: Story = {
|
|
args: {
|
|
layout: 'inline',
|
|
items: urlItems.map(({ term, detail }) => ({
|
|
term,
|
|
detail: (
|
|
<a href={detail as string} target="_blank" rel="noopener noreferrer">
|
|
{detail}
|
|
</a>
|
|
),
|
|
})),
|
|
},
|
|
};
|