@@ -3877,7 +3877,7 @@ FlexBox.defaultProps = {
38773877} ;
38783878
38793879function _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" ] ) ;
38813881
38823882 _templateObject$2 = function _templateObject ( ) {
38833883 return data ;
@@ -3892,7 +3892,7 @@ var ImageBox = styled(FlexBox)(_templateObject$2(), function (props) {
38923892} ) ;
38933893
38943894function _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" ] ) ;
38963896
38973897 _templateObject$3 = function _templateObject ( ) {
38983898 return data ;
@@ -3903,7 +3903,7 @@ function _templateObject$3() {
39033903var ImageInput = styled ( FlexBox ) ( _templateObject$3 ( ) ) ;
39043904
39053905function _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" ] ) ;
39073907
39083908 _templateObject3 = function _templateObject3 ( ) {
39093909 return data ;
@@ -3923,7 +3923,7 @@ function _templateObject2$1() {
39233923}
39243924
39253925function _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" ] ) ;
39273927
39283928 _templateObject$4 = function _templateObject ( ) {
39293929 return data ;
@@ -3943,7 +3943,7 @@ var Button = styled.button(_templateObject$4(), function (props) {
39433943var DeleteImageButton = styled ( Button ) ( _templateObject3 ( ) ) ;
39443944
39453945function _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" ] ) ;
39473947
39483948 _templateObject$5 = function _templateObject ( ) {
39493949 return data ;
@@ -3954,7 +3954,7 @@ function _templateObject$5() {
39543954var Image = styled . img ( _templateObject$5 ( ) ) ;
39553955
39563956function _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" ] ) ;
39583958
39593959 _templateObject$6 = function _templateObject ( ) {
39603960 return data ;
@@ -3974,27 +3974,136 @@ var Text = styled.span(_templateObject$6(), function (props) {
39743974 return props . theme . font . align [ props . textAlign ] ;
39753975} ) ;
39763976Text . defaultProps = {
3977+ color : 'textColor' ,
39773978 fontWeight : 'normal'
39783979} ;
39793980
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+
39804095var theme = {
39814096 buttons : {
39824097 small : {
3983- fontSize : '1.2rem ' ,
4098+ fontSize : '12px ' ,
39844099 fontWeight : 'normal' ,
3985- padding : '0.5rem 1.0rem '
4100+ padding : '5px 10px '
39864101 } ,
39874102 normal : {
3988- fontSize : '1.4rem ' ,
4103+ fontSize : '14px ' ,
39894104 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'
39984107 }
39994108 } ,
40004109 font : {
@@ -4005,10 +4114,10 @@ var theme = {
40054114 right : 'right'
40064115 } ,
40074116 size : {
4008- big : '1.8rem ' ,
4117+ big : '18px ' ,
40094118 inherit : 'inherit' ,
4010- normal : '1.6rem ' ,
4011- small : '1rem '
4119+ normal : '16px ' ,
4120+ small : '10px '
40124121 } ,
40134122 weight : {
40144123 normal : 'normal' ,
@@ -4021,25 +4130,27 @@ var darkTheme = {
40214130 background : '#111111' ,
40224131 outlineColor : 'rgba(255,255,255,0.6)' ,
40234132 textColor : 'rgba(255,255,255,0.6)' ,
4024- buttonColor : '#ff0e1f'
4133+ buttonColor : '#ff0e1f' ,
4134+ modalColor : '#111111'
40254135} ;
40264136var lightTheme = {
40274137 background : '#ffffff' ,
40284138 outlineColor : '#111111' ,
40294139 textColor : 'rgba(255,255,255,0.6)' ,
4030- buttonColor : '#ff0e1f'
4140+ buttonColor : '#ff0e1f' ,
4141+ modalColor : '#ffffff'
40314142} ;
40324143
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" ] ) ;
40354146
4036- _templateObject$7 = function _templateObject ( ) {
4147+ _templateObject$8 = function _templateObject ( ) {
40374148 return data ;
40384149 } ;
40394150
40404151 return data ;
40414152}
4042- var ImageOptionsWrapper = styled ( 'div' ) ( _templateObject$7 ( ) ) ;
4153+ var ImageOptionsWrapper = styled ( 'div' ) ( _templateObject$8 ( ) ) ;
40434154
40444155function DeleteIcon ( props ) {
40454156 return React . createElement ( "svg" , _extends ( {
@@ -4368,7 +4479,10 @@ function MultiImageInput(_ref) {
43684479 } , React__default . createElement ( ImageBox , null , Array ( numberOfImages ) . fill ( ) . map ( function ( _ , index ) {
43694480 return React__default . createElement ( ImageInput , {
43704481 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 , {
43724486 "aria-label" : "Edit Image " . concat ( index ) ,
43734487 role : "button" ,
43744488 onClick : function onClick ( e ) {
@@ -4380,9 +4494,6 @@ function MultiImageInput(_ref) {
43804494 onClick : function onClick ( e ) {
43814495 return removeImage ( e , index ) ;
43824496 }
4383- } ) ) , React__default . createElement ( ImageOverlay , null , React__default . createElement ( Image , {
4384- alt : "uploaded image" . concat ( index ) ,
4385- src : files [ index ]
43864497 } ) ) ) : React__default . createElement ( "div" , {
43874498 role : "button" ,
43884499 onClick : function onClick ( ) {
@@ -4416,21 +4527,20 @@ function MultiImageInput(_ref) {
44164527 } ,
44174528 accept : "image/*"
44184529 } ) ) ;
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 , {
44214534 crop : crop ,
44224535 onChange : setCrop ,
4536+ onComplete : onCropComplete ,
44234537 onImageLoaded : onImageLoaded ,
4424- onComplete : onCropComplete
4425- } ) ) , React__default . createElement ( Button , {
4538+ src : currentImage
4539+ } ) ) ) , React__default . createElement ( Modal . Footer , null , React__default . createElement ( Button , {
44264540 type : "button" ,
44274541 onClick : exitCrop ,
4428- size : "small" ,
4429- style : {
4430- marginTop : '1rem' ,
4431- display : 'block'
4432- }
4433- } , "Crop" ) ) ) ;
4542+ size : "normal"
4543+ } , "Crop" ) ) ) ) ;
44344544}
44354545MultiImageInput . defaultProps = {
44364546 max : 3 ,
0 commit comments