@s_mart/telas-de-acesso 8.1.0 → 9.0.0

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/dist/index.d.mts CHANGED
@@ -42,8 +42,10 @@ interface TemplateTelaBaseProps {
42
42
  declare function TemplateTelaBase({ children, whatsapp, textoChamativo, style, paperStyle, ilustracao, }: TemplateTelaBaseProps): react_jsx_runtime.JSX.Element;
43
43
 
44
44
  interface TelaCadastroProps extends Omit<TemplateTelaBaseProps, 'children'> {
45
- email: string;
46
- nome: string;
45
+ /**
46
+ * Valores iniciais do formulário
47
+ */
48
+ defaultValues: Pick<FormTelaCadastroValues, 'nome' | 'email'>;
47
49
  /**
48
50
  * Nome do sistema que irá ser exibido em uma frase no topo do paper de cadastro
49
51
  */
@@ -77,6 +79,7 @@ type FormTelaCadastroValues = {
77
79
  email: string;
78
80
  termosDeUso: boolean;
79
81
  senha: string;
82
+ confirmarSenha: string;
80
83
  };
81
84
  type FormTelaCadastroSubmitValues = FormTelaCadastroValues;
82
85
 
@@ -189,4 +192,4 @@ interface TelaEsqueceuSenhaProps extends Omit<TemplateTelaBaseProps, 'children'>
189
192
 
190
193
  declare function TelaEsqueceuSenha({ logo, onVoltarParaLogin, onConfirmar, ...rest }: TelaEsqueceuSenhaProps): react_jsx_runtime.JSX.Element;
191
194
 
192
- export { TelaCadastro, type TelaCadastroProps, TelaConviteExpirado, type TelaConviteExpiradoProps, TelaEsqueceuSenha, type TelaEsqueceuSenhaProps, TelaInstrucoesEnviadas, type TelaInstrucoesEnviadasProps, TelaLogin, type TelaLoginProps, TelaNovaSenha, type TelaNovaSenhaProps, TemplateTelaBase, type TemplateTelaBaseProps };
195
+ export { type FormTelaCadastroSubmitValues, type FormTelaCadastroValues, TelaCadastro, type TelaCadastroProps, type TelaCadastroSlots, TelaConviteExpirado, type TelaConviteExpiradoProps, TelaEsqueceuSenha, type TelaEsqueceuSenhaProps, TelaInstrucoesEnviadas, type TelaInstrucoesEnviadasProps, TelaLogin, type TelaLoginProps, TelaNovaSenha, type TelaNovaSenhaProps, TemplateTelaBase, type TemplateTelaBaseProps };
package/dist/index.mjs CHANGED
@@ -99,48 +99,48 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
99
99
  color: ${Oe.green[300]};
100
100
  }
101
101
  }
102
- `;import{jsx as F,jsxs as V}from"react/jsx-runtime";function l({children:e,whatsapp:o,textoChamativo:i,style:r,paperStyle:t,ilustracao:n}){return V(oe,{style:r,children:[i&&F(re,{children:i}),n&&F(ae,{children:typeof n=="string"?F("img",{src:n,alt:"Logo do sistema"}):n}),F(ie,{style:t,children:e}),o&&V(ne,{onClick:()=>{window.open(`https://api.whatsapp.com/send?phone=${o}`)},style:{marginBottom:16},children:[V(Ge,{variant:"bodyXS",children:["Com d\xFAvidas? ",Ke.format(o.slice(2))]}),F(Je,{icon:Ye,size:"20px",removeMargin:!0})]})]})}import{Button as tt,LIcon as O}from"@s_mart/core";import{Checkbox as ot,TextField as at}from"@s_mart/form";import{Link as rt,Typography as B}from"@mui/material";import{lineCheck as J}from"@s_mart/regular-icons";import{colorPalette as R}from"@s_mart/tokens";import{styled as S}from"@mui/material/styles";import{toRem as d}from"@s_mart/utils";import"@mui/system";var se=S("div")`
102
+ `;import{jsx as F,jsxs as H}from"react/jsx-runtime";function l({children:e,whatsapp:o,textoChamativo:a,style:n,paperStyle:t,ilustracao:i}){return H(oe,{style:n,children:[a&&F(re,{children:a}),i&&F(ae,{children:typeof i=="string"?F("img",{src:i,alt:"Logo do sistema"}):i}),F(ie,{style:t,children:e}),o&&H(ne,{onClick:()=>{window.open(`https://api.whatsapp.com/send?phone=${o}`)},style:{marginBottom:16},children:[H(Ge,{variant:"bodyXS",children:["Com d\xFAvidas? ",Ke.format(o.slice(2))]}),F(Je,{icon:Ye,size:"20px",removeMargin:!0})]})]})}import{Button as tt,LIcon as O}from"@s_mart/core";import{Checkbox as ot,TextField as at}from"@s_mart/form";import{Link as rt,Typography as B}from"@mui/material";import{lineCheck as J}from"@s_mart/regular-icons";import{colorPalette as R}from"@s_mart/tokens";import{styled as S}from"@mui/material/styles";import{toRem as m}from"@s_mart/utils";import"@mui/system";var se=S("div")`
103
103
  display: grid;
