@telefonica/mistica 16.4.0 → 16.5.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/css/vivo-new.css +11 -11
- package/dist/accordion.css-mistica.js +16 -13
- package/dist/accordion.css.d.ts +1 -0
- package/dist/accordion.d.ts +4 -0
- package/dist/accordion.js +110 -93
- package/dist/mosaic.d.ts +6 -2
- package/dist/mosaic.js +50 -48
- package/dist/navigation-bar.css-mistica.js +96 -37
- package/dist/navigation-bar.css.d.ts +27 -1
- package/dist/navigation-bar.d.ts +65 -30
- package/dist/navigation-bar.js +818 -193
- package/dist/package-version.js +1 -1
- package/dist/skins/blau.js +94 -94
- package/dist/skins/movistar.js +94 -94
- package/dist/skins/o2-new.js +94 -94
- package/dist/skins/o2.js +94 -94
- package/dist/skins/telefonica.js +94 -94
- package/dist/skins/tu.js +94 -94
- package/dist/skins/vivo-new.js +98 -98
- package/dist/skins/vivo.js +94 -94
- package/dist/text-tokens.d.ts +4 -0
- package/dist/text-tokens.js +101 -85
- package/dist/theme.js +20 -17
- package/dist-es/accordion.css-mistica.js +7 -7
- package/dist-es/accordion.js +140 -123
- package/dist-es/mosaic.js +73 -71
- package/dist-es/navigation-bar.css-mistica.js +14 -15
- package/dist-es/navigation-bar.js +864 -240
- package/dist-es/package-version.js +1 -1
- package/dist-es/skins/blau.js +94 -94
- package/dist-es/skins/movistar.js +94 -94
- package/dist-es/skins/o2-new.js +94 -94
- package/dist-es/skins/o2.js +94 -94
- package/dist-es/skins/telefonica.js +94 -94
- package/dist-es/skins/tu.js +94 -94
- package/dist-es/skins/vivo-new.js +98 -98
- package/dist-es/skins/vivo.js +94 -94
- package/dist-es/style.css +1 -1
- package/dist-es/text-tokens.js +53 -43
- package/dist-es/theme.js +20 -20
- package/package.json +1 -1
|
@@ -13,32 +13,35 @@ _export(exports, {
|
|
|
13
13
|
return e;
|
|
14
14
|
},
|
|
15
15
|
chevronContainer: function() {
|
|
16
|
-
return
|
|
16
|
+
return r;
|
|
17
17
|
},
|
|
18
18
|
itemContent: function() {
|
|
19
|
-
return
|
|
19
|
+
return a;
|
|
20
20
|
},
|
|
21
21
|
panel: function() {
|
|
22
|
-
return
|
|
22
|
+
return v;
|
|
23
23
|
},
|
|
24
24
|
panelContainer: function() {
|
|
25
|
-
return
|
|
25
|
+
return t;
|
|
26
26
|
},
|
|
27
27
|
panelTransitionClasses: function() {
|
|
28
|
-
return
|
|
28
|
+
return _;
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
rightContentContainer: function() {
|
|
31
31
|
return i;
|
|
32
32
|
},
|
|
33
|
-
|
|
33
|
+
touchableBackground: function() {
|
|
34
34
|
return o;
|
|
35
|
+
},
|
|
36
|
+
touchableBackgroundInverse: function() {
|
|
37
|
+
return x;
|
|
35
38
|
}
|
|
36
39
|
});
|
|
37
40
|
require("./sprinkles.css.ts.vanilla.css-mistica.js");
|
|
38
41
|
require("./accordion.css.ts.vanilla.css-mistica.js");
|
|
39
|
-
var e = "_1y2v1nfib",
|
|
40
|
-
enter: "
|
|
41
|
-
enterActive: "
|
|
42
|
-
exit: "
|
|
43
|
-
exitActive: "
|
|
44
|
-
}, i = "
|
|
42
|
+
var e = "_1y2v1nfib", r = "_8s3szx4", a = "_1y2v1nf7h _1y2v1nf8q _1y2v1nf9z _1y2v1nfb8 _1y2v1nfib _1y2v1nfk6 _1y2v1nf7g _1y2v1nfhq _1y2v1nfis", v = "_8s3szxa", t = "_8s3szx5", _ = {
|
|
43
|
+
enter: "_8s3szx6",
|
|
44
|
+
enterActive: "_8s3szx7",
|
|
45
|
+
exit: "_8s3szx8",
|
|
46
|
+
exitActive: "_8s3szx9"
|
|
47
|
+
}, i = "_8s3szx3", o = "_8s3szx1", x = "_8s3szx2";
|
package/dist/accordion.css.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const itemContent: string;
|
|
2
2
|
export declare const touchableBackground: string;
|
|
3
3
|
export declare const touchableBackgroundInverse: string;
|
|
4
|
+
export declare const rightContentContainer: string;
|
|
4
5
|
export declare const chevronContainer: string;
|
|
5
6
|
export declare const panelContainer: string;
|
|
6
7
|
export declare const panelTransitionClasses: {
|
package/dist/accordion.d.ts
CHANGED
|
@@ -12,6 +12,10 @@ interface AccordionItemContentProps {
|
|
|
12
12
|
dataAttributes?: DataAttributes;
|
|
13
13
|
trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
|
|
14
14
|
role?: string;
|
|
15
|
+
detail?: string;
|
|
16
|
+
right?: React.ReactNode;
|
|
17
|
+
'aria-label'?: string;
|
|
18
|
+
'aria-labelledby'?: string;
|
|
15
19
|
}
|
|
16
20
|
export declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemContentProps & React.RefAttributes<TouchableElement>>;
|
|
17
21
|
type AccordionBaseProps = {
|
package/dist/accordion.js
CHANGED
|
@@ -11,16 +11,16 @@ function _export(target, all) {
|
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
13
|
Accordion: function() {
|
|
14
|
-
return
|
|
14
|
+
return pe;
|
|
15
15
|
},
|
|
16
16
|
AccordionItem: function() {
|
|
17
|
-
return
|
|
17
|
+
return fe;
|
|
18
18
|
},
|
|
19
19
|
BoxedAccordion: function() {
|
|
20
|
-
return
|
|
20
|
+
return xe;
|
|
21
21
|
},
|
|
22
22
|
BoxedAccordionItem: function() {
|
|
23
|
-
return
|
|
23
|
+
return Ie;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -39,6 +39,7 @@ const _boxed = require("./boxed.js");
|
|
|
39
39
|
const _themevariantcontext = require("./theme-variant-context.js");
|
|
40
40
|
const _reacttransitiongroup = require("react-transition-group");
|
|
41
41
|
const _platform = require("./utils/platform.js");
|
|
42
|
+
const _inline = /*#__PURE__*/ _interop_require_default(require("./inline.js"));
|
|
42
43
|
function _interop_require_default(obj) {
|
|
43
44
|
return obj && obj.__esModule ? obj : {
|
|
44
45
|
default: obj
|
|
@@ -164,196 +165,212 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
164
165
|
}
|
|
165
166
|
return target;
|
|
166
167
|
}
|
|
167
|
-
const
|
|
168
|
+
const R = 400, C = /*#__PURE__*/ _react.createContext({
|
|
168
169
|
index: [],
|
|
169
170
|
toggle: ()=>{}
|
|
170
|
-
}),
|
|
171
|
-
let { value:
|
|
172
|
-
const
|
|
171
|
+
}), Q = ()=>_react.useContext(C), N = (param)=>{
|
|
172
|
+
let { value: n, defaultValue: r, onChange: t, singleOpen: c } = param;
|
|
173
|
+
const d = n !== void 0, s = (e)=>e === void 0 ? [] : typeof e == "number" ? [
|
|
173
174
|
e
|
|
174
|
-
] : e, [
|
|
175
|
+
] : e, [a, u] = _react.useState(s(r));
|
|
175
176
|
_react.useEffect(()=>{
|
|
176
|
-
if (
|
|
177
|
+
if (a.length > 1 && c) {
|
|
177
178
|
const e = [
|
|
178
|
-
...
|
|
179
|
+
...a
|
|
179
180
|
];
|
|
180
|
-
e.splice(1),
|
|
181
|
+
e.splice(1), u(e);
|
|
181
182
|
}
|
|
182
183
|
}, [
|
|
183
|
-
|
|
184
|
-
|
|
184
|
+
c,
|
|
185
|
+
a
|
|
185
186
|
]);
|
|
186
|
-
const
|
|
187
|
+
const m = (e, l)=>{
|
|
187
188
|
if (!l) return [
|
|
188
189
|
e
|
|
189
190
|
];
|
|
190
|
-
const
|
|
191
|
+
const p = l.indexOf(e);
|
|
191
192
|
let I = [
|
|
192
193
|
...l
|
|
193
194
|
];
|
|
194
|
-
return
|
|
195
|
+
return p === -1 ? c ? I = [
|
|
195
196
|
e
|
|
196
|
-
] : I.push(e) : I.splice(
|
|
197
|
+
] : I.push(e) : I.splice(p, 1), I;
|
|
197
198
|
}, f = (e)=>{
|
|
198
|
-
if (
|
|
199
|
-
const l = (
|
|
200
|
-
|
|
199
|
+
if (d || u(m(e, a)), t) {
|
|
200
|
+
const l = (d ? s(n) : a).includes(e);
|
|
201
|
+
t(e, !l);
|
|
201
202
|
}
|
|
202
203
|
};
|
|
203
|
-
return
|
|
204
|
-
s(
|
|
204
|
+
return d ? [
|
|
205
|
+
s(n),
|
|
205
206
|
f
|
|
206
207
|
] : [
|
|
207
|
-
|
|
208
|
+
a,
|
|
208
209
|
f
|
|
209
210
|
];
|
|
210
|
-
},
|
|
211
|
-
const r =
|
|
212
|
-
if (r) return Array.from(r.querySelectorAll("[data-accordion-item]")).filter((
|
|
213
|
-
},
|
|
214
|
-
var { content:
|
|
211
|
+
}, W = (n)=>{
|
|
212
|
+
const r = n == null ? void 0 : n.closest("[data-accordion]");
|
|
213
|
+
if (r) return Array.from(r.querySelectorAll("[data-accordion-item]")).filter((t)=>t.closest("[data-accordion]") === r).findIndex((t)=>t === n);
|
|
214
|
+
}, S = /*#__PURE__*/ _react.forwardRef((_param, u)=>{
|
|
215
|
+
var { content: n, dataAttributes: r, trackingEvent: t, right: c, "aria-label": d, "aria-labelledby": s } = _param, a = _object_without_properties(_param, [
|
|
215
216
|
"content",
|
|
216
217
|
"dataAttributes",
|
|
217
|
-
"trackingEvent"
|
|
218
|
+
"trackingEvent",
|
|
219
|
+
"right",
|
|
220
|
+
"aria-label",
|
|
221
|
+
"aria-labelledby"
|
|
218
222
|
]);
|
|
219
|
-
const
|
|
223
|
+
const m = _react.useRef(null), f = _react.useRef(null), { index: e, toggle: l } = Q(), p = (0, _themevariantcontext.useIsInverseOrMediaVariant)(), I = _react.useId(), b = _react.useId(), [x, y] = _react.useState(), h = x !== void 0 && (e == null ? void 0 : e.includes(x));
|
|
220
224
|
return _react.useEffect(()=>{
|
|
221
|
-
|
|
225
|
+
y(W(f.current));
|
|
222
226
|
}, []), /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
|
|
223
|
-
ref:
|
|
227
|
+
ref: f
|
|
224
228
|
}, (0, _dom.getPrefixedDataAttributes)(_object_spread_props(_object_spread({}, r), {
|
|
225
229
|
"accordion-item": !0
|
|
226
230
|
}))), {
|
|
227
231
|
children: [
|
|
228
232
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
|
|
229
|
-
ref:
|
|
230
|
-
className: (0, _classnames.default)(_accordioncssmistica.itemContent,
|
|
233
|
+
ref: u,
|
|
234
|
+
className: (0, _classnames.default)(_accordioncssmistica.itemContent, p ? _accordioncssmistica.touchableBackgroundInverse : _accordioncssmistica.touchableBackground),
|
|
231
235
|
onPress: ()=>{
|
|
232
|
-
|
|
236
|
+
x !== void 0 && l(x);
|
|
233
237
|
},
|
|
234
|
-
trackingEvent:
|
|
235
|
-
"aria-expanded":
|
|
236
|
-
"aria-controls":
|
|
238
|
+
trackingEvent: t,
|
|
239
|
+
"aria-expanded": h,
|
|
240
|
+
"aria-controls": b,
|
|
241
|
+
"aria-label": d,
|
|
242
|
+
"aria-labelledby": s,
|
|
237
243
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
|
|
238
244
|
paddingX: 16,
|
|
239
245
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_list.Content, _object_spread_props(_object_spread({
|
|
240
|
-
labelId:
|
|
241
|
-
},
|
|
242
|
-
right:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
246
|
+
labelId: I
|
|
247
|
+
}, a), {
|
|
248
|
+
right: (param)=>{
|
|
249
|
+
let { centerY: O } = param;
|
|
250
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_inline.default, {
|
|
251
|
+
space: 4,
|
|
252
|
+
alignItems: O ? "center" : void 0,
|
|
253
|
+
className: _accordioncssmistica.rightContentContainer,
|
|
254
|
+
children: [
|
|
255
|
+
c,
|
|
256
|
+
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
257
|
+
className: _accordioncssmistica.chevronContainer,
|
|
258
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevron.default, {
|
|
259
|
+
size: 24,
|
|
260
|
+
transitionDuration: R,
|
|
261
|
+
direction: h ? "up" : "down",
|
|
262
|
+
color: p ? _skincontractcssmistica.vars.colors.inverse : h ? _skincontractcssmistica.vars.colors.neutralHigh : _skincontractcssmistica.vars.colors.neutralMedium
|
|
263
|
+
})
|
|
264
|
+
})
|
|
265
|
+
]
|
|
266
|
+
});
|
|
267
|
+
}
|
|
251
268
|
}))
|
|
252
269
|
})
|
|
253
270
|
}),
|
|
254
271
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_reacttransitiongroup.CSSTransition, {
|
|
255
|
-
in:
|
|
256
|
-
timeout: (0, _platform.isRunningAcceptanceTest)() ? 0 :
|
|
257
|
-
nodeRef:
|
|
272
|
+
in: h,
|
|
273
|
+
timeout: (0, _platform.isRunningAcceptanceTest)() ? 0 : R,
|
|
274
|
+
nodeRef: m,
|
|
258
275
|
classNames: _accordioncssmistica.panelTransitionClasses,
|
|
259
276
|
mountOnEnter: !0,
|
|
260
277
|
unmountOnExit: !0,
|
|
261
278
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
262
279
|
className: _accordioncssmistica.panelContainer,
|
|
263
|
-
ref:
|
|
280
|
+
ref: m,
|
|
264
281
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
265
282
|
className: _accordioncssmistica.panel,
|
|
266
283
|
role: "region",
|
|
267
|
-
"aria-labelledby":
|
|
268
|
-
id:
|
|
284
|
+
"aria-labelledby": I,
|
|
285
|
+
id: b,
|
|
269
286
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
|
|
270
287
|
paddingX: 16,
|
|
271
288
|
paddingBottom: 16,
|
|
272
|
-
children:
|
|
289
|
+
children: n
|
|
273
290
|
})
|
|
274
291
|
})
|
|
275
292
|
})
|
|
276
293
|
})
|
|
277
294
|
]
|
|
278
295
|
}));
|
|
279
|
-
}),
|
|
280
|
-
var { dataAttributes:
|
|
296
|
+
}), fe = /*#__PURE__*/ _react.forwardRef((_param, c)=>{
|
|
297
|
+
var { dataAttributes: n, role: r } = _param, t = _object_without_properties(_param, [
|
|
281
298
|
"dataAttributes",
|
|
282
299
|
"role"
|
|
283
300
|
]);
|
|
284
301
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
285
302
|
role: r,
|
|
286
303
|
className: _accordioncssmistica.accordionItem,
|
|
287
|
-
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
288
|
-
ref:
|
|
304
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(S, _object_spread_props(_object_spread({}, t), {
|
|
305
|
+
ref: c,
|
|
289
306
|
dataAttributes: _object_spread({
|
|
290
307
|
"component-name": "AccordionItem"
|
|
291
|
-
},
|
|
308
|
+
}, n)
|
|
292
309
|
}))
|
|
293
310
|
});
|
|
294
|
-
}),
|
|
295
|
-
let { children:
|
|
296
|
-
const [
|
|
297
|
-
value:
|
|
298
|
-
defaultValue:
|
|
299
|
-
onChange:
|
|
311
|
+
}), pe = (param)=>{
|
|
312
|
+
let { children: n, dataAttributes: r, index: t, defaultIndex: c, onChange: d, singleOpen: s, role: a } = param;
|
|
313
|
+
const [u, m] = N({
|
|
314
|
+
value: t,
|
|
315
|
+
defaultValue: c,
|
|
316
|
+
onChange: d,
|
|
300
317
|
singleOpen: s
|
|
301
|
-
}), f = _react.Children.toArray(
|
|
302
|
-
return /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
318
|
+
}), f = _react.Children.toArray(n).filter(Boolean), e = f.length - 1;
|
|
319
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)(C.Provider, {
|
|
303
320
|
value: {
|
|
304
|
-
index:
|
|
305
|
-
toggle:
|
|
321
|
+
index: u,
|
|
322
|
+
toggle: m
|
|
306
323
|
},
|
|
307
324
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
|
|
308
|
-
role:
|
|
325
|
+
role: a
|
|
309
326
|
}, (0, _dom.getPrefixedDataAttributes)(_object_spread_props(_object_spread({}, r), {
|
|
310
327
|
accordion: !0
|
|
311
328
|
}), "Accordion")), {
|
|
312
|
-
children: f.map((l,
|
|
329
|
+
children: f.map((l, p)=>/* @__PURE__ */ (0, _jsxruntime.jsxs)(_react.Fragment, {
|
|
313
330
|
children: [
|
|
314
331
|
l,
|
|
315
|
-
|
|
332
|
+
p < e && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
|
|
316
333
|
paddingX: 16,
|
|
317
334
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_divider.default, {})
|
|
318
335
|
})
|
|
319
336
|
]
|
|
320
|
-
},
|
|
337
|
+
}, p))
|
|
321
338
|
}))
|
|
322
339
|
});
|
|
323
|
-
},
|
|
324
|
-
var { dataAttributes:
|
|
340
|
+
}, Ie = /*#__PURE__*/ _react.forwardRef((_param, c)=>{
|
|
341
|
+
var { dataAttributes: n, isInverse: r } = _param, t = _object_without_properties(_param, [
|
|
325
342
|
"dataAttributes",
|
|
326
343
|
"isInverse"
|
|
327
344
|
]);
|
|
328
345
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)(_boxed.Boxed, {
|
|
329
|
-
|
|
330
|
-
ref:
|
|
346
|
+
variant: r ? "inverse" : "default",
|
|
347
|
+
ref: c,
|
|
331
348
|
dataAttributes: _object_spread({
|
|
332
349
|
"component-name": "BoxedAccordionItem"
|
|
333
|
-
},
|
|
334
|
-
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
350
|
+
}, n),
|
|
351
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(S, _object_spread({}, t))
|
|
335
352
|
});
|
|
336
|
-
}),
|
|
337
|
-
let { children:
|
|
338
|
-
const [
|
|
339
|
-
value:
|
|
340
|
-
defaultValue:
|
|
341
|
-
onChange:
|
|
353
|
+
}), xe = (param)=>{
|
|
354
|
+
let { children: n, dataAttributes: r, index: t, defaultIndex: c, onChange: d, singleOpen: s, role: a } = param;
|
|
355
|
+
const [u, m] = N({
|
|
356
|
+
value: t,
|
|
357
|
+
defaultValue: c,
|
|
358
|
+
onChange: d,
|
|
342
359
|
singleOpen: s
|
|
343
360
|
});
|
|
344
|
-
return /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
361
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)(C.Provider, {
|
|
345
362
|
value: {
|
|
346
|
-
index:
|
|
347
|
-
toggle:
|
|
363
|
+
index: u,
|
|
364
|
+
toggle: m
|
|
348
365
|
},
|
|
349
366
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_stack.default, {
|
|
350
367
|
space: 16,
|
|
351
|
-
role:
|
|
368
|
+
role: a,
|
|
352
369
|
dataAttributes: _object_spread({
|
|
353
370
|
"component-name": "BoxedAccordion",
|
|
354
371
|
accordion: !0
|
|
355
372
|
}, r),
|
|
356
|
-
children:
|
|
373
|
+
children: n
|
|
357
374
|
})
|
|
358
375
|
});
|
|
359
376
|
};
|
package/dist/mosaic.d.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { DataAttributes } from './utils/types';
|
|
3
|
+
type MosaicItemGridMode = 'horizontal' | 'square' | 'vertical';
|
|
4
|
+
type MosaicItem = React.ReactElement | ((config: {
|
|
5
|
+
gridMode: MosaicItemGridMode;
|
|
6
|
+
}) => React.ReactElement);
|
|
3
7
|
type HorizontalMosaicProps = {
|
|
4
|
-
items: ReadonlyArray<
|
|
8
|
+
items: ReadonlyArray<MosaicItem>;
|
|
5
9
|
withBullets?: boolean;
|
|
6
10
|
free?: boolean;
|
|
7
11
|
dataAttributes?: DataAttributes;
|
|
8
12
|
};
|
|
9
13
|
export declare const HorizontalMosaic: ({ items, withBullets, free, dataAttributes, }: HorizontalMosaicProps) => JSX.Element;
|
|
10
14
|
type VerticalMosaicProps = {
|
|
11
|
-
items: ReadonlyArray<
|
|
15
|
+
items: ReadonlyArray<MosaicItem>;
|
|
12
16
|
dataAttributes?: DataAttributes;
|
|
13
17
|
};
|
|
14
18
|
export declare const VerticalMosaic: ({ items, dataAttributes }: VerticalMosaicProps) => JSX.Element;
|
package/dist/mosaic.js
CHANGED
|
@@ -10,10 +10,10 @@ function _export(target, all) {
|
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
12
|
HorizontalMosaic: function() {
|
|
13
|
-
return
|
|
13
|
+
return G;
|
|
14
14
|
},
|
|
15
15
|
VerticalMosaic: function() {
|
|
16
|
-
return
|
|
16
|
+
return N;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -72,58 +72,60 @@ function _object_spread_props(target, source) {
|
|
|
72
72
|
}
|
|
73
73
|
return target;
|
|
74
74
|
}
|
|
75
|
-
const
|
|
75
|
+
const u = {
|
|
76
76
|
mobile: 8,
|
|
77
77
|
desktop: 16
|
|
78
|
-
},
|
|
79
|
-
|
|
78
|
+
}, t = (n, o)=>typeof n == "function" ? n({
|
|
79
|
+
gridMode: o
|
|
80
|
+
}) : n, C = (param)=>{
|
|
81
|
+
let { items: n, isEven: o } = param;
|
|
80
82
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
81
83
|
className: n.length === 1 ? _mosaiccssmistica.singleItemRowContainer : _mosaiccssmistica.squareContainer,
|
|
82
84
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.Grid, {
|
|
83
|
-
gap:
|
|
85
|
+
gap: u,
|
|
84
86
|
rows: 2,
|
|
85
87
|
columns: 2,
|
|
86
88
|
height: "100%",
|
|
87
89
|
children: n.length === 3 ? /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
88
90
|
children: [
|
|
89
91
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.GridItem, {
|
|
90
|
-
columnSpan:
|
|
91
|
-
children: n[0]
|
|
92
|
+
columnSpan: o ? 2 : void 0,
|
|
93
|
+
children: t(n[0], o ? "horizontal" : "square")
|
|
92
94
|
}),
|
|
93
95
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.GridItem, {
|
|
94
|
-
children: n[1]
|
|
96
|
+
children: t(n[1], "square")
|
|
95
97
|
}),
|
|
96
98
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.GridItem, {
|
|
97
|
-
columnSpan:
|
|
98
|
-
children: n[2]
|
|
99
|
+
columnSpan: o ? void 0 : 2,
|
|
100
|
+
children: t(n[2], o ? "square" : "horizontal")
|
|
99
101
|
})
|
|
100
102
|
]
|
|
101
|
-
}) : n.map((a,
|
|
103
|
+
}) : n.map((a, s)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.GridItem, {
|
|
102
104
|
columnSpan: n.length === 4 ? void 0 : 2,
|
|
103
105
|
rowSpan: n.length === 1 ? 2 : void 0,
|
|
104
|
-
children: a
|
|
105
|
-
},
|
|
106
|
+
children: t(a, n.length === 4 ? "square" : "horizontal")
|
|
107
|
+
}, s))
|
|
106
108
|
})
|
|
107
109
|
});
|
|
108
|
-
},
|
|
109
|
-
let { items: n, withBullets:
|
|
110
|
-
const c = n.length,
|
|
111
|
-
length:
|
|
110
|
+
}, G = (param)=>{
|
|
111
|
+
let { items: n, withBullets: o, free: a, dataAttributes: s } = param;
|
|
112
|
+
const c = n.length, l = c < 5 ? Math.min(c, 1) : Math.floor((c + 1) / 3), h = Array.from({
|
|
113
|
+
length: l
|
|
112
114
|
}, ()=>[]);
|
|
113
|
-
return n.forEach((
|
|
114
|
-
const
|
|
115
|
-
|
|
115
|
+
return n.forEach((d, p)=>{
|
|
116
|
+
const M = Math.min(l - 1, Math.floor(p / 3));
|
|
117
|
+
h[M].push(d);
|
|
116
118
|
}), /* @__PURE__ */ (0, _jsxruntime.jsx)(_carousel.Carousel, {
|
|
117
|
-
dataAttributes: _object_spread_props(_object_spread({},
|
|
119
|
+
dataAttributes: _object_spread_props(_object_spread({}, s), {
|
|
118
120
|
"component-name": "HorizontalMosaic"
|
|
119
121
|
}),
|
|
120
|
-
items:
|
|
122
|
+
items: h.map((d, p)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.Grid, {
|
|
121
123
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(C, {
|
|
122
|
-
items:
|
|
124
|
+
items: d,
|
|
123
125
|
isEven: p % 2 === 0
|
|
124
126
|
}, p)
|
|
125
127
|
})),
|
|
126
|
-
withBullets:
|
|
128
|
+
withBullets: o,
|
|
127
129
|
free: a
|
|
128
130
|
});
|
|
129
131
|
}, S = (param)=>{
|
|
@@ -134,12 +136,12 @@ const d = {
|
|
|
134
136
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
135
137
|
className: _mosaiccssmistica.singleItemRowContainer,
|
|
136
138
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.Grid, {
|
|
137
|
-
gap:
|
|
139
|
+
gap: u,
|
|
138
140
|
columns: 2,
|
|
139
141
|
height: "100%",
|
|
140
|
-
children: n.map((
|
|
142
|
+
children: n.map((o, a)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.GridItem, {
|
|
141
143
|
columnSpan: n.length === 2 ? void 0 : 2,
|
|
142
|
-
children:
|
|
144
|
+
children: t(o, n.length === 2 ? "square" : "horizontal")
|
|
143
145
|
}, a))
|
|
144
146
|
})
|
|
145
147
|
});
|
|
@@ -147,13 +149,13 @@ const d = {
|
|
|
147
149
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
148
150
|
className: _mosaiccssmistica.squareContainer,
|
|
149
151
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.Grid, {
|
|
150
|
-
gap:
|
|
152
|
+
gap: u,
|
|
151
153
|
columns: 2,
|
|
152
154
|
flow: "column",
|
|
153
155
|
height: "100%",
|
|
154
|
-
children: n.map((
|
|
156
|
+
children: n.map((o, a)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.GridItem, {
|
|
155
157
|
rowSpan: a === 0 ? 2 : void 0,
|
|
156
|
-
children:
|
|
158
|
+
children: t(o, a === 0 ? "vertical" : "square")
|
|
157
159
|
}, a))
|
|
158
160
|
})
|
|
159
161
|
});
|
|
@@ -162,45 +164,45 @@ const d = {
|
|
|
162
164
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
163
165
|
className: _mosaiccssmistica.fourItemsContainer,
|
|
164
166
|
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_grid.Grid, {
|
|
165
|
-
gap:
|
|
167
|
+
gap: u,
|
|
166
168
|
rows: 3,
|
|
167
169
|
columns: 2,
|
|
168
170
|
height: "100%",
|
|
169
171
|
children: [
|
|
170
172
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.GridItem, {
|
|
171
173
|
rowSpan: 2,
|
|
172
|
-
children: n[0]
|
|
174
|
+
children: t(n[0], "vertical")
|
|
173
175
|
}),
|
|
174
176
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.GridItem, {
|
|
175
|
-
children: n[1]
|
|
177
|
+
children: t(n[1], "square")
|
|
176
178
|
}),
|
|
177
179
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.GridItem, {
|
|
178
180
|
rowSpan: 2,
|
|
179
|
-
children: n[3]
|
|
181
|
+
children: t(n[3], "vertical")
|
|
180
182
|
}),
|
|
181
183
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.GridItem, {
|
|
182
|
-
children: n[2]
|
|
184
|
+
children: t(n[2], "square")
|
|
183
185
|
})
|
|
184
186
|
]
|
|
185
187
|
})
|
|
186
188
|
});
|
|
187
189
|
}
|
|
188
|
-
},
|
|
189
|
-
let { items: n, dataAttributes:
|
|
190
|
-
const a = n.length,
|
|
191
|
-
length:
|
|
190
|
+
}, N = (param)=>{
|
|
191
|
+
let { items: n, dataAttributes: o } = param;
|
|
192
|
+
const a = n.length, s = Math.ceil(a / 4), c = Array.from({
|
|
193
|
+
length: s
|
|
192
194
|
}, ()=>[]);
|
|
193
|
-
return n.forEach((
|
|
194
|
-
const
|
|
195
|
-
c[
|
|
195
|
+
return n.forEach((l, h)=>{
|
|
196
|
+
const d = Math.floor(h / 4);
|
|
197
|
+
c[d].push(l);
|
|
196
198
|
}), /* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.Grid, {
|
|
197
199
|
rows: 1,
|
|
198
|
-
gap:
|
|
199
|
-
dataAttributes: _object_spread_props(_object_spread({},
|
|
200
|
+
gap: u,
|
|
201
|
+
dataAttributes: _object_spread_props(_object_spread({}, o), {
|
|
200
202
|
"component-name": "VerticalMosaic"
|
|
201
203
|
}),
|
|
202
|
-
children: c.map((
|
|
203
|
-
items:
|
|
204
|
-
},
|
|
204
|
+
children: c.map((l, h)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(S, {
|
|
205
|
+
items: l
|
|
206
|
+
}, h))
|
|
205
207
|
});
|
|
206
208
|
};
|