- add Timestamp component with moment relative time and ISO tooltip - add Timestamp stories (JustNow, MinutesAgo, HoursAgo, DaysAgo, MonthsAgo) - add ESLint 10 with typescript-eslint, react-hooks, react-refresh, prettier - add Prettier config with singleQuote, semi, trailingComma all, printWidth 100 - add lint, lint:fix, format, test:storybook scripts to package.json - fix react-hooks/set-state-in-effect in all page components - auto-fix 113 Prettier formatting issues across src and .storybook
46 lines
989 B
TypeScript
46 lines
989 B
TypeScript
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
import { Breadcrumbs } from '../../src/ui/Breadcrumbs/Breadcrumbs';
|
|
|
|
const meta: Meta<typeof Breadcrumbs> = {
|
|
title: 'UI/Breadcrumbs',
|
|
component: Breadcrumbs,
|
|
parameters: { layout: 'centered' },
|
|
tags: ['autodocs'],
|
|
};
|
|
export default meta;
|
|
type Story = StoryObj<typeof Breadcrumbs>;
|
|
|
|
export const Default: Story = {
|
|
args: {
|
|
items: [{ label: 'Scenarios', href: '#' }, { label: 'Login flow' }],
|
|
},
|
|
};
|
|
|
|
export const Deep: Story = {
|
|
args: {
|
|
items: [
|
|
{ label: 'Home', href: '#' },
|
|
{ label: 'Scenarios', href: '#' },
|
|
{ label: 'Login flow', href: '#' },
|
|
{ label: 'Step 3' },
|
|
],
|
|
},
|
|
};
|
|
|
|
export const SingleItem: Story = {
|
|
args: {
|
|
items: [{ label: 'Dashboard' }],
|
|
},
|
|
};
|
|
|
|
export const CustomSeparator: Story = {
|
|
args: {
|
|
separator: '/',
|
|
items: [
|
|
{ label: 'Environments', href: '#' },
|
|
{ label: 'Staging', href: '#' },
|
|
{ label: 'Config' },
|
|
],
|
|
},
|
|
};
|