glints-aries 4.0.344 → 4.0.345
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/es/@next/Steps/Step.d.ts +11 -0
- package/es/@next/Steps/Step.js +50 -0
- package/es/@next/Steps/StepStyle.d.ts +5 -0
- package/es/@next/Steps/StepStyle.js +25 -0
- package/es/@next/Steps/Steps.d.ts +16 -0
- package/es/@next/Steps/Steps.js +31 -0
- package/es/@next/Steps/Steps.stories.d.ts +4 -0
- package/lib/@next/Steps/Step.d.ts +11 -0
- package/lib/@next/Steps/Step.js +56 -0
- package/lib/@next/Steps/StepStyle.d.ts +5 -0
- package/lib/@next/Steps/StepStyle.js +35 -0
- package/lib/@next/Steps/Steps.d.ts +16 -0
- package/lib/@next/Steps/Steps.js +38 -0
- package/lib/@next/Steps/Steps.stories.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface StepProps {
|
|
3
|
+
/** Styles of step, predetermined from parent component, or you can overwrite this */
|
|
4
|
+
variant?: 'pending' | 'completed' | 'processing' | 'error';
|
|
5
|
+
/** Label given to the step component */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Step number to be shown, by default it's 1,2,3,... from the parent component, or you can overwrite this */
|
|
8
|
+
index?: number;
|
|
9
|
+
type?: 'normal' | 'dot';
|
|
10
|
+
}
|
|
11
|
+
export declare const Step: React.ForwardRefExoticComponent<StepProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Typography } from '../Typography';
|
|
3
|
+
import { CircleDiv, StepItemContainer, StepItemWrapper, VerticalLine, VerticalLineWrapper } from './StepStyle';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { Neutral } from '../utilities/colors';
|
|
6
|
+
export var Step = /*#__PURE__*/React.forwardRef(function Step(_ref, ref) {
|
|
7
|
+
var _ref$variant = _ref.variant,
|
|
8
|
+
variant = _ref$variant === void 0 ? 'pending' : _ref$variant,
|
|
9
|
+
_ref$label = _ref.label,
|
|
10
|
+
label = _ref$label === void 0 ? '' : _ref$label,
|
|
11
|
+
_ref$index = _ref.index,
|
|
12
|
+
index = _ref$index === void 0 ? 0 : _ref$index,
|
|
13
|
+
_ref$type = _ref.type,
|
|
14
|
+
type = _ref$type === void 0 ? 'normal' : _ref$type;
|
|
15
|
+
return /*#__PURE__*/React.createElement(StepItemContainer, {
|
|
16
|
+
className: "step-item-container"
|
|
17
|
+
}, /*#__PURE__*/React.createElement(StepItemWrapper, {
|
|
18
|
+
ref: ref,
|
|
19
|
+
"data-dot": type === 'dot',
|
|
20
|
+
className: "step-item-wrapper"
|
|
21
|
+
}, /*#__PURE__*/React.createElement(CircleDiv, {
|
|
22
|
+
"data-variant": variant,
|
|
23
|
+
"data-dot": type === 'dot'
|
|
24
|
+
}, variant === 'completed' && /*#__PURE__*/React.createElement(Icon, {
|
|
25
|
+
name: "ri-check",
|
|
26
|
+
className: "circle-icon"
|
|
27
|
+
}), variant === 'error' && /*#__PURE__*/React.createElement(Icon, {
|
|
28
|
+
name: "ri-close",
|
|
29
|
+
className: "circle-icon"
|
|
30
|
+
}), variant === 'processing' && /*#__PURE__*/React.createElement(Typography, {
|
|
31
|
+
as: "span",
|
|
32
|
+
variant: "caption",
|
|
33
|
+
color: Neutral.B100,
|
|
34
|
+
className: "circle-icon"
|
|
35
|
+
}, index), variant === 'pending' && /*#__PURE__*/React.createElement(Typography, {
|
|
36
|
+
as: "span",
|
|
37
|
+
variant: "caption",
|
|
38
|
+
color: Neutral.B40,
|
|
39
|
+
className: "circle-icon"
|
|
40
|
+
}, index)), /*#__PURE__*/React.createElement(Typography, {
|
|
41
|
+
as: "div",
|
|
42
|
+
variant: variant === 'processing' || variant === 'error' ? 'body2' : 'body1',
|
|
43
|
+
color: variant === 'pending' || variant === 'completed' ? Neutral.B40 : Neutral.B18
|
|
44
|
+
}, label)), /*#__PURE__*/React.createElement(VerticalLineWrapper, {
|
|
45
|
+
"data-dot": type === 'dot'
|
|
46
|
+
}, /*#__PURE__*/React.createElement(VerticalLine, {
|
|
47
|
+
"data-variant": variant,
|
|
48
|
+
"data-dot": type === 'dot'
|
|
49
|
+
})));
|
|
50
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const StepItemContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const StepItemWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const CircleDiv: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const VerticalLineWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const VerticalLine: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Breakpoints } from '..';
|
|
3
|
+
import { space4, space12, space16 } from '../utilities/spacing';
|
|
4
|
+
import { Blue, Neutral, Red } from '../utilities/colors';
|
|
5
|
+
import { borderRadiusHalf } from '../utilities/borderRadius';
|
|
6
|
+
export var StepItemContainer = styled.div.withConfig({
|
|
7
|
+
displayName: "StepStyle__StepItemContainer",
|
|
8
|
+
componentId: "sc-1br2jzt-0"
|
|
9
|
+
})(["&:last-child > div:last-child{display:none;}"]);
|
|
10
|
+
export var StepItemWrapper = styled.div.withConfig({
|
|
11
|
+
displayName: "StepStyle__StepItemWrapper",
|
|
12
|
+
componentId: "sc-1br2jzt-1"
|
|
13
|
+
})(["display:flex;align-items:center;gap:", ";cursor:default;&[data-dot='true']{gap:", ";}"], space12, space16);
|
|
14
|
+
export var CircleDiv = styled.div.withConfig({
|
|
15
|
+
displayName: "StepStyle__CircleDiv",
|
|
16
|
+
componentId: "sc-1br2jzt-2"
|
|
17
|
+
})(["display:flex;align-items:center;justify-content:center;height:28px;width:28px;border-radius:", ";svg{height:16px;width:16px;}&[data-variant='pending']{background-color:", ";}&[data-variant='completed']{background-color:", ";svg{fill:", ";}}&[data-variant='processing']{background-color:", ";}&[data-variant='error']{background-color:", ";svg{fill:", ";}}&[data-dot='true']{height:10px;width:10px;> .circle-icon{display:none;}&[data-variant='completed']{background-color:", ";}}@media (max-width:", "){height:24px;width:24px;svg{height:14px;width:14px;}}"], borderRadiusHalf, Neutral.B95, Blue.S08, Blue.S99, Blue.S99, Red.B93, Neutral.B100, Blue.S99, Breakpoints.large);
|
|
18
|
+
export var VerticalLineWrapper = styled.div.withConfig({
|
|
19
|
+
displayName: "StepStyle__VerticalLineWrapper",
|
|
20
|
+
componentId: "sc-1br2jzt-3"
|
|
21
|
+
})(["display:flex;align-items:center;justify-content:center;padding:", " 0;height:64px;width:28px;&[data-dot='true']{width:10px;}@media (max-width:", "){width:24px;}"], space4, Breakpoints.large);
|
|
22
|
+
export var VerticalLine = styled.div.withConfig({
|
|
23
|
+
displayName: "StepStyle__VerticalLine",
|
|
24
|
+
componentId: "sc-1br2jzt-4"
|
|
25
|
+
})(["width:2px;height:100%;background-color:", ";&[data-variant='completed']{background-color:", ";}&[data-dot='true']{width:1.5px;}"], Neutral.B85, Blue.S99);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StepProps } from './Step';
|
|
3
|
+
export interface StepsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Step index (1-indexed) marked as processing */
|
|
5
|
+
currentStep: number;
|
|
6
|
+
/** List of indexes (1-indexed) to be marked as error */
|
|
7
|
+
errorSteps?: number[];
|
|
8
|
+
/** Step components as child are required (1-indexed) */
|
|
9
|
+
children?: React.ReactElement<StepProps>[];
|
|
10
|
+
/** If dot type, display dot only; default is normal; automatically passed to all children */
|
|
11
|
+
type?: 'normal' | 'dot';
|
|
12
|
+
}
|
|
13
|
+
export declare const StepsComponent: React.ForwardRefExoticComponent<StepsProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare const Steps: React.ForwardRefExoticComponent<StepsProps & React.RefAttributes<HTMLDivElement>> & {
|
|
15
|
+
Step: React.ForwardRefExoticComponent<StepProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["currentStep", "errorSteps", "children", "type"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Step } from './Step';
|
|
6
|
+
export var StepsComponent = /*#__PURE__*/React.forwardRef(function Collapse(_ref, ref) {
|
|
7
|
+
var _ref$currentStep = _ref.currentStep,
|
|
8
|
+
currentStep = _ref$currentStep === void 0 ? 0 : _ref$currentStep,
|
|
9
|
+
_ref$errorSteps = _ref.errorSteps,
|
|
10
|
+
errorSteps = _ref$errorSteps === void 0 ? [] : _ref$errorSteps,
|
|
11
|
+
children = _ref.children,
|
|
12
|
+
_ref$type = _ref.type,
|
|
13
|
+
type = _ref$type === void 0 ? 'normal' : _ref$type,
|
|
14
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
16
|
+
ref: ref
|
|
17
|
+
}, props), React.Children.map(children, function (child, index) {
|
|
18
|
+
var _child$props, _child$props2;
|
|
19
|
+
var variant = errorSteps.includes(index + 1) ? 'error' : index + 1 === currentStep ? 'processing' : index + 1 < currentStep ? 'completed' : 'pending';
|
|
20
|
+
var childVariant = ((_child$props = child.props) == null ? void 0 : _child$props.variant) || variant;
|
|
21
|
+
var childIndex = ((_child$props2 = child.props) == null ? void 0 : _child$props2.index) || index + 1;
|
|
22
|
+
return /*#__PURE__*/React.createElement(child.type, _extends({}, child.props, {
|
|
23
|
+
variant: childVariant,
|
|
24
|
+
index: childIndex,
|
|
25
|
+
type: type
|
|
26
|
+
}));
|
|
27
|
+
}));
|
|
28
|
+
});
|
|
29
|
+
export var Steps = Object.assign(StepsComponent, {
|
|
30
|
+
Step: Step
|
|
31
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface StepProps {
|
|
3
|
+
/** Styles of step, predetermined from parent component, or you can overwrite this */
|
|
4
|
+
variant?: 'pending' | 'completed' | 'processing' | 'error';
|
|
5
|
+
/** Label given to the step component */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Step number to be shown, by default it's 1,2,3,... from the parent component, or you can overwrite this */
|
|
8
|
+
index?: number;
|
|
9
|
+
type?: 'normal' | 'dot';
|
|
10
|
+
}
|
|
11
|
+
export declare const Step: React.ForwardRefExoticComponent<StepProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.Step = void 0;
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _Typography = require("../Typography");
|
|
8
|
+
var _StepStyle = require("./StepStyle");
|
|
9
|
+
var _Icon = require("../Icon");
|
|
10
|
+
var _colors = require("../utilities/colors");
|
|
11
|
+
var Step = /*#__PURE__*/_react["default"].forwardRef(function Step(_ref, ref) {
|
|
12
|
+
var _ref$variant = _ref.variant,
|
|
13
|
+
variant = _ref$variant === void 0 ? 'pending' : _ref$variant,
|
|
14
|
+
_ref$label = _ref.label,
|
|
15
|
+
label = _ref$label === void 0 ? '' : _ref$label,
|
|
16
|
+
_ref$index = _ref.index,
|
|
17
|
+
index = _ref$index === void 0 ? 0 : _ref$index,
|
|
18
|
+
_ref$type = _ref.type,
|
|
19
|
+
type = _ref$type === void 0 ? 'normal' : _ref$type;
|
|
20
|
+
return /*#__PURE__*/_react["default"].createElement(_StepStyle.StepItemContainer, {
|
|
21
|
+
className: "step-item-container"
|
|
22
|
+
}, /*#__PURE__*/_react["default"].createElement(_StepStyle.StepItemWrapper, {
|
|
23
|
+
ref: ref,
|
|
24
|
+
"data-dot": type === 'dot',
|
|
25
|
+
className: "step-item-wrapper"
|
|
26
|
+
}, /*#__PURE__*/_react["default"].createElement(_StepStyle.CircleDiv, {
|
|
27
|
+
"data-variant": variant,
|
|
28
|
+
"data-dot": type === 'dot'
|
|
29
|
+
}, variant === 'completed' && /*#__PURE__*/_react["default"].createElement(_Icon.Icon, {
|
|
30
|
+
name: "ri-check",
|
|
31
|
+
className: "circle-icon"
|
|
32
|
+
}), variant === 'error' && /*#__PURE__*/_react["default"].createElement(_Icon.Icon, {
|
|
33
|
+
name: "ri-close",
|
|
34
|
+
className: "circle-icon"
|
|
35
|
+
}), variant === 'processing' && /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
36
|
+
as: "span",
|
|
37
|
+
variant: "caption",
|
|
38
|
+
color: _colors.Neutral.B100,
|
|
39
|
+
className: "circle-icon"
|
|
40
|
+
}, index), variant === 'pending' && /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
41
|
+
as: "span",
|
|
42
|
+
variant: "caption",
|
|
43
|
+
color: _colors.Neutral.B40,
|
|
44
|
+
className: "circle-icon"
|
|
45
|
+
}, index)), /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
46
|
+
as: "div",
|
|
47
|
+
variant: variant === 'processing' || variant === 'error' ? 'body2' : 'body1',
|
|
48
|
+
color: variant === 'pending' || variant === 'completed' ? _colors.Neutral.B40 : _colors.Neutral.B18
|
|
49
|
+
}, label)), /*#__PURE__*/_react["default"].createElement(_StepStyle.VerticalLineWrapper, {
|
|
50
|
+
"data-dot": type === 'dot'
|
|
51
|
+
}, /*#__PURE__*/_react["default"].createElement(_StepStyle.VerticalLine, {
|
|
52
|
+
"data-variant": variant,
|
|
53
|
+
"data-dot": type === 'dot'
|
|
54
|
+
})));
|
|
55
|
+
});
|
|
56
|
+
exports.Step = Step;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const StepItemContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const StepItemWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const CircleDiv: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const VerticalLineWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const VerticalLine: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.VerticalLineWrapper = exports.VerticalLine = exports.StepItemWrapper = exports.StepItemContainer = exports.CircleDiv = void 0;
|
|
6
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
7
|
+
var _ = require("..");
|
|
8
|
+
var _spacing = require("../utilities/spacing");
|
|
9
|
+
var _colors = require("../utilities/colors");
|
|
10
|
+
var _borderRadius = require("../utilities/borderRadius");
|
|
11
|
+
var StepItemContainer = _styledComponents["default"].div.withConfig({
|
|
12
|
+
displayName: "StepStyle__StepItemContainer",
|
|
13
|
+
componentId: "sc-1br2jzt-0"
|
|
14
|
+
})(["&:last-child > div:last-child{display:none;}"]);
|
|
15
|
+
exports.StepItemContainer = StepItemContainer;
|
|
16
|
+
var StepItemWrapper = _styledComponents["default"].div.withConfig({
|
|
17
|
+
displayName: "StepStyle__StepItemWrapper",
|
|
18
|
+
componentId: "sc-1br2jzt-1"
|
|
19
|
+
})(["display:flex;align-items:center;gap:", ";cursor:default;&[data-dot='true']{gap:", ";}"], _spacing.space12, _spacing.space16);
|
|
20
|
+
exports.StepItemWrapper = StepItemWrapper;
|
|
21
|
+
var CircleDiv = _styledComponents["default"].div.withConfig({
|
|
22
|
+
displayName: "StepStyle__CircleDiv",
|
|
23
|
+
componentId: "sc-1br2jzt-2"
|
|
24
|
+
})(["display:flex;align-items:center;justify-content:center;height:28px;width:28px;border-radius:", ";svg{height:16px;width:16px;}&[data-variant='pending']{background-color:", ";}&[data-variant='completed']{background-color:", ";svg{fill:", ";}}&[data-variant='processing']{background-color:", ";}&[data-variant='error']{background-color:", ";svg{fill:", ";}}&[data-dot='true']{height:10px;width:10px;> .circle-icon{display:none;}&[data-variant='completed']{background-color:", ";}}@media (max-width:", "){height:24px;width:24px;svg{height:14px;width:14px;}}"], _borderRadius.borderRadiusHalf, _colors.Neutral.B95, _colors.Blue.S08, _colors.Blue.S99, _colors.Blue.S99, _colors.Red.B93, _colors.Neutral.B100, _colors.Blue.S99, _.Breakpoints.large);
|
|
25
|
+
exports.CircleDiv = CircleDiv;
|
|
26
|
+
var VerticalLineWrapper = _styledComponents["default"].div.withConfig({
|
|
27
|
+
displayName: "StepStyle__VerticalLineWrapper",
|
|
28
|
+
componentId: "sc-1br2jzt-3"
|
|
29
|
+
})(["display:flex;align-items:center;justify-content:center;padding:", " 0;height:64px;width:28px;&[data-dot='true']{width:10px;}@media (max-width:", "){width:24px;}"], _spacing.space4, _.Breakpoints.large);
|
|
30
|
+
exports.VerticalLineWrapper = VerticalLineWrapper;
|
|
31
|
+
var VerticalLine = _styledComponents["default"].div.withConfig({
|
|
32
|
+
displayName: "StepStyle__VerticalLine",
|
|
33
|
+
componentId: "sc-1br2jzt-4"
|
|
34
|
+
})(["width:2px;height:100%;background-color:", ";&[data-variant='completed']{background-color:", ";}&[data-dot='true']{width:1.5px;}"], _colors.Neutral.B85, _colors.Blue.S99);
|
|
35
|
+
exports.VerticalLine = VerticalLine;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StepProps } from './Step';
|
|
3
|
+
export interface StepsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Step index (1-indexed) marked as processing */
|
|
5
|
+
currentStep: number;
|
|
6
|
+
/** List of indexes (1-indexed) to be marked as error */
|
|
7
|
+
errorSteps?: number[];
|
|
8
|
+
/** Step components as child are required (1-indexed) */
|
|
9
|
+
children?: React.ReactElement<StepProps>[];
|
|
10
|
+
/** If dot type, display dot only; default is normal; automatically passed to all children */
|
|
11
|
+
type?: 'normal' | 'dot';
|
|
12
|
+
}
|
|
13
|
+
export declare const StepsComponent: React.ForwardRefExoticComponent<StepsProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare const Steps: React.ForwardRefExoticComponent<StepsProps & React.RefAttributes<HTMLDivElement>> & {
|
|
15
|
+
Step: React.ForwardRefExoticComponent<StepProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.StepsComponent = exports.Steps = void 0;
|
|
6
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Step = require("./Step");
|
|
10
|
+
var _excluded = ["currentStep", "errorSteps", "children", "type"];
|
|
11
|
+
var StepsComponent = /*#__PURE__*/_react["default"].forwardRef(function Collapse(_ref, ref) {
|
|
12
|
+
var _ref$currentStep = _ref.currentStep,
|
|
13
|
+
currentStep = _ref$currentStep === void 0 ? 0 : _ref$currentStep,
|
|
14
|
+
_ref$errorSteps = _ref.errorSteps,
|
|
15
|
+
errorSteps = _ref$errorSteps === void 0 ? [] : _ref$errorSteps,
|
|
16
|
+
children = _ref.children,
|
|
17
|
+
_ref$type = _ref.type,
|
|
18
|
+
type = _ref$type === void 0 ? 'normal' : _ref$type,
|
|
19
|
+
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
20
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
21
|
+
ref: ref
|
|
22
|
+
}, props), _react["default"].Children.map(children, function (child, index) {
|
|
23
|
+
var _child$props, _child$props2;
|
|
24
|
+
var variant = errorSteps.includes(index + 1) ? 'error' : index + 1 === currentStep ? 'processing' : index + 1 < currentStep ? 'completed' : 'pending';
|
|
25
|
+
var childVariant = ((_child$props = child.props) == null ? void 0 : _child$props.variant) || variant;
|
|
26
|
+
var childIndex = ((_child$props2 = child.props) == null ? void 0 : _child$props2.index) || index + 1;
|
|
27
|
+
return /*#__PURE__*/_react["default"].createElement(child.type, (0, _extends2["default"])({}, child.props, {
|
|
28
|
+
variant: childVariant,
|
|
29
|
+
index: childIndex,
|
|
30
|
+
type: type
|
|
31
|
+
}));
|
|
32
|
+
}));
|
|
33
|
+
});
|
|
34
|
+
exports.StepsComponent = StepsComponent;
|
|
35
|
+
var Steps = Object.assign(StepsComponent, {
|
|
36
|
+
Step: _Step.Step
|
|
37
|
+
});
|
|
38
|
+
exports.Steps = Steps;
|