@@ -6,6 +6,7 @@ import Color (cssStringHSLA)
6
6
import Data.Maybe (Maybe (..))
7
7
import Data.Nullable (toNullable )
8
8
import Effect.Console (log )
9
+ import Effect.Uncurried (mkEffectFn1 )
9
10
import Lumi.Components.Button (button , defaults , secondary )
10
11
import Lumi.Components.Color (colors )
11
12
import Lumi.Components.Column (column , column_ )
@@ -25,20 +26,23 @@ docs =
25
26
, example $
26
27
dropdownButton dropdownButtonDefaults
27
28
{ label = " Dropdown Button"
28
- , content = R .div
29
+ , content = \closeSelf -> R .div
29
30
{ style: R .css { width: " 328px" , padding: " 12px" }
30
31
, children:
31
32
[ button secondary
32
33
{ title = " I can be any element"
33
34
, style = R .css { width: " 100%" , marginBottom: " 8px" }
35
+ , onPress = mkEffectFn1 \_ -> closeSelf
34
36
}
35
37
, button secondary
36
38
{ title = " I can be any element"
37
39
, style = R .css { width: " 100%" , marginBottom: " 8px" }
40
+ , onPress = mkEffectFn1 \_ -> closeSelf
38
41
}
39
42
, button defaults
40
43
{ title = " I can be any element"
41
44
, style = R .css { width: " 100%" }
45
+ , onPress = mkEffectFn1 \_ -> closeSelf
42
46
}
43
47
]
44
48
}
@@ -49,20 +53,23 @@ docs =
49
53
dropdownButton dropdownButtonDefaults
50
54
{ label = " Dropdown Button"
51
55
, alignment = toNullable (Just " right" )
52
- , content = R .div
56
+ , content = \closeSelf -> R .div
53
57
{ style: R .css { width: " 328px" , padding: " 12px" }
54
58
, children:
55
59
[ button secondary
56
60
{ title = " I can be any element"
57
61
, style = R .css { width: " 100%" , marginBottom: " 8px" }
62
+ , onPress = mkEffectFn1 \_ -> closeSelf
58
63
}
59
64
, button secondary
60
65
{ title = " I can be any element"
61
66
, style = R .css { width: " 100%" , marginBottom: " 8px" }
67
+ , onPress = mkEffectFn1 \_ -> closeSelf
62
68
}
63
69
, button defaults
64
70
{ title = " I can be any element"
65
71
, style = R .css { width: " 100%" }
72
+ , onPress = mkEffectFn1 \_ -> closeSelf
66
73
}
67
74
]
68
75
}
@@ -77,20 +84,23 @@ docs =
77
84
{ children:
78
85
[ dropdownButton dropdownButtonDefaults
79
86
{ label = " Dropdown Button"
80
- , content = R .div
87
+ , content = \closeSelf -> R .div
81
88
{ style: R .css { width: " 328px" , padding: " 12px" }
82
89
, children:
83
90
[ button secondary
84
91
{ title = " I can be any element"
85
92
, style = R .css { width: " 100%" , marginBottom: " 8px" }
93
+ , onPress = mkEffectFn1 \_ -> closeSelf
86
94
}
87
95
, button secondary
88
96
{ title = " I can be any element"
89
97
, style = R .css { width: " 100%" , marginBottom: " 8px" }
98
+ , onPress = mkEffectFn1 \_ -> closeSelf
90
99
}
91
100
, button defaults
92
101
{ title = " I can be any element"
93
102
, style = R .css { width: " 100%" }
103
+ , onPress = mkEffectFn1 \_ -> closeSelf
94
104
}
95
105
]
96
106
}
@@ -102,20 +112,23 @@ docs =
102
112
{ children:
103
113
[ dropdownButton dropdownButtonDefaults
104
114
{ label = " Dropdown Button"
105
- , content = R .div
115
+ , content = \closeSelf -> R .div
106
116
{ style: R .css { width: " 328px" , padding: " 12px" }
107
117
, children:
108
118
[ button secondary
109
119
{ title = " I can be any element"
110
120
, style = R .css { width: " 100%" , marginBottom: " 8px" }
121
+ , onPress = mkEffectFn1 \_ -> closeSelf
111
122
}
112
123
, button secondary
113
124
{ title = " I can be any element"
114
125
, style = R .css { width: " 100%" , marginBottom: " 8px" }
126
+ , onPress = mkEffectFn1 \_ -> closeSelf
115
127
}
116
128
, button defaults
117
129
{ title = " I can be any element"
118
130
, style = R .css { width: " 100%" }
131
+ , onPress = mkEffectFn1 \_ -> closeSelf
119
132
}
120
133
]
121
134
}
@@ -130,11 +143,11 @@ docs =
130
143
dropdownMenu dropdownMenuDefaults
131
144
{ label = " Dropdown Menu"
132
145
, items =
133
- [ [ { label: " Export all results to CSV" , action: log " hello" }
134
- , { label: " Export selected results to CSV" , action: log " hola" }
135
- , { label: " Assign manager" , action: log " bonjour " }
146
+ [ [ { label: " Export all results to CSV" , action: Just $ log " hello" }
147
+ , { label: " Export selected results to CSV" , action: Just $ log " hola" }
148
+ , { label: " Assign manager" , action: Nothing }
136
149
]
137
- , [ { label: " Archive" , action: log " olá" }
150
+ , [ { label: " Archive" , action: Just $ log " olá" }
138
151
]
139
152
]
140
153
}
@@ -143,11 +156,11 @@ docs =
143
156
{ label = " Dropdown Menu (right)"
144
157
, alignment = toNullable (Just " right" )
145
158
, items =
146
- [ [ { label: " Export all results to CSV" , action: log " hello" }
147
- , { label: " Export selected results to CSV" , action: log " hola" }
148
- , { label: " Assign manager" , action: log " bonjour " }
159
+ [ [ { label: " Export all results to CSV" , action: Just $ log " hello" }
160
+ , { label: " Export selected results to CSV" , action: Just $ log " hola" }
161
+ , { label: " Assign manager" , action: Nothing }
149
162
]
150
- , [ { label: " Archive" , action: log " olá" }
163
+ , [ { label: " Archive" , action: Just $ log " olá" }
151
164
]
152
165
]
153
166
}
@@ -181,9 +194,9 @@ docs =
181
194
, dropdownMenu dropdownMenuDefaults
182
195
{ label = " Dropdown Menu"
183
196
, items =
184
- [ [ { label: " Export all results to CSV" , action: log " hello" }
185
- , { label: " Export selected results to CSV" , action: log " hola" }
186
- , { label: " Assign manager" , action: log " bonjour " }
197
+ [ [ { label: " Export all results to CSV" , action: Just $ log " hello" }
198
+ , { label: " Export selected results to CSV" , action: Just $ log " hola" }
199
+ , { label: " Assign manager" , action: Nothing }
187
200
]
188
201
]
189
202
}
@@ -201,20 +214,23 @@ docs =
201
214
, h2_ " using an arbitrary icon in place of the button"
202
215
, example $
203
216
dropdownIcon dropdownIconDefaults
204
- { content = R .div
217
+ { content = \closeSelf -> R .div
205
218
{ style: R .css { width: " 328px" , padding: " 12px" }
206
219
, children:
207
220
[ button secondary
208
221
{ title = " I can be any element"
209
222
, style = R .css { width: " 100%" , marginBottom: " 8px" }
223
+ , onPress = mkEffectFn1 \_ -> closeSelf
210
224
}
211
225
, button secondary
212
226
{ title = " I can be any element"
213
227
, style = R .css { width: " 100%" , marginBottom: " 8px" }
228
+ , onPress = mkEffectFn1 \_ -> closeSelf
214
229
}
215
230
, button defaults
216
231
{ title = " I can be any element"
217
232
, style = R .css { width: " 100%" }
233
+ , onPress = mkEffectFn1 \_ -> closeSelf
218
234
}
219
235
]
220
236
}
0 commit comments