104
- gap: ${d(32)};
104
+ gap: ${m(32)};
105
105
  `,pe=S("header")`
106
106
  display: grid;
107
107
  text-align: center;
108
- gap: ${d(16)};
108
+ gap: ${m(16)};
109
109
  `,le=S("div")`
110
110
  display: grid;
111
- gap: ${d(32)};
112
- `,de=S("div")`
111
+ gap: ${m(32)};
112
+ `,me=S("div")`
113
113
  display: grid;
114
- gap: ${d(4)};
114
+ gap: ${m(4)};
115
115
 
116
116
  > div:first-of-type {
117
117
  display: grid;
118
118
  grid-template-columns: 1fr 1fr;
119
- gap: ${d(16)};
119
+ gap: ${m(16)};
120
120
 
121
121
  @media (max-width: 768px) {
122
122
  grid-template-columns: 1fr;
123
- gap: ${d(8)};
123
+ gap: ${m(8)};
124
124
  }
125
125
  }
126
126
 
127
127
  > div:last-of-type {
128
128
  display: grid;
129
- gap: ${d(4)};
129
+ gap: ${m(4)};
130
130
  }
131
- `,me=S("div")`
131
+ `,de=S("div")`
132
132
  display: flex;
133
133
  flex-wrap: wrap;
134
- gap: ${d(8)};
134
+ gap: ${m(8)};
135
135
  `,D=S("div")`
136
136
  display: flex;
137
137
  align-items: center;
138
- gap: ${d(4)};
138
+ gap: ${m(4)};
139
139
 
140
140
  color: ${R.neutral[600]};
141
141
  border: 1px solid ${R.neutral[600]};
142
- border-radius: ${d(4)};
143
- padding: ${d(3)} ${d(4)};
142
+ border-radius: ${m(4)};
143
+ padding: ${m(3)} ${m(4)};
144
144
 
145
145
  line-height: 1em;
146
146
  vertical-align: middle;
@@ -149,7 +149,7 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
149
149
  color: ${R.green[300]};
150
150
  border-color: ${R.green[300]};
151
151
  }
