reactjs-multi-stepper 1.1.3 → 1.1.5

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.css CHANGED
@@ -1 +1 @@
1
- body{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}h1,h2,h3,h4,h5,h6,p{margin:0%;padding:0%}.app-container{padding:1.5rem}.stepper-header{display:flex;width:100%;justify-content:space-between}.step-item{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}.step-item:not(:first-child):before{content:"";background-color:#e2e8f0;position:absolute;width:calc(100% - 2.5rem);height:3px;right:calc(50% + 1.25rem);top:1.125rem;transition:all .2s}.step{width:2.5rem;height:2.5rem;display:flex;align-items:center;justify-content:center;z-index:10;position:relative;border-radius:9999px;font-weight:600;color:#000;transition:all .2s}.step-active{border:1px solid #0284c7;background-color:#0284c7}.step-complete{background-color:#16a34a;color:#fff}.step-error{background-color:#ef4444}.step-finished{background-color:#16a34a}.step-active h2,.step-complete h2,.step-error span,.step-finished h2{color:#fff}.step-default{border:1px solid #d1d5db}.active .step{background-color:#0284c7}.complete .step{background-color:#16a34a}.complete:not(:first-child):before,.active:not(:first-child):before{background-color:#16a34a}.step-text{text-align:center;color:#fff}.step-title{font-size:1rem;color:#111827;font-weight:500;margin-top:1rem}.step-description{font-size:.85rem;color:#4b5563;font-weight:300;margin-top:.5rem}.stepper-content{width:100%;display:flex;justify-content:center;align-items:center}.stepper-footer{display:flex;justify-content:space-around;align-items:center;padding:1.5rem;padding-block:2rem}.stepper-button{padding:.375rem 2rem;font-size:1rem;border-radius:.375rem;border:1px solid #9ca3af;background-color:transparent;color:inherit;cursor:pointer}.stepper-button-fill{border-color:#3b82f6;background-color:#3b82f6;color:#fff}
1
+ body{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}h1,h2,h3,h4,h5,h6,p{margin:0%;padding:0%}.app-container{padding:1.5rem}.stepper-header{display:flex;justify-content:space-between}.step-item{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}.step-item:not(:first-child):before{content:"";background-color:#e2e8f0;position:absolute;width:calc(100% - 2.5rem);height:3px;right:calc(50% + 1.25rem);top:1.125rem;transition:all .2s}.step{width:2.5rem;height:2.5rem;display:flex;align-items:center;justify-content:center;z-index:10;position:relative;border-radius:9999px;font-weight:600;color:#000;transition:all .2s}.step-active{border:1px solid #0284c7;background-color:#0284c7}.step-complete{background-color:#16a34a;color:#fff}.step-error{background-color:#ef4444}.step-finished{background-color:#16a34a}.step-active h2,.step-complete h2,.step-error span,.step-finished h2{color:#fff}.step-default{border:1px solid #d1d5db}.active .step{background-color:#0284c7}.complete .step{background-color:#16a34a}.complete:not(:first-child):before,.active:not(:first-child):before{background-color:#16a34a}.step-text{text-align:center;color:#fff}.step-title{font-size:1rem;color:#111827;font-weight:500;margin-top:1rem}.step-description{font-size:.85rem;color:#4b5563;font-weight:300;margin-top:.5rem}.stepper-content{display:flex;justify-content:center;align-items:center}.stepper-footer{display:flex;justify-content:space-around;align-items:center;padding:1.5rem;padding-block:2rem}.stepper-button{padding:.375rem 2rem;font-size:1rem;border-radius:.375rem;border:1px solid #9ca3af;background-color:transparent;color:inherit;cursor:pointer}.stepper-button-fill{border-color:#0284c7;background-color:#0284c7;color:#fff}
@@ -1,4 +1,4 @@
1
- (function(j,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],i):(j=typeof globalThis<"u"?globalThis:j||self,i(j["multi-stepper"]={},j.React))})(this,function(j,i){"use strict";var M=document.createElement("style");M.textContent=`body{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}h1,h2,h3,h4,h5,h6,p{margin:0%;padding:0%}.app-container{padding:1.5rem}.stepper-header{display:flex;width:100%;justify-content:space-between}.step-item{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}.step-item:not(:first-child):before{content:"";background-color:#e2e8f0;position:absolute;width:calc(100% - 2.5rem);height:3px;right:calc(50% + 1.25rem);top:1.125rem;transition:all .2s}.step{width:2.5rem;height:2.5rem;display:flex;align-items:center;justify-content:center;z-index:10;position:relative;border-radius:9999px;font-weight:600;color:#000;transition:all .2s}.step-active{border:1px solid #0284c7;background-color:#0284c7}.step-complete{background-color:#16a34a;color:#fff}.step-error{background-color:#ef4444}.step-finished{background-color:#16a34a}.step-active h2,.step-complete h2,.step-error span,.step-finished h2{color:#fff}.step-default{border:1px solid #d1d5db}.active .step{background-color:#0284c7}.complete .step{background-color:#16a34a}.complete:not(:first-child):before,.active:not(:first-child):before{background-color:#16a34a}.step-text{text-align:center;color:#fff}.step-title{font-size:1rem;color:#111827;font-weight:500;margin-top:1rem}.step-description{font-size:.85rem;color:#4b5563;font-weight:300;margin-top:.5rem}.stepper-content{width:100%;display:flex;justify-content:center;align-items:center}.stepper-footer{display:flex;justify-content:space-around;align-items:center;padding:1.5rem;padding-block:2rem}.stepper-button{padding:.375rem 2rem;font-size:1rem;border-radius:.375rem;border:1px solid #9ca3af;background-color:transparent;color:inherit;cursor:pointer}.stepper-button-fill{border-color:#3b82f6;background-color:#3b82f6;color:#fff}
1
+ (function(j,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],i):(j=typeof globalThis<"u"?globalThis:j||self,i(j["multi-stepper"]={},j.React))})(this,function(j,i){"use strict";var M=document.createElement("style");M.textContent=`body{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}h1,h2,h3,h4,h5,h6,p{margin:0%;padding:0%}.app-container{padding:1.5rem}.stepper-header{display:flex;justify-content:space-between}.step-item{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}.step-item:not(:first-child):before{content:"";background-color:#e2e8f0;position:absolute;width:calc(100% - 2.5rem);height:3px;right:calc(50% + 1.25rem);top:1.125rem;transition:all .2s}.step{width:2.5rem;height:2.5rem;display:flex;align-items:center;justify-content:center;z-index:10;position:relative;border-radius:9999px;font-weight:600;color:#000;transition:all .2s}.step-active{border:1px solid #0284c7;background-color:#0284c7}.step-complete{background-color:#16a34a;color:#fff}.step-error{background-color:#ef4444}.step-finished{background-color:#16a34a}.step-active h2,.step-complete h2,.step-error span,.step-finished h2{color:#fff}.step-default{border:1px solid #d1d5db}.active .step{background-color:#0284c7}.complete .step{background-color:#16a34a}.complete:not(:first-child):before,.active:not(:first-child):before{background-color:#16a34a}.step-text{text-align:center;color:#fff}.step-title{font-size:1rem;color:#111827;font-weight:500;margin-top:1rem}.step-description{font-size:.85rem;color:#4b5563;font-weight:300;margin-top:.5rem}.stepper-content{display:flex;justify-content:center;align-items:center}.stepper-footer{display:flex;justify-content:space-around;align-items:center;padding:1.5rem;padding-block:2rem}.stepper-button{padding:.375rem 2rem;font-size:1rem;border-radius:.375rem;border:1px solid #9ca3af;background-color:transparent;color:inherit;cursor:pointer}.stepper-button-fill{border-color:#0284c7;background-color:#0284c7;color:#fff}
2
2
  /*$vite$:1*/`,document.head.appendChild(M);var S={exports:{}},R={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -15,10 +15,10 @@
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var I;function B(){return I||(I=1,process.env.NODE_ENV!=="production"&&function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case ae:return"Profiler";case se:return"StrictMode";case ue:return"Suspense";case de:return"SuspenseList";case pe:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case oe:return"Portal";case ie:return(e.displayName||"Context")+".Provider";case ce:return(e._context.displayName||"Context")+".Consumer";case le:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fe:return t=e.displayName||null,t!==null?t:r(e.type)||"Memo";case U:t=e._payload,e=e._init;try{return r(e(t))}catch{}}return null}function o(e){return""+e}function s(e){try{o(e);var t=!1}catch{t=!0}if(t){t=console;var a=t.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),o(e)}}function x(e){if(e===w)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===U)return"<...>";try{var t=r(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function c(){var e=O.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function m(e){if(z.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function h(e,t){function a(){W||(W=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}function y(){var e=r(this.type);return J[e]||(J[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function N(e,t,a,d,E,g,A,C){return a=g.ref,e={$$typeof:b,type:e,key:t,props:g,_owner:E},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:y}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:C}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function p(e,t,a,d,E,g,A,C){var f=t.children;if(f!==void 0)if(d)if(he(f)){for(d=0;d<f.length;d++)v(f[d]);Object.freeze&&Object.freeze(f)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(f);if(z.call(t,"key")){f=r(e);var _=Object.keys(t).filter(function(be){return be!=="key"});d=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",X[f+d]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ */var I;function B(){return I||(I=1,process.env.NODE_ENV!=="production"&&function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case ae:return"Profiler";case se:return"StrictMode";case ue:return"Suspense";case de:return"SuspenseList";case pe:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case oe:return"Portal";case ie:return(e.displayName||"Context")+".Provider";case ce:return(e._context.displayName||"Context")+".Consumer";case le:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fe:return t=e.displayName||null,t!==null?t:r(e.type)||"Memo";case U:t=e._payload,e=e._init;try{return r(e(t))}catch{}}return null}function o(e){return""+e}function s(e){try{o(e);var t=!1}catch{t=!0}if(t){t=console;var a=t.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),o(e)}}function x(e){if(e===O)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===U)return"<...>";try{var t=r(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function c(){var e=P.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function m(e){if(z.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function h(e,t){function a(){W||(W=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}function y(){var e=r(this.type);return J[e]||(J[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function N(e,t,a,d,E,g,A,C){return a=g.ref,e={$$typeof:b,type:e,key:t,props:g,_owner:E},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:y}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:C}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function p(e,t,a,d,E,g,A,C){var f=t.children;if(f!==void 0)if(d)if(he(f)){for(d=0;d<f.length;d++)v(f[d]);Object.freeze&&Object.freeze(f)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(f);if(z.call(t,"key")){f=r(e);var _=Object.keys(t).filter(function(be){return be!=="key"});d=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",X[f+d]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
19
19
  let props = %s;
20
20
  <%s {...props} />
21
21
  React keys must be passed directly to JSX without using spread:
22
22
  let props = %s;
23
- <%s key={someKey} {...props} />`,d,f,_,f),X[f+d]=!0)}if(f=null,a!==void 0&&(s(a),f=""+a),m(t)&&(s(t.key),f=""+t.key),"key"in t){a={};for(var F in t)F!=="key"&&(a[F]=t[F])}else a=t;return f&&h(a,typeof e=="function"?e.displayName||e.name||"Unknown":e),N(e,f,g,E,c(),a,A,C)}function v(e){typeof e=="object"&&e!==null&&e.$$typeof===b&&e._store&&(e._store.validated=1)}var u=i,b=Symbol.for("react.transitional.element"),oe=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),se=Symbol.for("react.strict_mode"),ae=Symbol.for("react.profiler"),ce=Symbol.for("react.consumer"),ie=Symbol.for("react.context"),le=Symbol.for("react.forward_ref"),ue=Symbol.for("react.suspense"),de=Symbol.for("react.suspense_list"),fe=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),me=Symbol.for("react.client.reference"),O=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,he=Array.isArray,P=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(e){return e()}};var W,J={},V=u.react_stack_bottom_frame.bind(u,l)(),G=P(x(l)),X={};k.Fragment=w,k.jsx=function(e,t,a,d,E){var g=1e4>O.recentlyCreatedOwnerStacks++;return p(e,t,a,!1,d,E,g?Error("react-stack-top-frame"):V,g?P(x(e)):G)},k.jsxs=function(e,t,a,d,E){var g=1e4>O.recentlyCreatedOwnerStacks++;return p(e,t,a,!0,d,E,g?Error("react-stack-top-frame"):V,g?P(x(e)):G)}}()),k}var D;function Z(){return D||(D=1,process.env.NODE_ENV==="production"?S.exports=H():S.exports=B()),S.exports}var n=Z();const L=i.createContext(void 0),T=()=>{const r=i.useContext(L);if(!r)throw new Error("useMultiStepperForm must be used within a MultiStepperProvider");return r},Q=({children:r,steppers:o})=>{const[s,x]=i.useState(0),[c,l]=i.useState([]);i.useEffect(()=>{if(o.length){const p=[...o];p[0].active=!0,l(p)}},[o.length]);const m=i.useCallback(p=>{l(v=>{const u=[...v];if(p>v.length-1)return v;u[s]&&(u[s]={...u[s],active:!1}),u[p]&&(u[p]={...u[p],active:!0});for(let b=0;b<p;b++)u[b]={...u[b],completed:!0};for(let b=p;b<u.length;b++)u[b]={...u[b],completed:!1};return u}),x(p)},[s]),h=i.useCallback(()=>{s<c.length-1?m(s+1):l(p=>{const v=[...p];return v[s]={...v[s],completed:!0},v})},[s,c.length,m]),y=i.useCallback(()=>{s>0&&m(s-1)},[s,m]),N=i.useMemo(()=>({currentStep:s,steps:c,handleNextStep:h,handlePrevStep:y,updateSteps:m}),[s,c,h,y,m]);return n.jsx(L.Provider,{value:N,children:r})},K=()=>n.jsx("div",{children:"Loading.."}),q=i.memo(K),$=({step:r,index:o})=>{const{steps:s}=T();return s.length?r.loading?n.jsx("div",{className:"step step-loading",children:n.jsx(q,{})}):r.error?n.jsx("div",{className:"step step-error",children:n.jsx("span",{className:"text-white",children:"✗"})}):r.completed?n.jsx("div",{className:"step step-complete",children:n.jsx("span",{className:"text-white",children:"✓"})}):r.finshed?n.jsx("div",{className:"step step-complete",children:r.icon}):r.active?n.jsx("div",{className:"step step-active",children:r.icon??n.jsx("h2",{className:"text-white",children:o})}):n.jsx("div",{className:"step step-default",children:r.icon??n.jsx("h2",{children:o})}):n.jsx(i.Fragment,{})},ee=()=>{const{steps:r}=T();return r.length?n.jsx("div",{className:"app-container",children:n.jsx("ol",{className:"stepper-header",children:r.map((o,s)=>n.jsxs("div",{className:`step-item ${o.active&&"active"} ${o.completed&&"complete"} `,children:[n.jsx($,{index:s+1,step:o}),n.jsxs("div",{className:"step-text",children:[o.title&&n.jsx("h3",{className:"step-title",children:o.title}),o.description&&n.jsx("h3",{className:"step-description",children:o.description})]})]},s))})}):n.jsx(i.Fragment,{})},te=({onClickNext:r})=>{const{handleNextStep:o,handlePrevStep:s,currentStep:x,steps:c}=T(),l=x===c.length-1,m=()=>{c[x].completed||(o(),r())},h=i.useMemo(()=>({button:"stepper-button",fill:"stepper-button-fill"}),[]);return n.jsxs("div",{className:"stepper-footer",children:[n.jsx("button",{type:"button",className:h.button,onClick:s,disabled:x<0,children:"Prev"}),n.jsx("button",{type:"button",className:`${l?`${h.button} ${h.fill}`:h.button}`,onClick:m,children:l?"Finish":"Next"})]})},re=()=>{const{steps:r,currentStep:o}=T();return n.jsx("div",{className:"stepper-content",children:r[o]&&r[o].children&&r[o].children})},ne=({steps:r,onClickNext:o})=>r?n.jsxs(Q,{steppers:r,children:[n.jsx(ee,{}),n.jsx(re,{}),n.jsx(te,{onClickNext:o})]}):n.jsx(n.Fragment,{});j.MultiStepper=ne,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
23
+ <%s key={someKey} {...props} />`,d,f,_,f),X[f+d]=!0)}if(f=null,a!==void 0&&(s(a),f=""+a),m(t)&&(s(t.key),f=""+t.key),"key"in t){a={};for(var F in t)F!=="key"&&(a[F]=t[F])}else a=t;return f&&h(a,typeof e=="function"?e.displayName||e.name||"Unknown":e),N(e,f,g,E,c(),a,A,C)}function v(e){typeof e=="object"&&e!==null&&e.$$typeof===b&&e._store&&(e._store.validated=1)}var u=i,b=Symbol.for("react.transitional.element"),oe=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),se=Symbol.for("react.strict_mode"),ae=Symbol.for("react.profiler"),ce=Symbol.for("react.consumer"),ie=Symbol.for("react.context"),le=Symbol.for("react.forward_ref"),ue=Symbol.for("react.suspense"),de=Symbol.for("react.suspense_list"),fe=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),me=Symbol.for("react.client.reference"),P=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,he=Array.isArray,w=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(e){return e()}};var W,J={},V=u.react_stack_bottom_frame.bind(u,l)(),G=w(x(l)),X={};k.Fragment=O,k.jsx=function(e,t,a,d,E){var g=1e4>P.recentlyCreatedOwnerStacks++;return p(e,t,a,!1,d,E,g?Error("react-stack-top-frame"):V,g?w(x(e)):G)},k.jsxs=function(e,t,a,d,E){var g=1e4>P.recentlyCreatedOwnerStacks++;return p(e,t,a,!0,d,E,g?Error("react-stack-top-frame"):V,g?w(x(e)):G)}}()),k}var D;function Z(){return D||(D=1,process.env.NODE_ENV==="production"?S.exports=H():S.exports=B()),S.exports}var n=Z();const L=i.createContext(void 0),T=()=>{const r=i.useContext(L);if(!r)throw new Error("useMultiStepperForm must be used within a MultiStepperProvider");return r},Q=({children:r,steppers:o})=>{const[s,x]=i.useState(0),[c,l]=i.useState([]);i.useEffect(()=>{if(o.length){const p=[...o];p[0].active=!0,l(p)}},[o.length]);const m=i.useCallback(p=>{l(v=>{const u=[...v];if(p>v.length-1)return v;u[s]&&(u[s]={...u[s],active:!1}),u[p]&&(u[p]={...u[p],active:!0});for(let b=0;b<p;b++)u[b]={...u[b],completed:!0};for(let b=p;b<u.length;b++)u[b]={...u[b],completed:!1};return u}),x(p)},[s]),h=i.useCallback(()=>{s<c.length-1?m(s+1):l(p=>{const v=[...p];return v[s]={...v[s],completed:!0},v})},[s,c.length,m]),y=i.useCallback(()=>{s>0&&m(s-1)},[s,m]),N=i.useMemo(()=>({currentStep:s,steps:c,handleNextStep:h,handlePrevStep:y,updateSteps:m}),[s,c,h,y,m]);return n.jsx(L.Provider,{value:N,children:r})},K=()=>n.jsx("div",{children:"Loading.."}),q=i.memo(K),$=({step:r,index:o})=>{const{steps:s}=T();return s.length?r.loading?n.jsx("div",{className:"step step-loading",children:n.jsx(q,{})}):r.error?n.jsx("div",{className:"step step-error",children:n.jsx("span",{className:"text-white",children:"✗"})}):r.completed?n.jsx("div",{className:"step step-complete",children:n.jsx("span",{className:"text-white",children:"✓"})}):r.finshed?n.jsx("div",{className:"step step-complete",children:r.icon}):r.active?n.jsx("div",{className:"step step-active",children:r.icon??n.jsx("h2",{className:"text-white",children:o})}):n.jsx("div",{className:"step step-default",children:r.icon??n.jsx("h2",{children:o})}):n.jsx(i.Fragment,{})},ee=()=>{const{steps:r}=T();return r.length?n.jsx("div",{className:"app-container",children:n.jsx("ol",{className:"stepper-header",children:r.map((o,s)=>n.jsxs("div",{className:`step-item ${o.active&&"active"} ${o.completed&&"complete"} `,children:[n.jsx($,{index:s+1,step:o}),n.jsxs("div",{className:"step-text",children:[o.title&&n.jsx("h3",{className:"step-title",children:o.title}),o.description&&n.jsx("h3",{className:"step-description",children:o.description})]})]},s))})}):n.jsx(i.Fragment,{})},te=({onClickNext:r})=>{const{handleNextStep:o,handlePrevStep:s,currentStep:x,steps:c}=T(),l=x===c.length-1,m=()=>{c[x].completed||(o(),r())},h=i.useMemo(()=>({button:"stepper-button",fill:"stepper-button-fill"}),[]);return n.jsxs("div",{className:"stepper-footer",children:[n.jsx("button",{type:"button",className:h.button,onClick:s,disabled:x<0,children:"Prev"}),n.jsx("button",{type:"button",className:`${l?`${h.button} ${h.fill}`:h.button}`,onClick:m,children:l?"Finish":"Next"})]})},re=()=>{const{steps:r,currentStep:o}=T();return n.jsx("div",{className:"stepper-content",children:r[o]&&r[o].children&&r[o].children})},ne=({steps:r,onClickNext:o})=>r?n.jsxs(Q,{steppers:r,children:[n.jsx(ee,{}),n.jsx(re,{}),n.jsx(te,{onClickNext:o})]}):n.jsx(n.Fragment,{});j.MultiStepper=ne,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
24
24
  //# sourceMappingURL=multi-stepper.umd.js.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "./dist/multi-stepper.umd.js",
4
4
  "module": "./dist/multi-stepper.es.js",
5
5
  "types": "./dist/index.d.ts",
6
- "version": "1.1.3",
6
+ "version": "1.1.5",
7
7
  "type": "module",
8
8
  "files": [
9
9
  "dist"
@@ -26,7 +26,7 @@
26
26
  "@vitejs/plugin-react-swc": "^3.11.0",
27
27
  "react": "^19.1.0",
28
28
  "react-dom": "^19.1.0",
29
- "reactjs-multi-stepper": "^1.1.2",
29
+ "reactjs-multi-stepper": "^1.1.4",
30
30
  "tailwindcss": "^4.1.11",
31
31
  "vite-plugin-dts": "^4.5.4",
32
32
  "vite-plugin-lib-inject-css": "^2.2.2"