@widergy/energy-ui 3.17.1 → 3.18.1
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 +22 -0
- package/dist/components/UTBadge/constants.js +2 -11
- package/dist/components/UTBadge/index.js +2 -1
- package/dist/components/UTBadge/theme.js +4 -13
- package/dist/components/UTButton/index.js +15 -6
- package/dist/components/UTButton/styles.module.scss +53 -32
- package/dist/components/UTButton/theme.js +2 -5
- package/dist/components/UTButton/utils.js +4 -2
- package/dist/components/UTIcon/theme.js +2 -3
- package/dist/components/UTLabel/theme.js +3 -3
- package/dist/components/UTTracker/README.md +24 -0
- package/dist/components/UTTracker/components/Step/index.js +82 -0
- package/dist/components/UTTracker/components/Step/styles.module.scss +58 -0
- package/dist/components/UTTracker/components/SubStep/index.js +38 -0
- package/dist/components/UTTracker/components/SubStep/styles.module.scss +4 -0
- package/dist/components/UTTracker/constants.js +39 -0
- package/dist/components/UTTracker/index.js +105 -0
- package/dist/components/UTTracker/propTypes.js +26 -0
- package/dist/components/UTTracker/styles.module.scss +73 -0
- package/dist/components/UTTracker/theme.js +82 -0
- package/dist/components/UTTracker/utils.js +16 -0
- package/dist/index.js +8 -1
- package/dist/utils/componentUtils.js +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## [3.18.1](https://github.com/widergy/energy-ui/compare/v3.18.0...v3.18.1) (2024-08-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add counter ([#480](https://github.com/widergy/energy-ui/issues/480)) ([7d2d122](https://github.com/widergy/energy-ui/commit/7d2d12228d53af2937c0258756037329ba32714d))
|
|
7
|
+
|
|
8
|
+
# [3.18.0](https://github.com/widergy/energy-ui/compare/v3.17.1...v3.18.0) (2024-08-26)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* import ([e97d3a2](https://github.com/widergy/energy-ui/commit/e97d3a205822fe9ee485efa6b5127e876c828d87))
|
|
14
|
+
* some fixes ([2050111](https://github.com/widergy/energy-ui/commit/20501114dce2f5fbf9623a70a9c3fe216a045071))
|
|
15
|
+
* some fixes ([ace0413](https://github.com/widergy/energy-ui/commit/ace04133a7a954d4676e046950b8d21655be5d23))
|
|
16
|
+
* styles ([4de22c5](https://github.com/widergy/energy-ui/commit/4de22c5344ed1b5094039ade8463a70262c03cff))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* add uttracker ([d4ce615](https://github.com/widergy/energy-ui/commit/d4ce615cfd96eba2381c4da547a8c7040d7232a0))
|
|
22
|
+
|
|
1
23
|
## [3.17.1](https://github.com/widergy/energy-ui/compare/v3.17.0...v3.17.1) (2024-08-21)
|
|
2
24
|
|
|
3
25
|
|
|
@@ -3,16 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.DEFAULT_PROPS =
|
|
7
|
-
const COLORS_MAPPER = exports.COLORS_MAPPER = {
|
|
8
|
-
alert: 'error',
|
|
9
|
-
identity: 'accent',
|
|
10
|
-
identitySecondary: 'neutral',
|
|
11
|
-
information: 'information',
|
|
12
|
-
negative: 'negative',
|
|
13
|
-
success: 'success',
|
|
14
|
-
warning: 'warning'
|
|
15
|
-
};
|
|
6
|
+
exports.DEFAULT_PROPS = void 0;
|
|
16
7
|
const DEFAULT_PROPS = exports.DEFAULT_PROPS = {
|
|
17
|
-
colorTheme: '
|
|
8
|
+
colorTheme: 'error'
|
|
18
9
|
};
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
|
+
var _Palette = require("../../constants/Palette");
|
|
9
10
|
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
10
11
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
11
12
|
var _theme = require("./theme");
|
|
@@ -19,7 +20,7 @@ const UTBadge = _ref => {
|
|
|
19
20
|
className,
|
|
20
21
|
colorTheme
|
|
21
22
|
} = _ref;
|
|
22
|
-
const textColorTheme = colorTheme
|
|
23
|
+
const textColorTheme = [_Palette.COLOR_THEMES.negative, _Palette.COLOR_THEMES.light].includes(colorTheme) ? 'dark' : 'negative';
|
|
23
24
|
const Component = children ? _UTLabel.default : 'span';
|
|
24
25
|
const componentProps = children ? {
|
|
25
26
|
colorTheme: textColorTheme,
|
|
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.variantsColorTheme = exports.retrieveStyle = void 0;
|
|
7
|
+
var _componentUtils = require("../../utils/componentUtils");
|
|
7
8
|
var _constants = require("./constants");
|
|
8
9
|
const variantsColorTheme = (theme, colorTheme) => {
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const backgroundColorMapper = {
|
|
12
|
-
alert: paletteTheme['04'],
|
|
13
|
-
information: paletteTheme['05'],
|
|
14
|
-
warning: paletteTheme['05'],
|
|
15
|
-
success: paletteTheme['05'],
|
|
16
|
-
identity: paletteTheme['05'],
|
|
17
|
-
identitySecondary: paletteTheme['05'],
|
|
18
|
-
negative: paletteTheme['04']
|
|
19
|
-
};
|
|
10
|
+
const colorThemeDefinition = theme.Palette[colorTheme] || theme.Palette.actions?.[colorTheme] || theme.Palette[_constants.DEFAULT_PROPS.colorTheme];
|
|
11
|
+
const colorShade = (0, _componentUtils.getDefaultColorShade)(colorTheme);
|
|
20
12
|
return {
|
|
21
|
-
backgroundColor:
|
|
13
|
+
backgroundColor: colorThemeDefinition[colorShade]
|
|
22
14
|
};
|
|
23
15
|
};
|
|
24
16
|
exports.variantsColorTheme = variantsColorTheme;
|
|
@@ -29,7 +21,6 @@ const baseButtonTheme = () => ({
|
|
|
29
21
|
display: 'inline-flex',
|
|
30
22
|
height: 'fit-content',
|
|
31
23
|
justifyContent: 'center',
|
|
32
|
-
margin: 10,
|
|
33
24
|
minHeight: '10px',
|
|
34
25
|
minWidth: '10px',
|
|
35
26
|
verticalAlign: 'middle'
|
|
@@ -8,7 +8,9 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
9
9
|
var _CircularProgress = _interopRequireDefault(require("@material-ui/core/CircularProgress"));
|
|
10
10
|
var _propTypes = require("prop-types");
|
|
11
|
+
var _componentUtils = require("../../utils/componentUtils");
|
|
11
12
|
var _classesUtils = require("../../utils/classesUtils");
|
|
13
|
+
var _UTBadge = _interopRequireDefault(require("../UTBadge"));
|
|
12
14
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
13
15
|
var _constants = require("./constants");
|
|
14
16
|
var _theme = require("./theme");
|
|
@@ -23,6 +25,7 @@ const UTButton = _ref => {
|
|
|
23
25
|
classes: theme,
|
|
24
26
|
classNames,
|
|
25
27
|
colorTheme,
|
|
28
|
+
count,
|
|
26
29
|
dataTestId,
|
|
27
30
|
disabled,
|
|
28
31
|
hideTextOnResponsive,
|
|
@@ -54,16 +57,21 @@ const UTButton = _ref => {
|
|
|
54
57
|
variant
|
|
55
58
|
}), [colorTheme, children, hideTextOnResponsive, icon, Icon, size, variant]);
|
|
56
59
|
const IconToShow = IconComponent && /*#__PURE__*/_react.default.createElement(IconComponent, iconProps);
|
|
60
|
+
const counterColorTheme = (0, _utils.getCounterColorTheme)(colorTheme, variant);
|
|
57
61
|
const RenderedChildren = /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
-
className: `
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
className: `${_stylesModule.default.text} ${hideTextOnResponsive && _stylesModule.default.hideTextOnResponsive} ${classes.text}`
|
|
62
|
+
className: `${childrenContainer} ${_stylesModule.default.childrenContainer}`
|
|
63
|
+
}, count && /*#__PURE__*/_react.default.createElement(_UTBadge.default, {
|
|
64
|
+
colorTheme: counterColorTheme
|
|
65
|
+
}, count), iconPlacement === _constants.ICON_PLACEMENTS.left && IconToShow, children !== null && children !== undefined && children !== false && /*#__PURE__*/_react.default.createElement("div", {
|
|
66
|
+
className: `${_stylesModule.default.textContainer} ${classes.text}`
|
|
64
67
|
}, children), iconPlacement !== _constants.ICON_PLACEMENTS.left && IconToShow);
|
|
65
68
|
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
66
69
|
classes: materialButtonClasses,
|
|
70
|
+
className: `
|
|
71
|
+
${_stylesModule.default[`padding${(0, _componentUtils.capitalize)(size)}`]}
|
|
72
|
+
${hideTextOnResponsive && _stylesModule.default.hideTextOnResponsive}
|
|
73
|
+
${!hideTextOnResponsive && !children && _stylesModule.default.noChildren}}
|
|
74
|
+
`,
|
|
67
75
|
"data-testid": dataTestId,
|
|
68
76
|
disabled: disabled || loading,
|
|
69
77
|
onClick: onClick,
|
|
@@ -80,6 +88,7 @@ UTButton.propTypes = {
|
|
|
80
88
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
81
89
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
82
90
|
colorTheme: _propTypes.string,
|
|
91
|
+
count: _propTypes.number,
|
|
83
92
|
dataTestId: _propTypes.string,
|
|
84
93
|
disabled: _propTypes.bool,
|
|
85
94
|
hideTextOnResponsive: _propTypes.bool,
|
|
@@ -3,26 +3,6 @@
|
|
|
3
3
|
$big-icon: 1.5rem;
|
|
4
4
|
$small-icon: 1.25rem;
|
|
5
5
|
|
|
6
|
-
.hideTextOnResponsive {
|
|
7
|
-
@media #{$mobile} {
|
|
8
|
-
display: none;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.text {
|
|
13
|
-
.baseIcon + &,
|
|
14
|
-
& + .baseIcon {
|
|
15
|
-
margin-left: 8px;
|
|
16
|
-
|
|
17
|
-
&.adaptableIconMedium,
|
|
18
|
-
&.adaptableIconLarge {
|
|
19
|
-
@media #{$mobile} {
|
|
20
|
-
margin-left: -4px;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
6
|
.baseIcon {
|
|
27
7
|
box-sizing: border-box;
|
|
28
8
|
flex-shrink: 0;
|
|
@@ -40,26 +20,14 @@ $small-icon: 1.25rem;
|
|
|
40
20
|
.iconOnlyMedium {
|
|
41
21
|
font-size: $big-icon;
|
|
42
22
|
height: $big-icon;
|
|
43
|
-
margin: -1px -5px;
|
|
44
23
|
width: $big-icon;
|
|
45
24
|
}
|
|
46
25
|
|
|
47
|
-
.iconOnlySmall {
|
|
48
|
-
margin: -1px -5px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.adaptableIconSmall {
|
|
52
|
-
@media #{$mobile} {
|
|
53
|
-
margin: -1px -5px;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
26
|
.adaptableIconLarge,
|
|
58
27
|
.adaptableIconMedium {
|
|
59
28
|
@media #{$mobile} {
|
|
60
29
|
font-size: $big-icon;
|
|
61
30
|
height: $big-icon;
|
|
62
|
-
margin: -1px -5px;
|
|
63
31
|
width: $big-icon;
|
|
64
32
|
}
|
|
65
33
|
}
|
|
@@ -67,9 +35,62 @@ $small-icon: 1.25rem;
|
|
|
67
35
|
.childrenContainer {
|
|
68
36
|
align-items: center;
|
|
69
37
|
display: flex;
|
|
38
|
+
grid-gap: 8px;
|
|
70
39
|
justify-content: flex-start;
|
|
71
40
|
}
|
|
72
41
|
|
|
73
42
|
.loading {
|
|
74
43
|
position: absolute;
|
|
75
44
|
}
|
|
45
|
+
|
|
46
|
+
.paddingLarge {
|
|
47
|
+
padding: 12px 16px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.paddingMedium {
|
|
51
|
+
padding: 8px 12px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.paddingSmall {
|
|
55
|
+
padding: 4px 8px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.hideTextOnResponsive {
|
|
59
|
+
.textContainer {
|
|
60
|
+
@media #{$mobile} {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.paddingLarge {
|
|
66
|
+
@media #{$mobile} {
|
|
67
|
+
padding: 12px;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&.paddingMedium {
|
|
72
|
+
@media #{$mobile} {
|
|
73
|
+
padding: 8px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.paddingSmall {
|
|
78
|
+
@media #{$mobile} {
|
|
79
|
+
padding: 4px;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.noChildren {
|
|
85
|
+
&.paddingLarge {
|
|
86
|
+
padding: 12px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&.paddingMedium {
|
|
90
|
+
padding: 8px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&.paddingSmall {
|
|
94
|
+
padding: 4px;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -135,19 +135,16 @@ const baseButtonTheme = theme => ({
|
|
|
135
135
|
fontWeight: '500',
|
|
136
136
|
lineHeight: '1.375rem',
|
|
137
137
|
minWidth: 'auto',
|
|
138
|
-
padding: '8px 12px',
|
|
139
138
|
textTransform: 'none',
|
|
140
139
|
transition: 'background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms'
|
|
141
140
|
},
|
|
142
141
|
sizeLarge: {
|
|
143
142
|
fontSize: '1rem',
|
|
144
|
-
fontWeight: '500'
|
|
145
|
-
padding: '12px 16px'
|
|
143
|
+
fontWeight: '500'
|
|
146
144
|
},
|
|
147
145
|
sizeSmall: {
|
|
148
146
|
fontSize: '0.875rem',
|
|
149
|
-
fontWeight: '500'
|
|
150
|
-
padding: '4px 8px'
|
|
147
|
+
fontWeight: '500'
|
|
151
148
|
},
|
|
152
149
|
circularProgress: {
|
|
153
150
|
color: theme.UTButton?.circularProgress?.color || '484848'
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getIconProps = void 0;
|
|
6
|
+
exports.getIconProps = exports.getCounterColorTheme = void 0;
|
|
7
7
|
var _Palette = require("../../constants/Palette");
|
|
8
8
|
var _componentUtils = require("../../utils/componentUtils");
|
|
9
9
|
var _UTIcon = _interopRequireDefault(require("../UTIcon"));
|
|
@@ -36,4 +36,6 @@ const getIconProps = _ref => {
|
|
|
36
36
|
} : {})
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
|
-
exports.getIconProps = getIconProps;
|
|
39
|
+
exports.getIconProps = getIconProps;
|
|
40
|
+
const getCounterColorTheme = (colorTheme, variant) => variant === _constants.VARIANTS_NAMES.filled ? colorTheme === _Palette.COLOR_THEMES.negative ? 'dark' : 'negative' : _constants.COLORS_MAPPER[colorTheme];
|
|
41
|
+
exports.getCounterColorTheme = getCounterColorTheme;
|
|
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveColor = exports.getIconProps = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _componentUtils = require("../../utils/componentUtils");
|
|
8
8
|
var _constants = require("./constants");
|
|
9
|
-
const getDefaultColorShade = colorTheme => colorTheme === _Palette.COLOR_THEMES.gray ? _Palette.COLOR_SHADES.shade04 : colorTheme === _Palette.COLOR_THEMES.light ? _Palette.COLOR_SHADES.shade01 : _Palette.COLOR_SHADES.shade05;
|
|
10
9
|
const retrieveColor = _ref => {
|
|
11
10
|
let {
|
|
12
11
|
colorTheme,
|
|
@@ -14,7 +13,7 @@ const retrieveColor = _ref => {
|
|
|
14
13
|
theme
|
|
15
14
|
} = _ref;
|
|
16
15
|
const colorThemeDefinition = theme.Palette[colorTheme] || theme.Palette.actions?.[colorTheme] || theme.Palette[_constants.DEFAULT_COLOR_THEME];
|
|
17
|
-
const colorShade = shade || getDefaultColorShade(colorTheme);
|
|
16
|
+
const colorShade = shade || (0, _componentUtils.getDefaultColorShade)(colorTheme);
|
|
18
17
|
return colorThemeDefinition[colorShade];
|
|
19
18
|
};
|
|
20
19
|
exports.retrieveColor = retrieveColor;
|
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
|
-
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
8
7
|
var _Palette = require("../../constants/Palette");
|
|
8
|
+
var _componentUtils = require("../../utils/componentUtils");
|
|
9
|
+
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
9
10
|
var _constants = require("./constants");
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const getDefaultColorShade = colorTheme => colorTheme === _Palette.COLOR_THEMES.gray ? _Palette.COLOR_SHADES.shade04 : colorTheme === _Palette.COLOR_THEMES.light ? _Palette.COLOR_SHADES.shade01 : _Palette.COLOR_SHADES.shade05;
|
|
12
12
|
const variantsColorTheme = (colorTheme, shade, theme) => {
|
|
13
13
|
const colorThemeDefinition = theme.Palette[colorTheme] || theme.Palette.actions?.[colorTheme] || theme.Palette[_constants.DEFAULT_PROPS.colorTheme];
|
|
14
|
-
const colorShade = Object.values(_Palette.COLOR_SHADES).includes(shade) ? shade : getDefaultColorShade(colorTheme);
|
|
14
|
+
const colorShade = Object.values(_Palette.COLOR_SHADES).includes(shade) ? shade : (0, _componentUtils.getDefaultColorShade)(colorTheme);
|
|
15
15
|
return colorThemeDefinition[colorShade] || _colorsModule.default.black;
|
|
16
16
|
};
|
|
17
17
|
const linkColor = (theme, colorTheme) => {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# UTTracker
|
|
2
|
+
|
|
3
|
+
### Description
|
|
4
|
+
|
|
5
|
+
This component displays a vertical stepper intended to track progress
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
|
|
9
|
+
| Name | Type | Default | Description |
|
|
10
|
+
| ----------- | ----------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| title | string | | Displays the title above the tracker. |
|
|
12
|
+
| mode | card \| flat | card | Defines whether the component should display as a card or as the bare components without any background. |
|
|
13
|
+
| variant | standard \| error | standard | Defines the color scheme of the tracker steps and the icon on the active step. |
|
|
14
|
+
| steps | stepsType | | Displays a step with a rounded icon on the left for each object received. |
|
|
15
|
+
| currentStep | number | | Defines which step will be active, previous ones will be marked as completed while following ones will not. Use 1 for the first step |
|
|
16
|
+
| detailsTab | detailsType | | Defines whether the detailsTab is enabled or not, if it is, it will show the subSteps of each step. The title property shows a message along the tab (card mode only) |
|
|
17
|
+
|
|
18
|
+
### Custom Types
|
|
19
|
+
|
|
20
|
+
| Type | Shape |
|
|
21
|
+
| ------------ | ------------------------------------------------------------------------------ |
|
|
22
|
+
| stepsType | `{ id: number, title: string, subtitle: string, subSteps: [...subStepsType] }` |
|
|
23
|
+
| subStepsType | `{ id: number, title: string, subtitle: string }` |
|
|
24
|
+
| detailsType | `{ enabled: bool, title: string }` |
|
|
@@ -0,0 +1,82 @@
|
|
|
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 _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
10
|
+
var _propTypes2 = require("../../propTypes");
|
|
11
|
+
var _UTIcon = _interopRequireDefault(require("../../../UTIcon"));
|
|
12
|
+
var _constants = require("../../constants");
|
|
13
|
+
var _classesUtils = require("../../../../utils/classesUtils");
|
|
14
|
+
var _utils = require("../../utils");
|
|
15
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
const ERROR_ICON_SIZE = 16;
|
|
18
|
+
const Step = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
first,
|
|
21
|
+
isActive,
|
|
22
|
+
isCompleted,
|
|
23
|
+
step,
|
|
24
|
+
classes = {},
|
|
25
|
+
variant
|
|
26
|
+
} = _ref;
|
|
27
|
+
const stepCompleted = isCompleted(step.id);
|
|
28
|
+
const stepActive = isActive(step.id);
|
|
29
|
+
const themedStyles = (0, _classesUtils.mergeClasses)({}, _stylesModule.default);
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
31
|
+
className: `
|
|
32
|
+
${themedStyles.outerContainer}
|
|
33
|
+
${stepActive && themedStyles.activeOuterContainer}
|
|
34
|
+
${first && _stylesModule.default.stepMargin}
|
|
35
|
+
`
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
37
|
+
className: themedStyles.containerStep
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
39
|
+
className: `
|
|
40
|
+
${themedStyles.container}
|
|
41
|
+
${classes.containerStep}
|
|
42
|
+
${stepCompleted && classes.completedLight}
|
|
43
|
+
${stepActive && classes.activeContainer}
|
|
44
|
+
${stepActive && variant === _constants.ERROR && classes.fullContainer}
|
|
45
|
+
`
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
47
|
+
className: `
|
|
48
|
+
${themedStyles.innerContainer}
|
|
49
|
+
${classes.innerContainer}
|
|
50
|
+
${stepCompleted && classes.completedInnerContainer}
|
|
51
|
+
${stepActive && classes.activeInnerContainer}
|
|
52
|
+
${stepCompleted && themedStyles.completedOuterContainer}
|
|
53
|
+
`
|
|
54
|
+
}, stepActive && variant === _constants.ERROR && /*#__PURE__*/_react.default.createElement(_UTIcon.default, {
|
|
55
|
+
colorTheme: "light",
|
|
56
|
+
name: "IconX",
|
|
57
|
+
size: ERROR_ICON_SIZE,
|
|
58
|
+
className: themedStyles.icon
|
|
59
|
+
})))), /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
+
className: `${themedStyles.textContainer} ${stepCompleted && themedStyles.completedOuterContainer}`
|
|
61
|
+
}, step.title && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
62
|
+
className: `${stepCompleted ? themedStyles.completedTitleColor : stepActive ? themedStyles.activeTitleColor : themedStyles.titleColor}`,
|
|
63
|
+
colorTheme: stepActive ? (0, _utils.getLabelTheme)(variant) : 'dark',
|
|
64
|
+
variant: "small",
|
|
65
|
+
weight: "medium"
|
|
66
|
+
}, step.title), step.subtitle && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
67
|
+
className: `${themedStyles.subtitleColor} ${themedStyles.subtitle}`
|
|
68
|
+
}, step.subtitle), step.description && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
69
|
+
variant: "small",
|
|
70
|
+
colorTheme: "gray",
|
|
71
|
+
className: themedStyles.description
|
|
72
|
+
}, step.description)));
|
|
73
|
+
};
|
|
74
|
+
Step.propTypes = {
|
|
75
|
+
classes: _propTypes.object,
|
|
76
|
+
first: _propTypes.bool,
|
|
77
|
+
isActive: _propTypes.func,
|
|
78
|
+
isCompleted: _propTypes.func,
|
|
79
|
+
step: _propTypes2.StepPropTypes,
|
|
80
|
+
variant: _propTypes2.VariantPropTypes
|
|
81
|
+
};
|
|
82
|
+
var _default = exports.default = Step;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
$oval-size: 20px;
|
|
2
|
+
|
|
3
|
+
.completedOuterContainer {
|
|
4
|
+
opacity: 0.5;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.container {
|
|
8
|
+
align-items: center;
|
|
9
|
+
border-radius: $oval-size;
|
|
10
|
+
border-style: solid;
|
|
11
|
+
border-width: calc(#{$oval-size} / 10);
|
|
12
|
+
display: flex;
|
|
13
|
+
height: $oval-size;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
width: $oval-size;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.description {
|
|
19
|
+
margin-top: 4px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.icon {
|
|
23
|
+
align-self: center;
|
|
24
|
+
margin-left: -2.5px;
|
|
25
|
+
margin-top: -3px;
|
|
26
|
+
position: absolute;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.innerContainer {
|
|
30
|
+
align-items: center;
|
|
31
|
+
border-radius: ($oval-size / 2);
|
|
32
|
+
height: ($oval-size / 2);
|
|
33
|
+
width: ($oval-size / 2);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.outerContainer {
|
|
37
|
+
align-items: center;
|
|
38
|
+
display: flex;
|
|
39
|
+
grid-gap: 8px;
|
|
40
|
+
margin: 16px 16px 0 16px;
|
|
41
|
+
position: relative;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.stepMargin {
|
|
45
|
+
margin-top: 24px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.subtitle {
|
|
49
|
+
margin-top: 4px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.textContainer {
|
|
53
|
+
width: 60%;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.containerStep {
|
|
57
|
+
padding: 6px;
|
|
58
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 _merge = _interopRequireDefault(require("lodash/merge"));
|
|
10
|
+
var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
11
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const SubStep = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
style,
|
|
16
|
+
subtitle,
|
|
17
|
+
title
|
|
18
|
+
} = _ref;
|
|
19
|
+
const themedStyles = (0, _merge.default)({}, _stylesModule.default, style);
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
21
|
+
className: themedStyles.container
|
|
22
|
+
}, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
23
|
+
colorTheme: "gray",
|
|
24
|
+
className: themedStyles.titleColor,
|
|
25
|
+
variant: "small"
|
|
26
|
+
}, title), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
27
|
+
colorTheme: "gray",
|
|
28
|
+
className: themedStyles.subtitleColor,
|
|
29
|
+
variant: "small",
|
|
30
|
+
shade: "01"
|
|
31
|
+
}, subtitle));
|
|
32
|
+
};
|
|
33
|
+
SubStep.propTypes = {
|
|
34
|
+
style: _propTypes.string,
|
|
35
|
+
subtitle: _propTypes.string,
|
|
36
|
+
title: _propTypes.string
|
|
37
|
+
};
|
|
38
|
+
var _default = exports.default = SubStep;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ownModeStyles = exports.VARIANTS = exports.STANDARD = exports.OVAL_SIZE = exports.FLAT = exports.ERROR = exports.DETAILS_ICON_FLAT_SIZE = exports.DETAILS_ICON_CARD_SIZE = exports.DEFAULT_PROPS = exports.CARD = void 0;
|
|
7
|
+
const CARD = exports.CARD = 'card';
|
|
8
|
+
const FLAT = exports.FLAT = 'flat';
|
|
9
|
+
const STANDARD = exports.STANDARD = 'standard';
|
|
10
|
+
const ERROR = exports.ERROR = 'error';
|
|
11
|
+
const OVAL_SIZE = exports.OVAL_SIZE = 20;
|
|
12
|
+
const DETAILS_ICON_CARD_SIZE = exports.DETAILS_ICON_CARD_SIZE = 20;
|
|
13
|
+
const DETAILS_ICON_FLAT_SIZE = exports.DETAILS_ICON_FLAT_SIZE = 24;
|
|
14
|
+
const ownModeStyles = exports.ownModeStyles = {
|
|
15
|
+
[CARD]: {
|
|
16
|
+
container: {
|
|
17
|
+
backgroundColor: 'white',
|
|
18
|
+
elevation: 2,
|
|
19
|
+
shadowColor: 'black',
|
|
20
|
+
shadowOffset: {
|
|
21
|
+
height: 3,
|
|
22
|
+
width: 0
|
|
23
|
+
},
|
|
24
|
+
shadowOpacity: 0.1
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
[FLAT]: {
|
|
28
|
+
container: {
|
|
29
|
+
backgroundColor: 'transparent'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const VARIANTS = exports.VARIANTS = {
|
|
34
|
+
error: 'error',
|
|
35
|
+
standar: 'standar'
|
|
36
|
+
};
|
|
37
|
+
const DEFAULT_PROPS = exports.DEFAULT_PROPS = {
|
|
38
|
+
variant: 'standar'
|
|
39
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
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 _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
10
|
+
var _UTButton = _interopRequireDefault(require("../UTButton"));
|
|
11
|
+
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
12
|
+
var _classesUtils = require("../../utils/classesUtils");
|
|
13
|
+
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
14
|
+
var _theme = require("./theme");
|
|
15
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
16
|
+
var _Step = _interopRequireDefault(require("./components/Step"));
|
|
17
|
+
var _SubStep = _interopRequireDefault(require("./components/SubStep"));
|
|
18
|
+
var _propTypes2 = require("./propTypes");
|
|
19
|
+
var _constants = require("./constants");
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
|
+
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); }
|
|
22
|
+
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 && {}.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; }
|
|
23
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
24
|
+
const UTTracker = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
classes: themeClasses = {},
|
|
27
|
+
classNames,
|
|
28
|
+
currentStep,
|
|
29
|
+
detailsTab,
|
|
30
|
+
mode = _constants.CARD,
|
|
31
|
+
steps,
|
|
32
|
+
title,
|
|
33
|
+
variant = _constants.STANDARD
|
|
34
|
+
} = _ref;
|
|
35
|
+
const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(themeClasses, classNames), [classNames]);
|
|
36
|
+
const [isCollapsed, setIsCollapsed] = (0, _react.useState)(false);
|
|
37
|
+
const [height, setHeight] = (0, _react.useState)(0);
|
|
38
|
+
const isCompleted = stepNumber => stepNumber < currentStep;
|
|
39
|
+
const isActive = stepNumber => stepNumber === currentStep;
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
41
|
+
className: `${classes.outerContainer}`
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
43
|
+
className: `${classes.container} ${mode !== _constants.FLAT ? _stylesModule.default.container : _stylesModule.default.containerFlat} ${!detailsTab && _stylesModule.default.roundedBorders}`
|
|
44
|
+
}, title && (mode === _constants.FLAT ? /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
45
|
+
onClick: () => setIsCollapsed(!isCollapsed),
|
|
46
|
+
classNames: {
|
|
47
|
+
childrenContainer: _stylesModule.default.button,
|
|
48
|
+
root: _stylesModule.default.titleTouchable,
|
|
49
|
+
text: _stylesModule.default.text
|
|
50
|
+
},
|
|
51
|
+
variant: "text",
|
|
52
|
+
Icon: detailsTab?.enabled && mode === _constants.FLAT ? isCollapsed ? 'IconChevronUp' : 'IconChevronDown' : null,
|
|
53
|
+
iconPlacement: "right"
|
|
54
|
+
}, title) : /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
55
|
+
weight: "medium",
|
|
56
|
+
variant: "subtitle1"
|
|
57
|
+
}, title)), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
+
style: {
|
|
59
|
+
height
|
|
60
|
+
},
|
|
61
|
+
className: `${title ? _stylesModule.default.connectorTitle : _stylesModule.default.connector} ${isCollapsed ? _stylesModule.default.connectorCollapsed : _stylesModule.default.connector}`
|
|
62
|
+
}), steps && /*#__PURE__*/_react.default.createElement("div", {
|
|
63
|
+
ref: el => {
|
|
64
|
+
if (!el) return;
|
|
65
|
+
setHeight(el.getBoundingClientRect().height - 45);
|
|
66
|
+
}
|
|
67
|
+
}, steps?.map((step, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
68
|
+
key: step.id
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(_Step.default, {
|
|
70
|
+
first: index === 0,
|
|
71
|
+
index,
|
|
72
|
+
isActive,
|
|
73
|
+
isCompleted,
|
|
74
|
+
step,
|
|
75
|
+
variant,
|
|
76
|
+
classes: classes
|
|
77
|
+
}), isCollapsed && /*#__PURE__*/_react.default.createElement("div", null, !(0, _isEmpty.default)(step.subSteps) && step.subSteps?.map(subStep => /*#__PURE__*/_react.default.createElement(_SubStep.default, _extends({
|
|
78
|
+
key: subStep.id
|
|
79
|
+
}, subStep, {
|
|
80
|
+
className: classes.subStep
|
|
81
|
+
}))))))))), detailsTab?.enabled && mode === _constants.CARD && /*#__PURE__*/_react.default.createElement("div", {
|
|
82
|
+
className: `${_stylesModule.default.detailButtonContainer} ${classes.detailButtonContainer}`
|
|
83
|
+
}, /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
84
|
+
classNames: {
|
|
85
|
+
childrenContainer: _stylesModule.default.button,
|
|
86
|
+
icon: _stylesModule.default.detailIcon,
|
|
87
|
+
text: _stylesModule.default.text
|
|
88
|
+
},
|
|
89
|
+
Icon: isCollapsed ? 'IconChevronUp' : 'IconChevronDown',
|
|
90
|
+
iconPlacement: "right",
|
|
91
|
+
onClick: () => setIsCollapsed(!isCollapsed),
|
|
92
|
+
variant: "text"
|
|
93
|
+
}, detailsTab.title)));
|
|
94
|
+
};
|
|
95
|
+
UTTracker.propTypes = {
|
|
96
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
97
|
+
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
98
|
+
currentStep: _propTypes.number,
|
|
99
|
+
detailsTab: _propTypes2.DetailsTabPropTypes,
|
|
100
|
+
mode: _propTypes2.ModePropTypes,
|
|
101
|
+
steps: _propTypes2.StepsPropTypes,
|
|
102
|
+
title: _propTypes.string,
|
|
103
|
+
variant: _propTypes2.VariantPropTypes
|
|
104
|
+
};
|
|
105
|
+
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTTracker);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VariantPropTypes = exports.SubStepPropTypes = exports.StepsPropTypes = exports.StepPropTypes = exports.ModePropTypes = exports.DetailsTabPropTypes = void 0;
|
|
7
|
+
var _propTypes = require("prop-types");
|
|
8
|
+
var _constants = require("./constants");
|
|
9
|
+
const SubStepPropTypes = exports.SubStepPropTypes = (0, _propTypes.shape)({
|
|
10
|
+
id: _propTypes.number,
|
|
11
|
+
subtitle: _propTypes.string,
|
|
12
|
+
title: _propTypes.string
|
|
13
|
+
});
|
|
14
|
+
const StepPropTypes = exports.StepPropTypes = (0, _propTypes.shape)({
|
|
15
|
+
id: _propTypes.number,
|
|
16
|
+
subSteps: (0, _propTypes.arrayOf)(SubStepPropTypes),
|
|
17
|
+
subtitle: _propTypes.string,
|
|
18
|
+
title: _propTypes.string
|
|
19
|
+
});
|
|
20
|
+
const StepsPropTypes = exports.StepsPropTypes = (0, _propTypes.arrayOf)(StepPropTypes);
|
|
21
|
+
const DetailsTabPropTypes = exports.DetailsTabPropTypes = (0, _propTypes.shape)({
|
|
22
|
+
enabled: _propTypes.bool,
|
|
23
|
+
title: _propTypes.string
|
|
24
|
+
});
|
|
25
|
+
const ModePropTypes = exports.ModePropTypes = (0, _propTypes.oneOf)([_constants.CARD, _constants.FLAT]);
|
|
26
|
+
const VariantPropTypes = exports.VariantPropTypes = (0, _propTypes.oneOf)([_constants.STANDARD, _constants.ERROR]);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@import '../../scss/variables/colors.module.scss';
|
|
2
|
+
|
|
3
|
+
.container {
|
|
4
|
+
border-top-left-radius: 8px;
|
|
5
|
+
border-top-right-radius: 8px;
|
|
6
|
+
box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.1);
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
padding: 16px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.containerFlat {
|
|
13
|
+
background-color: transparent;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.detailButtonContainer {
|
|
17
|
+
align-self: baseline;
|
|
18
|
+
border-radius: 0 0 6px 6px;
|
|
19
|
+
box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.1);
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: row;
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.roundedBorders {
|
|
26
|
+
border-bottom-left-radius: 8px;
|
|
27
|
+
border-bottom-right-radius: 8px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.titleContainer {
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
display: flex;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.titleTouchable {
|
|
36
|
+
align-self: baseline;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.connector {
|
|
40
|
+
border-left: 2px dashed gray;
|
|
41
|
+
flex-grow: 1;
|
|
42
|
+
margin-bottom: 5px;
|
|
43
|
+
margin-left: 32.5px;
|
|
44
|
+
position: absolute;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.connectorTitle {
|
|
48
|
+
margin-top: 32px !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.connectorCollapsed {
|
|
52
|
+
border-left: 2px dashed gray;
|
|
53
|
+
flex-grow: 1;
|
|
54
|
+
margin-bottom: 5px;
|
|
55
|
+
margin-left: 32.5px;
|
|
56
|
+
position: absolute;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.button {
|
|
60
|
+
grid-gap: 8px;
|
|
61
|
+
width: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.detailIcon {
|
|
65
|
+
height: 20px;
|
|
66
|
+
width: 20px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.text {
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: space-between;
|
|
72
|
+
width: 100%;
|
|
73
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.retrieveStyle = void 0;
|
|
7
|
+
var _constants = require("./constants");
|
|
8
|
+
var _utils = require("./utils");
|
|
9
|
+
const getBorderColor = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
theme,
|
|
12
|
+
variant
|
|
13
|
+
} = _ref;
|
|
14
|
+
return variant === _constants.VARIANTS.error ? `${theme.Palette.error['04']} !important` : `${theme.Palette.accent['04']} !important`;
|
|
15
|
+
};
|
|
16
|
+
const getBorderLightColor = _ref2 => {
|
|
17
|
+
let {
|
|
18
|
+
theme,
|
|
19
|
+
variant
|
|
20
|
+
} = _ref2;
|
|
21
|
+
return variant === _constants.VARIANTS.error ? `rgba(${theme.Palette.error['04'].match(/\w\w/g).map(x => parseInt(x, 16)).join(', ')}, 0.5) !important` : `rgba(${theme.Palette.accent['04'].match(/\w\w/g).map(x => parseInt(x, 16)).join(', ')}, 0.5) !important`;
|
|
22
|
+
};
|
|
23
|
+
const retrieveStyle = _ref3 => {
|
|
24
|
+
let {
|
|
25
|
+
theme,
|
|
26
|
+
variant
|
|
27
|
+
} = _ref3;
|
|
28
|
+
const variantTheme = (0, _utils.getVariant)(variant);
|
|
29
|
+
return {
|
|
30
|
+
activeContainer: {
|
|
31
|
+
borderColor: getBorderColor({
|
|
32
|
+
theme,
|
|
33
|
+
variant: variantTheme
|
|
34
|
+
})
|
|
35
|
+
},
|
|
36
|
+
activeInnerContainer: {
|
|
37
|
+
backgroundColor: getBorderColor({
|
|
38
|
+
theme,
|
|
39
|
+
variant: variantTheme
|
|
40
|
+
})
|
|
41
|
+
},
|
|
42
|
+
completedContainer: {
|
|
43
|
+
borderColor: getBorderColor({
|
|
44
|
+
theme,
|
|
45
|
+
variant: variantTheme
|
|
46
|
+
})
|
|
47
|
+
},
|
|
48
|
+
completedInnerContainer: {
|
|
49
|
+
backgroundColor: getBorderColor({
|
|
50
|
+
theme,
|
|
51
|
+
variant: variantTheme
|
|
52
|
+
})
|
|
53
|
+
},
|
|
54
|
+
fullContainer: {
|
|
55
|
+
backgroundColor: getBorderColor({
|
|
56
|
+
theme,
|
|
57
|
+
variant: variantTheme
|
|
58
|
+
})
|
|
59
|
+
},
|
|
60
|
+
container: {
|
|
61
|
+
backgroundColor: theme.Palette.light['01']
|
|
62
|
+
},
|
|
63
|
+
detailButtonContainer: {
|
|
64
|
+
backgroundColor: theme.Palette.light['01'],
|
|
65
|
+
borderTop: `1px solid ${theme.Palette.light['04']}`
|
|
66
|
+
},
|
|
67
|
+
containerStep: {
|
|
68
|
+
backgroundColor: theme.Palette.light['01'],
|
|
69
|
+
borderColor: theme.Palette.gray['04']
|
|
70
|
+
},
|
|
71
|
+
innerContainer: {
|
|
72
|
+
backgroundColor: theme.Palette.light['01']
|
|
73
|
+
},
|
|
74
|
+
completedLight: {
|
|
75
|
+
borderColor: getBorderLightColor({
|
|
76
|
+
theme,
|
|
77
|
+
variant: variantTheme
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
exports.retrieveStyle = retrieveStyle;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getVariant = exports.getLabelTheme = exports.getContainerStyle = void 0;
|
|
7
|
+
var _constants = require("./constants");
|
|
8
|
+
const getVariant = variant => _constants.VARIANTS[variant] || _constants.VARIANTS[_constants.DEFAULT_PROPS.variant];
|
|
9
|
+
exports.getVariant = getVariant;
|
|
10
|
+
const getLabelTheme = variant => ({
|
|
11
|
+
[_constants.VARIANTS.error]: 'error',
|
|
12
|
+
[_constants.VARIANTS.standar]: 'accent'
|
|
13
|
+
})[getVariant(variant)];
|
|
14
|
+
exports.getLabelTheme = getLabelTheme;
|
|
15
|
+
const getContainerStyle = mode => mode === _constants.FLAT ? 'transparent' : 'white';
|
|
16
|
+
exports.getContainerStyle = getContainerStyle;
|
package/dist/index.js
CHANGED
|
@@ -363,6 +363,12 @@ Object.defineProperty(exports, "UTTouchableWithoutFeedback", {
|
|
|
363
363
|
return _UTTouchableWithoutFeedback.default;
|
|
364
364
|
}
|
|
365
365
|
});
|
|
366
|
+
Object.defineProperty(exports, "UTTracker", {
|
|
367
|
+
enumerable: true,
|
|
368
|
+
get: function () {
|
|
369
|
+
return _UTTracker.default;
|
|
370
|
+
}
|
|
371
|
+
});
|
|
366
372
|
Object.defineProperty(exports, "UTVirtualizedList", {
|
|
367
373
|
enumerable: true,
|
|
368
374
|
get: function () {
|
|
@@ -429,6 +435,7 @@ var _UTLoading = _interopRequireDefault(require("./components/UTLoading"));
|
|
|
429
435
|
var _UTMap = _interopRequireDefault(require("./components/UTMap"));
|
|
430
436
|
var _UTMenu = _interopRequireDefault(require("./components/UTMenu"));
|
|
431
437
|
var _UTModal = _interopRequireDefault(require("./components/UTModal"));
|
|
438
|
+
var _UTOnboarding = _interopRequireDefault(require("./components/UTOnboarding"));
|
|
432
439
|
var _UTPagination = _interopRequireDefault(require("./components/UTPagination"));
|
|
433
440
|
var _UTPanel = _interopRequireDefault(require("./components/UTPanel"));
|
|
434
441
|
var _UTPasswordField = _interopRequireDefault(require("./components/UTPasswordField"));
|
|
@@ -453,9 +460,9 @@ var _UTToggle = _interopRequireDefault(require("./components/UTToggle"));
|
|
|
453
460
|
var _UTTooltip = _interopRequireDefault(require("./components/UTTooltip"));
|
|
454
461
|
var _UTTopbar = _interopRequireDefault(require("./components/UTTopbar"));
|
|
455
462
|
var _UTTouchableWithoutFeedback = _interopRequireDefault(require("./components/UTTouchableWithoutFeedback"));
|
|
463
|
+
var _UTTracker = _interopRequireDefault(require("./components/UTTracker"));
|
|
456
464
|
var _UTVirtualizedList = _interopRequireDefault(require("./components/UTVirtualizedList"));
|
|
457
465
|
var _UTWorkflowContainer = _interopRequireDefault(require("./components/UTWorkflowContainer"));
|
|
458
466
|
var _WithLoading = _interopRequireDefault(require("./components/WithLoading"));
|
|
459
467
|
var _WithTouch = _interopRequireDefault(require("./components/WithTouch"));
|
|
460
|
-
var _UTOnboarding = _interopRequireDefault(require("./components/UTOnboarding"));
|
|
461
468
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isUTIcon = exports.default = exports.capitalize = void 0;
|
|
6
|
+
exports.isUTIcon = exports.getDefaultColorShade = exports.default = exports.capitalize = void 0;
|
|
7
|
+
var _Palette = require("../constants/Palette");
|
|
7
8
|
const A_CHAR_CODE = 65;
|
|
8
9
|
const Z_CHAR_CODE = 90;
|
|
9
10
|
const capitalize = str => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
|
@@ -18,6 +19,8 @@ const getAvatarColors = (userName, colors) => {
|
|
|
18
19
|
const getFirstLetter = userName => userName?.trim().slice(0, 1).toUpperCase() || 'A';
|
|
19
20
|
const isUTIcon = icon => typeof icon === 'string';
|
|
20
21
|
exports.isUTIcon = isUTIcon;
|
|
22
|
+
const getDefaultColorShade = colorTheme => colorTheme === _Palette.COLOR_THEMES.gray ? _Palette.COLOR_SHADES.shade04 : colorTheme === _Palette.COLOR_THEMES.light ? _Palette.COLOR_SHADES.shade01 : _Palette.COLOR_SHADES.shade05;
|
|
23
|
+
exports.getDefaultColorShade = getDefaultColorShade;
|
|
21
24
|
var _default = exports.default = {
|
|
22
25
|
capitalize,
|
|
23
26
|
getAvatarColors,
|