@s_mart/telas-de-acesso 10.0.6 → 10.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,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
+ import { ImgHTMLAttributes, ReactNode } from 'react';
3
4
  import { TextFieldProps } from '@s_mart/form';
4
5
  import { UseFormReturn, FieldValues } from 'react-hook-form';
5
6
 
@@ -157,16 +158,23 @@ interface TelaInstrucoesEnviadasProps extends Omit<TemplateTelaBaseProps, 'child
157
158
 
158
159
  declare function TelaInstrucoesEnviadas({ logo, onVoltarParaLogin, ...rest }: TelaInstrucoesEnviadasProps): react_jsx_runtime.JSX.Element;
159
160
 
161
+ interface TelaNovaSenhaFormValues {
162
+ senha: string;
163
+ confirmarSenha: string;
164
+ termosDeUso: boolean;
165
+ }
166
+ interface TelaNovaSenhaFormValuesSubmit extends TelaNovaSenhaFormValues {
167
+ }
160
168
  interface TelaNovaSenhaProps extends Omit<TemplateTelaBaseProps, 'children'> {
161
169
  /**
162
170
  * Logo do sistema que será exibido do topo do paper de cadastro
163
171
  * @default undefined
164
172
  */
165
- logo?: React.ImgHTMLAttributes<HTMLImageElement>['src'] | React.ReactNode;
173
+ logo?: ImgHTMLAttributes<HTMLImageElement>['src'] | ReactNode;
166
174
  /**
167
175
  * Função que será executado ao clicar no botão trocar minha senha
168
176
  */
169
- onTrocarMinhaSenha: (data: any, methods: UseFormReturn<FieldValues, any>) => void;
177
+ onTrocarMinhaSenha: (data: TelaNovaSenhaFormValuesSubmit) => void;
170
178
  }
171
179
 
172
180
  declare function TelaNovaSenha({ logo, onTrocarMinhaSenha, ...rest }: TelaNovaSenhaProps): react_jsx_runtime.JSX.Element;
@@ -192,4 +200,4 @@ interface TelaEsqueceuSenhaProps extends Omit<TemplateTelaBaseProps, 'children'>
192
200
 
193
201
  declare function TelaEsqueceuSenha({ logo, onVoltarParaLogin, onConfirmar, ...rest }: TelaEsqueceuSenhaProps): react_jsx_runtime.JSX.Element;
194
202
 
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 };
203
+ export { type FormTelaCadastroSubmitValues, type FormTelaCadastroValues, TelaCadastro, type TelaCadastroProps, type TelaCadastroSlots, TelaConviteExpirado, type TelaConviteExpiradoProps, TelaEsqueceuSenha, type TelaEsqueceuSenhaProps, TelaInstrucoesEnviadas, type TelaInstrucoesEnviadasProps, TelaLogin, type TelaLoginProps, TelaNovaSenha, type TelaNovaSenhaFormValuesSubmit, type TelaNovaSenhaProps, TemplateTelaBase, type TemplateTelaBaseProps };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
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{styled as $}from"@mui/material";import{colorPalette as Oe}from"@s_mart/tokens";import{toRem as p}from"@s_mart/utils";var oe=$("div")`
1
+ import{LIcon as Ke}from"@s_mart/core";import{Typography as Ye}from"@mui/material";import{telefone as Ze}from"@s_mart/masks";import{lineWhatsApp as je}from"@s_mart/regular-icons";import{styled as $}from"@mui/material";import{colorPalette as Ge}from"@s_mart/tokens";import{toRem as p}from"@s_mart/utils";var j=$("div")`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: center;
@@ -18,7 +18,7 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
18
18
  @media (max-height: 600px) {
19
19
  justify-content: flex-start;
20
20
  }
21
- `,ae=$("div")`
21
+ `,ee=$("div")`
22
22
  position: absolute;
23
23
  left: 0;
24
24
  bottom: 32px;
@@ -27,7 +27,7 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
27
27
  @media (max-width: 768px) {
28
28
  display: none;
29
29
  }
30
- `,re=$("h1")`
30
+ `,te=$("h1")`
31
31
  position: absolute;
32
32
  left: 32px;
33
33
  top: 32px;
@@ -66,7 +66,7 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
66
66
  @media (max-width: 500px) {
67
67
  display: none;
68
68
  }
69
- `,ie=$("div")`
69
+ `,oe=$("div")`
70
70
  position: relative;
