@adoptaunabuelo/react-components 0.1.5 → 0.1.6

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/cjs/index.js CHANGED
@@ -130,5 +130,5 @@
130
130
  flex-direction: row;
131
131
  align-items: center;
132
132
  margin: 16px;
133
- `;exports.BreadCrumb=t=>{var{steps:a=1}=t,r=e(t,["steps"]);const[n,i]=h.exports.useState(r.selectedStep?r.selectedStep:0),p=Array.from(Array(a).keys());return h.exports.useEffect((()=>{r.selectedStep&&i(r.selectedStep)}),[r.selectedStep]),y.exports.jsx(at,Object.assign({"data-testid":"bread-crumb"},r,{children:p.map(((e,t)=>y.exports.jsx(yt,{isSelected:n===t},"crumb"+t)))}))},exports.Color=tt,exports.Feedback=t=>{var{type:a="success",isVisible:r=!1}=t,n=e(t,["type","isVisible"]);const[i,p]=h.exports.useState(!1);return h.exports.useEffect((()=>{p(r),setTimeout((()=>{n.onClose&&n.onClose(),p(!1)}),3e3)}),[r]),i?y.exports.jsx(Vt,Object.assign({"data-testid":"feedback",type:a},n,{children:y.exports.jsxs(St,{children:["success"===a?y.exports.jsx(qt,{style:{marginRight:12},color:"white",height:24,width:24}):y.exports.jsx(Ht,{style:{marginRight:12},color:"white",height:24,width:24}),y.exports.jsx(wt,Object.assign({type:"p",style:{display:"flex",flex:1,color:"white"}},{children:n.text}))]})})):null},exports.ProgressBar=e=>{const[t,a]=h.exports.useState(e.minValue?e.minValue:0),[r,n]=h.exports.useState(e.maxValue?e.maxValue:100),[i,p]=h.exports.useState("number"==typeof e.progress?0:e.progress.map((e=>({value:0,color:e.color}))));return h.exports.useEffect((()=>{e.minValue&&a(e.minValue),e.maxValue&&n(e.maxValue)}),[e.minValue,e.maxValue]),h.exports.useEffect((()=>{p(e.progress)}),[e.progress]),y.exports.jsx(bt,Object.assign({"data-testid":"progress-bar"},e,{children:"number"==typeof i?y.exports.jsx(jt,{style:{height:e.style&&e.style.height?e.style.height:6},progress:i/(r-t)*100,color:e.color,animationTime:e.animationTime,animationDelay:e.animationDelay}):i.map(((a,y)=>h.exports.createElement(jt,Object.assign({},e,{key:"progress-value-"+y,style:{height:e.style&&e.style.height?e.style.height:6},progress:a.value/(r-t)*100,color:a.color,animationTime:e.animationTime,animationDelay:e.animationDelay}))))}))},exports.Text=wt;
133
+ `;exports.BreadCrumb=t=>{var{steps:a=1}=t,r=e(t,["steps"]);const[n,i]=h.exports.useState(r.selectedStep?r.selectedStep:0),p=Array.from(Array(a).keys());return h.exports.useEffect((()=>{r.selectedStep&&i(r.selectedStep)}),[r.selectedStep]),y.exports.jsx(at,Object.assign({"data-testid":"bread-crumb"},r,{children:p.map(((e,t)=>y.exports.jsx(yt,{isSelected:n===t},"crumb"+t)))}))},exports.Color=tt,exports.Feedback=t=>{var{type:a="success",isVisible:r=!1}=t,n=e(t,["type","isVisible"]);const[i,p]=h.exports.useState(!1);return h.exports.useEffect((()=>{p(r),setTimeout((()=>{n.onClose&&n.onClose(),p(!1)}),3e3)}),[r]),i?y.exports.jsx(Vt,Object.assign({type:a},n,{children:y.exports.jsxs(St,{children:["success"===a?y.exports.jsx(qt,{style:{marginRight:12},color:"white",height:24,width:24}):y.exports.jsx(Ht,{style:{marginRight:12},color:"white",height:24,width:24}),y.exports.jsx(wt,Object.assign({type:"p",style:{display:"flex",flex:1,color:"white"}},{children:n.text}))]})})):null},exports.ProgressBar=e=>{const[t,a]=h.exports.useState(e.minValue?e.minValue:0),[r,n]=h.exports.useState(e.maxValue?e.maxValue:100),[i,p]=h.exports.useState("number"==typeof e.progress?0:e.progress.map((e=>({value:0,color:e.color}))));return h.exports.useEffect((()=>{e.minValue&&a(e.minValue),e.maxValue&&n(e.maxValue)}),[e.minValue,e.maxValue]),h.exports.useEffect((()=>{p(e.progress)}),[e.progress]),y.exports.jsx(bt,Object.assign({"data-testid":"progress-bar"},e,{children:"number"==typeof i?y.exports.jsx(jt,{style:{height:e.style&&e.style.height?e.style.height:6},progress:i/(r-t)*100,color:e.color,animationTime:e.animationTime,animationDelay:e.animationDelay}):i.map(((a,y)=>h.exports.createElement(jt,Object.assign({},e,{key:"progress-value-"+y,style:{height:e.style&&e.style.height?e.style.height:6},progress:a.value/(r-t)*100,color:a.color,animationTime:e.animationTime,animationDelay:e.animationDelay}))))}))},exports.Text=wt;
134
134
  //# sourceMappingURL=index.js.map