@telefonica/mistica 11.6.0 → 11.9.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 (59) hide show
  1. package/dist/avatar.d.ts +14 -0
  2. package/dist/avatar.js +239 -0
  3. package/dist/avatar.js.flow +16 -0
  4. package/dist/badge.d.ts +2 -0
  5. package/dist/badge.js +24 -7
  6. package/dist/badge.js.flow +2 -0
  7. package/dist/button.js +35 -10
  8. package/dist/image.d.ts +3 -1
  9. package/dist/image.js +76 -11
  10. package/dist/image.js.flow +3 -1
  11. package/dist/index.d.ts +3 -1
  12. package/dist/index.js +16 -2
  13. package/dist/index.js.flow +3 -1
  14. package/dist/package-version.js +1 -1
  15. package/dist/password-field.js +9 -8
  16. package/dist/placeholder.d.ts +0 -4
  17. package/dist/placeholder.js +1 -13
  18. package/dist/placeholder.js.flow +0 -4
  19. package/dist/section-title.d.ts +3 -0
  20. package/dist/section-title.js +3 -1
  21. package/dist/section-title.js.flow +3 -0
  22. package/dist/text-link.js +18 -5
  23. package/dist/text.js +8 -2
  24. package/dist/theme-context-provider.js +2 -1
  25. package/dist/theme.d.ts +2 -0
  26. package/dist/theme.js.flow +2 -0
  27. package/dist/title.d.ts +13 -0
  28. package/dist/title.js +87 -0
  29. package/dist/title.js.flow +18 -0
  30. package/dist/utils/analytics.d.ts +3 -0
  31. package/dist/utils/analytics.js +5 -1
  32. package/dist/utils/analytics.js.flow +3 -0
  33. package/dist/video.d.ts +1 -1
  34. package/dist/video.js +8 -6
  35. package/dist/video.js.flow +1 -1
  36. package/dist-es/avatar.js +208 -0
  37. package/dist-es/badge.js +24 -7
  38. package/dist-es/button.js +36 -11
  39. package/dist-es/image.js +77 -11
  40. package/dist-es/index.js +3 -1
  41. package/dist-es/package-version.js +1 -1
  42. package/dist-es/password-field.js +9 -8
  43. package/dist-es/placeholder.js +0 -11
  44. package/dist-es/section-title.js +3 -1
  45. package/dist-es/text-link.js +19 -6
  46. package/dist-es/text.js +8 -2
  47. package/dist-es/theme-context-provider.js +2 -1
  48. package/dist-es/title.js +54 -0
  49. package/dist-es/utils/analytics.js +5 -0
  50. package/dist-es/video.js +8 -6
  51. package/package.json +3 -3
  52. package/dist/icons/icon-visibility-off.d.ts +0 -7
  53. package/dist/icons/icon-visibility-off.js +0 -49
  54. package/dist/icons/icon-visibility-off.js.flow +0 -9
  55. package/dist/icons/icon-visibility.d.ts +0 -7
  56. package/dist/icons/icon-visibility.js +0 -49
  57. package/dist/icons/icon-visibility.js.flow +0 -9
  58. package/dist-es/icons/icon-visibility-off.js +0 -22
  59. package/dist-es/icons/icon-visibility.js +0 -22
package/dist/index.js CHANGED
@@ -380,10 +380,16 @@ Object.defineProperty(exports, "Placeholder", {
380
380
  return _placeholder.Placeholder;
381
381
  }
382
382
  });
