@elliemae/ds-wizard 3.1.0-next.2 → 3.1.0-next.3

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.
@@ -26,7 +26,6 @@ __export(WizardStep_exports, {
26
26
  module.exports = __toCommonJS(WizardStep_exports);
27
27
  var React = __toESM(require("react"));
28
28
  var import_react = __toESM(require("react"));
29
- var import_react_desc = require("react-desc");
30
29
  var import_ds_classnames = require("@elliemae/ds-classnames");
31
30
  var import_ds_utilities = require("@elliemae/ds-utilities");
32
31
  var import_ds_icons = require("@elliemae/ds-icons");
@@ -63,17 +62,17 @@ function WizardStep({
63
62
  }, /* @__PURE__ */ import_react.default.createElement(Wrapper, null, /* @__PURE__ */ import_react.default.createElement(BulletWrapper, null, /* @__PURE__ */ import_react.default.createElement(Bullet, null, iconWithOptions)), /* @__PURE__ */ import_react.default.createElement(Label, null, label)));
64
63
  }
65
64
  const wizzardStepProps = {
66
- label: import_react_desc.PropTypes.string.description("Step label"),
67
- icon: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.element, import_react_desc.PropTypes.string]).description("Default icon or number"),
68
- iconCompleted: import_react_desc.PropTypes.element.description("Icon when the step is completed").defaultValue(import_ds_icons.Checkmark),
69
- iconActive: import_react_desc.PropTypes.element.description("Icon when the step is active"),
70
- active: import_react_desc.PropTypes.bool.description("Whether the step is active or not").defaultValue(false),
71
- completed: import_react_desc.PropTypes.bool.description("Whether the step is completed or not").defaultValue(false),
72
- index: import_react_desc.PropTypes.number.description("Current item index")
65
+ label: import_ds_utilities.PropTypes.string.description("Step label"),
66
+ icon: import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.element, import_ds_utilities.PropTypes.string]).description("Default icon or number"),
67
+ iconCompleted: import_ds_utilities.PropTypes.element.description("Icon when the step is completed").defaultValue(import_ds_icons.Checkmark),
68
+ iconActive: import_ds_utilities.PropTypes.element.description("Icon when the step is active"),
69
+ active: import_ds_utilities.PropTypes.bool.description("Whether the step is active or not").defaultValue(false),
70
+ completed: import_ds_utilities.PropTypes.bool.description("Whether the step is completed or not").defaultValue(false),
71
+ index: import_ds_utilities.PropTypes.number.description("Current item index")
73
72
  };
74
73
  WizardStep.propTypes = wizzardStepProps;
75
74
  WizardStep.displayName = "WizardStep";
76
- const WizzardStepWithSchema = (0, import_react_desc.describe)(WizardStep);
75
+ const WizzardStepWithSchema = (0, import_ds_utilities.describe)(WizardStep);
77
76
  WizzardStepWithSchema.propTypes = wizzardStepProps;
78
77
  var WizardStep_default = WizardStep;