152
- `;import{useForm as Ze,useWatch as je}from"react-hook-form";var _=e=>e?e.match(/[a-z]/i):!1,X=e=>e?e.match(/[0-9]/i):!1,A=e=>e?e.length>=6:!1,ce={validate:e=>{if(!e)return"Obrigat\xF3rio";if(!_(e))return"Deve ter pelo menos uma letra";if(!X(e))return"Deve ter pelo menos um n\xFAmero";if(!A(e))return"Deve ter pelo menos 6 caracteres"}},ue=e=>({validate:o=>{if(!o)return"Obrigat\xF3rio";if(o!==e)return"As senhas devem ser iguais"}});function fe({email:e,nome:o}){let i=Ze({defaultValues:{email:e,nome:o,termosDeUso:!1,senha:void 0}}),r=je({control:i.control,name:"senha"}),t=_(r),n=X(r),h=A(r);return{form:i,senha:r,senhaContemLetra:t,senhaContemNumero:n,senhaContemMinimoDe6Caracteres:h}}import{TextField as Q}from"@s_mart/form";import{required as et}from"@s_mart/rules";import{jsx as U}from"react/jsx-runtime";var W={textFieldNome:e=>U(Q,{...e}),textFieldEmail:e=>U(Q,{...e}),textFieldSenha:e=>U(Q,{...e})},he={name:"nome",label:"Nome completo",required:!0,rules:et},ye={name:"email",label:"E-mail de acesso",required:!0,disabled:!0},ge={name:"senha",label:"Senha de acesso",type:"password",required:!0,rules:ce};import{FormProvider as it}from"react-hook-form";import{memo as nt}from"react";import{jsx as a,jsxs as m}from"react/jsx-runtime";var Ce=nt(e=>{let{form:o,senha:i,senhaContemLetra:r,senhaContemMinimoDe6Caracteres:t,senhaContemNumero:n}=fe(e),h=e.logo,x=e.slots,y=typeof e.logo=="string"?a("img",{src:h,alt:"Logo do sistema"}):h,T=x?.textFieldNome??W.textFieldNome,w=x?.textFieldEmail??W.textFieldEmail,N=x?.textFieldSenha??W.textFieldSenha;return a(l,{...e,children:m(se,{children:[m(pe,{children:[h&&a("div",{children:y}),m(B,{variant:"titleSM",children:["Vamos cadastrar uma senha de acesso ao ",e.nomeSistema,"."]})]}),a(it,{...o,children:a("form",{onSubmit:o.handleSubmit(e.onSubmit),children:m(le,{children:[a(w,{...ye}),a(T,{...he}),m(de,{children:[m("div",{children:[a(N,{...ge}),a(at,{type:"password",name:"confirmarSenha",label:"Confirme sua senha",required:!0,rules:ue(i)})]}),m("div",{children:[a(B,{variant:"bodyXS",children:"Sua senha precisa conter:"}),m(me,{children:[m(D,{"data-checked":!!r,children:[r&&a(O,{icon:J,size:"16px",removeMargin:!0}),a(B,{variant:"bodyXS",children:"Uma letra"})]}),m(D,{"data-checked":!!n,children:[n&&a(O,{icon:J,size:"16px",removeMargin:!0}),a(B,{variant:"bodyXS",children:"Um n\xFAmero"})]}),m(D,{"data-checked":!!t,children:[t&&a(O,{icon:J,size:"16px",removeMargin:!0}),a(B,{variant:"bodyXS",children:"M\xEDnimo de 6 caracteres"})]})]})]})]}),a("div",{children:a(ot,{name:"termosDeUso",label:m("div",{style:{display:"flex",gap:4},children:[a("span",{children:"Li e aceito os"}),a(rt,{href:e.linkTermosDeUso,target:"_blank",sx:L=>({color:L.palette.primary.main}),rel:"noreferrer",children:"termos de uso"})]})})}),a("div",{children:a(tt,{type:"submit",fullWidth:!0,disabled:!o.formState.isValid,children:"Concluir meu cadastro"})})]})})})]})})});Ce.displayName="TelaCadastro";import{useMemo as st}from"react";import{Button as Se,Indicator as pt}from"@s_mart/core";import{Checkbox as lt,Form as dt,TextField as be}from"@s_mart/form";import{composeValidators as mt,required as $e,email as ct}from"@s_mart/rules";import{useCapsLock as ut}from"@s_mart/hooks";import{colorPalette as ft}from"@s_mart/tokens";import{Typography as ht,useMediaQuery as yt}from"@mui/material";import G from"@emotion/styled";import{toRem as P}from"@s_mart/utils";var xe=G.div`
152
+ `;import{useForm as Ze,useWatch as je}from"react-hook-form";var _=e=>e?e.match(/[a-z]/i):!1,X=e=>e?e.match(/[0-9]/i):!1,A=e=>e?e.length>=6:!1,ce={validate:e=>{if(!e)return"Obrigat\xF3rio";if(!_(e))return"Deve ter pelo menos uma letra";if(!X(e))return"Deve ter pelo menos um n\xFAmero";if(!A(e))return"Deve ter pelo menos 6 caracteres"}},ue=e=>({validate:o=>{if(!o)return"Obrigat\xF3rio";if(o!==e)return"As senhas devem ser iguais"}});function fe({defaultValues:e}){let o=Ze({defaultValues:e}),a=je({control:o.control,name:"senha"}),n=_(a),t=X(a),i=A(a);return{form:o,senha:a,senhaContemLetra:n,senhaContemNumero:t,senhaContemMinimoDe6Caracteres:i}}import{TextField as Q}from"@s_mart/form";import{required as et}from"@s_mart/rules";import{jsx as U}from"react/jsx-runtime";var W={textFieldNome:e=>U(Q,{...e}),textFieldEmail:e=>U(Q,{...e}),textFieldSenha:e=>U(Q,{...e})},he={type:"text",name:"nome",label:"Nome completo",required:!0,rules:et},ye={type:"email",name:"email",label:"E-mail de acesso",required:!0,disabled:!0},ge={type:"password",name:"senha",label:"Senha de acesso",required:!0,rules:ce};import{FormProvider as it}from"react-hook-form";import{memo as nt}from"react";import{jsx as r,jsxs as d}from"react/jsx-runtime";var Ce=nt(e=>{let{form:o,senha:a,senhaContemLetra:n,senhaContemMinimoDe6Caracteres:t,senhaContemNumero:i}=fe(e),g=e.logo,x=e.slots,h=typeof e.logo=="string"?r("img",{src:g,alt:"Logo do sistema"}):g,T=x?.textFieldNome??W.textFieldNome,w=x?.textFieldEmail??W.textFieldEmail,N=x?.textFieldSenha??W.textFieldSenha;return r(l,{...e,children:d(se,{children:[d(pe,{children:[g&&r("div",{children:h}),d(B,{variant:"titleSM",children:["Vamos cadastrar uma senha de acesso ao ",e.nomeSistema,"."]})]}),r(it,{...o,children:r("form",{onSubmit:o.handleSubmit(e.onSubmit),children:d(le,{children:[r(w,{...ye}),r(T,{...he}),d(me,{children:[d("div",{children:[r(N,{...ge}),r(at,{type:"password",name:"confirmarSenha",label:"Confirme sua senha",required:!0,rules:ue(a)})]}),d("div",{children:[r(B,{variant:"bodyXS",children:"Sua senha precisa conter:"}),d(de,{children:[d(D,{"data-checked":!!n,children:[n&&r(O,{icon:J,size:"16px",removeMargin:!0}),r(B,{variant:"bodyXS",children:"Uma letra"})]}),d(D,{"data-checked":!!i,children:[i&&r(O,{icon:J,size:"16px",removeMargin:!0}),r(B,{variant:"bodyXS",children:"Um n\xFAmero"})]}),d(D,{"data-checked":!!t,children:[t&&r(O,{icon:J,size:"16px",removeMargin:!0}),r(B,{variant:"bodyXS",children:"M\xEDnimo de 6 caracteres"})]})]})]})]}),r("div",{children:r(ot,{name:"termosDeUso",label:d("div",{style:{display:"flex",gap:4},children:[r("span",{children:"Li e aceito os"}),r(rt,{href:e.linkTermosDeUso,target:"_blank",sx:L=>({color:L.palette.primary.main}),rel:"noreferrer",children:"termos de uso"})]})})}),r("div",{children:r(tt,{type:"submit",fullWidth:!0,disabled:!o.formState.isValid,children:"Concluir meu cadastro"})})]})})})]})})});Ce.displayName="TelaCadastro";import{useMemo as st}from"react";import{Button as Se,Indicator as pt}from"@s_mart/core";import{Checkbox as lt,Form as mt,TextField as be}from"@s_mart/form";import{composeValidators as dt,required as $e,email as ct}from"@s_mart/rules";import{useCapsLock as ut}from"@s_mart/hooks";import{colorPalette as ft}from"@s_mart/tokens";import{Typography as ht,useMediaQuery as yt}from"@mui/material";import G from"@emotion/styled";import{toRem as P}from"@s_mart/utils";var xe=G.div`
153
153
  display: grid;
