@telefonica/mistica 12.0.0 → 12.1.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.
Files changed (47) hide show
  1. package/dist/button-group.js +1 -1
  2. package/dist/button.js +4 -3
  3. package/dist/card.d.ts +4 -0
  4. package/dist/card.js +7 -2
  5. package/dist/card.js.flow +4 -0
  6. package/dist/carousel.d.ts +4 -0
  7. package/dist/carousel.js +6 -3
  8. package/dist/carousel.js.flow +6 -0
  9. package/dist/checkbox.js +2 -1
  10. package/dist/generated/mistica-icons/icon-photo-camera-filled.js +38 -18
  11. package/dist/generated/mistica-icons/icon-photo-camera-light.js +30 -16
  12. package/dist/generated/mistica-icons/icon-process-loading-filled.js +1 -1
  13. package/dist/generated/mistica-icons/icon-shield-cross-light.js +1 -1
  14. package/dist/generated/mistica-icons/icon-shop-light.js +1 -1
  15. package/dist/generated/mistica-icons/icon-talk-filled.js +1 -1
  16. package/dist/generated/mistica-icons/icon-tongue-light.js +1 -1
  17. package/dist/generated/mistica-icons/icon-trash-can-filled.js +1 -1
  18. package/dist/generated/mistica-icons/icon-umbrella-filled.js +1 -1
  19. package/dist/generated/mistica-icons/icon-web-filled.js +1 -1
  20. package/dist/package-version.js +1 -1
  21. package/dist/popover.d.ts +2 -1
  22. package/dist/popover.js +58 -63
  23. package/dist/popover.js.flow +2 -1
  24. package/dist/skins/blau.js +1 -1
  25. package/dist/spinner.js +0 -1
  26. package/dist/text-link.js +16 -8
  27. package/dist-es/button-group.js +1 -1
  28. package/dist-es/button.js +4 -3
  29. package/dist-es/card.js +7 -2
  30. package/dist-es/carousel.js +6 -3
  31. package/dist-es/checkbox.js +2 -1
  32. package/dist-es/generated/mistica-icons/icon-photo-camera-filled.js +38 -18
  33. package/dist-es/generated/mistica-icons/icon-photo-camera-light.js +30 -16
  34. package/dist-es/generated/mistica-icons/icon-process-loading-filled.js +1 -1
  35. package/dist-es/generated/mistica-icons/icon-shield-cross-light.js +1 -1
  36. package/dist-es/generated/mistica-icons/icon-shop-light.js +1 -1
  37. package/dist-es/generated/mistica-icons/icon-talk-filled.js +1 -1
  38. package/dist-es/generated/mistica-icons/icon-tongue-light.js +1 -1
  39. package/dist-es/generated/mistica-icons/icon-trash-can-filled.js +1 -1
  40. package/dist-es/generated/mistica-icons/icon-umbrella-filled.js +1 -1
  41. package/dist-es/generated/mistica-icons/icon-web-filled.js +1 -1
  42. package/dist-es/package-version.js +1 -1
  43. package/dist-es/popover.js +59 -64
  44. package/dist-es/skins/blau.js +1 -1
  45. package/dist-es/spinner.js +0 -1
  46. package/dist-es/text-link.js +16 -8
  47. package/package.json +1 -1