79
78
  //# sourceMappingURL=WizardStep.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/WizardStep.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable indent */\nimport React, { cloneElement, useMemo, isValidElement } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { 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;ADCvB,mBAA6D;AAC7D,wBAAoC;AACpC,2BAAkC;AAClC,0BAAoB;AACpB,sBAA0B;AAC1B,wBAAuC;AAEvC,MAAM,OAAO,4CAAkB,KAAK,EAAE,GAAG,4CAA0B,MAAM,CAAC,EAAE,QAAQ,gBAAiB;AAAA,EACnG;AAAA,EACA;AACF,EAAE;AACF,MAAM,UAAU,4CAAkB,KAAK,EAAE,GAAG,kDAAgC;AAC5E,MAAM,QAAQ,4CAAkB,MAAM,EAAE,0CAAwB,OAAO;AACvE,MAAM,SAAS,4CAAkB,KAAK,EAAE,0CAAwB,QAAQ;AACxE,MAAM,gBAAgB,4CAAkB,KAAK,EAAE,0CAAwB,gBAAgB;AAEvF,oBAAoB;AAAA,EAClB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,gBAA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Element, 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;ADCvB,mBAA6D;AAC7D,2BAAkC;AAClC,0BAAyC;AACzC,sBAA0B;AAC1B,wBAAuC;AAEvC,MAAM,OAAO,4CAAkB,KAAK,EAAE,GAAG,4CAA0B,MAAM,CAAC,EAAE,QAAQ,gBAAiB;AAAA,EACnG;AAAA,EACA;AACF,EAAE;AACF,MAAM,UAAU,4CAAkB,KAAK,EAAE,GAAG,kDAAgC;AAC5E,MAAM,QAAQ,4CAAkB,MAAM,EAAE,0CAAwB,OAAO;AACvE,MAAM,SAAS,4CAAkB,KAAK,EAAE,0CAAwB,QAAQ;AACxE,MAAM,gBAAgB,4CAAkB,KAAK,EAAE,0CAAwB,gBAAgB;AAEvF,oBAAoB;AAAA,EAClB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,gBAAgB,mDAAC,+BAAU;AAAA,EAC3B,aAAa;AAAA,EACb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AAAA,GACP;AACD,QAAM,cACJ,0BAAQ,MAAM;AACZ,QAAI;AAAQ,aAAO;AACnB,QAAI;AAAW,aAAO;AACtB,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,SAAS,CAAC,KAAK;AAE7B,QAAM,kBAAkB,0BACtB,MACE,iCAAe,WAAW,IACtB,+BAAa,aAAa;AAAA,IACxB,OAAO,6BAAI,aAAa,CAAC,SAAS,OAAO,CAAC,KAAK,CAAC,iBAAiB,YAAY,MAAM,GAAG;AAAA,EACxF,CAAC,IACD,eAAe,QAAQ,GAC7B,CAAC,WAAW,CACd;AAEA,SACE,mDAAC;AAAA,IAAK,YAAY,EAAE,QAAQ,UAAU;AAAA,KACpC,mDAAC,eACC,mDAAC,qBACC,mDAAC,cAAQ,eAAgB,CAC3B,GACA,mDAAC,aAAO,KAAM,CAChB,CACF;AAEJ;AAEA,MAAM,mBAAmB;AAAA,EACvB,OAAO,8BAAU,OAAO,YAAY,YAAY;AAAA,EAChD,MAAM,8BAAU,UAAU,CAAC,8BAAU,SAAS,8BAAU,MAAM,CAAC,EAAE,YAAY,wBAAwB;AAAA,EACrG,eAAe,8BAAU,QAAQ,YAAY,iCAAiC,EAAE,aAAa,yBAAS;AAAA,EACtG,YAAY,8BAAU,QAAQ,YAAY,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,wBAAwB,kCAAS,UAAU;AACjD,sBAAsB,YAAY;AAGlC,IAAO,qBAAQ;",
6
6
  "names": []
7
7
  }
@@ -52,7 +52,7 @@ __export(WizardSteps_exports, {
52
52
  module.exports = __toCommonJS(WizardSteps_exports);
53
53
  var React = __toESM(require("react"));
54
54
  var import_react = __toESM(require("react"));
55
- var import_react_desc = require("react-desc");
55
+ var import_ds_utilities = require("@elliemae/ds-utilities");
56
56
  var import_ds_classnames = require("@elliemae/ds-classnames");
57
57
  var import_WizardStep = __toESM(require("./WizardStep"));
58
58
  var import_blockNames = require("./blockNames");
@@ -73,13 +73,13 @@ function WizardSteps(_a) {
73
73
  }
74
74
  WizardSteps.Item = import_WizardStep.default;
75
75
  const wizzardProps = {
76
- current: import_react_desc.PropTypes.number.description("Current active state index").defaultValue(0),
77
- steps: import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.shape({})).description("Array of steps objects").defaultValue([]).isRequired,
78
- children: import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.instanceOf(import_WizardStep.default)).description("List of WizardStep components")
76
+ current: import_ds_utilities.PropTypes.number.description("Current active state index").defaultValue(0),
77
+ steps: import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.shape({})).description("Array of steps objects").defaultValue([]).isRequired,
78
+ children: import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.instanceOf(import_WizardStep.default)).description("List of WizardStep components")
79
79
  };
80
80
  WizardSteps.propTypes = wizzardProps;
81
81
  WizardSteps.displayName = "WizardSteps";
82
- const WizzardWithSchema = (0, import_react_desc.describe)(WizardSteps);
82
+ const WizzardWithSchema = (0, import_ds_utilities.describe)(WizardSteps);
83
83
  WizzardWithSchema.propTypes = wizzardProps;
