@telefonica/mistica 13.2.3 → 13.3.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/css/mistica.css +1 -1
- package/dist/card.js +14 -13
- package/dist/carousel.css-mistica.js +3 -3
- package/dist/carousel.css.d.ts +0 -1
- package/dist/carousel.d.ts +5 -0
- package/dist/carousel.js +218 -207
- package/dist/hero.css-mistica.js +24 -0
- package/dist/hero.css.d.ts +8 -0
- package/dist/hero.css.ts.vanilla.js +9 -0
- package/dist/hero.d.ts +23 -0
- package/dist/hero.js +296 -0
- package/dist/image.d.ts +3 -2
- package/dist/image.js +13 -13
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/package-version.js +1 -1
- package/dist/responsive-layout.css.d.ts +4 -0
- package/dist/search-field.d.ts +1 -1
- package/dist/search-field.js +22 -21
- package/dist/video.js +13 -13
- package/dist-es/card.js +20 -19
- package/dist-es/carousel.css-mistica.js +2 -2
- package/dist-es/carousel.js +256 -247
- package/dist-es/hero.css-mistica.js +7 -0
- package/dist-es/hero.css.ts.vanilla.js +2 -0
- package/dist-es/hero.js +245 -0
- package/dist-es/image.js +26 -26
- package/dist-es/index.js +1700 -1699
- package/dist-es/package-version.js +1 -1
- package/dist-es/search-field.js +33 -32
- package/dist-es/style.css +1 -1
- package/dist-es/video.js +14 -14
- package/package.json +1 -1
package/dist/hero.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Tag from './tag';
|
|
3
|
+
import { ButtonLink, ButtonPrimary } from './button';
|
|
4
|
+
import Video from './video';
|
|
5
|
+
import Image from './image';
|
|
6
|
+
import type { DataAttributes, RendersElement, RendersNullableElement } from './utils/types';
|
|
7
|
+
type HeroProps = {
|
|
8
|
+
height?: string;
|
|
9
|
+
background?: 'default' | 'alternative' | 'brand' | 'brand-secondary';
|
|
10
|
+
media: RendersElement<typeof Image> | RendersElement<typeof Video>;
|
|
11
|
+
headline?: RendersNullableElement<typeof Tag>;
|
|
12
|
+
pretitle?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
descriptionLinesMax?: number;
|
|
16
|
+
extra?: React.ReactNode;
|
|
17
|
+
button?: RendersNullableElement<typeof ButtonPrimary>;
|
|
18
|
+
buttonLink?: RendersNullableElement<typeof ButtonLink>;
|
|
19
|
+
dataAttributes?: DataAttributes;
|
|
20
|
+
desktopMediaPosition?: 'left' | 'right';
|
|
21
|
+
};
|
|
22
|
+
declare const Hero: React.ForwardRefExoticComponent<HeroProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export default Hero;
|
package/dist/hero.js
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>er
|
|
8
|
+
});
|
|
9
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
10
|
+
const _classnames = /*#__PURE__*/ _interopRequireDefault(require("classnames"));
|
|
11
|
+
const _hooksJs = require("./hooks.js");
|
|
12
|
+
const _imageJs = require("./image.js");
|
|
13
|
+
const _textJs = require("./text.js");
|
|
14
|
+
const _gridLayoutJs = /*#__PURE__*/ _interopRequireDefault(require("./grid-layout.js"));
|
|
15
|
+
const _boxJs = /*#__PURE__*/ _interopRequireDefault(require("./box.js"));
|
|
16
|
+
const _stackJs = /*#__PURE__*/ _interopRequireDefault(require("./stack.js"));
|
|
17
|
+
const _buttonGroupJs = /*#__PURE__*/ _interopRequireDefault(require("./button-group.js"));
|
|
18
|
+
const _skinContractCssMisticaJs = require("./skins/skin-contract.css-mistica.js");
|
|
19
|
+
const _heroCssMisticaJs = require("./hero.css-mistica.js");
|
|
20
|
+
const _dynamic = require("@vanilla-extract/dynamic");
|
|
21
|
+
const _carouselJs = require("./carousel.js");
|
|
22
|
+
const _domJs = require("./utils/dom.js");
|
|
23
|
+
const _sprinklesCssMisticaJs = require("./sprinkles.css-mistica.js");
|
|
24
|
+
const _themeVariantContextJs = require("./theme-variant-context.js");
|
|
25
|
+
const _jsxRuntimeJs = require("./_virtual/jsx-runtime.js");
|
|
26
|
+
function _interopRequireDefault(obj) {
|
|
27
|
+
return obj && obj.__esModule ? obj : {
|
|
28
|
+
default: obj
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
32
|
+
if (typeof WeakMap !== "function") return null;
|
|
33
|
+
var cacheBabelInterop = new WeakMap();
|
|
34
|
+
var cacheNodeInterop = new WeakMap();
|
|
35
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
36
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
37
|
+
})(nodeInterop);
|
|
38
|
+
}
|
|
39
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
40
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
41
|
+
return obj;
|
|
42
|
+
}
|
|
43
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
44
|
+
return {
|
|
45
|
+
default: obj
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
49
|
+
if (cache && cache.has(obj)) {
|
|
50
|
+
return cache.get(obj);
|
|
51
|
+
}
|
|
52
|
+
var newObj = {};
|
|
53
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
54
|
+
for(var key in obj){
|
|
55
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
56
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
57
|
+
if (desc && (desc.get || desc.set)) {
|
|
58
|
+
Object.defineProperty(newObj, key, desc);
|
|
59
|
+
} else {
|
|
60
|
+
newObj[key] = obj[key];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
newObj.default = obj;
|
|
65
|
+
if (cache) {
|
|
66
|
+
cache.set(obj, newObj);
|
|
67
|
+
}
|
|
68
|
+
return newObj;
|
|
69
|
+
}
|
|
70
|
+
function _defineProperty(obj, key, value) {
|
|
71
|
+
if (key in obj) {
|
|
72
|
+
Object.defineProperty(obj, key, {
|
|
73
|
+
value: value,
|
|
74
|
+
enumerable: true,
|
|
75
|
+
configurable: true,
|
|
76
|
+
writable: true
|
|
77
|
+
});
|
|
78
|
+
} else {
|
|
79
|
+
obj[key] = value;
|
|
80
|
+
}
|
|
81
|
+
return obj;
|
|
82
|
+
}
|
|
83
|
+
function _objectSpread(target) {
|
|
84
|
+
for(var i = 1; i < arguments.length; i++){
|
|
85
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
86
|
+
var ownKeys = Object.keys(source);
|
|
87
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
88
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
89
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
ownKeys.forEach(function(key) {
|
|
93
|
+
_defineProperty(target, key, source[key]);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return target;
|
|
97
|
+
}
|
|
98
|
+
function ownKeys(object, enumerableOnly) {
|
|
99
|
+
var keys = Object.keys(object);
|
|
100
|
+
if (Object.getOwnPropertySymbols) {
|
|
101
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
102
|
+
if (enumerableOnly) {
|
|
103
|
+
symbols = symbols.filter(function(sym) {
|
|
104
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
keys.push.apply(keys, symbols);
|
|
108
|
+
}
|
|
109
|
+
return keys;
|
|
110
|
+
}
|
|
111
|
+
function _objectSpreadProps(target, source) {
|
|
112
|
+
source = source != null ? source : {};
|
|
113
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
114
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
115
|
+
} else {
|
|
116
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
117
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return target;
|
|
121
|
+
}
|
|
122
|
+
function _objectWithoutProperties(source, excluded) {
|
|
123
|
+
if (source == null) return {};
|
|
124
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
125
|
+
var key, i;
|
|
126
|
+
if (Object.getOwnPropertySymbols) {
|
|
127
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
128
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
129
|
+
key = sourceSymbolKeys[i];
|
|
130
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
131
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
132
|
+
target[key] = source[key];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return target;
|
|
136
|
+
}
|
|
137
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
138
|
+
if (source == null) return {};
|
|
139
|
+
var target = {};
|
|
140
|
+
var sourceKeys = Object.keys(source);
|
|
141
|
+
var key, i;
|
|
142
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
143
|
+
key = sourceKeys[i];
|
|
144
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
145
|
+
target[key] = source[key];
|
|
146
|
+
}
|
|
147
|
+
return target;
|
|
148
|
+
}
|
|
149
|
+
const k = (param)=>/* @__PURE__ */ {
|
|
150
|
+
let { children: e , isInverse: o } = param;
|
|
151
|
+
return (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
|
|
152
|
+
isInverse: o,
|
|
153
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
|
|
154
|
+
className: _heroCssMisticaJs.layout,
|
|
155
|
+
children: e
|
|
156
|
+
})
|
|
157
|
+
});
|
|
158
|
+
}, v = (param)=>/* @__PURE__ */ {
|
|
159
|
+
let { headline: e , title: o , pretitle: a , description: i , descriptionLinesMax: d , extra: n , button: l , secondaryButton: p , buttonLink: m } = param;
|
|
160
|
+
return (0, _jsxRuntimeJs.jsxs)("section", {
|
|
161
|
+
className: (0, _sprinklesCssMisticaJs.sprinkles)({
|
|
162
|
+
height: "100%",
|
|
163
|
+
display: "flex",
|
|
164
|
+
justifyContent: "space-between",
|
|
165
|
+
flexDirection: "column"
|
|
166
|
+
}),
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)("div", {
|
|
169
|
+
children: [
|
|
170
|
+
/* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)(_stackJs.default, {
|
|
171
|
+
space: 16,
|
|
172
|
+
children: [
|
|
173
|
+
e && e,
|
|
174
|
+
/* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)(_stackJs.default, {
|
|
175
|
+
space: 8,
|
|
176
|
+
children: [
|
|
177
|
+
a && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_textJs.Text3, {
|
|
178
|
+
as: "p",
|
|
179
|
+
regular: !0,
|
|
180
|
+
children: a
|
|
181
|
+
}),
|
|
182
|
+
o && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_textJs.Text8, {
|
|
183
|
+
as: "h1",
|
|
184
|
+
children: o
|
|
185
|
+
})
|
|
186
|
+
]
|
|
187
|
+
}),
|
|
188
|
+
i && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_textJs.Text3, {
|
|
189
|
+
as: "p",
|
|
190
|
+
regular: !0,
|
|
191
|
+
color: _skinContractCssMisticaJs.vars.colors.textSecondary,
|
|
192
|
+
truncate: d,
|
|
193
|
+
children: i
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
}),
|
|
197
|
+
n && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
|
|
198
|
+
children: n
|
|
199
|
+
})
|
|
200
|
+
]
|
|
201
|
+
}),
|
|
202
|
+
(l || m) && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
|
|
203
|
+
className: _heroCssMisticaJs.actions,
|
|
204
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_buttonGroupJs.default, {
|
|
205
|
+
primaryButton: l,
|
|
206
|
+
secondaryButton: p,
|
|
207
|
+
link: m
|
|
208
|
+
})
|
|
209
|
+
})
|
|
210
|
+
]
|
|
211
|
+
});
|
|
212
|
+
}, C = {
|
|
213
|
+
default: _skinContractCssMisticaJs.vars.colors.background,
|
|
214
|
+
alternative: _skinContractCssMisticaJs.vars.colors.backgroundAlternative,
|
|
215
|
+
brand: _skinContractCssMisticaJs.vars.colors.backgroundBrand,
|
|
216
|
+
"brand-secondary": _skinContractCssMisticaJs.vars.colors.backgroundBrand
|
|
217
|
+
}, er = /*#__PURE__*/ _react.forwardRef((_param, l)=>{
|
|
218
|
+
var { height: e , background: o = "default" , media: a , desktopMediaPosition: i = "left" , dataAttributes: d } = _param, n = _objectWithoutProperties(_param, [
|
|
219
|
+
"height",
|
|
220
|
+
"background",
|
|
221
|
+
"media",
|
|
222
|
+
"desktopMediaPosition",
|
|
223
|
+
"dataAttributes"
|
|
224
|
+
]);
|
|
225
|
+
const { isTabletOrSmaller: p } = (0, _hooksJs.useScreenSize)(), m = (0, _carouselJs.useIsInsideSlideshowContext)(), h = o === "brand" || o === "brand-secondary";
|
|
226
|
+
if (p) return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_imageJs.MediaBorderRadiusProvider, {
|
|
227
|
+
value: !1,
|
|
228
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)("div", _objectSpreadProps(_objectSpread({}, (0, _domJs.getPrefixedDataAttributes)(_objectSpread({
|
|
229
|
+
"component-name": "Hero"
|
|
230
|
+
}, d))), {
|
|
231
|
+
ref: l,
|
|
232
|
+
style: _objectSpread({
|
|
233
|
+
backgroundColor: C[o]
|
|
234
|
+
}, e === "100vh" ? {
|
|
235
|
+
maxHeight: "-webkit-fill-available"
|
|
236
|
+
} : {}, (0, _dynamic.assignInlineVars)({
|
|
237
|
+
[_heroCssMisticaJs.vars.height]: e != null ? e : "100%"
|
|
238
|
+
})),
|
|
239
|
+
className: (0, _classnames.default)(_heroCssMisticaJs.container, _heroCssMisticaJs.containerMobile),
|
|
240
|
+
children: [
|
|
241
|
+
a,
|
|
242
|
+
/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(k, {
|
|
243
|
+
isInverse: h,
|
|
244
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_boxJs.default, {
|
|
245
|
+
paddingTop: 24,
|
|
246
|
+
paddingBottom: m ? 48 : 24,
|
|
247
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(v, _objectSpread({}, n))
|
|
248
|
+
})
|
|
249
|
+
})
|
|
250
|
+
]
|
|
251
|
+
}))
|
|
252
|
+
});
|
|
253
|
+
const H = i === "left" ? a : /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_boxJs.default, {
|
|
254
|
+
paddingRight: 24,
|
|
255
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(v, _objectSpread({}, n))
|
|
256
|
+
}), I = i === "right" ? a : /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_boxJs.default, {
|
|
257
|
+
paddingLeft: 24,
|
|
258
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(v, _objectSpread({}, n))
|
|
259
|
+
});
|
|
260
|
+
return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_imageJs.MediaBorderRadiusProvider, {
|
|
261
|
+
value: !0,
|
|
262
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", _objectSpreadProps(_objectSpread({}, (0, _domJs.getPrefixedDataAttributes)(_objectSpread({
|
|
263
|
+
"component-name": "Hero"
|
|
264
|
+
}, d))), {
|
|
265
|
+
ref: l,
|
|
266
|
+
style: _objectSpread({
|
|
267
|
+
backgroundColor: C[o]
|
|
268
|
+
}, e === "100vh" ? {
|
|
269
|
+
maxHeight: "-webkit-fill-available"
|
|
270
|
+
} : {}, (0, _dynamic.assignInlineVars)({
|
|
271
|
+
[_heroCssMisticaJs.vars.height]: e != null ? e : "100%"
|
|
272
|
+
})),
|
|
273
|
+
className: (0, _sprinklesCssMisticaJs.sprinkles)({
|
|
274
|
+
height: "100%",
|
|
275
|
+
display: "flex",
|
|
276
|
+
alignItems: "center"
|
|
277
|
+
}),
|
|
278
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(k, {
|
|
279
|
+
isInverse: h,
|
|
280
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_gridLayoutJs.default, {
|
|
281
|
+
template: "6+6",
|
|
282
|
+
left: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_boxJs.default, {
|
|
283
|
+
paddingY: 56,
|
|
284
|
+
className: (0, _classnames.default)(_heroCssMisticaJs.container, _heroCssMisticaJs.containerDesktop),
|
|
285
|
+
children: H
|
|
286
|
+
}),
|
|
287
|
+
right: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_boxJs.default, {
|
|
288
|
+
paddingY: 56,
|
|
289
|
+
className: (0, _classnames.default)(_heroCssMisticaJs.container, _heroCssMisticaJs.containerDesktop),
|
|
290
|
+
children: I
|
|
291
|
+
})
|
|
292
|
+
})
|
|
293
|
+
})
|
|
294
|
+
}))
|
|
295
|
+
});
|
|
296
|
+
});
|
package/dist/image.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { DataAttributes } from './utils/types';
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
3
|
+
export declare const useMediaBorderRadius: () => boolean;
|
|
4
|
+
export declare const MediaBorderRadiusProvider: ({ children, value, }: {
|
|
5
5
|
children: React.ReactNode;
|
|
6
|
+
value: boolean;
|
|
6
7
|
}) => JSX.Element;
|
|
7
8
|
export type AspectRatio = '1:1' | '16:9' | '7:10' | '4:3';
|
|
8
9
|
export declare const RATIO: {
|
package/dist/image.js
CHANGED
|
@@ -9,10 +9,10 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
12
|
+
MediaBorderRadiusProvider: ()=>r1,
|
|
13
13
|
RATIO: ()=>U,
|
|
14
|
-
default: ()=>
|
|
15
|
-
|
|
14
|
+
default: ()=>s1,
|
|
15
|
+
useMediaBorderRadius: ()=>O
|
|
16
16
|
});
|
|
17
17
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
18
18
|
const _classnames = /*#__PURE__*/ _interopRequireDefault(require("classnames"));
|
|
@@ -150,10 +150,10 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
150
150
|
}
|
|
151
151
|
return target;
|
|
152
152
|
}
|
|
153
|
-
const k = /*#__PURE__*/ _react.createContext(!
|
|
154
|
-
let { children: t } = param;
|
|
153
|
+
const k = /*#__PURE__*/ _react.createContext(!0), O = ()=>_react.useContext(k), r1 = (param)=>/* @__PURE__ */ {
|
|
154
|
+
let { children: t , value: r } = param;
|
|
155
155
|
return (0, _jsxRuntimeJs.jsx)(k.Provider, {
|
|
156
|
-
value:
|
|
156
|
+
value: r,
|
|
157
157
|
children: t
|
|
158
158
|
});
|
|
159
159
|
}, P = (param)=>/* @__PURE__ */ {
|
|
@@ -172,7 +172,7 @@ const k = /*#__PURE__*/ _react.createContext(!1), O = ()=>_react.useContext(k),
|
|
|
172
172
|
});
|
|
173
173
|
}, K = (param)=>{
|
|
174
174
|
let { noBorderRadius: t } = param;
|
|
175
|
-
const r = (0, _themeVariantContextJs.useIsInverseVariant)(), { skinName:
|
|
175
|
+
const r = (0, _themeVariantContextJs.useIsInverseVariant)(), { skinName: c } = (0, _hooksJs.useTheme)();
|
|
176
176
|
return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
|
|
177
177
|
style: {
|
|
178
178
|
height: "100%",
|
|
@@ -183,7 +183,7 @@ const k = /*#__PURE__*/ _react.createContext(!1), O = ()=>_react.useContext(k),
|
|
|
183
183
|
backgroundColor: r ? _skinContractCssMisticaJs.vars.colors.backgroundSkeletonInverse : _skinContractCssMisticaJs.vars.colors.backgroundSkeleton,
|
|
184
184
|
borderRadius: t ? void 0 : 8
|
|
185
185
|
},
|
|
186
|
-
children:
|
|
186
|
+
children: c === _constantsJs.VIVO_SKIN ? /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(P, {
|
|
187
187
|
style: {
|
|
188
188
|
width: "10%",
|
|
189
189
|
minWidth: 24,
|
|
@@ -208,8 +208,8 @@ const k = /*#__PURE__*/ _react.createContext(!1), O = ()=>_react.useContext(k),
|
|
|
208
208
|
"16:9": 16 / 9,
|
|
209
209
|
"7:10": 7 / 10,
|
|
210
210
|
"4:3": 4 / 3
|
|
211
|
-
},
|
|
212
|
-
var { aspectRatio: t = "1:1" , alt: r = "" , dataAttributes:
|
|
211
|
+
}, s1 = /*#__PURE__*/ _react.forwardRef((_param, y)=>{
|
|
212
|
+
var { aspectRatio: t = "1:1" , alt: r = "" , dataAttributes: c , noBorderRadius: l , src: I , onError: d , onLoad: a , loadingFallback: p = !0 , errorFallback: x = !0 } = _param, o = _objectWithoutProperties(_param, [
|
|
213
213
|
"aspectRatio",
|
|
214
214
|
"alt",
|
|
215
215
|
"dataAttributes",
|
|
@@ -220,13 +220,13 @@ const k = /*#__PURE__*/ _react.createContext(!1), O = ()=>_react.useContext(k),
|
|
|
220
220
|
"loadingFallback",
|
|
221
221
|
"errorFallback"
|
|
222
222
|
]);
|
|
223
|
-
const C = _react.useRef(), R = O(), m =
|
|
223
|
+
const C = _react.useRef(), R = O(), m = l != null ? l : !R, [u, f] = _react.useState(!1), [S, g] = _react.useState(!0), [M, v] = _react.useState(!1), n = typeof t == "number" ? t : U[t], b = p && !!(n !== 0 || o.width && o.height), H = x && !!(n !== 0 || o.width && o.height), h = _react.useCallback(()=>{
|
|
224
224
|
f(!1), g(!1), setTimeout(()=>{
|
|
225
225
|
v(!0);
|
|
226
226
|
}, _imageCssMisticaJs.FADE_IN_DURATION_MS), a == null || a();
|
|
227
227
|
}, [
|
|
228
228
|
a
|
|
229
|
-
]), z = /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("img", _objectSpreadProps(_objectSpread({}, (0, _domJs.getPrefixedDataAttributes)(
|
|
229
|
+
]), z = /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("img", _objectSpreadProps(_objectSpread({}, (0, _domJs.getPrefixedDataAttributes)(c)), {
|
|
230
230
|
style: _objectSpread({}, S && b ? {
|
|
231
231
|
opacity: 0
|
|
232
232
|
} : {
|
|
@@ -257,7 +257,7 @@ const k = /*#__PURE__*/ _react.createContext(!1), O = ()=>_react.useContext(k),
|
|
|
257
257
|
width: o.width,
|
|
258
258
|
height: o.height,
|
|
259
259
|
children: [
|
|
260
|
-
b && !
|
|
260
|
+
b && !M && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
|
|
261
261
|
style: {
|
|
262
262
|
position: "absolute",
|
|
263
263
|
width: "100%",
|
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export { default as HighlightedCard } from './highlighted-card';
|
|
|
51
51
|
export { default as Stepper } from './stepper';
|
|
52
52
|
export { default as ProgressBar } from './progress-bar';
|
|
53
53
|
export { MediaCard, DataCard, SnapCard } from './card';
|
|
54
|
+
export { default as Hero } from './hero';
|
|
54
55
|
export { default as Divider } from './divider';
|
|
55
56
|
export { default as Menu } from './menu';
|
|
56
57
|
export { default as EmptyState } from './empty-state';
|
package/dist/index.js
CHANGED
|
@@ -52,6 +52,7 @@ _export(exports, {
|
|
|
52
52
|
GridLayout: ()=>_gridLayoutJs.default,
|
|
53
53
|
Header: ()=>_headerJs.Header,
|
|
54
54
|
HeaderLayout: ()=>_headerJs.HeaderLayout,
|
|
55
|
+
Hero: ()=>_heroJs.default,
|
|
55
56
|
HighlightedCard: ()=>_highlightedCardJs.default,
|
|
56
57
|
IbanField: ()=>_ibanFieldJs.default,
|
|
57
58
|
Icon2GFilled: ()=>_icon2GFilledJs.default,
|
|
@@ -1873,6 +1874,7 @@ const _highlightedCardJs = /*#__PURE__*/ _interopRequireDefault(require("./highl
|
|
|
1873
1874
|
const _stepperJs = /*#__PURE__*/ _interopRequireDefault(require("./stepper.js"));
|
|
1874
1875
|
const _progressBarJs = /*#__PURE__*/ _interopRequireDefault(require("./progress-bar.js"));
|
|
1875
1876
|
const _cardJs = require("./card.js");
|
|
1877
|
+
const _heroJs = /*#__PURE__*/ _interopRequireDefault(require("./hero.js"));
|
|
1876
1878
|
const _dividerJs = /*#__PURE__*/ _interopRequireDefault(require("./divider.js"));
|
|
1877
1879
|
const _menuJs = /*#__PURE__*/ _interopRequireDefault(require("./menu.js"));
|
|
1878
1880
|
const _emptyStateJs = /*#__PURE__*/ _interopRequireDefault(require("./empty-state.js"));
|
package/dist/package-version.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export declare const MOBILE_SIDE_MARGIN = 16;
|
|
2
|
+
export declare const TABLET_SIDE_MARGIN = 32;
|
|
3
|
+
export declare const SMALL_DESKTOP_SIDE_MARGIN = 40;
|
|
4
|
+
export declare const LARGE_DESKTOP_MAX_WIDTH = 1224;
|
|
1
5
|
export declare const vars: {
|
|
2
6
|
sideMargin: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
3
7
|
};
|
package/dist/search-field.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export interface SearchFieldProps extends CommonFormFieldProps {
|
|
|
4
4
|
onChangeValue?: (value: string, rawValue: string) => void;
|
|
5
5
|
getSuggestions?: (value: string) => ReadonlyArray<string>;
|
|
6
6
|
}
|
|
7
|
-
declare const SearchField: React.
|
|
7
|
+
declare const SearchField: React.ForwardRefExoticComponent<SearchFieldProps & React.RefAttributes<any>>;
|
|
8
8
|
export default SearchField;
|
package/dist/search-field.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()=>
|
|
7
|
+
get: ()=>O
|
|
8
8
|
});
|
|
9
9
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
10
10
|
const _formContextJs = require("./form-context.js");
|
|
@@ -14,6 +14,7 @@ const _iconCloseRegularJs = /*#__PURE__*/ _interopRequireDefault(require("./gene
|
|
|
14
14
|
const _iconButtonJs = /*#__PURE__*/ _interopRequireDefault(require("./icon-button.js"));
|
|
15
15
|
const _hooksJs = require("./hooks.js");
|
|
16
16
|
const _domJs = require("./utils/dom.js");
|
|
17
|
+
const _commonJs = require("./utils/common.js");
|
|
17
18
|
const _jsxRuntimeJs = require("./_virtual/jsx-runtime.js");
|
|
18
19
|
function _interopRequireDefault(obj) {
|
|
19
20
|
return obj && obj.__esModule ? obj : {
|
|
@@ -138,8 +139,8 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
138
139
|
}
|
|
139
140
|
return target;
|
|
140
141
|
}
|
|
141
|
-
const
|
|
142
|
-
var { disabled:
|
|
142
|
+
const O = /*#__PURE__*/ _react.forwardRef((_param, S)=>{
|
|
143
|
+
var { disabled: a , error: u , helperText: p , name: d , optional: n , validate: I , onChange: e , onChangeValue: t , onBlur: R , value: l , defaultValue: x } = _param, y = _objectWithoutProperties(_param, [
|
|
143
144
|
"disabled",
|
|
144
145
|
"error",
|
|
145
146
|
"helperText",
|
|
@@ -152,45 +153,45 @@ const M = (_param)=>{
|
|
|
152
153
|
"value",
|
|
153
154
|
"defaultValue"
|
|
154
155
|
]);
|
|
155
|
-
const
|
|
156
|
-
i ||
|
|
156
|
+
const b = (0, _hooksJs.useTheme)(), o = _react.useRef(), [P, v] = _react.useState(x || ""), i = typeof l < "u", m = i ? l : P, f = _react.useCallback((s, h)=>{
|
|
157
|
+
i || v(s), t == null || t(s, h);
|
|
157
158
|
}, [
|
|
158
159
|
i,
|
|
159
|
-
|
|
160
|
-
]),
|
|
161
|
-
|
|
160
|
+
t
|
|
161
|
+
]), B = _react.useCallback(()=>{
|
|
162
|
+
f("", ""), o.current && (e == null || e((0, _domJs.createChangeEvent)(o.current, "")), o.current.focus());
|
|
162
163
|
}, [
|
|
163
|
-
|
|
164
|
+
f,
|
|
164
165
|
e
|
|
165
|
-
]),
|
|
166
|
+
]), F = (0, _formContextJs.useFieldProps)({
|
|
166
167
|
name: d,
|
|
167
|
-
value:
|
|
168
|
+
value: m,
|
|
168
169
|
defaultValue: void 0,
|
|
169
|
-
processValue: (
|
|
170
|
+
processValue: (s)=>s,
|
|
170
171
|
helperText: p,
|
|
171
172
|
optional: n,
|
|
172
173
|
error: u,
|
|
173
|
-
disabled:
|
|
174
|
-
onBlur:
|
|
174
|
+
disabled: a,
|
|
175
|
+
onBlur: R,
|
|
175
176
|
validate: I,
|
|
176
177
|
onChange: e,
|
|
177
|
-
onChangeValue:
|
|
178
|
+
onChangeValue: f
|
|
178
179
|
});
|
|
179
180
|
return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_textFieldBaseJs.TextFieldBaseAutosuggest, _objectSpreadProps(_objectSpread({
|
|
180
|
-
ref:
|
|
181
|
+
ref: (0, _commonJs.combineRefs)(o, S),
|
|
181
182
|
startIcon: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconSearchJs.default, {}),
|
|
182
|
-
endIcon:
|
|
183
|
+
endIcon: m ? /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconButtonJs.default, {
|
|
183
184
|
size: 48,
|
|
184
185
|
style: {
|
|
185
186
|
display: "flex",
|
|
186
187
|
padding: 12,
|
|
187
188
|
margin: -12
|
|
188
189
|
},
|
|
189
|
-
"aria-label":
|
|
190
|
-
onPress:
|
|
190
|
+
"aria-label": b.texts.formSearchClear,
|
|
191
|
+
onPress: B,
|
|
191
192
|
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconCloseRegularJs.default, {})
|
|
192
193
|
}) : void 0
|
|
193
|
-
},
|
|
194
|
+
}, y, F), {
|
|
194
195
|
type: "search"
|
|
195
196
|
}));
|
|
196
|
-
};
|
|
197
|
+
});
|
package/dist/video.js
CHANGED
|
@@ -9,7 +9,7 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
RATIO: ()=>
|
|
12
|
+
RATIO: ()=>C,
|
|
13
13
|
default: ()=>j
|
|
14
14
|
});
|
|
15
15
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
@@ -138,13 +138,13 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
138
138
|
}
|
|
139
139
|
return target;
|
|
140
140
|
}
|
|
141
|
-
const
|
|
141
|
+
const C = {
|
|
142
142
|
"1:1": 1,
|
|
143
143
|
"16:9": 16 / 9,
|
|
144
144
|
"12:5": 12 / 5,
|
|
145
145
|
"4:3": 4 / 3
|
|
146
|
-
},
|
|
147
|
-
var { src: t , poster: i , autoPlay: o = !(0, _platformJs.isRunningAcceptanceTest)() , muted:
|
|
146
|
+
}, F = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC", j = /*#__PURE__*/ _react.forwardRef((_param, l)=>{
|
|
147
|
+
var { src: t , poster: i , autoPlay: o = !(0, _platformJs.isRunningAcceptanceTest)() , muted: c = !0 , loop: m = !0 , preload: u = "none" , aspectRatio: A = "1:1" , dataAttributes: f } = _param, n = _objectWithoutProperties(_param, [
|
|
148
148
|
"src",
|
|
149
149
|
"poster",
|
|
150
150
|
"autoPlay",
|
|
@@ -154,9 +154,9 @@ const F = {
|
|
|
154
154
|
"aspectRatio",
|
|
155
155
|
"dataAttributes"
|
|
156
156
|
]);
|
|
157
|
-
const R = (0, _imageJs.
|
|
157
|
+
const R = (0, _imageJs.useMediaBorderRadius)(), p = typeof A == "number" ? A : C[A], d = _react.useRef(null);
|
|
158
158
|
_react.useEffect(()=>{
|
|
159
|
-
const e =
|
|
159
|
+
const e = d.current;
|
|
160
160
|
e && o && e.paused && e.play();
|
|
161
161
|
}, [
|
|
162
162
|
o
|
|
@@ -165,20 +165,20 @@ const F = {
|
|
|
165
165
|
t
|
|
166
166
|
]).map((e)=>typeof e == "string" ? {
|
|
167
167
|
src: e
|
|
168
|
-
} : e),
|
|
169
|
-
ref: (0, _commonJs.combineRefs)(l,
|
|
168
|
+
} : e), a = /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("video", _objectSpreadProps(_objectSpread({
|
|
169
|
+
ref: (0, _commonJs.combineRefs)(l, d),
|
|
170
170
|
playsInline: !0,
|
|
171
171
|
disablePictureInPicture: !0,
|
|
172
172
|
disableRemotePlayback: !0,
|
|
173
173
|
autoPlay: o,
|
|
174
|
-
muted:
|
|
174
|
+
muted: c,
|
|
175
175
|
loop: m,
|
|
176
176
|
className: _videoCssMisticaJs.video,
|
|
177
177
|
preload: u,
|
|
178
|
-
poster: i ||
|
|
178
|
+
poster: i || F
|
|
179
179
|
}, (0, _domJs.getPrefixedDataAttributes)(f)), {
|
|
180
180
|
style: {
|
|
181
|
-
borderRadius: R ?
|
|
181
|
+
borderRadius: R ? 8 : 0
|
|
182
182
|
},
|
|
183
183
|
children: g.map((param, b)=>/* @__PURE__ */ {
|
|
184
184
|
let { src: e , type: h } = param;
|
|
@@ -200,7 +200,7 @@ const F = {
|
|
|
200
200
|
backgroundSize: "cover",
|
|
201
201
|
backgroundPosition: "50% 50%"
|
|
202
202
|
},
|
|
203
|
-
children:
|
|
204
|
-
}) :
|
|
203
|
+
children: a
|
|
204
|
+
}) : a
|
|
205
205
|
});
|
|
206
206
|
});
|