@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/dist/text.js.flow CHANGED
@@ -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 type FontWeight = "light" | "regular" | "medium";
5
6
  export type TextPresetProps = {
6
7
  color?: string,
@@ -23,6 +24,7 @@ export type TextPresetProps = {
23
24
  as?: React.ComponentType<any> | string,
24
25
  role?: string,
25
26
  "aria-level"?: number,
27
+ dataAttributes?: DataAttributes,
26
28
  };
27
29
  declare type TextProps = {
28
30
  ...$Exact<TextPresetProps>,
@@ -0,0 +1,6 @@
1
+ export declare const eventCategories: {
2
+ readonly userInteraction: "user_interaction";
3
+ };
4
+ export declare const eventActions: {
5
+ readonly linkTapped: "link_tapped";
6
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.eventActions = exports.eventCategories = void 0;
6
+ var eventCategories = {
7
+ userInteraction: 'user_interaction'
8
+ };
9
+ exports.eventCategories = eventCategories;
10
+ var eventActions = {
11
+ linkTapped: 'link_tapped'
12
+ };
13
+ exports.eventActions = eventActions;
@@ -0,0 +1,8 @@
1
+ // @flow
2
+
3
+ declare export var eventCategories: {
4
+ +userInteraction: "user_interaction",
5
+ };
6
+ declare export var eventActions: {
7
+ +linkTapped: "link_tapped",
8
+ };
@@ -1,2 +1,3 @@
1
1
  import * as React from 'react';
2
2
  export declare const combineRefs: <T>(...refs: (React.Ref<T> | undefined)[]) => (refValue: T | null) => void;
3
+ export declare const getTextFromChildren: (children: React.ReactNode) => string;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- exports.combineRefs = void 0;
5
+ exports.getTextFromChildren = exports.combineRefs = void 0;
6
6
  var React = _interopRequireWildcard(require("react"));
7
7
  function _interopRequireWildcard(obj) {
8
8
  if (obj && obj.__esModule) {
@@ -43,3 +43,13 @@ var combineRefs = function combineRefs() {
43
43
  };
44
44
  };
45
45
  exports.combineRefs = combineRefs;
46
+ var getTextFromChildren = function getTextFromChildren(children) {
47
+ var text = '';
48
+ React.Children.forEach(children, function(child) {
49
+ if (typeof child === 'string') {
50
+ text += child;
51
+ }
52
+ });
53
+ return text;
54
+ };
55
+ exports.getTextFromChildren = getTextFromChildren;
@@ -4,3 +4,4 @@ import * as React from "react";
4
4
  declare export var combineRefs: <T>(
5
5
  ...refs: Array<React.Ref<T> | void>
6
6
  ) => (refValue: T | null) => void;
7
+ declare export var getTextFromChildren: (children: React.Node) => string;
@@ -1,12 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export type { RendersElement, RendersNullableElement } from './renders-element';
3
- export declare type TrackingEvent = {
4
- readonly [key: string]: unknown;
5
- readonly category: string;
6
- readonly action: string;
7
- readonly label?: string;
8
- readonly value?: number;
9
- };
3
+ export type { TrackingEvent } from '@tef-novum/webview-bridge';
10
4
  export declare type DataAttributes = {
11
5
  [name: string]: string | number | boolean | undefined;
12
6
  };
@@ -1,13 +1,7 @@
1
1
  // @flow
2
2
 
3
3
  export type { RendersElement, RendersNullableElement } from "./renders-element";
4
- export type TrackingEvent = {
5
- [key: string]: mixed,
6
- +category: string,
7
- +action: string,
8
- +label?: string,
9
- +value?: number,
10
- };
4
+ export type { TrackingEvent } from "@tef-novum/webview-bridge";
11
5
  export type DataAttributes = {
12
6
  [name: string]: string | number | boolean | void,
13
7
  };
package/dist/video.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 type AspectRatio = '1:1' | '16:9' | '12:5' | '4:3';
3
4
  export declare const RATIO: {
4
5
  '1:1': number;
@@ -28,6 +29,7 @@ export declare type VideoProps = {
28
29
  children?: void;
29
30
  /** defaults to none */
30
31
  preload?: 'none' | 'metadata' | 'auto';
32
+ dataAttributes?: DataAttributes;
31
33
  };
32
34
  declare const Video: React.ForwardRefExoticComponent<VideoProps & React.RefAttributes<HTMLVideoElement>>;
33
35
  export default Video;
package/dist/video.js CHANGED
@@ -8,6 +8,7 @@ var React = _interopRequireWildcard(require("react"));
8
8
  var _image = require("./image");
9
9
  var _jss = require("./jss");
10
10
  var _common = require("./utils/common");
11
+ var _dom = require("./utils/dom");
11
12
  function _interopRequireWildcard(obj) {
12
13
  if (obj && obj.__esModule) {
13
14
  return obj;
@@ -29,6 +30,35 @@ function _interopRequireWildcard(obj) {
29
30
  return newObj;
30
31
  }
31
32
  }
33
+ function _defineProperty(obj, key, value) {
34
+ if (key in obj) {
35
+ Object.defineProperty(obj, key, {
36
+ value: value,
37
+ enumerable: true,
38
+ configurable: true,
39
+ writable: true
40
+ });
41
+ } else {
42
+ obj[key] = value;
43
+ }
44
+ return obj;
45
+ }
46
+ function _objectSpread(target) {
47
+ var _arguments = arguments, _loop = function(i) {
48
+ var source = _arguments[i] != null ? _arguments[i] : {};
49
+ var ownKeys = Object.keys(source);
50
+ if (typeof Object.getOwnPropertySymbols === "function") {
51
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
52
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
53
+ }));
54
+ }
55
+ ownKeys.forEach(function(key) {
56
+ _defineProperty(target, key, source[key]);
57
+ });
58
+ };
59
+ for(var i = 1; i < arguments.length; i++)_loop(i);
60
+ return target;
61
+ }
32
62
  function _objectWithoutProperties(source, excluded) {
33
63
  if (source == null) return {};
34
64
  var target = _objectWithoutPropertiesLoose(source, excluded);
@@ -83,14 +113,15 @@ var useStyles = (0, _jss).createUseStyles(function() {
83
113
  });
84
114
  /** Transparent 1x1px PNG */ var TRANSPARENT_PIXEL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC';
85
115
  var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
86
- var src1 = _param.src, poster = _param.poster, _autoPlay = _param.autoPlay, autoPlay = _autoPlay === void 0 ? true : _autoPlay, _muted = _param.muted, muted = _muted === void 0 ? true : _muted, _loop = _param.loop, loop = _loop === void 0 ? true : _loop, _preload = _param.preload, preload = _preload === void 0 ? 'none' : _preload, _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? '1:1' : _aspectRatio, props = _objectWithoutProperties(_param, [
116
+ var src1 = _param.src, poster = _param.poster, _autoPlay = _param.autoPlay, autoPlay = _autoPlay === void 0 ? true : _autoPlay, _muted = _param.muted, muted = _muted === void 0 ? true : _muted, _loop = _param.loop, loop = _loop === void 0 ? true : _loop, _preload = _param.preload, preload = _preload === void 0 ? 'none' : _preload, _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? '1:1' : _aspectRatio, dataAttributes = _param.dataAttributes, props = _objectWithoutProperties(_param, [
87
117
  "src",
88
118
  "poster",
89
119
  "autoPlay",
90
120
  "muted",
91
121
  "loop",
92
122
  "preload",
93
- "aspectRatio"
123
+ "aspectRatio",
124
+ "dataAttributes"
94
125
  ]);
95
126
  var noBorderRadius = (0, _image).useDisableBorderRadius();
96
127
  var classes = useStyles({
@@ -130,7 +161,7 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
130
161
  } else {
131
162
  width = '100%';
132
163
  }
133
- return(/*#__PURE__*/ (0, _jsxRuntime).jsx("video", {
164
+ return(/*#__PURE__*/ (0, _jsxRuntime).jsx("video", _objectSpread({
134
165
  ref: (0, _common).combineRefs(ref, videoRef),
135
166
  playsInline: true,
136
167
  disablePictureInPicture: true,
@@ -143,7 +174,8 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
143
174
  className: classes.video,
144
175
  preload: preload,
145
176
  // This transparent pixel fallback avoids showing the ugly "play" image in android webviews
146
- poster: poster || TRANSPARENT_PIXEL,
177
+ poster: poster || TRANSPARENT_PIXEL
178
+ }, (0, _dom).getPrefixedDataAttributes(dataAttributes), {
147
179
  children: sources.map(function(param, index) {
148
180
  var src = param.src, type = param.type;
149
181
  /*#__PURE__*/ return (0, _jsxRuntime).jsx("source", {
@@ -151,7 +183,7 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
151
183
  type: type
152
184
  }, index);
153
185
  })
154
- }));
186
+ })));
155
187
  });
156
188
  var _default = Video;
157
189
  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
  export type AspectRatio = "1:1" | "16:9" | "12:5" | "4:3";
5
6
  declare export var RATIO: {
6
7
  "1:1": number,
@@ -43,6 +44,7 @@ export type VideoProps = {
43
44
  * defaults to none
44
45
  */
45
46
  preload?: "none" | "metadata" | "auto",
47
+ dataAttributes?: DataAttributes,
46
48
  };
47
49
  declare var Video: React.ComponentType<{
48
50
  ...VideoProps,
package/dist-es/button.js CHANGED
@@ -9,6 +9,8 @@ import { useForm } from './form-context';
9
9
  import { pxToRem } from './utils/css';
10
10
  import { Text, Text2, Text3 } from './text';
11
11
  import Box from './box';
12
+ import { getTextFromChildren } from './utils/common';
13
+ import { eventActions, eventCategories } from './utils/analytics';
12
14
  function _arrayLikeToArray(arr, len) {
13
15
  if (len == null || len > arr.length) len = arr.length;
14
16
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -308,13 +310,18 @@ var Button = function(props) {
308
310
  children: text
309
311
  });
310
312
  };
313
+ var _trackingEvent;
311
314
  var _obj;
312
315
  var commonProps = {
313
316
  className: classnames(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)),
314
317
  style: _objectSpread({
315
318
  cursor: props.fake ? 'pointer' : undefined
316
319
  }, props.style),
317
- trackingEvent: props.trackingEvent,
320
+ trackingEvent: (_trackingEvent = props.trackingEvent) !== null && _trackingEvent !== void 0 ? _trackingEvent : props.trackEvent ? {
321
+ category: eventCategories.userInteraction,
322
+ action: "".concat(props.type, "_button_tapped"),
323
+ label: getTextFromChildren(props.children)
324
+ } : undefined,
318
325
  dataAttributes: props.dataAttributes,
319
326
  'aria-controls': props['aria-controls'],
320
327
  'aria-expanded': props['aria-expanded'],
@@ -453,10 +460,15 @@ var useButtonLinkStyles = createUseStyles(function(theme) {
453
460
  export var ButtonLink = /*#__PURE__*/ React.forwardRef(function(props, ref) {
454
461
  var classes = useButtonLinkStyles();
455
462
  var isInverse = useIsInverseVariant();
463
+ var _trackingEvent;
456
464
  var _obj;
457
465
  var commonProps = {
458
466
  className: classnames(classes.link, (_obj = {}, _defineProperty(_obj, classes.inverse, isInverse), _defineProperty(_obj, classes.aligned, props.aligned), _obj)),
459
- trackingEvent: props.trackingEvent,
467
+ trackingEvent: (_trackingEvent = props.trackingEvent) !== null && _trackingEvent !== void 0 ? _trackingEvent : props.trackEvent ? {
468
+ category: eventCategories.userInteraction,
469
+ action: eventActions.linkTapped,
470
+ label: getTextFromChildren(props.children)
471
+ } : undefined,
460
472
  dataAttributes: props.dataAttributes,
461
473
  children: /*#__PURE__*/ _jsx(Text2, {
462
474
  medium: true,
@@ -502,18 +514,21 @@ export var ButtonLink = /*#__PURE__*/ React.forwardRef(function(props, ref) {
502
514
  export var ButtonPrimary = function(props) {
503
515
  var classes = usePrimaryButtonStyles();
504
516
  return(/*#__PURE__*/ _jsx(Button, _objectSpread({}, props, {
505
- classes: classes
517
+ classes: classes,
518
+ type: "primary"
506
519
  })));
507
520
  };
508
521
  export var ButtonSecondary = function(props) {
509
522
  var classes = useSecondaryButtonStyles();
510
523
  return(/*#__PURE__*/ _jsx(Button, _objectSpread({}, props, {
511
- classes: classes
524
+ classes: classes,
525
+ type: "secondary"
512
526
  })));
513
527
  };
514
528
  export var ButtonDanger = function(props) {
515
529
  var classes = useDangerButtonStyles();
516
530
  return(/*#__PURE__*/ _jsx(Button, _objectSpread({}, props, {
517
- classes: classes
531
+ classes: classes,
532
+ type: "danger"
518
533
  })));
519
534
  };
@@ -1,6 +1,8 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import Stack from './stack';
4
+ import Inline from './inline';
5
+ import Box from './box';
4
6
  import { useTheme } from './hooks';
5
7
  import { ThemeVariant, useIsInverseVariant } from './theme-variant-context';
6
8
  import { createUseStyles } from './jss';
@@ -63,8 +65,8 @@ var Callout = function(param) {
63
65
  children: /*#__PURE__*/ _jsxs(ThemeVariant, {
64
66
  isInverse: false,
65
67
  children: [
66
- icon && /*#__PURE__*/ _jsx("div", {
67
- className: classes.icon,
68
+ icon && /*#__PURE__*/ _jsx(Box, {
69
+ paddingRight: 16,
68
70
  children: icon
69
71
  }),
70
72
  /*#__PURE__*/ _jsx("div", {
@@ -72,18 +74,41 @@ var Callout = function(param) {
72
74
  children: /*#__PURE__*/ _jsxs(Stack, {
73
75
  space: 16,
74
76
  children: [
75
- /*#__PURE__*/ _jsxs(_Fragment, {
77
+ /*#__PURE__*/ _jsxs(Inline, {
78
+ fullWidth: true,
79
+ alignItems: "flex-start",
80
+ space: "between",
76
81
  children: [
77
- /*#__PURE__*/ _jsx(Text3, {
78
- as: "h2",
79
- regular: true,
80
- children: title
82
+ /*#__PURE__*/ _jsxs(Stack, {
83
+ space: 4,
84
+ children: [
85
+ /*#__PURE__*/ _jsx(Text3, {
86
+ as: "h2",
87
+ regular: true,
88
+ children: title
89
+ }),
90
+ /*#__PURE__*/ _jsx(Text2, {
91
+ as: "p",
92
+ regular: true,
93
+ color: colors.textSecondary,
94
+ children: description
95
+ })
96
+ ]
81
97
  }),
82
- /*#__PURE__*/ _jsx(Text2, {
83
- as: "p",
84
- regular: true,
85
- color: colors.textSecondary,
86
- children: description
98
+ onClose && /*#__PURE__*/ _jsx(IconButton, {
99
+ size: 40,
100
+ style: {
101
+ display: 'flex',
102
+ margin: '-8px -12px',
103
+ alignItems: 'center',
104
+ justifyContent: 'center'
105
+ },
106
+ onPress: onClose,
107
+ "aria-label": texts.closeButtonLabel,
108
+ children: /*#__PURE__*/ _jsx(IconCloseRegular, {
109
+ size: 24,
110
+ color: colors.neutralHigh
111
+ })
87
112
  })
88
113
  ]
89
114
  }),
@@ -94,20 +119,6 @@ var Callout = function(param) {
94
119
  })
95
120
  ]
96
121
  })
97
- }),
98
- onClose && /*#__PURE__*/ _jsx(IconButton, {
99
- size: 40,
100
- style: {
101
- display: 'flex',
102
- margin: '-8px -12px -8px 0',
103
- alignItems: 'center',
104
- justifyContent: 'center'
105
- },
106
- onPress: onClose,
107
- "aria-label": texts.closeButtonLabel,
108
- children: /*#__PURE__*/ _jsx(IconCloseRegular, {
109
- color: colors.neutralHigh
110
- })
111
122
  })
112
123
  ]
113
124
  })
package/dist-es/image.js CHANGED
@@ -1,6 +1,35 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { createUseStyles } from './jss';
4
+ import { getPrefixedDataAttributes } from './utils/dom';
5
+ function _defineProperty(obj, key, value) {
6
+ if (key in obj) {
7
+ Object.defineProperty(obj, key, {
8
+ value: value,
9
+ enumerable: true,
10
+ configurable: true,
11
+ writable: true
12
+ });
13
+ } else {
14
+ obj[key] = value;
15
+ }
16
+ return obj;
17
+ }
18
+ function _objectSpread(target) {
19
+ for(var i = 1; i < arguments.length; i++){
20
+ var source = arguments[i] != null ? arguments[i] : {};
21
+ var ownKeys = Object.keys(source);
22
+ if (typeof Object.getOwnPropertySymbols === "function") {
23
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
24
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
25
+ }));
26
+ }
27
+ ownKeys.forEach(function(key) {
28
+ _defineProperty(target, key, source[key]);
29
+ });
30
+ }
31
+ return target;
32
+ }
4
33
  function _objectWithoutProperties(source, excluded) {
5
34
  if (source == null) return {};
6
35
  var target = _objectWithoutPropertiesLoose(source, excluded);
@@ -67,9 +96,10 @@ export var RATIO = {
67
96
  '4:3': 4 / 3
68
97
  };
69
98
  var Image = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
70
- var _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? '1:1' : _aspectRatio, _alt = _param.alt, alt = _alt === void 0 ? '' : _alt, props = _objectWithoutProperties(_param, [
99
+ 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, [
71
100
  "aspectRatio",
72
- "alt"
101
+ "alt",
102
+ "dataAttributes"
73
103
  ]);
74
104
  var noBorderRadius = useDisableBorderRadius();
75
105
  var classes = useStyles({
@@ -89,13 +119,13 @@ var Image = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
89
119
  } else {
90
120
  width = '100%';
91
121
  }
92
- return(/*#__PURE__*/ _jsx("img", {
122
+ return(/*#__PURE__*/ _jsx("img", _objectSpread({}, getPrefixedDataAttributes(dataAttributes), {
93
123
  ref: ref,
94
124
  src: url,
95
125
  className: classes.image,
96
126
  alt: alt,
97
127
  width: width,
98
128
  height: height
99
- }));
129
+ })));
100
130
  });
101
131
  export default Image;
@@ -1,2 +1,2 @@
1
1
  // DO NOT EDIT THIS FILE. It's autogenerated by set-version.js
2
- export var PACKAGE_VERSION = '10.24.2';
2
+ export var PACKAGE_VERSION = '10.27.0';
@@ -94,8 +94,6 @@ export var getBlauSkin = function() {
94
94
  controlError: palette.blauRed,
95
95
  loadingBar: palette.blauBlueSecondary,
96
96
  loadingBarBackground: palette.blauBlueSecondary10,
97
- loadingBarInverse: palette.blauBlueSecondary,
98
- loadingBarBackgroundInverse: palette.blauBlueSecondary10,
99
97
  toggleAndroidInactive: palette.grey2,
100
98
  toggleAndroidBackgroundActive: palette.blauBlueSecondary10,
101
99
  iosControlKnob: palette.white,
@@ -107,8 +107,6 @@ export var getO2ClassicSkin = function() {
107
107
  controlError: palette.pepper,
108
108
  loadingBar: palette.o2Gem,
109
109
  loadingBarBackground: palette.o2GemLight30,
110
- loadingBarBackgroundInverse: palette.o2GemLight30,
111
- loadingBarInverse: palette.o2Gem,
112
110
  toggleAndroidInactive: palette.grey2,
113
111
  toggleAndroidBackgroundActive: palette.o2GemLight30,
114
112
  iosControlKnob: palette.white,
@@ -195,8 +193,6 @@ export var getO2ClassicSkin = function() {
195
193
  controlActivated: palette.o2Gem,
196
194
  loadingBar: palette.o2Gem,
197
195
  loadingBarBackground: palette.darkModeGrey6,
198
- loadingBarBackgroundInverse: palette.darkModeGrey,
199
- loadingBarInverse: palette.o2SkyBlue,
200
196
  toggleAndroidInactive: palette.grey4,
201
197
  toggleAndroidBackgroundActive: palette.o2GemLight30,
202
198
  iosControlKnob: palette.grey2,
@@ -97,8 +97,6 @@ export var getO2Skin = function() {
97
97
  controlError: palette.pepper,
98
98
  loadingBar: palette.o2BluePrimary,
99
99
  loadingBarBackground: palette.grey1,
100
- loadingBarBackgroundInverse: palette.grey1,
101
- loadingBarInverse: palette.o2BluePrimary,
102
100
  toggleAndroidInactive: palette.grey2,
103
101
  toggleAndroidBackgroundActive: palette.o2BluePrimary15,
104
102
  iosControlKnob: palette.white,
@@ -189,8 +187,6 @@ export var getO2Skin = function() {
189
187
  controlActivated: palette.o2BluePrimary30,
190
188
  loadingBar: palette.darkModeO2BluePrimary,
191
189
  loadingBarBackground: palette.darkModeGrey6,
192
- loadingBarBackgroundInverse: palette.grey1,
193
- loadingBarInverse: palette.darkModeO2BluePrimary,
194
190
  toggleAndroidInactive: palette.grey4,
195
191
  toggleAndroidBackgroundActive: palette.o2BlueLight30,
196
192
  iosControlKnob: palette.grey2,
@@ -92,8 +92,6 @@ export var getTelefonicaSkin = function() {
92
92
  controlError: palette.coral,
93
93
  loadingBar: palette.telefonicaBlue30,
94
94
  loadingBarBackground: palette.telefonicaBlue70,
95
- loadingBarBackgroundInverse: palette.telefonicaBlue70,
96
- loadingBarInverse: palette.telefonicaBlue30,
97
95
  toggleAndroidInactive: palette.grey2,
98
96
  toggleAndroidBackgroundActive: palette.grey2,
99
97
  iosControlKnob: palette.white,
@@ -102,7 +100,7 @@ export var getTelefonicaSkin = function() {
102
100
  dividerInverse: applyAlpha(palette.white, 0.2),
103
101
  navigationBarDivider: palette.telefonicaBlue,
104
102
  // FEEDBACKS
105
- badge: palette.coral80,
103
+ badge: palette.coral70,
106
104
  feedbackErrorBackground: palette.coral,
107
105
  feedbackInfoBackground: palette.grey9,
108
106
  // GLOBAL
@@ -182,8 +180,6 @@ export var getTelefonicaSkin = function() {
182
180
  controlActivated: palette.telefonicaBlue,
183
181
  loadingBar: palette.telefonicaBlue,
184
182
  loadingBarBackground: applyAlpha(palette.white, 0.05),
185
- loadingBarBackgroundInverse: palette.telefonicaBlue70,
186
- loadingBarInverse: palette.telefonicaBlue30,
187
183
  toggleAndroidInactive: palette.grey4,
188
184
  toggleAndroidBackgroundActive: palette.grey1,
189
185
  iosControlKnob: palette.grey2,
@@ -91,8 +91,6 @@ export var getVivoSkin = function() {
91
91
  controlError: palette.pepper,
92
92
  loadingBar: palette.pink,
93
93
  loadingBarBackground: palette.pepperLight30,
94
- loadingBarBackgroundInverse: palette.vivoPurpleLight50,
95
- loadingBarInverse: palette.vivoPurple,
96
94
  toggleAndroidInactive: palette.grey2,
97
95
  toggleAndroidBackgroundActive: palette.vivoPurpleLight20,
98
96
  iosControlKnob: palette.white,
@@ -183,8 +181,6 @@ export var getVivoSkin = function() {
183
181
  controlActivated: palette.vivoPurpleLight80,
184
182
  loadingBar: palette.vivoPurpleLight80,
185
183
  loadingBarBackground: palette.darkModeGrey6,
186
- loadingBarBackgroundInverse: palette.grey1,
187
- loadingBarInverse: palette.vivoPurpleLight80,
188
184
  toggleAndroidInactive: palette.grey4,
189
185
  toggleAndroidBackgroundActive: palette.vivoPurpleLight50,
190
186
  iosControlKnob: palette.grey2,
package/dist-es/tag.js CHANGED
@@ -6,6 +6,7 @@ import { createUseStyles } from './jss';
6
6
  import { Text } from './text';
7
7
  import { ThemeVariant, useIsInverseVariant } from './theme-variant-context';
8
8
  import { pxToRem } from './utils/css';
9
+ import { getPrefixedDataAttributes } from './utils/dom';
9
10
  function _arrayLikeToArray(arr, len) {
10
11
  if (len == null || len > arr.length) len = arr.length;
11
12
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -14,6 +15,19 @@ function _arrayLikeToArray(arr, len) {
14
15
  function _arrayWithHoles(arr) {
15
16
  if (Array.isArray(arr)) return arr;
16
17
  }
18
+ function _defineProperty(obj, key, value) {
19
+ if (key in obj) {
20
+ Object.defineProperty(obj, key, {
21
+ value: value,
22
+ enumerable: true,
23
+ configurable: true,
24
+ writable: true
25
+ });
26
+ } else {
27
+ obj[key] = value;
28
+ }
29
+ return obj;
30
+ }
17
31
  function _iterableToArrayLimit(arr, i) {
18
32
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
19
33
  if (_i == null) return;
@@ -41,6 +55,21 @@ function _iterableToArrayLimit(arr, i) {
41
55
  function _nonIterableRest() {
42
56
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
43
57
  }
58
+ function _objectSpread(target) {
59
+ for(var i = 1; i < arguments.length; i++){
60
+ var source = arguments[i] != null ? arguments[i] : {};
61
+ var ownKeys = Object.keys(source);
62
+ if (typeof Object.getOwnPropertySymbols === "function") {
63
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
64
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
65
+ }));
66
+ }
67
+ ownKeys.forEach(function(key) {
68
+ _defineProperty(target, key, source[key]);
69
+ });
70
+ }
71
+ return target;
72
+ }
44
73
  function _slicedToArray(arr, i) {
45
74
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
46
75
  }
@@ -74,7 +103,7 @@ var useStyles = createUseStyles(function() {
74
103
  };
75
104
  });
76
105
  var Tag = function(param) {
77
- var Icon = param.Icon, children = param.children, _type = param.type, type = _type === void 0 ? 'promo' : _type, color = param.color;
106
+ var Icon = param.Icon, children = param.children, dataAttributes = param.dataAttributes, _type = param.type, type = _type === void 0 ? 'promo' : _type, color = param.color;
78
107
  var classes = useStyles({
79
108
  hasIcon: !!Icon
80
109
  });
@@ -137,7 +166,7 @@ var Tag = function(param) {
137
166
  };
138
167
  var _type1 = _slicedToArray(tagTypeToColors[type], 2), textColor1 = _type1[0], backgroundColor = _type1[1];
139
168
  var shouldUseInverseBackground = isInverse && !isDarkMode;
140
- return(/*#__PURE__*/ _jsxs("span", {
169
+ return(/*#__PURE__*/ _jsxs("span", _objectSpread({}, getPrefixedDataAttributes(dataAttributes), {
141
170
  className: classes.tag,
142
171
  style: {
143
172
  background: shouldUseInverseBackground ? colors.inverse : backgroundColor
@@ -162,6 +191,6 @@ var Tag = function(param) {
162
191
  })
163
192
  })
164
193
  ]
165
- }));
194
+ })));
166
195
  };
167
196
  export default Tag;
@@ -5,6 +5,8 @@ import Touchable from './touchable';
5
5
  import classnames from 'classnames';
6
6
  import { useIsInverseVariant } from './theme-variant-context';
7
7
  import { useForm } from './form-context';
8
+ import { getTextFromChildren } from './utils/common';
9
+ import { eventActions, eventCategories } from './utils/analytics';
8
10
  function _defineProperty(obj, key, value) {
9
11
  if (key in obj) {
10
12
  Object.defineProperty(obj, key, {
@@ -94,8 +96,14 @@ var TextLink = function(_param) {
94
96
  var classes = useStyles();
95
97
  var isInverse = useIsInverseVariant();
96
98
  var formStatus = useForm().formStatus;
99
+ var _trackingEvent;
97
100
  var _obj;
98
101
  return(/*#__PURE__*/ _jsx(Touchable, _objectSpread({}, props, {
102
+ trackingEvent: (_trackingEvent = props.trackingEvent) !== null && _trackingEvent !== void 0 ? _trackingEvent : props.trackEvent ? {
103
+ category: eventCategories.userInteraction,
104
+ action: eventActions.linkTapped,
105
+ label: getTextFromChildren(children)
106
+ } : undefined,
99
107
  disabled: disabled || formStatus === 'sending',
100
108
  className: classnames(classes.textLink, className, (_obj = {}, _defineProperty(_obj, classes.small, small), _defineProperty(_obj, classes.inverse, isInverse), _obj)),
101
109
  children: children