@s_mart/minha-conta 5.0.8 → 6.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.ts → index.d.mts} +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +37 -37
|
@@ -343,4 +343,4 @@ declare function RecursosDialog({ onClose, axiosInstance, sistemaNome, telefoneS
|
|
|
343
343
|
|
|
344
344
|
declare function PlanosDialog({ onClose, axiosInstance, telefoneSuporte, endpointsV2, telefoneCS, ...planosDialog }: PlanosDialogProps): react_jsx_runtime.JSX.Element;
|
|
345
345
|
|
|
346
|
-
export { ConfirmarEmail, ConfirmarEmailProps, MinhaConta, MinhaContaProps, PlanosDialog, PlanosDialogProps, RecursosDialog, RecursosDialogProps };
|
|
346
|
+
export { ConfirmarEmail, type ConfirmarEmailProps, MinhaConta, type MinhaContaProps, PlanosDialog, type PlanosDialogProps, RecursosDialog, type RecursosDialogProps };
|
package/dist/index.mjs
CHANGED
|
@@ -142,7 +142,7 @@ import{cloneElement as Rs}from"react";import{Grid as ar,Tab as Ms}from"@s_mart/c
|
|
|
142
142
|
justify-content: space-between;
|
|
143
143
|
align-items: center;
|
|
144
144
|
min-height: 7rem;
|
|
145
|
-
`;import{Fragment as sa,jsx as T,jsxs as ho}from"react/jsx-runtime";function na({plano:o,id:e,reduceFont:r,onContratar:a,periodicidadePlanoAtual:i}){let n=u(g=>g.planosDialog.esconderValorPlanos),l=u(g=>g.planosDialog.habilitarPlanoAtual),m=u(g=>g.telefoneCS),p=u(g=>g.telefoneSuporte),c=o.planoAtual&&!l,C=()=>c?"Seu plano atual":n?"Quero saber mais":l&&o.planoAtual||o.periodicidade!==i?"Contratar plano":o.valorMensalMenorQueAtual?"Diminuir plano":"Aumentar plano";return T(ra,{id:e,children:T(pn,{title:o.disabled30Dias?ho(so,{variant:"bodyXS",children:["A troca para um plano de valor ",T("br",{}),"menor, s\xF3 \xE9 poss\xEDvel ap\xF3s 30 dias ",T("br",{}),"de uso do seu plano atual."]}):"",placement:"right",children:ho(aa,{destaque:!!o.destaque,disabled:c||o.disabled||o.disabled30Dias,children:[!!o.destaque&&T(ia,{icon:sn,color:We.yellow[300],style:{position:"absolute",top:"5px",right:"5px"}}),ho(ta,{children:[T("div",{style:{textAlign:"center"},children:T(so,{variant:r?"titleMS":"titleMD",children:o.nome})}),!!o.fraseDeEfeito&&T("div",{children:T(so,{variant:"bodySM",color:We.neutral[100],children:o.fraseDeEfeito})}),!n&&ho(sa,{children:[!!o.valorPeriodicoPromocional&&T("div",{children:ho(so,{variant:"bodySM",color:We.red[300],style:{textDecorationLine:"line-through",marginRight:"2rem"},children:["R$ ",o.valorPeriodico]})}),ho("div",{style:{display:"flex",justifyContent:"center",alignItems:"end"},children:[T(so,{variant:"titleXXS",alignSelf:"center",children:"R$"}),T(so,{variant:r?"titleLG":"titleXL",style:{fontSize:"3rem"},children:o.valorPeriodicoPromocional||o.valorPeriodico}),ho(so,{variant:r?"titleMS":"titleMD",marginBottom:"0.3rem",children:["/",$(o.periodicidade)]})]})]})]}),T(tn,{fullWidth:!0,variant:c?"neutral":"contained",disabled:c||o.disabled||o.disabled30Dias,startIcon:(c||n)&&T(ia,{icon:c?ln:mn,size:"25px"}),onClick:()=>{n?no(m||p):a(o)},style:{margin:"1.5rem 0"},children:C()}),T("div",{style:{paddingLeft:"1rem"},children:T(so,{variant:"bodySM",children:T("div",{style:{display:"flex",flexDirection:"column"},dangerouslySetInnerHTML:{__html:o.descricao}})})})]})})})}function pn(o){return o.title?T(nn,{...o}):T(sa,{children:o.children})}import{useMemo as ze}from"react";import{useMediaQuery as Oe}from"@s_mart/hooks";import{useFormContext as cn}from"react-hook-form";import la from"dayjs";var dn=({planos:o})=>{let e=x(f=>f.codigoPlano),r=x(f=>f.periodicidade),a=x(f=>f.valor),i=x(f=>f.dataContratacao),n=x(f=>f.recursos),l=b(f=>f.handleErrors),m=b(f=>f.setLoading),p=u(f=>f.planosDialog.bloquearDowngrade),c=u(f=>f.planosDialog.bloquearDowngrade30Dias),C=u(f=>f.planosDialog.desabilitarPlanosMenores),g=u(f=>f.planosDialog.mostrarSomentePlanosDaPeriodicidade),y=u(f=>f.planosDialog.mostrarPlanosDeterminados?.codigoPlanoValor),{buscarPlano:t}=w(),{watch:h,setValue:d}=cn(),D=Oe("(max-width: 900px)"),R=Oe("(max-width: 700px)"),q=Oe("(max-width: 450px)"),ro=h("filtroPeriodicidade"),wo=!!c&&la().diff(la(i),"days")<30,ao=ze(()=>{let f={previous:0,next:4};return R?f.next=2:D&&(f.next=3),f},[R,D,ro]),K=ze(()=>{let f=[];if(!o)return f;if(y&&!g)f=[...o.mensais,...o.trimestrais,...o.semestrais,...o.anuais].filter(F=>y.includes(F.codigoPlanoValor));else if(ro){let F=g||["mensais","trimestrais","semestrais","anuais"][ro.value];f=o[F]}return f.sort((S,F)=>S.valorPeriodico-F.valorPeriodico),f.map(S=>{let F=S.valorPeriodicoPromocional||S.valorPeriodico,X=ko(F,S.periodicidade)<ko(a??0,r);return{...S,planoAtual:S.codigo===e&&S.periodicidade===r,valorMensalMenorQueAtual:X,disabled:(!!p||!!C)&&X,disabled30Dias:wo&&X}})},[o,ro,y]),Ho=ze(()=>R?K.length>1:D?K.length>2:K.length>3,[R,D,K]);function ko(f,P){switch(P){case 1:return f/3;case 2:return f/6;case 3:return f/12;default:return f}}return{planosFiltrados:K,scrollPlanos:f=>{let P=ao[f];if(P===0||P>K.length)return;let S=document.getElementById(`plano-${P}`);S&&(S.scrollIntoView({behavior:"smooth"}),f==="next"?(ao.next++,ao.previous++):(ao.next--,ao.previous--))},showScrollControllers:Ho,maxWidth700:R,maxWidth450:q,handleClickContratarPlano:async f=>{try{m(!0);let P=await t(f.codigo,f.periodicidade);if(P.data){let S={},F=P.data.recursos?.filter(W=>!W?.valorRecurso)?.map(W=>W?.slugRecurso);n?.filter(W=>W.recursoContratado)?.forEach(W=>{P.data.recursos.some(_o=>_o.slugRecurso===W.slugRecurso)&&!F?.includes(W.slugRecurso)&&(S[W.slugRecurso]=!0)}),d("recursosSelecionados",S),d("planoSelecionado",{...f,recursos:P.data.recursos})}m(!1)}catch(P){l(P)}},periodicidadePlanoAtual:r}},ma=dn;import{jsx as Ro,jsxs as gn}from"react/jsx-runtime";function ca(o){let{planosFiltrados:e,scrollPlanos:r,showScrollControllers:a,maxWidth700:i,maxWidth450:n,handleClickContratarPlano:l,periodicidadePlanoAtual:m}=ma(o);return gn("div",{style:{display:"flex",position:"relative"},children:[a&&Ro($e,{side:"left",onClick:()=>r("previous"),children:Ro(pa,{icon:un,size:i?"2rem":"3rem"})}),Ro("div",{style:{display:"flex",justifyContent:a?void 0:"center",overflow:"hidden",flex:1},children:e.map((p,c)=>Ro(na,{id:`plano-${c+1}`,plano:p,reduceFont:n,periodicidadePlanoAtual:m??0,onContratar:l},p.codigoPlanoValor))}),a&&Ro($e,{side:"right",onClick:()=>r("next"),children:Ro(pa,{icon:fn,size:i?"2rem":"3rem"})})]})}import{Grid as Ke}from"@s_mart/core";import{Grid as yn,Typography as Xe}from"@s_mart/core";import{valor as hn}from"@s_mart/masks";import{Switch as Cn}from"@s_mart/form";import{useFormContext as xn}from"react-hook-form";import{Grid as je}from"@
|
|
145
|
+
`;import{Fragment as sa,jsx as T,jsxs as ho}from"react/jsx-runtime";function na({plano:o,id:e,reduceFont:r,onContratar:a,periodicidadePlanoAtual:i}){let n=u(g=>g.planosDialog.esconderValorPlanos),l=u(g=>g.planosDialog.habilitarPlanoAtual),m=u(g=>g.telefoneCS),p=u(g=>g.telefoneSuporte),c=o.planoAtual&&!l,C=()=>c?"Seu plano atual":n?"Quero saber mais":l&&o.planoAtual||o.periodicidade!==i?"Contratar plano":o.valorMensalMenorQueAtual?"Diminuir plano":"Aumentar plano";return T(ra,{id:e,children:T(pn,{title:o.disabled30Dias?ho(so,{variant:"bodyXS",children:["A troca para um plano de valor ",T("br",{}),"menor, s\xF3 \xE9 poss\xEDvel ap\xF3s 30 dias ",T("br",{}),"de uso do seu plano atual."]}):"",placement:"right",children:ho(aa,{destaque:!!o.destaque,disabled:c||o.disabled||o.disabled30Dias,children:[!!o.destaque&&T(ia,{icon:sn,color:We.yellow[300],style:{position:"absolute",top:"5px",right:"5px"}}),ho(ta,{children:[T("div",{style:{textAlign:"center"},children:T(so,{variant:r?"titleMS":"titleMD",children:o.nome})}),!!o.fraseDeEfeito&&T("div",{children:T(so,{variant:"bodySM",color:We.neutral[100],children:o.fraseDeEfeito})}),!n&&ho(sa,{children:[!!o.valorPeriodicoPromocional&&T("div",{children:ho(so,{variant:"bodySM",color:We.red[300],style:{textDecorationLine:"line-through",marginRight:"2rem"},children:["R$ ",o.valorPeriodico]})}),ho("div",{style:{display:"flex",justifyContent:"center",alignItems:"end"},children:[T(so,{variant:"titleXXS",alignSelf:"center",children:"R$"}),T(so,{variant:r?"titleLG":"titleXL",style:{fontSize:"3rem"},children:o.valorPeriodicoPromocional||o.valorPeriodico}),ho(so,{variant:r?"titleMS":"titleMD",marginBottom:"0.3rem",children:["/",$(o.periodicidade)]})]})]})]}),T(tn,{fullWidth:!0,variant:c?"neutral":"contained",disabled:c||o.disabled||o.disabled30Dias,startIcon:(c||n)&&T(ia,{icon:c?ln:mn,size:"25px"}),onClick:()=>{n?no(m||p):a(o)},style:{margin:"1.5rem 0"},children:C()}),T("div",{style:{paddingLeft:"1rem"},children:T(so,{variant:"bodySM",children:T("div",{style:{display:"flex",flexDirection:"column"},dangerouslySetInnerHTML:{__html:o.descricao}})})})]})})})}function pn(o){return o.title?T(nn,{...o}):T(sa,{children:o.children})}import{useMemo as ze}from"react";import{useMediaQuery as Oe}from"@s_mart/hooks";import{useFormContext as cn}from"react-hook-form";import la from"dayjs";var dn=({planos:o})=>{let e=x(f=>f.codigoPlano),r=x(f=>f.periodicidade),a=x(f=>f.valor),i=x(f=>f.dataContratacao),n=x(f=>f.recursos),l=b(f=>f.handleErrors),m=b(f=>f.setLoading),p=u(f=>f.planosDialog.bloquearDowngrade),c=u(f=>f.planosDialog.bloquearDowngrade30Dias),C=u(f=>f.planosDialog.desabilitarPlanosMenores),g=u(f=>f.planosDialog.mostrarSomentePlanosDaPeriodicidade),y=u(f=>f.planosDialog.mostrarPlanosDeterminados?.codigoPlanoValor),{buscarPlano:t}=w(),{watch:h,setValue:d}=cn(),D=Oe("(max-width: 900px)"),R=Oe("(max-width: 700px)"),q=Oe("(max-width: 450px)"),ro=h("filtroPeriodicidade"),wo=!!c&&la().diff(la(i),"days")<30,ao=ze(()=>{let f={previous:0,next:4};return R?f.next=2:D&&(f.next=3),f},[R,D,ro]),K=ze(()=>{let f=[];if(!o)return f;if(y&&!g)f=[...o.mensais,...o.trimestrais,...o.semestrais,...o.anuais].filter(F=>y.includes(F.codigoPlanoValor));else if(ro){let F=g||["mensais","trimestrais","semestrais","anuais"][ro.value];f=o[F]}return f.sort((S,F)=>S.valorPeriodico-F.valorPeriodico),f.map(S=>{let F=S.valorPeriodicoPromocional||S.valorPeriodico,X=ko(F,S.periodicidade)<ko(a??0,r);return{...S,planoAtual:S.codigo===e&&S.periodicidade===r,valorMensalMenorQueAtual:X,disabled:(!!p||!!C)&&X,disabled30Dias:wo&&X}})},[o,ro,y]),Ho=ze(()=>R?K.length>1:D?K.length>2:K.length>3,[R,D,K]);function ko(f,P){switch(P){case 1:return f/3;case 2:return f/6;case 3:return f/12;default:return f}}return{planosFiltrados:K,scrollPlanos:f=>{let P=ao[f];if(P===0||P>K.length)return;let S=document.getElementById(`plano-${P}`);S&&(S.scrollIntoView({behavior:"smooth"}),f==="next"?(ao.next++,ao.previous++):(ao.next--,ao.previous--))},showScrollControllers:Ho,maxWidth700:R,maxWidth450:q,handleClickContratarPlano:async f=>{try{m(!0);let P=await t(f.codigo,f.periodicidade);if(P.data){let S={},F=P.data.recursos?.filter(W=>!W?.valorRecurso)?.map(W=>W?.slugRecurso);n?.filter(W=>W.recursoContratado)?.forEach(W=>{P.data.recursos.some(_o=>_o.slugRecurso===W.slugRecurso)&&!F?.includes(W.slugRecurso)&&(S[W.slugRecurso]=!0)}),d("recursosSelecionados",S),d("planoSelecionado",{...f,recursos:P.data.recursos})}m(!1)}catch(P){l(P)}},periodicidadePlanoAtual:r}},ma=dn;import{jsx as Ro,jsxs as gn}from"react/jsx-runtime";function ca(o){let{planosFiltrados:e,scrollPlanos:r,showScrollControllers:a,maxWidth700:i,maxWidth450:n,handleClickContratarPlano:l,periodicidadePlanoAtual:m}=ma(o);return gn("div",{style:{display:"flex",position:"relative"},children:[a&&Ro($e,{side:"left",onClick:()=>r("previous"),children:Ro(pa,{icon:un,size:i?"2rem":"3rem"})}),Ro("div",{style:{display:"flex",justifyContent:a?void 0:"center",overflow:"hidden",flex:1},children:e.map((p,c)=>Ro(na,{id:`plano-${c+1}`,plano:p,reduceFont:n,periodicidadePlanoAtual:m??0,onContratar:l},p.codigoPlanoValor))}),a&&Ro($e,{side:"right",onClick:()=>r("next"),children:Ro(pa,{icon:fn,size:i?"2rem":"3rem"})})]})}import{Grid as Ke}from"@s_mart/core";import{Grid as yn,Typography as Xe}from"@s_mart/core";import{valor as hn}from"@s_mart/masks";import{Switch as Cn}from"@s_mart/form";import{useFormContext as xn}from"react-hook-form";import{Grid as je}from"@mui/material";import He from"@emotion/styled";var da=He(je)`
|
|
146
146
|
display: flex;
|
|
147
147
|
justify-content: end;
|
|
148
148
|
margin-bottom: 1.5rem;
|
package/package.json
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s_mart/minha-conta",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"main": "./dist/index.mjs",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
|
-
"types": "./dist/index.d.
|
|
6
|
+
"types": "./dist/index.d.mts",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist/**"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"tsup": "^6.7.0",
|
|
14
13
|
"@emotion/react": ">=11.11.1",
|
|
15
|
-
"@emotion/styled": ">=11.11.
|
|
14
|
+
"@emotion/styled": ">=11.11.5",
|
|
16
15
|
"@mui/material": ">=5.15.11",
|
|
17
16
|
"@mui/x-data-grid": "^6.11.2",
|
|
18
17
|
"@types/lodash-es": ">=4.17.12",
|
|
19
|
-
"@types/react": "
|
|
20
|
-
"@types/react-dom": ">=18.
|
|
18
|
+
"@types/react": ">=18.3.1",
|
|
19
|
+
"@types/react-dom": ">=18.3.0",
|
|
21
20
|
"axios": "^1.6.7",
|
|
22
21
|
"dayjs": "^1.11.10",
|
|
23
22
|
"eslint": "^8.47.0",
|
|
24
23
|
"jwt-decode": "^4.0.0",
|
|
25
24
|
"lodash-es": "^4.17.21",
|
|
26
25
|
"notistack": "^3.0.1",
|
|
27
|
-
"react": ">=18.
|
|
28
|
-
"react-dom": ">=18.
|
|
26
|
+
"react": ">=18.3.1",
|
|
27
|
+
"react-dom": ">=18.3.1",
|
|
29
28
|
"react-dropzone": "^14.2.3",
|
|
30
29
|
"react-hook-form": "^7.51.0",
|
|
31
|
-
"
|
|
30
|
+
"tsup": "8.0.2",
|
|
31
|
+
"typescript": ">=5.4.2",
|
|
32
32
|
"zustand": "^4.5.2",
|
|
33
33
|
"@s_mart/core": "5.0.4",
|
|
34
|
-
"@s_mart/data": "
|
|
35
|
-
"@s_mart/form": "
|
|
36
|
-
"@s_mart/hooks": "
|
|
37
|
-
"@s_mart/masks": "5.0
|
|
38
|
-
"@s_mart/regular-icons": "5.0
|
|
39
|
-
"@s_mart/rules": "5.0
|
|
40
|
-
"@s_mart/solid-icons": "5.0
|
|
41
|
-
"@s_mart/tokens": "5.0
|
|
42
|
-
"@s_mart/typed": "
|
|
43
|
-
"@s_mart/utils": "5.0
|
|
44
|
-
"eslint-config-smarten": "4.0
|
|
34
|
+
"@s_mart/data": "6.0.0",
|
|
35
|
+
"@s_mart/form": "6.0.0",
|
|
36
|
+
"@s_mart/hooks": "6.0.0",
|
|
37
|
+
"@s_mart/masks": "5.1.0",
|
|
38
|
+
"@s_mart/regular-icons": "5.1.0",
|
|
39
|
+
"@s_mart/rules": "5.1.0",
|
|
40
|
+
"@s_mart/solid-icons": "5.1.0",
|
|
41
|
+
"@s_mart/tokens": "5.1.0",
|
|
42
|
+
"@s_mart/typed": "6.0.0",
|
|
43
|
+
"@s_mart/utils": "5.1.0",
|
|
44
|
+
"eslint-config-smarten": "4.1.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@emotion/react": ">=11.11.1",
|
|
48
|
-
"@emotion/styled": ">=11.11.
|
|
48
|
+
"@emotion/styled": ">=11.11.5",
|
|
49
49
|
"@types/lodash-es": ">=4.17.12",
|
|
50
|
-
"@types/react": "
|
|
51
|
-
"@types/react-dom": ">=18.
|
|
50
|
+
"@types/react": ">=18.3.1",
|
|
51
|
+
"@types/react-dom": ">=18.3.0",
|
|
52
52
|
"axios": "^1.6.7",
|
|
53
53
|
"dayjs": "^1.11.10",
|
|
54
54
|
"jwt-decode": "^4.0.0",
|
|
55
55
|
"lodash-es": "^4.17.21",
|
|
56
|
-
"notistack": "^
|
|
57
|
-
"react": ">=18.
|
|
58
|
-
"react-dom": ">=18.
|
|
56
|
+
"notistack": "^3.0.1",
|
|
57
|
+
"react": ">=18.3.1",
|
|
58
|
+
"react-dom": ">=18.3.1",
|
|
59
59
|
"react-dropzone": "^14.2.3",
|
|
60
60
|
"react-hook-form": "^7.51.0",
|
|
61
|
-
"typescript": "
|
|
61
|
+
"typescript": ">=5.4.2",
|
|
62
62
|
"zustand": "^4.5.2",
|
|
63
63
|
"@s_mart/core": "5.0.4",
|
|
64
|
-
"@s_mart/data": "
|
|
65
|
-
"@s_mart/form": "
|
|
66
|
-
"@s_mart/hooks": "
|
|
67
|
-
"@s_mart/masks": "5.0
|
|
68
|
-
"@s_mart/regular-icons": "5.0
|
|
69
|
-
"@s_mart/rules": "5.0
|
|
70
|
-
"@s_mart/solid-icons": "5.0
|
|
71
|
-
"@s_mart/tokens": "5.0
|
|
72
|
-
"@s_mart/utils": "5.0
|
|
73
|
-
"eslint-config-smarten": "4.0
|
|
64
|
+
"@s_mart/data": "6.0.0",
|
|
65
|
+
"@s_mart/form": "6.0.0",
|
|
66
|
+
"@s_mart/hooks": "6.0.0",
|
|
67
|
+
"@s_mart/masks": "5.1.0",
|
|
68
|
+
"@s_mart/regular-icons": "5.1.0",
|
|
69
|
+
"@s_mart/rules": "5.1.0",
|
|
70
|
+
"@s_mart/solid-icons": "5.1.0",
|
|
71
|
+
"@s_mart/tokens": "5.1.0",
|
|
72
|
+
"@s_mart/utils": "5.1.0",
|
|
73
|
+
"eslint-config-smarten": "4.1.0"
|
|
74
74
|
},
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|