@elliemae/ds-wizard 1.61.12 → 1.61.13
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/cjs/WizardStep.js.map +1 -1
- package/cjs/WizardSteps.js.map +1 -1
- package/cjs/stories/steps.js.map +1 -1
- package/cjs/useWizard.js.map +1 -1
- package/esm/WizardStep.js.map +1 -1
- package/esm/WizardSteps.js.map +1 -1
- package/esm/stories/steps.js.map +1 -1
- package/esm/useWizard.js.map +1 -1
- package/package.json +5 -5
package/cjs/WizardStep.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardStep.js","sources":["../../src/WizardStep.tsx"],"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;\n\nconst WizzardStepWithSchema = describe(WizardStep);\nWizzardStepWithSchema.propTypes = wizzardStepProps;\n\nexport { WizzardStepWithSchema };\nexport default WizardStep;\n"],"names":["Item","aggregatedClasses","indicatorItemBlockName","active","completed","Wrapper","Label","Bullet","BulletWrapper","WizardStep","label","icon","iconCompleted","React","Checkmark","iconActive","index","currentIcon","useMemo","iconWithOptions","isValidElement","cloneElement","color","get","wizzardStepProps","PropTypes","string","description","oneOfType","element","defaultValue","bool","number","propTypes","WizzardStepWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;AAAA;AAQA,IAAMA,IAAI,GAAGC,8BAAiB,CAAC,KAAD,CAAjB,WAA4BC,iCAA5B,GAAsD,IAAtD,EAA4D;
|
|
1
|
+
{"version":3,"file":"WizardStep.js","sources":["../../src/WizardStep.tsx"],"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;\n\nconst WizzardStepWithSchema = describe(WizardStep);\nWizzardStepWithSchema.propTypes = wizzardStepProps;\n\nexport { WizzardStepWithSchema };\nexport default WizardStep;\n"],"names":["Item","aggregatedClasses","indicatorItemBlockName","active","completed","Wrapper","Label","Bullet","BulletWrapper","WizardStep","label","icon","iconCompleted","React","Checkmark","iconActive","index","currentIcon","useMemo","iconWithOptions","isValidElement","cloneElement","color","get","wizzardStepProps","PropTypes","string","description","oneOfType","element","defaultValue","bool","number","propTypes","WizzardStepWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;AAAA;AAQA,IAAMA,IAAI,GAAGC,8BAAiB,CAAC,KAAD,CAAjB,WAA4BC,iCAA5B,GAAsD,IAAtD,EAA4D;EAAA,IAAGC,MAAH,QAAGA,MAAH;MAAWC,SAAX,QAAWA,SAAX;EAAA,OAA4B;IACnGD,MAAM,EAANA,MADmG;IAEnGC,SAAS,EAATA;GAFuE;AAAA,CAA5D,CAAb;AAIA,IAAMC,OAAO,GAAGJ,8BAAiB,CAAC,KAAD,CAAjB,WAA4BC,iCAA5B,cAAhB;AACA,IAAMI,KAAK,GAAGL,8BAAiB,CAAC,MAAD,CAAjB,CAA0BC,iCAA1B,EAAkD,OAAlD,CAAd;AACA,IAAMK,MAAM,GAAGN,8BAAiB,CAAC,KAAD,CAAjB,CAAyBC,iCAAzB,EAAiD,QAAjD,CAAf;AACA,IAAMM,aAAa,GAAGP,8BAAiB,CAAC,KAAD,CAAjB,CAAyBC,iCAAzB,EAAiD,gBAAjD,CAAtB;;AAEA,SAASO,UAAT,QAQG;EAAA,wBAPDC,KAOC;MAPDA,KAOC,4BAPO,EAOP;yBANDC,IAMC;MANDA,IAMC,2BANM,IAMN;kCALDC,aAKC;MALDA,aAKC,iDALeC,wCAACC,iBAAD,OAKf;+BAJDC,UAIC;MAJDA,UAIC,iCAJY,IAIZ;2BAHDZ,MAGC;MAHDA,MAGC,6BAHQ,KAGR;8BAFDC,SAEC;MAFDA,SAEC,gCAFW,KAEX;0BADDY,KACC;MADDA,KACC,4BADO,CACP;EACD,IAAMC,WAAW,GACfC,aAAO,CAAC,YAAM;IACZ,IAAIf,MAAJ,EAAY,OAAOY,UAAP;IACZ,IAAIX,SAAJ,EAAe,OAAOQ,aAAP;IACf,OAAOD,IAAP;GAHK,EAIJ,CAACR,MAAD,EAASC,SAAT,CAJI,CAAP,IAI2BO,IAL7B;EAOA,IAAMQ,eAAe,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ES,mBAAS,CAACO,MAAV,CAAiBL,WAAjB,CAA6B,oBAA7B;AAPgB,CAAzB;AAUAlB,UAAU,CAACwB,SAAX,GAAuBT,gBAAvB;IAEMU,qBAAqB,GAAGC,kBAAQ,CAAC1B,UAAD;AACtCyB,qBAAqB,CAACD,SAAtB,GAAkCT,gBAAlC;;;;;"}
|
package/cjs/WizardSteps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardSteps.js","sources":["../../src/WizardSteps.tsx"],"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;\n\nconst WizzardWithSchema = describe(WizardSteps);\nWizzardWithSchema.propTypes = wizzardProps;\n\nexport { WizzardWithSchema };\nexport default WizardSteps;\n"],"names":["StepsWrapper","aggregatedClasses","indicatorBlockName","WizardSteps","current","steps","children","otherProps","items","useMemo","mergeStepProps","step","index","active","completed","map","React","WizardStep","Children","item","cloneElement","Item","wizzardProps","PropTypes","number","description","defaultValue","arrayOf","shape","isRequired","instanceOf","propTypes","WizzardWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,YAAY,GAAGC,8BAAiB,CAAC,KAAD,CAAjB,CAAyBC,6BAAzB,CAArB;;AAEA,SAASC,WAAT,OAAsE;
|
|
1
|
+
{"version":3,"file":"WizardSteps.js","sources":["../../src/WizardSteps.tsx"],"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;\n\nconst WizzardWithSchema = describe(WizardSteps);\nWizzardWithSchema.propTypes = wizzardProps;\n\nexport { WizzardWithSchema };\nexport default WizardSteps;\n"],"names":["StepsWrapper","aggregatedClasses","indicatorBlockName","WizardSteps","current","steps","children","otherProps","items","useMemo","mergeStepProps","step","index","active","completed","map","React","WizardStep","Children","item","cloneElement","Item","wizzardProps","PropTypes","number","description","defaultValue","arrayOf","shape","isRequired","instanceOf","propTypes","WizzardWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,YAAY,GAAGC,8BAAiB,CAAC,KAAD,CAAjB,CAAyBC,6BAAzB,CAArB;;AAEA,SAASC,WAAT,OAAsE;EAAA,wBAA/CC,OAA+C;MAA/CA,OAA+C,6BAArC,CAAqC;MAAlCC,KAAkC,QAAlCA,KAAkC;MAA3BC,QAA2B,QAA3BA,QAA2B;MAAdC,UAAc;;EACpE,IAAMC,KAAK,GAAGC,aAAO,CAAC,YAAM;IAC1B,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,IAAD,EAAOC,KAAP;MAAA,OAAkB;QACvCA,KAAK,EAALA,KADuC;QAEvCC,MAAM,EAAET,OAAO,KAAKQ,KAFmB;QAGvCE,SAAS,EAAEF,KAAK,GAAGR;OAHE;KAAvB;;IAMA,OAAOC,KAAK,GACRA,KAAK,CAACU,GAAN,CAAU,UAACJ,IAAD,EAAOC,KAAP;MAAA,oBACRI,wCAACC,qBAAD;QAAY,GAAG,EAAEL;SAAWD,IAA5B,EAAsCD,cAAc,CAACC,IAAD,EAAOC,KAAP,CAApD,EADQ;KAAV,CADQ,GAIRI,yBAAK,CAACE,QAAN,CAAeH,GAAf,CAAmBT,QAAnB,EAA6B,UAACa,IAAD,EAAOP,KAAP;MAAA,oBAC3BQ,kBAAY,CAACD,IAAD,EAAOT,cAAc,CAACS,IAAD,EAAOP,KAAP,CAArB,CADe;KAA7B,CAJJ;GAPmB,EAclB,CAACR,OAAD,EAAUE,QAAV,CAdkB,CAArB;EAgBA,oBAAOU,wCAAC,YAAD,EAAkBT,UAAlB,EAA+BC,KAA/B,CAAP;AACD;;AAEDL,WAAW,CAACkB,IAAZ,GAAmBJ,qBAAnB;AAEA,IAAMK,YAAY,GAAG;EACnBlB,OAAO,EAAEmB,mBAAS,CAACC,MAAV,CACNC,WADM,CACM,4BADN,EAENC,YAFM,CAEO,CAFP,CADU;EAInBrB,KAAK,EAAEkB,mBAAS,CAACI,OAAV,CAAkBJ,mBAAS,CAACK,KAAV,CAAgB,EAAhB,CAAlB,EACJH,WADI,CACQ,wBADR,EAEJC,YAFI,CAES,EAFT,EAEaG,UAND;EAOnBvB,QAAQ,EAAEiB,mBAAS,CAACI,OAAV,CAAkBJ,mBAAS,CAACO,UAAV,CAAqBb,qBAArB,CAAlB,EAAoDQ,WAApD,CACR,+BADQ;AAPS,CAArB;AAYAtB,WAAW,CAAC4B,SAAZ,GAAwBT,YAAxB;IAEMU,iBAAiB,GAAGC,kBAAQ,CAAC9B,WAAD;AAClC6B,iBAAiB,CAACD,SAAlB,GAA8BT,YAA9B;;;;;"}
|
package/cjs/stories/steps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps.js","sources":["../../../src/stories/steps.tsx"],"sourcesContent":["import React from 'react';\n\nconst Step1Content = () => <div>Step 1 Content</div>;\nconst Step2Content = () => <div>Step 2 Content</div>;\nconst Step3Content = () => <div>Step 3 Content</div>;\nconst Step4Content = () => <div>Step 4 Content</div>;\n\nexport const steps = [\n {\n label: 'Step 1',\n content: Step1Content,\n },\n {\n label: 'Step Lorem Ipsum',\n content: Step2Content,\n },\n {\n label: 'Step Lorem',\n content: Step3Content,\n },\n {\n label: 'Step Lorem 4',\n content: Step4Content,\n },\n];\n"],"names":["Step1Content","React","Step2Content","Step3Content","Step4Content","steps","label","content"],"mappings":";;;;;;;;;;AAEA,IAAMA,YAAY,GAAG,SAAfA,YAAe;
|
|
1
|
+
{"version":3,"file":"steps.js","sources":["../../../src/stories/steps.tsx"],"sourcesContent":["import React from 'react';\n\nconst Step1Content = () => <div>Step 1 Content</div>;\nconst Step2Content = () => <div>Step 2 Content</div>;\nconst Step3Content = () => <div>Step 3 Content</div>;\nconst Step4Content = () => <div>Step 4 Content</div>;\n\nexport const steps = [\n {\n label: 'Step 1',\n content: Step1Content,\n },\n {\n label: 'Step Lorem Ipsum',\n content: Step2Content,\n },\n {\n label: 'Step Lorem',\n content: Step3Content,\n },\n {\n label: 'Step Lorem 4',\n content: Step4Content,\n },\n];\n"],"names":["Step1Content","React","Step2Content","Step3Content","Step4Content","steps","label","content"],"mappings":";;;;;;;;;;AAEA,IAAMA,YAAY,GAAG,SAAfA,YAAe;EAAA,oBAAMC,sEAAN;AAAA,CAArB;;AACA,IAAMC,YAAY,GAAG,SAAfA,YAAe;EAAA,oBAAMD,sEAAN;AAAA,CAArB;;AACA,IAAME,YAAY,GAAG,SAAfA,YAAe;EAAA,oBAAMF,sEAAN;AAAA,CAArB;;AACA,IAAMG,YAAY,GAAG,SAAfA,YAAe;EAAA,oBAAMH,sEAAN;AAAA,CAArB;;IAEaI,KAAK,GAAG,CACnB;EACEC,KAAK,EAAE,QADT;EAEEC,OAAO,EAAEP;AAFX,CADmB,EAKnB;EACEM,KAAK,EAAE,kBADT;EAEEC,OAAO,EAAEL;AAFX,CALmB,EASnB;EACEI,KAAK,EAAE,YADT;EAEEC,OAAO,EAAEJ;AAFX,CATmB,EAanB;EACEG,KAAK,EAAE,cADT;EAEEC,OAAO,EAAEH;AAFX,CAbmB;;;;"}
|
package/cjs/useWizard.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWizard.js","sources":["../../src/useWizard.tsx"],"sourcesContent":["import { useCallback } from 'react';\nimport { get, useDerivedStateFromProps } from '@elliemae/ds-utilities';\n\nconst checkCanNext = (prevIndex, array) => array.length > prevIndex + 1;\nconst checkCanPrevious = prevIndex => prevIndex - 1 >= 0;\n\nconst noop = () => null;\n\nexport default function useWizard({\n steps: wizardSteps,\n current,\n onNext = noop,\n onPrevious = noop,\n initial = 0,\n}) {\n const [currentStep, setCurrentStep] = useDerivedStateFromProps(\n current || initial,\n );\n\n const handleNext = useCallback(() => {\n if (checkCanNext(currentStep, wizardSteps)) {\n onNext(currentStep);\n setCurrentStep(currentStep + 1);\n }\n });\n\n const handlePrevious = useCallback(() => {\n if (checkCanPrevious(currentStep)) {\n onPrevious(currentStep);\n setCurrentStep(currentStep - 1);\n }\n });\n\n return {\n current: currentStep,\n next: handleNext,\n previous: handlePrevious,\n canNext: checkCanNext(currentStep, wizardSteps),\n canPrevious: checkCanPrevious(currentStep),\n WizardCurrentContent: get(\n wizardSteps,\n [currentStep, 'content'],\n () => null,\n ),\n };\n}\n"],"names":["checkCanNext","prevIndex","array","length","checkCanPrevious","noop","useWizard","wizardSteps","steps","current","onNext","onPrevious","initial","useDerivedStateFromProps","currentStep","setCurrentStep","handleNext","useCallback","handlePrevious","next","previous","canNext","canPrevious","WizardCurrentContent","get"],"mappings":";;;;;;;;;;AAGA,IAAMA,YAAY,GAAG,SAAfA,YAAe,CAACC,SAAD,EAAYC,KAAZ;
|
|
1
|
+
{"version":3,"file":"useWizard.js","sources":["../../src/useWizard.tsx"],"sourcesContent":["import { useCallback } from 'react';\nimport { get, useDerivedStateFromProps } from '@elliemae/ds-utilities';\n\nconst checkCanNext = (prevIndex, array) => array.length > prevIndex + 1;\nconst checkCanPrevious = prevIndex => prevIndex - 1 >= 0;\n\nconst noop = () => null;\n\nexport default function useWizard({\n steps: wizardSteps,\n current,\n onNext = noop,\n onPrevious = noop,\n initial = 0,\n}) {\n const [currentStep, setCurrentStep] = useDerivedStateFromProps(\n current || initial,\n );\n\n const handleNext = useCallback(() => {\n if (checkCanNext(currentStep, wizardSteps)) {\n onNext(currentStep);\n setCurrentStep(currentStep + 1);\n }\n });\n\n const handlePrevious = useCallback(() => {\n if (checkCanPrevious(currentStep)) {\n onPrevious(currentStep);\n setCurrentStep(currentStep - 1);\n }\n });\n\n return {\n current: currentStep,\n next: handleNext,\n previous: handlePrevious,\n canNext: checkCanNext(currentStep, wizardSteps),\n canPrevious: checkCanPrevious(currentStep),\n WizardCurrentContent: get(\n wizardSteps,\n [currentStep, 'content'],\n () => null,\n ),\n };\n}\n"],"names":["checkCanNext","prevIndex","array","length","checkCanPrevious","noop","useWizard","wizardSteps","steps","current","onNext","onPrevious","initial","useDerivedStateFromProps","currentStep","setCurrentStep","handleNext","useCallback","handlePrevious","next","previous","canNext","canPrevious","WizardCurrentContent","get"],"mappings":";;;;;;;;;;AAGA,IAAMA,YAAY,GAAG,SAAfA,YAAe,CAACC,SAAD,EAAYC,KAAZ;EAAA,OAAsBA,KAAK,CAACC,MAAN,GAAeF,SAAS,GAAG,CAAjD;AAAA,CAArB;;AACA,IAAMG,gBAAgB,GAAG,SAAnBA,gBAAmB,CAAAH,SAAS;EAAA,OAAIA,SAAS,GAAG,CAAZ,IAAiB,CAArB;AAAA,CAAlC;;AAEA,IAAMI,IAAI,GAAG,SAAPA,IAAO;EAAA,OAAM,IAAN;AAAA,CAAb;;AAEe,SAASC,SAAT,OAMZ;EAAA,IALMC,WAKN,QALDC,KAKC;MAJDC,OAIC,QAJDA,OAIC;yBAHDC,MAGC;MAHDA,MAGC,4BAHQL,IAGR;6BAFDM,UAEC;MAFDA,UAEC,gCAFYN,IAEZ;0BADDO,OACC;MADDA,OACC,6BADS,CACT;;EACD,4BAAsCC,oCAAwB,CAC5DJ,OAAO,IAAIG,OADiD,CAA9D;;MAAOE,WAAP;MAAoBC,cAApB;;EAIA,IAAMC,UAAU,GAAGC,iBAAW,CAAC,YAAM;IACnC,IAAIjB,YAAY,CAACc,WAAD,EAAcP,WAAd,CAAhB,EAA4C;MAC1CG,MAAM,CAACI,WAAD,CAAN;MACAC,cAAc,CAACD,WAAW,GAAG,CAAf,CAAd;;GAH0B,CAA9B;EAOA,IAAMI,cAAc,GAAGD,iBAAW,CAAC,YAAM;IACvC,IAAIb,gBAAgB,CAACU,WAAD,CAApB,EAAmC;MACjCH,UAAU,CAACG,WAAD,CAAV;MACAC,cAAc,CAACD,WAAW,GAAG,CAAf,CAAd;;GAH8B,CAAlC;EAOA,OAAO;IACLL,OAAO,EAAEK,WADJ;IAELK,IAAI,EAAEH,UAFD;IAGLI,QAAQ,EAAEF,cAHL;IAILG,OAAO,EAAErB,YAAY,CAACc,WAAD,EAAcP,WAAd,CAJhB;IAKLe,WAAW,EAAElB,gBAAgB,CAACU,WAAD,CALxB;IAMLS,oBAAoB,EAAEC,eAAG,CACvBjB,WADuB,EAEvB,CAACO,WAAD,EAAc,SAAd,CAFuB,EAGvB;MAAA,OAAM,IAAN;KAHuB;GAN3B;AAYD;;;;"}
|
package/esm/WizardStep.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardStep.js","sources":["../../src/WizardStep.tsx"],"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;\n\nconst WizzardStepWithSchema = describe(WizardStep);\nWizzardStepWithSchema.propTypes = wizzardStepProps;\n\nexport { WizzardStepWithSchema };\nexport default WizardStep;\n"],"names":["Item","aggregatedClasses","indicatorItemBlockName","active","completed","Wrapper","Label","Bullet","BulletWrapper","WizardStep","label","icon","iconCompleted","iconActive","index","currentIcon","useMemo","iconWithOptions","isValidElement","cloneElement","color","get","wizzardStepProps","PropTypes","string","description","oneOfType","element","defaultValue","Checkmark","bool","number","propTypes","WizzardStepWithSchema","describe"],"mappings":";;;;;;;AAAA;AAQA,IAAMA,IAAI,GAAGC,iBAAiB,CAAC,KAAD,CAAjB,WAA4BC,sBAA5B,GAAsD,IAAtD,EAA4D;
|
|
1
|
+
{"version":3,"file":"WizardStep.js","sources":["../../src/WizardStep.tsx"],"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;\n\nconst WizzardStepWithSchema = describe(WizardStep);\nWizzardStepWithSchema.propTypes = wizzardStepProps;\n\nexport { WizzardStepWithSchema };\nexport default WizardStep;\n"],"names":["Item","aggregatedClasses","indicatorItemBlockName","active","completed","Wrapper","Label","Bullet","BulletWrapper","WizardStep","label","icon","iconCompleted","iconActive","index","currentIcon","useMemo","iconWithOptions","isValidElement","cloneElement","color","get","wizzardStepProps","PropTypes","string","description","oneOfType","element","defaultValue","Checkmark","bool","number","propTyp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AU,CAACuB,SAAX,GAAuBV,gBAAvB;IAEMW,qBAAqB,GAAGC,QAAQ,CAACzB,UAAD;AACtCwB,qBAAqB,CAACD,SAAtB,GAAkCV,gBAAlC;;;;"}
|
package/esm/WizardSteps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardSteps.js","sources":["../../src/WizardSteps.tsx"],"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;\n\nconst WizzardWithSchema = describe(WizardSteps);\nWizzardWithSchema.propTypes = wizzardProps;\n\nexport { WizzardWithSchema };\nexport default WizardSteps;\n"],"names":["StepsWrapper","aggregatedClasses","indicatorBlockName","WizardSteps","current","steps","children","otherProps","items","useMemo","mergeStepProps","step","index","active","completed","map","React","Children","item","cloneElement","Item","WizardStep","wizzardProps","PropTypes","number","description","defaultValue","arrayOf","shape","isRequired","instanceOf","propTypes","WizzardWithSchema","describe"],"mappings":";;;;;;;;;;;AAQA,IAAMA,YAAY,GAAGC,iBAAiB,CAAC,KAAD,CAAjB,CAAyBC,kBAAzB,CAArB;;AAEA,SAASC,WAAT,OAAsE;
|
|
1
|
+
{"version":3,"file":"WizardSteps.js","sources":["../../src/WizardSteps.tsx"],"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;\n\nconst WizzardWithSchema = describe(WizardSteps);\nWizzardWithSchema.propTypes = wizzardProps;\n\nexport { WizzardWithSchema };\nexport default WizardSteps;\n"],"names":["StepsWrapper","aggregatedClasses","indicatorBlockName","WizardSteps","current","steps","children","otherProps","items","useMemo","mergeStepProps","step","index","active","completed","map","React","Children","item","cloneElement","Item","WizardStep","wizzardProps","PropTypes","number","description","defaultValue","arrayOf","shape","isRequired","instanceOf","propTypes","WizzardWithSchema","describe"],"mappings":";;;;;;;;;;;AAQA,IAAMA,YAAY,GAAGC,iBAAiB,CAAC,KAAD,CAAjB,CAAyBC,kBAAzB,CAArB;;AAEA,SAASC,WAAT,OAAsE;EAAA,wBAA/CC,OAA+C;MAA/CA,OAA+C,6BAArC,CAAqC;MAAlCC,KAAkC,QAAlCA,KAAkC;MAA3BC,QAA2B,QAA3BA,QAA2B;MAAdC,UAAc;;EACpE,IAAMC,KAAK,GAAGC,OAAO,CAAC,YAAM;IAC1B,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,IAAD,EAAOC,KAAP;MAAA,OAAkB;QACvCA,KAAK,EAALA,KADuC;QAEvCC,MAAM,EAAET,OAAO,KAAKQ,KAFmB;QAGvCE,SAAS,EAAEF,KAAK,GAAGR;OAHE;KAAvB;;IAMA,OAAOC,KAAK,GACRA,KAAK,CAACU,GAAN,CAAU,UAACJ,IAAD,EAAOC,KAAP;MAAA,oBACR,oBAAC,UAAD;QAAY,GAAG,EAAEA;SAAWD,IAA5B,EAAsCD,cAAc,CAACC,IAAD,EAAOC,KAAP,CAApD,EADQ;KAAV,CADQ,GAIRI,KAAK,CAACC,QAAN,CAAeF,GAAf,CAAmBT,QAAnB,EAA6B,UAACY,IAAD,EAAON,KAAP;MAAA,oBAC3BO,YAAY,CAACD,IAAD,EAAOR,cAAc,CAACQ,IAAD,EAAON,KAAP,CAArB,CADe;KAA7B,CAJJ;GAPmB,EAclB,CAACR,OAAD,EAAUE,QAAV,CAdkB,CAArB;EAgBA,oBAAO,oBAAC,YAAD,EAAkBC,UAAlB,EAA+BC,KAA/B,CAAP;AACD;;AAEDL,WAAW,CAACiB,IAAZ,GAAmBC,UAAnB;AAEA,IAAMC,YAAY,GAAG;EACnBlB,OAAO,EAAEmB,SAAS,CAACC,MAAV,CACNC,WADM,CACM,4BADN,EAENC,YAFM,CAEO,CAFP,CADU;EAInBrB,KAAK,EAAEkB,SAAS,CAACI,OAAV,CAAkBJ,SAAS,CAACK,KAAV,CAAgB,EAAhB,CAAlB,EACJH,WADI,CACQ,wBADR,EAEJC,YAFI,CAES,EAFT,EAEaG,UAND;EAOnBvB,QAAQ,EAAEiB,SAAS,CAACI,OAAV,CAAkBJ,SAAS,CAACO,UAAV,CAAqBT,UAArB,CAAlB,EAAoDI,WAApD,CACR,+BADQ;AAPS,CAArB;AAYAtB,WAAW,CAAC4B,SAAZ,GAAwBT,YAAxB;IAEMU,iBAAiB,GAAGC,QAAQ,CAAC9B,WAAD;AAClC6B,iBAAiB,CAACD,SAAlB,GAA8BT,YAA9B;;;;"}
|
package/esm/stories/steps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps.js","sources":["../../../src/stories/steps.tsx"],"sourcesContent":["import React from 'react';\n\nconst Step1Content = () => <div>Step 1 Content</div>;\nconst Step2Content = () => <div>Step 2 Content</div>;\nconst Step3Content = () => <div>Step 3 Content</div>;\nconst Step4Content = () => <div>Step 4 Content</div>;\n\nexport const steps = [\n {\n label: 'Step 1',\n content: Step1Content,\n },\n {\n label: 'Step Lorem Ipsum',\n content: Step2Content,\n },\n {\n label: 'Step Lorem',\n content: Step3Content,\n },\n {\n label: 'Step Lorem 4',\n content: Step4Content,\n },\n];\n"],"names":["Step1Content","Step2Content","Step3Content","Step4Content","steps","label","content"],"mappings":";;AAEA,IAAMA,YAAY,GAAG,SAAfA,YAAe;
|
|
1
|
+
{"version":3,"file":"steps.js","sources":["../../../src/stories/steps.tsx"],"sourcesContent":["import React from 'react';\n\nconst Step1Content = () => <div>Step 1 Content</div>;\nconst Step2Content = () => <div>Step 2 Content</div>;\nconst Step3Content = () => <div>Step 3 Content</div>;\nconst Step4Content = () => <div>Step 4 Content</div>;\n\nexport const steps = [\n {\n label: 'Step 1',\n content: Step1Content,\n },\n {\n label: 'Step Lorem Ipsum',\n content: Step2Content,\n },\n {\n label: 'Step Lorem',\n content: Step3Content,\n },\n {\n label: 'Step Lorem 4',\n content: Step4Content,\n },\n];\n"],"names":["Step1Content","Step2Content","Step3Content","Step4Content","steps","label","content"],"mappings":";;AAEA,IAAMA,YAAY,GAAG,SAAfA,YAAe;EAAA,oBAAM,kDAAN;AAAA,CAArB;;AACA,IAAMC,YAAY,GAAG,SAAfA,YAAe;EAAA,oBAAM,kDAAN;AAAA,CAArB;;AACA,IAAMC,YAAY,GAAG,SAAfA,YAAe;EAAA,oBAAM,kDAAN;AAAA,CAArB;;AACA,IAAMC,YAAY,GAAG,SAAfA,YAAe;EAAA,oBAAM,kDAAN;AAAA,CAArB;;IAEaC,KAAK,GAAG,CACnB;EACEC,KAAK,EAAE,QADT;EAEEC,OAAO,EAAEN;AAFX,CADmB,EAKnB;EACEK,KAAK,EAAE,kBADT;EAEEC,OAAO,EAAEL;AAFX,CALmB,EASnB;EACEI,KAAK,EAAE,YADT;EAEEC,OAAO,EAAEJ;AAFX,CATmB,EAanB;EACEG,KAAK,EAAE,cADT;EAEEC,OAAO,EAAEH;AAFX,CAbmB;;;;"}
|
package/esm/useWizard.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWizard.js","sources":["../../src/useWizard.tsx"],"sourcesContent":["import { useCallback } from 'react';\nimport { get, useDerivedStateFromProps } from '@elliemae/ds-utilities';\n\nconst checkCanNext = (prevIndex, array) => array.length > prevIndex + 1;\nconst checkCanPrevious = prevIndex => prevIndex - 1 >= 0;\n\nconst noop = () => null;\n\nexport default function useWizard({\n steps: wizardSteps,\n current,\n onNext = noop,\n onPrevious = noop,\n initial = 0,\n}) {\n const [currentStep, setCurrentStep] = useDerivedStateFromProps(\n current || initial,\n );\n\n const handleNext = useCallback(() => {\n if (checkCanNext(currentStep, wizardSteps)) {\n onNext(currentStep);\n setCurrentStep(currentStep + 1);\n }\n });\n\n const handlePrevious = useCallback(() => {\n if (checkCanPrevious(currentStep)) {\n onPrevious(currentStep);\n setCurrentStep(currentStep - 1);\n }\n });\n\n return {\n current: currentStep,\n next: handleNext,\n previous: handlePrevious,\n canNext: checkCanNext(currentStep, wizardSteps),\n canPrevious: checkCanPrevious(currentStep),\n WizardCurrentContent: get(\n wizardSteps,\n [currentStep, 'content'],\n () => null,\n ),\n };\n}\n"],"names":["checkCanNext","prevIndex","array","length","checkCanPrevious","noop","useWizard","wizardSteps","steps","current","onNext","onPrevious","initial","useDerivedStateFromProps","currentStep","setCurrentStep","handleNext","useCallback","handlePrevious","next","previous","canNext","canPrevious","WizardCurrentContent","get"],"mappings":";;;;AAGA,IAAMA,YAAY,GAAG,SAAfA,YAAe,CAACC,SAAD,EAAYC,KAAZ;
|
|
1
|
+
{"version":3,"file":"useWizard.js","sources":["../../src/useWizard.tsx"],"sourcesContent":["import { useCallback } from 'react';\nimport { get, useDerivedStateFromProps } from '@elliemae/ds-utilities';\n\nconst checkCanNext = (prevIndex, array) => array.length > prevIndex + 1;\nconst checkCanPrevious = prevIndex => prevIndex - 1 >= 0;\n\nconst noop = () => null;\n\nexport default function useWizard({\n steps: wizardSteps,\n current,\n onNext = noop,\n onPrevious = noop,\n initial = 0,\n}) {\n const [currentStep, setCurrentStep] = useDerivedStateFromProps(\n current || initial,\n );\n\n const handleNext = useCallback(() => {\n if (checkCanNext(currentStep, wizardSteps)) {\n onNext(currentStep);\n setCurrentStep(currentStep + 1);\n }\n });\n\n const handlePrevious = useCallback(() => {\n if (checkCanPrevious(currentStep)) {\n onPrevious(currentStep);\n setCurrentStep(currentStep - 1);\n }\n });\n\n return {\n current: currentStep,\n next: handleNext,\n previous: handlePrevious,\n canNext: checkCanNext(currentStep, wizardSteps),\n canPrevious: checkCanPrevious(currentStep),\n WizardCurrentContent: get(\n wizardSteps,\n [currentStep, 'content'],\n () => null,\n ),\n };\n}\n"],"names":["checkCanNext","prevIndex","array","length","checkCanPrevious","noop","useWizard","wizardSteps","steps","current","onNext","onPrevious","initial","useDerivedStateFromProps","currentStep","setCurrentStep","handleNext","useCallback","handlePrevious","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MLS,oBAAoB,EAAEC,GAAG,CACvBjB,WADuB,EAEvB,CAACO,WAAD,EAAc,SAAd,CAFuB,EAGvB;MAAA,OAAM,IAAN;KAHuB;GAN3B;AAYD;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-wizard",
|
|
3
|
-
"version": "1.61.
|
|
3
|
+
"version": "1.61.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Ellie Mae - Dim Sum - Wizard",
|
|
6
6
|
"main": "cjs/index.js",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"build": "node ../../scripts/build/build.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@elliemae/ds-basic": "1.61.
|
|
20
|
-
"@elliemae/ds-classnames": "1.61.
|
|
21
|
-
"@elliemae/ds-icons": "1.61.
|
|
22
|
-
"@elliemae/ds-utilities": "1.61.
|
|
19
|
+
"@elliemae/ds-basic": "1.61.13",
|
|
20
|
+
"@elliemae/ds-classnames": "1.61.13",
|
|
21
|
+
"@elliemae/ds-icons": "1.61.13",
|
|
22
|
+
"@elliemae/ds-utilities": "1.61.13",
|
|
23
23
|
"prop-types": "~15.7.2",
|
|
24
24
|
"react-desc": "^4.1.2"
|
|
25
25
|
},
|