@telefonica/mistica 11.11.1 → 11.12.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/image.js CHANGED
@@ -166,7 +166,10 @@ var useStyles = (0, _jss).createUseStyles(function() {
166
166
  },
167
167
  "$wrapper &": {
168
168
  borderRadius: 0,
169
- position: "absolute",
169
+ position: function position(param) {
170
+ var aspectRatio = param.aspectRatio;
171
+ return aspectRatio ? "absolute" : "static";
172
+ },
170
173
  width: "100%",
171
174
  height: "100%",
172
175
  top: 0,
@@ -189,7 +192,7 @@ var useStyles = (0, _jss).createUseStyles(function() {
189
192
  paddingTop: function paddingTop(param) {
190
193
  var aspectRatio = param.aspectRatio, width = param.width;
191
194
  if (!aspectRatio) {
192
- return "initial";
195
+ return 0;
193
196
  }
194
197
  if (width && typeof width === "string" && width.endsWith("%")) {
195
198
  return "".concat(Number(width.replace("%", "")) / aspectRatio, "%");
@@ -257,10 +260,12 @@ var Image = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
257
260
  setIsError(false);
258
261
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(event);
259
262
  }
260
- }, !needsWrapper ? {
263
+ }, needsWrapper ? {
264
+ width: "100%"
265
+ } : {
261
266
  width: width,
262
267
  height: height
263
- } : {}));
268
+ }));
264
269
  if (needsWrapper) {
265
270
  return /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
266
271
  style: {
@@ -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.11.1";
6
+ var PACKAGE_VERSION = "11.12.0";
7
7
  exports.PACKAGE_VERSION = PACKAGE_VERSION;
@@ -2,15 +2,29 @@ export declare type SkinVariant = 'prominent';
2
2
  export declare type KnownSkinName = 'Movistar' | 'O2' | 'O2-classic' | 'Vivo' | 'Telefonica' | 'Blau';
3
3
  export declare type SkinName = KnownSkinName | string;
4
4
  export declare type GetKnownSkin = (variant?: SkinVariant) => KnownSkin;
5
+ export declare type FontWeight = 'light' | 'regular' | 'medium';
6
+ declare type TextPresetName = 'text5' | 'text6' | 'text7' | 'text8' | 'text9' | 'text10';
7
+ export declare type TextPresetsConfig = {
8
+ [preset in TextPresetName]: {
9
+ weight: FontWeight;
10
+ };
11
+ };
12
+ declare type PartialTextPresetsConfig = {
13
+ [preset in TextPresetName]?: {
14
+ weight?: FontWeight;
15
+ };
16
+ };
5
17
  export declare type Skin = {
6
18
  name: SkinName;
7
19
  colors: Colors;
8
20
  darkModeColors?: Partial<Colors>;
21
+ textPresets?: PartialTextPresetsConfig;
9
22
  };
10
23
  export declare type KnownSkin = {
11
24
  name: KnownSkinName;
12
25
  colors: Colors;
13
26
  darkModeColors?: Partial<Colors>;
27
+ textPresets?: PartialTextPresetsConfig;
14
28
  };
15
29
  export declare type Colors = {
16
30
  appBarBackground: string;
@@ -102,3 +116,4 @@ export declare type Colors = {
102
116
  textTagActive: string;
103
117
  textTagInactive: string;
104
118
  };
119
+ export {};
@@ -10,15 +10,37 @@ export type KnownSkinName =
10
10
  | "Blau";
11
11
  export type SkinName = KnownSkinName | string;
12
12
  export type GetKnownSkin = (variant?: SkinVariant) => KnownSkin;
13
+ export type FontWeight = "light" | "regular" | "medium";
14
+ declare type TextPresetName =
15
+ | "text5"
16
+ | "text6"
17
+ | "text7"
18
+ | "text8"
19
+ | "text9"
20
+ | "text10";
21
+ export type TextPresetsConfig = $ObjMapi<
22
+ { [k: TextPresetName]: any },
23
+ <preset>(preset) => {
24
+ weight: FontWeight,
25
+ }
26
+ >;
27
+ declare type PartialTextPresetsConfig = $ObjMapi<
28
+ { [k: TextPresetName]: any },
29
+ <preset>(preset) => {
30
+ weight?: FontWeight,
31
+ }
32
+ >;
13
33
  export type Skin = {
14
34
  name: SkinName,
15
35
  colors: Colors,
16
36
  darkModeColors?: $Shape<Colors>,
37
+ textPresets?: PartialTextPresetsConfig,
17
38
  };
18
39
  export type KnownSkin = {
19
40
  name: KnownSkinName,
20
41
  colors: Colors,
21
42
  darkModeColors?: $Shape<Colors>,
43
+ textPresets?: PartialTextPresetsConfig,
22
44
  };
23
45
  export type Colors = {
24
46
  appBarBackground: string,
@@ -110,3 +132,4 @@ export type Colors = {
110
132
  textTagActive: string,
111
133
  textTagInactive: string,
112
134
  };
135
+ declare export {};
package/dist/text.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
+ import type { FontWeight } from './skins/types';
2
3
  import type { DataAttributes } from './utils/types';
3
- declare type FontWeight = 'light' | 'regular' | 'medium';
4
4
  export interface TextPresetProps {
5
5
  color?: string;
6
6
  decoration?: 'underline' | 'line-through' | 'inherit' | 'none';
package/dist/text.js CHANGED
@@ -10,6 +10,7 @@ var _jss = require("./jss");
10
10
  var _themeVariantContext = require("./theme-variant-context");
11
11
  var _css = require("./utils/css");
12
12
  var _dom = require("./utils/dom");
13
+ var _hooks = require("./hooks");
13
14
  function _interopRequireDefault(obj) {
14
15
  return obj && obj.__esModule ? obj : {
15
16
  default: obj
@@ -190,72 +191,78 @@ var getWeight = function getWeight(props) {
190
191
  return props.light && "light" || props.regular && "regular" || props.medium && "medium";
191
192
  };
192
193
  var Text10 = function Text10(props) {
194
+ var textPresets = (0, _hooks).useTheme().textPresets;
193
195
  return /*#__PURE__*/ (0, _jsxRuntime).jsx(Text, _objectSpread({
194
196
  mobileSize: 32,
195
197
  mobileLineHeight: "40px",
196
198
  desktopSize: 64,
197
199
  desktopLineHeight: "72px",
198
- weight: "light"
200
+ weight: textPresets.text10.weight
199
201
  }, props, {
200
202
  children: props.children
201
203
  }));
202
204
  };
203
205
  exports.Text10 = Text10;
204
206
  var Text9 = function Text9(props) {
207
+ var textPresets = (0, _hooks).useTheme().textPresets;
205
208
  return /*#__PURE__*/ (0, _jsxRuntime).jsx(Text, _objectSpread({
206
209
  mobileSize: 32,
207
210
  mobileLineHeight: "40px",
208
211
  desktopSize: 56,
209
212
  desktopLineHeight: "64px",
210
- weight: "light"
213
+ weight: textPresets.text9.weight
211
214
  }, props, {
212
215
  children: props.children
213
216
  }));
214
217
  };
215
218
  exports.Text9 = Text9;
216
219
  var Text8 = function Text8(props) {
220
+ var textPresets = (0, _hooks).useTheme().textPresets;
217
221
  return /*#__PURE__*/ (0, _jsxRuntime).jsx(Text, _objectSpread({
218
222
  mobileSize: 32,
219
223
  mobileLineHeight: "40px",
220
224
  desktopSize: 40,
221
225
  desktopLineHeight: "48px",
222
- weight: "light"
226
+ weight: textPresets.text8.weight
223
227
  }, props, {
224
228
  children: props.children
225
229
  }));
226
230
  };
227
231
  exports.Text8 = Text8;
228
232
  var Text7 = function Text7(props) {
233
+ var textPresets = (0, _hooks).useTheme().textPresets;
229
234
  return /*#__PURE__*/ (0, _jsxRuntime).jsx(Text, _objectSpread({
230
235
  mobileSize: 28,
231
236
  mobileLineHeight: "32px",
232
237
  desktopSize: 40,
233
238
  desktopLineHeight: "48px",
234
- weight: "light"
239
+ weight: textPresets.text7.weight
235
240
  }, props, {
236
241
  children: props.children
237
242
  }));
238
243
  };
239
244
  exports.Text7 = Text7;
240
245
  var Text6 = function Text6(props) {
246
+ var textPresets = (0, _hooks).useTheme().textPresets;
241
247
  return /*#__PURE__*/ (0, _jsxRuntime).jsx(Text, _objectSpread({
242
248
  mobileSize: 24,
243
249
  mobileLineHeight: "32px",
244
250
  desktopSize: 32,
245
251
  desktopLineHeight: "40px",
246
- weight: "light"
252
+ weight: textPresets.text6.weight
247
253
  }, props, {
248
254
  children: props.children
249
255
  }));
250
256
  };
251
257
  exports.Text6 = Text6;
252
258
  var Text5 = function Text5(props) {
259
+ var textPresets = (0, _hooks).useTheme().textPresets;
253
260
  return /*#__PURE__*/ (0, _jsxRuntime).jsx(Text, _objectSpread({
254
261
  mobileSize: 22,
255
262
  mobileLineHeight: "24px",
256
263
  desktopSize: 28,
257
264
  desktopLineHeight: "32px",
258
- weight: "light"
265
+ weight: textPresets.text5.weight
259
266
  }, props, {
260
267
  children: props.children
261
268
  }));
package/dist/text.js.flow CHANGED
@@ -1,8 +1,8 @@
1
1
  // @flow
2
2
 
3
3
  import * as React from "react";
4
+ import type { FontWeight } from "./skins/types";
4
5
  import type { DataAttributes } from "./utils/types";
5
- declare type FontWeight = "light" | "regular" | "medium";
6
6
  export type TextPresetProps = {
7
7
  color?: string,
8
8
  decoration?: "underline" | "line-through" | "inherit" | "none",
@@ -167,15 +167,35 @@ var useDefaultHrefDecorator = function useDefaultHrefDecorator() {
167
167
  return href;
168
168
  };
169
169
  };
170
+ var defaultTextPresetsConfig = {
171
+ text5: {
172
+ weight: "light"
173
+ },
174
+ text6: {
175
+ weight: "light"
176
+ },
177
+ text7: {
178
+ weight: "light"
179
+ },
180
+ text8: {
181
+ weight: "light"
182
+ },
183
+ text9: {
184
+ weight: "light"
185
+ },
186
+ text10: {
187
+ weight: "light"
188
+ }
189
+ };
170
190
  var ThemeContextProvider = function ThemeContextProvider(param) {
171
191
  var theme = param.theme, children = param.children, providerId = param.providerId;
172
- var ref = _slicedToArray(React.useState(function() {
192
+ var ref6 = _slicedToArray(React.useState(function() {
173
193
  if (providerId) {
174
194
  return providerId;
175
195
  } else {
176
196
  return (0, _environment).isServerSide() ? 0 : nextJssInstanceId++;
177
197
  }
178
- }), 1), instanceId = ref[0];
198
+ }), 1), instanceId = ref6[0];
179
199
  var classNamePrefix = React.useMemo(function() {
180
200
  return process.env.NODE_ENV === "test" ? "" : "mistica-".concat(_packageVersion.PACKAGE_VERSION.replace(/\./g, "-"), "_").concat(instanceId, "_");
181
201
  }, [
@@ -187,6 +207,7 @@ var ThemeContextProvider = function ThemeContextProvider(param) {
187
207
  }, []);
188
208
  var isOsDarkModeEnabled = useIsOsDarkModeEnabled();
189
209
  var contextTheme = React.useMemo(function() {
210
+ var ref, ref1, ref2, ref3, ref4, ref5;
190
211
  var _colorScheme;
191
212
  // TODO: In next major version we could change this to "auto" by default
192
213
  var colorScheme = (_colorScheme = theme.colorScheme) !== null && _colorScheme !== void 0 ? _colorScheme : "light";
@@ -213,6 +234,14 @@ var ThemeContextProvider = function ThemeContextProvider(param) {
213
234
  dimensions: _objectSpread({}, _theme.dimensions, theme.dimensions),
214
235
  mq: (0, _mediaQueries).createMediaQueries((_mediaQueries1 = theme.mediaQueries) !== null && _mediaQueries1 !== void 0 ? _mediaQueries1 : _theme.mediaQueriesConfig),
215
236
  colors: colors,
237
+ textPresets: {
238
+ text5: _objectSpread({}, defaultTextPresetsConfig.text5, (ref = theme.skin.textPresets) === null || ref === void 0 ? void 0 : ref.text5),
239
+ text6: _objectSpread({}, defaultTextPresetsConfig.text6, (ref1 = theme.skin.textPresets) === null || ref1 === void 0 ? void 0 : ref1.text6),
240
+ text7: _objectSpread({}, defaultTextPresetsConfig.text7, (ref2 = theme.skin.textPresets) === null || ref2 === void 0 ? void 0 : ref2.text7),
241
+ text8: _objectSpread({}, defaultTextPresetsConfig.text8, (ref3 = theme.skin.textPresets) === null || ref3 === void 0 ? void 0 : ref3.text8),
242
+ text9: _objectSpread({}, defaultTextPresetsConfig.text9, (ref4 = theme.skin.textPresets) === null || ref4 === void 0 ? void 0 : ref4.text9),
243
+ text10: _objectSpread({}, defaultTextPresetsConfig.text10, (ref5 = theme.skin.textPresets) === null || ref5 === void 0 ? void 0 : ref5.text10)
244
+ },
216
245
  Link: (_Link = theme.Link) !== null && _Link !== void 0 ? _Link : _theme.AnchorLink,
217
246
  isDarkMode: isDarkModeEnabled,
218
247
  isIos: (0, _platform).getPlatform(platformOverrides) === "ios",
package/dist/theme.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import type { RegionCode } from './utils/region-code';
3
3
  import type { Locale } from './utils/locale';
4
- import type { Skin, Colors, SkinName } from './skins/types';
4
+ import type { Skin, Colors, SkinName, TextPresetsConfig } from './skins/types';
5
5
  import type { TrackingEvent } from './utils/types';
6
6
  import type { MediaQueries } from './utils/media-queries';
7
7
  export declare type ThemeTexts = typeof TEXTS_ES;
@@ -127,6 +127,7 @@ export declare type Theme = {
127
127
  };
128
128
  mq: MediaQueries;
129
129
  colors: Colors;
130
+ textPresets: TextPresetsConfig;
130
131
  Link: LinkComponent;
131
132
  isDarkMode: boolean;
132
133
  isIos: boolean;
@@ -3,7 +3,7 @@
3
3
  import * as React from "react";
4
4
  import type { RegionCode } from "./utils/region-code";
5
5
  import type { Locale } from "./utils/locale";
6
- import type { Skin, Colors, SkinName } from "./skins/types";
6
+ import type { Skin, Colors, SkinName, TextPresetsConfig } from "./skins/types";
7
7
  import type { TrackingEvent } from "./utils/types";
8
8
  import type { MediaQueries } from "./utils/media-queries";
9
9
  export type ThemeTexts = typeof TEXTS_ES;
@@ -131,6 +131,7 @@ export type Theme = {
131
131
  },
132
132
  mq: MediaQueries,
133
133
  colors: Colors,
134
+ textPresets: TextPresetsConfig,
134
135
  Link: LinkComponent,
135
136
  isDarkMode: boolean,
136
137
  isIos: boolean,
package/dist/video.js CHANGED
@@ -115,7 +115,10 @@ var useStyles = (0, _jss).createUseStyles(function() {
115
115
  },
116
116
  "$wrapper &": {
117
117
  borderRadius: 0,
118
- position: "absolute",
118
+ position: function position(param) {
119
+ var aspectRatio = param.aspectRatio;
120
+ return aspectRatio ? "absolute" : "static";
121
+ },
119
122
  width: "100%",
120
123
  height: "100%",
121
124
  top: 0,
@@ -134,7 +137,7 @@ var useStyles = (0, _jss).createUseStyles(function() {
134
137
  paddingTop: function paddingTop(param) {
135
138
  var aspectRatio = param.aspectRatio, width = param.width;
136
139
  if (!aspectRatio) {
137
- return "initial";
140
+ return 0;
138
141
  }
139
142
  if (width && typeof width === "string" && width.endsWith("%")) {
140
143
  return "".concat(Number(width.replace("%", "")) / aspectRatio, "%");
@@ -146,7 +149,7 @@ var useStyles = (0, _jss).createUseStyles(function() {
146
149
  });
147
150
  /** Transparent 1x1px PNG */ var TRANSPARENT_PIXEL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC";
148
151
  var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
149
- 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, [
152
+ var src1 = _param.src, poster = _param.poster, _autoPlay = _param.autoPlay, autoPlay = _autoPlay === void 0 ? !(0, _platform).isRunningAcceptanceTest() : _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, [
150
153
  "src",
151
154
  "poster",
152
155
  "autoPlay",
@@ -213,7 +216,9 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
213
216
  autoPlay: autoPlay,
214
217
  muted: muted,
215
218
  loop: loop
216
- }, needsWrapper ? {} : {
219
+ }, needsWrapper ? {
220
+ width: "100%"
221
+ } : {
217
222
  width: width,
218
223
  height: height
219
224
  }, {
package/dist-es/image.js CHANGED
@@ -137,7 +137,11 @@ var useStyles = createUseStyles(function() {
137
137
  },
138
138
  "$wrapper &": {
139
139
  borderRadius: 0,
140
- position: "absolute",
140
+ position: function(param) {
141
+ var aspectRatio = param.aspectRatio;
142
+ return(// when aspectRatio is 0, we want the video to use the original aspect ratio
143
+ aspectRatio ? "absolute" : "static");
144
+ },
141
145
  width: "100%",
142
146
  height: "100%",
143
147
  top: 0,
@@ -160,7 +164,7 @@ var useStyles = createUseStyles(function() {
160
164
  paddingTop: function(param) {
161
165
  var aspectRatio = param.aspectRatio, width = param.width;
162
166
  if (!aspectRatio) {
163
- return "initial";
167
+ return 0;
164
168
  }
165
169
  if (width && typeof width === "string" && width.endsWith("%")) {
166
170
  return "".concat(Number(width.replace("%", "")) / aspectRatio, "%");
@@ -228,10 +232,12 @@ var Image = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
228
232
  setIsError(false);
229
233
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(event);
230
234
  }
231
- }, !needsWrapper ? {
235
+ }, needsWrapper ? {
236
+ width: "100%"
237
+ } : {
232
238
  width: width,
233
239
  height: height
234
- } : {}));
240
+ }));
235
241
  if (needsWrapper) {
236
242
  return /*#__PURE__*/ _jsx("div", {
237
243
  style: {
@@ -1,2 +1,2 @@
1
1
  // DO NOT EDIT THIS FILE. It's autogenerated by set-version.js
2
- export var PACKAGE_VERSION = "11.11.1";
2
+ export var PACKAGE_VERSION = "11.12.0";
package/dist-es/text.js CHANGED
@@ -33,6 +33,7 @@ import { createUseStyles } from "./jss";
33
33
  import { useIsInverseVariant } from "./theme-variant-context";
34
34
  import { pxToRem } from "./utils/css";
35
35
  import { getPrefixedDataAttributes } from "./utils/dom";
36
+ import { useTheme } from "./hooks";
36
37
  var useStyles = createUseStyles(function(theme) {
37
38
  var mapToWeight = {
38
39
  light: 300,
@@ -157,67 +158,73 @@ var getWeight = function(props) {
157
158
  return props.light && "light" || props.regular && "regular" || props.medium && "medium";
158
159
  };
159
160
  export var Text10 = function(props) {
161
+ var textPresets = useTheme().textPresets;
160
162
  return /*#__PURE__*/ _jsx(Text, _objectSpread({
161
163
  mobileSize: 32,
162
164
  mobileLineHeight: "40px",
163
165
  desktopSize: 64,
164
166
  desktopLineHeight: "72px",
165
- weight: "light"
167
+ weight: textPresets.text10.weight
166
168
  }, props, {
167
169
  children: props.children
168
170
  }));
169
171
  };
170
172
  export var Text9 = function(props) {
173
+ var textPresets = useTheme().textPresets;
171
174
  return /*#__PURE__*/ _jsx(Text, _objectSpread({
172
175
  mobileSize: 32,
173
176
  mobileLineHeight: "40px",
174
177
  desktopSize: 56,
175
178
  desktopLineHeight: "64px",
176
- weight: "light"
179
+ weight: textPresets.text9.weight
177
180
  }, props, {
178
181
  children: props.children
179
182
  }));
180
183
  };
181
184
  export var Text8 = function(props) {
185
+ var textPresets = useTheme().textPresets;
182
186
  return /*#__PURE__*/ _jsx(Text, _objectSpread({
183
187
  mobileSize: 32,
184
188
  mobileLineHeight: "40px",
185
189
  desktopSize: 40,
186
190
  desktopLineHeight: "48px",
187
- weight: "light"
191
+ weight: textPresets.text8.weight
188
192
  }, props, {
189
193
  children: props.children
190
194
  }));
191
195
  };
192
196
  export var Text7 = function(props) {
197
+ var textPresets = useTheme().textPresets;
193
198
  return /*#__PURE__*/ _jsx(Text, _objectSpread({
194
199
  mobileSize: 28,
195
200
  mobileLineHeight: "32px",
196
201
  desktopSize: 40,
197
202
  desktopLineHeight: "48px",
198
- weight: "light"
203
+ weight: textPresets.text7.weight
199
204
  }, props, {
200
205
  children: props.children
201
206
  }));
202
207
  };
203
208
  export var Text6 = function(props) {
209
+ var textPresets = useTheme().textPresets;
204
210
  return /*#__PURE__*/ _jsx(Text, _objectSpread({
205
211
  mobileSize: 24,
206
212
  mobileLineHeight: "32px",
207
213
  desktopSize: 32,
208
214
  desktopLineHeight: "40px",
209
- weight: "light"
215
+ weight: textPresets.text6.weight
210
216
  }, props, {
211
217
  children: props.children
212
218
  }));
213
219
  };
214
220
  export var Text5 = function(props) {
221
+ var textPresets = useTheme().textPresets;
215
222
  return /*#__PURE__*/ _jsx(Text, _objectSpread({
216
223
  mobileSize: 22,
217
224
  mobileLineHeight: "24px",
218
225
  desktopSize: 28,
219
226
  desktopLineHeight: "32px",
220
- weight: "light"
227
+ weight: textPresets.text5.weight
221
228
  }, props, {
222
229
  children: props.children
223
230
  }));
@@ -134,15 +134,35 @@ var useDefaultHrefDecorator = function() {
134
134
  return href;
135
135
  };
136
136
  };
137
+ var defaultTextPresetsConfig = {
138
+ text5: {
139
+ weight: "light"
140
+ },
141
+ text6: {
142
+ weight: "light"
143
+ },
144
+ text7: {
145
+ weight: "light"
146
+ },
147
+ text8: {
148
+ weight: "light"
149
+ },
150
+ text9: {
151
+ weight: "light"
152
+ },
153
+ text10: {
154
+ weight: "light"
155
+ }
156
+ };
137
157
  var ThemeContextProvider = function(param) {
138
158
  var theme = param.theme, children = param.children, providerId = param.providerId;
139
- var ref = _slicedToArray(React.useState(function() {
159
+ var ref6 = _slicedToArray(React.useState(function() {
140
160
  if (providerId) {
141
161
  return providerId;
142
162
  } else {
143
163
  return isServerSide() ? 0 : nextJssInstanceId++;
144
164
  }
145
- }), 1), instanceId = ref[0];
165
+ }), 1), instanceId = ref6[0];
146
166
  var classNamePrefix = React.useMemo(function() {
147
167
  return process.env.NODE_ENV === "test" ? "" : "mistica-".concat(PACKAGE_VERSION.replace(/\./g, "-"), "_").concat(instanceId, "_");
148
168
  }, [
@@ -154,6 +174,7 @@ var ThemeContextProvider = function(param) {
154
174
  }, []);
155
175
  var isOsDarkModeEnabled = useIsOsDarkModeEnabled();
156
176
  var contextTheme = React.useMemo(function() {
177
+ var ref, ref1, ref2, ref3, ref4, ref5;
157
178
  var _colorScheme;
158
179
  // TODO: In next major version we could change this to "auto" by default
159
180
  var colorScheme = (_colorScheme = theme.colorScheme) !== null && _colorScheme !== void 0 ? _colorScheme : "light";
@@ -180,6 +201,14 @@ var ThemeContextProvider = function(param) {
180
201
  dimensions: _objectSpread({}, dimensions, theme.dimensions),
181
202
  mq: createMediaQueries((_mediaQueries = theme.mediaQueries) !== null && _mediaQueries !== void 0 ? _mediaQueries : mediaQueriesConfig),
182
203
  colors: colors,
204
+ textPresets: {
205
+ text5: _objectSpread({}, defaultTextPresetsConfig.text5, (ref = theme.skin.textPresets) === null || ref === void 0 ? void 0 : ref.text5),
206
+ text6: _objectSpread({}, defaultTextPresetsConfig.text6, (ref1 = theme.skin.textPresets) === null || ref1 === void 0 ? void 0 : ref1.text6),
207
+ text7: _objectSpread({}, defaultTextPresetsConfig.text7, (ref2 = theme.skin.textPresets) === null || ref2 === void 0 ? void 0 : ref2.text7),
208
+ text8: _objectSpread({}, defaultTextPresetsConfig.text8, (ref3 = theme.skin.textPresets) === null || ref3 === void 0 ? void 0 : ref3.text8),
209
+ text9: _objectSpread({}, defaultTextPresetsConfig.text9, (ref4 = theme.skin.textPresets) === null || ref4 === void 0 ? void 0 : ref4.text9),
210
+ text10: _objectSpread({}, defaultTextPresetsConfig.text10, (ref5 = theme.skin.textPresets) === null || ref5 === void 0 ? void 0 : ref5.text10)
211
+ },
183
212
  Link: (_Link = theme.Link) !== null && _Link !== void 0 ? _Link : AnchorLink,
184
213
  isDarkMode: isDarkModeEnabled,
185
214
  isIos: getPlatform(platformOverrides) === "ios",
package/dist-es/video.js CHANGED
@@ -60,7 +60,7 @@ import { createUseStyles } from "./jss";
60
60
  import { useSupportsAspectRatio } from "./utils/aspect-ratio-support";
61
61
  import { combineRefs } from "./utils/common";
62
62
  import { getPrefixedDataAttributes } from "./utils/dom";
63
- import { isSafari } from "./utils/platform";
63
+ import { isRunningAcceptanceTest, isSafari } from "./utils/platform";
64
64
  export var RATIO = {
65
65
  "1:1": 1,
66
66
  "16:9": 16 / 9,
@@ -87,7 +87,11 @@ var useStyles = createUseStyles(function() {
87
87
  },
88
88
  "$wrapper &": {
89
89
  borderRadius: 0,
90
- position: "absolute",
90
+ position: function(param) {
91
+ var aspectRatio = param.aspectRatio;
92
+ return(// when aspectRatio is 0, we want the video to use the original aspect ratio
93
+ aspectRatio ? "absolute" : "static");
94
+ },
91
95
  width: "100%",
92
96
  height: "100%",
93
97
  top: 0,
@@ -106,7 +110,7 @@ var useStyles = createUseStyles(function() {
106
110
  paddingTop: function(param) {
107
111
  var aspectRatio = param.aspectRatio, width = param.width;
108
112
  if (!aspectRatio) {
109
- return "initial";
113
+ return 0;
110
114
  }
111
115
  if (width && typeof width === "string" && width.endsWith("%")) {
112
116
  return "".concat(Number(width.replace("%", "")) / aspectRatio, "%");
@@ -118,7 +122,7 @@ var useStyles = createUseStyles(function() {
118
122
  });
119
123
  /** Transparent 1x1px PNG */ var TRANSPARENT_PIXEL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC";
120
124
  var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
121
- 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, [
125
+ var src1 = _param.src, poster = _param.poster, _autoPlay = _param.autoPlay, autoPlay = _autoPlay === void 0 ? !isRunningAcceptanceTest() : _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, [
122
126
  "src",
123
127
  "poster",
124
128
  "autoPlay",
@@ -185,7 +189,9 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
185
189
  autoPlay: autoPlay,
186
190
  muted: muted,
187
191
  loop: loop
188
- }, needsWrapper ? {} : {
192
+ }, needsWrapper ? {
193
+ width: "100%"
194
+ } : {
189
195
  width: width,
190
196
  height: height
191
197
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telefonica/mistica",
3
- "version": "11.11.1",
3
+ "version": "11.12.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",