154
154
  gap: ${P(32)};
155
155
  `,ve=G.header`
@@ -168,7 +168,7 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
168
168
  > div:last-of-type {
169
169
  gap: ${P(8)};
170
170
  }
171
- `;import{jsx as c,jsxs as q}from"react/jsx-runtime";function gt({logo:e,initialValues:o,onSubmit:i,onEsqueciMinhaSenha:r,errorLabel:t,...n}){let h=typeof e=="string"?c("img",{src:e,alt:"Logo do sistema"}):e,x=ut(),y=yt("(max-width: 500px)"),T=st(()=>({manterConectado:!1,...o}),[o]);return c(l,{...n,paperStyle:{minWidth:y?void 0:456,width:y?"90%":void 0},children:q(xe,{children:[c(ve,{children:e&&c("div",{children:h})}),c(dt,{onSubmit:i,defaultValues:T,children:q(Te,{children:[q("div",{children:[c(be,{name:"email",label:"E-mail de acesso",required:!0,rules:mt([$e,ct]),autoComplete:"email",type:"email"}),q("div",{children:[c(be,{name:"senha",label:"Senha de acesso",type:"password",required:!0,rules:$e}),x&&c(pt,{severity:"warning",children:"Capslock ativado"}),!!t&&c(ht,{variant:"titleXXS",color:ft.red[300],children:t})]})]}),c(lt,{name:"manterConectado",label:"Manter conectado"}),q("div",{children:[c(Se,{type:"submit",fullWidth:!0,children:"Entrar"}),r&&c(Se,{type:"button",fullWidth:!0,variant:"text",onClick:r,children:"Esqueci minha senha"})]})]})})]})})}import{Button as qe,LIcon as Ct}from"@s_mart/core";import{Typography as Ee,useMediaQuery as xt}from"@mui/material";import{colorPalette as Y}from"@s_mart/tokens";import{lineWhatsApp as vt}from"@s_mart/regular-icons";import Fe from"@emotion/styled";import{toRem as K}from"@s_mart/utils";var Be=Fe.div`
171
+ `;import{jsx as c,jsxs as q}from"react/jsx-runtime";function gt({logo:e,initialValues:o,onSubmit:a,onEsqueciMinhaSenha:n,errorLabel:t,...i}){let g=typeof e=="string"?c("img",{src:e,alt:"Logo do sistema"}):e,x=ut(),h=yt("(max-width: 500px)"),T=st(()=>({manterConectado:!1,...o}),[o]);return c(l,{...i,paperStyle:{minWidth:h?void 0:456,width:h?"90%":void 0},children:q(xe,{children:[c(ve,{children:e&&c("div",{children:g})}),c(mt,{onSubmit:a,defaultValues:T,children:q(Te,{children:[q("div",{children:[c(be,{name:"email",label:"E-mail de acesso",required:!0,rules:dt([$e,ct]),autoComplete:"email",type:"email"}),q("div",{children:[c(be,{name:"senha",label:"Senha de acesso",type:"password",required:!0,rules:$e}),x&&c(pt,{severity:"warning",children:"Capslock ativado"}),!!t&&c(ht,{variant:"titleXXS",color:ft.red[300],children:t})]})]}),c(lt,{name:"manterConectado",label:"Manter conectado"}),q("div",{children:[c(Se,{type:"submit",fullWidth:!0,children:"Entrar"}),n&&c(Se,{type:"button",fullWidth:!0,variant:"text",onClick:n,children:"Esqueci minha senha"})]})]})})]})})}import{Button as qe,LIcon as Ct}from"@s_mart/core";import{Typography as Ee,useMediaQuery as xt}from"@mui/material";import{colorPalette as Y}from"@s_mart/tokens";import{lineWhatsApp as vt}from"@s_mart/regular-icons";import Fe from"@emotion/styled";import{toRem as K}from"@s_mart/utils";var Be=Fe.div`
172
172
  display: grid;
