@telefonica/mistica 11.5.0 → 11.7.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/dist/button.d.ts CHANGED
@@ -59,6 +59,7 @@ export interface SubmitButtonProps extends CommonProps {
59
59
  export declare type ButtonProps = FakeButtonProps | SubmitButtonProps | ToButtonProps | OnPressButtonProps | HrefButtonProps;
60
60
  interface ButtonLinkCommonProps {
61
61
  children: React.ReactNode;
62
+ disabled?: boolean;
62
63
  trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
63
64
  trackEvent?: boolean;
64
65
  /** "data-" prefix is automatically added. For example, use "testid" instead of "data-testid" */
package/dist/button.js CHANGED
@@ -472,7 +472,8 @@ var useButtonLinkStyles = (0, _jss).createUseStyles(function(theme) {
472
472
  "@media (pointer: coarse)": {
473
473
  backgroundColor: "initial"
474
474
  }
475
- }
475
+ },
476
+ "&[disabled]": disabledStyle
476
477
  },
477
478
  inverse: {
478
479
  color: theme.colors.textLinkInverse,
@@ -492,6 +493,7 @@ var useButtonLinkStyles = (0, _jss).createUseStyles(function(theme) {
492
493
  };
493
494
  });
494
495
  var ButtonLink = /*#__PURE__*/ React.forwardRef(function(props, ref) {
496
+ var formStatus = (0, _formContext).useForm().formStatus;
495
497
  var classes = useButtonLinkStyles();
496
498
  var isInverse = (0, _themeVariantContext).useIsInverseVariant();
497
499
  var _trackingEvent;
@@ -509,7 +511,8 @@ var ButtonLink = /*#__PURE__*/ React.forwardRef(function(props, ref) {
509
511
  truncate: 1,
510
512
  color: "inherit",
511
513
  children: props.children
512
- })
514
+ }),
515
+ disabled: props.disabled || formStatus === "sending"
513
516
  };
514
517
  if (process.env.NODE_ENV !== "production") {
515
518
  if (props.to === "" || props.href === "") {
@@ -59,6 +59,7 @@ export type ButtonProps =
59
59
  | HrefButtonProps;
60
60
  declare type ButtonLinkCommonProps = {
61
61
  children: React.Node,
62
+ disabled?: boolean,
62
63
  trackingEvent?: TrackingEvent | $ReadOnlyArray<TrackingEvent>,
63
64
  trackEvent?: boolean,
64
65
 
package/dist/carousel.js CHANGED
@@ -224,6 +224,9 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
224
224
  var _obj, _obj1, _obj2;
225
225
  return {
226
226
  carouselContainer: {
227
+ // This value is a workaround to solve an issue when the page is rendered in a hidden webview
228
+ // in that case the window size is reported as 0 and the scroll snap is placed at the wrong slide
229
+ minWidth: 64,
227
230
  position: "relative"
228
231
  },
229
232
  arrowButton: _objectSpread({}, arrowButtonStyle(theme), {
package/dist/feedback.js CHANGED
@@ -245,6 +245,14 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
245
245
  }
246
246
  };
247
247
  });
248
+ var BackgroundColor = function BackgroundColor() {
249
+ var colors = (0, _hooks).useTheme().colors;
250
+ var isInverse = (0, _themeVariantContext).useIsInverseVariant();
251
+ var css = "body {background:".concat(isInverse ? colors.backgroundBrand : colors.background, "}");
252
+ return /*#__PURE__*/ (0, _jsxRuntime).jsx("style", {
253
+ children: css
254
+ });
255
+ };
248
256
  var requestVibration = function requestVibration(type) {
249
257
  if ((0, _webviewBridge).isWebViewBridgeAvailable()) {
250
258
  (0, _webviewBridge).requestVibration(type).catch(function() {});
@@ -354,7 +362,7 @@ var FeedbackScreen = function FeedbackScreen(param) {
354
362
  var title = param.title, description = param.description, children = param.children, primaryButton = param.primaryButton, secondaryButton = param.secondaryButton, link = param.link, hapticFeedback = param.hapticFeedback, icon = param.icon, _animateText = param.animateText, animateText = _animateText === void 0 ? false : _animateText, unstable_inlineInDesktop = param.unstable_inlineInDesktop, imageUrl = param.imageUrl, imageFit = param.imageFit, dataAttributes = param.dataAttributes;
355
363
  useHapticFeedback(hapticFeedback);
356
364
  var isInverse = (0, _themeVariantContext).useIsInverseVariant();
357
- var ref = (0, _hooks).useTheme(), colors = ref.colors, platformOverrides = ref.platformOverrides, isDarkMode = ref.isDarkMode;
365
+ var ref = (0, _hooks).useTheme(), colors = ref.colors, platformOverrides = ref.platformOverrides, isDarkMode = ref.isDarkMode, skinName = ref.skinName;
358
366
  var windowHeight = (0, _hooks).useWindowHeight();
359
367
  var isTabletOrSmaller = (0, _hooks).useScreenSize().isTabletOrSmaller;
360
368
  var ref1 = _slicedToArray(React.useState(typeof self !== "undefined"), 2), isServerSide = ref1[0], setIsServerSide = ref1[1];
@@ -423,9 +431,10 @@ var FeedbackScreen = function FeedbackScreen(param) {
423
431
  children: feedbackContent
424
432
  })
425
433
  }),
426
- /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
434
+ skinName === _constants.O2_CLASSIC_SKIN && /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
427
435
  className: classes.backgroundDiv
428
- })
436
+ }),
437
+ skinName !== _constants.O2_CLASSIC_SKIN && /*#__PURE__*/ (0, _jsxRuntime).jsx(BackgroundColor, {})
429
438
  ]
