@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.
Files changed (59) hide show
  1. package/dist/carousel.js +5 -3
  2. package/dist/fixed-footer-layout.js +31 -9
  3. package/dist/generated/mistica-icons/icon-buy-data-light.js +5 -11
  4. package/dist/generated/mistica-icons/icon-buy-data-regular.js +1 -1
  5. package/dist/generated/mistica-icons/icon-eco-light.js +1 -1
  6. package/dist/generated/mistica-icons/icon-justice-regular.js +1 -1
  7. package/dist/generated/mistica-icons/icon-tokens-filled.d.ts +4 -0
  8. package/dist/generated/mistica-icons/icon-tokens-filled.js +109 -0
  9. package/dist/generated/mistica-icons/icon-tokens-filled.js.flow +6 -0
  10. package/dist/generated/mistica-icons/icon-tokens-light.d.ts +4 -0
  11. package/dist/generated/mistica-icons/icon-tokens-light.js +109 -0
  12. package/dist/generated/mistica-icons/icon-tokens-light.js.flow +6 -0
  13. package/dist/generated/mistica-icons/icon-tokens-regular.d.ts +4 -0
  14. package/dist/generated/mistica-icons/icon-tokens-regular.js +109 -0
  15. package/dist/generated/mistica-icons/icon-tokens-regular.js.flow +6 -0
  16. package/dist/hooks.d.ts +3 -0
  17. package/dist/hooks.js +16 -3
  18. package/dist/hooks.js.flow +3 -0
  19. package/dist/image.d.ts +2 -0
  20. package/dist/image.js +118 -80
  21. package/dist/image.js.flow +2 -0
  22. package/dist/index.d.ts +3 -0
  23. package/dist/index.js +21 -0
  24. package/dist/index.js.flow +3 -0
  25. package/dist/package-version.js +1 -1
  26. package/dist/skeletons.d.ts +5 -2
  27. package/dist/skeletons.js +50 -87
  28. package/dist/skeletons.js.flow +4 -4
  29. package/dist/skins/o2.js +1 -1
  30. package/dist/text-field-base.d.ts +0 -1
  31. package/dist/text-field-base.js +2 -0
  32. package/dist/text-field-base.js.flow +0 -1
  33. package/dist/text-field-components.d.ts +1 -0
  34. package/dist/text-field-components.js +7 -3
  35. package/dist/text-field-components.js.flow +1 -0
  36. package/dist/utils/aspect-ratio-support.d.ts +10 -0
  37. package/dist/utils/aspect-ratio-support.js +115 -1
  38. package/dist/utils/aspect-ratio-support.js.flow +14 -0
  39. package/dist/video.js +20 -79
  40. package/dist-es/carousel.js +5 -3
  41. package/dist-es/fixed-footer-layout.js +32 -10
  42. package/dist-es/generated/mistica-icons/icon-buy-data-light.js +6 -12
  43. package/dist-es/generated/mistica-icons/icon-buy-data-regular.js +1 -1
  44. package/dist-es/generated/mistica-icons/icon-eco-light.js +1 -1
  45. package/dist-es/generated/mistica-icons/icon-justice-regular.js +1 -1
  46. package/dist-es/generated/mistica-icons/icon-tokens-filled.js +85 -0
  47. package/dist-es/generated/mistica-icons/icon-tokens-light.js +85 -0
  48. package/dist-es/generated/mistica-icons/icon-tokens-regular.js +85 -0
  49. package/dist-es/hooks.js +14 -2
  50. package/dist-es/image.js +115 -83
  51. package/dist-es/index.js +3 -0
  52. package/dist-es/package-version.js +1 -1
  53. package/dist-es/skeletons.js +50 -87
  54. package/dist-es/skins/o2.js +1 -1
  55. package/dist-es/text-field-base.js +2 -0
  56. package/dist-es/text-field-components.js +7 -3
  57. package/dist-es/utils/aspect-ratio-support.js +112 -0
  58. package/dist-es/video.js +21 -81
  59. package/package.json +1 -1
