@widergy/energy-ui 3.11.0 → 3.12.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 CHANGED
@@ -1,3 +1,25 @@
1
+ ## [3.12.1](https://github.com/widergy/energy-ui/compare/v3.12.0...v3.12.1) (2024-07-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update uticon ([#464](https://github.com/widergy/energy-ui/issues/464)) ([c5320e6](https://github.com/widergy/energy-ui/commit/c5320e69a02d0840cf690194341d52f2406e7ae5))
7
+
8
+ # [3.12.0](https://github.com/widergy/energy-ui/compare/v3.11.0...v3.12.0) (2024-07-17)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fix pr ([986ef80](https://github.com/widergy/energy-ui/commit/986ef8095dac159a2ef2ea0013b82e4064ae50cd))
14
+
15
+
16
+ ### Features
17
+
18
+ * autocomplete wip ([1c70075](https://github.com/widergy/energy-ui/commit/1c7007531476b07a078635d7f12052e7069b44ef))
19
+ * handle errors + google logo + completed component ([1e93a1f](https://github.com/widergy/energy-ui/commit/1e93a1f5dc2e0a8315217c758af160b0233fd4e5))
20
+ * moved the googlemaps script ([f1068d1](https://github.com/widergy/energy-ui/commit/f1068d1d068a112e3e8acf023a28ebcabd4db4aa))
21
+ * updates wip ([c5a11fc](https://github.com/widergy/energy-ui/commit/c5a11fcf2d102d685eddc71b6efcc119594391ee))
22
+
1
23
  # [3.11.0](https://github.com/widergy/energy-ui/compare/v3.10.5...v3.11.0) (2024-07-04)
2
24
 
3
25
 
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.variantsColorTheme = exports.retrieveStyle = void 0;
7
7
  var _constants = require("./constants");
8
8
  const variantsColorTheme = (theme, colorTheme) => {
9
+ var _theme$Palette$action;
9
10
  const colorName = _constants.COLORS_MAPPER[colorTheme] || _constants.COLORS_MAPPER[_constants.DEFAULT_PROPS.colorTheme];
10
- const paletteTheme = theme.Palette[colorName] || theme.Palette.actions[colorName];
11
+ const paletteTheme = theme.Palette[colorName] || ((_theme$Palette$action = theme.Palette.actions) === null || _theme$Palette$action === void 0 ? void 0 : _theme$Palette$action[colorName]);
11
12
  const backgroundColorMapper = {
12
13
  alert: paletteTheme['04'],
13
14
  information: paletteTheme['05'],
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.VARIANTS = exports.SIZES = exports.SHADOW_MAPPER = exports.ICON_PLACEMENTS = exports.DEFAULT_PROPS = exports.COLORS_MAPPER = void 0;
7
+ var _Palette = require("../../constants/Palette");
7
8
  const VARIANTS = exports.VARIANTS = {
8
9
  filled: 'contained',
9
10
  outlined: 'outlined',
@@ -30,11 +31,11 @@ const DEFAULT_PROPS = exports.DEFAULT_PROPS = {
30
31
  variant: 'filled'
31
32
  };
32
33
  const COLORS_MAPPER = exports.COLORS_MAPPER = {
33
- error: 'error',
34
- negative: 'negative',
35
- primary: 'accent',
36
- secondary: 'neutral',
37
- success: 'success'
34
+ error: _Palette.COLOR_THEMES.error,
35
+ negative: _Palette.COLOR_THEMES.negative,
36
+ primary: _Palette.COLOR_THEMES.accent,
37
+ secondary: _Palette.COLOR_THEMES.neutral,
38
+ success: _Palette.COLOR_THEMES.success
38
39
  };
39
40
  const SHADOW_MAPPER = exports.SHADOW_MAPPER = {
40
41
  [COLORS_MAPPER.error]: 'accentError',
@@ -10,10 +10,11 @@ var _constants = require("./constants");
10
10
  const variantsColorTheme = (theme, colorTheme, variant) => {
11
11
  var _theme$Palette$shadow;
12
12
  const actionColorName = _constants.COLORS_MAPPER[colorTheme] || _constants.COLORS_MAPPER[_constants.DEFAULT_PROPS.colorTheme];
13
- const actionTheme = theme.Palette.actions[actionColorName];
13
+ const actionPaletteColors = theme.Palette.actions || theme.Palette;
14
+ const actionTheme = actionPaletteColors[actionColorName];
14
15
  const shadowTheme = ((_theme$Palette$shadow = theme.Palette.shadows) === null || _theme$Palette$shadow === void 0 ? void 0 : _theme$Palette$shadow[_constants.SHADOW_MAPPER[actionColorName]]) || 'transparent';
15
- const negativeTheme = theme.Palette.actions[_constants.COLORS_MAPPER.negative];
16
- const neutralTheme = theme.Palette.actions[_constants.COLORS_MAPPER.secondary];
16
+ const negativeTheme = actionPaletteColors[_constants.COLORS_MAPPER.negative];
17
+ const neutralTheme = actionPaletteColors[_constants.COLORS_MAPPER.secondary];
17
18
  const definition = {
18
19
  filled: {
19
20
  backgroundColor: actionTheme['04'],
@@ -7,8 +7,9 @@ exports.variantsColorTheme = exports.retrieveStyle = void 0;
7
7
  var _classesUtils = require("../../utils/classesUtils");
8
8
  var _constants = require("./constants");
9
9
  const variantsColorTheme = (colorTheme, theme) => {
10
+ var _theme$Palette$action;
10
11
  const actionColorName = _constants.COLORS_MAPPER[colorTheme] || _constants.COLORS_MAPPER[_constants.DEFAULT_PROPS.colorTheme];
11
- const actionTheme = theme.Palette.actions[actionColorName];
12
+ const actionTheme = ((_theme$Palette$action = theme.Palette.actions) === null || _theme$Palette$action === void 0 ? void 0 : _theme$Palette$action[actionColorName]) || theme.Palette[actionColorName];
12
13
  return actionTheme['05'];
13
14
  };
14
15
  exports.variantsColorTheme = variantsColorTheme;
@@ -0,0 +1,25 @@
1
+ # UTGoogleAutocomplete
2
+
3
+ Component used for searching for addresses and getting their details from Google Api.
4
+
5
+ ## Props
6
+
7
+
8
+ | Name | Type | Default | Description |
9
+ | ----------------------- | -------- | -------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
10
+ | apiKey | string | | Google Api Key provided. |
11
+ | classes | string | | Classes returned by UTGoogleAutocomplete's own [Theme](./theme.js#L40) `retrieveStyle`. |
12
+ | detailErrorLabel | string | "Hubo un error al intentar recuperar el detalle de la dirección seleccionada" | Message to show when the Google Api places detail service fails. |
13
+ | inputProps | object | | [UTTextInput](../UTTextInput/index.js) inputProps. This allows you to customize the autocomplete input. |
14
+ | minChar | number | 3 | The component won´t call google predictions (Autocomplete service) until the user had entered at least the number indicated by minChar. |
15
+ | noResultsLabel | string | 'No se encuentran resultados. Ingresa una dirección valida.' | Message to show to the user when google predictions don´t return anything. |
16
+ | predictionsErrorLabel | string | "Hubo un error al intentar recuperar la dirección ingresada" | Message to show when the Google Api places autocomplete service fails. |
17
+ | retrieveError | string | () => {} | Func to execute when any google service fails. It retrieves the status code, since google doesn´t return the error message. Check[PlacesServiceStatus](https://developers.google.com/maps/documentation/javascript/reference/places-service?hl=es-419#PlacesServiceStatus) for status descriptions. <br />The ideal case is to use this function to log the error into rollbar so we can be aware of it. |
18
+ | searchRestrictions | object | {} | Autocomplete service restrictions. Check [AutocompletionRequest](https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service?hl=es-419#AutocompletionRequest) for more information |
19
+ | setSelectedPlace | func | () => {} | Func to execute when a result from the predictions is selected. |
20
+
21
+ ### Use
22
+
23
+ ```JSX
24
+ <UTGoogleAutocomplete apiKey={apiKey} />
25
+ ```
@@ -5,64 +5,131 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
- var _propTypes = require("prop-types");
9
- var _api = require("@react-google-maps/api");
8
+ var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
9
+ var _WithGoogleMaps = _interopRequireDefault(require("../WithGoogleMaps"));
10
+ var _WithTheme = _interopRequireDefault(require("../WithTheme"));
11
+ var _UTTouchableWithoutFeedback = _interopRequireDefault(require("../UTTouchableWithoutFeedback"));
12
+ var _UTTextInput = _interopRequireDefault(require("../UTTextInput"));
13
+ var _UTIcon = _interopRequireDefault(require("../UTIcon"));
14
+ var _UTLabel = _interopRequireDefault(require("../UTLabel"));
15
+ var _AlertHandler = _interopRequireDefault(require("../UTAlert/AlertHandler"));
16
+ var _UTAlert = _interopRequireDefault(require("../UTAlert"));
17
+ var _googleMapsTypes = require("../../types/googleMapsTypes");
18
+ var _theme = require("./theme");
19
+ var _google_on_white = _interopRequireDefault(require("./assets/google_on_white.png"));
20
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
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); }
11
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); }
12
24
  const UTGoogleAutocomplete = _ref => {
13
25
  let {
14
- apikey
26
+ alert,
27
+ classes,
28
+ detailErrorLabel = 'Hubo un error al intentar recuperar el detalle de la dirección seleccionada',
29
+ inputProps,
30
+ minChar = 3,
31
+ noResultsLabel = 'No se encuentran resultados. Ingresa una dirección valida.',
32
+ predictionsErrorLabel = 'Hubo un error al intentar recuperar la dirección ingresada',
33
+ retrieveError = () => {},
34
+ searchRestrictions = {},
35
+ setSelectedPlace = () => {}
15
36
  } = _ref;
16
- console.log(apikey);
17
- const placesLibrary = ['places'];
18
- const [searchResult, setSearchResult] = (0, _react.useState)('Result: none');
37
+ const [autoCompletePredictions, setAutoCompletePredictions] = (0, _react.useState)([]);
38
+ const [searchInputValue, setSearchInputValue] = (0, _react.useState)('');
39
+ const [predictionsNotFound, setPredictionsNotFound] = (0, _react.useState)(false);
40
+ const [showPredictions, setShowPredicitions] = (0, _react.useState)(false);
41
+ const placeDetailRef = (0, _react.useRef)();
19
42
  const {
20
- isLoaded
21
- } = (0, _api.useLoadScript)({
22
- googleMapsApiKey: apikey,
23
- libraries: placesLibrary
24
- });
25
- function onLoad(autocomplete) {
26
- setSearchResult(autocomplete);
27
- }
28
- function onPlaceChanged() {
29
- if (searchResult != null) {
30
- const place = searchResult.getPlace();
31
- console.log({
32
- place
33
- });
43
+ google
44
+ } = window;
45
+ const googleAutocompleteService = new google.maps.places.AutocompleteService();
46
+ const GOOGLE_OK_STATUS = google.maps.places.PlacesServiceStatus.OK;
47
+ const GOOGLE_ZERO_STATUS = google.maps.places.PlacesServiceStatus.ZERO_RESULTS;
48
+ const sessionToken = (0, _react.useMemo)(() => new google.maps.places.AutocompleteSessionToken(), [google.maps.places.AutocompleteSessionToken]);
49
+ const handlePredictions = (predictions, status) => {
50
+ if (status === GOOGLE_OK_STATUS) {
51
+ setShowPredicitions(true);
52
+ setPredictionsNotFound(false);
53
+ const autocompleteSuggestions = predictions.map(prediction => ({
54
+ id: prediction.place_id,
55
+ name: prediction.description
56
+ }));
57
+ return setAutoCompletePredictions(autocompleteSuggestions);
58
+ }
59
+ if (status === GOOGLE_ZERO_STATUS) {
60
+ setPredictionsNotFound(true);
61
+ setAutoCompletePredictions([]);
34
62
  } else {
35
- alert('Please enter text');
63
+ _AlertHandler.default.error(predictionsErrorLabel);
64
+ retrieveError(status);
36
65
  }
37
- }
38
- if (!isLoaded) {
39
- return /*#__PURE__*/_react.default.createElement("div", null, "Loading...");
40
- }
41
- return /*#__PURE__*/_react.default.createElement("div", {
42
- className: "App"
43
- }, /*#__PURE__*/_react.default.createElement("div", {
44
- id: "searchColumn"
45
- }, /*#__PURE__*/_react.default.createElement(_api.Autocomplete, {
46
- onPlaceChanged: onPlaceChanged,
47
- onLoad: onLoad
48
- }, /*#__PURE__*/_react.default.createElement("input", {
49
- type: "text",
50
- placeholder: "Search for Tide Information",
51
- style: {
52
- boxSizing: "border-box",
53
- border: "1px solid transparent",
54
- width: "240px",
55
- height: "32px",
56
- padding: "0 12px",
57
- borderRadius: "3px",
58
- boxShadow: "0 2px 6px rgba(0, 0, 0, 0.3)",
59
- fontSize: "14px",
60
- outline: "none",
61
- textOverflow: "ellipses"
66
+ };
67
+ const handleInputChange = value => {
68
+ setSearchInputValue(value);
69
+ if (value.length >= minChar) {
70
+ googleAutocompleteService.getPlacePredictions({
71
+ input: value,
72
+ sessionToken,
73
+ ...searchRestrictions
74
+ }, handlePredictions);
75
+ } else {
76
+ setAutoCompletePredictions([]);
62
77
  }
63
- }))));
64
- };
65
- UTGoogleAutocomplete.propTypes = {
66
- apikey: _propTypes.string
78
+ };
79
+ const handleGetDetails = (place, status) => {
80
+ if (status === GOOGLE_OK_STATUS) {
81
+ setShowPredicitions(false);
82
+ setSelectedPlace(place);
83
+ } else {
84
+ _AlertHandler.default.error(detailErrorLabel);
85
+ retrieveError(status);
86
+ }
87
+ };
88
+ return /*#__PURE__*/_react.default.createElement("div", {
89
+ className: classes.inputContainer
90
+ }, /*#__PURE__*/_react.default.createElement(_UTAlert.default, {
91
+ content: alert
92
+ }), /*#__PURE__*/_react.default.createElement(_UTTextInput.default, _extends({
93
+ input: {
94
+ value: searchInputValue,
95
+ onChange: handleInputChange
96
+ },
97
+ inputClassName: classes.inputClassName
98
+ }, inputProps)), showPredictions && !(0, _isEmpty.default)(autoCompletePredictions) && autoCompletePredictions.map(_ref2 => {
99
+ let {
100
+ id,
101
+ name
102
+ } = _ref2;
103
+ return /*#__PURE__*/_react.default.createElement("div", {
104
+ ref: placeDetailRef,
105
+ key: id
106
+ }, /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
107
+ onClick: () => {
108
+ setSearchInputValue(name);
109
+ const googleGetPlaceService = new google.maps.places.PlacesService(placeDetailRef.current);
110
+ googleGetPlaceService.getDetails({
111
+ placeId: id
112
+ }, handleGetDetails);
113
+ },
114
+ className: classes.resultsContainer
115
+ }, /*#__PURE__*/_react.default.createElement(_UTIcon.default, {
116
+ size: 20,
117
+ name: "IconMapPin",
118
+ className: classes.resultIcon
119
+ }), /*#__PURE__*/_react.default.createElement(_UTLabel.default, null, name)));
120
+ }), searchInputValue.length >= minChar && predictionsNotFound && /*#__PURE__*/_react.default.createElement("div", {
121
+ className: classes.noResultsContainer
122
+ }, /*#__PURE__*/_react.default.createElement(_UTIcon.default, {
123
+ size: 32,
124
+ name: "IconSearchOff",
125
+ className: classes.noResultsIcon
126
+ }), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
127
+ colorTheme: "gray"
128
+ }, noResultsLabel)), /*#__PURE__*/_react.default.createElement("img", {
129
+ className: classes.googlelogo,
130
+ src: _google_on_white.default,
131
+ alt: "googleLogo"
132
+ }));
67
133
  };
68
- var _default = exports.default = UTGoogleAutocomplete;
134
+ UTGoogleAutocomplete.propTypes = _googleMapsTypes.UTGoogleAutocompletePropTypes;
135
+ var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)((0, _WithGoogleMaps.default)()(UTGoogleAutocomplete));
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.retrieveStyle = void 0;
7
+ const retrieveStyle = _ref => {
8
+ var _theme$Palette$action;
9
+ let {
10
+ theme
11
+ } = _ref;
12
+ return {
13
+ googlelogo: {
14
+ width: '45px'
15
+ },
16
+ inputContainer: {
17
+ borderRadius: '8px',
18
+ display: 'flex',
19
+ flexDirection: 'column',
20
+ gridGap: '8px',
21
+ maxWidth: '480px',
22
+ padding: '16px',
23
+ width: '480px'
24
+ },
25
+ inputClassName: {
26
+ width: '480px'
27
+ },
28
+ noResultsContainer: {
29
+ alignItems: 'center',
30
+ display: 'flex',
31
+ flexDirection: 'column',
32
+ gridGap: '24px',
33
+ padding: '16px'
34
+ },
35
+ noResultsIcon: {
36
+ backgroundColor: theme.Palette.light['03'],
37
+ borderRadius: '25px',
38
+ color: theme.Palette.light['05'],
39
+ padding: '9px'
40
+ },
41
+ resultsContainer: {
42
+ display: 'flex',
43
+ gridGap: '16px',
44
+ padding: '12px 0'
45
+ },
46
+ resultIcon: {
47
+ color: ((_theme$Palette$action = theme.Palette.actions) === null || _theme$Palette$action === void 0 ? void 0 : _theme$Palette$action.neutral['05']) || theme.Palette.neutral['05'],
48
+ minWidth: '20px'
49
+ }
50
+ };
51
+ };
52
+ exports.retrieveStyle = retrieveStyle;
@@ -10,12 +10,13 @@ The icon name must be with the first letter of each word in uppercase.
10
10
 
11
11
  ### Props
12
12
 
13
- | Name | Description |
14
- | --------- | ----------------------------------- |
15
- | name | The name of the icon in TablerIcons |
16
- | classname | The classname to aplied to the Icon |
17
- | color | The icon color |
18
- | size | The icon size in px |
13
+ | Name | Description |
14
+ | ----------- | ----------------------------------- |
15
+ | name | The name of the icon in TablerIcons |
16
+ | classname | The classname to aplied to the Icon |
17
+ | colorTheme | The icon color |
18
+ | shade | The icon color shade |
19
+ | size | The icon size in px |
19
20
 
20
21
  ### Usage
21
22
 
@@ -27,7 +28,7 @@ import styles from './styles.module.scss';
27
28
  const MyComponent = () => {
28
29
  return (
29
30
  <div>
30
- <UTIcon name="IconArrowLeft" color="red" size={48} className={styles.iconClassname} />
31
+ <UTIcon name="IconArrowLeft" colorTheme="dark" size={48} className={styles.iconClassname} />
31
32
  </div>
32
33
  );
33
34
  };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.FILLED_ICON_SUFIX = exports.FILLED_ICON_COLOR = void 0;
7
+ const FILLED_ICON_COLOR = exports.FILLED_ICON_COLOR = 'transparent';
8
+ const FILLED_ICON_SUFIX = exports.FILLED_ICON_SUFIX = 'Filled';
@@ -7,6 +7,8 @@ exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = require("prop-types");
9
9
  var TablerIcons = _interopRequireWildcard(require("@tabler/icons-react"));
10
+ var _WithTheme = _interopRequireDefault(require("../WithTheme"));
11
+ var _theme = require("./theme");
10
12
  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); }
11
13
  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; }
12
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -14,21 +16,41 @@ const UTIcon = _ref => {
14
16
  let {
15
17
  className,
16
18
  color,
19
+ colorTheme,
17
20
  name,
18
- size
21
+ shade,
22
+ size,
23
+ theme
19
24
  } = _ref;
25
+ const {
26
+ iconColor,
27
+ iconStyle
28
+ } = (0, _theme.retrieveColor)({
29
+ color,
30
+ colorTheme,
31
+ name,
32
+ shade,
33
+ theme
34
+ });
20
35
  const IconComponent = TablerIcons[name];
21
36
  if (!IconComponent) return null;
22
37
  return /*#__PURE__*/_react.default.createElement(IconComponent, {
23
38
  className: className,
24
- color: color,
25
- size: size
39
+ color: iconColor,
40
+ size: size,
41
+ style: iconStyle
26
42
  });
27
43
  };
28
44
  UTIcon.propTypes = {
29
45
  className: _propTypes.string,
46
+ /**
47
+ * @deprecated The "color" prop is deprecated and will be removed in a future release. Please use "colorTheme" instead.
48
+ */
30
49
  color: _propTypes.string,
50
+ colorTheme: _propTypes.string,
31
51
  name: _propTypes.string,
32
- size: _propTypes.number
52
+ shade: _propTypes.string,
53
+ size: _propTypes.number,
54
+ theme: _propTypes.object
33
55
  };
34
- var _default = exports.default = UTIcon;
56
+ var _default = exports.default = (0, _WithTheme.default)()(UTIcon);
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.retrieveColor = void 0;
7
+ var _Palette = require("../../constants/Palette");
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
+ const getIconColorDefinition = (color, iconName) => {
11
+ const filled = iconName.endsWith(_constants.FILLED_ICON_SUFIX);
12
+ return {
13
+ iconColor: filled ? _constants.FILLED_ICON_COLOR : color,
14
+ iconStyle: filled ? {
15
+ color
16
+ } : {}
17
+ };
18
+ };
19
+ const retrieveColor = _ref => {
20
+ var _theme$Palette$action;
21
+ let {
22
+ color,
23
+ colorTheme,
24
+ name,
25
+ shade,
26
+ theme
27
+ } = _ref;
28
+ if (color) return getIconColorDefinition(color, name);
29
+ if (!colorTheme) return {};
30
+ const colorThemeDefinition = theme.Palette[colorTheme] || ((_theme$Palette$action = theme.Palette.actions) === null || _theme$Palette$action === void 0 ? void 0 : _theme$Palette$action[colorTheme]);
31
+ const colorShade = shade || getDefaultColorShade(colorTheme);
32
+ return getIconColorDefinition(colorThemeDefinition[colorShade], name);
33
+ };
34
+ exports.retrieveColor = retrieveColor;
@@ -3,18 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.WEIGHTS = exports.VARIANTS_SIZES = exports.VARIANTS_LINE_HEIGHT = exports.VARIANTS = exports.SHADES = exports.MARKDOWN_RENDERERS = exports.DEFAULT_PROPS = exports.COLOR_THEMES = void 0;
6
+ exports.WEIGHTS = exports.VARIANTS_SIZES = exports.VARIANTS_LINE_HEIGHT = exports.VARIANTS = exports.MARKDOWN_RENDERERS = exports.DEFAULT_PROPS = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
+ var _Palette = require("../../constants/Palette");
8
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
10
  /* eslint-disable react/prop-types */
10
11
 
11
- const SHADES = exports.SHADES = {
12
- shade01: '01',
13
- shade02: '02',
14
- shade03: '03',
15
- shade04: '04',
16
- shade05: '05'
17
- };
18
12
  const VARIANTS = exports.VARIANTS = {
19
13
  title1: 'h1',
20
14
  title2: 'h2',
@@ -62,15 +56,6 @@ const WEIGHTS = exports.WEIGHTS = {
62
56
  extrabold: 800,
63
57
  black: 900
64
58
  };
65
- const COLOR_THEMES = exports.COLOR_THEMES = {
66
- dark: 'dark',
67
- gray: 'gray',
68
- light: 'light',
69
- success: 'success',
70
- error: 'error',
71
- warning: 'warning',
72
- information: 'information'
73
- };
74
59
  const MARKDOWN_RENDERERS = exports.MARKDOWN_RENDERERS = {
75
60
  a: _ref => {
76
61
  let {
@@ -85,7 +70,7 @@ const MARKDOWN_RENDERERS = exports.MARKDOWN_RENDERERS = {
85
70
  }
86
71
  };
87
72
  const DEFAULT_PROPS = exports.DEFAULT_PROPS = {
88
- colorTheme: 'dark',
73
+ colorTheme: _Palette.COLOR_THEMES.dark,
89
74
  field: {},
90
75
  markdownRenderers: MARKDOWN_RENDERERS,
91
76
  variant: 'body',
@@ -5,16 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.retrieveStyle = void 0;
7
7
  var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
8
+ var _Palette = require("../../constants/Palette");
8
9
  var _constants = require("./constants");
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- const getDefaultColorShade = colorTheme => colorTheme === _constants.COLOR_THEMES.gray ? _constants.SHADES.shade04 : colorTheme === _constants.COLOR_THEMES.light ? _constants.SHADES.shade01 : _constants.SHADES.shade05;
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;
11
12
  const variantsColorTheme = (colorTheme, shade, theme) => {
12
- const colorThemeDefinition = theme.Palette[colorTheme] || theme.Palette.actions[colorTheme] || theme.Palette[_constants.DEFAULT_PROPS.colorTheme];
13
- const colorShade = Object.values(_constants.SHADES).includes(shade) ? shade : getDefaultColorShade(colorTheme);
13
+ var _theme$Palette$action;
14
+ const colorThemeDefinition = theme.Palette[colorTheme] || ((_theme$Palette$action = theme.Palette.actions) === null || _theme$Palette$action === void 0 ? void 0 : _theme$Palette$action[colorTheme]) || theme.Palette[_constants.DEFAULT_PROPS.colorTheme];
15
+ const colorShade = Object.values(_Palette.COLOR_SHADES).includes(shade) ? shade : getDefaultColorShade(colorTheme);
14
16
  return colorThemeDefinition[colorShade] || _colorsModule.default.black;
15
17
  };
16
18
  const linkColor = (theme, colorTheme) => {
17
- const color = colorTheme === _constants.COLOR_THEMES.light ? theme.Palette.actions.negative[_constants.SHADES.shade05] : colorTheme === _constants.COLOR_THEMES.error ? theme.Palette.actions.error[_constants.SHADES.shade05] : theme.Palette.actions.neutral[_constants.SHADES.shade05];
19
+ const actionPaletteColors = theme.Palette.actions || theme.Palette;
20
+ const color = colorTheme === _Palette.COLOR_THEMES.light ? actionPaletteColors.negative[_Palette.COLOR_SHADES.shade05] : colorTheme === _Palette.COLOR_THEMES.error ? actionPaletteColors.error[_Palette.COLOR_SHADES.shade05] : actionPaletteColors.neutral[_Palette.COLOR_SHADES.shade05];
18
21
  return color;
19
22
  };
20
23
  const retrieveStyle = _ref => {
@@ -8,10 +8,10 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _array = require("@widergy/web-utils/lib/array");
9
9
  var _form = require("@widergy/web-utils/lib/form");
10
10
  var _UTLabel = _interopRequireDefault(require("../UTLabel"));
11
+ var _googleMapsTypes = require("../../types/googleMapsTypes");
12
+ var _WithGoogleMaps = _interopRequireDefault(require("../WithGoogleMaps"));
11
13
  var _GoogleMaps = _interopRequireDefault(require("./components/GoogleMaps"));
12
14
  var _utils = require("./utils");
13
- var _types = require("./types");
14
- var _withGoogleMapScript = _interopRequireDefault(require("./withGoogleMapScript"));
15
15
  var _constants = require("./constants");
16
16
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
17
17
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -239,7 +239,7 @@ class UTMap extends _react.PureComponent {
239
239
  }, (0, _form.shouldShowErrors)(this.props.meta) ? this.props.meta.error : ''));
240
240
  }
241
241
  }
242
- UTMap.propTypes = _types.UTMapPropTypes;
242
+ UTMap.propTypes = _googleMapsTypes.UTMapPropTypes;
243
243
  UTMap.defaultProps = {
244
244
  errors: {
245
245
  retrievingLocation: _constants.TEXTS.retrievingLocation,
@@ -253,4 +253,4 @@ UTMap.defaultProps = {
253
253
  }
254
254
  }
255
255
  };
256
- var _default = exports.default = (0, _withGoogleMapScript.default)()(UTMap);
256
+ var _default = exports.default = (0, _WithGoogleMaps.default)()(UTMap);
@@ -3,40 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.UTMapPropTypes = exports.GoogleMapsPropTypes = void 0;
6
+ exports.GoogleMapsPropTypes = void 0;
7
7
  var _propTypes = require("prop-types");
8
- var _formTypes = require("../../types/formTypes");
9
8
  const coordinatePropType = (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.func]);
10
- const UTMapPropTypes = exports.UTMapPropTypes = {
11
- onChange: _propTypes.func.isRequired,
12
- singleMarker: _propTypes.bool,
13
- startLocation: (0, _propTypes.shape)({
14
- position: (0, _propTypes.shape)({
15
- lat: coordinatePropType,
16
- lng: coordinatePropType
17
- }),
18
- key: _propTypes.number,
19
- defaultAnimation: _propTypes.number
20
- }),
21
- useGeolocation: _propTypes.bool,
22
- usePolygon: _propTypes.bool,
23
- placeholder: _propTypes.string,
24
- polygonPath: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
25
- lat: _propTypes.number,
26
- lng: _propTypes.number
27
- })),
28
- onLocationOutOfBoundsCallback: _propTypes.func,
29
- errors: (0, _propTypes.shape)({
30
- retrievingLocation: _propTypes.string,
31
- retrieveLocationError: _propTypes.string
32
- }),
33
- className: _propTypes.string,
34
- field: _formTypes.fieldType,
35
- meta: _formTypes.metaPropTypes,
36
- input: _formTypes.inputPropTypes,
37
- apiKey: _propTypes.string,
38
- disabled: _propTypes.bool
39
- };
40
9
  const GoogleMapsPropTypes = exports.GoogleMapsPropTypes = {
41
10
  onMapClick: _propTypes.func.isRequired,
42
11
  onMarkerRightClick: _propTypes.func.isRequired,
@@ -24,17 +24,19 @@ const getLabelTheme = _ref2 => {
24
24
  }[variant];
25
25
  };
26
26
  const getButtonTheme = _ref3 => {
27
+ var _theme$Palette$action, _theme$Palette$action2, _theme$Palette$action3;
27
28
  let {
28
29
  theme,
29
30
  variant
30
31
  } = _ref3;
31
32
  return {
32
- [_constants.VARIANTS.dark]: theme.Palette.actions.negative['04'],
33
- [_constants.VARIANTS.information]: theme.Palette.actions.negative['04'],
34
- [_constants.VARIANTS.light]: theme.Palette.actions.accent['04']
33
+ [_constants.VARIANTS.dark]: ((_theme$Palette$action = theme.Palette.actions) === null || _theme$Palette$action === void 0 ? void 0 : _theme$Palette$action.negative['04']) || theme.Palette.negative['04'],
34
+ [_constants.VARIANTS.information]: ((_theme$Palette$action2 = theme.Palette.actions) === null || _theme$Palette$action2 === void 0 ? void 0 : _theme$Palette$action2.negative['04']) || theme.Palette.negative['04'],
35
+ [_constants.VARIANTS.light]: ((_theme$Palette$action3 = theme.Palette.actions) === null || _theme$Palette$action3 === void 0 ? void 0 : _theme$Palette$action3.accent['04']) || theme.Palette.accent['04']
35
36
  }[variant];
36
37
  };
37
38
  const getButtonNextTextTheme = _ref4 => {
39
+ var _theme$Palette$action4;
38
40
  let {
39
41
  theme,
40
42
  variant
@@ -42,7 +44,7 @@ const getButtonNextTextTheme = _ref4 => {
42
44
  return {
43
45
  [_constants.VARIANTS.dark]: theme.Palette.dark['05'],
44
46
  [_constants.VARIANTS.information]: theme.Palette.dark['05'],
45
- [_constants.VARIANTS.light]: theme.Palette.actions.negative['05']
47
+ [_constants.VARIANTS.light]: ((_theme$Palette$action4 = theme.Palette.actions) === null || _theme$Palette$action4 === void 0 ? void 0 : _theme$Palette$action4.negative['05']) || theme.Palette.negative['05']
46
48
  }[variant];
47
49
  };
48
50
  const validateProps = _ref5 => {
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.retrieveStyle = void 0;
7
7
  const retrieveStyle = _ref => {
8
+ var _theme$Palette$action, _theme$Palette$action2;
8
9
  let {
9
10
  theme
10
11
  } = _ref;
@@ -26,7 +27,7 @@ const retrieveStyle = _ref => {
26
27
  paddingBottom: '24px'
27
28
  },
28
29
  discountChip: {
29
- backgroundColor: theme.Palette.actions.accent['04'],
30
+ backgroundColor: ((_theme$Palette$action = theme.Palette.actions) === null || _theme$Palette$action === void 0 ? void 0 : _theme$Palette$action.accent['04']) || theme.Palette.accent['04'],
30
31
  borderRadius: '4px',
31
32
  padding: '4px 8px'
32
33
  },
@@ -55,7 +56,7 @@ const retrieveStyle = _ref => {
55
56
  gridGap: '12px'
56
57
  },
57
58
  selectedQuantity: {
58
- backgroundColor: theme.Palette.actions.neutral['04'],
59
+ backgroundColor: ((_theme$Palette$action2 = theme.Palette.actions) === null || _theme$Palette$action2 === void 0 ? void 0 : _theme$Palette$action2.neutral['04']) || theme.Palette.neutral['04'],
59
60
  borderRadius: '4px',
60
61
  padding: '4px 8px'
61
62
  }
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.retrieveStyle = void 0;
7
7
  var _shadowUtils = require("../../utils/shadowUtils");
8
8
  const retrieveStyle = _ref => {
9
- var _theme$Palette$shadow;
9
+ var _theme$Palette$shadow, _theme$Palette$action, _theme$Palette$action2, _theme$Palette$action3, _theme$Palette$action4, _theme$Palette$action5, _theme$Palette$action6, _theme$Palette$action7, _theme$Palette$action8, _theme$Palette$action9, _theme$Palette$action10, _theme$Palette$action11, _theme$Palette$action12, _theme$Palette$action13;
10
10
  let {
11
11
  theme
12
12
  } = _ref;
@@ -113,20 +113,20 @@ const retrieveStyle = _ref => {
113
113
  },
114
114
  whiteSelectedContainer: {
115
115
  boxShadow: 'none',
116
- outline: "2px solid ".concat(theme.Palette.actions.accent['05']),
116
+ outline: "2px solid ".concat(((_theme$Palette$action = theme.Palette.actions) === null || _theme$Palette$action === void 0 ? void 0 : _theme$Palette$action.accent['05']) || theme.Palette.accent['05']),
117
117
  '& $titleText, & $description, & $aditionalInfoTitle, & $aditionalInfoDescription': {
118
- color: theme.Palette.actions.accent['05']
118
+ color: ((_theme$Palette$action2 = theme.Palette.actions) === null || _theme$Palette$action2 === void 0 ? void 0 : _theme$Palette$action2.accent['05']) || theme.Palette.accent['05']
119
119
  },
120
120
  '& $icon path, & $infoIcon path, & $checkIcon path': {
121
- fill: theme.Palette.actions.accent['05']
121
+ fill: ((_theme$Palette$action3 = theme.Palette.actions) === null || _theme$Palette$action3 === void 0 ? void 0 : _theme$Palette$action3.accent['05']) || theme.Palette.accent['05']
122
122
  },
123
123
  '&:hover': {
124
- backgroundColor: theme.Palette.actions.accent['01'],
125
- outline: "2px solid ".concat(theme.Palette.actions.accent['05'])
124
+ backgroundColor: ((_theme$Palette$action4 = theme.Palette.actions) === null || _theme$Palette$action4 === void 0 ? void 0 : _theme$Palette$action4.accent['01']) || theme.Palette.accent['01'],
125
+ outline: "2px solid ".concat(((_theme$Palette$action5 = theme.Palette.actions) === null || _theme$Palette$action5 === void 0 ? void 0 : _theme$Palette$action5.accent['05']) || theme.Palette.accent['05'])
126
126
  },
127
127
  '&:active': {
128
- backgroundColor: theme.Palette.actions.accent['02'],
129
- outline: "2px solid ".concat(theme.Palette.actions.accent['05'])
128
+ backgroundColor: ((_theme$Palette$action6 = theme.Palette.actions) === null || _theme$Palette$action6 === void 0 ? void 0 : _theme$Palette$action6.accent['02']) || theme.Palette.accent['02'],
129
+ outline: "2px solid ".concat(((_theme$Palette$action7 = theme.Palette.actions) === null || _theme$Palette$action7 === void 0 ? void 0 : _theme$Palette$action7.accent['05']) || theme.Palette.accent['05'])
130
130
  }
131
131
  },
132
132
  whiteDisabledContainer: {
@@ -169,19 +169,19 @@ const retrieveStyle = _ref => {
169
169
  }
170
170
  },
171
171
  graySelectedContainer: {
172
- backgroundColor: theme.Palette.actions.accent['01'],
173
- outline: "2px solid ".concat(theme.Palette.actions.accent['03']),
172
+ backgroundColor: ((_theme$Palette$action8 = theme.Palette.actions) === null || _theme$Palette$action8 === void 0 ? void 0 : _theme$Palette$action8.accent['01']) || theme.Palette.accent['01'],
173
+ outline: "2px solid ".concat(((_theme$Palette$action9 = theme.Palette.actions) === null || _theme$Palette$action9 === void 0 ? void 0 : _theme$Palette$action9.accent['03']) || theme.Palette.accent['03']),
174
174
  '& $titleText, & $description, & $aditionalInfoTitle, & $aditionalInfoDescription': {
175
- color: theme.Palette.actions.accent['05']
175
+ color: ((_theme$Palette$action10 = theme.Palette.actions) === null || _theme$Palette$action10 === void 0 ? void 0 : _theme$Palette$action10.accent['05']) || theme.Palette.accent['05']
176
176
  },
177
177
  '& $icon path, & $infoIcon path, & $checkIcon path': {
178
- fill: theme.Palette.actions.accent['05']
178
+ fill: ((_theme$Palette$action11 = theme.Palette.actions) === null || _theme$Palette$action11 === void 0 ? void 0 : _theme$Palette$action11.accent['05']) || theme.Palette.accent['05']
179
179
  },
180
180
  '&:hover': {
181
- backgroundColor: theme.Palette.actions.accent['02']
181
+ backgroundColor: ((_theme$Palette$action12 = theme.Palette.actions) === null || _theme$Palette$action12 === void 0 ? void 0 : _theme$Palette$action12.accent['02']) || theme.Palette.accent['02']
182
182
  },
183
183
  '&:active': {
184
- backgroundColor: theme.Palette.actions.accent['03'],
184
+ backgroundColor: ((_theme$Palette$action13 = theme.Palette.actions) === null || _theme$Palette$action13 === void 0 ? void 0 : _theme$Palette$action13.accent['03']) || theme.Palette.accent['03'],
185
185
  '& $titleText, & $description, & $aditionalInfoTitle, & $aditionalInfoDescription': {
186
186
  color: theme.Palette.light['01']
187
187
  },
@@ -9,7 +9,7 @@ var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.
9
9
  var _classesUtils = require("../../utils/classesUtils");
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const retrieveStyle = _ref => {
12
- var _theme$UTTable, _theme$UTTable2, _theme$UTTable3, _theme$UTTable4, _theme$UTTable5, _theme$UTTable6, _theme$UTTable7, _theme$UTTable8, _theme$UTTable9, _theme$UTTable10, _theme$UTTable11, _theme$UTTable12, _theme$UTTable13, _theme$UTTable14, _theme$UTTable15, _theme$UTTable16, _theme$UTTable17, _theme$UTTable18, _theme$UTTable19, _theme$UTTable20, _theme$UTTable21, _theme$UTTable22, _theme$UTTable23, _theme$UTTable24, _theme$UTTable25, _theme$UTTable26, _theme$UTTable27;
12
+ var _theme$UTTable, _theme$UTTable2, _theme$UTTable3, _theme$UTTable4, _theme$UTTable5, _theme$UTTable6, _theme$UTTable7, _theme$UTTable8, _theme$UTTable9, _theme$UTTable10, _theme$UTTable11, _theme$UTTable12, _theme$UTTable13, _theme$UTTable14, _theme$UTTable15, _theme$UTTable16, _theme$UTTable17, _theme$UTTable18, _theme$UTTable19, _theme$UTTable20, _theme$UTTable21, _theme$UTTable22, _theme$UTTable23, _theme$UTTable24, _theme$UTTable25, _theme$UTTable26, _theme$UTTable27, _theme$Palette$action, _theme$Palette$action2, _theme$Palette$action3;
13
13
  let {
14
14
  theme
15
15
  } = _ref;
@@ -352,12 +352,12 @@ const retrieveStyle = _ref => {
352
352
  color: (0, _seamlessImmutable.getIn)(theme, ['Loading', 'base', 'color'], _colorsModule.default.loadingBase)
353
353
  },
354
354
  actionIcon: {
355
- color: theme.Palette.actions.neutral['05'],
356
- fill: theme.Palette.actions.neutral['05']
355
+ color: ((_theme$Palette$action = theme.Palette.actions) === null || _theme$Palette$action === void 0 ? void 0 : _theme$Palette$action.neutral['05']) || theme.Palette.neutral['05'],
356
+ fill: ((_theme$Palette$action2 = theme.Palette.actions) === null || _theme$Palette$action2 === void 0 ? void 0 : _theme$Palette$action2.neutral['05']) || theme.Palette.neutral['05']
357
357
  },
358
358
  actionIconButton: {
359
359
  '&:hover': {
360
- backgroundColor: theme.Palette.actions.neutral['01']
360
+ backgroundColor: ((_theme$Palette$action3 = theme.Palette.actions) === null || _theme$Palette$action3 === void 0 ? void 0 : _theme$Palette$action3.neutral['01']) || theme.Palette.neutral['01']
361
361
  }
362
362
  }
363
363
  };
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _withScriptjs = _interopRequireDefault(require("react-google-maps/lib/withScriptjs"));
9
- var _types = require("./types");
9
+ var _propTypes = require("prop-types");
10
+ var _googleMapsTypes = require("../../types/googleMapsTypes");
10
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
12
  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); }
12
13
  const WithGoogleMapScript = () => WrappedComponent => {
@@ -25,7 +26,11 @@ const WithGoogleMapScript = () => WrappedComponent => {
25
26
  })
26
27
  }, props));
27
28
  };
28
- WithGoogleMap.propTypes = _types.UTMapPropTypes.propTypes;
29
+ WithGoogleMap.propTypes = {
30
+ apiKey: _propTypes.string,
31
+ UTMapPropTypes: _googleMapsTypes.UTMapPropTypes,
32
+ UTGoogleAutocompletePropTypes: _googleMapsTypes.UTGoogleAutocompletePropTypes
33
+ };
29
34
  return WithGoogleMap;
30
35
  };
31
36
  var _default = exports.default = WithGoogleMapScript;
@@ -44,9 +44,11 @@ const ThemedComponent = _ref => {
44
44
  return muiThemeUpdated ? /*#__PURE__*/_react.default.createElement(_styles.MuiThemeProvider, {
45
45
  theme: muiThemeUpdated
46
46
  }, /*#__PURE__*/_react.default.createElement(Component, _extends({
47
- classes: classes
47
+ classes: classes,
48
+ theme: theme
48
49
  }, props))) : /*#__PURE__*/_react.default.createElement(Component, _extends({
49
- classes: classes
50
+ classes: classes,
51
+ theme: theme
50
52
  }, props));
51
53
  };
52
54
  ThemedComponent.propTypes = {
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.COLOR_THEMES = exports.COLOR_SHADES = void 0;
7
+ const COLOR_SHADES = exports.COLOR_SHADES = {
8
+ shade01: '01',
9
+ shade02: '02',
10
+ shade03: '03',
11
+ shade04: '04',
12
+ shade05: '05'
13
+ };
14
+ const COLOR_THEMES = exports.COLOR_THEMES = {
15
+ accent: 'accent',
16
+ dark: 'dark',
17
+ error: 'error',
18
+ gray: 'gray',
19
+ information: 'information',
20
+ light: 'light',
21
+ negative: 'negative',
22
+ neutral: 'neutral',
23
+ success: 'success',
24
+ warning: 'warning'
25
+ };
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.UTMapPropTypes = exports.UTGoogleAutocompletePropTypes = void 0;
7
+ var _propTypes = require("prop-types");
8
+ var _formTypes = require("./formTypes");
9
+ const coordinatePropType = (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.func]);
10
+ const UTMapPropTypes = exports.UTMapPropTypes = {
11
+ onChange: _propTypes.func.isRequired,
12
+ singleMarker: _propTypes.bool,
13
+ startLocation: (0, _propTypes.shape)({
14
+ position: (0, _propTypes.shape)({
15
+ lat: coordinatePropType,
16
+ lng: coordinatePropType
17
+ }),
18
+ key: _propTypes.number,
19
+ defaultAnimation: _propTypes.number
20
+ }),
21
+ useGeolocation: _propTypes.bool,
22
+ usePolygon: _propTypes.bool,
23
+ placeholder: _propTypes.string,
24
+ polygonPath: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
25
+ lat: _propTypes.number,
26
+ lng: _propTypes.number
27
+ })),
28
+ onLocationOutOfBoundsCallback: _propTypes.func,
29
+ errors: (0, _propTypes.shape)({
30
+ retrievingLocation: _propTypes.string,
31
+ retrieveLocationError: _propTypes.string
32
+ }),
33
+ className: _propTypes.string,
34
+ field: _formTypes.fieldType,
35
+ meta: _formTypes.metaPropTypes,
36
+ input: _formTypes.inputPropTypes,
37
+ apiKey: _propTypes.string,
38
+ disabled: _propTypes.bool
39
+ };
40
+ const UTGoogleAutocompletePropTypes = exports.UTGoogleAutocompletePropTypes = {
41
+ alert: _propTypes.string,
42
+ apikey: _propTypes.string,
43
+ classes: (0, _propTypes.objectOf)(_propTypes.string),
44
+ detailErrorLabel: _propTypes.string,
45
+ inputProps: _propTypes.object,
46
+ minChar: _propTypes.number,
47
+ noResultsLabel: _propTypes.string,
48
+ predictionsErrorLabel: _propTypes.string,
49
+ retrieveError: _propTypes.func,
50
+ searchRestrictions: _propTypes.object,
51
+ setSelectedPlace: _propTypes.func
52
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.11.0",
3
+ "version": "3.12.1",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",