71
71
  z-index: 2;
72
72
 
@@ -75,7 +75,7 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
75
75
  margin: ${p(16)};
76
76
 
77
77
  background-color: ${({theme:e})=>e.palette.common.white};
78
- `,ne=$("button")`
78
+ `,ae=$("button")`
79
79
  position: relative;
80
80
  z-index: 2;
81
81
 
@@ -96,20 +96,20 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
96
96
  background-color: transparent;
97
97
 
98
98
  svg {
99
- color: ${Oe.green[300]};
99
+ color: ${Ge.green[300]};
100
100
  }
101
101
  }
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")`
102
+ `;import{jsx as F,jsxs as I}from"react/jsx-runtime";function l({children:e,whatsapp:t,textoChamativo:r,style:i,paperStyle:a,ilustracao:n}){return I(j,{style:i,children:[r&&F(te,{children:r}),n&&F(ee,{children:typeof n=="string"?F("img",{src:n,alt:"Logo do sistema"}):n}),F(oe,{style:a,children:e}),t&&I(ae,{onClick:()=>{window.open(`https://api.whatsapp.com/send?phone=${t}`)},style:{marginBottom:16},children:[I(Ye,{variant:"bodyXS",children:["Com d\xFAvidas? ",Ze.format(t.slice(2))]}),F(Ke,{icon:je,size:"20px",removeMargin:!0})]})]})}import{Button as at,LIcon as A}from"@s_mart/core";import{Checkbox as rt,TextField as it}from"@s_mart/form";import{Link as nt,Typography as P}from"@mui/material";import{lineCheck as Q}from"@s_mart/regular-icons";import{colorPalette as w}from"@s_mart/tokens";import{styled as S}from"@mui/material";import{toRem as m}from"@s_mart/utils";var re=S("div")`
103
103
  display: grid;
104
104
  gap: ${m(32)};
105
- `,pe=S("header")`
105
+ `,ie=S("header")`
106
106
  display: grid;
107
107
  text-align: center;
108
108
  gap: ${m(16)};
109
- `,le=S("div")`
109
+ `,ne=S("div")`
110
110
  display: grid;
111
111
  gap: ${m(32)};
112
- `,me=S("div")`
112
+ `,se=S("div")`
113
113
  display: grid;
114
114
  gap: ${m(4)};
115
115
 
@@ -128,17 +128,17 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
128
128
  display: grid;
129
129
  gap: ${m(4)};
130
130
  }
131
- `,de=S("div")`
131
+ `,pe=S("div")`
132
132
  display: flex;
133
133
  flex-wrap: wrap;
134
134
  gap: ${m(8)};
135
- `,D=S("div")`
135
+ `,L=S("div")`
136
136
  display: flex;
137
137
  align-items: center;
138
138
  gap: ${m(4)};
139
139
 
140
- color: ${R.neutral[600]};
141
- border: 1px solid ${R.neutral[600]};
140
+ color: ${w.neutral[600]};
141
+ border: 1px solid ${w.neutral[600]};
142
142
  border-radius: ${m(4)};
143
143
  padding: ${m(3)} ${m(4)};
144
144
 
@@ -146,63 +146,63 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
146
146
  vertical-align: middle;
147
147
 
