@sikka/hawa 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +3 -5
- package/src/blocks/AuthForms/NewPasswordForm.js +80 -14
- package/src/blocks/AuthForms/ResetPasswordForm.js +46 -3
- package/src/blocks/AuthForms/SignInForm.js +60 -13
- package/src/blocks/AuthForms/SignUpForm.js +70 -18
- package/src/blocks/Payment/ChargeWalletForm.js +32 -0
- package/src/blocks/Payment/PayWithWallet.js +35 -0
- package/src/blocks/Payment/SelectPayment.js +15 -16
- package/src/blocks/Payment/index.js +2 -0
- package/src/layout/Box.js +0 -1
- package/src/stories/BlocksStories/AuthForm.stories.js +11 -5
- package/src/stories/BlocksStories/PaymentForm.stories.js +12 -41
- package/src/stories/Introduction.stories.js +132 -110
- package/src/stories/{ActionButton.stories.js → UIStories/ActionButton.stories.js} +2 -2
- package/src/stories/{AdaptiveButton.stories.js → UIStories/AdaptiveButton.stories.js} +2 -2
- package/src/stories/UIStories/Alert.stories.js +55 -0
- package/src/stories/{CheckBox.stories.js → UIStories/CheckBox.stories.js} +3 -4
- package/src/stories/UIStories/InputLabel.stories.js +13 -0
- package/src/stories/{RadioSelector.stories.js → UIStories/RadioSelector.stories.js} +5 -6
- package/src/stories/{TextField.stories.js → UIStories/TextField.stories.js} +4 -5
- package/src/themes/HawaProvider.js +54 -2
- package/src/ui/ApplePayButton.js +0 -1
- package/src/ui/GithubButton.js +0 -1
- package/src/ui/GoogleButton.js +0 -1
- package/src/ui/GooglePayButton.js +1 -2
- package/src/ui/HawaAlert.js +37 -0
- package/src/ui/HawaButton.js +48 -0
- package/src/ui/{Checkbox.js → HawaCheckbox.js} +1 -1
- package/src/ui/HawaInputLabel.js +0 -1
- package/src/ui/HawaLogoButton.js +48 -0
- package/src/ui/{RadioSelector.js → HawaRadio.js} +1 -1
- package/src/ui/HawaTextField.js +52 -57
- package/src/ui/HawaTypography.js +29 -0
- package/src/ui/MadaButton.js +0 -1
- package/src/ui/PayPalButton.js +1 -2
- package/src/ui/STCPayButton.js +1 -2
- package/src/ui/TwitterButton.js +0 -1
- package/src/ui/VisaMasterButton.js +0 -1
- package/src/ui/WalletButton.js +4 -71
- package/src/ui/index.js +8 -5
- package/storybook-static/{1.95be85dd.iframe.bundle.js → 0.0d994c92.iframe.bundle.js} +3 -3
- package/storybook-static/{1.95be85dd.iframe.bundle.js.LICENSE.txt → 0.0d994c92.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/0.0d994c92.iframe.bundle.js.map +1 -0
- package/storybook-static/1.aabc3f3a.iframe.bundle.js +1 -0
- package/storybook-static/{3.d72f7fac.iframe.bundle.js → 2.430bf1e3.iframe.bundle.js} +1 -1
- package/storybook-static/{7.ffb0d84b.iframe.bundle.js → 6.704d1e8d.iframe.bundle.js} +1 -1
- package/storybook-static/{8.68cd1217.iframe.bundle.js → 7.9ce807e3.iframe.bundle.js} +3 -3
- package/storybook-static/{8.68cd1217.iframe.bundle.js.LICENSE.txt → 7.9ce807e3.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/7.9ce807e3.iframe.bundle.js.map +1 -0
- package/storybook-static/{9.488e3969.iframe.bundle.js → 8.c4cb6081.iframe.bundle.js} +1 -1
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.e55ce615.iframe.bundle.js +1 -0
- package/storybook-static/runtime~main.cfefe972.iframe.bundle.js +1 -0
- package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.d75dc38b.iframe.bundle.js.LICENSE.txt → vendors~main.30a2c5d7.iframe.bundle.js.LICENSE.txt} +15 -0
- package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js.map +1 -0
- package/src/stories/Alert.stories.js +0 -41
- package/src/stories/InputLabel.stories.js +0 -92
- package/src/ui/StyledAlert.js +0 -30
- package/storybook-static/0.54f7e52e.iframe.bundle.js +0 -1
- package/storybook-static/1.95be85dd.iframe.bundle.js.map +0 -1
- package/storybook-static/2.eb601582.iframe.bundle.js +0 -1
- package/storybook-static/8.68cd1217.iframe.bundle.js.map +0 -1
- package/storybook-static/main.044648aa.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.3e280e98.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.d75dc38b.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.d75dc38b.iframe.bundle.js.map +0 -1
package/es/index.es.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{createContext as t,useContext as o}from"react";import r from"@mui/material/Button";import n,{jsx as i,jsxs as a,Fragment as l}from"react/jsx-runtime";import{darken as d,styled as c,alpha as u}from"@mui/material/styles";import s from"@mui/material/InputBase";import p from"prop-types";import f from"@mui/material/InputLabel";import h from"@mui/material/utils";function m(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function b(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?m(Object(o),!0).forEach((function(t){g(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):m(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function g(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var y=t({borderRadius:10,primaryColor:"blue",secondaryColor:"grey",primaryActionColor:"grey",secondaryActionColor:"#4cc9f0",layoutColor:"#d3d4d9",textColor:"black",inputColor:"white",lightBackground:"#FBF5F3",darkBackground:"#0F0E0E",margins:10,paddings:10,allBorderRadius:10,actionButton:{primary:{borderRadius:10,backgroundColor:"#f90900",color:"white",margin:10,padding:10},secondary:{borderRadius:10,margin:10,padding:10,backgroundColor:"#FF8811",color:"black"}},layout:{primary:{backgroundColor:"#d3d4d9",color:"black",margin:10,padding:10,borderRadius:10},secondary:{backgroundColor:"#001E3C",color:"white",margin:10,padding:10,borderRadius:10}},inputFields:{primary:{backgroundColor:"white",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",borderRadius:10},secondary:{backgroundColor:"white",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",borderRadius:10}}}),v=function(e){var t,n=o(y),a=Object.keys(n.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())})),l={};a?l=b(b({},n.actionButton[a]),{},{margin:e.last?0:n.actionButton[a].margin,marginTop:e.last?2*n.actionButton[a].margin:0,"&:hover":{backgroundColor:d(null===(t=n.actionButton[a])||void 0===t?void 0:t.backgroundColor,.1)}}):l={backgroundColor:"black",color:"white",padding:10,marginTop:e.last?20:0};var u=c(r)((function(e){return e.theme,b({},l)}));return i(u,b(b({},e),{},{children:e.text}))},C=function(e){var t=o(y),r={};console.log(Object.keys(t.actionButton));var n=Object.keys(t.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())}));return r=n?{margin:15,marginRight:5,marginLeft:5,color:t.layout[n].color}:{margin:15,marginRight:0,marginLeft:0,color:"black"},i(f,{style:r,children:i("div",{style:{fontSize:15},children:e.label})})},k=function(e){var t=o(y),r=Object.keys(t.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())})),n={};n=r?b(b({},t.inputFields[r]),{},{margin:e.last?0:t.inputFields[r].margin,marginTop:e.last?2*t.inputFields[r].margin:0}):{backgroundColor:"white",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start"};var d=c(s)((function(e){var t=e.theme;return{"& .MuiInputBase-input":b({backgroundColor:"light"===t.palette.mode?"#fcfcfb":"#2b2b2b",transition:t.transitions.create(["border-color","background-color","box-shadow"]),"&:focus":{boxShadow:"".concat(u(t.palette.primary.main,.25)," 0 0 0 0.2rem"),borderColor:t.palette.primary.main},borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,padding:"10px 12px"},n)}}));return a(l,{children:[e.inputLabel?i(C,{themeType:e.themeType,label:e.inputLabel}):null,i(d,{fullWidth:!0,"aria-label":"dws"})]})};k.propTypes={type:p.oneOf(["text","number"]),helperText:p.string};var x,w=function(e){var t=o(y),n={};console.log(Object.keys(t.actionButton));var l=Object.keys(t.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:t.layout[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:t.layout[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:t.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var u=c(r)((function(e){var t=e.theme;return b(b({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(u,{onClick:e.handleClick,children:[i("img",{src:"https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg"}),i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},T={},j={exports:{}};(x=j).exports=function(e){return e&&e.__esModule?e:{default:e}},x.exports.__esModule=!0,x.exports.default=x.exports;var O={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=h}(O);var L=j.exports;Object.defineProperty(T,"__esModule",{value:!0});var R=T.default=void 0;!function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=B(t);if(o&&o.has(e))return o.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,o&&o.set(e,r)}(e);var P=n;function B(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(B=function(e){return e?o:t})(e)}var S=(0,L(O).default)((0,P.jsx)("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub");R=T.default=S;var I=function(e){var t=o(y),n={};console.log(Object.keys(t.actionButton));var l=Object.keys(t.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:t.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:t.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:t.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var u=c(r)((function(e){var t=e.theme;return b(b({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(u,{onClick:e.handleClick,children:[i(R,{}),i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},M={},D=j.exports;Object.defineProperty(M,"__esModule",{value:!0});var z=M.default=void 0;!function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=F(t);if(o&&o.has(e))return o.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,o&&o.set(e,r)}(e);var W=n;function F(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(F=function(e){return e?o:t})(e)}var A=(0,D(O).default)((0,W.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"}),"Twitter");z=M.default=A;var _=function(e){var t=o(y),n={};console.log(Object.keys(t.actionButton));var l=Object.keys(t.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:t.layout[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:t.layout[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:t.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var u=c(r)((function(e){var t=e.theme;return b(b({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(u,{onClick:e.handleClick,children:[i(z,{}),i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},G=function(e){var t=o(y),n={};console.log(Object.keys(t.actionButton));var l=Object.keys(t.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:t.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:t.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:t.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var u=c(r)((function(e){var t=e.theme;return b(b({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(u,{onClick:e.handleClick,children:[i("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png",height:30})," ",i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},E=function(e){var t=o(y),n={};console.log(Object.keys(t.actionButton));var l=Object.keys(t.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:t.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:t.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:t.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var u=c(r)((function(e){var t=e.theme;return b(b({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(u,{onClick:e.handleClick,children:[i("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png",height:30})," ",i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},U=function(e){var t=o(y),n={};console.log(Object.keys(t.actionButton));var l=Object.keys(t.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:t.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:t.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:t.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var u=c(r)((function(e){var t=e.theme;return b(b({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(u,{onClick:e.handleClick,children:[i("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png",height:30})," ",i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},N=function(e){var t=o(y),n={};console.log(Object.keys(t.actionButton));var l=Object.keys(t.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:t.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:t.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:t.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var u=c(r)((function(e){var t=e.theme;return b(b({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(u,{onClick:e.handleClick,children:[i("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png",height:30})," ",i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},H=function(e){var t=o(y),n={};console.log(Object.keys(t.actionButton));var l=Object.keys(t.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:t.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:t.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:t.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var u=c(r)((function(e){var t=e.theme;return b(b({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(u,{onClick:e.handleClick,children:[i("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png",height:40})," ",i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},V=function(e){var t=o(y),n={};console.log(Object.keys(t.actionButton));var l=Object.keys(t.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:t.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:t.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:t.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var u=c(r)((function(e){var t=e.theme;return b(b({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(u,{onClick:e.handleClick,children:[i("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png",height:30})," ",i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},q={},J=j.exports;Object.defineProperty(q,"__esModule",{value:!0});var K=q.default=void 0,Q=n,X=(0,J(O).default)((0,Q.jsx)("path",{d:"M21 18v1c0 1.1-.9 2-2 2H5c-1.11 0-2-.9-2-2V5c0-1.1.89-2 2-2h14c1.1 0 2 .9 2 2v1h-9c-1.11 0-2 .9-2 2v8c0 1.1.89 2 2 2h9zm-9-2h10V8H12v8zm4-2.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"}),"AccountBalanceWallet");K=q.default=X;var Y=function(e){var t=o(y),n={};console.log(Object.keys(t.actionButton));var l=Object.keys(t.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:t.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:t.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:t.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var u=c(r)((function(e){var t=e.theme;return b(b({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(u,{onClick:e.handleClick,children:[i(K,{}),i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},Z=function(e){var t=o(y),r={};console.log(Object.keys(t.actionButton));var n=Object.keys(t.actionButton).find((function(t){var o;return t.toLowerCase()===(null===(o=e.themeType)||void 0===o?void 0:o.toLowerCase())}));return r=n?b(b({display:"flex",flexDirection:"column"},t.layout[n]),{},{backgroundColor:e.noColor?"none":t.layout[n].backgroundColor,padding:e.noPadding?0:t.layout[n].padding,margin:e.noMargin?0:t.layout[n].margin,maxWidth:e.maxWidth}):{display:"flex",flexDirection:"column",color:"white",marginTop:e.last?20:0,backgroundColor:e.noColor?"none":"lightGrey",padding:e.noPadding?0:10,margin:e.noMargin?0:10,maxWidth:e.maxWidth,borderRadius:0},i("div",{style:r,children:e.children})},$=function(e){return a(Z,{maxWidth:400,children:[i(C,{type:"text",inputLabel:"First Name"}),i(C,{type:"text",inputLabel:"Last Name"}),i(C,{type:"email",inputLabel:"Email"}),i(C,{type:"password",inputLabel:"Password"}),i(v,{last:!0,text:"Update Account"})]})},ee=function(e){return a(Z,{maxWidth:400,children:[i(k,{type:"text",inputLabel:"First Name"}),i(k,{type:"text",inputLabel:"Last Name"}),i(k,{type:"email",inputLabel:"Email"}),i(k,{type:"password",inputLabel:"Password"}),i(v,{last:!0,text:"Update Account"})]})},te=function(e){return o(y),i(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:a(Z,{themeType:e.theme,noMargin:!0,children:[i(k,{themeType:e.theme,type:"password",inputLabel:"Password"}),i(k,{themeType:e.theme,type:"password",inputLabel:"Confirm Password"}),i(v,{themeType:e.theme,last:!0,text:"Reset Password"})]})})},oe=function(e){return i(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:a(Z,{themeType:e.theme,noMargin:!0,children:[i(k,{themeType:e.theme,type:"text",inputLabel:"Email"}),i(v,{themeType:e.theme,last:!0,text:"Reset Password"})]})})},re=function(e){return a(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:[a(Z,{themeType:e.theme,noMargin:!0,children:[i(k,{themeType:e.theme,type:"text",inputLabel:"Email"}),i(k,{themeType:e.theme,type:"text",inputLabel:"Password"}),i(k,{themeType:e.theme,type:"text",inputLabel:"Confirm Password"}),i(v,{text:"Sign Up",last:!0,themeType:e.theme,onClick:e.handleSignUp})]}),e.viaGoogle&&i(w,{outlined:!0,themeType:e.theme,buttonText:e.googleButtonLabel,handleClick:e.handleGoogleSignIn}),e.viaGithub&&i(I,{outlined:!0,themeType:e.theme,buttonText:e.githubButtonLabel,handleClick:e.handleGithubSignUp}),e.viaTwitter&&i(_,{outlined:!0,themeType:e.theme,buttonText:e.twitterButtonLabel,handleClick:e.handleTwitterSignIn})]})};re.propTypes={theme:p.oneOf(["secondary","primary"])};var ne=function(e){return a(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:[a(Z,{themeType:e.theme,noMargin:!0,children:[i(k,{themeType:e.theme,type:"text",inputLabel:"Email"}),i(k,{themeType:e.theme,type:"text",inputLabel:"Password"}),i(v,{last:!0,text:"Sign In",themeType:e.theme,onClick:e.handleSignIn})]}),e.viaGoogle&&i(w,{themeType:e.theme,outlined:!0,buttonText:e.googleButtonLabel,handleClick:e.handleGoogleSignIn}),e.viaGithub&&i(I,{outlined:!0,themeType:e.theme,buttonText:e.githubButtonLabel,handleClick:e.handleGithubSignIn}),e.viaTwitter&&i(_,{outlined:!0,themeType:e.theme,buttonText:e.twitterButtonLabel,handleClick:e.handleTwitterSignIn})]})},ie=function(e){return i(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:a(Z,{themeType:e.theme,noMargin:!0,children:[i("div",{children:"Choose Payment"}),e.viaWallet&&i(Y,{themeType:e.theme,outlined:!0,buttonText:e.walletLabel,handleClick:e.handleWallet}),e.viaCreditCard&&i(G,{themeType:e.theme,outlined:!0,buttonText:e.visaMasterLabel,handleClick:e.handleCreditCard}),e.viaMada&&i(E,{themeType:e.theme,outlined:!0,buttonText:e.madaLabel,handleClick:e.handleMada}),e.viaSTCPay&&i(U,{themeType:e.theme,outlined:!0,buttonText:e.stcPayLabel,handleClick:e.handleSTCPay}),e.viaPayPal&&i(N,{themeType:e.theme,outlined:!0,buttonText:e.paypalLabel,handleClick:e.handlePayPal}),e.viaGooglePay&&i(V,{themeType:e.theme,outlined:!0,buttonText:e.googlePayLabel,handleClick:e.handleGooglePay}),e.viaApplePay&&i(H,{themeType:e.theme,outlined:!0,buttonText:e.applePayLabel,handleClick:e.handleApplePay})]})})};k.propTypes={theme:p.oneOf(["secondary","primary"]),viaApplePay:p.bool,viaGooglePay:p.bool,viaSTCPay:p.bool,viaCreditCard:p.bool,viaPayPal:p.bool,handleApplePay:p.func};var ae=function(e){return i(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:a(Z,{themeType:e.theme,noMargin:!0,children:[i(k,{themeType:e.theme,type:"text",inputLabel:"Email"}),i(k,{themeType:e.theme,type:"text",inputLabel:"Password"}),i(v,{last:!0,text:"Sign In",themeType:e.theme,onClick:e.handleSignIn})]})})};export{ae as CreditCardForm,te as NewPasswordForm,oe as ResetPasswordForm,ie as SelectPayment,ne as SignInForm,re as SignUpForm,$ as UserProfile,ee as UserSettings};
|
|
1
|
+
import{createContext as e,useContext as t,useState as r}from"react";import o from"@mui/material/Button";import"@mui/material/Tooltip";import n from"prop-types";import{jsx as i,jsxs as a,Fragment as l}from"react/jsx-runtime";import{darken as d,styled as u}from"@mui/material/styles";import"@mui/material/FormControlLabel";import"@mui/material/Checkbox";import s from"@mui/material/InputBase";import c from"@mui/material/Typography";import m from"@mui/material/InputLabel";import{useFormContext as p,Controller as h,useForm as f,FormProvider as g}from"react-hook-form";import b from"@mui/material/Alert";import y from"@mui/material/AlertTitle";import v from"@mui/icons-material/GitHub";import C from"@mui/icons-material/Twitter";import x from"@mui/icons-material/AccountBalanceWallet";import"@mui/material";function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){T(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function L(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return S(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var R=e({borderRadius:10,primaryColor:"blue",secondaryColor:"grey",primaryActionColor:"grey",secondaryActionColor:"#4cc9f0",layoutColor:"#d3d4d9",textColor:"black",inputColor:"white",lightBackground:"#FBF5F3",darkBackground:"#0F0E0E",testcolor:"green",margins:10,paddings:10,allBorderRadius:10,typography:{primary:{color:"black"},secondary:{color:"white"}},logoButton:{primary:{borderRadius:10,backgroundColor:"#f90900",padding:10,border:"1px solid #ced4da",height:50,"&:focus":{borderColor:"green"}},secondary:{borderRadius:10,backgroundColor:"#f90900",padding:10,border:"1px solid #ced4da",height:50,"&:focus":{borderColor:"green"}}},actionButton:{primary:{borderRadius:10,backgroundColor:"#f90900",color:"white",margin:10,padding:10,border:"1px solid #ced4da",fontSize:16,height:50,"&:focus":{borderColor:"red"}},secondary:{borderRadius:10,margin:10,padding:10,backgroundColor:"#FF8811",color:"black"}},layout:{primary:{backgroundColor:"#d3d4d9",color:"black",margin:10,padding:10,borderRadius:10},secondary:{backgroundColor:"#001E3C",color:"white",margin:10,padding:10,borderRadius:10}},inputFields:{primary:{backgroundColor:"white",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",borderRadius:10,"&:focus":{borderColor:"#f90900"}},secondary:{backgroundColor:"white",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",borderRadius:10}},alerts:{primary:{marginBottom:10,padding:10,borderRadius:10},secondary:{marginBottom:10,padding:10,borderRadius:10}}});n.string,n.bool,n.bool,n.bool;var P=function(e){var r,n=t(R),a=Object.keys(n.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())})),l={};a?l=k(k({},n.actionButton[a]),{},{margin:e.last?0:n.actionButton[a].margin,marginTop:e.last?2*n.actionButton[a].margin:0,"&:hover":{backgroundColor:d(null===(r=n.actionButton[a])||void 0===r?void 0:r.backgroundColor,.1)}}):l={backgroundColor:"black",color:"white",padding:10,marginTop:e.last?20:0};var s=u(o)((function(e){return e.theme,k({},l)}));return i(s,k(k({},e),{},{children:e.text}))},B=function(e){var r,n=t(R),a={},l=Object.keys(n.logoButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())}));l?a=k(k({},n.logoButton[l]),{},{border:e.outlined?"2px solid black":"none",backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}):a={cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:null===(r=n.logoButton[l])||void 0===r?void 0:r.margin,border:e.outlined?"2px solid black":"none",height:50,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var s=u(o)((function(e){return e.theme,k({},a)}));return i(s,k(k({},e),{},{children:e.children}))},j=function(e){var r=t(R),o={},n=Object.keys(r.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())}));return o=n?{margin:15,marginRight:5,marginLeft:5,color:r.layout[n].color}:{margin:15,marginRight:0,marginLeft:0,color:"black"},i(m,{style:o,children:i("div",{style:{fontSize:15},children:e.label})})},I=function(e){var r=p(),o=r.control,n=r.register,d=t(R),m=Object.keys(d.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())})),f={};f=m?k(k({},d.inputFields[m]),{},{margin:e.last?0:d.inputFields[m].margin,marginTop:e.last?2*d.inputFields[m].margin:0}):{backgroundColor:"white",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start"};var g=u(s)((function(t){var r=t.theme;return{"& .MuiInputBase-input":k({backgroundColor:"light"===r.palette.mode?"#fcfcfb":"#2b2b2b",transition:r.transitions.create(["border-color","background-color","box-shadow"]),"&:focus":{},borderRadius:4,border:"1px solid #ced4da",fontSize:16,padding:"10px 12px",marginBottom:e.helperText?5:0},f)}}));return i(h,{render:function(t){var r;return t.field,a(l,{children:[e.inputLabel&&i(j,{themeType:e.themeType,label:e.inputLabel}),i(g,k(k({fullWidth:!0,type:null!==(r=e.type)&&void 0!==r?r:"text",defaultValue:e.defaultValue&&"",value:e.value&&""},e),n(e.name))),i(c,{variant:"caption",style:{margin:5,color:"red"},children:e.helperText})]})},name:e.name,rules:e.rules,control:o,shouldUnregister:e.shouldUnregister})};I.propTypes={type:n.oneOf(["text","number","password"]),helperText:n.string};var O=function(e){var r=t(R),o=Object.keys(r.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())})),n={};n=o?k({},r.typography[o]):{color:"black"};var a=u(c)((function(e){return e.theme,k({},n)}));return i(a,k(k({},e),{},{children:e.children}))},W=function(e){var r=t(R),o=Object.keys(r.alerts).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())})),n={};n=o?k({},r.alerts[o]):{marginBottom:10};var l=u(b)((function(e){return e.theme,k({},n)}));return a(l,k(k({themeType:e.themeType},e),{},{children:[e.title&&i(y,{children:e.title}),e.text]}))},z=function(e){var r=t(R),n={},l=Object.keys(r.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.layout[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:r.layout[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var s=u(o)((function(e){var t=e.theme;return k(k({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(s,{onClick:e.handleClick,children:[i("img",{src:"https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg"}),i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},A=function(e){var r=t(R),n={},l=Object.keys(r.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:r.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var s=u(o)((function(e){var t=e.theme;return k(k({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(s,{onClick:e.handleClick,children:[i(v,{}),i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},D=function(e){var r=t(R),n={},l=Object.keys(r.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.layout[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:r.layout[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var s=u(o)((function(e){var t=e.theme;return k(k({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(s,{onClick:e.handleClick,children:[i(C,{}),i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},F=function(e){var r=t(R),n={},l=Object.keys(r.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:r.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var s=u(o)((function(e){var t=e.theme;return k(k({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(s,{onClick:e.handleClick,children:[i("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png",height:30})," ",i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},M=function(e){var r=t(R),n={},l=Object.keys(r.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:r.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var s=u(o)((function(e){var t=e.theme;return k(k({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(s,{onClick:e.handleClick,children:[i("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png",height:30})," ",i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},E=function(e){var r=t(R),n={},l=Object.keys(r.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:r.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var s=u(o)((function(e){var t=e.theme;return k(k({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(s,{onClick:e.handleClick,children:[i("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png",height:20})," ",i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},q=function(e){var r=t(R),n={},l=Object.keys(r.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:r.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var s=u(o)((function(e){var t=e.theme;return k(k({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(s,{onClick:e.handleClick,children:[i("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png",height:25})," ",i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},G=function(e){var r=t(R),n={},l=Object.keys(r.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:r.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var s=u(o)((function(e){var t=e.theme;return k(k({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(s,{onClick:e.handleClick,children:[i("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png",height:40})," ",i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},V=function(e){var r=t(R),n={},l=Object.keys(r.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())}));n=l?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[l].margin,border:e.outlined?"2px solid black":"none",borderRadius:r.actionButton[l].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:e.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:d("#ffffff",.1)}};var s=u(o)((function(e){var t=e.theme;return k(k({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},n),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return a(s,{onClick:e.handleClick,children:[i("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png",height:20})," ",i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]})},U=function(e){return a(B,k(k({},e),{},{children:[i(x,{}),i("div",{style:{width:10}}),i("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]}))},Z=function(e){var r=t(R),o={},n=Object.keys(r.actionButton).find((function(t){var r;return t.toLowerCase()===(null===(r=e.themeType)||void 0===r?void 0:r.toLowerCase())}));return o=n?k(k({display:"flex",flexDirection:"column"},r.layout[n]),{},{backgroundColor:e.noColor?"none":r.layout[n].backgroundColor,padding:e.noPadding?0:r.layout[n].padding,margin:e.noMargin?0:r.layout[n].margin,maxWidth:e.maxWidth}):{display:"flex",flexDirection:"column",color:"white",marginTop:e.last?20:0,backgroundColor:e.noColor?"none":"lightGrey",padding:e.noPadding?0:10,margin:e.noMargin?0:10,maxWidth:e.maxWidth,borderRadius:0},i("div",{style:o,children:e.children})},N=function(e){return a(Z,{maxWidth:400,children:[i(j,{type:"text",inputLabel:"First Name"}),i(j,{type:"text",inputLabel:"Last Name"}),i(j,{type:"email",inputLabel:"Email"}),i(j,{type:"password",inputLabel:"Password"}),i(P,{last:!0,text:"Update Account"})]})},$=function(e){return a(Z,{maxWidth:400,children:[i(I,{type:"text",inputLabel:"First Name"}),i(I,{type:"text",inputLabel:"Last Name"}),i(I,{type:"email",inputLabel:"Email"}),i(I,{type:"password",inputLabel:"Password"}),i(P,{last:!0,text:"Update Account"})]})},_=function(e){var t,o,n=L(r(""),2),l=n[0],d=n[1],u=L(r(""),2);u[0],u[1];var s=L(r(!1),2);s[0],s[1];var c=L(r(""),2);c[0],c[1];var m=L(r(!0),2);m[0],m[1];var p=f(),h=p.formState.errors,b=p.handleSubmit;return p.getValues,p.register,p.watch,p.reset,p.setValue,i(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:a(Z,{themeType:e.theme,noMargin:!0,children:[e.error&&i(W,{themeType:e.theme,text:"This is a new password alert",severity:"error"}),i(g,k(k({},p),{},{children:a("form",{onSubmit:b(e.handleNewPassword),children:[i(I,{name:"password",themeType:e.theme,type:"password",inputLabel:"Password",onChange:function(e){return d(e.target.value)},value:l,rules:{required:"Password is rquired"},helperText:null===(t=h.password)||void 0===t?void 0:t.message}),i(I,{themeType:e.theme,name:"confirmPassword",type:"password",inputLabel:"Confirm Password",rules:{required:"Password is rquired"},helperText:null===(o=h.confirmPassword)||void 0===o?void 0:o.message}),i(P,{fullWidth:!0,type:"submit",themeType:e.theme,last:!0,text:"Reset Password"})]})}))]})})},H=function(e){var t,r=f(),o=r.formState.errors,n=r.handleSubmit;return r.getValues,r.register,r.watch,r.reset,r.setValue,i(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:a(Z,{themeType:e.theme,noMargin:!0,children:[e.error&&i(W,{themeType:e.theme,text:"This is a reset password alert",severity:"error"}),i(g,k(k({},r),{},{children:a("form",{onSubmit:n(e.handleResetPassword),children:[i(I,{type:"text",name:"email",inputLabel:"Email",themeType:e.theme,rules:{required:"Email is required",pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:"Invalid email address"}},helperText:null===(t=o.email)||void 0===t?void 0:t.message}),i(P,{fullWidth:!0,themeType:e.theme,last:!0,type:"submit",text:"Reset Password"})]})}))," "]})})},J=function(e){var t,r,o,n=f(),l=n.formState.errors,d=n.handleSubmit;return n.getValues,n.register,n.watch,n.reset,n.setValue,a(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:[a(Z,{themeType:e.theme,noMargin:!0,children:[e.error&&i(W,{themeType:e.theme,text:"This is a sign in alert",severity:"error"}),i(g,k(k({},n),{},{children:a("form",{onSubmit:d(e.handleSignUp),children:[i(I,{themeType:e.theme,type:"text",inputLabel:"Email",placeholder:"Email",name:"email",rules:{required:"Email is required",pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:"Invalid email address"}},helperText:null===(t=l.email)||void 0===t?void 0:t.message}),i(I,{name:"password",placeholder:"Password",themeType:e.theme,type:"password",inputLabel:"Password",rules:{required:"Password is rquired"},helperText:null===(r=l.password)||void 0===r?void 0:r.message}),i(I,{name:"confirmPassword",placeholder:"Password",themeType:e.theme,type:"password",inputLabel:"Confirm Password",rules:{required:"Password is rquired"},helperText:null===(o=l.confirmPassword)||void 0===o?void 0:o.message}),i(P,{fullWidth:!0,type:"submit",text:"Sign Up",last:!0,themeType:e.theme})]})}))]}),e.viaGoogle&&i(z,{outlined:!0,themeType:e.theme,buttonText:e.googleButtonLabel,handleClick:e.handleGoogleSignIn}),e.viaGithub&&i(A,{outlined:!0,themeType:e.theme,buttonText:e.githubButtonLabel,handleClick:e.handleGithubSignUp}),e.viaTwitter&&i(D,{outlined:!0,themeType:e.theme,buttonText:e.twitterButtonLabel,handleClick:e.handleTwitterSignIn})]})};J.propTypes={theme:n.oneOf(["secondary","primary"])};var K=function(e){var t,r,o=f(),n=o.formState.errors,l=o.handleSubmit;return o.getValues,o.register,o.watch,o.reset,o.setValue,a(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:[a(Z,{themeType:e.theme,noMargin:!0,children:[e.error&&i(W,{themeType:e.theme,text:"This is a sign in alert",severity:"error"}),i(g,k(k({},o),{},{children:a("form",{onSubmit:l(e.handleSignIn),children:[i(I,{type:"text",name:"email",inputLabel:"Email",placeholder:"Email",themeType:e.theme,rules:{required:"Email is required",pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:"Invalid email address"}},helperText:null===(t=n.email)||void 0===t?void 0:t.message}),i(I,{name:"password",placeholder:"Password",themeType:e.theme,type:"password",inputLabel:"Password",rules:{required:"Password is rquired"},helperText:null===(r=n.password)||void 0===r?void 0:r.message}),i(P,{type:"submit",fullWidth:!0,last:"true",text:"Sign In",themeType:e.theme})]})}))]}),e.viaGoogle&&i(z,{themeType:e.theme,outlined:!0,buttonText:e.googleButtonLabel,handleClick:e.handleGoogleSignIn}),e.viaGithub&&i(A,{outlined:!0,themeType:e.theme,buttonText:e.githubButtonLabel,handleClick:e.handleGithubSignIn}),e.viaTwitter&&i(D,{outlined:!0,themeType:e.theme,buttonText:e.twitterButtonLabel,handleClick:e.handleTwitterSignIn})]})},Q=function(e){return i(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:a(Z,{themeType:e.theme,noMargin:!0,children:[i(O,{themeType:e.theme,align:"center",children:"Choose Payment"}),e.viaWallet&&i(U,{outlined:!0,themeType:e.theme,buttonText:e.walletLabel,onClick:e.handleWallet}),e.viaCreditCard&&i(F,{outlined:!0,themeType:e.theme,buttonText:e.visaMasterLabel,handleClick:e.handleCreditCard}),e.viaMada&&i(M,{outlined:!0,themeType:e.theme,buttonText:e.madaLabel,handleClick:e.handleMada}),e.viaSTCPay&&i(E,{outlined:!0,themeType:e.theme,buttonText:e.stcPayLabel,handleClick:e.handleSTCPay}),e.viaPayPal&&i(q,{outlined:!0,themeType:e.theme,buttonText:e.paypalLabel,handleClick:e.handlePayPal}),e.viaGooglePay&&i(V,{outlined:!0,themeType:e.theme,buttonText:e.googlePayLabel,handleClick:e.handleGooglePay}),e.viaApplePay&&i(G,{outlined:!0,themeType:e.theme,buttonText:e.applePayLabel,handleClick:e.handleApplePay})]})})};I.propTypes={theme:n.oneOf(["secondary","primary"]),viaApplePay:n.bool,viaGooglePay:n.bool,viaSTCPay:n.bool,viaCreditCard:n.bool,viaPayPal:n.bool,handleApplePay:n.func};var X=function(e){return i(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:a(Z,{themeType:e.theme,noMargin:!0,children:[i(I,{themeType:e.theme,type:"text",inputLabel:"Email"}),i(I,{themeType:e.theme,type:"text",inputLabel:"Password"}),i(P,{last:!0,text:"Sign In",themeType:e.theme,onClick:e.handleSignIn})]})})},Y=function(e){var t=L(r(0),2),o=t[0],n=t[1];return i(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:a(Z,{themeType:e.theme,noMargin:!0,children:[a(O,{variant:"h2",align:"center",themeType:e.theme,children:[o.toLocaleString("en")," ",i("span",{style:{fontSize:20,letterSpacing:1},children:e.currency})]}),i(O,{themeType:e.theme}),i(I,{themeType:e.theme,type:"number",inputLabel:"Amount",onChange:function(e){return n(e.target.value)}}),i(P,{last:!0,text:"Charge Wallet",themeType:e.theme,onClick:e.handleSignIn})]})})},ee=function(e){return i(Z,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:a(Z,{themeType:e.theme,noMargin:!0,children:[i("div",{children:"Wallet Balance"}),e.viaWallet&&i(U,{themeType:e.theme,outlined:!0,buttonText:e.walletLabel,handleClick:e.handleWallet})]})})};export{Y as ChargeWalletForm,X as CreditCardForm,_ as NewPasswordForm,ee as PayWithWallet,H as ResetPasswordForm,Q as SelectPayment,K as SignInForm,J as SignUpForm,N as UserProfile,$ as UserSettings};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@mui/material/Button"),o=require("react/jsx-runtime"),r=require("@mui/material/styles"),n=require("@mui/material/InputBase"),i=require("prop-types"),a=require("@mui/material/InputLabel"),l=require("@mui/material/utils");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=d(e),u=d(t),c=d(o),f=d(n),p=d(i),h=d(a),b=d(l);function m(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function g(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?m(Object(o),!0).forEach((function(t){y(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):m(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function y(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var x={borderRadius:10,primaryColor:"blue",secondaryColor:"grey",primaryActionColor:"grey",secondaryActionColor:"#4cc9f0",layoutColor:"#d3d4d9",textColor:"black",inputColor:"white",lightBackground:"#FBF5F3",darkBackground:"#0F0E0E",margins:10,paddings:10,allBorderRadius:10,actionButton:{primary:{borderRadius:10,backgroundColor:"#f90900",color:"white",margin:10,padding:10},secondary:{borderRadius:10,margin:10,padding:10,backgroundColor:"#FF8811",color:"black"}},layout:{primary:{backgroundColor:"#d3d4d9",color:"black",margin:10,padding:10,borderRadius:10},secondary:{backgroundColor:"#001E3C",color:"white",margin:10,padding:10,borderRadius:10}},inputFields:{primary:{backgroundColor:"white",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",borderRadius:10},secondary:{backgroundColor:"white",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",borderRadius:10}}},v=e.createContext(x),C=function(t){var n,i=e.useContext(v),a=Object.keys(i.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())})),l={};a?l=g(g({},i.actionButton[a]),{},{margin:t.last?0:i.actionButton[a].margin,marginTop:t.last?2*i.actionButton[a].margin:0,"&:hover":{backgroundColor:r.darken(null===(n=i.actionButton[a])||void 0===n?void 0:n.backgroundColor,.1)}}):l={backgroundColor:"black",color:"white",padding:10,marginTop:t.last?20:0};var d=r.styled(u.default)((function(e){return e.theme,g({},l)}));return o.jsx(d,g(g({},t),{},{children:t.text}))},k=function(t){var r=e.useContext(v),n={};console.log(Object.keys(r.actionButton));var i=Object.keys(r.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())}));return n=i?{margin:15,marginRight:5,marginLeft:5,color:r.layout[i].color}:{margin:15,marginRight:0,marginLeft:0,color:"black"},o.jsx(h.default,{style:n,children:o.jsx("div",{style:{fontSize:15},children:t.label})})},j=function(t){var n=e.useContext(v),i=Object.keys(n.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())})),a={};a=i?g(g({},n.inputFields[i]),{},{margin:t.last?0:n.inputFields[i].margin,marginTop:t.last?2*n.inputFields[i].margin:0}):{backgroundColor:"white",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start"};var l=r.styled(f.default)((function(e){var t=e.theme;return{"& .MuiInputBase-input":g({backgroundColor:"light"===t.palette.mode?"#fcfcfb":"#2b2b2b",transition:t.transitions.create(["border-color","background-color","box-shadow"]),"&:focus":{boxShadow:"".concat(r.alpha(t.palette.primary.main,.25)," 0 0 0 0.2rem"),borderColor:t.palette.primary.main},borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,padding:"10px 12px"},a)}}));return o.jsxs(o.Fragment,{children:[t.inputLabel?o.jsx(k,{themeType:t.themeType,label:t.inputLabel}):null,o.jsx(l,{fullWidth:!0,"aria-label":"dws"})]})};j.propTypes={type:p.default.oneOf(["text","number"]),helperText:p.default.string};var w,T=function(t){var n=e.useContext(v),i={};console.log(Object.keys(n.actionButton));var a=Object.keys(n.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:n.layout[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:n.layout[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:n.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}};var l=r.styled(u.default)((function(e){var t=e.theme;return g(g({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg"}),o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},O={},L={exports:{}};(w=L).exports=function(e){return e&&e.__esModule?e:{default:e}},w.exports.__esModule=!0,w.exports.default=w.exports;var P={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=b.default}(P);var R=L.exports;Object.defineProperty(O,"__esModule",{value:!0});var B=O.default=void 0;!function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=M(t);if(o&&o.has(e))return o.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,o&&o.set(e,r)}(s.default);var S=R(P),I=c.default;function M(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(M=function(e){return e?o:t})(e)}var D=(0,S.default)((0,I.jsx)("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub");B=O.default=D;var z=function(t){var n=e.useContext(v),i={};console.log(Object.keys(n.actionButton));var a=Object.keys(n.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:n.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:n.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:n.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}};var l=r.styled(u.default)((function(e){var t=e.theme;return g(g({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx(B,{}),o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},W={},F=L.exports;Object.defineProperty(W,"__esModule",{value:!0});var A=W.default=void 0;!function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=E(t);if(o&&o.has(e))return o.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,o&&o.set(e,r)}(s.default);var _=F(P),G=c.default;function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(E=function(e){return e?o:t})(e)}var q=(0,_.default)((0,G.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"}),"Twitter");A=W.default=q;var U=function(t){var n=e.useContext(v),i={};console.log(Object.keys(n.actionButton));var a=Object.keys(n.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:n.layout[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:n.layout[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:n.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}};var l=r.styled(u.default)((function(e){var t=e.theme;return g(g({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx(A,{}),o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},N=function(t){var n=e.useContext(v),i={};console.log(Object.keys(n.actionButton));var a=Object.keys(n.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:n.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:n.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:n.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}};var l=r.styled(u.default)((function(e){var t=e.theme;return g(g({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png",height:30})," ",o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},H=function(t){var n=e.useContext(v),i={};console.log(Object.keys(n.actionButton));var a=Object.keys(n.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:n.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:n.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:n.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}};var l=r.styled(u.default)((function(e){var t=e.theme;return g(g({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png",height:30})," ",o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},V=function(t){var n=e.useContext(v),i={};console.log(Object.keys(n.actionButton));var a=Object.keys(n.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:n.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:n.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:n.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}};var l=r.styled(u.default)((function(e){var t=e.theme;return g(g({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png",height:30})," ",o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},J=function(t){var n=e.useContext(v),i={};console.log(Object.keys(n.actionButton));var a=Object.keys(n.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:n.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:n.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:n.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}};var l=r.styled(u.default)((function(e){var t=e.theme;return g(g({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png",height:30})," ",o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},K=function(t){var n=e.useContext(v),i={};console.log(Object.keys(n.actionButton));var a=Object.keys(n.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:n.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:n.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:n.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}};var l=r.styled(u.default)((function(e){var t=e.theme;return g(g({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png",height:40})," ",o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},Q=function(t){var n=e.useContext(v),i={};console.log(Object.keys(n.actionButton));var a=Object.keys(n.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:n.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:n.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:n.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}};var l=r.styled(u.default)((function(e){var t=e.theme;return g(g({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png",height:30})," ",o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},X={},Y=L.exports;Object.defineProperty(X,"__esModule",{value:!0});var Z=X.default=void 0,$=Y(P),ee=c.default,te=(0,$.default)((0,ee.jsx)("path",{d:"M21 18v1c0 1.1-.9 2-2 2H5c-1.11 0-2-.9-2-2V5c0-1.1.89-2 2-2h14c1.1 0 2 .9 2 2v1h-9c-1.11 0-2 .9-2 2v8c0 1.1.89 2 2 2h9zm-9-2h10V8H12v8zm4-2.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"}),"AccountBalanceWallet");Z=X.default=te;var oe=function(t){var n=e.useContext(v),i={};console.log(Object.keys(n.actionButton));var a=Object.keys(n.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:n.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:n.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:n.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:r.darken("#ffffff",.1)}};var l=r.styled(u.default)((function(e){var t=e.theme;return g(g({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx(Z,{}),o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},re=function(t){var r=e.useContext(v),n={};console.log(Object.keys(r.actionButton));var i=Object.keys(r.actionButton).find((function(e){var o;return e.toLowerCase()===(null===(o=t.themeType)||void 0===o?void 0:o.toLowerCase())}));return n=i?g(g({display:"flex",flexDirection:"column"},r.layout[i]),{},{backgroundColor:t.noColor?"none":r.layout[i].backgroundColor,padding:t.noPadding?0:r.layout[i].padding,margin:t.noMargin?0:r.layout[i].margin,maxWidth:t.maxWidth}):{display:"flex",flexDirection:"column",color:"white",marginTop:t.last?20:0,backgroundColor:t.noColor?"none":"lightGrey",padding:t.noPadding?0:10,margin:t.noMargin?0:10,maxWidth:t.maxWidth,borderRadius:0},o.jsx("div",{style:n,children:t.children})},ne=function(e){return o.jsxs(re,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:[o.jsxs(re,{themeType:e.theme,noMargin:!0,children:[o.jsx(j,{themeType:e.theme,type:"text",inputLabel:"Email"}),o.jsx(j,{themeType:e.theme,type:"text",inputLabel:"Password"}),o.jsx(j,{themeType:e.theme,type:"text",inputLabel:"Confirm Password"}),o.jsx(C,{text:"Sign Up",last:!0,themeType:e.theme,onClick:e.handleSignUp})]}),e.viaGoogle&&o.jsx(T,{outlined:!0,themeType:e.theme,buttonText:e.googleButtonLabel,handleClick:e.handleGoogleSignIn}),e.viaGithub&&o.jsx(z,{outlined:!0,themeType:e.theme,buttonText:e.githubButtonLabel,handleClick:e.handleGithubSignUp}),e.viaTwitter&&o.jsx(U,{outlined:!0,themeType:e.theme,buttonText:e.twitterButtonLabel,handleClick:e.handleTwitterSignIn})]})};ne.propTypes={theme:p.default.oneOf(["secondary","primary"])};j.propTypes={theme:p.default.oneOf(["secondary","primary"]),viaApplePay:p.default.bool,viaGooglePay:p.default.bool,viaSTCPay:p.default.bool,viaCreditCard:p.default.bool,viaPayPal:p.default.bool,handleApplePay:p.default.func};exports.CreditCardForm=function(e){return o.jsx(re,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:o.jsxs(re,{themeType:e.theme,noMargin:!0,children:[o.jsx(j,{themeType:e.theme,type:"text",inputLabel:"Email"}),o.jsx(j,{themeType:e.theme,type:"text",inputLabel:"Password"}),o.jsx(C,{last:!0,text:"Sign In",themeType:e.theme,onClick:e.handleSignIn})]})})},exports.NewPasswordForm=function(t){return e.useContext(v),o.jsx(re,{themeType:t.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:o.jsxs(re,{themeType:t.theme,noMargin:!0,children:[o.jsx(j,{themeType:t.theme,type:"password",inputLabel:"Password"}),o.jsx(j,{themeType:t.theme,type:"password",inputLabel:"Confirm Password"}),o.jsx(C,{themeType:t.theme,last:!0,text:"Reset Password"})]})})},exports.ResetPasswordForm=function(e){return o.jsx(re,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:o.jsxs(re,{themeType:e.theme,noMargin:!0,children:[o.jsx(j,{themeType:e.theme,type:"text",inputLabel:"Email"}),o.jsx(C,{themeType:e.theme,last:!0,text:"Reset Password"})]})})},exports.SelectPayment=function(e){return o.jsx(re,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:o.jsxs(re,{themeType:e.theme,noMargin:!0,children:[o.jsx("div",{children:"Choose Payment"}),e.viaWallet&&o.jsx(oe,{themeType:e.theme,outlined:!0,buttonText:e.walletLabel,handleClick:e.handleWallet}),e.viaCreditCard&&o.jsx(N,{themeType:e.theme,outlined:!0,buttonText:e.visaMasterLabel,handleClick:e.handleCreditCard}),e.viaMada&&o.jsx(H,{themeType:e.theme,outlined:!0,buttonText:e.madaLabel,handleClick:e.handleMada}),e.viaSTCPay&&o.jsx(V,{themeType:e.theme,outlined:!0,buttonText:e.stcPayLabel,handleClick:e.handleSTCPay}),e.viaPayPal&&o.jsx(J,{themeType:e.theme,outlined:!0,buttonText:e.paypalLabel,handleClick:e.handlePayPal}),e.viaGooglePay&&o.jsx(Q,{themeType:e.theme,outlined:!0,buttonText:e.googlePayLabel,handleClick:e.handleGooglePay}),e.viaApplePay&&o.jsx(K,{themeType:e.theme,outlined:!0,buttonText:e.applePayLabel,handleClick:e.handleApplePay})]})})},exports.SignInForm=function(e){return o.jsxs(re,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:[o.jsxs(re,{themeType:e.theme,noMargin:!0,children:[o.jsx(j,{themeType:e.theme,type:"text",inputLabel:"Email"}),o.jsx(j,{themeType:e.theme,type:"text",inputLabel:"Password"}),o.jsx(C,{last:!0,text:"Sign In",themeType:e.theme,onClick:e.handleSignIn})]}),e.viaGoogle&&o.jsx(T,{themeType:e.theme,outlined:!0,buttonText:e.googleButtonLabel,handleClick:e.handleGoogleSignIn}),e.viaGithub&&o.jsx(z,{outlined:!0,themeType:e.theme,buttonText:e.githubButtonLabel,handleClick:e.handleGithubSignIn}),e.viaTwitter&&o.jsx(U,{outlined:!0,themeType:e.theme,buttonText:e.twitterButtonLabel,handleClick:e.handleTwitterSignIn})]})},exports.SignUpForm=ne,exports.UserProfile=function(e){return o.jsxs(re,{maxWidth:400,children:[o.jsx(k,{type:"text",inputLabel:"First Name"}),o.jsx(k,{type:"text",inputLabel:"Last Name"}),o.jsx(k,{type:"email",inputLabel:"Email"}),o.jsx(k,{type:"password",inputLabel:"Password"}),o.jsx(C,{last:!0,text:"Update Account"})]})},exports.UserSettings=function(e){return o.jsxs(re,{maxWidth:400,children:[o.jsx(j,{type:"text",inputLabel:"First Name"}),o.jsx(j,{type:"text",inputLabel:"Last Name"}),o.jsx(j,{type:"email",inputLabel:"Email"}),o.jsx(j,{type:"password",inputLabel:"Password"}),o.jsx(C,{last:!0,text:"Update Account"})]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@mui/material/Button");require("@mui/material/Tooltip");var r=require("prop-types"),o=require("react/jsx-runtime"),n=require("@mui/material/styles");require("@mui/material/FormControlLabel"),require("@mui/material/Checkbox");var i=require("@mui/material/InputBase"),a=require("@mui/material/Typography"),l=require("@mui/material/InputLabel"),s=require("react-hook-form"),d=require("@mui/material/Alert"),u=require("@mui/material/AlertTitle"),c=require("@mui/icons-material/GitHub"),m=require("@mui/icons-material/Twitter"),h=require("@mui/icons-material/AccountBalanceWallet");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@mui/material");var f=p(t),g=p(r),b=p(i),x=p(a),y=p(l),v=p(d),C=p(u),j=p(c),k=p(m),w=p(h);function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){L(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function L(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return R(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var B={borderRadius:10,primaryColor:"blue",secondaryColor:"grey",primaryActionColor:"grey",secondaryActionColor:"#4cc9f0",layoutColor:"#d3d4d9",textColor:"black",inputColor:"white",lightBackground:"#FBF5F3",darkBackground:"#0F0E0E",testcolor:"green",margins:10,paddings:10,allBorderRadius:10,typography:{primary:{color:"black"},secondary:{color:"white"}},logoButton:{primary:{borderRadius:10,backgroundColor:"#f90900",padding:10,border:"1px solid #ced4da",height:50,"&:focus":{borderColor:"green"}},secondary:{borderRadius:10,backgroundColor:"#f90900",padding:10,border:"1px solid #ced4da",height:50,"&:focus":{borderColor:"green"}}},actionButton:{primary:{borderRadius:10,backgroundColor:"#f90900",color:"white",margin:10,padding:10,border:"1px solid #ced4da",fontSize:16,height:50,"&:focus":{borderColor:"red"}},secondary:{borderRadius:10,margin:10,padding:10,backgroundColor:"#FF8811",color:"black"}},layout:{primary:{backgroundColor:"#d3d4d9",color:"black",margin:10,padding:10,borderRadius:10},secondary:{backgroundColor:"#001E3C",color:"white",margin:10,padding:10,borderRadius:10}},inputFields:{primary:{backgroundColor:"white",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",borderRadius:10,"&:focus":{borderColor:"#f90900"}},secondary:{backgroundColor:"white",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",borderRadius:10}},alerts:{primary:{marginBottom:10,padding:10,borderRadius:10},secondary:{marginBottom:10,padding:10,borderRadius:10}}},I=e.createContext(B);g.default.string,g.default.bool,g.default.bool,g.default.bool;var O=function(t){var r,i=e.useContext(I),a=Object.keys(i.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())})),l={};a?l=S(S({},i.actionButton[a]),{},{margin:t.last?0:i.actionButton[a].margin,marginTop:t.last?2*i.actionButton[a].margin:0,"&:hover":{backgroundColor:n.darken(null===(r=i.actionButton[a])||void 0===r?void 0:r.backgroundColor,.1)}}):l={backgroundColor:"black",color:"white",padding:10,marginTop:t.last?20:0};var s=n.styled(f.default)((function(e){return e.theme,S({},l)}));return o.jsx(s,S(S({},t),{},{children:t.text}))},F=function(t){var r,i=e.useContext(I),a={},l=Object.keys(i.logoButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())}));l?a=S(S({},i.logoButton[l]),{},{border:t.outlined?"2px solid black":"none",backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}}):a={cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:null===(r=i.logoButton[l])||void 0===r?void 0:r.margin,border:t.outlined?"2px solid black":"none",height:50,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}};var s=n.styled(f.default)((function(e){return e.theme,S({},a)}));return o.jsx(s,S(S({},t),{},{children:t.children}))},W=function(t){var r=e.useContext(I),n={},i=Object.keys(r.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())}));return n=i?{margin:15,marginRight:5,marginLeft:5,color:r.layout[i].color}:{margin:15,marginRight:0,marginLeft:0,color:"black"},o.jsx(y.default,{style:n,children:o.jsx("div",{style:{fontSize:15},children:t.label})})},z=function(t){var r=s.useFormContext(),i=r.control,a=r.register,l=e.useContext(I),d=Object.keys(l.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())})),u={};u=d?S(S({},l.inputFields[d]),{},{margin:t.last?0:l.inputFields[d].margin,marginTop:t.last?2*l.inputFields[d].margin:0}):{backgroundColor:"white",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start"};var c=n.styled(b.default)((function(e){var r=e.theme;return{"& .MuiInputBase-input":S({backgroundColor:"light"===r.palette.mode?"#fcfcfb":"#2b2b2b",transition:r.transitions.create(["border-color","background-color","box-shadow"]),"&:focus":{},borderRadius:4,border:"1px solid #ced4da",fontSize:16,padding:"10px 12px",marginBottom:t.helperText?5:0},u)}}));return o.jsx(s.Controller,{render:function(e){var r;return e.field,o.jsxs(o.Fragment,{children:[t.inputLabel&&o.jsx(W,{themeType:t.themeType,label:t.inputLabel}),o.jsx(c,S(S({fullWidth:!0,type:null!==(r=t.type)&&void 0!==r?r:"text",defaultValue:t.defaultValue&&"",value:t.value&&""},t),a(t.name))),o.jsx(x.default,{variant:"caption",style:{margin:5,color:"red"},children:t.helperText})]})},name:t.name,rules:t.rules,control:i,shouldUnregister:t.shouldUnregister})};z.propTypes={type:g.default.oneOf(["text","number","password"]),helperText:g.default.string};var q=function(t){var r=e.useContext(I),i=Object.keys(r.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())})),a={};a=i?S({},r.typography[i]):{color:"black"};var l=n.styled(x.default)((function(e){return e.theme,S({},a)}));return o.jsx(l,S(S({},t),{},{children:t.children}))},A=function(t){var r=e.useContext(I),i=Object.keys(r.alerts).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())})),a={};a=i?S({},r.alerts[i]):{marginBottom:10};var l=n.styled(v.default)((function(e){return e.theme,S({},a)}));return o.jsxs(l,S(S({themeType:t.themeType},t),{},{children:[t.title&&o.jsx(C.default,{children:t.title}),t.text]}))},D=function(t){var r=e.useContext(I),i={},a=Object.keys(r.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.layout[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:r.layout[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}};var l=n.styled(f.default)((function(e){var t=e.theme;return S(S({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg"}),o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},M=function(t){var r=e.useContext(I),i={},a=Object.keys(r.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:r.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}};var l=n.styled(f.default)((function(e){var t=e.theme;return S(S({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx(j.default,{}),o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},E=function(t){var r=e.useContext(I),i={},a=Object.keys(r.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.layout[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:r.layout[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}};var l=n.styled(f.default)((function(e){var t=e.theme;return S(S({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx(k.default,{}),o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},G=function(t){var r=e.useContext(I),i={},a=Object.keys(r.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:r.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}};var l=n.styled(f.default)((function(e){var t=e.theme;return S(S({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png",height:30})," ",o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},U=function(t){var r=e.useContext(I),i={},a=Object.keys(r.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:r.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}};var l=n.styled(f.default)((function(e){var t=e.theme;return S(S({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png",height:30})," ",o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},V=function(t){var r=e.useContext(I),i={},a=Object.keys(r.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:r.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}};var l=n.styled(f.default)((function(e){var t=e.theme;return S(S({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png",height:20})," ",o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},N=function(t){var r=e.useContext(I),i={},a=Object.keys(r.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:r.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}};var l=n.styled(f.default)((function(e){var t=e.theme;return S(S({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png",height:25})," ",o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},Z=function(t){var r=e.useContext(I),i={},a=Object.keys(r.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:r.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}};var l=n.styled(f.default)((function(e){var t=e.theme;return S(S({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png",height:40})," ",o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},$=function(t){var r=e.useContext(I),i={},a=Object.keys(r.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())}));i=a?{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:0,marginTop:r.actionButton[a].margin,border:t.outlined?"2px solid black":"none",borderRadius:r.actionButton[a].borderRadius,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}}:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:r.margins,border:t.outlined?"2px solid black":"none",borderRadius:0,backgroundColor:"white","&:hover":{backgroundColor:n.darken("#ffffff",.1)}};var l=n.styled(f.default)((function(e){var t=e.theme;return S(S({borderRadius:4,position:"relative",border:"1px solid #ced4da",fontSize:16,height:50},i),{},{"&:focus":{borderColor:t.palette.primary.main}})}));return o.jsxs(l,{onClick:t.handleClick,children:[o.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png",height:20})," ",o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:t.buttonText})]})},_=function(e){return o.jsxs(F,S(S({},e),{},{children:[o.jsx(w.default,{}),o.jsx("div",{style:{width:10}}),o.jsx("p",{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]}))},H=function(t){var r=e.useContext(I),n={},i=Object.keys(r.actionButton).find((function(e){var r;return e.toLowerCase()===(null===(r=t.themeType)||void 0===r?void 0:r.toLowerCase())}));return n=i?S(S({display:"flex",flexDirection:"column"},r.layout[i]),{},{backgroundColor:t.noColor?"none":r.layout[i].backgroundColor,padding:t.noPadding?0:r.layout[i].padding,margin:t.noMargin?0:r.layout[i].margin,maxWidth:t.maxWidth}):{display:"flex",flexDirection:"column",color:"white",marginTop:t.last?20:0,backgroundColor:t.noColor?"none":"lightGrey",padding:t.noPadding?0:10,margin:t.noMargin?0:10,maxWidth:t.maxWidth,borderRadius:0},o.jsx("div",{style:n,children:t.children})},J=function(e){var t,r,n,i=s.useForm(),a=i.formState.errors,l=i.handleSubmit;return i.getValues,i.register,i.watch,i.reset,i.setValue,o.jsxs(H,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:[o.jsxs(H,{themeType:e.theme,noMargin:!0,children:[e.error&&o.jsx(A,{themeType:e.theme,text:"This is a sign in alert",severity:"error"}),o.jsx(s.FormProvider,S(S({},i),{},{children:o.jsxs("form",{onSubmit:l(e.handleSignUp),children:[o.jsx(z,{themeType:e.theme,type:"text",inputLabel:"Email",placeholder:"Email",name:"email",rules:{required:"Email is required",pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:"Invalid email address"}},helperText:null===(t=a.email)||void 0===t?void 0:t.message}),o.jsx(z,{name:"password",placeholder:"Password",themeType:e.theme,type:"password",inputLabel:"Password",rules:{required:"Password is rquired"},helperText:null===(r=a.password)||void 0===r?void 0:r.message}),o.jsx(z,{name:"confirmPassword",placeholder:"Password",themeType:e.theme,type:"password",inputLabel:"Confirm Password",rules:{required:"Password is rquired"},helperText:null===(n=a.confirmPassword)||void 0===n?void 0:n.message}),o.jsx(O,{fullWidth:!0,type:"submit",text:"Sign Up",last:!0,themeType:e.theme})]})}))]}),e.viaGoogle&&o.jsx(D,{outlined:!0,themeType:e.theme,buttonText:e.googleButtonLabel,handleClick:e.handleGoogleSignIn}),e.viaGithub&&o.jsx(M,{outlined:!0,themeType:e.theme,buttonText:e.githubButtonLabel,handleClick:e.handleGithubSignUp}),e.viaTwitter&&o.jsx(E,{outlined:!0,themeType:e.theme,buttonText:e.twitterButtonLabel,handleClick:e.handleTwitterSignIn})]})};J.propTypes={theme:g.default.oneOf(["secondary","primary"])};z.propTypes={theme:g.default.oneOf(["secondary","primary"]),viaApplePay:g.default.bool,viaGooglePay:g.default.bool,viaSTCPay:g.default.bool,viaCreditCard:g.default.bool,viaPayPal:g.default.bool,handleApplePay:g.default.func};exports.ChargeWalletForm=function(t){var r=P(e.useState(0),2),n=r[0],i=r[1];return o.jsx(H,{themeType:t.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:o.jsxs(H,{themeType:t.theme,noMargin:!0,children:[o.jsxs(q,{variant:"h2",align:"center",themeType:t.theme,children:[n.toLocaleString("en")," ",o.jsx("span",{style:{fontSize:20,letterSpacing:1},children:t.currency})]}),o.jsx(q,{themeType:t.theme}),o.jsx(z,{themeType:t.theme,type:"number",inputLabel:"Amount",onChange:function(e){return i(e.target.value)}}),o.jsx(O,{last:!0,text:"Charge Wallet",themeType:t.theme,onClick:t.handleSignIn})]})})},exports.CreditCardForm=function(e){return o.jsx(H,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:o.jsxs(H,{themeType:e.theme,noMargin:!0,children:[o.jsx(z,{themeType:e.theme,type:"text",inputLabel:"Email"}),o.jsx(z,{themeType:e.theme,type:"text",inputLabel:"Password"}),o.jsx(O,{last:!0,text:"Sign In",themeType:e.theme,onClick:e.handleSignIn})]})})},exports.NewPasswordForm=function(t){var r,n,i=P(e.useState(""),2),a=i[0],l=i[1],d=P(e.useState(""),2);d[0],d[1];var u=P(e.useState(!1),2);u[0],u[1];var c=P(e.useState(""),2);c[0],c[1];var m=P(e.useState(!0),2);m[0],m[1];var h=s.useForm(),p=h.formState.errors,f=h.handleSubmit;return h.getValues,h.register,h.watch,h.reset,h.setValue,o.jsx(H,{themeType:t.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:o.jsxs(H,{themeType:t.theme,noMargin:!0,children:[t.error&&o.jsx(A,{themeType:t.theme,text:"This is a new password alert",severity:"error"}),o.jsx(s.FormProvider,S(S({},h),{},{children:o.jsxs("form",{onSubmit:f(t.handleNewPassword),children:[o.jsx(z,{name:"password",themeType:t.theme,type:"password",inputLabel:"Password",onChange:function(e){return l(e.target.value)},value:a,rules:{required:"Password is rquired"},helperText:null===(r=p.password)||void 0===r?void 0:r.message}),o.jsx(z,{themeType:t.theme,name:"confirmPassword",type:"password",inputLabel:"Confirm Password",rules:{required:"Password is rquired"},helperText:null===(n=p.confirmPassword)||void 0===n?void 0:n.message}),o.jsx(O,{fullWidth:!0,type:"submit",themeType:t.theme,last:!0,text:"Reset Password"})]})}))]})})},exports.PayWithWallet=function(e){return o.jsx(H,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:o.jsxs(H,{themeType:e.theme,noMargin:!0,children:[o.jsx("div",{children:"Wallet Balance"}),e.viaWallet&&o.jsx(_,{themeType:e.theme,outlined:!0,buttonText:e.walletLabel,handleClick:e.handleWallet})]})})},exports.ResetPasswordForm=function(e){var t,r=s.useForm(),n=r.formState.errors,i=r.handleSubmit;return r.getValues,r.register,r.watch,r.reset,r.setValue,o.jsx(H,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:o.jsxs(H,{themeType:e.theme,noMargin:!0,children:[e.error&&o.jsx(A,{themeType:e.theme,text:"This is a reset password alert",severity:"error"}),o.jsx(s.FormProvider,S(S({},r),{},{children:o.jsxs("form",{onSubmit:i(e.handleResetPassword),children:[o.jsx(z,{type:"text",name:"email",inputLabel:"Email",themeType:e.theme,rules:{required:"Email is required",pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:"Invalid email address"}},helperText:null===(t=n.email)||void 0===t?void 0:t.message}),o.jsx(O,{fullWidth:!0,themeType:e.theme,last:!0,type:"submit",text:"Reset Password"})]})}))," "]})})},exports.SelectPayment=function(e){return o.jsx(H,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:o.jsxs(H,{themeType:e.theme,noMargin:!0,children:[o.jsx(q,{themeType:e.theme,align:"center",children:"Choose Payment"}),e.viaWallet&&o.jsx(_,{outlined:!0,themeType:e.theme,buttonText:e.walletLabel,onClick:e.handleWallet}),e.viaCreditCard&&o.jsx(G,{outlined:!0,themeType:e.theme,buttonText:e.visaMasterLabel,handleClick:e.handleCreditCard}),e.viaMada&&o.jsx(U,{outlined:!0,themeType:e.theme,buttonText:e.madaLabel,handleClick:e.handleMada}),e.viaSTCPay&&o.jsx(V,{outlined:!0,themeType:e.theme,buttonText:e.stcPayLabel,handleClick:e.handleSTCPay}),e.viaPayPal&&o.jsx(N,{outlined:!0,themeType:e.theme,buttonText:e.paypalLabel,handleClick:e.handlePayPal}),e.viaGooglePay&&o.jsx($,{outlined:!0,themeType:e.theme,buttonText:e.googlePayLabel,handleClick:e.handleGooglePay}),e.viaApplePay&&o.jsx(Z,{outlined:!0,themeType:e.theme,buttonText:e.applePayLabel,handleClick:e.handleApplePay})]})})},exports.SignInForm=function(e){var t,r,n=s.useForm(),i=n.formState.errors,a=n.handleSubmit;return n.getValues,n.register,n.watch,n.reset,n.setValue,o.jsxs(H,{themeType:e.theme,maxWidth:400,noColor:!0,noMargin:!0,noPadding:!0,children:[o.jsxs(H,{themeType:e.theme,noMargin:!0,children:[e.error&&o.jsx(A,{themeType:e.theme,text:"This is a sign in alert",severity:"error"}),o.jsx(s.FormProvider,S(S({},n),{},{children:o.jsxs("form",{onSubmit:a(e.handleSignIn),children:[o.jsx(z,{type:"text",name:"email",inputLabel:"Email",placeholder:"Email",themeType:e.theme,rules:{required:"Email is required",pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:"Invalid email address"}},helperText:null===(t=i.email)||void 0===t?void 0:t.message}),o.jsx(z,{name:"password",placeholder:"Password",themeType:e.theme,type:"password",inputLabel:"Password",rules:{required:"Password is rquired"},helperText:null===(r=i.password)||void 0===r?void 0:r.message}),o.jsx(O,{type:"submit",fullWidth:!0,last:"true",text:"Sign In",themeType:e.theme})]})}))]}),e.viaGoogle&&o.jsx(D,{themeType:e.theme,outlined:!0,buttonText:e.googleButtonLabel,handleClick:e.handleGoogleSignIn}),e.viaGithub&&o.jsx(M,{outlined:!0,themeType:e.theme,buttonText:e.githubButtonLabel,handleClick:e.handleGithubSignIn}),e.viaTwitter&&o.jsx(E,{outlined:!0,themeType:e.theme,buttonText:e.twitterButtonLabel,handleClick:e.handleTwitterSignIn})]})},exports.SignUpForm=J,exports.UserProfile=function(e){return o.jsxs(H,{maxWidth:400,children:[o.jsx(W,{type:"text",inputLabel:"First Name"}),o.jsx(W,{type:"text",inputLabel:"Last Name"}),o.jsx(W,{type:"email",inputLabel:"Email"}),o.jsx(W,{type:"password",inputLabel:"Password"}),o.jsx(O,{last:!0,text:"Update Account"})]})},exports.UserSettings=function(e){return o.jsxs(H,{maxWidth:400,children:[o.jsx(z,{type:"text",inputLabel:"First Name"}),o.jsx(z,{type:"text",inputLabel:"Last Name"}),o.jsx(z,{type:"email",inputLabel:"Email"}),o.jsx(z,{type:"password",inputLabel:"Password"}),o.jsx(O,{last:!0,text:"Update Account"})]})};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sikka/hawa",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "UI Kit",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.es.js",
|
|
@@ -46,17 +46,15 @@
|
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@emotion/react": "^11.8.2",
|
|
48
48
|
"@emotion/styled": "^11.8.1",
|
|
49
|
+
"@mui/icons-material": "^5.5.1",
|
|
49
50
|
"@mui/material": "^5.5.1",
|
|
50
51
|
"crypto-js": "^4.1.1",
|
|
51
52
|
"next-scripts": "^0.3.4",
|
|
52
53
|
"prop-types": "^15.7.2",
|
|
53
54
|
"react": "^17.0.1",
|
|
54
55
|
"react-dom": "^17.0.1",
|
|
55
|
-
"react-hook-form": "^7.
|
|
56
|
+
"react-hook-form": "^7.28.0",
|
|
56
57
|
"react-transition-group": "^4.4.2",
|
|
57
58
|
"tinycolor2": "^1.4.2"
|
|
58
|
-
},
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"@mui/icons-material": "^5.5.1"
|
|
61
59
|
}
|
|
62
60
|
}
|
|
@@ -1,23 +1,89 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import { Box } from "../../layout";
|
|
3
3
|
import { ThemeProvider } from "../../themes/HawaProvider";
|
|
4
|
-
import { ActionButton, HawaTextField,
|
|
4
|
+
import { ActionButton, HawaTextField, HawaAlert } from "../../ui";
|
|
5
|
+
import { FormProvider, useForm } from "react-hook-form";
|
|
6
|
+
|
|
5
7
|
export const NewPasswordForm = (props) => {
|
|
6
|
-
const
|
|
8
|
+
const [newPassword, setNewPassword] = useState("");
|
|
9
|
+
const [confirmNewPassword, setConfirmNewPassword] = useState("");
|
|
10
|
+
const [error, setError] = useState(false);
|
|
11
|
+
const [errorMessage, setErrorMessage] = useState("");
|
|
12
|
+
const [loading, setLoading] = useState(true);
|
|
13
|
+
|
|
14
|
+
const methods = useForm();
|
|
15
|
+
const {
|
|
16
|
+
formState: { errors },
|
|
17
|
+
handleSubmit,
|
|
18
|
+
getValues,
|
|
19
|
+
register,
|
|
20
|
+
watch,
|
|
21
|
+
reset,
|
|
22
|
+
setValue
|
|
23
|
+
} = methods;
|
|
24
|
+
|
|
25
|
+
const handleNewPassword = (e) => {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
console.log("submitting fom", e.target);
|
|
28
|
+
// setLoading(true);
|
|
29
|
+
// e.preventDefault();
|
|
30
|
+
// if (newPassword == "" || confirmNewPassword == "") {
|
|
31
|
+
// setLoading(false);
|
|
32
|
+
// return;
|
|
33
|
+
// }
|
|
34
|
+
// if (newPassword != confirmNewPassword) {
|
|
35
|
+
// setError(true);
|
|
36
|
+
// setLoading(false);
|
|
37
|
+
// // setErrorMessage(t("password-no-match"));
|
|
38
|
+
// return;
|
|
39
|
+
// }
|
|
40
|
+
// if (newPassword == confirmNewPassword) {
|
|
41
|
+
// //mutation to reset password here
|
|
42
|
+
// }
|
|
43
|
+
};
|
|
7
44
|
return (
|
|
8
45
|
<Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
|
|
9
46
|
<Box themeType={props.theme} noMargin>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
47
|
+
{props.error && (
|
|
48
|
+
<HawaAlert
|
|
49
|
+
themeType={props.theme}
|
|
50
|
+
text="This is a new password alert"
|
|
51
|
+
severity="error"
|
|
52
|
+
/>
|
|
53
|
+
)}
|
|
54
|
+
<FormProvider {...methods}>
|
|
55
|
+
<form onSubmit={handleSubmit(props.handleNewPassword)}>
|
|
56
|
+
<HawaTextField
|
|
57
|
+
name="password"
|
|
58
|
+
themeType={props.theme}
|
|
59
|
+
type="password"
|
|
60
|
+
inputLabel="Password"
|
|
61
|
+
onChange={(e) => setNewPassword(e.target.value)}
|
|
62
|
+
value={newPassword}
|
|
63
|
+
rules={{
|
|
64
|
+
required: "Password is rquired"
|
|
65
|
+
}}
|
|
66
|
+
helperText={errors.password?.message}
|
|
67
|
+
/>
|
|
68
|
+
<HawaTextField
|
|
69
|
+
themeType={props.theme}
|
|
70
|
+
name="confirmPassword"
|
|
71
|
+
type="password"
|
|
72
|
+
inputLabel="Confirm Password"
|
|
73
|
+
rules={{
|
|
74
|
+
required: "Password is rquired"
|
|
75
|
+
}}
|
|
76
|
+
helperText={errors.confirmPassword?.message}
|
|
77
|
+
/>
|
|
78
|
+
<ActionButton
|
|
79
|
+
fullWidth
|
|
80
|
+
type="submit"
|
|
81
|
+
themeType={props.theme}
|
|
82
|
+
last
|
|
83
|
+
text="Reset Password"
|
|
84
|
+
/>
|
|
85
|
+
</form>
|
|
86
|
+
</FormProvider>
|
|
21
87
|
</Box>
|
|
22
88
|
</Box>
|
|
23
89
|
);
|
|
@@ -1,12 +1,55 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { FormProvider, useForm } from "react-hook-form";
|
|
2
3
|
import { Box } from "../../layout";
|
|
3
|
-
import { HawaTextField,
|
|
4
|
+
import { HawaTextField, ActionButton, HawaAlert } from "../../ui";
|
|
5
|
+
|
|
4
6
|
export const ResetPasswordForm = (props) => {
|
|
7
|
+
const methods = useForm();
|
|
8
|
+
const {
|
|
9
|
+
formState: { errors },
|
|
10
|
+
handleSubmit,
|
|
11
|
+
getValues,
|
|
12
|
+
register,
|
|
13
|
+
watch,
|
|
14
|
+
reset,
|
|
15
|
+
setValue
|
|
16
|
+
} = methods;
|
|
5
17
|
return (
|
|
6
18
|
<Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
|
|
7
19
|
<Box themeType={props.theme} noMargin>
|
|
8
|
-
|
|
9
|
-
|
|
20
|
+
{props.error && (
|
|
21
|
+
<HawaAlert
|
|
22
|
+
themeType={props.theme}
|
|
23
|
+
text="This is a reset password alert"
|
|
24
|
+
severity="error"
|
|
25
|
+
/>
|
|
26
|
+
)}
|
|
27
|
+
<FormProvider {...methods}>
|
|
28
|
+
<form onSubmit={handleSubmit(props.handleResetPassword)}>
|
|
29
|
+
<HawaTextField
|
|
30
|
+
type="text"
|
|
31
|
+
name="email"
|
|
32
|
+
inputLabel="Email"
|
|
33
|
+
themeType={props.theme}
|
|
34
|
+
rules={{
|
|
35
|
+
required: "Email is required",
|
|
36
|
+
pattern: {
|
|
37
|
+
value:
|
|
38
|
+
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
39
|
+
message: "Invalid email address"
|
|
40
|
+
}
|
|
41
|
+
}}
|
|
42
|
+
helperText={errors.email?.message}
|
|
43
|
+
/>
|
|
44
|
+
<ActionButton
|
|
45
|
+
fullWidth
|
|
46
|
+
themeType={props.theme}
|
|
47
|
+
last
|
|
48
|
+
type="submit"
|
|
49
|
+
text="Reset Password"
|
|
50
|
+
/>
|
|
51
|
+
</form>
|
|
52
|
+
</FormProvider>{" "}
|
|
10
53
|
</Box>
|
|
11
54
|
</Box>
|
|
12
55
|
);
|
|
@@ -4,27 +4,74 @@ import {
|
|
|
4
4
|
ActionButton,
|
|
5
5
|
GoogleButton,
|
|
6
6
|
TwitterButton,
|
|
7
|
-
GithubButton
|
|
7
|
+
GithubButton,
|
|
8
|
+
HawaAlert
|
|
8
9
|
} from "../../ui";
|
|
9
10
|
import { Box } from "../../layout";
|
|
11
|
+
import { FormProvider, useForm } from "react-hook-form";
|
|
12
|
+
import { TextField } from "@mui/material";
|
|
10
13
|
|
|
11
14
|
export const SignInForm = (props) => {
|
|
15
|
+
const methods = useForm();
|
|
16
|
+
const {
|
|
17
|
+
formState: { errors },
|
|
18
|
+
handleSubmit,
|
|
19
|
+
getValues,
|
|
20
|
+
register,
|
|
21
|
+
watch,
|
|
22
|
+
reset,
|
|
23
|
+
setValue
|
|
24
|
+
} = methods;
|
|
25
|
+
|
|
12
26
|
return (
|
|
13
27
|
<Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
|
|
14
28
|
<Box themeType={props.theme} noMargin>
|
|
15
|
-
|
|
29
|
+
{props.error && (
|
|
30
|
+
<HawaAlert
|
|
31
|
+
themeType={props.theme}
|
|
32
|
+
text="This is a sign in alert"
|
|
33
|
+
severity="error"
|
|
34
|
+
/>
|
|
35
|
+
)}
|
|
36
|
+
<FormProvider {...methods}>
|
|
37
|
+
<form onSubmit={handleSubmit(props.handleSignIn)}>
|
|
38
|
+
<HawaTextField
|
|
39
|
+
type="text"
|
|
40
|
+
name="email"
|
|
41
|
+
inputLabel="Email"
|
|
42
|
+
placeholder="Email"
|
|
43
|
+
themeType={props.theme}
|
|
44
|
+
rules={{
|
|
45
|
+
required: "Email is required",
|
|
46
|
+
pattern: {
|
|
47
|
+
value:
|
|
48
|
+
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
49
|
+
message: "Invalid email address"
|
|
50
|
+
}
|
|
51
|
+
}}
|
|
52
|
+
helperText={errors.email?.message}
|
|
53
|
+
/>
|
|
16
54
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
55
|
+
<HawaTextField
|
|
56
|
+
name="password"
|
|
57
|
+
placeholder="Password"
|
|
58
|
+
themeType={props.theme}
|
|
59
|
+
type="password"
|
|
60
|
+
inputLabel="Password"
|
|
61
|
+
rules={{
|
|
62
|
+
required: "Password is rquired"
|
|
63
|
+
}}
|
|
64
|
+
helperText={errors.password?.message}
|
|
65
|
+
/>
|
|
66
|
+
<ActionButton
|
|
67
|
+
type="submit"
|
|
68
|
+
fullWidth
|
|
69
|
+
last={"true"}
|
|
70
|
+
text={"Sign In"}
|
|
71
|
+
themeType={props.theme}
|
|
72
|
+
/>
|
|
73
|
+
</form>
|
|
74
|
+
</FormProvider>
|
|
28
75
|
</Box>
|
|
29
76
|
{props.viaGoogle && (
|
|
30
77
|
<GoogleButton
|