@telefonica/mistica 13.2.3 → 13.4.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/header.d.ts +5 -1
- package/dist/header.js +22 -22
- 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/header.js +33 -33
- 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-es/header.js
CHANGED
|
@@ -87,9 +87,9 @@ import v from "./overscroll-color-context.js";
|
|
|
87
87
|
import { Text6 as B, Text3 as u, Text8 as R, Text7 as j } from "./text.js";
|
|
88
88
|
import G from "./button-group.js";
|
|
89
89
|
import { vars as p } from "./skins/skin-contract.css-mistica.js";
|
|
90
|
-
import { jsxs as
|
|
90
|
+
import { jsxs as t, jsx as r } from "./_virtual/jsx-runtime.js";
|
|
91
91
|
const J = (param)=>{
|
|
92
|
-
let { pretitle: i , title: e , description:
|
|
92
|
+
let { pretitle: i , title: e , description: o , dataAttributes: n , preamount: c , amount: s , button: a , subtitle: g , isErrorAmount: H , secondaryButton: x } = param;
|
|
93
93
|
const { isTabletOrSmaller: L } = h(), O = P(), f = (m, y)=>{
|
|
94
94
|
if (typeof m == "string") return /* @__PURE__ */ r(u, _objectSpreadProps(_objectSpread({
|
|
95
95
|
regular: !0
|
|
@@ -105,13 +105,13 @@ const J = (param)=>{
|
|
|
105
105
|
children: m.text
|
|
106
106
|
}));
|
|
107
107
|
};
|
|
108
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ t(l, {
|
|
109
109
|
space: L ? 24 : 32,
|
|
110
110
|
dataAttributes: n,
|
|
111
111
|
children: [
|
|
112
|
-
(e || i ||
|
|
112
|
+
(e || i || o) && /* @__PURE__ */ r(d, {
|
|
113
113
|
paddingRight: 16,
|
|
114
|
-
children: /* @__PURE__ */
|
|
114
|
+
children: /* @__PURE__ */ t(l, {
|
|
115
115
|
space: 8,
|
|
116
116
|
children: [
|
|
117
117
|
i && f(i, {
|
|
@@ -122,21 +122,21 @@ const J = (param)=>{
|
|
|
122
122
|
"aria-level": 2,
|
|
123
123
|
children: e
|
|
124
124
|
}),
|
|
125
|
-
|
|
125
|
+
o && /* @__PURE__ */ r(u, {
|
|
126
126
|
regular: !0,
|
|
127
127
|
color: p.colors.textSecondary,
|
|
128
|
-
children:
|
|
128
|
+
children: o
|
|
129
129
|
})
|
|
130
130
|
]
|
|
131
131
|
})
|
|
132
132
|
}),
|
|
133
|
-
(
|
|
133
|
+
(c || s || a || g) && /* @__PURE__ */ t(l, {
|
|
134
134
|
space: 16,
|
|
135
135
|
children: [
|
|
136
|
-
(
|
|
136
|
+
(c || s) && /* @__PURE__ */ t(l, {
|
|
137
137
|
space: 8,
|
|
138
138
|
children: [
|
|
139
|
-
|
|
139
|
+
c && f(c, {
|
|
140
140
|
color: p.colors.textPrimary
|
|
141
141
|
}),
|
|
142
142
|
/* @__PURE__ */ r(R, {
|
|
@@ -145,8 +145,8 @@ const J = (param)=>{
|
|
|
145
145
|
})
|
|
146
146
|
]
|
|
147
147
|
}),
|
|
148
|
-
(
|
|
149
|
-
primaryButton:
|
|
148
|
+
(a || x) && /* @__PURE__ */ r(G, {
|
|
149
|
+
primaryButton: a,
|
|
150
150
|
secondaryButton: x
|
|
151
151
|
}),
|
|
152
152
|
g && f(g, {})
|
|
@@ -155,12 +155,12 @@ const J = (param)=>{
|
|
|
155
155
|
]
|
|
156
156
|
});
|
|
157
157
|
}, K = (param)=>{
|
|
158
|
-
let { title: i , description: e , button:
|
|
158
|
+
let { title: i , description: e , button: o } = param;
|
|
159
159
|
const { isTabletOrSmaller: n } = h();
|
|
160
|
-
return /* @__PURE__ */
|
|
160
|
+
return /* @__PURE__ */ t(l, {
|
|
161
161
|
space: 32,
|
|
162
162
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ t(l, {
|
|
164
164
|
space: n ? 12 : 16,
|
|
165
165
|
children: [
|
|
166
166
|
i && /* @__PURE__ */ r(j, {
|
|
@@ -173,39 +173,39 @@ const J = (param)=>{
|
|
|
173
173
|
})
|
|
174
174
|
]
|
|
175
175
|
}),
|
|
176
|
-
|
|
176
|
+
o
|
|
177
177
|
]
|
|
178
178
|
});
|
|
179
179
|
}, N = (param)=>{
|
|
180
|
-
let { isInverse: i = !0 , breadcrumbs: e , header:
|
|
181
|
-
const { isTabletOrSmaller:
|
|
182
|
-
return /* @__PURE__ */
|
|
180
|
+
let { isInverse: i = !0 , breadcrumbs: e , header: o , extra: n , sideBySideExtraOnDesktop: c = !1 , dataAttributes: s } = param;
|
|
181
|
+
const { isTabletOrSmaller: a } = h();
|
|
182
|
+
return /* @__PURE__ */ t(S, {
|
|
183
183
|
isInverse: i,
|
|
184
184
|
dataAttributes: _objectSpread({
|
|
185
185
|
"component-name": "HeaderLayout"
|
|
186
186
|
}, s),
|
|
187
187
|
children: [
|
|
188
188
|
/* @__PURE__ */ r(v, {}),
|
|
189
|
-
|
|
190
|
-
paddingTop: 32,
|
|
189
|
+
a ? /* @__PURE__ */ r(d, {
|
|
190
|
+
paddingTop: o ? 32 : 0,
|
|
191
191
|
paddingBottom: 24,
|
|
192
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ t(l, {
|
|
193
193
|
space: 24,
|
|
194
194
|
children: [
|
|
195
|
-
|
|
195
|
+
o,
|
|
196
196
|
n
|
|
197
197
|
]
|
|
198
198
|
})
|
|
199
|
-
}) :
|
|
199
|
+
}) : c ? /* @__PURE__ */ r(d, {
|
|
200
200
|
paddingTop: e ? 16 : 48,
|
|
201
201
|
paddingBottom: 48,
|
|
202
202
|
children: /* @__PURE__ */ r(T, {
|
|
203
203
|
template: "6+6",
|
|
204
|
-
left: /* @__PURE__ */
|
|
204
|
+
left: /* @__PURE__ */ t(l, {
|
|
205
205
|
space: 32,
|
|
206
206
|
children: [
|
|
207
207
|
e,
|
|
208
|
-
|
|
208
|
+
o
|
|
209
209
|
]
|
|
210
210
|
}),
|
|
211
211
|
right: n
|
|
@@ -213,14 +213,14 @@ const J = (param)=>{
|
|
|
213
213
|
}) : /* @__PURE__ */ r(d, {
|
|
214
214
|
paddingTop: e ? 16 : 48,
|
|
215
215
|
paddingBottom: 48,
|
|
216
|
-
children: /* @__PURE__ */
|
|
217
|
-
space:
|
|
216
|
+
children: /* @__PURE__ */ t(l, {
|
|
217
|
+
space: a ? 24 : 32,
|
|
218
218
|
children: [
|
|
219
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ t(l, {
|
|
220
220
|
space: 32,
|
|
221
221
|
children: [
|
|
222
222
|
e,
|
|
223
|
-
|
|
223
|
+
o
|
|
224
224
|
]
|
|
225
225
|
}),
|
|
226
226
|
n
|
|
@@ -231,12 +231,12 @@ const J = (param)=>{
|
|
|
231
231
|
});
|
|
232
232
|
}, Q = (param)=>{
|
|
233
233
|
let { isInverse: i = !0 , children: e } = param;
|
|
234
|
-
const { isTabletOrSmaller:
|
|
235
|
-
return /* @__PURE__ */
|
|
234
|
+
const { isTabletOrSmaller: o } = h();
|
|
235
|
+
return /* @__PURE__ */ t(S, {
|
|
236
236
|
isInverse: i,
|
|
237
237
|
children: [
|
|
238
238
|
/* @__PURE__ */ r(v, {}),
|
|
239
|
-
|
|
239
|
+
o ? /* @__PURE__ */ r(d, {
|
|
240
240
|
paddingTop: 12,
|
|
241
241
|
paddingBottom: 24,
|
|
242
242
|
children: e
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./sprinkles.css.ts.vanilla.js";
|
|
2
|
+
import "./responsive-layout.css.ts.vanilla.js";
|
|
3
|
+
import "./hero.css.ts.vanilla.js";
|
|
4
|
+
var t = "_16rbpto6 _1y2v1nf5g _1y2v1nf62 _1y2v1nf5w", n = "_16rbpto2 _1y2v1nf5g", a = "_1y2v1nf5v _1y2v1nf83", _ = "_1y2v1nf5m", i = "_16rbpto7", p = {
|
|
5
|
+
height: "var(--_16rbpto0)"
|
|
6
|
+
};
|
|
7
|
+
export { t as actions, n as container, a as containerDesktop, _ as containerMobile, i as layout, p as vars };
|
package/dist-es/hero.js
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
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 ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _objectSpreadProps(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
function _objectWithoutProperties(source, excluded) {
|
|
54
|
+
if (source == null) return {};
|
|
55
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
56
|
+
var key, i;
|
|
57
|
+
if (Object.getOwnPropertySymbols) {
|
|
58
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
59
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
60
|
+
key = sourceSymbolKeys[i];
|
|
61
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
62
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
63
|
+
target[key] = source[key];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return target;
|
|
67
|
+
}
|
|
68
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
69
|
+
if (source == null) return {};
|
|
70
|
+
var target = {};
|
|
71
|
+
var sourceKeys = Object.keys(source);
|
|
72
|
+
var key, i;
|
|
73
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
74
|
+
key = sourceKeys[i];
|
|
75
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
76
|
+
target[key] = source[key];
|
|
77
|
+
}
|
|
78
|
+
return target;
|
|
79
|
+
}
|
|
80
|
+
import * as R from "react";
|
|
81
|
+
import f from "classnames";
|
|
82
|
+
import { useScreenSize as T } from "./hooks.js";
|
|
83
|
+
import { MediaBorderRadiusProvider as g } from "./image.js";
|
|
84
|
+
import { Text3 as x, Text8 as D } from "./text.js";
|
|
85
|
+
import O from "./grid-layout.js";
|
|
86
|
+
import t from "./box.js";
|
|
87
|
+
import b from "./stack.js";
|
|
88
|
+
import j from "./button-group.js";
|
|
89
|
+
import { vars as s } from "./skins/skin-contract.css-mistica.js";
|
|
90
|
+
import { vars as y, container as u, containerMobile as G, containerDesktop as B, layout as L, actions as A } from "./hero.css-mistica.js";
|
|
91
|
+
import { assignInlineVars as N } from "@vanilla-extract/dynamic";
|
|
92
|
+
import { useIsInsideSlideshowContext as V } from "./carousel.js";
|
|
93
|
+
import { getPrefixedDataAttributes as S } from "./utils/dom.js";
|
|
94
|
+
import { sprinkles as w } from "./sprinkles.css-mistica.js";
|
|
95
|
+
import { ThemeVariant as Y } from "./theme-variant-context.js";
|
|
96
|
+
import { jsx as r, jsxs as c } from "./_virtual/jsx-runtime.js";
|
|
97
|
+
const k = (param)=>/* @__PURE__ */ {
|
|
98
|
+
let { children: e , isInverse: o } = param;
|
|
99
|
+
return r(Y, {
|
|
100
|
+
isInverse: o,
|
|
101
|
+
children: /* @__PURE__ */ r("div", {
|
|
102
|
+
className: L,
|
|
103
|
+
children: e
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
}, v = (param)=>/* @__PURE__ */ {
|
|
107
|
+
let { headline: e , title: o , pretitle: a , description: i , descriptionLinesMax: d , extra: n , button: l , secondaryButton: p , buttonLink: m } = param;
|
|
108
|
+
return c("section", {
|
|
109
|
+
className: w({
|
|
110
|
+
height: "100%",
|
|
111
|
+
display: "flex",
|
|
112
|
+
justifyContent: "space-between",
|
|
113
|
+
flexDirection: "column"
|
|
114
|
+
}),
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ c("div", {
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ c(b, {
|
|
119
|
+
space: 16,
|
|
120
|
+
children: [
|
|
121
|
+
e && e,
|
|
122
|
+
/* @__PURE__ */ c(b, {
|
|
123
|
+
space: 8,
|
|
124
|
+
children: [
|
|
125
|
+
a && /* @__PURE__ */ r(x, {
|
|
126
|
+
as: "p",
|
|
127
|
+
regular: !0,
|
|
128
|
+
children: a
|
|
129
|
+
}),
|
|
130
|
+
o && /* @__PURE__ */ r(D, {
|
|
131
|
+
as: "h1",
|
|
132
|
+
children: o
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
}),
|
|
136
|
+
i && /* @__PURE__ */ r(x, {
|
|
137
|
+
as: "p",
|
|
138
|
+
regular: !0,
|
|
139
|
+
color: s.colors.textSecondary,
|
|
140
|
+
truncate: d,
|
|
141
|
+
children: i
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
}),
|
|
145
|
+
n && /* @__PURE__ */ r("div", {
|
|
146
|
+
children: n
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
}),
|
|
150
|
+
(l || m) && /* @__PURE__ */ r("div", {
|
|
151
|
+
className: A,
|
|
152
|
+
children: /* @__PURE__ */ r(j, {
|
|
153
|
+
primaryButton: l,
|
|
154
|
+
secondaryButton: p,
|
|
155
|
+
link: m
|
|
156
|
+
})
|
|
157
|
+
})
|
|
158
|
+
]
|
|
159
|
+
});
|
|
160
|
+
}, C = {
|
|
161
|
+
default: s.colors.background,
|
|
162
|
+
alternative: s.colors.backgroundAlternative,
|
|
163
|
+
brand: s.colors.backgroundBrand,
|
|
164
|
+
"brand-secondary": s.colors.backgroundBrand
|
|
165
|
+
}, er = /*#__PURE__*/ R.forwardRef((_param, l)=>{
|
|
166
|
+
var { height: e , background: o = "default" , media: a , desktopMediaPosition: i = "left" , dataAttributes: d } = _param, n = _objectWithoutProperties(_param, [
|
|
167
|
+
"height",
|
|
168
|
+
"background",
|
|
169
|
+
"media",
|
|
170
|
+
"desktopMediaPosition",
|
|
171
|
+
"dataAttributes"
|
|
172
|
+
]);
|
|
173
|
+
const { isTabletOrSmaller: p } = T(), m = V(), h = o === "brand" || o === "brand-secondary";
|
|
174
|
+
if (p) return /* @__PURE__ */ r(g, {
|
|
175
|
+
value: !1,
|
|
176
|
+
children: /* @__PURE__ */ c("div", _objectSpreadProps(_objectSpread({}, S(_objectSpread({
|
|
177
|
+
"component-name": "Hero"
|
|
178
|
+
}, d))), {
|
|
179
|
+
ref: l,
|
|
180
|
+
style: _objectSpread({
|
|
181
|
+
backgroundColor: C[o]
|
|
182
|
+
}, e === "100vh" ? {
|
|
183
|
+
maxHeight: "-webkit-fill-available"
|
|
184
|
+
} : {}, N({
|
|
185
|
+
[y.height]: e != null ? e : "100%"
|
|
186
|
+
})),
|
|
187
|
+
className: f(u, G),
|
|
188
|
+
children: [
|
|
189
|
+
a,
|
|
190
|
+
/* @__PURE__ */ r(k, {
|
|
191
|
+
isInverse: h,
|
|
192
|
+
children: /* @__PURE__ */ r(t, {
|
|
193
|
+
paddingTop: 24,
|
|
194
|
+
paddingBottom: m ? 48 : 24,
|
|
195
|
+
children: /* @__PURE__ */ r(v, _objectSpread({}, n))
|
|
196
|
+
})
|
|
197
|
+
})
|
|
198
|
+
]
|
|
199
|
+
}))
|
|
200
|
+
});
|
|
201
|
+
const H = i === "left" ? a : /* @__PURE__ */ r(t, {
|
|
202
|
+
paddingRight: 24,
|
|
203
|
+
children: /* @__PURE__ */ r(v, _objectSpread({}, n))
|
|
204
|
+
}), I = i === "right" ? a : /* @__PURE__ */ r(t, {
|
|
205
|
+
paddingLeft: 24,
|
|
206
|
+
children: /* @__PURE__ */ r(v, _objectSpread({}, n))
|
|
207
|
+
});
|
|
208
|
+
return /* @__PURE__ */ r(g, {
|
|
209
|
+
value: !0,
|
|
210
|
+
children: /* @__PURE__ */ r("div", _objectSpreadProps(_objectSpread({}, S(_objectSpread({
|
|
211
|
+
"component-name": "Hero"
|
|
212
|
+
}, d))), {
|
|
213
|
+
ref: l,
|
|
214
|
+
style: _objectSpread({
|
|
215
|
+
backgroundColor: C[o]
|
|
216
|
+
}, e === "100vh" ? {
|
|
217
|
+
maxHeight: "-webkit-fill-available"
|
|
218
|
+
} : {}, N({
|
|
219
|
+
[y.height]: e != null ? e : "100%"
|
|
220
|
+
})),
|
|
221
|
+
className: w({
|
|
222
|
+
height: "100%",
|
|
223
|
+
display: "flex",
|
|
224
|
+
alignItems: "center"
|
|
225
|
+
}),
|
|
226
|
+
children: /* @__PURE__ */ r(k, {
|
|
227
|
+
isInverse: h,
|
|
228
|
+
children: /* @__PURE__ */ r(O, {
|
|
229
|
+
template: "6+6",
|
|
230
|
+
left: /* @__PURE__ */ r(t, {
|
|
231
|
+
paddingY: 56,
|
|
232
|
+
className: f(u, B),
|
|
233
|
+
children: H
|
|
234
|
+
}),
|
|
235
|
+
right: /* @__PURE__ */ r(t, {
|
|
236
|
+
paddingY: 56,
|
|
237
|
+
className: f(u, B),
|
|
238
|
+
children: I
|
|
239
|
+
})
|
|
240
|
+
})
|
|
241
|
+
})
|
|
242
|
+
}))
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
export { er as default };
|
package/dist-es/image.js
CHANGED
|
@@ -79,21 +79,21 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
79
79
|
}
|
|
80
80
|
import * as i from "react";
|
|
81
81
|
import A from "classnames";
|
|
82
|
-
import { SkeletonRectangle as
|
|
83
|
-
import { AspectRatioElement as
|
|
84
|
-
import { getPrefixedDataAttributes as
|
|
85
|
-
import { useIsInverseVariant as
|
|
86
|
-
import { useTheme as
|
|
87
|
-
import { VIVO_SKIN as
|
|
88
|
-
import { sprinkles as
|
|
89
|
-
import { FADE_IN_DURATION_MS as
|
|
82
|
+
import { SkeletonRectangle as F } from "./skeletons.js";
|
|
83
|
+
import { AspectRatioElement as N } from "./utils/aspect-ratio-support.js";
|
|
84
|
+
import { getPrefixedDataAttributes as V } from "./utils/dom.js";
|
|
85
|
+
import { useIsInverseVariant as W } from "./theme-variant-context.js";
|
|
86
|
+
import { useTheme as B } from "./hooks.js";
|
|
87
|
+
import { VIVO_SKIN as E } from "./skins/constants.js";
|
|
88
|
+
import { sprinkles as L } from "./sprinkles.css-mistica.js";
|
|
89
|
+
import { FADE_IN_DURATION_MS as T, image as _ } from "./image.css-mistica.js";
|
|
90
90
|
import { vars as s } from "./skins/skin-contract.css-mistica.js";
|
|
91
|
-
import { combineRefs as
|
|
92
|
-
import { jsx as e, jsxs as
|
|
93
|
-
const k = /*#__PURE__*/ i.createContext(!
|
|
94
|
-
let { children: t } = param;
|
|
91
|
+
import { combineRefs as j } from "./utils/common.js";
|
|
92
|
+
import { jsx as e, jsxs as D } from "./_virtual/jsx-runtime.js";
|
|
93
|
+
const k = /*#__PURE__*/ i.createContext(!0), O = ()=>i.useContext(k), r1 = (param)=>/* @__PURE__ */ {
|
|
94
|
+
let { children: t , value: r } = param;
|
|
95
95
|
return e(k.Provider, {
|
|
96
|
-
value:
|
|
96
|
+
value: r,
|
|
97
97
|
children: t
|
|
98
98
|
});
|
|
99
99
|
}, P = (param)=>/* @__PURE__ */ {
|
|
@@ -112,7 +112,7 @@ const k = /*#__PURE__*/ i.createContext(!1), O = ()=>i.useContext(k), s1 = (para
|
|
|
112
112
|
});
|
|
113
113
|
}, K = (param)=>{
|
|
114
114
|
let { noBorderRadius: t } = param;
|
|
115
|
-
const r =
|
|
115
|
+
const r = W(), { skinName: c } = B();
|
|
116
116
|
return /* @__PURE__ */ e("div", {
|
|
117
117
|
style: {
|
|
118
118
|
height: "100%",
|
|
@@ -123,7 +123,7 @@ const k = /*#__PURE__*/ i.createContext(!1), O = ()=>i.useContext(k), s1 = (para
|
|
|
123
123
|
backgroundColor: r ? s.colors.backgroundSkeletonInverse : s.colors.backgroundSkeleton,
|
|
124
124
|
borderRadius: t ? void 0 : 8
|
|
125
125
|
},
|
|
126
|
-
children:
|
|
126
|
+
children: c === E ? /* @__PURE__ */ e(P, {
|
|
127
127
|
style: {
|
|
128
128
|
width: "10%",
|
|
129
129
|
minWidth: 24,
|
|
@@ -148,8 +148,8 @@ const k = /*#__PURE__*/ i.createContext(!1), O = ()=>i.useContext(k), s1 = (para
|
|
|
148
148
|
"16:9": 16 / 9,
|
|
149
149
|
"7:10": 7 / 10,
|
|
150
150
|
"4:3": 4 / 3
|
|
151
|
-
},
|
|
152
|
-
var { aspectRatio: t = "1:1" , alt: r = "" , dataAttributes:
|
|
151
|
+
}, s1 = /*#__PURE__*/ i.forwardRef((_param, y)=>{
|
|
152
|
+
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, [
|
|
153
153
|
"aspectRatio",
|
|
154
154
|
"alt",
|
|
155
155
|
"dataAttributes",
|
|
@@ -160,21 +160,21 @@ const k = /*#__PURE__*/ i.createContext(!1), O = ()=>i.useContext(k), s1 = (para
|
|
|
160
160
|
"loadingFallback",
|
|
161
161
|
"errorFallback"
|
|
162
162
|
]);
|
|
163
|
-
const C = i.useRef(), R = O(), m =
|
|
163
|
+
const C = i.useRef(), R = O(), m = l != null ? l : !R, [u, f] = i.useState(!1), [S, g] = i.useState(!0), [M, v] = i.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 = i.useCallback(()=>{
|
|
164
164
|
f(!1), g(!1), setTimeout(()=>{
|
|
165
165
|
v(!0);
|
|
166
|
-
},
|
|
166
|
+
}, T), a == null || a();
|
|
167
167
|
}, [
|
|
168
168
|
a
|
|
169
|
-
]), z = /* @__PURE__ */ e("img", _objectSpreadProps(_objectSpread({},
|
|
169
|
+
]), z = /* @__PURE__ */ e("img", _objectSpreadProps(_objectSpread({}, V(c)), {
|
|
170
170
|
style: _objectSpread({}, S && b ? {
|
|
171
171
|
opacity: 0
|
|
172
172
|
} : {
|
|
173
173
|
opacity: 1
|
|
174
174
|
}),
|
|
175
|
-
ref:
|
|
175
|
+
ref: j(C, y),
|
|
176
176
|
src: I,
|
|
177
|
-
className: A(
|
|
177
|
+
className: A(_, L({
|
|
178
178
|
position: n !== 0 ? "absolute" : "static",
|
|
179
179
|
borderRadius: m ? void 0 : 8
|
|
180
180
|
})),
|
|
@@ -189,7 +189,7 @@ const k = /*#__PURE__*/ i.createContext(!1), O = ()=>i.useContext(k), s1 = (para
|
|
|
189
189
|
(w = C.current) != null && w.complete && h();
|
|
190
190
|
}, [
|
|
191
191
|
h
|
|
192
|
-
]), /* @__PURE__ */
|
|
192
|
+
]), /* @__PURE__ */ D(N, {
|
|
193
193
|
style: {
|
|
194
194
|
position: "relative"
|
|
195
195
|
},
|
|
@@ -197,13 +197,13 @@ const k = /*#__PURE__*/ i.createContext(!1), O = ()=>i.useContext(k), s1 = (para
|
|
|
197
197
|
width: o.width,
|
|
198
198
|
height: o.height,
|
|
199
199
|
children: [
|
|
200
|
-
b && !
|
|
200
|
+
b && !M && /* @__PURE__ */ e("div", {
|
|
201
201
|
style: {
|
|
202
202
|
position: "absolute",
|
|
203
203
|
width: "100%",
|
|
204
204
|
height: "100%"
|
|
205
205
|
},
|
|
206
|
-
children: /* @__PURE__ */ e(
|
|
206
|
+
children: /* @__PURE__ */ e(F, {
|
|
207
207
|
width: o.width,
|
|
208
208
|
height: o.height,
|
|
209
209
|
noBorderRadius: m
|
|
@@ -223,4 +223,4 @@ const k = /*#__PURE__*/ i.createContext(!1), O = ()=>i.useContext(k), s1 = (para
|
|
|
223
223
|
]
|
|
224
224
|
});
|
|
225
225
|
});
|
|
226
|
-
export {
|
|
226
|
+
export { r1 as MediaBorderRadiusProvider, U as RATIO, s1 as default, O as useMediaBorderRadius };
|