@elliemae/ds-wizard 3.5.0-rc.7 → 3.5.1-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/WizardStep.js +18 -5
- package/dist/cjs/WizardStep.js.map +2 -2
- package/dist/cjs/WizardSteps.js +7 -6
- package/dist/cjs/WizardSteps.js.map +2 -2
- package/dist/esm/WizardStep.js +18 -5
- package/dist/esm/WizardStep.js.map +2 -2
- package/dist/esm/WizardSteps.js +7 -6
- package/dist/esm/WizardSteps.js.map +1 -1
- package/package.json +4 -4
package/dist/cjs/WizardStep.js
CHANGED
|
@@ -29,7 +29,8 @@ __export(WizardStep_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(WizardStep_exports);
|
|
31
31
|
var React = __toESM(require("react"));
|
|
32
|
-
var
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
var import_react = require("react");
|
|
33
34
|
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
34
35
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
35
36
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
@@ -45,7 +46,7 @@ const BulletWrapper = (0, import_ds_classnames.aggregatedClasses)("div")(import_
|
|
|
45
46
|
function WizardStep({
|
|
46
47
|
label = "",
|
|
47
48
|
icon = null,
|
|
48
|
-
iconCompleted = /* @__PURE__ */
|
|
49
|
+
iconCompleted = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.Checkmark, {}),
|
|
49
50
|
iconActive = null,
|
|
50
51
|
active = false,
|
|
51
52
|
completed = false,
|
|
@@ -64,9 +65,21 @@ function WizardStep({
|
|
|
64
65
|
}) : currentIcon || index + 1,
|
|
65
66
|
[currentIcon]
|
|
66
67
|
);
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
-
classProps: { active, completed }
|
|
69
|
-
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Item, {
|
|
69
|
+
classProps: { active, completed },
|
|
70
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Wrapper, {
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BulletWrapper, {
|
|
73
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Bullet, {
|
|
74
|
+
children: iconWithOptions
|
|
75
|
+
})
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, {
|
|
78
|
+
children: label
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
})
|
|
82
|
+
});
|
|
70
83
|
}
|
|
71
84
|
const wizzardStepProps = {
|
|
72
85
|
label: import_ds_utilities.PropTypes.string.description("Step label"),
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/WizardStep.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable indent */\nimport React, { cloneElement, useMemo, isValidElement } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { describe, PropTypes, get } from '@elliemae/ds-utilities';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport { indicatorItemBlockName } from './blockNames';\n\nconst Item = aggregatedClasses('div')(`${indicatorItemBlockName}`, null, ({ active, completed }) => ({\n active,\n completed,\n}));\nconst Wrapper = aggregatedClasses('div')(`${indicatorItemBlockName}-wrapper`);\nconst Label = aggregatedClasses('span')(indicatorItemBlockName, 'label');\nconst Bullet = aggregatedClasses('div')(indicatorItemBlockName, 'bullet');\nconst BulletWrapper = aggregatedClasses('div')(indicatorItemBlockName, 'bullet-wrapper');\n\nfunction WizardStep({\n label = '',\n icon = null,\n iconCompleted = <Checkmark />,\n iconActive = null,\n active = false,\n completed = false,\n index = 0,\n}) {\n const currentIcon =\n useMemo(() => {\n if (active) return iconActive;\n if (completed) return iconCompleted;\n return icon;\n }, [active, completed]) || icon;\n\n const iconWithOptions = useMemo(\n () =>\n isValidElement(currentIcon)\n ? cloneElement(currentIcon, {\n color: get(currentIcon, ['props', 'color']) || ['brand-primary', completed ? 600 : 500],\n })\n : currentIcon || index + 1,\n [currentIcon],\n );\n\n return (\n <Item classProps={{ active, completed }}>\n <Wrapper>\n <BulletWrapper>\n <Bullet>{iconWithOptions}</Bullet>\n </BulletWrapper>\n <Label>{label}</Label>\n </Wrapper>\n </Item>\n );\n}\n\nconst wizzardStepProps = {\n label: PropTypes.string.description('Step label'),\n icon: PropTypes.oneOfType([PropTypes.element, PropTypes.string]).description('Default icon or number'),\n iconCompleted: PropTypes.element.description('Icon when the step is completed').defaultValue(Checkmark),\n iconActive: PropTypes.element.description('Icon when the step is active'),\n active: PropTypes.bool.description('Whether the step is active or not').defaultValue(false),\n completed: PropTypes.bool.description('Whether the step is completed or not').defaultValue(false),\n index: PropTypes.number.description('Current item index'),\n};\n\nWizardStep.propTypes = wizzardStepProps;\nWizardStep.displayName = 'WizardStep';\nconst WizzardStepWithSchema = describe(WizardStep);\nWizzardStepWithSchema.propTypes = wizzardStepProps;\n\nexport { WizzardStepWithSchema };\nexport default WizardStep;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,mBAA6D;AAC7D,2BAAkC;AAClC,0BAAyC;AACzC,sBAA0B;AAC1B,wBAAuC;AAEvC,MAAM,WAAO,wCAAkB,KAAK,EAAE,GAAG,4CAA0B,MAAM,CAAC,EAAE,QAAQ,UAAU,OAAO;AAAA,EACnG;AAAA,EACA;AACF,EAAE;AACF,MAAM,cAAU,wCAAkB,KAAK,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8BAA8B;AAAA,EACxE,QAAQ,8BAAU,KAAK,YAAY,mCAAmC,EAAE,aAAa,KAAK;AAAA,EAC1F,WAAW,8BAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,KAAK;AAAA,EAChG,OAAO,8BAAU,OAAO,YAAY,oBAAoB;AAC1D;AAEA,WAAW,YAAY;AACvB,WAAW,cAAc;AACzB,MAAM,4BAAwB,8BAAS,UAAU;AACjD,sBAAsB,YAAY;AAGlC,IAAO,qBAAQ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/cjs/WizardSteps.js
CHANGED
|
@@ -29,6 +29,7 @@ __export(WizardSteps_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(WizardSteps_exports);
|
|
31
31
|
var React = __toESM(require("react"));
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
33
|
var import_react = __toESM(require("react"));
|
|
33
34
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
34
35
|
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
@@ -42,18 +43,18 @@ function WizardSteps({ current = 0, steps, children, ...otherProps }) {
|
|
|
42
43
|
active: current === index,
|
|
43
44
|
completed: index < current
|
|
44
45
|
});
|
|
45
|
-
return steps ? steps.map((step, index) => /* @__PURE__ */
|
|
46
|
-
key: index,
|
|
46
|
+
return steps ? steps.map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_WizardStep.default, {
|
|
47
47
|
...step,
|
|
48
48
|
...mergeStepProps(step, index)
|
|
49
|
-
})) : import_react.default.Children.map(
|
|
49
|
+
}, index)) : import_react.default.Children.map(
|
|
50
50
|
children,
|
|
51
51
|
(item, index) => (0, import_react.cloneElement)(item, mergeStepProps(item, index))
|
|
52
52
|
);
|
|
53
53
|
}, [current, children]);
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
...otherProps
|
|
56
|
-
|
|
54
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StepsWrapper, {
|
|
55
|
+
...otherProps,
|
|
56
|
+
children: items
|
|
57
|
+
});
|
|
57
58
|
}
|
|
58
59
|
WizardSteps.Item = import_WizardStep.default;
|
|
59
60
|
const wizzardProps = {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/WizardSteps.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable indent */\n/* eslint-disable react/no-array-index-key */\nimport React, { cloneElement, useMemo } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport WizardStep from './WizardStep';\nimport { indicatorBlockName } from './blockNames';\n\nconst StepsWrapper = aggregatedClasses('div')(indicatorBlockName);\n\nfunction WizardSteps({ current = 0, steps, children, ...otherProps }) {\n const items = useMemo(() => {\n const mergeStepProps = (step, index) => ({\n index,\n active: current === index,\n completed: index < current,\n });\n\n return steps\n ? steps.map((step, index) => (\n <WizardStep key={index} {...step} {...mergeStepProps(step, index)} />\n ))\n : React.Children.map(children, (item, index) =>\n cloneElement(item, mergeStepProps(item, index)),\n );\n }, [current, children]);\n\n return <StepsWrapper {...otherProps}>{items}</StepsWrapper>;\n}\n\nWizardSteps.Item = WizardStep;\n\nconst wizzardProps = {\n current: PropTypes.number\n .description('Current active state index')\n .defaultValue(0),\n steps: PropTypes.arrayOf(PropTypes.shape({}))\n .description('Array of steps objects')\n .defaultValue([]).isRequired,\n children: PropTypes.arrayOf(PropTypes.instanceOf(WizardStep)).description(\n 'List of WizardStep components',\n ),\n};\n\nWizardSteps.propTypes = wizzardProps;\nWizardSteps.displayName = 'WizardSteps';\nconst WizzardWithSchema = describe(WizardSteps);\nWizzardWithSchema.propTypes = wizzardProps;\n\nexport { WizzardWithSchema };\nexport default WizardSteps;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;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YAAY,cAAc;AAC1B,MAAM,wBAAoB,8BAAS,WAAW;AAC9C,kBAAkB,YAAY;AAG9B,IAAO,sBAAQ;",
|
|
6
|
+
"names": ["WizardStep", "React"]
|
|
7
7
|
}
|
package/dist/esm/WizardStep.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cloneElement, useMemo, isValidElement } from "react";
|
|
3
4
|
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
4
5
|
import { describe, PropTypes, get } from "@elliemae/ds-utilities";
|
|
5
6
|
import { Checkmark } from "@elliemae/ds-icons";
|
|
@@ -15,7 +16,7 @@ const BulletWrapper = aggregatedClasses("div")(indicatorItemBlockName, "bullet-w
|
|
|
15
16
|
function WizardStep({
|
|
16
17
|
label = "",
|
|
17
18
|
icon = null,
|
|
18
|
-
iconCompleted = /* @__PURE__ */
|
|
19
|
+
iconCompleted = /* @__PURE__ */ jsx(Checkmark, {}),
|
|
19
20
|
iconActive = null,
|
|
20
21
|
active = false,
|
|
21
22
|
completed = false,
|
|
@@ -34,9 +35,21 @@ function WizardStep({
|
|
|
34
35
|
}) : currentIcon || index + 1,
|
|
35
36
|
[currentIcon]
|
|
36
37
|
);
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
classProps: { active, completed }
|
|
39
|
-
|
|
38
|
+
return /* @__PURE__ */ jsx(Item, {
|
|
39
|
+
classProps: { active, completed },
|
|
40
|
+
children: /* @__PURE__ */ jsxs(Wrapper, {
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsx(BulletWrapper, {
|
|
43
|
+
children: /* @__PURE__ */ jsx(Bullet, {
|
|
44
|
+
children: iconWithOptions
|
|
45
|
+
})
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ jsx(Label, {
|
|
48
|
+
children: label
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
})
|
|
52
|
+
});
|
|
40
53
|
}
|
|
41
54
|
const wizzardStepProps = {
|
|
42
55
|
label: PropTypes.string.description("Step label"),
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/WizardStep.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport React, { cloneElement, useMemo, isValidElement } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { describe, PropTypes, get } from '@elliemae/ds-utilities';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport { indicatorItemBlockName } from './blockNames';\n\nconst Item = aggregatedClasses('div')(`${indicatorItemBlockName}`, null, ({ active, completed }) => ({\n active,\n completed,\n}));\nconst Wrapper = aggregatedClasses('div')(`${indicatorItemBlockName}-wrapper`);\nconst Label = aggregatedClasses('span')(indicatorItemBlockName, 'label');\nconst Bullet = aggregatedClasses('div')(indicatorItemBlockName, 'bullet');\nconst BulletWrapper = aggregatedClasses('div')(indicatorItemBlockName, 'bullet-wrapper');\n\nfunction WizardStep({\n label = '',\n icon = null,\n iconCompleted = <Checkmark />,\n iconActive = null,\n active = false,\n completed = false,\n index = 0,\n}) {\n const currentIcon =\n useMemo(() => {\n if (active) return iconActive;\n if (completed) return iconCompleted;\n return icon;\n }, [active, completed]) || icon;\n\n const iconWithOptions = useMemo(\n () =>\n isValidElement(currentIcon)\n ? cloneElement(currentIcon, {\n color: get(currentIcon, ['props', 'color']) || ['brand-primary', completed ? 600 : 500],\n })\n : currentIcon || index + 1,\n [currentIcon],\n );\n\n return (\n <Item classProps={{ active, completed }}>\n <Wrapper>\n <BulletWrapper>\n <Bullet>{iconWithOptions}</Bullet>\n </BulletWrapper>\n <Label>{label}</Label>\n </Wrapper>\n </Item>\n );\n}\n\nconst wizzardStepProps = {\n label: PropTypes.string.description('Step label'),\n icon: PropTypes.oneOfType([PropTypes.element, PropTypes.string]).description('Default icon or number'),\n iconCompleted: PropTypes.element.description('Icon when the step is completed').defaultValue(Checkmark),\n iconActive: PropTypes.element.description('Icon when the step is active'),\n active: PropTypes.bool.description('Whether the step is active or not').defaultValue(false),\n completed: PropTypes.bool.description('Whether the step is completed or not').defaultValue(false),\n index: PropTypes.number.description('Current item index'),\n};\n\nWizardStep.propTypes = wizzardStepProps;\nWizardStep.displayName = 'WizardStep';\nconst WizzardStepWithSchema = describe(WizardStep);\nWizzardStepWithSchema.propTypes = wizzardStepProps;\n\nexport { WizzardStepWithSchema };\nexport default WizardStep;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAgB,cAAc,SAAS,sBAAsB;AAC7D,SAAS,yBAAyB;AAClC,SAAS,UAAU,WAAW,WAAW;AACzC,SAAS,iBAAiB;AAC1B,SAAS,8BAA8B;AAEvC,MAAM,OAAO,kBAAkB,KAAK,EAAE,GAAG,0BAA0B,MAAM,CAAC,EAAE,QAAQ,UAAU,OAAO;AAAA,EACnG;AAAA,EACA;AACF,EAAE;AACF,MAAM,UAAU,kBAAkB,KAAK,EAAE,GAAG,gCAAgC;AAC5E,MAAM,QAAQ,kBAAkB,MAAM,EAAE,wBAAwB,OAAO;AACvE,MAAM,SAAS,kBAAkB,KAAK,EAAE,wBAAwB,QAAQ;AACxE,MAAM,gBAAgB,kBAAkB,KAAK,EAAE,wBAAwB,gBAAgB;AAEvF,SAAS,WAAW;AAAA,EAClB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,gBAAgB,oBAAC,aAAU;AAAA,EAC3B,aAAa;AAAA,EACb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AACV,GAAG;AACD,QAAM,cACJ,QAAQ,MAAM;AACZ,QAAI;AAAQ,aAAO;AACnB,QAAI;AAAW,aAAO;AACtB,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,SAAS,CAAC,KAAK;AAE7B,QAAM,kBAAkB;AAAA,IACtB,MACE,eAAe,WAAW,IACtB,aAAa,aAAa;AAAA,MACxB,OAAO,IAAI,aAAa,CAAC,SAAS,OAAO,CAAC,KAAK,CAAC,iBAAiB,YAAY,MAAM,GAAG;AAAA,IACxF,CAAC,IACD,eAAe,QAAQ;AAAA,IAC7B,CAAC,WAAW;AAAA,EACd;AAEA,SACE,oBAAC;AAAA,IAAK,YAAY,EAAE,QAAQ,UAAU;AAAA,IACpC,+BAAC;AAAA,MACC;AAAA,4BAAC;AAAA,UACC,8BAAC;AAAA,YAAQ;AAAA,WAAgB;AAAA,SAC3B;AAAA,QACA,oBAAC;AAAA,UAAO;AAAA,SAAM;AAAA;AAAA,KAChB;AAAA,GACF;AAEJ;AAEA,MAAM,mBAAmB;AAAA,EACvB,OAAO,UAAU,OAAO,YAAY,YAAY;AAAA,EAChD,MAAM,UAAU,UAAU,CAAC,UAAU,SAAS,UAAU,MAAM,CAAC,EAAE,YAAY,wBAAwB;AAAA,EACrG,eAAe,UAAU,QAAQ,YAAY,iCAAiC,EAAE,aAAa,SAAS;AAAA,EACtG,YAAY,UAAU,QAAQ,YAAY,8BAA8B;AAAA,EACxE,QAAQ,UAAU,KAAK,YAAY,mCAAmC,EAAE,aAAa,KAAK;AAAA,EAC1F,WAAW,UAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,KAAK;AAAA,EAChG,OAAO,UAAU,OAAO,YAAY,oBAAoB;AAC1D;AAEA,WAAW,YAAY;AACvB,WAAW,cAAc;AACzB,MAAM,wBAAwB,SAAS,UAAU;AACjD,sBAAsB,YAAY;AAGlC,IAAO,qBAAQ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/esm/WizardSteps.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import React2, { cloneElement, useMemo } from "react";
|
|
3
4
|
import { describe, PropTypes } from "@elliemae/ds-utilities";
|
|
4
5
|
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
@@ -12,18 +13,18 @@ function WizardSteps({ current = 0, steps, children, ...otherProps }) {
|
|
|
12
13
|
active: current === index,
|
|
13
14
|
completed: index < current
|
|
14
15
|
});
|
|
15
|
-
return steps ? steps.map((step, index) => /* @__PURE__ */
|
|
16
|
-
key: index,
|
|
16
|
+
return steps ? steps.map((step, index) => /* @__PURE__ */ jsx(WizardStep, {
|
|
17
17
|
...step,
|
|
18
18
|
...mergeStepProps(step, index)
|
|
19
|
-
})) : React2.Children.map(
|
|
19
|
+
}, index)) : React2.Children.map(
|
|
20
20
|
children,
|
|
21
21
|
(item, index) => cloneElement(item, mergeStepProps(item, index))
|
|
22
22
|
);
|
|
23
23
|
}, [current, children]);
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
...otherProps
|
|
26
|
-
|
|
24
|
+
return /* @__PURE__ */ jsx(StepsWrapper, {
|
|
25
|
+
...otherProps,
|
|
26
|
+
children: items
|
|
27
|
+
});
|
|
27
28
|
}
|
|
28
29
|
WizardSteps.Item = WizardStep;
|
|
29
30
|
const wizzardProps = {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/WizardSteps.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n/* eslint-disable react/no-array-index-key */\nimport React, { cloneElement, useMemo } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport WizardStep from './WizardStep';\nimport { indicatorBlockName } from './blockNames';\n\nconst StepsWrapper = aggregatedClasses('div')(indicatorBlockName);\n\nfunction WizardSteps({ current = 0, steps, children, ...otherProps }) {\n const items = useMemo(() => {\n const mergeStepProps = (step, index) => ({\n index,\n active: current === index,\n completed: index < current,\n });\n\n return steps\n ? steps.map((step, index) => (\n <WizardStep key={index} {...step} {...mergeStepProps(step, index)} />\n ))\n : React.Children.map(children, (item, index) =>\n cloneElement(item, mergeStepProps(item, index)),\n );\n }, [current, children]);\n\n return <StepsWrapper {...otherProps}>{items}</StepsWrapper>;\n}\n\nWizardSteps.Item = WizardStep;\n\nconst wizzardProps = {\n current: PropTypes.number\n .description('Current active state index')\n .defaultValue(0),\n steps: PropTypes.arrayOf(PropTypes.shape({}))\n .description('Array of steps objects')\n .defaultValue([]).isRequired,\n children: PropTypes.arrayOf(PropTypes.instanceOf(WizardStep)).description(\n 'List of WizardStep components',\n ),\n};\n\nWizardSteps.propTypes = wizzardProps;\nWizardSteps.displayName = 'WizardSteps';\nconst WizzardWithSchema = describe(WizardSteps);\nWizzardWithSchema.propTypes = wizzardProps;\n\nexport { WizzardWithSchema };\nexport default WizardSteps;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,OAAOA,UAAS,cAAc,eAAe;AAC7C,SAAS,UAAU,iBAAiB;AACpC,SAAS,yBAAyB;AAClC,OAAO,gBAAgB;AACvB,SAAS,0BAA0B;AAEnC,MAAM,eAAe,kBAAkB,KAAK,EAAE,kBAAkB;AAEhE,SAAS,YAAY,EAAE,UAAU,GAAG,OAAO,aAAa,WAAW,GAAG;AACpE,QAAM,QAAQ,QAAQ,MAAM;AAC1B,UAAM,iBAAiB,CAAC,MAAM,WAAW;AAAA,MACvC;AAAA,MACA,QAAQ,YAAY;AAAA,MACpB,WAAW,QAAQ;AAAA,IACrB;AAEA,WAAO,QACH,MAAM,IAAI,CAAC,MAAM,UACf,oBAAC;AAAA,MAAwB,GAAG;AAAA,MAAO,GAAG,eAAe,MAAM,KAAK;AAAA,OAA/C,KAAkD,CACpE,IACDA,OAAM,SAAS;AAAA,MAAI;AAAA,MAAU,CAAC,MAAM,UAClC,aAAa,MAAM,eAAe,MAAM,KAAK,CAAC;AAAA,IAChD;AAAA,EACN,GAAG,CAAC,SAAS,QAAQ,CAAC;AAEtB,SAAO,oBAAC;AAAA,IAAc,GAAG;AAAA,IAAa;AAAA,GAAM;AAC9C;AAEA,YAAY,OAAO;AAEnB,MAAM,eAAe;AAAA,EACnB,SAAS,UAAU,OAChB,YAAY,4BAA4B,EACxC,aAAa,CAAC;AAAA,EACjB,OAAO,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC,CAAC,EACzC,YAAY,wBAAwB,EACpC,aAAa,CAAC,CAAC,EAAE;AAAA,EACpB,UAAU,UAAU,QAAQ,UAAU,WAAW,UAAU,CAAC,EAAE;AAAA,IAC5D;AAAA,EACF;AACF;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,oBAAoB,SAAS,WAAW;AAC9C,kBAAkB,YAAY;AAG9B,IAAO,sBAAQ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-wizard",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Wizard",
|
|
6
6
|
"files": [
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"indent": 4
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@elliemae/ds-classnames": "3.5.
|
|
59
|
-
"@elliemae/ds-icons": "3.5.
|
|
60
|
-
"@elliemae/ds-utilities": "3.5.
|
|
58
|
+
"@elliemae/ds-classnames": "3.5.1-next.0",
|
|
59
|
+
"@elliemae/ds-icons": "3.5.1-next.0",
|
|
60
|
+
"@elliemae/ds-utilities": "3.5.1-next.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"lodash": "^4.17.21",
|