@mailstep/design-system 0.7.50-beta.5 → 0.7.50-beta.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.7.50-beta.5",
3
+ "version": "0.7.50-beta.7",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -30,7 +30,8 @@ export var LoginForm = function (_a) {
30
30
  setLoginError('');
31
31
  setPasswordError('');
32
32
  setDCCenterError('');
33
- if (!login) {
33
+ setSubmitError('');
34
+ if (withLogin && !login) {
34
35
  setLoginError(i18n._({ id: 'requiredField', message: 'Required field' }));
35
36
  return;
36
37
  }
package/ui/index.es.js CHANGED
@@ -47598,7 +47598,7 @@ const ake = Y.img`
47598
47598
  }, []), F = ve((_) => {
47599
47599
  m(_.target.value);
47600
47600
  }, []), W = ve(() => {
47601
- if (C(""), O(""), M(""), !p) {
47601
+ if (C(""), O(""), M(""), w(""), u && !p) {
47602
47602
  C(_e._({
47603
47603
  id: "requiredField",
47604
47604
  message: "Required field"
package/ui/index.umd.js CHANGED
@@ -3440,7 +3440,7 @@ ${Q.current.stack}
3440
3440
  display: inline-block;
3441
3441
  margin-top: 40px;
3442
3442
  }
3443
- `,xOe=({onSubmit:e,isSubmitting:t,isSubmitDisabled:r,distributionCenterOptions:n,withDistributionCenterSelect:i,onChangeDistributionCenter:o,selectedDistributionCenter:l,withPassword:c,withLogin:u,loginLabel:f})=>{const[p,h]=I.useState(""),[v,m]=I.useState(""),[y,w]=I.useState(""),[S,C]=I.useState(""),[k,P]=I.useState(""),[T,L]=I.useState(""),F=I.useCallback(U=>{h(U.target.value)},[]),V=I.useCallback(U=>{m(U.target.value)},[]),H=I.useCallback(()=>{if(C(""),P(""),L(""),!p){C(ze._({id:"requiredField",message:"Required field"}));return}if(c&&!v){P(ze._({id:"requiredField",message:"Required field"}));return}if(i&&!l){L(ze._({id:"requiredField",message:"Required field"}));return}e({login:p,password:v}).catch(U=>{U&&w(String(U))}).finally(()=>{m("")})},[p,v,l,i,c,e]),G=I.useCallback(U=>{o==null||o(U.target.value)},[o]);return g.jsxs(COe,{children:[u&&g.jsx(We.div,{mt:"24px",children:g.jsx(mo,{label:f||ze._({id:"form.login.label",message:"Login"}),placeholder:ze._({id:"form.login.label",message:"Login"}),type:"text",name:"login",autoFocus:!0,error:S,value:p,onChange:F,onEnter:H})}),c&&g.jsx(We.div,{mt:"12px",children:g.jsx(mo,{label:ze._({id:"form.password.label",message:"Password"}),placeholder:ze._({id:"form.password.label",message:"Password"}),name:"password",type:"password",value:v,onChange:V,error:k,onEnter:H})}),i&&g.jsx(We.div,{mt:"12px",children:g.jsx(vm,{onChange:G,options:n,value:l,placeholder:ze._({id:"form.distributionCenter.label",message:"Distribution center"}),label:ze._({id:"form.distributionCenter.label",message:"Distribution center"}),error:T})}),y&&g.jsx(We.div,{mt:"12px",color:"red1",children:y}),g.jsx(wOe,{children:g.jsx(Zr,{onClick:H,iconLeft:"login",isLoading:t,disabled:r,fullWidth:!0,children:g.jsx(St,{id:"form.buttonSignIn",message:"Sign in"})})})]})},SOe="https://cs-cz.facebook.com/mailstepfulfillment",EOe="https://www.instagram.com/mailstep_fulfillment",IOe="https://cz.linkedin.com/company/mail-step",kOe="https://twitter.com/mailstep",OOe="mailstep@mailstep.cz",POe=J.div`
3443
+ `,xOe=({onSubmit:e,isSubmitting:t,isSubmitDisabled:r,distributionCenterOptions:n,withDistributionCenterSelect:i,onChangeDistributionCenter:o,selectedDistributionCenter:l,withPassword:c,withLogin:u,loginLabel:f})=>{const[p,h]=I.useState(""),[v,m]=I.useState(""),[y,w]=I.useState(""),[S,C]=I.useState(""),[k,P]=I.useState(""),[T,L]=I.useState(""),F=I.useCallback(U=>{h(U.target.value)},[]),V=I.useCallback(U=>{m(U.target.value)},[]),H=I.useCallback(()=>{if(C(""),P(""),L(""),w(""),u&&!p){C(ze._({id:"requiredField",message:"Required field"}));return}if(c&&!v){P(ze._({id:"requiredField",message:"Required field"}));return}if(i&&!l){L(ze._({id:"requiredField",message:"Required field"}));return}e({login:p,password:v}).catch(U=>{U&&w(String(U))}).finally(()=>{m("")})},[p,v,l,i,c,e]),G=I.useCallback(U=>{o==null||o(U.target.value)},[o]);return g.jsxs(COe,{children:[u&&g.jsx(We.div,{mt:"24px",children:g.jsx(mo,{label:f||ze._({id:"form.login.label",message:"Login"}),placeholder:ze._({id:"form.login.label",message:"Login"}),type:"text",name:"login",autoFocus:!0,error:S,value:p,onChange:F,onEnter:H})}),c&&g.jsx(We.div,{mt:"12px",children:g.jsx(mo,{label:ze._({id:"form.password.label",message:"Password"}),placeholder:ze._({id:"form.password.label",message:"Password"}),name:"password",type:"password",value:v,onChange:V,error:k,onEnter:H})}),i&&g.jsx(We.div,{mt:"12px",children:g.jsx(vm,{onChange:G,options:n,value:l,placeholder:ze._({id:"form.distributionCenter.label",message:"Distribution center"}),label:ze._({id:"form.distributionCenter.label",message:"Distribution center"}),error:T})}),y&&g.jsx(We.div,{mt:"12px",color:"red1",children:y}),g.jsx(wOe,{children:g.jsx(Zr,{onClick:H,iconLeft:"login",isLoading:t,disabled:r,fullWidth:!0,children:g.jsx(St,{id:"form.buttonSignIn",message:"Sign in"})})})]})},SOe="https://cs-cz.facebook.com/mailstepfulfillment",EOe="https://www.instagram.com/mailstep_fulfillment",IOe="https://cz.linkedin.com/company/mail-step",kOe="https://twitter.com/mailstep",OOe="mailstep@mailstep.cz",POe=J.div`
3444
3444
  height: 600px;
3445
3445
  margin: auto;
3446
3446
  display: none;