@@ -75,9 +75,13 @@ function _unsupportedIterableToArray(o, minLen) {
75
75
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
76
76
  import * as React from "react";
77
77
  import { createUseStyles } from "./jss";
78
- import IcnCloseRegular from "./generated/mistica-icons/icon-close-regular";
78
+ import IconCloseRegular from "./generated/mistica-icons/icon-close-regular";
79
79
  import IconButton from "./icon-button";
80
80
  import { useTheme, useScreenSize } from "./hooks";
81
+ import Stack from "./stack";
82
+ import Box from "./box";
83
+ import Inline from "./inline";
84
+ import { Text3, Text2 } from "./text";
81
85
  // Zeplin definition:
82
86
  // https://app.zeplin.io/project/5c9b6f097168bc065782b5c3/screen/5d15d87e46571573089f2863
83
87
  var defaultPositionDesktop = "bottom";
@@ -99,7 +103,7 @@ var useStyles = createUseStyles(function(theme) {
99
103
  top: 0,
100
104
  left: "50%",
101
105
  transform: "translate(-50%, -50%) rotate(45deg)",
102
- border: "1px solid ".concat(theme.colors.divider),
106
+ border: "1px solid ".concat(theme.colors.border),
103
107
  borderRadius: 2,
104
108
  boxShadow: function(param) {
105
109
  var position = param.position;
@@ -122,46 +126,27 @@ var useStyles = createUseStyles(function(theme) {
122
126
  zIndex: 9,
123
127
  boxShadow: "0 2px 4px 0 rgba(0, 0, 0, ".concat(shadowAlpha, ")"),
124
128
  backgroundColor: theme.colors.backgroundContainer,
125
- border: "1px solid ".concat(theme.colors.divider),
129
+ border: "1px solid ".concat(theme.colors.border),
126
130
  borderRadius: 8
127
131
  },
128
- title: {
129
- marginBottom: 4,
130
- color: theme.colors.textPrimary,
131
- fontWeight: 400,
132
- lineHeight: 1.5,
133
- fontSize: 16
134
- },
135
- boxContainer: {
136
- position: "relative",
132
+ textAlign: {
137
133
  display: "flex",
138
- justifyContent: "space-between"
134
+ alignItems: "center",
135
+ height: "100%"
136
+ },
137
+ boxContent: {
138
+ display: "flex"
139
139
  },
140
140
  textContent: {
141
- display: "flex",
142
- flexDirection: "column",
143
- margin: 16,
144
- marginRight: 8,
145
- justifyContent: "center",
141
+ textAlign: "left",
146
142
  width: "100%",
147
143
  wordBreak: "break-word"
148
144
  },
149
- assetContent: {
150
- width: 40,
151
- minWidth: 40,
152
- height: 40,
153
- margin: 16,
154
- marginRight: 0
155
- },
156
- text: {
157
- color: theme.colors.textSecondary,
158
- textAlign: "left",
159
- lineHeight: 1.42857142,
160
- fontSize: 14
161
- },
162
145
  closeButtonIcon: {
163
- paddingTop: 8,
164
- paddingRight: 8
146
+ position: "absolute",
147
+ top: 8,
148
+ right: 8,
149
+ zIndex: 1
165
150
  }
166
151
  };
167
152
  });
@@ -246,7 +231,7 @@ var getTargetPosition = function(targetWrapper) {
246
231
  } : null;
247
232
  };
248
233
  var Popover = function(param) {
249
- var description = param.description, title = param.title, onClose = param.onClose, trackingEvent = param.trackingEvent, position = param.position, width = param.width, target = param.target, asset = param.asset, _isVisible = param.isVisible, isVisible = _isVisible === void 0 ? true : _isVisible;
234
+ var description = param.description, title = param.title, onClose = param.onClose, trackingEvent = param.trackingEvent, position = param.position, width = param.width, target = param.target, asset = param.asset, _isVisible = param.isVisible, isVisible = _isVisible === void 0 ? true : _isVisible, extra = param.extra;
250
235
  var ref = useTheme(), texts = ref.texts, colors = ref.colors, isIos = ref.isIos;
251
236
  var isTabletOrSmaller = useScreenSize().isTabletOrSmaller;
252
237
  var ref1 = _slicedToArray(React.useState(null), 2), targetPosition = ref1[0], setTargetPosition = ref1[1];
@@ -287,40 +272,50 @@ var Popover = function(param) {
287
272
  className: classes.arrow
288
273
  })
289
274
  }),
