@s_mart/nps 7.0.1 → 7.0.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.
Files changed (2) hide show
  1. package/dist/index.mjs +2 -2
  2. package/package.json +7 -7
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{Backdrop as I,Button as R,LIcon as U,Typography as g}from"@s_mart/core";import{Checkbox as H,Form as L}from"@s_mart/form";import{lineTimes as O}from"@s_mart/regular-icons";import{Button as w,Typography as u}from"@s_mart/core";import{useMediaQuery as z}from"@s_mart/hooks";import{colorPalette as y}from"@s_mart/tokens";import{useFormContext as T}from"react-hook-form";import{Fragment as $,jsx as m,jsxs as b}from"react/jsx-runtime";var B=({onSelecionarNota:t})=>{let{watch:a,setValue:o}=T(),i=z("(max-width: 500px)"),l=a("nota"),n=s=>{l!==s&&(o("nota",s),t?.(s))},p=m(u,{variant:"bodyXS",color:y.neutral[100],children:"Pouco prov\xE1vel"});return b($,{children:[i&&m("div",{style:{marginBottom:"0.5rem"},children:p}),m("div",{style:{display:"flex",gap:"0.3rem",flexWrap:"wrap",justifyContent:"center"},children:Array(11).fill(void 0).map((s,r)=>m(w,{variant:l===r?"contained":"outlined",style:{minWidth:"3rem"},onClick:()=>n(r),children:r},r))}),b("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"0.5rem"},children:[m("span",{children:!i&&p}),m(u,{variant:"bodyXS",color:y.neutral[100],children:"Muito prov\xE1vel"})]})]})},v=B;import{TextField as E}from"@s_mart/form";import{jsx as D}from"react/jsx-runtime";var A=({tipo:t,sistemaNome:a})=>D(E,{name:"feedback",placeholder:t==="promotor"?`Para mim o ${a} \xE9...`:"Eu acho que...",multiline:!0,size:"large",minRows:2}),x=A;import V from"@emotion/styled";import{colorPalette as q}from"@s_mart/tokens";var P=V.div`
1
+ import{Button as I,LIcon as R}from"@s_mart/core";import{Checkbox as U,Form as H}from"@s_mart/form";import{lineTimes as L}from"@s_mart/regular-icons";import{Backdrop as O,Typography as g}from"@mui/material";import{Button as w}from"@s_mart/core";import{Typography as u,useMediaQuery as z}from"@mui/material";import{colorPalette as y}from"@s_mart/tokens";import{useFormContext as T}from"react-hook-form";import{Fragment as $,jsx as m,jsxs as b}from"react/jsx-runtime";var B=({onSelecionarNota:t})=>{let{watch:a,setValue:o}=T(),i=z("(max-width: 500px)"),l=a("nota"),n=s=>{l!==s&&(o("nota",s),t?.(s))},p=m(u,{variant:"bodyXS",color:y.neutral[100],children:"Pouco prov\xE1vel"});return b($,{children:[i&&m("div",{style:{marginBottom:"0.5rem"},children:p}),m("div",{style:{display:"flex",gap:"0.3rem",flexWrap:"wrap",justifyContent:"center"},children:Array(11).fill(void 0).map((s,r)=>m(w,{variant:l===r?"contained":"outlined",style:{minWidth:"3rem"},onClick:()=>n(r),children:r},r))}),b("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"0.5rem"},children:[m("span",{children:!i&&p}),m(u,{variant:"bodyXS",color:y.neutral[100],children:"Muito prov\xE1vel"})]})]})},v=B;import{TextField as E}from"@s_mart/form";import{jsx as D}from"react/jsx-runtime";var A=({tipo:t,sistemaNome:a})=>D(E,{name:"feedback",placeholder:t==="promotor"?`Para mim o ${a} \xE9...`:"Eu acho que...",multiline:!0,size:"large",minRows:2}),x=A;import V from"@emotion/styled";import{colorPalette as q}from"@s_mart/tokens";var P=V.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 1rem;
@@ -18,4 +18,4 @@ import{Backdrop as I,Button as R,LIcon as U,Typography as g}from"@s_mart/core";i
18
18
  right: 1.25rem;
19
19
  left: 1.25rem;
20
20
  }
21
- `;import{useState as M}from"react";import{useNotification as W}from"@s_mart/hooks";var X=({onEnviarNota:t})=>{let[a,o]=M("selecionarNota"),i=W();return{step:a,handleEnviar:(n,p)=>{a==="selecionarNota"?(t?.(n),n>=9?o("feedbackPromotor"):o("feedbackDetrator")):(p(),i.setNotification({variant:"success",title:"Avalia\xE7\xE3o enviada",message:"Agradecemos muito pela sua avalia\xE7\xE3o.",autoHideDuration:5e3}))}}},h=X;import{z as d}from"zod";var j=d.object({nota:d.number(),feedback:d.string().optional(),autorizoPublicacao:d.coerce.boolean()}),S=j;import{Fragment as G,jsx as e,jsxs as c}from"react/jsx-runtime";var Q=({onFinalizar:t,mostrarBackdrop:a,sistemaNome:o,onClose:i,shouldCloseOnBackdropClick:l,onSelecionarNota:n,paperStyle:p,...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(L,{onSubmit:t,schema:S,children:({watch:C,onSubmit:F})=>{let f=C("nota");return c(G,{children:[!!a&&e(I,{open:!0,onClick:l?i:void 0,style:{zIndex:99}}),c(P,{style:p,children:[c("div",{style:{display:"flex",justifyContent:"space-between"},children:[e(g,{variant:"titleSM",children:N[r]}),e(U,{icon:O,size:"25px",onClick:i,style:{cursor:"pointer"}})]}),e("div",{children:r==="selecionarNota"?e(v,{onSelecionarNota:n}):e(x,{tipo:r==="feedbackPromotor"?"promotor":"detrator",sistemaNome:o})}),c("div",{style:{display:"flex",justifyContent:"space-between"},children:[e("div",{children:r==="feedbackPromotor"&&e(H,{name:"autorizoPublicacao",label:c(g,{variant:"bodyXS",children:["Autorizo a publica\xE7\xE3o deste coment\xE1rio no site e em redes sociais do ",o]})})}),e(R,{disabled:f===void 0,onClick:()=>k(f,F),children:"Enviar"})]})]})]})}})},_=Q;export{_ as NPS};
21
+ `;import{useState as M}from"react";import{useNotification as W}from"@s_mart/hooks";var X=({onEnviarNota:t})=>{let[a,o]=M("selecionarNota"),i=W();return{step:a,handleEnviar:(n,p)=>{a==="selecionarNota"?(t?.(n),n>=9?o("feedbackPromotor"):o("feedbackDetrator")):(p(),i.setNotification({variant:"success",title:"Avalia\xE7\xE3o enviada",message:"Agradecemos muito pela sua avalia\xE7\xE3o.",autoHideDuration:5e3}))}}},h=X;import{z as d}from"zod";var j=d.object({nota:d.number(),feedback:d.string().optional(),autorizoPublicacao:d.coerce.boolean()}),S=j;import{Fragment as G,jsx as e,jsxs as c}from"react/jsx-runtime";var Q=({onFinalizar:t,mostrarBackdrop:a,sistemaNome:o,onClose:i,shouldCloseOnBackdropClick:l,onSelecionarNota:n,paperStyle:p,...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(H,{onSubmit:t,schema:S,children:({watch:C,onSubmit:F})=>{let f=C("nota");return c(G,{children:[!!a&&e(O,{open:!0,onClick:l?i:void 0,style:{zIndex:99}}),c(P,{style:p,children:[c("div",{style:{display:"flex",justifyContent:"space-between"},children:[e(g,{variant:"titleSM",children:N[r]}),e(R,{icon:L,size:"25px",onClick:i,style:{cursor:"pointer"}})]}),e("div",{children:r==="selecionarNota"?e(v,{onSelecionarNota:n}):e(x,{tipo:r==="feedbackPromotor"?"promotor":"detrator",sistemaNome:o})}),c("div",{style:{display:"flex",justifyContent:"space-between"},children:[e("div",{children:r==="feedbackPromotor"&&e(U,{name:"autorizoPublicacao",label:c(g,{variant:"bodyXS",children:["Autorizo a publica\xE7\xE3o deste coment\xE1rio no site e em redes sociais do ",o]})})}),e(I,{disabled:f===void 0,onClick:()=>k(f,F),children:"Enviar"})]})]})]})}})},_=Q;export{_ as NPS};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s_mart/nps",
3
- "version": "7.0.1",
3
+ "version": "7.0.3",
4
4
  "main": "./dist/index.mjs",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.mts",
@@ -17,9 +17,9 @@
17
17
  "@types/react-dom": ">=18.3.0",
18
18
  "tsup": "8.0.2",
19
19
  "typescript": ">=5.4.2",
20
- "@s_mart/core": "7.0.0",
21
- "@s_mart/form": "7.0.1",
22
- "@s_mart/hooks": "7.0.0",
20
+ "@s_mart/core": "7.0.1",
21
+ "@s_mart/form": "7.1.2",
22
+ "@s_mart/hooks": "7.0.1",
23
23
  "@s_mart/regular-icons": "5.2.0",
24
24
  "@s_mart/tokens": "5.1.0",
25
25
  "@s_mart/typed": "6.0.0",
@@ -36,9 +36,9 @@
36
36
  "react-dom": ">=18.3.1",
37
37
  "react-hook-form": "^7.51.0",
38
38
  "zod": ">=3.21.4",
39
- "@s_mart/core": "7.0.0",
40
- "@s_mart/form": "7.0.1",
41
- "@s_mart/hooks": "7.0.0",
39
+ "@s_mart/core": "7.0.1",
40
+ "@s_mart/form": "7.1.2",
41
+ "@s_mart/hooks": "7.0.1",
42
42
  "@s_mart/regular-icons": "5.2.0",
43
43
  "@s_mart/tokens": "5.1.0"
44
44
  },