@telefonica/mistica 11.10.1 → 11.11.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.
@@ -0,0 +1,86 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { createUseStyles } from "./jss";
4
+ import IconCloseRegular from "./generated/mistica-icons/icon-close-regular";
5
+ import { useTheme } from "./hooks";
6
+ import IconButton from "./icon-button";
7
+ import { useIsInverseVariant } from "./theme-variant-context";
8
+ import { applyAlpha } from "./utils/color";
9
+ var DismissableContext = /*#__PURE__*/ React.createContext(false);
10
+ export var useIsDismissable = function() {
11
+ return React.useContext(DismissableContext);
12
+ };
13
+ var useStyles = createUseStyles(function(theme) {
14
+ return {
15
+ dismissableContainer: {
16
+ position: "relative",
17
+ display: "flex",
18
+ flexShrink: 0,
19
+ width: function(param) {
20
+ var width = param.width;
21
+ return width || "100%";
22
+ }
23
+ },
24
+ dismissableButton: {
25
+ position: "absolute",
26
+ top: 0,
27
+ right: 0,
28
+ width: 48,
29
+ height: 48,
30
+ display: "flex",
31
+ alignItems: "center",
32
+ justifyContent: "center"
33
+ },
34
+ dismissableCircleContainer: {
35
+ display: "flex",
36
+ alignItems: "center",
37
+ justifyContent: "center",
38
+ width: 24,
39
+ height: 24,
40
+ margin: "0 0 8px 8px",
41
+ borderRadius: "50%",
42
+ backgroundColor: applyAlpha(theme.colors.background, 0.7)
43
+ }
44
+ };
45
+ });
46
+ var MaybeDismissable = function(param) {
47
+ var children = param.children, width = param.width, onClose = param.onClose, ariaLabel = param["aria-label"];
48
+ var isInverse = useIsInverseVariant();
49
+ var classes = useStyles({
50
+ isInverse: isInverse,
51
+ width: width
52
+ });
53
+ var ref = useTheme(), colors = ref.colors, texts = ref.texts;
54
+ if (!onClose) {
55
+ return /*#__PURE__*/ _jsx(_Fragment, {
56
+ children: children
57
+ });
58
+ }
59
+ return /*#__PURE__*/ _jsxs("section", {
60
+ className: classes.dismissableContainer,
61
+ "aria-label": ariaLabel,
62
+ children: [
63
+ /*#__PURE__*/ _jsx(DismissableContext.Provider, {
64
+ value: true,
65
+ children: children
66
+ }),
67
+ /*#__PURE__*/ _jsx(IconButton, {
68
+ className: classes.dismissableButton,
69
+ onPress: onClose,
70
+ "aria-label": texts.closeButtonLabel,
71
+ style: {
72
+ display: "flex",
73
+ width: 48,
74
+ height: 48
75
+ },
76
+ children: /*#__PURE__*/ _jsx("div", {
77
+ className: classes.dismissableCircleContainer,
78
+ children: /*#__PURE__*/ _jsx(IconCloseRegular, {
79
+ color: colors.neutralHigh
80
+ })
81
+ })
82
+ })
83
+ ]
84
+ });
85
+ };
86
+ export default MaybeDismissable;
@@ -1,2 +1,2 @@
1
1
  // DO NOT EDIT THIS FILE. It's autogenerated by set-version.js