148
148
  &[data-checked='true'] {
149
- color: ${R.green[300]};
150
- border-color: ${R.green[300]};
149
+ color: ${w.green[300]};
150
+ border-color: ${w.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({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,useMemo as st}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),h=e.logo,x=e.slots,y=st(()=>typeof h=="string"?r("img",{src:h,alt:"Logo do sistema"}):h,[h]),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:[h&&r("div",{children:y}),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 pt}from"react";import{Button as Se,Indicator as lt}from"@s_mart/core";import{Checkbox as mt,Form as dt,TextField as be}from"@s_mart/form";import{composeValidators as ct,required as $e,email as ut}from"@s_mart/rules";import{useCapsLock as ft}from"@s_mart/hooks";import{colorPalette as ht}from"@s_mart/tokens";import{Typography as yt,useMediaQuery as gt}from"@mui/material";import{styled as G}from"@mui/material";import{toRem as P}from"@s_mart/utils";var xe=G("div")`
152
+ `;import{useForm as et,useWatch as tt}from"react-hook-form";var V=e=>e?e.match(/[a-z]/i):!1,z=e=>e?e.match(/[0-9]/i):!1,H=e=>e?e.length>=6:!1,le={validate:e=>{if(!e)return"Obrigat\xF3rio";if(!V(e))return"Deve ter pelo menos uma letra";if(!z(e))return"Deve ter pelo menos um n\xFAmero";if(!H(e))return"Deve ter pelo menos 6 caracteres"}},me=e=>({validate:t=>{if(!t)return"Obrigat\xF3rio";if(t!==e)return"As senhas devem ser iguais"}});function de({defaultValues:e}){let t=et({defaultValues:e,mode:"all"}),r=tt({control:t.control,name:"senha"}),i=V(r),a=z(r),n=H(r);return{form:t,senha:r,senhaContemLetra:i,senhaContemNumero:a,senhaContemMinimoDe6Caracteres:n}}import{TextField as _}from"@s_mart/form";import{required as ot}from"@s_mart/rules";import{jsx as X}from"react/jsx-runtime";var N={textFieldNome:e=>X(_,{...e}),textFieldEmail:e=>X(_,{...e}),textFieldSenha:e=>X(_,{...e})},ce={type:"text",name:"nome",label:"Nome completo",required:!0,rules:ot},ue={type:"email",name:"email",label:"E-mail de acesso",required:!0,disabled:!0},fe={type:"password",name:"senha",label:"Senha de acesso",required:!0,rules:le};import{FormProvider as st}from"react-hook-form";import{memo as pt,useMemo as lt}from"react";import{required as mt}from"@s_mart/rules";import{jsx as o,jsxs as d}from"react/jsx-runtime";var he=pt(e=>{let{form:t,senha:r,senhaContemLetra:i,senhaContemMinimoDe6Caracteres:a,senhaContemNumero:n}=de(e),f=e.logo,C=e.slots,v=lt(()=>typeof f=="string"?o("img",{src:f,alt:"Logo do sistema"}):f,[f]),y=C?.textFieldNome??N.textFieldNome,Ue=C?.textFieldEmail??N.textFieldEmail,Oe=C?.textFieldSenha??N.textFieldSenha;return o(l,{...e,children:d(re,{children:[d(ie,{children:[f&&o("div",{children:v}),d(P,{variant:"titleSM",children:["Vamos cadastrar uma senha de acesso ao ",e.nomeSistema,"."]})]}),o(st,{...t,children:o("form",{onSubmit:t.handleSubmit(e.onSubmit),children:d(ne,{children:[o(Ue,{...ue}),o(y,{...ce}),d(se,{children:[d("div",{children:[o(Oe,{...fe}),o(it,{type:"password",name:"confirmarSenha",label:"Confirme sua senha",required:!0,rules:me(r)})]}),d("div",{children:[o(P,{variant:"bodyXS",children:"Sua senha precisa conter:"}),d(pe,{children:[d(L,{"data-checked":!!i,children:[i&&o(A,{icon:Q,size:"16px",removeMargin:!0}),o(P,{variant:"bodyXS",children:"Uma letra"})]}),d(L,{"data-checked":!!n,children:[n&&o(A,{icon:Q,size:"16px",removeMargin:!0}),o(P,{variant:"bodyXS",children:"Um n\xFAmero"})]}),d(L,{"data-checked":!!a,children:[a&&o(A,{icon:Q,size:"16px",removeMargin:!0}),o(P,{variant:"bodyXS",children:"M\xEDnimo de 6 caracteres"})]})]})]})]}),o("div",{children:o(rt,{rules:mt,name:"termosDeUso",label:d("div",{style:{display:"flex",gap:4},children:[o("span",{children:"Li e aceito os"}),o(nt,{href:e.linkTermosDeUso,target:"_blank",sx:Je=>({color:Je.palette.primary.main}),rel:"noreferrer",children:"termos de uso"})]})})}),o("div",{children:o(at,{type:"submit",fullWidth:!0,children:"Concluir meu cadastro"})})]})})})]})})});he.displayName="TelaCadastro";import{useMemo as dt}from"react";import{Button as xe,Indicator as ct}from"@s_mart/core";import{Checkbox as ut,Form as ft,TextField as ve}from"@s_mart/form";import{composeValidators as ht,required as Te,email as yt}from"@s_mart/rules";import{useCapsLock as gt}from"@s_mart/hooks";import{colorPalette as Ct}from"@s_mart/tokens";import{Typography as xt,useMediaQuery as vt}from"@mui/material";import{styled as U}from"@mui/material";import{toRem as B}from"@s_mart/utils";var ye=U("div")`
153
153
  display: grid;
154
- gap: ${P(32)};
155
- `,ve=G("header")`
154
+ gap: ${B(32)};
155
+ `,ge=U("header")`
156
156
  display: grid;
157
157
  text-align: center;
158
- gap: ${P(16)};
159
- `,Te=G("div")`
158
+ gap: ${B(16)};
159
+ `,Ce=U("div")`
160
160
  display: grid;
161
- gap: ${P(16)};
161
+ gap: ${B(16)};
162
162
 
163
163
  > div {
164
164
  display: grid;
165
- gap: ${P(16)};
165
+ gap: ${B(16)};
166
166
  }
167
167
 
168
168
  > div:last-of-type {
169
- gap: ${P(8)};
169
+ gap: ${B(8)};
170
170
  }
171
- `;import{jsx as c,jsxs as q}from"react/jsx-runtime";function Ct({logo:e,initialValues:o,onSubmit:a,onEsqueciMinhaSenha:n,errorLabel:t,...i}){let h=typeof e=="string"?c("img",{src:e,alt:"Logo do sistema"}):e,x=ft(),y=gt("(max-width: 500px)"),T=pt(()=>({manterConectado:!1,...o}),[o]);return c(l,{...i,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:a,defaultValues:T,children:q(Te,{children:[q("div",{children:[c(be,{name:"email",label:"E-mail de acesso",required:!0,rules:ct([$e,ut]),autoComplete:"email",type:"email"}),q("div",{children:[c(be,{name:"senha",label:"Senha de acesso",type:"password",required:!0,rules:$e}),x&&c(lt,{severity:"warning",children:"Capslock ativado"}),!!t&&c(yt,{variant:"titleXXS",color:ht.red[300],children:t})]})]}),c(mt,{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 xt}from"@s_mart/core";import{Typography as Ee,useMediaQuery as vt}from"@mui/material";import{colorPalette as Y}from"@s_mart/tokens";import{lineWhatsApp as Tt}from"@s_mart/regular-icons";import{styled as Fe}from"@mui/material";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 Tt({logo:e,initialValues:t,onSubmit:r,onEsqueciMinhaSenha:i,errorLabel:a,...n}){let f=typeof e=="string"?c("img",{src:e,alt:"Logo do sistema"}):e,C=gt(),v=vt("(max-width: 500px)"),y=dt(()=>({manterConectado:!1,...t}),[t]);return c(l,{...n,paperStyle:{minWidth:v?void 0:456,width:v?"90%":void 0},children:q(ye,{children:[c(ge,{children:e&&c("div",{children:f})}),c(ft,{onSubmit:r,defaultValues:y,children:q(Ce,{children:[q("div",{children:[c(ve,{name:"email",label:"E-mail de acesso",required:!0,rules:ht([Te,yt]),autoComplete:"email",type:"email"}),q("div",{children:[c(ve,{name:"senha",label:"Senha de acesso",type:"password",required:!0,rules:Te}),C&&c(ct,{severity:"warning",children:"Capslock ativado"}),!!a&&c(xt,{variant:"titleXXS",color:Ct.red[300],children:a})]})]}),c(ut,{name:"manterConectado",label:"Manter conectado"}),q("div",{children:[c(xe,{type:"submit",fullWidth:!0,children:"Entrar"}),i&&c(xe,{type:"button",fullWidth:!0,variant:"text",onClick:i,children:"Esqueci minha senha"})]})]})})]})})}import{Button as Fe,LIcon as St}from"@s_mart/core";import{Typography as Pe,useMediaQuery as bt}from"@mui/material";import{colorPalette as J}from"@s_mart/tokens";import{lineWhatsApp as $t}from"@s_mart/regular-icons";import{styled as Se}from"@mui/material";import{toRem as O}from"@s_mart/utils";var be=Se("div")`
172
172
  display: grid;
173
- gap: ${K(32)};
173
+ gap: ${O(32)};
174
174
 
175
175
  > div {
176
176
  display: grid;
177
- gap: ${K(8)};
177
+ gap: ${O(8)};
178
178
  }
179
- `,Pe=Fe("header")`
179
+ `,$e=Se("header")`
180
180
  display: grid;
181
181
  text-align: center;
182
- gap: ${K(16)};
183
- `;import{jsx as C,jsxs as E}from"react/jsx-runtime";function St({logo:e,onPrecisoDeAjuda:o,onRealizarAcesso:a,...n}){let t=typeof e=="string"?C("img",{src:e,alt:"Logo do sistema"}):e,i=vt("(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(xt,{icon:Tt,size:"20px",removeMargin:!0,color:Y.neutral[900]}),"Preciso de outro convite"]})]})]})})}import{Button as bt}from"@s_mart/core";import{useMediaQuery as $t,Typography as Ne}from"@mui/material";import{styled as Me}from"@mui/material";import{toRem as Z}from"@s_mart/utils";var ke=Me("div")`
182
+ gap: ${O(16)};
183
+ `;import{jsx as x,jsxs as E}from"react/jsx-runtime";function Ft({logo:e,onPrecisoDeAjuda:t,onRealizarAcesso:r,...i}){let a=typeof e=="string"?x("img",{src:e,alt:"Logo do sistema"}):e,n=bt("(max-width: 500px)");return x(l,{...i,paperStyle:{minWidth:n?void 0:456,width:n?"90%":void 0},children:E(be,{children:[E("div",{children:[x($e,{children:e&&x("div",{children:a})}),E("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",gap:8,color:J.neutral[800]},children:[x(Pe,{variant:"bodyMD",children:"Parece que este convite j\xE1 foi usado ou expirou."}),x(Pe,{variant:"bodyMD",children:"J\xE1 se cadastrou? Realize o login."})]})]}),E("div",{children:[x(Fe,{fullWidth:!0,onClick:r,children:"Realizar login"}),E(Fe,{fullWidth:!0,variant:"text",onClick:t,style:{display:"flex",gap:4,color:J.neutral[900]},children:[x(St,{icon:$t,size:"20px",removeMargin:!0,color:J.neutral[900]}),"Preciso de outro convite"]})]})]})})}import{Button as Pt}from"@s_mart/core";import{useMediaQuery as Bt,Typography as Me}from"@mui/material";import{styled as Be}from"@mui/material";import{toRem as G}from"@s_mart/utils";var qe=Be("div")`
184
184
  display: grid;
185
- gap: ${Z(32)};
185
+ gap: ${G(32)};
186
186
 
187
187
  > div {
188
188
  display: grid;
189
- gap: ${Z(16)};
189
+ gap: ${G(16)};
190
190
  }
191
- `,we=Me("header")`
191
+ `,Ee=Be("header")`
192
192
  display: grid;
193
193
  text-align: center;
194
- gap: ${Z(16)};
195
- `;import{jsx as v,jsxs as Le}from"react/jsx-runtime";function Ft({logo:e,onVoltarParaLogin:o,...a}){let n=typeof e=="string"?v("img",{src:e,alt:"Logo do sistema"}):e,t=$t("(max-width: 500px)");return v(l,{...a,paperStyle:{maxWidth:t?void 0:456,width:t?"90%":void 0},children:Le(ke,{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(bt,{fullWidth:!0,onClick:o,children:"Voltar para login"})]})})}import{Button as Bt,LIcon as j}from"@s_mart/core";import{Typography as M}from"@mui/material";import{Form as Pt,TextField as He}from"@s_mart/form";import{required as qt}from"@s_mart/rules";import{lineCheck as ee}from"@s_mart/regular-icons";import{styled as b}from"@mui/material";import{colorPalette as I}from"@s_mart/tokens";import{toRem as u}from"@s_mart/utils";var Re=b("div")`
194
+ gap: ${G(16)};
195
+ `;import{jsx as T,jsxs as ke}from"react/jsx-runtime";function qt({logo:e,onVoltarParaLogin:t,...r}){let i=typeof e=="string"?T("img",{src:e,alt:"Logo do sistema"}):e,a=Bt("(max-width: 500px)");return T(l,{...r,paperStyle:{maxWidth:a?void 0:456,width:a?"90%":void 0},children:ke(qe,{children:[ke("div",{style:{display:"flex",flexDirection:"column",gap:24},children:[T(Ee,{children:e&&T("div",{children:i})}),T(Me,{variant:"titleMD",textAlign:"center",children:"Instru\xE7\xF5es enviadas"}),T(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."})]}),T(Pt,{fullWidth:!0,onClick:t,children:"Voltar para login"})]})})}import{Button as Et,LIcon as K}from"@s_mart/core";import{Typography as M}from"@mui/material";import{TextField as ze}from"@s_mart/form";import{required as Mt}from"@s_mart/rules";import{lineCheck as Y}from"@s_mart/regular-icons";import{styled as b}from"@mui/material";import{colorPalette as R}from"@s_mart/tokens";import{toRem as u}from"@s_mart/utils";var we=b("div")`
196
196
  display: grid;
197
197
  gap: ${u(32)};
198
- `,De=b("header")`
198
+ `,Le=b("header")`
199
199
  display: grid;
200
200
  text-align: center;
201
201
  gap: ${u(16)};
202
- `,We=b("div")`
202
+ `,Ne=b("div")`
203
203
  display: grid;
204
204
  gap: ${u(32)};
205
- `,Ie=b("div")`
205
+ `,Re=b("div")`
206
206
  display: grid;
207
207
  gap: ${u(4)};
208
208
 
@@ -221,17 +221,17 @@ 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
- `,Ve=b("div")`
224
+ `,We=b("div")`
225
225
  display: flex;
226
226
  flex-wrap: wrap;
227
227
  gap: ${u(8)};
228
- `,V=b("div")`
228
+ `,W=b("div")`
229
229
  display: flex;
230
230
  align-items: center;
231
231
  gap: ${u(4)};
232
232
 
233
- color: ${I.neutral[600]};
234
- border: 1px solid ${I.neutral[600]};
233
+ color: ${R.neutral[600]};
234
+ border: 1px solid ${R.neutral[600]};
235
235
  border-radius: ${u(4)};
236
236
  padding: ${u(3)} ${u(4)};
237
237
 
@@ -239,10 +239,10 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
239
239
  vertical-align: middle;
240
240
 
241
241
  ${({checked:e})=>{if(e)return`
242
- color: ${I.green[300]};
243
- border-color: ${I.green[300]};
242
+ color: ${R.green[300]};
243
+ border-color: ${R.green[300]};
244
244
  `}}
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 g}from"react/jsx-runtime";function Et({logo:e,onTrocarMinhaSenha:o,...a}){let{senhaContemLetra:n,senhaContemNumero:t,senhaContemMinimoDe6Caracteres:i,desabilitarBotaoDeCadastro:h}=ze();return s(l,{...a,children:g(Re,{children:[g(De,{children:[e&&s("div",{children:typeof e=="string"?s("img",{src:e,alt:"Logo do sistema"}):e}),s(M,{variant:"titleSM",children:"Vamos cadastrar uma nova senha de acesso."})]}),s(Pt,{onSubmit:o,children:({watch:y})=>{let T=n(y("senha")),w=t(y("senha")),N=i(y("senha"));return g(We,{children:[g(Ie,{children:[g("div",{children:[s(He,{type:"password",name:"senha",label:"Senha de acesso",required:!0,rules:qt}),s(He,{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(M,{variant:"bodyXS",children:"Sua senha precisa conter:"}),g(Ve,{children:[g(V,{checked:!!T,children:[T&&s(j,{icon:ee,size:"16px",removeMargin:!0}),s(M,{variant:"bodyXS",children:"Uma letra"})]}),g(V,{checked:!!w,children:[w&&s(j,{icon:ee,size:"16px",removeMargin:!0}),s(M,{variant:"bodyXS",children:"Um n\xFAmero"})]}),g(V,{checked:!!N,children:[N&&s(j,{icon:ee,size:"16px",removeMargin:!0}),s(M,{variant:"bodyXS",children:"M\xEDnimo de 6 caracteres"})]})]})]})]}),s("div",{children:s(Bt,{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 Mt}from"@mui/material";import{styled as te}from"@mui/material";import{toRem as k}from"@s_mart/utils";var _e=te("div")`
245
+ `;import{FormProvider as kt,useForm as wt,useWatch as Lt}from"react-hook-form";var De=e=>e?e.match(/[a-z]/i):!1,Ie=e=>e?e.match(/[0-9]/i):!1,Ve=e=>e?e.length>=6:!1;import{jsx as s,jsxs as g}from"react/jsx-runtime";function Nt({logo:e,onTrocarMinhaSenha:t,...r}){let i=wt(),a=Lt({control:i.control,name:"senha"}),n=typeof e=="string"?s("img",{src:e,alt:"Logo do sistema"}):e,f=De(a),C=Ie(a),v=Ve(a);return s(l,{...r,children:g(we,{children:[g(Le,{children:[e&&s("div",{children:n}),s(M,{variant:"titleSM",children:"Vamos cadastrar uma nova senha de acesso."})]}),s(kt,{...i,children:s("form",{onSubmit:y=>{y.preventDefault(),y.stopPropagation(),i.handleSubmit(t)(y)},children:g(Ne,{children:[g(Re,{children:[g("div",{children:[s(ze,{type:"password",name:"senha",label:"Senha de acesso",required:!0,rules:Mt}),s(ze,{type:"password",name:"confirmarSenha",label:"Confirme sua senha",required:!0,rules:{validate:y=>{if(!y)return"Campo obrigat\xF3rio";if(y!==a)return"As senhas devem ser iguais"}}})]}),g("div",{children:[s(M,{variant:"bodyXS",children:"Sua senha precisa conter:"}),g(We,{children:[g(W,{checked:!!f,children:[f&&s(K,{icon:Y,size:"16px",removeMargin:!0}),s(M,{variant:"bodyXS",children:"Uma letra"})]}),g(W,{checked:!!C,children:[C&&s(K,{icon:Y,size:"16px",removeMargin:!0}),s(M,{variant:"bodyXS",children:"Um n\xFAmero"})]}),g(W,{checked:!!v,children:[v&&s(K,{icon:Y,size:"16px",removeMargin:!0}),s(M,{variant:"bodyXS",children:"M\xEDnimo de 6 caracteres"})]})]})]})]}),s(Et,{type:"submit",fullWidth:!0,children:"Trocar minha senha"})]})})})]})})}import{Button as Ae}from"@s_mart/core";import{Typography as Qe,useMediaQuery as Rt}from"@mui/material";import{styled as Z}from"@mui/material";import{toRem as k}from"@s_mart/utils";var He=Z("div")`
246
246
  display: grid;
247
247
  gap: ${k(32)};
248
248
 
@@ -250,11 +250,11 @@ import{LIcon as Je}from"@s_mart/core";import{Typography as Ge}from"@mui/material
250
250
  display: grid;
251
251
  gap: ${k(16)};
252
252
  }
253
- `,Xe=te("header")`
253
+ `,_e=Z("header")`
254
254
  display: grid;
255
255
  text-align: center;
256
256
  gap: ${k(16)};
257
- `,Ae=te("div")`
257
+ `,Xe=Z("div")`
258
258
  display: grid;
259
259
  gap: ${k(32)};
260
260
 
@@ -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: ${k(16)};
264
264
  }
265
- `;import{Form as kt,TextField as wt}from"@s_mart/form";import{composeValidators as Nt,email as Lt,required as Rt}from"@s_mart/rules";import{jsx as f,jsxs as z}from"react/jsx-runtime";function Dt({logo:e,onVoltarParaLogin:o,onConfirmar:a,...n}){let t=typeof e=="string"?f("img",{src:e,alt:"Logo do sistema"}):e,i=Mt("(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(wt,{name:"email",label:"E-mail de acesso",required:!0,rules:Nt([Rt,Lt]),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,St as TelaConviteExpirado,Dt as TelaEsqueceuSenha,Ft as TelaInstrucoesEnviadas,Ct as TelaLogin,Et as TelaNovaSenha,l as TemplateTelaBase};
265
+ `;import{Form as Wt,TextField as Dt}from"@s_mart/form";import{composeValidators as It,email as Vt,required as zt}from"@s_mart/rules";import{jsx as h,jsxs as D}from"react/jsx-runtime";function Ht({logo:e,onVoltarParaLogin:t,onConfirmar:r,...i}){let a=typeof e=="string"?h("img",{src:e,alt:"Logo do sistema"}):e,n=Rt("(max-width: 500px)");return h(l,{...i,paperStyle:{minWidth:n?void 0:456,width:n?"90%":void 0},children:D(He,{children:[D("div",{style:{display:"flex",flexDirection:"column",gap:24},children:[h(_e,{children:e&&h("div",{children:a})}),h(Qe,{variant:"titleMD",textAlign:"center",children:"Esqueceu a senha?"}),h(Qe,{variant:"bodySM",textAlign:"center",children:"Informe seu e-mail de acesso para receber instru\xE7\xF5es e criar uma nova senha."})]}),h(Wt,{onSubmit:r,children:D(Xe,{children:[h("div",{children:h(Dt,{name:"email",label:"E-mail de acesso",required:!0,rules:It([zt,Vt]),type:"email"})}),D("div",{children:[h(Ae,{fullWidth:!0,type:"submit",children:"Confirmar"}),h(Ae,{fullWidth:!0,onClick:t,variant:"neutral",children:"Voltar para login"})]})]})})]})})}export{he as TelaCadastro,Ft as TelaConviteExpirado,Ht as TelaEsqueceuSenha,qt as TelaInstrucoesEnviadas,Tt as TelaLogin,Nt 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": "10.0.6",
3
+ "version": "10.1.0",
4
4
  "main": "./dist/index.mjs",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.mts",
@@ -10,47 +10,51 @@
10
10
  "dist/**"
11
11
  ],
12
12
  "dependencies": {
13
- "tsup": "8.0.2",
14
- "@s_mart/rules": "5.1.1"
13
+ "react-is": "^18.3.1",
14
+ "tsup": "8.5.0",
15
+ "@s_mart/rules": "5.2.0"
15
16
  },
16
17
  "peerDependencies": {
17
18
  "@emotion/react": "^11.11.4",
18
19
  "@emotion/styled": "^11.13.0",
19
- "@mui/material": "^6.1.3",
20
- "@mui/system": "^6.4.0",
21
- "@types/node": ">=20.0.0",
22
- "@types/react": ">=18.3.12",
23
- "@types/react-dom": ">=18.3.1",
24
- "react": ">=18.3.1",
25
- "react-dom": ">=18.3.1",
20
+ "@mui/material": "^7.2.0",
21
+ "@mui/system": "^7.2.0",
22
+ "@types/node": ">=22.15.17",
23
+ "@types/react": "^18.3.12",
24
+ "@types/react-dom": "^18.3.1",
25
+ "react": "^18.3.1",
26
+ "react-dom": "^18.3.1",
26
27
  "react-hook-form": "^7.51.0",
27
28
  "typescript": ">=5.4.2",
28
- "@s_mart/core": "9.0.6",
29
- "@s_mart/form": "9.0.6",
30
- "@s_mart/hooks": "8.0.9",
31
- "@s_mart/masks": "5.2.0",
32
- "@s_mart/regular-icons": "6.0.6",
33
- "@s_mart/tokens": "5.1.1",
34
- "@s_mart/utils": "5.3.4"
29
+ "@s_mart/core": "10.1.0",
30
+ "@s_mart/form": "10.2.0",
31
+ "@s_mart/regular-icons": "6.0.12",
32
+ "@s_mart/hooks": "8.1.2",
33
+ "@s_mart/masks": "5.3.0",
34
+ "@s_mart/tokens": "6.0.0",
35
+ "@s_mart/utils": "5.4.0"
35
36
  },
36
37
  "publishConfig": {
37
38
  "access": "public"
38
39
  },
39
40
  "devDependencies": {
40
41
  "@emotion/styled": "^11.13.0",
41
- "@mui/material": "^6.1.3",
42
- "@mui/system": "^6.4.0",
43
- "@types/node": ">=20.0.0",
44
- "@types/react": ">=18.3.12",
45
- "@types/react-dom": ">=18.3.1",
42
+ "@mui/material": "^7.2.0",
43
+ "@mui/system": "^7.2.0",
44
+ "@types/node": ">=22.15.17",
45
+ "@types/react": "^18.3.12",
46
+ "@types/react-dom": "^18.3.1",
46
47
  "typescript": ">=5.4.2",
47
- "@s_mart/core": "9.0.6",
48
- "@s_mart/form": "9.0.6",
49
- "@s_mart/hooks": "8.0.9",
50
- "@s_mart/masks": "5.2.0",
51
- "@s_mart/regular-icons": "6.0.6",
52
- "@s_mart/tokens": "5.1.1",
53
- "@s_mart/utils": "5.3.4"
48
+ "@s_mart/core": "10.1.0",
49
+ "@s_mart/form": "10.2.0",
50
+ "@s_mart/hooks": "8.1.2",
51
+ "@s_mart/masks": "5.3.0",
52
+ "@s_mart/regular-icons": "6.0.12",
53
+ "@s_mart/tokens": "6.0.0",
54
+ "@s_mart/utils": "5.4.0"
55
+ },
56
+ "overrides": {
57
+ "react-is": "^18.3.1"
54
58
  },
55
59
  "scripts": {
56
60
  "build": "tsup src/index.tsx --minify --format esm --dts --external react",