Skip to content

Commit 7355a95

Browse files
committed
refactor ToggleButton prop description + story
1 parent 1fbf61b commit 7355a95

File tree

3 files changed

+55
-35
lines changed

3 files changed

+55
-35
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import {ArgsTable, Canvas, Meta, Story} from '@storybook/addon-docs/blocks';
2+
import {ToggleButton} from '@ui5/webcomponents-react/lib/ToggleButton';
3+
import {ButtonDesign} from '@ui5/webcomponents-react/lib/ButtonDesign';
4+
import '@ui5/webcomponents-icons/dist/icons/employee.js';
5+
import {CSSProperties} from 'react';
6+
7+
import {createSelectArgTypes} from '@shared/stories/createSelectArgTypes';
8+
import {DocsHeader} from '@shared/stories/DocsHeader';
9+
10+
<Meta
11+
title="UI5 Web Components / ToggleButton"
12+
component={ToggleButton}
13+
argTypes={{
14+
...createSelectArgTypes({design: ButtonDesign}),
15+
children: {control: 'text'},
16+
slot: {control: {disable: true}},
17+
ref: {control: {disable: true}},
18+
style: {
19+
type: CSSProperties,
20+
description:
21+
'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.'
22+
},
23+
className: {
24+
type: 'string',
25+
description:
26+
'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.'
27+
},
28+
tooltip: {type: 'string', description: 'A tooltip which will be shown on hover'}
29+
}}
30+
args={{
31+
design: ButtonDesign.Default,
32+
icon: 'employee',
33+
children: 'ToggleButton Text',
34+
style: {},
35+
className: '',
36+
tooltip: '',
37+
slot: '',
38+
ref: null
39+
}}
40+
/>
41+
42+
<DocsHeader/>
43+
44+
<Canvas>
45+
<Story name="Default">
46+
{(args) => {
47+
return <ToggleButton {...args} />;
48+
}}
49+
</Story>
50+
</Canvas>
51+
52+
<ArgsTable story="."/>

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

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

packages/main/src/webComponents/ToggleButton/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ export interface ToggleButtonPropTypes extends Omit<WithWebComponentPropTypes, '
1717
*/
1818
disabled?: boolean;
1919
/**
20-
* Defines the icon to be displayed as graphical element within the <code>Button</code>. The SAP-icons font provides numerous options. <br><br> Example: <br> <pre>ui5-button icon="palette"</pre><br/><br/>
20+
* Defines the icon to be displayed as graphical element within the <code>Button</code>. The SAP-icons font provides numerous options.
21+
*
22+
* <b>Note:</b> You should import the desired icon first, then use its name as "icon".<br><code>import "@ui5/webcomponents-icons/dist/icons/{icon_name}.js"</code>
2123
*
2224
* See all the available icons in the <ui5-link target="_blank" href="https://openui5.hana.ondemand.com/test-resources/sap/m/demokit/iconExplorer/webapp/index.html" class="api-table-content-cell-link">Icon Explorer</ui5-link>.
2325
*/

0 commit comments

Comments
 (0)