@@ -11,18 +11,15 @@ import Lumi.Components.Size (Size(..))
1111import React.Basic (Component , JSX , createComponent , element , makeStateless )
1212import React.Basic.DOM as R
1313
14- type ListProps =
14+ type ListProps r =
1515 { size :: Maybe Size
1616 , rightAligned :: Boolean
1717 , rows :: Array (Array JSX )
18- , borders :: Boolean
18+ | r
1919 }
2020
21- component :: Component ListProps
22- component = createComponent " List"
23-
24- list :: ListProps -> JSX
25- list = makeStateless component $ lumiList <<< mapProps
21+ listComponent :: ListProps (borders :: Boolean ) -> JSX
22+ listComponent = makeStateless (createComponent " List" ) $ lumiList <<< mapProps
2623 where
2724 mapProps props =
2825 { className: " lumi"
@@ -45,20 +42,36 @@ list = makeStateless component $ lumiList <<< mapProps
4542 lumiListRow = element (R .unsafeCreateDOMComponent " lumi-list-row" )
4643 lumiListRowCell = element (R .unsafeCreateDOMComponent " lumi-list-row-cell" )
4744
48- defaultList :: ListProps
45+ list :: ListProps () -> JSX
46+ list props =
47+ listComponent
48+ { size: props.size
49+ , rightAligned: props.rightAligned
50+ , rows: props.rows
51+ , borders: true
52+ }
53+
54+ borderlessList :: ListProps () -> JSX
55+ borderlessList props =
56+ listComponent
57+ { size: props.size
58+ , rightAligned: props.rightAligned
59+ , rows: props.rows
60+ , borders: false
61+ }
62+
63+ defaultList :: ListProps ()
4964defaultList =
5065 { size: Just $ Medium
5166 , rightAligned: false
5267 , rows: []
53- , borders: true
5468 }
5569
56- compactList :: ListProps
70+ compactList :: ListProps ()
5771compactList =
5872 { size: Just $ Small
5973 , rightAligned: false
6074 , rows: []
61- , borders: true
6275 }
6376
6477type StructuredColumnListProps row =
@@ -80,7 +93,6 @@ structuredColumnList = makeStateless structuredColumnListComponent render
8093 { size: Just $ Large
8194 , rightAligned: props.rightAligned
8295 , rows: map renderRow props.rows
83- , borders: true
8496 }
8597 where
8698 renderRow row =
0 commit comments