@s_mart/nps 10.0.0-beta.8 → 10.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.mjs +1 -21
- package/package.json +26 -22
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
gap: 1rem;
|
|
5
|
-
|
|
6
|
-
padding: 1.5rem;
|
|
7
|
-
border-radius: 0.375rem;
|
|
8
|
-
box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.25);
|
|
9
|
-
border: 1px solid ${({theme:t})=>t.palette.primary?.main};
|
|
10
|
-
background: ${D.neutral[0]};
|
|
11
|
-
|
|
12
|
-
position: absolute;
|
|
13
|
-
bottom: 1.5rem;
|
|
14
|
-
right: 1.75rem;
|
|
15
|
-
z-index: 102;
|
|
16
|
-
|
|
17
|
-
@media (max-width: 650px) {
|
|
18
|
-
right: 1.25rem;
|
|
19
|
-
left: 1.25rem;
|
|
20
|
-
}
|
|
21
|
-
`;import{useState as M}from"react";var W=({onEnviarNota:t,onNotification:i})=>{let[o,a]=M("selecionarNota");return{step:o,handleEnviar:(p,n)=>{o==="selecionarNota"?(t?.(p),p>=9?a("feedbackPromotor"):a("feedbackDetrator")):(n(),i({variant:"success",title:"Avalia\xE7\xE3o enviada",message:"Agradecemos muito pela sua avalia\xE7\xE3o.",duration:5e3}))}}},h=W;import{z as c}from"zod";var X=c.object({nota:c.number(),feedback:c.string().optional(),autorizoPublicacao:c.coerce.boolean()}),S=X;import{Fragment as G,jsx as e,jsxs as d}from"react/jsx-runtime";var Q=({onFinalizar:t,mostrarBackdrop:i,sistemaNome:o,onClose:a,shouldCloseOnBackdropClick:l,onSelecionarNota:p,paperStyle:n,...s})=>{let{step:r,handleEnviar:k}=h(s),N={selecionarNota:`De 0 a 10, o quanto voc\xEA recomendaria o ${o}?`,feedbackDetrator:`Como podemos melhorar a sua experi\xEAncia no ${o}?`,feedbackPromotor:`O que voc\xEA mais gosta no ${o}?`};return e(U,{onSubmit:t,schema:S,children:({watch:C,onSubmit:F})=>{let u=C("nota");return d(G,{children:[!!i&&e(O,{open:!0,onClick:l?a:void 0,style:{zIndex:99}}),d(P,{style:n,children:[d("div",{style:{display:"flex",justifyContent:"space-between"},children:[e(g,{variant:"titleSM",children:N[r]}),e(I,{icon:L,size:"25px",onClick:a,style:{cursor:"pointer"}})]}),e("div",{children:r==="selecionarNota"?e(v,{onSelecionarNota:p}):e(x,{tipo:r==="feedbackPromotor"?"promotor":"detrator",sistemaNome:o})}),d("div",{style:{display:"flex",justifyContent:"space-between"},children:[e("div",{children:r==="feedbackPromotor"&&e(R,{name:"autorizoPublicacao",label:d(g,{variant:"bodyXS",children:["Autorizo a publica\xE7\xE3o deste coment\xE1rio no site e em redes sociais do ",o]})})}),e(j,{disabled:u===void 0,onClick:()=>k(u,F),children:"Enviar"})]})]})]})}})},_=Q;export{_ as NPS};
|
|
1
|
+
import{LIcon as j}from"@s_mart/core";import{Checkbox as U,Form as L}from"@s_mart/form";import{lineTimes as O}from"@s_mart/regular-icons";import{Button as Q,Backdrop as _,IconButton as G,Typography as x,useTheme as H}from"@mui/material";import{Button as T,Typography as f,useMediaQuery as w}from"@mui/material";import{colorPalette as y}from"@s_mart/tokens";import{useFormContext as B,useWatch as I}from"react-hook-form";import{Fragment as $,jsx as m,jsxs as v}from"react/jsx-runtime";var E=({onSelecionarNota:e})=>{let{control:i,setValue:t}=B(),a=w("(max-width: 500px)"),l=I({control:i,name:"nota"}),n=p=>{l!==p&&(t("nota",p),e?.(p))},s=m(f,{variant:"bodyXS",color:y.neutral[100],children:"Pouco prov\xE1vel"});return v($,{children:[a&&m("div",{style:{marginBottom:"0.5rem"},children:s}),m("div",{style:{display:"flex",gap:"0.3rem",flexWrap:"wrap",justifyContent:"center"},children:Array.from({length:11}).map((p,r)=>m(T,{variant:l===r?"contained":"outlined",style:{minWidth:"3rem"},onClick:()=>n(r),children:r},r))}),v("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"0.5rem"},children:[m("span",{children:!a&&s}),m(f,{variant:"bodyXS",color:y.neutral[100],children:"Muito prov\xE1vel"})]})]})},b=E;import{TextField as A}from"@s_mart/form";import{jsx as M}from"react/jsx-runtime";var D=({tipo:e,sistemaNome:i})=>M(A,{name:"feedback",placeholder:e==="promotor"?`Para mim o ${i} \xE9...`:"Eu acho que...",multiline:!0,size:"large",minRows:2}),h=D;import{styled as R}from"@mui/material";import{colorPalette as V}from"@s_mart/tokens";var P=R("div")(({theme:e})=>({display:"flex",flexDirection:"column",gap:"1.5rem",padding:"1.5rem",borderRadius:Number.parseFloat(e.shape.borderRadius.toString())*1.5,boxShadow:e.shadows[6],border:`1px solid ${e.palette.primary?.main}`,background:V.neutral[0],position:"absolute",bottom:"1.5rem",right:"1.75rem",zIndex:102,"@media (max-width: 650px)":{right:"1.25rem",left:"1.25rem"}}));import{useState as W}from"react";var q=({onEnviarNota:e,onNotification:i})=>{let[t,a]=W("selecionarNota");return{step:t,handleEnviar:(n,s)=>{t==="selecionarNota"?(e?.(n),n>=9?a("feedbackPromotor"):a("feedbackDetrator")):(s(),i({variant:"success",title:"Avalia\xE7\xE3o enviada",message:"Agradecemos muito pela sua avalia\xE7\xE3o.",duration:5e3}))}}},g=q;import{z as d}from"zod";var X=d.object({nota:d.number(),feedback:d.string().optional(),autorizoPublicacao:d.coerce.boolean()}),S=X;import{Fragment as Y,jsx as o,jsxs as c}from"react/jsx-runtime";var J=({onFinalizar:e,mostrarBackdrop:i,sistemaNome:t,onClose:a,shouldCloseOnBackdropClick:l,onSelecionarNota:n,paperStyle:s,...p})=>{let{step:r,handleEnviar:k}=g(p),N=H(),F={selecionarNota:`De 0 a 10, o quanto voc\xEA recomendaria o ${t}?`,feedbackDetrator:`Como podemos melhorar a sua experi\xEAncia no ${t}?`,feedbackPromotor:`O que voc\xEA mais gosta no ${t}?`};return o(L,{onSubmit:e,schema:S,children:({watch:C,onSubmit:z})=>{let u=C("nota");return c(Y,{children:[!!i&&o(_,{open:!0,onClick:l?a:void 0,style:{zIndex:99}}),c(P,{style:s,children:[c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o(x,{variant:"titleSM",color:N.palette.grey[700],children:F[r]}),o(G,{size:"small",onClick:a,children:o(j,{icon:O,removeMargin:!0,size:"25px"})})]}),o("div",{children:r==="selecionarNota"?o(b,{onSelecionarNota:n}):o(h,{tipo:r==="feedbackPromotor"?"promotor":"detrator",sistemaNome:t})}),c("div",{style:{display:"flex",justifyContent:"space-between"},children:[o("div",{children:r==="feedbackPromotor"&&o(U,{name:"autorizoPublicacao",label:c(x,{variant:"bodyXS",children:["Autorizo a publica\xE7\xE3o deste coment\xE1rio no site e em redes sociais do ",t]})})}),o("div",{children:o(Q,{disabled:u===void 0,onClick:()=>k(u,z),children:"Enviar"})})]})]})]})}})},K=J;export{K as NPS};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s_mart/nps",
|
|
3
|
-
"version": "10.0.0
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"main": "./dist/index.mjs",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.mts",
|
|
@@ -10,27 +10,28 @@
|
|
|
10
10
|
"dist/**"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
+
"react-is": "^18.3.1",
|
|
13
14
|
"tsup": "8.0.2",
|
|
14
15
|
"typescript": ">=5.4.2",
|
|
15
|
-
"@s_mart/typed": "
|
|
16
|
+
"@s_mart/typed": "8.0.0"
|
|
16
17
|
},
|
|
17
18
|
"peerDependencies": {
|
|
18
19
|
"@emotion/react": "^11.11.4",
|
|
19
20
|
"@emotion/styled": "^11.13.0",
|
|
20
|
-
"@mui/material": "^
|
|
21
|
-
"@mui/system": "^
|
|
21
|
+
"@mui/material": "^7.2.0",
|
|
22
|
+
"@mui/system": "^7.2.0",
|
|
22
23
|
"@types/node": ">=22.15.17",
|
|
23
|
-
"@types/react": "
|
|
24
|
-
"@types/react-dom": "
|
|
24
|
+
"@types/react": "^18.3.12",
|
|
25
|
+
"@types/react-dom": "^18.3.1",
|
|
25
26
|
"notistack": "^3.0.1",
|
|
26
|
-
"react": "
|
|
27
|
-
"react-dom": "
|
|
27
|
+
"react": "^18.3.1",
|
|
28
|
+
"react-dom": "^18.3.1",
|
|
28
29
|
"react-hook-form": "^7.51.0",
|
|
29
30
|
"zod": "^3.22.4",
|
|
30
|
-
"@s_mart/core": "
|
|
31
|
-
"@s_mart/form": "
|
|
32
|
-
"@s_mart/regular-icons": "6.0.
|
|
33
|
-
"@s_mart/tokens": "
|
|
31
|
+
"@s_mart/core": "10.0.0",
|
|
32
|
+
"@s_mart/form": "10.0.0",
|
|
33
|
+
"@s_mart/regular-icons": "6.0.11",
|
|
34
|
+
"@s_mart/tokens": "6.0.0"
|
|
34
35
|
},
|
|
35
36
|
"publishConfig": {
|
|
36
37
|
"access": "public"
|
|
@@ -38,20 +39,23 @@
|
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"@emotion/react": "^11.11.4",
|
|
40
41
|
"@emotion/styled": "^11.13.0",
|
|
41
|
-
"@mui/material": "^
|
|
42
|
-
"@mui/system": "^
|
|
42
|
+
"@mui/material": "^7.2.0",
|
|
43
|
+
"@mui/system": "^7.2.0",
|
|
43
44
|
"@types/node": ">=22.15.17",
|
|
44
|
-
"@types/react": "
|
|
45
|
-
"@types/react-dom": "
|
|
45
|
+
"@types/react": "^18.3.12",
|
|
46
|
+
"@types/react-dom": "^18.3.1",
|
|
46
47
|
"notistack": "^3.0.1",
|
|
47
|
-
"react": "
|
|
48
|
-
"react-dom": "
|
|
48
|
+
"react": "^18.3.1",
|
|
49
|
+
"react-dom": "^18.3.1",
|
|
49
50
|
"react-hook-form": "^7.51.0",
|
|
50
51
|
"zod": "^3.22.4",
|
|
51
|
-
"@s_mart/core": "
|
|
52
|
-
"@s_mart/form": "
|
|
53
|
-
"@s_mart/regular-icons": "6.0.
|
|
54
|
-
"@s_mart/tokens": "
|
|
52
|
+
"@s_mart/core": "10.0.0",
|
|
53
|
+
"@s_mart/form": "10.0.0",
|
|
54
|
+
"@s_mart/regular-icons": "6.0.11",
|
|
55
|
+
"@s_mart/tokens": "6.0.0"
|
|
56
|
+
},
|
|
57
|
+
"overrides": {
|
|
58
|
+
"react-is": "^18.3.1"
|
|
55
59
|
},
|
|
56
60
|
"scripts": {
|
|
57
61
|
"build": "tsup src/index.tsx --minify --format esm --dts --external react",
|