@widergy/energy-ui 1.131.1 → 1.132.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 CHANGED
@@ -1,3 +1,17 @@
1
+ # [1.132.0](https://github.com/widergy/energy-ui/compare/v1.131.2...v1.132.0) (2022-10-06)
2
+
3
+
4
+ ### Features
5
+
6
+ * sidebar migration ([#310](https://github.com/widergy/energy-ui/issues/310)) ([55ef7ea](https://github.com/widergy/energy-ui/commit/55ef7eab5bb3b738676882543f324a6e276c9b10))
7
+
8
+ ## [1.131.2](https://github.com/widergy/energy-ui/compare/v1.131.1...v1.131.2) (2022-09-30)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * added outside text ([#312](https://github.com/widergy/energy-ui/issues/312)) ([09fd1bd](https://github.com/widergy/energy-ui/commit/09fd1bdb263d1f45df29694ae28d3d96f577ce64))
14
+
1
15
  ## [1.131.1](https://github.com/widergy/energy-ui/compare/v1.131.0...v1.131.1) (2022-09-26)
2
16
 
3
17
 
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _propTypes = require("prop-types");
13
+
14
+ var _reactRedux = require("react-redux");
15
+
16
+ var _types = require("../../types");
17
+
18
+ var _Option = _interopRequireDefault(require("../Option"));
19
+
20
+ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
+
24
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
+
26
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
+
28
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
29
+
30
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
31
+
32
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
33
+
34
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
35
+
36
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
37
+
38
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
39
+
40
+ var ListOption = function ListOption(_ref) {
41
+ var classes = _ref.classes,
42
+ handleClose = _ref.handleClose,
43
+ IconActive = _ref.IconActive,
44
+ IconInactive = _ref.IconInactive,
45
+ key = _ref.key,
46
+ label = _ref.label,
47
+ labelAlwaysVisible = _ref.labelAlwaysVisible,
48
+ location = _ref.location,
49
+ open = _ref.open,
50
+ openDrawer = _ref.openDrawer,
51
+ options = _ref.options;
52
+
53
+ var _useState = (0, _react.useState)(false),
54
+ _useState2 = _slicedToArray(_useState, 2),
55
+ openMenu = _useState2[0],
56
+ setOpenMenu = _useState2[1];
57
+
58
+ var optionRef = (0, _react.useRef)();
59
+ (0, _react.useEffect)(function () {
60
+ if (!open) setOpenMenu(false);
61
+ }, [open]);
62
+
63
+ var toogleMenu = function toogleMenu() {
64
+ if (!open) {
65
+ openDrawer();
66
+ setOpenMenu(true);
67
+ } else setOpenMenu(!openMenu);
68
+ };
69
+
70
+ var optionHeight = (0, _react.useMemo)(function () {
71
+ var _optionRef$current;
72
+
73
+ return openMenu && open ? options.length * (optionRef === null || optionRef === void 0 ? void 0 : (_optionRef$current = optionRef.current) === null || _optionRef$current === void 0 ? void 0 : _optionRef$current.clientHeight) : 0;
74
+ }, [openMenu, open]);
75
+ var hasSelectedItem = (0, _react.useMemo)(function () {
76
+ return options.some(function (opt) {
77
+ return opt.link === location;
78
+ });
79
+ }, [location, options]);
80
+ return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Option.default, {
81
+ optionRef: optionRef,
82
+ key: key,
83
+ label: label,
84
+ IconActive: IconActive,
85
+ IconInactive: IconInactive,
86
+ isSelectedGroup: hasSelectedItem && (!open || !openMenu),
87
+ labelAlwaysVisible: labelAlwaysVisible,
88
+ classes: classes,
89
+ open: open,
90
+ onClick: toogleMenu,
91
+ toggleArrowActive: openMenu,
92
+ withToggleArrow: true
93
+ }), /*#__PURE__*/_react.default.createElement("div", {
94
+ className: _stylesModule.default.optionMenu,
95
+ style: {
96
+ height: optionHeight
97
+ }
98
+ }, options.map(function (op) {
99
+ return /*#__PURE__*/_react.default.createElement(_Option.default, {
100
+ key: op.key,
101
+ link: op.link,
102
+ label: op.label,
103
+ labelAlwaysVisible: labelAlwaysVisible,
104
+ classes: classes,
105
+ open: open,
106
+ handleClose: handleClose
107
+ });
108
+ })));
109
+ };
110
+
111
+ ListOption.propTypes = {
112
+ classes: (0, _propTypes.objectOf)(_propTypes.string),
113
+ handleClose: _propTypes.func,
114
+ IconActive: _propTypes.elementType,
115
+ IconInactive: _propTypes.elementType,
116
+ key: _propTypes.string,
117
+ label: _propTypes.string,
118
+ labelAlwaysVisible: _propTypes.bool,
119
+ location: _propTypes.string,
120
+ open: _propTypes.bool,
121
+ openDrawer: _propTypes.func,
122
+ options: (0, _propTypes.arrayOf)(_types.subOptionType)
123
+ };
124
+
125
+ var mapStateToProps = function mapStateToProps(store) {
126
+ var _store$router, _store$router$locatio;
127
+
128
+ return {
129
+ location: (_store$router = store.router) === null || _store$router === void 0 ? void 0 : (_store$router$locatio = _store$router.location) === null || _store$router$locatio === void 0 ? void 0 : _store$router$locatio.pathname
130
+ };
131
+ };
132
+
133
+ var _default = (0, _reactRedux.connect)(mapStateToProps)( /*#__PURE__*/(0, _react.memo)(ListOption));
134
+
135
+ exports.default = _default;
@@ -0,0 +1,4 @@
1
+ .optionMenu {
2
+ overflow: hidden;
3
+ transition: height 0.3s;
4
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _propTypes = require("prop-types");
13
+
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+
16
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
+
18
+ var DynamicIcon = function DynamicIcon(_ref) {
19
+ var className = _ref.className,
20
+ Icon = _ref.Icon;
21
+ return typeof Icon === 'string' ? /*#__PURE__*/_react.default.createElement("img", {
22
+ src: Icon,
23
+ alt: "",
24
+ className: className
25
+ }) : /*#__PURE__*/_react.default.createElement(Icon, {
26
+ className: className
27
+ });
28
+ };
29
+
30
+ DynamicIcon.propTypes = {
31
+ className: _propTypes.string,
32
+ Icon: (0, _propTypes.oneOfType)([_propTypes.elementType, _propTypes.func, _propTypes.string])
33
+ };
34
+
35
+ var _default = /*#__PURE__*/(0, _react.memo)(DynamicIcon);
36
+
37
+ exports.default = _default;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _propTypes = require("prop-types");
13
+
14
+ var _DynamicIcon = _interopRequireDefault(require("./components/DynamicIcon"));
15
+
16
+ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ var LogosContainer = function LogosContainer(_ref) {
25
+ var BigLogo = _ref.BigLogo,
26
+ bigLogoClassName = _ref.bigLogoClassName,
27
+ containerClassName = _ref.containerClassName,
28
+ SmallLogo = _ref.SmallLogo,
29
+ smallLogoClassName = _ref.smallLogoClassName,
30
+ showBigLogo = _ref.showBigLogo;
31
+ return /*#__PURE__*/_react.default.createElement("div", {
32
+ className: "".concat(containerClassName, " ").concat(_stylesModule.default.logoContainer)
33
+ }, /*#__PURE__*/_react.default.createElement(_DynamicIcon.default, {
34
+ Icon: BigLogo,
35
+ className: "".concat(bigLogoClassName, " ").concat(_stylesModule.default.logo, " ").concat(showBigLogo && _stylesModule.default.visibleIcon)
36
+ }), /*#__PURE__*/_react.default.createElement(_DynamicIcon.default, {
37
+ Icon: SmallLogo,
38
+ className: "".concat(smallLogoClassName, " ").concat(_stylesModule.default.logo, " ").concat(!showBigLogo && _stylesModule.default.visibleIcon)
39
+ }));
40
+ };
41
+
42
+ LogosContainer.propTypes = {
43
+ BigLogo: _propTypes.elementType,
44
+ bigLogoClassName: _propTypes.string,
45
+ containerClassName: _propTypes.string,
46
+ smallLogoClassName: _propTypes.string,
47
+ SmallLogo: _propTypes.elementType,
48
+ showBigLogo: _propTypes.bool
49
+ };
50
+
51
+ var _default = /*#__PURE__*/(0, _react.memo)(LogosContainer);
52
+
53
+ exports.default = _default;
@@ -0,0 +1,15 @@
1
+ .logoContainer {
2
+ display: flex;
3
+ flex-direction: column;
4
+ flex-shrink: 0;
5
+ width: 100%;
6
+ }
7
+
8
+ .logo {
9
+ display: none;
10
+ flex-shrink: 0;
11
+ }
12
+
13
+ .visibleIcon {
14
+ display: block;
15
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TOOLTIP_CONFIG = void 0;
7
+ var TOOLTIP_CONFIG = {
8
+ tippyProps: {
9
+ placement: 'right',
10
+ interactive: false,
11
+ arrow: false,
12
+ boundary: 'viewport',
13
+ appendTo: document.body
14
+ }
15
+ };
16
+ exports.TOOLTIP_CONFIG = TOOLTIP_CONFIG;
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _propTypes = require("prop-types");
13
+
14
+ var _reactRedux = require("react-redux");
15
+
16
+ var _connectedReactRouter = require("connected-react-router");
17
+
18
+ var _ListItem = _interopRequireDefault(require("@material-ui/core/ListItem"));
19
+
20
+ var _ListItemIcon = _interopRequireDefault(require("@material-ui/core/ListItemIcon"));
21
+
22
+ var _ListItemText = _interopRequireDefault(require("@material-ui/core/ListItemText"));
23
+
24
+ var _ExpandMore = _interopRequireDefault(require("@material-ui/icons/ExpandMore"));
25
+
26
+ var _energyUi = require("@widergy/energy-ui");
27
+
28
+ var _types = require("../../types");
29
+
30
+ var _constants = require("./constants");
31
+
32
+ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
33
+
34
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
+
36
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
+
38
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
+
40
+ 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; }
41
+
42
+ 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; }
43
+
44
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
45
+
46
+ var Option = function Option(_ref) {
47
+ var classes = _ref.classes,
48
+ dispatch = _ref.dispatch,
49
+ handleClose = _ref.handleClose,
50
+ IconInactive = _ref.IconInactive,
51
+ IconActive = _ref.IconActive,
52
+ isSelectedGroup = _ref.isSelectedGroup,
53
+ label = _ref.label,
54
+ link = _ref.link,
55
+ labelAlwaysVisible = _ref.labelAlwaysVisible,
56
+ location = _ref.location,
57
+ onClick = _ref.onClick,
58
+ open = _ref.open,
59
+ optionRef = _ref.optionRef,
60
+ toggleArrowActive = _ref.toggleArrowActive,
61
+ withToggleArrow = _ref.withToggleArrow,
62
+ withTooltip = _ref.withTooltip;
63
+ var isSelected = isSelectedGroup || link === location;
64
+
65
+ var handleRedirection = function handleRedirection() {
66
+ dispatch((0, _connectedReactRouter.push)(link));
67
+ if (handleClose) handleClose();
68
+ };
69
+
70
+ var Container = withTooltip ? _energyUi.UTTooltip : _react.Fragment;
71
+
72
+ var containerProps = withTooltip && _objectSpread(_objectSpread({}, _constants.TOOLTIP_CONFIG), {}, {
73
+ content: /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
74
+ className: classes.tooltipLabel
75
+ }, label),
76
+ className: classes.tooltip
77
+ });
78
+
79
+ return /*#__PURE__*/_react.default.createElement(Container, containerProps, /*#__PURE__*/_react.default.createElement(_ListItem.default, {
80
+ className: "\n ".concat(_stylesModule.default.option, "\n ").concat(classes.option, "\n ").concat(isSelected && "".concat(_stylesModule.default.optionSelected, " ").concat(classes.optionSelected), "\n ").concat(isSelected && open && classes.optionSelectedOpened, "\n ").concat(isSelected && !isSelectedGroup && !withTooltip && _stylesModule.default.removeEvents, "\n "),
81
+ onClick: onClick || handleRedirection,
82
+ ref: optionRef
83
+ }, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, {
84
+ className: "\n ".concat(classes.optionIconContainer, "\n ").concat(isSelected && "".concat(classes.optionIconContainerSelected, " ").concat(_stylesModule.default.optionIconContainerSelected), "\n ").concat(_stylesModule.default.optionIconContainer, "\n ")
85
+ }, IconInactive && /*#__PURE__*/_react.default.createElement(IconInactive, {
86
+ className: "".concat(classes.optionIcon, " ").concat(_stylesModule.default.optionIcon)
87
+ }), IconActive && /*#__PURE__*/_react.default.createElement(IconActive, {
88
+ className: "".concat(classes.optionIcon, " ").concat(_stylesModule.default.optionIconSelected, " ").concat(classes.optionIconSelected)
89
+ })), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
90
+ disableTypography: true,
91
+ className: "\n ".concat(classes.optionLabel, "\n ").concat(isSelected && classes.optionLabelSelected, "\n ").concat(!open && _stylesModule.default.hidden, "\n "),
92
+ primary: label
93
+ }), !open && labelAlwaysVisible && /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
94
+ disableTypography: true,
95
+ className: "\n ".concat(_stylesModule.default.optionLabelBottom, "\n ").concat(classes.optionLabelBottom, "\n ").concat(isSelected && classes.optionLabelBottomSelected, "\n "),
96
+ primary: label
97
+ }), open && withToggleArrow && /*#__PURE__*/_react.default.createElement(_ExpandMore.default, {
98
+ className: "\n ".concat(_stylesModule.default.toggleArrow, "\n ").concat(classes.toggleArrow, "\n ").concat(toggleArrowActive && _stylesModule.default.toggleArrowActive, "\n ")
99
+ })));
100
+ };
101
+
102
+ Option.propTypes = {
103
+ classes: _types.classType,
104
+ handleClose: _propTypes.func,
105
+ IconInactive: _types.iconType,
106
+ IconActive: _types.iconType,
107
+ isSelectedGroup: _propTypes.bool,
108
+ label: _propTypes.string,
109
+ link: _propTypes.string,
110
+ labelAlwaysVisible: _propTypes.bool,
111
+ location: _propTypes.string,
112
+ onClick: _propTypes.func,
113
+ open: _propTypes.bool,
114
+ optionRef: _propTypes.any,
115
+ toggleArrowActive: _propTypes.bool,
116
+ withToggleArrow: _propTypes.bool,
117
+ withTooltip: _propTypes.bool
118
+ };
119
+
120
+ var mapStateToProps = function mapStateToProps(store) {
121
+ var _store$router, _store$router$locatio;
122
+
123
+ return {
124
+ location: (_store$router = store.router) === null || _store$router === void 0 ? void 0 : (_store$router$locatio = _store$router.location) === null || _store$router$locatio === void 0 ? void 0 : _store$router$locatio.pathname
125
+ };
126
+ };
127
+
128
+ var _default = (0, _reactRedux.connect)(mapStateToProps)( /*#__PURE__*/(0, _react.memo)(Option));
129
+
130
+ exports.default = _default;
@@ -0,0 +1,76 @@
1
+ @import 'scss/variables/_mediaQueries.scss';
2
+ @import '_sizes.scss';
3
+ @import '_colors.scss';
4
+
5
+ .option {
6
+ cursor: pointer;
7
+ padding: 0;
8
+ overflow: hidden;
9
+
10
+ &:hover {
11
+ .optionIcon {
12
+ opacity: 0;
13
+ }
14
+
15
+ .optionIconSelected {
16
+ opacity: 1;
17
+ }
18
+ }
19
+ }
20
+
21
+ .optionSelected {
22
+ &::after {
23
+ content: '';
24
+ position: absolute;
25
+ transition: background-color 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, right 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
26
+ }
27
+ }
28
+
29
+ .removeEvents {
30
+ pointer-events: none;
31
+ }
32
+
33
+ .optionIconContainerSelected {
34
+ .optionIcon {
35
+ opacity: 0;
36
+ }
37
+
38
+ .optionIconSelected {
39
+ opacity: 1;
40
+ }
41
+ }
42
+
43
+ .optionIcon {
44
+ position: absolute;
45
+ }
46
+
47
+ .optionIconSelected {
48
+ opacity: 0;
49
+ position: absolute;
50
+ }
51
+
52
+ .optionIconContainer {
53
+ align-items: center;
54
+ height: 100%;
55
+ justify-content: center;
56
+ position: relative;
57
+ }
58
+
59
+ .hidden {
60
+ display: none;
61
+ }
62
+
63
+ .optionLabelBottom {
64
+ bottom: -30px;
65
+ margin: 0;
66
+ padding: 6px 0;
67
+ position: absolute;
68
+ }
69
+
70
+ .toggleArrow {
71
+ transition: transform 0.3s;
72
+ }
73
+
74
+ .toggleArrowActive {
75
+ transform: rotate(180deg);
76
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _propTypes = require("prop-types");
13
+
14
+ var _energyUi = require("@widergy/energy-ui");
15
+
16
+ var _Menu = _interopRequireDefault(require("@material-ui/icons/Menu"));
17
+
18
+ var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
19
+
20
+ var _types = require("../../types");
21
+
22
+ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+
26
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
+
28
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
+
30
+ var Toggler = function Toggler(_ref) {
31
+ var classes = _ref.classes,
32
+ open = _ref.open,
33
+ toggleDrawer = _ref.toggleDrawer,
34
+ title = _ref.title,
35
+ subtitle = _ref.subtitle;
36
+ return /*#__PURE__*/_react.default.createElement("div", {
37
+ className: "".concat(classes.togglerContainer, " ").concat(_stylesModule.default.togglerContainer)
38
+ }, open ? /*#__PURE__*/_react.default.createElement("div", {
39
+ className: "".concat(classes.closeDrawerContainer, " ").concat(_stylesModule.default.closeDrawerContainer)
40
+ }, /*#__PURE__*/_react.default.createElement(_energyUi.UTTouchableWithoutFeedback, {
41
+ onClick: toggleDrawer
42
+ }, /*#__PURE__*/_react.default.createElement(_Close.default, {
43
+ className: classes.closeIcon
44
+ })), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
45
+ className: classes.drawerTitle
46
+ }, title), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
47
+ className: classes.drawerSubtitle
48
+ }, subtitle))) : /*#__PURE__*/_react.default.createElement(_energyUi.UTTouchableWithoutFeedback, {
49
+ onClick: toggleDrawer
50
+ }, /*#__PURE__*/_react.default.createElement(_Menu.default, {
51
+ className: classes.menuIcon
52
+ })));
53
+ };
54
+
55
+ Toggler.propTypes = {
56
+ classes: _types.classType,
57
+ open: _propTypes.bool,
58
+ subtitle: _propTypes.string,
59
+ title: _propTypes.string,
60
+ toggleDrawer: _propTypes.func
61
+ };
62
+
63
+ var _default = /*#__PURE__*/(0, _react.memo)(Toggler);
64
+
65
+ exports.default = _default;
@@ -0,0 +1,12 @@
1
+ .togglerContainer {
2
+ display: flex;
3
+ flex-direction: column;
4
+ flex-shrink: 0;
5
+ justify-content: center;
6
+ width: 100%;
7
+ }
8
+
9
+ .closeDrawerContainer {
10
+ display: flex;
11
+ flex-shrink: 0;
12
+ }
@@ -0,0 +1,176 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _propTypes = require("prop-types");
13
+
14
+ var _Backdrop = _interopRequireDefault(require("@material-ui/core/Backdrop"));
15
+
16
+ var _Drawer = _interopRequireDefault(require("@material-ui/core/Drawer"));
17
+
18
+ var _List = _interopRequireDefault(require("@material-ui/core/List"));
19
+
20
+ var _reactPerfectScrollbar = _interopRequireDefault(require("react-perfect-scrollbar"));
21
+
22
+ require("react-perfect-scrollbar/dist/css/styles.css");
23
+
24
+ var _array = require("@widergy/web-utils/lib/array");
25
+
26
+ var _useScreenSize2 = require("../../utils/useScreenSize");
27
+
28
+ var _WithTheme = _interopRequireDefault(require("../WithTheme"));
29
+
30
+ var _types = require("./types");
31
+
32
+ var _theme = require("./theme");
33
+
34
+ var _ListOption = _interopRequireDefault(require("./components/ListOption"));
35
+
36
+ var _LogosContainer = _interopRequireDefault(require("./components/LogosContainer"));
37
+
38
+ var _Option = _interopRequireDefault(require("./components/Option"));
39
+
40
+ var _Toggler = _interopRequireDefault(require("./components/Toggler"));
41
+
42
+ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
43
+
44
+ var _excluded = ["show", "options"];
45
+
46
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
47
+
48
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
49
+
50
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
51
+
52
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
53
+
54
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
55
+
56
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
57
+
58
+ var UTSidebar = function UTSidebar(_ref) {
59
+ var BigLogo = _ref.BigLogo,
60
+ classes = _ref.classes,
61
+ FooterBigLogo = _ref.FooterBigLogo,
62
+ FooterSmallLogo = _ref.FooterSmallLogo,
63
+ handleOpen = _ref.handleOpen,
64
+ handleClose = _ref.handleClose,
65
+ labelAlwaysVisible = _ref.labelAlwaysVisible,
66
+ open = _ref.open,
67
+ options = _ref.options,
68
+ SmallLogo = _ref.SmallLogo,
69
+ subtitle = _ref.subtitle,
70
+ title = _ref.title,
71
+ withMouseActions = _ref.withMouseActions,
72
+ withoutToggler = _ref.withoutToggler,
73
+ withTooltip = _ref.withTooltip;
74
+
75
+ var _useScreenSize = (0, _useScreenSize2.useScreenSize)(),
76
+ isTabletOrDesktop = _useScreenSize.isTabletOrDesktop;
77
+
78
+ var toggleDrawer = function toggleDrawer() {
79
+ return open ? handleClose() : handleOpen();
80
+ };
81
+
82
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_Drawer.default, {
83
+ open: isTabletOrDesktop || open,
84
+ variant: isTabletOrDesktop ? 'persistent' : 'temporary',
85
+ classes: {
86
+ root: classes.drawerRoot,
87
+ paper: "\n ".concat(classes.drawer, "\n ").concat(_stylesModule.default.drawer, "\n ").concat(open ? classes.openedDrawer : _stylesModule.default.removeShadow, "\n ")
88
+ },
89
+ ModalProps: {
90
+ onBackdropClick: handleClose
91
+ },
92
+ onMouseLeave: function onMouseLeave() {
93
+ return withMouseActions && handleClose();
94
+ },
95
+ onMouseEnter: function onMouseEnter() {
96
+ return withMouseActions && handleOpen();
97
+ }
98
+ }, /*#__PURE__*/_react.default.createElement(_LogosContainer.default, {
99
+ BigLogo: BigLogo,
100
+ SmallLogo: SmallLogo,
101
+ bigLogoClassName: classes.bigLogo,
102
+ smallLogoClassName: classes.smallLogo,
103
+ containerClassName: classes.logoContainer,
104
+ showBigLogo: open
105
+ }), !withoutToggler && /*#__PURE__*/_react.default.createElement(_Toggler.default, {
106
+ toggleDrawer: toggleDrawer,
107
+ open: open,
108
+ classes: classes,
109
+ title: title,
110
+ subtitle: subtitle
111
+ }), /*#__PURE__*/_react.default.createElement("div", {
112
+ className: _stylesModule.default.sidebarContent
113
+ }, /*#__PURE__*/_react.default.createElement(_List.default, {
114
+ className: "".concat(classes.list, " ").concat(open && classes.listOpened, " ").concat(_stylesModule.default.list)
115
+ }, /*#__PURE__*/_react.default.createElement(_reactPerfectScrollbar.default, {
116
+ className: "".concat(!open && _stylesModule.default.scrollbarClosed, " ").concat(classes.listScrollbar),
117
+ options: {
118
+ suppressScrollX: true
119
+ }
120
+ }, options.map(function (_ref2) {
121
+ var _ref2$show = _ref2.show,
122
+ show = _ref2$show === void 0 ? true : _ref2$show,
123
+ menuOptions = _ref2.options,
124
+ props = _objectWithoutProperties(_ref2, _excluded);
125
+
126
+ if (!show) return false;
127
+ var hasMenuOptions = !(0, _array.isEmpty)(menuOptions);
128
+ var menuOptionsToShow = hasMenuOptions && menuOptions.filter(function (opt) {
129
+ return opt.show;
130
+ });
131
+ if (hasMenuOptions && (0, _array.isEmpty)(menuOptionsToShow)) return false;
132
+ var Component = (0, _array.isEmpty)(menuOptions) ? _Option.default : _ListOption.default;
133
+ return /*#__PURE__*/_react.default.createElement(Component, _extends({
134
+ open: open,
135
+ classes: classes,
136
+ labelAlwaysVisible: labelAlwaysVisible,
137
+ options: menuOptionsToShow,
138
+ openDrawer: handleOpen,
139
+ handleClose: handleClose,
140
+ withTooltip: withTooltip
141
+ }, props));
142
+ }))), FooterBigLogo && FooterSmallLogo && /*#__PURE__*/_react.default.createElement(_LogosContainer.default, {
143
+ BigLogo: FooterBigLogo,
144
+ SmallLogo: FooterSmallLogo,
145
+ bigLogoClassName: classes.footerBigLogo,
146
+ smallLogoClassName: classes.footerSmallLogo,
147
+ containerClassName: classes.footerLogoContainer,
148
+ showBigLogo: open
149
+ }))), /*#__PURE__*/_react.default.createElement(_Backdrop.default, {
150
+ open: isTabletOrDesktop && open,
151
+ className: _stylesModule.default.backdrop,
152
+ onClick: toggleDrawer
153
+ }));
154
+ };
155
+
156
+ UTSidebar.propTypes = {
157
+ BigLogo: (0, _propTypes.oneOfType)([_types.iconType, _propTypes.string]),
158
+ classes: _types.classType,
159
+ handleOpen: _propTypes.func,
160
+ handleClose: _propTypes.func,
161
+ FooterBigLogo: (0, _propTypes.oneOfType)([_types.iconType, _propTypes.string]),
162
+ FooterSmallLogo: (0, _propTypes.oneOfType)([_types.iconType, _propTypes.string]),
163
+ labelAlwaysVisible: _propTypes.bool,
164
+ open: _propTypes.bool,
165
+ options: _types.optionsType,
166
+ SmallLogo: (0, _propTypes.oneOfType)([_types.iconType, _propTypes.string]),
167
+ subtitle: _propTypes.string,
168
+ title: _propTypes.string,
169
+ withMouseActions: _propTypes.bool,
170
+ withoutToggler: _propTypes.bool,
171
+ withTooltip: _propTypes.bool
172
+ };
173
+
174
+ var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTSidebar);
175
+
176
+ exports.default = _default;
@@ -0,0 +1,52 @@
1
+ @import '_mediaQueries.scss';
2
+
3
+ .drawer {
4
+ align-items: center;
5
+ display: flex;
6
+ overflow-x: hidden;
7
+
8
+ @media #{$desktop-tablet} {
9
+ transition: transform 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, width 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms !important;
10
+ }
11
+ }
12
+
13
+ .removeShadow {
14
+ box-shadow: none;
15
+ }
16
+
17
+ .list {
18
+ display: flex;
19
+ flex-direction: column;
20
+ justify-content: center;
21
+ overflow: hidden;
22
+ }
23
+
24
+ .hidden {
25
+ display: none;
26
+ }
27
+
28
+ .scrollbarClosed {
29
+ :global {
30
+ .ps__rail-y {
31
+ max-width: 8px;
32
+ }
33
+
34
+ .ps__thumb-y {
35
+ max-width: 8px;
36
+ right: -2px;
37
+ }
38
+ }
39
+ }
40
+
41
+ .backdrop {
42
+ z-index: 1199;
43
+ }
44
+
45
+ .sidebarContent {
46
+ display: flex;
47
+ flex-direction: column;
48
+ height: 100%;
49
+ justify-content: space-between;
50
+ overflow: hidden;
51
+ width: 100%;
52
+ }
@@ -0,0 +1,233 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.retrieveStyle = void 0;
7
+
8
+ var _seamlessImmutable = require("seamless-immutable");
9
+
10
+ var _colors = _interopRequireDefault(require("../../scss/variables/_colors.scss"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ var retrieveStyle = function retrieveStyle(theme) {
15
+ return {
16
+ drawerRoot: {
17
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'drawer', 'width'], 60)
18
+ },
19
+ drawer: {
20
+ backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'drawer', 'backgroundColor'], _colors.default.white),
21
+ borderRight: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'drawer', 'borderRight']),
22
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'drawer', 'width'], 60)
23
+ },
24
+ openedDrawer: {
25
+ backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'openedDrawer', 'backgroundColor'], _colors.default.white),
26
+ borderRight: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'openedDrawer', 'borderRight']),
27
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'openedDrawer', 'width'], 180)
28
+ },
29
+ drawerTitle: {
30
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'drawerTitle', 'color'], _colors.default.black),
31
+ fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'drawerTitle', 'fontSize'], '16px'),
32
+ fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'drawerTitle', 'fontWeight'], 600),
33
+ margin: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'drawerTitle', 'margin'])
34
+ },
35
+ drawerSubtitle: {
36
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'drawerSubtitle', 'color'], _colors.default.black),
37
+ fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'drawerSubtitle', 'fontSize'], '14px'),
38
+ fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'drawerSubtitle', 'fontWeight'], 400),
39
+ margin: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'drawerSubtitle', 'margin'])
40
+ },
41
+ closeDrawerContainer: {
42
+ padding: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'closeDrawerContainer', 'padding']),
43
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'closeDrawerContainer', 'width'], '100%')
44
+ },
45
+ closeIcon: {
46
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'closeIcon', 'color']),
47
+ fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'closeIcon', 'fontSize']),
48
+ margin: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'closeIcon', 'margin'])
49
+ },
50
+ togglerContainer: {
51
+ alignItems: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'togglerContainer', 'alignItems']),
52
+ height: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'togglerContainer', 'height'], 50)
53
+ },
54
+ logoContainer: {
55
+ alignItems: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'logoContainer', 'justify']),
56
+ justifyContent: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'logoContainer', 'align'], 'center'),
57
+ backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'logoContainer', 'backgroundColor'], _colors.default.white),
58
+ borderBottom: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'logoContainer', 'borderBottom']),
59
+ height: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'logoContainer', 'height']),
60
+ padding: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'logoContainer', 'padding'])
61
+ },
62
+ smallLogo: {
63
+ alignSelf: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'smallLogo', 'align']),
64
+ margin: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'smallLogo', 'margin']),
65
+ height: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'smallLogo', 'height']),
66
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'smallLogo', 'width'])
67
+ },
68
+ bigLogo: {
69
+ alignSelf: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'bigLogo', 'align']),
70
+ height: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'bigLogo', 'height']),
71
+ margin: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'bigLogo', 'margin']),
72
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'bigLogo', 'width'])
73
+ },
74
+ footerLogoContainer: {
75
+ padding: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'footerLogoContainer', 'padding'])
76
+ },
77
+ footerBigLogo: {
78
+ alignSelf: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'footerBigLogo', 'align']),
79
+ margin: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'footerBigLogo', 'margin']),
80
+ height: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'footerBigLogo', 'height']),
81
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'footerBigLogo', 'width'])
82
+ },
83
+ footerSmallLogo: {
84
+ alignSelf: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'footerSmallLogo', 'align']),
85
+ height: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'footerSmallLogo', 'height']),
86
+ margin: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'footerSmallLogo', 'margin']),
87
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'footerSmallLogo', 'width'])
88
+ },
89
+ menuIcon: {
90
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'menuIcon', 'color'], _colors.default.black),
91
+ fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'menuIcon', 'fontSize']),
92
+ margin: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'menuIcon', 'margin'], '20px 0'),
93
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'menuIcon', 'width'], '100%')
94
+ },
95
+ list: {
96
+ alignSelf: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'list', 'align']),
97
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'list', 'width'], '100%')
98
+ },
99
+ listScrollbar: {
100
+ maxWidth: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'list', 'maxWidth'], '100%'),
101
+ padding: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'list', 'padding'], 0)
102
+ },
103
+ listOpened: {
104
+ alignSelf: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'listOpened', 'align']),
105
+ maxWidth: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'listOpened', 'maxWidth']),
106
+ padding: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'listOpened', 'padding']),
107
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'listOpened', 'width'])
108
+ },
109
+ option: {
110
+ backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'backgroundColor']),
111
+ border: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'border']),
112
+ borderRadius: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'borderRadius']),
113
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'color']),
114
+ height: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'height']),
115
+ margin: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'margin']),
116
+ maxWidth: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'maxWidth']),
117
+ '&:hover': {
118
+ background: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'hover', 'background']),
119
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'hover', 'color']),
120
+ transition: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'hover', 'transition']),
121
+ '& $optionIconContainer': {
122
+ background: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'hover', 'optionIconContainer', 'background']),
123
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'hover', 'optionIconContainer', 'color'])
124
+ },
125
+ '& $optionIcon': {
126
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'hover', 'optionIcon', 'color']),
127
+ opacity: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'hover', 'optionIcon', 'opacity'])
128
+ }
129
+ },
130
+ padding: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'padding']),
131
+ transition: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'transition'], 'background-color 0.3s')
132
+ },
133
+ optionSelected: {
134
+ background: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionSelected', 'background']),
135
+ border: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionSelected', 'border']),
136
+ borderRadius: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionSelected', 'borderRadius']),
137
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionSelected', 'color']),
138
+ height: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionSelected', 'height']),
139
+ margin: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionSelected', 'margin']),
140
+ '&::after': {
141
+ backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'selectedMarker', 'backgroundColor']),
142
+ borderRadius: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'selectedMarker', 'borderRadius'], 5),
143
+ height: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'selectedMarker', 'height'], '100%'),
144
+ right: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'selectedMarker', 'right'], 0),
145
+ top: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'selectedMarker', 'top'], 0),
146
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'selectedMarker', 'width'], 1)
147
+ },
148
+ padding: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionSelected', 'padding'])
149
+ },
150
+ optionSelectedOpened: {
151
+ '&::after': {
152
+ backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'selectedMarkerOpened', 'backgroundColor']),
153
+ height: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'selectedMarkerOpened', 'height']),
154
+ right: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'selectedMarkerOpened', 'right']),
155
+ top: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'selectedMarkerOpened', 'top']),
156
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'selectedMarkerOpened', 'width'])
157
+ }
158
+ },
159
+ optionIconContainer: {
160
+ backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconContainer', 'backgroundColor']),
161
+ border: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconContainer', 'border']),
162
+ borderRadius: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconContainer', 'borderRadius']),
163
+ minHeight: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconContainer', 'minHeight']),
164
+ minWidth: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconContainer', 'minWidth']),
165
+ transition: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconContainer', 'transition']),
166
+ padding: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconContainer', 'padding'])
167
+ },
168
+ optionIconContainerSelected: {
169
+ backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconContainerSelected', 'backgroundColor']),
170
+ border: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconContainerSelected', 'border']),
171
+ borderRadius: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconContainerSelected', 'borderRadius']),
172
+ minWidth: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconContainerSelected', 'minWidth'])
173
+ },
174
+ optionIcon: {
175
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIcon', 'color'], (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'option', 'color'], _colors.default.black)),
176
+ fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIcon', 'fontSize']),
177
+ height: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIcon', 'height']),
178
+ transition: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIcon', 'transition']),
179
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIcon', 'width'])
180
+ },
181
+ optionIconSelected: {
182
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconSelected', 'color'], (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionSelected', 'color'])),
183
+ height: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconSelected', 'height']),
184
+ fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconSelected', 'fontSize']),
185
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionIconSelected', 'width'])
186
+ },
187
+ optionLabel: {
188
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabel', 'color']),
189
+ fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabel', 'fontSize'], '14px'),
190
+ fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabel', 'fontWeight']),
191
+ margin: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabel', 'margin']),
192
+ padding: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabel', 'padding']),
193
+ whiteSpace: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabel', 'whiteSpace'])
194
+ },
195
+ optionLabelSelected: {
196
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelSelected', 'color']),
197
+ fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelSelected', 'fontSize']),
198
+ fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelSelected', 'fontWeight']),
199
+ padding: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelSelected', 'padding'])
200
+ },
201
+ optionLabelBottom: {
202
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelBottom', 'color']),
203
+ fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelBottom', 'fontSize'], '12px'),
204
+ fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelBottom', 'fontWeight']),
205
+ left: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelBottom', 'left']),
206
+ textAlign: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelBottom', 'textAlign'], 'center'),
207
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelBottom', 'width'], '100%')
208
+ },
209
+ optionLabelBottomSelected: {
210
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelBottomSelected', 'color']),
211
+ fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelBottomSelected', 'fontSize']),
212
+ fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelBottomSelected', 'fontWeight']),
213
+ left: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelBottomSelected', 'left']),
214
+ textAlign: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelBottomSelected', 'textAlign']),
215
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'optionLabelBottomSelected', 'width'])
216
+ },
217
+ toggleArrow: {
218
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'toggleArrow', 'color']),
219
+ fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'toggleArrow', 'fontSize']),
220
+ width: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'toggleArrow', 'width'], 40)
221
+ },
222
+ tooltip: {
223
+ backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'tooltip', 'backgroundColor']),
224
+ padding: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'tooltip', 'padding'], '2px 4px')
225
+ },
226
+ tooltipLabel: {
227
+ fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'tooltipLabel', 'fontSize'], '18px'),
228
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSidebar', 'tooltipLabel', 'color'])
229
+ }
230
+ };
231
+ };
232
+
233
+ exports.retrieveStyle = retrieveStyle;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.subOptionType = exports.optionsType = exports.optionType = exports.iconType = exports.classType = void 0;
7
+
8
+ var _propTypes = require("prop-types");
9
+
10
+ var classType = (0, _propTypes.shape)({
11
+ bigLogo: _propTypes.string,
12
+ closeDrawerContainer: _propTypes.string,
13
+ closeIcon: _propTypes.string,
14
+ drawer: _propTypes.string,
15
+ drawerSubtitle: _propTypes.string,
16
+ drawerTitle: _propTypes.string,
17
+ list: _propTypes.string,
18
+ listOpened: _propTypes.string,
19
+ logoContainer: _propTypes.string,
20
+ menuIcon: _propTypes.string,
21
+ smallLogo: _propTypes.string,
22
+ selectedMarker: _propTypes.string,
23
+ selectedMarkerOpened: _propTypes.string,
24
+ openedDrawer: _propTypes.string,
25
+ option: _propTypes.string,
26
+ optionIcon: _propTypes.string,
27
+ optionIconSelected: _propTypes.string,
28
+ optionIconContainer: _propTypes.string,
29
+ optionIconContainerSelected: _propTypes.string,
30
+ optionLabel: _propTypes.string,
31
+ optionLabelBottom: _propTypes.string,
32
+ optionLabelBottomSelected: _propTypes.string,
33
+ optionLabelSelected: _propTypes.string,
34
+ optionSelected: _propTypes.string,
35
+ togglerContainer: _propTypes.string
36
+ });
37
+ exports.classType = classType;
38
+ var iconType = (0, _propTypes.oneOfType)([_propTypes.func, _propTypes.elementType]);
39
+ exports.iconType = iconType;
40
+ var subOptionType = (0, _propTypes.shape)({
41
+ id: _propTypes.string,
42
+ key: _propTypes.string,
43
+ label: _propTypes.string,
44
+ link: _propTypes.string,
45
+ show: _propTypes.bool
46
+ });
47
+ exports.subOptionType = subOptionType;
48
+ var optionType = (0, _propTypes.shape)({
49
+ id: _propTypes.string,
50
+ key: _propTypes.string,
51
+ IconActive: _propTypes.elementType,
52
+ IconInactive: _propTypes.elementType,
53
+ link: _propTypes.string,
54
+ label: _propTypes.string,
55
+ show: _propTypes.bool,
56
+ options: (0, _propTypes.arrayOf)(subOptionType)
57
+ });
58
+ exports.optionType = optionType;
59
+ var optionsType = (0, _propTypes.arrayOf)(optionType);
60
+ exports.optionsType = optionsType;
@@ -58,35 +58,38 @@ var UTSwitch = function UTSwitch(_ref) {
58
58
  themeClasses = _ref$classes === void 0 ? {} : _ref$classes,
59
59
  classNames = _ref.classNames,
60
60
  disabled = _ref.disabled,
61
- field = _ref.field,
62
- input = _ref.input,
61
+ _ref$field = _ref.field,
62
+ field = _ref$field === void 0 ? {} : _ref$field,
63
+ _ref$input = _ref.input,
64
+ input = _ref$input === void 0 ? {} : _ref$input,
63
65
  _ref$meta = _ref.meta,
64
66
  meta = _ref$meta === void 0 ? {} : _ref$meta,
65
- showErrors = _ref.showErrors,
66
- textOff = _ref.textOff,
67
- textOn = _ref.textOn,
68
- withText = _ref.withText;
69
-
70
- var _ref2 = input || {},
71
- value = _ref2.value,
72
- onChange_ = _ref2.onChange;
73
-
67
+ showErrors = _ref.showErrors;
68
+ var value = input.value,
69
+ onChange_ = input.onChange;
74
70
  var key = field.key,
75
- fieldOptions = field.field_options;
71
+ fieldOptions = field.field_options,
72
+ _field$configuration = field.configuration,
73
+ configuration = _field$configuration === void 0 ? {} : _field$configuration;
74
+ var textOff_ = configuration.textOff,
75
+ textOn_ = configuration.textOn,
76
+ _configuration$inside = configuration.insideText,
77
+ insideText = _configuration$inside === void 0 ? true : _configuration$inside,
78
+ withText = configuration.withText;
76
79
  var switchId = key || _constants.DEFAULT_SWITCH_ID;
77
80
  var classes = (0, _react.useMemo)(function () {
78
81
  return (0, _classesUtils.mergeClasses)(themeClasses, classNames);
79
82
  }, [classNames]);
80
83
  var useFieldOptions = fieldOptions && !(0, _array.isEmpty)(fieldOptions);
81
84
 
82
- var _ref3 = useFieldOptions ? _toConsumableArray(fieldOptions).sort(function (_, _ref5) {
83
- var optionValue = _ref5.value,
84
- name = _ref5.name;
85
+ var _ref2 = useFieldOptions ? _toConsumableArray(fieldOptions).sort(function (_, _ref4) {
86
+ var optionValue = _ref4.value,
87
+ name = _ref4.name;
85
88
  return [optionValue, name === _constants.TRUE].includes(value) ? 1 : -1;
86
89
  }) : [],
87
- _ref4 = _slicedToArray(_ref3, 2),
88
- currentOption = _ref4[0],
89
- switchedOption = _ref4[1];
90
+ _ref3 = _slicedToArray(_ref2, 2),
91
+ currentOption = _ref3[0],
92
+ switchedOption = _ref3[1];
90
93
 
91
94
  var onChange = useFieldOptions ? function () {
92
95
  return onChange_(switchedOption.value);
@@ -94,7 +97,11 @@ var UTSwitch = function UTSwitch(_ref) {
94
97
  (0, _react.useEffect)(function () {
95
98
  if (useFieldOptions && value === false) onChange_(currentOption.value);
96
99
  }, [value]);
97
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("label", {
100
+ var textOn = textOn_ || _constants.STATES.ON;
101
+ var textOff = textOff_ || _constants.STATES.OFF;
102
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
103
+ className: classes.outerContainer
104
+ }, withText && !insideText && textOff, /*#__PURE__*/_react.default.createElement("label", {
98
105
  htmlFor: switchId,
99
106
  className: "".concat(classes.container, " ").concat(disabled && classes.disabled)
100
107
  }, /*#__PURE__*/_react.default.createElement("input", {
@@ -109,17 +116,17 @@ var UTSwitch = function UTSwitch(_ref) {
109
116
  className: "".concat(classes.sliderContainer, " ").concat(disabled && classes.disabled)
110
117
  }, /*#__PURE__*/_react.default.createElement("span", {
111
118
  className: "".concat(classes.sliderBack, " ").concat(disabled && classes.disabled)
112
- }), withText && /*#__PURE__*/_react.default.createElement("div", {
119
+ }), withText && insideText && /*#__PURE__*/_react.default.createElement("div", {
113
120
  className: classes.textContainer
114
121
  }, /*#__PURE__*/_react.default.createElement("div", {
115
122
  className: classes.checkedText
116
- }, textOn || _constants.STATES.ON), /*#__PURE__*/_react.default.createElement("div", {
123
+ }, textOn), /*#__PURE__*/_react.default.createElement("div", {
117
124
  className: classes.uncheckedText
118
- }, textOff || _constants.STATES.OFF)), /*#__PURE__*/_react.default.createElement("span", {
125
+ }, textOff)), /*#__PURE__*/_react.default.createElement("span", {
119
126
  className: "".concat(classes.sliderHover, " ").concat(disabled && classes.disabled)
120
127
  }), /*#__PURE__*/_react.default.createElement("span", {
121
128
  className: "".concat(classes.slider, " ").concat(disabled && classes.disabled)
122
- }))), showErrors && meta && (0, _form.shouldShowErrors)(meta) && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
129
+ }))), withText && !insideText && textOn), showErrors && meta && (0, _form.shouldShowErrors)(meta) && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
123
130
  error: true
124
131
  }, meta === null || meta === void 0 ? void 0 : meta.error));
