Skip to content

Commit a20902c

Browse files
authored
Merge pull request #17 from jvliwanag/update-ps0.14-emotion11
Update to purescript 0.14 and emotion 11
2 parents be154d6 + 608761a commit a20902c

File tree

7 files changed

+3441
-341
lines changed

7 files changed

+3441
-341
lines changed

bower.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@
1212
"url": "https://github.com/lumihq/purescript-react-basic-emotion.git"
1313
},
1414
"dependencies": {
15-
"purescript-colors": "^5.0.0",
16-
"purescript-foreign": "^5.0.0",
17-
"purescript-numbers": "^7.0.0",
18-
"purescript-prelude": "^4.1.0",
19-
"purescript-react-basic": "^13.0.0 || ^14.0.0 || ^15.0.0",
20-
"purescript-typelevel-prelude": "^5.0.2",
21-
"purescript-unsafe-reference": "^3.0.1"
15+
"purescript-colors": "^6.0.0",
16+
"purescript-foreign": "^6.0.0",
17+
"purescript-numbers": "^8.0.0",
18+
"purescript-prelude": "^5.0.0",
19+
"purescript-react-basic": "^16.0.0",
20+
"purescript-react-basic-dom": "https://github.com/lumihq/purescript-react-basic-dom.git#4.0.1",
21+
"purescript-typelevel-prelude": "^6.0.0",
22+
"purescript-unsafe-reference": "^4.0.0"
2223
},
2324
"devDependencies": {
24-
"purescript-psci-support": "^4.0.0",
25-
"purescript-react-basic-hooks": ">=2.0.2 <7.0.0"
25+
"purescript-psci-support": "^5.0.0",
26+
"purescript-react-basic-hooks": "^7.0.0"
2627
}
2728
}

examples/basic/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"dependencies": {
3-
"@emotion/core": "^10.0.21",
4-
"react": "16.10.2",
5-
"react-dom": "16.10.2"
3+
"@emotion/react": "^11.1.5",
4+
"react": "17.0.2",
5+
"react-dom": "17.0.2"
66
},
77
"devDependencies": {
8-
"browserify": "16.5.0"
8+
"browserify": "17.0.0"
99
}
1010
}

examples/basic/src/Basic.purs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Prelude
44
import Effect (Effect)
55
import React.Basic.DOM as R
66
import React.Basic.Emotion as E
7-
import React.Basic.Hooks (JSX, ReactComponent, component, element, fragment)
7+
import React.Basic.Hooks (JSX, ReactComponent, element, fragment, reactComponent)
88

99
data Size
1010
= S
@@ -15,12 +15,12 @@ border :: forall r. { borderSize :: Size, borderColor :: String | r } -> E.Style
1515
border { borderSize, borderColor } =
1616
E.css
1717
{ borderWidth:
18-
E.int case borderSize of
18+
E.px case borderSize of
1919
S -> 1
2020
M -> 2
2121
L -> 4
2222
, borderColor: E.str borderColor
23-
, borderRadius: E.int 4
23+
, borderRadius: E.px 4
2424
, borderStyle: E.str "solid"
2525
, padding: E.str "16px 24px"
2626
}
@@ -30,15 +30,15 @@ text size =
3030
E.css
3131
{ fontFamily: E.str "sans-serif"
3232
, fontSize:
33-
E.int case size of
33+
E.px case size of
3434
S -> 14
3535
M -> 18
3636
L -> 32
3737
, fontWeight:
38-
E.int case size of
39-
S -> 400
40-
M -> 500
41-
L -> 800
38+
E.str case size of
39+
S -> "400"
40+
M -> "500"
41+
L -> "800"
4242
}
4343

4444
type SlatProps
@@ -61,7 +61,7 @@ slatDefaults =
6161
mkSlat :: Effect (ReactComponent SlatProps)
6262
mkSlat = do
6363
box <- mkBox
64-
component "Slat" \props ->
64+
reactComponent "Slat" \props ->
6565
pure
6666
$ E.element
6767
box
@@ -79,7 +79,7 @@ mkSlat = do
7979
mkEx :: Effect (ReactComponent {})
8080
mkEx = do
8181
slat <- mkSlat
82-
component "BasicEx" \props -> React.do
82+
reactComponent "BasicEx" \props -> React.do
8383
pure
8484
$ fragment
8585
[ element slat
@@ -93,8 +93,8 @@ mkEx = do
9393
, css =
9494
E.merge
9595
[ E.css
96-
{ padding: E.int 4
97-
, maxWidth: E.int 200
96+
{ padding: E.px 4
97+
, maxWidth: E.px 200
9898
}
9999
, text S
100100
]
@@ -123,7 +123,7 @@ boxStyle =
123123

124124
mkBox :: Effect (ReactComponent BoxProps)
125125
mkBox = do
126-
component "Box" \props ->
126+
reactComponent "Box" \props ->
127127
pure
128128
$ E.element R.div'
129129
{ className: props.className

0 commit comments

Comments
 (0)