Skip to content

Commit 1fbf61b

Browse files
committed
refactor Title story
1 parent b98892b commit 1fbf61b

File tree

2 files changed

+50
-26
lines changed

2 files changed

+50
-26
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
2+
import { Title } from '@ui5/webcomponents-react/lib/Title';
3+
import { TitleLevel } from '@ui5/webcomponents-react/lib/TitleLevel';
4+
import { CSSProperties, Ref } from 'react';
5+
6+
import { createSelectArgTypes } from '@shared/stories/createSelectArgTypes';
7+
import { DocsHeader } from '@shared/stories/DocsHeader';
8+
9+
<Meta
10+
title="UI5 Web Components / Title"
11+
component={Title}
12+
argTypes={{
13+
...createSelectArgTypes({ level: TitleLevel }),
14+
children: { control: 'text' },
15+
slot: { control: { disable: true } },
16+
ref: { control: { disable: true } },
17+
style: {
18+
type: CSSProperties,
19+
description:
20+
'Element style which will be appended to the most outer element of a component. Use this prop carefully, some css properties might break the component.'
21+
},
22+
className: {
23+
type: 'string',
24+
description:
25+
'CSS Class Name which will be appended to the most outer element of a component. Use this prop carefully, overwriting CSS rules might break the component.'
26+
},
27+
tooltip: { type: 'string', description: 'A tooltip which will be shown on hover' }
28+
}}
29+
args={{
30+
level: TitleLevel.H2,
31+
children: 'Title Text',
32+
style: {},
33+
className: '',
34+
tooltip: '',
35+
slot: '',
36+
ref: null
37+
}}
38+
/>
39+
40+
<DocsHeader />
41+
42+
<Canvas>
43+
<Story name="Default">
44+
{(args) => {
45+
return <Title {...args} />;
46+
}}
47+
</Story>
48+
</Canvas>
49+
50+
<ArgsTable story="." />

packages/main/src/webComponents/Title/Title.stories.tsx

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)