84
84
  var WizardSteps_default = WizardSteps;
85
85
  //# sourceMappingURL=WizardSteps.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/WizardSteps.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable indent */\n/* eslint-disable react/no-array-index-key */\nimport React, { cloneElement, useMemo } from 'react';\nimport { describe, PropTypes } from 'react-desc';\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAA6C;AAC7C,wBAAoC;AACpC,2BAAkC;AAClC,wBAAuB;AACvB,wBAAmC;AAEnC,MAAM,eAAe,4CAAkB,KAAK,EAAE,oCAAkB;AAEhE,qBAAqB,IAAiD;AAAjD,eAAE,YAAU,GAAG,OAAO,aAAtB,IAAmC,uBAAnC,IAAmC,CAAjC,WAAa,SAAO;AACzC,QAAM,QAAQ,0BAAQ,MAAM;AAC1B,UAAM,iBAAiB,CAAC,MAAM,UAAW;AAAA,MACvC;AAAA,MACA,QAAQ,YAAY;AAAA,MACpB,WAAW,QAAQ;AAAA,IACrB;AAEA,WAAO,QACH,MAAM,IAAI,CAAC,MAAM,UACf,mDAAC;AAAA,MAAW,KAAK;AAAA,OAAW,OAAU,eAAe,MAAM,KAAK,EAAG,CACpE,IACD,qBAAM,SAAS,IAAI,UAAU,CAAC,MAAM,UAClC,+BAAa,MAAM,eAAe,MAAM,KAAK,CAAC,CAChD;AAAA,EACN,GAAG,CAAC,SAAS,QAAQ,CAAC;AAEtB,SAAO,mDAAC,iCAAiB,aAAa,KAAM;AAC9C;AAEA,YAAY,OAAO;AAEnB,MAAM,eAAe;AAAA,EACnB,SAAS,4BAAU,OAChB,YAAY,4BAA4B,EACxC,aAAa,CAAC;AAAA,EACjB,OAAO,4BAAU,QAAQ,4BAAU,MAAM,CAAC,CAAC,CAAC,EACzC,YAAY,wBAAwB,EACpC,aAAa,CAAC,CAAC,EAAE;AAAA,EACpB,UAAU,4BAAU,QAAQ,4BAAU,WAAW,yBAAU,CAAC,EAAE,YAC5D,+BACF;AACF;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,oBAAoB,gCAAS,WAAW;AAC9C,kBAAkB,YAAY;AAG9B,IAAO,sBAAQ;",
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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;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{ describe, PropTypes } from "react-desc";
4
3
  import { aggregatedClasses } from "@elliemae/ds-classnames";
5
- import { get } from "@elliemae/ds-utilities";
4
+ import { describe, PropTypes, get } from "@elliemae/ds-utilities";
6
5
  import { Checkmark } from "@elliemae/ds-icons";
7
6
  import { indicatorItemBlockName } from "./blockNames";
