Skip to content

Commit 1106f34

Browse files
committed
Card and Carousel
1 parent c362a84 commit 1106f34

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { action } from '@storybook/addon-actions';
2-
import { boolean, text } from '@storybook/addon-knobs';
31
import '@ui5/webcomponents-icons/dist/icons/person-placeholder.js';
42
import { Avatar } from '@ui5/webcomponents-react/lib/Avatar';
53
import { AvatarBackgroundColor } from '@ui5/webcomponents-react/lib/AvatarBackgroundColor';
@@ -10,18 +8,23 @@ import React from 'react';
108

119
export default {
1210
title: 'UI5 Web Components / Card',
13-
component: Card
11+
component: Card,
12+
args: {
13+
heading: 'Team Space',
14+
status: '3 of 5',
15+
subheading: 'Direct Reports'
16+
}
1417
};
1518

16-
export const generatedDefaultStory = () => (
19+
export const generatedDefaultStory = (props) => (
1720
<Card
18-
headerInteractive={boolean('headerInteractive', false)}
19-
heading={text('heading', 'Team Space')}
20-
status={text('status', '3 of 5')}
21-
subheading={text('subheading', 'Direct Reports')}
2221
avatar={<Avatar backgroundColor={AvatarBackgroundColor.Accent3} icon="person-placeholder" />}
23-
onHeaderClick={action('onHeaderClick')}
2422
style={{ width: '300px' }}
23+
headerInteractive={props.headerInteractive}
24+
heading={props.heading}
25+
status={props.status}
26+
subheading={props.subheading}
27+
onHeaderClick={props.onHeaderClick}
2528
>
2629
<List>
2730
<StandardListItem description="Software Architect">Richard Wilson</StandardListItem>

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

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
1-
import { action } from '@storybook/addon-actions';
2-
import { boolean, number, select } from '@storybook/addon-knobs';
1+
import { createSelectArgTypes } from '@shared/stories/createSelectArgTypes';
32
import { ThemingParameters } from '@ui5/webcomponents-react-base/lib/ThemingParameters';
43
import { Carousel } from '@ui5/webcomponents-react/lib/Carousel';
54
import { CarouselArrowsPlacement } from '@ui5/webcomponents-react/lib/CarouselArrowsPlacement';
65
import React from 'react';
76

87
export default {
98
title: 'UI5 Web Components / Carousel',
10-
component: Carousel
9+
component: Carousel,
10+
argTypes: {
11+
...createSelectArgTypes({ arrowsPlacement: CarouselArrowsPlacement })
12+
},
13+
args: {
14+
arrowsPlacement: CarouselArrowsPlacement.Content,
15+
selectedIndex: 0
16+
}
1117
};
1218

13-
export const generatedDefaultStory = () => (
19+
export const generatedDefaultStory = (props) => (
1420
<Carousel
15-
arrowsPlacement={select('arrowsPlacement', CarouselArrowsPlacement, CarouselArrowsPlacement['Content'])}
16-
cyclic={boolean('cyclic', false)}
17-
hideNavigation={boolean('hideNavigation', false)}
18-
itemsPerPageL={number('itemsPerPageL', 1)}
19-
itemsPerPageM={number('itemsPerPageM', 1)}
20-
itemsPerPageS={number('itemsPerPageS', 1)}
21-
onNavigate={action('onNavigate')}
22-
selectedIndex={number('selectedIndex', 0)}
21+
arrowsPlacement={props.arrowsPlacement}
22+
cyclic={props.cyclic}
23+
hideNavigation={props.hideNavigation}
24+
itemsPerPageL={props.itemsPerPageL}
25+
itemsPerPageM={props.itemsPerPageM}
26+
itemsPerPageS={props.itemsPerPageS}
27+
onNavigate={props.onNavigate}
28+
selectedIndex={props.selectedIndex}
2329
>
2430
<div style={{ height: '300px', width: '100%', backgroundColor: ThemingParameters.sapInformationBackground }}>
2531
Carousel Content 1

0 commit comments

Comments
 (0)