430
439
  }) : /*#__PURE__*/ (0, _jsxRuntime).jsx(_responsiveLayout.default, {
431
440
  children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_box.default, {
package/dist/image.d.ts CHANGED
@@ -14,7 +14,7 @@ export declare type ImageProps = {
14
14
  /** defaults to 100% when no width and no height are given */
15
15
  width?: string | number;
16
16
  height?: string | number;
17
- /** defaults to 1:1, if both width and height are given, aspectRatio is ignored */
17
+ /** defaults to 1:1, if both width and height are given, aspectRatio is ignored. To use original image proportions, set aspectRatio to 0 */
18
18
  aspectRatio?: AspectRatio | number;
19
19
  /** defaults to empty string */
20
20
  alt?: string;
package/dist/image.js CHANGED
@@ -108,17 +108,18 @@ var useStyles = (0, _jss).createUseStyles(function() {
108
108
  objectFit: "cover",
109
109
  maxWidth: "100%",
110
110
  maxHeight: "100%",
111
+ borderRadius: function borderRadius(param) {
112
+ var noBorderRadius = param.noBorderRadius;
113
+ return noBorderRadius ? 0 : 4;
114
+ },
111
115
  "@supports (aspect-ratio: 1 / 1)": {
112
- borderRadius: function borderRadius(param) {
113
- var noBorderRadius = param.noBorderRadius;
114
- return noBorderRadius ? 0 : 4;
115
- },
116
116
  aspectRatio: function aspectRatio(param) {
117
117
  var aspectRatio1 = param.aspectRatio;
118
118
  return aspectRatio1 !== null && aspectRatio1 !== void 0 ? aspectRatio1 : "unset";
119
119
  }
120
120
  },
121
121
  "$wrapper &": {
122
+ borderRadius: 0,
122
123
  position: "absolute",
123
124
  width: "100%",
124
125
  height: "100%",
@@ -166,9 +167,10 @@ var Image = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
166
167
  var supportsAspectRatio = (0, _aspectRatioSupport).useSupportsAspectRatio();
167
168
  var noBorderRadiusContext = useDisableBorderRadius();
168
169
  var noBorderSetting = noBorderRadius !== null && noBorderRadius !== void 0 ? noBorderRadius : noBorderRadiusContext;
169
- // if width or height are numeric, we can calculate the other with the ratio without css
170
- var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number";
171
170
  var ratio = typeof aspectRatio === "number" ? aspectRatio : RATIO[aspectRatio];
171
+ // if width or height are numeric, we can calculate the other with the ratio without css.
172
+ // if aspect ratio is 0, we use the original image proportions
173
+ var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number" && ratio !== 0;
172
174
  var classes = useStyles({
173
175
  noBorderRadius: noBorderSetting,
174
176
  aspectRatio: withCssAspectRatio ? ratio : undefined,
@@ -19,7 +19,7 @@ export type ImageProps = {
19
19
  width?: string | number,
20
20
  height?: string | number,
21
21
  /**
22
- * defaults to 1:1, if both width and height are given, aspectRatio is ignored
22
+ * defaults to 1:1, if both width and height are given, aspectRatio is ignored. To use original image proportions, set aspectRatio to 0
23
23
  */
24
24
  aspectRatio?: AspectRatio | number,
25
25
  /**
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  exports.PACKAGE_VERSION = void 0;
6
- var PACKAGE_VERSION = "11.5.0";
6
+ var PACKAGE_VERSION = "11.7.0";
7
7
  exports.PACKAGE_VERSION = PACKAGE_VERSION;
@@ -58,7 +58,9 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
58
58
  width: "100%"
59
59
  },
60
60
  layout: (_obj = {
61
- margin: "auto"
61
+ margin: "auto",
62
+ paddingLeft: "env(safe-area-inset-left)",
63
+ paddingRight: "env(safe-area-inset-right)"
62
64
  }, _defineProperty(_obj, theme.mq.largeDesktop, {
63
65
  width: LARGE_DESKTOP_MAX_WIDTH
64
66
  }), _defineProperty(_obj, theme.mq.desktop, {
package/dist/video.d.ts CHANGED
@@ -15,7 +15,7 @@ export declare type VideoProps = {
15
15
  /** defaults to 100% when no width and no height are given */
16
16
  width?: string | number;
17
17
  height?: string | number;
18
- /** defaults to 1:1, if both width and height are given, aspectRatio is ignored */
18
+ /** defaults to 1:1, if both width and height are given, aspectRatio is ignored. To use original video proportions, set aspectRatio to 0 */
19
19
  aspectRatio?: AspectRatio | number;
20
20
  /** accepts multiple sources */
21
21
  src: string | Array<string> | VideoSource | Array<VideoSource>;
package/dist/video.js CHANGED
@@ -101,17 +101,18 @@ var useStyles = (0, _jss).createUseStyles(function() {
101
101
  objectFit: "cover",
102
102
  maxWidth: "100%",
103
103
  maxHeight: "100%",
104
+ borderRadius: function borderRadius(param) {
105
+ var noBorderRadius = param.noBorderRadius;
106
+ return noBorderRadius ? 0 : 4;
107
+ },
104
108
  "@supports (aspect-ratio: 1 / 1)": {
105
- borderRadius: function borderRadius(param) {
106
- var noBorderRadius = param.noBorderRadius;
107
- return noBorderRadius ? 0 : 4;
108
- },
109
109
  aspectRatio: function aspectRatio(param) {
110
110
  var aspectRatio1 = param.aspectRatio;
111
111
  return aspectRatio1 !== null && aspectRatio1 !== void 0 ? aspectRatio1 : "unset";
112
112
  }
113
113
  },
114
114
  "$wrapper &": {
115
+ borderRadius: 0,
115
116
  position: "absolute",
116
117
  width: "100%",
117
118
  height: "100%",
@@ -155,9 +156,10 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
155
156
  ]);
156
157
  var supportsAspectRatio = (0, _aspectRatioSupport).useSupportsAspectRatio();
157
158
  var noBorderRadius = (0, _image).useDisableBorderRadius();
158
- // if width or height are numeric, we can calculate the other with the ratio without css
159
- var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number";
160
159
  var ratio = typeof aspectRatio === "number" ? aspectRatio : RATIO[aspectRatio];
160
+ // if width or height are numeric, we can calculate the other with the ratio without css
161
+ // if aspect ratio is 0, we use the original video proportions
162
+ var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number" && ratio !== 0;
161
163
  var classes = useStyles({
162
164
  noBorderRadius: noBorderRadius,
163
165
  aspectRatio: withCssAspectRatio ? ratio : undefined,
@@ -20,7 +20,7 @@ export type VideoProps = {
20
20
  width?: string | number,
21
21
  height?: string | number,
22
22
  /**
23
- * defaults to 1:1, if both width and height are given, aspectRatio is ignored
23
+ * defaults to 1:1, if both width and height are given, aspectRatio is ignored. To use original video proportions, set aspectRatio to 0
24
24
  */
25
25
  aspectRatio?: AspectRatio | number,
26
26
  /**
package/dist-es/button.js CHANGED
@@ -439,7 +439,8 @@ var useButtonLinkStyles = createUseStyles(function(theme) {
439
439
  "@media (pointer: coarse)": {
440
440
  backgroundColor: "initial"
441
441
  }
442
- }
442
+ },
443
+ "&[disabled]": disabledStyle
443
444
  },
444
445
  inverse: {
445
446
  color: theme.colors.textLinkInverse,
@@ -459,6 +460,7 @@ var useButtonLinkStyles = createUseStyles(function(theme) {
459
460
  };
460
461
  });
461
462
  export var ButtonLink = /*#__PURE__*/ React.forwardRef(function(props, ref) {
463
+ var formStatus = useForm().formStatus;
462
464
  var classes = useButtonLinkStyles();
463
465
  var isInverse = useIsInverseVariant();
464
466
  var _trackingEvent;
@@ -476,7 +478,8 @@ export var ButtonLink = /*#__PURE__*/ React.forwardRef(function(props, ref) {
476
478
  truncate: 1,
477
479
  color: "inherit",
478
480
  children: props.children
479
- })
481
+ }),
482
+ disabled: props.disabled || formStatus === "sending"
480
483
  };
481
484
  if (process.env.NODE_ENV !== "production") {
482
485
  if (props.to === "" || props.href === "") {
@@ -191,6 +191,9 @@ var useStyles = createUseStyles(function(theme) {
191
191
  var _obj, _obj1, _obj2;
192
192
  return {
193
193
  carouselContainer: {
194
+ // This value is a workaround to solve an issue when the page is rendered in a hidden webview
195
+ // in that case the window size is reported as 0 and the scroll snap is placed at the wrong slide
196
+ minWidth: 64,
194
197
  position: "relative"
195
198
  },
196
199
  arrowButton: _objectSpread({}, arrowButtonStyle(theme), {
@@ -106,7 +106,7 @@ import { useTheme, useScreenSize, useWindowHeight, useIsomorphicLayoutEffect } f
106
106
  import { ThemeVariant, useIsInverseVariant } from "./theme-variant-context";
107
107
  import ButtonFixedFooterLayout from "./button-fixed-footer-layout";
108
108
  import OverscrollColor from "./overscroll-color-context";
109
- import { VIVO_SKIN } from "./skins/constants";
109
+ import { O2_CLASSIC_SKIN, VIVO_SKIN } from "./skins/constants";
110
110
  import IcnSuccess from "./icons/icon-success";
111
111
  import IconSuccessVivo from "./icons/icon-success-vivo";
112
112
  import IcnError from "./icons/icon-error";
@@ -213,6 +213,14 @@ var useStyles = createUseStyles(function(theme) {
213
213
  }
214
214
  };
215
215
  });
216
+ var BackgroundColor = function() {
217
+ var colors = useTheme().colors;
218
+ var isInverse = useIsInverseVariant();
219
+ var css = "body {background:".concat(isInverse ? colors.backgroundBrand : colors.background, "}");
220
+ return /*#__PURE__*/ _jsx("style", {
221
+ children: css
222
+ });
223
+ };
216
224
  var requestVibration = function(type) {
217
225
  if (isWebViewBridgeAvailable()) {
218
226
  requestVibrationNative(type).catch(function() {});
@@ -322,7 +330,7 @@ export var FeedbackScreen = function(param) {
322
330
  var title = param.title, description = param.description, children = param.children, primaryButton = param.primaryButton, secondaryButton = param.secondaryButton, link = param.link, hapticFeedback = param.hapticFeedback, icon = param.icon, _animateText = param.animateText, animateText = _animateText === void 0 ? false : _animateText, unstable_inlineInDesktop = param.unstable_inlineInDesktop, imageUrl = param.imageUrl, imageFit = param.imageFit, dataAttributes = param.dataAttributes;
323
331
  useHapticFeedback(hapticFeedback);
324
332
  var isInverse = useIsInverseVariant();
325
- var ref = useTheme(), colors = ref.colors, platformOverrides = ref.platformOverrides, isDarkMode = ref.isDarkMode;
333
+ var ref = useTheme(), colors = ref.colors, platformOverrides = ref.platformOverrides, isDarkMode = ref.isDarkMode, skinName = ref.skinName;
326
334
  var windowHeight = useWindowHeight();
327
335
  var isTabletOrSmaller = useScreenSize().isTabletOrSmaller;
328
336
  var ref1 = _slicedToArray(React.useState(typeof self !== "undefined"), 2), isServerSide = ref1[0], setIsServerSide = ref1[1];
@@ -391,9 +399,10 @@ export var FeedbackScreen = function(param) {
391
399
  children: feedbackContent
392
400
  })
393
401
  }),
394
- /*#__PURE__*/ _jsx("div", {
402
+ skinName === O2_CLASSIC_SKIN && /*#__PURE__*/ _jsx("div", {
395
403
  className: classes.backgroundDiv
396
- })
404
+ }),
405
+ skinName !== O2_CLASSIC_SKIN && /*#__PURE__*/ _jsx(BackgroundColor, {})
397
406
  ]
398
407
  }) : /*#__PURE__*/ _jsx(ResponsiveLayout, {
399
408
  children: /*#__PURE__*/ _jsx(Box, {
package/dist-es/image.js CHANGED
@@ -79,17 +79,18 @@ var useStyles = createUseStyles(function() {
79
79
  objectFit: "cover",
80
80
  maxWidth: "100%",
81
81
  maxHeight: "100%",
82
+ borderRadius: function(param) {
83
+ var noBorderRadius = param.noBorderRadius;
84
+ return noBorderRadius ? 0 : 4;
85
+ },
82
86
  "@supports (aspect-ratio: 1 / 1)": {
83
- borderRadius: function(param) {
84
- var noBorderRadius = param.noBorderRadius;
85
- return noBorderRadius ? 0 : 4;
86
- },
87
87
  aspectRatio: function(param) {
88
88
  var aspectRatio = param.aspectRatio;
89
89
  return aspectRatio !== null && aspectRatio !== void 0 ? aspectRatio : "unset";
90
90
  }
91
91
  },
92
92
  "$wrapper &": {
93
+ borderRadius: 0,
93
94
  position: "absolute",
94
95
  width: "100%",
95
96
  height: "100%",
@@ -136,9 +137,10 @@ var Image = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
136
137
  var supportsAspectRatio = useSupportsAspectRatio();
137
138
  var noBorderRadiusContext = useDisableBorderRadius();
138
139
  var noBorderSetting = noBorderRadius !== null && noBorderRadius !== void 0 ? noBorderRadius : noBorderRadiusContext;
139
- // if width or height are numeric, we can calculate the other with the ratio without css
140
- var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number";
141
140
  var ratio = typeof aspectRatio === "number" ? aspectRatio : RATIO[aspectRatio];
141
+ // if width or height are numeric, we can calculate the other with the ratio without css.
142
+ // if aspect ratio is 0, we use the original image proportions
143
+ var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number" && ratio !== 0;
142
144
  var classes = useStyles({
143
145
  noBorderRadius: noBorderSetting,
144
146
  aspectRatio: withCssAspectRatio ? ratio : undefined,
@@ -1,2 +1,2 @@
1
1
  // DO NOT EDIT THIS FILE. It's autogenerated by set-version.js
2
- export var PACKAGE_VERSION = "11.5.0";
2
+ export var PACKAGE_VERSION = "11.7.0";
@@ -27,7 +27,9 @@ var useStyles = createUseStyles(function(theme) {
27
27
  width: "100%"
28
28
  },
29
29
  layout: (_obj = {
30
- margin: "auto"
30
+ margin: "auto",
31
+ paddingLeft: "env(safe-area-inset-left)",
32
+ paddingRight: "env(safe-area-inset-right)"
31
33
  }, _defineProperty(_obj, theme.mq.largeDesktop, {
32
34
  width: LARGE_DESKTOP_MAX_WIDTH
33
35
  }), _defineProperty(_obj, theme.mq.desktop, {
package/dist-es/video.js CHANGED
@@ -73,17 +73,18 @@ var useStyles = createUseStyles(function() {
73
73
  objectFit: "cover",
74
74
  maxWidth: "100%",
75
75
  maxHeight: "100%",
76
+ borderRadius: function(param) {
77
+ var noBorderRadius = param.noBorderRadius;
78
+ return noBorderRadius ? 0 : 4;
79
+ },
76
80
  "@supports (aspect-ratio: 1 / 1)": {
77
- borderRadius: function(param) {
78
- var noBorderRadius = param.noBorderRadius;
79
- return noBorderRadius ? 0 : 4;
80
- },
81
81
  aspectRatio: function(param) {
82
82
  var aspectRatio = param.aspectRatio;
83
83
  return aspectRatio !== null && aspectRatio !== void 0 ? aspectRatio : "unset";
84
84
  }
85
85
  },
86
86
  "$wrapper &": {
87
+ borderRadius: 0,
87
88
  position: "absolute",
88
89
  width: "100%",
89
90
  height: "100%",
@@ -127,9 +128,10 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
127
128
  ]);
128
129
  var supportsAspectRatio = useSupportsAspectRatio();
129
130
  var noBorderRadius = useDisableBorderRadius();
130
- // if width or height are numeric, we can calculate the other with the ratio without css
131
- var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number";
132
131
  var ratio = typeof aspectRatio === "number" ? aspectRatio : RATIO[aspectRatio];
132
+ // if width or height are numeric, we can calculate the other with the ratio without css
133
+ // if aspect ratio is 0, we use the original video proportions
134
+ var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number" && ratio !== 0;
133
135
  var classes = useStyles({
134
136
  noBorderRadius: noBorderRadius,
135
137
  aspectRatio: withCssAspectRatio ? ratio : undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telefonica/mistica",
3
- "version": "11.5.0",
3
+ "version": "11.7.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",