@s_mart/telas-de-acesso 8.0.6 → 8.1.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
@@ -1,4 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
3
+ import { TextFieldProps } from '@s_mart/form';
2
4
  import { UseFormReturn, FieldValues } from 'react-hook-form';
3
5
 
4
6
  interface TemplateTelaBaseProps {
@@ -50,11 +52,11 @@ interface TelaCadastroProps extends Omit<TemplateTelaBaseProps, 'children'> {
50
52
  * Logo do sistema que será exibido do topo do paper de cadastro
51
53
  * @default undefined
52
54
  */
53
- logo?: React.ImgHTMLAttributes<HTMLImageElement>['src'] | React.ReactNode;
55
+ logo?: React.ImgHTMLAttributes<HTMLImageElement>['src'];
54
56
  /**
55
57
  * Função que será executada quando o formulário for submetido
56
58
  */
57
- onSubmit: (data: any, methods: UseFormReturn<FieldValues, any>) => void;
59
+ onSubmit: (data: FormTelaCadastroSubmitValues) => void;
58
60
  /**
59
61
  * Link dos termos de uso do sistema - será exibido no checkbox de aceite dos termos de uso
60
62
  * @default undefined
@@ -63,9 +65,22 @@ interface TelaCadastroProps extends Omit<TemplateTelaBaseProps, 'children'> {
63
65
  * <TelaCadastro linkTermosDeUso="https://www.google.com" />
64
66
  */
65
67
  linkTermosDeUso?: string;
68
+ slots?: TelaCadastroSlots;
66
69
  }
70
+ type TelaCadastroSlots = {
71
+ textFieldEmail?: (props: TextFieldProps) => React.ReactNode;
72
+ textFieldNome?: (props: TextFieldProps) => React.ReactNode;
73
+ textFieldSenha?: (props: TextFieldProps) => React.ReactNode;
74
+ };
75
+ type FormTelaCadastroValues = {
76
+ nome?: string;
77
+ email: string;
78
+ termosDeUso: boolean;
79
+ senha: string;
80
+ };
81
+ type FormTelaCadastroSubmitValues = FormTelaCadastroValues;
67
82
 
68
- declare function TelaCadastro({ logo, nomeSistema, onSubmit, linkTermosDeUso, email, nome, ...rest }: TelaCadastroProps): react_jsx_runtime.JSX.Element;
83
+ declare const TelaCadastro: react.MemoExoticComponent<(props: TelaCadastroProps) => react_jsx_runtime.JSX.Element>;
69
84
 
70
85
  interface TelaLoginFormValues {
71
86
  email: string;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{LIcon as Ve}from"@s_mart/core";import{Typography as Xe}from"@mui/material";import{telefone as Ae}from"@s_mart/masks";import{lineWhatsApp as Qe}from"@s_mart/regular-icons";import{toRem as p}from"@s_mart/utils";import B from"@emotion/styled";import{colorPalette as He}from"@s_mart/tokens";var ae=B.div`
1
+ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material";import{telefone as Ke}from"@s_mart/masks";import{lineWhatsApp as Ye}from"@s_mart/regular-icons";import{toRem as p}from"@s_mart/utils";import $ from"@emotion/styled";import{colorPalette as Oe}from"@s_mart/tokens";var oe=$.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: center;
@@ -18,7 +18,7 @@ import{LIcon as Ve}from"@s_mart/core";import{Typography as Xe}from"@mui/material
18
18
  @media (max-height: 600px) {
19
19
  justify-content: flex-start;
20
20
  }
21
- `,te=B.div`
21
+ `,ae=$.div`
22
22
  position: absolute;
23
23
  left: 0;
24
24
  bottom: 32px;
@@ -27,7 +27,7 @@ import{LIcon as Ve}from"@s_mart/core";import{Typography as Xe}from"@mui/material
27
27
  @media (max-width: 768px) {
28
28
  display: none;
29
29
  }
30
- `,oe=B.h1`
30
+ `,re=$.h1`
31
31
  position: absolute;
32
32
  left: 32px;
33
33
  top: 32px;
@@ -66,7 +66,7 @@ import{LIcon as Ve}from"@s_mart/core";import{Typography as Xe}from"@mui/material
66
66
  @media (max-width: 500px) {
67
67
  display: none;
68
68
  }
69
- `,re=B.div`
69
+ `,ie=$.div`
70
70
  position: relative;
71
71
  z-index: 2;
72
72
 
@@ -75,7 +75,7 @@ import{LIcon as Ve}from"@s_mart/core";import{Typography as Xe}from"@mui/material
75
75
  margin: ${p(16)};
76
76
 
77
77
  background-color: ${({theme:e})=>e.palette.common.white};
78
- `,ie=B.button`
78
+ `,ne=$.button`
79
79
  position: relative;
80
80
  z-index: 2;
81
81
 
@@ -96,113 +96,113 @@ import{LIcon as Ve}from"@s_mart/core";import{Typography as Xe}from"@mui/material
96
96
  background-color: transparent;
97
97
 
98
98
  svg {
99
- color: ${He.green[300]};
99
+ color: ${Oe.green[300]};
100
100
  }
101
101
  }
102
- `;import{jsx as q,jsxs as H}from"react/jsx-runtime";function d({children:e,whatsapp:t,textoChamativo:r,style:i,paperStyle:a,ilustracao:n}){return H(ae,{style:i,children:[r&&q(oe,{children:r}),n&&q(te,{children:typeof n=="string"?q("img",{src:n,alt:"Logo do sistema"}):n}),q(re,{style:a,children:e}),t&&H(ie,{onClick:()=>{window.open(`https://api.whatsapp.com/send?phone=${t}`)},style:{marginBottom:16},children:[H(Xe,{variant:"bodyXS",children:["Com d\xFAvidas? ",Ae.format(t.slice(2))]}),q(Ve,{icon:Qe,size:"20px",removeMargin:!0})]})]})}import{Button as Ue,LIcon as V}from"@s_mart/core";import{Checkbox as Oe,Form as Je,TextField as N}from"@s_mart/form";import{Typography as M}from"@mui/material";import{required as ce}from"@s_mart/rules";import{lineCheck as X}from"@s_mart/regular-icons";import{colorPalette as R}from"@s_mart/tokens";import S from"@emotion/styled";import{toRem as l}from"@s_mart/utils";var ne=S.div`
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")`
103
103
  display: grid;
104
- gap: ${l(32)};
105
- `,se=S.header`
104
+ gap: ${d(32)};
105
+ `,pe=S("header")`
106
106
  display: grid;
107
107
  text-align: center;
108
- gap: ${l(16)};
109
- `,pe=S.div`
108
+ gap: ${d(16)};
109
+ `,le=S("div")`
110
110
  display: grid;
111
- gap: ${l(32)};
112
- `,de=S.div`
111
+ gap: ${d(32)};
112
+ `,de=S("div")`
113
113
  display: grid;
114
- gap: ${l(4)};
114
+ gap: ${d(4)};
115
115
 
116
116
  > div:first-of-type {
117
117
  display: grid;
118
118
  grid-template-columns: 1fr 1fr;
119
- gap: ${l(16)};
119
+ gap: ${d(16)};
120
120
 
121
121
  @media (max-width: 768px) {
122
122
  grid-template-columns: 1fr;
123
- gap: ${l(8)};
123
+ gap: ${d(8)};
124
124
  }
125
125
  }
126
126
 
127
127
  > div:last-of-type {
128
128
  display: grid;
129
- gap: ${l(4)};
129
+ gap: ${d(4)};
130
130
  }
131
- `,le=S.div`
131
+ `,me=S("div")`
132
132
  display: flex;
133
133
  flex-wrap: wrap;
134
- gap: ${l(8)};
135
- `,D=S.div`
134
+ gap: ${d(8)};
135
+ `,D=S("div")`
136
136
  display: flex;
137
137
  align-items: center;
138
- gap: ${l(4)};
138
+ gap: ${d(4)};
139
139
 
140
140
  color: ${R.neutral[600]};
141
141
  border: 1px solid ${R.neutral[600]};
142
- border-radius: ${l(4)};
143
- padding: ${l(3)} ${l(4)};
142
+ border-radius: ${d(4)};
143
+ padding: ${d(3)} ${d(4)};
144
144
 
145
145
  line-height: 1em;
146
146
  vertical-align: middle;
147
147
 
148
- ${({checked:e})=>{if(e)return`
149
- color: ${R.green[300]};
150
- border-color: ${R.green[300]};
151
- `}}
152
- `;function me(){let e=a=>a?a.match(/[a-z]/i):!1,t=a=>a?a.match(/[0-9]/i):!1,r=a=>a?a.length>=6:!1;return{senhaContemLetra:e,senhaContemNumero:t,senhaContemMinimoDe6Caracteres:r,desabilitarBotaoDeCadastro:a=>!a.email||!a.senha||!a.confirmarSenha||!a.termosDeUso||!e(a.senha)||!t(a.senha)||!r(a.senha)}}import{jsx as o,jsxs as m}from"react/jsx-runtime";function Ge({logo:e,nomeSistema:t,onSubmit:r,linkTermosDeUso:i,email:a,nome:n,...x}){let{senhaContemLetra:b,senhaContemNumero:h,senhaContemMinimoDe6Caracteres:T,desabilitarBotaoDeCadastro:L}=me();return o(d,{...x,children:m(ne,{children:[m(se,{children:[e&&o("div",{children:typeof e=="string"?o("img",{src:e,alt:"Logo do sistema"}):e}),m(M,{variant:"titleSM",children:["Vamos cadastrar uma senha de acesso ao ",t,"."]})]}),o(Je,{onSubmit:r,defaultValues:{email:a,nome:n,termosDeUso:!1},children:({watch:g})=>{let Y=b(g("senha")),Z=h(g("senha")),j=T(g("senha"));return m(pe,{children:[o(N,{name:"email",label:"E-mail de acesso",required:!0,disabled:!0}),o(N,{name:"nome",label:"Nome completo",required:!0,rules:ce}),m(de,{children:[m("div",{children:[o(N,{type:"password",name:"senha",label:"Senha de acesso",required:!0,rules:ce}),o(N,{type:"password",name:"confirmarSenha",label:"Confirme sua senha",required:!0,rules:{validate:ee=>{if(!ee)return"Campo obrigat\xF3rio";if(ee!==g("senha"))return"As senhas devem ser iguais"}}})]}),m("div",{children:[o(M,{variant:"bodyXS",children:"Sua senha precisa conter:"}),m(le,{children:[m(D,{checked:!!Y,children:[Y&&o(V,{icon:X,size:"16px",removeMargin:!0}),o(M,{variant:"bodyXS",children:"Uma letra"})]}),m(D,{checked:!!Z,children:[Z&&o(V,{icon:X,size:"16px",removeMargin:!0}),o(M,{variant:"bodyXS",children:"Um n\xFAmero"})]}),m(D,{checked:!!j,children:[j&&o(V,{icon:X,size:"16px",removeMargin:!0}),o(M,{variant:"bodyXS",children:"M\xEDnimo de 6 caracteres"})]})]})]})]}),o("div",{children:o(Oe,{name:"termosDeUso",label:m("div",{style:{display:"flex",gap:4},children:[o("span",{children:"Li e aceito os"}),o("a",{href:i,target:"_blank",style:{color:"var(--color-primary)"},rel:"noreferrer",children:"termos de uso"})]})})}),o("div",{children:o(Ue,{type:"submit",fullWidth:!0,disabled:L(g()),children:"Concluir meu cadastro"})})]})}})]})})}import{useMemo as Ke}from"react";import{Button as ye,Indicator as Ye}from"@s_mart/core";import{Checkbox as Ze,Form as je,TextField as ge}from"@s_mart/form";import{composeValidators as ea,required as Ce,email as aa}from"@s_mart/rules";import{useCapsLock as ta}from"@s_mart/hooks";import{colorPalette as oa}from"@s_mart/tokens";import{Typography as ra,useMediaQuery as ia}from"@mui/material";import A from"@emotion/styled";import{toRem as F}from"@s_mart/utils";var ue=A.div`
148
+ &[data-checked='true'] {
149
+ color: ${R.green[300]};
150
+ border-color: ${R.green[300]};
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`
153
153
  display: grid;
154
- gap: ${F(32)};
155
- `,fe=A.header`
154
+ gap: ${P(32)};
155
+ `,ve=G.header`
156
156
  display: grid;
157
157
  text-align: center;
158
- gap: ${F(16)};
159
- `,he=A.div`
158
+ gap: ${P(16)};
159
+ `,Te=G.div`
160
160
  display: grid;
161
- gap: ${F(16)};
161
+ gap: ${P(16)};
162
162
 
163
163
  > div {
164
164
  display: grid;
165
- gap: ${F(16)};
165
+ gap: ${P(16)};
166
166
  }
167
167
 
168
168
  > div:last-of-type {
169
- gap: ${F(8)};
169
+ gap: ${P(8)};
170
170
  }
171
- `;import{jsx as c,jsxs as P}from"react/jsx-runtime";function na({logo:e,initialValues:t,onSubmit:r,onEsqueciMinhaSenha:i,errorLabel:a,...n}){let x=typeof e=="string"?c("img",{src:e,alt:"Logo do sistema"}):e,b=ta(),h=ia("(max-width: 500px)"),T=Ke(()=>({manterConectado:!1,...t}),[t]);return c(d,{...n,paperStyle:{minWidth:h?void 0:456,width:h?"90%":void 0},children:P(ue,{children:[c(fe,{children:e&&c("div",{children:x})}),c(je,{onSubmit:r,defaultValues:T,children:P(he,{children:[P("div",{children:[c(ge,{name:"email",label:"E-mail de acesso",required:!0,rules:ea([Ce,aa]),autoComplete:"email",type:"email"}),P("div",{children:[c(ge,{name:"senha",label:"Senha de acesso",type:"password",required:!0,rules:Ce}),b&&c(Ye,{severity:"warning",children:"Capslock ativado"}),!!a&&c(ra,{variant:"titleXXS",color:oa.red[300],children:a})]})]}),c(Ze,{name:"manterConectado",label:"Manter conectado"}),P("div",{children:[c(ye,{type:"submit",fullWidth:!0,children:"Entrar"}),i&&c(ye,{type:"button",fullWidth:!0,variant:"text",onClick:i,children:"Esqueci minha senha"})]})]})})]})})}import{Button as Se,LIcon as sa}from"@s_mart/core";import{Typography as $e,useMediaQuery as pa}from"@mui/material";import{colorPalette as U}from"@s_mart/tokens";import{lineWhatsApp as da}from"@s_mart/regular-icons";import ve from"@emotion/styled";import{toRem as Q}from"@s_mart/utils";var xe=ve.div`
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`
172
172
  display: grid;
173
- gap: ${Q(32)};
173
+ gap: ${K(32)};
174
174
 
175
175
  > div {
176
176
  display: grid;
177
- gap: ${Q(8)};
177
+ gap: ${K(8)};
178
178
  }
179
- `,Te=ve.header`
179
+ `,Pe=Fe.header`
180
180
  display: grid;
181
181
  text-align: center;
182
- gap: ${Q(16)};
183
- `;import{jsx as C,jsxs as k}from"react/jsx-runtime";function la({logo:e,onPrecisoDeAjuda:t,onRealizarAcesso:r,...i}){let a=typeof e=="string"?C("img",{src:e,alt:"Logo do sistema"}):e,n=pa("(max-width: 500px)");return C(d,{...i,paperStyle:{minWidth:n?void 0:456,width:n?"90%":void 0},children:k(xe,{children:[k("div",{children:[C(Te,{children:e&&C("div",{children:a})}),k("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",gap:8,color:U.neutral[800]},children:[C($e,{variant:"bodyMD",children:"Parece que este convite j\xE1 foi usado ou expirou."}),C($e,{variant:"bodyMD",children:"J\xE1 se cadastrou? Realize o login."})]})]}),k("div",{children:[C(Se,{fullWidth:!0,onClick:r,children:"Realizar login"}),k(Se,{fullWidth:!0,variant:"text",onClick:t,style:{display:"flex",gap:4,color:U.neutral[900]},children:[C(sa,{icon:da,size:"20px",removeMargin:!0,color:U.neutral[900]}),"Preciso de outro convite"]})]})]})})}import{Button as ma}from"@s_mart/core";import{useMediaQuery as ca,Typography as Me}from"@mui/material";import be from"@emotion/styled";import{toRem as O}from"@s_mart/utils";var Be=be.div`
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`
184
184
  display: grid;
185
- gap: ${O(32)};
185
+ gap: ${Z(32)};
186
186
 
187
187
  > div {
188
188
  display: grid;
189
- gap: ${O(16)};
189
+ gap: ${Z(16)};
190
190
  }
191
- `,qe=be.header`
191
+ `,we=ke.header`
192
192
  display: grid;
193
193
  text-align: center;
194
- gap: ${O(16)};
195
- `;import{jsx as v,jsxs as Fe}from"react/jsx-runtime";function ua({logo:e,onVoltarParaLogin:t,...r}){let i=typeof e=="string"?v("img",{src:e,alt:"Logo do sistema"}):e,a=ca("(max-width: 500px)");return v(d,{...r,paperStyle:{maxWidth:a?void 0:456,width:a?"90%":void 0},children:Fe(Be,{children:[Fe("div",{style:{display:"flex",flexDirection:"column",gap:24},children:[v(qe,{children:e&&v("div",{children:i})}),v(Me,{variant:"titleMD",textAlign:"center",children:"Instru\xE7\xF5es enviadas"}),v(Me,{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(ma,{fullWidth:!0,onClick:t,children:"Voltar para login"})]})})}import{Button as fa,LIcon as J}from"@s_mart/core";import{Typography as E}from"@mui/material";import{Form as ha,TextField as De}from"@s_mart/form";import{required as ya}from"@s_mart/rules";import{lineCheck as G}from"@s_mart/regular-icons";import{colorPalette as W}from"@s_mart/tokens";import $ from"@emotion/styled";import{toRem as u}from"@s_mart/utils";var Pe=$.div`
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`
196
196
  display: grid;
197
197
  gap: ${u(32)};
198
- `,ke=$.header`
198
+ `,De=b.header`
199
199
  display: grid;
200
200
  text-align: center;
201
201
  gap: ${u(16)};
202
- `,Ee=$.div`
202
+ `,We=b.div`
203
203
  display: grid;
204
204
  gap: ${u(32)};
205
- `,we=$.div`
205
+ `,Ie=b.div`
206
206
  display: grid;
207
207
  gap: ${u(4)};
208
208
 
@@ -221,17 +221,17 @@ import{LIcon as Ve}from"@s_mart/core";import{Typography as Xe}from"@mui/material
221
221
  display: grid;
222
222
  gap: ${u(4)};
223
223
  }
224
- `,Le=$.div`
224
+ `,ze=b.div`
225
225
  display: flex;
226
226
  flex-wrap: wrap;
227
227
  gap: ${u(8)};
228
- `,_=$.div`
228
+ `,z=b.div`
229
229
  display: flex;
230
230
  align-items: center;
231
231
  gap: ${u(4)};
232
232
 
233
- color: ${W.neutral[600]};
234
- border: 1px solid ${W.neutral[600]};
233
+ color: ${I.neutral[600]};
234
+ border: 1px solid ${I.neutral[600]};
235
235
  border-radius: ${u(4)};
236
236
  padding: ${u(3)} ${u(4)};
237
237
 
@@ -239,27 +239,27 @@ import{LIcon as Ve}from"@s_mart/core";import{Typography as Xe}from"@mui/material
239
239
  vertical-align: middle;
240
240
 
241
241
  ${({checked:e})=>{if(e)return`
242
- color: ${W.green[300]};
243
- border-color: ${W.green[300]};
242
+ color: ${I.green[300]};
243
+ border-color: ${I.green[300]};
244
244
  `}}
245
- `;function Re(){let e=a=>a?a.match(/[a-z]/i):!1,t=a=>a?a.match(/[0-9]/i):!1,r=a=>a?a.length>=6:!1;return{senhaContemLetra:e,senhaContemNumero:t,senhaContemMinimoDe6Caracteres:r,desabilitarBotaoDeCadastro:a=>!a.senha||!a.confirmarSenha||!e(a.senha)||!t(a.senha)||!r(a.senha)}}import{jsx as s,jsxs as y}from"react/jsx-runtime";function ga({logo:e,onTrocarMinhaSenha:t,...r}){let{senhaContemLetra:i,senhaContemNumero:a,senhaContemMinimoDe6Caracteres:n,desabilitarBotaoDeCadastro:x}=Re();return s(d,{...r,children:y(Pe,{children:[y(ke,{children:[e&&s("div",{children:typeof e=="string"?s("img",{src:e,alt:"Logo do sistema"}):e}),s(E,{variant:"titleSM",children:"Vamos cadastrar uma nova senha de acesso."})]}),s(ha,{onSubmit:t,children:({watch:h})=>{let T=i(h("senha")),L=a(h("senha")),z=n(h("senha"));return y(Ee,{children:[y(we,{children:[y("div",{children:[s(De,{type:"password",name:"senha",label:"Senha de acesso",required:!0,rules:ya}),s(De,{type:"password",name:"confirmarSenha",label:"Confirme sua senha",required:!0,rules:{validate:g=>{if(!g)return"Campo obrigat\xF3rio";if(g!==h("senha"))return"As senhas devem ser iguais"}}})]}),y("div",{children:[s(E,{variant:"bodyXS",children:"Sua senha precisa conter:"}),y(Le,{children:[y(_,{checked:!!T,children:[T&&s(J,{icon:G,size:"16px",removeMargin:!0}),s(E,{variant:"bodyXS",children:"Uma letra"})]}),y(_,{checked:!!L,children:[L&&s(J,{icon:G,size:"16px",removeMargin:!0}),s(E,{variant:"bodyXS",children:"Um n\xFAmero"})]}),y(_,{checked:!!z,children:[z&&s(J,{icon:G,size:"16px",removeMargin:!0}),s(E,{variant:"bodyXS",children:"M\xEDnimo de 6 caracteres"})]})]})]})]}),s("div",{children:s(fa,{type:"submit",fullWidth:!0,disabled:x(h()),children:"Trocar minha senha"})})]})}})]})})}import{Button as Ie}from"@s_mart/core";import{Typography as ze,useMediaQuery as Ca}from"@mui/material";import K from"@emotion/styled";import{toRem as w}from"@s_mart/utils";var Ne=K.div`
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`
246
246
  display: grid;
247
- gap: ${w(32)};
247
+ gap: ${M(32)};
248
248
 
249
249
  > div {
250
250
  display: grid;
251
- gap: ${w(16)};
251
+ gap: ${M(16)};
252
252
  }
253
- `,We=K.header`
253
+ `,Xe=te.header`
254
254
  display: grid;
255
255
  text-align: center;
256
- gap: ${w(16)};
257
- `,_e=K.div`
256
+ gap: ${M(16)};
257
+ `,Ae=te.div`
258
258
  display: grid;
259
- gap: ${w(32)};
259
+ gap: ${M(32)};
260
260
 
261
261
  > div:last-of-type {
262
262
  display: grid;
263
- gap: ${w(16)};
263
+ gap: ${M(16)};
264
264
  }
265
- `;import{Form as va,TextField as xa}from"@s_mart/form";import{composeValidators as Ta,email as Sa,required as $a}from"@s_mart/rules";import{jsx as f,jsxs as I}from"react/jsx-runtime";function ba({logo:e,onVoltarParaLogin:t,onConfirmar:r,...i}){let a=typeof e=="string"?f("img",{src:e,alt:"Logo do sistema"}):e,n=Ca("(max-width: 500px)");return f(d,{...i,paperStyle:{minWidth:n?void 0:456,width:n?"90%":void 0},children:I(Ne,{children:[I("div",{style:{display:"flex",flexDirection:"column",gap:24},children:[f(We,{children:e&&f("div",{children:a})}),f(ze,{variant:"titleMD",textAlign:"center",children:"Esqueceu a senha?"}),f(ze,{variant:"bodySM",textAlign:"center",children:"Informe seu e-mail de acesso para receber instru\xE7\xF5es e criar uma nova senha."})]}),f(va,{onSubmit:r,children:I(_e,{children:[f("div",{children:f(xa,{name:"email",label:"E-mail de acesso",required:!0,rules:Ta([$a,Sa]),type:"email"})}),I("div",{children:[f(Ie,{fullWidth:!0,type:"submit",children:"Confirmar"}),f(Ie,{fullWidth:!0,onClick:t,variant:"neutral",children:"Voltar para login"})]})]})})]})})}export{Ge as TelaCadastro,la as TelaConviteExpirado,ba as TelaEsqueceuSenha,ua as TelaInstrucoesEnviadas,na as TelaLogin,ga as TelaNovaSenha,d 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 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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s_mart/telas-de-acesso",
3
- "version": "8.0.6",
3
+ "version": "8.1.0",
4
4
  "main": "./dist/index.mjs",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.mts",
@@ -17,6 +17,7 @@
17
17
  "@emotion/react": "^11.11.4",
18
18
  "@emotion/styled": "^11.13.0",
19
19
  "@mui/material": "^6.1.3",
20
+ "@mui/system": "^6.4.0",
20
21
  "@types/node": ">=20.0.0",
21
22
  "@types/react": ">=18.3.12",
22
23
  "@types/react-dom": ">=18.3.1",
@@ -26,10 +27,10 @@
26
27
  "typescript": ">=5.4.2",
27
28
  "@s_mart/core": "8.0.4",
28
29
  "@s_mart/form": "8.1.1",
29
- "@s_mart/hooks": "8.0.8",
30
+ "@s_mart/hooks": "8.0.9",
30
31
  "@s_mart/masks": "5.2.0",
31
32
  "@s_mart/regular-icons": "6.0.6",
32
- "@s_mart/utils": "5.3.3",
33
+ "@s_mart/utils": "5.3.4",
33
34
  "@s_mart/tokens": "5.1.1"
34
35
  },
35
36
  "publishConfig": {
@@ -38,17 +39,18 @@
38
39
  "devDependencies": {
39
40
  "@emotion/styled": "^11.13.0",
40
41
  "@mui/material": "^6.1.3",
42
+ "@mui/system": "^6.4.0",
41
43
  "@types/node": ">=20.0.0",
42
44
  "@types/react": ">=18.3.12",
43
45
  "@types/react-dom": ">=18.3.1",
44
46
  "typescript": ">=5.4.2",
45
47
  "@s_mart/core": "8.0.4",
46
48
  "@s_mart/form": "8.1.1",
47
- "@s_mart/hooks": "8.0.8",
48
- "@s_mart/masks": "5.2.0",
49
+ "@s_mart/hooks": "8.0.9",
49
50
  "@s_mart/regular-icons": "6.0.6",
50
51
  "@s_mart/tokens": "5.1.1",
51
- "@s_mart/utils": "5.3.3"
52
+ "@s_mart/utils": "5.3.4",
53
+ "@s_mart/masks": "5.2.0"
52
54
  },
53
55
  "scripts": {
54
56
  "build": "tsup src/index.tsx --minify --format esm --dts --external react",