All files / Breadcrumb Breadcrumb.stories.tsx

100% Statements 6/6
100% Branches 0/0
100% Functions 2/2
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69                                      1x 1x   1x                               1x 1x   1x                                                      
import React from 'react';
import { Meta, Story } from '@storybook/react';
 
import Breadcrumb, { IBreadcrumbProps } from './Breadcrumb';
import NotchedTag from '../NotchedTag/NotchedTag';
 
export default {
	title: 'Navigation/Breadcrumb',
	component: Breadcrumb,
	parameters: {
		docs: {
			description: {
				component: Breadcrumb.peek.description,
			},
		},
	},
} as Meta;
 
/* Basic */
export const Basic: Story<IBreadcrumbProps> = (args) => {
	const { Item } = Breadcrumb;
 
	return (
		<Breadcrumb {...args}>
			<Item key='home'>
				<a href='#'>Start</a>
			</Item>
			<Item key='list'>
				<a href='#'>List</a>
			</Item>
			<Item key='item'>
				<a href='#'>Item</a>
			</Item>
		</Breadcrumb>
	);
};
 
/* Rich */
export const Rich: Story<IBreadcrumbProps> = (args) => {
	const { Item } = Breadcrumb;
 
	return (
		<Breadcrumb {...args}>
			<Item key='home'>
				<a href='#'>
					<NotchedTag type='stroke' size='small' tagStyle='style-two'>
						IO
					</NotchedTag>
					<span>
						<span>Foo</span>
						<span style={{ fontWeight: 400 }}>&nbsp;(1234)</span>
					</span>
				</a>
			</Item>
			<Item key='list'>
				<a href='#'>
					<NotchedTag type='filled' size='small' tagStyle='style-three'>
						LI
					</NotchedTag>
					<span>
						<span>Bar</span>
						<span style={{ fontWeight: 400 }}>&nbsp;(1234)</span>
					</span>
				</a>
			</Item>
		</Breadcrumb>
	);
};