2
- export var PACKAGE_VERSION = "11.10.1";
2
+ export var PACKAGE_VERSION = "11.11.1";
package/dist-es/select.js CHANGED
@@ -200,7 +200,7 @@ var useStyles = createUseStyles(function(theme) {
200
200
  },
201
201
  menuItem: (_obj1 = {
202
202
  color: theme.colors.textPrimary,
203
- padding: "6px 16px",
203
+ padding: "8px 16px",
204
204
  height: 48,
205
205
  transition: "background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"
206
206
  }, _defineProperty(_obj1, theme.mq.supportsHover, {
package/dist-es/text.js CHANGED
@@ -88,7 +88,7 @@ var useStyles = createUseStyles(function(theme) {
88
88
  "@supports not (overflow-wrap: anywhere)": {
89
89
  wordBreak: function(param) {
90
90
  var wordBreak = param.wordBreak;
91
- return wordBreak ? "break-all" : "normal";
91
+ return wordBreak ? "break-all" : "inherit";
92
92
  }
93
93
  },
94
94
  // Needed to reset the default browser margin that adds to p, h1, h2... elements.
@@ -116,7 +116,7 @@ var useStyles = createUseStyles(function(theme) {
116
116
  return truncate === 1 || truncate === true ? "break-all" : "normal";
117
117
  }
118
118
  },
119
- display: "box",
119
+ display: "-webkit-box",
120
120
  boxOrient: "vertical",
121
121
  overflow: "hidden"
122
122
  }
@@ -12,6 +12,10 @@ export var createMediaQueries = function(param) {
12
12
  // Also enabled for (pointer: none) for acceptance tests, where (pointer: fine) doesn't match.
13
13
  // WARNING: you may be tempted to use @media (hover: hover) instead, but that doesn't work as expected in some android browsers.
14
14
  // See: https://hover-pointer-media-query.glitch.me/ and https://github.com/mui-org/material-ui/issues/15736
15
- supportsHover: "@media (pointer: fine), (pointer: none)"
15
+ supportsHover: "@media (pointer: fine), (pointer: none)",
16
+ /**
17
+ * Scopes the styles to touchable devices.
18
+ * See: https://stackoverflow.com/questions/12469875/how-to-code-css-media-queries-targeting-all-mobile-devices-and-tablets/42835826#42835826
19
+ */ touchableOnly: "@media (pointer: coarse), @media (hover: none)"
16
20
  };
17
21
  };
@@ -82,6 +82,14 @@ export var isIos = function(platformOverrides) {
82
82
  }
83
83
  return false;
84
84
  };
85
+ /**
86
+ * Returns true if the browser is a safari browser:
87
+ * webview, mobile, desktop or a browser like Chrome for iOS which is just a safari with a skin
88
+ *
89
+ * Note that this function checks the navigator vendor. It doesn't use platformOverrides or userAgent.
90
+ */ export var isSafari = function() {
91
+ return navigator.vendor.includes("Apple");
92
+ };
85
93
  export var isFirefox = function(platformOverrides) {
86
94
  return !!getUserAgent(platformOverrides).match(/Firefox\/([0-9]+)\./);
87
95
  };
package/dist-es/video.js CHANGED
@@ -60,6 +60,7 @@ import { createUseStyles } from "./jss";
60
60
  import { useSupportsAspectRatio } from "./utils/aspect-ratio-support";
61
61
  import { combineRefs } from "./utils/common";
62
62
  import { getPrefixedDataAttributes } from "./utils/dom";
63
+ import { isSafari } from "./utils/platform";
63
64
  export var RATIO = {
64
65
  "1:1": 1,
65
66
  "16:9": 16 / 9,
@@ -69,6 +70,7 @@ export var RATIO = {
69
70
  var useStyles = createUseStyles(function() {
70
71
  return {
71
72
  video: {
73
+ background: "transparent",
72
74
  display: "block",
73
75
  objectFit: "cover",
74
76
  maxWidth: "100%",
@@ -170,7 +172,11 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
170
172
  } else {
171
173
  width = props.width || "100%";
172
174
  }
173
- var needsWrapper = withCssAspectRatio && !supportsAspectRatio;
175
+ /**
176
+ * In safari, when using a video with poster, the transition from pause to play does a flicker,
177
+ * To avoid this, in Safari browsers, instead of using the poster attribute, we use a
178
+ * wrapper with the poster as background image
179
+ */ var needsWrapper = isSafari() || withCssAspectRatio && !supportsAspectRatio;
174
180
  var video1 = /*#__PURE__*/ _jsx("video", _objectSpread({
175
181
  ref: combineRefs(ref, videoRef),
176
182
  playsInline: true,
@@ -179,14 +185,14 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
179
185
  autoPlay: autoPlay,
180
186
  muted: muted,
181
187
  loop: loop
182
- }, !needsWrapper ? {
188
+ }, needsWrapper ? {} : {
183
189
  width: width,
184
190
  height: height
185
- } : {}, {
191
+ }, {
186
192
  className: classes.video,
187
193
  preload: preload,
188
194
  // This transparent pixel fallback avoids showing the ugly "play" image in android webviews
189
- poster: poster || TRANSPARENT_PIXEL
195
+ poster: needsWrapper ? TRANSPARENT_PIXEL : poster || TRANSPARENT_PIXEL
190
196
  }, getPrefixedDataAttributes(dataAttributes), {
191
197
  children: sources.map(function(param, index) {
192
198
  var src = param.src, type = param.type;
@@ -200,7 +206,10 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
200
206
  return /*#__PURE__*/ _jsx("div", {
201
207
  style: {
202
208
  width: width,
203
- height: height
209
+ height: height,
210
+ backgroundImage: poster ? 'url("'.concat(poster, '")') : undefined,
211
+ backgroundSize: "cover",
212
+ backgroundPosition: "50% 50%"
204
213
  },
205
214
  className: classes.wrapper,
206
215
  children: video1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telefonica/mistica",
3
- "version": "11.10.1",
3
+ "version": "11.11.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -123,7 +123,7 @@
123
123
  },
124
124
  "dependencies": {
125
125
  "@juggle/resize-observer": "^3.3.1",
126
- "@tef-novum/webview-bridge": "^3.7.0",
126
+ "@tef-novum/webview-bridge": "^3.8.0",
127
127
  "@telefonica/libphonenumber": "^2.8.1",
128
128
  "classnames": "^2.3.1",
129
129
  "jss": "^10.9.0",