@@ -90,7 +90,7 @@ var IconJusticeRegular = function(_param) {
90
90
  role: "presentation"
91
91
  }, rest, {
92
92
  children: /*#__PURE__*/ _jsx("path", {
93
- d: "M21.828 14.066a.16.16 0 01.008.044c0 .918-.258 1.641-.753 2.15-.429.432-1.009.676-1.717.726a64.99 64.99 0 01-2.009.006c-.75-.037-1.358-.28-1.806-.728-.494-.496-.746-1.2-.76-2.082-.002-.005-.002-.01-.002-.016l-.002-.03a.244.244 0 01.01-.089.376.376 0 00.012-.073c0-.018 0-.038.008-.058l2.22-7.367c-.912-.002-2.184-.002-3.257-.002v11.935h1.446c.79 0 1.42.235 1.88.698.475.479.716 1.156.716 2.02a.632.632 0 01-.619.643.12.12 0 01-.034-.006l-.02-.005-.022.005a.12.12 0 01-.033.006H6.904a.12.12 0 01-.035-.006l-.019-.005-.023.005a.121.121 0 01-.033.006.632.632 0 01-.619-.644c0-.86.241-1.54.717-2.02.46-.462 1.09-.697 1.883-.697h1.442V6.547c-1.073.002-2.342.002-3.255.002l2.224 7.367c.005.019.005.037.006.054 0 .014 0 .028.003.041a.385.385 0 00.008.037.22.22 0 01.011.064l-.001.027a.306.306 0 00-.001.027c-.003.005-.003.01-.003.016-.014.883-.264 1.586-.76 2.082-.445.448-1.053.692-1.803.728a65.34 65.34 0 01-2.014-.006c-.712-.05-1.289-.294-1.717-.725-.502-.507-.76-1.23-.76-2.149v-.002c0-.016.005-.032.01-.047.003-.013.006-.025.007-.038l.005-.038a.531.531 0 01.029-.13L5.158 6.69a1.109 1.109 0 00-.35.219.593.593 0 01-.871-.02.665.665 0 01.02-.913c.437-.437 1.03-.678 1.767-.714.056-.006 3.33-.006 5.232-.006a1.083 1.083 0 01-.207-.162c-.285-.286-.428-.709-.428-1.255 0-.552.145-.975.428-1.26.272-.278.667-.418 1.171-.418h.146v.003c.003-.003.008-.003.011-.003.504 0 .9.14 1.171.417.286.286.429.709.429 1.26 0 .547-.146.97-.429 1.256a1.333 1.333 0 01-.207.162c1.899 0 5.173.003 5.232.006.737.036 1.33.277 1.768.714.246.25.255.658.02.913a.596.596 0 01-.874.02 1.175 1.175 0 00-.354-.219l2.953 7.168a.56.56 0 01.033.168.217.217 0 00.009.04zM11.45 6.546h.17c.005 0 .009.002.013.003a.03.03 0 00.013.003h.022c.06 0 .225-.003.37-.003v.003h.308l.013-.003a.04.04 0 01.012-.002h.168v11.935h-1.09V6.547zM17.945 7.8l-1.708 5.666h4.042L17.945 7.8zm2.272 7.532c.143-.143.247-.336.308-.574h-4.44c.065.238.169.431.311.574.227.224.563.35 1 .37a58.297 58.297 0 001.877-.003c.415-.028.731-.154.944-.367zm-3.977 4.776c-.222-.221-.563-.334-1.023-.334H8.77c-.46 0-.804.113-1.022.334-.11.115-.197.263-.253.448h9a1.11 1.11 0 00-.254-.448zM3.707 13.465H7.75L6.041 7.8l-2.334 5.666zm3.883 1.866c.143-.143.246-.336.31-.574H3.46c.062.238.166.431.309.574.216.216.532.339.947.367a58.288 58.288 0 001.876.003c.435-.023.774-.146.998-.37z",
93
+ d: "M20.352 15.383c-.216.216-.538.344-.96.373a59.137 59.137 0 01-1.906.002c-.444-.02-.786-.148-1.016-.375a1.281 1.281 0 01-.316-.584h4.511a1.253 1.253 0 01-.313.584zm-2.308-7.654l2.37 5.758h-4.106l1.736-5.758zm-2.772 12.168c.466 0 .814.114 1.039.338.113.117.199.268.259.456H7.425c.057-.188.145-.339.256-.456.222-.224.572-.338 1.039-.338h6.552zm-3.828-13.44h.173c.009 0 .017.006.026.006.008 0 .219-.003.398-.003v.003h.313c.009 0 .017-.006.026-.006h.17v12.128h-1.106V6.457zm-3.76 7.03H3.577l2.37-5.758 1.737 5.758zm-.162 1.896c-.228.227-.573.353-1.014.375a59.142 59.142 0 01-1.907-.003c-.42-.028-.742-.153-.962-.372a1.253 1.253 0 01-.313-.584h4.511c-.065.242-.17.439-.315.584zm14.475-1.241c0-.029-.014-.054-.017-.086a.569.569 0 00-.034-.17l-3-7.284c.137.06.262.128.359.222a.606.606 0 00.888-.02.678.678 0 00-.02-.928c-.444-.444-1.048-.688-1.796-.725-.06-.003-3.387-.006-5.317-.006a1.35 1.35 0 00.21-.165c.288-.29.436-.72.436-1.275 0-.56-.145-.99-.435-1.28-.276-.283-.678-.425-1.19-.425-.003 0-.008 0-.011.003V2h-.148c-.513 0-.914.142-1.19.424-.287.29-.435.72-.435 1.28 0 .556.145.986.435 1.276a1.1 1.1 0 00.21.165c-1.932 0-5.26 0-5.316.006-.749.037-1.352.281-1.796.725a.675.675 0 00-.02.928.602.602 0 00.453.202c.156 0 .313-.06.432-.182.094-.094.222-.165.356-.222l-3 7.284c-.023.054-.025.113-.034.17-.003.029-.017.057-.017.086v.003c0 .933.262 1.667.771 2.183.436.438 1.022.686 1.745.737a66.277 66.277 0 002.046.005c.763-.037 1.38-.284 1.833-.74.504-.503.757-1.218.772-2.114 0-.006 0-.012.002-.017 0-.02.003-.034.003-.054 0-.037-.014-.069-.02-.103-.005-.031 0-.063-.008-.097L6.884 6.46c.928 0 2.217 0 3.307-.003v12.128H8.725c-.805 0-1.445.239-1.912.708-.484.487-.729 1.179-.729 2.052 0 .362.282.655.63.655.02 0 .036-.009.056-.011.017.002.034.011.054.011H17.18c.02 0 .037-.009.056-.011.018.002.035.011.055.011a.642.642 0 00.629-.655c0-.876-.245-1.565-.729-2.052-.467-.47-1.107-.708-1.91-.708h-1.468V6.457c1.09 0 2.382 0 3.31.003l-2.257 7.485c-.012.034-.006.066-.012.097-.005.034-.02.066-.02.103 0 .017.003.034.003.054 0 .005 0 .011.003.017.014.896.27 1.61.771 2.114.456.456 1.073.703 1.836.74a65.907 65.907 0 002.04-.006c.72-.05 1.31-.298 1.745-.736.504-.518.766-1.253.766-2.186z",
94
94
  fill: fillColor
95
95
  })
96
96
  }));
