@@ -11,17 +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+ | r
1819 }
1920
20- component :: Component ListProps
21- component = createComponent " List"
22-
23- list :: ListProps -> JSX
24- list = makeStateless component $ lumiList <<< mapProps
21+ listComponent :: ListProps (borders :: Boolean ) -> JSX
22+ listComponent = makeStateless (createComponent " List" ) $ lumiList <<< mapProps
2523 where
2624 mapProps props =
2725 { className: " lumi"
@@ -30,6 +28,7 @@ list = makeStateless component $ lumiList <<< mapProps
3028 Just size -> show size
3129 Nothing -> show Medium
3230 , " data-right-aligned" : props.rightAligned
31+ , " data-borders" : props.borders
3332 , children: map renderRow props.rows
3433 }
3534 where
@@ -43,14 +42,32 @@ list = makeStateless component $ lumiList <<< mapProps
4342 lumiListRow = element (R .unsafeCreateDOMComponent " lumi-list-row" )
4443 lumiListRowCell = element (R .unsafeCreateDOMComponent " lumi-list-row-cell" )
4544
46- 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 ()
4764defaultList =
4865 { size: Just $ Medium
4966 , rightAligned: false
5067 , rows: []
5168 }
5269
53- compactList :: ListProps
70+ compactList :: ListProps ()
5471compactList =
5572 { size: Just $ Small
5673 , rightAligned: false
@@ -100,9 +117,9 @@ styles = jss
100117 , display: " flex"
101118 , flexFlow: " row wrap"
102119 , justifyContent: " space-between"
103- , borderTop: [ " 1px" , " solid" , cssStringHSLA colors.black4 ]
104120 , minHeight: " calc(48px + 1px)"
105121 , padding: " 6px 0"
122+ , borderTop: [ " 1px" , " solid" , cssStringHSLA colors.black4 ]
106123
107124 , " & > lumi-list-row-cell" :
108125 { boxSizing: " border-box"
@@ -114,6 +131,13 @@ styles = jss
114131 }
115132 }
116133
134+ , " &[data-borders=\" false\" ]" :
135+ { border: " 0"
136+ , " & > lumi-list-row" :
137+ { border: " 0"
138+ }
139+ }
140+
117141 , " &[data-size=\" small\" ] > lumi-list-row" :
118142 { minHeight: " calc(40px + 1px)"
119143 , padding: " 2px 0"
0 commit comments