@s_mart/telas-de-acesso 10.1.1 → 10.1.3
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.mjs +1 -1
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -149,7 +149,7 @@ import{LIcon as Ke}from"@s_mart/core";import{Typography as Ye}from"@mui/material
|
|
|
149
149
|
color: ${w.green[300]};
|
|
150
150
|
border-color: ${w.green[300]};
|
|
151
151
|
}
|
|
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
|
|
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
154
|
gap: ${B(32)};
|
|
155
155
|
`,ge=U("header")`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s_mart/telas-de-acesso",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.3",
|
|
4
4
|
"main": "./dist/index.mjs",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.mts",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"react-dom": ">=18.3.1",
|
|
26
26
|
"react-hook-form": "^7.51.0",
|
|
27
27
|
"typescript": ">=5.4.2",
|
|
28
|
-
"@s_mart/core": "9.1.
|
|
29
|
-
"@s_mart/form": "9.1.
|
|
30
|
-
"@s_mart/hooks": "8.0.
|
|
28
|
+
"@s_mart/core": "9.1.1",
|
|
29
|
+
"@s_mart/form": "9.1.1",
|
|
30
|
+
"@s_mart/hooks": "8.0.10",
|
|
31
31
|
"@s_mart/masks": "5.2.0",
|
|
32
|
-
"@s_mart/regular-icons": "6.0.
|
|
32
|
+
"@s_mart/regular-icons": "6.0.7",
|
|
33
33
|
"@s_mart/tokens": "5.1.1",
|
|
34
34
|
"@s_mart/utils": "5.3.4"
|
|
35
35
|
},
|
|
@@ -44,11 +44,11 @@
|
|
|
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": "9.1.
|
|
48
|
-
"@s_mart/form": "9.1.
|
|
49
|
-
"@s_mart/hooks": "8.0.
|
|
47
|
+
"@s_mart/core": "9.1.1",
|
|
48
|
+
"@s_mart/form": "9.1.1",
|
|
49
|
+
"@s_mart/hooks": "8.0.10",
|
|
50
50
|
"@s_mart/masks": "5.2.0",
|
|
51
|
-
"@s_mart/regular-icons": "6.0.
|
|
51
|
+
"@s_mart/regular-icons": "6.0.7",
|
|
52
52
|
"@s_mart/tokens": "5.1.1",
|
|
53
53
|
"@s_mart/utils": "5.3.4"
|
|
54
54
|
},
|