@@ -11,18 +11,22 @@ 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 CommonListProps rest =
1515 { size :: Maybe Size
1616 , rightAligned :: Boolean
1717 , rows :: Array (Array JSX )
18- , borders :: Boolean
18+ | rest
1919 }
2020
21+ type ListProps = CommonListProps
22+ ( borders :: Boolean
23+ )
24+
2125component :: Component ListProps
2226component = createComponent " List"
2327
24- list :: ListProps -> JSX
25- list = makeStateless component $ lumiList <<< mapProps
28+ listComponent :: ListProps -> JSX
29+ listComponent = makeStateless component $ lumiList <<< mapProps
2630 where
2731 mapProps props =
2832 { className: " lumi"
@@ -45,20 +49,35 @@ list = makeStateless component $ lumiList <<< mapProps
4549 lumiListRow = element (R .unsafeCreateDOMComponent " lumi-list-row" )
4650 lumiListRowCell = element (R .unsafeCreateDOMComponent " lumi-list-row-cell" )
4751
48- defaultList :: ListProps
52+ list :: CommonListProps () -> JSX
53+ list props =
54+ listComponent
55+ { size: props.size
56+ , rightAligned: props.rightAligned
57+ , rows: props.rows
58+ , borders: true
59+ }
60+
61+ defaultList :: CommonListProps ()
4962defaultList =
5063 { size: Just $ Medium
5164 , rightAligned: false
5265 , rows: []
53- , borders: true
5466 }
5567
56- compactList :: ListProps
68+ compactList :: CommonListProps ()
5769compactList =
5870 { size: Just $ Small
5971 , rightAligned: false
6072 , rows: []
61- , borders: true
73+ }
74+
75+ borderlessList :: ListProps
76+ borderlessList =
77+ { size: Just $ Medium
78+ , rightAligned: false
79+ , rows: []
80+ , borders: false
6281 }
6382
6483type StructuredColumnListProps row =
@@ -80,7 +99,6 @@ structuredColumnList = makeStateless structuredColumnListComponent render
8099 { size: Just $ Large
81100 , rightAligned: props.rightAligned
82101 , rows: map renderRow props.rows
83- , borders: true
84102 }
85103 where
86104 renderRow row =
0 commit comments