@@ -0,0 +1,85 @@
1
+ function _defineProperty(obj, key, value) {
2
+ if (key in obj) {
3
+ Object.defineProperty(obj, key, {
4
+ value: value,
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true
8
+ });
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ return obj;
13
+ }
14
+ function _objectSpread(target) {
15
+ for(var i = 1; i < arguments.length; i++){
16
+ var source = arguments[i] != null ? arguments[i] : {};
17
+ var ownKeys = Object.keys(source);
18
+ if (typeof Object.getOwnPropertySymbols === "function") {
19
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
+ }));
22
+ }
23
+ ownKeys.forEach(function(key) {
24
+ _defineProperty(target, key, source[key]);
25
+ });
26
+ }
27
+ return target;
28
+ }
29
+ function _objectWithoutProperties(source, excluded) {
30
+ if (source == null) return {};
31
+ var target = _objectWithoutPropertiesLoose(source, excluded);
32
+ var key, i;
33
+ if (Object.getOwnPropertySymbols) {
34
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
35
+ for(i = 0; i < sourceSymbolKeys.length; i++){
36
+ key = sourceSymbolKeys[i];
37
+ if (excluded.indexOf(key) >= 0) continue;
38
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
39
+ target[key] = source[key];
40
+ }
41
+ }
42
+ return target;
43
+ }
44
+ function _objectWithoutPropertiesLoose(source, excluded) {
45
+ if (source == null) return {};
46
+ var target = {};
47
+ var sourceKeys = Object.keys(source);
48
+ var key, i;
49
+ for(i = 0; i < sourceKeys.length; i++){
50
+ key = sourceKeys[i];
51
+ if (excluded.indexOf(key) >= 0) continue;
52
+ target[key] = source[key];
53
+ }
54
+ return target;
55
+ }
56
+ import { jsx as _jsx } from "react/jsx-runtime";
57
+ /*
58
+ * This file was autogenerated. Don't edit this file!
59
+ *
60
+ * To update, execute "yarn start" inside "import-mistica-icons"
61
+ */ import * as React from "react";
62
+ import { useTheme } from "../../hooks";
63
+ import { useIsInverseVariant } from "../../theme-variant-context";
64
+ var IconTokensFilled = function(_param) {
65
+ var color = _param.color, _size = _param.size, size = _size === void 0 ? 24 : _size, children = _param.children, rest = _objectWithoutProperties(_param, [
66
+ "color",
67
+ "size",
68
+ "children"
69
+ ]);
70
+ var colors = useTheme().colors;
71
+ var isInverse = useIsInverseVariant();
72
+ var fillColor = color !== null && color !== void 0 ? color : isInverse ? colors.inverse : colors.neutralHigh;
73
+ return /*#__PURE__*/ _jsx("svg", _objectSpread({
74
+ width: size,
75
+ height: size,
76
+ viewBox: "0 0 24 24",
77
+ role: "presentation"
78
+ }, rest, {
79
+ children: /*#__PURE__*/ _jsx("path", {
80
+ d: "M13.43 4.63l-.016.034-.029.066-.005.01a11.525 11.525 0 01-1.845 2.881 11.612 11.612 0 01-3.95 2.931 12.737 12.737 0 00-2.032-2.457 8.422 8.422 0 002.19-1.11 8.586 8.586 0 002.83-3.4.9.9 0 00.03-.068l.005-.013a1.52 1.52 0 012.763-.125l.027.063.02.045.014.03.008.018c.133.353.13.744-.01 1.095zM8.207 16.026a12.725 12.725 0 00-2.95 1.346 8.572 8.572 0 00-.327-2.294 8.515 8.515 0 00-2.386-3.885l-.005-.005a2.844 2.844 0 00-.074-.067l-.006-.006A1.516 1.516 0 013.49 8.511h.024a1.51 1.51 0 011.072.445c.02.02.042.038.065.055a11.46 11.46 0 012.115 2.671l.003.006a11.612 11.612 0 011.437 4.338zm10.659 2.754a8.579 8.579 0 011.247-5.97 12.745 12.745 0 01-3.117-.657 11.576 11.576 0 00-.87 8.3c.109.29.302.542.555.721h.002l.014.009.04.027a1.52 1.52 0 002.303-1.61l-.029-.114a8.117 8.117 0 01-.145-.707zm-6.83.99c.924.005 1.84.16 2.714.457a12.796 12.796 0 01-.302-3.226 11.577 11.577 0 00-5.386.115c-1.17.308-2.283.8-3.298 1.455l-.012.008c-.083.053-.17.11-.26.173a1.51 1.51 0 00-.476.692 8.235 8.235 0 01-.055.21 1.52 1.52 0 002.402 1.495l.01-.007A8.494 8.494 0 0112 19.77h.036zm2.52-4.057c.19-1.407.611-2.774 1.246-4.044a12.917 12.917 0 01-3.785-2.679 12.91 12.91 0 01-3.798 2.687 12.937 12.937 0 011.242 4.031 12.876 12.876 0 015.095.005zm7.002-4.615c.284-.284.444-.67.445-1.072a1.523 1.523 0 00-1.395-1.512l-.074-.005h-.015a8.462 8.462 0 01-5.992-3.188 12.775 12.775 0 01-1.657 2.705 11.593 11.593 0 004.065 2.734c1.096.435 2.253.698 3.43.78h.016l.025.001a1.518 1.518 0 001.152-.443z",
81
+ fill: fillColor
82
+ })
83
+ }));
84
+ };
85
+ export default IconTokensFilled;
@@ -0,0 +1,85 @@
1
+ function _defineProperty(obj, key, value) {
2
+ if (key in obj) {
3
+ Object.defineProperty(obj, key, {
4
+ value: value,
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true
8
+ });
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ return obj;
13
+ }
14
+ function _objectSpread(target) {
15
+ for(var i = 1; i < arguments.length; i++){
16
+ var source = arguments[i] != null ? arguments[i] : {};
17
+ var ownKeys = Object.keys(source);
18
+ if (typeof Object.getOwnPropertySymbols === "function") {
19
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
+ }));
22
+ }
23
+ ownKeys.forEach(function(key) {
24
+ _defineProperty(target, key, source[key]);
25
+ });
26
+ }
27
+ return target;
28
+ }
29
+ function _objectWithoutProperties(source, excluded) {
30
+ if (source == null) return {};
31
+ var target = _objectWithoutPropertiesLoose(source, excluded);
32
+ var key, i;
33
+ if (Object.getOwnPropertySymbols) {
34
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
35
+ for(i = 0; i < sourceSymbolKeys.length; i++){
36
+ key = sourceSymbolKeys[i];
37
+ if (excluded.indexOf(key) >= 0) continue;
38
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
39
+ target[key] = source[key];
40
+ }
41
+ }
42
+ return target;
43
+ }
44
+ function _objectWithoutPropertiesLoose(source, excluded) {
45
+ if (source == null) return {};
46
+ var target = {};
47
+ var sourceKeys = Object.keys(source);
48
+ var key, i;
49
+ for(i = 0; i < sourceKeys.length; i++){
50
+ key = sourceKeys[i];
51
+ if (excluded.indexOf(key) >= 0) continue;
52
+ target[key] = source[key];
53
+ }
54
+ return target;
55
+ }
56
+ import { jsx as _jsx } from "react/jsx-runtime";
57
+ /*
58
+ * This file was autogenerated. Don't edit this file!
59
+ *
60
+ * To update, execute "yarn start" inside "import-mistica-icons"
61
+ */ import * as React from "react";
62
+ import { useTheme } from "../../hooks";
63
+ import { useIsInverseVariant } from "../../theme-variant-context";
64
+ var IconTokensLight = function(_param) {
65
+ var color = _param.color, _size = _param.size, size = _size === void 0 ? 24 : _size, children = _param.children, rest = _objectWithoutProperties(_param, [
66
+ "color",
67
+ "size",
68
+ "children"
69
+ ]);
70
+ var colors = useTheme().colors;
71
+ var isInverse = useIsInverseVariant();
72
+ var fillColor = color !== null && color !== void 0 ? color : isInverse ? colors.inverse : colors.neutralHigh;
73
+ return /*#__PURE__*/ _jsx("svg", _objectSpread({
74
+ width: size,
75
+ height: size,
76
+ viewBox: "0 0 24 24",
77
+ role: "presentation"
78
+ }, rest, {
79
+ children: /*#__PURE__*/ _jsx("path", {
80
+ d: "M22 10.196a2.254 2.254 0 00-2.07-2.246l-.021-.001-.063-.005h-.009a6.868 6.868 0 01-5.723-4.013 2.256 2.256 0 00-4.194-.009v.003l-.009.023-.003.006c-.09.193-.182.37-.292.562a6.865 6.865 0 01-5.421 3.428H4.19c-.06.002-.12.006-.176.012l-.011.001h-.004a2.254 2.254 0 00-1.231 3.936l.004.004a6.852 6.852 0 011.938 3.15 6.961 6.961 0 01.079 3.504c-.026.08-.047.163-.064.246l-.006.03a2.258 2.258 0 003.402 2.332l.01-.006.005-.004a4.28 4.28 0 01.116-.077l.005-.003a6.882 6.882 0 013.741-1.107h.031a6.926 6.926 0 013.758 1.13l.004.002.004.002.013.01.027.017.004.003a2.251 2.251 0 002.212.14 2.26 2.26 0 001.223-2.528c0-.006-.003-.013-.005-.019a6.673 6.673 0 01-.144-.674 6.941 6.941 0 012.134-6.18l.043-.04A2.249 2.249 0 0022 10.196zm-2.902-1.774c.231.04.467.07.701.088h.009l.07.005h.001a1.687 1.687 0 01-.134 3.368c-.028 0-.058 0-.087-.002l-.035-.002h-.01a10.754 10.754 0 01-3.22-.733 10.893 10.893 0 01-4-2.763 11.38 11.38 0 001.662-2.659l.001-.004a2.28 2.28 0 00.05-.113l.004-.009c.043-.108.078-.22.105-.334a7.425 7.425 0 004.883 3.158zm-4.505 7.33a11.43 11.43 0 00-5.171-.005 11.49 11.49 0 00-1.289-4.191 11.472 11.472 0 003.883-2.744 11.469 11.469 0 003.87 2.738 11.497 11.497 0 00-1.293 4.201zM10.107 4.799a7.045 7.045 0 00.334-.652l.005-.014a1.69 1.69 0 013.08-.13l.003.009c.013.032.028.063.04.094l.024.05c.152.398.148.837-.011 1.232l-.044.099-.002.005v.002a10.81 10.81 0 01-1.734 2.707 10.891 10.891 0 01-3.952 2.858 11.342 11.342 0 00-2.02-2.476 2.295 2.295 0 00-.349-.279 7.36 7.36 0 002.458-1.13 7.536 7.536 0 002.168-2.375zM3.668 12a7.545 7.545 0 00-.507-.518l-.003-.003a4.351 4.351 0 00-.073-.067 1.687 1.687 0 011.136-2.9h.033a1.676 1.676 0 011.193.493.289.289 0 00.037.032 10.77 10.77 0 012 2.52 10.914 10.914 0 011.382 4.334c-1.07.306-2.089.768-3.023 1.371l-.008.005c-.09.059-.183.12-.285.19l-.017.012-.008.008A7.468 7.468 0 003.668 12zm8.33 7.394a7.453 7.453 0 00-4.054 1.202l-.003.002-.004.002a1.69 1.69 0 01-2.659-1.674l.001-.006c.02-.072.039-.145.056-.214.101-.31.29-.583.544-.787a8.51 8.51 0 01.257-.17l.007-.005c.954-.616 2-1.078 3.098-1.367a10.874 10.874 0 015.306-.051 11.375 11.375 0 00.3 3.297v.006c.026.11.056.223.086.337a.333.333 0 00.006.02l.005.014a7.514 7.514 0 00-2.914-.605h-.031zm6.765-4.51a7.544 7.544 0 00-.07 3.874c.009.035.018.07.029.105a1.692 1.692 0 01-2.565 1.794l-.002-.002-.035-.023-.01-.007-.003-.002a1.708 1.708 0 01-.626-.818 9.122 9.122 0 01-.081-.314l-.002-.007a10.87 10.87 0 011.02-7.721c1.012.377 2.074.606 3.152.681h.002l.057.004a2.304 2.304 0 00.348-.01 7.526 7.526 0 00-1.214 2.446z",
81
+ fill: fillColor
82
+ })
83
+ }));
84
+ };
85
+ export default IconTokensLight;
@@ -0,0 +1,85 @@
1
+ function _defineProperty(obj, key, value) {
2
+ if (key in obj) {
3
+ Object.defineProperty(obj, key, {
4
+ value: value,
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true
8
+ });
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ return obj;
13
+ }
14
+ function _objectSpread(target) {
15
+ for(var i = 1; i < arguments.length; i++){
16
+ var source = arguments[i] != null ? arguments[i] : {};
17
+ var ownKeys = Object.keys(source);
18
+ if (typeof Object.getOwnPropertySymbols === "function") {
19
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
+ }));
22
+ }
23
+ ownKeys.forEach(function(key) {
24
+ _defineProperty(target, key, source[key]);
25
+ });
26
+ }
27
+ return target;
28
+ }
29
+ function _objectWithoutProperties(source, excluded) {
30
+ if (source == null) return {};
31
+ var target = _objectWithoutPropertiesLoose(source, excluded);
32
+ var key, i;
33
+ if (Object.getOwnPropertySymbols) {
34
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
35
+ for(i = 0; i < sourceSymbolKeys.length; i++){
36
+ key = sourceSymbolKeys[i];
37
+ if (excluded.indexOf(key) >= 0) continue;
38
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
39
+ target[key] = source[key];
40
+ }
41
+ }
42
+ return target;
43
+ }
44
+ function _objectWithoutPropertiesLoose(source, excluded) {
45
+ if (source == null) return {};
46
+ var target = {};
47
+ var sourceKeys = Object.keys(source);
48
+ var key, i;
49
+ for(i = 0; i < sourceKeys.length; i++){
50
+ key = sourceKeys[i];
51
+ if (excluded.indexOf(key) >= 0) continue;
52
+ target[key] = source[key];
53
+ }
54
+ return target;
55
+ }
56
+ import { jsx as _jsx } from "react/jsx-runtime";
57
+ /*
58
+ * This file was autogenerated. Don't edit this file!
59
+ *
60
+ * To update, execute "yarn start" inside "import-mistica-icons"
61
+ */ import * as React from "react";
62
+ import { useTheme } from "../../hooks";
63
+ import { useIsInverseVariant } from "../../theme-variant-context";
64
+ var IconTokensRegular = function(_param) {
65
+ var color = _param.color, _size = _param.size, size = _size === void 0 ? 24 : _size, children = _param.children, rest = _objectWithoutProperties(_param, [
66
+ "color",
67
+ "size",
68
+ "children"
69
+ ]);
70
+ var colors = useTheme().colors;
71
+ var isInverse = useIsInverseVariant();
72
+ var fillColor = color !== null && color !== void 0 ? color : isInverse ? colors.inverse : colors.neutralHigh;
73
+ return /*#__PURE__*/ _jsx("svg", _objectSpread({
74
+ width: size,
75
+ height: size,
76
+ viewBox: "0 0 24 24",
77
+ role: "presentation"
78
+ }, rest, {
79
+ children: /*#__PURE__*/ _jsx("path", {
80
+ d: "M22 10.254a2.482 2.482 0 00-2.276-2.472l-.034-.003a.438.438 0 01-.051-.004h-.013a6.373 6.373 0 01-5.305-3.721 2.483 2.483 0 00-4.614 0l-.002.006-.004.01v.003a6.371 6.371 0 01-5.297 3.7h-.005a2.481 2.481 0 00-1.56 4.34l.006.006a6.312 6.312 0 011.797 2.923 6.46 6.46 0 01.074 3.246c-.026.085-.048.17-.065.258l-.007.035a2.485 2.485 0 003.744 2.565l.02-.012.006-.005.108-.072.005-.002.003-.003a6.388 6.388 0 016.982.022h.002l.007.005.008.006.029.018.01.007a2.48 2.48 0 002.435.154 2.486 2.486 0 001.313-2.905 6.443 6.443 0 011.425-5.814 5.91 5.91 0 01.37-.381l.002-.003a4.014 4.014 0 01.124-.115l.014-.016A2.474 2.474 0 0022 10.254zm-3.16-1.433c.233.04.471.07.708.088h.01l.068.005a1.344 1.344 0 01-.108 2.683c-.023 0-.047 0-.07-.002h-.037a10.135 10.135 0 01-3.04-.692 10.275 10.275 0 01-3.6-2.422c.587-.735 1.08-1.54 1.468-2.397a7.497 7.497 0 004.6 2.737zm-4.575 6.471a11.408 11.408 0 00-4.515-.004 11.468 11.468 0 00-1.1-3.572 11.436 11.436 0 003.364-2.38c.965.987 2.101 1.79 3.353 2.373a11.467 11.467 0 00-1.103 3.583zM10.416 5.164a7.045 7.045 0 00.343-.674l.004-.01a1.346 1.346 0 012.449-.117v.002l.042.095.02.042c.117.313.114.66-.01.97-.013.028-.026.06-.04.088a.074.074 0 00-.003.009v.001a10.193 10.193 0 01-1.635 2.553 10.283 10.283 0 01-3.499 2.597 11.303 11.303 0 00-1.8-2.178 7.454 7.454 0 001.94-.983 7.601 7.601 0 002.189-2.397v.002zM4.132 11.81a7.397 7.397 0 00-.512-.522l-.004-.004a4.177 4.177 0 00-.066-.06l-.004-.004a1.344 1.344 0 01.785-2.3l.127-.008a1.337 1.337 0 01.974.393.612.612 0 00.057.05c.74.69 1.37 1.488 1.874 2.366a10.287 10.287 0 011.277 3.85c-.918.285-1.797.686-2.613 1.193a7.539 7.539 0 00-1.895-4.954zm4.308 7.974a7.701 7.701 0 00-.54.32l-.008.005a1.348 1.348 0 01-2.128-1.324l.048-.186c.08-.24.226-.453.422-.614l.23-.153.01-.006a10.17 10.17 0 012.923-1.29 10.26 10.26 0 014.772-.102c-.033.96.057 1.921.267 2.859a7.531 7.531 0 00-5.996.491zm9.842-5.06a7.616 7.616 0 00-.07 3.912 1.348 1.348 0 01-2.015 1.528l-.039-.026-.01-.006a1.36 1.36 0 01-.49-.64c-.027-.096-.051-.192-.074-.284l-.002-.008c-.57-2.379-.27-4.884.845-7.062.893.309 1.82.504 2.762.581a7.592 7.592 0 00-.907 2.005z",
81
+ fill: fillColor
82
+ })
83
+ }));
84
+ };
85
+ export default IconTokensRegular;
package/dist-es/hooks.js CHANGED
@@ -147,10 +147,14 @@ export var useWindowSize = function() {
147
147
  ), 2), windowHeight = ref[0], setWindowHeight = ref[1];
