@telefonica/mistica 12.6.0 → 12.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/carousel.js +5 -3
- package/dist/fixed-footer-layout.js +31 -9
- package/dist/generated/mistica-icons/icon-buy-data-light.js +5 -11
- package/dist/generated/mistica-icons/icon-buy-data-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-eco-light.js +1 -1
- package/dist/generated/mistica-icons/icon-justice-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-tokens-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-tokens-filled.js +109 -0
- package/dist/generated/mistica-icons/icon-tokens-filled.js.flow +6 -0
- package/dist/generated/mistica-icons/icon-tokens-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-tokens-light.js +109 -0
- package/dist/generated/mistica-icons/icon-tokens-light.js.flow +6 -0
- package/dist/generated/mistica-icons/icon-tokens-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-tokens-regular.js +109 -0
- package/dist/generated/mistica-icons/icon-tokens-regular.js.flow +6 -0
- package/dist/hooks.d.ts +3 -0
- package/dist/hooks.js +16 -3
- package/dist/hooks.js.flow +3 -0
- package/dist/image.d.ts +2 -0
- package/dist/image.js +118 -80
- package/dist/image.js.flow +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/index.js.flow +3 -0
- package/dist/package-version.js +1 -1
- package/dist/skeletons.d.ts +5 -2
- package/dist/skeletons.js +50 -87
- package/dist/skeletons.js.flow +4 -4
- package/dist/skins/o2.js +1 -1
- package/dist/text-field-base.d.ts +0 -1
- package/dist/text-field-base.js +2 -0
- package/dist/text-field-base.js.flow +0 -1
- package/dist/text-field-components.d.ts +1 -0
- package/dist/text-field-components.js +7 -3
- package/dist/text-field-components.js.flow +1 -0
- package/dist/utils/aspect-ratio-support.d.ts +10 -0
- package/dist/utils/aspect-ratio-support.js +115 -1
- package/dist/utils/aspect-ratio-support.js.flow +14 -0
- package/dist/video.js +20 -79
- package/dist-es/carousel.js +5 -3
- package/dist-es/fixed-footer-layout.js +32 -10
- package/dist-es/generated/mistica-icons/icon-buy-data-light.js +6 -12
- package/dist-es/generated/mistica-icons/icon-buy-data-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-eco-light.js +1 -1
- package/dist-es/generated/mistica-icons/icon-justice-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-tokens-filled.js +85 -0
- package/dist-es/generated/mistica-icons/icon-tokens-light.js +85 -0
- package/dist-es/generated/mistica-icons/icon-tokens-regular.js +85 -0
- package/dist-es/hooks.js +14 -2
- package/dist-es/image.js +115 -83
- package/dist-es/index.js +3 -0
- package/dist-es/package-version.js +1 -1
- package/dist-es/skeletons.js +50 -87
- package/dist-es/skins/o2.js +1 -1
- package/dist-es/text-field-base.js +2 -0
- package/dist-es/text-field-components.js +7 -3
- package/dist-es/utils/aspect-ratio-support.js +112 -0
- package/dist-es/video.js +21 -81
- package/package.json +1 -1
package/dist/skins/o2.js
CHANGED
|
@@ -73,7 +73,7 @@ var getO2Skin = function getO2Skin() {
|
|
|
73
73
|
buttonDangerBackground: palette.pepper,
|
|
74
74
|
buttonDangerBackgroundSelected: palette.pepper60,
|
|
75
75
|
buttonDangerBackgroundHover: palette.pepper60,
|
|
76
|
-
buttonLinkBackgroundSelected: palette.
|
|
76
|
+
buttonLinkBackgroundSelected: palette.o2BluePrimary10,
|
|
77
77
|
buttonLinkBackgroundSelectedInverse: (0, _color).applyAlpha(palette.white, 0.2),
|
|
78
78
|
buttonPrimaryBackground: palette.o2BluePrimary,
|
|
79
79
|
buttonPrimaryBackgroundInverse: palette.white,
|
package/dist/text-field-base.js
CHANGED
|
@@ -205,6 +205,7 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
205
205
|
},
|
|
206
206
|
textArea: _objectSpread((_obj = {
|
|
207
207
|
resize: "none",
|
|
208
|
+
padding: 0,
|
|
208
209
|
marginTop: function marginTop(param) {
|
|
209
210
|
var hasLabel = param.hasLabel;
|
|
210
211
|
return hasLabel ? 28 : 16;
|
|
@@ -441,6 +442,7 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
441
442
|
multiline: multiline,
|
|
442
443
|
fullWidth: fullWidth,
|
|
443
444
|
fieldRef: fieldRef,
|
|
445
|
+
readOnly: rest.readOnly,
|
|
444
446
|
children: [
|
|
445
447
|
startIcon && /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
446
448
|
className: classes.startIcon,
|
|
@@ -297,15 +297,19 @@ var useFieldContainerStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
297
297
|
var multiline = param.multiline;
|
|
298
298
|
return multiline ? 152 : 56;
|
|
299
299
|
}
|
|
300
|
-
}), _defineProperty(_obj1, "display", "flex"), _defineProperty(_obj1, "position", "relative"), _defineProperty(_obj1, "backgroundColor",
|
|
300
|
+
}), _defineProperty(_obj1, "display", "flex"), _defineProperty(_obj1, "position", "relative"), _defineProperty(_obj1, "backgroundColor", function(param) {
|
|
301
|
+
var readOnly = param.readOnly;
|
|
302
|
+
return readOnly ? theme.colors.neutralLow : theme.colors.backgroundContainer;
|
|
303
|
+
}), _obj1)
|
|
301
304
|
};
|
|
302
305
|
});
|
|
303
306
|
var FieldContainer = function FieldContainer(param) {
|
|
304
|
-
var multiline = param.multiline, disabled = param.disabled, children = param.children, helperText = param.helperText, className = param.className, fieldRef = param.fieldRef, fullWidth = param.fullWidth;
|
|
307
|
+
var multiline = param.multiline, disabled = param.disabled, children = param.children, helperText = param.helperText, className = param.className, fieldRef = param.fieldRef, fullWidth = param.fullWidth, readOnly = param.readOnly;
|
|
305
308
|
var classes = useFieldContainerStyles({
|
|
306
309
|
multiline: multiline,
|
|
307
310
|
fullWidth: fullWidth,
|
|
308
|
-
disabled: disabled
|
|
311
|
+
disabled: disabled,
|
|
312
|
+
readOnly: readOnly
|
|
309
313
|
});
|
|
310
314
|
return /*#__PURE__*/ (0, _jsxRuntime).jsxs("div", {
|
|
311
315
|
className: classes.fieldContainer,
|
|
@@ -4,4 +4,14 @@ declare type Props = {
|
|
|
4
4
|
};
|
|
5
5
|
export declare const AspectRatioSupportProvider: React.FC<Props>;
|
|
6
6
|
export declare const useSupportsAspectRatio: () => boolean;
|
|
7
|
+
declare type AspectRatioElementProps = {
|
|
8
|
+
width?: number | string;
|
|
9
|
+
height?: number | string;
|
|
10
|
+
aspectRatio: number;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
as?: React.ComponentType<any> | string;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const AspectRatioElement: (props: AspectRatioElementProps) => JSX.Element;
|
|
7
17
|
export {};
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports.useSupportsAspectRatio = exports.AspectRatioSupportProvider = void 0;
|
|
5
|
+
exports.AspectRatioElement = exports.useSupportsAspectRatio = exports.AspectRatioSupportProvider = void 0;
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _hooks = require("../hooks");
|
|
9
|
+
var _jss = require("../jss");
|
|
9
10
|
function _interopRequireWildcard(obj) {
|
|
10
11
|
if (obj && obj.__esModule) {
|
|
11
12
|
return obj;
|
|
@@ -35,6 +36,19 @@ function _arrayLikeToArray(arr, len) {
|
|
|
35
36
|
function _arrayWithHoles(arr) {
|
|
36
37
|
if (Array.isArray(arr)) return arr;
|
|
37
38
|
}
|
|
39
|
+
function _defineProperty(obj, key, value) {
|
|
40
|
+
if (key in obj) {
|
|
41
|
+
Object.defineProperty(obj, key, {
|
|
42
|
+
value: value,
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
writable: true
|
|
46
|
+
});
|
|
47
|
+
} else {
|
|
48
|
+
obj[key] = value;
|
|
49
|
+
}
|
|
50
|
+
return obj;
|
|
51
|
+
}
|
|
38
52
|
function _iterableToArrayLimit(arr, i) {
|
|
39
53
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
40
54
|
if (_i == null) return;
|
|
@@ -62,6 +76,22 @@ function _iterableToArrayLimit(arr, i) {
|
|
|
62
76
|
function _nonIterableRest() {
|
|
63
77
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
64
78
|
}
|
|
79
|
+
function _objectSpread(target) {
|
|
80
|
+
var _arguments = arguments, _loop = function(i) {
|
|
81
|
+
var source = _arguments[i] != null ? _arguments[i] : {};
|
|
82
|
+
var ownKeys = Object.keys(source);
|
|
83
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
84
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
85
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
ownKeys.forEach(function(key) {
|
|
89
|
+
_defineProperty(target, key, source[key]);
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
for(var i = 1; i < arguments.length; i++)_loop(i);
|
|
93
|
+
return target;
|
|
94
|
+
}
|
|
65
95
|
function _slicedToArray(arr, i) {
|
|
66
96
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
67
97
|
}
|
|
@@ -98,3 +128,87 @@ var useSupportsAspectRatio = function useSupportsAspectRatio() {
|
|
|
98
128
|
return React.useContext(AspectRatioSupport);
|
|
99
129
|
};
|
|
100
130
|
exports.useSupportsAspectRatio = useSupportsAspectRatio;
|
|
131
|
+
var useAspectRatioStyles = (0, _jss).createUseStyles(function() {
|
|
132
|
+
return {
|
|
133
|
+
container: {
|
|
134
|
+
"@supports (aspect-ratio: 1 / 1)": {
|
|
135
|
+
aspectRatio: function aspectRatio(param) {
|
|
136
|
+
var aspectRatio1 = param.aspectRatio;
|
|
137
|
+
return aspectRatio1 !== null && aspectRatio1 !== void 0 ? aspectRatio1 : "unset";
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"$wrapper &": {
|
|
141
|
+
position: function position(param) {
|
|
142
|
+
var aspectRatio = param.aspectRatio;
|
|
143
|
+
return aspectRatio ? "absolute" : "static";
|
|
144
|
+
},
|
|
145
|
+
width: "100%",
|
|
146
|
+
height: "100%",
|
|
147
|
+
top: 0,
|
|
148
|
+
left: 0
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
wrapper: {
|
|
152
|
+
overflow: "hidden",
|
|
153
|
+
maxWidth: "100%",
|
|
154
|
+
maxHeight: "100%",
|
|
155
|
+
position: "relative",
|
|
156
|
+
paddingTop: function paddingTop(param) {
|
|
157
|
+
var aspectRatio = param.aspectRatio, width = param.width;
|
|
158
|
+
if (!aspectRatio) {
|
|
159
|
+
return 0;
|
|
160
|
+
}
|
|
161
|
+
if (width && typeof width === "string" && width.endsWith("%")) {
|
|
162
|
+
return "".concat(Number(width.replace("%", "")) / aspectRatio, "%");
|
|
163
|
+
}
|
|
164
|
+
return "".concat(100 / aspectRatio, "%");
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
var AspectRatioElement = function AspectRatioElement(props) {
|
|
170
|
+
var supportsAspectRatio = useSupportsAspectRatio();
|
|
171
|
+
// if width or height are numeric, we can calculate the other with the ratio without css.
|
|
172
|
+
// if aspect ratio is 0, we use the original image proportions
|
|
173
|
+
var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number" && props.aspectRatio !== 0;
|
|
174
|
+
var classes = useAspectRatioStyles({
|
|
175
|
+
aspectRatio: withCssAspectRatio ? props.aspectRatio : undefined,
|
|
176
|
+
width: props.width
|
|
177
|
+
});
|
|
178
|
+
var width = props.width;
|
|
179
|
+
var height = props.height;
|
|
180
|
+
if (props.width !== undefined && props.height !== undefined) {
|
|
181
|
+
width = props.width;
|
|
182
|
+
height = props.height;
|
|
183
|
+
} else if (typeof props.width === "number") {
|
|
184
|
+
height = props.aspectRatio !== 0 ? props.width / props.aspectRatio : undefined;
|
|
185
|
+
} else if (typeof props.height === "number") {
|
|
186
|
+
width = props.aspectRatio !== 0 ? props.height * props.aspectRatio : undefined;
|
|
187
|
+
} else {
|
|
188
|
+
width = props.width || "100%";
|
|
189
|
+
}
|
|
190
|
+
var needsWrapper = withCssAspectRatio && !supportsAspectRatio;
|
|
191
|
+
var _as;
|
|
192
|
+
var container = /*#__PURE__*/ React.createElement((_as = props.as) !== null && _as !== void 0 ? _as : "div", {
|
|
193
|
+
className: props.className ? "".concat(props.className, " ").concat(classes.container) : classes.container,
|
|
194
|
+
style: _objectSpread({}, needsWrapper ? _objectSpread({}, props.style, {
|
|
195
|
+
width: "100%"
|
|
196
|
+
}) : _objectSpread({}, props.style, {
|
|
197
|
+
width: width,
|
|
198
|
+
height: height
|
|
199
|
+
}))
|
|
200
|
+
}, props.children);
|
|
201
|
+
if (needsWrapper) {
|
|
202
|
+
return /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
203
|
+
style: {
|
|
204
|
+
width: width,
|
|
205
|
+
height: height
|
|
206
|
+
},
|
|
207
|
+
className: classes.wrapper,
|
|
208
|
+
children: container
|
|
209
|
+
});
|
|
210
|
+
} else {
|
|
211
|
+
return container;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
exports.AspectRatioElement = AspectRatioElement;
|
|
@@ -6,4 +6,18 @@ declare type Props = {
|
|
|
6
6
|
};
|
|
7
7
|
declare export var AspectRatioSupportProvider: React.ComponentType<Props>;
|
|
8
8
|
declare export var useSupportsAspectRatio: () => boolean;
|
|
9
|
+
declare type AspectRatioElementProps = {
|
|
10
|
+
width?: number | string,
|
|
11
|
+
height?: number | string,
|
|
12
|
+
aspectRatio: number,
|
|
13
|
+
children: React.Node,
|
|
14
|
+
as?: React.ComponentType<any> | string,
|
|
15
|
+
style?: CssStyle,
|
|
16
|
+
className?: string,
|
|
17
|
+
};
|
|
18
|
+
declare export var AspectRatioElement: (
|
|
19
|
+
props: AspectRatioElementProps
|
|
20
|
+
) => React.Node;
|
|
9
21
|
declare export {};
|
|
22
|
+
|
|
23
|
+
import { type CssStyle } from "../__css_types__.js.flow";
|
package/dist/video.js
CHANGED
|
@@ -98,44 +98,13 @@ exports.RATIO = RATIO;
|
|
|
98
98
|
var useStyles = (0, _jss).createUseStyles(function() {
|
|
99
99
|
return {
|
|
100
100
|
video: {
|
|
101
|
+
width: "100%",
|
|
102
|
+
height: "100%",
|
|
101
103
|
background: "transparent",
|
|
102
104
|
display: "block",
|
|
103
105
|
objectFit: "cover",
|
|
104
106
|
maxWidth: "100%",
|
|
105
|
-
maxHeight: "100%"
|
|
106
|
-
"@supports (aspect-ratio: 1 / 1)": {
|
|
107
|
-
aspectRatio: function aspectRatio(param) {
|
|
108
|
-
var aspectRatio1 = param.aspectRatio;
|
|
109
|
-
return aspectRatio1 !== null && aspectRatio1 !== void 0 ? aspectRatio1 : "unset";
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
"$wrapper &": {
|
|
113
|
-
borderRadius: 0,
|
|
114
|
-
position: function position(param) {
|
|
115
|
-
var aspectRatio = param.aspectRatio;
|
|
116
|
-
return aspectRatio ? "absolute" : "static";
|
|
117
|
-
},
|
|
118
|
-
width: "100%",
|
|
119
|
-
height: "100%",
|
|
120
|
-
top: 0,
|
|
121
|
-
left: 0
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
wrapper: {
|
|
125
|
-
overflow: "hidden",
|
|
126
|
-
maxWidth: "100%",
|
|
127
|
-
maxHeight: "100%",
|
|
128
|
-
position: "relative",
|
|
129
|
-
paddingTop: function paddingTop(param) {
|
|
130
|
-
var aspectRatio = param.aspectRatio, width = param.width;
|
|
131
|
-
if (!aspectRatio) {
|
|
132
|
-
return 0;
|
|
133
|
-
}
|
|
134
|
-
if (width && typeof width === "string" && width.endsWith("%")) {
|
|
135
|
-
return "".concat(Number(width.replace("%", "")) / aspectRatio, "%");
|
|
136
|
-
}
|
|
137
|
-
return "".concat(100 / aspectRatio, "%");
|
|
138
|
-
}
|
|
107
|
+
maxHeight: "100%"
|
|
139
108
|
}
|
|
140
109
|
};
|
|
141
110
|
});
|
|
@@ -151,16 +120,9 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
151
120
|
"aspectRatio",
|
|
152
121
|
"dataAttributes"
|
|
153
122
|
]);
|
|
154
|
-
var supportsAspectRatio = (0, _aspectRatioSupport).useSupportsAspectRatio();
|
|
155
123
|
var noBorderRadius = (0, _image).useDisableBorderRadius();
|
|
156
124
|
var ratio = typeof aspectRatio === "number" ? aspectRatio : RATIO[aspectRatio];
|
|
157
|
-
|
|
158
|
-
// if aspect ratio is 0, we use the original video proportions
|
|
159
|
-
var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number" && ratio !== 0;
|
|
160
|
-
var classes = useStyles({
|
|
161
|
-
aspectRatio: withCssAspectRatio ? ratio : undefined,
|
|
162
|
-
width: props.width
|
|
163
|
-
});
|
|
125
|
+
var classes = useStyles();
|
|
164
126
|
var videoRef = React.useRef(null);
|
|
165
127
|
React.useEffect(function() {
|
|
166
128
|
var video = videoRef.current;
|
|
@@ -182,23 +144,6 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
182
144
|
return source;
|
|
183
145
|
}
|
|
184
146
|
});
|
|
185
|
-
var width = props.width;
|
|
186
|
-
var height = props.height;
|
|
187
|
-
if (props.width !== undefined && props.height !== undefined) {
|
|
188
|
-
width = props.width;
|
|
189
|
-
height = props.height;
|
|
190
|
-
} else if (typeof props.width === "number") {
|
|
191
|
-
height = ratio ? props.width / ratio : undefined;
|
|
192
|
-
} else if (typeof props.height === "number") {
|
|
193
|
-
width = ratio ? props.height * ratio : undefined;
|
|
194
|
-
} else {
|
|
195
|
-
width = props.width || "100%";
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* In safari, when using a video with poster, the transition from pause to play does a flicker,
|
|
199
|
-
* To avoid this, in Safari browsers, instead of using the poster attribute, we use a
|
|
200
|
-
* wrapper with the poster as background image
|
|
201
|
-
*/ var needsWrapper = (0, _platform).isSafari() || withCssAspectRatio && !supportsAspectRatio;
|
|
202
147
|
var video1 = /*#__PURE__*/ (0, _jsxRuntime).jsx("video", _objectSpread({
|
|
203
148
|
ref: (0, _common).combineRefs(ref, videoRef),
|
|
204
149
|
playsInline: true,
|
|
@@ -206,13 +151,7 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
206
151
|
disableRemotePlayback: true,
|
|
207
152
|
autoPlay: autoPlay,
|
|
208
153
|
muted: muted,
|
|
209
|
-
loop: loop
|
|
210
|
-
}, needsWrapper ? {
|
|
211
|
-
width: "100%"
|
|
212
|
-
} : {
|
|
213
|
-
width: width,
|
|
214
|
-
height: height
|
|
215
|
-
}, {
|
|
154
|
+
loop: loop,
|
|
216
155
|
className: classes.video,
|
|
217
156
|
preload: preload,
|
|
218
157
|
// This transparent pixel fallback avoids showing the ugly "play" image in android webviews
|
|
@@ -230,23 +169,25 @@ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
230
169
|
}, index);
|
|
231
170
|
})
|
|
232
171
|
}));
|
|
233
|
-
|
|
234
|
-
|
|
172
|
+
return /*#__PURE__*/ (0, _jsxRuntime).jsx(_aspectRatioSupport.AspectRatioElement, {
|
|
173
|
+
aspectRatio: ratio,
|
|
174
|
+
width: props.width,
|
|
175
|
+
height: props.height,
|
|
176
|
+
children: (0, _platform).isSafari() ? /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
235
177
|
style: {
|
|
236
|
-
width:
|
|
237
|
-
height:
|
|
238
|
-
|
|
239
|
-
|
|
178
|
+
width: "100%",
|
|
179
|
+
height: "100%",
|
|
180
|
+
/**
|
|
181
|
+
* In safari, when using a video with poster, the transition from pause to play does a flicker,
|
|
182
|
+
* To avoid this, in Safari browsers, instead of using the poster attribute, we use a
|
|
183
|
+
* wrapper with the poster as background image
|
|
184
|
+
*/ backgroundImage: poster ? 'url("'.concat(poster, '")') : undefined,
|
|
240
185
|
backgroundSize: "cover",
|
|
241
|
-
backgroundPosition: "50% 50%"
|
|
242
|
-
borderRadius: noBorderRadius ? 0 : 8
|
|
186
|
+
backgroundPosition: "50% 50%"
|
|
243
187
|
},
|
|
244
|
-
className: classes.wrapper,
|
|
245
188
|
children: video1
|
|
246
|
-
})
|
|
247
|
-
}
|
|
248
|
-
return video1;
|
|
249
|
-
}
|
|
189
|
+
}) : video1
|
|
190
|
+
});
|
|
250
191
|
});
|
|
251
192
|
var _default = Video;
|
|
252
193
|
exports.default = _default;
|
package/dist-es/carousel.js
CHANGED
|
@@ -118,6 +118,7 @@ var useBulletsStyles = createUseStyles(function(theme) {
|
|
|
118
118
|
height: 8,
|
|
119
119
|
borderRadius: "50%",
|
|
120
120
|
transition: "transform 0.3s ease-in-out, background-color 0.3s ease-in-out",
|
|
121
|
+
zIndex: 2,
|
|
121
122
|
"&.active": {
|
|
122
123
|
backgroundColor: function(param) {
|
|
123
124
|
var isInverse = param.isInverse;
|
|
@@ -209,7 +210,7 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
209
210
|
},
|
|
210
211
|
arrowButton: _objectSpread({}, arrowButtonStyle(theme), {
|
|
211
212
|
position: "absolute",
|
|
212
|
-
zIndex:
|
|
213
|
+
zIndex: 2,
|
|
213
214
|
top: "calc(50% - ".concat(arrowButtonSize / 2, "px)"),
|
|
214
215
|
"&.prev": {
|
|
215
216
|
left: function(param) {
|
|
@@ -683,7 +684,7 @@ var useSlideshowStyles = createUseStyles(function(theme) {
|
|
|
683
684
|
arrowButton: _objectSpread({}, arrowButtonStyle(theme), {
|
|
684
685
|
border: "none",
|
|
685
686
|
position: "absolute",
|
|
686
|
-
zIndex:
|
|
687
|
+
zIndex: 2,
|
|
687
688
|
top: "calc(50% - ".concat(arrowButtonSize / 2, "px)"),
|
|
688
689
|
"&.prev": _defineProperty({
|
|
689
690
|
left: 24
|
|
@@ -701,7 +702,8 @@ var useSlideshowStyles = createUseStyles(function(theme) {
|
|
|
701
702
|
bottom: 24,
|
|
702
703
|
display: "flex",
|
|
703
704
|
justifyContent: "center",
|
|
704
|
-
width: "100%"
|
|
705
|
+
width: "100%",
|
|
706
|
+
zIndex: 2
|
|
705
707
|
}
|
|
706
708
|
};
|
|
707
709
|
});
|
|
@@ -63,8 +63,9 @@ import classnames from "classnames";
|
|
|
63
63
|
import debounce from "lodash/debounce";
|
|
64
64
|
import { createUseStyles } from "./jss";
|
|
65
65
|
import { isRunningAcceptanceTest } from "./utils/platform";
|
|
66
|
-
import { useElementDimensions, useIsomorphicLayoutEffect, useScreenSize, useTheme } from "./hooks";
|
|
66
|
+
import { useElementDimensions, useIsomorphicLayoutEffect, useScreenHeight, useScreenSize, useTheme, useWindowHeight } from "./hooks";
|
|
67
67
|
import { addPassiveEventListener, getScrollableParentElement, getScrollDistanceToBottom, hasScroll, removePassiveEventListener } from "./utils/dom";
|
|
68
|
+
var FOOTER_CANVAS_RATIO = 2;
|
|
68
69
|
var getScrollEventTarget = function(el) {
|
|
69
70
|
return el === document.documentElement ? window : el;
|
|
70
71
|
};
|
|
@@ -91,8 +92,8 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
91
92
|
},
|
|
92
93
|
containerSmall: {
|
|
93
94
|
paddingBottom: function(param) {
|
|
94
|
-
var
|
|
95
|
-
return
|
|
95
|
+
var footerHeight = param.footerHeight;
|
|
96
|
+
return footerHeight;
|
|
96
97
|
},
|
|
97
98
|
backgroundColor: function(param) {
|
|
98
99
|
var containerBgColor = param.containerBgColor;
|
|
@@ -100,8 +101,17 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
}, theme.mq.tabletOrSmaller, {
|
|
104
|
+
containerSmall: {
|
|
105
|
+
paddingBottom: function(param) {
|
|
106
|
+
var footerHeight = param.footerHeight, isContentWithScroll = param.isContentWithScroll, hasContentEnoughVSpace = param.hasContentEnoughVSpace;
|
|
107
|
+
return hasContentEnoughVSpace || !isContentWithScroll ? footerHeight : 0;
|
|
108
|
+
}
|
|
109
|
+
},
|
|
103
110
|
footer: {
|
|
104
|
-
position:
|
|
111
|
+
position: function(param) {
|
|
112
|
+
var hasContentEnoughVSpace = param.hasContentEnoughVSpace, isContentWithScroll = param.isContentWithScroll;
|
|
113
|
+
return hasContentEnoughVSpace || !isContentWithScroll ? "fixed" : "initial";
|
|
114
|
+
},
|
|
105
115
|
left: 0,
|
|
106
116
|
bottom: 0,
|
|
107
117
|
zIndex: 1
|
|
@@ -117,12 +127,18 @@ var FixedFooterLayout = function(param) {
|
|
|
117
127
|
var containerRef = React.useRef(null);
|
|
118
128
|
var isTabletOrSmaller = useScreenSize().isTabletOrSmaller;
|
|
119
129
|
var platformOverrides = useTheme().platformOverrides;
|
|
120
|
-
var ref1 = useElementDimensions(),
|
|
130
|
+
var ref1 = useElementDimensions(), realFooterHeight = ref1.height, ref2 = ref1.ref;
|
|
131
|
+
var windowHeight = useWindowHeight();
|
|
132
|
+
var screenHeight = useScreenHeight();
|
|
133
|
+
var hasContentEnoughVSpace = windowHeight - realFooterHeight > screenHeight / FOOTER_CANVAS_RATIO;
|
|
134
|
+
var hasContentScroll = function() {
|
|
135
|
+
return hasScroll(getScrollableParentElement(containerRef.current));
|
|
136
|
+
};
|
|
121
137
|
useIsomorphicLayoutEffect(function() {
|
|
122
|
-
onChangeFooterHeight === null || onChangeFooterHeight === void 0 ? void 0 : onChangeFooterHeight(
|
|
138
|
+
onChangeFooterHeight === null || onChangeFooterHeight === void 0 ? void 0 : onChangeFooterHeight(realFooterHeight);
|
|
123
139
|
}, [
|
|
124
140
|
onChangeFooterHeight,
|
|
125
|
-
|
|
141
|
+
realFooterHeight
|
|
126
142
|
]);
|
|
127
143
|
React.useEffect(function() {
|
|
128
144
|
var scrollable = getScrollableParentElement(containerRef.current);
|
|
@@ -130,6 +146,9 @@ var FixedFooterLayout = function(param) {
|
|
|
130
146
|
if (isRunningAcceptanceTest(platformOverrides)) {
|
|
131
147
|
return false;
|
|
132
148
|
}
|
|
149
|
+
if (!hasContentEnoughVSpace) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
133
152
|
if (hasScroll(scrollable)) {
|
|
134
153
|
return getScrollDistanceToBottom(scrollable) > 1; // This is 1 and not 0 because a weird bug with Safari
|
|
135
154
|
}
|
|
@@ -152,14 +171,17 @@ var FixedFooterLayout = function(param) {
|
|
|
152
171
|
transitionAwaiter.cancel();
|
|
153
172
|
};
|
|
154
173
|
}, [
|
|
155
|
-
|
|
156
|
-
containerRef,
|
|
174
|
+
hasContentEnoughVSpace,
|
|
157
175
|
platformOverrides
|
|
158
176
|
]);
|
|
159
177
|
var classes = useStyles({
|
|
160
178
|
footerBgColor: footerBgColor,
|
|
161
179
|
containerBgColor: containerBgColor,
|
|
162
|
-
|
|
180
|
+
footerHeight: realFooterHeight,
|
|
181
|
+
windowHeight: windowHeight,
|
|
182
|
+
screenHeight: screenHeight,
|
|
183
|
+
isContentWithScroll: hasContentScroll(),
|
|
184
|
+
hasContentEnoughVSpace: hasContentEnoughVSpace
|
|
163
185
|
});
|
|
164
186
|
var _obj;
|
|
165
187
|
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
@@ -53,7 +53,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
53
53
|
}
|
|
54
54
|
return target;
|
|
55
55
|
}
|
|
56
|
-
import { jsx as _jsx
|
|
56
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
57
57
|
/*
|
|
58
58
|
* This file was autogenerated. Don't edit this file!
|
|
59
59
|
*
|
|
@@ -70,22 +70,16 @@ var IconBuyDataLight = function(_param) {
|
|
|
70
70
|
var colors = useTheme().colors;
|
|
71
71
|
var isInverse = useIsInverseVariant();
|
|
72
72
|
var fillColor = color !== null && color !== void 0 ? color : isInverse ? colors.inverse : colors.neutralHigh;
|
|
73
|
-
return /*#__PURE__*/
|
|
73
|
+
return /*#__PURE__*/ _jsx("svg", _objectSpread({
|
|
74
74
|
width: size,
|
|
75
75
|
height: size,
|
|
76
76
|
viewBox: "0 0 24 24",
|
|
77
77
|
role: "presentation"
|
|
78
78
|
}, rest, {
|
|
79
|
-
children:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}),
|
|
84
|
-
/*#__PURE__*/ _jsx("path", {
|
|
85
|
-
d: "M11.201 5.599v.003c0 .039.134.238.754.423.588.176 1.378.274 2.224.274.846 0 1.633-.098 2.224-.274.622-.188.753-.387.753-.426h-5.955zm0 0a.281.281 0 00-.28-.277.281.281 0 00-.28.277h.56zm-.571 16.235c-.871 0-1.373-.501-1.373-1.372 0-.872.502-1.373 1.373-1.373.87 0 1.372.501 1.372 1.373 0 .87-.498 1.372-1.372 1.372zm-.813-1.372c0 .563.25.812.813.812s.812-.25.812-.812c0-.564-.25-.813-.812-.813-.563 0-.813.25-.813.813zm6.275 1.372c-.871 0-1.373-.501-1.373-1.372 0-.872.502-1.373 1.373-1.373s1.372.501 1.372 1.373c0 .87-.498 1.372-1.372 1.372zm-.812-1.372c0 .563.249.812.812.812.563 0 .812-.25.812-.812 0-.564-.25-.813-.812-.813-.563 0-.812.25-.812.813z",
|
|
86
|
-
fill: fillColor
|
|
87
|
-
})
|
|
88
|
-
]
|
|
79
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
80
|
+
d: "M17.274 17.004h-6.662c-.777 0-1.466-.26-1.987-.752-.555-.524-.914-1.284-1.07-2.263C7.408 13.075 6.05 4.909 5.888 4a1.637 1.637 0 00-.65-1.013 2.138 2.138 0 00-1.289-.419H2.285A.286.286 0 012 2.285C2 2.128 2.128 2 2.285 2H3.95a2.72 2.72 0 011.634.532c.464.348.772.835.869 1.37.058.325.269 1.577.522 3.094h3.649V5.5c0-.88 1.864-1.281 3.595-1.281s3.596.401 3.596 1.28V7h3.9a.286.286 0 01.276.356l-.398 1.596-.37 1.482a623.86 623.86 0 01-.897 3.587c-.256.99-.626 1.717-1.125 2.218-.515.506-1.161.766-1.927.766zm.54-9.435v5.879c0 .88-1.861 1.278-3.595 1.278-1.73 0-3.595-.401-3.595-1.281v-5.88H7.07c.44 2.636.963 5.788 1.048 6.335.256 1.634 1.145 2.537 2.494 2.537h6.662c.618 0 1.116-.2 1.523-.606.421-.422.749-1.08.977-1.956.075-.29.259-1.027.481-1.918.13-.522.273-1.097.416-1.664l.015-.064.002-.006c.256-1.028.499-2.006.663-2.654h-3.536zm-3.355 4.507l-.24.002h-.028c-1.133-.003-2.318-.176-2.998-.543v1.913c0 .04.136.242.766.43.598.179 1.4.279 2.26.279.86 0 1.66-.1 2.26-.28.633-.19.767-.392.767-.43v-1.912c-.636.344-1.72.518-2.787.54zm2.787-1.276V8.887c-.64.346-1.73.52-2.803.541l-.224.003c-.83 0-1.688-.092-2.36-.285a3.353 3.353 0 01-.666-.261v1.912c0 .04.136.242.766.43.598.182 1.4.282 2.26.282.86 0 1.66-.1 2.26-.28.633-.19.767-.392.767-.429zm0-4.56c-.684.37-1.885.543-3.027.543-1.141 0-2.34-.177-3.026-.547V8.15c0 .04.136.242.766.43.598.18 1.4.282 2.26.282.86 0 1.66-.1 2.26-.279.633-.19.767-.393.767-.43V6.24zm0-.741c0-.04-.137-.242-.766-.433-.601-.176-1.401-.276-2.26-.276-.858 0-1.66.1-2.261.279-.63.19-.766.393-.766.433 0 .04.136.242.766.43.598.179 1.4.279 2.26.279.86 0 1.66-.1 2.26-.28.633-.19.767-.392.767-.432zM10.612 22c-.885 0-1.395-.51-1.395-1.395s.51-1.395 1.395-1.395c.886 0 1.395.51 1.395 1.395S11.5 22 10.612 22zm0-2.22c-.572 0-.826.253-.826.825s.254.826.826.826.826-.254.826-.826-.254-.826-.826-.826zM16.164 22c-.886 0-1.395-.51-1.395-1.395s.51-1.395 1.395-1.395 1.395.51 1.395 1.395S17.052 22 16.164 22zm0-2.22c-.573 0-.826.253-.826.825s.254.826.826.826.825-.254.825-.826-.253-.826-.825-.826z",
|
|
81
|
+
fill: fillColor
|
|
82
|
+
})
|
|
89
83
|
}));
|
|
90
84
|
};
|
|
91
85
|
export default IconBuyDataLight;
|
|
@@ -77,7 +77,7 @@ var IconBuyDataRegular = function(_param) {
|
|
|
77
77
|
role: "presentation"
|
|
78
78
|
}, rest, {
|
|
79
79
|
children: /*#__PURE__*/ _jsx("path", {
|
|
80
|
-
d: "M16.
|
|
80
|
+
d: "M16.974 17.285H10.61c-.852 0-1.607-.288-2.185-.83-.602-.566-.992-1.384-1.157-2.43-.131-.834-1.476-8.638-1.664-9.689-.123-.684-.835-1.196-1.661-1.196H2.57A.571.571 0 012 2.57c0-.314.256-.57.57-.57h1.376c1.39 0 2.561.897 2.783 2.137.05.277.226 1.289.446 2.564h3.304V5.49a.442.442 0 01.002-.063c.034-.455.46-.81 1.271-1.054.664-.2 1.541-.31 2.464-.31.924 0 1.801.11 2.465.31.765.23 1.188.56 1.262.978a.43.43 0 01.017.139v1.214h3.459a.571.571 0 01.552.71l-.443 1.77a2593.494 2593.494 0 01-.67 2.684c-.253 1.02-.47 1.89-.556 2.215-.27 1.042-.664 1.809-1.202 2.347-.567.567-1.282.855-2.126.855zm.986-9.442v5.596c0 .484-.427.86-1.273 1.114-.664.202-1.542.31-2.468.31-.926 0-1.8-.11-2.467-.31-.846-.254-1.273-.63-1.273-1.114V7.84H7.372c.435 2.524.942 5.476 1.027 6.009.125.79.396 1.385.812 1.778.364.345.837.521 1.402.521h6.361c.695 0 1.681-.242 2.225-2.35.078-.3.273-1.08.506-2.013l.392-1.569.143-.572c.166-.67.323-1.298.45-1.8h-2.73zm-.886-2.356c-.077-.068-.288-.208-.809-.345-.564-.145-1.29-.225-2.046-.225-.755 0-1.481.08-2.045.225-.522.137-.732.277-.81.345.058.051.19.143.47.243.095.033.207.068.34.102.564.145 1.29.225 2.045.225.755 0 1.482-.08 2.046-.225.522-.135.733-.277.809-.345zm-5.735.967l-.006 1.651c.034.043.211.214.84.376.565.146 1.291.226 2.046.226.755 0 1.482-.08 2.046-.226.63-.162.806-.336.84-.376V6.453a4.303 4.303 0 01-.418.151c-.664.2-1.542.31-2.465.31-.923 0-1.8-.11-2.464-.31a3.96 3.96 0 01-.419-.15zm.413 2.8a3.925 3.925 0 01-.416-.15l-.003 1.651c.034.043.211.214.84.376.565.145 1.291.225 2.046.225.755 0 1.482-.08 2.046-.225.63-.162.806-.336.84-.376V9.104a3.924 3.924 0 01-.418.15 5.48 5.48 0 01-.259.07c-.625.155-1.398.24-2.206.24h-.003c-.926 0-1.8-.111-2.467-.31zm-.419 4.156c.037.043.217.214.84.376.565.146 1.291.225 2.046.225.755 0 1.482-.08 2.046-.225.624-.16.803-.33.84-.376v-1.655a4.314 4.314 0 01-.418.151c-.664.2-1.542.31-2.465.31-.923 0-1.8-.11-2.467-.31a4.314 4.314 0 01-.419-.151l-.003 1.655zM10.61 22c-.51 0-.918-.145-1.214-.43-.31-.3-.467-.718-.467-1.25 0-.534.156-.953.467-1.252.296-.285.707-.43 1.214-.43s.917.145 1.213.43c.31.3.468.718.468 1.251 0 .533-.157.952-.468 1.25-.293.286-.703.431-1.213.431zm0-2.222c-.416 0-.542.125-.542.541 0 .416.126.541.542.541.416 0 .541-.125.541-.54 0-.417-.125-.542-.541-.542zM16.165 22c-.51 0-.917-.145-1.213-.43-.311-.3-.468-.718-.468-1.25 0-.534.157-.953.468-1.252.296-.285.706-.43 1.213-.43.507 0 .918.145 1.214.43.308.3.467.718.467 1.251 0 .533-.157.952-.467 1.25-.294.286-.704.431-1.214.431zm0-2.222c-.416 0-.541.125-.541.541 0 .416.125.541.541.541.416 0 .542-.125.542-.54 0-.417-.126-.542-.542-.542z",
|
|
81
81
|
fill: fillColor
|
|
82
82
|
})
|
|
83
83
|
}));
|
|
@@ -96,7 +96,7 @@ var IconEcoLight = function(_param) {
|
|
|
96
96
|
role: "presentation"
|
|
97
97
|
}, rest, {
|
|
98
98
|
children: /*#__PURE__*/ _jsx("path", {
|
|
99
|
-
d: "
|
|
99
|
+
d: "M3.437 3.002c-.79.003-1.434.65-1.437 1.44v3.265c0 .02.002.04.006.059.053 1.318.447 2.341 1.177 3.043.756.727 1.856 1.097 3.267 1.097 1.38 0 2.459-.351 3.21-1.045.278.547.521 1.151.728 1.812.718 2.295.858 4.773.95 6.412l.002.043c.036.621.064 1.113.117 1.437a.272.272 0 00.228.225c.014.003.028.003.043.003a.272.272 0 00.265-.228c.332-2.039.973-4.861 2.165-7.133.047.05.095.1.144.148.753.727 1.85 1.095 3.259 1.095 1.411 0 2.506-.368 3.256-1.095.725-.696 1.118-1.709 1.173-3.016a.256.256 0 00.01-.075V7.225c0-.784-.642-1.423-1.425-1.426H17.56c-1.409 0-2.506.368-3.259 1.095-.781.756-1.177 1.879-1.177 3.344 0 1.108.227 2.023.677 2.729-.253.459-.491.957-.714 1.49-.59 1.414-.985 2.86-1.243 4.011-.131-2.182-.42-5.452-1.794-8.036.562-.736.844-1.734.844-2.973 0-1.472-.399-2.598-1.183-3.356-.755-.73-1.851-1.1-3.26-1.1a371.8 371.8 0 00-3.015 0zm-.873 4.454V4.442a.88.88 0 01.873-.875h3.01c2.578 0 3.884 1.309 3.884 3.889 0 1.003-.198 1.815-.592 2.431-.801-1.294-1.916-2.365-3.477-2.962a.272.272 0 00-.194.508c1.368.522 2.474 1.497 3.309 2.91-.649.664-1.627.999-2.93.999-2.577 0-3.883-1.309-3.883-3.886zm11.097 2.782c0-2.591 1.311-3.903 3.9-3.903h3.016a.898.898 0 01.89.89v2.958a.266.266 0 00-.006.055c0 2.59-1.311 3.9-3.9 3.9-1.438 0-2.482-.404-3.125-1.207.972-1.662 2.274-2.946 4.015-3.263a.27.27 0 00-.098-.53c-1.197.216-2.283.864-3.23 1.924a9.646 9.646 0 00-1.01 1.37c-.301-.583-.452-1.315-.452-2.194z",
|
|
100
100
|
fill: fillColor
|
|
101
101
|
})
|
|
102
102
|
}));
|