reactjs-multi-stepper 1.3.4 → 1.3.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 +1 -1
- package/dist/{multi-stepper.es.js → index.es.js} +63 -80
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +9 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/types/index.d.ts +54 -0
- package/package.json +39 -41
- package/dist/index.d.ts +0 -1
- package/dist/multi-stepper.umd.js +0 -24
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--color-primary: #0284c7;--color-primary-light: #38bdf8;--color-success: #16a34a;--color-error: #ef4444;--color-text: #111827;--color-text-light: #4b5563;--color-black: #000;--color-white: #fff;--color-border: #d1d5db;--color-border-light: #e2e8f0;--spacing-xs: .375rem;--spacing-sm: .5rem;--spacing-md: 1rem;--spacing-lg: 1.5rem;--spacing-xl: 2rem;--step-size: 2.5rem;--step-font-weight: 600;--step-radius: 50%;--spinner-size: 1.5rem;--spinner-thickness: 3px;--spinner-color: #3b82f6;--spinner-track: #e5e7eb;--spinner-speed: .8s}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-block:var(--spacing-lg);width:100%}.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(:last-child):after{content:"";background-color:var(--color-border-light);position:absolute;width:calc(100% - var(--step-size));height:3px;left:calc(50% + (var(--step-size) / 2));top:calc(var(--step-size) / 2 - .125rem);transition:all .2s}.step{width:var(--step-size);height:var(--step-size);display:flex;align-items:center;justify-content:center;z-index:10;position:relative;border-radius:var(--step-radius);font-weight:var(--step-font-weight);color:var(--color-black);transition:all .2s;border:1px solid var(--color-border)}.step-active{border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-white)}.step-complete{border-color:var(--color-success);background-color:var(--color-success);color:var(--color-white)}.step-finished{background-color:var(--color-success);color:var(--color-white)}.active:not(:last-child):after{background-color:var(--color-border-light)}.complete:not(:last-child):after{background-color:var(--color-success)}.step-title{font-size:1rem;color:var(--color-text);font-weight:500;margin-top:var(--spacing-md)}.step-description{font-size:.85rem;color:var(--color-text-light);font-weight:300;margin-top:var(--spacing-sm)}.stepper-content{display:flex;justify-content:center;align-items:center}.stepper-footer{display:flex;justify-content:space-around;align-items:center;padding:var(--spacing-lg) var(--spacing-xl)}.stepper-button{padding:var(--spacing-xs) var(--spacing-xl);font-size:1rem;border-radius:.375rem;border:1px solid #9ca3af;background-color:transparent;color:inherit;cursor:pointer}.stepper-button-fill{border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-white)}.stepper-button-disabled{opacity:.5;cursor:not-allowed}.test-step{padding:10vh;display:flex;justify-content:center;align-items:center;border-radius:1rem;width:50%;margin-block:2rem}.test-step h3{color:#fff}.step-text{text-align:center}@media
|
|
1
|
+
:root{--color-primary: #0284c7;--color-primary-light: #38bdf8;--color-success: #16a34a;--color-error: #ef4444;--color-text: #111827;--color-text-light: #4b5563;--color-black: #000;--color-white: #fff;--color-border: #d1d5db;--color-border-light: #e2e8f0;--spacing-xs: .375rem;--spacing-sm: .5rem;--spacing-md: 1rem;--spacing-lg: 1.5rem;--spacing-xl: 2rem;--step-size: 2.5rem;--step-font-weight: 600;--step-radius: 50%;--spinner-size: 1.5rem;--spinner-thickness: 3px;--spinner-color: #3b82f6;--spinner-track: #e5e7eb;--spinner-speed: .8s}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-block:var(--spacing-lg);width:100%}.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(:last-child):after{content:"";background-color:var(--color-border-light);position:absolute;width:calc(100% - var(--step-size));height:3px;left:calc(50% + (var(--step-size) / 2));top:calc(var(--step-size) / 2 - .125rem);transition:all .2s}.step{width:var(--step-size);height:var(--step-size);display:flex;align-items:center;justify-content:center;z-index:10;position:relative;border-radius:var(--step-radius);font-weight:var(--step-font-weight);color:var(--color-black);transition:all .2s;border:1px solid var(--color-border)}.step-active{border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-white)}.step-complete{border-color:var(--color-success);background-color:var(--color-success);color:var(--color-white)}.step-finished{background-color:var(--color-success);color:var(--color-white)}.active:not(:last-child):after{background-color:var(--color-border-light)}.complete:not(:last-child):after{background-color:var(--color-success)}.step-title{font-size:1rem;color:var(--color-text);font-weight:500;margin-top:var(--spacing-md)}.step-description{font-size:.85rem;color:var(--color-text-light);font-weight:300;margin-top:var(--spacing-sm)}.stepper-content{display:flex;justify-content:center;align-items:center}.stepper-footer{display:flex;justify-content:space-around;align-items:center;padding:var(--spacing-lg) var(--spacing-xl)}.stepper-button{padding:var(--spacing-xs) var(--spacing-xl);font-size:1rem;border-radius:.375rem;border:1px solid #9ca3af;background-color:transparent;color:inherit;cursor:pointer}.stepper-button-fill{border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-white)}.stepper-button-disabled{opacity:.5;cursor:not-allowed}.test-step{padding:10vh;display:flex;justify-content:center;align-items:center;border-radius:1rem;width:50%;margin-block:2rem}.test-step h3{color:#fff}.step-text{text-align:center}@media(max-width:768px){.stepper-header{padding:0%;margin:0%}}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import z, { createContext as se, useContext as ce,
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @license React
|
|
5
|
-
* react-jsx-runtime.production.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
1
|
+
import z, { createContext as se, useContext as ce, useCallback as h, Fragment as $, useState as U, useEffect as le, useMemo as ie } from "react";
|
|
2
|
+
var P = { exports: {} }, R = {};
|
|
12
3
|
var V;
|
|
13
4
|
function ue() {
|
|
14
5
|
if (V) return R;
|
|
15
6
|
V = 1;
|
|
16
|
-
var n = Symbol.for("react.transitional.element"), u = Symbol.for("react.fragment");
|
|
7
|
+
var n = /* @__PURE__ */ Symbol.for("react.transitional.element"), u = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
17
8
|
function a(t, i, c) {
|
|
18
9
|
var m = null;
|
|
19
10
|
if (c !== void 0 && (m = "" + c), i.key !== void 0 && (m = "" + i.key), "key" in i) {
|
|
@@ -32,18 +23,9 @@ function ue() {
|
|
|
32
23
|
return R.Fragment = u, R.jsx = a, R.jsxs = a, R;
|
|
33
24
|
}
|
|
34
25
|
var j = {};
|
|
35
|
-
/**
|
|
36
|
-
* @license React
|
|
37
|
-
* react-jsx-runtime.development.js
|
|
38
|
-
*
|
|
39
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the MIT license found in the
|
|
42
|
-
* LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/
|
|
44
26
|
var q;
|
|
45
27
|
function fe() {
|
|
46
|
-
return q || (q = 1, process.env.NODE_ENV !== "production" && function() {
|
|
28
|
+
return q || (q = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
29
|
function n(e) {
|
|
48
30
|
if (e == null) return null;
|
|
49
31
|
if (typeof e == "function")
|
|
@@ -237,7 +219,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
237
219
|
function p(e) {
|
|
238
220
|
return typeof e == "object" && e !== null && e.$$typeof === l;
|
|
239
221
|
}
|
|
240
|
-
var b = z, l = Symbol.for("react.transitional.element"), E = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), X = Symbol.for("react.strict_mode"), B = Symbol.for("react.profiler"), H = Symbol.for("react.consumer"), Z = Symbol.for("react.context"), Q = Symbol.for("react.forward_ref"), K = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), te = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), re = Symbol.for("react.activity"), ne = Symbol.for("react.client.reference"), y = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, oe = Array.isArray, w = console.createTask ? console.createTask : function() {
|
|
222
|
+
var b = z, l = /* @__PURE__ */ Symbol.for("react.transitional.element"), E = /* @__PURE__ */ Symbol.for("react.portal"), O = /* @__PURE__ */ Symbol.for("react.fragment"), X = /* @__PURE__ */ Symbol.for("react.strict_mode"), B = /* @__PURE__ */ Symbol.for("react.profiler"), H = /* @__PURE__ */ Symbol.for("react.consumer"), Z = /* @__PURE__ */ Symbol.for("react.context"), Q = /* @__PURE__ */ Symbol.for("react.forward_ref"), K = /* @__PURE__ */ Symbol.for("react.suspense"), ee = /* @__PURE__ */ Symbol.for("react.suspense_list"), te = /* @__PURE__ */ Symbol.for("react.memo"), A = /* @__PURE__ */ Symbol.for("react.lazy"), re = /* @__PURE__ */ Symbol.for("react.activity"), ne = /* @__PURE__ */ Symbol.for("react.client.reference"), y = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, oe = Array.isArray, w = console.createTask ? console.createTask : function() {
|
|
241
223
|
return null;
|
|
242
224
|
};
|
|
243
225
|
b = {
|
|
@@ -270,7 +252,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
270
252
|
f ? w(t(e)) : L
|
|
271
253
|
);
|
|
272
254
|
};
|
|
273
|
-
}()), j;
|
|
255
|
+
})()), j;
|
|
274
256
|
}
|
|
275
257
|
var J;
|
|
276
258
|
function de() {
|
|
@@ -286,58 +268,6 @@ const G = se(
|
|
|
286
268
|
"useMultiStepperForm must be used within a MultiStepperProvider"
|
|
287
269
|
);
|
|
288
270
|
return n;
|
|
289
|
-
}, _e = ({ children: n, steppers: u, options: a }) => {
|
|
290
|
-
const [t, i] = U(0), [c, m] = U([]);
|
|
291
|
-
le(() => {
|
|
292
|
-
if (u.length) {
|
|
293
|
-
const p = [...u];
|
|
294
|
-
p[0].active = !0, m(p);
|
|
295
|
-
}
|
|
296
|
-
}, [u, u.length]);
|
|
297
|
-
const v = h((p) => {
|
|
298
|
-
m((b) => {
|
|
299
|
-
const l = [...b];
|
|
300
|
-
if (p > b.length - 1) return b;
|
|
301
|
-
l[t] && (l[t] = { ...l[t], active: !1 }), l[p] && (l[p] = { ...l[p], active: !0 });
|
|
302
|
-
for (let E = 0; E < p; E++)
|
|
303
|
-
l[E] = { ...l[E], completed: !0 };
|
|
304
|
-
for (let E = p; E < l.length; E++)
|
|
305
|
-
l[E] = { ...l[E], completed: !1 };
|
|
306
|
-
return l;
|
|
307
|
-
}), i(p);
|
|
308
|
-
}, [t]), S = h(() => {
|
|
309
|
-
t < c.length - 1 ? v(t + 1) : m((p) => {
|
|
310
|
-
const b = [...p];
|
|
311
|
-
return b[t] = { ...b[t], completed: !0 }, b;
|
|
312
|
-
});
|
|
313
|
-
}, [t, c.length, v]), T = h(() => {
|
|
314
|
-
t > 0 && v(t - 1);
|
|
315
|
-
}, [t, v]), x = h(
|
|
316
|
-
(p) => {
|
|
317
|
-
m((b) => {
|
|
318
|
-
const l = [...b];
|
|
319
|
-
return l[t] && (l[t] = {
|
|
320
|
-
...l[t],
|
|
321
|
-
active: !1,
|
|
322
|
-
completed: !1
|
|
323
|
-
}, l[t][p] = !0), l;
|
|
324
|
-
});
|
|
325
|
-
},
|
|
326
|
-
[t]
|
|
327
|
-
), k = ie(
|
|
328
|
-
() => ({
|
|
329
|
-
currentStep: t,
|
|
330
|
-
steps: c,
|
|
331
|
-
handleNextStep: S,
|
|
332
|
-
handlePrevStep: T,
|
|
333
|
-
updateSteps: v,
|
|
334
|
-
setStepStatus: x,
|
|
335
|
-
// styles,
|
|
336
|
-
options: a
|
|
337
|
-
}),
|
|
338
|
-
[t, c, S, T, v, x, a]
|
|
339
|
-
);
|
|
340
|
-
return /* @__PURE__ */ o.jsx(G.Provider, { value: k, children: n });
|
|
341
271
|
}, pe = () => {
|
|
342
272
|
const { steps: n, currentStep: u } = g(), a = n?.[u];
|
|
343
273
|
return !a || !a.children ? null : /* @__PURE__ */ o.jsx("div", { className: "stepper-content", children: a.children });
|
|
@@ -395,15 +325,68 @@ const G = se(
|
|
|
395
325
|
t.id ?? i
|
|
396
326
|
);
|
|
397
327
|
}) }) }) : /* @__PURE__ */ o.jsx($, {});
|
|
398
|
-
},
|
|
328
|
+
}, _e = ({
|
|
399
329
|
onClickNext: n
|
|
400
330
|
}) => /* @__PURE__ */ o.jsxs($, { children: [
|
|
401
331
|
/* @__PURE__ */ o.jsx(be, {}),
|
|
402
332
|
/* @__PURE__ */ o.jsx(pe, {}),
|
|
403
333
|
/* @__PURE__ */ o.jsx(me, { onClickNext: n })
|
|
404
|
-
] })
|
|
334
|
+
] }), he = ({ children: n, steppers: u, options: a }) => {
|
|
335
|
+
const [t, i] = U(0), [c, m] = U([]);
|
|
336
|
+
le(() => {
|
|
337
|
+
if (u.length) {
|
|
338
|
+
const p = [...u];
|
|
339
|
+
p[0].active = !0, m(p);
|
|
340
|
+
}
|
|
341
|
+
}, [u, u.length]);
|
|
342
|
+
const v = h((p) => {
|
|
343
|
+
m((b) => {
|
|
344
|
+
const l = [...b];
|
|
345
|
+
if (p > b.length - 1) return b;
|
|
346
|
+
l[t] && (l[t] = { ...l[t], active: !1 }), l[p] && (l[p] = { ...l[p], active: !0 });
|
|
347
|
+
for (let E = 0; E < p; E++)
|
|
348
|
+
l[E] = { ...l[E], completed: !0 };
|
|
349
|
+
for (let E = p; E < l.length; E++)
|
|
350
|
+
l[E] = { ...l[E], completed: !1 };
|
|
351
|
+
return l;
|
|
352
|
+
}), i(p);
|
|
353
|
+
}, [t]), S = h(() => {
|
|
354
|
+
t < c.length - 1 ? v(t + 1) : m((p) => {
|
|
355
|
+
const b = [...p];
|
|
356
|
+
return b[t] = { ...b[t], completed: !0 }, b;
|
|
357
|
+
});
|
|
358
|
+
}, [t, c.length, v]), T = h(() => {
|
|
359
|
+
t > 0 && v(t - 1);
|
|
360
|
+
}, [t, v]), x = h(
|
|
361
|
+
(p) => {
|
|
362
|
+
m((b) => {
|
|
363
|
+
const l = [...b];
|
|
364
|
+
return l[t] && (l[t] = {
|
|
365
|
+
...l[t],
|
|
366
|
+
active: !1,
|
|
367
|
+
completed: !1
|
|
368
|
+
}, l[t][p] = !0), l;
|
|
369
|
+
});
|
|
370
|
+
},
|
|
371
|
+
[t]
|
|
372
|
+
), k = ie(
|
|
373
|
+
() => ({
|
|
374
|
+
currentStep: t,
|
|
375
|
+
steps: c,
|
|
376
|
+
handleNextStep: S,
|
|
377
|
+
handlePrevStep: T,
|
|
378
|
+
updateSteps: v,
|
|
379
|
+
setStepStatus: x,
|
|
380
|
+
// styles,
|
|
381
|
+
options: a
|
|
382
|
+
}),
|
|
383
|
+
[t, c, S, T, v, x, a]
|
|
384
|
+
);
|
|
385
|
+
return /* @__PURE__ */ o.jsx(G.Provider, { value: k, children: n });
|
|
386
|
+
};
|
|
405
387
|
export {
|
|
406
|
-
|
|
407
|
-
|
|
388
|
+
_e as MultiStepper,
|
|
389
|
+
he as MultiStepperProvider,
|
|
408
390
|
g as useMultiStepper
|
|
409
391
|
};
|
|
392
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/hooks/index.ts","../src/components/StepperContent.tsx","../src/components/StepperFooter.tsx","../src/components/StepItem.tsx","../src/components/StepperHeader.tsx","../src/components/MultiStepper.tsx","../src/contexts/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%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)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"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.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { createContext, useContext } from \"react\";\nimport type { MultiStepperType } from \"../types\";\n\n// Multi stepper context\nexport const MultiStepperContext = createContext<MultiStepperType | undefined>(\n undefined\n);\n\n// context consumer hook\nexport const useMultiStepper = () => {\n const context = useContext(MultiStepperContext);\n if (!context)\n throw new Error(\n \"useMultiStepperForm must be used within a MultiStepperProvider\"\n );\n return context;\n};\n","import React from \"react\";\nimport { useMultiStepper } from \"../hooks\";\n\nexport const StepperContent: React.FC = () => {\n const { steps, currentStep } = useMultiStepper();\n\n const current = steps?.[currentStep];\n\n if (!current || !current.children) return null;\n\n return <div className=\"stepper-content\">{current.children}</div>;\n};\n","import React, { useCallback } from 'react';\nimport { useMultiStepper } from '../hooks';\n\ntype StepperFooterProps = {\n onClickNext: () => void\n}\n\nexport const StepperFooter: React.FC<StepperFooterProps> = React.memo(({ onClickNext }) => {\n const { handlePrevStep, currentStep, steps } = useMultiStepper();\n const isLastStep = currentStep === steps.length - 1;\n const isPrevDisabled = currentStep === 0;\n\n const handleNext = useCallback(() => {\n if (!steps[currentStep].completed) {\n onClickNext()\n }\n }, [steps, currentStep, onClickNext])\n\n const handlePrev = useCallback(() => {\n if (!isPrevDisabled) handlePrevStep()\n }, [isPrevDisabled, handlePrevStep])\n\n return <div className=\"stepper-footer\">\n <button\n type=\"button\"\n className={`stepper-button \n ${isPrevDisabled ? 'stepper-button-disbled' : ''}`}\n onClick={handlePrev}\n disabled={currentStep < 0}\n >\n Prev\n </button>\n\n <button\n type=\"button\"\n className={isLastStep ?\n 'stepper-button stepper-button-fill' :\n 'stepper-button'}\n onClick={handleNext}\n >\n {isLastStep ? 'Finish' : 'Next'}\n </button>\n </div>\n})","import React, { Fragment } from 'react';\nimport { useMultiStepper } from '../hooks';\nimport type { StepType } from '../types';\n\ntype StepItemType = {\n step: StepType,\n index: number\n}\n\nexport const Step: React.FC<StepItemType> = ({\n step, index\n}) => {\n const { steps, options } = useMultiStepper()\n if (!steps.length) return <Fragment />\n\n if (step.completed) return <div className='step step-complete'>\n {\n step.icon ? step.icon : options?.completedIcon ??\n <span className='text-white'>✓</span>\n }\n </div>\n\n if (step.active) return <div className='step step-active'>\n {\n step.icon ? step.icon : options?.activeIcon ??\n <h2 className='text-white'>{index}</h2>\n }\n </div>\n\n return (\n <div className={`step step-default`}>\n {step.icon ?? <h2>{index}</h2>}\n </div>\n );\n};\n","import React, { Fragment } from 'react';\nimport { useMultiStepper } from '../hooks';\nimport { Step } from './StepItem';\n\n\nexport const StepperHeader: React.FC = () => {\n const { steps, updateSteps } = useMultiStepper()\n const onClickStep = (index: number) => updateSteps(index);\n if (!steps.length) return <Fragment />\n return (\n <div className='app-container'>\n <ol className='stepper-header'>\n {\n steps.map((step, i) => {\n const isActive = Boolean(step.active);\n const isComplete = Boolean(step.completed);\n\n return (\n <div\n key={step.id ?? i}\n onClick={\n () => onClickStep(i)\n }\n className={`step-item ${isActive ? 'active' : ''} ${isComplete ? 'complete' : ''}`}\n >\n <Step index={i + 1} step={step} />\n <div className=\"step-text\">\n {step.title && <h3 className=\"step-title\">{step.title}</h3>}\n {step.description && <h3 className=\"step-description\">{step.description}</h3>}\n </div>\n </div>\n )\n })\n }\n </ol>\n </div>\n );\n};\n","import React, { Fragment } from 'react';\nimport { StepperContent } from './StepperContent';\nimport { StepperFooter } from './StepperFooter';\nimport { StepperHeader } from './StepperHeader';\n\ntype StepperProps = {\n onClickNext: () => void\n}\n\nexport const MultiStepper: React.FC<StepperProps> = ({\n onClickNext,\n}) => {\n return (\n <Fragment>\n <StepperHeader />\n <StepperContent />\n <StepperFooter onClickNext={onClickNext} />\n </Fragment>\n );\n};\n","import { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { MultiStepperProviderType, StepType } from '../types';\nimport { MultiStepperContext } from \"../hooks\";\n\nexport const MultiStepperProvider: React.FC<MultiStepperProviderType> = ({ children, steppers, options }) => {\n\n const [currentStep, setCurrentStep] = useState(0)\n const [steps, setSteps] = useState<StepType[]>([])\n\n useEffect(() => {\n if (steppers.length) {\n const temp = [...steppers]\n temp[0].active = true\n setSteps(temp)\n }\n }, [steppers, steppers.length])\n\n const updateSteps = useCallback((newStep: number) => {\n setSteps((prev) => {\n const updated = [...prev]\n\n // if more than length of steps array return steps array as its\n if (newStep > prev.length - 1) return prev\n\n // deactivate current step\n if (updated[currentStep])\n updated[currentStep] = { ...updated[currentStep], active: false }\n\n // activate new step\n if (updated[newStep])\n updated[newStep] = { ...updated[newStep], active: true }\n\n // mark prev steps as completed\n for (let i = 0; i < newStep; i++) {\n updated[i] = { ...updated[i], completed: true }\n }\n\n // mark future steps as incompleted\n for (let i = newStep; i < updated.length; i++) {\n updated[i] = { ...updated[i], completed: false }\n }\n\n return updated\n })\n setCurrentStep(newStep)\n }, [currentStep])\n\n const handleNextStep = useCallback(() => {\n if (currentStep < steps.length - 1) updateSteps(currentStep + 1)\n else setSteps((prev) => {\n const updated = [...prev]\n updated[currentStep] = { ...updated[currentStep], completed: true }\n return updated\n })\n }, [currentStep, steps.length, updateSteps])\n\n\n\n const handlePrevStep = useCallback(() => {\n if (currentStep > 0) updateSteps(currentStep - 1)\n }, [currentStep, updateSteps])\n\n\n const setStepStatus = useCallback(\n (status: \"active\" | \"completed\") => {\n setSteps((prev) => {\n const updated = [...prev];\n if (updated[currentStep]) {\n // reset all flags to false first\n updated[currentStep] = {\n ...updated[currentStep],\n active: false,\n completed: false,\n };\n\n // now set the chosen status to true\n updated[currentStep][status] = true;\n }\n return updated;\n });\n },\n [currentStep]\n );\n\n\n\n\n // ⚡️ Memoize the entire context value\n const contextValue = useMemo(\n () => ({\n currentStep,\n steps,\n handleNextStep,\n handlePrevStep,\n updateSteps,\n setStepStatus,\n // styles,\n options\n }),\n [currentStep, steps, handleNextStep, handlePrevStep, updateSteps, setStepStatus, options]\n );\n\n return <MultiStepperContext.Provider value={contextValue}>\n {children}\n </MultiStepperContext.Provider>\n}"],"names":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","MultiStepperContext","createContext","useMultiStepper","context","useContext","StepperContent","steps","currentStep","current","jsx","StepperFooter","onClickNext","handlePrevStep","isLastStep","isPrevDisabled","handleNext","useCallback","handlePrev","jsxs","Step","step","index","options","Fragment","StepperHeader","updateSteps","onClickStep","isActive","isComplete","MultiStepper","MultiStepperProvider","steppers","setCurrentStep","useState","setSteps","useEffect","temp","newStep","prev","updated","i","handleNextStep","setStepStatus","status","contextValue","useMemo"],"mappings":";;;;;;AAWA,MAAIA,IAAqB,uBAAO,IAAI,4BAA4B,GAC9DC,IAAsB,uBAAO,IAAI,gBAAgB;AACnD,WAASC,EAAQC,GAAMC,GAAQC,GAAU;AACvC,QAAIC,IAAM;AAGV,QAFWD,MAAX,WAAwBC,IAAM,KAAKD,IACxBD,EAAO,QAAlB,WAA0BE,IAAM,KAAKF,EAAO,MACxC,SAASA,GAAQ;AACnB,MAAAC,IAAW,CAAA;AACX,eAASE,KAAYH;AACnB,QAAUG,MAAV,UAAuBF,EAASE,CAAQ,IAAIH,EAAOG,CAAQ;AAAA,IACjE,MAAS,CAAAF,IAAWD;AAClB,WAAAA,IAASC,EAAS,KACX;AAAA,MACL,UAAUL;AAAA,MACV,MAAMG;AAAA,MACN,KAAKG;AAAA,MACL,KAAgBF,MAAX,SAAoBA,IAAS;AAAA,MAClC,OAAOC;AAAA;EAEX;AACA,SAAAG,EAAA,WAAmBP,GACnBO,EAAA,MAAcN,GACdM,EAAA,OAAeN;;;;;sBCtBE,QAAQ,IAAI,aAA7B,iBACG,WAAY;AACX,aAASO,EAAyBN,GAAM;AACtC,UAAYA,KAAR,KAAc,QAAO;AACzB,UAAmB,OAAOA,KAAtB;AACF,eAAOA,EAAK,aAAaO,KACrB,OACAP,EAAK,eAAeA,EAAK,QAAQ;AACvC,UAAiB,OAAOA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eof exports=="object"&&typeof module<"u"?c(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],c):(x=typeof globalThis<"u"?globalThis:x||self,c(x["iteratex-component-library"]={},x.React))})(this,(function(x,c){"use strict";var Y=document.createElement("style");Y.textContent=`:root{--color-primary: #0284c7;--color-primary-light: #38bdf8;--color-success: #16a34a;--color-error: #ef4444;--color-text: #111827;--color-text-light: #4b5563;--color-black: #000;--color-white: #fff;--color-border: #d1d5db;--color-border-light: #e2e8f0;--spacing-xs: .375rem;--spacing-sm: .5rem;--spacing-md: 1rem;--spacing-lg: 1.5rem;--spacing-xl: 2rem;--step-size: 2.5rem;--step-font-weight: 600;--step-radius: 50%;--spinner-size: 1.5rem;--spinner-thickness: 3px;--spinner-color: #3b82f6;--spinner-track: #e5e7eb;--spinner-speed: .8s}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-block:var(--spacing-lg);width:100%}.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(:last-child):after{content:"";background-color:var(--color-border-light);position:absolute;width:calc(100% - var(--step-size));height:3px;left:calc(50% + (var(--step-size) / 2));top:calc(var(--step-size) / 2 - .125rem);transition:all .2s}.step{width:var(--step-size);height:var(--step-size);display:flex;align-items:center;justify-content:center;z-index:10;position:relative;border-radius:var(--step-radius);font-weight:var(--step-font-weight);color:var(--color-black);transition:all .2s;border:1px solid var(--color-border)}.step-active{border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-white)}.step-complete{border-color:var(--color-success);background-color:var(--color-success);color:var(--color-white)}.step-finished{background-color:var(--color-success);color:var(--color-white)}.active:not(:last-child):after{background-color:var(--color-border-light)}.complete:not(:last-child):after{background-color:var(--color-success)}.step-title{font-size:1rem;color:var(--color-text);font-weight:500;margin-top:var(--spacing-md)}.step-description{font-size:.85rem;color:var(--color-text-light);font-weight:300;margin-top:var(--spacing-sm)}.stepper-content{display:flex;justify-content:center;align-items:center}.stepper-footer{display:flex;justify-content:space-around;align-items:center;padding:var(--spacing-lg) var(--spacing-xl)}.stepper-button{padding:var(--spacing-xs) var(--spacing-xl);font-size:1rem;border-radius:.375rem;border:1px solid #9ca3af;background-color:transparent;color:inherit;cursor:pointer}.stepper-button-fill{border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-white)}.stepper-button-disabled{opacity:.5;cursor:not-allowed}.test-step{padding:10vh;display:flex;justify-content:center;align-items:center;border-radius:1rem;width:50%;margin-block:2rem}.test-step h3{color:#fff}.step-text{text-align:center}@media(max-width:768px){.stepper-header{padding:0%;margin:0%}}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(Y);var S={exports:{}},E={};var z;function X(){if(z)return E;z=1;var o=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function a(t,u,l){var v=null;if(l!==void 0&&(v=""+l),u.key!==void 0&&(v=""+u.key),"key"in u){l={};for(var b in u)b!=="key"&&(l[b]=u[b])}else l=u;return u=l.ref,{$$typeof:o,type:t,key:v,ref:u!==void 0?u:null,props:l}}return E.Fragment=d,E.jsx=a,E.jsxs=a,E}var k={};var I;function H(){return I||(I=1,process.env.NODE_ENV!=="production"&&(function(){function o(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case oe:return"Profiler";case re:return"StrictMode";case ce:return"Suspense";case le:return"SuspenseList";case ue: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 g:return"Portal";case ae:return e.displayName||"Context";case ne:return(e._context.displayName||"Context")+".Consumer";case se:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ie:return r=e.displayName||null,r!==null?r:o(e.type)||"Memo";case O:r=e._payload,e=e._init;try{return o(e(r))}catch{}}return null}function d(e){return""+e}function a(e){try{d(e);var r=!1}catch{r=!0}if(r){r=console;var s=r.error,p=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",p),d(e)}}function t(e){if(e===N)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var r=o(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function u(){var e=A.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function v(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function b(e,r){function s(){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)",r))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function j(){var e=o(this.type);return V[e]||(V[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 T(e,r,s,p,P,M){var f=s.ref;return e={$$typeof:i,type:e,key:r,props:s,_owner:p},(f!==void 0?f:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:j}):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:P}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:M}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function R(e,r,s,p,P,M){var f=r.children;if(f!==void 0)if(p)if(pe(f)){for(p=0;p<f.length;p++)w(f[p]);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 w(f);if(U.call(r,"key")){f=o(e);var _=Object.keys(r).filter(function(fe){return fe!=="key"});p=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",B[f+p]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
3
|
+
let props = %s;
|
|
4
|
+
<%s {...props} />
|
|
5
|
+
React keys must be passed directly to JSX without using spread:
|
|
6
|
+
let props = %s;
|
|
7
|
+
<%s key={someKey} {...props} />`,p,f,_,f),B[f+p]=!0)}if(f=null,s!==void 0&&(a(s),f=""+s),v(r)&&(a(r.key),f=""+r.key),"key"in r){s={};for(var F in r)F!=="key"&&(s[F]=r[F])}else s=r;return f&&b(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),T(e,f,s,u(),P,M)}function w(e){m(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?m(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function m(e){return typeof e=="object"&&e!==null&&e.$$typeof===i}var h=c,i=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),re=Symbol.for("react.strict_mode"),oe=Symbol.for("react.profiler"),ne=Symbol.for("react.consumer"),ae=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),de=Symbol.for("react.client.reference"),A=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=Object.prototype.hasOwnProperty,pe=Array.isArray,C=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(e){return e()}};var W,V={},J=h.react_stack_bottom_frame.bind(h,l)(),G=C(t(l)),B={};k.Fragment=N,k.jsx=function(e,r,s){var p=1e4>A.recentlyCreatedOwnerStacks++;return R(e,r,s,!1,p?Error("react-stack-top-frame"):J,p?C(t(e)):G)},k.jsxs=function(e,r,s){var p=1e4>A.recentlyCreatedOwnerStacks++;return R(e,r,s,!0,p?Error("react-stack-top-frame"):J,p?C(t(e)):G)}})()),k}var D;function Z(){return D||(D=1,process.env.NODE_ENV==="production"?S.exports=X():S.exports=H()),S.exports}var n=Z();const L=c.createContext(void 0),y=()=>{const o=c.useContext(L);if(!o)throw new Error("useMultiStepperForm must be used within a MultiStepperProvider");return o},Q=()=>{const{steps:o,currentStep:d}=y(),a=o?.[d];return!a||!a.children?null:n.jsx("div",{className:"stepper-content",children:a.children})},K=c.memo(({onClickNext:o})=>{const{handlePrevStep:d,currentStep:a,steps:t}=y(),u=a===t.length-1,l=a===0,v=c.useCallback(()=>{t[a].completed||o()},[t,a,o]),b=c.useCallback(()=>{l||d()},[l,d]);return n.jsxs("div",{className:"stepper-footer",children:[n.jsx("button",{type:"button",className:`stepper-button
|
|
8
|
+
${l?"stepper-button-disbled":""}`,onClick:b,disabled:a<0,children:"Prev"}),n.jsx("button",{type:"button",className:u?"stepper-button stepper-button-fill":"stepper-button",onClick:v,children:u?"Finish":"Next"})]})}),q=({step:o,index:d})=>{const{steps:a,options:t}=y();return a.length?o.completed?n.jsx("div",{className:"step step-complete",children:o.icon?o.icon:t?.completedIcon??n.jsx("span",{className:"text-white",children:"✓"})}):o.active?n.jsx("div",{className:"step step-active",children:o.icon?o.icon:t?.activeIcon??n.jsx("h2",{className:"text-white",children:d})}):n.jsx("div",{className:"step step-default",children:o.icon??n.jsx("h2",{children:d})}):n.jsx(c.Fragment,{})},$=()=>{const{steps:o,updateSteps:d}=y(),a=t=>d(t);return o.length?n.jsx("div",{className:"app-container",children:n.jsx("ol",{className:"stepper-header",children:o.map((t,u)=>{const l=!!t.active,v=!!t.completed;return n.jsxs("div",{onClick:()=>a(u),className:`step-item ${l?"active":""} ${v?"complete":""}`,children:[n.jsx(q,{index:u+1,step:t}),n.jsxs("div",{className:"step-text",children:[t.title&&n.jsx("h3",{className:"step-title",children:t.title}),t.description&&n.jsx("h3",{className:"step-description",children:t.description})]})]},t.id??u)})})}):n.jsx(c.Fragment,{})},ee=({onClickNext:o})=>n.jsxs(c.Fragment,{children:[n.jsx($,{}),n.jsx(Q,{}),n.jsx(K,{onClickNext:o})]}),te=({children:o,steppers:d,options:a})=>{const[t,u]=c.useState(0),[l,v]=c.useState([]);c.useEffect(()=>{if(d.length){const m=[...d];m[0].active=!0,v(m)}},[d,d.length]);const b=c.useCallback(m=>{v(h=>{const i=[...h];if(m>h.length-1)return h;i[t]&&(i[t]={...i[t],active:!1}),i[m]&&(i[m]={...i[m],active:!0});for(let g=0;g<m;g++)i[g]={...i[g],completed:!0};for(let g=m;g<i.length;g++)i[g]={...i[g],completed:!1};return i}),u(m)},[t]),j=c.useCallback(()=>{t<l.length-1?b(t+1):v(m=>{const h=[...m];return h[t]={...h[t],completed:!0},h})},[t,l.length,b]),T=c.useCallback(()=>{t>0&&b(t-1)},[t,b]),R=c.useCallback(m=>{v(h=>{const i=[...h];return i[t]&&(i[t]={...i[t],active:!1,completed:!1},i[t][m]=!0),i})},[t]),w=c.useMemo(()=>({currentStep:t,steps:l,handleNextStep:j,handlePrevStep:T,updateSteps:b,setStepStatus:R,options:a}),[t,l,j,T,b,R,a]);return n.jsx(L.Provider,{value:w,children:o})};x.MultiStepper=ee,x.MultiStepperProvider=te,x.useMultiStepper=y,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));
|
|
9
|
+
//# sourceMappingURL=index.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/hooks/index.ts","../src/components/StepperContent.tsx","../src/components/StepperFooter.tsx","../src/components/StepItem.tsx","../src/components/StepperHeader.tsx","../src/components/MultiStepper.tsx","../src/contexts/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%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)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"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.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { createContext, useContext } from \"react\";\nimport type { MultiStepperType } from \"../types\";\n\n// Multi stepper context\nexport const MultiStepperContext = createContext<MultiStepperType | undefined>(\n undefined\n);\n\n// context consumer hook\nexport const useMultiStepper = () => {\n const context = useContext(MultiStepperContext);\n if (!context)\n throw new Error(\n \"useMultiStepperForm must be used within a MultiStepperProvider\"\n );\n return context;\n};\n","import React from \"react\";\nimport { useMultiStepper } from \"../hooks\";\n\nexport const StepperContent: React.FC = () => {\n const { steps, currentStep } = useMultiStepper();\n\n const current = steps?.[currentStep];\n\n if (!current || !current.children) return null;\n\n return <div className=\"stepper-content\">{current.children}</div>;\n};\n","import React, { useCallback } from 'react';\nimport { useMultiStepper } from '../hooks';\n\ntype StepperFooterProps = {\n onClickNext: () => void\n}\n\nexport const StepperFooter: React.FC<StepperFooterProps> = React.memo(({ onClickNext }) => {\n const { handlePrevStep, currentStep, steps } = useMultiStepper();\n const isLastStep = currentStep === steps.length - 1;\n const isPrevDisabled = currentStep === 0;\n\n const handleNext = useCallback(() => {\n if (!steps[currentStep].completed) {\n onClickNext()\n }\n }, [steps, currentStep, onClickNext])\n\n const handlePrev = useCallback(() => {\n if (!isPrevDisabled) handlePrevStep()\n }, [isPrevDisabled, handlePrevStep])\n\n return <div className=\"stepper-footer\">\n <button\n type=\"button\"\n className={`stepper-button \n ${isPrevDisabled ? 'stepper-button-disbled' : ''}`}\n onClick={handlePrev}\n disabled={currentStep < 0}\n >\n Prev\n </button>\n\n <button\n type=\"button\"\n className={isLastStep ?\n 'stepper-button stepper-button-fill' :\n 'stepper-button'}\n onClick={handleNext}\n >\n {isLastStep ? 'Finish' : 'Next'}\n </button>\n </div>\n})","import React, { Fragment } from 'react';\nimport { useMultiStepper } from '../hooks';\nimport type { StepType } from '../types';\n\ntype StepItemType = {\n step: StepType,\n index: number\n}\n\nexport const Step: React.FC<StepItemType> = ({\n step, index\n}) => {\n const { steps, options } = useMultiStepper()\n if (!steps.length) return <Fragment />\n\n if (step.completed) return <div className='step step-complete'>\n {\n step.icon ? step.icon : options?.completedIcon ??\n <span className='text-white'>✓</span>\n }\n </div>\n\n if (step.active) return <div className='step step-active'>\n {\n step.icon ? step.icon : options?.activeIcon ??\n <h2 className='text-white'>{index}</h2>\n }\n </div>\n\n return (\n <div className={`step step-default`}>\n {step.icon ?? <h2>{index}</h2>}\n </div>\n );\n};\n","import React, { Fragment } from 'react';\nimport { useMultiStepper } from '../hooks';\nimport { Step } from './StepItem';\n\n\nexport const StepperHeader: React.FC = () => {\n const { steps, updateSteps } = useMultiStepper()\n const onClickStep = (index: number) => updateSteps(index);\n if (!steps.length) return <Fragment />\n return (\n <div className='app-container'>\n <ol className='stepper-header'>\n {\n steps.map((step, i) => {\n const isActive = Boolean(step.active);\n const isComplete = Boolean(step.completed);\n\n return (\n <div\n key={step.id ?? i}\n onClick={\n () => onClickStep(i)\n }\n className={`step-item ${isActive ? 'active' : ''} ${isComplete ? 'complete' : ''}`}\n >\n <Step index={i + 1} step={step} />\n <div className=\"step-text\">\n {step.title && <h3 className=\"step-title\">{step.title}</h3>}\n {step.description && <h3 className=\"step-description\">{step.description}</h3>}\n </div>\n </div>\n )\n })\n }\n </ol>\n </div>\n );\n};\n","import React, { Fragment } from 'react';\nimport { StepperContent } from './StepperContent';\nimport { StepperFooter } from './StepperFooter';\nimport { StepperHeader } from './StepperHeader';\n\ntype StepperProps = {\n onClickNext: () => void\n}\n\nexport const MultiStepper: React.FC<StepperProps> = ({\n onClickNext,\n}) => {\n return (\n <Fragment>\n <StepperHeader />\n <StepperContent />\n <StepperFooter onClickNext={onClickNext} />\n </Fragment>\n );\n};\n","import { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { MultiStepperProviderType, StepType } from '../types';\nimport { MultiStepperContext } from \"../hooks\";\n\nexport const MultiStepperProvider: React.FC<MultiStepperProviderType> = ({ children, steppers, options }) => {\n\n const [currentStep, setCurrentStep] = useState(0)\n const [steps, setSteps] = useState<StepType[]>([])\n\n useEffect(() => {\n if (steppers.length) {\n const temp = [...steppers]\n temp[0].active = true\n setSteps(temp)\n }\n }, [steppers, steppers.length])\n\n const updateSteps = useCallback((newStep: number) => {\n setSteps((prev) => {\n const updated = [...prev]\n\n // if more than length of steps array return steps array as its\n if (newStep > prev.length - 1) return prev\n\n // deactivate current step\n if (updated[currentStep])\n updated[currentStep] = { ...updated[currentStep], active: false }\n\n // activate new step\n if (updated[newStep])\n updated[newStep] = { ...updated[newStep], active: true }\n\n // mark prev steps as completed\n for (let i = 0; i < newStep; i++) {\n updated[i] = { ...updated[i], completed: true }\n }\n\n // mark future steps as incompleted\n for (let i = newStep; i < updated.length; i++) {\n updated[i] = { ...updated[i], completed: false }\n }\n\n return updated\n })\n setCurrentStep(newStep)\n }, [currentStep])\n\n const handleNextStep = useCallback(() => {\n if (currentStep < steps.length - 1) updateSteps(currentStep + 1)\n else setSteps((prev) => {\n const updated = [...prev]\n updated[currentStep] = { ...updated[currentStep], completed: true }\n return updated\n })\n }, [currentStep, steps.length, updateSteps])\n\n\n\n const handlePrevStep = useCallback(() => {\n if (currentStep > 0) updateSteps(currentStep - 1)\n }, [currentStep, updateSteps])\n\n\n const setStepStatus = useCallback(\n (status: \"active\" | \"completed\") => {\n setSteps((prev) => {\n const updated = [...prev];\n if (updated[currentStep]) {\n // reset all flags to false first\n updated[currentStep] = {\n ...updated[currentStep],\n active: false,\n completed: false,\n };\n\n // now set the chosen status to true\n updated[currentStep][status] = true;\n }\n return updated;\n });\n },\n [currentStep]\n );\n\n\n\n\n // ⚡️ Memoize the entire context value\n const contextValue = useMemo(\n () => ({\n currentStep,\n steps,\n handleNextStep,\n handlePrevStep,\n updateSteps,\n setStepStatus,\n // styles,\n options\n }),\n [currentStep, steps, handleNextStep, handlePrevStep, updateSteps, setStepStatus, options]\n );\n\n return <MultiStepperContext.Provider value={contextValue}>\n {children}\n </MultiStepperContext.Provider>\n}"],"names":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","MultiStepperContext","createContext","useMultiStepper","context","useContext","StepperContent","steps","currentStep","current","jsx","StepperFooter","onClickNext","handlePrevStep","isLastStep","isPrevDisabled","handleNext","useCallback","handlePrev","jsxs","Step","step","index","options","Fragment","StepperHeader","updateSteps","onClickStep","i","isActive","isComplete","MultiStepper","MultiStepperProvider","steppers","setCurrentStep","useState","setSteps","useEffect","temp","newStep","prev","updated","handleNextStep","setStepStatus","status","contextValue","useMemo"],"mappings":";wGAWA,IAAIA,EAAqB,OAAO,IAAI,4BAA4B,EAC9DC,EAAsB,OAAO,IAAI,gBAAgB,EACnD,SAASC,EAAQC,EAAMC,EAAQC,EAAU,CACvC,IAAIC,EAAM,KAGV,GAFWD,IAAX,SAAwBC,EAAM,GAAKD,GACxBD,EAAO,MAAlB,SAA0BE,EAAM,GAAKF,EAAO,KACxC,QAASA,EAAQ,CACnBC,EAAW,CAAA,EACX,QAASE,KAAYH,EACTG,IAAV,QAAuBF,EAASE,CAAQ,EAAIH,EAAOG,CAAQ,EACjE,MAASF,EAAWD,EAClB,OAAAA,EAASC,EAAS,IACX,CACL,SAAUL,EACV,KAAMG,EACN,IAAKG,EACL,IAAgBF,IAAX,OAAoBA,EAAS,KAClC,MAAOC,EAEX,CACA,OAAAG,EAAA,SAAmBP,EACnBO,EAAA,IAAcN,EACdM,EAAA,KAAeN,+CCtBE,QAAQ,IAAI,WAA7B,eACG,UAAY,CACX,SAASO,EAAyBN,EAAM,CACtC,GAAYA,GAAR,KAAc,OAAO,KACzB,GAAmB,OAAOA,GAAtB,WACF,OAAOA,EAA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iBzB,EAAAA,YAAY,IAAM,CACjCT,EAAcD,EAAM,OAAS,EAAGmB,EAAYlB,EAAc,CAAC,EAC1D4B,EAAUI,GAAS,CACpB,MAAMC,EAAU,CAAC,GAAGD,CAAI,EACxB,OAAAC,EAAQjC,CAAW,EAAI,CAAE,GAAGiC,EAAQjC,CAAW,EAAG,UAAW,EAAA,EACtDiC,CACX,CAAC,CACL,EAAG,CAACjC,EAAaD,EAAM,OAAQmB,CAAW,CAAC,EAIrCb,EAAiBI,EAAAA,YAAY,IAAM,CACjCT,EAAc,GAAGkB,EAAYlB,EAAc,CAAC,CACpD,EAAG,CAACA,EAAakB,CAAW,CAAC,EAGvBiB,EAAgB1B,EAAAA,YACjB2B,GAAmC,CAChCR,EAAUI,GAAS,CACf,MAAMC,EAAU,CAAC,GAAGD,CAAI,EACxB,OAAIC,EAAQjC,CAAW,IAEnBiC,EAAQjC,CAAW,EAAI,CACnB,GAAGiC,EAAQjC,CAAW,EACtB,OAAQ,GACR,UAAW,EAAA,EAIfiC,EAAQjC,CAAW,EAAEoC,CAAM,EAAI,IAE5BH,CACX,CAAC,CACL,EACA,CAACjC,CAAW,CAAA,EAOVqC,EAAeC,EAAAA,QACjB,KAAO,CACH,YAAAtC,EACA,MAAAD,EACA,eAAAmC,EACA,eAAA7B,EACA,YAAAa,EACA,cAAAiB,EAEA,QAAApB,CAAA,GAEJ,CAACf,EAAaD,EAAOmC,EAAgB7B,EAAgBa,EAAaiB,EAAepB,CAAO,CAAA,EAG5F,aAAQtB,EAAoB,SAApB,CAA6B,MAAO4C,EACvC,SAAA/D,EACL,CACJ","x_google_ignoreList":[0,1,2]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
export declare const MultiStepper: default_2.FC<StepperProps>;
|
|
5
|
+
|
|
6
|
+
export declare const MultiStepperProvider: React.FC<MultiStepperProviderType>;
|
|
7
|
+
|
|
8
|
+
export declare type MultiStepperProviderType = {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
steppers: StepType[];
|
|
11
|
+
options?: OptionsType;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export declare type MultiStepperType = {
|
|
15
|
+
currentStep: number;
|
|
16
|
+
steps: StepType[];
|
|
17
|
+
handleNextStep: () => void;
|
|
18
|
+
handlePrevStep: () => void;
|
|
19
|
+
updateSteps: (newStep: number) => void;
|
|
20
|
+
setStepStatus: (status: "active" | "completed") => void;
|
|
21
|
+
options?: OptionsType;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
declare type OptionsType = {
|
|
25
|
+
completedIcon?: ReactNode;
|
|
26
|
+
activeIcon?: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
declare type StepperProps = {
|
|
30
|
+
onClickNext: () => void;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export declare type StepStyleType = {
|
|
34
|
+
textColor?: string;
|
|
35
|
+
activeTextColor?: string;
|
|
36
|
+
bgColor?: string;
|
|
37
|
+
activeBgColor?: string;
|
|
38
|
+
completedBgColor?: string;
|
|
39
|
+
completedTextColor?: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export declare type StepType = {
|
|
43
|
+
id?: number;
|
|
44
|
+
title?: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
icon?: ReactNode;
|
|
47
|
+
active?: boolean;
|
|
48
|
+
completed?: boolean;
|
|
49
|
+
children?: ReactNode;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export declare const useMultiStepper: () => MultiStepperType;
|
|
53
|
+
|
|
54
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,65 +1,63 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactjs-multi-stepper",
|
|
3
|
-
"
|
|
4
|
-
"module": "./dist/multi-stepper.es.js",
|
|
5
|
-
"types": "./dist/index.d.ts",
|
|
6
|
-
"version": "1.3.4",
|
|
3
|
+
"version": "1.3.5",
|
|
7
4
|
"type": "module",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/types/index.d.ts",
|
|
8
|
+
"import": "./dist/index.es.js",
|
|
9
|
+
"require": "./dist/index.umd.js"
|
|
10
|
+
},
|
|
11
|
+
"./dist/index.css": "./dist/index.css",
|
|
12
|
+
"./style.css": "./dist/index.css"
|
|
10
13
|
},
|
|
14
|
+
"style": "./dist/index.css",
|
|
11
15
|
"files": [
|
|
12
16
|
"dist",
|
|
13
17
|
"assets",
|
|
14
18
|
"README.md",
|
|
15
19
|
"LICENSE"
|
|
16
20
|
],
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"import": "./dist/multi-stepper.es.js",
|
|
20
|
-
"require": "./dist/multi-stepper.umd.js",
|
|
21
|
-
"types": "./dist/index.d.ts"
|
|
22
|
-
}
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"dev": "vite",
|
|
26
26
|
"build": "tsc -b && vite build",
|
|
27
27
|
"lint": "eslint .",
|
|
28
|
-
"preview": "vite preview",
|
|
29
28
|
"test": "vitest",
|
|
30
|
-
"test:watch": "vitest --watch",
|
|
31
29
|
"test:coverage": "vitest run --coverage",
|
|
32
|
-
"typecheck": "tsc --noEmit"
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"preview": "vite preview"
|
|
33
32
|
},
|
|
34
33
|
"dependencies": {
|
|
35
|
-
"
|
|
36
|
-
"react": "^19.2.0",
|
|
37
|
-
"react-
|
|
38
|
-
"vite-plugin-dts": "^4.5.4",
|
|
39
|
-
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
34
|
+
"react": "^18.0.0 || ^19.2.0",
|
|
35
|
+
"react-dom": "^18.0.0 || ^19.2.0",
|
|
36
|
+
"react-multi-stepper": "file:react-multi-stepper-1.3.5.tgz"
|
|
40
37
|
},
|
|
41
38
|
"devDependencies": {
|
|
42
|
-
"@eslint/js": "^9.
|
|
43
|
-
"@testing-library/jest-dom": "^6.
|
|
44
|
-
"@testing-library/react": "^16.3.
|
|
45
|
-
"@
|
|
46
|
-
"@types/
|
|
47
|
-
"@types/react": "^19.2.4",
|
|
39
|
+
"@eslint/js": "^9.39.1",
|
|
40
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
41
|
+
"@testing-library/react": "^16.3.2",
|
|
42
|
+
"@types/node": "^25.1.0",
|
|
43
|
+
"@types/react": "^19.2.5",
|
|
48
44
|
"@types/react-dom": "^19.2.3",
|
|
49
|
-
"@vitejs/plugin-react": "^
|
|
50
|
-
"
|
|
51
|
-
"eslint": "^
|
|
52
|
-
"eslint-plugin-react-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
45
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
46
|
+
"eslint": "^9.39.1",
|
|
47
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
48
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
49
|
+
"globals": "^16.5.0",
|
|
50
|
+
"typescript": "^5.9.3",
|
|
51
|
+
"vite": "^7.2.4",
|
|
52
|
+
"vite-plugin-dts": "^4.5.4",
|
|
53
|
+
"vitest": "^4.0.18"
|
|
54
|
+
},
|
|
55
|
+
"repository": {
|
|
56
|
+
"url": "https://github.com/UppiliSrinivas/react-stepper/tree/multi-stepper"
|
|
60
57
|
},
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
"license": "ISC",
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"react": "^18.0.0 || ^19.2.0",
|
|
61
|
+
"react-dom": "^18.0.0 || ^19.2.0"
|
|
62
|
+
}
|
|
65
63
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
(function(x,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],c):(x=typeof globalThis<"u"?globalThis:x||self,c(x["multi-stepper"]={},x.React))})(this,function(x,c){"use strict";var Y=document.createElement("style");Y.textContent=`:root{--color-primary: #0284c7;--color-primary-light: #38bdf8;--color-success: #16a34a;--color-error: #ef4444;--color-text: #111827;--color-text-light: #4b5563;--color-black: #000;--color-white: #fff;--color-border: #d1d5db;--color-border-light: #e2e8f0;--spacing-xs: .375rem;--spacing-sm: .5rem;--spacing-md: 1rem;--spacing-lg: 1.5rem;--spacing-xl: 2rem;--step-size: 2.5rem;--step-font-weight: 600;--step-radius: 50%;--spinner-size: 1.5rem;--spinner-thickness: 3px;--spinner-color: #3b82f6;--spinner-track: #e5e7eb;--spinner-speed: .8s}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-block:var(--spacing-lg);width:100%}.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(:last-child):after{content:"";background-color:var(--color-border-light);position:absolute;width:calc(100% - var(--step-size));height:3px;left:calc(50% + (var(--step-size) / 2));top:calc(var(--step-size) / 2 - .125rem);transition:all .2s}.step{width:var(--step-size);height:var(--step-size);display:flex;align-items:center;justify-content:center;z-index:10;position:relative;border-radius:var(--step-radius);font-weight:var(--step-font-weight);color:var(--color-black);transition:all .2s;border:1px solid var(--color-border)}.step-active{border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-white)}.step-complete{border-color:var(--color-success);background-color:var(--color-success);color:var(--color-white)}.step-finished{background-color:var(--color-success);color:var(--color-white)}.active:not(:last-child):after{background-color:var(--color-border-light)}.complete:not(:last-child):after{background-color:var(--color-success)}.step-title{font-size:1rem;color:var(--color-text);font-weight:500;margin-top:var(--spacing-md)}.step-description{font-size:.85rem;color:var(--color-text-light);font-weight:300;margin-top:var(--spacing-sm)}.stepper-content{display:flex;justify-content:center;align-items:center}.stepper-footer{display:flex;justify-content:space-around;align-items:center;padding:var(--spacing-lg) var(--spacing-xl)}.stepper-button{padding:var(--spacing-xs) var(--spacing-xl);font-size:1rem;border-radius:.375rem;border:1px solid #9ca3af;background-color:transparent;color:inherit;cursor:pointer}.stepper-button-fill{border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-white)}.stepper-button-disabled{opacity:.5;cursor:not-allowed}.test-step{padding:10vh;display:flex;justify-content:center;align-items:center;border-radius:1rem;width:50%;margin-block:2rem}.test-step h3{color:#fff}.step-text{text-align:center}@media (max-width: 768px){.stepper-header{padding:0%;margin:0%}}
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(Y);var S={exports:{}},E={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var z;function X(){if(z)return E;z=1;var o=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function a(t,u,l){var v=null;if(l!==void 0&&(v=""+l),u.key!==void 0&&(v=""+u.key),"key"in u){l={};for(var b in u)b!=="key"&&(l[b]=u[b])}else l=u;return u=l.ref,{$$typeof:o,type:t,key:v,ref:u!==void 0?u:null,props:l}}return E.Fragment=d,E.jsx=a,E.jsxs=a,E}var k={};/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react-jsx-runtime.development.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var I;function H(){return I||(I=1,process.env.NODE_ENV!=="production"&&function(){function o(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case oe:return"Profiler";case re:return"StrictMode";case ce:return"Suspense";case le:return"SuspenseList";case ue: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 g:return"Portal";case ae:return e.displayName||"Context";case ne:return(e._context.displayName||"Context")+".Consumer";case se:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ie:return r=e.displayName||null,r!==null?r:o(e.type)||"Memo";case O:r=e._payload,e=e._init;try{return o(e(r))}catch{}}return null}function d(e){return""+e}function a(e){try{d(e);var r=!1}catch{r=!0}if(r){r=console;var s=r.error,p=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",p),d(e)}}function t(e){if(e===N)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var r=o(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function u(){var e=A.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function v(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function b(e,r){function s(){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)",r))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function j(){var e=o(this.type);return V[e]||(V[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 T(e,r,s,p,P,M){var f=s.ref;return e={$$typeof:i,type:e,key:r,props:s,_owner:p},(f!==void 0?f:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:j}):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:P}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:M}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function R(e,r,s,p,P,M){var f=r.children;if(f!==void 0)if(p)if(pe(f)){for(p=0;p<f.length;p++)w(f[p]);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 w(f);if(U.call(r,"key")){f=o(e);var _=Object.keys(r).filter(function(fe){return fe!=="key"});p=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",B[f+p]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
19
|
-
let props = %s;
|
|
20
|
-
<%s {...props} />
|
|
21
|
-
React keys must be passed directly to JSX without using spread:
|
|
22
|
-
let props = %s;
|
|
23
|
-
<%s key={someKey} {...props} />`,p,f,_,f),B[f+p]=!0)}if(f=null,s!==void 0&&(a(s),f=""+s),v(r)&&(a(r.key),f=""+r.key),"key"in r){s={};for(var F in r)F!=="key"&&(s[F]=r[F])}else s=r;return f&&b(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),T(e,f,s,u(),P,M)}function w(e){m(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?m(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function m(e){return typeof e=="object"&&e!==null&&e.$$typeof===i}var h=c,i=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),re=Symbol.for("react.strict_mode"),oe=Symbol.for("react.profiler"),ne=Symbol.for("react.consumer"),ae=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),de=Symbol.for("react.client.reference"),A=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=Object.prototype.hasOwnProperty,pe=Array.isArray,C=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(e){return e()}};var W,V={},J=h.react_stack_bottom_frame.bind(h,l)(),G=C(t(l)),B={};k.Fragment=N,k.jsx=function(e,r,s){var p=1e4>A.recentlyCreatedOwnerStacks++;return R(e,r,s,!1,p?Error("react-stack-top-frame"):J,p?C(t(e)):G)},k.jsxs=function(e,r,s){var p=1e4>A.recentlyCreatedOwnerStacks++;return R(e,r,s,!0,p?Error("react-stack-top-frame"):J,p?C(t(e)):G)}}()),k}var D;function Z(){return D||(D=1,process.env.NODE_ENV==="production"?S.exports=X():S.exports=H()),S.exports}var n=Z();const L=c.createContext(void 0),y=()=>{const o=c.useContext(L);if(!o)throw new Error("useMultiStepperForm must be used within a MultiStepperProvider");return o},Q=({children:o,steppers:d,options:a})=>{const[t,u]=c.useState(0),[l,v]=c.useState([]);c.useEffect(()=>{if(d.length){const m=[...d];m[0].active=!0,v(m)}},[d,d.length]);const b=c.useCallback(m=>{v(h=>{const i=[...h];if(m>h.length-1)return h;i[t]&&(i[t]={...i[t],active:!1}),i[m]&&(i[m]={...i[m],active:!0});for(let g=0;g<m;g++)i[g]={...i[g],completed:!0};for(let g=m;g<i.length;g++)i[g]={...i[g],completed:!1};return i}),u(m)},[t]),j=c.useCallback(()=>{t<l.length-1?b(t+1):v(m=>{const h=[...m];return h[t]={...h[t],completed:!0},h})},[t,l.length,b]),T=c.useCallback(()=>{t>0&&b(t-1)},[t,b]),R=c.useCallback(m=>{v(h=>{const i=[...h];return i[t]&&(i[t]={...i[t],active:!1,completed:!1},i[t][m]=!0),i})},[t]),w=c.useMemo(()=>({currentStep:t,steps:l,handleNextStep:j,handlePrevStep:T,updateSteps:b,setStepStatus:R,options:a}),[t,l,j,T,b,R,a]);return n.jsx(L.Provider,{value:w,children:o})},K=()=>{const{steps:o,currentStep:d}=y(),a=o?.[d];return!a||!a.children?null:n.jsx("div",{className:"stepper-content",children:a.children})},q=c.memo(({onClickNext:o})=>{const{handlePrevStep:d,currentStep:a,steps:t}=y(),u=a===t.length-1,l=a===0,v=c.useCallback(()=>{t[a].completed||o()},[t,a,o]),b=c.useCallback(()=>{l||d()},[l,d]);return n.jsxs("div",{className:"stepper-footer",children:[n.jsx("button",{type:"button",className:`stepper-button
|
|
24
|
-
${l?"stepper-button-disbled":""}`,onClick:b,disabled:a<0,children:"Prev"}),n.jsx("button",{type:"button",className:u?"stepper-button stepper-button-fill":"stepper-button",onClick:v,children:u?"Finish":"Next"})]})}),$=({step:o,index:d})=>{const{steps:a,options:t}=y();return a.length?o.completed?n.jsx("div",{className:"step step-complete",children:o.icon?o.icon:t?.completedIcon??n.jsx("span",{className:"text-white",children:"✓"})}):o.active?n.jsx("div",{className:"step step-active",children:o.icon?o.icon:t?.activeIcon??n.jsx("h2",{className:"text-white",children:d})}):n.jsx("div",{className:"step step-default",children:o.icon??n.jsx("h2",{children:d})}):n.jsx(c.Fragment,{})},ee=()=>{const{steps:o,updateSteps:d}=y(),a=t=>d(t);return o.length?n.jsx("div",{className:"app-container",children:n.jsx("ol",{className:"stepper-header",children:o.map((t,u)=>{const l=!!t.active,v=!!t.completed;return n.jsxs("div",{onClick:()=>a(u),className:`step-item ${l?"active":""} ${v?"complete":""}`,children:[n.jsx($,{index:u+1,step:t}),n.jsxs("div",{className:"step-text",children:[t.title&&n.jsx("h3",{className:"step-title",children:t.title}),t.description&&n.jsx("h3",{className:"step-description",children:t.description})]})]},t.id??u)})})}):n.jsx(c.Fragment,{})},te=({onClickNext:o})=>n.jsxs(c.Fragment,{children:[n.jsx(ee,{}),n.jsx(K,{}),n.jsx(q,{onClickNext:o})]});x.MultiStepper=te,x.MultiStepperProvider=Q,x.useMultiStepper=y,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|