@widergy/energy-ui 3.2.1 → 3.4.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/CHANGELOG.md +20 -0
- package/dist/components/UTAutocomplete/theme.js +2 -2
- package/dist/components/UTBanner/index.js +38 -0
- package/dist/components/UTBanner/styles.module.scss +7 -0
- package/dist/components/UTBanner/theme.js +18 -0
- package/dist/components/UTButton/index.js +1 -5
- package/dist/components/UTCarousel/components/Slider/index.js +17 -17
- package/dist/components/UTHeader/assets/edit.svg +3 -0
- package/dist/components/UTHeader/assets/ellipsis.svg +3 -0
- package/dist/components/UTHeader/index.js +149 -0
- package/dist/components/UTHeader/styles.module.scss +39 -0
- package/dist/components/UTHeader/theme.js +21 -0
- package/dist/components/UTProgressBar/index.js +2 -2
- package/dist/components/UTSelect/index.js +2 -2
- package/dist/components/UTSelect/theme.js +2 -2
- package/dist/components/UTSelectableCard/README.md +23 -0
- package/dist/components/UTSelectableCard/constants.js +25 -0
- package/dist/components/UTSelectableCard/index.js +103 -0
- package/dist/components/UTSelectableCard/theme.js +173 -0
- package/dist/components/UTStepper/components/Connectors/index.js +44 -0
- package/dist/components/UTStepper/components/Connectors/styles.module.scss +19 -0
- package/dist/components/UTStepper/components/Step/assets/check.svg +5 -0
- package/dist/components/UTStepper/components/Step/index.js +61 -0
- package/dist/components/UTStepper/components/Step/styles.module.scss +67 -0
- package/dist/components/UTStepper/constants.js +10 -0
- package/dist/components/UTStepper/index.js +64 -0
- package/dist/components/UTStepper/styles.module.scss +27 -0
- package/dist/components/UTStepper/theme.js +50 -0
- package/dist/components/UTTextInput/theme.js +2 -2
- package/dist/components/UTWorkflowContainer/index.js +12 -114
- package/dist/components/UTWorkflowContainer/{components → versions/V0/components}/ActionButton/index.js +1 -1
- package/dist/components/UTWorkflowContainer/versions/V0/index.js +128 -0
- package/dist/components/UTWorkflowContainer/{theme.js → versions/V0/theme.js} +2 -2
- package/dist/components/UTWorkflowContainer/versions/V1/README.md +37 -0
- package/dist/components/UTWorkflowContainer/versions/V1/components/NavActions/constants.js +8 -0
- package/dist/components/UTWorkflowContainer/versions/V1/components/NavActions/index.js +94 -0
- package/dist/components/UTWorkflowContainer/versions/V1/components/NavActions/styles.module.scss +34 -0
- package/dist/components/UTWorkflowContainer/versions/V1/index.js +132 -0
- package/dist/components/UTWorkflowContainer/versions/V1/styles.module.scss +38 -0
- package/dist/components/UTWorkflowContainer/versions/V1/theme.js +32 -0
- package/dist/components/UTWorkflowContainer/versions/V1/types.js +15 -0
- package/dist/index.js +7 -0
- package/dist/scss/variables/mediaQueries.module.scss +1 -1
- package/package.json +1 -1
- /package/dist/components/UTWorkflowContainer/{components → versions/V0/components}/ActionButton/styles.module.scss +0 -0
- /package/dist/components/UTWorkflowContainer/{constants.js → versions/V0/constants.js} +0 -0
- /package/dist/components/UTWorkflowContainer/{hooks → versions/V0/hooks}/use-previous.js +0 -0
- /package/dist/components/UTWorkflowContainer/{styles.module.scss → versions/V0/styles.module.scss} +0 -0
- /package/dist/components/UTWorkflowContainer/{types.js → versions/V0/types.js} +0 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.retrieveStyle = void 0;
|
|
7
|
+
const retrieveStyle = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
theme
|
|
10
|
+
} = _ref;
|
|
11
|
+
return {
|
|
12
|
+
aditionalInfoColumn: {
|
|
13
|
+
textAlign: 'end !important'
|
|
14
|
+
},
|
|
15
|
+
amountContainer: {
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
display: 'flex',
|
|
18
|
+
gridGap: '8px'
|
|
19
|
+
},
|
|
20
|
+
grayPressedCheckIcon: {
|
|
21
|
+
color: "".concat(theme.Palette.light['01'], " !important")
|
|
22
|
+
},
|
|
23
|
+
apareanceGrayPressedIcon: {
|
|
24
|
+
'& path': {
|
|
25
|
+
fill: "".concat(theme.Palette.light['01'], "!important")
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
checkIcon: {
|
|
29
|
+
color: theme.Palette.actions.accent['05']
|
|
30
|
+
},
|
|
31
|
+
column: {
|
|
32
|
+
alignSelf: 'center',
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
gridGap: '4px',
|
|
36
|
+
justifyContent: 'space-between',
|
|
37
|
+
textAlign: 'initial'
|
|
38
|
+
},
|
|
39
|
+
detailContainer: {
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
display: 'flex',
|
|
42
|
+
gridGap: '8px'
|
|
43
|
+
},
|
|
44
|
+
disabledIcon: {
|
|
45
|
+
'& path': {
|
|
46
|
+
fill: "".concat(theme.Palette.gray['04'], " !important")
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
disabledTooltip: {
|
|
50
|
+
'& path': {
|
|
51
|
+
color: "".concat(theme.Palette.gray['04'], " !important")
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
icon: {
|
|
55
|
+
flexShrink: 0,
|
|
56
|
+
height: '36px',
|
|
57
|
+
width: '36px',
|
|
58
|
+
'& path': {
|
|
59
|
+
fill: theme.Palette.dark['05']
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
infoIcon: {
|
|
63
|
+
'& path': {
|
|
64
|
+
color: theme.Palette.dark['05']
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
item: {
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
borderRadius: '4px',
|
|
70
|
+
boxSizing: 'border-box',
|
|
71
|
+
display: 'flex',
|
|
72
|
+
gridGap: '16px',
|
|
73
|
+
transition: 'background-color 0.1s ease-in-out',
|
|
74
|
+
width: '100%',
|
|
75
|
+
'& + div': {
|
|
76
|
+
marginTop: '20px'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
mediumSize: {
|
|
80
|
+
padding: '24px'
|
|
81
|
+
},
|
|
82
|
+
selectedIcon: {
|
|
83
|
+
'& path': {
|
|
84
|
+
fill: theme.Palette.actions.accent['05']
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
selectedInfoIcon: {
|
|
88
|
+
'& path': {
|
|
89
|
+
color: theme.Palette.actions.accent['05']
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
smallSize: {
|
|
93
|
+
padding: '16px'
|
|
94
|
+
},
|
|
95
|
+
textContainer: {
|
|
96
|
+
display: 'flex',
|
|
97
|
+
gridGap: '8px',
|
|
98
|
+
justifyContent: 'space-between',
|
|
99
|
+
width: '100%'
|
|
100
|
+
},
|
|
101
|
+
titleAndTooltip: {
|
|
102
|
+
alignItems: 'center',
|
|
103
|
+
display: 'flex',
|
|
104
|
+
gridGap: '4px'
|
|
105
|
+
},
|
|
106
|
+
tooltip: {
|
|
107
|
+
display: 'flex'
|
|
108
|
+
},
|
|
109
|
+
// white apareance
|
|
110
|
+
|
|
111
|
+
whiteApareance: {
|
|
112
|
+
backgroundColor: theme.Palette.light['01'],
|
|
113
|
+
boxShadow: '0 3px 6px 0 #182C491A',
|
|
114
|
+
'&:hover': {
|
|
115
|
+
backgroundColor: theme.Palette.light['03'],
|
|
116
|
+
boxShadow: 'none'
|
|
117
|
+
},
|
|
118
|
+
'&:active': {
|
|
119
|
+
backgroundColor: theme.Palette.light['04'],
|
|
120
|
+
boxShadow: 'none'
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
whiteDisabledContainer: {
|
|
124
|
+
backgroundColor: "".concat(theme.Palette.light['03'], " !important"),
|
|
125
|
+
boxShadow: 'none',
|
|
126
|
+
'&:hover': {
|
|
127
|
+
cursor: 'default'
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
whiteSelectedContainer: {
|
|
131
|
+
border: "2px solid ".concat(theme.Palette.actions.accent['05']),
|
|
132
|
+
boxShadow: 'none',
|
|
133
|
+
'&:hover': {
|
|
134
|
+
backgroundColor: theme.Palette.actions.accent['01'],
|
|
135
|
+
border: "2px solid ".concat(theme.Palette.actions.accent['05'])
|
|
136
|
+
},
|
|
137
|
+
'&:active': {
|
|
138
|
+
backgroundColor: theme.Palette.actions.accent['02'],
|
|
139
|
+
border: "2px solid ".concat(theme.Palette.actions.accent['05'])
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
// Gray apareance
|
|
143
|
+
|
|
144
|
+
grayApareance: {
|
|
145
|
+
backgroundColor: theme.Palette.light['03'],
|
|
146
|
+
border: "1px solid ".concat(theme.Palette.light['05']),
|
|
147
|
+
'&:hover': {
|
|
148
|
+
backgroundColor: theme.Palette.light['04']
|
|
149
|
+
},
|
|
150
|
+
'&:active': {
|
|
151
|
+
backgroundColor: theme.Palette.light['05']
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
grayDisabledContainer: {
|
|
155
|
+
border: "2px solid ".concat(theme.Palette.light['05']),
|
|
156
|
+
'&:hover': {
|
|
157
|
+
backgroundColor: "".concat(theme.Palette.light['03'], " !important"),
|
|
158
|
+
cursor: 'default'
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
graySelectedContainer: {
|
|
162
|
+
backgroundColor: theme.Palette.actions.accent['01'],
|
|
163
|
+
border: "2px solid ".concat(theme.Palette.actions.accent['03']),
|
|
164
|
+
'&:hover': {
|
|
165
|
+
backgroundColor: theme.Palette.actions.accent['02']
|
|
166
|
+
},
|
|
167
|
+
'&:active': {
|
|
168
|
+
backgroundColor: theme.Palette.actions.accent['03']
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
exports.retrieveStyle = retrieveStyle;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = require("prop-types");
|
|
9
|
+
var _commonTypes = require("../../../../types/commonTypes");
|
|
10
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
const Connectors = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
classes,
|
|
15
|
+
withPadding,
|
|
16
|
+
isCompleted,
|
|
17
|
+
numberOfSteps
|
|
18
|
+
} = _ref;
|
|
19
|
+
const connectorMaxWidth = "".concat(100 / (numberOfSteps - 1), "%");
|
|
20
|
+
const containerMaxWidth = "".concat(100 - 100 / numberOfSteps, "%");
|
|
21
|
+
const connectors = new Array(numberOfSteps - 1).fill(null).map((key, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
22
|
+
className: "\n ".concat(_stylesModule.default.connector, " ").concat(classes.connector, " ").concat(isCompleted(index + 1) && classes.coloredProgress, "\n "),
|
|
23
|
+
key: key,
|
|
24
|
+
style: {
|
|
25
|
+
maxWidth: withPadding ? connectorMaxWidth : null,
|
|
26
|
+
height: 2
|
|
27
|
+
}
|
|
28
|
+
}));
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
+
className: _stylesModule.default.wrapper
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
+
className: "".concat(_stylesModule.default.connectorContainer),
|
|
33
|
+
style: {
|
|
34
|
+
maxWidth: withPadding ? containerMaxWidth : null
|
|
35
|
+
}
|
|
36
|
+
}, connectors));
|
|
37
|
+
};
|
|
38
|
+
Connectors.propTypes = {
|
|
39
|
+
classes: _commonTypes.classesType,
|
|
40
|
+
isCompleted: _propTypes.func,
|
|
41
|
+
numberOfSteps: _propTypes.number,
|
|
42
|
+
withPadding: _propTypes.bool
|
|
43
|
+
};
|
|
44
|
+
var _default = exports.default = Connectors;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.wrapper {
|
|
2
|
+
height: 100%;
|
|
3
|
+
position: absolute;
|
|
4
|
+
top: 0;
|
|
5
|
+
transform: translateY(50%);
|
|
6
|
+
width: 100%;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.connectorContainer {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-around;
|
|
12
|
+
margin: 0 auto;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.connector {
|
|
16
|
+
height: 1px;
|
|
17
|
+
transition: all 0.5s;
|
|
18
|
+
width: 100vw;
|
|
19
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="check">
|
|
3
|
+
<path id="Vector (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M10.3536 3.14645C10.5488 3.34171 10.5488 3.65829 10.3536 3.85355L5.35355 8.85355C5.15829 9.04882 4.84171 9.04882 4.64645 8.85355L2.14645 6.35355C1.95118 6.15829 1.95118 5.84171 2.14645 5.64645C2.34171 5.45118 2.65829 5.45118 2.85355 5.64645L5 7.79289L9.64645 3.14645C9.84171 2.95118 10.1583 2.95118 10.3536 3.14645Z"/>
|
|
4
|
+
</g>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _propTypes = require("prop-types");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
10
|
+
var _commonTypes = require("../../../../types/commonTypes");
|
|
11
|
+
var _constants = require("../../constants");
|
|
12
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
var CompletedIcon = function CompletedIcon(props) {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
|
|
16
|
+
clipRule: "evenodd",
|
|
17
|
+
d: "M10.354 3.146a.5.5 0 0 1 0 .708l-5 5a.5.5 0 0 1-.708 0l-2.5-2.5a.5.5 0 1 1 .708-.708L5 7.793l4.646-4.647a.5.5 0 0 1 .708 0Z"
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
CompletedIcon.defaultProps = {
|
|
21
|
+
width: "12",
|
|
22
|
+
height: "12",
|
|
23
|
+
viewBox: "0 0 12 12",
|
|
24
|
+
fill: "none",
|
|
25
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
26
|
+
};
|
|
27
|
+
const Step = _ref => {
|
|
28
|
+
let {
|
|
29
|
+
stage,
|
|
30
|
+
isActive,
|
|
31
|
+
isCompleted,
|
|
32
|
+
size,
|
|
33
|
+
classes
|
|
34
|
+
} = _ref;
|
|
35
|
+
const stageCompleted = isCompleted(stage === null || stage === void 0 ? void 0 : stage.id);
|
|
36
|
+
const stageActive = isActive(stage === null || stage === void 0 ? void 0 : stage.id);
|
|
37
|
+
const CustomIcon = stage.Icon;
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
39
|
+
className: "\n ".concat(_stylesModule.default["stepContainer".concat(size)], " ").concat(classes["stepContainer".concat(size)], "\n ").concat(stageActive ? classes["active".concat(size)] : '', " \n ").concat(stageCompleted ? classes.completed : '', "\n ")
|
|
40
|
+
}, stageCompleted && /*#__PURE__*/_react.default.createElement(CompletedIcon, {
|
|
41
|
+
className: _stylesModule.default["checkIcon".concat(size)]
|
|
42
|
+
}), !stageCompleted && size === _constants.SIZES.LARGE && /*#__PURE__*/_react.default.createElement(CustomIcon, {
|
|
43
|
+
className: "\n ".concat(stageActive ? classes.activeIcon : classes.nextIcxon, " \n ").concat(_stylesModule.default["customIcon".concat(size)], "\n ")
|
|
44
|
+
}), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
45
|
+
variant: "xsmall",
|
|
46
|
+
className: "\n ".concat(_stylesModule.default.label, "\n ").concat(stageActive || stageCompleted ? classes.coloredLabel : '', "\n "),
|
|
47
|
+
colorTheme: !stageActive && !stageCompleted ? 'gray' : null
|
|
48
|
+
}, stage.label));
|
|
49
|
+
};
|
|
50
|
+
Step.propTypes = {
|
|
51
|
+
classes: _commonTypes.classesType,
|
|
52
|
+
isActive: _propTypes.func,
|
|
53
|
+
isCompleted: _propTypes.func,
|
|
54
|
+
size: _propTypes.string,
|
|
55
|
+
stage: (0, _propTypes.shape)({
|
|
56
|
+
id: _propTypes.number,
|
|
57
|
+
label: _propTypes.string,
|
|
58
|
+
Icon: _propTypes.elementType
|
|
59
|
+
})
|
|
60
|
+
};
|
|
61
|
+
var _default = exports.default = Step;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@import '../../../../scss/variables/colors.module.scss';
|
|
2
|
+
|
|
3
|
+
$vertical-label-offset: 10px;
|
|
4
|
+
|
|
5
|
+
%stepContainer {
|
|
6
|
+
border-radius: 50%;
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
position: relative;
|
|
10
|
+
transition: all 0.5s;
|
|
11
|
+
z-index: 2;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.stepContainerS {
|
|
15
|
+
@extend %stepContainer;
|
|
16
|
+
border-style: solid;
|
|
17
|
+
border-width: 4px;
|
|
18
|
+
height: 8px;
|
|
19
|
+
width: 8px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.stepContainerL {
|
|
23
|
+
@extend %stepContainer;
|
|
24
|
+
height: 32px;
|
|
25
|
+
width: 32px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
%customIcon {
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 4px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.customIconS {
|
|
34
|
+
@extend %customIcon;
|
|
35
|
+
height: 12px;
|
|
36
|
+
width: 12px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.customIconL {
|
|
40
|
+
@extend %customIcon;
|
|
41
|
+
height: 24px;
|
|
42
|
+
width: 24px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.label {
|
|
46
|
+
bottom: 0;
|
|
47
|
+
position: absolute;
|
|
48
|
+
transform: translateY(calc(100% + #{$vertical-label-offset}));
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
%checkIcon {
|
|
53
|
+
fill: $white;
|
|
54
|
+
position: absolute;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.checkIconS {
|
|
58
|
+
@extend %checkIcon;
|
|
59
|
+
bottom: -2px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.checkIconL {
|
|
63
|
+
@extend %checkIcon;
|
|
64
|
+
bottom: 4px;
|
|
65
|
+
height: 24px;
|
|
66
|
+
width: 24px;
|
|
67
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _propTypes = require("prop-types");
|
|
9
|
+
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
10
|
+
var _classesUtils = require("../../utils/classesUtils");
|
|
11
|
+
var _Step = _interopRequireDefault(require("./components/Step"));
|
|
12
|
+
var _Connectors = _interopRequireDefault(require("./components/Connectors"));
|
|
13
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
14
|
+
var _theme = require("./theme");
|
|
15
|
+
var _constants = require("./constants");
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
const UTStepper = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
classes: themeClasses = {},
|
|
22
|
+
classNames,
|
|
23
|
+
currentStage,
|
|
24
|
+
stages,
|
|
25
|
+
stepperSize,
|
|
26
|
+
withPadding
|
|
27
|
+
} = _ref;
|
|
28
|
+
const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(themeClasses, classNames), [classNames]);
|
|
29
|
+
const orderedStages = Object.values(stages).sort((a, b) => (a === null || a === void 0 ? void 0 : a.id) - (b === null || b === void 0 ? void 0 : b.id));
|
|
30
|
+
const numberOfSteps = orderedStages.length;
|
|
31
|
+
const size = stepperSize === _constants.SIZES.LARGE && orderedStages.every(stage => stage.Icon) ? _constants.SIZES.LARGE : _constants.SIZES.SMALL;
|
|
32
|
+
const isCompleted = stageNumber => stageNumber < currentStage;
|
|
33
|
+
const isActive = stageNumber => stageNumber === currentStage;
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
35
|
+
className: _stylesModule.default.stepper
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
37
|
+
className: withPadding ? _stylesModule.default.paddingContainer : _stylesModule.default.container
|
|
38
|
+
}, orderedStages.map(stage => /*#__PURE__*/_react.default.createElement(_Step.default, {
|
|
39
|
+
classes,
|
|
40
|
+
withPadding,
|
|
41
|
+
size,
|
|
42
|
+
isCompleted,
|
|
43
|
+
isActive,
|
|
44
|
+
stage
|
|
45
|
+
})), /*#__PURE__*/_react.default.createElement(_Connectors.default, {
|
|
46
|
+
classes,
|
|
47
|
+
withPadding,
|
|
48
|
+
isCompleted,
|
|
49
|
+
numberOfSteps
|
|
50
|
+
})));
|
|
51
|
+
};
|
|
52
|
+
UTStepper.propTypes = {
|
|
53
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
54
|
+
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
55
|
+
currentStage: _propTypes.number,
|
|
56
|
+
stages: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
57
|
+
id: _propTypes.number,
|
|
58
|
+
label: _propTypes.string,
|
|
59
|
+
Icon: _propTypes.elementType
|
|
60
|
+
})),
|
|
61
|
+
stepperSize: (0, _propTypes.oneOf)([_constants.SIZES.LARGE, _constants.SIZES.SMALL]),
|
|
62
|
+
withPadding: _propTypes.bool
|
|
63
|
+
};
|
|
64
|
+
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTStepper);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.stepper {
|
|
2
|
+
padding: 24px 0 48px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.paddingContainer {
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: space-around;
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.container {
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
position: relative;
|
|
15
|
+
|
|
16
|
+
> :first-child {
|
|
17
|
+
> div {
|
|
18
|
+
left: -4px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
> :nth-last-child(2) {
|
|
23
|
+
> div {
|
|
24
|
+
right: -4px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.retrieveStyle = void 0;
|
|
7
|
+
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const retrieveStyle = _ref => {
|
|
10
|
+
var _theme$Palette, _theme$Palette2, _theme$Palette3, _theme$Palette4, _theme$Palette5, _theme$Palette6, _theme$Palette7, _theme$Palette8, _theme$Palette9, _theme$Palette10, _theme$Palette11;
|
|
11
|
+
let {
|
|
12
|
+
theme
|
|
13
|
+
} = _ref;
|
|
14
|
+
return {
|
|
15
|
+
connector: {
|
|
16
|
+
backgroundColor: (_theme$Palette = theme.Palette) === null || _theme$Palette === void 0 ? void 0 : _theme$Palette.light['05']
|
|
17
|
+
},
|
|
18
|
+
coloredProgress: {
|
|
19
|
+
backgroundColor: "".concat((_theme$Palette2 = theme.Palette) === null || _theme$Palette2 === void 0 || (_theme$Palette2 = _theme$Palette2.actions) === null || _theme$Palette2 === void 0 ? void 0 : _theme$Palette2.accent['04'], " !important")
|
|
20
|
+
},
|
|
21
|
+
stepContainerS: {
|
|
22
|
+
backgroundColor: (_theme$Palette3 = theme.Palette) === null || _theme$Palette3 === void 0 ? void 0 : _theme$Palette3.light['05'],
|
|
23
|
+
borderColor: (_theme$Palette4 = theme.Palette) === null || _theme$Palette4 === void 0 ? void 0 : _theme$Palette4.light['03']
|
|
24
|
+
},
|
|
25
|
+
stepContainerL: {
|
|
26
|
+
backgroundColor: (_theme$Palette5 = theme.Palette) === null || _theme$Palette5 === void 0 ? void 0 : _theme$Palette5.light['03']
|
|
27
|
+
},
|
|
28
|
+
activeS: {
|
|
29
|
+
backgroundColor: _colorsModule.default.white,
|
|
30
|
+
borderColor: (_theme$Palette6 = theme.Palette) === null || _theme$Palette6 === void 0 || (_theme$Palette6 = _theme$Palette6.actions) === null || _theme$Palette6 === void 0 ? void 0 : _theme$Palette6.accent['04']
|
|
31
|
+
},
|
|
32
|
+
activeL: {
|
|
33
|
+
backgroundColor: (_theme$Palette7 = theme.Palette) === null || _theme$Palette7 === void 0 || (_theme$Palette7 = _theme$Palette7.actions) === null || _theme$Palette7 === void 0 ? void 0 : _theme$Palette7.accent['04']
|
|
34
|
+
},
|
|
35
|
+
completed: {
|
|
36
|
+
backgroundColor: (_theme$Palette8 = theme.Palette) === null || _theme$Palette8 === void 0 || (_theme$Palette8 = _theme$Palette8.actions) === null || _theme$Palette8 === void 0 ? void 0 : _theme$Palette8.accent['04'],
|
|
37
|
+
borderColor: (_theme$Palette9 = theme.Palette) === null || _theme$Palette9 === void 0 || (_theme$Palette9 = _theme$Palette9.actions) === null || _theme$Palette9 === void 0 ? void 0 : _theme$Palette9.accent['04']
|
|
38
|
+
},
|
|
39
|
+
activeIcon: {
|
|
40
|
+
fill: _colorsModule.default.white
|
|
41
|
+
},
|
|
42
|
+
nextIcon: {
|
|
43
|
+
fill: (_theme$Palette10 = theme.Palette) === null || _theme$Palette10 === void 0 ? void 0 : _theme$Palette10.gray['04']
|
|
44
|
+
},
|
|
45
|
+
coloredLabel: {
|
|
46
|
+
color: "".concat((_theme$Palette11 = theme.Palette) === null || _theme$Palette11 === void 0 || (_theme$Palette11 = _theme$Palette11.actions) === null || _theme$Palette11 === void 0 ? void 0 : _theme$Palette11.accent['04'], " !important")
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
exports.retrieveStyle = retrieveStyle;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.retrieveStyle = exports.retrieveMuiTheme = void 0;
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
8
|
var _styles = require("@material-ui/core/styles");
|
|
9
|
-
var
|
|
9
|
+
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
10
10
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
const retrieveStyle = _ref => {
|
|
@@ -129,6 +129,6 @@ const retrieveMuiTheme = (theme, muiTheme) => {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
|
-
return (0, _styles.createTheme)(
|
|
132
|
+
return (0, _styles.createTheme)((0, _merge.default)(muiTheme, mui));
|
|
133
133
|
};
|
|
134
134
|
exports.retrieveMuiTheme = retrieveMuiTheme;
|