173
173
  gap: ${K(32)};
174
174
 
@@ -180,7 +180,7 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
180
180
  display: grid;
181
181
  text-align: center;
182
182
  gap: ${K(16)};
183
- `;import{jsx as C,jsxs as E}from"react/jsx-runtime";function Tt({logo:e,onPrecisoDeAjuda:o,onRealizarAcesso:i,...r}){let t=typeof e=="string"?C("img",{src:e,alt:"Logo do sistema"}):e,n=xt("(max-width: 500px)");return C(l,{...r,paperStyle:{minWidth:n?void 0:456,width:n?"90%":void 0},children:E(Be,{children:[E("div",{children:[C(Pe,{children:e&&C("div",{children:t})}),E("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",gap:8,color:Y.neutral[800]},children:[C(Ee,{variant:"bodyMD",children:"Parece que este convite j\xE1 foi usado ou expirou."}),C(Ee,{variant:"bodyMD",children:"J\xE1 se cadastrou? Realize o login."})]})]}),E("div",{children:[C(qe,{fullWidth:!0,onClick:i,children:"Realizar login"}),E(qe,{fullWidth:!0,variant:"text",onClick:o,style:{display:"flex",gap:4,color:Y.neutral[900]},children:[C(Ct,{icon:vt,size:"20px",removeMargin:!0,color:Y.neutral[900]}),"Preciso de outro convite"]})]})]})})}import{Button as St}from"@s_mart/core";import{useMediaQuery as bt,Typography as Ne}from"@mui/material";import ke from"@emotion/styled";import{toRem as Z}from"@s_mart/utils";var Me=ke.div`
183
+ `;import{jsx as C,jsxs as E}from"react/jsx-runtime";function Tt({logo:e,onPrecisoDeAjuda:o,onRealizarAcesso:a,...n}){let t=typeof e=="string"?C("img",{src:e,alt:"Logo do sistema"}):e,i=xt("(max-width: 500px)");return C(l,{...n,paperStyle:{minWidth:i?void 0:456,width:i?"90%":void 0},children:E(Be,{children:[E("div",{children:[C(Pe,{children:e&&C("div",{children:t})}),E("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",gap:8,color:Y.neutral[800]},children:[C(Ee,{variant:"bodyMD",children:"Parece que este convite j\xE1 foi usado ou expirou."}),C(Ee,{variant:"bodyMD",children:"J\xE1 se cadastrou? Realize o login."})]})]}),E("div",{children:[C(qe,{fullWidth:!0,onClick:a,children:"Realizar login"}),E(qe,{fullWidth:!0,variant:"text",onClick:o,style:{display:"flex",gap:4,color:Y.neutral[900]},children:[C(Ct,{icon:vt,size:"20px",removeMargin:!0,color:Y.neutral[900]}),"Preciso de outro convite"]})]})]})})}import{Button as St}from"@s_mart/core";import{useMediaQuery as bt,Typography as Ne}from"@mui/material";import ke from"@emotion/styled";import{toRem as Z}from"@s_mart/utils";var Me=ke.div`
184
184
  display: grid;
185
185
  gap: ${Z(32)};
186
186
 
@@ -192,7 +192,7 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
192
192
  display: grid;
193
193
  text-align: center;
194
194
  gap: ${Z(16)};
