Skip to content

Commit 5d93b77

Browse files
Remove lumiElement (#141)
1 parent a7f5b1f commit 5d93b77

File tree

14 files changed

+142
-128
lines changed

14 files changed

+142
-128
lines changed

docs/Examples2/Box.example.purs

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
module Lumi.Components2.Examples.Box where
22

33
import Prelude
4+
45
import Color.Scheme.MaterialDesign (blue, green, red)
5-
import Lumi.Components (lumiElement, ($$$))
6+
import Lumi.Components (($$$))
67
import Lumi.Components.Example (example)
78
import Lumi.Components.Spacing (Space(..), vspace)
89
import Lumi.Components.Text (h2_, p_)
9-
import Lumi.Components2.Box (box)
10+
import Lumi.Components2.Box (box, column, row)
1011
import Lumi.Styles.Box (FlexAlign(..), _alignSelf, _justify, _row)
1112
import React.Basic (JSX)
1213
import React.Basic.Emotion as E
@@ -15,45 +16,46 @@ docs :: JSX
1516
docs =
1617
let
1718
childBox color =
18-
lumiElement box
19-
_
20-
{ css =
21-
\_ ->
22-
E.css
23-
{ backgroundColor: E.color color
24-
, height: E.prop S40
25-
, width: E.prop S40
26-
}
27-
}
19+
box _
20+
{ css =
21+
\_ ->
22+
E.css
23+
{ backgroundColor: E.color color
24+
, height: E.prop S40
25+
, width: E.prop S40
26+
}
27+
}
2828

2929
exampleContent =
3030
[ childBox red
3131
, childBox green
3232
, childBox blue
3333
]
3434
in
35-
lumiElement box
35+
box
3636
_
3737
{ content =
3838
[ p_ "Box is a simple building block component. Lumi components default to building off of Box and generally expect their JSX arguments to be Box-compatible elements."
3939
, p_ "A Box is essentially a div which defaults to a flex column. The most common flex settings are available as prop modifiers. Nested boxes will also stretch to fill their given space by default. If a component shouldn't grow beyond a specific size under any circumstances, be sure to give it a max-width!"
4040
, vspace S24
4141
, h2_ "Defaults"
42-
, example $ lumiElement box
42+
, example
43+
$ box
4344
$$$ exampleContent
4445
, h2_ "Row"
45-
, example $ lumiElement box
46+
, example
47+
$ box
4648
$ _row
4749
$$$ exampleContent
4850
, h2_ "Align/justify"
49-
, example $ lumiElement box
50-
$ _row
51+
, example
52+
$ row
5153
$ _alignSelf Stretch -- only necessary because `example` isn't a Box
5254
$ _justify End
5355
$$$ exampleContent
5456
, h2_ "Space evenly"
55-
, example $ lumiElement box
56-
$ _row
57+
, example
58+
$ column
5759
$ _alignSelf Stretch -- only necessary because `example` isn't a Box
5860
$ _justify SpaceEvenly
5961
$$$ exampleContent

docs/Examples2/Button.example.purs

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ module Lumi.Components2.Examples.Button where
22

33
import Prelude
44
import Data.Array (intercalate)
5-
import Lumi.Components (lumiElement)
65
import Lumi.Components.Column (column_)
76
import Lumi.Components.Example (example)
87
import Lumi.Components.Icon (IconType(..), icon)
@@ -22,45 +21,42 @@ docs =
2221
column_
2322
$ intercalate [ vspace S16 ]
2423
[ [ example
25-
$ lumiElement button
24+
$ button
2625
$ _ { content = [ R.text "Button" ] }
2726
]
2827
, [ h2_ "Disabled"
2928
, example
30-
$ lumiElement button
31-
$ _
32-
{ content = [ R.text "Button" ]
33-
, state = Disabled
34-
}
29+
$ button
30+
$ _ { content = [ R.text "Button" ] }
3531
]
3632
, [ h2_ "Size"
3733
, h4_ "Medium (default)"
3834
, example
39-
$ lumiElement button
35+
$ button
4036
$ _
4137
{ content = [ R.text "Button" ]
4238
, size = Medium
4339
}
4440
]
4541
, [ h4_ "Small"
4642
, example
47-
$ lumiElement button
43+
$ button
4844
$ _
4945
{ content = [ R.text "Button" ]
5046
, size = Small
5147
}
5248
]
5349
, [ h4_ "Large"
5450
, example
55-
$ lumiElement button
51+
$ button
5652
$ _
5753
{ content = [ R.text "Button" ]
5854
, size = Large
5955
}
6056
]
6157
, [ h4_ "Extra Large"
6258
, example
63-
$ lumiElement button
59+
$ button
6460
$ _
6561
{ content = [ R.text "Button" ]
6662
, size = ExtraLarge
@@ -69,27 +65,27 @@ docs =
6965
, [ h2_ "Color"
7066
, h4_ "Primary (default)"
7167
, example
72-
$ lumiElement button
68+
$ button
7369
$ _interactive
7470
$ _ { content = [ R.text "Button" ] }
7571
]
7672
, [ h4_ "Primary + Disabled"
7773
, example
78-
$ lumiElement button
74+
$ button
7975
$ _
8076
{ content = [ R.text "Button" ]
8177
, state = Disabled
8278
}
8379
]
8480
, [ h4_ "Secondary (outline)"
8581
, example
86-
$ lumiElement button
82+
$ button
8783
$ _secondary
8884
$ _ { content = [ R.text "Button" ] }
8985
]
9086
, [ h4_ "Secondary Small"
9187
, example
92-
$ lumiElement button
88+
$ button
9389
$ _secondary
9490
$ _
9591
{ content = [ R.text "Button" ]
@@ -98,7 +94,7 @@ docs =
9894
]
9995
, [ h4_ "Secondary Large"
10096
, example
101-
$ lumiElement button
97+
$ button
10298
$ _secondary
10399
$ _
104100
{ content = [ R.text "Button" ]
@@ -107,7 +103,7 @@ docs =
107103
]
108104
, [ h4_ "Secondary Extra Large"
109105
, example
110-
$ lumiElement button
106+
$ button
111107
$ _secondary
112108
$ _
113109
{ content = [ R.text "Button" ]
@@ -116,7 +112,7 @@ docs =
116112
]
117113
, [ h4_ "Secondary + Disabled"
118114
, example
119-
$ lumiElement button
115+
$ button
120116
$ _secondary
121117
$ _
122118
{ content = [ R.text "Button" ]
@@ -125,54 +121,59 @@ docs =
125121
]
126122
, [ h4_ "Icon button"
127123
, example
128-
$ lumiElement button
124+
$ button
129125
$ _ { content = [ buttonIcon Plus, hspace S8, R.text "Add new item" ] }
130126
]
131127
, [ h4_ "Icon button"
132128
, example
133-
$ lumiElement button
129+
$ button
134130
$ _secondary
135131
$ _ { content = [ buttonIcon Plus, hspace S8, R.text "Add new item" ] }
136132
]
137133
, [ h4_ "Icon button"
138134
, example
139-
$ lumiElement button
135+
$ button
140136
$ _ { content = [ R.text "Add new item", hspace S8, buttonIcon Plus ] }
141137
]
142138
, [ h4_ "Link style"
143139
, example
144-
$ lumiElement button
140+
$ button
145141
$ _linkStyle
146-
$ _ { content = [ R.text "Button w/ link style" ], onPress = alert "asdf" =<< window }
142+
$ _ { content = [ R.text "Button w/ link style" ]
143+
, onPress = alert "asdf" =<< window
144+
}
147145
, example
148-
$ lumiElement button
146+
$ button
149147
$ _linkStyle
150-
$ _ { state = Disabled, content = [ R.text "Button w/ link style" ], onPress = alert "asdf" =<< window }
148+
$ _ { state = Disabled
149+
, content = [ R.text "Button w/ link style" ]
150+
, onPress = alert "asdf" =<< window
151+
}
151152
]
152153
, [ h4_ "Loading (Medium/default)"
153154
, example
154-
$ lumiElement button
155+
$ button
155156
$ _ { state = Loading }
156157
]
157158
, [ h4_ "Loading (Small) "
158159
, example
159-
$ lumiElement button
160+
$ button
160161
$ _
161162
{ state = Loading
162163
, size = Small
163164
}
164165
]
165166
, [ h4_ "Loading (Large) "
166167
, example
167-
$ lumiElement button
168+
$ button
168169
$ _
169170
{ state = Loading
170171
, size = Large
171172
}
172173
]
173174
, [ h4_ "Loading (ExtraLarge) "
174175
, example
175-
$ lumiElement button
176+
$ button
176177
$ _
177178
{ state = Loading
178179
, size = ExtraLarge

docs/Examples2/ButtonGroup.example.purs

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module Lumi.Components2.Examples.ButtonGroup where
33
import Prelude
44
import Effect.Console (log)
55
import Effect.Uncurried (mkEffectFn1)
6-
import Lumi.Components (lumiElement)
76
import Lumi.Components.Column (column_)
87
import Lumi.Components.Example (example)
98
import Lumi.Components.NativeSelect (nativeSelect, defaults)
@@ -18,73 +17,73 @@ docs =
1817
column_
1918
$ [ h2_ "Not Joined"
2019
, example
21-
$ lumiElement buttonGroup
20+
$ buttonGroup
2221
$ _
2322
{ content =
24-
[ lumiElement button _ { content = [ R.text "Button" ] }
25-
, lumiElement button
23+
[ button _ { content = [ R.text "Button" ] }
24+
, button
2625
$ _secondary
2726
$ _ { content = [ R.text "Button" ] }
2827
]
2928
}
3029
, h2_ "Not Joined"
3130
, example
32-
$ lumiElement buttonGroup
31+
$ buttonGroup
3332
$ _
3433
{ content =
35-
[ lumiElement button _ { content = [ R.text "Button" ] }
36-
, lumiElement button
34+
[ button _ { content = [ R.text "Button" ] }
35+
, button
3736
$ _secondary
3837
$ _ { content = [ R.text "Button" ] }
39-
, lumiElement button
38+
, button
4039
$ _secondary
4140
$ _ { content = [ R.text "Button" ] }
4241
]
4342
}
4443
, h2_ "Not Joined"
4544
, example
46-
$ lumiElement buttonGroup
45+
$ buttonGroup
4746
$ _
4847
{ content =
49-
[ lumiElement button _ { content = [ R.text "Button" ] }
48+
[ button _ { content = [ R.text "Button" ] }
5049
, nativeSelect
5150
defaults
5251
{ options = []
5352
, onChange = mkEffectFn1 \_ -> log "onChange"
5453
, value = "Foo bar"
5554
}
56-
, lumiElement button
55+
, button
5756
$ _secondary
5857
$ _ { content = [ R.text "Button" ] }
5958
]
6059
}
6160
, h2_ "Joined"
6261
, example
63-
$ lumiElement buttonGroup
62+
$ buttonGroup
6463
$ _
6564
{ joined = true
6665
, content =
67-
[ lumiElement button
66+
[ button
6867
$ _secondary
6968
$ _ { content = [ R.text "Button" ] }
70-
, lumiElement button
69+
, button
7170
$ _secondary
7271
$ _ { content = [ R.text "Button" ] }
7372
]
7473
}
7574
, h2_ "Joined"
7675
, example
77-
$ lumiElement buttonGroup
76+
$ buttonGroup
7877
$ _
7978
{ joined = true
8079
, content =
81-
[ lumiElement button
80+
[ button
8281
$ _secondary
8382
$ _ { content = [ R.text "Button" ] }
84-
, lumiElement button
83+
, button
8584
$ _secondary
8685
$ _ { content = [ R.text "Button" ] }
87-
, lumiElement button
86+
, button
8887
$ _secondary
8988
$ _ { content = [ R.text "Button" ] }
9089
]

docs/Examples2/Clip.example.purs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module Lumi.Components2.Examples.Clip where
22

33
import Prelude
4-
import Lumi.Components (lumiElement)
54
import Lumi.Components.Example (example)
65
import Lumi.Components.Spacing (Space(..), vspace)
76
import Lumi.Components.Text (body_, p_)
@@ -11,14 +10,14 @@ import React.Basic (JSX)
1110

1211
docs :: JSX
1312
docs =
14-
lumiElement box
13+
box
1514
_
1615
{ content =
1716
[ p_ "The Clip component wraps the provided content with a grey border and a \"Copy\" button, which copies the text content into the system clipboard."
1817
, p_ "If clipboard access is not allowed or not supported the text will be left highlighted, allowing the user to press ctrl+c manually. Only the plain text content is copied, not the HTML."
1918
, vspace S24
2019
, example
21-
$ lumiElement clip
20+
$ clip
2221
$ _ { content = [ body_ "[email protected]" ] }
2322
, p_ "The Clip behavior is also available as a React hook."
2423
]

0 commit comments

Comments
 (0)