@@ -11,18 +11,15 @@ import Lumi.Components.Size (Size(..))
11
11
import React.Basic (Component , JSX , createComponent , element , makeStateless )
12
12
import React.Basic.DOM as R
13
13
14
- type ListProps =
14
+ type ListProps r =
15
15
{ size :: Maybe Size
16
16
, rightAligned :: Boolean
17
17
, rows :: Array (Array JSX )
18
- , borders :: Boolean
18
+ | r
19
19
}
20
20
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
26
23
where
27
24
mapProps props =
28
25
{ className: " lumi"
@@ -45,20 +42,36 @@ list = makeStateless component $ lumiList <<< mapProps
45
42
lumiListRow = element (R .unsafeCreateDOMComponent " lumi-list-row" )
46
43
lumiListRowCell = element (R .unsafeCreateDOMComponent " lumi-list-row-cell" )
47
44
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 ()
49
64
defaultList =
50
65
{ size: Just $ Medium
51
66
, rightAligned: false
52
67
, rows: []
53
- , borders: true
54
68
}
55
69
56
- compactList :: ListProps
70
+ compactList :: ListProps ()
57
71
compactList =
58
72
{ size: Just $ Small
59
73
, rightAligned: false
60
74
, rows: []
61
- , borders: true
62
75
}
63
76
64
77
type StructuredColumnListProps row =
@@ -80,7 +93,6 @@ structuredColumnList = makeStateless structuredColumnListComponent render
80
93
{ size: Just $ Large
81
94
, rightAligned: props.rightAligned
82
95
, rows: map renderRow props.rows
83
- , borders: true
84
96
}
85
97
where
86
98
renderRow row =
0 commit comments