148
148
  var ref6 = _slicedToArray(React.useState(typeof window !== "undefined" ? window.innerWidth : 800 // Best guess
149
149
  ), 2), windowWidth = ref6[0], setWindowWidth = ref6[1];
150
+ var ref7 = _slicedToArray(React.useState(typeof window !== "undefined" ? window.screen.availHeight : 1200), 2), screenHeight = ref7[0], setScreenHeight = ref7[1];
151
+ var ref8 = _slicedToArray(React.useState(typeof window !== "undefined" ? window.screen.availWidth : 800), 2), screenWidth = ref8[0], setScreenWidth = ref8[1];
150
152
  React.useEffect(function() {
151
153
  var handleResize = function() {
152
154
  setWindowHeight(window.innerHeight);
153
155
  setWindowWidth(window.innerWidth);
156
+ setScreenHeight(window.screen.availHeight);
157
+ setScreenWidth(window.screen.availWidth);
154
158
  };
155
159
  window.addEventListener("resize", handleResize);
156
160
  return function() {
@@ -161,11 +165,15 @@ export var useWindowSize = function() {
161
165
  return React.useMemo(function() {
162
166
  return {
163
167
  height: windowHeight,
164
- width: windowWidth
168
+ width: windowWidth,
169
+ screenHeight: screenHeight,
170
+ screenWidth: screenWidth
165
171
  };
166
172
  }, [
167
173
  windowHeight,
168
- windowWidth
174
+ windowWidth,
175
+ screenHeight,
176
+ screenWidth
169
177
  ]);
170
178
  };
171
179
  export var useWindowHeight = function() {
@@ -176,6 +184,10 @@ export var useWindowWidth = function() {
176
184
  var width = useWindowSize().width;
177
185
  return width;
178
186
  };
187
+ export var useScreenHeight = function() {
188
+ var screenHeight = useWindowSize().screenHeight;
189
+ return screenHeight;
190
+ };
179
191
  // React currently throws a warning when using useLayoutEffect on the server.
180
192
  // To get around it, we can conditionally useEffect on the server (no-op) and
181
193
  // useLayoutEffect in the browser
package/dist-es/image.js CHANGED
@@ -99,11 +99,17 @@ function _unsupportedIterableToArray(o, minLen) {
99
99
  if (n === "Map" || n === "Set") return Array.from(n);
100
100
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
101
101
  }
102
- import { jsx as _jsx } from "react/jsx-runtime";
102
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
103
103
  import * as React from "react";
104
104
  import { createUseStyles } from "./jss";
105
- import { useSupportsAspectRatio } from "./utils/aspect-ratio-support";
105
+ import { SkeletonRectangle } from "./skeletons";
106
+ import { AspectRatioElement } from "./utils/aspect-ratio-support";
106
107
  import { getPrefixedDataAttributes } from "./utils/dom";
108
+ import IconImageRegular from "./generated/mistica-icons/icon-image-regular";
109
+ import { useIsInverseVariant } from "./theme-variant-context";
110
+ import { useTheme } from "./hooks";
111
+ import { VIVO_SKIN } from "./skins/constants";
112
+ var FADE_IN_DURATION_MS = 300;
107
113
  /**
108
114
  * This context is used internally to disable the border radius. This is useful for example
109
115
  * when using the Image component inside a Card
@@ -118,59 +124,74 @@ export var DisableBorderRadiusProvider = function(param) {
118
124
  children: children
119
125
  });
120
126
  };
127
+ var VivoLogo = function(param) {
128
+ var style = param.style;
129
+ var colors = useTheme().colors;
130
+ return /*#__PURE__*/ _jsx("svg", {
131
+ width: "48",
132
+ height: "48",
133
+ viewBox: "0 0 48 48",
134
+ fill: "none",
135
+ style: style,
136
+ children: /*#__PURE__*/ _jsx("path", {
137
+ d: "M24.021 35.7235C24.8145 35.7694 25.0467 36.1913 25.3157 36.5138C25.586 36.8362 29.515 41.551 29.7823 41.8569C30.0475 42.1662 30.7822 42.7329 31.5901 42.8405C32.3967 42.9473 33.282 42.7842 33.8484 42.3748C34.4135 41.965 35.1313 41.4073 35.3833 41.0356C35.6337 40.6638 36.061 40.1302 35.9823 39.2534C35.9028 38.3783 35.7112 37.9204 35.0268 37.1691C34.3433 36.4185 30.2992 31.6657 29.5382 30.7537C29.5382 30.7537 28.8467 29.9423 28.9469 28.7956C29.0476 27.6468 29.567 27.1343 30.6608 26.8487C31.7534 26.5647 36.0267 25.5306 36.0267 25.5306C36.0267 25.5306 38.4728 24.3723 37.9182 22.0776L37.5997 20.904C37.5997 20.904 37.0672 18.2264 33.5519 19.0556C30.0344 19.8869 28.0803 20.377 28.0803 20.377C28.0803 20.377 26.9602 20.4838 26.7999 19.744C26.6417 19.0038 26.8494 18.6218 27.3443 18.4156C27.8387 18.209 30.9611 16.7175 31.3617 12.6853C31.7652 8.65158 28.3882 5.06573 24.0091 5.08104C19.6288 5.0976 16.4594 8.39988 16.4725 11.8185C16.4856 15.2387 18.7033 17.5144 20.4079 18.3638C21.3752 18.8453 21.0656 19.7122 21.0656 19.7122C21.0656 19.7122 20.8334 20.5554 19.8153 20.3311C18.7972 20.1025 13.8657 18.9736 13.8657 18.9736C13.8657 18.9736 10.8914 18.4226 10.1732 21.359C9.4541 24.2978 11.1261 25.4143 12.3532 25.6908C13.5798 25.9669 17.7296 26.9716 17.7296 26.9716C17.7296 26.9716 18.9643 27.581 19.0125 28.8308C19.0425 29.5697 19.0438 30.1824 18.266 31.2832C17.4894 32.3835 12.6598 38.0148 12.6598 38.0148C12.6598 38.0148 10.9997 39.9862 13.4051 41.763C15.8106 43.5401 17.1641 43.1262 18.5921 41.4889C20.0188 39.852 22.8383 36.4243 22.8383 36.4243C22.8383 36.4243 23.2275 35.6788 24.021 35.7235Z",
138
+ stroke: colors.brand,
139
+ strokeWidth: "2"
140
+ })
141
+ });
142
+ };
143
+ var ImageError = function() {
144
+ var isInverse = useIsInverseVariant();
145
+ var ref = useTheme(), colors = ref.colors, skinName = ref.skinName;
146
+ return /*#__PURE__*/ _jsx("div", {
147
+ style: {
148
+ height: "100%",
149
+ width: "100%",
150
+ display: "flex",
151
+ alignItems: "center",
152
+ justifyContent: "center",
153
+ backgroundColor: isInverse ? colors.backgroundSkeletonInverse : colors.backgroundSkeleton,
154
+ borderRadius: 8
155
+ },
156
+ children: skinName === VIVO_SKIN ? /*#__PURE__*/ _jsx(VivoLogo, {
157
+ style: {
158
+ width: "10%",
159
+ minWidth: 24,
160
+ maxWidth: 48
161
+ }
162
+ }) : /*#__PURE__*/ _jsx(IconImageRegular, {
163
+ color: isInverse ? colors.inverse : colors.neutralMedium,
164
+ size: "",
165
+ style: {
166
+ width: "10%",
167
+ minWidth: 24,
168
+ maxWidth: 48
169
+ }
170
+ })
171
+ });
172
+ };
121
173
  var useStyles = createUseStyles(function() {
122
174
  return {
123
175
  image: {
176
+ // needeed because images with aspect-ratio 0 and position absolute does not work
177
+ position: function(param) {
178
+ var ratio = param.ratio;
179
+ return ratio !== 0 ? "absolute" : "static";
180
+ },
181
+ top: 0,
182
+ left: 0,
124
183
  display: "block",
125
184
  objectFit: "cover",
185
+ width: "100%",
186
+ height: "100%",
126
187
  maxWidth: "100%",
127
188
  maxHeight: "100%",
128
189
  borderRadius: function(param) {
129
190
  var noBorderRadius = param.noBorderRadius;
130
191
  return noBorderRadius ? 0 : 8;
131
192
  },
132
- "@supports (aspect-ratio: 1 / 1)": {
133
- aspectRatio: function(param) {
134
- var aspectRatio = param.aspectRatio;
135
- return aspectRatio !== null && aspectRatio !== void 0 ? aspectRatio : "unset";
136
- }
137
- },
138
- "$wrapper &": {
139
- borderRadius: 0,
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
- },
145
- width: "100%",
146
- height: "100%",
147
- top: 0,
148
- left: 0
149
- },
150
- opacity: function(param) {
151
- var isError = param.isError;
152
- return isError ? 0 : 1;
153
- }
154
- },
155
- wrapper: {
156
- borderRadius: function(param) {
157
- var noBorderRadius = param.noBorderRadius;
158
- return noBorderRadius ? 0 : 8;
159
- },
160
- overflow: "hidden",
161
- maxWidth: "100%",
162
- maxHeight: "100%",
163
- position: "relative",
164
- paddingTop: function(param) {
165
- var aspectRatio = param.aspectRatio, width = param.width;
166
- if (!aspectRatio) {
167
- return 0;
168
- }
169
- if (width && typeof width === "string" && width.endsWith("%")) {
170
- return "".concat(Number(width.replace("%", "")) / aspectRatio, "%");
171
- }
172
- return "".concat(100 / aspectRatio, "%");
173
- }
193
+ transition: "opacity ".concat(FADE_IN_DURATION_MS, "ms"),
194
+ zIndex: 1
174
195
  }
175
196
  };
176
197
  });
@@ -181,74 +202,85 @@ export var RATIO = {
181
202
  "4:3": 4 / 3
182
203
  };
183
204
  var Image = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
184
- var _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? "1:1" : _aspectRatio, _alt = _param.alt, alt = _alt === void 0 ? "" : _alt, dataAttributes = _param.dataAttributes, noBorderRadius = _param.noBorderRadius, src = _param.src, onError = _param.onError, onLoad = _param.onLoad, props = _objectWithoutProperties(_param, [
205
+ var _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? "1:1" : _aspectRatio, _alt = _param.alt, alt = _alt === void 0 ? "" : _alt, dataAttributes = _param.dataAttributes, noBorderRadius = _param.noBorderRadius, src = _param.src, onError = _param.onError, onLoad = _param.onLoad, _loadingFallback = _param.loadingFallback, loadingFallback = _loadingFallback === void 0 ? true : _loadingFallback, _errorFallback = _param.errorFallback, errorFallback = _errorFallback === void 0 ? true : _errorFallback, props = _objectWithoutProperties(_param, [
185
206
  "aspectRatio",
186
207
  "alt",
187
208
  "dataAttributes",
188
209
  "noBorderRadius",
189
210
  "src",
190
211
  "onError",
191
- "onLoad"
212
+ "onLoad",
213
+ "loadingFallback",
214
+ "errorFallback"
192
215
  ]);
193
- var supportsAspectRatio = useSupportsAspectRatio();
194
216
  var noBorderRadiusContext = useDisableBorderRadius();
195
217
  var noBorderSetting = noBorderRadius !== null && noBorderRadius !== void 0 ? noBorderRadius : noBorderRadiusContext;
196
218
  var _$ref = _slicedToArray(React.useState(false), 2), isError = _$ref[0], setIsError = _$ref[1];
219
+ var _$ref1 = _slicedToArray(React.useState(true), 2), isLoading = _$ref1[0], setIsLoading = _$ref1[1];
220
+ var _$ref2 = _slicedToArray(React.useState(false), 2), hideLoadingFallback = _$ref2[0], setHideLoadingFallback = _$ref2[1];
197
221
  var ratio = typeof aspectRatio === "number" ? aspectRatio : RATIO[aspectRatio];
198
- // if width or height are numeric, we can calculate the other with the ratio without css.
199
- // if aspect ratio is 0, we use the original image proportions
200
- var withCssAspectRatio = typeof props.width !== "number" && typeof props.height !== "number" && ratio !== 0;
201
222
  var classes = useStyles({
202
223
  noBorderRadius: noBorderSetting,
203
- aspectRatio: withCssAspectRatio ? ratio : undefined,
204
- width: props.width,
205
- isError: isError
224
+ ratio: ratio
206
225
  });
207
- var width = props.width;
208
- var height = props.height;
209
- if (props.width !== undefined && props.height !== undefined) {
210
- width = props.width;
211
- height = props.height;
212
- } else if (typeof props.width === "number") {
213
- height = ratio ? props.width / ratio : undefined;
214
- } else if (typeof props.height === "number") {
215
- width = ratio ? props.height * ratio : undefined;
216
- } else {
217
- width = props.width || "100%";
218
- }
219
- var needsWrapper = withCssAspectRatio && !supportsAspectRatio;
226
+ var withLoadingFallback = loadingFallback && !!(ratio !== 0 || props.width && props.height);
227
+ var withErrorFallback = errorFallback && !!(ratio !== 0 || props.width && props.height);
220
228
  var img = // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/309
221
229
  // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
222
230
  /*#__PURE__*/ _jsx("img", _objectSpread({}, getPrefixedDataAttributes(dataAttributes), {
231
+ style: _objectSpread({}, isLoading && withLoadingFallback ? {
232
+ opacity: 0
233
+ } : {
234
+ opacity: 1
235
+ }),
223
236
  ref: ref,
224
237
  src: src,
225
238
  className: classes.image,
226
239
  alt: alt,
227
240
  onError: function(event) {
228
241
  setIsError(true);
242
+ setIsLoading(false);
243
+ setHideLoadingFallback(true);
229
244
  onError === null || onError === void 0 ? void 0 : onError(event);
230
245
  },
231
246
  onLoad: function(event) {
232
247
  setIsError(false);
248
+ setIsLoading(false);
249
+ setTimeout(function() {
250
+ setHideLoadingFallback(true);
251
+ }, FADE_IN_DURATION_MS);
233
252
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(event);
234
253
  }
235
- }, needsWrapper ? {
236
- width: "100%"
237
- } : {
238
- width: width,
239
- height: height
240
254
  }));
241
- if (needsWrapper) {
242
- return /*#__PURE__*/ _jsx("div", {
243
- style: {
244
- width: width,
245
- height: height
246
- },
247
- className: classes.wrapper,
248
- children: img
249
- });
250
- } else {
251
- return img;
252
- }
255
+ return /*#__PURE__*/ _jsxs(AspectRatioElement, {
256
+ style: {
257
+ position: "relative"
258
+ },
259
+ aspectRatio: ratio,
260
+ width: props.width,
261
+ height: props.height,
262
+ children: [
263
+ withLoadingFallback && !hideLoadingFallback && /*#__PURE__*/ _jsx("div", {
264
+ style: {
265
+ position: "absolute",
266
+ width: "100%",
267
+ height: "100%"
268
+ },
269
+ children: /*#__PURE__*/ _jsx(SkeletonRectangle, {
270
+ width: props.width,
271
+ height: props.height
272
+ })
273
+ }),
274
+ isError && withErrorFallback && /*#__PURE__*/ _jsx("div", {
275
+ style: {
276
+ position: "absolute",
277
+ width: "100%",
278
+ height: "100%"
279
+ },
280
+ children: /*#__PURE__*/ _jsx(ImageError, {})
281
+ }),
282
+ !isError && img
283
+ ]
284
+ });
253
285
  });
254
286
  export default Image;
package/dist-es/index.js CHANGED
@@ -1600,6 +1600,9 @@ export { default as IconTipsAndTricksRegular } from "./generated/mistica-icons/i
1600
1600
  export { default as IconTkFilled } from "./generated/mistica-icons/icon-tk-filled";
1601
1601
  export { default as IconTkLight } from "./generated/mistica-icons/icon-tk-light";
1602
1602
  export { default as IconTkRegular } from "./generated/mistica-icons/icon-tk-regular";
1603
+ export { default as IconTokensFilled } from "./generated/mistica-icons/icon-tokens-filled";
1604
+ export { default as IconTokensLight } from "./generated/mistica-icons/icon-tokens-light";
1605
+ export { default as IconTokensRegular } from "./generated/mistica-icons/icon-tokens-regular";
1603
1606
  export { default as IconTongueFilled } from "./generated/mistica-icons/icon-tongue-filled";
1604
1607
  export { default as IconTongueLight } from "./generated/mistica-icons/icon-tongue-light";
1605
1608
  export { default as IconTongueRegular } from "./generated/mistica-icons/icon-tongue-regular";
@@ -1,2 +1,2 @@
1
1
  // DO NOT EDIT THIS FILE. It's autogenerated by set-version.js
2
- export var PACKAGE_VERSION = "12.6.0";
2
+ export var PACKAGE_VERSION = "12.7.0";