@telefonica/mistica 10.24.2 → 10.27.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 (50) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/button.d.ts +2 -0
  3. package/dist/button.js +20 -5
  4. package/dist/button.js.flow +2 -0
  5. package/dist/callout.js +37 -26
  6. package/dist/image.d.ts +3 -0
  7. package/dist/image.js +35 -4
  8. package/dist/image.js.flow +3 -0
  9. package/dist/package-version.js +1 -1
  10. package/dist/skins/blau.js +0 -2
  11. package/dist/skins/o2-classic.js +0 -4
  12. package/dist/skins/o2.js +0 -4
  13. package/dist/skins/telefonica.js +1 -5
  14. package/dist/skins/vivo.js +0 -4
  15. package/dist/tag.d.ts +2 -1
  16. package/dist/tag.js +33 -3
  17. package/dist/tag.js.flow +2 -1
  18. package/dist/text-link.d.ts +1 -0
  19. package/dist/text-link.js +8 -0
  20. package/dist/text-link.js.flow +1 -0
  21. package/dist/text.d.ts +2 -0
  22. package/dist/text.js +4 -3
  23. package/dist/text.js.flow +2 -0
  24. package/dist/utils/analytics.d.ts +6 -0
  25. package/dist/utils/analytics.js +13 -0
  26. package/dist/utils/analytics.js.flow +8 -0
  27. package/dist/utils/common.d.ts +1 -0
  28. package/dist/utils/common.js +11 -1
  29. package/dist/utils/common.js.flow +1 -0
  30. package/dist/utils/types.d.ts +1 -7
  31. package/dist/utils/types.js.flow +1 -7
  32. package/dist/video.d.ts +2 -0
  33. package/dist/video.js +37 -5
  34. package/dist/video.js.flow +2 -0
  35. package/dist-es/button.js +20 -5
  36. package/dist-es/callout.js +38 -27
  37. package/dist-es/image.js +34 -4
  38. package/dist-es/package-version.js +1 -1
  39. package/dist-es/skins/blau.js +0 -2
  40. package/dist-es/skins/o2-classic.js +0 -4
  41. package/dist-es/skins/o2.js +0 -4
  42. package/dist-es/skins/telefonica.js +1 -5
  43. package/dist-es/skins/vivo.js +0 -4
  44. package/dist-es/tag.js +32 -3
  45. package/dist-es/text-link.js +8 -0
  46. package/dist-es/text.js +4 -3
  47. package/dist-es/utils/analytics.js +6 -0
  48. package/dist-es/utils/common.js +9 -0
  49. package/dist-es/video.js +36 -5
  50. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ # [10.27.0](https://github.com/Telefonica/mistica-web/compare/v10.26.0...v10.27.0) (2022-02-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **playroom:** dark mode in Blau & Telefonica ios ([#423](https://github.com/Telefonica/mistica-web/issues/423)) ([a630625](https://github.com/Telefonica/mistica-web/commit/a630625379cdb486abd916ad05c0d3fd4974e5cd))
