@@ -3877,7 +3877,7 @@ FlexBox.defaultProps = {
3877
3877
} ;
3878
3878
3879
3879
function _templateObject$2 ( ) {
3880
- var data = _taggedTemplateLiteral ( [ "\n background: " , ";\n border: 2px solid " , ";\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n padding: 1.5rem 2rem ;\n margin-bottom: 1rem ;\n" ] ) ;
3880
+ var data = _taggedTemplateLiteral ( [ "\n background: " , ";\n border: 2px solid " , ";\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n margin-bottom: 1rem ;\n padding: 1.5rem 2rem ;\n" ] ) ;
3881
3881
3882
3882
_templateObject$2 = function _templateObject ( ) {
3883
3883
return data ;
@@ -3892,7 +3892,7 @@ var ImageBox = styled(FlexBox)(_templateObject$2(), function (props) {
3892
3892
} ) ;
3893
3893
3894
3894
function _templateObject$3 ( ) {
3895
- var data = _taggedTemplateLiteral ( [ "\n flex-direction: column;\n width: auto ;\n max-width: 9rem ;\n justify-content: center ;\n margin-right: 1rem ;\n position: relative ;\n" ] ) ;
3895
+ var data = _taggedTemplateLiteral ( [ "\n flex-direction: column;\n justify-content: center ;\n margin-right: 1rem ;\n max-width: 9rem ;\n position: relative ;\n width: auto ;\n" ] ) ;
3896
3896
3897
3897
_templateObject$3 = function _templateObject ( ) {
3898
3898
return data ;
@@ -3903,7 +3903,7 @@ function _templateObject$3() {
3903
3903
var ImageInput = styled ( FlexBox ) ( _templateObject$3 ( ) ) ;
3904
3904
3905
3905
function _templateObject3 ( ) {
3906
- var data = _taggedTemplateLiteral ( [ "\n align-items: center;\n border: none;\n display: flex;\n flex-shrink: 0;\n height: 1.5rem;\n justify-content: center;\n padding-right: 0.5px;\n position: absolute;\n right: 0.5rem;\n top: 0.5rem;\n width: 1.5rem;\n z-index: 10;\n background: none; \n &:before,\n &:after {\n background: #ff0e1f;\n border-radius: 2px;\n content: '';\n display: block;\n height: 0.1rem;\n left: 50%;\n position: absolute;\n top: 50%;\n transition: 0.3s all;\n width: 2rem;\n }\n\n &:before {\n transform: translate(-50%, -50%) rotate(45deg);\n }\n\n &:after {\n transform: translate(-50%, -50%) rotate(-45deg);\n }\n" ] ) ;
3906
+ var data = _taggedTemplateLiteral ( [ "\n align-items: center;\n background: none;\n border: none;\n display: flex;\n flex-shrink: 0;\n font-family: inherit;\n height: 1.5rem;\n justify-content: center;\n padding-right: 0.5px;\n position: absolute;\n right: 0.5rem;\n top: 0.5rem;\n width: 1.5rem;\n z-index: 10;\n\n &:before,\n &:after {\n background: #ff0e1f;\n border-radius: 2px;\n content: '';\n display: block;\n height: 0.1rem;\n left: 50%;\n position: absolute;\n top: 50%;\n transition: 0.3s all;\n width: 2rem;\n }\n\n &:before {\n transform: translate(-50%, -50%) rotate(45deg);\n }\n\n &:after {\n transform: translate(-50%, -50%) rotate(-45deg);\n }\n" ] ) ;
3907
3907
3908
3908
_templateObject3 = function _templateObject3 ( ) {
3909
3909
return data ;
@@ -3923,7 +3923,7 @@ function _templateObject2$1() {
3923
3923
}
3924
3924
3925
3925
function _templateObject$4 ( ) {
3926
- var data = _taggedTemplateLiteral ( [ "\n -webkit-appearance: none;\n background-color: " , ";\n color: " , " ;\n border: 0;\n cursor: pointer;\n display: inline-block;\n letter-spacing: 1px;\n line-height: 1;\n outline: none;\n overflow: hidden;\n padding: 0;\n text-decoration: none;\n transition: all 0.3s;\n user-select: none;\n white-space: nowrap;\n ", "\n" ] ) ;
3926
+ var data = _taggedTemplateLiteral ( [ "\n -webkit-appearance: none;\n background-color: " , ";\n border-radius: 5px ;\n border: 0;\n color: " , ";\n cursor: pointer;\n display: inline-block;\n font-family: inherit ;\n letter-spacing: 1px;\n line-height: 1;\n outline: none;\n overflow: hidden;\n padding: 0;\n text-decoration: none;\n transition: all 0.3s;\n user-select: none;\n white-space: nowrap;\n ", "\n" ] ) ;
3927
3927
3928
3928
_templateObject$4 = function _templateObject ( ) {
3929
3929
return data ;
@@ -3943,7 +3943,7 @@ var Button = styled.button(_templateObject$4(), function (props) {
3943
3943
var DeleteImageButton = styled ( Button ) ( _templateObject3 ( ) ) ;
3944
3944
3945
3945
function _templateObject$5 ( ) {
3946
- var data = _taggedTemplateLiteral ( [ "\n width: 100% ;\n display: inline-block ;\n opacity: 0.4;\n" ] ) ;
3946
+ var data = _taggedTemplateLiteral ( [ "\n display: inline-block ;\n height: auto ;\n opacity: 0.4;\n width: 100% ;\n" ] ) ;
3947
3947
3948
3948
_templateObject$5 = function _templateObject ( ) {
3949
3949
return data ;
@@ -3954,7 +3954,7 @@ function _templateObject$5() {
3954
3954
var Image = styled . img ( _templateObject$5 ( ) ) ;
3955
3955
3956
3956
function _templateObject$6 ( ) {
3957
- var data = _taggedTemplateLiteral ( [ "\n &,\n &:visited {\n color: " , ";\n }\n display: inline-block;\n font-size: " , ";\n font-weight: " , ";\n line-height: " , ";\n text-align: " , ";\n" ] ) ;
3957
+ var data = _taggedTemplateLiteral ( [ "\n &,\n &:visited {\n color: " , ";\n }\n display: inline-block;\n font-family: inherit;\n font- size: " , ";\n font-weight: " , ";\n line-height: " , ";\n text-align: " , ";\n" ] ) ;
3958
3958
3959
3959
_templateObject$6 = function _templateObject ( ) {
3960
3960
return data ;
@@ -3974,27 +3974,136 @@ var Text = styled.span(_templateObject$6(), function (props) {
3974
3974
return props . theme . font . align [ props . textAlign ] ;
3975
3975
} ) ;
3976
3976
Text . defaultProps = {
3977
+ color : 'textColor' ,
3977
3978
fontWeight : 'normal'
3978
3979
} ;
3979
3980
3981
+ function _templateObject7 ( ) {
3982
+ var data = _taggedTemplateLiteral ( [ "\n display: flex;\n justify-content: center;\n padding: 0 15px 15px 15px;\n" ] ) ;
3983
+
3984
+ _templateObject7 = function _templateObject7 ( ) {
3985
+ return data ;
3986
+ } ;
3987
+
3988
+ return data ;
3989
+ }
3990
+
3991
+ function _templateObject6 ( ) {
3992
+ var data = _taggedTemplateLiteral ( [ "\n padding: 15px;\n position: relative;\n" ] ) ;
3993
+
3994
+ _templateObject6 = function _templateObject6 ( ) {
3995
+ return data ;
3996
+ } ;
3997
+
3998
+ return data ;
3999
+ }
4000
+
4001
+ function _templateObject5 ( ) {
4002
+ var data = _taggedTemplateLiteral ( [ "\n align-items: center;\n border-bottom: 1px solid " , ";\n display: flex;\n justify-content: center;\n padding: 20px;\n" ] ) ;
4003
+
4004
+ _templateObject5 = function _templateObject5 ( ) {
4005
+ return data ;
4006
+ } ;
4007
+
4008
+ return data ;
4009
+ }
4010
+
4011
+ function _templateObject4 ( ) {
4012
+ var data = _taggedTemplateLiteral ( [ "\n display: flex;\n opacity: 1;\n pointer-events: auto;\n visibility: visible;\n\n " , " {\n transform: translate(0, 0);\n }\n\n " , " {\n opacity: 1;\n }\n " ] ) ;
4013
+
4014
+ _templateObject4 = function _templateObject4 ( ) {
4015
+ return data ;
4016
+ } ;
4017
+
4018
+ return data ;
4019
+ }
4020
+
4021
+ function _templateObject3$1 ( ) {
4022
+ var data = _taggedTemplateLiteral ( [ "\n align-items: center;\n bottom: 0;\n dsplay: flex;\n justify-content: center;\n left: 0;\n opacity: 0;\n pointer-events: none;\n position: fixed;\n right: 0;\n top: 0;\n transition: all 0.3s;\n visibility: hidden;\n z-index: 9;\n\n " , " {\n transform: translate(0, -50px);\n }\n\n " , "\n" ] ) ;
4023
+
4024
+ _templateObject3$1 = function _templateObject3 ( ) {
4025
+ return data ;
4026
+ } ;
4027
+
4028
+ return data ;
4029
+ }
4030
+
4031
+ function _templateObject2$2 ( ) {
4032
+ var data = _taggedTemplateLiteral ( [ "\n background-color: rgba(0, 0, 0, 0.8);\n bottom: 0;\n dsplay: flex;\n left: 0;\n opacity: 0;\n position: fixed;\n right: 0;\n top: 0;\n transition: all 0.3s;\n" ] ) ;
4033
+
4034
+ _templateObject2$2 = function _templateObject2 ( ) {
4035
+ return data ;
4036
+ } ;
4037
+
4038
+ return data ;
4039
+ }
4040
+
4041
+ function _templateObject$7 ( ) {
4042
+ var data = _taggedTemplateLiteral ( [ "\n background-color: " , ";\n border-radius: 5px;\n max-width: 360px;\n transition: transform 0.3s ease-out;\n z-index: 9999;\n" ] ) ;
4043
+
4044
+ _templateObject$7 = function _templateObject ( ) {
4045
+ return data ;
4046
+ } ;
4047
+
4048
+ return data ;
4049
+ }
4050
+ var Content = styled . div ( _templateObject$7 ( ) , function ( _ref ) {
4051
+ var theme = _ref . theme ;
4052
+ return theme . colors . modalColor ;
4053
+ } ) ;
4054
+ var Overlay = styled . div ( _templateObject2$2 ( ) ) ;
4055
+ var Wrapper = styled . div ( _templateObject3$1 ( ) , Content , function ( _ref2 ) {
4056
+ var isOpen = _ref2 . isOpen ;
4057
+ return isOpen && css ( _templateObject4 ( ) , Content , Overlay ) ;
4058
+ } ) ;
4059
+ var HeaderWrapper = styled . div ( _templateObject5 ( ) , function ( _ref3 ) {
4060
+ var theme = _ref3 . theme ;
4061
+ return theme . colors . outlineColor ;
4062
+ } ) ;
4063
+ var Body = styled . div ( _templateObject6 ( ) ) ;
4064
+ var Footer = styled . div ( _templateObject7 ( ) ) ;
4065
+
4066
+ var Header = function Header ( _ref4 ) {
4067
+ var children = _ref4 . children ,
4068
+ props = _objectWithoutProperties ( _ref4 , [ "children" ] ) ;
4069
+
4070
+ return React__default . createElement ( HeaderWrapper , props , React__default . createElement ( Text , {
4071
+ align : "center"
4072
+ } , children ) ) ;
4073
+ } ;
4074
+
4075
+ var Modal = function Modal ( _ref5 ) {
4076
+ var children = _ref5 . children ,
4077
+ isOpen = _ref5 . isOpen ,
4078
+ toggle = _ref5 . toggle ;
4079
+ return React__default . createElement ( Wrapper , {
4080
+ isOpen : isOpen
4081
+ } , React__default . createElement ( Overlay , {
4082
+ onClick : toggle
4083
+ } ) , React__default . createElement ( Content , null , children ) ) ;
4084
+ } ;
4085
+
4086
+ Modal . Header = Header ;
4087
+ Modal . Body = Body ;
4088
+ Modal . Footer = Footer ;
4089
+ Modal . propTypes = {
4090
+ children : propTypes . node . isRequired ,
4091
+ isOpen : propTypes . bool . isRequired ,
4092
+ toggle : propTypes . func . isRequired
4093
+ } ;
4094
+
3980
4095
var theme = {
3981
4096
buttons : {
3982
4097
small : {
3983
- fontSize : '1.2rem ' ,
4098
+ fontSize : '12px ' ,
3984
4099
fontWeight : 'normal' ,
3985
- padding : '0.5rem 1.0rem '
4100
+ padding : '5px 10px '
3986
4101
} ,
3987
4102
normal : {
3988
- fontSize : '1.4rem ' ,
4103
+ fontSize : '14px ' ,
3989
4104
fontWeight : 'normal' ,
3990
- height : '4.0rem' ,
3991
- padding : '0.5rem 1.0rem'
3992
- } ,
3993
- large : {
3994
- fontSize : '1.4rem' ,
3995
- fontWeight : 'bold' ,
3996
- height : '5.0rem' ,
3997
- padding : '1.4rem 3.0rem'
4105
+ height : '35px' ,
4106
+ padding : '5px 10px'
3998
4107
}
3999
4108
} ,
4000
4109
font : {
@@ -4005,10 +4114,10 @@ var theme = {
4005
4114
right : 'right'
4006
4115
} ,
4007
4116
size : {
4008
- big : '1.8rem ' ,
4117
+ big : '18px ' ,
4009
4118
inherit : 'inherit' ,
4010
- normal : '1.6rem ' ,
4011
- small : '1rem '
4119
+ normal : '16px ' ,
4120
+ small : '10px '
4012
4121
} ,
4013
4122
weight : {
4014
4123
normal : 'normal' ,
@@ -4021,25 +4130,27 @@ var darkTheme = {
4021
4130
background : '#111111' ,
4022
4131
outlineColor : 'rgba(255,255,255,0.6)' ,
4023
4132
textColor : 'rgba(255,255,255,0.6)' ,
4024
- buttonColor : '#ff0e1f'
4133
+ buttonColor : '#ff0e1f' ,
4134
+ modalColor : '#111111'
4025
4135
} ;
4026
4136
var lightTheme = {
4027
4137
background : '#ffffff' ,
4028
4138
outlineColor : '#111111' ,
4029
4139
textColor : 'rgba(255,255,255,0.6)' ,
4030
- buttonColor : '#ff0e1f'
4140
+ buttonColor : '#ff0e1f' ,
4141
+ modalColor : '#ffffff'
4031
4142
} ;
4032
4143
4033
- function _templateObject$7 ( ) {
4034
- var data = _taggedTemplateLiteral ( [ "\n align-items: center;\n display: flex;\n height: 2rem;\n justify-content: space-between;\n padding-right: 0.5px;\n position: absolute;\n right: 0.5rem;\n top: 0.2rem;\n width: 3rem;\n z-index: 10;\n cursor: pointer ;\n" ] ) ;
4144
+ function _templateObject$8 ( ) {
4145
+ var data = _taggedTemplateLiteral ( [ "\n align-items: center;\n cursor: pointer;\n display: flex;\n height: 2rem;\n justify-content: space-between;\n padding-right: 0.5px;\n position: absolute;\n right: 0.5rem;\n top: 0.2rem;\n width: 3rem;\n" ] ) ;
4035
4146
4036
- _templateObject$7 = function _templateObject ( ) {
4147
+ _templateObject$8 = function _templateObject ( ) {
4037
4148
return data ;
4038
4149
} ;
4039
4150
4040
4151
return data ;
4041
4152
}
4042
- var ImageOptionsWrapper = styled ( 'div' ) ( _templateObject$7 ( ) ) ;
4153
+ var ImageOptionsWrapper = styled ( 'div' ) ( _templateObject$8 ( ) ) ;
4043
4154
4044
4155
function DeleteIcon ( props ) {
4045
4156
return React . createElement ( "svg" , _extends ( {
@@ -4368,7 +4479,10 @@ function MultiImageInput(_ref) {
4368
4479
} , React__default . createElement ( ImageBox , null , Array ( numberOfImages ) . fill ( ) . map ( function ( _ , index ) {
4369
4480
return React__default . createElement ( ImageInput , {
4370
4481
key : index
4371
- } , files [ index ] ? React__default . createElement ( React__default . Fragment , null , React__default . createElement ( ImageOptionsWrapper , null , React__default . createElement ( EditIcon , {
4482
+ } , files [ index ] ? React__default . createElement ( React__default . Fragment , null , React__default . createElement ( ImageOverlay , null , React__default . createElement ( Image , {
4483
+ alt : "uploaded image" . concat ( index ) ,
4484
+ src : files [ index ]
4485
+ } ) ) , React__default . createElement ( ImageOptionsWrapper , null , React__default . createElement ( EditIcon , {
4372
4486
"aria-label" : "Edit Image " . concat ( index ) ,
4373
4487
role : "button" ,
4374
4488
onClick : function onClick ( e ) {
@@ -4380,9 +4494,6 @@ function MultiImageInput(_ref) {
4380
4494
onClick : function onClick ( e ) {
4381
4495
return removeImage ( e , index ) ;
4382
4496
}
4383
- } ) ) , React__default . createElement ( ImageOverlay , null , React__default . createElement ( Image , {
4384
- alt : "uploaded image" . concat ( index ) ,
4385
- src : files [ index ]
4386
4497
} ) ) ) : React__default . createElement ( "div" , {
4387
4498
role : "button" ,
4388
4499
onClick : function onClick ( ) {
@@ -4416,21 +4527,20 @@ function MultiImageInput(_ref) {
4416
4527
} ,
4417
4528
accept : "image/*"
4418
4529
} ) ) ;
4419
- } ) ) , allowCrop && currentImage && React__default . createElement ( React__default . Fragment , null , React__default . createElement ( ReactCrop , _extends ( { } , cropConfig , {
4420
- src : currentImage ,
4530
+ } ) ) , allowCrop && currentImage && React__default . createElement ( Modal , {
4531
+ isOpen : true ,
4532
+ toggle : exitCrop
4533
+ } , React__default . createElement ( Modal . Header , null , "Crop Image" ) , React__default . createElement ( Modal . Body , null , React__default . createElement ( ReactCrop , _extends ( { } , cropConfig , {
4421
4534
crop : crop ,
4422
4535
onChange : setCrop ,
4536
+ onComplete : onCropComplete ,
4423
4537
onImageLoaded : onImageLoaded ,
4424
- onComplete : onCropComplete
4425
- } ) ) , React__default . createElement ( Button , {
4538
+ src : currentImage
4539
+ } ) ) ) , React__default . createElement ( Modal . Footer , null , React__default . createElement ( Button , {
4426
4540
type : "button" ,
4427
4541
onClick : exitCrop ,
4428
- size : "small" ,
4429
- style : {
4430
- marginTop : '1rem' ,
4431
- display : 'block'
4432
- }
4433
- } , "Crop" ) ) ) ;
4542
+ size : "normal"
4543
+ } , "Crop" ) ) ) ) ;
4434
4544
}
4435
4545
MultiImageInput . defaultProps = {
4436
4546
max : 3 ,
0 commit comments