@elliemae/ds-wizard 2.3.0-next.0 → 3.0.0-alpha.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 +85 -0
- package/dist/cjs/WizardStep.js.map +7 -0
- package/dist/cjs/WizardSteps.js +68 -0
- package/dist/cjs/WizardSteps.js.map +7 -0
- package/dist/cjs/blockNames.js +39 -0
- package/dist/cjs/blockNames.js.map +7 -0
- package/dist/cjs/index.js +41 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/stories/steps.js +57 -0
- package/dist/cjs/stories/steps.js.map +7 -0
- package/dist/cjs/useWizard.js +68 -0
- package/dist/cjs/useWizard.js.map +7 -0
- package/dist/esm/WizardStep.js +56 -0
- package/dist/esm/WizardStep.js.map +7 -0
- package/dist/esm/WizardSteps.js +39 -0
- package/dist/esm/WizardSteps.js.map +7 -0
- package/dist/esm/blockNames.js +10 -0
- package/dist/esm/blockNames.js.map +7 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/stories/steps.js +28 -0
- package/dist/esm/stories/steps.js.map +7 -0
- package/{esm → dist/esm}/useWizard.js +16 -19
- package/dist/esm/useWizard.js.map +7 -0
- package/{types → dist/types}/DSWizard.stories.d.ts +0 -2
- package/{types → dist/types}/WizardStep.d.ts +0 -0
- package/{types → dist/types}/WizardSteps.d.ts +0 -0
- package/{types → dist/types}/blockNames.d.ts +0 -0
- package/{types → dist/types}/index.d.ts +0 -0
- package/{types → dist/types}/stories/steps.d.ts +0 -0
- package/{types → dist/types}/stories/wizzard-overview.stories.d.ts +0 -0
- package/{types → dist/types}/useWizard.d.ts +0 -0
- package/package.json +38 -30
- package/cjs/DSWizard.stories.js +0 -18
- package/cjs/WizardStep.js +0 -72
- package/cjs/WizardSteps.js +0 -66
- package/cjs/blockNames.js +0 -11
- package/cjs/index.js +0 -15
- package/cjs/stories/steps.js +0 -36
- package/cjs/stories/wizzard-overview.stories.js +0 -61
- package/cjs/useWizard.js +0 -44
- package/esm/DSWizard.stories.js +0 -13
- package/esm/WizardStep.js +0 -63
- package/esm/WizardSteps.js +0 -55
- package/esm/blockNames.js +0 -5
- package/esm/index.js +0 -3
- package/esm/stories/steps.js +0 -28
- package/esm/stories/wizzard-overview.stories.js +0 -52
package/esm/WizardSteps.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
4
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
5
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
10
|
-
import React, { useMemo, cloneElement } from 'react';
|
|
11
|
-
import { PropTypes, describe } from 'react-desc';
|
|
12
|
-
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
13
|
-
import WizardStep from './WizardStep.js';
|
|
14
|
-
import { indicatorBlockName } from './blockNames.js';
|
|
15
|
-
import { jsx } from 'react/jsx-runtime';
|
|
16
|
-
|
|
17
|
-
const _excluded = ["current", "steps", "children"];
|
|
18
|
-
|
|
19
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
-
|
|
21
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22
|
-
const StepsWrapper = aggregatedClasses('div')(indicatorBlockName);
|
|
23
|
-
|
|
24
|
-
function WizardSteps(_ref) {
|
|
25
|
-
let {
|
|
26
|
-
current = 0,
|
|
27
|
-
steps,
|
|
28
|
-
children
|
|
29
|
-
} = _ref,
|
|
30
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
-
|
|
32
|
-
const items = useMemo(() => {
|
|
33
|
-
const mergeStepProps = (step, index) => ({
|
|
34
|
-
index,
|
|
35
|
-
active: current === index,
|
|
36
|
-
completed: index < current
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
return steps ? steps.map((step, index) => /*#__PURE__*/jsx(WizardStep, _objectSpread(_objectSpread({}, step), mergeStepProps(step, index)), index)) : React.Children.map(children, (item, index) => /*#__PURE__*/cloneElement(item, mergeStepProps(item, index)));
|
|
40
|
-
}, [current, children]);
|
|
41
|
-
return /*#__PURE__*/jsx(StepsWrapper, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
42
|
-
children: items
|
|
43
|
-
}));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
WizardSteps.Item = WizardStep;
|
|
47
|
-
const wizzardProps = {
|
|
48
|
-
current: PropTypes.number.description('Current active state index').defaultValue(0),
|
|
49
|
-
steps: PropTypes.arrayOf(PropTypes.shape({})).description('Array of steps objects').defaultValue([]).isRequired,
|
|
50
|
-
children: PropTypes.arrayOf(PropTypes.instanceOf(WizardStep)).description('List of WizardStep components')
|
|
51
|
-
};
|
|
52
|
-
const WizzardWithSchema = describe(WizardSteps);
|
|
53
|
-
WizzardWithSchema.propTypes = wizzardProps;
|
|
54
|
-
|
|
55
|
-
export { WizzardWithSchema, WizardSteps as default };
|
package/esm/blockNames.js
DELETED
package/esm/index.js
DELETED
package/esm/stories/steps.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'react';
|
|
3
|
-
|
|
4
|
-
var _div, _div2, _div3, _div4;
|
|
5
|
-
|
|
6
|
-
const Step1Content = () => _div || (_div = /*#__PURE__*/_jsx("div", {}, void 0, "Step 1 Content"));
|
|
7
|
-
|
|
8
|
-
const Step2Content = () => _div2 || (_div2 = /*#__PURE__*/_jsx("div", {}, void 0, "Step 2 Content"));
|
|
9
|
-
|
|
10
|
-
const Step3Content = () => _div3 || (_div3 = /*#__PURE__*/_jsx("div", {}, void 0, "Step 3 Content"));
|
|
11
|
-
|
|
12
|
-
const Step4Content = () => _div4 || (_div4 = /*#__PURE__*/_jsx("div", {}, void 0, "Step 4 Content"));
|
|
13
|
-
|
|
14
|
-
const steps = [{
|
|
15
|
-
label: 'Step 1',
|
|
16
|
-
content: Step1Content
|
|
17
|
-
}, {
|
|
18
|
-
label: 'Step Lorem Ipsum',
|
|
19
|
-
content: Step2Content
|
|
20
|
-
}, {
|
|
21
|
-
label: 'Step Lorem',
|
|
22
|
-
content: Step3Content
|
|
23
|
-
}, {
|
|
24
|
-
label: 'Step Lorem 4',
|
|
25
|
-
content: Step4Content
|
|
26
|
-
}];
|
|
27
|
-
|
|
28
|
-
export { steps };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'react';
|
|
3
|
-
import { useWizard, WizardStepsIndicator } from '@elliemae/ds-wizard';
|
|
4
|
-
import DSButton from '@elliemae/ds-button';
|
|
5
|
-
import { steps } from './steps.js';
|
|
6
|
-
import { jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
const Overview = () => {
|
|
9
|
-
const {
|
|
10
|
-
WizardCurrentContent,
|
|
11
|
-
current,
|
|
12
|
-
next,
|
|
13
|
-
previous,
|
|
14
|
-
canNext,
|
|
15
|
-
canPrevious
|
|
16
|
-
} = useWizard({
|
|
17
|
-
steps
|
|
18
|
-
});
|
|
19
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
20
|
-
children: [/*#__PURE__*/_jsx(WizardStepsIndicator, {
|
|
21
|
-
current: current,
|
|
22
|
-
steps: steps
|
|
23
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
24
|
-
style: {
|
|
25
|
-
margin: '10px 0',
|
|
26
|
-
padding: 10,
|
|
27
|
-
border: '1px solid #ddd'
|
|
28
|
-
}
|
|
29
|
-
}, void 0, /*#__PURE__*/_jsx(WizardCurrentContent, {
|
|
30
|
-
data: {
|
|
31
|
-
someExtraData: 'step information'
|
|
32
|
-
}
|
|
33
|
-
})), /*#__PURE__*/_jsx("div", {
|
|
34
|
-
style: {
|
|
35
|
-
display: 'flex',
|
|
36
|
-
width: 180,
|
|
37
|
-
justifyContent: 'space-between'
|
|
38
|
-
}
|
|
39
|
-
}, void 0, /*#__PURE__*/_jsx(DSButton, {
|
|
40
|
-
buttonType: "secondary",
|
|
41
|
-
disabled: !canPrevious,
|
|
42
|
-
labelText: "Previous",
|
|
43
|
-
onClick: previous
|
|
44
|
-
}), /*#__PURE__*/_jsx(DSButton, {
|
|
45
|
-
disabled: !canNext,
|
|
46
|
-
labelText: "Next",
|
|
47
|
-
onClick: next
|
|
48
|
-
}))]
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export { Overview };
|