290
- /*#__PURE__*/ _jsxs("div", {
291
- className: classes.boxContainer,
275
+ /*#__PURE__*/ _jsxs(Box, {
276
+ padding: 16,
292
277
  children: [
293
- asset && /*#__PURE__*/ _jsx("div", {
294
- className: classes.assetContent,
295
- children: asset
296
- }),
297
- /*#__PURE__*/ _jsxs("div", {
298
- className: classes.textContent,
299
- children: [
300
- title && /*#__PURE__*/ _jsx("span", {
301
- className: classes.title,
302
- children: title
303
- }),
304
- /*#__PURE__*/ _jsx("span", {
305
- className: classes.text,
306
- children: description
307
- })
308
- ]
278
+ /*#__PURE__*/ _jsx(Box, {
279
+ paddingRight: 24,
280
+ className: classes.boxContent,
281
+ children: /*#__PURE__*/ _jsxs(Inline, {
282
+ space: 16,
283
+ children: [
284
+ asset,
285
+ /*#__PURE__*/ _jsx(Box, {
286
+ className: classes.textAlign,
287
+ children: /*#__PURE__*/ _jsxs(Stack, {
288
+ space: 4,
289
+ className: classes.textContent,
290
+ children: [
291
+ title && /*#__PURE__*/ _jsx(Text3, {
292
+ regular: true,
293
+ children: title
294
+ }),
295
+ /*#__PURE__*/ _jsx(Text2, {
296
+ regular: true,
297
+ color: colors.textSecondary,
298
+ children: description
299
+ })
300
+ ]
301
+ })
302
+ })
303
+ ]
304
+ })
309
305
  }),
310
- /*#__PURE__*/ _jsx("div", {
306
+ /*#__PURE__*/ _jsx(IconButton, {
311
307
  className: classes.closeButtonIcon,
312
- children: /*#__PURE__*/ _jsx(IconButton, {
313
- onPress: function(e) {
314
- onClose === null || onClose === void 0 ? void 0 : onClose();
315
- e.stopPropagation();
316
- },
317
- trackingEvent: trackingEvent,
318
- "aria-label": texts.modalClose,
319
- children: /*#__PURE__*/ _jsx(IcnCloseRegular, {
320
- color: colors.neutralHigh
321
- })
308
+ onPress: function(e) {
309
+ onClose === null || onClose === void 0 ? void 0 : onClose();
310
+ e.stopPropagation();
311
+ },
312
+ trackingEvent: trackingEvent,
313
+ "aria-label": texts.modalClose,
314
+ children: /*#__PURE__*/ _jsx(IconCloseRegular, {
315
+ color: colors.neutralHigh
322
316
  })
323
- })
317
+ }),
318
+ extra
324
319
  ]
325
320
  })
326
321
  ]
@@ -53,7 +53,7 @@ export var getBlauSkin = function() {
53
53
  backgroundBrand: palette.blauBluePrimary,
54
54
  backgroundOverlay: applyAlpha(palette.blauBlueSecondary, 0.75),
55
55
  backgroundSkeleton: palette.grey2,
56
- backgroundSkeletonInverse: palette.white,
56
+ backgroundSkeletonInverse: applyAlpha(palette.white, 0.2),
57
57
  navigationBarBackground: palette.blauBluePrimary,
58
58
  backgroundAlternative: palette.blauBluePrimary20,
59
59
  backgroundFeedbackBottom: palette.blauBluePrimary,
@@ -211,7 +211,6 @@ var Spinner = function(param) {
211
211
  r: "30",
212
212
  role: "presentation",
213
213
  stroke: color,
214
- strokeLinecap: "square",
215
214
  strokeWidth: "6"
216
215
  })
217
216
  ]
@@ -62,25 +62,33 @@ import { useIsInverseVariant } from "./theme-variant-context";
62
62
  import { useForm } from "./form-context";
63
63
  import { getTextFromChildren } from "./utils/common";
64
64
  import { eventActions, eventCategories, eventNames, useTrackingConfig } from "./utils/analytics";
65
- var useStyles = createUseStyles(function(theme) {
65
+ var useStyles = createUseStyles(function(param) {
66
+ var colors = param.colors, isDarkMode = param.isDarkMode, mq = param.mq;
66
67
  var _obj;
67
68
  return {
68
69
  textLink: (_obj = {
69
70
  width: "auto",
70
71
  lineHeight: "inherit",
71
72
  display: "inline-block",
72
- color: theme.colors.textLink,
73
- wordBreak: "break-word"
74
- }, _defineProperty(_obj, theme.mq.supportsHover, {
73
+ color: colors.textLink,
74
+ wordBreak: "break-word",
75
+ cursor: "pointer"
76
+ }, _defineProperty(_obj, mq.supportsHover, {
75
77
  "&:hover:not([disabled])": {
76
78
  textDecoration: "underline"
77
79
  }
78
80
  }), _defineProperty(_obj, "&[disabled]", {
79
- opacity: 0.5
81
+ opacity: 0.5,
82
+ textDecoration: "none"
80
83
  }), _obj),
81
- inverse: {
82
- color: theme.colors.textLinkInverse
83
- },
84
+ inverse: _defineProperty({
85
+ color: colors.textLinkInverse,
86
+ textDecoration: isDarkMode ? "none" : "underline"
87
+ }, mq.supportsHover, {
88
+ "&:hover:not([disabled])": {
89
+ textDecorationThickness: isDarkMode ? 1 : 2
90
+ }
91
+ }),
84
92
  small: {
85
93
  fontSize: 14
86
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telefonica/mistica",
3
- "version": "12.0.0",
3
+ "version": "12.1.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",