@mailstep/design-system 0.6.73-beta.3 → 0.6.73-beta.4
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/package.json +1 -1
- package/ui/Blocks/Stepper/Stepper.js +1 -1
- package/ui/index.es.js +4 -1
- package/ui/index.umd.js +1 -1
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import { StepItem } from './components/StepItem';
|
|
|
4
4
|
import { Container, ItemsWrapper } from './styles';
|
|
5
5
|
export var Stepper = function (_a) {
|
|
6
6
|
var items = _a.items, activeStep = _a.activeStep, hasStepNumbering = _a.hasStepNumbering, handleChangeStep = _a.handleChangeStep, handleGoToNextStep = _a.handleGoToNextStep, isLoading = _a.isLoading;
|
|
7
|
-
var Component = useMemo(function () { return items[activeStep].component; }, [items, activeStep]);
|
|
7
|
+
var Component = useMemo(function () { var _a; return (_a = items[activeStep]) === null || _a === void 0 ? void 0 : _a.component; }, [items, activeStep]);
|
|
8
8
|
useEffect(function () {
|
|
9
9
|
var _a;
|
|
10
10
|
if (!!activeStep && !((_a = items[activeStep - 1]) === null || _a === void 0 ? void 0 : _a.completed)) {
|
package/ui/index.es.js
CHANGED
|
@@ -51695,7 +51695,10 @@ const Cke = /* @__PURE__ */ Da(wke), xke = ot`
|
|
|
51695
51695
|
handleGoToNextStep: i,
|
|
51696
51696
|
isLoading: o
|
|
51697
51697
|
}) => {
|
|
51698
|
-
const l = Ye(() =>
|
|
51698
|
+
const l = Ye(() => {
|
|
51699
|
+
var c;
|
|
51700
|
+
return (c = e[t]) == null ? void 0 : c.component;
|
|
51701
|
+
}, [e, t]);
|
|
51699
51702
|
return At(() => {
|
|
51700
51703
|
var c;
|
|
51701
51704
|
t && !((c = e[t - 1]) != null && c.completed) && (n == null || n(0)());
|
package/ui/index.umd.js
CHANGED
|
@@ -3985,7 +3985,7 @@ ${ee.current.stack}
|
|
|
3985
3985
|
flex-direction: row;
|
|
3986
3986
|
width: auto;
|
|
3987
3987
|
}
|
|
3988
|
-
`,kOe=({items:e,activeStep:t,hasStepNumbering:r,handleChangeStep:n,handleGoToNextStep:i,isLoading:o})=>{const l=I.useMemo(()=>e[t].component,[e,t]);return I.useEffect(()=>{var u;t&&!((u=e[t-1])!=null&&u.completed)&&(n==null||n(0)())},[e]),e!=null&&e.length?g.jsxs(EOe,{children:[g.jsx(IOe,{total:e.length,hasComponent:!!l,children:e.map(({title:u,disabled:c,completed:f,icon:A},p)=>g.jsx(SOe,{onClick:n==null?void 0:n(p),title:u,index:p,total:e.length,activeStep:t,disabled:c,completed:f,hasStepNumbering:r,icon:A},u))}),l&&g.jsx(l,{handleGoToNextStep:i,isLoading:o})]}):null},OOe=({totalSteps:e})=>{const[t,r]=I.useState(0),[n,i]=I.useState(!1),o=I.useCallback(()=>{r(0),i(!1)},[]),l=I.useCallback(()=>{if(t+1===e){o(),i(!0);return}r(t+1)},[t,e,o]),u=I.useCallback(c=>()=>{r(c)},[]);return{activeStep:t,handleChangeStep:u,handleGoToNextStep:l,isSuccess:n,handleReset:o}},POe=$(Xe.div)`
|
|
3988
|
+
`,kOe=({items:e,activeStep:t,hasStepNumbering:r,handleChangeStep:n,handleGoToNextStep:i,isLoading:o})=>{const l=I.useMemo(()=>{var u;return(u=e[t])==null?void 0:u.component},[e,t]);return I.useEffect(()=>{var u;t&&!((u=e[t-1])!=null&&u.completed)&&(n==null||n(0)())},[e]),e!=null&&e.length?g.jsxs(EOe,{children:[g.jsx(IOe,{total:e.length,hasComponent:!!l,children:e.map(({title:u,disabled:c,completed:f,icon:A},p)=>g.jsx(SOe,{onClick:n==null?void 0:n(p),title:u,index:p,total:e.length,activeStep:t,disabled:c,completed:f,hasStepNumbering:r,icon:A},u))}),l&&g.jsx(l,{handleGoToNextStep:i,isLoading:o})]}):null},OOe=({totalSteps:e})=>{const[t,r]=I.useState(0),[n,i]=I.useState(!1),o=I.useCallback(()=>{r(0),i(!1)},[]),l=I.useCallback(()=>{if(t+1===e){o(),i(!0);return}r(t+1)},[t,e,o]),u=I.useCallback(c=>()=>{r(c)},[]);return{activeStep:t,handleChangeStep:u,handleGoToNextStep:l,isSuccess:n,handleReset:o}},POe=$(Xe.div)`
|
|
3989
3989
|
margin-right: 1em;
|
|
3990
3990
|
`,TOe=$.div`
|
|
3991
3991
|
display: flex;
|