125
132
  };
@@ -131,10 +138,7 @@ UTSwitch.propTypes = {
131
138
  field: _formTypes.fieldType,
132
139
  input: _formTypes.inputPropTypes.isRequired,
133
140
  meta: _formTypes.metaPropTypes,
134
- showErrors: _propTypes.bool,
135
- textOff: _propTypes.string,
136
- textOn: _propTypes.string,
137
- withText: _propTypes.bool
141
+ showErrors: _propTypes.bool
138
142
  };
139
143
 
140
144
  var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTSwitch);
@@ -13,6 +13,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
13
13
 
14
14
  var retrieveStyle = function retrieveStyle(theme) {
15
15
  return {
16
+ outerContainer: {
17
+ alignItems: (0, _seamlessImmutable.getIn)(theme, ['UTSwitch', 'outerContainer', 'alignItems'], 'center'),
18
+ color: (0, _seamlessImmutable.getIn)(theme, ['UTSwitch', 'outerContainer', 'color']),
19
+ columnGap: (0, _seamlessImmutable.getIn)(theme, ['UTSwitch', 'outerContainer', 'columnGap']),
20
+ display: (0, _seamlessImmutable.getIn)(theme, ['UTSwitch', 'outerContainer', 'display'], 'flex')
21
+ },
16
22
  container: {
17
23
  boxSizing: (0, _seamlessImmutable.getIn)(theme, ['UTSwitch', 'container', 'boxSizing'], 'border-box'),
18
24
  cursor: (0, _seamlessImmutable.getIn)(theme, ['UTSwitch', 'container', 'cursor'], 'pointer'),
package/dist/index.js CHANGED
@@ -225,6 +225,12 @@ Object.defineProperty(exports, "UTSelect", {
225
225
  return _UTSelect.default;
226
226
  }
227
227
  });
228
+ Object.defineProperty(exports, "UTSidebar", {
229
+ enumerable: true,
230
+ get: function get() {
231
+ return _UTSidebar.default;
232
+ }
233
+ });
228
234
  Object.defineProperty(exports, "UTSkeleton", {
229
235
  enumerable: true,
230
236
  get: function get() {
@@ -408,6 +414,8 @@ var _UTProgressBar = _interopRequireDefault(require("./components/UTProgressBar"
408
414
 
409
415
  var _UTDatePicker = _interopRequireDefault(require("./components/UTDatePicker"));
410
416
 
417
+ var _UTSidebar = _interopRequireDefault(require("./components/UTSidebar"));
418
+
411
419
  var _UTSwitch = _interopRequireDefault(require("./components/UTSwitch"));
412
420
 
413
421
  var _UTPasswordField = _interopRequireDefault(require("./components/UTPasswordField"));
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useScreenSize = void 0;
7
+
8
+ var _energyHooks = require("@widergy/energy-hooks");
9
+
10
+ var useScreenSize = (0, _energyHooks.createUseScreenSize)({
11
+ mobileBP: 767,
12
+ tabletBP: 1024
13
+ });
14
+ exports.useScreenSize = useScreenSize;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "1.131.1",
3
+ "version": "1.132.0",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",