7
+ * **skins:** remove deprecated constants ([#418](https://github.com/Telefonica/mistica-web/issues/418)) ([822960f](https://github.com/Telefonica/mistica-web/commit/822960f2ecf629b4e5de0ac3224e2026332c0f14))
8
+ * **Telefonica skin:** change badge color ([#424](https://github.com/Telefonica/mistica-web/issues/424)) ([0976c24](https://github.com/Telefonica/mistica-web/commit/0976c246f295d4be61426d33ff93b65c9bae0598))
9
+
10
+
11
+ ### Features
12
+
13
+ * **Button:** default tracking events ([#425](https://github.com/Telefonica/mistica-web/issues/425)) ([5fc2576](https://github.com/Telefonica/mistica-web/commit/5fc25768f71cd8a0318b47266511694e6024e49e))
14
+ * **Image, Text, Video, Tag:** add dataAttributes prop ([#429](https://github.com/Telefonica/mistica-web/issues/429)) ([730a0db](https://github.com/Telefonica/mistica-web/commit/730a0dbb80abe9a47260b21e29fe1cbf2c9cc206))
15
+
16
+ # [10.26.0](https://github.com/Telefonica/mistica-web/compare/v10.25.0...v10.26.0) (2022-02-23)
17
+
18
+
19
+ ### Features
20
+
21
+ * **Callout:** Changed element distribution so link has more space ([#414](https://github.com/Telefonica/mistica-web/issues/414)) ([bf3c1cf](https://github.com/Telefonica/mistica-web/commit/bf3c1cfc30db7f5df498743b414599635582910e))
22
+
23
+ # [10.25.0](https://github.com/Telefonica/mistica-web/compare/v10.24.2...v10.25.0) (2022-02-23)
24
+
25
+
26
+ ### Features
27
+
28
+ * **webview-bridge:** upgrade webview-bridge dependency ([#420](https://github.com/Telefonica/mistica-web/issues/420)) ([0b01b6e](https://github.com/Telefonica/mistica-web/commit/0b01b6ed67bb0bcb10927ffb44812095abacc233))
29
+
1
30
  ## [10.24.2](https://github.com/Telefonica/mistica-web/compare/v10.24.1...v10.24.2) (2022-02-22)
2
31
 
3
32
 
package/dist/button.d.ts CHANGED
@@ -11,6 +11,7 @@ interface CommonProps {
11
11
  loadingText?: string;
12
12
  disabled?: boolean;
13
13
  trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
14
+ trackEvent?: boolean;
14
15
  /** "data-" prefix is automatically added. For example, use "testid" instead of "data-testid" */
15
16
  dataAttributes?: DataAttributes;
16
17
  'aria-controls'?: string;
@@ -58,6 +59,7 @@ export declare type ButtonProps = FakeButtonProps | SubmitButtonProps | ToButton
58
59
  interface ButtonLinkCommonProps {
59
60
  children: React.ReactNode;
60
61
  trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
62
+ trackEvent?: boolean;
61
63
  /** "data-" prefix is automatically added. For example, use "testid" instead of "data-testid" */
62
64
  dataAttributes?: DataAttributes;
63
65
  aligned?: boolean;
package/dist/button.js CHANGED
@@ -14,6 +14,8 @@ var _formContext = require("./form-context");
14
14
  var _css = require("./utils/css");
15
15
  var _text = require("./text");
16
16
  var _box = _interopRequireDefault(require("./box"));
17
+ var _common = require("./utils/common");
18
+ var _analytics = require("./utils/analytics");
17
19
  function _interopRequireDefault(obj) {
18
20
  return obj && obj.__esModule ? obj : {
19
21
  default: obj
@@ -341,13 +343,18 @@ var Button = function Button(props) {
341
343
  children: text
342
344
  });
343
345
  };
346
+ var _trackingEvent;
344
347
  var _obj;
345
348
  var commonProps = {
346
349
  className: (0, _classnames).default(classes.button, props.className, (_obj = {}, _defineProperty(_obj, classes.small, props.small), _defineProperty(_obj, classes.inverse, isInverse), _defineProperty(_obj, classes.light, !isInverse), _defineProperty(_obj, classes.isLoading, showSpinner), _obj)),
347
350
  style: _objectSpread({
348
351
  cursor: props.fake ? 'pointer' : undefined
349
352
  }, props.style),
350
- trackingEvent: props.trackingEvent,
353
+ trackingEvent: (_trackingEvent = props.trackingEvent) !== null && _trackingEvent !== void 0 ? _trackingEvent : props.trackEvent ? {
354
+ category: _analytics.eventCategories.userInteraction,
355
+ action: "".concat(props.type, "_button_tapped"),
356
+ label: (0, _common).getTextFromChildren(props.children)
357
+ } : undefined,
351
358
  dataAttributes: props.dataAttributes,
352
359
  'aria-controls': props['aria-controls'],
353
360
  'aria-expanded': props['aria-expanded'],
@@ -486,10 +493,15 @@ var useButtonLinkStyles = (0, _jss).createUseStyles(function(theme) {
486
493
  var ButtonLink = /*#__PURE__*/ React.forwardRef(function(props, ref) {
487
494
  var classes = useButtonLinkStyles();
488
495
  var isInverse = (0, _themeVariantContext).useIsInverseVariant();
496
+ var _trackingEvent;
489
497
  var _obj;
490
498
  var commonProps = {
491
499
  className: (0, _classnames).default(classes.link, (_obj = {}, _defineProperty(_obj, classes.inverse, isInverse), _defineProperty(_obj, classes.aligned, props.aligned), _obj)),
492
- trackingEvent: props.trackingEvent,
500
+ trackingEvent: (_trackingEvent = props.trackingEvent) !== null && _trackingEvent !== void 0 ? _trackingEvent : props.trackEvent ? {
501
+ category: _analytics.eventCategories.userInteraction,
502
+ action: _analytics.eventActions.linkTapped,
503
+ label: (0, _common).getTextFromChildren(props.children)
504
+ } : undefined,
493
505
  dataAttributes: props.dataAttributes,
494
506
  children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text2, {
495
507
  medium: true,
@@ -536,21 +548,24 @@ exports.ButtonLink = ButtonLink;
536
548
  var ButtonPrimary = function ButtonPrimary(props) {
537
549
  var classes = usePrimaryButtonStyles();
538
550
  return(/*#__PURE__*/ (0, _jsxRuntime).jsx(Button, _objectSpread({}, props, {
539
- classes: classes
551
+ classes: classes,
552
+ type: "primary"
540
553
  })));
541
554
  };
542
555
  exports.ButtonPrimary = ButtonPrimary;
543
556
  var ButtonSecondary = function ButtonSecondary(props) {
544
557
  var classes = useSecondaryButtonStyles();
545
558
  return(/*#__PURE__*/ (0, _jsxRuntime).jsx(Button, _objectSpread({}, props, {
546
- classes: classes
559
+ classes: classes,
560
+ type: "secondary"
547
561
  })));
548
562
  };
549
563
  exports.ButtonSecondary = ButtonSecondary;
550
564
  var ButtonDanger = function ButtonDanger(props) {
551
565
  var classes = useDangerButtonStyles();
552
566
  return(/*#__PURE__*/ (0, _jsxRuntime).jsx(Button, _objectSpread({}, props, {
553
- classes: classes
567
+ classes: classes,
568
+ type: "danger"
554
569
  })));
555
570
  };
556
571
  exports.ButtonDanger = ButtonDanger;
@@ -18,6 +18,7 @@ declare type CommonProps = {
18
18
  loadingText?: string,
19
19
  disabled?: boolean,
20
20
  trackingEvent?: TrackingEvent | $ReadOnlyArray<TrackingEvent>,
21
+ trackEvent?: boolean,
21
22
 
22
23
  /**
23
24
  * "data-" prefix is automatically added. For example, use "testid" instead of "data-testid"
@@ -58,6 +59,7 @@ export type ButtonProps =
58
59
  declare type ButtonLinkCommonProps = {
59
60
  children: React.Node,
60
61
  trackingEvent?: TrackingEvent | $ReadOnlyArray<TrackingEvent>,
62
+ trackEvent?: boolean,
61
63
 
62
64
  /**
63
65
  * "data-" prefix is automatically added. For example, use "testid" instead of "data-testid"
package/dist/callout.js CHANGED
@@ -6,6 +6,8 @@ exports.default = void 0;
6
6
  var _jsxRuntime = require("react/jsx-runtime");
7
7
  var React = _interopRequireWildcard(require("react"));
8
8
  var _stack = _interopRequireDefault(require("./stack"));
9
+ var _inline = _interopRequireDefault(require("./inline"));
10
+ var _box = _interopRequireDefault(require("./box"));
9
11
  var _hooks = require("./hooks");
10
12
  var _themeVariantContext = require("./theme-variant-context");
11
13
  var _jss = require("./jss");
@@ -94,8 +96,8 @@ var Callout = function Callout(param) {
94
96
  children: /*#__PURE__*/ (0, _jsxRuntime).jsxs(_themeVariantContext.ThemeVariant, {
95
97
  isInverse: false,
96
98
  children: [
97
- icon && /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
98
- className: classes.icon,
99
+ icon && /*#__PURE__*/ (0, _jsxRuntime).jsx(_box.default, {
100
+ paddingRight: 16,
99
101
  children: icon
100
102
  }),
101
103
  /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
@@ -103,18 +105,41 @@ var Callout = function Callout(param) {
103
105
  children: /*#__PURE__*/ (0, _jsxRuntime).jsxs(_stack.default, {
104
106
  space: 16,
105
107
  children: [
106
- /*#__PURE__*/ (0, _jsxRuntime).jsxs(_jsxRuntime.Fragment, {
108
+ /*#__PURE__*/ (0, _jsxRuntime).jsxs(_inline.default, {
109
+ fullWidth: true,
110
+ alignItems: "flex-start",
111
+ space: "between",
107
112
  children: [
108
- /*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text3, {
109
- as: "h2",
110
- regular: true,
111
- children: title
113
+ /*#__PURE__*/ (0, _jsxRuntime).jsxs(_stack.default, {
114
+ space: 4,
115
+ children: [
116
+ /*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text3, {
117
+ as: "h2",
118
+ regular: true,
119
+ children: title
120
+ }),
121
+ /*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text2, {
122
+ as: "p",
123
+ regular: true,
124
+ color: colors.textSecondary,
125
+ children: description
126
+ })
127
+ ]
112
128
  }),
113
- /*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text2, {
114
- as: "p",
115
- regular: true,
116
- color: colors.textSecondary,
117
- children: description
129
+ onClose && /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconButton.default, {
130
+ size: 40,
131
+ style: {
132
+ display: 'flex',
133
+ margin: '-8px -12px',
134
+ alignItems: 'center',
135
+ justifyContent: 'center'
136
+ },
137
+ onPress: onClose,
138
+ "aria-label": texts.closeButtonLabel,
139
+ children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconCloseRegular.default, {
140
+ size: 24,
141
+ color: colors.neutralHigh
142
+ })
118
143
  })
119
144
  ]
120
145
  }),
@@ -125,20 +150,6 @@ var Callout = function Callout(param) {
125
150
  })
126
151
  ]
127
152
  })
128
- }),
129
- onClose && /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconButton.default, {
130
- size: 40,
131
- style: {
132
- display: 'flex',
133
- margin: '-8px -12px -8px 0',
134
- alignItems: 'center',
135
- justifyContent: 'center'
136
- },
137
- onPress: onClose,
138
- "aria-label": texts.closeButtonLabel,
139
- children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconCloseRegular.default, {
140
- color: colors.neutralHigh
141
- })
142
153
  })
143
154
  ]
144
155
  })
package/dist/image.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import type { DataAttributes } from './utils/types';
2
3
  export declare const useDisableBorderRadius: () => boolean;
3
4
  export declare const DisableBorderRadiusProvider: React.FC;
4
5
  export declare type AspectRatio = '1:1' | '16:9' | '7:10' | '4:3';
@@ -19,6 +20,7 @@ export declare type ImageProps = {
19
20
  /** defaults to empty string */
20
21
  alt?: string;
21
22
  children?: void;
23
+ dataAttributes?: DataAttributes;
22
24
  };
23
25
  /** @deprecated */
24
26
  declare type DeprecatedImageProps = {
@@ -31,6 +33,7 @@ declare type DeprecatedImageProps = {
31
33
  /** defaults to empty string */
32
34
  alt?: string;
33
35
  children?: void;
36
+ dataAttributes?: DataAttributes;
34
37
  };
35
38
  declare const Image: React.ForwardRefExoticComponent<(ImageProps | DeprecatedImageProps) & React.RefAttributes<HTMLImageElement>>;
36
39
  export default Image;
package/dist/image.js CHANGED
@@ -6,6 +6,7 @@ exports.default = exports.RATIO = exports.DisableBorderRadiusProvider = exports.
6
6
  var _jsxRuntime = require("react/jsx-runtime");
7
7
  var React = _interopRequireWildcard(require("react"));
8
8
  var _jss = require("./jss");
9
+ var _dom = require("./utils/dom");
9
10
  function _interopRequireWildcard(obj) {
10
11
  if (obj && obj.__esModule) {
11
12
  return obj;
@@ -27,6 +28,35 @@ function _interopRequireWildcard(obj) {
27
28
  return newObj;
28
29
  }
29
30
  }
31
+ function _defineProperty(obj, key, value) {
32
+ if (key in obj) {
33
+ Object.defineProperty(obj, key, {
34
+ value: value,
35
+ enumerable: true,
36
+ configurable: true,
37
+ writable: true
38
+ });
39
+ } else {
40
+ obj[key] = value;
41
+ }
42
+ return obj;
43
+ }
44
+ function _objectSpread(target) {
45
+ var _arguments = arguments, _loop = function(i) {
46
+ var source = _arguments[i] != null ? _arguments[i] : {};
47
+ var ownKeys = Object.keys(source);
48
+ if (typeof Object.getOwnPropertySymbols === "function") {
49
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
50
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
51
+ }));
52
+ }
53
+ ownKeys.forEach(function(key) {
54
+ _defineProperty(target, key, source[key]);
55
+ });
56
+ };
57
+ for(var i = 1; i < arguments.length; i++)_loop(i);
58
+ return target;
59
+ }
30
60
  function _objectWithoutProperties(source, excluded) {
31
61
  if (source == null) return {};
32
62
  var target = _objectWithoutPropertiesLoose(source, excluded);
@@ -96,9 +126,10 @@ var RATIO = {
96
126
  };
97
127
  exports.RATIO = RATIO;
98
128
  var Image = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
99
- var _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? '1:1' : _aspectRatio, _alt = _param.alt, alt = _alt === void 0 ? '' : _alt, props = _objectWithoutProperties(_param, [
129
+ var _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? '1:1' : _aspectRatio, _alt = _param.alt, alt = _alt === void 0 ? '' : _alt, dataAttributes = _param.dataAttributes, props = _objectWithoutProperties(_param, [
100
130
  "aspectRatio",
101
- "alt"
131
+ "alt",
132
+ "dataAttributes"
102
133
  ]);
103
134
  var noBorderRadius = useDisableBorderRadius();
104
135
  var classes = useStyles({
@@ -118,14 +149,14 @@ var Image = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
118
149
  } else {
119
150
  width = '100%';
120
151
  }
121
- return(/*#__PURE__*/ (0, _jsxRuntime).jsx("img", {
152
+ return(/*#__PURE__*/ (0, _jsxRuntime).jsx("img", _objectSpread({}, (0, _dom).getPrefixedDataAttributes(dataAttributes), {
122
153
  ref: ref,
123
154
  src: url,
124
155
  className: classes.image,
125
156
  alt: alt,
126
157
  width: width,
127
158
  height: height
128
- }));
159
+ })));
129
160
  });
130
161
  var _default = Image;
131
162
  exports.default = _default;
@@ -1,6 +1,7 @@
1
1
  // @flow
2
2
 
3
3
  import * as React from "react";
4
+ import type { DataAttributes } from "./utils/types";
4
5
  declare export var useDisableBorderRadius: () => boolean;
5
6
  declare export var DisableBorderRadiusProvider: React.ComponentType<{}>;
6
7
  export type AspectRatio = "1:1" | "16:9" | "7:10" | "4:3";
@@ -25,6 +26,7 @@ export type ImageProps = {
25
26
  * defaults to empty string
26
27
  */
27
28
  alt?: string,
29
+ dataAttributes?: DataAttributes,
28
30
  };
29
31
  /**
30
32
  * @deprecated
@@ -41,6 +43,7 @@ declare type DeprecatedImageProps = {
41
43
  * defaults to empty string
42
44
  */
43
45
  alt?: string,
46
+ dataAttributes?: DataAttributes,
44
47
  };
45
48
  declare var Image: React.ComponentType<{
46
49
  ...ImageProps | DeprecatedImageProps,
@@ -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 = '10.24.2';
6
+ var PACKAGE_VERSION = '10.27.0';
7
7
  exports.PACKAGE_VERSION = PACKAGE_VERSION;
@@ -98,8 +98,6 @@ var getBlauSkin = function getBlauSkin() {
98
98
  controlError: palette.blauRed,
99
99
  loadingBar: palette.blauBlueSecondary,
100
100
  loadingBarBackground: palette.blauBlueSecondary10,
101
- loadingBarInverse: palette.blauBlueSecondary,
102
- loadingBarBackgroundInverse: palette.blauBlueSecondary10,
103
101
  toggleAndroidInactive: palette.grey2,
104
102
  toggleAndroidBackgroundActive: palette.blauBlueSecondary10,
105
103
  iosControlKnob: palette.white,
@@ -111,8 +111,6 @@ var getO2ClassicSkin = function getO2ClassicSkin() {
111
111
  controlError: palette.pepper,
112
112
  loadingBar: palette.o2Gem,
113
113
  loadingBarBackground: palette.o2GemLight30,
114
- loadingBarBackgroundInverse: palette.o2GemLight30,
115
- loadingBarInverse: palette.o2Gem,
116
114
  toggleAndroidInactive: palette.grey2,
117
115
  toggleAndroidBackgroundActive: palette.o2GemLight30,
118
116
  iosControlKnob: palette.white,
@@ -199,8 +197,6 @@ var getO2ClassicSkin = function getO2ClassicSkin() {
199
197
  controlActivated: palette.o2Gem,
200
198
  loadingBar: palette.o2Gem,
201
199
  loadingBarBackground: palette.darkModeGrey6,
202
- loadingBarBackgroundInverse: palette.darkModeGrey,
203
- loadingBarInverse: palette.o2SkyBlue,
204
200
  toggleAndroidInactive: palette.grey4,
205
201
  toggleAndroidBackgroundActive: palette.o2GemLight30,
206
202
  iosControlKnob: palette.grey2,
package/dist/skins/o2.js CHANGED
@@ -101,8 +101,6 @@ var getO2Skin = function getO2Skin() {
101
101
  controlError: palette.pepper,
102
102
  loadingBar: palette.o2BluePrimary,
103
103
  loadingBarBackground: palette.grey1,
104
- loadingBarBackgroundInverse: palette.grey1,
105
- loadingBarInverse: palette.o2BluePrimary,
106
104
  toggleAndroidInactive: palette.grey2,
107
105
  toggleAndroidBackgroundActive: palette.o2BluePrimary15,
108
106
  iosControlKnob: palette.white,
@@ -193,8 +191,6 @@ var getO2Skin = function getO2Skin() {
193
191
  controlActivated: palette.o2BluePrimary30,
194
192
  loadingBar: palette.darkModeO2BluePrimary,
195
193
  loadingBarBackground: palette.darkModeGrey6,
196
- loadingBarBackgroundInverse: palette.grey1,
197
- loadingBarInverse: palette.darkModeO2BluePrimary,
198
194
  toggleAndroidInactive: palette.grey4,
199
195
  toggleAndroidBackgroundActive: palette.o2BlueLight30,
200
196
  iosControlKnob: palette.grey2,
@@ -96,8 +96,6 @@ var getTelefonicaSkin = function getTelefonicaSkin() {
96
96
  controlError: palette.coral,
97
97
  loadingBar: palette.telefonicaBlue30,
98
98
  loadingBarBackground: palette.telefonicaBlue70,
99
- loadingBarBackgroundInverse: palette.telefonicaBlue70,
100
- loadingBarInverse: palette.telefonicaBlue30,
101
99
  toggleAndroidInactive: palette.grey2,
102
100
  toggleAndroidBackgroundActive: palette.grey2,
103
101
  iosControlKnob: palette.white,
@@ -106,7 +104,7 @@ var getTelefonicaSkin = function getTelefonicaSkin() {
106
104
  dividerInverse: (0, _color).applyAlpha(palette.white, 0.2),
107
105
  navigationBarDivider: palette.telefonicaBlue,
108
106
  // FEEDBACKS
109
- badge: palette.coral80,
107
+ badge: palette.coral70,
110
108
  feedbackErrorBackground: palette.coral,
111
109
  feedbackInfoBackground: palette.grey9,
112
110
  // GLOBAL
@@ -186,8 +184,6 @@ var getTelefonicaSkin = function getTelefonicaSkin() {
186
184
  controlActivated: palette.telefonicaBlue,
187
185
  loadingBar: palette.telefonicaBlue,
188
186
  loadingBarBackground: (0, _color).applyAlpha(palette.white, 0.05),
189
- loadingBarBackgroundInverse: palette.telefonicaBlue70,
190
- loadingBarInverse: palette.telefonicaBlue30,
191
187
  toggleAndroidInactive: palette.grey4,
192
188
  toggleAndroidBackgroundActive: palette.grey1,
193
189
  iosControlKnob: palette.grey2,
@@ -95,8 +95,6 @@ var getVivoSkin = function getVivoSkin() {
95
95
  controlError: palette.pepper,
96
96
  loadingBar: palette.pink,
97
97
  loadingBarBackground: palette.pepperLight30,
98
- loadingBarBackgroundInverse: palette.vivoPurpleLight50,
99
- loadingBarInverse: palette.vivoPurple,
100
98
  toggleAndroidInactive: palette.grey2,
101
99
  toggleAndroidBackgroundActive: palette.vivoPurpleLight20,
102
100
  iosControlKnob: palette.white,
@@ -187,8 +185,6 @@ var getVivoSkin = function getVivoSkin() {
187
185
  controlActivated: palette.vivoPurpleLight80,
188
186
  loadingBar: palette.vivoPurpleLight80,
189
187
  loadingBarBackground: palette.darkModeGrey6,
190
- loadingBarBackgroundInverse: palette.grey1,
191
- loadingBarInverse: palette.vivoPurpleLight80,
192
188
  toggleAndroidInactive: palette.grey4,
193
189
  toggleAndroidBackgroundActive: palette.vivoPurpleLight50,
194
190
  iosControlKnob: palette.grey2,
package/dist/tag.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import * as React from 'react';
2
- import type { IconProps } from './utils/types';
2
+ import type { DataAttributes, IconProps } from './utils/types';
3
3
  export declare type TagType = 'promo' | 'active' | 'inactive' | 'success' | 'warning' | 'error';
4
4
  export declare type TagProps = {
5
5
  type?: 'promo' | 'active' | 'inactive' | 'success' | 'warning' | 'error';
6
6
  children: string;
7
7
  Icon?: React.FC<IconProps>;
8
+ dataAttributes?: DataAttributes;
8
9
  /** @deprecated use type prop */
9
10
  color?: string;
10
11
  };
package/dist/tag.js CHANGED
@@ -11,6 +11,7 @@ var _jss = require("./jss");
11
11
  var _text = require("./text");
12
12
  var _themeVariantContext = require("./theme-variant-context");
13
13
  var _css = require("./utils/css");
14
+ var _dom = require("./utils/dom");
14
15
  function _interopRequireDefault(obj) {
15
16
  return obj && obj.__esModule ? obj : {
16
17
  default: obj
@@ -45,6 +46,19 @@ function _arrayLikeToArray(arr, len) {
45
46
  function _arrayWithHoles(arr) {
46
47
  if (Array.isArray(arr)) return arr;
47
48
  }
49
+ function _defineProperty(obj, key, value) {
50
+ if (key in obj) {
51
+ Object.defineProperty(obj, key, {
52
+ value: value,
53
+ enumerable: true,
54
+ configurable: true,
55
+ writable: true
56
+ });
57
+ } else {
58
+ obj[key] = value;
59
+ }
60
+ return obj;
61
+ }
48
62
  function _iterableToArrayLimit(arr, i) {
49
63
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
50
64
  if (_i == null) return;
@@ -72,6 +86,22 @@ function _iterableToArrayLimit(arr, i) {
72
86
  function _nonIterableRest() {
73
87
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
74
88
  }
89
+ function _objectSpread(target) {
90
+ var _arguments = arguments, _loop = function(i) {
91
+ var source = _arguments[i] != null ? _arguments[i] : {};
92
+ var ownKeys = Object.keys(source);
93
+ if (typeof Object.getOwnPropertySymbols === "function") {
94
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
95
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
96
+ }));
97
+ }
98
+ ownKeys.forEach(function(key) {
99
+ _defineProperty(target, key, source[key]);
100
+ });
101
+ };
102
+ for(var i = 1; i < arguments.length; i++)_loop(i);
103
+ return target;
104
+ }
75
105
  function _slicedToArray(arr, i) {
76
106
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
77
107
  }
@@ -105,7 +135,7 @@ var useStyles = (0, _jss).createUseStyles(function() {
105
135
  };
106
136
  });
107
137
  var Tag = function Tag(param) {
108
- var Icon = param.Icon, children = param.children, _type = param.type, type = _type === void 0 ? 'promo' : _type, color = param.color;
138
+ var Icon = param.Icon, children = param.children, dataAttributes = param.dataAttributes, _type = param.type, type = _type === void 0 ? 'promo' : _type, color = param.color;
109
139
  var classes = useStyles({
110
140
  hasIcon: !!Icon
111
141
  });
@@ -168,7 +198,7 @@ var Tag = function Tag(param) {
168
198
  };
169
199
  var _type1 = _slicedToArray(tagTypeToColors[type], 2), textColor1 = _type1[0], backgroundColor = _type1[1];
170
200
  var shouldUseInverseBackground = isInverse && !isDarkMode;
171
- return(/*#__PURE__*/ (0, _jsxRuntime).jsxs("span", {
201
+ return(/*#__PURE__*/ (0, _jsxRuntime).jsxs("span", _objectSpread({}, (0, _dom).getPrefixedDataAttributes(dataAttributes), {
172
202
  className: classes.tag,
173
203
  style: {
174
204
  background: shouldUseInverseBackground ? colors.inverse : backgroundColor
@@ -193,7 +223,7 @@ var Tag = function Tag(param) {
193
223
  })
194
224
  })
195
225
  ]
196
- }));
226
+ })));
197
227
  };
198
228
  var _default = Tag;
199
229
  exports.default = _default;
package/dist/tag.js.flow CHANGED
@@ -1,7 +1,7 @@
1
1
  // @flow
2
2
 
3
3
  import * as React from "react";
4
- import type { IconProps } from "./utils/types";
4
+ import type { DataAttributes, IconProps } from "./utils/types";
5
5
  export type TagType =
6
6
  | "promo"
7
7
  | "active"
@@ -13,6 +13,7 @@ export type TagProps = {
13
13
  type?: "promo" | "active" | "inactive" | "success" | "warning" | "error",
14
14
  children: string,
15
15
  Icon?: React.ComponentType<IconProps>,
16
+ dataAttributes?: DataAttributes,
16
17
 
17
18
  /**
18
19
  * @deprecated use type prop
@@ -10,6 +10,7 @@ interface CommonProps {
10
10
  small?: boolean;
11
11
  disabled?: boolean;
12
12
  trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
13
+ trackEvent?: boolean;
13
14
  /** "data-" prefix is automatically added. For example, use "testid" instead of "data-testid" */
14
15
  dataAttributes?: DataAttributes;
15
16
  }
package/dist/text-link.js CHANGED
@@ -10,6 +10,8 @@ var _touchable = _interopRequireDefault(require("./touchable"));
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
11
  var _themeVariantContext = require("./theme-variant-context");
12
12
  var _formContext = require("./form-context");
13
+ var _common = require("./utils/common");
14
+ var _analytics = require("./utils/analytics");
13
15
  function _interopRequireDefault(obj) {
14
16
  return obj && obj.__esModule ? obj : {
15
17
  default: obj
@@ -126,8 +128,14 @@ var TextLink = function TextLink(_param) {
126
128
  var classes = useStyles();
127
129
  var isInverse = (0, _themeVariantContext).useIsInverseVariant();
128
130
  var formStatus = (0, _formContext).useForm().formStatus;
131
+ var _trackingEvent;
129
132
  var _obj;
130
133
  return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_touchable.default, _objectSpread({}, props, {
134
+ trackingEvent: (_trackingEvent = props.trackingEvent) !== null && _trackingEvent !== void 0 ? _trackingEvent : props.trackEvent ? {
135
+ category: _analytics.eventCategories.userInteraction,
136
+ action: _analytics.eventActions.linkTapped,
137
+ label: (0, _common).getTextFromChildren(children)
138
+ } : undefined,
131
139
  disabled: disabled || formStatus === 'sending',
132
140
  className: (0, _classnames).default(classes.textLink, className, (_obj = {}, _defineProperty(_obj, classes.small, small), _defineProperty(_obj, classes.inverse, isInverse), _obj)),
133
141
  children: children
@@ -12,6 +12,7 @@ declare type CommonProps = {
12
12
  small?: boolean,
13
13
  disabled?: boolean,
14
14
  trackingEvent?: TrackingEvent | $ReadOnlyArray<TrackingEvent>,
15
+ trackEvent?: boolean,
15
16
 
16
17
  /**
17
18
  * "data-" prefix is automatically added. For example, use "testid" instead of "data-testid"
package/dist/text.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import type { DataAttributes } from './utils/types';
2
3
  declare type FontWeight = 'light' | 'regular' | 'medium';
3
4
  export interface TextPresetProps {
4
5
  color?: string;
@@ -15,6 +16,7 @@ export interface TextPresetProps {
15
16
  as?: React.ComponentType<any> | string;
16
17
  role?: string;
17
18
  'aria-level'?: number;
19
+ dataAttributes?: DataAttributes;
18
20
  }
19
21
  interface TextProps extends TextPresetProps {
20
22
  weight?: FontWeight | boolean;
package/dist/text.js CHANGED
@@ -9,6 +9,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
9
9
  var _jss = require("./jss");
10
10
  var _themeVariantContext = require("./theme-variant-context");
11
11
  var _css = require("./utils/css");
12
+ var _dom = require("./utils/dom");
12
13
  function _interopRequireDefault(obj) {
13
14
  return obj && obj.__esModule ? obj : {
14
15
  default: obj
@@ -148,7 +149,7 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
148
149
  };
149
150
  });
150
151
  var Text = function Text(param) {
151
- var weight = param.weight, color = param.color, textDecoration = param.textDecoration, _decoration = param.decoration, decoration = _decoration === void 0 ? textDecoration : _decoration, truncate = param.truncate, uppercase = param.uppercase, transform = param.transform, wordBreak = param.wordBreak, _as = param.as, as = _as === void 0 ? 'span' : _as, children = param.children, size = param.size, _mobileSize = param.mobileSize, mobileSize = _mobileSize === void 0 ? size : _mobileSize, _desktopSize = param.desktopSize, desktopSize = _desktopSize === void 0 ? size : _desktopSize, lineHeight = param.lineHeight, _mobileLineHeight = param.mobileLineHeight, mobileLineHeight = _mobileLineHeight === void 0 ? lineHeight : _mobileLineHeight, _desktopLineHeight = param.desktopLineHeight, desktopLineHeight = _desktopLineHeight === void 0 ? lineHeight : _desktopLineHeight, letterSpacing = param.letterSpacing, id = param.id, role = param.role, ariaLevel = param['aria-level'];
152
+ var weight = param.weight, color = param.color, textDecoration = param.textDecoration, _decoration = param.decoration, decoration = _decoration === void 0 ? textDecoration : _decoration, truncate = param.truncate, uppercase = param.uppercase, transform = param.transform, wordBreak = param.wordBreak, _as = param.as, as = _as === void 0 ? 'span' : _as, children = param.children, size = param.size, _mobileSize = param.mobileSize, mobileSize = _mobileSize === void 0 ? size : _mobileSize, _desktopSize = param.desktopSize, desktopSize = _desktopSize === void 0 ? size : _desktopSize, lineHeight = param.lineHeight, _mobileLineHeight = param.mobileLineHeight, mobileLineHeight = _mobileLineHeight === void 0 ? lineHeight : _mobileLineHeight, _desktopLineHeight = param.desktopLineHeight, desktopLineHeight = _desktopLineHeight === void 0 ? lineHeight : _desktopLineHeight, letterSpacing = param.letterSpacing, id = param.id, role = param.role, ariaLevel = param['aria-level'], dataAttributes = param.dataAttributes;
152
153
  var isInverse = (0, _themeVariantContext).useIsInverseVariant();
153
154
  var classes = useStyles({
154
155
  isInverse: isInverse,
@@ -169,12 +170,12 @@ var Text = function Text(param) {
169
170
  return null;
170
171
  }
171
172
  var className = (0, _classnames).default(classes.text, _defineProperty({}, classes.truncate, !!truncate));
172
- return(/*#__PURE__*/ React.createElement(as, {
173
+ return(/*#__PURE__*/ React.createElement(as, _objectSpread({
173
174
  className: className,
174
175
  id: id,
175
176
  role: role,
176
177
  'aria-level': ariaLevel
177
- }, children));
178
+ }, (0, _dom).getPrefixedDataAttributes(dataAttributes)), children));
178
179
  };
179
180
  exports.Text = Text;
180
181
  var getRegularOrMediumWeight = function getRegularOrMediumWeight(props) {