8
7
  const Item = aggregatedClasses("div")(`${indicatorItemBlockName}`, null, ({ active, completed }) => ({
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/WizardStep.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport React, { cloneElement, useMemo, isValidElement } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { 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;ACCA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,OAAO,kBAAkB,KAAK,EAAE,GAAG,0BAA0B,MAAM,CAAC,EAAE,QAAQ,gBAAiB;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,oBAAoB;AAAA,EAClB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,gBAAgB,qCAAC,eAAU;AAAA,EAC3B,aAAa;AAAA,EACb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AAAA,GACP;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,QACtB,MACE,eAAe,WAAW,IACtB,aAAa,aAAa;AAAA,IACxB,OAAO,IAAI,aAAa,CAAC,SAAS,OAAO,CAAC,KAAK,CAAC,iBAAiB,YAAY,MAAM,GAAG;AAAA,EACxF,CAAC,IACD,eAAe,QAAQ,GAC7B,CAAC,WAAW,CACd;AAEA,SACE,qCAAC;AAAA,IAAK,YAAY,EAAE,QAAQ,UAAU;AAAA,KACpC,qCAAC,eACC,qCAAC,qBACC,qCAAC,cAAQ,eAAgB,CAC3B,GACA,qCAAC,aAAO,KAAM,CAChB,CACF;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;",
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;ACCA;AACA;AACA;AACA;AACA;AAEA,MAAM,OAAO,kBAAkB,KAAK,EAAE,GAAG,0BAA0B,MAAM,CAAC,EAAE,QAAQ,gBAAiB;AAAA,EACnG;AAAA,EACA;AAC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AK;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
6
  "names": []
7
7
  }
@@ -28,7 +28,7 @@ var __objRest = (source, exclude) => {
28
28
  };
29
29
  import * as React from "react";
30
30
  import React2, { cloneElement, useMemo } from "react";
31
- import { describe, PropTypes } from "react-desc";
31
+ import { describe, PropTypes } from "@elliemae/ds-utilities";
32
32
  import { aggregatedClasses } from "@elliemae/ds-classnames";
33
33
  import WizardStep from "./WizardStep";
34
34
  import { indicatorBlockName } from "./blockNames";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/WizardSteps.tsx"],
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 'react-desc';\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"],
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
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AACA;AACA;AACA;AAEA,MAAM,eAAe,kBAAkB,KAAK,EAAE,kBAAkB;AAEhE,qBAAqB,IAAiD;AAAjD,eAAE,YAAU,GAAG,OAAO,aAAtB,IAAmC,uBAAnC,IAAmC,CAAjC,WAAa,SAAO;AACzC,QAAM,QAAQ,QAAQ,MAAM;AAC1B,UAAM,iBAAiB,CAAC,MAAM,UAAW;AAAA,MACvC;AAAA,MACA,QAAQ,YAAY;AAAA,MACpB,WAAW,QAAQ;AAAA,IACrB;AAEA,WAAO,QACH,MAAM,IAAI,CAAC,MAAM,UACf,qCAAC;AAAA,MAAW,KAAK;AAAA,OAAW,OAAU,eAAe,MAAM,KAAK,EAAG,CACpE,IACD,OAAM,SAAS,IAAI,UAAU,CAAC,MAAM,UAClC,aAAa,MAAM,eAAe,MAAM,KAAK,CAAC,CAChD;AAAA,EACN,GAAG,CAAC,SAAS,QAAQ,CAAC;AAEtB,SAAO,qCAAC,iCAAiB,aAAa,KAAM;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,YAC5D,+BACF;AACF;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,oBAAoB,SAAS,WAAW;AAC9C,kBAAkB,YAAY;AAG9B,IAAO,sBAAQ;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-wizard",
3
- "version": "3.1.0-next.2",
3
+ "version": "3.1.0-next.3",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Wizard",
6
6
  "files": [
@@ -54,21 +54,10 @@
54
54
  "reportFile": "tests.xml",
55
55
  "indent": 4
56
56
  },
57
- "scripts": {
58
- "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
59
- "test": "node ../../scripts/testing/test.mjs",
60
- "lint": "node ../../scripts/lint.mjs",
61
- "dts": "node ../../scripts/dts.mjs",
62
- "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
63
- },
64
57
  "dependencies": {
65
- "@elliemae/ds-button": "3.1.0-next.2",
66
- "@elliemae/ds-classnames": "3.1.0-next.2",
67
- "@elliemae/ds-icons": "3.1.0-next.2",
68
- "@elliemae/ds-utilities": "3.1.0-next.2",
69
- "@elliemae/ds-wizard": "3.1.0-next.2",
70
- "prop-types": "~15.8.1",
71
- "react-desc": "~4.1.3"
58
+ "@elliemae/ds-classnames": "3.1.0-next.3",
59
+ "@elliemae/ds-icons": "3.1.0-next.3",
60
+ "@elliemae/ds-utilities": "3.1.0-next.3"
72
61
  },
73
62
  "peerDependencies": {
74
63
  "lodash": "^4.17.21",
@@ -78,5 +67,13 @@
78
67
  "publishConfig": {
79
68
  "access": "public",
80
69
  "typeSafety": false
70
+ },
71
+ "scripts": {
72
+ "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
73
+ "test": "node ../../scripts/testing/test.mjs",
74
+ "lint": "node ../../scripts/lint.mjs",
75
+ "dts": "node ../../scripts/dts.mjs",
76
+ "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
77
+ "checkDeps": "npx -yes ../ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
81
78
  }
82
- }
79
+ }