@@ -10,20 +10,88 @@ import {
1010 VariantRow ,
1111} from " @calcom/storybook/components" ;
1212
13- import { List , ListItem } from " ./List" ;
13+ import { List , ListItem , ListItemTitle , ListItemText } from " ./List" ;
14+
15+ export const listItems = [
16+ { title: " Title 1" , description: " Description 1" },
17+ { title: " Title 2" , description: " Description 2" },
18+ { title: " Title 3" , description: " Description 3" },
19+ ];
1420
1521<Meta title = " UI/List" component = { List } />
1622
17- <Title title = " List" suffix = " Brief" subtitle = " Version 2.0 — Last Update: 05 jan 2023" />
23+ <Title title = " List" suffix = " Brief" subtitle = " Version 2.0 — Last Update: 24 Aug 2023" />
1824
1925## Definition
2026
21- Sums it up nicely.
27+ The List component is used to render an unordered list with default styling
28+
29+ ## Structure
30+
31+ List takes an array of objects to display a list in the UI
32+ ### List
33+ <CustomArgsTable of = { List } />
34+
35+ ### ListItem
36+ <CustomArgsTable of = { ListItem } />
37+
38+ <Examples >
39+ <Example title = " Default" >
40+ <List >
41+ { listItems .map ((item ) => (
42+ <ListItem rounded = { false } >
43+ <ListItemTitle className = " mr-2" >{ item .title } </ListItemTitle >
44+ <ListItemText >{ item .description } </ListItemText >
45+ </ListItem >
46+ ))}
47+ </List >
48+ </Example >
49+ <Example title = " Round Container" >
50+ <List roundContainer = { false } >
51+ { listItems .map ((item ) => (
52+ <ListItem rounded = { false } >
53+ <ListItemTitle className = " mr-2" >{ item .title } </ListItemTitle >
54+ <ListItemText >{ item .description } </ListItemText >
55+ </ListItem >
56+ ))}
57+ </List >
58+ </Example >
59+ <Example title = " No Border Treatment" >
60+ <List noBorderTreatment = { true } >
61+ { listItems .map ((item ) => (
62+ <ListItem rounded = { false } >
63+ <ListItemTitle className = " mr-2" >{ item .title } </ListItemTitle >
64+ <ListItemText >{ item .description } </ListItemText >
65+ </ListItem >
66+ ))}
67+ </List >
68+ </Example >
69+ </Examples >
70+
71+ <Title offset title = " List" suffix = " Variants" />
2272
2373<Canvas >
24- <Story name = " List" >
25- <VariantsTable titles = { []} columnMinWidth = { 150 } >
26- <VariantRow variant = " Default" >TODO!</VariantRow >
27- </VariantsTable >
74+ <Story
75+ name = " List"
76+ args = { {
77+ roundContainer: true ,
78+ noBorderTreatment: false ,
79+ rounded: false ,
80+ expanded: false
81+ }} >
82+ { ({ roundContainer , noBorderTreatment , rounded , expanded }) => (
83+ <VariantsTable titles = { [" Default" ]} columnMinWidth = { 150 } >
84+ <VariantRow >
85+ <List roundContainer = { roundContainer } noBorderTreatment = { noBorderTreatment } >
86+ { listItems .map ((item ) => (
87+ <ListItem rounded = { rounded } expanded = { expanded } >
88+ <ListItemTitle className = " mr-2" >{ item .title } </ListItemTitle >
89+ <ListItemText >{ item .description } </ListItemText >
90+ </ListItem >
91+ ))}
92+ </List >
93+ </VariantRow >
94+ </VariantsTable >
95+ )}
2896 </Story >
2997</Canvas >
0 commit comments