195
- `;import{jsx as v,jsxs as Le}from"react/jsx-runtime";function $t({logo:e,onVoltarParaLogin:o,...i}){let r=typeof e=="string"?v("img",{src:e,alt:"Logo do sistema"}):e,t=bt("(max-width: 500px)");return v(l,{...i,paperStyle:{maxWidth:t?void 0:456,width:t?"90%":void 0},children:Le(Me,{children:[Le("div",{style:{display:"flex",flexDirection:"column",gap:24},children:[v(we,{children:e&&v("div",{children:r})}),v(Ne,{variant:"titleMD",textAlign:"center",children:"Instru\xE7\xF5es enviadas"}),v(Ne,{variant:"bodySM",textAlign:"center",children:"Enviamos ao seu e-mail de acesso as instru\xE7\xF5es para criar uma nova senha. Verifique sua caixa de entrada e de Spam."})]}),v(St,{fullWidth:!0,onClick:o,children:"Voltar para login"})]})})}import{Button as Ft,LIcon as j}from"@s_mart/core";import{Typography as k}from"@mui/material";import{Form as Bt,TextField as Ve}from"@s_mart/form";import{required as Pt}from"@s_mart/rules";import{lineCheck as ee}from"@s_mart/regular-icons";import{colorPalette as I}from"@s_mart/tokens";import b from"@emotion/styled";import{toRem as u}from"@s_mart/utils";var Re=b.div`
195
+ `;import{jsx as v,jsxs as Le}from"react/jsx-runtime";function $t({logo:e,onVoltarParaLogin:o,...a}){let n=typeof e=="string"?v("img",{src:e,alt:"Logo do sistema"}):e,t=bt("(max-width: 500px)");return v(l,{...a,paperStyle:{maxWidth:t?void 0:456,width:t?"90%":void 0},children:Le(Me,{children:[Le("div",{style:{display:"flex",flexDirection:"column",gap:24},children:[v(we,{children:e&&v("div",{children:n})}),v(Ne,{variant:"titleMD",textAlign:"center",children:"Instru\xE7\xF5es enviadas"}),v(Ne,{variant:"bodySM",textAlign:"center",children:"Enviamos ao seu e-mail de acesso as instru\xE7\xF5es para criar uma nova senha. Verifique sua caixa de entrada e de Spam."})]}),v(St,{fullWidth:!0,onClick:o,children:"Voltar para login"})]})})}import{Button as Ft,LIcon as j}from"@s_mart/core";import{Typography as k}from"@mui/material";import{Form as Bt,TextField as He}from"@s_mart/form";import{required as Pt}from"@s_mart/rules";import{lineCheck as ee}from"@s_mart/regular-icons";import{colorPalette as I}from"@s_mart/tokens";import b from"@emotion/styled";import{toRem as u}from"@s_mart/utils";var Re=b.div`
196
196
  display: grid;
197
197
  gap: ${u(32)};
198
198
  `,De=b.header`
@@ -221,11 +221,11 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
221
221
  display: grid;
222
222
  gap: ${u(4)};
223
223
  }
224
- `,ze=b.div`
224
+ `,Ve=b.div`
225
225
  display: flex;
226
226
  flex-wrap: wrap;
227
227
  gap: ${u(8)};
228
- `,z=b.div`
228
+ `,V=b.div`
229
229
  display: flex;
230
230
  align-items: center;
231
231
  gap: ${u(4)};
@@ -242,7 +242,7 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
242
242
  color: ${I.green[300]};
243
243
  border-color: ${I.green[300]};