383
- Object.defineProperty(exports, "AvatarPlaceholder", {
383
+ Object.defineProperty(exports, "Title1", {
384
384
  enumerable: true,
385
385
  get: function() {
386
- return _placeholder.AvatarPlaceholder;
386
+ return _title.Title1;
387
+ }
388
+ });
389
+ Object.defineProperty(exports, "Title2", {
390
+ enumerable: true,
391
+ get: function() {
392
+ return _title.Title2;
387
393
  }
388
394
  });
389
395
  Object.defineProperty(exports, "RowList", {
@@ -512,6 +518,12 @@ Object.defineProperty(exports, "Callout", {
512
518
  return _callout.default;
513
519
  }
514
520
  });
521
+ Object.defineProperty(exports, "Avatar", {
522
+ enumerable: true,
523
+ get: function() {
524
+ return _avatar.default;
525
+ }
526
+ });
515
527
  Object.defineProperty(exports, "useModalState", {
516
528
  enumerable: true,
517
529
  get: function() {
@@ -10769,6 +10781,7 @@ var _text = _interopRequireWildcard(require("./text"));
10769
10781
  var _tag = _interopRequireDefault(require("./tag"));
10770
10782
  var _sectionTitle = _interopRequireDefault(require("./section-title"));
10771
10783
  var _placeholder = require("./placeholder");
10784
+ var _title = require("./title");
10772
10785
  var _list = require("./list");
10773
10786
  var _switchComponent = _interopRequireDefault(require("./switch-component"));
10774
10787
  var _checkbox = _interopRequireDefault(require("./checkbox"));
@@ -10785,6 +10798,7 @@ var _menu = _interopRequireDefault(require("./menu"));
10785
10798
  var _emptyState = _interopRequireDefault(require("./empty-state"));
10786
10799
  var _emptyStateCard = _interopRequireDefault(require("./empty-state-card"));
10787
10800
  var _callout = _interopRequireDefault(require("./callout"));
10801
+ var _avatar = _interopRequireDefault(require("./avatar"));
10788
10802
  var _modalContextProvider = require("./modal-context-provider");
10789
10803
  var _navigationBar = require("./navigation-bar");
10790
10804
  var _image = _interopRequireDefault(require("./image"));
@@ -73,7 +73,8 @@ declare export {
73
73
  declare export { default as Tag } from "./tag";
74
74
  export type { TagType } from "./tag";
75
75
  declare export { default as SectionTitle } from "./section-title";
76
- declare export { Placeholder, AvatarPlaceholder } from "./placeholder";
76
+ declare export { Placeholder } from "./placeholder";
77
+ declare export { Title1, Title2 } from "./title";
77
78
  declare export { RowList, Row, BoxedRowList, BoxedRow } from "./list";
78
79
  declare export { default as Switch } from "./switch-component";
79
80
  declare export { default as Checkbox } from "./checkbox";
@@ -90,6 +91,7 @@ declare export { default as Menu } from "./menu";
90
91
  declare export { default as EmptyState } from "./empty-state";
91
92
  declare export { default as EmptyStateCard } from "./empty-state-card";
92
93
  declare export { default as Callout } from "./callout";
94
+ declare export { default as Avatar } from "./avatar";
93
95
  declare export { useModalState } from "./modal-context-provider";
94
96
  declare export {
95
97
  NavigationBar,
@@ -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.6.0";
6
+ var PACKAGE_VERSION = "11.9.0";
7
7
  exports.PACKAGE_VERSION = PACKAGE_VERSION;
@@ -9,8 +9,8 @@ var _formContext = require("./form-context");
9
9
  var _textFieldBase = require("./text-field-base");
10
10
  var _hooks = require("./hooks");
11
11
  var _iconButton = _interopRequireDefault(require("./icon-button"));
12
- var _iconVisibility = _interopRequireDefault(require("./icons/icon-visibility"));
13
- var _iconVisibilityOff = _interopRequireDefault(require("./icons/icon-visibility-off"));
12
+ var _iconAccesibilityRegular = _interopRequireDefault(require("./generated/mistica-icons/icon-accesibility-regular"));
13
+ var _iconEyeRegular = _interopRequireDefault(require("./generated/mistica-icons/icon-eye-regular"));
14
14
  var _jss = require("./jss");
15
15
  function _interopRequireDefault(obj) {
16
16
  return obj && obj.__esModule ? obj : {
@@ -144,7 +144,7 @@ var usePasswordAdornmentStyles = (0, _jss).createUseStyles(function(theme) {
144
144
  return {
145
145
  shadow: _defineProperty({}, theme.mq.supportsHover, {
146
146
  "&:hover": {
147
- backgroundColor: "rgba(0, 0, 0, 0.08)"
147
+ backgroundColor: theme.colors.backgroundAlternative
148
148
  }
149
149
  })
150
150
  };
@@ -155,10 +155,11 @@ var PasswordAdornment = function PasswordAdornment(param) {
155
155
  var classes = usePasswordAdornmentStyles();
156
156
  var style = {
157
157
  backgroundSize: "200%",
158
- padding: 12,
159
- margin: -12,
158
+ padding: 8,
159
+ margin: -8,
160
160
  borderRadius: "50%",
161
- backgroundColor: undefined
161
+ backgroundColor: undefined,
162
+ transition: "background-color 0.2s ease-in-out"
162
163
  };
163
164
  return /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconButton.default, {
164
165
  "aria-label": texts.togglePasswordVisibilityLabel,
@@ -166,10 +167,10 @@ var PasswordAdornment = function PasswordAdornment(param) {
166
167
  setVisibility(!isVisible);
167
168
  focus();
168
169
  },
169
- size: 48,
170
+ size: 40,
170
171
  className: classes.shadow,
171
172
  style: style,
172
- children: isVisible ? /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconVisibilityOff.default, {}) : /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconVisibility.default, {})
173
+ children: isVisible ? /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconAccesibilityRegular.default, {}) : /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconEyeRegular.default, {})
173
174
  });
174
175
  };
175
176
  var PasswordField = function PasswordField(_param) {
@@ -1,8 +1,4 @@
1
1
  import * as React from 'react';
2
- declare type AvatarPlaceholderProps = {
3
- size?: string | number;
4
- };
5
- export declare const AvatarPlaceholder: React.FC<AvatarPlaceholderProps>;
6
2
  declare type PlaceholderProps = {
7
3
  width?: string | number;
8
4
  height?: string | number;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- exports.Placeholder = exports.AvatarPlaceholder = void 0;
5
+ exports.Placeholder = void 0;
6
6
  var _jsxRuntime = require("react/jsx-runtime");
7
7
  var React = _interopRequireWildcard(require("react"));
8
8
  var _color = require("./utils/color");
@@ -28,18 +28,6 @@ function _interopRequireWildcard(obj) {
28
28
  return newObj;
29
29
  }
30
30
  }
31
- var AvatarPlaceholder = function AvatarPlaceholder(param) {
32
- var _size = param.size, size = _size === void 0 ? "100%" : _size;
33
- return /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
34
- style: {
35
- width: size,
36
- height: size,
37
- borderRadius: "50%",
38
- background: "gray"
39
- }
40
- });
41
- };
42
- exports.AvatarPlaceholder = AvatarPlaceholder;
43
31
  var Placeholder = function Placeholder(param) {
44
32
  var _width = param.width, width = _width === void 0 ? "auto" : _width, _height = param.height, height = _height === void 0 ? 120 : _height;
45
33
  var colors = (0, _hooks).useTheme().colors;
@@ -1,10 +1,6 @@
1
1
  // @flow
2
2
 
3
3
  import * as React from "react";
4
- declare type AvatarPlaceholderProps = {
5
- size?: string | number,
6
- };
7
- declare export var AvatarPlaceholder: React.ComponentType<AvatarPlaceholderProps>;
8
4
  declare type PlaceholderProps = {
9
5
  width?: string | number,
10
6
  height?: string | number,
@@ -5,5 +5,8 @@ declare type Props = {
5
5
  right?: React.ReactNode;
6
6
  as?: 'h1' | 'h2' | 'h3' | 'h4';
7
7
  };
8
+ /**
9
+ * @deprecated use Title1 instead
10
+ */
8
11
  declare const SectionTitle: React.FC<Props>;
9
12
  export default SectionTitle;
@@ -61,7 +61,9 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
61
61
  })
62
62
  };
63
63
  });
64
- var SectionTitle = function SectionTitle(param) {
64
+ /**
65
+ * @deprecated use Title1 instead
66
+ */ var SectionTitle = function SectionTitle(param) {
65
67
  var children = param.children, id = param.id, right = param.right, _as = param.as, as = _as === void 0 ? "h3" : _as;
66
68
  var classes = useStyles();
67
69
  var theme = (0, _hooks).useTheme();
@@ -7,5 +7,8 @@ declare type Props = {
7
7
  right?: React.Node,
8
8
  as?: "h1" | "h2" | "h3" | "h4",
9
9
  };
10
+ /**
11
+ * @deprecated use Title1 instead
12
+ */
10
13
  declare var SectionTitle: React.ComponentType<Props>;
11
14
  declare export default typeof SectionTitle;
package/dist/text-link.js CHANGED
@@ -12,6 +12,7 @@ var _themeVariantContext = require("./theme-variant-context");
12
12
  var _formContext = require("./form-context");
13
13
  var _common = require("./utils/common");
14
14
  var _analytics = require("./utils/analytics");
15
+ var _hooks = require("./hooks");
15
16
  function _interopRequireDefault(obj) {
16
17
  return obj && obj.__esModule ? obj : {
17
18
  default: obj
@@ -128,14 +129,26 @@ var TextLink = function TextLink(_param) {
128
129
  var classes = useStyles();
129
130
  var isInverse = (0, _themeVariantContext).useIsInverseVariant();
130
131
  var formStatus = (0, _formContext).useForm().formStatus;
132
+ var analytics = (0, _hooks).useTheme().analytics;
133
+ var createDefaultTrackingEvent = function createDefaultTrackingEvent() {
134
+ if (analytics.eventFormat === "google-analytics-4") {
135
+ return {
136
+ name: _analytics.eventNames.userInteraction,
137
+ component_type: "link",
138
+ component_copy: (0, _common).getTextFromChildren(children)
139
+ };
140
+ } else {
141
+ return {
142
+ category: _analytics.eventCategories.userInteraction,
143
+ action: _analytics.eventActions.linkTapped,
144
+ label: (0, _common).getTextFromChildren(children)
145
+ };
146
+ }
147
+ };
131
148
  var _trackingEvent;
132
149
  var _obj;
133
150
  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,
151
+ trackingEvent: (_trackingEvent = props.trackingEvent) !== null && _trackingEvent !== void 0 ? _trackingEvent : props.trackEvent ? createDefaultTrackingEvent() : undefined,
139
152
  disabled: disabled || formStatus === "sending",
140
153
  className: (0, _classnames).default(classes.textLink, className, (_obj = {}, _defineProperty(_obj, classes.small, small), _defineProperty(_obj, classes.inverse, isInverse), _obj)),
141
154
  children: children
package/dist/text.js CHANGED
@@ -133,8 +133,14 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
133
133
  "-webkit-line-clamp": lineClamp,
134
134
  lineClamp: lineClamp,
135
135
  wordBreak: function wordBreak(param) {
136
- var truncate = param.truncate;
137
- return truncate === 1 || truncate === true ? "break-all" : "normal";
136
+ var wordBreak1 = param.wordBreak;
137
+ return wordBreak1 ? "break-all" : "normal";
138
+ },
139
+ "@supports (overflow-wrap: anywhere)": {
140
+ wordBreak: function wordBreak(param) {
141
+ var truncate = param.truncate;
142
+ return truncate === 1 || truncate === true ? "break-all" : "normal";
143
+ }
138
144
  },
139
145
  display: "box",
140
146
  boxOrient: "vertical",
@@ -206,7 +206,8 @@ var ThemeContextProvider = function ThemeContextProvider(param) {
206
206
  analytics: _objectSpread({
207
207
  logEvent: function logEvent() {
208
208
  return Promise.resolve();
209
- }
209
+ },
210
+ eventFormat: "universal-analytics"
210
211
  }, theme.analytics),
211
212
  dimensions: _objectSpread({}, _theme.dimensions, theme.dimensions),
212
213
  mq: (0, _mediaQueries).createMediaQueries((_mediaQueries1 = theme.mediaQueries) !== null && _mediaQueries1 !== void 0 ? _mediaQueries1 : _theme.mediaQueriesConfig),
package/dist/theme.d.ts CHANGED
@@ -89,6 +89,7 @@ export declare type ThemeConfig = {
89
89
  texts?: Partial<ThemeTexts>;
90
90
  analytics?: {
91
91
  logEvent: (trackingEvent: TrackingEvent) => Promise<void>;
92
+ eventFormat?: 'universal-analytics' | 'google-analytics-4';
92
93
  };
93
94
  dimensions?: {
94
95
  headerMobileHeight: number;
@@ -117,6 +118,7 @@ export declare type Theme = {
117
118
  texts: ThemeTexts;
118
119
  analytics: {
119
120
  logEvent: (trackingEvent: TrackingEvent) => Promise<void>;
121
+ eventFormat: 'universal-analytics' | 'google-analytics-4';
120
122
  };
121
123
  dimensions: {
122
124
  headerMobileHeight: number;
@@ -93,6 +93,7 @@ export type ThemeConfig = {
93
93
  texts?: $Shape<ThemeTexts>,
94
94
  analytics?: {
95
95
  logEvent: (trackingEvent: TrackingEvent) => Promise<void>,
96
+ eventFormat?: "universal-analytics" | "google-analytics-4",
96
97
  },
97
98
  dimensions?: {
98
99
  headerMobileHeight: number,
@@ -121,6 +122,7 @@ export type Theme = {
121
122
  texts: ThemeTexts,
122
123
  analytics: {
123
124
  logEvent: (trackingEvent: TrackingEvent) => Promise<void>,
125
+ eventFormat: "universal-analytics" | "google-analytics-4",
124
126
  },
125
127
  dimensions: {
126
128
  headerMobileHeight: number,
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import type { DataAttributes } from './utils/types';
3
+ declare type TitleProps = {
4
+ children: React.ReactNode;
5
+ id?: string;
6
+ right?: React.ReactNode;
7
+ as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
8
+ /** "data-" prefix is automatically added. For example, use "testid" instead of "data-testid" */
9
+ dataAttributes?: DataAttributes;
10
+ };
11
+ export declare const Title1: ({ children, as, id, right, dataAttributes }: TitleProps) => React.ReactElement;
12
+ export declare const Title2: ({ children, as, id, right, dataAttributes }: TitleProps) => React.ReactElement;
13
+ export {};
package/dist/title.js ADDED
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.Title2 = exports.Title1 = void 0;
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _text = require("./text");
9
+ var _hooks = require("./hooks");
10
+ var _inline = _interopRequireDefault(require("./inline"));
11
+ var _box = _interopRequireDefault(require("./box"));
12
+ function _interopRequireDefault(obj) {
13
+ return obj && obj.__esModule ? obj : {
14
+ default: obj
15
+ };
16
+ }
17
+ function _interopRequireWildcard(obj) {
18
+ if (obj && obj.__esModule) {
19
+ return obj;
20
+ } else {
21
+ var newObj = {};
22
+ if (obj != null) {
23
+ for(var key in obj){
24
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
25
+ var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
26
+ if (desc.get || desc.set) {
27
+ Object.defineProperty(newObj, key, desc);
28
+ } else {
29
+ newObj[key] = obj[key];
30
+ }
31
+ }
32
+ }
33
+ }
34
+ newObj.default = obj;
35
+ return newObj;
36
+ }
37
+ }
38
+ var TitleLayout = function TitleLayout(param) {
39
+ var title = param.title, right = param.right;
40
+ if (!right) {
41
+ return title;
42
+ }
43
+ return /*#__PURE__*/ (0, _jsxRuntime).jsxs(_inline.default, {
44
+ space: "between",
45
+ alignItems: "baseline",
46
+ children: [
47
+ title,
48
+ /*#__PURE__*/ (0, _jsxRuntime).jsx(_box.default, {
49
+ paddingLeft: 16,
50
+ children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text2, {
51
+ regular: true,
52
+ children: right
53
+ })
54
+ })
55
+ ]
56
+ });
57
+ };
58
+ var Title1 = function Title1(param) {
59
+ var children = param.children, _as = param.as, as = _as === void 0 ? "h3" : _as, id = param.id, right = param.right, dataAttributes = param.dataAttributes;
60
+ var theme = (0, _hooks).useTheme();
61
+ return /*#__PURE__*/ (0, _jsxRuntime).jsx(TitleLayout, {
62
+ title: /*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text1, {
63
+ color: theme.colors.textSecondary,
64
+ transform: "uppercase",
65
+ medium: true,
66
+ as: as,
67
+ id: id,
68
+ dataAttributes: dataAttributes,
69
+ children: children
70
+ }),
71
+ right: right
72
+ });
73
+ };
74
+ exports.Title1 = Title1;
75
+ var Title2 = function Title2(param) {
76
+ var children = param.children, _as = param.as, as = _as === void 0 ? "h3" : _as, id = param.id, right = param.right, dataAttributes = param.dataAttributes;
77
+ return /*#__PURE__*/ (0, _jsxRuntime).jsx(TitleLayout, {
78
+ title: /*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text5, {
79
+ as: as,
80
+ id: id,
81
+ dataAttributes: dataAttributes,
82
+ children: children
83
+ }),
84
+ right: right
85
+ });
86
+ };
87
+ exports.Title2 = Title2;
@@ -0,0 +1,18 @@
1
+ // @flow
2
+
3
+ import * as React from "react";
4
+ import type { DataAttributes } from "./utils/types";
5
+ declare type TitleProps = {
6
+ children: React.Node,
7
+ id?: string,
8
+ right?: React.Node,
9
+ as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6",
10
+
11
+ /**
12
+ * "data-" prefix is automatically added. For example, use "testid" instead of "data-testid"
13
+ */
14
+ dataAttributes?: DataAttributes,
15
+ };
16
+ declare export var Title1: (x: TitleProps) => React.Element<any>;
17
+ declare export var Title2: (x: TitleProps) => React.Element<any>;
18
+ declare export {};
@@ -4,3 +4,6 @@ export declare const eventCategories: {
4
4
  export declare const eventActions: {
5
5
  readonly linkTapped: "link_tapped";
6
6
  };
7
+ export declare const eventNames: {
8
+ readonly userInteraction: "user_interaction";
9
+ };
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- exports.eventActions = exports.eventCategories = void 0;
5
+ exports.eventNames = exports.eventActions = exports.eventCategories = void 0;
6
6
  var eventCategories = {
7
7
  userInteraction: "user_interaction"
8
8
  };
@@ -11,3 +11,7 @@ var eventActions = {
11
11
  linkTapped: "link_tapped"
12
12
  };
13
13
  exports.eventActions = eventActions;
14
+ var eventNames = {
15
+ userInteraction: "user_interaction"
16
+ };
17
+ exports.eventNames = eventNames;
@@ -6,3 +6,6 @@ declare export var eventCategories: {
6
6
  declare export var eventActions: {
7
7
  +linkTapped: "link_tapped",
8
8
  };
9
+ declare export var eventNames: {
10
+ +userInteraction: "user_interaction",
11
+ };
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
  /**