@elliemae/ds-stepper 2.2.0-next.5 → 2.2.0-next.6
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/Stepper.js +3 -2
- package/cjs/StepperButton.js +3 -2
- package/cjs/props.js +21 -8
- package/cjs/styled.js +1 -1
- package/esm/Stepper.js +4 -3
- package/esm/StepperButton.js +4 -3
- package/esm/props.js +17 -8
- package/esm/styled.js +1 -1
- package/package.json +5 -5
- package/types/Stepper.d.ts +2166 -0
- package/types/StepperButton.d.ts +2145 -9
- package/types/props.d.ts +4322 -20
- package/types/tests/Stepper.global-attributes.test.d.ts +1 -0
- package/types/tests/StepperButton.global-attributes.test.d.ts +1 -0
package/cjs/Stepper.js
CHANGED
|
@@ -38,11 +38,12 @@ const DSStepper = props$1 => {
|
|
|
38
38
|
visited
|
|
39
39
|
} = propsWithDefaults;
|
|
40
40
|
const stepsArray = React__default["default"].useMemo(() => new Array(steps).fill(1), [steps]);
|
|
41
|
-
|
|
41
|
+
const globalAttributes = dsPropsHelpers.useGetGlobalAttributes(propsWithDefaults);
|
|
42
|
+
return /*#__PURE__*/jsxRuntime.jsx(styled.StepperWrapper, _objectSpread(_objectSpread({
|
|
42
43
|
steps: steps,
|
|
43
44
|
current: current,
|
|
44
45
|
visited: visited
|
|
45
|
-
},
|
|
46
|
+
}, globalAttributes), {}, {
|
|
46
47
|
children: stepsArray.map((item, index) => /*#__PURE__*/_jsx__default["default"](styled.Step // eslint-disable-next-line react/no-array-index-key
|
|
47
48
|
, {
|
|
48
49
|
active: current === index,
|
package/cjs/StepperButton.js
CHANGED
|
@@ -40,13 +40,14 @@ const DSStepperButton = props$1 => {
|
|
|
40
40
|
onClick,
|
|
41
41
|
innerRef
|
|
42
42
|
} = propsWithDefaults;
|
|
43
|
-
|
|
43
|
+
const globalAttributes = dsPropsHelpers.useGetGlobalAttributes(propsWithDefaults);
|
|
44
|
+
return /*#__PURE__*/jsxRuntime.jsxs(styled.StyledButton, _objectSpread(_objectSpread({
|
|
44
45
|
disabled: disabled,
|
|
45
46
|
onClick: onClick,
|
|
46
47
|
innerRef: innerRef,
|
|
47
48
|
buttonType: dsButton.BUTTON_TYPES.TEXT,
|
|
48
49
|
fontSize: fontSize
|
|
49
|
-
},
|
|
50
|
+
}, globalAttributes), {}, {
|
|
50
51
|
children: [chevron === 'left' ? _ChevronLeft || (_ChevronLeft = /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronLeft, {})) : null, /*#__PURE__*/_jsx__default["default"](styled.Label, {
|
|
51
52
|
value: label
|
|
52
53
|
}), chevron === 'right' ? _ChevronRight || (_ChevronRight = /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronRight, {})) : null]
|
package/cjs/props.js
CHANGED
|
@@ -2,9 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
11
|
var lodash = require('lodash');
|
|
6
12
|
var reactDesc = require('react-desc');
|
|
13
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
7
14
|
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
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__default["default"](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; }
|
|
8
22
|
const BUTTON_SIZES = {
|
|
9
23
|
normal: 'normal',
|
|
10
24
|
large: 'large'
|
|
@@ -14,27 +28,26 @@ const defaultProps = {
|
|
|
14
28
|
current: undefined,
|
|
15
29
|
visited: []
|
|
16
30
|
};
|
|
17
|
-
const dsStepperProps = {
|
|
31
|
+
const dsStepperProps = _objectSpread({
|
|
18
32
|
steps: reactDesc.PropTypes.number.description('Number of steps').isRequired,
|
|
19
33
|
current: reactDesc.PropTypes.number.description('Index of active step'),
|
|
20
34
|
visited: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.number).description('Array of visited steps').isRequired
|
|
21
|
-
};
|
|
35
|
+
}, dsPropsHelpers.globalAttributesPropTypes);
|
|
22
36
|
const defaultButtonProps = {
|
|
23
37
|
chevron: undefined,
|
|
24
38
|
fontSize: BUTTON_SIZES.normal,
|
|
25
39
|
disabled: false,
|
|
26
40
|
onClick: lodash.noop
|
|
27
41
|
};
|
|
28
|
-
const dsStepperButtonProps = {
|
|
42
|
+
const dsStepperButtonProps = _objectSpread(_objectSpread({
|
|
29
43
|
chevron: reactDesc.PropTypes.oneOf(['left', 'right', null]).description('Chevron icon position, if null/undefined no chevron will be shown').defaultValue(null),
|
|
30
44
|
fontSize: reactDesc.PropTypes.oneOf(['normal', 'large']).description('Label size, used for marking last step').defaultValue('normal'),
|
|
31
|
-
|
|
45
|
+
innerRef: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.object, reactDesc.PropTypes.func]).description('Inner ref to button component.')
|
|
46
|
+
}, dsPropsHelpers.globalAttributesPropTypes), {}, {
|
|
32
47
|
disabled: reactDesc.PropTypes.bool.description('Adds disabled state.'),
|
|
33
48
|
onClick: reactDesc.PropTypes.func.description('OnClick callback handler.').defaultValue('()=>{}'),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
'data-': reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.bool]).description('accept all the data-* props')
|
|
37
|
-
};
|
|
49
|
+
label: reactDesc.PropTypes.string.description('Text Label, this only accepts text, no custom JSX').isRequired
|
|
50
|
+
});
|
|
38
51
|
|
|
39
52
|
exports.defaultButtonProps = defaultButtonProps;
|
|
40
53
|
exports.defaultProps = defaultProps;
|
package/cjs/styled.js
CHANGED
|
@@ -12,7 +12,7 @@ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
|
12
12
|
|
|
13
13
|
const StepperWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
14
14
|
componentId: "sc-fgtqnq-0"
|
|
15
|
-
})(["display:grid;align-items:
|
|
15
|
+
})(["display:grid;align-items:center;grid-template-columns repeat(", ",1fr);column-gap:", ";"], props => props.steps, props => props.steps >= 8 ? props.theme.space.xxxs : props.theme.space.xxs);
|
|
16
16
|
const Step = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
17
17
|
componentId: "sc-fgtqnq-1"
|
|
18
18
|
})(["display:grid;border-radius:1px;height:", ";background:", ";"], props => props.active ? '5px' : '3px', props => props.active || props.visited ? props.theme.colors.brand[700] : '#A9B1BE');
|
package/esm/Stepper.js
CHANGED
|
@@ -10,7 +10,7 @@ import 'core-js/modules/esnext.iterator.for-each.js';
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { uid } from 'uid';
|
|
12
12
|
import { describe } from 'react-desc';
|
|
13
|
-
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes,
|
|
13
|
+
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';
|
|
14
14
|
import { dsStepperProps, defaultProps } from './props.js';
|
|
15
15
|
import { StepperWrapper, Step } from './styled.js';
|
|
16
16
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -28,11 +28,12 @@ const DSStepper = props => {
|
|
|
28
28
|
visited
|
|
29
29
|
} = propsWithDefaults;
|
|
30
30
|
const stepsArray = React.useMemo(() => new Array(steps).fill(1), [steps]);
|
|
31
|
-
|
|
31
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefaults);
|
|
32
|
+
return /*#__PURE__*/jsx(StepperWrapper, _objectSpread(_objectSpread({
|
|
32
33
|
steps: steps,
|
|
33
34
|
current: current,
|
|
34
35
|
visited: visited
|
|
35
|
-
},
|
|
36
|
+
}, globalAttributes), {}, {
|
|
36
37
|
children: stepsArray.map((item, index) => /*#__PURE__*/_jsx(Step // eslint-disable-next-line react/no-array-index-key
|
|
37
38
|
, {
|
|
38
39
|
active: current === index,
|
package/esm/StepperButton.js
CHANGED
|
@@ -7,7 +7,7 @@ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
|
7
7
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
8
|
import 'react';
|
|
9
9
|
import { describe } from 'react-desc';
|
|
10
|
-
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes,
|
|
10
|
+
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';
|
|
11
11
|
import { BUTTON_TYPES } from '@elliemae/ds-button';
|
|
12
12
|
import { ChevronLeft, ChevronRight } from '@elliemae/ds-icons';
|
|
13
13
|
import { dsStepperButtonProps, defaultButtonProps } from './props.js';
|
|
@@ -31,13 +31,14 @@ const DSStepperButton = props => {
|
|
|
31
31
|
onClick,
|
|
32
32
|
innerRef
|
|
33
33
|
} = propsWithDefaults;
|
|
34
|
-
|
|
34
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefaults);
|
|
35
|
+
return /*#__PURE__*/jsxs(StyledButton, _objectSpread(_objectSpread({
|
|
35
36
|
disabled: disabled,
|
|
36
37
|
onClick: onClick,
|
|
37
38
|
innerRef: innerRef,
|
|
38
39
|
buttonType: BUTTON_TYPES.TEXT,
|
|
39
40
|
fontSize: fontSize
|
|
40
|
-
},
|
|
41
|
+
}, globalAttributes), {}, {
|
|
41
42
|
children: [chevron === 'left' ? _ChevronLeft || (_ChevronLeft = /*#__PURE__*/_jsx(ChevronLeft, {})) : null, /*#__PURE__*/_jsx(Label, {
|
|
42
43
|
value: label
|
|
43
44
|
}), chevron === 'right' ? _ChevronRight || (_ChevronRight = /*#__PURE__*/_jsx(ChevronRight, {})) : null]
|
package/esm/props.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
1
7
|
import { noop } from 'lodash';
|
|
2
8
|
import { PropTypes } from 'react-desc';
|
|
9
|
+
import { globalAttributesPropTypes } from '@elliemae/ds-props-helpers';
|
|
3
10
|
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
4
14
|
const BUTTON_SIZES = {
|
|
5
15
|
normal: 'normal',
|
|
6
16
|
large: 'large'
|
|
@@ -10,26 +20,25 @@ const defaultProps = {
|
|
|
10
20
|
current: undefined,
|
|
11
21
|
visited: []
|
|
12
22
|
};
|
|
13
|
-
const dsStepperProps = {
|
|
23
|
+
const dsStepperProps = _objectSpread({
|
|
14
24
|
steps: PropTypes.number.description('Number of steps').isRequired,
|
|
15
25
|
current: PropTypes.number.description('Index of active step'),
|
|
16
26
|
visited: PropTypes.arrayOf(PropTypes.number).description('Array of visited steps').isRequired
|
|
17
|
-
};
|
|
27
|
+
}, globalAttributesPropTypes);
|
|
18
28
|
const defaultButtonProps = {
|
|
19
29
|
chevron: undefined,
|
|
20
30
|
fontSize: BUTTON_SIZES.normal,
|
|
21
31
|
disabled: false,
|
|
22
32
|
onClick: noop
|
|
23
33
|
};
|
|
24
|
-
const dsStepperButtonProps = {
|
|
34
|
+
const dsStepperButtonProps = _objectSpread(_objectSpread({
|
|
25
35
|
chevron: PropTypes.oneOf(['left', 'right', null]).description('Chevron icon position, if null/undefined no chevron will be shown').defaultValue(null),
|
|
26
36
|
fontSize: PropTypes.oneOf(['normal', 'large']).description('Label size, used for marking last step').defaultValue('normal'),
|
|
27
|
-
|
|
37
|
+
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.')
|
|
38
|
+
}, globalAttributesPropTypes), {}, {
|
|
28
39
|
disabled: PropTypes.bool.description('Adds disabled state.'),
|
|
29
40
|
onClick: PropTypes.func.description('OnClick callback handler.').defaultValue('()=>{}'),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'data-': PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).description('accept all the data-* props')
|
|
33
|
-
};
|
|
41
|
+
label: PropTypes.string.description('Text Label, this only accepts text, no custom JSX').isRequired
|
|
42
|
+
});
|
|
34
43
|
|
|
35
44
|
export { defaultButtonProps, defaultProps, dsStepperButtonProps, dsStepperProps };
|
package/esm/styled.js
CHANGED
|
@@ -4,7 +4,7 @@ import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text'
|
|
|
4
4
|
|
|
5
5
|
const StepperWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
6
6
|
componentId: "sc-fgtqnq-0"
|
|
7
|
-
})(["display:grid;align-items:
|
|
7
|
+
})(["display:grid;align-items:center;grid-template-columns repeat(", ",1fr);column-gap:", ";"], props => props.steps, props => props.steps >= 8 ? props.theme.space.xxxs : props.theme.space.xxs);
|
|
8
8
|
const Step = /*#__PURE__*/styled.div.withConfig({
|
|
9
9
|
componentId: "sc-fgtqnq-1"
|
|
10
10
|
})(["display:grid;border-radius:1px;height:", ";background:", ";"], props => props.active ? '5px' : '3px', props => props.active || props.visited ? props.theme.colors.brand[700] : '#A9B1BE');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-stepper",
|
|
3
|
-
"version": "2.2.0-next.
|
|
3
|
+
"version": "2.2.0-next.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Stepper",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"build": "node ../../scripts/build/build.js"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@elliemae/ds-button": "2.2.0-next.
|
|
52
|
-
"@elliemae/ds-icons": "2.2.0-next.
|
|
53
|
-
"@elliemae/ds-props-helpers": "2.2.0-next.
|
|
54
|
-
"@elliemae/ds-truncated-tooltip-text": "2.2.0-next.
|
|
51
|
+
"@elliemae/ds-button": "2.2.0-next.6",
|
|
52
|
+
"@elliemae/ds-icons": "2.2.0-next.6",
|
|
53
|
+
"@elliemae/ds-props-helpers": "2.2.0-next.6",
|
|
54
|
+
"@elliemae/ds-truncated-tooltip-text": "2.2.0-next.6",
|
|
55
55
|
"react-desc": "~4.1.3",
|
|
56
56
|
"uid": "~2.0.0"
|
|
57
57
|
},
|