Skip to content

Commit f96fc10

Browse files
committed
Merge branch 'master' into arthur/banner
2 parents 12e0ab0 + 5f01236 commit f96fc10

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2550
-659
lines changed

.eslintrc.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
env:
2+
browser: true
3+
commonjs: true
4+
es6: true
5+
node: true
6+
extends:
7+
- eslint:recommended
8+
- plugin:prettier/recommended
9+
globals:
10+
Atomics: readonly
11+
SharedArrayBuffer: readonly
12+
parserOptions:
13+
ecmaFeatures:
14+
jsx: false
15+
ecmaVersion: 2018
16+
rules:
17+
strict:
18+
- error
19+
- global
20+
no-unused-vars:
21+
- error
22+
- argsIgnorePattern: ^_

bower.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"purescript-random": "^4.0.0",
3232
"purescript-react-basic": "^13.0.0",
3333
"purescript-react-basic-emotion": "^4.0.0",
34-
"purescript-react-basic-hooks": "^4.0.0",
34+
"purescript-react-basic-hooks": "^4.1.1",
3535
"purescript-react-dnd-basic": "^6.1.4",
3636
"purescript-record": ">= 1.0.0 < 3.0.0",
3737
"purescript-simple-json": ">=4.0.0 <7.0.0",
@@ -44,7 +44,8 @@
4444
"purescript-js-timers": "^4.0.1",
4545
"purescript-heterogeneous": ">=0.3.0 <0.5.0",
4646
"purescript-free": "^5.1.0",
47-
"purescript-colors": "^5.0.0"
47+
"purescript-colors": "^5.0.0",
48+
"purescript-web-uievents": "^2.0.0"
4849
},
4950
"devDependencies": {
5051
"purescript-debug": "^4.0.0",

docs/.eslintrc.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extends:
2+
- plugin:react/recommended
3+
parser: babel-eslint
4+
parserOptions:
5+
sourceType: module
6+
ecmaFeatures:
7+
jsx: true
8+
settings:
9+
react:
10+
version: detect
11+
rules:
12+
react/prop-types: 0

docs/App.jsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint-disable react/jsx-key */
2+
/* global COMMITHASH, VERSION */
3+
14
import React, { Component, useState, useEffect } from "react";
25
import { Link, NavLink, Redirect, Route, Switch } from "react-router-dom";
36
import Media from "react-media";
@@ -116,9 +119,16 @@ const componentLoaders = [
116119
"Wizard"
117120
].map(fromComponentPath);
118121

119-
const componentv2Loaders = ["Banner", "Box", "Button", "ButtonGroup", "Link", "Slat"].map(
120-
fromComponentPathv2
121-
);
122+
const componentv2Loaders = [
123+
"Banner",
124+
"Box",
125+
"Button",
126+
"ButtonGroup",
127+
"Clip",
128+
"Link",
129+
"QRCode",
130+
"Slat"
131+
].map(fromComponentPathv2);
122132

123133
const App = () => {
124134
const [menuOpen, setMenuOpen] = useState(false);
@@ -212,6 +222,7 @@ const renderRoute = component => (
212222
<a
213223
className="lumi"
214224
target="_blank"
225+
rel="noopener noreferrer"
215226
href={component.componentSource}
216227
style={{
217228
marginLeft: "8px",
@@ -224,6 +235,7 @@ const renderRoute = component => (
224235
<a
225236
className="lumi"
226237
target="_blank"
238+
rel="noopener noreferrer"
227239
href={component.exampleSource}
228240
style={{
229241
marginLeft: "8px",
@@ -236,6 +248,7 @@ const renderRoute = component => (
236248
<a
237249
className="lumi"
238250
target="_blank"
251+
rel="noopener noreferrer"
239252
href={component.apiReference}
240253
style={{
241254
marginLeft: "8px"

docs/Examples/DropdownButton.example.purs

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Color (cssStringHSLA)
66
import Data.Maybe (Maybe(..))
77
import Data.Nullable (toNullable)
88
import Effect.Console (log)
9+
import Effect.Uncurried (mkEffectFn1)
910
import Lumi.Components.Button (button, defaults, secondary)
1011
import Lumi.Components.Color (colors)
1112
import Lumi.Components.Column (column, column_)
@@ -25,20 +26,23 @@ docs =
2526
, example $
2627
dropdownButton dropdownButtonDefaults
2728
{ label = "Dropdown Button"
28-
, content = R.div
29+
, content = \closeSelf -> R.div
2930
{ style: R.css { width: "328px", padding: "12px" }
3031
, children:
3132
[ button secondary
3233
{ title = "I can be any element"
3334
, style = R.css { width: "100%", marginBottom: "8px" }
35+
, onPress = mkEffectFn1 \_ -> closeSelf
3436
}
3537
, button secondary
3638
{ title = "I can be any element"
3739
, style = R.css { width: "100%", marginBottom: "8px" }
40+
, onPress = mkEffectFn1 \_ -> closeSelf
3841
}
3942
, button defaults
4043
{ title = "I can be any element"
4144
, style = R.css { width: "100%" }
45+
, onPress = mkEffectFn1 \_ -> closeSelf
4246
}
4347
]
4448
}
@@ -49,20 +53,23 @@ docs =
4953
dropdownButton dropdownButtonDefaults
5054
{ label = "Dropdown Button"
5155
, alignment = toNullable (Just "right")
52-
, content = R.div
56+
, content = \closeSelf -> R.div
5357
{ style: R.css { width: "328px", padding: "12px" }
5458
, children:
5559
[ button secondary
5660
{ title = "I can be any element"
5761
, style = R.css { width: "100%", marginBottom: "8px" }
62+
, onPress = mkEffectFn1 \_ -> closeSelf
5863
}
5964
, button secondary
6065
{ title = "I can be any element"
6166
, style = R.css { width: "100%", marginBottom: "8px" }
67+
, onPress = mkEffectFn1 \_ -> closeSelf
6268
}
6369
, button defaults
6470
{ title = "I can be any element"
6571
, style = R.css { width: "100%" }
72+
, onPress = mkEffectFn1 \_ -> closeSelf
6673
}
6774
]
6875
}
@@ -77,20 +84,23 @@ docs =
7784
{ children:
7885
[ dropdownButton dropdownButtonDefaults
7986
{ label = "Dropdown Button"
80-
, content = R.div
87+
, content = \closeSelf -> R.div
8188
{ style: R.css { width: "328px", padding: "12px" }
8289
, children:
8390
[ button secondary
8491
{ title = "I can be any element"
8592
, style = R.css { width: "100%", marginBottom: "8px" }
93+
, onPress = mkEffectFn1 \_ -> closeSelf
8694
}
8795
, button secondary
8896
{ title = "I can be any element"
8997
, style = R.css { width: "100%", marginBottom: "8px" }
98+
, onPress = mkEffectFn1 \_ -> closeSelf
9099
}
91100
, button defaults
92101
{ title = "I can be any element"
93102
, style = R.css { width: "100%" }
103+
, onPress = mkEffectFn1 \_ -> closeSelf
94104
}
95105
]
96106
}
@@ -102,20 +112,23 @@ docs =
102112
{ children:
103113
[ dropdownButton dropdownButtonDefaults
104114
{ label = "Dropdown Button"
105-
, content = R.div
115+
, content = \closeSelf -> R.div
106116
{ style: R.css { width: "328px", padding: "12px" }
107117
, children:
108118
[ button secondary
109119
{ title = "I can be any element"
110120
, style = R.css { width: "100%", marginBottom: "8px" }
121+
, onPress = mkEffectFn1 \_ -> closeSelf
111122
}
112123
, button secondary
113124
{ title = "I can be any element"
114125
, style = R.css { width: "100%", marginBottom: "8px" }
126+
, onPress = mkEffectFn1 \_ -> closeSelf
115127
}
116128
, button defaults
117129
{ title = "I can be any element"
118130
, style = R.css { width: "100%" }
131+
, onPress = mkEffectFn1 \_ -> closeSelf
119132
}
120133
]
121134
}
@@ -130,11 +143,11 @@ docs =
130143
dropdownMenu dropdownMenuDefaults
131144
{ label = "Dropdown Menu"
132145
, 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 }
136149
]
137-
, [ { label: "Archive", action: log "olá" }
150+
, [ { label: "Archive", action: Just $ log "olá" }
138151
]
139152
]
140153
}
@@ -143,11 +156,11 @@ docs =
143156
{ label = "Dropdown Menu (right)"
144157
, alignment = toNullable (Just "right")
145158
, 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 }
149162
]
150-
, [ { label: "Archive", action: log "olá" }
163+
, [ { label: "Archive", action: Just $ log "olá" }
151164
]
152165
]
153166
}
@@ -181,9 +194,9 @@ docs =
181194
, dropdownMenu dropdownMenuDefaults
182195
{ label = "Dropdown Menu"
183196
, 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 }
187200
]
188201
]
189202
}
@@ -201,20 +214,23 @@ docs =
201214
, h2_ "using an arbitrary icon in place of the button"
202215
, example $
203216
dropdownIcon dropdownIconDefaults
204-
{ content = R.div
217+
{ content = \closeSelf -> R.div
205218
{ style: R.css { width: "328px", padding: "12px" }
206219
, children:
207220
[ button secondary
208221
{ title = "I can be any element"
209222
, style = R.css { width: "100%", marginBottom: "8px" }
223+
, onPress = mkEffectFn1 \_ -> closeSelf
210224
}
211225
, button secondary
212226
{ title = "I can be any element"
213227
, style = R.css { width: "100%", marginBottom: "8px" }
228+
, onPress = mkEffectFn1 \_ -> closeSelf
214229
}
215230
, button defaults
216231
{ title = "I can be any element"
217232
, style = R.css { width: "100%" }
233+
, onPress = mkEffectFn1 \_ -> closeSelf
218234
}
219235
]
220236
}

docs/Examples/EditableTable.example.purs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,23 @@ docs = unit # make component
154154
[ hspace S16
155155
, dropdownIcon dropdownIconDefaults
156156
{ alignment = Nullable.notNull "right"
157-
, content = R.div
157+
, content = \closeSelf -> R.div
158158
{ style: R.css { width: "328px", padding: "12px" }
159159
, children:
160160
[ Link.link Link.defaults
161161
{ className = pure "lumi-dropdown-menu-item"
162162
, text = p_ "Do something with this row"
163-
, navigate = pure $ log $ "Did something: " <> show row
163+
, navigate = Just do
164+
closeSelf
165+
log $ "Did something: " <> show row
164166
}
165167
, onRemove # Array.foldMap \onRemove' ->
166168
Link.link Link.defaults
167169
{ className = pure "lumi-dropdown-menu-item"
168170
, text = p_ "Remove this row"
169-
, navigate = pure $ onRemove' row
171+
, navigate = Just do
172+
closeSelf
173+
onRemove' row
170174
}
171175
]
172176
}

0 commit comments

Comments
 (0)