244
244
  `}}
245
- `;function He(){let e=t=>t?t.match(/[a-z]/i):!1,o=t=>t?t.match(/[0-9]/i):!1,i=t=>t?t.length>=6:!1;return{senhaContemLetra:e,senhaContemNumero:o,senhaContemMinimoDe6Caracteres:i,desabilitarBotaoDeCadastro:t=>!t.senha||!t.confirmarSenha||!e(t.senha)||!o(t.senha)||!i(t.senha)}}import{jsx as s,jsxs as g}from"react/jsx-runtime";function qt({logo:e,onTrocarMinhaSenha:o,...i}){let{senhaContemLetra:r,senhaContemNumero:t,senhaContemMinimoDe6Caracteres:n,desabilitarBotaoDeCadastro:h}=He();return s(l,{...i,children:g(Re,{children:[g(De,{children:[e&&s("div",{children:typeof e=="string"?s("img",{src:e,alt:"Logo do sistema"}):e}),s(k,{variant:"titleSM",children:"Vamos cadastrar uma nova senha de acesso."})]}),s(Bt,{onSubmit:o,children:({watch:y})=>{let T=r(y("senha")),w=t(y("senha")),N=n(y("senha"));return g(We,{children:[g(Ie,{children:[g("div",{children:[s(Ve,{type:"password",name:"senha",label:"Senha de acesso",required:!0,rules:Pt}),s(Ve,{type:"password",name:"confirmarSenha",label:"Confirme sua senha",required:!0,rules:{validate:L=>{if(!L)return"Campo obrigat\xF3rio";if(L!==y("senha"))return"As senhas devem ser iguais"}}})]}),g("div",{children:[s(k,{variant:"bodyXS",children:"Sua senha precisa conter:"}),g(ze,{children:[g(z,{checked:!!T,children:[T&&s(j,{icon:ee,size:"16px",removeMargin:!0}),s(k,{variant:"bodyXS",children:"Uma letra"})]}),g(z,{checked:!!w,children:[w&&s(j,{icon:ee,size:"16px",removeMargin:!0}),s(k,{variant:"bodyXS",children:"Um n\xFAmero"})]}),g(z,{checked:!!N,children:[N&&s(j,{icon:ee,size:"16px",removeMargin:!0}),s(k,{variant:"bodyXS",children:"M\xEDnimo de 6 caracteres"})]})]})]})]}),s("div",{children:s(Ft,{type:"submit",fullWidth:!0,disabled:h(y()),children:"Trocar minha senha"})})]})}})]})})}import{Button as Qe}from"@s_mart/core";import{Typography as Ue,useMediaQuery as Et}from"@mui/material";import te from"@emotion/styled";import{toRem as M}from"@s_mart/utils";var _e=te.div`
245
+ `;function ze(){let e=t=>t?t.match(/[a-z]/i):!1,o=t=>t?t.match(/[0-9]/i):!1,a=t=>t?t.length>=6:!1;return{senhaContemLetra:e,senhaContemNumero:o,senhaContemMinimoDe6Caracteres:a,desabilitarBotaoDeCadastro:t=>!t.senha||!t.confirmarSenha||!e(t.senha)||!o(t.senha)||!a(t.senha)}}import{jsx as s,jsxs as y}from"react/jsx-runtime";function qt({logo:e,onTrocarMinhaSenha:o,...a}){let{senhaContemLetra:n,senhaContemNumero:t,senhaContemMinimoDe6Caracteres:i,desabilitarBotaoDeCadastro:g}=ze();return s(l,{...a,children:y(Re,{children:[y(De,{children:[e&&s("div",{children:typeof e=="string"?s("img",{src:e,alt:"Logo do sistema"}):e}),s(k,{variant:"titleSM",children:"Vamos cadastrar uma nova senha de acesso."})]}),s(Bt,{onSubmit:o,children:({watch:h})=>{let T=n(h("senha")),w=t(h("senha")),N=i(h("senha"));return y(We,{children:[y(Ie,{children:[y("div",{children:[s(He,{type:"password",name:"senha",label:"Senha de acesso",required:!0,rules:Pt}),s(He,{type:"password",name:"confirmarSenha",label:"Confirme sua senha",required:!0,rules:{validate:L=>{if(!L)return"Campo obrigat\xF3rio";if(L!==h("senha"))return"As senhas devem ser iguais"}}})]}),y("div",{children:[s(k,{variant:"bodyXS",children:"Sua senha precisa conter:"}),y(Ve,{children:[y(V,{checked:!!T,children:[T&&s(j,{icon:ee,size:"16px",removeMargin:!0}),s(k,{variant:"bodyXS",children:"Uma letra"})]}),y(V,{checked:!!w,children:[w&&s(j,{icon:ee,size:"16px",removeMargin:!0}),s(k,{variant:"bodyXS",children:"Um n\xFAmero"})]}),y(V,{checked:!!N,children:[N&&s(j,{icon:ee,size:"16px",removeMargin:!0}),s(k,{variant:"bodyXS",children:"M\xEDnimo de 6 caracteres"})]})]})]})]}),s("div",{children:s(Ft,{type:"submit",fullWidth:!0,disabled:g(h()),children:"Trocar minha senha"})})]})}})]})})}import{Button as Qe}from"@s_mart/core";import{Typography as Ue,useMediaQuery as Et}from"@mui/material";import te from"@emotion/styled";import{toRem as M}from"@s_mart/utils";var _e=te.div`
246
246
  display: grid;
247
247
  gap: ${M(32)};
248
248
 
@@ -262,4 +262,4 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
262
262
  display: grid;
263
263
  gap: ${M(16)};
264
264
  }
265
- `;import{Form as kt,TextField as Mt}from"@s_mart/form";import{composeValidators as wt,email as Nt,required as Lt}from"@s_mart/rules";import{jsx as f,jsxs as H}from"react/jsx-runtime";function Rt({logo:e,onVoltarParaLogin:o,onConfirmar:i,...r}){let t=typeof e=="string"?f("img",{src:e,alt:"Logo do sistema"}):e,n=Et("(max-width: 500px)");return f(l,{...r,paperStyle:{minWidth:n?void 0:456,width:n?"90%":void 0},children:H(_e,{children:[H("div",{style:{display:"flex",flexDirection:"column",gap:24},children:[f(Xe,{children:e&&f("div",{children:t})}),f(Ue,{variant:"titleMD",textAlign:"center",children:"Esqueceu a senha?"}),f(Ue,{variant:"bodySM",textAlign:"center",children:"Informe seu e-mail de acesso para receber instru\xE7\xF5es e criar uma nova senha."})]}),f(kt,{onSubmit:i,children:H(Ae,{children:[f("div",{children:f(Mt,{name:"email",label:"E-mail de acesso",required:!0,rules:wt([Lt,Nt]),type:"email"})}),H("div",{children:[f(Qe,{fullWidth:!0,type:"submit",children:"Confirmar"}),f(Qe,{fullWidth:!0,onClick:o,variant:"neutral",children:"Voltar para login"})]})]})})]})})}export{Ce as TelaCadastro,Tt as TelaConviteExpirado,Rt as TelaEsqueceuSenha,$t as TelaInstrucoesEnviadas,gt as TelaLogin,qt as TelaNovaSenha,l as TemplateTelaBase};
265
+ `;import{Form as kt,TextField as Mt}from"@s_mart/form";import{composeValidators as wt,email as Nt,required as Lt}from"@s_mart/rules";import{jsx as f,jsxs as z}from"react/jsx-runtime";function Rt({logo:e,onVoltarParaLogin:o,onConfirmar:a,...n}){let t=typeof e=="string"?f("img",{src:e,alt:"Logo do sistema"}):e,i=Et("(max-width: 500px)");return f(l,{...n,paperStyle:{minWidth:i?void 0:456,width:i?"90%":void 0},children:z(_e,{children:[z("div",{style:{display:"flex",flexDirection:"column",gap:24},children:[f(Xe,{children:e&&f("div",{children:t})}),f(Ue,{variant:"titleMD",textAlign:"center",children:"Esqueceu a senha?"}),f(Ue,{variant:"bodySM",textAlign:"center",children:"Informe seu e-mail de acesso para receber instru\xE7\xF5es e criar uma nova senha."})]}),f(kt,{onSubmit:a,children:z(Ae,{children:[f("div",{children:f(Mt,{name:"email",label:"E-mail de acesso",required:!0,rules:wt([Lt,Nt]),type:"email"})}),z("div",{children:[f(Qe,{fullWidth:!0,type:"submit",children:"Confirmar"}),f(Qe,{fullWidth:!0,onClick:o,variant:"neutral",children:"Voltar para login"})]})]})})]})})}export{Ce as TelaCadastro,Tt as TelaConviteExpirado,Rt as TelaEsqueceuSenha,$t as TelaInstrucoesEnviadas,gt as TelaLogin,qt as TelaNovaSenha,l as TemplateTelaBase};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s_mart/telas-de-acesso",
3
- "version": "8.1.0",
3
+ "version": "9.0.0",
4
4
  "main": "./dist/index.mjs",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.mts",
@@ -27,11 +27,11 @@
27
27
  "typescript": ">=5.4.2",
28
28
  "@s_mart/core": "8.0.4",
29
29
  "@s_mart/form": "8.1.1",
30
- "@s_mart/hooks": "8.0.9",
31
30
  "@s_mart/masks": "5.2.0",
32
31
  "@s_mart/regular-icons": "6.0.6",
33
- "@s_mart/utils": "5.3.4",
34
- "@s_mart/tokens": "5.1.1"
32
+ "@s_mart/tokens": "5.1.1",
33
+ "@s_mart/hooks": "8.0.9",
34
+ "@s_mart/utils": "5.3.4"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"
@@ -44,13 +44,13 @@
44
44
  "@types/react": ">=18.3.12",
45
45
  "@types/react-dom": ">=18.3.1",
46
46
  "typescript": ">=5.4.2",
47
- "@s_mart/core": "8.0.4",
48
47
  "@s_mart/form": "8.1.1",
48
+ "@s_mart/core": "8.0.4",
49
49
  "@s_mart/hooks": "8.0.9",
50
- "@s_mart/regular-icons": "6.0.6",
51
50
  "@s_mart/tokens": "5.1.1",
51
+ "@s_mart/masks": "5.2.0",
52
52
  "@s_mart/utils": "5.3.4",
53
- "@s_mart/masks": "5.2.0"
53
+ "@s_mart/regular-icons": "6.0.6"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "tsup src/index.tsx --minify --format esm --dts --external react",