@@ -4,7 +4,7 @@ import Prelude
44import  Effect  (Effect )
55import  React.Basic.DOM  as  R 
66import  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
99data  Size 
1010  = S 
@@ -15,12 +15,12 @@ border :: forall r. { borderSize :: Size, borderColor :: String | r } -> E.Style
1515border { 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
4444type  SlatProps 
@@ -61,7 +61,7 @@ slatDefaults =
6161mkSlat  ::  Effect  (ReactComponent  SlatProps )
6262mkSlat = 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
7979mkEx  ::  Effect  (ReactComponent  { } )
8080mkEx = 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
124124mkBox  ::  Effect  (ReactComponent  BoxProps )
125125mkBox = do 
126-   component  " Box"   \props -> 
126+   reactComponent  " Box"   \props -> 
127127    pure
128128      $ E .element R .div'
129129          { className: props.className
0 commit comments